From b9d86aa5afb25f9fa71162bee5a70213156c3695 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 28 Jul 2022 21:29:02 +1000 Subject: [PATCH 1/5] fix classes that inherit from BackboneType in R4B --- .../org/hl7/fhir/r4b/formats/JsonParser.java | 47 ++++++++++++++----- .../org/hl7/fhir/r4b/formats/RdfParser.java | 23 ++++++--- .../org/hl7/fhir/r4b/formats/XmlParser.java | 45 ++++++++++++------ .../java/org/hl7/fhir/r4b/model/Dosage.java | 2 +- .../hl7/fhir/r4b/model/ElementDefinition.java | 2 +- .../hl7/fhir/r4b/model/MarketingStatus.java | 2 +- .../org/hl7/fhir/r4b/model/Population.java | 2 +- .../fhir/r4b/model/ProdCharacteristic.java | 2 +- .../hl7/fhir/r4b/model/ProductShelfLife.java | 2 +- .../java/org/hl7/fhir/r4b/model/Timing.java | 2 +- 10 files changed, 88 insertions(+), 41 deletions(-) diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/JsonParser.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/JsonParser.java index 77e84ca68..760dc5a69 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/JsonParser.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/JsonParser.java @@ -201,6 +201,17 @@ public class JsonParser extends JsonParserBase { }; } + + protected void parseBackboneTypeProperties(JsonObject json, BackboneType res) throws IOException, FHIRFormatError { + parseDataTypeProperties(json, res); + if (json.has("modifierExtension")) { + JsonArray array = getJArray(json, "modifierExtension"); + for (int i = 0; i < array.size(); i++) { + res.getModifierExtension().add(parseExtension(array.get(i).getAsJsonObject())); + } + }; + } + protected void parseDataTypeProperties(JsonObject json, DataType res) throws IOException, FHIRFormatError { parseElementProperties(json, res); } @@ -648,7 +659,7 @@ public class JsonParser extends JsonParserBase { } protected void parseDosageProperties(JsonObject json, Dosage res) throws IOException, FHIRFormatError { - parseDataTypeProperties(json, res); + parseBackboneTypeProperties(json, res); if (json.has("sequence")) res.setSequenceElement(parseInteger(json.get("sequence").getAsLong())); if (json.has("_sequence")) @@ -1319,7 +1330,7 @@ public class JsonParser extends JsonParserBase { } protected void parseMarketingStatusProperties(JsonObject json, MarketingStatus res) throws IOException, FHIRFormatError { - parseDataTypeProperties(json, res); + parseBackboneTypeProperties(json, res); if (json.has("country")) res.setCountry(parseCodeableConcept(getJObject(json, "country"))); if (json.has("jurisdiction")) @@ -1484,7 +1495,7 @@ public class JsonParser extends JsonParserBase { } protected void parsePopulationProperties(JsonObject json, Population res) throws IOException, FHIRFormatError { - parseDataTypeProperties(json, res); + parseBackboneTypeProperties(json, res); DataType age = parseType("age", json); if (age != null) res.setAge(age); @@ -1503,7 +1514,7 @@ public class JsonParser extends JsonParserBase { } protected void parseProdCharacteristicProperties(JsonObject json, ProdCharacteristic res) throws IOException, FHIRFormatError { - parseDataTypeProperties(json, res); + parseBackboneTypeProperties(json, res); if (json.has("height")) res.setHeight(parseQuantity(getJObject(json, "height"))); if (json.has("width")) @@ -1575,7 +1586,7 @@ public class JsonParser extends JsonParserBase { } protected void parseProductShelfLifeProperties(JsonObject json, ProductShelfLife res) throws IOException, FHIRFormatError { - parseDataTypeProperties(json, res); + parseBackboneTypeProperties(json, res); if (json.has("type")) res.setType(parseCodeableConcept(getJObject(json, "type"))); DataType period = parseType("period", json); @@ -1802,7 +1813,7 @@ public class JsonParser extends JsonParserBase { } protected void parseTimingProperties(JsonObject json, Timing res) throws IOException, FHIRFormatError { - parseDataTypeProperties(json, res); + parseBackboneTypeProperties(json, res); if (json.has("event")) { JsonArray array = getJArray(json, "event"); for (int i = 0; i < array.size(); i++) { @@ -30250,6 +30261,16 @@ public class JsonParser extends JsonParserBase { }; } + protected void composeBackboneTypeProperties(BackboneType element) throws IOException { + composeDataTypeProperties(element); + if (element.hasModifierExtension()) { + openArray("modifierExtension"); + for (Extension e : element.getModifierExtension()) + composeExtension(null, e); + closeArray(); + }; + } + protected void composeDataTypeProperties(DataType element) throws IOException { composeElementProperties(element); } @@ -30720,7 +30741,7 @@ public class JsonParser extends JsonParserBase { } protected void composeDosageProperties(Dosage element) throws IOException { - composeDataTypeProperties(element); + composeBackboneTypeProperties(element); if (element.hasSequenceElement()) { composeIntegerCore("sequence", element.getSequenceElement(), false); composeIntegerExtras("sequence", element.getSequenceElement(), false); @@ -30813,7 +30834,7 @@ public class JsonParser extends JsonParserBase { } protected void composeElementDefinitionProperties(ElementDefinition element) throws IOException { - composeDataTypeProperties(element); + composeBackboneTypeProperties(element); if (element.hasPathElement()) { composeStringCore("path", element.getPathElement(), false); composeStringExtras("path", element.getPathElement(), false); @@ -31389,7 +31410,7 @@ public class JsonParser extends JsonParserBase { } protected void composeMarketingStatusProperties(MarketingStatus element) throws IOException { - composeDataTypeProperties(element); + composeBackboneTypeProperties(element); if (element.hasCountry()) { composeCodeableConcept("country", element.getCountry()); } @@ -31570,7 +31591,7 @@ public class JsonParser extends JsonParserBase { } protected void composePopulationProperties(Population element) throws IOException { - composeDataTypeProperties(element); + composeBackboneTypeProperties(element); if (element.hasAge()) { composeType("age", element.getAge()); } @@ -31594,7 +31615,7 @@ public class JsonParser extends JsonParserBase { } protected void composeProdCharacteristicProperties(ProdCharacteristic element) throws IOException { - composeDataTypeProperties(element); + composeBackboneTypeProperties(element); if (element.hasHeight()) { composeQuantity("height", element.getHeight()); } @@ -31665,7 +31686,7 @@ public class JsonParser extends JsonParserBase { } protected void composeProductShelfLifeProperties(ProductShelfLife element) throws IOException { - composeDataTypeProperties(element); + composeBackboneTypeProperties(element); if (element.hasType()) { composeCodeableConcept("type", element.getType()); } @@ -31923,7 +31944,7 @@ public class JsonParser extends JsonParserBase { } protected void composeTimingProperties(Timing element) throws IOException { - composeDataTypeProperties(element); + composeBackboneTypeProperties(element); if (element.hasEvent()) { if (anyHasValue(element.getEvent())) { openArray("event"); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/RdfParser.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/RdfParser.java index 16dff006f..2f61f2e0a 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/RdfParser.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/RdfParser.java @@ -245,6 +245,15 @@ public class RdfParser extends RdfParserBase { composeDataType(t, parentType, name, element, index); } + + protected void composeBackboneType(Complex t, String parentType, String name, BackboneType element, int index) { + composeDataType(t, parentType, name, element, index); + for (int i = 0; i < element.getModifierExtension().size(); i++) { + composeExtension(t, "BackboneElement", "modifierExtension", element.getModifierExtension().get(i), i); + } + } + + protected void composeAddress(Complex parent, String parentType, String name, Address element, int index) { if (element == null) return; @@ -619,7 +628,7 @@ public class RdfParser extends RdfParserBase { else { t = parent.predicate("fhir:"+parentType+'.'+name); } - composeDataType(t, "Dosage", name, element, index); + composeBackboneType(t, "Dosage", name, element, index); if (element.hasSequenceElement()) { composeInteger(t, "Dosage", "sequence", element.getSequenceElement(), -1); } @@ -703,7 +712,7 @@ public class RdfParser extends RdfParserBase { else { t = parent.predicate("fhir:"+parentType+'.'+name); } - composeDataType(t, "ElementDefinition", name, element, index); + composeBackboneType(t, "ElementDefinition", name, element, index); if (element.hasPathElement()) { composeString(t, "ElementDefinition", "path", element.getPathElement(), -1); } @@ -1111,7 +1120,7 @@ public class RdfParser extends RdfParserBase { else { t = parent.predicate("fhir:"+parentType+'.'+name); } - composeDataType(t, "MarketingStatus", name, element, index); + composeBackboneType(t, "MarketingStatus", name, element, index); if (element.hasCountry()) { composeCodeableConcept(t, "MarketingStatus", "country", element.getCountry(), -1); } @@ -1255,7 +1264,7 @@ public class RdfParser extends RdfParserBase { else { t = parent.predicate("fhir:"+parentType+'.'+name); } - composeDataType(t, "Population", name, element, index); + composeBackboneType(t, "Population", name, element, index); if (element.hasAge()) { composeType(t, "Population", "age", element.getAge(), -1); } @@ -1279,7 +1288,7 @@ public class RdfParser extends RdfParserBase { else { t = parent.predicate("fhir:"+parentType+'.'+name); } - composeDataType(t, "ProdCharacteristic", name, element, index); + composeBackboneType(t, "ProdCharacteristic", name, element, index); if (element.hasHeight()) { composeQuantity(t, "ProdCharacteristic", "height", element.getHeight(), -1); } @@ -1324,7 +1333,7 @@ public class RdfParser extends RdfParserBase { else { t = parent.predicate("fhir:"+parentType+'.'+name); } - composeDataType(t, "ProductShelfLife", name, element, index); + composeBackboneType(t, "ProductShelfLife", name, element, index); if (element.hasType()) { composeCodeableConcept(t, "ProductShelfLife", "type", element.getType(), -1); } @@ -1552,7 +1561,7 @@ public class RdfParser extends RdfParserBase { else { t = parent.predicate("fhir:"+parentType+'.'+name); } - composeDataType(t, "Timing", name, element, index); + composeBackboneType(t, "Timing", name, element, index); for (int i = 0; i < element.getEvent().size(); i++) { composeDateTime(t, "Timing", "event", element.getEvent().get(i), i); } diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/XmlParser.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/XmlParser.java index 23c2717a2..e10130cf8 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/XmlParser.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/formats/XmlParser.java @@ -392,6 +392,15 @@ public class XmlParser extends XmlParserBase { return true; } + protected boolean parseBackboneTypeContent(int eventType, XmlPullParser xpp, BackboneType res) throws XmlPullParserException, IOException, FHIRFormatError { + if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) { + res.getModifierExtension().add(parseExtension(xpp)); + } else if (!parseDataTypeContent(eventType, xpp, res)){ + return false; + } + return true; + } + protected boolean parseDataTypeContent(int eventType, XmlPullParser xpp, DataType res) throws XmlPullParserException, IOException, FHIRFormatError { if (!parseElementContent(eventType, xpp, res)){ return false; @@ -907,7 +916,7 @@ public class XmlParser extends XmlParserBase { res.setMaxDosePerAdministration(parseQuantity(xpp)); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerLifetime")) { res.setMaxDosePerLifetime(parseQuantity(xpp)); - } else if (!parseDataTypeContent(eventType, xpp, res)){ + } else if (!parseBackboneTypeContent(eventType, xpp, res)){ return false; } return true; @@ -1047,7 +1056,7 @@ public class XmlParser extends XmlParserBase { res.setBinding(parseElementDefinitionBindingComponent(xpp)); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) { res.getMapping().add(parseElementDefinitionMappingComponent(xpp)); - } else if (!parseDataTypeContent(eventType, xpp, res)){ + } else if (!parseBackboneTypeContent(eventType, xpp, res)){ return false; } return true; @@ -1443,7 +1452,7 @@ public class XmlParser extends XmlParserBase { res.setDateRange(parsePeriod(xpp)); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("restoreDate")) { res.setRestoreDateElement(parseDateTime(xpp)); - } else if (!parseDataTypeContent(eventType, xpp, res)){ + } else if (!parseBackboneTypeContent(eventType, xpp, res)){ return false; } return true; @@ -1621,7 +1630,7 @@ public class XmlParser extends XmlParserBase { res.setRace(parseCodeableConcept(xpp)); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("physiologicalCondition")) { res.setPhysiologicalCondition(parseCodeableConcept(xpp)); - } else if (!parseDataTypeContent(eventType, xpp, res)){ + } else if (!parseBackboneTypeContent(eventType, xpp, res)){ return false; } return true; @@ -1665,7 +1674,7 @@ public class XmlParser extends XmlParserBase { res.getImage().add(parseAttachment(xpp)); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("scoring")) { res.setScoring(parseCodeableConcept(xpp)); - } else if (!parseDataTypeContent(eventType, xpp, res)){ + } else if (!parseBackboneTypeContent(eventType, xpp, res)){ return false; } return true; @@ -1693,7 +1702,7 @@ public class XmlParser extends XmlParserBase { res.setPeriod(parseType("period", xpp)); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialPrecautionsForStorage")) { res.getSpecialPrecautionsForStorage().add(parseCodeableConcept(xpp)); - } else if (!parseDataTypeContent(eventType, xpp, res)){ + } else if (!parseBackboneTypeContent(eventType, xpp, res)){ return false; } return true; @@ -1971,7 +1980,7 @@ public class XmlParser extends XmlParserBase { res.setRepeat(parseTimingRepeatComponent(xpp)); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) { res.setCode(parseCodeableConcept(xpp)); - } else if (!parseDataTypeContent(eventType, xpp, res)){ + } else if (!parseBackboneTypeContent(eventType, xpp, res)){ return false; } return true; @@ -26548,6 +26557,14 @@ public class XmlParser extends XmlParserBase { composeExtension("modifierExtension", e); } } + + protected void composeBackboneTypeElements(BackboneType element) throws IOException { + composeDataTypeElements(element); + if (element.hasModifierExtension()) { + for (Extension e : element.getModifierExtension()) + composeExtension("modifierExtension", e); + } + } protected void composeDataTypeElements(DataType element) throws IOException { composeElementElements(element); @@ -26959,7 +26976,7 @@ public class XmlParser extends XmlParserBase { } protected void composeDosageElements(Dosage element) throws IOException { - composeDataTypeElements(element); + composeBackboneTypeElements(element); if (element.hasSequenceElement()) { composeInteger("sequence", element.getSequenceElement()); } @@ -27048,7 +27065,7 @@ public class XmlParser extends XmlParserBase { } protected void composeElementDefinitionElements(ElementDefinition element) throws IOException { - composeDataTypeElements(element); + composeBackboneTypeElements(element); if (element.hasPathElement()) { composeString("path", element.getPathElement()); } @@ -27480,7 +27497,7 @@ public class XmlParser extends XmlParserBase { } protected void composeMarketingStatusElements(MarketingStatus element) throws IOException { - composeDataTypeElements(element); + composeBackboneTypeElements(element); if (element.hasCountry()) { composeCodeableConcept("country", element.getCountry()); } @@ -27636,7 +27653,7 @@ public class XmlParser extends XmlParserBase { } protected void composePopulationElements(Population element) throws IOException { - composeDataTypeElements(element); + composeBackboneTypeElements(element); if (element.hasAge()) { composeType("age", element.getAge()); } if (element.hasGender()) { @@ -27661,7 +27678,7 @@ public class XmlParser extends XmlParserBase { } protected void composeProdCharacteristicElements(ProdCharacteristic element) throws IOException { - composeDataTypeElements(element); + composeBackboneTypeElements(element); if (element.hasHeight()) { composeQuantity("height", element.getHeight()); } @@ -27711,7 +27728,7 @@ public class XmlParser extends XmlParserBase { } protected void composeProductShelfLifeElements(ProductShelfLife element) throws IOException { - composeDataTypeElements(element); + composeBackboneTypeElements(element); if (element.hasType()) { composeCodeableConcept("type", element.getType()); } @@ -27956,7 +27973,7 @@ public class XmlParser extends XmlParserBase { } protected void composeTimingElements(Timing element) throws IOException { - composeDataTypeElements(element); + composeBackboneTypeElements(element); if (element.hasEvent()) { for (DateTimeType e : element.getEvent()) composeDateTime("event", e); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Dosage.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Dosage.java index 606ce3f2a..8713872bc 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Dosage.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Dosage.java @@ -49,7 +49,7 @@ import ca.uhn.fhir.model.api.annotation.Block; * Base StructureDefinition for Dosage Type: Indicates how the medication is/was taken or should be taken by the patient. */ @DatatypeDef(name="Dosage") -public class Dosage extends DataType implements ICompositeType { +public class Dosage extends BackboneType implements ICompositeType { @Block() public static class DosageDoseAndRateComponent extends Element implements IBaseDatatypeElement { diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ElementDefinition.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ElementDefinition.java index ecd94f64d..7a94ef0ea 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ElementDefinition.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ElementDefinition.java @@ -55,7 +55,7 @@ import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; * Base StructureDefinition for ElementDefinition Type: Captures constraints on each element within the resource, profile, or extension. */ @DatatypeDef(name="ElementDefinition") -public class ElementDefinition extends DataType implements ICompositeType { +public class ElementDefinition extends BackboneType implements ICompositeType { public enum AggregationMode { /** diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/MarketingStatus.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/MarketingStatus.java index 75dbda888..74656503d 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/MarketingStatus.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/MarketingStatus.java @@ -48,7 +48,7 @@ import ca.uhn.fhir.model.api.annotation.Block; * Base StructureDefinition for MarketingStatus Type: The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. */ @DatatypeDef(name="MarketingStatus") -public class MarketingStatus extends DataType implements ICompositeType { +public class MarketingStatus extends BackboneType implements ICompositeType { /** * The country in which the marketing authorisation has been granted shall be specified It should be specified using the ISO 3166 ‑ 1 alpha-2 code elements. diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Population.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Population.java index 5ecba8d0d..014451d64 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Population.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Population.java @@ -48,7 +48,7 @@ import ca.uhn.fhir.model.api.annotation.Block; * Base StructureDefinition for Population Type: A populatioof people with some set of grouping criteria. */ @DatatypeDef(name="Population") -public class Population extends DataType implements ICompositeType { +public class Population extends BackboneType implements ICompositeType { /** * The age of the specific population. diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ProdCharacteristic.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ProdCharacteristic.java index 90bc7d83f..685c1b57c 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ProdCharacteristic.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ProdCharacteristic.java @@ -49,7 +49,7 @@ import ca.uhn.fhir.model.api.annotation.Block; * Base StructureDefinition for ProdCharacteristic Type: The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. */ @DatatypeDef(name="ProdCharacteristic") -public class ProdCharacteristic extends DataType implements ICompositeType { +public class ProdCharacteristic extends BackboneType implements ICompositeType { /** * Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ProductShelfLife.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ProductShelfLife.java index 4340090c4..af0cfd42d 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ProductShelfLife.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/ProductShelfLife.java @@ -48,7 +48,7 @@ import ca.uhn.fhir.model.api.annotation.Block; * Base StructureDefinition for ProductShelfLife Type: The shelf-life and storage information for a medicinal product item or container can be described using this class. */ @DatatypeDef(name="ProductShelfLife") -public class ProductShelfLife extends DataType implements ICompositeType { +public class ProductShelfLife extends BackboneType implements ICompositeType { /** * This describes the shelf life, taking into account various scenarios such as shelf life of the packaged Medicinal Product itself, shelf life after transformation where necessary and shelf life after the first opening of a bottle, etc. The shelf life type shall be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified. diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Timing.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Timing.java index aac5a2cc1..94bccdf34 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Timing.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/Timing.java @@ -50,7 +50,7 @@ import ca.uhn.fhir.model.api.annotation.Block; * Base StructureDefinition for Timing Type: Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out. */ @DatatypeDef(name="Timing") -public class Timing extends DataType implements ICompositeType { +public class Timing extends BackboneType implements ICompositeType { public enum EventTiming { /** From 780be4096a1c4f0c6476ad4f26f5e5cb40b19e51 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 28 Jul 2022 21:29:33 +1000 Subject: [PATCH 2/5] fix rendering note - more informative --- .../java/org/hl7/fhir/r4b/renderers/ProfileDrivenRenderer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/ProfileDrivenRenderer.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/ProfileDrivenRenderer.java index 904390fb8..fe4d47612 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/ProfileDrivenRenderer.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/ProfileDrivenRenderer.java @@ -104,7 +104,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer { @Override public boolean render(XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException { if (context.isAddGeneratedNarrativeHeader()) { - x.para().b().tx("Generated Narrative"); + x.para().b().tx("Generated Narrative: "+r.fhirType()); } if (context.isTechnicalMode()) { renderResourceHeader(r, x); From 1ac49bdce2f955930b0d6a894423d0e2cbb6b4fc Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 28 Jul 2022 21:30:12 +1000 Subject: [PATCH 3/5] Add R4B / R5 Conversions --- .../advisors/impl/BaseAdvisor_43_50.java | 33 + .../advisors/interfaces/BaseAdvisor43.java | 81 + .../context/ConversionContext43_50.java | 53 + .../conv43_50/VersionConvertor_43_50.java | 143 + .../datatypes43_50/BackboneElement43_50.java | 35 + .../datatypes43_50/BackboneType43_50.java | 35 + .../datatypes43_50/Element43_50.java | 56 + .../conv43_50/datatypes43_50/Type43_50.java | 256 ++ .../general43_50/Address43_50.java | 153 + .../datatypes43_50/general43_50/Age43_50.java | 19 + .../general43_50/Annotation43_50.java | 30 + .../general43_50/Attachment43_50.java | 37 + .../general43_50/CodeableConcept43_50.java | 32 + .../general43_50/Coding43_50.java | 34 + .../general43_50/ContactPoint43_50.java | 168 + .../general43_50/Count43_50.java | 19 + .../general43_50/Distance43_50.java | 19 + .../general43_50/Duration43_50.java | 19 + .../general43_50/HumanName43_50.java | 109 + .../general43_50/Identifier43_50.java | 97 + .../general43_50/Money43_50.java | 26 + .../general43_50/MoneyQuantity43_50.java | 13 + .../general43_50/Period43_50.java | 25 + .../general43_50/Quantity43_50.java | 110 + .../general43_50/Range43_50.java | 24 + .../general43_50/Ratio43_50.java | 24 + .../general43_50/SampledData43_50.java | 37 + .../general43_50/Signature43_50.java | 38 + .../general43_50/SimpleQuantity43_50.java | 13 + .../general43_50/Timing43_50.java | 417 +++ .../metadata43_50/ContactDetail43_50.java | 28 + .../metadata43_50/Contributor43_50.java | 85 + .../metadata43_50/DataRequirement43_50.java | 181 ++ .../metadata43_50/Expression43_50.java | 34 + .../ParameterDefinition43_50.java | 82 + .../metadata43_50/RelatedArtifact43_50.java | 119 + .../metadata43_50/TriggerDefinition43_50.java | 115 + .../metadata43_50/UsageContext43_50.java | 27 + .../primitive43_50/Base64Binary43_50.java | 18 + .../primitive43_50/Boolean43_50.java | 18 + .../primitive43_50/Canonical43_50.java | 18 + .../primitive43_50/Code43_50.java | 26 + .../primitive43_50/Date43_50.java | 33 + .../primitive43_50/DateTime43_50.java | 18 + .../primitive43_50/Decimal43_50.java | 18 + .../primitive43_50/Id43_50.java | 18 + .../primitive43_50/Instant43_50.java | 18 + .../primitive43_50/Integer43_50.java | 18 + .../primitive43_50/MarkDown43_50.java | 24 + .../primitive43_50/Oid43_50.java | 18 + .../primitive43_50/PositiveInt43_50.java | 18 + .../primitive43_50/String43_50.java | 34 + .../primitive43_50/Time43_50.java | 18 + .../primitive43_50/UnsignedInt43_50.java | 30 + .../primitive43_50/Uri43_50.java | 18 + .../primitive43_50/Url43_50.java | 18 + .../primitive43_50/Uuid43_50.java | 18 + .../special43_50/Dosage43_50.java | 95 + .../special43_50/ElementDefinition43_50.java | 618 ++++ .../special43_50/Extension43_50.java | 27 + .../special43_50/Meta43_50.java | 39 + .../special43_50/Narrative43_50.java | 80 + .../special43_50/Reference43_50.java | 38 + .../special43_50/xhtml43_50.java | 9 + .../resources43_50/Account43_50.java | 209 ++ .../ActivityDefinition43_50.java | 590 ++++ .../AllergyIntolerance43_50.java | 353 +++ .../resources43_50/Appointment43_50.java | 377 +++ .../AppointmentResponse43_50.java | 139 + .../resources43_50/AuditEvent43_50.java | 396 +++ .../conv43_50/resources43_50/Basic43_50.java | 76 + .../conv43_50/resources43_50/Binary43_50.java | 67 + .../BiologicallyDerivedProduct43_50.java | 353 +++ .../resources43_50/BodyStructure43_50.java | 88 + .../conv43_50/resources43_50/Bundle43_50.java | 429 +++ .../CapabilityStatement43_50.java | 1076 +++++++ .../resources43_50/CarePlan43_50.java | 527 ++++ .../resources43_50/CareTeam43_50.java | 192 ++ .../resources43_50/ChargeItem43_50.java | 245 ++ .../ChargeItemDefinition43_50.java | 294 ++ .../conv43_50/resources43_50/Claim43_50.java | 739 +++++ .../resources43_50/ClaimResponse43_50.java | 775 +++++ .../ClinicalImpression43_50.java | 201 ++ .../resources43_50/CodeSystem43_50.java | 576 ++++ .../resources43_50/Communication43_50.java | 308 ++ .../CommunicationRequest43_50.java | 303 ++ .../CompartmentDefinition43_50.java | 193 ++ .../resources43_50/Composition43_50.java | 444 +++ .../resources43_50/ConceptMap43_50.java | 456 +++ .../resources43_50/Condition43_50.java | 191 ++ .../resources43_50/Consent43_50.java | 408 +++ .../resources43_50/Contract43_50.java | 997 ++++++ .../resources43_50/Coverage43_50.java | 251 ++ .../CoverageEligibilityRequest43_50.java | 351 +++ .../resources43_50/DetectedIssue43_50.java | 272 ++ .../conv43_50/resources43_50/Device43_50.java | 461 +++ .../resources43_50/DeviceDefinition43_50.java | 340 +++ .../resources43_50/DeviceMetric43_50.java | 399 +++ .../resources43_50/DeviceRequest43_50.java | 379 +++ .../DeviceUseStatement43_50.java | 170 ++ .../resources43_50/DiagnosticReport43_50.java | 232 ++ .../resources43_50/DocumentManifest43_50.java | 124 + .../DocumentReference43_50.java | 297 ++ .../resources43_50/Encounter43_50.java | 455 +++ .../resources43_50/Endpoint43_50.java | 161 + .../EnrollmentRequest43_50.java | 133 + .../resources43_50/Enumerations43_50.java | 558 ++++ .../resources43_50/EpisodeOfCare43_50.java | 221 ++ .../resources43_50/EventDefinition43_50.java | 172 ++ .../resources43_50/ExampleScenario43_50.java | 436 +++ .../ExplanationOfBenefit43_50.java | 1255 ++++++++ .../FamilyMemberHistory43_50.java | 214 ++ .../conv43_50/resources43_50/Flag43_50.java | 132 + .../conv43_50/resources43_50/Goal43_50.java | 225 ++ .../resources43_50/GraphDefinition43_50.java | 372 +++ .../conv43_50/resources43_50/Group43_50.java | 221 ++ .../resources43_50/GuidanceResponse43_50.java | 181 ++ .../HealthcareService43_50.java | 302 ++ .../resources43_50/ImagingStudy43_50.java | 316 ++ .../resources43_50/Immunization43_50.java | 335 ++ .../ImmunizationEvaluation43_50.java | 147 + .../ImmunizationRecommendation43_50.java | 165 + .../ImplementationGuide43_50.java | 2694 +++++++++++++++++ .../resources43_50/InsurancePlan43_50.java | 367 +++ .../resources43_50/Invoice43_50.java | 322 ++ .../resources43_50/Library43_50.java | 180 ++ .../resources43_50/Linkage43_50.java | 134 + .../resources43_50/ListResource43_50.java | 229 ++ .../resources43_50/Location43_50.java | 336 ++ .../resources43_50/MarketingStatus43_50.java | 33 + .../resources43_50/Measure43_50.java | 376 +++ .../resources43_50/MeasureReport43_50.java | 366 +++ .../conv43_50/resources43_50/Media43_50.java | 178 ++ .../resources43_50/Medication43_50.java | 191 ++ .../MedicationAdministration43_50.java | 268 ++ .../MedicationDispense43_50.java | 295 ++ .../MedicationKnowledge43_50.java | 596 ++++ .../MedicationRequest43_50.java | 478 +++ .../MedicationStatement43_50.java | 203 ++ .../MessageDefinition43_50.java | 302 ++ .../resources43_50/MessageHeader43_50.java | 241 ++ .../resources43_50/NamingSystem43_50.java | 242 ++ .../resources43_50/NutritionOrder43_50.java | 470 +++ .../resources43_50/Observation43_50.java | 290 ++ .../ObservationDefinition43_50.java | 326 ++ .../OperationDefinition43_50.java | 367 +++ .../resources43_50/OperationOutcome43_50.java | 358 +++ .../resources43_50/Organization43_50.java | 122 + .../OrganizationAffiliation43_50.java | 100 + .../resources43_50/Parameters43_50.java | 89 + .../resources43_50/Patient43_50.java | 256 ++ .../resources43_50/PaymentNotice43_50.java | 156 + .../conv43_50/resources43_50/Person43_50.java | 164 + .../resources43_50/PlanDefinition43_50.java | 936 ++++++ .../resources43_50/Population43_50.java | 32 + .../resources43_50/Practitioner43_50.java | 122 + .../resources43_50/PractitionerRole43_50.java | 240 ++ .../resources43_50/Procedure43_50.java | 293 ++ .../ProdCharacteristic43_50.java | 46 + .../resources43_50/ProductShelfLife43_50.java | 30 + .../resources43_50/Provenance43_50.java | 209 ++ .../resources43_50/Questionnaire43_50.java | 541 ++++ .../QuestionnaireResponse43_50.java | 214 ++ .../resources43_50/RelatedPerson43_50.java | 122 + .../resources43_50/Resource43_50.java | 535 ++++ .../resources43_50/RiskAssessment43_50.java | 239 ++ .../resources43_50/Schedule43_50.java | 90 + .../resources43_50/SearchParameter43_50.java | 413 +++ .../resources43_50/ServiceRequest43_50.java | 380 +++ .../conv43_50/resources43_50/Slot43_50.java | 160 + .../resources43_50/Specimen43_50.java | 266 ++ .../SpecimenDefinition43_50.java | 265 ++ .../StructureDefinition43_50.java | 393 +++ .../resources43_50/StructureMap43_50.java | 871 ++++++ .../resources43_50/Substance43_50.java | 178 ++ .../resources43_50/SubstanceAmount43_50.java | 54 + .../resources43_50/SupplyDelivery43_50.java | 168 + .../resources43_50/SupplyRequest43_50.java | 270 ++ .../conv43_50/resources43_50/Task43_50.java | 474 +++ .../TerminologyCapabilities43_50.java | 488 +++ .../resources43_50/TestReport43_50.java | 524 ++++ .../resources43_50/TestScript43_50.java | 1043 +++++++ .../resources43_50/ValueSet43_50.java | 474 +++ .../VerificationResult43_50.java | 295 ++ .../VisionPrescription43_50.java | 325 ++ .../hl7/fhir/r4b/utils/ToolingExtensions.java | 3 + 186 files changed, 45832 insertions(+) create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/advisors/impl/BaseAdvisor_43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/advisors/interfaces/BaseAdvisor43.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/context/ConversionContext43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/VersionConvertor_43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/BackboneElement43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/BackboneType43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/Element43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/Type43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Address43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Age43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Annotation43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Attachment43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/CodeableConcept43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Coding43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/ContactPoint43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Count43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Distance43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Duration43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/HumanName43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Identifier43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Money43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/MoneyQuantity43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Period43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Quantity43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Range43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Ratio43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/SampledData43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Signature43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/SimpleQuantity43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Timing43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ContactDetail43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Contributor43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/DataRequirement43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Expression43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ParameterDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/RelatedArtifact43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/TriggerDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/UsageContext43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Base64Binary43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Boolean43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Canonical43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Code43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Date43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/DateTime43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Decimal43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Id43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Instant43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Integer43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/MarkDown43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Oid43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/PositiveInt43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/String43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Time43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/UnsignedInt43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Uri43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Url43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Uuid43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Dosage43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/ElementDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Extension43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Meta43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Narrative43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Reference43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/xhtml43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Account43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActivityDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AllergyIntolerance43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Appointment43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AppointmentResponse43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AuditEvent43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Basic43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Binary43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/BiologicallyDerivedProduct43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/BodyStructure43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Bundle43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CapabilityStatement43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CarePlan43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CareTeam43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItem43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItemDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Claim43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClaimResponse43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClinicalImpression43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CodeSystem43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Communication43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CommunicationRequest43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CompartmentDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Composition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ConceptMap43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Condition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Consent43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Contract43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Coverage43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CoverageEligibilityRequest43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DetectedIssue43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Device43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceMetric43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceRequest43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceUseStatement43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DiagnosticReport43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentManifest43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentReference43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Encounter43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Endpoint43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EnrollmentRequest43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Enumerations43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EpisodeOfCare43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EventDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExampleScenario43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExplanationOfBenefit43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/FamilyMemberHistory43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Flag43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Goal43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GraphDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Group43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GuidanceResponse43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/HealthcareService43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImagingStudy43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Immunization43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationEvaluation43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationRecommendation43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImplementationGuide43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/InsurancePlan43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Invoice43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Library43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Linkage43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ListResource43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Location43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MarketingStatus43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Measure43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MeasureReport43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Media43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Medication43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationAdministration43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationDispense43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationKnowledge43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationRequest43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationStatement43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageHeader43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NamingSystem43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NutritionOrder43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Observation43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ObservationDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationOutcome43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Organization43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OrganizationAffiliation43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Parameters43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Patient43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PaymentNotice43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Person43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PlanDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Population43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Practitioner43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PractitionerRole43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Procedure43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ProdCharacteristic43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ProductShelfLife43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Provenance43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Questionnaire43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/QuestionnaireResponse43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/RelatedPerson43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Resource43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/RiskAssessment43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Schedule43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ServiceRequest43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Slot43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Specimen43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SpecimenDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureDefinition43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureMap43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Substance43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubstanceAmount43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyDelivery43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyRequest43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Task43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TerminologyCapabilities43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestReport43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestScript43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ValueSet43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VerificationResult43_50.java create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VisionPrescription43_50.java diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/advisors/impl/BaseAdvisor_43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/advisors/impl/BaseAdvisor_43_50.java new file mode 100644 index 000000000..e24f1c1ee --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/advisors/impl/BaseAdvisor_43_50.java @@ -0,0 +1,33 @@ +package org.hl7.fhir.convertors.advisors.impl; + +import java.util.Arrays; +import java.util.List; + +import javax.annotation.Nonnull; + +import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor50; +import org.hl7.fhir.exceptions.FHIRException; + +public class BaseAdvisor_43_50 extends BaseAdvisor50 { + + private static final List TestScriptIgnoredUrls = Arrays.asList("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestScript.scope"); + + public BaseAdvisor_43_50() { + } + + public BaseAdvisor_43_50(Boolean failFast) { + this.failFast = failFast; + } + + + @Override + public boolean ignoreExtension(@Nonnull String path, + @Nonnull String url) throws FHIRException { + List paths = Arrays.asList(path.split(",")); + if ((paths.get(paths.size() - 1).equals("TestScript")) && (TestScriptIgnoredUrls.contains(url))) { + return true; + } else + return false; + } + +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/advisors/interfaces/BaseAdvisor43.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/advisors/interfaces/BaseAdvisor43.java new file mode 100644 index 000000000..30f0f1836 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/advisors/interfaces/BaseAdvisor43.java @@ -0,0 +1,81 @@ +package org.hl7.fhir.convertors.advisors.interfaces; + +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseExtension; +import org.hl7.fhir.r4b.model.*; + +import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.List; + +public abstract class BaseAdvisor43 extends BaseAdvisor { + + private final List cslist = new ArrayList<>(); + + public final List getCslist() { + return this.cslist; + } + + public void handleCodeSystem(@Nonnull CodeSystem tgtcs, + @Nonnull ValueSet source) { + tgtcs.setId(source.getId()); + tgtcs.setValueSet(source.getUrl()); + this.cslist.add(tgtcs); + } + + public boolean ignoreEntry(@Nonnull Bundle.BundleEntryComponent src, + @Nonnull org.hl7.fhir.utilities.FhirPublication targetVersion) { + return false; + } + + public CodeSystem getCodeSystem(@Nonnull ValueSet src) throws FHIRException { + return null; + } + + public boolean ignoreExtension(@Nonnull String path, + @Nonnull Extension ext) throws FHIRException { + return ((ext.getUrl() != null) && (this.ignoreExtension(path, ext.getUrl())) + || (this.ignoreType(path, ext.getValue()))); + } + + public boolean ignoreExtension(@Nonnull String path, + @Nonnull T ext) throws FHIRException { + return ((ext.getUrl() != null) && this.ignoreExtension(path, ext.getUrl())) + || (this.ignoreType(path, ext.getValue())); + } + + public boolean ignoreExtension(@Nonnull String path, + @Nonnull String url) throws FHIRException { + return false; + } + + public boolean ignoreType(@Nonnull String path, + @Nonnull DataType type) throws FHIRException { + return false; + } + + public boolean ignoreType(@Nonnull String path, + @Nonnull Object type) throws FHIRException { + return false; + } + + public boolean useAdvisorForExtension(@Nonnull String path, + @Nonnull Extension ext) throws FHIRException { + return false; + } + + public boolean useAdvisorForExtension(@Nonnull String path, + @Nonnull T ext) throws FHIRException { + return false; + } + + public void handleExtension(@Nonnull String path, + @Nonnull Extension src, + @Nonnull T tgt) throws FHIRException { + } + + public void handleExtension(@Nonnull String path, + @Nonnull T src, + @Nonnull Extension tgt) throws FHIRException { + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/context/ConversionContext43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/context/ConversionContext43_50.java new file mode 100644 index 000000000..d67f5a213 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/context/ConversionContext43_50.java @@ -0,0 +1,53 @@ +package org.hl7.fhir.convertors.context; + +import org.hl7.fhir.convertors.conv43_50.VersionConvertor_43_50; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +public enum ConversionContext43_50 { + INSTANCE; + + private final VersionConvertorContext context = new VersionConvertorContext<>(); + + public void init(VersionConvertor_43_50 versionConvertor_43_50, String path) { + context.init(versionConvertor_43_50, path); + } + + public void close(String path) { + context.close(path); + } + + public String path() { + return context.getPath(); + } + + public VersionConvertor_43_50 getVersionConvertor_43_50() { + return context.getVersionConvertor(); + } +} \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/VersionConvertor_43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/VersionConvertor_43_50.java new file mode 100644 index 000000000..ddfe044a8 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/VersionConvertor_43_50.java @@ -0,0 +1,143 @@ +package org.hl7.fhir.convertors.conv43_50; + +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50; +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.Element43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.Type43_50; +import org.hl7.fhir.convertors.conv43_50.resources43_50.Resource43_50; +import org.hl7.fhir.exceptions.FHIRException; + +import javax.annotation.Nonnull; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * Our conversion class needs to be able to handle all the base data-types in FHIR; Resources, DomainResource, Element + */ +public class VersionConvertor_43_50 { + private final BaseAdvisor_43_50 advisor; + private final Element43_50 elementConvertor; + + private final BackboneElement43_50 backboneElementConvertor; + private final Resource43_50 resourceConvertor; + private final Type43_50 typeConvertor; + + public VersionConvertor_43_50(@Nonnull BaseAdvisor_43_50 advisor) { + this.advisor = advisor; + this.elementConvertor = new Element43_50(advisor); + this.backboneElementConvertor = new BackboneElement43_50(); + this.resourceConvertor = new Resource43_50(advisor); + this.typeConvertor = new Type43_50(advisor); + } + + public BaseAdvisor_43_50 advisor() { + return advisor; + } + + public void copyResource(@Nonnull org.hl7.fhir.r4b.model.Resource src, + @Nonnull org.hl7.fhir.r5.model.Resource tgt) throws FHIRException { + resourceConvertor.copyResource(src, tgt); + } + + public void copyResource(@Nonnull org.hl7.fhir.r5.model.Resource src, + @Nonnull org.hl7.fhir.r4b.model.Resource tgt) throws FHIRException { + resourceConvertor.copyResource(src, tgt); + } + + public org.hl7.fhir.r5.model.Resource convertResource(@Nonnull org.hl7.fhir.r4b.model.Resource src) throws FHIRException { + ConversionContext43_50.INSTANCE.init(this, src.fhirType()); + try { + return resourceConvertor.convertResource(src); + } finally { + ConversionContext43_50.INSTANCE.close(src.fhirType()); + } + } + + public org.hl7.fhir.r4b.model.Resource convertResource(@Nonnull org.hl7.fhir.r5.model.Resource src) throws FHIRException { + ConversionContext43_50.INSTANCE.init(this, src.fhirType()); + try { + return resourceConvertor.convertResource(src); + } finally { + ConversionContext43_50.INSTANCE.close(src.fhirType()); + } + } + + public org.hl7.fhir.r5.model.DataType convertType(@Nonnull org.hl7.fhir.r4b.model.DataType src) throws FHIRException { + ConversionContext43_50.INSTANCE.init(this, src.fhirType()); + try { + return typeConvertor.convertType(src); + } finally { + ConversionContext43_50.INSTANCE.close(src.fhirType()); + } + } + + public org.hl7.fhir.r4b.model.DataType convertType(@Nonnull org.hl7.fhir.r5.model.DataType src) throws FHIRException { + ConversionContext43_50.INSTANCE.init(this, src.fhirType()); + try { + return typeConvertor.convertType(src); + } finally { + ConversionContext43_50.INSTANCE.close(src.fhirType()); + } + } + + public void copyDomainResource(@Nonnull org.hl7.fhir.r4b.model.DomainResource src, + @Nonnull org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException { + resourceConvertor.copyDomainResource(src, tgt); + } + + public void copyDomainResource(@Nonnull org.hl7.fhir.r5.model.DomainResource src, + @Nonnull org.hl7.fhir.r4b.model.DomainResource tgt) throws FHIRException { + resourceConvertor.copyDomainResource(src, tgt); + } + + public void copyElement(@Nonnull org.hl7.fhir.r4b.model.Element src, + @Nonnull org.hl7.fhir.r5.model.Element tgt, + String... var) throws FHIRException { + elementConvertor.copyElement(src, tgt, ConversionContext43_50.INSTANCE.path(), var); + } + + public void copyElement(@Nonnull org.hl7.fhir.r5.model.Element src, + @Nonnull org.hl7.fhir.r4b.model.Element tgt, + String... var) throws FHIRException { + elementConvertor.copyElement(src, tgt, ConversionContext43_50.INSTANCE.path(), var); + } + + public void copyBackboneElement(@Nonnull org.hl7.fhir.r5.model.BackboneElement src, + @Nonnull org.hl7.fhir.r4b.model.BackboneElement tgt, + String... var) throws FHIRException { + backboneElementConvertor.copyBackboneElement(src, tgt, var); + } + + public void copyBackboneElement(@Nonnull org.hl7.fhir.r4b.model.BackboneElement src, + @Nonnull org.hl7.fhir.r5.model.BackboneElement tgt, + String... var) throws FHIRException { + backboneElementConvertor.copyBackboneElement(src, tgt, var); + } +} \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/BackboneElement43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/BackboneElement43_50.java new file mode 100644 index 000000000..cbef0e80d --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/BackboneElement43_50.java @@ -0,0 +1,35 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50; + +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; + +public class BackboneElement43_50 { + public static void copyBackboneElement(org.hl7.fhir.r4b.model.BackboneElement src, org.hl7.fhir.r5.model.BackboneElement tgt, String ... var) throws FHIRException { + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var); + for (org.hl7.fhir.r4b.model.Extension e : src.getModifierExtension()) { + tgt.addModifierExtension(Extension43_50.convertExtension(e)); + } + } + + public static void copyBackboneElement(org.hl7.fhir.r5.model.BackboneElement src, org.hl7.fhir.r4b.model.BackboneElement tgt, String... var) throws FHIRException { + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var); + for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) { + tgt.addModifierExtension(Extension43_50.convertExtension(e)); + } + } + + public static void copyBackboneElement(org.hl7.fhir.r5.model.BackboneType src, org.hl7.fhir.r4b.model.BackboneType tgt, String... var) throws FHIRException { + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var); + for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) { + tgt.addModifierExtension(Extension43_50.convertExtension(e)); + } + } + + public static void copyBackboneElement(org.hl7.fhir.r4b.model.BackboneType src, org.hl7.fhir.r5.model.BackboneType tgt, String... var) throws FHIRException { + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var); + for (org.hl7.fhir.r4b.model.Extension e : src.getModifierExtension()) { + tgt.addModifierExtension(Extension43_50.convertExtension(e)); + } + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/BackboneType43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/BackboneType43_50.java new file mode 100644 index 000000000..ddc7ad267 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/BackboneType43_50.java @@ -0,0 +1,35 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50; + +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; + +public class BackboneType43_50 { +// public static void copyBackboneType(org.hl7.fhir.r4b.model.BackboneElement src, org.hl7.fhir.r5.model.BackboneElement tgt, String ... var) throws FHIRException { +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var); +// for (org.hl7.fhir.r4b.model.Extension e : src.getModifierExtension()) { +// tgt.addModifierExtension(Extension43_50.convertExtension(e)); +// } +// } +// +// public static void copyBackboneType(org.hl7.fhir.r5.model.BackboneElement src, org.hl7.fhir.r4b.model.BackboneElement tgt, String... var) throws FHIRException { +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var); +// for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) { +// tgt.addModifierExtension(Extension43_50.convertExtension(e)); +// } +// } + + public static void copyBackboneType(org.hl7.fhir.r5.model.BackboneType src, org.hl7.fhir.r4b.model.BackboneType tgt, String... var) throws FHIRException { + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var); + for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) { + tgt.addModifierExtension(Extension43_50.convertExtension(e)); + } + } + + public static void copyBackboneType(org.hl7.fhir.r4b.model.BackboneType src, org.hl7.fhir.r5.model.BackboneType tgt, String... var) throws FHIRException { + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var); + for (org.hl7.fhir.r4b.model.Extension e : src.getModifierExtension()) { + tgt.addModifierExtension(Extension43_50.convertExtension(e)); + } + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/Element43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/Element43_50.java new file mode 100644 index 000000000..c76e68995 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/Element43_50.java @@ -0,0 +1,56 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50; + +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Extension43_50; +import org.hl7.fhir.exceptions.FHIRException; + +import java.util.Arrays; + +public class Element43_50 { + + public final BaseAdvisor_43_50 advisor; + + public Element43_50(BaseAdvisor_43_50 advisor) { + this.advisor = advisor; + } + + public static boolean isExemptExtension(String url, String[] extensionsToIgnore) { + return Arrays.asList(extensionsToIgnore).contains(url); + } + + public void copyElement(org.hl7.fhir.r4b.model.Element src, + org.hl7.fhir.r5.model.Element tgt, + String path, + String... extensionsToIgnore) throws FHIRException { + if (src.hasId()) tgt.setId(src.getId()); + src.getExtension().stream() + .filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore)) + .forEach(e -> { + if (advisor.useAdvisorForExtension(path, e)) { + org.hl7.fhir.r5.model.Extension convertedExtension = new org.hl7.fhir.r5.model.Extension(); + advisor.handleExtension(path, e, convertedExtension); + tgt.addExtension(convertedExtension); + } else { + tgt.addExtension(Extension43_50.convertExtension(e)); + } + }); + } + + public void copyElement(org.hl7.fhir.r5.model.Element src, + org.hl7.fhir.r4b.model.Element tgt, + String path, + String... extensionsToIgnore) throws FHIRException { + if (src.hasId()) tgt.setId(src.getId()); + src.getExtension().stream() + .filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore)) + .forEach(e -> { + if (advisor.useAdvisorForExtension(path, e)) { + org.hl7.fhir.r4b.model.Extension convertedExtension = new org.hl7.fhir.r4b.model.Extension(); + advisor.handleExtension(path, e, convertedExtension); + tgt.addExtension(convertedExtension); + } else { + tgt.addExtension(Extension43_50.convertExtension(e)); + } + }); + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/Type43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/Type43_50.java new file mode 100644 index 000000000..79eea204c --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/Type43_50.java @@ -0,0 +1,256 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50; + +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.*; +import org.hl7.fhir.convertors.conv43_50.resources43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +public class Type43_50 { + + private final BaseAdvisor_43_50 advisor; + + public Type43_50(BaseAdvisor_43_50 advisor) { + this.advisor = advisor; + } + + public org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.r4b.model.DataType src) throws FHIRException { + if (src == null || src.isEmpty()) return null; + if (src instanceof org.hl7.fhir.r4b.model.Base64BinaryType) + return Base64Binary43_50.convertBase64Binary((org.hl7.fhir.r4b.model.Base64BinaryType) src); + if (src instanceof org.hl7.fhir.r4b.model.BooleanType) + return Boolean43_50.convertBoolean((org.hl7.fhir.r4b.model.BooleanType) src); + if (src instanceof org.hl7.fhir.r4b.model.CanonicalType) + return Canonical43_50.convertCanonical((org.hl7.fhir.r4b.model.CanonicalType) src); + if (src instanceof org.hl7.fhir.r4b.model.CodeType) + return Code43_50.convertCode((org.hl7.fhir.r4b.model.CodeType) src); + if (src instanceof org.hl7.fhir.r4b.model.DateType) + return Date43_50.convertDate((org.hl7.fhir.r4b.model.DateType) src); + if (src instanceof org.hl7.fhir.r4b.model.DateTimeType) + return DateTime43_50.convertDateTime((org.hl7.fhir.r4b.model.DateTimeType) src); + if (src instanceof org.hl7.fhir.r4b.model.DecimalType) + return Decimal43_50.convertDecimal((org.hl7.fhir.r4b.model.DecimalType) src); + if (src instanceof org.hl7.fhir.r4b.model.IdType) return Id43_50.convertId((org.hl7.fhir.r4b.model.IdType) src); + if (src instanceof org.hl7.fhir.r4b.model.InstantType) + return Instant43_50.convertInstant((org.hl7.fhir.r4b.model.InstantType) src); + if (src instanceof org.hl7.fhir.r4b.model.UnsignedIntType) + return UnsignedInt43_50.convertUnsignedInt((org.hl7.fhir.r4b.model.UnsignedIntType) src); + if (src instanceof org.hl7.fhir.r4b.model.PositiveIntType) + return PositiveInt43_50.convertPositiveInt((org.hl7.fhir.r4b.model.PositiveIntType) src); + if (src instanceof org.hl7.fhir.r4b.model.IntegerType) + return Integer43_50.convertInteger((org.hl7.fhir.r4b.model.IntegerType) src); + if (src instanceof org.hl7.fhir.r4b.model.MarkdownType) + return MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src); + if (src instanceof org.hl7.fhir.r4b.model.OidType) return Oid43_50.convertOid((org.hl7.fhir.r4b.model.OidType) src); + if (src instanceof org.hl7.fhir.r4b.model.TimeType) + return Time43_50.convertTime((org.hl7.fhir.r4b.model.TimeType) src); + if (src instanceof org.hl7.fhir.r4b.model.UrlType) return Url43_50.convertUrl((org.hl7.fhir.r4b.model.UrlType) src); + if (src instanceof org.hl7.fhir.r4b.model.UuidType) + return Uuid43_50.convertUuid((org.hl7.fhir.r4b.model.UuidType) src); + if (src instanceof org.hl7.fhir.r4b.model.UriType) return Uri43_50.convertUri((org.hl7.fhir.r4b.model.UriType) src); + if (src instanceof org.hl7.fhir.r4b.model.StringType) + return String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src); + if (src instanceof org.hl7.fhir.r4b.model.Extension) + return Extension43_50.convertExtension((org.hl7.fhir.r4b.model.Extension) src); + if (src instanceof org.hl7.fhir.r4b.model.Narrative) + return Narrative43_50.convertNarrative((org.hl7.fhir.r4b.model.Narrative) src); + if (src instanceof org.hl7.fhir.r4b.model.Address) + return Address43_50.convertAddress((org.hl7.fhir.r4b.model.Address) src); + if (src instanceof org.hl7.fhir.r4b.model.Age) return Age43_50.convertAge((org.hl7.fhir.r4b.model.Age) src); + if (src instanceof org.hl7.fhir.r4b.model.Annotation) + return Annotation43_50.convertAnnotation((org.hl7.fhir.r4b.model.Annotation) src); + if (src instanceof org.hl7.fhir.r4b.model.Attachment) + return Attachment43_50.convertAttachment((org.hl7.fhir.r4b.model.Attachment) src); + if (src instanceof org.hl7.fhir.r4b.model.CodeableConcept) + return CodeableConcept43_50.convertCodeableConcept((org.hl7.fhir.r4b.model.CodeableConcept) src); + if (src instanceof org.hl7.fhir.r4b.model.Coding) + return Coding43_50.convertCoding((org.hl7.fhir.r4b.model.Coding) src); + if (src instanceof org.hl7.fhir.r4b.model.ContactDetail) + return ContactDetail43_50.convertContactDetail((org.hl7.fhir.r4b.model.ContactDetail) src); + if (src instanceof org.hl7.fhir.r4b.model.ContactPoint) + return ContactPoint43_50.convertContactPoint((org.hl7.fhir.r4b.model.ContactPoint) src); + if (src instanceof org.hl7.fhir.r4b.model.Contributor) + return Contributor43_50.convertContributor((org.hl7.fhir.r4b.model.Contributor) src); + if (src instanceof org.hl7.fhir.r4b.model.Count) return Count43_50.convertCount((org.hl7.fhir.r4b.model.Count) src); + if (src instanceof org.hl7.fhir.r4b.model.DataRequirement) + return DataRequirement43_50.convertDataRequirement((org.hl7.fhir.r4b.model.DataRequirement) src); + if (src instanceof org.hl7.fhir.r4b.model.Distance) + return Distance43_50.convertDistance((org.hl7.fhir.r4b.model.Distance) src); + if (src instanceof org.hl7.fhir.r4b.model.Dosage) + return Dosage43_50.convertDosage((org.hl7.fhir.r4b.model.Dosage) src); + if (src instanceof org.hl7.fhir.r4b.model.Duration) + return Duration43_50.convertDuration((org.hl7.fhir.r4b.model.Duration) src); + if (src instanceof org.hl7.fhir.r4b.model.Expression) + return Expression43_50.convertExpression((org.hl7.fhir.r4b.model.Expression) src); + if (src instanceof org.hl7.fhir.r4b.model.HumanName) + return HumanName43_50.convertHumanName((org.hl7.fhir.r4b.model.HumanName) src); + if (src instanceof org.hl7.fhir.r4b.model.Identifier) + return Identifier43_50.convertIdentifier((org.hl7.fhir.r4b.model.Identifier) src); + if (src instanceof org.hl7.fhir.r4b.model.MarketingStatus) + return MarketingStatus43_50.convertMarketingStatus((org.hl7.fhir.r4b.model.MarketingStatus) src); + if (src instanceof org.hl7.fhir.r4b.model.Meta) return Meta43_50.convertMeta((org.hl7.fhir.r4b.model.Meta) src); + if (src instanceof org.hl7.fhir.r4b.model.Money) return Money43_50.convertMoney((org.hl7.fhir.r4b.model.Money) src); + if (src instanceof org.hl7.fhir.r4b.model.ParameterDefinition) + return ParameterDefinition43_50.convertParameterDefinition((org.hl7.fhir.r4b.model.ParameterDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.Period) + return Period43_50.convertPeriod((org.hl7.fhir.r4b.model.Period) src); + if (src instanceof org.hl7.fhir.r4b.model.Population) + return Population43_50.convertPopulation((org.hl7.fhir.r4b.model.Population) src); + if (src instanceof org.hl7.fhir.r4b.model.ProdCharacteristic) + return ProdCharacteristic43_50.convertProdCharacteristic((org.hl7.fhir.r4b.model.ProdCharacteristic) src); + if (src instanceof org.hl7.fhir.r4b.model.ProductShelfLife) + return ProductShelfLife43_50.convertProductShelfLife((org.hl7.fhir.r4b.model.ProductShelfLife) src); + if (src instanceof org.hl7.fhir.r4b.model.MoneyQuantity) + return MoneyQuantity43_50.convertMoneyQuantity((org.hl7.fhir.r4b.model.MoneyQuantity) src); + if (src instanceof org.hl7.fhir.r4b.model.SimpleQuantity) + return SimpleQuantity43_50.convertSimpleQuantity((org.hl7.fhir.r4b.model.SimpleQuantity) src); + if (src instanceof org.hl7.fhir.r4b.model.Quantity) + return Quantity43_50.convertQuantity((org.hl7.fhir.r4b.model.Quantity) src); + if (src instanceof org.hl7.fhir.r4b.model.Range) return Range43_50.convertRange((org.hl7.fhir.r4b.model.Range) src); + if (src instanceof org.hl7.fhir.r4b.model.Ratio) return Ratio43_50.convertRatio((org.hl7.fhir.r4b.model.Ratio) src); + if (src instanceof org.hl7.fhir.r4b.model.Reference) + return Reference43_50.convertReference((org.hl7.fhir.r4b.model.Reference) src); + if (src instanceof org.hl7.fhir.r4b.model.RelatedArtifact) + return RelatedArtifact43_50.convertRelatedArtifact((org.hl7.fhir.r4b.model.RelatedArtifact) src); + if (src instanceof org.hl7.fhir.r4b.model.SampledData) + return SampledData43_50.convertSampledData((org.hl7.fhir.r4b.model.SampledData) src); + if (src instanceof org.hl7.fhir.r4b.model.Signature) + return Signature43_50.convertSignature((org.hl7.fhir.r4b.model.Signature) src); + if (src instanceof org.hl7.fhir.r4b.model.SubstanceAmount) + return SubstanceAmount43_50.convertSubstanceAmount((org.hl7.fhir.r4b.model.SubstanceAmount) src); + if (src instanceof org.hl7.fhir.r4b.model.Timing) + return Timing43_50.convertTiming((org.hl7.fhir.r4b.model.Timing) src); + if (src instanceof org.hl7.fhir.r4b.model.TriggerDefinition) + return TriggerDefinition43_50.convertTriggerDefinition((org.hl7.fhir.r4b.model.TriggerDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.UsageContext) + return UsageContext43_50.convertUsageContext((org.hl7.fhir.r4b.model.UsageContext) src); + if (src instanceof org.hl7.fhir.r4b.model.ElementDefinition) + return ElementDefinition43_50.convertElementDefinition((org.hl7.fhir.r4b.model.ElementDefinition) src); + if (advisor.failFastOnNullOrUnknownEntry()) { + throw new FHIRException("Unknown type " + src.fhirType()); + } else { + return null; + } + } + + public org.hl7.fhir.r4b.model.DataType convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException { + if (src == null || src.isEmpty()) return null; + if (src instanceof org.hl7.fhir.r5.model.Base64BinaryType) + return Base64Binary43_50.convertBase64Binary((org.hl7.fhir.r5.model.Base64BinaryType) src); + if (src instanceof org.hl7.fhir.r5.model.BooleanType) + return Boolean43_50.convertBoolean((org.hl7.fhir.r5.model.BooleanType) src); + if (src instanceof org.hl7.fhir.r5.model.CanonicalType) + return Canonical43_50.convertCanonical((org.hl7.fhir.r5.model.CanonicalType) src); + if (src instanceof org.hl7.fhir.r5.model.CodeType) + return Code43_50.convertCode((org.hl7.fhir.r5.model.CodeType) src); + if (src instanceof org.hl7.fhir.r5.model.DateType) + return Date43_50.convertDate((org.hl7.fhir.r5.model.DateType) src); + if (src instanceof org.hl7.fhir.r5.model.DateTimeType) + return DateTime43_50.convertDateTime((org.hl7.fhir.r5.model.DateTimeType) src); + if (src instanceof org.hl7.fhir.r5.model.DecimalType) + return Decimal43_50.convertDecimal((org.hl7.fhir.r5.model.DecimalType) src); + if (src instanceof org.hl7.fhir.r5.model.IdType) return Id43_50.convertId((org.hl7.fhir.r5.model.IdType) src); + if (src instanceof org.hl7.fhir.r5.model.InstantType) + return Instant43_50.convertInstant((org.hl7.fhir.r5.model.InstantType) src); + if (src instanceof org.hl7.fhir.r5.model.MarkdownType) + return MarkDown43_50.convertMarkdown((org.hl7.fhir.r5.model.MarkdownType) src); + if (src instanceof org.hl7.fhir.r5.model.OidType) return Oid43_50.convertOid((org.hl7.fhir.r5.model.OidType) src); + if (src instanceof org.hl7.fhir.r5.model.PositiveIntType) + return PositiveInt43_50.convertPositiveInt((org.hl7.fhir.r5.model.PositiveIntType) src); + if (src instanceof org.hl7.fhir.r5.model.StringType) + return String43_50.convertString((org.hl7.fhir.r5.model.StringType) src); + if (src instanceof org.hl7.fhir.r5.model.TimeType) + return Time43_50.convertTime((org.hl7.fhir.r5.model.TimeType) src); + if (src instanceof org.hl7.fhir.r5.model.UnsignedIntType) + return UnsignedInt43_50.convertUnsignedInt((org.hl7.fhir.r5.model.UnsignedIntType) src); + if (src instanceof org.hl7.fhir.r5.model.IntegerType) + return Integer43_50.convertInteger((org.hl7.fhir.r5.model.IntegerType) src); + if (src instanceof org.hl7.fhir.r5.model.UrlType) return Url43_50.convertUrl((org.hl7.fhir.r5.model.UrlType) src); + if (src instanceof org.hl7.fhir.r5.model.UuidType) + return Uuid43_50.convertUuid((org.hl7.fhir.r5.model.UuidType) src); + if (src instanceof org.hl7.fhir.r5.model.UriType) return Uri43_50.convertUri((org.hl7.fhir.r5.model.UriType) src); + if (src instanceof org.hl7.fhir.r5.model.Extension) + return Extension43_50.convertExtension((org.hl7.fhir.r5.model.Extension) src); + if (src instanceof org.hl7.fhir.r5.model.Narrative) + return Narrative43_50.convertNarrative((org.hl7.fhir.r5.model.Narrative) src); + if (src instanceof org.hl7.fhir.r5.model.Address) + return Address43_50.convertAddress((org.hl7.fhir.r5.model.Address) src); + if (src instanceof org.hl7.fhir.r5.model.Age) return Age43_50.convertAge((org.hl7.fhir.r5.model.Age) src); + if (src instanceof org.hl7.fhir.r5.model.Annotation) + return Annotation43_50.convertAnnotation((org.hl7.fhir.r5.model.Annotation) src); + if (src instanceof org.hl7.fhir.r5.model.Attachment) + return Attachment43_50.convertAttachment((org.hl7.fhir.r5.model.Attachment) src); + if (src instanceof org.hl7.fhir.r5.model.CodeableConcept) + return CodeableConcept43_50.convertCodeableConcept((org.hl7.fhir.r5.model.CodeableConcept) src); + if (src instanceof org.hl7.fhir.r5.model.Coding) + return Coding43_50.convertCoding((org.hl7.fhir.r5.model.Coding) src); + if (src instanceof org.hl7.fhir.r5.model.ContactDetail) + return ContactDetail43_50.convertContactDetail((org.hl7.fhir.r5.model.ContactDetail) src); + if (src instanceof org.hl7.fhir.r5.model.ContactPoint) + return ContactPoint43_50.convertContactPoint((org.hl7.fhir.r5.model.ContactPoint) src); + if (src instanceof org.hl7.fhir.r5.model.Contributor) + return Contributor43_50.convertContributor((org.hl7.fhir.r5.model.Contributor) src); + if (src instanceof org.hl7.fhir.r5.model.Count) return Count43_50.convertCount((org.hl7.fhir.r5.model.Count) src); + if (src instanceof org.hl7.fhir.r5.model.DataRequirement) + return DataRequirement43_50.convertDataRequirement((org.hl7.fhir.r5.model.DataRequirement) src); + if (src instanceof org.hl7.fhir.r5.model.Distance) + return Distance43_50.convertDistance((org.hl7.fhir.r5.model.Distance) src); + if (src instanceof org.hl7.fhir.r5.model.Dosage) + return Dosage43_50.convertDosage((org.hl7.fhir.r5.model.Dosage) src); + if (src instanceof org.hl7.fhir.r5.model.Duration) + return Duration43_50.convertDuration((org.hl7.fhir.r5.model.Duration) src); + if (src instanceof org.hl7.fhir.r5.model.Expression) + return Expression43_50.convertExpression((org.hl7.fhir.r5.model.Expression) src); + if (src instanceof org.hl7.fhir.r5.model.HumanName) + return HumanName43_50.convertHumanName((org.hl7.fhir.r5.model.HumanName) src); + if (src instanceof org.hl7.fhir.r5.model.Identifier) + return Identifier43_50.convertIdentifier((org.hl7.fhir.r5.model.Identifier) src); + if (src instanceof org.hl7.fhir.r5.model.MarketingStatus) + return MarketingStatus43_50.convertMarketingStatus((org.hl7.fhir.r5.model.MarketingStatus) src); + if (src instanceof org.hl7.fhir.r5.model.Meta) return Meta43_50.convertMeta((org.hl7.fhir.r5.model.Meta) src); + if (src instanceof org.hl7.fhir.r5.model.Money) return Money43_50.convertMoney((org.hl7.fhir.r5.model.Money) src); + if (src instanceof org.hl7.fhir.r5.model.ParameterDefinition) + return ParameterDefinition43_50.convertParameterDefinition((org.hl7.fhir.r5.model.ParameterDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.Period) + return Period43_50.convertPeriod((org.hl7.fhir.r5.model.Period) src); + if (src instanceof org.hl7.fhir.r5.model.Population) + return Population43_50.convertPopulation((org.hl7.fhir.r5.model.Population) src); + if (src instanceof org.hl7.fhir.r5.model.ProdCharacteristic) + return ProdCharacteristic43_50.convertProdCharacteristic((org.hl7.fhir.r5.model.ProdCharacteristic) src); + if (src instanceof org.hl7.fhir.r5.model.ProductShelfLife) + return ProductShelfLife43_50.convertProductShelfLife((org.hl7.fhir.r5.model.ProductShelfLife) src); + if (src instanceof org.hl7.fhir.r5.model.MoneyQuantity) + return MoneyQuantity43_50.convertMoneyQuantity((org.hl7.fhir.r5.model.MoneyQuantity) src); + if (src instanceof org.hl7.fhir.r5.model.SimpleQuantity) + return SimpleQuantity43_50.convertSimpleQuantity((org.hl7.fhir.r5.model.SimpleQuantity) src); + if (src instanceof org.hl7.fhir.r5.model.Quantity) + return Quantity43_50.convertQuantity((org.hl7.fhir.r5.model.Quantity) src); + if (src instanceof org.hl7.fhir.r5.model.Range) return Range43_50.convertRange((org.hl7.fhir.r5.model.Range) src); + if (src instanceof org.hl7.fhir.r5.model.Ratio) return Ratio43_50.convertRatio((org.hl7.fhir.r5.model.Ratio) src); + if (src instanceof org.hl7.fhir.r5.model.Reference) + return Reference43_50.convertReference((org.hl7.fhir.r5.model.Reference) src); + if (src instanceof org.hl7.fhir.r5.model.RelatedArtifact) + return RelatedArtifact43_50.convertRelatedArtifact((org.hl7.fhir.r5.model.RelatedArtifact) src); + if (src instanceof org.hl7.fhir.r5.model.SampledData) + return SampledData43_50.convertSampledData((org.hl7.fhir.r5.model.SampledData) src); + if (src instanceof org.hl7.fhir.r5.model.Signature) + return Signature43_50.convertSignature((org.hl7.fhir.r5.model.Signature) src); + if (src instanceof org.hl7.fhir.r5.model.SubstanceAmount) + return SubstanceAmount43_50.convertSubstanceAmount((org.hl7.fhir.r5.model.SubstanceAmount) src); + if (src instanceof org.hl7.fhir.r5.model.Timing) + return Timing43_50.convertTiming((org.hl7.fhir.r5.model.Timing) src); + if (src instanceof org.hl7.fhir.r5.model.TriggerDefinition) + return TriggerDefinition43_50.convertTriggerDefinition((org.hl7.fhir.r5.model.TriggerDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.UsageContext) + return UsageContext43_50.convertUsageContext((org.hl7.fhir.r5.model.UsageContext) src); + if (src instanceof org.hl7.fhir.r5.model.ElementDefinition) + return ElementDefinition43_50.convertElementDefinition((org.hl7.fhir.r5.model.ElementDefinition) src); + if (advisor.failFastOnNullOrUnknownEntry()) { + throw new FHIRException("Unknown type " + src.fhirType()); + } else { + return null; + } + } +} 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 new file mode 100644 index 000000000..fd62ae9f5 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Address43_50.java @@ -0,0 +1,153 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +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; + +public class Address43_50 { + public static org.hl7.fhir.r5.model.Address convertAddress(org.hl7.fhir.r4b.model.Address src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Address tgt = new org.hl7.fhir.r5.model.Address(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasUse()) tgt.setUseElement(convertAddressUse(src.getUseElement())); + if (src.hasType()) tgt.setTypeElement(convertAddressType(src.getTypeElement())); + if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getLine()) tgt.getLine().add(String43_50.convertString(t)); + if (src.hasCity()) tgt.setCityElement(String43_50.convertString(src.getCityElement())); + if (src.hasDistrict()) tgt.setDistrictElement(String43_50.convertString(src.getDistrictElement())); + if (src.hasState()) tgt.setStateElement(String43_50.convertString(src.getStateElement())); + if (src.hasPostalCode()) tgt.setPostalCodeElement(String43_50.convertString(src.getPostalCodeElement())); + if (src.hasCountry()) tgt.setCountryElement(String43_50.convertString(src.getCountryElement())); + if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Address convertAddress(org.hl7.fhir.r5.model.Address src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Address tgt = new org.hl7.fhir.r4b.model.Address(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasUse()) tgt.setUseElement(convertAddressUse(src.getUseElement())); + if (src.hasType()) tgt.setTypeElement(convertAddressType(src.getTypeElement())); + if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getLine()) tgt.getLine().add(String43_50.convertString(t)); + if (src.hasCity()) tgt.setCityElement(String43_50.convertString(src.getCityElement())); + if (src.hasDistrict()) tgt.setDistrictElement(String43_50.convertString(src.getDistrictElement())); + if (src.hasState()) tgt.setStateElement(String43_50.convertString(src.getStateElement())); + if (src.hasPostalCode()) tgt.setPostalCodeElement(String43_50.convertString(src.getPostalCodeElement())); + if (src.hasCountry()) tgt.setCountryElement(String43_50.convertString(src.getCountryElement())); + if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertAddressUse(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertAddressUse(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertAddressType(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertAddressType(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.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()) { + 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; + } + } + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Age43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Age43_50.java new file mode 100644 index 000000000..df3b16e50 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Age43_50.java @@ -0,0 +1,19 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.exceptions.FHIRException; + +public class Age43_50 { + public static org.hl7.fhir.r5.model.Age convertAge(org.hl7.fhir.r4b.model.Age src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Age tgt = new org.hl7.fhir.r5.model.Age(); + Quantity43_50.copyQuantity(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Age convertAge(org.hl7.fhir.r5.model.Age src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Age tgt = new org.hl7.fhir.r4b.model.Age(); + Quantity43_50.copyQuantity(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Annotation43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Annotation43_50.java new file mode 100644 index 000000000..a4c50cf2c --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Annotation43_50.java @@ -0,0 +1,30 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Annotation43_50 { + public static org.hl7.fhir.r5.model.Annotation convertAnnotation(org.hl7.fhir.r4b.model.Annotation src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Annotation tgt = new org.hl7.fhir.r5.model.Annotation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasAuthor()) + tgt.setAuthor(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAuthor())); + if (src.hasTime()) tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement())); + if (src.hasText()) tgt.setTextElement(MarkDown43_50.convertMarkdown(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Annotation convertAnnotation(org.hl7.fhir.r5.model.Annotation src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Annotation tgt = new org.hl7.fhir.r4b.model.Annotation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasAuthor()) + tgt.setAuthor(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAuthor())); + if (src.hasTime()) tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement())); + if (src.hasText()) tgt.setTextElement(MarkDown43_50.convertMarkdown(src.getTextElement())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Attachment43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Attachment43_50.java new file mode 100644 index 000000000..ba8538f85 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Attachment43_50.java @@ -0,0 +1,37 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +public class Attachment43_50 { + public static org.hl7.fhir.r5.model.Attachment convertAttachment(org.hl7.fhir.r4b.model.Attachment src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Attachment tgt = new org.hl7.fhir.r5.model.Attachment(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasContentType()) tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement())); + if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasData()) tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement())); + if (src.hasUrl()) tgt.setUrlElement(Url43_50.convertUrl(src.getUrlElement())); + if (src.hasSize()) tgt.setSizeElement(UnsignedInt43_50.convertUnsignedIntToInteger64(src.getSizeElement())); + if (src.hasHash()) tgt.setHashElement(Base64Binary43_50.convertBase64Binary(src.getHashElement())); + if (src.hasTitle()) tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasCreation()) tgt.setCreationElement(DateTime43_50.convertDateTime(src.getCreationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Attachment convertAttachment(org.hl7.fhir.r5.model.Attachment src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Attachment tgt = new org.hl7.fhir.r4b.model.Attachment(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasContentType()) tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement())); + if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasData()) tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement())); + if (src.hasUrl()) tgt.setUrlElement(Url43_50.convertUrl(src.getUrlElement())); + if (src.hasSize()) tgt.setSizeElement(UnsignedInt43_50.convertInteger64ToUnsignedInt(src.getSizeElement())); + if (src.hasHash()) tgt.setHashElement(Base64Binary43_50.convertBase64Binary(src.getHashElement())); + if (src.hasTitle()) tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasCreation()) tgt.setCreationElement(DateTime43_50.convertDateTime(src.getCreationElement())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/CodeableConcept43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/CodeableConcept43_50.java new file mode 100644 index 000000000..3d18c2154 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/CodeableConcept43_50.java @@ -0,0 +1,32 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +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.CodeableReference; + +public class CodeableConcept43_50 { + public static org.hl7.fhir.r5.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.r4b.model.CodeableConcept src) throws FHIRException { + if (src == null) 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); + for (org.hl7.fhir.r4b.model.Coding t : src.getCoding()) tgt.addCoding(Coding43_50.convertCoding(t)); + if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.CodeableConcept tgt = new org.hl7.fhir.r4b.model.CodeableConcept(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + for (org.hl7.fhir.r5.model.Coding t : src.getCoding()) tgt.addCoding(Coding43_50.convertCoding(t)); + if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement())); + return tgt; + } + + public static CodeableReference convertCodeableConceptToCodeableReference(org.hl7.fhir.r4b.model.CodeableConcept src) { + CodeableReference tgt = new CodeableReference(); + tgt.setConcept(convertCodeableConcept(src)); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Coding43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Coding43_50.java new file mode 100644 index 000000000..36424ea1a --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Coding43_50.java @@ -0,0 +1,34 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_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.exceptions.FHIRException; + +public class Coding43_50 { + public static org.hl7.fhir.r5.model.Coding convertCoding(org.hl7.fhir.r4b.model.Coding src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Coding tgt = new org.hl7.fhir.r5.model.Coding(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasVersion()) tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasCode()) tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasUserSelected()) tgt.setUserSelectedElement(Boolean43_50.convertBoolean(src.getUserSelectedElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Coding convertCoding(org.hl7.fhir.r5.model.Coding src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Coding tgt = new org.hl7.fhir.r4b.model.Coding(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasVersion()) tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasCode()) tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasUserSelected()) tgt.setUserSelectedElement(Boolean43_50.convertBoolean(src.getUserSelectedElement())); + 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 new file mode 100644 index 000000000..32978e486 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/ContactPoint43_50.java @@ -0,0 +1,168 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +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; + +public class ContactPoint43_50 { + public static org.hl7.fhir.r5.model.ContactPoint convertContactPoint(org.hl7.fhir.r4b.model.ContactPoint src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ContactPoint tgt = new org.hl7.fhir.r5.model.ContactPoint(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasSystem()) tgt.setSystemElement(convertContactPointSystem(src.getSystemElement())); + if (src.hasValue()) tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasUse()) tgt.setUseElement(convertContactPointUse(src.getUseElement())); + if (src.hasRank()) tgt.setRankElement(PositiveInt43_50.convertPositiveInt(src.getRankElement())); + if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ContactPoint convertContactPoint(org.hl7.fhir.r5.model.ContactPoint src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ContactPoint tgt = new org.hl7.fhir.r4b.model.ContactPoint(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasSystem()) tgt.setSystemElement(convertContactPointSystem(src.getSystemElement())); + if (src.hasValue()) tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasUse()) tgt.setUseElement(convertContactPointUse(src.getUseElement())); + if (src.hasRank()) tgt.setRankElement(PositiveInt43_50.convertPositiveInt(src.getRankElement())); + if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertContactPointSystem(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertContactPointSystem(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertContactPointUse(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertContactPointUse(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.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()) { + 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; + } + } + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Count43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Count43_50.java new file mode 100644 index 000000000..fdaced513 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Count43_50.java @@ -0,0 +1,19 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.exceptions.FHIRException; + +public class Count43_50 { + public static org.hl7.fhir.r5.model.Count convertCount(org.hl7.fhir.r4b.model.Count src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Count tgt = new org.hl7.fhir.r5.model.Count(); + Quantity43_50.copyQuantity(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Count convertCount(org.hl7.fhir.r5.model.Count src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Count tgt = new org.hl7.fhir.r4b.model.Count(); + Quantity43_50.copyQuantity(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Distance43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Distance43_50.java new file mode 100644 index 000000000..7e378eec2 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Distance43_50.java @@ -0,0 +1,19 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.exceptions.FHIRException; + +public class Distance43_50 { + public static org.hl7.fhir.r5.model.Distance convertDistance(org.hl7.fhir.r4b.model.Distance src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Distance tgt = new org.hl7.fhir.r5.model.Distance(); + Quantity43_50.copyQuantity(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Distance convertDistance(org.hl7.fhir.r5.model.Distance src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Distance tgt = new org.hl7.fhir.r4b.model.Distance(); + Quantity43_50.copyQuantity(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Duration43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Duration43_50.java new file mode 100644 index 000000000..bd307e92b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Duration43_50.java @@ -0,0 +1,19 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.exceptions.FHIRException; + +public class Duration43_50 { + public static org.hl7.fhir.r5.model.Duration convertDuration(org.hl7.fhir.r4b.model.Duration src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Duration tgt = new org.hl7.fhir.r5.model.Duration(); + Quantity43_50.copyQuantity(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Duration convertDuration(org.hl7.fhir.r5.model.Duration src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Duration tgt = new org.hl7.fhir.r4b.model.Duration(); + Quantity43_50.copyQuantity(src, tgt); + 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 new file mode 100644 index 000000000..d6cfb67c2 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/HumanName43_50.java @@ -0,0 +1,109 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +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; + +public class HumanName43_50 { + public static org.hl7.fhir.r5.model.HumanName convertHumanName(org.hl7.fhir.r4b.model.HumanName src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.HumanName tgt = new org.hl7.fhir.r5.model.HumanName(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasUse()) tgt.setUseElement(convertNameUse(src.getUseElement())); + if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement())); + if (src.hasFamily()) tgt.setFamilyElement(String43_50.convertString(src.getFamilyElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getGiven()) tgt.getGiven().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getPrefix()) tgt.getPrefix().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getSuffix()) tgt.getSuffix().add(String43_50.convertString(t)); + if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.HumanName convertHumanName(org.hl7.fhir.r5.model.HumanName src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.HumanName tgt = new org.hl7.fhir.r4b.model.HumanName(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasUse()) tgt.setUseElement(convertNameUse(src.getUseElement())); + if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement())); + if (src.hasFamily()) tgt.setFamilyElement(String43_50.convertString(src.getFamilyElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getGiven()) tgt.getGiven().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getPrefix()) tgt.getPrefix().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getSuffix()) tgt.getSuffix().add(String43_50.convertString(t)); + if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertNameUse(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertNameUse(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.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()) { + 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; + } + } + 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 new file mode 100644 index 000000000..acb8fa87d --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Identifier43_50.java @@ -0,0 +1,97 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +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.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; + +public class Identifier43_50 { + public static org.hl7.fhir.r5.model.Identifier convertIdentifier(org.hl7.fhir.r4b.model.Identifier src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Identifier tgt = new org.hl7.fhir.r5.model.Identifier(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasUse()) tgt.setUseElement(convertIdentifierUse(src.getUseElement())); + if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasValue()) tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasAssigner()) tgt.setAssigner(Reference43_50.convertReference(src.getAssigner())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Identifier convertIdentifier(org.hl7.fhir.r5.model.Identifier src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Identifier tgt = new org.hl7.fhir.r4b.model.Identifier(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasUse()) tgt.setUseElement(convertIdentifierUse(src.getUseElement())); + if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasValue()) tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasAssigner()) tgt.setAssigner(Reference43_50.convertReference(src.getAssigner())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertIdentifierUse(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertIdentifierUse(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.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()) { + 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; + } + } + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Money43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Money43_50.java new file mode 100644 index 000000000..1d99e468b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Money43_50.java @@ -0,0 +1,26 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Money43_50 { + public static org.hl7.fhir.r5.model.Money convertMoney(org.hl7.fhir.r4b.model.Money src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Money tgt = new org.hl7.fhir.r5.model.Money(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasValue()) tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement())); + if (src.hasCurrency()) tgt.setCurrencyElement(Code43_50.convertCode(src.getCurrencyElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Money convertMoney(org.hl7.fhir.r5.model.Money src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Money tgt = new org.hl7.fhir.r4b.model.Money(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasValue()) tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement())); + if (src.hasCurrency()) tgt.setCurrencyElement(Code43_50.convertCode(src.getCurrencyElement())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/MoneyQuantity43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/MoneyQuantity43_50.java new file mode 100644 index 000000000..f6a3a6c3f --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/MoneyQuantity43_50.java @@ -0,0 +1,13 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.exceptions.FHIRException; + +public class MoneyQuantity43_50 { + public static org.hl7.fhir.r5.model.Quantity convertMoneyQuantity(org.hl7.fhir.r4b.model.Quantity src) throws FHIRException { + return Quantity43_50.convertQuantity(src); + } + + public static org.hl7.fhir.r4b.model.Quantity convertMoneyQuantity(org.hl7.fhir.r5.model.Quantity src) throws FHIRException { + return Quantity43_50.convertQuantity(src); + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Period43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Period43_50.java new file mode 100644 index 000000000..554caadac --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Period43_50.java @@ -0,0 +1,25 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Period43_50 { + public static org.hl7.fhir.r5.model.Period convertPeriod(org.hl7.fhir.r4b.model.Period src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Period tgt = new org.hl7.fhir.r5.model.Period(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasStart()) tgt.setStartElement(DateTime43_50.convertDateTime(src.getStartElement())); + if (src.hasEnd()) tgt.setEndElement(DateTime43_50.convertDateTime(src.getEndElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Period convertPeriod(org.hl7.fhir.r5.model.Period src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Period tgt = new org.hl7.fhir.r4b.model.Period(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasStart()) tgt.setStartElement(DateTime43_50.convertDateTime(src.getStartElement())); + if (src.hasEnd()) tgt.setEndElement(DateTime43_50.convertDateTime(src.getEndElement())); + 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 new file mode 100644 index 000000000..e553abd23 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Quantity43_50.java @@ -0,0 +1,110 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_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.exceptions.FHIRException; + +public class Quantity43_50 { + public static org.hl7.fhir.r5.model.Quantity convertQuantity(org.hl7.fhir.r4b.model.Quantity src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Quantity tgt = new org.hl7.fhir.r5.model.Quantity(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasValue()) tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement())); + if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement())); + if (src.hasUnit()) tgt.setUnitElement(String43_50.convertString(src.getUnitElement())); + if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasCode()) tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Quantity convertQuantity(org.hl7.fhir.r5.model.Quantity src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Quantity tgt = new org.hl7.fhir.r4b.model.Quantity(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasValue()) tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement())); + if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement())); + if (src.hasUnit()) tgt.setUnitElement(String43_50.convertString(src.getUnitElement())); + if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasCode()) tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Enumeration convertQuantityComparator(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.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()) { + 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; + } + } + return tgt; + } + + public static org.hl7.fhir.r4b.model.Enumeration convertQuantityComparator(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.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()) { + 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; + } + } + return tgt; + } + + public static void copyQuantity(org.hl7.fhir.r4b.model.Quantity src, org.hl7.fhir.r5.model.Quantity tgt) throws FHIRException { + if (src == null || tgt == null) return; + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasValue()) tgt.setValue(src.getValue()); + if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement())); + if (src.hasUnit()) tgt.setUnit(src.getUnit()); + if (src.hasSystem()) tgt.setSystem(src.getSystem()); + if (src.hasCode()) tgt.setCode(src.getCode()); + } + + public static void copyQuantity(org.hl7.fhir.r5.model.Quantity src, org.hl7.fhir.r4b.model.Quantity tgt) throws FHIRException { + if (src == null || tgt == null) return; + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasValue()) tgt.setValue(src.getValue()); + if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement())); + if (src.hasUnit()) tgt.setUnit(src.getUnit()); + if (src.hasSystem()) tgt.setSystem(src.getSystem()); + if (src.hasCode()) tgt.setCode(src.getCode()); + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Range43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Range43_50.java new file mode 100644 index 000000000..f71632a95 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Range43_50.java @@ -0,0 +1,24 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Range43_50 { + public static org.hl7.fhir.r5.model.Range convertRange(org.hl7.fhir.r4b.model.Range src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Range tgt = new org.hl7.fhir.r5.model.Range(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasLow()) tgt.setLow(SimpleQuantity43_50.convertSimpleQuantity(src.getLow())); + if (src.hasHigh()) tgt.setHigh(SimpleQuantity43_50.convertSimpleQuantity(src.getHigh())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Range convertRange(org.hl7.fhir.r5.model.Range src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Range tgt = new org.hl7.fhir.r4b.model.Range(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasLow()) tgt.setLow(SimpleQuantity43_50.convertSimpleQuantity(src.getLow())); + if (src.hasHigh()) tgt.setHigh(SimpleQuantity43_50.convertSimpleQuantity(src.getHigh())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Ratio43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Ratio43_50.java new file mode 100644 index 000000000..360357d1a --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Ratio43_50.java @@ -0,0 +1,24 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Ratio43_50 { + public static org.hl7.fhir.r5.model.Ratio convertRatio(org.hl7.fhir.r4b.model.Ratio src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Ratio tgt = new org.hl7.fhir.r5.model.Ratio(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasNumerator()) tgt.setNumerator(Quantity43_50.convertQuantity(src.getNumerator())); + if (src.hasDenominator()) tgt.setDenominator(Quantity43_50.convertQuantity(src.getDenominator())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Ratio convertRatio(org.hl7.fhir.r5.model.Ratio src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Ratio tgt = new org.hl7.fhir.r4b.model.Ratio(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasNumerator()) tgt.setNumerator(Quantity43_50.convertQuantity(src.getNumerator())); + if (src.hasDenominator()) tgt.setDenominator(Quantity43_50.convertQuantity(src.getDenominator())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/SampledData43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/SampledData43_50.java new file mode 100644 index 000000000..445afc983 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/SampledData43_50.java @@ -0,0 +1,37 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50; +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; + +public class SampledData43_50 { + public static org.hl7.fhir.r5.model.SampledData convertSampledData(org.hl7.fhir.r4b.model.SampledData src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.SampledData tgt = new org.hl7.fhir.r5.model.SampledData(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity43_50.convertSimpleQuantity(src.getOrigin())); + if (src.hasPeriod()) tgt.setPeriodElement(Decimal43_50.convertDecimal(src.getPeriodElement())); + if (src.hasFactor()) tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasLowerLimit()) tgt.setLowerLimitElement(Decimal43_50.convertDecimal(src.getLowerLimitElement())); + if (src.hasUpperLimit()) tgt.setUpperLimitElement(Decimal43_50.convertDecimal(src.getUpperLimitElement())); + if (src.hasDimensions()) tgt.setDimensionsElement(PositiveInt43_50.convertPositiveInt(src.getDimensionsElement())); + if (src.hasData()) tgt.setDataElement(String43_50.convertString(src.getDataElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SampledData convertSampledData(org.hl7.fhir.r5.model.SampledData src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.SampledData tgt = new org.hl7.fhir.r4b.model.SampledData(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity43_50.convertSimpleQuantity(src.getOrigin())); + if (src.hasPeriod()) tgt.setPeriodElement(Decimal43_50.convertDecimal(src.getPeriodElement())); + if (src.hasFactor()) tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasLowerLimit()) tgt.setLowerLimitElement(Decimal43_50.convertDecimal(src.getLowerLimitElement())); + if (src.hasUpperLimit()) tgt.setUpperLimitElement(Decimal43_50.convertDecimal(src.getUpperLimitElement())); + if (src.hasDimensions()) tgt.setDimensionsElement(PositiveInt43_50.convertPositiveInt(src.getDimensionsElement())); + if (src.hasData()) tgt.setDataElement(String43_50.convertString(src.getDataElement())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Signature43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Signature43_50.java new file mode 100644 index 000000000..cd00f24b1 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Signature43_50.java @@ -0,0 +1,38 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Base64Binary43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50; +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; + +public class Signature43_50 { + public static org.hl7.fhir.r5.model.Signature convertSignature(org.hl7.fhir.r4b.model.Signature src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Signature tgt = new org.hl7.fhir.r5.model.Signature(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + for (org.hl7.fhir.r4b.model.Coding t : src.getType()) tgt.addType(Coding43_50.convertCoding(t)); + if (src.hasWhen()) tgt.setWhenElement(Instant43_50.convertInstant(src.getWhenElement())); + if (src.hasWho()) tgt.setWho(Reference43_50.convertReference(src.getWho())); + if (src.hasOnBehalfOf()) tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + if (src.hasTargetFormat()) tgt.setTargetFormatElement(Code43_50.convertCode(src.getTargetFormatElement())); + if (src.hasSigFormat()) tgt.setSigFormatElement(Code43_50.convertCode(src.getSigFormatElement())); + if (src.hasData()) tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Signature convertSignature(org.hl7.fhir.r5.model.Signature src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Signature tgt = new org.hl7.fhir.r4b.model.Signature(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(Coding43_50.convertCoding(t)); + if (src.hasWhen()) tgt.setWhenElement(Instant43_50.convertInstant(src.getWhenElement())); + if (src.hasWho()) tgt.setWho(Reference43_50.convertReference(src.getWho())); + if (src.hasOnBehalfOf()) tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + if (src.hasTargetFormat()) tgt.setTargetFormatElement(Code43_50.convertCode(src.getTargetFormatElement())); + if (src.hasSigFormat()) tgt.setSigFormatElement(Code43_50.convertCode(src.getSigFormatElement())); + if (src.hasData()) tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/SimpleQuantity43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/SimpleQuantity43_50.java new file mode 100644 index 000000000..4aa801b7d --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/SimpleQuantity43_50.java @@ -0,0 +1,13 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.exceptions.FHIRException; + +public class SimpleQuantity43_50 { + public static org.hl7.fhir.r5.model.Quantity convertSimpleQuantity(org.hl7.fhir.r4b.model.Quantity src) throws FHIRException { + return Quantity43_50.convertQuantity(src); + } + + public static org.hl7.fhir.r4b.model.Quantity convertSimpleQuantity(org.hl7.fhir.r5.model.Quantity src) throws FHIRException { + return Quantity43_50.convertQuantity(src); + } +} 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 new file mode 100644 index 000000000..3b52122ec --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/general43_50/Timing43_50.java @@ -0,0 +1,417 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneType43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +import java.util.stream.Collectors; + +public class Timing43_50 { + public static org.hl7.fhir.r4b.model.Timing convertTiming(org.hl7.fhir.r5.model.Timing src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Timing tgt = new org.hl7.fhir.r4b.model.Timing(); + BackboneType43_50.copyBackboneType(src, tgt); + for (org.hl7.fhir.r5.model.DateTimeType t : src.getEvent()) tgt.getEvent().add(DateTime43_50.convertDateTime(t)); + if (src.hasRepeat()) tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat())); + if (src.hasCode()) tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Timing convertTiming(org.hl7.fhir.r4b.model.Timing src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Timing tgt = new org.hl7.fhir.r5.model.Timing(); + BackboneElement43_50.copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.DateTimeType t : src.getEvent()) tgt.getEvent().add(DateTime43_50.convertDateTime(t)); + if (src.hasRepeat()) tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat())); + if (src.hasCode()) tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.r4b.model.Timing.TimingRepeatComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.r5.model.Timing.TimingRepeatComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasBounds()) + tgt.setBounds(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getBounds())); + if (src.hasCount()) tgt.setCountElement(PositiveInt43_50.convertPositiveInt(src.getCountElement())); + if (src.hasCountMax()) tgt.setCountMaxElement(PositiveInt43_50.convertPositiveInt(src.getCountMaxElement())); + if (src.hasDuration()) tgt.setDurationElement(Decimal43_50.convertDecimal(src.getDurationElement())); + if (src.hasDurationMax()) tgt.setDurationMaxElement(Decimal43_50.convertDecimal(src.getDurationMaxElement())); + if (src.hasDurationUnit()) tgt.setDurationUnitElement(convertUnitsOfTime(src.getDurationUnitElement())); + if (src.hasFrequency()) tgt.setFrequencyElement(PositiveInt43_50.convertPositiveInt(src.getFrequencyElement())); + if (src.hasFrequencyMax()) + tgt.setFrequencyMaxElement(PositiveInt43_50.convertPositiveInt(src.getFrequencyMaxElement())); + if (src.hasPeriod()) tgt.setPeriodElement(Decimal43_50.convertDecimal(src.getPeriodElement())); + if (src.hasPeriodMax()) tgt.setPeriodMaxElement(Decimal43_50.convertDecimal(src.getPeriodMaxElement())); + if (src.hasPeriodUnit()) tgt.setPeriodUnitElement(convertUnitsOfTime(src.getPeriodUnitElement())); + tgt.setDayOfWeek(src.getDayOfWeek().stream().map(Timing43_50::convertDayOfWeek).collect(Collectors.toList())); + if (src.hasWhen()) + tgt.setWhen(src.getWhen().stream().map(Timing43_50::convertEventTiming).collect(Collectors.toList())); + for (org.hl7.fhir.r4b.model.TimeType t : src.getTimeOfDay()) tgt.getTimeOfDay().add(Time43_50.convertTime(t)); + if (src.hasOffset()) tgt.setOffsetElement(UnsignedInt43_50.convertUnsignedInt(src.getOffsetElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.r5.model.Timing.TimingRepeatComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.r4b.model.Timing.TimingRepeatComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasBounds()) + tgt.setBounds(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getBounds())); + if (src.hasCount()) tgt.setCountElement(PositiveInt43_50.convertPositiveInt(src.getCountElement())); + if (src.hasCountMax()) tgt.setCountMaxElement(PositiveInt43_50.convertPositiveInt(src.getCountMaxElement())); + if (src.hasDuration()) tgt.setDurationElement(Decimal43_50.convertDecimal(src.getDurationElement())); + if (src.hasDurationMax()) tgt.setDurationMaxElement(Decimal43_50.convertDecimal(src.getDurationMaxElement())); + if (src.hasDurationUnit()) tgt.setDurationUnitElement(convertUnitsOfTime(src.getDurationUnitElement())); + if (src.hasFrequency()) tgt.setFrequencyElement(PositiveInt43_50.convertPositiveInt(src.getFrequencyElement())); + if (src.hasFrequencyMax()) + tgt.setFrequencyMaxElement(PositiveInt43_50.convertPositiveInt(src.getFrequencyMaxElement())); + if (src.hasPeriod()) tgt.setPeriodElement(Decimal43_50.convertDecimal(src.getPeriodElement())); + if (src.hasPeriodMax()) tgt.setPeriodMaxElement(Decimal43_50.convertDecimal(src.getPeriodMaxElement())); + if (src.hasPeriodUnit()) tgt.setPeriodUnitElement(convertUnitsOfTime(src.getPeriodUnitElement())); + tgt.setDayOfWeek(src.getDayOfWeek().stream().map(Timing43_50::convertDayOfWeek).collect(Collectors.toList())); + if (src.hasWhen()) + tgt.setWhen(src.getWhen().stream().map(Timing43_50::convertEventTiming).collect(Collectors.toList())); + for (org.hl7.fhir.r5.model.TimeType t : src.getTimeOfDay()) tgt.getTimeOfDay().add(Time43_50.convertTime(t)); + if (src.hasOffset()) tgt.setOffsetElement(UnsignedInt43_50.convertUnsignedInt(src.getOffsetElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertUnitsOfTime(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertUnitsOfTime(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertDayOfWeek(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); + if (src.getValue() == null) { + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertDayOfWeek(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); + if (src.getValue() == null) { + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.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; + } + + static public org.hl7.fhir.r5.model.Enumeration convertEventTiming(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertEventTiming(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.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()) { + 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; + } + } + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ContactDetail43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ContactDetail43_50.java new file mode 100644 index 000000000..e55273cb6 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ContactDetail43_50.java @@ -0,0 +1,28 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.ContactPoint43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class ContactDetail43_50 { + public static org.hl7.fhir.r5.model.ContactDetail convertContactDetail(org.hl7.fhir.r4b.model.ContactDetail src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ContactDetail convertContactDetail(org.hl7.fhir.r5.model.ContactDetail src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ContactDetail tgt = new org.hl7.fhir.r4b.model.ContactDetail(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + 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 new file mode 100644 index 000000000..162277aae --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Contributor43_50.java @@ -0,0 +1,85 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50; + +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; + +public class Contributor43_50 { + public static org.hl7.fhir.r5.model.Contributor convertContributor(org.hl7.fhir.r4b.model.Contributor src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Contributor tgt = new org.hl7.fhir.r5.model.Contributor(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setTypeElement(convertContributorType(src.getTypeElement())); + if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contributor convertContributor(org.hl7.fhir.r5.model.Contributor src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Contributor tgt = new org.hl7.fhir.r4b.model.Contributor(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setTypeElement(convertContributorType(src.getTypeElement())); + if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertContributorType(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertContributorType(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.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()) { + 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; + } + } + 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 new file mode 100644 index 000000000..b445cb9d3 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/DataRequirement43_50.java @@ -0,0 +1,181 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +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; + +public class DataRequirement43_50 { + public static org.hl7.fhir.r5.model.DataRequirement convertDataRequirement(org.hl7.fhir.r4b.model.DataRequirement src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.DataRequirement tgt = new org.hl7.fhir.r5.model.DataRequirement(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) + tgt.setType(org.hl7.fhir.r5.model.Enumerations.FHIRAllTypes.fromCode(convertResourceName4to5(src.getType().toCode()))); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getProfile()) + tgt.getProfile().add(Canonical43_50.convertCanonical(t)); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + for (org.hl7.fhir.r4b.model.StringType t : src.getMustSupport()) + tgt.getMustSupport().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent t : src.getCodeFilter()) + tgt.addCodeFilter(convertDataRequirementCodeFilterComponent(t)); + for (org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent t : src.getDateFilter()) + tgt.addDateFilter(convertDataRequirementDateFilterComponent(t)); + if (src.hasLimit()) tgt.setLimitElement(PositiveInt43_50.convertPositiveInt(src.getLimitElement())); + for (org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent t : src.getSort()) + tgt.addSort(convertDataRequirementSortComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DataRequirement convertDataRequirement(org.hl7.fhir.r5.model.DataRequirement src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.DataRequirement tgt = new org.hl7.fhir.r4b.model.DataRequirement(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.getTypeElement().setValueAsString(convertResourceName5to4(src.getType().toCode())); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getProfile()) + tgt.getProfile().add(Canonical43_50.convertCanonical(t)); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + for (org.hl7.fhir.r5.model.StringType t : src.getMustSupport()) + tgt.getMustSupport().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent t : src.getCodeFilter()) + tgt.addCodeFilter(convertDataRequirementCodeFilterComponent(t)); + for (org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent t : src.getDateFilter()) + tgt.addDateFilter(convertDataRequirementDateFilterComponent(t)); + if (src.hasLimit()) tgt.setLimitElement(PositiveInt43_50.convertPositiveInt(src.getLimitElement())); + for (org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent t : src.getSort()) + tgt.addSort(convertDataRequirementSortComponent(t)); + return tgt; + } + + private static String convertResourceName4to5(String name) { + if (name == null) return null; + if (name.equals("MedicationStatement")) { + return "MedicationUsage"; + } + if (name.equals("DeviceUseStatement")) { + return "DeviceUsage"; + } + return name; + } + + private static String convertResourceName5to4(String name) { + if (name == null) return null; + if (name.equals("MedicationUsage")) { + return "MedicationStatement"; + } + if (name.equals("DeviceUsage")) { + return "DeviceUseStatement"; + } + return name; + } + + public static org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent convertDataRequirementCodeFilterComponent(org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent tgt = new org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasSearchParam()) tgt.setSearchParamElement(String43_50.convertString(src.getSearchParamElement())); + if (src.hasValueSet()) tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement())); + for (org.hl7.fhir.r4b.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent convertDataRequirementCodeFilterComponent(org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent tgt = new org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasSearchParam()) tgt.setSearchParamElement(String43_50.convertString(src.getSearchParamElement())); + if (src.hasValueSet()) tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement())); + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent convertDataRequirementDateFilterComponent(org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent tgt = new org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasSearchParam()) tgt.setSearchParamElement(String43_50.convertString(src.getSearchParamElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent convertDataRequirementDateFilterComponent(org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent tgt = new org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasSearchParam()) tgt.setSearchParamElement(String43_50.convertString(src.getSearchParamElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent convertDataRequirementSortComponent(org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent tgt = new org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasDirection()) tgt.setDirectionElement(convertSortDirection(src.getDirectionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent convertDataRequirementSortComponent(org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent tgt = new org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasDirection()) tgt.setDirectionElement(convertSortDirection(src.getDirectionElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertSortDirection(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertSortDirection(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.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()) { + 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; + } + } + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Expression43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Expression43_50.java new file mode 100644 index 000000000..6e0a7aec6 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/Expression43_50.java @@ -0,0 +1,34 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Id43_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.exceptions.FHIRException; + +public class Expression43_50 { + public static org.hl7.fhir.r5.model.Expression convertExpression(org.hl7.fhir.r4b.model.Expression src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Expression tgt = new org.hl7.fhir.r5.model.Expression(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasName()) tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasExpression()) tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasReference()) tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Expression convertExpression(org.hl7.fhir.r5.model.Expression src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Expression tgt = new org.hl7.fhir.r4b.model.Expression(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasName()) tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasExpression()) tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasReference()) tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement())); + 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 new file mode 100644 index 000000000..0742491da --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/ParameterDefinition43_50.java @@ -0,0 +1,82 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50; +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; + +public class ParameterDefinition43_50 { + public static org.hl7.fhir.r5.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.r4b.model.ParameterDefinition src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ParameterDefinition tgt = new org.hl7.fhir.r5.model.ParameterDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasName()) tgt.setNameElement(Code43_50.convertCode(src.getNameElement())); + if (src.hasUse()) tgt.setUseElement(convertParameterUse(src.getUseElement())); + if (src.hasMin()) tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement())); + if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasDocumentation()) tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + if (src.hasType()) tgt.setType(org.hl7.fhir.r5.model.Enumerations.FHIRAllTypes.fromCode(src.getType().toCode())); + if (src.hasProfile()) tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.r5.model.ParameterDefinition src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ParameterDefinition tgt = new org.hl7.fhir.r4b.model.ParameterDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasName()) tgt.setNameElement(Code43_50.convertCode(src.getNameElement())); + if (src.hasUse()) tgt.setUseElement(convertParameterUse(src.getUseElement())); + if (src.hasMin()) tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement())); + if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasDocumentation()) tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + if (src.hasType()) tgt.getTypeElement().setValueAsString(src.getType().toCode()); + if (src.hasProfile()) tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertParameterUse(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); + if (src.getValue() == null) { + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertParameterUse(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); + if (src.getValue() == null) { + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.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; + } +} 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 new file mode 100644 index 000000000..0124e7af0 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/RelatedArtifact43_50.java @@ -0,0 +1,119 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Attachment43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +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.Url43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class RelatedArtifact43_50 { + public static org.hl7.fhir.r5.model.RelatedArtifact convertRelatedArtifact(org.hl7.fhir.r4b.model.RelatedArtifact src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.RelatedArtifact tgt = new org.hl7.fhir.r5.model.RelatedArtifact(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setTypeElement(convertRelatedArtifactType(src.getTypeElement())); + if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasCitation()) tgt.setCitationElement(MarkDown43_50.convertMarkdown(src.getCitationElement())); + if (src.hasUrl()) tgt.getDocument().setUrlElement(Url43_50.convertUrl(src.getUrlElement())); + if (src.hasDocument()) tgt.setDocument(Attachment43_50.convertAttachment(src.getDocument())); + if (src.hasResource()) tgt.setResourceElement(Canonical43_50.convertCanonical(src.getResourceElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.RelatedArtifact convertRelatedArtifact(org.hl7.fhir.r5.model.RelatedArtifact src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.RelatedArtifact tgt = new org.hl7.fhir.r4b.model.RelatedArtifact(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setTypeElement(convertRelatedArtifactType(src.getTypeElement())); + if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasCitation()) tgt.setCitationElement(MarkDown43_50.convertMarkdown(src.getCitationElement())); + if (src.getDocument().hasUrl()) tgt.setUrlElement(Url43_50.convertUrl(src.getDocument().getUrlElement())); + if (src.hasDocument()) tgt.setDocument(Attachment43_50.convertAttachment(src.getDocument())); + if (src.hasResource()) tgt.setResourceElement(Canonical43_50.convertCanonical(src.getResourceElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertRelatedArtifactType(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); + if (src.getValue() == null) { + tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertRelatedArtifactType(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.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()) { + 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; + } + } + 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 new file mode 100644 index 000000000..63f066ea1 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/TriggerDefinition43_50.java @@ -0,0 +1,115 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50; + +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; + +public class TriggerDefinition43_50 { + public static org.hl7.fhir.r5.model.TriggerDefinition convertTriggerDefinition(org.hl7.fhir.r4b.model.TriggerDefinition src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.TriggerDefinition tgt = new org.hl7.fhir.r5.model.TriggerDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setTypeElement(convertTriggerType(src.getTypeElement())); + if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + for (org.hl7.fhir.r4b.model.DataRequirement t : src.getData()) + tgt.addData(DataRequirement43_50.convertDataRequirement(t)); + if (src.hasCondition()) tgt.setCondition(Expression43_50.convertExpression(src.getCondition())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TriggerDefinition convertTriggerDefinition(org.hl7.fhir.r5.model.TriggerDefinition src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.TriggerDefinition tgt = new org.hl7.fhir.r4b.model.TriggerDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setTypeElement(convertTriggerType(src.getTypeElement())); + if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + for (org.hl7.fhir.r5.model.DataRequirement t : src.getData()) + tgt.addData(DataRequirement43_50.convertDataRequirement(t)); + if (src.hasCondition()) tgt.setCondition(Expression43_50.convertExpression(src.getCondition())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertTriggerType(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertTriggerType(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.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()) { + 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; + } + } + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/UsageContext43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/UsageContext43_50.java new file mode 100644 index 000000000..79ddeb858 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/metadata43_50/UsageContext43_50.java @@ -0,0 +1,27 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class UsageContext43_50 { + public static org.hl7.fhir.r5.model.UsageContext convertUsageContext(org.hl7.fhir.r4b.model.UsageContext src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.UsageContext tgt = new org.hl7.fhir.r5.model.UsageContext(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasCode()) tgt.setCode(Coding43_50.convertCoding(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.UsageContext convertUsageContext(org.hl7.fhir.r5.model.UsageContext src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.UsageContext tgt = new org.hl7.fhir.r4b.model.UsageContext(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasCode()) tgt.setCode(Coding43_50.convertCoding(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Base64Binary43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Base64Binary43_50.java new file mode 100644 index 000000000..e3b510827 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Base64Binary43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Base64Binary43_50 { + public static org.hl7.fhir.r5.model.Base64BinaryType convertBase64Binary(org.hl7.fhir.r4b.model.Base64BinaryType src) throws FHIRException { + org.hl7.fhir.r5.model.Base64BinaryType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.Base64BinaryType(src.getValue()) : new org.hl7.fhir.r5.model.Base64BinaryType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Base64BinaryType convertBase64Binary(org.hl7.fhir.r5.model.Base64BinaryType src) throws FHIRException { + org.hl7.fhir.r4b.model.Base64BinaryType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.Base64BinaryType(src.getValue()) : new org.hl7.fhir.r4b.model.Base64BinaryType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Boolean43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Boolean43_50.java new file mode 100644 index 000000000..c7a79a158 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Boolean43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Boolean43_50 { + public static org.hl7.fhir.r5.model.BooleanType convertBoolean(org.hl7.fhir.r4b.model.BooleanType src) throws FHIRException { + org.hl7.fhir.r5.model.BooleanType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.BooleanType(src.getValue()) : new org.hl7.fhir.r5.model.BooleanType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.BooleanType convertBoolean(org.hl7.fhir.r5.model.BooleanType src) throws FHIRException { + org.hl7.fhir.r4b.model.BooleanType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.BooleanType(src.getValue()) : new org.hl7.fhir.r4b.model.BooleanType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Canonical43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Canonical43_50.java new file mode 100644 index 000000000..571f56767 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Canonical43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Canonical43_50 { + public static org.hl7.fhir.r5.model.CanonicalType convertCanonical(org.hl7.fhir.r4b.model.CanonicalType src) throws FHIRException { + org.hl7.fhir.r5.model.CanonicalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.CanonicalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.CanonicalType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CanonicalType convertCanonical(org.hl7.fhir.r5.model.CanonicalType src) throws FHIRException { + org.hl7.fhir.r4b.model.CanonicalType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.CanonicalType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.CanonicalType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Code43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Code43_50.java new file mode 100644 index 000000000..05d71a37b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Code43_50.java @@ -0,0 +1,26 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Code43_50 { + public static org.hl7.fhir.r5.model.CodeType convertCode(org.hl7.fhir.r4b.model.CodeType src) throws FHIRException { + org.hl7.fhir.r5.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.CodeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.CodeType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CodeType convertCode(org.hl7.fhir.r5.model.CodeType src) throws FHIRException { + org.hl7.fhir.r4b.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.CodeType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.CodeType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r5.model.CodeType convertResourceEnum(org.hl7.fhir.r4b.model.CodeType src) { + return Code43_50.convertCode(src); + } + + public static org.hl7.fhir.r4b.model.CodeType convertResourceEnum(org.hl7.fhir.r5.model.CodeType src) { + return Code43_50.convertCode(src); + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Date43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Date43_50.java new file mode 100644 index 000000000..1d83a6be4 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Date43_50.java @@ -0,0 +1,33 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext10_50; +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.DateType; +import org.hl7.fhir.r5.model.DateTimeType; + +public class Date43_50 { + public static org.hl7.fhir.r5.model.DateType convertDate(org.hl7.fhir.r4b.model.DateType src) throws FHIRException { + org.hl7.fhir.r5.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DateType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DateType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DateType convertDate(org.hl7.fhir.r5.model.DateType src) throws FHIRException { + org.hl7.fhir.r4b.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.DateType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.DateType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r5.model.DateTimeType convertDatetoDateTime(org.hl7.fhir.r4b.model.DateType src) { + org.hl7.fhir.r5.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DateTimeType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DateType convertDateTimeToDate(org.hl7.fhir.r5.model.DateTimeType src) { + org.hl7.fhir.r4b.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.DateType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.DateType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/DateTime43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/DateTime43_50.java new file mode 100644 index 000000000..b27e4c622 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/DateTime43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class DateTime43_50 { + public static org.hl7.fhir.r5.model.DateTimeType convertDateTime(org.hl7.fhir.r4b.model.DateTimeType src) throws FHIRException { + org.hl7.fhir.r5.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DateTimeType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DateTimeType convertDateTime(org.hl7.fhir.r5.model.DateTimeType src) throws FHIRException { + org.hl7.fhir.r4b.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.DateTimeType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Decimal43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Decimal43_50.java new file mode 100644 index 000000000..27326a636 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Decimal43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Decimal43_50 { + public static org.hl7.fhir.r5.model.DecimalType convertDecimal(org.hl7.fhir.r4b.model.DecimalType src) throws FHIRException { + org.hl7.fhir.r5.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DecimalType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DecimalType convertDecimal(org.hl7.fhir.r5.model.DecimalType src) throws FHIRException { + org.hl7.fhir.r4b.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.DecimalType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Id43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Id43_50.java new file mode 100644 index 000000000..a4eb361e1 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Id43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Id43_50 { + public static org.hl7.fhir.r5.model.IdType convertId(org.hl7.fhir.r4b.model.IdType src) throws FHIRException { + org.hl7.fhir.r5.model.IdType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.IdType(src.getValueAsString()) : new org.hl7.fhir.r5.model.IdType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.IdType convertId(org.hl7.fhir.r5.model.IdType src) throws FHIRException { + org.hl7.fhir.r4b.model.IdType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.IdType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.IdType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Instant43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Instant43_50.java new file mode 100644 index 000000000..f729c0486 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Instant43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Instant43_50 { + public static org.hl7.fhir.r5.model.InstantType convertInstant(org.hl7.fhir.r4b.model.InstantType src) throws FHIRException { + org.hl7.fhir.r5.model.InstantType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.InstantType(src.getValueAsString()) : new org.hl7.fhir.r5.model.InstantType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InstantType convertInstant(org.hl7.fhir.r5.model.InstantType src) throws FHIRException { + org.hl7.fhir.r4b.model.InstantType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.InstantType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.InstantType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Integer43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Integer43_50.java new file mode 100644 index 000000000..b08f51778 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Integer43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Integer43_50 { + public static org.hl7.fhir.r5.model.IntegerType convertInteger(org.hl7.fhir.r4b.model.IntegerType src) throws FHIRException { + org.hl7.fhir.r5.model.IntegerType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.IntegerType(src.getValueAsString()) : new org.hl7.fhir.r5.model.IntegerType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.IntegerType convertInteger(org.hl7.fhir.r5.model.IntegerType src) throws FHIRException { + org.hl7.fhir.r4b.model.IntegerType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.IntegerType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.IntegerType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/MarkDown43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/MarkDown43_50.java new file mode 100644 index 000000000..4c2b57694 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/MarkDown43_50.java @@ -0,0 +1,24 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class MarkDown43_50 { + public static org.hl7.fhir.r5.model.MarkdownType convertMarkdown(org.hl7.fhir.r4b.model.MarkdownType src) throws FHIRException { + org.hl7.fhir.r5.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.MarkdownType(src.getValueAsString()) : new org.hl7.fhir.r5.model.MarkdownType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MarkdownType convertMarkdown(org.hl7.fhir.r5.model.MarkdownType src) throws FHIRException { + org.hl7.fhir.r4b.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.MarkdownType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.MarkdownType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r5.model.MarkdownType convertStringToMarkdown(org.hl7.fhir.r4b.model.StringType src) throws FHIRException { + org.hl7.fhir.r5.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.MarkdownType(src.getValueAsString()) : new org.hl7.fhir.r5.model.MarkdownType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Oid43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Oid43_50.java new file mode 100644 index 000000000..bea948887 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Oid43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Oid43_50 { + public static org.hl7.fhir.r5.model.OidType convertOid(org.hl7.fhir.r4b.model.OidType src) throws FHIRException { + org.hl7.fhir.r5.model.OidType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.OidType(src.getValueAsString()) : new org.hl7.fhir.r5.model.OidType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.OidType convertOid(org.hl7.fhir.r5.model.OidType src) throws FHIRException { + org.hl7.fhir.r4b.model.OidType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.OidType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.OidType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/PositiveInt43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/PositiveInt43_50.java new file mode 100644 index 000000000..9b3d7562b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/PositiveInt43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class PositiveInt43_50 { + public static org.hl7.fhir.r5.model.PositiveIntType convertPositiveInt(org.hl7.fhir.r4b.model.PositiveIntType src) throws FHIRException { + org.hl7.fhir.r5.model.PositiveIntType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.PositiveIntType(src.getValueAsString()) : new org.hl7.fhir.r5.model.PositiveIntType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PositiveIntType convertPositiveInt(org.hl7.fhir.r5.model.PositiveIntType src) throws FHIRException { + org.hl7.fhir.r4b.model.PositiveIntType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.PositiveIntType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.PositiveIntType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/String43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/String43_50.java new file mode 100644 index 000000000..f877e05a2 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/String43_50.java @@ -0,0 +1,34 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext30_50; +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class String43_50 { + public static org.hl7.fhir.r5.model.StringType convertString(org.hl7.fhir.r4b.model.StringType src) throws FHIRException { + org.hl7.fhir.r5.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.StringType(src.getValueAsString()) : new org.hl7.fhir.r5.model.StringType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StringType convertString(org.hl7.fhir.r5.model.StringType src) throws FHIRException { + org.hl7.fhir.r4b.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.StringType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.StringType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + + + public static org.hl7.fhir.r5.model.MarkdownType convertStringToMarkdown(org.hl7.fhir.r4b.model.StringType src) throws FHIRException { + org.hl7.fhir.r5.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.MarkdownType(src.getValueAsString()) : new org.hl7.fhir.r5.model.MarkdownType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StringType convertMarkdownToString(org.hl7.fhir.r5.model.MarkdownType src) throws FHIRException { + org.hl7.fhir.r4b.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.StringType(src.getValue()) : new org.hl7.fhir.r4b.model.StringType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Time43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Time43_50.java new file mode 100644 index 000000000..b34164600 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Time43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Time43_50 { + public static org.hl7.fhir.r5.model.TimeType convertTime(org.hl7.fhir.r4b.model.TimeType src) throws FHIRException { + org.hl7.fhir.r5.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.TimeType(src.getValue()) : new org.hl7.fhir.r5.model.TimeType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TimeType convertTime(org.hl7.fhir.r5.model.TimeType src) throws FHIRException { + org.hl7.fhir.r4b.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.TimeType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/UnsignedInt43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/UnsignedInt43_50.java new file mode 100644 index 000000000..9ef3f7317 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/UnsignedInt43_50.java @@ -0,0 +1,30 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class UnsignedInt43_50 { + public static org.hl7.fhir.r5.model.Integer64Type convertUnsignedIntToInteger64(org.hl7.fhir.r4b.model.UnsignedIntType src) throws FHIRException { + org.hl7.fhir.r5.model.Integer64Type tgt = src.hasValue() ? new org.hl7.fhir.r5.model.Integer64Type(src.getValueAsString()) : new org.hl7.fhir.r5.model.Integer64Type(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.UnsignedIntType convertInteger64ToUnsignedInt(org.hl7.fhir.r5.model.Integer64Type src) throws FHIRException { + org.hl7.fhir.r4b.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UnsignedIntType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UnsignedIntType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r5.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.r4b.model.UnsignedIntType src) throws FHIRException { + org.hl7.fhir.r5.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UnsignedIntType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UnsignedIntType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.r5.model.UnsignedIntType src) throws FHIRException { + org.hl7.fhir.r4b.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UnsignedIntType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UnsignedIntType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Uri43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Uri43_50.java new file mode 100644 index 000000000..7dd80d0e4 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Uri43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Uri43_50 { + public static org.hl7.fhir.r5.model.UriType convertUri(org.hl7.fhir.r4b.model.UriType src) throws FHIRException { + org.hl7.fhir.r5.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UriType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UriType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.UriType convertUri(org.hl7.fhir.r5.model.UriType src) throws FHIRException { + org.hl7.fhir.r4b.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UriType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UriType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Url43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Url43_50.java new file mode 100644 index 000000000..df2f4280e --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Url43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Url43_50 { + public static org.hl7.fhir.r5.model.UrlType convertUrl(org.hl7.fhir.r4b.model.UrlType src) throws FHIRException { + org.hl7.fhir.r5.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UrlType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UrlType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.UrlType convertUrl(org.hl7.fhir.r5.model.UrlType src) throws FHIRException { + org.hl7.fhir.r4b.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UrlType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UrlType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Uuid43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Uuid43_50.java new file mode 100644 index 000000000..d10bdbda6 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/primitive43_50/Uuid43_50.java @@ -0,0 +1,18 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Uuid43_50 { + public static org.hl7.fhir.r5.model.UuidType convertUuid(org.hl7.fhir.r4b.model.UuidType src) throws FHIRException { + org.hl7.fhir.r5.model.UuidType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UuidType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UuidType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.UuidType convertUuid(org.hl7.fhir.r5.model.UuidType src) throws FHIRException { + org.hl7.fhir.r4b.model.UuidType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UuidType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UuidType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Dosage43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Dosage43_50.java new file mode 100644 index 000000000..5c49f4c5f --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Dosage43_50.java @@ -0,0 +1,95 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Ratio43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Timing43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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; + +public class Dosage43_50 { + public static org.hl7.fhir.r5.model.Dosage convertDosage(org.hl7.fhir.r4b.model.Dosage src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Dosage tgt = new org.hl7.fhir.r5.model.Dosage(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasSequence()) tgt.setSequenceElement(Integer43_50.convertInteger(src.getSequenceElement())); + if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getAdditionalInstruction()) + tgt.addAdditionalInstruction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPatientInstruction()) + tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement())); + if (src.hasTiming()) tgt.setTiming(Timing43_50.convertTiming(src.getTiming())); + if (src.hasAsNeededBooleanType()) + tgt.setAsNeededElement(Boolean43_50.convertBoolean(src.getAsNeededBooleanType())); + if (src.hasAsNeededCodeableConcept()) { + tgt.addAsNeededFor(CodeableConcept43_50.convertCodeableConcept(src.getAsNeededCodeableConcept())); + } + if (src.hasSite()) tgt.setSite(CodeableConcept43_50.convertCodeableConcept(src.getSite())); + if (src.hasRoute()) tgt.setRoute(CodeableConcept43_50.convertCodeableConcept(src.getRoute())); + if (src.hasMethod()) tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + for (org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent t : src.getDoseAndRate()) + tgt.addDoseAndRate(convertDosageDoseAndRateComponent(t)); + if (src.hasMaxDosePerPeriod()) tgt.addMaxDosePerPeriod(Ratio43_50.convertRatio(src.getMaxDosePerPeriod())); + if (src.hasMaxDosePerAdministration()) + tgt.setMaxDosePerAdministration(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxDosePerAdministration())); + if (src.hasMaxDosePerLifetime()) + tgt.setMaxDosePerLifetime(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxDosePerLifetime())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Dosage convertDosage(org.hl7.fhir.r5.model.Dosage src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Dosage tgt = new org.hl7.fhir.r4b.model.Dosage(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasSequence()) tgt.setSequenceElement(Integer43_50.convertInteger(src.getSequenceElement())); + if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAdditionalInstruction()) + tgt.addAdditionalInstruction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPatientInstruction()) + tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement())); + if (src.hasTiming()) tgt.setTiming(Timing43_50.convertTiming(src.getTiming())); + if (src.hasAsNeeded()) + tgt.setAsNeeded(Boolean43_50.convertBoolean(src.getAsNeededElement())); + if (src.hasAsNeededFor()) + tgt.setAsNeeded(CodeableConcept43_50.convertCodeableConcept(src.getAsNeededForFirstRep())); + if (src.hasSite()) tgt.setSite(CodeableConcept43_50.convertCodeableConcept(src.getSite())); + if (src.hasRoute()) tgt.setRoute(CodeableConcept43_50.convertCodeableConcept(src.getRoute())); + if (src.hasMethod()) tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + for (org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent t : src.getDoseAndRate()) + tgt.addDoseAndRate(convertDosageDoseAndRateComponent(t)); + if (src.hasMaxDosePerPeriod()) tgt.setMaxDosePerPeriod(Ratio43_50.convertRatio(src.getMaxDosePerPeriodFirstRep())); + if (src.hasMaxDosePerAdministration()) + tgt.setMaxDosePerAdministration(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxDosePerAdministration())); + if (src.hasMaxDosePerLifetime()) + tgt.setMaxDosePerLifetime(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxDosePerLifetime())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent convertDosageDoseAndRateComponent(org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent tgt = new org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasDose()) + tgt.setDose(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDose())); + if (src.hasRate()) + tgt.setRate(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getRate())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent convertDosageDoseAndRateComponent(org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent tgt = new org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasDose()) + tgt.setDose(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDose())); + if (src.hasRate()) + tgt.setRate(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getRate())); + 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 new file mode 100644 index 000000000..fad40ac0e --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/ElementDefinition43_50.java @@ -0,0 +1,618 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.resources43_50.Enumerations43_50; +import org.hl7.fhir.exceptions.FHIRException; + +import java.util.stream.Collectors; + +public class ElementDefinition43_50 { + public static org.hl7.fhir.r5.model.ElementDefinition convertElementDefinition(org.hl7.fhir.r4b.model.ElementDefinition src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ElementDefinition tgt = new org.hl7.fhir.r5.model.ElementDefinition(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition43_50::convertPropertyRepresentation).collect(Collectors.toList())); + if (src.hasSliceName()) tgt.setSliceNameElement(String43_50.convertString(src.getSliceNameElement())); + if (src.hasSliceIsConstraining()) + tgt.setSliceIsConstrainingElement(Boolean43_50.convertBoolean(src.getSliceIsConstrainingElement())); + if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + for (org.hl7.fhir.r4b.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t)); + if (src.hasSlicing()) tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing())); + if (src.hasShort()) tgt.setShortElement(String43_50.convertString(src.getShortElement())); + if (src.hasDefinition()) tgt.setDefinitionElement(MarkDown43_50.convertMarkdown(src.getDefinitionElement())); + if (src.hasComment()) tgt.setCommentElement(MarkDown43_50.convertMarkdown(src.getCommentElement())); + if (src.hasRequirements()) tgt.setRequirementsElement(MarkDown43_50.convertMarkdown(src.getRequirementsElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + if (src.hasMin()) tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement())); + if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasBase()) tgt.setBase(convertElementDefinitionBaseComponent(src.getBase())); + if (src.hasContentReference()) + tgt.setContentReferenceElement(Uri43_50.convertUri(src.getContentReferenceElement())); + for (org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent t : src.getType()) + tgt.addType(convertTypeRefComponent(t)); + if (src.hasDefaultValue()) + tgt.setDefaultValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDefaultValue())); + if (src.hasMeaningWhenMissing()) + tgt.setMeaningWhenMissingElement(MarkDown43_50.convertMarkdown(src.getMeaningWhenMissingElement())); + if (src.hasOrderMeaning()) tgt.setOrderMeaningElement(String43_50.convertString(src.getOrderMeaningElement())); + if (src.hasFixed()) + tgt.setFixed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getFixed())); + if (src.hasPattern()) + tgt.setPattern(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getPattern())); + for (org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent t : src.getExample()) + tgt.addExample(convertElementDefinitionExampleComponent(t)); + if (src.hasMinValue()) + tgt.setMinValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMinValue())); + if (src.hasMaxValue()) + tgt.setMaxValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMaxValue())); + if (src.hasMaxLength()) tgt.setMaxLengthElement(Integer43_50.convertInteger(src.getMaxLengthElement())); + for (org.hl7.fhir.r4b.model.IdType t : src.getCondition()) tgt.getCondition().add(Id43_50.convertId(t)); + for (org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint()) + tgt.addConstraint(convertElementDefinitionConstraintComponent(t)); + if (src.hasMustSupport()) tgt.setMustSupportElement(Boolean43_50.convertBoolean(src.getMustSupportElement())); + if (src.hasIsModifier()) tgt.setIsModifierElement(Boolean43_50.convertBoolean(src.getIsModifierElement())); + if (src.hasIsModifierReason()) + tgt.setIsModifierReasonElement(String43_50.convertString(src.getIsModifierReasonElement())); + if (src.hasIsSummary()) tgt.setIsSummaryElement(Boolean43_50.convertBoolean(src.getIsSummaryElement())); + if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); + for (org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping()) + tgt.addMapping(convertElementDefinitionMappingComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ElementDefinition convertElementDefinition(org.hl7.fhir.r5.model.ElementDefinition src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ElementDefinition tgt = new org.hl7.fhir.r4b.model.ElementDefinition(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition43_50::convertPropertyRepresentation).collect(Collectors.toList())); + if (src.hasSliceName()) tgt.setSliceNameElement(String43_50.convertString(src.getSliceNameElement())); + if (src.hasSliceIsConstraining()) + tgt.setSliceIsConstrainingElement(Boolean43_50.convertBoolean(src.getSliceIsConstrainingElement())); + if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t)); + if (src.hasSlicing()) tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing())); + if (src.hasShort()) tgt.setShortElement(String43_50.convertString(src.getShortElement())); + if (src.hasDefinition()) tgt.setDefinitionElement(MarkDown43_50.convertMarkdown(src.getDefinitionElement())); + if (src.hasComment()) tgt.setCommentElement(MarkDown43_50.convertMarkdown(src.getCommentElement())); + if (src.hasRequirements()) tgt.setRequirementsElement(MarkDown43_50.convertMarkdown(src.getRequirementsElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + if (src.hasMin()) tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement())); + if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasBase()) tgt.setBase(convertElementDefinitionBaseComponent(src.getBase())); + if (src.hasContentReference()) + tgt.setContentReferenceElement(Uri43_50.convertUri(src.getContentReferenceElement())); + for (org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent t : src.getType()) + tgt.addType(convertTypeRefComponent(t)); + if (src.hasDefaultValue()) + tgt.setDefaultValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDefaultValue())); + if (src.hasMeaningWhenMissing()) + tgt.setMeaningWhenMissingElement(MarkDown43_50.convertMarkdown(src.getMeaningWhenMissingElement())); + if (src.hasOrderMeaning()) tgt.setOrderMeaningElement(String43_50.convertString(src.getOrderMeaningElement())); + if (src.hasFixed()) + tgt.setFixed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getFixed())); + if (src.hasPattern()) + tgt.setPattern(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getPattern())); + for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent t : src.getExample()) + tgt.addExample(convertElementDefinitionExampleComponent(t)); + if (src.hasMinValue()) + tgt.setMinValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMinValue())); + if (src.hasMaxValue()) + tgt.setMaxValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMaxValue())); + if (src.hasMaxLength()) tgt.setMaxLengthElement(Integer43_50.convertInteger(src.getMaxLengthElement())); + for (org.hl7.fhir.r5.model.IdType t : src.getCondition()) tgt.getCondition().add(Id43_50.convertId(t)); + for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint()) + tgt.addConstraint(convertElementDefinitionConstraintComponent(t)); + if (src.hasMustSupport()) tgt.setMustSupportElement(Boolean43_50.convertBoolean(src.getMustSupportElement())); + if (src.hasIsModifier()) tgt.setIsModifierElement(Boolean43_50.convertBoolean(src.getIsModifierElement())); + if (src.hasIsModifierReason()) + tgt.setIsModifierReasonElement(String43_50.convertString(src.getIsModifierReasonElement())); + if (src.hasIsSummary()) tgt.setIsSummaryElement(Boolean43_50.convertBoolean(src.getIsSummaryElement())); + if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding())); + for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping()) + tgt.addMapping(convertElementDefinitionMappingComponent(t)); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertPropertyRepresentation(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertPropertyRepresentation(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.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()) { + 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; + } + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingComponent convertElementDefinitionSlicingComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + for (org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent t : src.getDiscriminator()) + tgt.addDiscriminator(convertElementDefinitionSlicingDiscriminatorComponent(t)); + if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasOrdered()) tgt.setOrderedElement(Boolean43_50.convertBoolean(src.getOrderedElement())); + if (src.hasRules()) tgt.setRulesElement(convertSlicingRules(src.getRulesElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingComponent convertElementDefinitionSlicingComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent t : src.getDiscriminator()) + tgt.addDiscriminator(convertElementDefinitionSlicingDiscriminatorComponent(t)); + if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasOrdered()) tgt.setOrderedElement(Boolean43_50.convertBoolean(src.getOrderedElement())); + if (src.hasRules()) tgt.setRulesElement(convertSlicingRules(src.getRulesElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertSlicingRules(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertSlicingRules(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.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()) { + 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; + } + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent convertElementDefinitionSlicingDiscriminatorComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setTypeElement(convertDiscriminatorType(src.getTypeElement())); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent convertElementDefinitionSlicingDiscriminatorComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) tgt.setTypeElement(convertDiscriminatorType(src.getTypeElement())); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertDiscriminatorType(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertDiscriminatorType(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.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()) { + 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; + } + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBaseComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBaseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasMin()) tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement())); + if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBaseComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBaseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasMin()) tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement())); + if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent convertTypeRefComponent(org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasCode()) tgt.setCodeElement(Uri43_50.convertUri(src.getCodeElement())); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getProfile()) + tgt.getProfile().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getTargetProfile()) + tgt.getTargetProfile().add(Canonical43_50.convertCanonical(t)); + tgt.setAggregation(src.getAggregation().stream().map(ElementDefinition43_50::convertAggregationMode).collect(Collectors.toList())); + if (src.hasVersioning()) tgt.setVersioningElement(convertReferenceVersionRules(src.getVersioningElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent convertTypeRefComponent(org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasCode()) tgt.setCodeElement(Uri43_50.convertUri(src.getCodeElement())); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getProfile()) + tgt.getProfile().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getTargetProfile()) + tgt.getTargetProfile().add(Canonical43_50.convertCanonical(t)); + tgt.setAggregation(src.getAggregation().stream().map(ElementDefinition43_50::convertAggregationMode).collect(Collectors.toList())); + if (src.hasVersioning()) tgt.setVersioningElement(convertReferenceVersionRules(src.getVersioningElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertAggregationMode(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertAggregationMode(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertReferenceVersionRules(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertReferenceVersionRules(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.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()) { + 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; + } + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent convertElementDefinitionExampleComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent convertElementDefinitionExampleComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasKey()) tgt.setKeyElement(Id43_50.convertId(src.getKeyElement())); + if (src.hasRequirements()) tgt.setRequirementsElement(String43_50.convertString(src.getRequirementsElement())); + if (src.hasSeverity()) tgt.setSeverityElement(convertConstraintSeverity(src.getSeverityElement())); + if (src.hasHuman()) tgt.setHumanElement(String43_50.convertString(src.getHumanElement())); + if (src.hasExpression()) tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasXpath()) tgt.setXpathElement(String43_50.convertString(src.getXpathElement())); + if (src.hasSource()) tgt.setSourceElement(Canonical43_50.convertCanonical(src.getSourceElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasKey()) tgt.setKeyElement(Id43_50.convertId(src.getKeyElement())); + if (src.hasRequirements()) tgt.setRequirementsElement(String43_50.convertString(src.getRequirementsElement())); + if (src.hasSeverity()) tgt.setSeverityElement(convertConstraintSeverity(src.getSeverityElement())); + if (src.hasHuman()) tgt.setHumanElement(String43_50.convertString(src.getHumanElement())); + if (src.hasExpression()) tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasXpath()) tgt.setXpathElement(String43_50.convertString(src.getXpathElement())); + if (src.hasSource()) tgt.setSourceElement(Canonical43_50.convertCanonical(src.getSourceElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertConstraintSeverity(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertConstraintSeverity(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.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()) { + 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; + } + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent convertElementDefinitionBindingComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBindingComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasStrength()) tgt.setStrengthElement(Enumerations43_50.convertBindingStrength(src.getStrengthElement())); + if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasValueSet()) tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBindingComponent convertElementDefinitionBindingComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBindingComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBindingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasStrength()) tgt.setStrengthElement(Enumerations43_50.convertBindingStrength(src.getStrengthElement())); + if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasValueSet()) tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent convertElementDefinitionMappingComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasIdentity()) tgt.setIdentityElement(Id43_50.convertId(src.getIdentityElement())); + if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasMap()) tgt.setMapElement(String43_50.convertString(src.getMapElement())); + if (src.hasComment()) tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent convertElementDefinitionMappingComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasIdentity()) tgt.setIdentityElement(Id43_50.convertId(src.getIdentityElement())); + if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasMap()) tgt.setMapElement(String43_50.convertString(src.getMapElement())); + if (src.hasComment()) tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Extension43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Extension43_50.java new file mode 100644 index 000000000..2983e4b8c --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Extension43_50.java @@ -0,0 +1,27 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Extension43_50 { + public static org.hl7.fhir.r5.model.Extension convertExtension(org.hl7.fhir.r4b.model.Extension src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Extension tgt = new org.hl7.fhir.r5.model.Extension(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasUrl()) tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Extension convertExtension(org.hl7.fhir.r5.model.Extension src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Extension tgt = new org.hl7.fhir.r4b.model.Extension(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasUrl()) tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Meta43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Meta43_50.java new file mode 100644 index 000000000..e29b33c09 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Meta43_50.java @@ -0,0 +1,39 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Id43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Meta43_50 { + public static org.hl7.fhir.r5.model.Meta convertMeta(org.hl7.fhir.r4b.model.Meta src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Meta tgt = new org.hl7.fhir.r5.model.Meta(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasVersionId()) tgt.setVersionIdElement(Id43_50.convertId(src.getVersionIdElement())); + if (src.hasLastUpdated()) tgt.setLastUpdatedElement(Instant43_50.convertInstant(src.getLastUpdatedElement())); + if (src.hasSource()) tgt.setSourceElement(Uri43_50.convertUri(src.getSourceElement())); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getProfile()) + tgt.getProfile().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r4b.model.Coding t : src.getTag()) tgt.addTag(Coding43_50.convertCoding(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Meta convertMeta(org.hl7.fhir.r5.model.Meta src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Meta tgt = new org.hl7.fhir.r4b.model.Meta(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasVersionId()) tgt.setVersionIdElement(Id43_50.convertId(src.getVersionIdElement())); + if (src.hasLastUpdated()) tgt.setLastUpdatedElement(Instant43_50.convertInstant(src.getLastUpdatedElement())); + if (src.hasSource()) tgt.setSourceElement(Uri43_50.convertUri(src.getSourceElement())); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getProfile()) + tgt.getProfile().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r5.model.Coding t : src.getTag()) tgt.addTag(Coding43_50.convertCoding(t)); + 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 new file mode 100644 index 000000000..bf2110ec1 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Narrative43_50.java @@ -0,0 +1,80 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Narrative43_50 { + public static org.hl7.fhir.r5.model.Narrative convertNarrative(org.hl7.fhir.r4b.model.Narrative src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Narrative tgt = new org.hl7.fhir.r5.model.Narrative(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasStatus()) tgt.setStatusElement(convertNarrativeStatus(src.getStatusElement())); + if (src.hasDiv()) tgt.setDiv(xhtml43_50.convertXhtml(src.getDiv())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Narrative convertNarrative(org.hl7.fhir.r5.model.Narrative src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Narrative tgt = new org.hl7.fhir.r4b.model.Narrative(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasStatus()) tgt.setStatusElement(convertNarrativeStatus(src.getStatusElement())); + if (src.hasDiv()) tgt.setDiv(xhtml43_50.convertXhtml(src.getDiv())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertNarrativeStatus(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.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()) { + 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; + } + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertNarrativeStatus(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.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()) { + 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; + } + } + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Reference43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Reference43_50.java new file mode 100644 index 000000000..8c6349c57 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/Reference43_50.java @@ -0,0 +1,38 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_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.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeableReference; + +public class Reference43_50 { + public static org.hl7.fhir.r5.model.Reference convertReference(org.hl7.fhir.r4b.model.Reference src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Reference tgt = new org.hl7.fhir.r5.model.Reference(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasReference()) tgt.setReferenceElement(String43_50.convertString(src.getReferenceElement_())); + if (src.hasType()) tgt.setTypeElement(Uri43_50.convertUri(src.getTypeElement())); + if (src.hasIdentifier()) tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Reference convertReference(org.hl7.fhir.r5.model.Reference src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Reference tgt = new org.hl7.fhir.r4b.model.Reference(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasReference()) tgt.setReferenceElement(String43_50.convertString(src.getReferenceElement_())); + if (src.hasType()) tgt.setTypeElement(Uri43_50.convertUri(src.getTypeElement())); + if (src.hasIdentifier()) tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + return tgt; + } + + public static CodeableReference convertReferenceToCodeableReference(org.hl7.fhir.r4b.model.Reference src) { + CodeableReference tgt = new CodeableReference(); + tgt.setReference(convertReference(src)); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/xhtml43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/xhtml43_50.java new file mode 100644 index 000000000..4ff5ceec4 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/datatypes43_50/special43_50/xhtml43_50.java @@ -0,0 +1,9 @@ +package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50; + +import org.hl7.fhir.exceptions.FHIRException; + +public class xhtml43_50 { + public static org.hl7.fhir.utilities.xhtml.XhtmlNode convertXhtml(org.hl7.fhir.utilities.xhtml.XhtmlNode src) throws FHIRException { + return src; + } +} 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 new file mode 100644 index 000000000..4858fb022 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Account43_50.java @@ -0,0 +1,209 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Account43_50 { + + public static org.hl7.fhir.r5.model.Account convertAccount(org.hl7.fhir.r4b.model.Account src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Account tgt = new org.hl7.fhir.r5.model.Account(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertAccountStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getSubject()) tgt.addSubject(Reference43_50.convertReference(t)); + if (src.hasServicePeriod()) + tgt.setServicePeriod(Period43_50.convertPeriod(src.getServicePeriod())); + for (org.hl7.fhir.r4b.model.Account.CoverageComponent t : src.getCoverage()) + tgt.addCoverage(convertCoverageComponent(t)); + if (src.hasOwner()) + tgt.setOwner(Reference43_50.convertReference(src.getOwner())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.Account.GuarantorComponent t : src.getGuarantor()) + tgt.addGuarantor(convertGuarantorComponent(t)); + if (src.hasPartOf()) + tgt.setPartOf(Reference43_50.convertReference(src.getPartOf())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Account convertAccount(org.hl7.fhir.r5.model.Account src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Account tgt = new org.hl7.fhir.r4b.model.Account(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertAccountStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getSubject()) tgt.addSubject(Reference43_50.convertReference(t)); + if (src.hasServicePeriod()) + tgt.setServicePeriod(Period43_50.convertPeriod(src.getServicePeriod())); + for (org.hl7.fhir.r5.model.Account.CoverageComponent t : src.getCoverage()) + tgt.addCoverage(convertCoverageComponent(t)); + if (src.hasOwner()) + tgt.setOwner(Reference43_50.convertReference(src.getOwner())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.Account.GuarantorComponent t : src.getGuarantor()) + tgt.addGuarantor(convertGuarantorComponent(t)); + if (src.hasPartOf()) + tgt.setPartOf(Reference43_50.convertReference(src.getPartOf())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r4b.model.Account.CoverageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Account.CoverageComponent tgt = new org.hl7.fhir.r5.model.Account.CoverageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + if (src.hasPriority()) + tgt.setPriorityElement(PositiveInt43_50.convertPositiveInt(src.getPriorityElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r5.model.Account.CoverageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Account.CoverageComponent tgt = new org.hl7.fhir.r4b.model.Account.CoverageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + if (src.hasPriority()) + tgt.setPriorityElement(PositiveInt43_50.convertPositiveInt(src.getPriorityElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r4b.model.Account.GuarantorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Account.GuarantorComponent tgt = new org.hl7.fhir.r5.model.Account.GuarantorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + if (src.hasOnHold()) + tgt.setOnHoldElement(Boolean43_50.convertBoolean(src.getOnHoldElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r5.model.Account.GuarantorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Account.GuarantorComponent tgt = new org.hl7.fhir.r4b.model.Account.GuarantorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + if (src.hasOnHold()) + tgt.setOnHoldElement(Boolean43_50.convertBoolean(src.getOnHoldElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + 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/ActivityDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActivityDefinition43_50.java new file mode 100644 index 000000000..1f1bb5e52 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ActivityDefinition43_50.java @@ -0,0 +1,590 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.Expression43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.RelatedArtifact43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ActivityDefinition43_50 { + + public static org.hl7.fhir.r5.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r4b.model.ActivityDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ActivityDefinition tgt = new org.hl7.fhir.r5.model.ActivityDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getLibrary()) + tgt.getLibrary().add(Canonical43_50.convertCanonical(t)); + if (src.hasKind()) + tgt.setKindElement(convertActivityDefinitionKind(src.getKindElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasIntent()) + tgt.setIntentElement(convertRequestIntent(src.getIntentElement())); + if (src.hasPriority()) + tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + if (src.hasLocation()) + tgt.setLocation(new CodeableReference(Reference43_50.convertReference(src.getLocation()))); + for (org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + if (src.hasProduct()) + tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + for (org.hl7.fhir.r4b.model.Dosage t : src.getDosage()) tgt.addDosage(Dosage43_50.convertDosage(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getBodySite()) + tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSpecimenRequirement()) + tgt.addSpecimenRequirement(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getObservationRequirement()) + tgt.addObservationRequirement(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getObservationResultRequirement()) + tgt.addObservationResultRequirement(Reference43_50.convertReference(t)); + if (src.hasTransform()) + tgt.setTransformElement(Canonical43_50.convertCanonical(src.getTransformElement())); + for (org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) + tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r5.model.ActivityDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ActivityDefinition tgt = new org.hl7.fhir.r4b.model.ActivityDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) + tgt.getLibrary().add(Canonical43_50.convertCanonical(t)); + if (src.hasKind()) + tgt.setKindElement(convertActivityDefinitionKind(src.getKindElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasIntent()) + tgt.setIntentElement(convertRequestIntent(src.getIntentElement())); + if (src.hasPriority()) + tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + if (src.getLocation().hasReference()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation().getReference())); + for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertActivityDefinitionParticipantComponent(t)); + if (src.hasProduct()) + tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(Dosage43_50.convertDosage(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) + tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimenRequirement()) + tgt.addSpecimenRequirement(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getObservationRequirement()) + tgt.addObservationRequirement(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getObservationResultRequirement()) + tgt.addObservationResultRequirement(Reference43_50.convertReference(t)); + if (src.hasTransform()) + tgt.setTransformElement(Canonical43_50.convertCanonical(src.getTransformElement())); + for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue()) + tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t)); + return tgt; + } + + 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.RequestResourceTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.APPOINTMENT); + break; + case APPOINTMENTRESPONSE: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.APPOINTMENTRESPONSE); + break; + case CAREPLAN: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CAREPLAN); + break; + case CLAIM: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CLAIM); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.COMMUNICATIONREQUEST); + break; + case CONTRACT: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CONTRACT); + break; + case DEVICEREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.DEVICEREQUEST); + break; + case ENROLLMENTREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.ENROLLMENTREQUEST); + break; + case IMMUNIZATIONRECOMMENDATION: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.IMMUNIZATIONRECOMMENDATION); + break; + case MEDICATIONREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.NUTRITIONORDER); + break; + case SERVICEREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.SERVICEREQUEST); + break; + case SUPPLYREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.SUPPLYREQUEST); + break; + case TASK: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.TASK); + break; + case VISIONPRESCRIPTION: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertActivityDefinitionKind(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.ActivityDefinition.RequestResourceTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.APPOINTMENT); + break; + case APPOINTMENTRESPONSE: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.APPOINTMENTRESPONSE); + break; + case CAREPLAN: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.CAREPLAN); + break; + case CLAIM: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.CLAIM); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.COMMUNICATIONREQUEST); + break; + case CONTRACT: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.CONTRACT); + break; + case DEVICEREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.DEVICEREQUEST); + break; + case ENROLLMENTREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.ENROLLMENTREQUEST); + break; + case IMMUNIZATIONRECOMMENDATION: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.IMMUNIZATIONRECOMMENDATION); + break; + case MEDICATIONREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.NUTRITIONORDER); + break; + case SERVICEREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.SERVICEREQUEST); + break; + case SUPPLYREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.SUPPLYREQUEST); + break; + case TASK: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.TASK); + break; + case VISIONPRESCRIPTION: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent tgt = new org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertActivityParticipantType(src.getTypeElement())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent tgt = new org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertActivityParticipantType(src.getTypeElement())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent tgt = new org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasExpression()) + tgt.setExpression(Expression43_50.convertExpression(src.getExpression())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent tgt = new org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasExpression()) + tgt.setExpression(Expression43_50.convertExpression(src.getExpression())); + 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/AllergyIntolerance43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AllergyIntolerance43_50.java new file mode 100644 index 000000000..f7f0e6aaa --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AllergyIntolerance43_50.java @@ -0,0 +1,353 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Reference30_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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.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.AllergyIntolerance.AllergyIntoleranceParticipantComponent; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class AllergyIntolerance43_50 { + + public static org.hl7.fhir.r5.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r4b.model.AllergyIntolerance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AllergyIntolerance tgt = new org.hl7.fhir.r5.model.AllergyIntolerance(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasClinicalStatus()) + tgt.setClinicalStatus(CodeableConcept43_50.convertCodeableConcept(src.getClinicalStatus())); + if (src.hasVerificationStatus()) + tgt.setVerificationStatus(CodeableConcept43_50.convertCodeableConcept(src.getVerificationStatus())); + if (src.hasType()) + tgt.setTypeElement(convertAllergyIntoleranceType(src.getTypeElement())); + tgt.setCategory(src.getCategory().stream() + .map(AllergyIntolerance43_50::convertAllergyIntoleranceCategory) + .collect(Collectors.toList())); + if (src.hasCriticality()) + tgt.setCriticalityElement(convertAllergyIntoleranceCriticality(src.getCriticalityElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOnset()) + tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset())); + if (src.hasRecordedDate()) + tgt.setRecordedDateElement(DateTime43_50.convertDateTime(src.getRecordedDateElement())); + if (src.hasRecorder()) + tgt.addParticipant(new AllergyIntoleranceParticipantComponent() + .setFunction(new CodeableConcept().addCoding(new Coding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "author", "Author"))) + .setActor(Reference43_50.convertReference(src.getRecorder()))); + if (src.hasAsserter()) + tgt.addParticipant(new AllergyIntoleranceParticipantComponent() + .setFunction(new CodeableConcept().addCoding(new Coding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "attester", "Attester"))) + .setActor(Reference43_50.convertReference(src.getRecorder()))); + if (src.hasLastOccurrence()) + tgt.setLastOccurrenceElement(DateTime43_50.convertDateTime(src.getLastOccurrenceElement())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) + tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r5.model.AllergyIntolerance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.AllergyIntolerance tgt = new org.hl7.fhir.r4b.model.AllergyIntolerance(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasClinicalStatus()) + tgt.setClinicalStatus(CodeableConcept43_50.convertCodeableConcept(src.getClinicalStatus())); + if (src.hasVerificationStatus()) + tgt.setVerificationStatus(CodeableConcept43_50.convertCodeableConcept(src.getVerificationStatus())); + if (src.hasType()) + tgt.setTypeElement(convertAllergyIntoleranceType(src.getTypeElement())); + tgt.setCategory(src.getCategory().stream() + .map(AllergyIntolerance43_50::convertAllergyIntoleranceCategory) + .collect(Collectors.toList())); + if (src.hasCriticality()) + tgt.setCriticalityElement(convertAllergyIntoleranceCriticality(src.getCriticalityElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOnset()) + tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset())); + if (src.hasRecordedDate()) + tgt.setRecordedDateElement(DateTime43_50.convertDateTime(src.getRecordedDateElement())); + for (AllergyIntoleranceParticipantComponent t : src.getParticipant()) { + if (t.getFunction().hasCoding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "author")) + tgt.setRecorder(Reference43_50.convertReference(t.getActor())); + if (t.getFunction().hasCoding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "attester")) + tgt.setAsserter(Reference43_50.convertReference(t.getActor())); + } + if (src.hasLastOccurrence()) + tgt.setLastOccurrenceElement(DateTime43_50.convertDateTime(src.getLastOccurrenceElement())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction()) + tgt.addReaction(convertAllergyIntoleranceReactionComponent(t)); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertAllergyIntoleranceType(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.AllergyIntoleranceTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case ALLERGY: + tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY); + break; + case INTOLERANCE: + tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertAllergyIntoleranceType(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.AllergyIntoleranceTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case ALLERGY: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY); + break; + case INTOLERANCE: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceType.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r5.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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSubstance()) + tgt.setSubstance(CodeableConcept43_50.convertCodeableConcept(src.getSubstance())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getManifestation()) + tgt.addManifestation(new CodeableReference(CodeableConcept43_50.convertCodeableConcept(t))); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasOnset()) + tgt.setOnsetElement(DateTime43_50.convertDateTime(src.getOnsetElement())); + if (src.hasSeverity()) + tgt.setSeverityElement(convertAllergyIntoleranceSeverity(src.getSeverityElement())); + if (src.hasExposureRoute()) + tgt.setExposureRoute(CodeableConcept43_50.convertCodeableConcept(src.getExposureRoute())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSubstance()) + tgt.setSubstance(CodeableConcept43_50.convertCodeableConcept(src.getSubstance())); + for (CodeableReference t : src.getManifestation()) + if (t.hasConcept()) tgt.addManifestation(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasOnset()) + tgt.setOnsetElement(DateTime43_50.convertDateTime(src.getOnsetElement())); + if (src.hasSeverity()) + tgt.setSeverityElement(convertAllergyIntoleranceSeverity(src.getSeverityElement())); + if (src.hasExposureRoute()) + tgt.setExposureRoute(CodeableConcept43_50.convertCodeableConcept(src.getExposureRoute())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..d16b3459a --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Appointment43_50.java @@ -0,0 +1,377 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50; +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.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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Appointment43_50 { + + public static org.hl7.fhir.r5.model.Appointment convertAppointment(org.hl7.fhir.r4b.model.Appointment src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Appointment tgt = new org.hl7.fhir.r5.model.Appointment(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement())); + if (src.hasCancelationReason()) + tgt.setCancellationReason(CodeableConcept43_50.convertCodeableConcept(src.getCancelationReason())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getServiceCategory()) + tgt.addServiceCategory(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getServiceType()) + tgt.addServiceType().setConcept(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasAppointmentType()) + tgt.setAppointmentType(CodeableConcept43_50.convertCodeableConcept(src.getAppointmentType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + if (src.hasPriority()) + tgt.setPriority(convertAppointmentPriority(src.getPriorityElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + if (src.hasStart()) + tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement())); + if (src.hasMinutesDuration()) + tgt.setMinutesDurationElement(PositiveInt43_50.convertPositiveInt(src.getMinutesDurationElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getSlot()) tgt.addSlot(Reference43_50.convertReference(t)); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasComment()) + tgt.getNoteFirstRep().setTextElement(MarkDown43_50.convertStringToMarkdown(src.getCommentElement())); +// if (src.hasPatientInstruction()) +// tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertAppointmentParticipantComponent(t)); + for (org.hl7.fhir.r4b.model.Period t : src.getRequestedPeriod()) + tgt.addRequestedPeriod(Period43_50.convertPeriod(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Appointment convertAppointment(org.hl7.fhir.r5.model.Appointment src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Appointment tgt = new org.hl7.fhir.r4b.model.Appointment(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement())); + if (src.hasCancellationReason()) + tgt.setCancelationReason(CodeableConcept43_50.convertCodeableConcept(src.getCancellationReason())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory()) + tgt.addServiceCategory(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableReference t : src.getServiceType()) + tgt.addServiceType(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasAppointmentType()) + tgt.setAppointmentType(CodeableConcept43_50.convertCodeableConcept(src.getAppointmentType())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + if (src.hasPriority()) + tgt.setPriorityElement(convertAppointmentPriority(src.getPriority())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + if (src.hasStart()) + tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement())); + if (src.hasMinutesDuration()) + tgt.setMinutesDurationElement(PositiveInt43_50.convertPositiveInt(src.getMinutesDurationElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(Reference43_50.convertReference(t)); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasNote()) + tgt.setCommentElement(String43_50.convertString(src.getNoteFirstRep().getTextElement())); +// if (src.hasPatientInstruction()) +// tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertAppointmentParticipantComponent(t)); + for (org.hl7.fhir.r5.model.Period t : src.getRequestedPeriod()) + tgt.addRequestedPeriod(Period43_50.convertPeriod(t)); + return tgt; + } + + + private static UnsignedIntType convertAppointmentPriority(CodeableConcept src) { + UnsignedIntType tgt = new UnsignedIntType(convertAppointmentPriorityFromR5(src)); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + private static CodeableConcept convertAppointmentPriority(UnsignedIntType src) { + CodeableConcept tgt = src.hasValue() ? convertAppointmentPriorityToR5(src.getValue()) : new CodeableConcept(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r5.model.CodeableConcept convertAppointmentPriorityToR5(int priority) { + return null; + } + + public static int convertAppointmentPriorityFromR5(org.hl7.fhir.r5.model.CodeableConcept priority) { + return 0; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + if (src.hasRequired()) + tgt.setRequiredElement(convertParticipantRequired(src.getRequiredElement())); + if (src.hasStatus()) + tgt.setStatusElement(convertParticipationStatus(src.getStatusElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + if (src.hasRequired()) + tgt.setRequiredElement(convertParticipantRequired(src.getRequiredElement())); + if (src.hasStatus()) + tgt.setStatusElement(convertParticipationStatus(src.getStatusElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + 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; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertParticipantRequired(org.hl7.fhir.r5.model.BooleanType 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.ParticipantRequiredEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.getValue()) { // case REQUIRED: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.ParticipantRequired.REQUIRED); + } else { // case OPTIONAL + others: + tgt.setValue(org.hl7.fhir.r4b.model.Appointment.ParticipantRequired.OPTIONAL); + } + return tgt; + } + + static public org.hl7.fhir.r5.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.Enumerations.ParticipationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.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; + } +} \ 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 new file mode 100644 index 000000000..a102943ee --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AppointmentResponse43_50.java @@ -0,0 +1,139 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class AppointmentResponse43_50 { + + public static org.hl7.fhir.r5.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r4b.model.AppointmentResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AppointmentResponse tgt = new org.hl7.fhir.r5.model.AppointmentResponse(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasAppointment()) + tgt.setAppointment(Reference43_50.convertReference(src.getAppointment())); + if (src.hasStart()) + tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getParticipantType()) + tgt.addParticipantType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + if (src.hasParticipantStatus()) + tgt.setParticipantStatusElement(convertParticipantStatus(src.getParticipantStatusElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r5.model.AppointmentResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.AppointmentResponse tgt = new org.hl7.fhir.r4b.model.AppointmentResponse(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasAppointment()) + tgt.setAppointment(Reference43_50.convertReference(src.getAppointment())); + if (src.hasStart()) + tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getParticipantType()) + tgt.addParticipantType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + if (src.hasParticipantStatus()) + tgt.setParticipantStatusElement(convertParticipantStatus(src.getParticipantStatusElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + 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.Enumerations.ParticipationStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case ACCEPTED: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.ACCEPTED); + break; + case DECLINED: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.DECLINED); + break; + case TENTATIVE: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.TENTATIVE); + break; + case NEEDSACTION: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NEEDSACTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.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; + } +} \ 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 new file mode 100644 index 000000000..94dd3582e --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/AuditEvent43_50.java @@ -0,0 +1,396 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class AuditEvent43_50 { + + public static org.hl7.fhir.r5.model.AuditEvent convertAuditEvent(org.hl7.fhir.r4b.model.AuditEvent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent tgt = new org.hl7.fhir.r5.model.AuditEvent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasType()) + tgt.getCategoryFirstRep().addCoding(Coding43_50.convertCoding(src.getType())); + for (org.hl7.fhir.r4b.model.Coding t : src.getSubtype()) tgt.getCode().addCoding(Coding43_50.convertCoding(t)); + if (src.hasAction()) + tgt.setActionElement(convertAuditEventAction(src.getActionElement())); + if (src.hasPeriod()) + tgt.setOccurred(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasRecorded()) + tgt.setRecordedElement(Instant43_50.convertInstant(src.getRecordedElement())); + if (src.hasOutcome()) + tgt.getOutcome().getCode().setSystem("http://terminology.hl7.org/CodeSystem/audit-event-outcome").setCode(src.getOutcome().toCode()); + if (src.hasOutcomeDesc()) + tgt.getOutcome().getDetailFirstRep().setTextElement(String43_50.convertString(src.getOutcomeDescElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPurposeOfEvent()) + tgt.addAuthorization(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) + tgt.addAgent(convertAuditEventAgentComponent(t)); + if (src.hasSource()) + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + for (org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) + tgt.addEntity(convertAuditEventEntityComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.AuditEvent convertAuditEvent(org.hl7.fhir.r5.model.AuditEvent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.AuditEvent tgt = new org.hl7.fhir.r4b.model.AuditEvent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.getCategoryFirstRep().hasCoding()) { + tgt.setType(Coding43_50.convertCoding(src.getCategoryFirstRep().getCodingFirstRep())); + } + for (org.hl7.fhir.r5.model.Coding t : src.getCode().getCoding()) tgt.addSubtype(Coding43_50.convertCoding(t)); + if (src.hasAction()) + tgt.setActionElement(convertAuditEventAction(src.getActionElement())); + if (src.hasOccurredPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getOccurredPeriod())); + if (src.hasRecorded()) + tgt.setRecordedElement(Instant43_50.convertInstant(src.getRecordedElement())); + if (src.hasOutcome() && "http://terminology.hl7.org/CodeSystem/audit-event-outcome".equals(src.getOutcome().getCode().getSystem())) + tgt.getOutcomeElement().setValueAsString(src.getOutcome().getCode().getCode()); + if (src.getOutcome().getDetailFirstRep().hasText()) + tgt.setOutcomeDescElement(String43_50.convertString(src.getOutcome().getDetailFirstRep().getTextElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization()) + tgt.addPurposeOfEvent(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) + tgt.addAgent(convertAuditEventAgentComponent(t)); + if (src.hasSource()) + tgt.setSource(convertAuditEventSourceComponent(src.getSource())); + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) + tgt.addEntity(convertAuditEventEntityComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getRole()) + tgt.addRole(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasWho()) + tgt.setWho(Reference43_50.convertReference(src.getWho())); +// if (src.hasAltId()) +// tgt.setAltIdElement(String43_50.convertString(src.getAltIdElement())); +// if (src.hasName()) +// tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasRequestor()) + tgt.setRequestorElement(Boolean43_50.convertBoolean(src.getRequestorElement())); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (org.hl7.fhir.r4b.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri43_50.convertUri(t)); +// if (src.hasMedia()) +// tgt.setMedia(Coding43_50.convertCoding(src.getMedia())); +// if (src.hasNetwork()) +// tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPurposeOfUse()) + tgt.addAuthorization(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) + tgt.addRole(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasWho()) + tgt.setWho(Reference43_50.convertReference(src.getWho())); +// if (src.hasAltId()) +// tgt.setAltIdElement(String43_50.convertString(src.getAltIdElement())); +// if (src.hasName()) +// tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasRequestor()) + tgt.setRequestorElement(Boolean43_50.convertBoolean(src.getRequestorElement())); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri43_50.convertUri(t)); +// if (src.hasMedia()) +// tgt.setMedia(Coding43_50.convertCoding(src.getMedia())); +// if (src.hasNetwork()) +// tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization()) + tgt.addPurposeOfUse(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + +// public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasAddress()) +// tgt.setAddressElement(String43_50.convertString(src.getAddressElement())); +// if (src.hasType()) +// tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasAddress()) +// tgt.setAddressElement(String43_50.convertString(src.getAddressElement())); +// if (src.hasType()) +// tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement())); +// return tgt; +// } +// +// static public org.hl7.fhir.r5.model.Enumeration convertAuditEventAgentNetworkType(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.AuditEventAgentNetworkTypeEnumFactory()); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// switch (src.getValue()) { +// case _1: +// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1); +// break; +// case _2: +// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2); +// break; +// case _3: +// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3); +// break; +// case _4: +// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4); +// break; +// case _5: +// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5); +// break; +// default: +// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL); +// break; +// } +// return tgt; +// } +// +// static public org.hl7.fhir.r4b.model.Enumeration convertAuditEventAgentNetworkType(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.AuditEventAgentNetworkTypeEnumFactory()); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// switch (src.getValue()) { +// case _1: +// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._1); +// break; +// case _2: +// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._2); +// break; +// case _3: +// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._3); +// break; +// case _4: +// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._4); +// break; +// case _5: +// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._5); +// break; +// default: +// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType.NULL); +// break; +// } +// return tgt; +// } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); +// if (src.hasSite()) +// tgt.setSiteElement(String43_50.convertString(src.getSiteElement())); + if (src.hasObserver()) + tgt.setObserver(Reference43_50.convertReference(src.getObserver())); + for (org.hl7.fhir.r4b.model.Coding t : src.getType()) tgt.addType().addCoding(Coding43_50.convertCoding(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventSourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); +// if (src.hasSite()) +// tgt.setSiteElement(String43_50.convertString(src.getSiteElement())); + if (src.hasObserver()) + tgt.setObserver(Reference43_50.convertReference(src.getObserver())); + for (CodeableConcept t : src.getType()) tgt.addType(Coding43_50.convertCoding(t.getCodingFirstRep())); + return tgt; + } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasWhat()) + tgt.setWhat(Reference43_50.convertReference(src.getWhat())); +// if (src.hasType()) +// tgt.setType(Coding43_50.convertCoding(src.getType())); + if (src.hasRole()) + tgt.getRole().addCoding(Coding43_50.convertCoding(src.getRole())); +// if (src.hasLifecycle()) +// tgt.setLifecycle(Coding43_50.convertCoding(src.getLifecycle())); + for (org.hl7.fhir.r4b.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel().addCoding(Coding43_50.convertCoding(t)); +// if (src.hasName()) +// tgt.setNameElement(String43_50.convertString(src.getNameElement())); + // if (src.hasDescription()) + // tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasQuery()) + tgt.setQueryElement(Base64Binary43_50.convertBase64Binary(src.getQueryElement())); + for (org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) + tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasWhat()) + tgt.setWhat(Reference43_50.convertReference(src.getWhat())); +// if (src.hasType()) +// tgt.setType(Coding43_50.convertCoding(src.getType())); + if (src.hasRole()) + tgt.setRole(Coding43_50.convertCoding(src.getRole().getCodingFirstRep())); +// if (src.hasLifecycle()) +// tgt.setLifecycle(Coding43_50.convertCoding(src.getLifecycle())); + for (CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding43_50.convertCoding(t.getCodingFirstRep())); +// if (src.hasName()) +// tgt.setNameElement(String43_50.convertString(src.getNameElement())); + // if (src.hasDescription()) + // tgt.setDescriptionElement(convertString(src.getDescriptionElement())); + if (src.hasQuery()) + tgt.setQueryElement(Base64Binary43_50.convertBase64Binary(src.getQueryElement())); + for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) + tgt.addDetail(convertAuditEventEntityDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.getType().setTextElement(String43_50.convertString(src.getTypeElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.getType().hasTextElement()) + tgt.setTypeElement(String43_50.convertString(src.getType().getTextElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Basic43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Basic43_50.java new file mode 100644 index 000000000..1df4a2f36 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Basic43_50.java @@ -0,0 +1,76 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Basic43_50 { + + public static org.hl7.fhir.r5.model.Basic convertBasic(org.hl7.fhir.r4b.model.Basic src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Basic tgt = new org.hl7.fhir.r5.model.Basic(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasCreated()) + tgt.setCreatedElement(Date43_50.convertDatetoDateTime(src.getCreatedElement())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Basic convertBasic(org.hl7.fhir.r5.model.Basic src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Basic tgt = new org.hl7.fhir.r4b.model.Basic(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasCreated()) + tgt.setCreatedElement(Date43_50.convertDateTimeToDate(src.getCreatedElement())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + 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/Binary43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Binary43_50.java new file mode 100644 index 000000000..ba98c1f64 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Binary43_50.java @@ -0,0 +1,67 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Base64Binary43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Binary43_50 { + + public static org.hl7.fhir.r5.model.Binary convertBinary(org.hl7.fhir.r4b.model.Binary src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Binary tgt = new org.hl7.fhir.r5.model.Binary(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt); + if (src.hasContentType()) + tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement())); + if (src.hasSecurityContext()) + tgt.setSecurityContext(Reference43_50.convertReference(src.getSecurityContext())); + if (src.hasData()) + tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Binary convertBinary(org.hl7.fhir.r5.model.Binary src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Binary tgt = new org.hl7.fhir.r4b.model.Binary(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt); + if (src.hasContentType()) + tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement())); + if (src.hasSecurityContext()) + tgt.setSecurityContext(Reference43_50.convertReference(src.getSecurityContext())); + if (src.hasData()) + tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement())); + 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/BiologicallyDerivedProduct43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/BiologicallyDerivedProduct43_50.java new file mode 100644 index 000000000..822b5ddbf --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/BiologicallyDerivedProduct43_50.java @@ -0,0 +1,353 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class BiologicallyDerivedProduct43_50 { + + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); +// if (src.hasProductCategory()) +// tgt.setProductCategoryElement(convertBiologicallyDerivedProductCategory(src.getProductCategoryElement())); +// if (src.hasProductCode()) +// tgt.setProductCode(CodeableConcept43_50.convertCodeableConcept(src.getProductCode())); +// if (src.hasStatus()) +// tgt.setStatusElement(convertBiologicallyDerivedProductStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getRequest()) tgt.addRequest(Reference43_50.convertReference(t)); +// if (src.hasQuantity()) +// tgt.setQuantityElement(Integer43_50.convertInteger(src.getQuantityElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getParent()) tgt.addParent(Reference43_50.convertReference(t)); + if (src.hasCollection()) + tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection())); +// for (org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing()) +// tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t)); +// if (src.hasManipulation()) +// tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation())); +// for (org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage()) +// tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r5.model.BiologicallyDerivedProduct src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); +// if (src.hasProductCategory()) +// tgt.setProductCategoryElement(convertBiologicallyDerivedProductCategory(src.getProductCategoryElement())); +// if (src.hasProductCode()) +// tgt.setProductCode(CodeableConcept43_50.convertCodeableConcept(src.getProductCode())); +// if (src.hasStatus()) +// tgt.setStatusElement(convertBiologicallyDerivedProductStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) tgt.addRequest(Reference43_50.convertReference(t)); +// if (src.hasQuantity()) +// tgt.setQuantityElement(Integer43_50.convertInteger(src.getQuantityElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getParent()) tgt.addParent(Reference43_50.convertReference(t)); + if (src.hasCollection()) + tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection())); +// for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing()) +// tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t)); +// if (src.hasManipulation()) +// tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation())); +// for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage()) +// tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t)); + return tgt; + } +// +// static public org.hl7.fhir.r5.model.Enumeration convertBiologicallyDerivedProductCategory(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.BiologicallyDerivedProduct.BiologicallyDerivedProductCategoryEnumFactory()); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// switch (src.getValue()) { +// case ORGAN: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN); +// break; +// case TISSUE: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE); +// break; +// case FLUID: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID); +// break; +// case CELLS: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS); +// break; +// case BIOLOGICALAGENT: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT); +// break; +// default: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL); +// break; +// } +// return tgt; +// } +// +// static public org.hl7.fhir.r4b.model.Enumeration convertBiologicallyDerivedProductCategory(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.BiologicallyDerivedProduct.BiologicallyDerivedProductCategoryEnumFactory()); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// switch (src.getValue()) { +// case ORGAN: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN); +// break; +// case TISSUE: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE); +// break; +// case FLUID: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID); +// break; +// case CELLS: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS); +// break; +// case BIOLOGICALAGENT: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT); +// break; +// default: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL); +// break; +// } +// return tgt; +// } +// +// static public org.hl7.fhir.r5.model.Enumeration convertBiologicallyDerivedProductStatus(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.BiologicallyDerivedProduct.BiologicallyDerivedProductStatusEnumFactory()); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// switch (src.getValue()) { +// case AVAILABLE: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE); +// break; +// case UNAVAILABLE: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE); +// break; +// default: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL); +// break; +// } +// return tgt; +// } +// +// static public org.hl7.fhir.r4b.model.Enumeration convertBiologicallyDerivedProductStatus(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.BiologicallyDerivedProduct.BiologicallyDerivedProductStatusEnumFactory()); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// switch (src.getValue()) { +// case AVAILABLE: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE); +// break; +// case UNAVAILABLE: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE); +// break; +// default: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL); +// break; +// } +// return tgt; +// } + + public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCollector()) + tgt.setCollector(Reference43_50.convertReference(src.getCollector())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + if (src.hasCollected()) + tgt.setCollected(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCollected())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCollector()) + tgt.setCollector(Reference43_50.convertReference(src.getCollector())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + if (src.hasCollected()) + tgt.setCollected(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCollected())); + return tgt; + } + +// public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasDescription()) +// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasProcedure()) +// tgt.setProcedure(CodeableConcept43_50.convertCodeableConcept(src.getProcedure())); +// if (src.hasAdditive()) +// tgt.setAdditive(Reference43_50.convertReference(src.getAdditive())); +// if (src.hasTime()) +// tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasDescription()) +// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasProcedure()) +// tgt.setProcedure(CodeableConcept43_50.convertCodeableConcept(src.getProcedure())); +// if (src.hasAdditive()) +// tgt.setAdditive(Reference43_50.convertReference(src.getAdditive())); +// if (src.hasTime()) +// tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime())); +// return tgt; +// } +// +// public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasDescription()) +// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasTime()) +// tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasDescription()) +// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasTime()) +// tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime())); +// return tgt; +// } +// +// public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasDescription()) +// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasTemperature()) +// tgt.setTemperatureElement(Decimal43_50.convertDecimal(src.getTemperatureElement())); +// if (src.hasScale()) +// tgt.setScaleElement(convertBiologicallyDerivedProductStorageScale(src.getScaleElement())); +// if (src.hasDuration()) +// tgt.setDuration(Period43_50.convertPeriod(src.getDuration())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasDescription()) +// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasTemperature()) +// tgt.setTemperatureElement(Decimal43_50.convertDecimal(src.getTemperatureElement())); +// if (src.hasScale()) +// tgt.setScaleElement(convertBiologicallyDerivedProductStorageScale(src.getScaleElement())); +// if (src.hasDuration()) +// tgt.setDuration(Period43_50.convertPeriod(src.getDuration())); +// return tgt; +// } +// +// static public org.hl7.fhir.r5.model.Enumeration convertBiologicallyDerivedProductStorageScale(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.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory()); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// switch (src.getValue()) { +// case FARENHEIT: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT); +// break; +// case CELSIUS: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS); +// break; +// case KELVIN: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN); +// break; +// default: +// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL); +// break; +// } +// return tgt; +// } +// +// static public org.hl7.fhir.r4b.model.Enumeration convertBiologicallyDerivedProductStorageScale(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.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory()); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// switch (src.getValue()) { +// case FARENHEIT: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT); +// break; +// case CELSIUS: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS); +// break; +// case KELVIN: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN); +// break; +// default: +// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL); +// break; +// } +// return tgt; +// } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/BodyStructure43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/BodyStructure43_50.java new file mode 100644 index 000000000..63377a0c6 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/BodyStructure43_50.java @@ -0,0 +1,88 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Attachment43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class BodyStructure43_50 { + + public static org.hl7.fhir.r5.model.BodyStructure convertBodyStructure(org.hl7.fhir.r4b.model.BodyStructure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.BodyStructure tgt = new org.hl7.fhir.r5.model.BodyStructure(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasMorphology()) + tgt.setMorphology(CodeableConcept43_50.convertCodeableConcept(src.getMorphology())); +// if (src.hasLocation()) +// tgt.setLocation(CodeableConcept43_50.convertCodeableConcept(src.getLocation())); +// for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getLocationQualifier()) +// tgt.addLocationQualifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.Attachment t : src.getImage()) tgt.addImage(Attachment43_50.convertAttachment(t)); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.BodyStructure convertBodyStructure(org.hl7.fhir.r5.model.BodyStructure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.BodyStructure tgt = new org.hl7.fhir.r4b.model.BodyStructure(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasMorphology()) + tgt.setMorphology(CodeableConcept43_50.convertCodeableConcept(src.getMorphology())); +// if (src.hasLocation()) +// tgt.setLocation(CodeableConcept43_50.convertCodeableConcept(src.getLocation())); +// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLocationQualifier()) +// tgt.addLocationQualifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.Attachment t : src.getImage()) tgt.addImage(Attachment43_50.convertAttachment(t)); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + 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/Bundle43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Bundle43_50.java new file mode 100644 index 000000000..40b980df5 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Bundle43_50.java @@ -0,0 +1,429 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Signature43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Bundle43_50 { + + public static org.hl7.fhir.r5.model.Bundle convertBundle(org.hl7.fhir.r4b.model.Bundle src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle tgt = new org.hl7.fhir.r5.model.Bundle(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasType()) + tgt.setTypeElement(convertBundleType(src.getTypeElement())); + if (src.hasTimestamp()) + tgt.setTimestampElement(Instant43_50.convertInstant(src.getTimestampElement())); + if (src.hasTotal()) + tgt.setTotalElement(UnsignedInt43_50.convertUnsignedInt(src.getTotalElement())); + for (org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + for (org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent t : src.getEntry()) + tgt.addEntry(convertBundleEntryComponent(t)); + if (src.hasSignature()) + tgt.setSignature(Signature43_50.convertSignature(src.getSignature())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Bundle convertBundle(org.hl7.fhir.r5.model.Bundle src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Bundle tgt = new org.hl7.fhir.r4b.model.Bundle(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasType()) + tgt.setTypeElement(convertBundleType(src.getTypeElement())); + if (src.hasTimestamp()) + tgt.setTimestampElement(Instant43_50.convertInstant(src.getTimestampElement())); + if (src.hasTotal()) + tgt.setTotalElement(UnsignedInt43_50.convertUnsignedInt(src.getTotalElement())); + for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry()) + tgt.addEntry(convertBundleEntryComponent(t)); + if (src.hasSignature()) + tgt.setSignature(Signature43_50.convertSignature(src.getSignature())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRelation()) + tgt.setRelationElement(String43_50.convertString(src.getRelationElement())); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r5.model.Bundle.BundleLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRelation()) + tgt.setRelationElement(String43_50.convertString(src.getRelationElement())); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasFullUrl()) + tgt.setFullUrlElement(Uri43_50.convertUri(src.getFullUrlElement())); + if (src.hasResource()) + tgt.setResource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getResource())); + if (src.hasSearch()) + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + if (src.hasRequest()) + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); + if (src.hasFullUrl()) + tgt.setFullUrlElement(Uri43_50.convertUri(src.getFullUrlElement())); + if (src.hasResource()) + tgt.setResource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getResource())); + if (src.hasSearch()) + tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); + if (src.hasRequest()) + tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntrySearchComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertSearchEntryMode(src.getModeElement())); + if (src.hasScore()) + tgt.setScoreElement(Decimal43_50.convertDecimal(src.getScoreElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleEntrySearchComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertSearchEntryMode(src.getModeElement())); + if (src.hasScore()) + tgt.setScoreElement(Decimal43_50.convertDecimal(src.getScoreElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMethod()) + tgt.setMethodElement(convertHTTPVerb(src.getMethodElement())); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasIfNoneMatch()) + tgt.setIfNoneMatchElement(String43_50.convertString(src.getIfNoneMatchElement())); + if (src.hasIfModifiedSince()) + tgt.setIfModifiedSinceElement(Instant43_50.convertInstant(src.getIfModifiedSinceElement())); + if (src.hasIfMatch()) + tgt.setIfMatchElement(String43_50.convertString(src.getIfMatchElement())); + if (src.hasIfNoneExist()) + tgt.setIfNoneExistElement(String43_50.convertString(src.getIfNoneExistElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMethod()) + tgt.setMethodElement(convertHTTPVerb(src.getMethodElement())); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasIfNoneMatch()) + tgt.setIfNoneMatchElement(String43_50.convertString(src.getIfNoneMatchElement())); + if (src.hasIfModifiedSince()) + tgt.setIfModifiedSinceElement(Instant43_50.convertInstant(src.getIfModifiedSinceElement())); + if (src.hasIfMatch()) + tgt.setIfMatchElement(String43_50.convertString(src.getIfMatchElement())); + if (src.hasIfNoneExist()) + tgt.setIfNoneExistElement(String43_50.convertString(src.getIfNoneExistElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasStatus()) + tgt.setStatusElement(String43_50.convertString(src.getStatusElement())); + if (src.hasLocation()) + tgt.setLocationElement(Uri43_50.convertUri(src.getLocationElement())); + if (src.hasEtag()) + tgt.setEtagElement(String43_50.convertString(src.getEtagElement())); + if (src.hasLastModified()) + tgt.setLastModifiedElement(Instant43_50.convertInstant(src.getLastModifiedElement())); + if (src.hasOutcome()) + tgt.setOutcome(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getOutcome())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleEntryResponseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasStatus()) + tgt.setStatusElement(String43_50.convertString(src.getStatusElement())); + if (src.hasLocation()) + tgt.setLocationElement(Uri43_50.convertUri(src.getLocationElement())); + if (src.hasEtag()) + tgt.setEtagElement(String43_50.convertString(src.getEtagElement())); + if (src.hasLastModified()) + tgt.setLastModifiedElement(Instant43_50.convertInstant(src.getLastModifiedElement())); + if (src.hasOutcome()) + tgt.setOutcome(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getOutcome())); + 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/CapabilityStatement43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CapabilityStatement43_50.java new file mode 100644 index 000000000..952611673 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CapabilityStatement43_50.java @@ -0,0 +1,1076 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class CapabilityStatement43_50 { + + public static org.hl7.fhir.r5.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r4b.model.CapabilityStatement src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement tgt = new org.hl7.fhir.r5.model.CapabilityStatement(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasKind()) + tgt.setKindElement(convertCapabilityStatementKind(src.getKindElement())); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiates()) + tgt.getInstantiates().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getImports()) + tgt.getImports().add(Canonical43_50.convertCanonical(t)); + if (src.hasSoftware()) + tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); + if (src.hasImplementation()) + tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation())); + if (src.hasFhirVersion()) + tgt.setFhirVersionElement(Enumerations43_50.convertFHIRVersion(src.getFhirVersionElement())); + for (org.hl7.fhir.r4b.model.CodeType t : src.getFormat()) tgt.getFormat().add(Code43_50.convertCode(t)); + for (org.hl7.fhir.r4b.model.CodeType t : src.getPatchFormat()) tgt.getPatchFormat().add(Code43_50.convertCode(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getImplementationGuide()) + tgt.getImplementationGuide().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) + tgt.addRest(convertCapabilityStatementRestComponent(t)); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) + tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) + tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r5.model.CapabilityStatement src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement tgt = new org.hl7.fhir.r4b.model.CapabilityStatement(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasKind()) + tgt.setKindElement(convertCapabilityStatementKind(src.getKindElement())); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiates()) + tgt.getInstantiates().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getImports()) + tgt.getImports().add(Canonical43_50.convertCanonical(t)); + if (src.hasSoftware()) + tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware())); + if (src.hasImplementation()) + tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation())); + if (src.hasFhirVersion()) + tgt.setFhirVersionElement(Enumerations43_50.convertFHIRVersion(src.getFhirVersionElement())); + for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.getFormat().add(Code43_50.convertCode(t)); + for (org.hl7.fhir.r5.model.CodeType t : src.getPatchFormat()) tgt.getPatchFormat().add(Code43_50.convertCode(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getImplementationGuide()) + tgt.getImplementationGuide().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest()) + tgt.addRest(convertCapabilityStatementRestComponent(t)); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging()) + tgt.addMessaging(convertCapabilityStatementMessagingComponent(t)); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument()) + tgt.addDocument(convertCapabilityStatementDocumentComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasReleaseDate()) + tgt.setReleaseDateElement(DateTime43_50.convertDateTime(src.getReleaseDateElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementSoftwareComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasReleaseDate()) + tgt.setReleaseDateElement(DateTime43_50.convertDateTime(src.getReleaseDateElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasUrl()) + tgt.setUrlElement(Url43_50.convertUrl(src.getUrlElement())); + if (src.hasCustodian()) + tgt.setCustodian(Reference43_50.convertReference(src.getCustodian())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementImplementationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasUrl()) + tgt.setUrlElement(Url43_50.convertUrl(src.getUrlElement())); + if (src.hasCustodian()) + tgt.setCustodian(Reference43_50.convertReference(src.getCustodian())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertRestfulCapabilityMode(src.getModeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + if (src.hasSecurity()) + tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) + tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); + for (org.hl7.fhir.r4b.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) + tgt.addInteraction(convertSystemInteractionComponent(t)); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) + tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) + tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getCompartment()) + tgt.getCompartment().add(Canonical43_50.convertCanonical(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertRestfulCapabilityMode(src.getModeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + if (src.hasSecurity()) + tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity())); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource()) + tgt.addResource(convertCapabilityStatementRestResourceComponent(t)); + for (org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction()) + tgt.addInteraction(convertSystemInteractionComponent(t)); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) + tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) + tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getCompartment()) + tgt.getCompartment().add(Canonical43_50.convertCanonical(t)); + return tgt; + } + + 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.Enumerations.RestfulCapabilityModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case CLIENT: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode.CLIENT); + break; + case SERVER: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RestfulCapabilityMode.SERVER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.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; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCors()) + tgt.setCorsElement(Boolean43_50.convertBoolean(src.getCorsElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getService()) + tgt.addService(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestSecurityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCors()) + tgt.setCorsElement(Boolean43_50.convertBoolean(src.getCorsElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService()) + tgt.addService(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(Code43_50.convertResourceEnum(src.getTypeElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getSupportedProfile()) + tgt.getSupportedProfile().add(Canonical43_50.convertCanonical(t)); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + for (org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) + tgt.addInteraction(convertResourceInteractionComponent(t)); + if (src.hasVersioning()) + tgt.setVersioningElement(convertResourceVersionPolicy(src.getVersioningElement())); + if (src.hasReadHistory()) + tgt.setReadHistoryElement(Boolean43_50.convertBoolean(src.getReadHistoryElement())); + if (src.hasUpdateCreate()) + tgt.setUpdateCreateElement(Boolean43_50.convertBoolean(src.getUpdateCreateElement())); + if (src.hasConditionalCreate()) + tgt.setConditionalCreateElement(Boolean43_50.convertBoolean(src.getConditionalCreateElement())); + if (src.hasConditionalRead()) + tgt.setConditionalReadElement(convertConditionalReadStatus(src.getConditionalReadElement())); + if (src.hasConditionalUpdate()) + tgt.setConditionalUpdateElement(Boolean43_50.convertBoolean(src.getConditionalUpdateElement())); + if (src.hasConditionalDelete()) + tgt.setConditionalDeleteElement(convertConditionalDeleteStatus(src.getConditionalDeleteElement())); + tgt.setReferencePolicy(src.getReferencePolicy().stream() + .map(CapabilityStatement43_50::convertReferenceHandlingPolicy) + .collect(Collectors.toList())); + for (org.hl7.fhir.r4b.model.StringType t : src.getSearchInclude()) + tgt.getSearchInclude().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getSearchRevInclude()) + tgt.getSearchRevInclude().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) + tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) + tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(Code43_50.convertResourceEnum(src.getTypeElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getSupportedProfile()) + tgt.getSupportedProfile().add(Canonical43_50.convertCanonical(t)); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction()) + tgt.addInteraction(convertResourceInteractionComponent(t)); + if (src.hasVersioning()) + tgt.setVersioningElement(convertResourceVersionPolicy(src.getVersioningElement())); + if (src.hasReadHistory()) + tgt.setReadHistoryElement(Boolean43_50.convertBoolean(src.getReadHistoryElement())); + if (src.hasUpdateCreate()) + tgt.setUpdateCreateElement(Boolean43_50.convertBoolean(src.getUpdateCreateElement())); + if (src.hasConditionalCreate()) + tgt.setConditionalCreateElement(Boolean43_50.convertBoolean(src.getConditionalCreateElement())); + if (src.hasConditionalRead()) + tgt.setConditionalReadElement(convertConditionalReadStatus(src.getConditionalReadElement())); + if (src.hasConditionalUpdate()) + tgt.setConditionalUpdateElement(Boolean43_50.convertBoolean(src.getConditionalUpdateElement())); + if (src.hasConditionalDelete()) + tgt.setConditionalDeleteElement(convertConditionalDeleteStatus(src.getConditionalDeleteElement())); + tgt.setReferencePolicy(src.getReferencePolicy().stream() + .map(CapabilityStatement43_50::convertReferenceHandlingPolicy) + .collect(Collectors.toList())); + for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude()) + tgt.getSearchInclude().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude()) + tgt.getSearchRevInclude().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam()) + tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t)); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation()) + tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertTypeRestfulInteraction(src.getCodeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.ResourceInteractionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertTypeRestfulInteraction(src.getCodeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + if (src.hasType()) + tgt.setTypeElement(Enumerations43_50.convertSearchParamType(src.getTypeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + if (src.hasType()) + tgt.setTypeElement(Enumerations43_50.convertSearchParamType(src.getTypeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent convertCapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent convertCapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r4b.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertSystemRestfulInteraction(src.getCodeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.SystemInteractionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertSystemRestfulInteraction(src.getCodeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) + tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + if (src.hasReliableCache()) + tgt.setReliableCacheElement(UnsignedInt43_50.convertUnsignedInt(src.getReliableCacheElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + for (org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) + tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint()) + tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t)); + if (src.hasReliableCache()) + tgt.setReliableCacheElement(UnsignedInt43_50.convertUnsignedInt(src.getReliableCacheElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage()) + tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProtocol()) + tgt.setProtocol(Coding43_50.convertCoding(src.getProtocol())); + if (src.hasAddress()) + tgt.setAddressElement(Url43_50.convertUrl(src.getAddressElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProtocol()) + tgt.setProtocol(Coding43_50.convertCoding(src.getProtocol())); + if (src.hasAddress()) + tgt.setAddressElement(Url43_50.convertUrl(src.getAddressElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertEventCapabilityMode(src.getModeElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertEventCapabilityMode(src.getModeElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertDocumentMode(src.getModeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementDocumentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertDocumentMode(src.getModeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(MarkDown43_50.convertMarkdown(src.getDocumentationElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..7ee43d634 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CarePlan43_50.java @@ -0,0 +1,527 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class CarePlan43_50 { + + public static org.hl7.fhir.r5.model.CarePlan convertCarePlan(org.hl7.fhir.r4b.model.CarePlan src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CarePlan tgt = new org.hl7.fhir.r5.model.CarePlan(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement())); + if (src.hasIntent()) + tgt.setIntentElement(convertCarePlanIntent(src.getIntentElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasAuthor()) + tgt.setCustodian(Reference43_50.convertReference(src.getAuthor())); + for (org.hl7.fhir.r4b.model.Reference t : src.getContributor()) + tgt.addContributor(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getCareTeam()) tgt.addCareTeam(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getAddresses()) + tgt.addAddresses(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) + tgt.addActivity(convertCarePlanActivityComponent(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CarePlan convertCarePlan(org.hl7.fhir.r5.model.CarePlan src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CarePlan tgt = new org.hl7.fhir.r4b.model.CarePlan(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement())); + if (src.hasIntent()) + tgt.setIntentElement(convertCarePlanIntent(src.getIntentElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasCustodian()) + tgt.setAuthor(Reference43_50.convertReference(src.getCustodian())); + for (org.hl7.fhir.r5.model.Reference t : src.getContributor()) + tgt.addContributor(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getCareTeam()) tgt.addCareTeam(Reference43_50.convertReference(t)); + for (CodeableReference t : src.getAddresses()) + if (t.hasReference()) + tgt.addAddresses(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) + tgt.addActivity(convertCarePlanActivityComponent(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getOutcomeCodeableConcept()) + tgt.addPerformedActivity(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getOutcomeReference()) + tgt.addPerformedActivity(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getProgress()) tgt.addProgress(Annotation43_50.convertAnnotation(t)); + if (src.hasReference()) + tgt.setPlannedActivityReference(Reference43_50.convertReference(src.getReference())); + if (src.hasDetail()) + tgt.setPlannedActivityDetail(convertCarePlanActivityDetailComponent(src.getDetail())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (CodeableReference t : src.getPerformedActivity()) + if (t.hasConcept()) + tgt.addOutcomeCodeableConcept(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getPerformedActivity()) + if (t.hasReference()) + tgt.addOutcomeReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Annotation t : src.getProgress()) tgt.addProgress(Annotation43_50.convertAnnotation(t)); + if (src.hasPlannedActivityReference()) + tgt.setReference(Reference43_50.convertReference(src.getPlannedActivityReference())); + if (src.hasPlannedActivityDetail()) + tgt.setDetail(convertCarePlanActivityDetailComponent(src.getPlannedActivityDetail())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasKind()) + tgt.setKindElement(convertCarePlanActivityKind(src.getKindElement())); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasScheduled()) + tgt.setScheduled(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getScheduled())); + if (src.hasLocation()) + tgt.getLocation().setReference(Reference43_50.convertReference(src.getLocation())); + for (org.hl7.fhir.r4b.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t)); + if (src.hasProduct()) + tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct())); + if (src.hasDailyAmount()) + tgt.setDailyAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getDailyAmount())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasKind()) + tgt.setKindElement(convertCarePlanActivityKind(src.getKindElement())); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasScheduled()) + tgt.setScheduled(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getScheduled())); + if (src.getLocation().hasReference()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation().getReference())); + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t)); + if (src.hasProduct()) + tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct())); + if (src.hasDailyAmount()) + tgt.setDailyAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getDailyAmount())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertCarePlanActivityKind(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.CarePlanActivityKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.APPOINTMENT); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST); + break; + case DEVICEREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST); + break; + case MEDICATIONREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER); + break; + case TASK: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.TASK); + break; + case SERVICEREQUEST: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST); + break; + case VISIONPRESCRIPTION: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertCarePlanActivityKind(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.CarePlanActivityKindEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case APPOINTMENT: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.APPOINTMENT); + break; + case COMMUNICATIONREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST); + break; + case DEVICEREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST); + break; + case MEDICATIONREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST); + break; + case NUTRITIONORDER: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER); + break; + case TASK: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.TASK); + break; + case SERVICEREQUEST: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST); + break; + case VISIONPRESCRIPTION: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertCarePlanActivityStatus(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.CarePlanActivityStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case NOTSTARTED: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); + break; + case SCHEDULED: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.SCHEDULED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.CANCELLED); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.STOPPED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.UNKNOWN); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertCarePlanActivityStatus(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.CarePlanActivityStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case NOTSTARTED: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.NOTSTARTED); + break; + case SCHEDULED: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.SCHEDULED); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.INPROGRESS); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.ONHOLD); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.CANCELLED); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.STOPPED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.UNKNOWN); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.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/CareTeam43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CareTeam43_50.java new file mode 100644 index 000000000..a144b6507 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CareTeam43_50.java @@ -0,0 +1,192 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class CareTeam43_50 { + + public static org.hl7.fhir.r5.model.CareTeam convertCareTeam(org.hl7.fhir.r4b.model.CareTeam src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CareTeam tgt = new org.hl7.fhir.r5.model.CareTeam(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCareTeamStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertCareTeamParticipantComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getManagingOrganization()) + tgt.addManagingOrganization(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CareTeam convertCareTeam(org.hl7.fhir.r5.model.CareTeam src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CareTeam tgt = new org.hl7.fhir.r4b.model.CareTeam(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCareTeamStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertCareTeamParticipantComponent(t)); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Reference t : src.getManagingOrganization()) + tgt.addManagingOrganization(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent tgt = new org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasMember()) + tgt.setMember(Reference43_50.convertReference(src.getMember())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + if (src.hasPeriod()) + tgt.setCoverage(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent tgt = new org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRole()) + tgt.addRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasMember()) + tgt.setMember(Reference43_50.convertReference(src.getMember())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + if (src.hasCoveragePeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getCoveragePeriod())); + 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/ChargeItem43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItem43_50.java new file mode 100644 index 000000000..48c74b590 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItem43_50.java @@ -0,0 +1,245 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ChargeItem43_50 { + + public static org.hl7.fhir.r5.model.ChargeItem convertChargeItem(org.hl7.fhir.r4b.model.ChargeItem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItem tgt = new org.hl7.fhir.r5.model.ChargeItem(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getDefinitionUri()) tgt.getDefinitionUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getDefinitionCanonical()) + tgt.getDefinitionCanonical().add(Canonical43_50.convertCanonical(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertChargeItemStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setContext(Reference43_50.convertReference(src.getContext())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + for (org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertChargeItemPerformerComponent(t)); + if (src.hasPerformingOrganization()) + tgt.setPerformingOrganization(Reference43_50.convertReference(src.getPerformingOrganization())); + if (src.hasRequestingOrganization()) + tgt.setRequestingOrganization(Reference43_50.convertReference(src.getRequestingOrganization())); + if (src.hasCostCenter()) + tgt.setCostCenter(Reference43_50.convertReference(src.getCostCenter())); + if (src.hasQuantity()) + tgt.setQuantity(Quantity43_50.convertQuantity(src.getQuantity())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getBodysite()) + tgt.addBodysite(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasFactorOverride()) + tgt.setFactorOverrideElement(Decimal43_50.convertDecimal(src.getFactorOverrideElement())); + if (src.hasPriceOverride()) + tgt.setPriceOverride(Money43_50.convertMoney(src.getPriceOverride())); + if (src.hasOverrideReason()) + tgt.setOverrideReasonElement(String43_50.convertString(src.getOverrideReasonElement())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasEnteredDate()) + tgt.setEnteredDateElement(DateTime43_50.convertDateTime(src.getEnteredDateElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReason()) + tgt.addReason(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getService()) tgt.addService(Reference43_50.convertReference(t)); + if (src.hasProductCodeableConcept()) + tgt.addProduct().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getProductCodeableConcept())); + else if (src.hasProductReference()) + tgt.addProduct().setReference(Reference43_50.convertReference(src.getProductReference())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAccount()) tgt.addAccount(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ChargeItem convertChargeItem(org.hl7.fhir.r5.model.ChargeItem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ChargeItem tgt = new org.hl7.fhir.r4b.model.ChargeItem(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getDefinitionUri()) tgt.getDefinitionUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getDefinitionCanonical()) + tgt.getDefinitionCanonical().add(Canonical43_50.convertCanonical(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertChargeItemStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setContext(Reference43_50.convertReference(src.getContext())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + for (org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertChargeItemPerformerComponent(t)); + if (src.hasPerformingOrganization()) + tgt.setPerformingOrganization(Reference43_50.convertReference(src.getPerformingOrganization())); + if (src.hasRequestingOrganization()) + tgt.setRequestingOrganization(Reference43_50.convertReference(src.getRequestingOrganization())); + if (src.hasCostCenter()) + tgt.setCostCenter(Reference43_50.convertReference(src.getCostCenter())); + if (src.hasQuantity()) + tgt.setQuantity(Quantity43_50.convertQuantity(src.getQuantity())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodysite()) + tgt.addBodysite(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasFactorOverride()) + tgt.setFactorOverrideElement(Decimal43_50.convertDecimal(src.getFactorOverrideElement())); + if (src.hasPriceOverride()) + tgt.setPriceOverride(Money43_50.convertMoney(src.getPriceOverride())); + if (src.hasOverrideReason()) + tgt.setOverrideReasonElement(String43_50.convertString(src.getOverrideReasonElement())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasEnteredDate()) + tgt.setEnteredDateElement(DateTime43_50.convertDateTime(src.getEnteredDateElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) + tgt.addReason(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getService()) tgt.addService(Reference43_50.convertReference(t)); + if (src.getProductFirstRep().hasConcept()) + tgt.setProduct(CodeableConcept43_50.convertCodeableConcept(src.getProductFirstRep().getConcept())); + if (src.getProductFirstRep().hasReference()) + tgt.setProduct(Reference43_50.convertReference(src.getProductFirstRep().getReference())); + for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent tgt = new org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent tgt = new org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + 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/ChargeItemDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItemDefinition43_50.java new file mode 100644 index 000000000..efadc1f3a --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ChargeItemDefinition43_50.java @@ -0,0 +1,294 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Money43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ChargeItemDefinition43_50 { + + public static org.hl7.fhir.r5.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r4b.model.ChargeItemDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItemDefinition tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + for (org.hl7.fhir.r4b.model.UriType t : src.getDerivedFromUri()) tgt.getDerivedFromUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getPartOf()) + tgt.getPartOf().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getReplaces()) + tgt.getReplaces().add(Canonical43_50.convertCanonical(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r4b.model.Reference t : src.getInstance()) tgt.addInstance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) + tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); + for (org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent t : src.getPropertyGroup()) + tgt.addPropertyGroup(convertChargeItemDefinitionPropertyGroupComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r5.model.ChargeItemDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ChargeItemDefinition tgt = new org.hl7.fhir.r4b.model.ChargeItemDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + for (org.hl7.fhir.r5.model.UriType t : src.getDerivedFromUri()) tgt.getDerivedFromUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getPartOf()) + tgt.getPartOf().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces()) + tgt.getReplaces().add(Canonical43_50.convertCanonical(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r5.model.Reference t : src.getInstance()) tgt.addInstance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) + tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); + for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent t : src.getPropertyGroup()) + tgt.addPropertyGroup(convertChargeItemDefinitionPropertyGroupComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent convertChargeItemDefinitionApplicabilityComponent(org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasLanguage()) + tgt.setLanguageElement(String43_50.convertString(src.getLanguageElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent convertChargeItemDefinitionApplicabilityComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent tgt = new org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasLanguage()) + tgt.setLanguageElement(String43_50.convertString(src.getLanguageElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) + tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); + for (org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent t : src.getPriceComponent()) + tgt.addPriceComponent(convertChargeItemDefinitionPropertyGroupPriceComponentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent tgt = new org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability()) + tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t)); + for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent t : src.getPriceComponent()) + tgt.addPriceComponent(convertChargeItemDefinitionPropertyGroupPriceComponentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent convertChargeItemDefinitionPropertyGroupPriceComponentComponent(org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertChargeItemDefinitionPriceComponentType(src.getTypeElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent convertChargeItemDefinitionPropertyGroupPriceComponentComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent tgt = new org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertChargeItemDefinitionPriceComponentType(src.getTypeElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertChargeItemDefinitionPriceComponentType(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.InvoicePriceComponentTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case BASE: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.BASE); + break; + case SURCHARGE: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.SURCHARGE); + break; + case DEDUCTION: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DEDUCTION); + break; + case DISCOUNT: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DISCOUNT); + break; + case TAX: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.TAX); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertChargeItemDefinitionPriceComponentType(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.InvoicePriceComponentTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case BASE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.BASE); + break; + case SURCHARGE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.SURCHARGE); + break; + case DEDUCTION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.DEDUCTION); + break; + case DISCOUNT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.DISCOUNT); + break; + case TAX: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.TAX); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.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/Claim43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Claim43_50.java new file mode 100644 index 000000000..bcaab55c7 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Claim43_50.java @@ -0,0 +1,739 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Claim43_50 { + + public static org.hl7.fhir.r5.model.Claim convertClaim(org.hl7.fhir.r4b.model.Claim src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim tgt = new org.hl7.fhir.r5.model.Claim(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertClaimStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUseElement(convertUse(src.getUseElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasBillablePeriod()) + tgt.setBillablePeriod(Period43_50.convertPeriod(src.getBillablePeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve())); + for (org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent t : src.getRelated()) + tgt.addRelated(convertRelatedClaimComponent(t)); + if (src.hasPrescription()) + tgt.setPrescription(Reference43_50.convertReference(src.getPrescription())); + if (src.hasOriginalPrescription()) + tgt.setOriginalPrescription(Reference43_50.convertReference(src.getOriginalPrescription())); + if (src.hasPayee()) + tgt.setPayee(convertPayeeComponent(src.getPayee())); + if (src.hasReferral()) + tgt.setReferral(Reference43_50.convertReference(src.getReferral())); + if (src.hasFacility()) + tgt.setFacility(Reference43_50.convertReference(src.getFacility())); + for (org.hl7.fhir.r4b.model.Claim.CareTeamComponent t : src.getCareTeam()) + tgt.addCareTeam(convertCareTeamComponent(t)); + for (org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent t : src.getSupportingInfo()) + tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + for (org.hl7.fhir.r4b.model.Claim.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + for (org.hl7.fhir.r4b.model.Claim.ProcedureComponent t : src.getProcedure()) + tgt.addProcedure(convertProcedureComponent(t)); + for (org.hl7.fhir.r4b.model.Claim.InsuranceComponent t : src.getInsurance()) + tgt.addInsurance(convertInsuranceComponent(t)); + if (src.hasAccident()) + tgt.setAccident(convertAccidentComponent(src.getAccident())); + for (org.hl7.fhir.r4b.model.Claim.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + if (src.hasTotal()) + tgt.setTotal(Money43_50.convertMoney(src.getTotal())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim convertClaim(org.hl7.fhir.r5.model.Claim src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim tgt = new org.hl7.fhir.r4b.model.Claim(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertClaimStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUseElement(convertUse(src.getUseElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasBillablePeriod()) + tgt.setBillablePeriod(Period43_50.convertPeriod(src.getBillablePeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve())); + for (org.hl7.fhir.r5.model.Claim.RelatedClaimComponent t : src.getRelated()) + tgt.addRelated(convertRelatedClaimComponent(t)); + if (src.hasPrescription()) + tgt.setPrescription(Reference43_50.convertReference(src.getPrescription())); + if (src.hasOriginalPrescription()) + tgt.setOriginalPrescription(Reference43_50.convertReference(src.getOriginalPrescription())); + if (src.hasPayee()) + tgt.setPayee(convertPayeeComponent(src.getPayee())); + if (src.hasReferral()) + tgt.setReferral(Reference43_50.convertReference(src.getReferral())); + if (src.hasFacility()) + tgt.setFacility(Reference43_50.convertReference(src.getFacility())); + for (org.hl7.fhir.r5.model.Claim.CareTeamComponent t : src.getCareTeam()) + tgt.addCareTeam(convertCareTeamComponent(t)); + for (org.hl7.fhir.r5.model.Claim.SupportingInformationComponent t : src.getSupportingInfo()) + tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + for (org.hl7.fhir.r5.model.Claim.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + for (org.hl7.fhir.r5.model.Claim.ProcedureComponent t : src.getProcedure()) + tgt.addProcedure(convertProcedureComponent(t)); + for (org.hl7.fhir.r5.model.Claim.InsuranceComponent t : src.getInsurance()) + tgt.addInsurance(convertInsuranceComponent(t)); + if (src.hasAccident()) + tgt.setAccident(convertAccidentComponent(src.getAccident())); + for (org.hl7.fhir.r5.model.Claim.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + if (src.hasTotal()) + tgt.setTotal(Money43_50.convertMoney(src.getTotal())); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.RelatedClaimComponent tgt = new org.hl7.fhir.r5.model.Claim.RelatedClaimComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasClaim()) + tgt.setClaim(Reference43_50.convertReference(src.getClaim())); + if (src.hasRelationship()) + tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship())); + if (src.hasReference()) + tgt.setReference(Identifier43_50.convertIdentifier(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r5.model.Claim.RelatedClaimComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent tgt = new org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasClaim()) + tgt.setClaim(Reference43_50.convertReference(src.getClaim())); + if (src.hasRelationship()) + tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship())); + if (src.hasReference()) + tgt.setReference(Identifier43_50.convertIdentifier(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r4b.model.Claim.PayeeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.PayeeComponent tgt = new org.hl7.fhir.r5.model.Claim.PayeeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r5.model.Claim.PayeeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.PayeeComponent tgt = new org.hl7.fhir.r4b.model.Claim.PayeeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r4b.model.Claim.CareTeamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.CareTeamComponent tgt = new org.hl7.fhir.r5.model.Claim.CareTeamComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasResponsible()) + tgt.setResponsibleElement(Boolean43_50.convertBoolean(src.getResponsibleElement())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasQualification()) + tgt.setQualification(CodeableConcept43_50.convertCodeableConcept(src.getQualification())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r5.model.Claim.CareTeamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.CareTeamComponent tgt = new org.hl7.fhir.r4b.model.Claim.CareTeamComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasResponsible()) + tgt.setResponsibleElement(Boolean43_50.convertBoolean(src.getResponsibleElement())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasQualification()) + tgt.setQualification(CodeableConcept43_50.convertCodeableConcept(src.getQualification())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.Claim.SupportingInformationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.Claim.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent tgt = new org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4b.model.Claim.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.Claim.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasDiagnosis()) + tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOnAdmission()) + tgt.setOnAdmission(CodeableConcept43_50.convertCodeableConcept(src.getOnAdmission())); + if (src.hasPackageCode()) + tgt.setPackageCode(CodeableConcept43_50.convertCodeableConcept(src.getPackageCode())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.Claim.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.DiagnosisComponent tgt = new org.hl7.fhir.r4b.model.Claim.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasDiagnosis()) + tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOnAdmission()) + tgt.setOnAdmission(CodeableConcept43_50.convertCodeableConcept(src.getOnAdmission())); + if (src.hasPackageCode()) + tgt.setPackageCode(CodeableConcept43_50.convertCodeableConcept(src.getPackageCode())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r4b.model.Claim.ProcedureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.ProcedureComponent tgt = new org.hl7.fhir.r5.model.Claim.ProcedureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasProcedure()) + tgt.setProcedure(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProcedure())); + for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r5.model.Claim.ProcedureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.ProcedureComponent tgt = new org.hl7.fhir.r4b.model.Claim.ProcedureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasProcedure()) + tgt.setProcedure(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProcedure())); + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4b.model.Claim.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.InsuranceComponent tgt = new org.hl7.fhir.r5.model.Claim.InsuranceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasFocal()) + tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement())); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getPreAuthRef()) + tgt.getPreAuthRef().add(String43_50.convertString(t)); + if (src.hasClaimResponse()) + tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.Claim.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.InsuranceComponent tgt = new org.hl7.fhir.r4b.model.Claim.InsuranceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasFocal()) + tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement())); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef()) + tgt.getPreAuthRef().add(String43_50.convertString(t)); + if (src.hasClaimResponse()) + tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r4b.model.Claim.AccidentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.AccidentComponent tgt = new org.hl7.fhir.r5.model.Claim.AccidentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r5.model.Claim.AccidentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.AccidentComponent tgt = new org.hl7.fhir.r4b.model.Claim.AccidentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r4b.model.Claim.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.ItemComponent tgt = new org.hl7.fhir.r5.model.Claim.ItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getCareTeamSequence()) + tgt.getCareTeamSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getDiagnosisSequence()) + tgt.getDiagnosisSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getProcedureSequence()) + tgt.getProcedureSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getInformationSequence()) + tgt.getInformationSequence().add(PositiveInt43_50.convertPositiveInt(t)); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubSite()) + tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getEncounter()) tgt.addEncounter(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Claim.DetailComponent t : src.getDetail()) tgt.addDetail(convertDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.Claim.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.ItemComponent tgt = new org.hl7.fhir.r4b.model.Claim.ItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getCareTeamSequence()) + tgt.getCareTeamSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDiagnosisSequence()) + tgt.getDiagnosisSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getProcedureSequence()) + tgt.getProcedureSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getInformationSequence()) + tgt.getInformationSequence().add(PositiveInt43_50.convertPositiveInt(t)); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) + tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEncounter()) tgt.addEncounter(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Claim.DetailComponent t : src.getDetail()) tgt.addDetail(convertDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.DetailComponent convertDetailComponent(org.hl7.fhir.r4b.model.Claim.DetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.DetailComponent tgt = new org.hl7.fhir.r5.model.Claim.DetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Claim.SubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.DetailComponent convertDetailComponent(org.hl7.fhir.r5.model.Claim.DetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.DetailComponent tgt = new org.hl7.fhir.r4b.model.Claim.DetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Claim.SubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Claim.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4b.model.Claim.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Claim.SubDetailComponent tgt = new org.hl7.fhir.r5.model.Claim.SubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Claim.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.Claim.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Claim.SubDetailComponent tgt = new org.hl7.fhir.r4b.model.Claim.SubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + 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/ClaimResponse43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClaimResponse43_50.java new file mode 100644 index 000000000..7053da1f8 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClaimResponse43_50.java @@ -0,0 +1,775 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ClaimResponse43_50 { + + public static org.hl7.fhir.r5.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r4b.model.ClaimResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse tgt = new org.hl7.fhir.r5.model.ClaimResponse(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertClaimResponseStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUseElement(convertUse(src.getUseElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasRequestor()) + tgt.setRequestor(Reference43_50.convertReference(src.getRequestor())); + if (src.hasRequest()) + tgt.setRequest(Reference43_50.convertReference(src.getRequest())); + if (src.hasOutcome()) + tgt.setOutcomeElement(convertRemittanceOutcome(src.getOutcomeElement())); + if (src.hasDisposition()) + tgt.setDispositionElement(String43_50.convertString(src.getDispositionElement())); + if (src.hasPreAuthRef()) + tgt.setPreAuthRefElement(String43_50.convertString(src.getPreAuthRefElement())); + if (src.hasPreAuthPeriod()) + tgt.setPreAuthPeriod(Period43_50.convertPeriod(src.getPreAuthPeriod())); + if (src.hasPayeeType()) + tgt.setPayeeType(CodeableConcept43_50.convertCodeableConcept(src.getPayeeType())); + for (org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent t : src.getAddItem()) + tgt.addAddItem(convertAddedItemComponent(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t)); + if (src.hasPayment()) + tgt.setPayment(convertPaymentComponent(src.getPayment())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve())); + if (src.hasFormCode()) + tgt.setFormCode(CodeableConcept43_50.convertCodeableConcept(src.getFormCode())); + if (src.hasForm()) + tgt.setForm(Attachment43_50.convertAttachment(src.getForm())); + for (org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent t : src.getProcessNote()) + tgt.addProcessNote(convertNoteComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getCommunicationRequest()) + tgt.addCommunicationRequest(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent t : src.getInsurance()) + tgt.addInsurance(convertInsuranceComponent(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent t : src.getError()) tgt.addError(convertErrorComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r5.model.ClaimResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse tgt = new org.hl7.fhir.r4b.model.ClaimResponse(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertClaimResponseStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUseElement(convertUse(src.getUseElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasRequestor()) + tgt.setRequestor(Reference43_50.convertReference(src.getRequestor())); + if (src.hasRequest()) + tgt.setRequest(Reference43_50.convertReference(src.getRequest())); + if (src.hasOutcome()) + tgt.setOutcomeElement(convertRemittanceOutcome(src.getOutcomeElement())); + if (src.hasDisposition()) + tgt.setDispositionElement(String43_50.convertString(src.getDispositionElement())); + if (src.hasPreAuthRef()) + tgt.setPreAuthRefElement(String43_50.convertString(src.getPreAuthRefElement())); + if (src.hasPreAuthPeriod()) + tgt.setPreAuthPeriod(Period43_50.convertPeriod(src.getPreAuthPeriod())); + if (src.hasPayeeType()) + tgt.setPayeeType(CodeableConcept43_50.convertCodeableConcept(src.getPayeeType())); + for (org.hl7.fhir.r5.model.ClaimResponse.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent t : src.getAddItem()) + tgt.addAddItem(convertAddedItemComponent(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t)); + if (src.hasPayment()) + tgt.setPayment(convertPaymentComponent(src.getPayment())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve())); + if (src.hasFormCode()) + tgt.setFormCode(CodeableConcept43_50.convertCodeableConcept(src.getFormCode())); + if (src.hasForm()) + tgt.setForm(Attachment43_50.convertAttachment(src.getForm())); + for (org.hl7.fhir.r5.model.ClaimResponse.NoteComponent t : src.getProcessNote()) + tgt.addProcessNote(convertNoteComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getCommunicationRequest()) + tgt.addCommunicationRequest(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent t : src.getInsurance()) + tgt.addInsurance(convertInsuranceComponent(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent t : src.getError()) tgt.addError(convertErrorComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasItemSequence()) + tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement())); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent t : src.getDetail()) + tgt.addDetail(convertItemDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasItemSequence()) + tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement())); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent t : src.getDetail()) + tgt.addDetail(convertItemDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasValue()) + tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasValue()) + tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDetailSequence()) + tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement())); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDetailSequence()) + tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement())); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSubDetailSequence()) + tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement())); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSubDetailSequence()) + tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement())); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getItemSequence()) + tgt.getItemSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getDetailSequence()) + tgt.getDetailSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getSubdetailSequence()) + tgt.getSubdetailSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getProvider()) tgt.addProvider(Reference43_50.convertReference(t)); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubSite()) + tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail()) + tgt.addDetail(convertAddedItemDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getItemSequence()) + tgt.getItemSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDetailSequence()) + tgt.getDetailSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSubdetailSequence()) + tgt.getSubdetailSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getProvider()) tgt.addProvider(Reference43_50.convertReference(t)); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) + tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail()) + tgt.addDetail(convertAddedItemDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertAddedItemSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertAddedItemSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.TotalComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r5.model.ClaimResponse.TotalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasAdjustment()) + tgt.setAdjustment(Money43_50.convertMoney(src.getAdjustment())); + if (src.hasAdjustmentReason()) + tgt.setAdjustmentReason(CodeableConcept43_50.convertCodeableConcept(src.getAdjustmentReason())); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasAdjustment()) + tgt.setAdjustment(Money43_50.convertMoney(src.getAdjustment())); + if (src.hasAdjustmentReason()) + tgt.setAdjustmentReason(CodeableConcept43_50.convertCodeableConcept(src.getAdjustmentReason())); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.NoteComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(PositiveInt43_50.convertPositiveInt(src.getNumberElement())); + if (src.hasType()) + tgt.setTypeElement(Enumerations43_50.convertNoteType(src.getTypeElement())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + if (src.hasLanguage()) + tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r5.model.ClaimResponse.NoteComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(PositiveInt43_50.convertPositiveInt(src.getNumberElement())); + if (src.hasType()) + tgt.setTypeElement(Enumerations43_50.convertNoteType(src.getTypeElement())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + if (src.hasLanguage()) + tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasFocal()) + tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement())); + if (src.hasClaimResponse()) + tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasFocal()) + tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement())); + if (src.hasClaimResponse()) + tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasItemSequence()) + tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement())); + if (src.hasDetailSequence()) + tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement())); + if (src.hasSubDetailSequence()) + tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasItemSequence()) + tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement())); + if (src.hasDetailSequence()) + tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement())); + if (src.hasSubDetailSequence()) + tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + 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/ClinicalImpression43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClinicalImpression43_50.java new file mode 100644 index 000000000..17a296727 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ClinicalImpression43_50.java @@ -0,0 +1,201 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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.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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ClinicalImpression43_50 { + + public static org.hl7.fhir.r5.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r4b.model.ClinicalImpression src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClinicalImpression tgt = new org.hl7.fhir.r5.model.ClinicalImpression(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertClinicalImpressionStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + // if (src.hasCode()) + // tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasAssessor()) + tgt.setPerformer(Reference43_50.convertReference(src.getAssessor())); + if (src.hasPrevious()) + tgt.setPrevious(Reference43_50.convertReference(src.getPrevious())); + for (org.hl7.fhir.r4b.model.Reference t : src.getProblem()) tgt.addProblem(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getProtocol()) tgt.getProtocol().add(Uri43_50.convertUri(t)); + if (src.hasSummary()) + tgt.setSummaryElement(String43_50.convertString(src.getSummaryElement())); + for (org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) + tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPrognosisCodeableConcept()) + tgt.addPrognosisCodeableConcept(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getPrognosisReference()) + tgt.addPrognosisReference(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r5.model.ClinicalImpression src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClinicalImpression tgt = new org.hl7.fhir.r4b.model.ClinicalImpression(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertClinicalImpressionStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + // if (src.hasCode()) + // tgt.setCode(convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPerformer()) + tgt.setAssessor(Reference43_50.convertReference(src.getPerformer())); + if (src.hasPrevious()) + tgt.setPrevious(Reference43_50.convertReference(src.getPrevious())); + for (org.hl7.fhir.r5.model.Reference t : src.getProblem()) tgt.addProblem(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getProtocol()) tgt.getProtocol().add(Uri43_50.convertUri(t)); + if (src.hasSummary()) + tgt.setSummaryElement(String43_50.convertString(src.getSummaryElement())); + for (org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) + tgt.addFinding(convertClinicalImpressionFindingComponent(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPrognosisCodeableConcept()) + tgt.addPrognosisCodeableConcept(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getPrognosisReference()) + tgt.addPrognosisReference(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasItemCodeableConcept()) + tgt.setItem(CodeableConcept43_50.convertCodeableConceptToCodeableReference(src.getItemCodeableConcept())); + if (src.hasItemReference()) + tgt.setItem(Reference43_50.convertReferenceToCodeableReference(src.getItemReference())); + if (src.hasBasis()) + tgt.setBasisElement(String43_50.convertString(src.getBasisElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasItem() && src.getItem().hasConcept()) + tgt.setItemCodeableConcept(CodeableConcept43_50.convertCodeableConcept(src.getItem().getConcept())); + if (src.hasItem() && src.getItem().hasReference()) + tgt.setItemReference(Reference43_50.convertReference(src.getItem().getReference())); + if (src.hasBasis()) + tgt.setBasisElement(String43_50.convertString(src.getBasisElement())); + 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/CodeSystem43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CodeSystem43_50.java new file mode 100644 index 000000000..12d79aa70 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CodeSystem43_50.java @@ -0,0 +1,576 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class CodeSystem43_50 { + + public static org.hl7.fhir.r5.model.CodeSystem convertCodeSystem(org.hl7.fhir.r4b.model.CodeSystem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem tgt = new org.hl7.fhir.r5.model.CodeSystem(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasCaseSensitive()) + tgt.setCaseSensitiveElement(Boolean43_50.convertBoolean(src.getCaseSensitiveElement())); + if (src.hasValueSet()) + tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement())); + if (src.hasHierarchyMeaning()) + tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement())); + if (src.hasCompositional()) + tgt.setCompositionalElement(Boolean43_50.convertBoolean(src.getCompositionalElement())); + if (src.hasVersionNeeded()) + tgt.setVersionNeededElement(Boolean43_50.convertBoolean(src.getVersionNeededElement())); + if (src.hasContent()) + tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement())); + if (src.hasSupplements()) + tgt.setSupplementsElement(Canonical43_50.convertCanonical(src.getSupplementsElement())); + if (src.hasCount()) + tgt.setCountElement(UnsignedInt43_50.convertUnsignedInt(src.getCountElement())); + for (org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) + tgt.addFilter(convertCodeSystemFilterComponent(t)); + for (org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent t : src.getProperty()) + tgt.addProperty(convertPropertyComponent(t)); + for (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) + tgt.addConcept(convertConceptDefinitionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CodeSystem convertCodeSystem(org.hl7.fhir.r5.model.CodeSystem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CodeSystem tgt = new org.hl7.fhir.r4b.model.CodeSystem(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasCaseSensitive()) + tgt.setCaseSensitiveElement(Boolean43_50.convertBoolean(src.getCaseSensitiveElement())); + if (src.hasValueSet()) + tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement())); + if (src.hasHierarchyMeaning()) + tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement())); + if (src.hasCompositional()) + tgt.setCompositionalElement(Boolean43_50.convertBoolean(src.getCompositionalElement())); + if (src.hasVersionNeeded()) + tgt.setVersionNeededElement(Boolean43_50.convertBoolean(src.getVersionNeededElement())); + if (src.hasContent()) + tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement())); + if (src.hasSupplements()) + tgt.setSupplementsElement(Canonical43_50.convertCanonical(src.getSupplementsElement())); + if (src.hasCount()) + tgt.setCountElement(UnsignedInt43_50.convertUnsignedInt(src.getCountElement())); + for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter()) + tgt.addFilter(convertCodeSystemFilterComponent(t)); + for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty()) + tgt.addProperty(convertPropertyComponent(t)); + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) + tgt.addConcept(convertConceptDefinitionComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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.CodeSystem.CodeSystemContentModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case NOTPRESENT: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NOTPRESENT); + break; + case EXAMPLE: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.EXAMPLE); + break; + case FRAGMENT: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.FRAGMENT); + break; + case COMPLETE: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.COMPLETE); + break; + case SUPPLEMENT: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.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; + } + + public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + tgt.setOperator(src.getOperator().stream() + .map(CodeSystem43_50::convertFilterOperator) + .collect(Collectors.toList())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + tgt.setOperator(src.getOperator().stream() + .map(CodeSystem43_50::convertFilterOperator) + .collect(Collectors.toList())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.PropertyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasUri()) + tgt.setUriElement(Uri43_50.convertUri(src.getUriElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasType()) + tgt.setTypeElement(convertPropertyType(src.getTypeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.PropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasUri()) + tgt.setUriElement(Uri43_50.convertUri(src.getUriElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasType()) + tgt.setTypeElement(convertPropertyType(src.getTypeElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(String43_50.convertString(src.getDefinitionElement())); + for (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) + tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + for (org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) + tgt.addProperty(convertConceptPropertyComponent(t)); + for (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) + tgt.addConcept(convertConceptDefinitionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(String43_50.convertString(src.getDefinitionElement())); + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation()) + tgt.addDesignation(convertConceptDefinitionDesignationComponent(t)); + for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty()) + tgt.addProperty(convertConceptPropertyComponent(t)); + for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept()) + tgt.addConcept(convertConceptDefinitionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasUse()) + tgt.setUse(Coding43_50.convertCoding(src.getUse())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasUse()) + tgt.setUse(Coding43_50.convertCoding(src.getUse())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + 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/Communication43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Communication43_50.java new file mode 100644 index 000000000..8d3db8fc4 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Communication43_50.java @@ -0,0 +1,308 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +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.StringType; +import org.hl7.fhir.r5.model.CodeableConcept; +import org.hl7.fhir.r5.model.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Communication43_50 { + + public static org.hl7.fhir.r5.model.Communication convertCommunication(org.hl7.fhir.r4b.model.Communication src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Communication tgt = new org.hl7.fhir.r5.model.Communication(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getInResponseTo()) + tgt.addInResponseTo(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCommunicationStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriorityElement(convertCommunicationPriority(src.getPriorityElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getMedium()) + tgt.addMedium(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasTopic()) + tgt.setTopic(CodeableConcept43_50.convertCodeableConcept(src.getTopic())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAbout()) tgt.addAbout(Reference43_50.convertReference(t)); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasSent()) + tgt.setSentElement(DateTime43_50.convertDateTime(src.getSentElement())); + if (src.hasReceived()) + tgt.setReceivedElement(DateTime43_50.convertDateTime(src.getReceivedElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t)); + if (src.hasSender()) + tgt.setSender(Reference43_50.convertReference(src.getSender())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent t : src.getPayload()) + tgt.addPayload(convertCommunicationPayloadComponent(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Communication convertCommunication(org.hl7.fhir.r5.model.Communication src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Communication tgt = new org.hl7.fhir.r4b.model.Communication(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getInResponseTo()) + tgt.addInResponseTo(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCommunicationStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriorityElement(convertCommunicationPriority(src.getPriorityElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) + tgt.addMedium(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasTopic()) + tgt.setTopic(CodeableConcept43_50.convertCodeableConcept(src.getTopic())); + for (org.hl7.fhir.r5.model.Reference t : src.getAbout()) tgt.addAbout(Reference43_50.convertReference(t)); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasSent()) + tgt.setSentElement(DateTime43_50.convertDateTime(src.getSentElement())); + if (src.hasReceived()) + tgt.setReceivedElement(DateTime43_50.convertDateTime(src.getReceivedElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t)); + if (src.hasSender()) + tgt.setSender(Reference43_50.convertReference(src.getSender())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent t : src.getPayload()) + tgt.addPayload(convertCommunicationPayloadComponent(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContent()) { + if (src.getContent() instanceof StringType) { + CodeableConcept tgtc = new CodeableConcept(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src.getContent(), tgtc); + tgtc.setText(src.getContentStringType().getValue()); + tgt.setContent(tgtc); + } else { + if (src.hasContent()) + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent())); + } + } + return tgt; + } + + public static org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContent()) { + if (src.hasContentCodeableConcept()) { + StringType tgts = new StringType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src.getContent(), tgts); + tgts.setValue(src.getContentCodeableConcept().getText()); + tgt.setContent(tgts); + } else { + if (src.hasContent()) + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent())); + } + } + 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/CommunicationRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CommunicationRequest43_50.java new file mode 100644 index 000000000..e93b8c264 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CommunicationRequest43_50.java @@ -0,0 +1,303 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class CommunicationRequest43_50 { + + public final static String EXT_PAYLOAD_CONTENT = "http://hl7.org/fhir/4.0/StructureDefinition/extension-CommunicationRequest.payload.content"; + + public static org.hl7.fhir.r5.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r4b.model.CommunicationRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CommunicationRequest tgt = new org.hl7.fhir.r5.model.CommunicationRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t)); + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatusElement(convertCommunicationRequestStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriorityElement(convertCommunicationPriority(src.getPriorityElement())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getMedium()) + tgt.addMedium(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAbout()) tgt.addAbout(Reference43_50.convertReference(t)); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + for (org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) + tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + for (org.hl7.fhir.r4b.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t)); + if (src.hasSender()) + tgt.addInformationProvider(Reference43_50.convertReference(src.getSender())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r5.model.CommunicationRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CommunicationRequest tgt = new org.hl7.fhir.r4b.model.CommunicationRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t)); + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatusElement(convertCommunicationRequestStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriorityElement(convertCommunicationPriority(src.getPriorityElement())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium()) + tgt.addMedium(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + for (org.hl7.fhir.r5.model.Reference t : src.getAbout()) tgt.addAbout(Reference43_50.convertReference(t)); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + for (org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) + tgt.addPayload(convertCommunicationRequestPayloadComponent(t)); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t)); + if (src.hasInformationProvider()) + tgt.setSender(Reference43_50.convertReference(src.getInformationProviderFirstRep())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (org.hl7.fhir.r4b.utils.ToolingExtensions.hasExtension(src, EXT_PAYLOAD_CONTENT)) { + org.hl7.fhir.r4b.model.Extension e = org.hl7.fhir.r4b.utils.ToolingExtensions.getExtension(src, EXT_PAYLOAD_CONTENT); + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(e.getValue())); + org.hl7.fhir.r5.utils.ToolingExtensions.removeExtension(tgt, EXT_PAYLOAD_CONTENT); + } else if (src.hasContent()) { + org.hl7.fhir.r4b.model.DataType content = src.getContent(); + if (content instanceof org.hl7.fhir.r4b.model.StringType) { + org.hl7.fhir.r4b.model.StringType string = (org.hl7.fhir.r4b.model.StringType) content; + org.hl7.fhir.r5.model.CodeableConcept code = new org.hl7.fhir.r5.model.CodeableConcept(); + code.setTextElement((org.hl7.fhir.r5.model.StringType) ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(string)); + tgt.setContent(code); + } else + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(content)); + } + return tgt; + } + + public static org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContent()) { + org.hl7.fhir.r5.model.DataType content = src.getContent(); + if (content instanceof org.hl7.fhir.r5.model.CodeableConcept) { + org.hl7.fhir.r5.model.CodeableConcept code = (org.hl7.fhir.r5.model.CodeableConcept) content; + if (code.hasText()) + tgt.setContent(new org.hl7.fhir.r4b.model.StringType(code.getText())); + if (code.hasCoding() || code.hasExtension()) { + org.hl7.fhir.r4b.model.Extension e = new org.hl7.fhir.r4b.model.Extension(EXT_PAYLOAD_CONTENT); + e.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(code)); + tgt.addExtension(e); + } + } else + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(content)); + } + 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/CompartmentDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CompartmentDefinition43_50.java new file mode 100644 index 000000000..11907b284 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CompartmentDefinition43_50.java @@ -0,0 +1,193 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class CompartmentDefinition43_50 { + + public static org.hl7.fhir.r5.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r4b.model.CompartmentDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CompartmentDefinition tgt = new org.hl7.fhir.r5.model.CompartmentDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCompartmentType(src.getCodeElement())); + if (src.hasSearch()) + tgt.setSearchElement(Boolean43_50.convertBoolean(src.getSearchElement())); + for (org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) + tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r5.model.CompartmentDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CompartmentDefinition tgt = new org.hl7.fhir.r4b.model.CompartmentDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCompartmentType(src.getCodeElement())); + if (src.hasSearch()) + tgt.setSearchElement(Boolean43_50.convertBoolean(src.getSearchElement())); + for (org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource()) + tgt.addResource(convertCompartmentDefinitionResourceComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertResourceEnum(src.getCodeElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getParam()) tgt.getParam().add(String43_50.convertString(t)); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertResourceEnum(src.getCodeElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getParam()) tgt.getParam().add(String43_50.convertString(t)); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + 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/Composition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Composition43_50.java new file mode 100644 index 000000000..03e16db2f --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Composition43_50.java @@ -0,0 +1,444 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext30_50; +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Reference30_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50; +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.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.RelatedArtifact; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Composition43_50 { + + public static org.hl7.fhir.r5.model.Composition convertComposition(org.hl7.fhir.r4b.model.Composition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Composition tgt = new org.hl7.fhir.r5.model.Composition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasStatus()) + tgt.setStatusElement(convertCompositionStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t)); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasConfidentiality()) + tgt.setConfidentialityElement(Code43_50.convertCode(src.getConfidentialityElement())); + for (org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent t : src.getAttester()) + tgt.addAttester(convertCompositionAttesterComponent(t)); + if (src.hasCustodian()) + tgt.setCustodian(Reference43_50.convertReference(src.getCustodian())); + for (org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) + tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); + for (org.hl7.fhir.r4b.model.Composition.CompositionEventComponent t : src.getEvent()) + tgt.addEvent(convertCompositionEventComponent(t)); + for (org.hl7.fhir.r4b.model.Composition.SectionComponent t : src.getSection()) + tgt.addSection(convertSectionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Composition convertComposition(org.hl7.fhir.r5.model.Composition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Composition tgt = new org.hl7.fhir.r4b.model.Composition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasStatus()) + tgt.setStatusElement(convertCompositionStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t)); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasConfidentiality()) + tgt.setConfidentialityElement(Code43_50.convertCode(src.getConfidentialityElement())); + for (org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent t : src.getAttester()) + tgt.addAttester(convertCompositionAttesterComponent(t)); + if (src.hasCustodian()) + tgt.setCustodian(Reference43_50.convertReference(src.getCustodian())); + for (RelatedArtifact t : src.getRelatesTo()) + tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); + for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent()) + tgt.addEvent(convertCompositionEventComponent(t)); + for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) + tgt.addSection(convertSectionComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setMode(convertCompositionAttestationMode(src.getModeElement())); + if (src.hasTime()) + tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement())); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertCompositionAttestationMode(src.getMode())); + if (src.hasTime()) + tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement())); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + return tgt; + } + + 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; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertCompositionAttestationMode(org.hl7.fhir.r5.model.CodeableConcept 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.Composition.CompositionAttestationModeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getCode("http://hl7.org/fhir/composition-attestation-mode")) { + case "personal": + tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.PERSONAL); + break; + case "professional": + tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.PROFESSIONAL); + break; + case "legal": + tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.LEGAL); + break; + case "official": + tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.OFFICIAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.NULL); + break; + } + return tgt; + } + + public static org.hl7.fhir.r5.model.RelatedArtifact convertCompositionRelatesToComponent(org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RelatedArtifact tgt = new org.hl7.fhir.r5.model.RelatedArtifact(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasCode()) + tgt.setTypeElement(convertDocumentRelationshipType(src.getCodeElement())); + if (src.hasTargetReference()) + tgt.setResourceReference(Reference43_50.convertReference(src.getTargetReference())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r5.model.RelatedArtifact src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasType()) + tgt.setCodeElement(convertDocumentRelationshipType(src.getTypeElement())); + if (src.hasResourceReference()) + tgt.setTarget(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getResourceReference())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r4b.model.Composition.CompositionEventComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionEventComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r4b.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r5.model.Composition.CompositionEventComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r4b.model.Composition.CompositionEventComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r4b.model.Composition.SectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Composition.SectionComponent tgt = new org.hl7.fhir.r5.model.Composition.SectionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t)); + if (src.hasFocus()) + tgt.setFocus(Reference43_50.convertReference(src.getFocus())); + if (src.hasText()) + tgt.setText(Narrative43_50.convertNarrative(src.getText())); + if (src.hasMode()) + tgt.setModeElement(convertSectionMode(src.getModeElement())); + if (src.hasOrderedBy()) + tgt.setOrderedBy(CodeableConcept43_50.convertCodeableConcept(src.getOrderedBy())); + for (org.hl7.fhir.r4b.model.Reference t : src.getEntry()) tgt.addEntry(Reference43_50.convertReference(t)); + if (src.hasEmptyReason()) + tgt.setEmptyReason(CodeableConcept43_50.convertCodeableConcept(src.getEmptyReason())); + for (org.hl7.fhir.r4b.model.Composition.SectionComponent t : src.getSection()) + tgt.addSection(convertSectionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r5.model.Composition.SectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Composition.SectionComponent tgt = new org.hl7.fhir.r4b.model.Composition.SectionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t)); + if (src.hasFocus()) + tgt.setFocus(Reference43_50.convertReference(src.getFocus())); + if (src.hasText()) + tgt.setText(Narrative43_50.convertNarrative(src.getText())); + if (src.hasMode()) + tgt.setModeElement(convertSectionMode(src.getModeElement())); + if (src.hasOrderedBy()) + tgt.setOrderedBy(CodeableConcept43_50.convertCodeableConcept(src.getOrderedBy())); + for (org.hl7.fhir.r5.model.Reference t : src.getEntry()) tgt.addEntry(Reference43_50.convertReference(t)); + if (src.hasEmptyReason()) + tgt.setEmptyReason(CodeableConcept43_50.convertCodeableConcept(src.getEmptyReason())); + for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection()) + tgt.addSection(convertSectionComponent(t)); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..f9bf30165 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ConceptMap43_50.java @@ -0,0 +1,456 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.VersionConvertorConstants; +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +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.Enumerations.ConceptMapRelationship; +import org.hl7.fhir.r5.utils.ToolingExtensions; +import org.hl7.fhir.utilities.CanonicalPair; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ConceptMap43_50 { + + public static org.hl7.fhir.r5.model.ConceptMap convertConceptMap(org.hl7.fhir.r4b.model.ConceptMap src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap tgt = new org.hl7.fhir.r5.model.ConceptMap(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getIdentifierFirstRep())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasSource()) + tgt.setSourceScope(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSource())); + if (src.hasTarget()) + tgt.setTargetScope(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTarget())); + for (org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) + tgt.addGroup(convertConceptMapGroupComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ConceptMap convertConceptMap(org.hl7.fhir.r5.model.ConceptMap src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ConceptMap tgt = new org.hl7.fhir.r4b.model.ConceptMap(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getIdentifierFirstRep())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasSourceScope()) + tgt.setSource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSourceScope())); + if (src.hasTargetScope()) + tgt.setTarget(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTargetScope())); + for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup()) + tgt.addGroup(convertConceptMapGroupComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSource() || src.hasSourceVersion()) + tgt.setSourceElement(convertUriAndVersionToCanonical(src.getSourceElement(), src.getSourceVersionElement())); + if (src.hasTarget() || src.hasTargetVersion()) + tgt.setTargetElement(convertUriAndVersionToCanonical(src.getTargetElement(), src.getTargetVersionElement())); + for (org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent t : src.getElement()) + tgt.addElement(convertSourceElementComponent(t)); + if (src.hasUnmapped()) + tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); + return tgt; + } + + private static CanonicalType convertUriAndVersionToCanonical(org.hl7.fhir.r4b.model.UriType srcUri, org.hl7.fhir.r4b.model.StringType srcVersion) { + if (srcUri == null && srcVersion == null) + return null; + org.hl7.fhir.r5.model.CanonicalType tgt = new org.hl7.fhir.r5.model.CanonicalType(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(srcUri == null ? srcVersion : srcUri, tgt); + if (srcUri.hasValue()) { + if (srcVersion.hasValue()) { + tgt.setValue(srcUri.getValue() + "|" + srcVersion.getValue()); + } else { + tgt.setValue(srcUri.getValue()); + } + } + return tgt; + } + + public static org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSource()) { + CanonicalPair cp = new CanonicalPair(src.getSource()); + tgt.setSource(cp.getUrl()); + tgt.setSourceVersion(cp.getVersion()); + } + if (src.hasTarget()) { + CanonicalPair cp = new CanonicalPair(src.getTarget()); + tgt.setTarget(cp.getUrl()); + tgt.setTargetVersion(cp.getVersion()); + } + for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : src.getElement()) + tgt.addElement(convertSourceElementComponent(t)); + if (src.hasUnmapped()) + tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + for (org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent t : src.getTarget()) { + if (t.getEquivalence() == org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.UNMATCHED) { + tgt.setNoMap(true); + } else { + tgt.addTarget(convertTargetElementComponent(t)); + } + } + return tgt; + } + + public static org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasNoMap() && src.getNoMap() == true) { + tgt.addTarget(new org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent().setEquivalence(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.UNMATCHED)); + } else { + for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget()) + tgt.addTarget(convertTargetElementComponent(t)); + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasEquivalence()) + tgt.setRelationshipElement(convertConceptMapRelationship(src.getEquivalenceElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + for (org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) + tgt.addDependsOn(convertOtherElementComponent(t)); + for (org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent t : src.getProduct()) + tgt.addProduct(convertOtherElementComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasRelationship()) + tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getRelationshipElement())); + else + tgt.setEquivalence(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.RELATEDTO); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) + tgt.addDependsOn(convertOtherElementComponent(t)); + for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct()) + tgt.addProduct(convertOtherElementComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Enumeration convertConceptMapEquivalence(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.ConceptMapEquivalenceEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE); + if (src.hasExtension(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)) { + tgt.setValueAsString(src.getExtensionString(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)); + } else { + switch (src.getValue()) { + case RELATEDTO: + tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.RELATEDTO); + break; + case EQUIVALENT: + tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.EQUIVALENT); + break; + case SOURCEISNARROWERTHANTARGET: + tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.WIDER); + break; + case SOURCEISBROADERTHANTARGET: + tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.NARROWER); + break; + case NOTRELATEDTO: + tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.DISJOINT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.NULL); + break; + } + } + return tgt; + } + + public static Enumeration convertConceptMapRelationship(org.hl7.fhir.r4b.model.Enumeration src) 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.setCodeExtension(tgt, 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; + } + + public static org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProperty()) + tgt.setPropertyElement(Uri43_50.convertUri(src.getPropertyElement())); + if (src.hasSystem()) { + tgt.setValue(new Coding().setSystem(src.getSystem()).setCode(src.getValue()).setDisplay(src.getDisplay())); + } else if (src.hasValueElement()) { + tgt.setValue(String43_50.convertString(src.getValueElement())); + } + return tgt; + } + + public static org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProperty()) + tgt.setPropertyElement(Uri43_50.convertUri(src.getPropertyElement())); + + if (src.hasValueCoding()) { + tgt.setSystem(src.getValueCoding().getSystem()); + tgt.setValue(src.getValueCoding().getCode()); + tgt.setDisplay(src.getValueCoding().getDisplay()); + } else if (src.hasValue()) { + tgt.setValue(src.getValue().primitiveValue()); + } + + return tgt; + } + + public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertConceptMapGroupUnmappedMode(src.getModeElement())); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasUrl()) + tgt.setOtherMapElement(Canonical43_50.convertCanonical(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMode()) + tgt.setModeElement(convertConceptMapGroupUnmappedMode(src.getModeElement())); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + if (src.hasOtherMap()) + tgt.setUrlElement(Canonical43_50.convertCanonical(src.getOtherMapElement())); + return tgt; + } + + 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; + } + + 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; + } +} \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Condition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Condition43_50.java new file mode 100644 index 000000000..805eb0180 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Condition43_50.java @@ -0,0 +1,191 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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.CodeableConcept; +import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.Coding; +import org.hl7.fhir.r5.model.Condition.ConditionParticipantComponent; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Condition43_50 { + + public static org.hl7.fhir.r5.model.Condition convertCondition(org.hl7.fhir.r4b.model.Condition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Condition tgt = new org.hl7.fhir.r5.model.Condition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasClinicalStatus()) + tgt.setClinicalStatus(CodeableConcept43_50.convertCodeableConcept(src.getClinicalStatus())); + if (src.hasVerificationStatus()) + tgt.setVerificationStatus(CodeableConcept43_50.convertCodeableConcept(src.getVerificationStatus())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSeverity()) + tgt.setSeverity(CodeableConcept43_50.convertCodeableConcept(src.getSeverity())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getBodySite()) + tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOnset()) + tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset())); + if (src.hasAbatement()) + tgt.setAbatement(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAbatement())); + if (src.hasRecordedDate()) + tgt.setRecordedDateElement(DateTime43_50.convertDateTime(src.getRecordedDateElement())); + if (src.hasRecorder()) + tgt.addParticipant().setFunction(new CodeableConcept(new Coding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "author", "Author"))).setActor(Reference43_50.convertReference(src.getRecorder())); + if (src.hasAsserter()) + tgt.addParticipant().setFunction(new CodeableConcept(new Coding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "informant", "Informant"))).setActor(Reference43_50.convertReference(src.getAsserter())); + for (org.hl7.fhir.r4b.model.Condition.ConditionStageComponent t : src.getStage()) + tgt.addStage(convertConditionStageComponent(t)); + for (org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) + tgt.getEvidence().addAll(convertConditionEvidenceComponent(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Condition convertCondition(org.hl7.fhir.r5.model.Condition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Condition tgt = new org.hl7.fhir.r4b.model.Condition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasClinicalStatus()) + tgt.setClinicalStatus(CodeableConcept43_50.convertCodeableConcept(src.getClinicalStatus())); + if (src.hasVerificationStatus()) + tgt.setVerificationStatus(CodeableConcept43_50.convertCodeableConcept(src.getVerificationStatus())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSeverity()) + tgt.setSeverity(CodeableConcept43_50.convertCodeableConcept(src.getSeverity())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) + tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOnset()) + tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset())); + if (src.hasAbatement()) + tgt.setAbatement(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAbatement())); + if (src.hasRecordedDate()) + tgt.setRecordedDateElement(DateTime43_50.convertDateTime(src.getRecordedDateElement())); + for (org.hl7.fhir.r5.model.Condition.ConditionParticipantComponent t : src.getParticipant()) { + if (t.getFunction().hasCoding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "author")) + tgt.setRecorder(Reference43_50.convertReference(t.getActor())); + if (t.getFunction().hasCoding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "informant")) + tgt.setAsserter(Reference43_50.convertReference(t.getActor())); + } + for (org.hl7.fhir.r5.model.Condition.ConditionStageComponent t : src.getStage()) + tgt.addStage(convertConditionStageComponent(t)); + for (CodeableReference t : src.getEvidence()) + tgt.addEvidence(convertConditionEvidenceComponent(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r4b.model.Condition.ConditionStageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionStageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSummary()) + tgt.setSummary(CodeableConcept43_50.convertCodeableConcept(src.getSummary())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAssessment()) tgt.addAssessment(Reference43_50.convertReference(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r5.model.Condition.ConditionStageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r4b.model.Condition.ConditionStageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSummary()) + tgt.setSummary(CodeableConcept43_50.convertCodeableConcept(src.getSummary())); + for (org.hl7.fhir.r5.model.Reference t : src.getAssessment()) tgt.addAssessment(Reference43_50.convertReference(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + return tgt; + } + + public static List convertConditionEvidenceComponent(org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent src) throws FHIRException { + if (src == null) + return null; + List list = new ArrayList<>(); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) { + org.hl7.fhir.r5.model.CodeableReference tgt = new org.hl7.fhir.r5.model.CodeableReference(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + tgt.setConcept(CodeableConcept43_50.convertCodeableConcept(t)); + list.add(tgt); + } + for (org.hl7.fhir.r4b.model.Reference t : src.getDetail()) { + org.hl7.fhir.r5.model.CodeableReference tgt = new org.hl7.fhir.r5.model.CodeableReference(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + tgt.setReference(Reference43_50.convertReference(t)); + list.add(tgt); + } + return list; + } + + public static org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.r5.model.CodeableReference src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasConcept()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(src.getConcept())); + if (src.hasReference()) + tgt.addDetail(Reference43_50.convertReference(src.getReference())); + 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 new file mode 100644 index 000000000..b240ff084 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Consent43_50.java @@ -0,0 +1,408 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Consent43_50 { + + public static org.hl7.fhir.r5.model.Consent convertConsent(org.hl7.fhir.r4b.model.Consent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent tgt = new org.hl7.fhir.r5.model.Consent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertConsentState(src.getStatusElement())); +// if (src.hasScope()) +// tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPatient()) + tgt.setSubject(Reference43_50.convertReference(src.getPatient())); + if (src.hasDateTime()) + tgt.setDateTimeElement(DateTime43_50.convertDateTime(src.getDateTimeElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getPerformer()) tgt.addGrantee(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getOrganization()) tgt.addManager(Reference43_50.convertReference(t)); + if (src.hasSourceAttachment()) + tgt.addSourceAttachment(Attachment43_50.convertAttachment(src.getSourceAttachment())); + if (src.hasSourceReference()) + tgt.addSourceReference(Reference43_50.convertReference(src.getSourceReference())); +// for (org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent t : src.getPolicy()) +// tgt.addPolicy(convertConsentPolicyComponent(t)); +// if (src.hasPolicyRule()) +// tgt.setPolicyRule(CodeableConcept43_50.convertCodeableConcept(src.getPolicyRule())); + for (org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent t : src.getVerification()) + tgt.addVerification(convertConsentVerificationComponent(t)); + if (src.hasProvision()) + tgt.setProvision(convertprovisionComponent(src.getProvision())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Consent convertConsent(org.hl7.fhir.r5.model.Consent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Consent tgt = new org.hl7.fhir.r4b.model.Consent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertConsentState(src.getStatusElement())); +// if (src.hasScope()) +// tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setPatient(Reference43_50.convertReference(src.getSubject())); + if (src.hasDateTime()) + tgt.setDateTimeElement(DateTime43_50.convertDateTime(src.getDateTimeElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getGrantee()) tgt.addPerformer(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getManager()) tgt.addOrganization(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getController()) + tgt.addOrganization(Reference43_50.convertReference(t)); + if (src.hasSourceAttachment()) + tgt.setSource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSourceAttachmentFirstRep())); + if (src.hasSourceReference()) + tgt.setSource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSourceReferenceFirstRep())); +// for (org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent t : src.getPolicy()) +// tgt.addPolicy(convertConsentPolicyComponent(t)); +// if (src.hasPolicyRule()) +// tgt.setPolicyRule(CodeableConcept43_50.convertCodeableConcept(src.getPolicyRule())); + for (org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent t : src.getVerification()) + tgt.addVerification(convertConsentVerificationComponent(t)); + if (src.hasProvision()) + tgt.setProvision(convertprovisionComponent(src.getProvision())); + return tgt; + } + + 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; + } + + 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; + } + +// public static org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent tgt = new org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasAuthority()) +// tgt.setAuthorityElement(Uri43_50.convertUri(src.getAuthorityElement())); +// if (src.hasUri()) +// tgt.setUriElement(Uri43_50.convertUri(src.getUriElement())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent tgt = new org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasAuthority()) +// tgt.setAuthorityElement(Uri43_50.convertUri(src.getAuthorityElement())); +// if (src.hasUri()) +// tgt.setUriElement(Uri43_50.convertUri(src.getUriElement())); +// return tgt; +// } + + public static org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent tgt = new org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasVerified()) + tgt.setVerifiedElement(Boolean43_50.convertBoolean(src.getVerifiedElement())); + if (src.hasVerifiedWith()) + tgt.setVerifiedWith(Reference43_50.convertReference(src.getVerifiedWith())); + if (src.hasVerificationDate()) + tgt.getVerificationDate().add(DateTime43_50.convertDateTime(src.getVerificationDateElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent tgt = new org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasVerified()) + tgt.setVerifiedElement(Boolean43_50.convertBoolean(src.getVerifiedElement())); + if (src.hasVerifiedWith()) + tgt.setVerifiedWith(Reference43_50.convertReference(src.getVerifiedWith())); + if (src.hasVerificationDate()) + tgt.setVerificationDateElement(DateTime43_50.convertDateTime(src.getVerificationDate().get(0))); + return tgt; + } + + public static org.hl7.fhir.r5.model.Consent.ProvisionComponent convertprovisionComponent(org.hl7.fhir.r4b.model.Consent.ProvisionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent.ProvisionComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertConsentProvisionType(src.getTypeElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent t : src.getActor()) + tgt.addActor(convertprovisionActorComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getAction()) + tgt.addAction(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r4b.model.Coding t : src.getPurpose()) tgt.addPurpose(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r4b.model.Coding t : src.getClass_()) tgt.addClass_(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDataPeriod()) + tgt.setDataPeriod(Period43_50.convertPeriod(src.getDataPeriod())); + for (org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent t : src.getData()) + tgt.addData(convertprovisionDataComponent(t)); + for (org.hl7.fhir.r4b.model.Consent.ProvisionComponent t : src.getProvision()) + tgt.addProvision(convertprovisionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Consent.ProvisionComponent convertprovisionComponent(org.hl7.fhir.r5.model.Consent.ProvisionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Consent.ProvisionComponent tgt = new org.hl7.fhir.r4b.model.Consent.ProvisionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertConsentProvisionType(src.getTypeElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r5.model.Consent.ProvisionActorComponent t : src.getActor()) + tgt.addActor(convertprovisionActorComponent(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAction()) + tgt.addAction(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r5.model.Coding t : src.getPurpose()) tgt.addPurpose(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r5.model.Coding t : src.getClass_()) tgt.addClass_(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDataPeriod()) + tgt.setDataPeriod(Period43_50.convertPeriod(src.getDataPeriod())); + for (org.hl7.fhir.r5.model.Consent.ProvisionDataComponent t : src.getData()) + tgt.addData(convertprovisionDataComponent(t)); + for (org.hl7.fhir.r5.model.Consent.ProvisionComponent t : src.getProvision()) + tgt.addProvision(convertprovisionComponent(t)); + return tgt; + } + + 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.Consent.ConsentProvisionTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case DENY: + tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentProvisionType.DENY); + break; + case PERMIT: + tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentProvisionType.PERMIT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Consent.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; + } + + public static org.hl7.fhir.r5.model.Consent.ProvisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent.ProvisionActorComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionActorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r5.model.Consent.ProvisionActorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent tgt = new org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Consent.ProvisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Consent.ProvisionDataComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionDataComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMeaning()) + tgt.setMeaningElement(convertConsentDataMeaning(src.getMeaningElement())); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r5.model.Consent.ProvisionDataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent tgt = new org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMeaning()) + tgt.setMeaningElement(convertConsentDataMeaning(src.getMeaningElement())); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + return tgt; + } + + 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.Consent.ConsentDataMeaningEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case INSTANCE: + tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.INSTANCE); + break; + case RELATED: + tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.RELATED); + break; + case DEPENDENTS: + tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.DEPENDENTS); + break; + case AUTHOREDBY: + tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.AUTHOREDBY); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Consent.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; + } +} 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 new file mode 100644 index 000000000..106dc8c44 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Contract43_50.java @@ -0,0 +1,997 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Contract43_50 { + + public static org.hl7.fhir.r5.model.Contract convertContract(org.hl7.fhir.r4b.model.Contract src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract tgt = new org.hl7.fhir.r5.model.Contract(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasStatus()) + tgt.setStatusElement(convertContractStatus(src.getStatusElement())); + if (src.hasLegalState()) + tgt.setLegalState(CodeableConcept43_50.convertCodeableConcept(src.getLegalState())); + if (src.hasInstantiatesCanonical()) + tgt.setInstantiatesCanonical(Reference43_50.convertReference(src.getInstantiatesCanonical())); + if (src.hasInstantiatesUri()) + tgt.setInstantiatesUriElement(Uri43_50.convertUri(src.getInstantiatesUriElement())); + if (src.hasContentDerivative()) + tgt.setContentDerivative(CodeableConcept43_50.convertCodeableConcept(src.getContentDerivative())); + if (src.hasIssued()) + tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement())); + if (src.hasApplies()) + tgt.setApplies(Period43_50.convertPeriod(src.getApplies())); + if (src.hasExpirationType()) + tgt.setExpirationType(CodeableConcept43_50.convertCodeableConcept(src.getExpirationType())); + for (org.hl7.fhir.r4b.model.Reference t : src.getSubject()) tgt.addSubject(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getAuthority()) tgt.addAuthority(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getDomain()) tgt.addDomain(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSite()) tgt.addSite(Reference43_50.convertReference(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + if (src.hasScope()) + tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope())); + if (src.hasTopic()) + tgt.setTopic(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTopic())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubType()) + tgt.addSubType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasContentDefinition()) + tgt.setContentDefinition(convertContentDefinitionComponent(src.getContentDefinition())); + for (org.hl7.fhir.r4b.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getRelevantHistory()) + tgt.addRelevantHistory(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Contract.SignatoryComponent t : src.getSigner()) + tgt.addSigner(convertSignatoryComponent(t)); + for (org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) + tgt.addFriendly(convertFriendlyLanguageComponent(t)); + for (org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent t : src.getLegal()) + tgt.addLegal(convertLegalLanguageComponent(t)); + for (org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent t : src.getRule()) + tgt.addRule(convertComputableLanguageComponent(t)); + if (src.hasLegallyBinding()) + tgt.setLegallyBinding(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLegallyBinding())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract convertContract(org.hl7.fhir.r5.model.Contract src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract tgt = new org.hl7.fhir.r4b.model.Contract(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasStatus()) + tgt.setStatusElement(convertContractStatus(src.getStatusElement())); + if (src.hasLegalState()) + tgt.setLegalState(CodeableConcept43_50.convertCodeableConcept(src.getLegalState())); + if (src.hasInstantiatesCanonical()) + tgt.setInstantiatesCanonical(Reference43_50.convertReference(src.getInstantiatesCanonical())); + if (src.hasInstantiatesUri()) + tgt.setInstantiatesUriElement(Uri43_50.convertUri(src.getInstantiatesUriElement())); + if (src.hasContentDerivative()) + tgt.setContentDerivative(CodeableConcept43_50.convertCodeableConcept(src.getContentDerivative())); + if (src.hasIssued()) + tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement())); + if (src.hasApplies()) + tgt.setApplies(Period43_50.convertPeriod(src.getApplies())); + if (src.hasExpirationType()) + tgt.setExpirationType(CodeableConcept43_50.convertCodeableConcept(src.getExpirationType())); + for (org.hl7.fhir.r5.model.Reference t : src.getSubject()) tgt.addSubject(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getAuthority()) tgt.addAuthority(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getDomain()) tgt.addDomain(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSite()) tgt.addSite(Reference43_50.convertReference(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + if (src.hasScope()) + tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope())); + if (src.hasTopic()) + tgt.setTopic(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTopic())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubType()) + tgt.addSubType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasContentDefinition()) + tgt.setContentDefinition(convertContentDefinitionComponent(src.getContentDefinition())); + for (org.hl7.fhir.r5.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) + tgt.addRelevantHistory(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Contract.SignatoryComponent t : src.getSigner()) + tgt.addSigner(convertSignatoryComponent(t)); + for (org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) + tgt.addFriendly(convertFriendlyLanguageComponent(t)); + for (org.hl7.fhir.r5.model.Contract.LegalLanguageComponent t : src.getLegal()) + tgt.addLegal(convertLegalLanguageComponent(t)); + for (org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent t : src.getRule()) + tgt.addRule(convertComputableLanguageComponent(t)); + if (src.hasLegallyBinding()) + tgt.setLegallyBinding(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLegallyBinding())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent tgt = new org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasPublisher()) + tgt.setPublisher(Reference43_50.convertReference(src.getPublisher())); + if (src.hasPublicationDate()) + tgt.setPublicationDateElement(DateTime43_50.convertDateTime(src.getPublicationDateElement())); + if (src.hasPublicationStatus()) + tgt.setPublicationStatusElement(convertContractPublicationStatus(src.getPublicationStatusElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent tgt = new org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasPublisher()) + tgt.setPublisher(Reference43_50.convertReference(src.getPublisher())); + if (src.hasPublicationDate()) + tgt.setPublicationDateElement(DateTime43_50.convertDateTime(src.getPublicationDateElement())); + if (src.hasPublicationStatus()) + tgt.setPublicationStatusElement(convertContractPublicationStatus(src.getPublicationStatusElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r4b.model.Contract.TermComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.TermComponent tgt = new org.hl7.fhir.r5.model.Contract.TermComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasIssued()) + tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement())); + if (src.hasApplies()) + tgt.setApplies(Period43_50.convertPeriod(src.getApplies())); + if (src.hasTopic()) + tgt.setTopic(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTopic())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent t : src.getSecurityLabel()) + tgt.addSecurityLabel(convertSecurityLabelComponent(t)); + if (src.hasOffer()) + tgt.setOffer(convertContractOfferComponent(src.getOffer())); + for (org.hl7.fhir.r4b.model.Contract.ContractAssetComponent t : src.getAsset()) + tgt.addAsset(convertContractAssetComponent(t)); + for (org.hl7.fhir.r4b.model.Contract.ActionComponent t : src.getAction()) tgt.addAction(convertActionComponent(t)); + for (org.hl7.fhir.r4b.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r5.model.Contract.TermComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.TermComponent tgt = new org.hl7.fhir.r4b.model.Contract.TermComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasIssued()) + tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement())); + if (src.hasApplies()) + tgt.setApplies(Period43_50.convertPeriod(src.getApplies())); + if (src.hasTopic()) + tgt.setTopic(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTopic())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r5.model.Contract.SecurityLabelComponent t : src.getSecurityLabel()) + tgt.addSecurityLabel(convertSecurityLabelComponent(t)); + if (src.hasOffer()) + tgt.setOffer(convertContractOfferComponent(src.getOffer())); + for (org.hl7.fhir.r5.model.Contract.ContractAssetComponent t : src.getAsset()) + tgt.addAsset(convertContractAssetComponent(t)); + for (org.hl7.fhir.r5.model.Contract.ActionComponent t : src.getAction()) tgt.addAction(convertActionComponent(t)); + for (org.hl7.fhir.r5.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.SecurityLabelComponent convertSecurityLabelComponent(org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.SecurityLabelComponent tgt = new org.hl7.fhir.r5.model.Contract.SecurityLabelComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getNumber()) + tgt.getNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + if (src.hasClassification()) + tgt.setClassification(Coding43_50.convertCoding(src.getClassification())); + for (org.hl7.fhir.r4b.model.Coding t : src.getCategory()) tgt.addCategory(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r4b.model.Coding t : src.getControl()) tgt.addControl(Coding43_50.convertCoding(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent convertSecurityLabelComponent(org.hl7.fhir.r5.model.Contract.SecurityLabelComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent tgt = new org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getNumber()) + tgt.getNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + if (src.hasClassification()) + tgt.setClassification(Coding43_50.convertCoding(src.getClassification())); + for (org.hl7.fhir.r5.model.Coding t : src.getCategory()) tgt.addCategory(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r5.model.Coding t : src.getControl()) tgt.addControl(Coding43_50.convertCoding(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r4b.model.Contract.ContractOfferComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ContractOfferComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractOfferComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.Contract.ContractPartyComponent t : src.getParty()) + tgt.addParty(convertContractPartyComponent(t)); + if (src.hasTopic()) + tgt.setTopic(Reference43_50.convertReference(src.getTopic())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasDecision()) + tgt.setDecision(CodeableConcept43_50.convertCodeableConcept(src.getDecision())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getDecisionMode()) + tgt.addDecisionMode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t)); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getSecurityLabelNumber()) + tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r5.model.Contract.ContractOfferComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.ContractOfferComponent tgt = new org.hl7.fhir.r4b.model.Contract.ContractOfferComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.Contract.ContractPartyComponent t : src.getParty()) + tgt.addParty(convertContractPartyComponent(t)); + if (src.hasTopic()) + tgt.setTopic(Reference43_50.convertReference(src.getTopic())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasDecision()) + tgt.setDecision(CodeableConcept43_50.convertCodeableConcept(src.getDecision())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDecisionMode()) + tgt.addDecisionMode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t)); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) + tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r4b.model.Contract.ContractPartyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ContractPartyComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractPartyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t)); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r5.model.Contract.ContractPartyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.ContractPartyComponent tgt = new org.hl7.fhir.r4b.model.Contract.ContractPartyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t)); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r4b.model.Contract.AnswerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.AnswerComponent tgt = new org.hl7.fhir.r5.model.Contract.AnswerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r5.model.Contract.AnswerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.AnswerComponent tgt = new org.hl7.fhir.r4b.model.Contract.AnswerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r4b.model.Contract.ContractAssetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ContractAssetComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractAssetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasScope()) + tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getTypeReference()) + tgt.addTypeReference(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubtype()) + tgt.addSubtype(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasRelationship()) + tgt.setRelationship(Coding43_50.convertCoding(src.getRelationship())); + for (org.hl7.fhir.r4b.model.Contract.AssetContextComponent t : src.getContext()) + tgt.addContext(convertAssetContextComponent(t)); + if (src.hasCondition()) + tgt.setConditionElement(String43_50.convertString(src.getConditionElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPeriodType()) + tgt.addPeriodType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Period t : src.getPeriod()) tgt.addPeriod(Period43_50.convertPeriod(t)); + for (org.hl7.fhir.r4b.model.Period t : src.getUsePeriod()) tgt.addUsePeriod(Period43_50.convertPeriod(t)); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t)); + for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getSecurityLabelNumber()) + tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + for (org.hl7.fhir.r4b.model.Contract.ValuedItemComponent t : src.getValuedItem()) + tgt.addValuedItem(convertValuedItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r5.model.Contract.ContractAssetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.ContractAssetComponent tgt = new org.hl7.fhir.r4b.model.Contract.ContractAssetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasScope()) + tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getTypeReference()) + tgt.addTypeReference(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubtype()) + tgt.addSubtype(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasRelationship()) + tgt.setRelationship(Coding43_50.convertCoding(src.getRelationship())); + for (org.hl7.fhir.r5.model.Contract.AssetContextComponent t : src.getContext()) + tgt.addContext(convertAssetContextComponent(t)); + if (src.hasCondition()) + tgt.setConditionElement(String43_50.convertString(src.getConditionElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPeriodType()) + tgt.addPeriodType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Period t : src.getPeriod()) tgt.addPeriod(Period43_50.convertPeriod(t)); + for (org.hl7.fhir.r5.model.Period t : src.getUsePeriod()) tgt.addUsePeriod(Period43_50.convertPeriod(t)); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t)); + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) + tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + for (org.hl7.fhir.r5.model.Contract.ValuedItemComponent t : src.getValuedItem()) + tgt.addValuedItem(convertValuedItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.AssetContextComponent convertAssetContextComponent(org.hl7.fhir.r4b.model.Contract.AssetContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.AssetContextComponent tgt = new org.hl7.fhir.r5.model.Contract.AssetContextComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.AssetContextComponent convertAssetContextComponent(org.hl7.fhir.r5.model.Contract.AssetContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.AssetContextComponent tgt = new org.hl7.fhir.r4b.model.Contract.AssetContextComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r4b.model.Contract.ValuedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.r5.model.Contract.ValuedItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasEntity()) + tgt.setEntity(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEntity())); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasEffectiveTime()) + tgt.setEffectiveTimeElement(DateTime43_50.convertDateTime(src.getEffectiveTimeElement())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasPoints()) + tgt.setPointsElement(Decimal43_50.convertDecimal(src.getPointsElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + if (src.hasPayment()) + tgt.setPaymentElement(String43_50.convertString(src.getPaymentElement())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(DateTime43_50.convertDateTime(src.getPaymentDateElement())); + if (src.hasResponsible()) + tgt.setResponsible(Reference43_50.convertReference(src.getResponsible())); + if (src.hasRecipient()) + tgt.setRecipient(Reference43_50.convertReference(src.getRecipient())); + for (org.hl7.fhir.r4b.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getSecurityLabelNumber()) + tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r5.model.Contract.ValuedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.r4b.model.Contract.ValuedItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasEntity()) + tgt.setEntity(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEntity())); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasEffectiveTime()) + tgt.setEffectiveTimeElement(DateTime43_50.convertDateTime(src.getEffectiveTimeElement())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasPoints()) + tgt.setPointsElement(Decimal43_50.convertDecimal(src.getPointsElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + if (src.hasPayment()) + tgt.setPaymentElement(String43_50.convertString(src.getPaymentElement())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(DateTime43_50.convertDateTime(src.getPaymentDateElement())); + if (src.hasResponsible()) + tgt.setResponsible(Reference43_50.convertReference(src.getResponsible())); + if (src.hasRecipient()) + tgt.setRecipient(Reference43_50.convertReference(src.getRecipient())); + for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) + tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r4b.model.Contract.ActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ActionComponent tgt = new org.hl7.fhir.r5.model.Contract.ActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent t : src.getSubject()) + tgt.addSubject(convertActionSubjectComponent(t)); + if (src.hasIntent()) + tgt.setIntent(CodeableConcept43_50.convertCodeableConcept(src.getIntent())); + for (org.hl7.fhir.r4b.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t)); + if (src.hasStatus()) + tgt.setStatus(CodeableConcept43_50.convertCodeableConcept(src.getStatus())); + if (src.hasContext()) + tgt.setContext(Reference43_50.convertReference(src.getContext())); + for (org.hl7.fhir.r4b.model.StringType t : src.getContextLinkId()) + tgt.getContextLinkId().add(String43_50.convertString(t)); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + for (org.hl7.fhir.r4b.model.Reference t : src.getRequester()) tgt.addRequester(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getRequesterLinkId()) + tgt.getRequesterLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPerformerType()) + tgt.addPerformerType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPerformerRole()) + tgt.setPerformerRole(CodeableConcept43_50.convertCodeableConcept(src.getPerformerRole())); + if (src.hasPerformer()) + tgt.setPerformer(Reference43_50.convertReference(src.getPerformer())); + for (org.hl7.fhir.r4b.model.StringType t : src.getPerformerLinkId()) + tgt.getPerformerLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getReasonLinkId()) + tgt.getReasonLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getSecurityLabelNumber()) + tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r5.model.Contract.ActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.ActionComponent tgt = new org.hl7.fhir.r4b.model.Contract.ActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.Contract.ActionSubjectComponent t : src.getSubject()) + tgt.addSubject(convertActionSubjectComponent(t)); + if (src.hasIntent()) + tgt.setIntent(CodeableConcept43_50.convertCodeableConcept(src.getIntent())); + for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t)); + if (src.hasStatus()) + tgt.setStatus(CodeableConcept43_50.convertCodeableConcept(src.getStatus())); + if (src.hasContext()) + tgt.setContext(Reference43_50.convertReference(src.getContext())); + for (org.hl7.fhir.r5.model.StringType t : src.getContextLinkId()) + tgt.getContextLinkId().add(String43_50.convertString(t)); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + for (org.hl7.fhir.r5.model.Reference t : src.getRequester()) tgt.addRequester(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getRequesterLinkId()) + tgt.getRequesterLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPerformerType()) + tgt.addPerformerType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPerformerRole()) + tgt.setPerformerRole(CodeableConcept43_50.convertCodeableConcept(src.getPerformerRole())); + if (src.hasPerformer()) + tgt.setPerformer(Reference43_50.convertReference(src.getPerformer())); + for (org.hl7.fhir.r5.model.StringType t : src.getPerformerLinkId()) + tgt.getPerformerLinkId().add(String43_50.convertString(t)); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.StringType t : src.getReasonLinkId()) tgt.getReason().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getReasonLinkId()) + tgt.getReasonLinkId().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber()) + tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ActionSubjectComponent tgt = new org.hl7.fhir.r5.model.Contract.ActionSubjectComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t)); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r5.model.Contract.ActionSubjectComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent tgt = new org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t)); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r4b.model.Contract.SignatoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.r5.model.Contract.SignatoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(Coding43_50.convertCoding(src.getType())); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + for (org.hl7.fhir.r4b.model.Signature t : src.getSignature()) tgt.addSignature(Signature43_50.convertSignature(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r5.model.Contract.SignatoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.r4b.model.Contract.SignatoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(Coding43_50.convertCoding(src.getType())); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + for (org.hl7.fhir.r5.model.Signature t : src.getSignature()) tgt.addSignature(Signature43_50.convertSignature(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContent()) + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContent()) + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.LegalLanguageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContent()) + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r5.model.Contract.LegalLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContent()) + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContent()) + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContent()) + tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent())); + 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/Coverage43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Coverage43_50.java new file mode 100644 index 000000000..63564dc89 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Coverage43_50.java @@ -0,0 +1,251 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Coverage43_50 { + + public static org.hl7.fhir.r5.model.Coverage convertCoverage(org.hl7.fhir.r4b.model.Coverage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Coverage tgt = new org.hl7.fhir.r5.model.Coverage(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCoverageStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasPolicyHolder()) + tgt.setPolicyHolder(Reference43_50.convertReference(src.getPolicyHolder())); + if (src.hasSubscriber()) + tgt.setSubscriber(Reference43_50.convertReference(src.getSubscriber())); + if (src.hasSubscriberId()) + tgt.getSubscriberId().setValueElement(String43_50.convertString(src.getSubscriberIdElement())); + if (src.hasBeneficiary()) + tgt.setBeneficiary(Reference43_50.convertReference(src.getBeneficiary())); + if (src.hasDependent()) + tgt.setDependentElement(String43_50.convertString(src.getDependentElement())); + if (src.hasRelationship()) + tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r4b.model.Reference t : src.getPayor()) tgt.addPayor(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Coverage.ClassComponent t : src.getClass_()) tgt.addClass_(convertClassComponent(t)); + if (src.hasOrder()) + tgt.setOrderElement(PositiveInt43_50.convertPositiveInt(src.getOrderElement())); + if (src.hasNetwork()) + tgt.setNetworkElement(String43_50.convertString(src.getNetworkElement())); + for (org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary()) + tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t)); + if (src.hasSubrogation()) + tgt.setSubrogationElement(Boolean43_50.convertBoolean(src.getSubrogationElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getContract()) tgt.addContract(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Coverage convertCoverage(org.hl7.fhir.r5.model.Coverage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Coverage tgt = new org.hl7.fhir.r4b.model.Coverage(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertCoverageStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasPolicyHolder()) + tgt.setPolicyHolder(Reference43_50.convertReference(src.getPolicyHolder())); + if (src.hasSubscriber()) + tgt.setSubscriber(Reference43_50.convertReference(src.getSubscriber())); + if (src.hasSubscriberId()) + tgt.setSubscriberIdElement(String43_50.convertString(src.getSubscriberId().getValueElement())); + if (src.hasBeneficiary()) + tgt.setBeneficiary(Reference43_50.convertReference(src.getBeneficiary())); + if (src.hasDependent()) + tgt.setDependentElement(String43_50.convertString(src.getDependentElement())); + if (src.hasRelationship()) + tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r5.model.Reference t : src.getPayor()) tgt.addPayor(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Coverage.ClassComponent t : src.getClass_()) tgt.addClass_(convertClassComponent(t)); + if (src.hasOrder()) + tgt.setOrderElement(PositiveInt43_50.convertPositiveInt(src.getOrderElement())); + if (src.hasNetwork()) + tgt.setNetworkElement(String43_50.convertString(src.getNetworkElement())); + for (org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary()) + tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t)); + if (src.hasSubrogation()) + tgt.setSubrogationElement(Boolean43_50.convertBoolean(src.getSubrogationElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getContract()) tgt.addContract(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r4b.model.Coverage.ClassComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Coverage.ClassComponent tgt = new org.hl7.fhir.r5.model.Coverage.ClassComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r5.model.Coverage.ClassComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Coverage.ClassComponent tgt = new org.hl7.fhir.r4b.model.Coverage.ClassComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent tgt = new org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + for (org.hl7.fhir.r4b.model.Coverage.ExemptionComponent t : src.getException()) + tgt.addException(convertExemptionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent tgt = new org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + for (org.hl7.fhir.r5.model.Coverage.ExemptionComponent t : src.getException()) + tgt.addException(convertExemptionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Coverage.ExemptionComponent convertExemptionComponent(org.hl7.fhir.r4b.model.Coverage.ExemptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Coverage.ExemptionComponent tgt = new org.hl7.fhir.r5.model.Coverage.ExemptionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Coverage.ExemptionComponent convertExemptionComponent(org.hl7.fhir.r5.model.Coverage.ExemptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Coverage.ExemptionComponent tgt = new org.hl7.fhir.r4b.model.Coverage.ExemptionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + 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/CoverageEligibilityRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CoverageEligibilityRequest43_50.java new file mode 100644 index 000000000..adb4cb81c --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/CoverageEligibilityRequest43_50.java @@ -0,0 +1,351 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Money43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class CoverageEligibilityRequest43_50 { + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r4b.model.CoverageEligibilityRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEligibilityRequestStatus(src.getStatusElement())); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + tgt.setPurpose(src.getPurpose().stream() + .map(CoverageEligibilityRequest43_50::convertEligibilityRequestPurpose) + .collect(Collectors.toList())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasFacility()) + tgt.setFacility(Reference43_50.convertReference(src.getFacility())); + for (org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent t : src.getSupportingInfo()) + tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + for (org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent t : src.getInsurance()) + tgt.addInsurance(convertInsuranceComponent(t)); + for (org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent t : src.getItem()) + tgt.addItem(convertDetailsComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r5.model.CoverageEligibilityRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEligibilityRequestStatus(src.getStatusElement())); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + tgt.setPurpose(src.getPurpose().stream() + .map(CoverageEligibilityRequest43_50::convertEligibilityRequestPurpose) + .collect(Collectors.toList())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasFacility()) + tgt.setFacility(Reference43_50.convertReference(src.getFacility())); + for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent t : src.getSupportingInfo()) + tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent t : src.getInsurance()) + tgt.addInsurance(convertInsuranceComponent(t)); + for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent t : src.getItem()) + tgt.addItem(convertDetailsComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasInformation()) + tgt.setInformation(Reference43_50.convertReference(src.getInformation())); + if (src.hasAppliesToAll()) + tgt.setAppliesToAllElement(Boolean43_50.convertBoolean(src.getAppliesToAllElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasInformation()) + tgt.setInformation(Reference43_50.convertReference(src.getInformation())); + if (src.hasAppliesToAll()) + tgt.setAppliesToAllElement(Boolean43_50.convertBoolean(src.getAppliesToAllElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFocal()) + tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFocal()) + tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + if (src.hasBusinessArrangement()) + tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getSupportingInfoSequence()) + tgt.getSupportingInfoSequence().add(PositiveInt43_50.convertPositiveInt(t)); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFacility()) + tgt.setFacility(Reference43_50.convertReference(src.getFacility())); + for (org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSupportingInfoSequence()) + tgt.getSupportingInfoSequence().add(PositiveInt43_50.convertPositiveInt(t)); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFacility()) + tgt.setFacility(Reference43_50.convertReference(src.getFacility())); + for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDiagnosis()) + tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDiagnosis()) + tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis())); + 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/DetectedIssue43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DetectedIssue43_50.java new file mode 100644 index 000000000..6e85c52e7 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DetectedIssue43_50.java @@ -0,0 +1,272 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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.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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class DetectedIssue43_50 { + + public static org.hl7.fhir.r5.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r4b.model.DetectedIssue src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DetectedIssue tgt = new org.hl7.fhir.r5.model.DetectedIssue(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertDetectedIssueStatus(src.getStatusElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSeverity()) + tgt.setSeverityElement(convertDetectedIssueSeverity(src.getSeverityElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasIdentified()) + tgt.setIdentified(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getIdentified())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + for (org.hl7.fhir.r4b.model.Reference t : src.getImplicated()) tgt.addImplicated(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence()) + tgt.addEvidence(convertDetectedIssueEvidenceComponent(t)); + if (src.hasDetail()) + tgt.setDetailElement(String43_50.convertString(src.getDetailElement())); + if (src.hasReference()) + tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement())); + for (org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) + tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r5.model.DetectedIssue src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DetectedIssue tgt = new org.hl7.fhir.r4b.model.DetectedIssue(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertDetectedIssueStatus(src.getStatusElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSeverity()) + tgt.setSeverityElement(convertDetectedIssueSeverity(src.getSeverityElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasIdentified()) + tgt.setIdentified(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getIdentified())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + for (org.hl7.fhir.r5.model.Reference t : src.getImplicated()) tgt.addImplicated(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence()) + tgt.addEvidence(convertDetectedIssueEvidenceComponent(t)); + if (src.hasDetail()) + tgt.setDetailElement(String43_50.convertString(src.getDetailElement())); + if (src.hasReference()) + tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement())); + for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) + tgt.addMitigation(convertDetectedIssueMitigationComponent(t)); + return tgt; + } + + 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.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; + } + + 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 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent tgt = new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent tgt = new org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAction()) + tgt.setAction(CodeableConcept43_50.convertCodeableConcept(src.getAction())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAction()) + tgt.setAction(CodeableConcept43_50.convertCodeableConcept(src.getAction())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + 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/Device43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Device43_50.java new file mode 100644 index 000000000..fd8708fe5 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Device43_50.java @@ -0,0 +1,461 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Base64Binary43_50; +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.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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Device43_50 { + + public static org.hl7.fhir.r5.model.Device convertDevice(org.hl7.fhir.r4b.model.Device src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device tgt = new org.hl7.fhir.r5.model.Device(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasDefinition()) + tgt.getDefinition().setReference(Reference43_50.convertReference(src.getDefinition())); + for (org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier()) + tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertFHIRDeviceStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getStatusReason()) + tgt.addStatusReason(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDistinctIdentifier()) + tgt.getBiologicalSourceEvent().setValueElement(String43_50.convertString(src.getDistinctIdentifierElement())); + if (src.hasManufacturer()) + tgt.setManufacturerElement(String43_50.convertString(src.getManufacturerElement())); + if (src.hasManufactureDate()) + tgt.setManufactureDateElement(DateTime43_50.convertDateTime(src.getManufactureDateElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(DateTime43_50.convertDateTime(src.getExpirationDateElement())); + if (src.hasLotNumber()) + tgt.setLotNumberElement(String43_50.convertString(src.getLotNumberElement())); + if (src.hasSerialNumber()) + tgt.setSerialNumberElement(String43_50.convertString(src.getSerialNumberElement())); + for (org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent t : src.getDeviceName()) + tgt.addDeviceName(convertDeviceDeviceNameComponent(t)); + if (src.hasModelNumber()) + tgt.setModelNumberElement(String43_50.convertString(src.getModelNumberElement())); + if (src.hasPartNumber()) + tgt.setPartNumberElement(String43_50.convertString(src.getPartNumberElement())); + if (src.hasType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// for (org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent t : src.getSpecialization()) +// tgt.addSpecialization(convertDeviceSpecializationComponent(t)); + for (org.hl7.fhir.r4b.model.Device.DeviceVersionComponent t : src.getVersion()) + tgt.addVersion(convertDeviceVersionComponent(t)); + for (org.hl7.fhir.r4b.model.Device.DevicePropertyComponent t : src.getProperty()) + tgt.addProperty(convertDevicePropertyComponent(t)); + if (src.hasPatient()) + tgt.setSubject(Reference43_50.convertReference(src.getPatient())); + if (src.hasOwner()) + tgt.setOwner(Reference43_50.convertReference(src.getOwner())); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getContact()) + tgt.addContact(ContactPoint43_50.convertContactPoint(t)); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSafety()) + tgt.addSafety(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasParent()) + tgt.setParent(Reference43_50.convertReference(src.getParent())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Device convertDevice(org.hl7.fhir.r5.model.Device src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Device tgt = new org.hl7.fhir.r4b.model.Device(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.getDefinition().hasReference()) + tgt.setDefinition(Reference43_50.convertReference(src.getDefinition().getReference())); + for (org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier()) + tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertFHIRDeviceStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) + tgt.addStatusReason(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasBiologicalSourceEvent()) + tgt.setDistinctIdentifierElement(String43_50.convertString(src.getBiologicalSourceEvent().getValueElement())); + if (src.hasManufacturer()) + tgt.setManufacturerElement(String43_50.convertString(src.getManufacturerElement())); + if (src.hasManufactureDate()) + tgt.setManufactureDateElement(DateTime43_50.convertDateTime(src.getManufactureDateElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(DateTime43_50.convertDateTime(src.getExpirationDateElement())); + if (src.hasLotNumber()) + tgt.setLotNumberElement(String43_50.convertString(src.getLotNumberElement())); + if (src.hasSerialNumber()) + tgt.setSerialNumberElement(String43_50.convertString(src.getSerialNumberElement())); + for (org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent t : src.getDeviceName()) + tgt.addDeviceName(convertDeviceDeviceNameComponent(t)); + if (src.hasModelNumber()) + tgt.setModelNumberElement(String43_50.convertString(src.getModelNumberElement())); + if (src.hasPartNumber()) + tgt.setPartNumberElement(String43_50.convertString(src.getPartNumberElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getTypeFirstRep())); +// for (org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent t : src.getSpecialization()) +// tgt.addSpecialization(convertDeviceSpecializationComponent(t)); + for (org.hl7.fhir.r5.model.Device.DeviceVersionComponent t : src.getVersion()) + tgt.addVersion(convertDeviceVersionComponent(t)); + for (org.hl7.fhir.r5.model.Device.DevicePropertyComponent t : src.getProperty()) + tgt.addProperty(convertDevicePropertyComponent(t)); + if (src.hasSubject()) + tgt.setPatient(Reference43_50.convertReference(src.getSubject())); + if (src.hasOwner()) + tgt.setOwner(Reference43_50.convertReference(src.getOwner())); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) + tgt.addContact(ContactPoint43_50.convertContactPoint(t)); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety()) + tgt.addSafety(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasParent()) + tgt.setParent(Reference43_50.convertReference(src.getParent())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDeviceIdentifier()) + tgt.setDeviceIdentifierElement(String43_50.convertString(src.getDeviceIdentifierElement())); + if (src.hasIssuer()) + tgt.setIssuerElement(Uri43_50.convertUri(src.getIssuerElement())); + if (src.hasJurisdiction()) + tgt.setJurisdictionElement(Uri43_50.convertUri(src.getJurisdictionElement())); + if (src.hasCarrierAIDC()) + tgt.setCarrierAIDCElement(Base64Binary43_50.convertBase64Binary(src.getCarrierAIDCElement())); + if (src.hasCarrierHRF()) + tgt.setCarrierHRFElement(String43_50.convertString(src.getCarrierHRFElement())); + if (src.hasEntryType()) + tgt.setEntryTypeElement(convertUDIEntryType(src.getEntryTypeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent tgt = new org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDeviceIdentifier()) + tgt.setDeviceIdentifierElement(String43_50.convertString(src.getDeviceIdentifierElement())); + if (src.hasIssuer()) + tgt.setIssuerElement(Uri43_50.convertUri(src.getIssuerElement())); + if (src.hasJurisdiction()) + tgt.setJurisdictionElement(Uri43_50.convertUri(src.getJurisdictionElement())); + if (src.hasCarrierAIDC()) + tgt.setCarrierAIDCElement(Base64Binary43_50.convertBase64Binary(src.getCarrierAIDCElement())); + if (src.hasCarrierHRF()) + tgt.setCarrierHRFElement(String43_50.convertString(src.getCarrierHRFElement())); + if (src.hasEntryType()) + tgt.setEntryTypeElement(convertUDIEntryType(src.getEntryTypeElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasType()) + tgt.setTypeElement(convertDeviceNameType(src.getTypeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent tgt = new org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasType()) + tgt.setTypeElement(convertDeviceNameType(src.getTypeElement())); + return tgt; + } + + 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; + } + + 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; + } + +// public static org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasSystemType()) +// tgt.setSystemType(CodeableConcept43_50.convertCodeableConcept(src.getSystemType())); +// if (src.hasVersion()) +// tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasSystemType()) +// tgt.setSystemType(CodeableConcept43_50.convertCodeableConcept(src.getSystemType())); +// if (src.hasVersion()) +// tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); +// return tgt; +// } + + public static org.hl7.fhir.r5.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r4b.model.Device.DeviceVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device.DeviceVersionComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceVersionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasComponent()) + tgt.setComponent(Identifier43_50.convertIdentifier(src.getComponent())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r5.model.Device.DeviceVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Device.DeviceVersionComponent tgt = new org.hl7.fhir.r4b.model.Device.DeviceVersionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasComponent()) + tgt.setComponent(Identifier43_50.convertIdentifier(src.getComponent())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r4b.model.Device.DevicePropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Device.DevicePropertyComponent tgt = new org.hl7.fhir.r5.model.Device.DevicePropertyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.Quantity t : src.getValueQuantity()) tgt.setValue(Quantity43_50.convertQuantity(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getValueCode()) + tgt.setValue(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r5.model.Device.DevicePropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Device.DevicePropertyComponent tgt = new org.hl7.fhir.r4b.model.Device.DevicePropertyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValueQuantity()) tgt.addValueQuantity(Quantity43_50.convertQuantity(src.getValueQuantity())); + if (src.hasValueCodeableConcept()) + tgt.addValueCode(CodeableConcept43_50.convertCodeableConcept(src.getValueCodeableConcept())); + return tgt; + } +} 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 new file mode 100644 index 000000000..9a4089742 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceDefinition43_50.java @@ -0,0 +1,340 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +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.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.DeviceDefinition.DeviceDefinitionClassificationComponent; +import org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionVersionComponent; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class DeviceDefinition43_50 { + + public static org.hl7.fhir.r5.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r4b.model.DeviceDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition tgt = new org.hl7.fhir.r5.model.DeviceDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier()) + tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t)); + if (src.hasManufacturerReference()) + tgt.setManufacturer(Reference43_50.convertReference(src.getManufacturerReference())); + for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName()) + tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t)); + if (src.hasModelNumber()) + tgt.setModelNumberElement(String43_50.convertString(src.getModelNumberElement())); + if (src.hasType()) + tgt.addClassification().setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization()) +// tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getVersion()) + tgt.getVersion().add(new DeviceDefinitionVersionComponent().setValueElement(String43_50.convertString(t))); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSafety()) + tgt.addSafety(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.ProductShelfLife t : src.getShelfLifeStorage()) + tgt.addShelfLifeStorage(ProductShelfLife43_50.convertProductShelfLife(t)); +// if (src.hasPhysicalCharacteristics()) +// tgt.setPhysicalCharacteristics(ProdCharacteristic43_50.convertProdCharacteristic(src.getPhysicalCharacteristics())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getLanguageCode()) + tgt.addLanguageCode(CodeableConcept43_50.convertCodeableConcept(t)); +// for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability()) +// tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t)); + for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty()) + tgt.addProperty(convertDeviceDefinitionPropertyComponent(t)); + if (src.hasOwner()) + tgt.setOwner(Reference43_50.convertReference(src.getOwner())); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getContact()) + tgt.addContact(ContactPoint43_50.convertContactPoint(t)); +// if (src.hasOnlineInformation()) +// tgt.setOnlineInformationElement(Uri43_50.convertUri(src.getOnlineInformationElement())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasParentDevice()) + tgt.setParentDevice(Reference43_50.convertReference(src.getParentDevice())); + for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent t : src.getMaterial()) + tgt.addMaterial(convertDeviceDefinitionMaterialComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r5.model.DeviceDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceDefinition tgt = new org.hl7.fhir.r4b.model.DeviceDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier()) + tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t)); + if (src.hasManufacturer()) + tgt.setManufacturer(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getManufacturer())); + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName()) + tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t)); + if (src.hasModelNumber()) + tgt.setModelNumberElement(String43_50.convertString(src.getModelNumberElement())); + for (DeviceDefinitionClassificationComponent t : src.getClassification()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(t.getType())); +// for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization()) +// tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t)); + for (DeviceDefinitionVersionComponent t : src.getVersion()) + tgt.getVersion().add(String43_50.convertString(t.getValueElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety()) + tgt.addSafety(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.ProductShelfLife t : src.getShelfLifeStorage()) + tgt.addShelfLifeStorage(ProductShelfLife43_50.convertProductShelfLife(t)); +// if (src.hasPhysicalCharacteristics()) +// tgt.setPhysicalCharacteristics(ProdCharacteristic43_50.convertProdCharacteristic(src.getPhysicalCharacteristics())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLanguageCode()) + tgt.addLanguageCode(CodeableConcept43_50.convertCodeableConcept(t)); +// for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability()) +// tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t)); + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty()) + tgt.addProperty(convertDeviceDefinitionPropertyComponent(t)); + if (src.hasOwner()) + tgt.setOwner(Reference43_50.convertReference(src.getOwner())); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) + tgt.addContact(ContactPoint43_50.convertContactPoint(t)); +// if (src.hasOnlineInformation()) +// tgt.setOnlineInformationElement(Uri43_50.convertUri(src.getOnlineInformationElement())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasParentDevice()) + tgt.setParentDevice(Reference43_50.convertReference(src.getParentDevice())); + for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent t : src.getMaterial()) + tgt.addMaterial(convertDeviceDefinitionMaterialComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent convertDeviceDefinitionUdiDeviceIdentifierComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDeviceIdentifier()) + tgt.setDeviceIdentifierElement(String43_50.convertString(src.getDeviceIdentifierElement())); + if (src.hasIssuer()) + tgt.setIssuerElement(Uri43_50.convertUri(src.getIssuerElement())); + if (src.hasJurisdiction()) + tgt.setJurisdictionElement(Uri43_50.convertUri(src.getJurisdictionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent convertDeviceDefinitionUdiDeviceIdentifierComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDeviceIdentifier()) + tgt.setDeviceIdentifierElement(String43_50.convertString(src.getDeviceIdentifierElement())); + if (src.hasIssuer()) + tgt.setIssuerElement(Uri43_50.convertUri(src.getIssuerElement())); + if (src.hasJurisdiction()) + tgt.setJurisdictionElement(Uri43_50.convertUri(src.getJurisdictionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasType()) + tgt.setTypeElement(convertDeviceNameType(src.getTypeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasType()) + tgt.setTypeElement(convertDeviceNameType(src.getTypeElement())); + return tgt; + } + + 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; + } + + 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; + } +// +// public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasSystemType()) +// tgt.setSystemTypeElement(String43_50.convertString(src.getSystemTypeElement())); +// if (src.hasVersion()) +// tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasSystemType()) +// tgt.setSystemTypeElement(String43_50.convertString(src.getSystemTypeElement())); +// if (src.hasVersion()) +// tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); +// return tgt; +// } +// +// public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasType()) +// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getDescription()) +// tgt.addDescription(CodeableConcept43_50.convertCodeableConcept(t)); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasType()) +// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDescription()) +// tgt.addDescription(CodeableConcept43_50.convertCodeableConcept(t)); +// return tgt; +// } + + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.Quantity t : src.getValueQuantity()) + tgt.setValue(Quantity43_50.convertQuantity(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getValueCode()) + tgt.setValue(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValueQuantity()) + tgt.addValueQuantity(Quantity43_50.convertQuantity(src.getValueQuantity())); + if (src.hasValueCodeableConcept()) + tgt.addValueCode(CodeableConcept43_50.convertCodeableConcept(src.getValueCodeableConcept())); + return tgt; + } + + public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSubstance()) + tgt.setSubstance(CodeableConcept43_50.convertCodeableConcept(src.getSubstance())); + if (src.hasAlternate()) + tgt.setAlternateElement(Boolean43_50.convertBoolean(src.getAlternateElement())); + if (src.hasAllergenicIndicator()) + tgt.setAllergenicIndicatorElement(Boolean43_50.convertBoolean(src.getAllergenicIndicatorElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSubstance()) + tgt.setSubstance(CodeableConcept43_50.convertCodeableConcept(src.getSubstance())); + if (src.hasAlternate()) + tgt.setAlternateElement(Boolean43_50.convertBoolean(src.getAlternateElement())); + if (src.hasAllergenicIndicator()) + tgt.setAllergenicIndicatorElement(Boolean43_50.convertBoolean(src.getAllergenicIndicatorElement())); + return tgt; + } +} 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 new file mode 100644 index 000000000..217723d87 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceMetric43_50.java @@ -0,0 +1,399 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Timing43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class DeviceMetric43_50 { + + public static org.hl7.fhir.r5.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r4b.model.DeviceMetric src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceMetric tgt = new org.hl7.fhir.r5.model.DeviceMetric(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasUnit()) + tgt.setUnit(CodeableConcept43_50.convertCodeableConcept(src.getUnit())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + if (src.hasParent()) + tgt.setParent(Reference43_50.convertReference(src.getParent())); + if (src.hasOperationalStatus()) + tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement())); + if (src.hasColor()) + tgt.setColorElement(convertDeviceMetricColor(src.getColorElement())); + if (src.hasCategory()) + tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement())); + if (src.hasMeasurementPeriod()) + tgt.setMeasurementPeriod(Timing43_50.convertTiming(src.getMeasurementPeriod())); + for (org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) + tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r5.model.DeviceMetric src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceMetric tgt = new org.hl7.fhir.r4b.model.DeviceMetric(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasUnit()) + tgt.setUnit(CodeableConcept43_50.convertCodeableConcept(src.getUnit())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + if (src.hasParent()) + tgt.setParent(Reference43_50.convertReference(src.getParent())); + if (src.hasOperationalStatus()) + tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement())); + if (src.hasColor()) + tgt.setColorElement(convertDeviceMetricColor(src.getColorElement())); + if (src.hasCategory()) + tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement())); + if (src.hasMeasurementPeriod()) + tgt.setMeasurementPeriod(Timing43_50.convertTiming(src.getMeasurementPeriod())); + for (org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) + tgt.addCalibration(convertDeviceMetricCalibrationComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + static public org.hl7.fhir.r5.model.Enumeration convertDeviceMetricColor(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.DeviceMetricColorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case BLACK: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLACK); + break; + case RED: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.RED); + break; + case GREEN: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.GREEN); + break; + case YELLOW: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.YELLOW); + break; + case BLUE: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLUE); + break; + case MAGENTA: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.MAGENTA); + break; + case CYAN: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.CYAN); + break; + case WHITE: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.WHITE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertDeviceMetricColor(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.DeviceMetricColorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case BLACK: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.BLACK); + break; + case RED: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.RED); + break; + case GREEN: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.GREEN); + break; + case YELLOW: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.YELLOW); + break; + case BLUE: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.BLUE); + break; + case MAGENTA: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.MAGENTA); + break; + case CYAN: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.CYAN); + break; + case WHITE: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.WHITE); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r5.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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement())); + if (src.hasState()) + tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement())); + if (src.hasTime()) + tgt.setTimeElement(Instant43_50.convertInstant(src.getTimeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement())); + if (src.hasState()) + tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement())); + if (src.hasTime()) + tgt.setTimeElement(Instant43_50.convertInstant(src.getTimeElement())); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..5dca83957 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceRequest43_50.java @@ -0,0 +1,379 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class DeviceRequest43_50 { + + public static org.hl7.fhir.r5.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r4b.model.DeviceRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceRequest tgt = new org.hl7.fhir.r5.model.DeviceRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); +// for (org.hl7.fhir.r4b.model.Reference t : src.getPriorRequest()) +// tgt.addPriorRequest(Reference43_50.convertReference(t)); + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatusElement(convertDeviceRequestStatus(src.getStatusElement())); + if (src.hasIntent()) + tgt.setIntentElement(convertRequestIntent(src.getIntentElement())); + if (src.hasPriority()) + tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement())); + if (src.hasCodeCodeableConcept()) + tgt.getCode().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getCodeCodeableConcept())); + else if (src.hasCodeReference()) + tgt.getCode().setReference(Reference43_50.convertReference(src.getCodeReference())); + + for (org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter()) + tgt.addParameter(convertDeviceRequestParameterComponent(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + if (src.hasPerformerType()) + tgt.setPerformerType(CodeableConcept43_50.convertCodeableConcept(src.getPerformerType())); + if (src.hasPerformer()) + tgt.setPerformer(Reference43_50.convertReference(src.getPerformer())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getRelevantHistory()) + tgt.addRelevantHistory(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r5.model.DeviceRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceRequest tgt = new org.hl7.fhir.r4b.model.DeviceRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); +// for (org.hl7.fhir.r5.model.Reference t : src.getPriorRequest()) +// tgt.addPriorRequest(Reference43_50.convertReference(t)); + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier())); + if (src.hasStatus()) + tgt.setStatusElement(convertDeviceRequestStatus(src.getStatusElement())); + if (src.hasIntent()) + tgt.setIntentElement(convertRequestIntent(src.getIntentElement())); + if (src.hasPriority()) + tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement())); + if (src.getCode().hasConcept()) + tgt.setCode(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCode().getConcept())); + if (src.getCode().hasReference()) + tgt.setCode(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCode().getReference())); + for (org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter()) + tgt.addParameter(convertDeviceRequestParameterComponent(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + if (src.hasPerformerType()) + tgt.setPerformerType(CodeableConcept43_50.convertCodeableConcept(src.getPerformerType())); + if (src.hasPerformer()) + tgt.setPerformer(Reference43_50.convertReference(src.getPerformer())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) + tgt.addRelevantHistory(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent tgt = new org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent tgt = new org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + 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/DeviceUseStatement43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceUseStatement43_50.java new file mode 100644 index 000000000..486de6c0a --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DeviceUseStatement43_50.java @@ -0,0 +1,170 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class DeviceUseStatement43_50 { + + public static org.hl7.fhir.r5.model.DeviceUsage convertDeviceUseStatement(org.hl7.fhir.r4b.model.DeviceUseStatement src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DeviceUsage tgt = new org.hl7.fhir.r5.model.DeviceUsage(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertDeviceUseStatementStatus(src.getStatusElement())); + if (src.hasSubject()) + tgt.setPatient(Reference43_50.convertReference(src.getSubject())); + for (org.hl7.fhir.r4b.model.Reference t : src.getDerivedFrom()) + tgt.addDerivedFrom(Reference43_50.convertReference(t)); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + if (src.hasRecordedOn()) + tgt.setDateAssertedElement(DateTime43_50.convertDateTime(src.getRecordedOnElement())); + if (src.hasSource()) + tgt.setInformationSource(Reference43_50.convertReference(src.getSource())); + if (src.hasDevice()) + tgt.getDevice().setReference(Reference43_50.convertReference(src.getDevice())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + if (src.hasBodySite()) + tgt.getBodySite().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.r5.model.DeviceUsage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DeviceUseStatement tgt = new org.hl7.fhir.r4b.model.DeviceUseStatement(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertDeviceUseStatementStatus(src.getStatusElement())); + if (src.hasPatient()) + tgt.setSubject(Reference43_50.convertReference(src.getPatient())); + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) + tgt.addDerivedFrom(Reference43_50.convertReference(t)); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + if (src.hasDateAsserted()) + tgt.setRecordedOnElement(DateTime43_50.convertDateTime(src.getDateAssertedElement())); + if (src.hasInformationSource()) + tgt.setSource(Reference43_50.convertReference(src.getInformationSource())); + if (src.getDevice().hasReference()) + tgt.setDevice(Reference43_50.convertReference(src.getDevice().getReference())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + if (src.getBodySite().hasConcept()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite().getConcept())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..be962723b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DiagnosticReport43_50.java @@ -0,0 +1,232 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Attachment43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class DiagnosticReport43_50 { + + public static org.hl7.fhir.r5.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.r4b.model.DiagnosticReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DiagnosticReport tgt = new org.hl7.fhir.r5.model.DiagnosticReport(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertDiagnosticReportStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective())); + if (src.hasIssued()) + tgt.setIssuedElement(Instant43_50.convertInstant(src.getIssuedElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getResultsInterpreter()) + tgt.addResultsInterpreter(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSpecimen()) tgt.addSpecimen(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getResult()) tgt.addResult(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getImagingStudy()) + tgt.addImagingStudy(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) + tgt.addMedia(convertDiagnosticReportMediaComponent(t)); + if (src.hasConclusion()) + tgt.setConclusionElement(String43_50.convertString(src.getConclusionElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getConclusionCode()) + tgt.addConclusionCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Attachment t : src.getPresentedForm()) + tgt.addPresentedForm(Attachment43_50.convertAttachment(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.r5.model.DiagnosticReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DiagnosticReport tgt = new org.hl7.fhir.r4b.model.DiagnosticReport(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertDiagnosticReportStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective())); + if (src.hasIssued()) + tgt.setIssuedElement(Instant43_50.convertInstant(src.getIssuedElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getResultsInterpreter()) + tgt.addResultsInterpreter(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getResult()) tgt.addResult(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getImagingStudy()) + tgt.addImagingStudy(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia()) + tgt.addMedia(convertDiagnosticReportMediaComponent(t)); + if (src.hasConclusion()) + tgt.setConclusionElement(String43_50.convertString(src.getConclusionElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getConclusionCode()) + tgt.addConclusionCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Attachment t : src.getPresentedForm()) + tgt.addPresentedForm(Attachment43_50.convertAttachment(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + if (src.hasLink()) + tgt.setLink(Reference43_50.convertReference(src.getLink())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r4b.model.DiagnosticReport.DiagnosticReportMediaComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + if (src.hasLink()) + tgt.setLink(Reference43_50.convertReference(src.getLink())); + 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/DocumentManifest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentManifest43_50.java new file mode 100644 index 000000000..5ec057a89 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentManifest43_50.java @@ -0,0 +1,124 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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.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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class DocumentManifest43_50 { + + public static org.hl7.fhir.r5.model.DocumentManifest convertDocumentManifest(org.hl7.fhir.r4b.model.DocumentManifest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentManifest tgt = new org.hl7.fhir.r5.model.DocumentManifest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasMasterIdentifier()) + tgt.setMasterIdentifier(Identifier43_50.convertIdentifier(src.getMasterIdentifier())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertDocumentReferenceStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t)); + if (src.hasSource()) + tgt.setSourceElement(Uri43_50.convertUri(src.getSourceElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getContent()) tgt.addContent(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) + tgt.addRelated(convertDocumentManifestRelatedComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DocumentManifest convertDocumentManifest(org.hl7.fhir.r5.model.DocumentManifest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DocumentManifest tgt = new org.hl7.fhir.r4b.model.DocumentManifest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasMasterIdentifier()) + tgt.setMasterIdentifier(Identifier43_50.convertIdentifier(src.getMasterIdentifier())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertDocumentReferenceStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t)); + if (src.hasSource()) + tgt.setSourceElement(Uri43_50.convertUri(src.getSourceElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getContent()) tgt.addContent(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated()) + tgt.addRelated(convertDocumentManifestRelatedComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent convertDocumentManifestRelatedComponent(org.hl7.fhir.r4b.model.DocumentManifest.DocumentManifestRelatedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasRef()) + tgt.setRef(Reference43_50.convertReference(src.getRef())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DocumentManifest.DocumentManifestRelatedComponent convertDocumentManifestRelatedComponent(org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.r4b.model.DocumentManifest.DocumentManifestRelatedComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasRef()) + tgt.setRef(Reference43_50.convertReference(src.getRef())); + 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/DocumentReference43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentReference43_50.java new file mode 100644 index 000000000..467aa7a48 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/DocumentReference43_50.java @@ -0,0 +1,297 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; +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.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeableReference; +import org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceAttesterComponent; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class DocumentReference43_50 { + + public static org.hl7.fhir.r5.model.DocumentReference convertDocumentReference(org.hl7.fhir.r4b.model.DocumentReference src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentReference tgt = new org.hl7.fhir.r5.model.DocumentReference(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasMasterIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getMasterIdentifier())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertDocumentReferenceStatus(src.getStatusElement())); + if (src.hasDocStatus()) + tgt.setDocStatusElement(convertReferredDocumentStatus(src.getDocStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(Instant43_50.convertInstant(src.getDateElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t)); + if (src.hasAuthenticator()) + tgt.addAttester().setMode(new org.hl7.fhir.r5.model.CodeableConcept().addCoding(new org.hl7.fhir.r5.model.Coding("http://hl7.org/fhir/composition-attestation-mode","official", "Official"))) + .setParty(Reference43_50.convertReference(src.getAuthenticator())); + if (src.hasCustodian()) + tgt.setCustodian(Reference43_50.convertReference(src.getCustodian())); + for (org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) + tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertStringToMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSecurityLabel()) + tgt.addSecurityLabel(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) + tgt.addContent(convertDocumentReferenceContentComponent(t)); + if (src.hasContext()) + convertDocumentReferenceContextComponent(src.getContext(), tgt); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DocumentReference convertDocumentReference(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DocumentReference tgt = new org.hl7.fhir.r4b.model.DocumentReference(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); +// if (src.hasMasterIdentifier()) +// tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertDocumentReferenceStatus(src.getStatusElement())); + if (src.hasDocStatus()) + tgt.setDocStatusElement(convertReferredDocumentStatus(src.getDocStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(Instant43_50.convertInstant(src.getDateElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t)); + for (DocumentReferenceAttesterComponent t : src.getAttester()) { + if (t.getMode().hasCoding("http://hl7.org/fhir/composition-attestation-mode", "official")) + tgt.setAuthenticator(Reference43_50.convertReference(t.getParty())); + } + if (src.hasCustodian()) + tgt.setCustodian(Reference43_50.convertReference(src.getCustodian())); + for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) + tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel()) + tgt.addSecurityLabel(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) + tgt.addContent(convertDocumentReferenceContentComponent(t)); + convertDocumentReferenceContextComponent(src, tgt.getContext()); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(convertDocumentRelationshipType(src.getCodeElement())); + if (src.hasTarget()) + tgt.setTarget(Reference43_50.convertReference(src.getTarget())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceRelatesToComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(convertDocumentRelationshipType(src.getCode())); + if (src.hasTarget()) + tgt.setTarget(Reference43_50.convertReference(src.getTarget())); + return tgt; + } + + 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; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertDocumentRelationshipType(org.hl7.fhir.r5.model.CodeableConcept 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.getCode("http://hl7.org/fhir/document-relationship-type")) { + 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.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAttachment()) + tgt.setAttachment(Attachment43_50.convertAttachment(src.getAttachment())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceContentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAttachment()) + tgt.setAttachment(Attachment43_50.convertAttachment(src.getAttachment())); + return tgt; + } + + public static void convertDocumentReferenceContextComponent(org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceContextComponent src, org.hl7.fhir.r5.model.DocumentReference tgt) throws FHIRException { + for (org.hl7.fhir.r4b.model.Reference t : src.getEncounter()) tgt.addContext(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getEvent()) + tgt.addEvent(new CodeableReference().setConcept(CodeableConcept43_50.convertCodeableConcept(t))); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasFacilityType()) + tgt.setFacilityType(CodeableConcept43_50.convertCodeableConcept(src.getFacilityType())); + if (src.hasPracticeSetting()) + tgt.setPracticeSetting(CodeableConcept43_50.convertCodeableConcept(src.getPracticeSetting())); + if (src.hasSourcePatientInfo()) + tgt.setSourcePatientInfo(Reference43_50.convertReference(src.getSourcePatientInfo())); +// for (org.hl7.fhir.r4b.model.Reference t : src.getRelated()) tgt.addRelated(Reference43_50.convertReference(t)); + } + + public static void convertDocumentReferenceContextComponent(org.hl7.fhir.r5.model.DocumentReference src, org.hl7.fhir.r4b.model.DocumentReference.DocumentReferenceContextComponent tgt) throws FHIRException { + for (org.hl7.fhir.r5.model.Reference t : src.getContext()) tgt.addEncounter(Reference43_50.convertReference(t)); + for (CodeableReference t : src.getEvent()) + if (t.hasConcept()) + tgt.addEvent(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasFacilityType()) + tgt.setFacilityType(CodeableConcept43_50.convertCodeableConcept(src.getFacilityType())); + if (src.hasPracticeSetting()) + tgt.setPracticeSetting(CodeableConcept43_50.convertCodeableConcept(src.getPracticeSetting())); + if (src.hasSourcePatientInfo()) + tgt.setSourcePatientInfo(Reference43_50.convertReference(src.getSourcePatientInfo())); +// for (org.hl7.fhir.r5.model.Reference t : src.getRelated()) tgt.addRelated(Reference43_50.convertReference(t)); + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..31f055dc6 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Encounter43_50.java @@ -0,0 +1,455 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Encounter43_50 { + + public static org.hl7.fhir.r5.model.Encounter convertEncounter(org.hl7.fhir.r4b.model.Encounter src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter tgt = new org.hl7.fhir.r5.model.Encounter(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEncounterStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) + tgt.addStatusHistory(convertStatusHistoryComponent(t)); + if (src.hasClass_()) + tgt.setClass_(new org.hl7.fhir.r5.model.CodeableConcept().addCoding(Coding43_50.convertCoding(src.getClass_()))); + for (org.hl7.fhir.r4b.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) + tgt.addClassHistory(convertClassHistoryComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasServiceType()) + tgt.setServiceType(new CodeableReference(CodeableConcept43_50.convertCodeableConcept(src.getServiceType()))); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + for (org.hl7.fhir.r4b.model.Reference t : src.getEpisodeOfCare()) + tgt.addEpisodeOfCare(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertEncounterParticipantComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getAppointment()) + tgt.addAppointment(Reference43_50.convertReference(t)); + if (src.hasPeriod()) + tgt.setActualPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasLength()) + tgt.setLength(Duration43_50.convertDuration(src.getLength())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getAccount()) tgt.addAccount(Reference43_50.convertReference(t)); + if (src.hasHospitalization()) + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + for (org.hl7.fhir.r4b.model.Encounter.EncounterLocationComponent t : src.getLocation()) + tgt.addLocation(convertEncounterLocationComponent(t)); + if (src.hasServiceProvider()) + tgt.setServiceProvider(Reference43_50.convertReference(src.getServiceProvider())); + if (src.hasPartOf()) + tgt.setPartOf(Reference43_50.convertReference(src.getPartOf())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Encounter convertEncounter(org.hl7.fhir.r5.model.Encounter src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Encounter tgt = new org.hl7.fhir.r4b.model.Encounter(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEncounterStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent t : src.getStatusHistory()) + tgt.addStatusHistory(convertStatusHistoryComponent(t)); + if (src.hasClass_()) + tgt.setClass_(Coding43_50.convertCoding(src.getClass_().getCodingFirstRep())); + for (org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent t : src.getClassHistory()) + tgt.addClassHistory(convertClassHistoryComponent(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.getServiceType().hasConcept()) + tgt.setServiceType(CodeableConcept43_50.convertCodeableConcept(src.getServiceType().getConcept())); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + for (org.hl7.fhir.r5.model.Reference t : src.getEpisodeOfCare()) + tgt.addEpisodeOfCare(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertEncounterParticipantComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getAppointment()) + tgt.addAppointment(Reference43_50.convertReference(t)); + if (src.hasActualPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getActualPeriod())); + if (src.hasLength()) + tgt.setLength(Duration43_50.convertDuration(src.getLength())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Encounter.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(Reference43_50.convertReference(t)); + if (src.hasHospitalization()) + tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization())); + for (org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent t : src.getLocation()) + tgt.addLocation(convertEncounterLocationComponent(t)); + if (src.hasServiceProvider()) + tgt.setServiceProvider(Reference43_50.convertReference(src.getServiceProvider())); + if (src.hasPartOf()) + tgt.setPartOf(Reference43_50.convertReference(src.getPartOf())); + return tgt; + } + + 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.Encounter.EncounterStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case PLANNED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterStatus.PLANNED); + break; + case ARRIVED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS); + break; + case TRIAGED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS); + break; + case INPROGRESS: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS); + break; + case ONLEAVE: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS); + break; + case FINISHED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterStatus.COMPLETED); + break; + case CANCELLED: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterStatus.CANCELLED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterStatus.ENTEREDINERROR); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.EncounterStatus.UNKNOWN); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Encounter.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; + } + + public static org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r4b.model.Encounter.StatusHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent tgt = new org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasStatus()) + tgt.setStatusElement(convertEncounterStatus(src.getStatusElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Encounter.StatusHistoryComponent tgt = new org.hl7.fhir.r4b.model.Encounter.StatusHistoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasStatus()) + tgt.setStatusElement(convertEncounterStatus(src.getStatusElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent convertClassHistoryComponent(org.hl7.fhir.r4b.model.Encounter.ClassHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent tgt = new org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasClass_()) + tgt.setClass_(Coding43_50.convertCoding(src.getClass_())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Encounter.ClassHistoryComponent convertClassHistoryComponent(org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Encounter.ClassHistoryComponent tgt = new org.hl7.fhir.r4b.model.Encounter.ClassHistoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasClass_()) + tgt.setClass_(Coding43_50.convertCoding(src.getClass_())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r4b.model.Encounter.EncounterParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasIndividual()) + tgt.setActor(Reference43_50.convertReference(src.getIndividual())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r4b.model.Encounter.EncounterParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasActor()) + tgt.setIndividual(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4b.model.Encounter.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.Encounter.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCondition()) + tgt.setCondition(Reference43_50.convertReference(src.getCondition())); + if (src.hasUse()) + tgt.setUse(CodeableConcept43_50.convertCodeableConcept(src.getUse())); + if (src.hasRank()) + tgt.setRankElement(PositiveInt43_50.convertPositiveInt(src.getRankElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Encounter.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.Encounter.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Encounter.DiagnosisComponent tgt = new org.hl7.fhir.r4b.model.Encounter.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCondition()) + tgt.setCondition(Reference43_50.convertReference(src.getCondition())); + if (src.hasUse()) + tgt.setUse(CodeableConcept43_50.convertCodeableConcept(src.getUse())); + if (src.hasRank()) + tgt.setRankElement(PositiveInt43_50.convertPositiveInt(src.getRankElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.r4b.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPreAdmissionIdentifier()) + tgt.setPreAdmissionIdentifier(Identifier43_50.convertIdentifier(src.getPreAdmissionIdentifier())); + if (src.hasOrigin()) + tgt.setOrigin(Reference43_50.convertReference(src.getOrigin())); + if (src.hasAdmitSource()) + tgt.setAdmitSource(CodeableConcept43_50.convertCodeableConcept(src.getAdmitSource())); + if (src.hasReAdmission()) + tgt.setReAdmission(CodeableConcept43_50.convertCodeableConcept(src.getReAdmission())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getDietPreference()) + tgt.addDietPreference(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialCourtesy()) + tgt.addSpecialCourtesy(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialArrangement()) + tgt.addSpecialArrangement(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDestination()) + tgt.setDestination(Reference43_50.convertReference(src.getDestination())); + if (src.hasDischargeDisposition()) + tgt.setDischargeDisposition(CodeableConcept43_50.convertCodeableConcept(src.getDischargeDisposition())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r4b.model.Encounter.EncounterHospitalizationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPreAdmissionIdentifier()) + tgt.setPreAdmissionIdentifier(Identifier43_50.convertIdentifier(src.getPreAdmissionIdentifier())); + if (src.hasOrigin()) + tgt.setOrigin(Reference43_50.convertReference(src.getOrigin())); + if (src.hasAdmitSource()) + tgt.setAdmitSource(CodeableConcept43_50.convertCodeableConcept(src.getAdmitSource())); + if (src.hasReAdmission()) + tgt.setReAdmission(CodeableConcept43_50.convertCodeableConcept(src.getReAdmission())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDietPreference()) + tgt.addDietPreference(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialCourtesy()) + tgt.addSpecialCourtesy(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialArrangement()) + tgt.addSpecialArrangement(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDestination()) + tgt.setDestination(Reference43_50.convertReference(src.getDestination())); + if (src.hasDischargeDisposition()) + tgt.setDischargeDisposition(CodeableConcept43_50.convertCodeableConcept(src.getDischargeDisposition())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.r4b.model.Encounter.EncounterLocationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + if (src.hasStatus()) + tgt.setStatusElement(convertEncounterLocationStatus(src.getStatusElement())); + if (src.hasPhysicalType()) + tgt.setPhysicalType(CodeableConcept43_50.convertCodeableConcept(src.getPhysicalType())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r4b.model.Encounter.EncounterLocationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + if (src.hasStatus()) + tgt.setStatusElement(convertEncounterLocationStatus(src.getStatusElement())); + if (src.hasPhysicalType()) + tgt.setPhysicalType(CodeableConcept43_50.convertCodeableConcept(src.getPhysicalType())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..eb2e04efe --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Endpoint43_50.java @@ -0,0 +1,161 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_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.Url43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Endpoint43_50 { + + public static org.hl7.fhir.r5.model.Endpoint convertEndpoint(org.hl7.fhir.r4b.model.Endpoint src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Endpoint tgt = new org.hl7.fhir.r5.model.Endpoint(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEndpointStatus(src.getStatusElement())); + if (src.hasConnectionType()) + tgt.addConnectionType(Coding43_50.convertCoding(src.getConnectionType())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getContact()) + tgt.addContact(ContactPoint43_50.convertContactPoint(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPayloadType()) + tgt.addPayloadType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeType t : src.getPayloadMimeType()) + tgt.getPayloadMimeType().add(Code43_50.convertCode(t)); + if (src.hasAddress()) + tgt.setAddressElement(Url43_50.convertUrl(src.getAddressElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getHeader()) tgt.getHeader().add(String43_50.convertString(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Endpoint convertEndpoint(org.hl7.fhir.r5.model.Endpoint src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Endpoint tgt = new org.hl7.fhir.r4b.model.Endpoint(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEndpointStatus(src.getStatusElement())); + if (src.hasConnectionType()) + tgt.setConnectionType(Coding43_50.convertCoding(src.getConnectionTypeFirstRep())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact()) + tgt.addContact(ContactPoint43_50.convertContactPoint(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPayloadType()) + tgt.addPayloadType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeType t : src.getPayloadMimeType()) + tgt.getPayloadMimeType().add(Code43_50.convertCode(t)); + if (src.hasAddress()) + tgt.setAddressElement(Url43_50.convertUrl(src.getAddressElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getHeader()) tgt.getHeader().add(String43_50.convertString(t)); + return tgt; + } + + 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; + case TEST: + tgt.setValue(org.hl7.fhir.r5.model.Endpoint.EndpointStatus.TEST); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.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; + case TEST: + tgt.setValue(org.hl7.fhir.r4b.model.Endpoint.EndpointStatus.TEST); + 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 new file mode 100644 index 000000000..1bb30ccba --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EnrollmentRequest43_50.java @@ -0,0 +1,133 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class EnrollmentRequest43_50 { + + public static org.hl7.fhir.r5.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.r4b.model.EnrollmentRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EnrollmentRequest tgt = new org.hl7.fhir.r5.model.EnrollmentRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEnrollmentRequestStatus(src.getStatusElement())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasCandidate()) + tgt.setCandidate(Reference43_50.convertReference(src.getCandidate())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.r5.model.EnrollmentRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.EnrollmentRequest tgt = new org.hl7.fhir.r4b.model.EnrollmentRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEnrollmentRequestStatus(src.getStatusElement())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasCandidate()) + tgt.setCandidate(Reference43_50.convertReference(src.getCandidate())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..dc56badc5 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Enumerations43_50.java @@ -0,0 +1,558 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Enumerations43_50 { + + public static void copyEnumeration(org.hl7.fhir.r4b.model.Enumeration src, org.hl7.fhir.r5.model.Enumeration tgt) throws FHIRException { + if (src.hasId()) tgt.setId(src.getId()); + for (org.hl7.fhir.r4b.model.Extension e : src.getExtension()) { + tgt.addExtension(Extension43_50.convertExtension(e)); + } + } + + public static void copyEnumeration(org.hl7.fhir.r5.model.Enumeration src, org.hl7.fhir.r4b.model.Enumeration tgt) throws FHIRException { + if (src.hasId()) tgt.setId(src.getId()); + for (org.hl7.fhir.r5.model.Extension e : src.getExtension()) { + tgt.addExtension(Extension43_50.convertExtension(e)); + } + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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_0CIBUILD: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_3_0CIBUILD); + break; + case _4_3_0SNAPSHOT1: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_3_0SNAPSHOT1); + 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; + } + + 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_0CIBUILD: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_3_0CIBUILD); + break; + case _4_3_0SNAPSHOT1: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_3_0SNAPSHOT1); + 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; + } + + 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; + } + + 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.Enumerations.NoteTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case DISPLAY: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.NoteType.DISPLAY); + break; + case PRINT: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.NoteType.PRINT); + break; + case PRINTOPER: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.NoteType.PRINTOPER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.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; + } + + 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.Enumerations.DocumentReferenceStatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case CURRENT: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.CURRENT); + break; + case SUPERSEDED: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.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; + } + + 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; + } + + 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; + } + +} \ 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 new file mode 100644 index 000000000..b36e9c5ec --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EpisodeOfCare43_50.java @@ -0,0 +1,221 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class EpisodeOfCare43_50 { + + public static org.hl7.fhir.r5.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.r4b.model.EpisodeOfCare src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EpisodeOfCare tgt = new org.hl7.fhir.r5.model.EpisodeOfCare(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEpisodeOfCareStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) + tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r4b.model.Reference t : src.getReferralRequest()) + tgt.addReferralRequest(Reference43_50.convertReference(t)); + if (src.hasCareManager()) + tgt.setCareManager(Reference43_50.convertReference(src.getCareManager())); + for (org.hl7.fhir.r4b.model.Reference t : src.getTeam()) tgt.addTeam(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getAccount()) tgt.addAccount(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.r5.model.EpisodeOfCare src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.EpisodeOfCare tgt = new org.hl7.fhir.r4b.model.EpisodeOfCare(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertEpisodeOfCareStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory()) + tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r5.model.Reference t : src.getReferralRequest()) + tgt.addReferralRequest(Reference43_50.convertReference(t)); + if (src.hasCareManager()) + tgt.setCareManager(Reference43_50.convertReference(src.getCareManager())); + for (org.hl7.fhir.r5.model.Reference t : src.getTeam()) tgt.addTeam(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasStatus()) + tgt.setStatusElement(convertEpisodeOfCareStatus(src.getStatusElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r4b.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasStatus()) + tgt.setStatusElement(convertEpisodeOfCareStatus(src.getStatusElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4b.model.EpisodeOfCare.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCondition()) + tgt.setCondition(Reference43_50.convertReference(src.getCondition())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasRank()) + tgt.setRankElement(PositiveInt43_50.convertPositiveInt(src.getRankElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.EpisodeOfCare.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.EpisodeOfCare.DiagnosisComponent tgt = new org.hl7.fhir.r4b.model.EpisodeOfCare.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCondition()) + tgt.setCondition(Reference43_50.convertReference(src.getCondition())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasRank()) + tgt.setRankElement(PositiveInt43_50.convertPositiveInt(src.getRankElement())); + 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/EventDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EventDefinition43_50.java new file mode 100644 index 000000000..f874dc45e --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/EventDefinition43_50.java @@ -0,0 +1,172 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.RelatedArtifact43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.TriggerDefinition43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class EventDefinition43_50 { + + public static org.hl7.fhir.r5.model.EventDefinition convertEventDefinition(org.hl7.fhir.r4b.model.EventDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.EventDefinition tgt = new org.hl7.fhir.r5.model.EventDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r4b.model.TriggerDefinition t : src.getTrigger()) + tgt.addTrigger(TriggerDefinition43_50.convertTriggerDefinition(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.EventDefinition convertEventDefinition(org.hl7.fhir.r5.model.EventDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.EventDefinition tgt = new org.hl7.fhir.r4b.model.EventDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger()) + tgt.addTrigger(TriggerDefinition43_50.convertTriggerDefinition(t)); + 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/ExampleScenario43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExampleScenario43_50.java new file mode 100644 index 000000000..aae4cef62 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExampleScenario43_50.java @@ -0,0 +1,436 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ExampleScenario43_50 { + + public static org.hl7.fhir.r5.model.ExampleScenario convertExampleScenario(org.hl7.fhir.r4b.model.ExampleScenario src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario tgt = new org.hl7.fhir.r5.model.ExampleScenario(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + for (org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor()) + tgt.addActor(convertExampleScenarioActorComponent(t)); + for (org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceComponent t : src.getInstance()) + tgt.addInstance(convertExampleScenarioInstanceComponent(t)); + for (org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) + tgt.addProcess(convertExampleScenarioProcessComponent(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getWorkflow()) + tgt.getWorkflow().add(Canonical43_50.convertCanonical(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExampleScenario convertExampleScenario(org.hl7.fhir.r5.model.ExampleScenario src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExampleScenario tgt = new org.hl7.fhir.r4b.model.ExampleScenario(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor()) + tgt.addActor(convertExampleScenarioActorComponent(t)); + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent t : src.getInstance()) + tgt.addInstance(convertExampleScenarioInstanceComponent(t)); + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) + tgt.addProcess(convertExampleScenarioProcessComponent(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getWorkflow()) + tgt.getWorkflow().add(Canonical43_50.convertCanonical(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent convertExampleScenarioActorComponent(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasActorId()) + tgt.setActorIdElement(String43_50.convertString(src.getActorIdElement())); + if (src.hasType()) + tgt.setTypeElement(convertExampleScenarioActorType(src.getTypeElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorComponent convertExampleScenarioActorComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorComponent tgt = new org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioActorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasActorId()) + tgt.setActorIdElement(String43_50.convertString(src.getActorIdElement())); + if (src.hasType()) + tgt.setTypeElement(convertExampleScenarioActorType(src.getTypeElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + 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.ExampleScenario.ExampleScenarioActorTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case PERSON: + tgt.setValue(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.PERSON); + break; + case ENTITY: + tgt.setValue(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.ENTITY); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ExampleScenario.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 ENTITY: + 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; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasResourceId()) + tgt.setResourceIdElement(String43_50.convertString(src.getResourceIdElement())); + if (src.hasResourceType()) + tgt.setTypeElement(Code43_50.convertCode(src.getResourceTypeElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceVersionComponent t : src.getVersion()) + tgt.addVersion(convertExampleScenarioInstanceVersionComponent(t)); + for (org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent t : src.getContainedInstance()) + tgt.addContainedInstance(convertExampleScenarioInstanceContainedInstanceComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasResourceId()) + tgt.setResourceIdElement(String43_50.convertString(src.getResourceIdElement())); + if (src.hasType()) + tgt.setResourceTypeElement(Code43_50.convertCode(src.getTypeElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent t : src.getVersion()) + tgt.addVersion(convertExampleScenarioInstanceVersionComponent(t)); + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent t : src.getContainedInstance()) + tgt.addContainedInstance(convertExampleScenarioInstanceContainedInstanceComponent(t)); + return tgt; + } + + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent convertExampleScenarioInstanceVersionComponent(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasVersionId()) + tgt.setVersionIdElement(String43_50.convertString(src.getVersionIdElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceVersionComponent convertExampleScenarioInstanceVersionComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceVersionComponent tgt = new org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceVersionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasVersionId()) + tgt.setVersionIdElement(String43_50.convertString(src.getVersionIdElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent convertExampleScenarioInstanceContainedInstanceComponent(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasResourceId()) + tgt.setResourceIdElement(String43_50.convertString(src.getResourceIdElement())); + if (src.hasVersionId()) + tgt.setVersionIdElement(String43_50.convertString(src.getVersionIdElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent convertExampleScenarioInstanceContainedInstanceComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent tgt = new org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasResourceId()) + tgt.setResourceIdElement(String43_50.convertString(src.getResourceIdElement())); + if (src.hasVersionId()) + tgt.setVersionIdElement(String43_50.convertString(src.getVersionIdElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent convertExampleScenarioProcessComponent(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + if (src.hasPreConditions()) + tgt.setPreConditionsElement(MarkDown43_50.convertMarkdown(src.getPreConditionsElement())); + if (src.hasPostConditions()) + tgt.setPostConditionsElement(MarkDown43_50.convertMarkdown(src.getPostConditionsElement())); + for (org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) + tgt.addStep(convertExampleScenarioProcessStepComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessComponent convertExampleScenarioProcessComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessComponent tgt = new org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + if (src.hasPreConditions()) + tgt.setPreConditionsElement(MarkDown43_50.convertMarkdown(src.getPreConditionsElement())); + if (src.hasPostConditions()) + tgt.setPostConditionsElement(MarkDown43_50.convertMarkdown(src.getPostConditionsElement())); + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) + tgt.addStep(convertExampleScenarioProcessStepComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent convertExampleScenarioProcessStepComponent(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) + tgt.addProcess(convertExampleScenarioProcessComponent(t)); + if (src.hasPause()) + tgt.setPauseElement(Boolean43_50.convertBoolean(src.getPauseElement())); + if (src.hasOperation()) + tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation())); + for (org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent t : src.getAlternative()) + tgt.addAlternative(convertExampleScenarioProcessStepAlternativeComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepComponent convertExampleScenarioProcessStepComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess()) + tgt.addProcess(convertExampleScenarioProcessComponent(t)); + if (src.hasPause()) + tgt.setPauseElement(Boolean43_50.convertBoolean(src.getPauseElement())); + if (src.hasOperation()) + tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation())); + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent t : src.getAlternative()) + tgt.addAlternative(convertExampleScenarioProcessStepAlternativeComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(String43_50.convertString(src.getNumberElement())); + if (src.hasType()) + tgt.setTypeElement(String43_50.convertString(src.getTypeElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasInitiator()) + tgt.setInitiatorElement(String43_50.convertString(src.getInitiatorElement())); + if (src.hasReceiver()) + tgt.setReceiverElement(String43_50.convertString(src.getReceiverElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + if (src.hasInitiatorActive()) + tgt.setInitiatorActiveElement(Boolean43_50.convertBoolean(src.getInitiatorActiveElement())); + if (src.hasReceiverActive()) + tgt.setReceiverActiveElement(Boolean43_50.convertBoolean(src.getReceiverActiveElement())); + if (src.hasRequest()) + tgt.setRequest(convertExampleScenarioInstanceContainedInstanceComponent(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertExampleScenarioInstanceContainedInstanceComponent(src.getResponse())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent tgt = new org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(String43_50.convertString(src.getNumberElement())); + if (src.hasType()) + tgt.setTypeElement(String43_50.convertString(src.getTypeElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasInitiator()) + tgt.setInitiatorElement(String43_50.convertString(src.getInitiatorElement())); + if (src.hasReceiver()) + tgt.setReceiverElement(String43_50.convertString(src.getReceiverElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + if (src.hasInitiatorActive()) + tgt.setInitiatorActiveElement(Boolean43_50.convertBoolean(src.getInitiatorActiveElement())); + if (src.hasReceiverActive()) + tgt.setReceiverActiveElement(Boolean43_50.convertBoolean(src.getReceiverActiveElement())); + if (src.hasRequest()) + tgt.setRequest(convertExampleScenarioInstanceContainedInstanceComponent(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(convertExampleScenarioInstanceContainedInstanceComponent(src.getResponse())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent convertExampleScenarioProcessStepAlternativeComponent(org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) + tgt.addStep(convertExampleScenarioProcessStepComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent convertExampleScenarioProcessStepAlternativeComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent tgt = new org.hl7.fhir.r4b.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep()) + tgt.addStep(convertExampleScenarioProcessStepComponent(t)); + 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/ExplanationOfBenefit43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExplanationOfBenefit43_50.java new file mode 100644 index 000000000..127e8119b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ExplanationOfBenefit43_50.java @@ -0,0 +1,1255 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ExplanationOfBenefit43_50 { + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit convertExplanationOfBenefit(org.hl7.fhir.r4b.model.ExplanationOfBenefit src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertExplanationOfBenefitStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUseElement(convertUse(src.getUseElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasBillablePeriod()) + tgt.setBillablePeriod(Period43_50.convertPeriod(src.getBillablePeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasFundsReserveRequested()) + tgt.setFundsReserveRequested(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserveRequested())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve())); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.RelatedClaimComponent t : src.getRelated()) + tgt.addRelated(convertRelatedClaimComponent(t)); + if (src.hasPrescription()) + tgt.setPrescription(Reference43_50.convertReference(src.getPrescription())); + if (src.hasOriginalPrescription()) + tgt.setOriginalPrescription(Reference43_50.convertReference(src.getOriginalPrescription())); + if (src.hasPayee()) + tgt.setPayee(convertPayeeComponent(src.getPayee())); + if (src.hasReferral()) + tgt.setReferral(Reference43_50.convertReference(src.getReferral())); + if (src.hasFacility()) + tgt.setFacility(Reference43_50.convertReference(src.getFacility())); + if (src.hasClaim()) + tgt.setClaim(Reference43_50.convertReference(src.getClaim())); + if (src.hasClaimResponse()) + tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse())); + if (src.hasOutcome()) + tgt.setOutcomeElement(convertRemittanceOutcome(src.getOutcomeElement())); + if (src.hasDisposition()) + tgt.setDispositionElement(String43_50.convertString(src.getDispositionElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getPreAuthRef()) + tgt.getPreAuthRef().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.Period t : src.getPreAuthRefPeriod()) + tgt.addPreAuthRefPeriod(Period43_50.convertPeriod(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.CareTeamComponent t : src.getCareTeam()) + tgt.addCareTeam(convertCareTeamComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.SupportingInformationComponent t : src.getSupportingInfo()) + tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.ProcedureComponent t : src.getProcedure()) + tgt.addProcedure(convertProcedureComponent(t)); + if (src.hasPrecedence()) + tgt.setPrecedenceElement(PositiveInt43_50.convertPositiveInt(src.getPrecedenceElement())); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.InsuranceComponent t : src.getInsurance()) + tgt.addInsurance(convertInsuranceComponent(t)); + if (src.hasAccident()) + tgt.setAccident(convertAccidentComponent(src.getAccident())); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.ItemComponent t : src.getItem()) + tgt.addItem(convertItemComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemComponent t : src.getAddItem()) + tgt.addAddItem(convertAddedItemComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.TotalComponent t : src.getTotal()) + tgt.addTotal(convertTotalComponent(t)); + if (src.hasPayment()) + tgt.setPayment(convertPaymentComponent(src.getPayment())); + if (src.hasFormCode()) + tgt.setFormCode(CodeableConcept43_50.convertCodeableConcept(src.getFormCode())); + if (src.hasForm()) + tgt.setForm(Attachment43_50.convertAttachment(src.getForm())); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.NoteComponent t : src.getProcessNote()) + tgt.addProcessNote(convertNoteComponent(t)); + if (src.hasBenefitPeriod()) + tgt.setBenefitPeriod(Period43_50.convertPeriod(src.getBenefitPeriod())); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitBalanceComponent t : src.getBenefitBalance()) + tgt.addBenefitBalance(convertBenefitBalanceComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit convertExplanationOfBenefit(org.hl7.fhir.r5.model.ExplanationOfBenefit src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertExplanationOfBenefitStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubType()) + tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType())); + if (src.hasUse()) + tgt.setUseElement(convertUse(src.getUseElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasBillablePeriod()) + tgt.setBillablePeriod(Period43_50.convertPeriod(src.getBillablePeriod())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasInsurer()) + tgt.setInsurer(Reference43_50.convertReference(src.getInsurer())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasFundsReserveRequested()) + tgt.setFundsReserveRequested(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserveRequested())); + if (src.hasFundsReserve()) + tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve())); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent t : src.getRelated()) + tgt.addRelated(convertRelatedClaimComponent(t)); + if (src.hasPrescription()) + tgt.setPrescription(Reference43_50.convertReference(src.getPrescription())); + if (src.hasOriginalPrescription()) + tgt.setOriginalPrescription(Reference43_50.convertReference(src.getOriginalPrescription())); + if (src.hasPayee()) + tgt.setPayee(convertPayeeComponent(src.getPayee())); + if (src.hasReferral()) + tgt.setReferral(Reference43_50.convertReference(src.getReferral())); + if (src.hasFacility()) + tgt.setFacility(Reference43_50.convertReference(src.getFacility())); + if (src.hasClaim()) + tgt.setClaim(Reference43_50.convertReference(src.getClaim())); + if (src.hasClaimResponse()) + tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse())); + if (src.hasOutcome()) + tgt.setOutcomeElement(convertRemittanceOutcome(src.getOutcomeElement())); + if (src.hasDisposition()) + tgt.setDispositionElement(String43_50.convertString(src.getDispositionElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef()) + tgt.getPreAuthRef().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.Period t : src.getPreAuthRefPeriod()) + tgt.addPreAuthRefPeriod(Period43_50.convertPeriod(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent t : src.getCareTeam()) + tgt.addCareTeam(convertCareTeamComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent t : src.getSupportingInfo()) + tgt.addSupportingInfo(convertSupportingInformationComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent t : src.getDiagnosis()) + tgt.addDiagnosis(convertDiagnosisComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent t : src.getProcedure()) + tgt.addProcedure(convertProcedureComponent(t)); + if (src.hasPrecedence()) + tgt.setPrecedenceElement(PositiveInt43_50.convertPositiveInt(src.getPrecedenceElement())); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent t : src.getInsurance()) + tgt.addInsurance(convertInsuranceComponent(t)); + if (src.hasAccident()) + tgt.setAccident(convertAccidentComponent(src.getAccident())); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent t : src.getItem()) + tgt.addItem(convertItemComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent t : src.getAddItem()) + tgt.addAddItem(convertAddedItemComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent t : src.getTotal()) + tgt.addTotal(convertTotalComponent(t)); + if (src.hasPayment()) + tgt.setPayment(convertPaymentComponent(src.getPayment())); + if (src.hasFormCode()) + tgt.setFormCode(CodeableConcept43_50.convertCodeableConcept(src.getFormCode())); + if (src.hasForm()) + tgt.setForm(Attachment43_50.convertAttachment(src.getForm())); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent t : src.getProcessNote()) + tgt.addProcessNote(convertNoteComponent(t)); + if (src.hasBenefitPeriod()) + tgt.setBenefitPeriod(Period43_50.convertPeriod(src.getBenefitPeriod())); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent t : src.getBenefitBalance()) + tgt.addBenefitBalance(convertBenefitBalanceComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.RelatedClaimComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasClaim()) + tgt.setClaim(Reference43_50.convertReference(src.getClaim())); + if (src.hasRelationship()) + tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship())); + if (src.hasReference()) + tgt.setReference(Identifier43_50.convertIdentifier(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.RelatedClaimComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.RelatedClaimComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.RelatedClaimComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasClaim()) + tgt.setClaim(Reference43_50.convertReference(src.getClaim())); + if (src.hasRelationship()) + tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship())); + if (src.hasReference()) + tgt.setReference(Identifier43_50.convertIdentifier(src.getReference())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent convertPayeeComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.PayeeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.PayeeComponent convertPayeeComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.PayeeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.PayeeComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.PayeeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasParty()) + tgt.setParty(Reference43_50.convertReference(src.getParty())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.CareTeamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasResponsible()) + tgt.setResponsibleElement(Boolean43_50.convertBoolean(src.getResponsibleElement())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasQualification()) + tgt.setQualification(CodeableConcept43_50.convertCodeableConcept(src.getQualification())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.CareTeamComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.CareTeamComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.CareTeamComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasResponsible()) + tgt.setResponsibleElement(Boolean43_50.convertBoolean(src.getResponsibleElement())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasQualification()) + tgt.setQualification(CodeableConcept43_50.convertCodeableConcept(src.getQualification())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasReason()) + tgt.setReason(Coding43_50.convertCoding(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.SupportingInformationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.SupportingInformationComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.SupportingInformationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasReason()) + tgt.setReason(Coding43_50.convertCoding(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasDiagnosis()) + tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOnAdmission()) + tgt.setOnAdmission(CodeableConcept43_50.convertCodeableConcept(src.getOnAdmission())); + if (src.hasPackageCode()) + tgt.setPackageCode(CodeableConcept43_50.convertCodeableConcept(src.getPackageCode())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.DiagnosisComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.DiagnosisComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.DiagnosisComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasDiagnosis()) + tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOnAdmission()) + tgt.setOnAdmission(CodeableConcept43_50.convertCodeableConcept(src.getOnAdmission())); + if (src.hasPackageCode()) + tgt.setPackageCode(CodeableConcept43_50.convertCodeableConcept(src.getPackageCode())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ProcedureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasProcedure()) + tgt.setProcedure(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProcedure())); + for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.ProcedureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.ProcedureComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.ProcedureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasProcedure()) + tgt.setProcedure(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProcedure())); + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFocal()) + tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + for (org.hl7.fhir.r4b.model.StringType t : src.getPreAuthRef()) + tgt.getPreAuthRef().add(String43_50.convertString(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.InsuranceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.InsuranceComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.InsuranceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFocal()) + tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement())); + if (src.hasCoverage()) + tgt.setCoverage(Reference43_50.convertReference(src.getCoverage())); + for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef()) + tgt.getPreAuthRef().add(String43_50.convertString(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent convertAccidentComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.AccidentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.AccidentComponent convertAccidentComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AccidentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.AccidentComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.AccidentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent convertItemComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getCareTeamSequence()) + tgt.getCareTeamSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getDiagnosisSequence()) + tgt.getDiagnosisSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getProcedureSequence()) + tgt.getProcedureSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getInformationSequence()) + tgt.getInformationSequence().add(PositiveInt43_50.convertPositiveInt(t)); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubSite()) + tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getEncounter()) tgt.addEncounter(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.DetailComponent t : src.getDetail()) + tgt.addDetail(convertDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.ItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.ItemComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.ItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getCareTeamSequence()) + tgt.getCareTeamSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDiagnosisSequence()) + tgt.getDiagnosisSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getProcedureSequence()) + tgt.getProcedureSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getInformationSequence()) + tgt.getInformationSequence().add(PositiveInt43_50.convertPositiveInt(t)); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) + tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEncounter()) tgt.addEncounter(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent t : src.getDetail()) + tgt.addDetail(convertDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasValue()) + tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasValue()) + tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent convertDetailComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.DetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.SubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.DetailComponent convertDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.DetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.DetailComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.DetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.SubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.SubDetailComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.SubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasRevenue()) + tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getItemSequence()) + tgt.getItemSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getDetailSequence()) + tgt.getDetailSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getSubDetailSequence()) + tgt.getSubDetailSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getProvider()) tgt.addProvider(Reference43_50.convertReference(t)); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubSite()) + tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailComponent t : src.getDetail()) + tgt.addDetail(convertAddedItemDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getItemSequence()) + tgt.getItemSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDetailSequence()) + tgt.getDetailSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSubDetailSequence()) + tgt.getSubDetailSequence().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getProvider()) tgt.addProvider(Reference43_50.convertReference(t)); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode()) + tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasServiced()) + tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced())); + if (src.hasLocation()) + tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite()) + tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent t : src.getDetail()) + tgt.addDetail(convertAddedItemDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertAddedItemDetailSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent t : src.getSubDetail()) + tgt.addSubDetail(convertAddedItemDetailSubDetailComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent convertAddedItemDetailSubDetailComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent convertAddedItemDetailSubDetailComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.AddedItemDetailSubDetailComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProductOrService()) + tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier()) + tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasUnitPrice()) + tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasNet()) + tgt.setNet(Money43_50.convertMoney(src.getNet())); + for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber()) + tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t)); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.AdjudicationComponent t : src.getAdjudication()) + tgt.addAdjudication(convertAdjudicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent convertTotalComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.TotalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.TotalComponent convertTotalComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.TotalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.TotalComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.TotalComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent convertPaymentComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.PaymentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasAdjustment()) + tgt.setAdjustment(Money43_50.convertMoney(src.getAdjustment())); + if (src.hasAdjustmentReason()) + tgt.setAdjustmentReason(CodeableConcept43_50.convertCodeableConcept(src.getAdjustmentReason())); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.PaymentComponent convertPaymentComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.PaymentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.PaymentComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.PaymentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasAdjustment()) + tgt.setAdjustment(Money43_50.convertMoney(src.getAdjustment())); + if (src.hasAdjustmentReason()) + tgt.setAdjustmentReason(CodeableConcept43_50.convertCodeableConcept(src.getAdjustmentReason())); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent convertNoteComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.NoteComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(PositiveInt43_50.convertPositiveInt(src.getNumberElement())); + if (src.hasType()) + tgt.setTypeElement(Enumerations43_50.convertNoteType(src.getTypeElement())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + if (src.hasLanguage()) + tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.NoteComponent convertNoteComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.NoteComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.NoteComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.NoteComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasNumber()) + tgt.setNumberElement(PositiveInt43_50.convertPositiveInt(src.getNumberElement())); + if (src.hasType()) + tgt.setTypeElement(Enumerations43_50.convertNoteType(src.getTypeElement())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + if (src.hasLanguage()) + tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent convertBenefitBalanceComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitBalanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasExcluded()) + tgt.setExcludedElement(Boolean43_50.convertBoolean(src.getExcludedElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasNetwork()) + tgt.setNetwork(CodeableConcept43_50.convertCodeableConcept(src.getNetwork())); + if (src.hasUnit()) + tgt.setUnit(CodeableConcept43_50.convertCodeableConcept(src.getUnit())); + if (src.hasTerm()) + tgt.setTerm(CodeableConcept43_50.convertCodeableConcept(src.getTerm())); + for (org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitComponent t : src.getFinancial()) + tgt.addFinancial(convertBenefitComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitBalanceComponent convertBenefitBalanceComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitBalanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitBalanceComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitBalanceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasExcluded()) + tgt.setExcludedElement(Boolean43_50.convertBoolean(src.getExcludedElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasNetwork()) + tgt.setNetwork(CodeableConcept43_50.convertCodeableConcept(src.getNetwork())); + if (src.hasUnit()) + tgt.setUnit(CodeableConcept43_50.convertCodeableConcept(src.getUnit())); + if (src.hasTerm()) + tgt.setTerm(CodeableConcept43_50.convertCodeableConcept(src.getTerm())); + for (org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent t : src.getFinancial()) + tgt.addFinancial(convertBenefitComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent convertBenefitComponent(org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent tgt = new org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAllowed())); + if (src.hasUsed()) + tgt.setUsed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getUsed())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitComponent convertBenefitComponent(org.hl7.fhir.r5.model.ExplanationOfBenefit.BenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitComponent tgt = new org.hl7.fhir.r4b.model.ExplanationOfBenefit.BenefitComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAllowed())); + if (src.hasUsed()) + tgt.setUsed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getUsed())); + 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/FamilyMemberHistory43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/FamilyMemberHistory43_50.java new file mode 100644 index 000000000..df5d187a0 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/FamilyMemberHistory43_50.java @@ -0,0 +1,214 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class FamilyMemberHistory43_50 { + + public static org.hl7.fhir.r5.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r4b.model.FamilyMemberHistory src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.FamilyMemberHistory tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertFamilyHistoryStatus(src.getStatusElement())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(CodeableConcept43_50.convertCodeableConcept(src.getDataAbsentReason())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasRelationship()) + tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship())); + if (src.hasSex()) + tgt.setSex(CodeableConcept43_50.convertCodeableConcept(src.getSex())); + if (src.hasBorn()) + tgt.setBorn(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getBorn())); + if (src.hasAge()) + tgt.setAge(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAge())); + if (src.hasEstimatedAge()) + tgt.setEstimatedAgeElement(Boolean43_50.convertBoolean(src.getEstimatedAgeElement())); + if (src.hasDeceased()) + tgt.setDeceased(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDeceased())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) + tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r5.model.FamilyMemberHistory src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.FamilyMemberHistory tgt = new org.hl7.fhir.r4b.model.FamilyMemberHistory(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertFamilyHistoryStatus(src.getStatusElement())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(CodeableConcept43_50.convertCodeableConcept(src.getDataAbsentReason())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasRelationship()) + tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship())); + if (src.hasSex()) + tgt.setSex(CodeableConcept43_50.convertCodeableConcept(src.getSex())); + if (src.hasBorn()) + tgt.setBorn(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getBorn())); + if (src.hasAge()) + tgt.setAge(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAge())); + if (src.hasEstimatedAge()) + tgt.setEstimatedAgeElement(Boolean43_50.convertBoolean(src.getEstimatedAgeElement())); + if (src.hasDeceased()) + tgt.setDeceased(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDeceased())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition()) + tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasOutcome()) + tgt.setOutcome(CodeableConcept43_50.convertCodeableConcept(src.getOutcome())); + if (src.hasContributedToDeath()) + tgt.setContributedToDeathElement(Boolean43_50.convertBoolean(src.getContributedToDeathElement())); + if (src.hasOnset()) + tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r4b.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasOutcome()) + tgt.setOutcome(CodeableConcept43_50.convertCodeableConcept(src.getOutcome())); + if (src.hasContributedToDeath()) + tgt.setContributedToDeathElement(Boolean43_50.convertBoolean(src.getContributedToDeathElement())); + if (src.hasOnset()) + tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + 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/Flag43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Flag43_50.java new file mode 100644 index 000000000..b305d0a54 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Flag43_50.java @@ -0,0 +1,132 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Flag43_50 { + + public static org.hl7.fhir.r5.model.Flag convertFlag(org.hl7.fhir.r4b.model.Flag src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Flag tgt = new org.hl7.fhir.r5.model.Flag(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertFlagStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Flag convertFlag(org.hl7.fhir.r5.model.Flag src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Flag tgt = new org.hl7.fhir.r4b.model.Flag(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertFlagStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..ace148edc --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Goal43_50.java @@ -0,0 +1,225 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Date43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Goal43_50 { + + public static org.hl7.fhir.r5.model.Goal convertGoal(org.hl7.fhir.r4b.model.Goal src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Goal tgt = new org.hl7.fhir.r5.model.Goal(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasLifecycleStatus()) + tgt.setLifecycleStatusElement(convertGoalLifecycleStatus(src.getLifecycleStatusElement())); + if (src.hasAchievementStatus()) + tgt.setAchievementStatus(CodeableConcept43_50.convertCodeableConcept(src.getAchievementStatus())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasDescription()) + tgt.setDescription(CodeableConcept43_50.convertCodeableConcept(src.getDescription())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasStart()) + tgt.setStart(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getStart())); + for (org.hl7.fhir.r4b.model.Goal.GoalTargetComponent t : src.getTarget()) + tgt.addTarget(convertGoalTargetComponent(t)); + if (src.hasStatusDate()) + tgt.setStatusDateElement(Date43_50.convertDate(src.getStatusDateElement())); + if (src.hasStatusReason()) + tgt.setStatusReasonElement(String43_50.convertString(src.getStatusReasonElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAddresses()) tgt.addAddresses(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getOutcomeCode()) + tgt.addOutcome(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getOutcomeReference()) + tgt.addOutcome(Reference43_50.convertReferenceToCodeableReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Goal convertGoal(org.hl7.fhir.r5.model.Goal src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Goal tgt = new org.hl7.fhir.r4b.model.Goal(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasLifecycleStatus()) + tgt.setLifecycleStatusElement(convertGoalLifecycleStatus(src.getLifecycleStatusElement())); + if (src.hasAchievementStatus()) + tgt.setAchievementStatus(CodeableConcept43_50.convertCodeableConcept(src.getAchievementStatus())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasDescription()) + tgt.setDescription(CodeableConcept43_50.convertCodeableConcept(src.getDescription())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasStart()) + tgt.setStart(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getStart())); + for (org.hl7.fhir.r5.model.Goal.GoalTargetComponent t : src.getTarget()) + tgt.addTarget(convertGoalTargetComponent(t)); + if (src.hasStatusDate()) + tgt.setStatusDateElement(Date43_50.convertDate(src.getStatusDateElement())); + if (src.hasStatusReason()) + tgt.setStatusReasonElement(String43_50.convertString(src.getStatusReasonElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getAddresses()) tgt.addAddresses(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (CodeableReference t : src.getOutcome()) + if (t.hasConcept()) + tgt.addOutcomeCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getOutcome()) + if (t.hasReference()) + tgt.addOutcomeReference(Reference43_50.convertReference(t.getReference())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r4b.model.Goal.GoalTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Goal.GoalTargetComponent tgt = new org.hl7.fhir.r5.model.Goal.GoalTargetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMeasure()) + tgt.setMeasure(CodeableConcept43_50.convertCodeableConcept(src.getMeasure())); + if (src.hasDetail()) + tgt.setDetail(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDetail())); + if (src.hasDue()) + tgt.setDue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r5.model.Goal.GoalTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Goal.GoalTargetComponent tgt = new org.hl7.fhir.r4b.model.Goal.GoalTargetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMeasure()) + tgt.setMeasure(CodeableConcept43_50.convertCodeableConcept(src.getMeasure())); + if (src.hasDetail()) + tgt.setDetail(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDetail())); + if (src.hasDue()) + tgt.setDue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDue())); + 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/GraphDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GraphDefinition43_50.java new file mode 100644 index 000000000..40d460064 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GraphDefinition43_50.java @@ -0,0 +1,372 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class GraphDefinition43_50 { + + public static org.hl7.fhir.r5.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r4b.model.GraphDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GraphDefinition tgt = new org.hl7.fhir.r5.model.GraphDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasStart()) + tgt.setStartElement(Code43_50.convertResourceEnum(src.getStartElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + for (org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) + tgt.addLink(convertGraphDefinitionLinkComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r5.model.GraphDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.GraphDefinition tgt = new org.hl7.fhir.r4b.model.GraphDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasStart()) + tgt.setStartElement(Code43_50.convertResourceEnum(src.getStartElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) + tgt.addLink(convertGraphDefinitionLinkComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasSliceName()) + tgt.setSliceNameElement(String43_50.convertString(src.getSliceNameElement())); + if (src.hasMin()) + tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) + tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasSliceName()) + tgt.setSliceNameElement(String43_50.convertString(src.getSliceNameElement())); + if (src.hasMin()) + tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget()) + tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(Code43_50.convertResourceEnum(src.getTypeElement())); + if (src.hasParams()) + tgt.setParamsElement(String43_50.convertString(src.getParamsElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + for (org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) + tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); + for (org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) + tgt.addLink(convertGraphDefinitionLinkComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(Code43_50.convertResourceEnum(src.getTypeElement())); + if (src.hasParams()) + tgt.setParamsElement(String43_50.convertString(src.getParamsElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment()) + tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t)); + for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink()) + tgt.addLink(convertGraphDefinitionLinkComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUse()) + tgt.setUseElement(convertGraphCompartmentUse(src.getUseElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCompartmentCode(src.getCodeElement())); + if (src.hasRule()) + tgt.setRuleElement(convertGraphCompartmentRule(src.getRuleElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r4b.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUse()) + tgt.setUseElement(convertGraphCompartmentUse(src.getUseElement())); + if (src.hasCode()) + tgt.setCodeElement(convertCompartmentCode(src.getCodeElement())); + if (src.hasRule()) + tgt.setRuleElement(convertGraphCompartmentRule(src.getRuleElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertGraphCompartmentUse(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.GraphDefinition.GraphCompartmentUseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case CONDITION: + tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.CONDITION); + break; + case REQUIREMENT: + tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertGraphCompartmentUse(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.GraphDefinition.GraphCompartmentUseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case CONDITION: + tgt.setValue(org.hl7.fhir.r4b.model.GraphDefinition.GraphCompartmentUse.CONDITION); + break; + case REQUIREMENT: + tgt.setValue(org.hl7.fhir.r4b.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.GraphDefinition.GraphCompartmentUse.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertCompartmentCode(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; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertCompartmentCode(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; + } + + static public org.hl7.fhir.r5.model.Enumeration convertGraphCompartmentRule(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.GraphDefinition.GraphCompartmentRuleEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_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; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertGraphCompartmentRule(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.GraphDefinition.GraphCompartmentRuleEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case IDENTICAL: + tgt.setValue(org.hl7.fhir.r4b.model.GraphDefinition.GraphCompartmentRule.IDENTICAL); + break; + case MATCHING: + tgt.setValue(org.hl7.fhir.r4b.model.GraphDefinition.GraphCompartmentRule.MATCHING); + break; + case DIFFERENT: + tgt.setValue(org.hl7.fhir.r4b.model.GraphDefinition.GraphCompartmentRule.DIFFERENT); + break; + case CUSTOM: + tgt.setValue(org.hl7.fhir.r4b.model.GraphDefinition.GraphCompartmentRule.CUSTOM); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.GraphDefinition.GraphCompartmentRule.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/Group43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Group43_50.java new file mode 100644 index 000000000..91f092101 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Group43_50.java @@ -0,0 +1,221 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +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.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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Group43_50 { + + public static org.hl7.fhir.r5.model.Group convertGroup(org.hl7.fhir.r4b.model.Group src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Group tgt = new org.hl7.fhir.r5.model.Group(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasType()) + tgt.setTypeElement(convertGroupType(src.getTypeElement())); + if (src.hasActual()) + tgt.setActualElement(Boolean43_50.convertBoolean(src.getActualElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasQuantity()) + tgt.setQuantityElement(UnsignedInt43_50.convertUnsignedInt(src.getQuantityElement())); + if (src.hasManagingEntity()) + tgt.setManagingEntity(Reference43_50.convertReference(src.getManagingEntity())); + for (org.hl7.fhir.r4b.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) + tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + for (org.hl7.fhir.r4b.model.Group.GroupMemberComponent t : src.getMember()) + tgt.addMember(convertGroupMemberComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Group convertGroup(org.hl7.fhir.r5.model.Group src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Group tgt = new org.hl7.fhir.r4b.model.Group(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasType()) + tgt.setTypeElement(convertGroupType(src.getTypeElement())); + if (src.hasActual()) + tgt.setActualElement(Boolean43_50.convertBoolean(src.getActualElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasQuantity()) + tgt.setQuantityElement(UnsignedInt43_50.convertUnsignedInt(src.getQuantityElement())); + if (src.hasManagingEntity()) + tgt.setManagingEntity(Reference43_50.convertReference(src.getManagingEntity())); + for (org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent t : src.getCharacteristic()) + tgt.addCharacteristic(convertGroupCharacteristicComponent(t)); + for (org.hl7.fhir.r5.model.Group.GroupMemberComponent t : src.getMember()) + tgt.addMember(convertGroupMemberComponent(t)); + return tgt; + } + + 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; + case MEDICATION: + tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.MEDICATION); + break; + case SUBSTANCE: + tgt.setValue(org.hl7.fhir.r5.model.Group.GroupType.SUBSTANCE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.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; + case MEDICATION: + tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.MEDICATION); + break; + case SUBSTANCE: + tgt.setValue(org.hl7.fhir.r4b.model.Group.GroupType.SUBSTANCE); + 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 { + if (src == null) + return null; + org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasExclude()) + tgt.setExcludeElement(Boolean43_50.convertBoolean(src.getExcludeElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r4b.model.Group.GroupCharacteristicComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasExclude()) + tgt.setExcludeElement(Boolean43_50.convertBoolean(src.getExcludeElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.r4b.model.Group.GroupMemberComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r5.model.Group.GroupMemberComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasEntity()) + tgt.setEntity(Reference43_50.convertReference(src.getEntity())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasInactive()) + tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.r5.model.Group.GroupMemberComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r4b.model.Group.GroupMemberComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasEntity()) + tgt.setEntity(Reference43_50.convertReference(src.getEntity())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasInactive()) + tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); + 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/GuidanceResponse43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GuidanceResponse43_50.java new file mode 100644 index 000000000..e06749874 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/GuidanceResponse43_50.java @@ -0,0 +1,181 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.DataRequirement43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class GuidanceResponse43_50 { + + public static org.hl7.fhir.r5.model.GuidanceResponse convertGuidanceResponse(org.hl7.fhir.r4b.model.GuidanceResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.GuidanceResponse tgt = new org.hl7.fhir.r5.model.GuidanceResponse(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasRequestIdentifier()) + tgt.setRequestIdentifier(Identifier43_50.convertIdentifier(src.getRequestIdentifier())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasModule()) + tgt.setModule(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getModule())); + if (src.hasStatus()) + tgt.setStatusElement(convertGuidanceResponseStatus(src.getStatusElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrenceDateTime()) + tgt.setOccurrenceDateTimeElement(DateTime43_50.convertDateTime(src.getOccurrenceDateTimeElement())); + if (src.hasPerformer()) + tgt.setPerformer(Reference43_50.convertReference(src.getPerformer())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getEvaluationMessage()) + tgt.addEvaluationMessage(Reference43_50.convertReference(t)); + if (src.hasOutputParameters()) + tgt.setOutputParameters(Reference43_50.convertReference(src.getOutputParameters())); + if (src.hasResult()) + tgt.setResult(Reference43_50.convertReference(src.getResult())); + for (org.hl7.fhir.r4b.model.DataRequirement t : src.getDataRequirement()) + tgt.addDataRequirement(DataRequirement43_50.convertDataRequirement(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.GuidanceResponse convertGuidanceResponse(org.hl7.fhir.r5.model.GuidanceResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.GuidanceResponse tgt = new org.hl7.fhir.r4b.model.GuidanceResponse(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasRequestIdentifier()) + tgt.setRequestIdentifier(Identifier43_50.convertIdentifier(src.getRequestIdentifier())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasModule()) + tgt.setModule(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getModule())); + if (src.hasStatus()) + tgt.setStatusElement(convertGuidanceResponseStatus(src.getStatusElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrenceDateTime()) + tgt.setOccurrenceDateTimeElement(DateTime43_50.convertDateTime(src.getOccurrenceDateTimeElement())); + if (src.hasPerformer()) + tgt.setPerformer(Reference43_50.convertReference(src.getPerformer())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEvaluationMessage()) + tgt.addEvaluationMessage(Reference43_50.convertReference(t)); + if (src.hasOutputParameters()) + tgt.setOutputParameters(Reference43_50.convertReference(src.getOutputParameters())); + if (src.hasResult()) + tgt.setResult(Reference43_50.convertReference(src.getResult())); + for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement()) + tgt.addDataRequirement(DataRequirement43_50.convertDataRequirement(t)); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..e540035d3 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/HealthcareService43_50.java @@ -0,0 +1,302 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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.Time43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class HealthcareService43_50 { + + public static org.hl7.fhir.r5.model.HealthcareService convertHealthcareService(org.hl7.fhir.r4b.model.HealthcareService src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.HealthcareService tgt = new org.hl7.fhir.r5.model.HealthcareService(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasProvidedBy()) + tgt.setProvidedBy(Reference43_50.convertReference(src.getProvidedBy())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getLocation()) tgt.addLocation(Reference43_50.convertReference(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + if (src.hasExtraDetails()) + tgt.setExtraDetailsElement(MarkDown43_50.convertMarkdown(src.getExtraDetailsElement())); + if (src.hasPhoto()) + tgt.setPhoto(Attachment43_50.convertAttachment(src.getPhoto())); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getCoverageArea()) + tgt.addCoverageArea(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getServiceProvisionCode()) + tgt.addServiceProvisionCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceEligibilityComponent t : src.getEligibility()) + tgt.addEligibility(convertHealthcareServiceEligibilityComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgram()) + tgt.addProgram(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCharacteristic()) + tgt.addCharacteristic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCommunication()) + tgt.addCommunication(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReferralMethod()) + tgt.addReferralMethod(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasAppointmentRequired()) + tgt.setAppointmentRequiredElement(Boolean43_50.convertBoolean(src.getAppointmentRequiredElement())); + for (org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) + tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + for (org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) + tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(String43_50.convertString(src.getAvailabilityExceptionsElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.HealthcareService convertHealthcareService(org.hl7.fhir.r5.model.HealthcareService src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.HealthcareService tgt = new org.hl7.fhir.r4b.model.HealthcareService(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasProvidedBy()) + tgt.setProvidedBy(Reference43_50.convertReference(src.getProvidedBy())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(Reference43_50.convertReference(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + if (src.hasExtraDetails()) + tgt.setExtraDetailsElement(MarkDown43_50.convertMarkdown(src.getExtraDetailsElement())); + if (src.hasPhoto()) + tgt.setPhoto(Attachment43_50.convertAttachment(src.getPhoto())); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) + tgt.addCoverageArea(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceProvisionCode()) + tgt.addServiceProvisionCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent t : src.getEligibility()) + tgt.addEligibility(convertHealthcareServiceEligibilityComponent(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgram()) + tgt.addProgram(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCharacteristic()) + tgt.addCharacteristic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) + tgt.addCommunication(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReferralMethod()) + tgt.addReferralMethod(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasAppointmentRequired()) + tgt.setAppointmentRequiredElement(Boolean43_50.convertBoolean(src.getAppointmentRequiredElement())); + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime()) + tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t)); + for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable()) + tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t)); + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(String43_50.convertString(src.getAvailabilityExceptionsElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent convertHealthcareServiceEligibilityComponent(org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceEligibilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasComment()) + tgt.setCommentElement(MarkDown43_50.convertMarkdown(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceEligibilityComponent convertHealthcareServiceEligibilityComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceEligibilityComponent tgt = new org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceEligibilityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasComment()) + tgt.setCommentElement(MarkDown43_50.convertMarkdown(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent convertHealthcareServiceAvailableTimeComponent(org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceAvailableTimeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + tgt.setDaysOfWeek(src.getDaysOfWeek().stream() + .map(HealthcareService43_50::convertDaysOfWeek) + .collect(Collectors.toList())); + if (src.hasAllDay()) + tgt.setAllDayElement(Boolean43_50.convertBoolean(src.getAllDayElement())); + if (src.hasAvailableStartTime()) + tgt.setAvailableStartTimeElement(Time43_50.convertTime(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTime()) + tgt.setAvailableEndTimeElement(Time43_50.convertTime(src.getAvailableEndTimeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceAvailableTimeComponent convertHealthcareServiceAvailableTimeComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceAvailableTimeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + tgt.setDaysOfWeek(src.getDaysOfWeek().stream() + .map(HealthcareService43_50::convertDaysOfWeek) + .collect(Collectors.toList())); + if (src.hasAllDay()) + tgt.setAllDayElement(Boolean43_50.convertBoolean(src.getAllDayElement())); + if (src.hasAvailableStartTime()) + tgt.setAvailableStartTimeElement(Time43_50.convertTime(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTime()) + tgt.setAvailableEndTimeElement(Time43_50.convertTime(src.getAvailableEndTimeElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasDuring()) + tgt.setDuring(Period43_50.convertPeriod(src.getDuring())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r4b.model.HealthcareService.HealthcareServiceNotAvailableComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasDuring()) + tgt.setDuring(Period43_50.convertPeriod(src.getDuring())); + 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/ImagingStudy43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImagingStudy43_50.java new file mode 100644 index 000000000..c32b35170 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImagingStudy43_50.java @@ -0,0 +1,316 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Id43_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.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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ImagingStudy43_50 { + + public static org.hl7.fhir.r5.model.ImagingStudy convertImagingStudy(org.hl7.fhir.r4b.model.ImagingStudy src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImagingStudy tgt = new org.hl7.fhir.r5.model.ImagingStudy(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertImagingStudyStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.Coding t : src.getModality()) + tgt.addModality(new CodeableConcept().addCoding(Coding43_50.convertCoding(t))); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasStarted()) + tgt.setStartedElement(DateTime43_50.convertDateTime(src.getStartedElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasReferrer()) + tgt.setReferrer(Reference43_50.convertReference(src.getReferrer())); + for (org.hl7.fhir.r4b.model.Reference t : src.getInterpreter()) + tgt.addInterpreter(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + if (src.hasNumberOfSeries()) + tgt.setNumberOfSeriesElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberOfSeriesElement())); + if (src.hasNumberOfInstances()) + tgt.setNumberOfInstancesElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberOfInstancesElement())); + if (src.hasProcedureReference()) + tgt.addProcedure().setReference(Reference43_50.convertReference(src.getProcedureReference())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProcedureCode()) + tgt.addProcedure().setConcept(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) + tgt.addSeries(convertImagingStudySeriesComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImagingStudy convertImagingStudy(org.hl7.fhir.r5.model.ImagingStudy src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImagingStudy tgt = new org.hl7.fhir.r4b.model.ImagingStudy(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertImagingStudyStatus(src.getStatusElement())); + for (CodeableConcept t : src.getModality()) + for (Coding tt : t.getCoding()) + tgt.addModality(Coding43_50.convertCoding(tt)); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasStarted()) + tgt.setStartedElement(DateTime43_50.convertDateTime(src.getStartedElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasReferrer()) + tgt.setReferrer(Reference43_50.convertReference(src.getReferrer())); + for (org.hl7.fhir.r5.model.Reference t : src.getInterpreter()) + tgt.addInterpreter(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + if (src.hasNumberOfSeries()) + tgt.setNumberOfSeriesElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberOfSeriesElement())); + if (src.hasNumberOfInstances()) + tgt.setNumberOfInstancesElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberOfInstancesElement())); + for (CodeableReference t : src.getProcedure()) { + if (t.hasConcept()) + tgt.addProcedureCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + if (t.hasReference()) { + tgt.setProcedureReference(Reference43_50.convertReference(t.getReference())); + } + } + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries()) + tgt.addSeries(convertImagingStudySeriesComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUid()) + tgt.setUidElement(Id43_50.convertId(src.getUidElement())); + if (src.hasNumber()) + tgt.setNumberElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberElement())); + if (src.hasModality()) + tgt.setModality(new CodeableConcept().addCoding(Coding43_50.convertCoding(src.getModality()))); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasNumberOfInstances()) + tgt.setNumberOfInstancesElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberOfInstancesElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + if (src.hasBodySite()) + tgt.setBodySite(new CodeableReference(new CodeableConcept(Coding43_50.convertCoding(src.getBodySite())))); + if (src.hasLaterality()) + tgt.setLaterality(new CodeableConcept(Coding43_50.convertCoding(src.getLaterality()))); + for (org.hl7.fhir.r4b.model.Reference t : src.getSpecimen()) tgt.addSpecimen(Reference43_50.convertReference(t)); + if (src.hasStarted()) + tgt.setStartedElement(DateTime43_50.convertDateTime(src.getStartedElement())); + for (org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesPerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertImagingStudySeriesPerformerComponent(t)); + for (org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) + tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUid()) + tgt.setUidElement(Id43_50.convertId(src.getUidElement())); + if (src.hasNumber()) + tgt.setNumberElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberElement())); + if (src.hasModality()) + tgt.setModality(Coding43_50.convertCoding(src.getModality().getCodingFirstRep())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasNumberOfInstances()) + tgt.setNumberOfInstancesElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberOfInstancesElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + if (src.getBodySite().getConcept().hasCoding()) + tgt.setBodySite(Coding43_50.convertCoding(src.getBodySite().getConcept().getCodingFirstRep())); + if (src.getLaterality().hasCoding()) + tgt.setLaterality(Coding43_50.convertCoding(src.getLaterality().getCodingFirstRep())); + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(Reference43_50.convertReference(t)); + if (src.hasStarted()) + tgt.setStartedElement(DateTime43_50.convertDateTime(src.getStartedElement())); + for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertImagingStudySeriesPerformerComponent(t)); + for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance()) + tgt.addInstance(convertImagingStudySeriesInstanceComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent convertImagingStudySeriesPerformerComponent(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesPerformerComponent convertImagingStudySeriesPerformerComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesPerformerComponent tgt = new org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesPerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent convertImagingStudySeriesInstanceComponent(org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUid()) + tgt.setUidElement(Id43_50.convertId(src.getUidElement())); + if (src.hasSopClass()) + tgt.setSopClass(Coding43_50.convertCoding(src.getSopClass())); + if (src.hasNumber()) + tgt.setNumberElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesInstanceComponent convertImagingStudySeriesInstanceComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r4b.model.ImagingStudy.ImagingStudySeriesInstanceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUid()) + tgt.setUidElement(Id43_50.convertId(src.getUidElement())); + if (src.hasSopClass()) + tgt.setSopClass(Coding43_50.convertCoding(src.getSopClass())); + if (src.hasNumber()) + tgt.setNumberElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + 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/Immunization43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Immunization43_50.java new file mode 100644 index 000000000..9b6bc03a2 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Immunization43_50.java @@ -0,0 +1,335 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Immunization43_50 { + + public static org.hl7.fhir.r5.model.Immunization convertImmunization(org.hl7.fhir.r4b.model.Immunization src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization tgt = new org.hl7.fhir.r5.model.Immunization(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertImmunizationStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasVaccineCode()) + tgt.setVaccineCode(CodeableConcept43_50.convertCodeableConcept(src.getVaccineCode())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); +// if (src.hasRecorded()) +// tgt.setRecordedElement(DateTime43_50.convertDateTime(src.getRecordedElement())); + if (src.hasPrimarySource()) + tgt.setPrimarySourceElement(Boolean43_50.convertBoolean(src.getPrimarySourceElement())); + if (src.hasReportOrigin()) + tgt.setInformationSource(new CodeableReference(CodeableConcept43_50.convertCodeableConcept(src.getReportOrigin()))); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + if (src.hasManufacturer()) + tgt.setManufacturer(Reference43_50.convertReference(src.getManufacturer())); + if (src.hasLotNumber()) + tgt.setLotNumberElement(String43_50.convertString(src.getLotNumberElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(Date43_50.convertDate(src.getExpirationDateElement())); + if (src.hasSite()) + tgt.setSite(CodeableConcept43_50.convertCodeableConcept(src.getSite())); + if (src.hasRoute()) + tgt.setRoute(CodeableConcept43_50.convertCodeableConcept(src.getRoute())); + if (src.hasDoseQuantity()) + tgt.setDoseQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getDoseQuantity())); + for (org.hl7.fhir.r4b.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertImmunizationPerformerComponent(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + if (src.hasIsSubpotent()) + tgt.setIsSubpotentElement(Boolean43_50.convertBoolean(src.getIsSubpotentElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubpotentReason()) + tgt.addSubpotentReason(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Immunization.ImmunizationEducationComponent t : src.getEducation()) + tgt.addEducation(convertImmunizationEducationComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramEligibility()) + tgt.addProgramEligibility(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasFundingSource()) + tgt.setFundingSource(CodeableConcept43_50.convertCodeableConcept(src.getFundingSource())); + for (org.hl7.fhir.r4b.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) + tgt.addReaction(convertImmunizationReactionComponent(t)); + for (org.hl7.fhir.r4b.model.Immunization.ImmunizationProtocolAppliedComponent t : src.getProtocolApplied()) + tgt.addProtocolApplied(convertImmunizationProtocolAppliedComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Immunization convertImmunization(org.hl7.fhir.r5.model.Immunization src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Immunization tgt = new org.hl7.fhir.r4b.model.Immunization(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertImmunizationStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasVaccineCode()) + tgt.setVaccineCode(CodeableConcept43_50.convertCodeableConcept(src.getVaccineCode())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); +// if (src.hasRecorded()) +// tgt.setRecordedElement(DateTime43_50.convertDateTime(src.getRecordedElement())); + if (src.hasPrimarySource()) + tgt.setPrimarySourceElement(Boolean43_50.convertBoolean(src.getPrimarySourceElement())); + if (src.getInformationSource().hasConcept()) + tgt.setReportOrigin(CodeableConcept43_50.convertCodeableConcept(src.getInformationSource().getConcept())); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + if (src.hasManufacturer()) + tgt.setManufacturer(Reference43_50.convertReference(src.getManufacturer())); + if (src.hasLotNumber()) + tgt.setLotNumberElement(String43_50.convertString(src.getLotNumberElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(Date43_50.convertDate(src.getExpirationDateElement())); + if (src.hasSite()) + tgt.setSite(CodeableConcept43_50.convertCodeableConcept(src.getSite())); + if (src.hasRoute()) + tgt.setRoute(CodeableConcept43_50.convertCodeableConcept(src.getRoute())); + if (src.hasDoseQuantity()) + tgt.setDoseQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getDoseQuantity())); + for (org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertImmunizationPerformerComponent(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + if (src.hasIsSubpotent()) + tgt.setIsSubpotentElement(Boolean43_50.convertBoolean(src.getIsSubpotentElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubpotentReason()) + tgt.addSubpotentReason(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent t : src.getEducation()) + tgt.addEducation(convertImmunizationEducationComponent(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramEligibility()) + tgt.addProgramEligibility(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasFundingSource()) + tgt.setFundingSource(CodeableConcept43_50.convertCodeableConcept(src.getFundingSource())); + for (org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) + tgt.addReaction(convertImmunizationReactionComponent(t)); + for (org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent t : src.getProtocolApplied()) + tgt.addProtocolApplied(convertImmunizationProtocolAppliedComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r4b.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Immunization.ImmunizationPerformerComponent tgt = new org.hl7.fhir.r4b.model.Immunization.ImmunizationPerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent convertImmunizationEducationComponent(org.hl7.fhir.r4b.model.Immunization.ImmunizationEducationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDocumentType()) + tgt.setDocumentTypeElement(String43_50.convertString(src.getDocumentTypeElement())); + if (src.hasReference()) + tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement())); + if (src.hasPublicationDate()) + tgt.setPublicationDateElement(DateTime43_50.convertDateTime(src.getPublicationDateElement())); + if (src.hasPresentationDate()) + tgt.setPresentationDateElement(DateTime43_50.convertDateTime(src.getPresentationDateElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Immunization.ImmunizationEducationComponent convertImmunizationEducationComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Immunization.ImmunizationEducationComponent tgt = new org.hl7.fhir.r4b.model.Immunization.ImmunizationEducationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDocumentType()) + tgt.setDocumentTypeElement(String43_50.convertString(src.getDocumentTypeElement())); + if (src.hasReference()) + tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement())); + if (src.hasPublicationDate()) + tgt.setPublicationDateElement(DateTime43_50.convertDateTime(src.getPublicationDateElement())); + if (src.hasPresentationDate()) + tgt.setPresentationDateElement(DateTime43_50.convertDateTime(src.getPresentationDateElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent convertImmunizationReactionComponent(org.hl7.fhir.r4b.model.Immunization.ImmunizationReactionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasDetail()) + tgt.setManifestation(new CodeableReference(Reference43_50.convertReference(src.getDetail()))); + if (src.hasReported()) + tgt.setReportedElement(Boolean43_50.convertBoolean(src.getReportedElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Immunization.ImmunizationReactionComponent convertImmunizationReactionComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.r4b.model.Immunization.ImmunizationReactionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasManifestation()) + tgt.setDetail(Reference43_50.convertReference(src.getManifestation().getReference())); + if (src.hasReported()) + tgt.setReportedElement(Boolean43_50.convertBoolean(src.getReportedElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent convertImmunizationProtocolAppliedComponent(org.hl7.fhir.r4b.model.Immunization.ImmunizationProtocolAppliedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSeries()) + tgt.setSeriesElement(String43_50.convertString(src.getSeriesElement())); + if (src.hasAuthority()) + tgt.setAuthority(Reference43_50.convertReference(src.getAuthority())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getTargetDisease()) + tgt.addTargetDisease(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDoseNumber()) + tgt.setDoseNumber(src.getDoseNumber().primitiveValue()); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(src.getSeriesDoses().primitiveValue()); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Immunization.ImmunizationProtocolAppliedComponent convertImmunizationProtocolAppliedComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Immunization.ImmunizationProtocolAppliedComponent tgt = new org.hl7.fhir.r4b.model.Immunization.ImmunizationProtocolAppliedComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSeries()) + tgt.setSeriesElement(String43_50.convertString(src.getSeriesElement())); + if (src.hasAuthority()) + tgt.setAuthority(Reference43_50.convertReference(src.getAuthority())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTargetDisease()) + tgt.addTargetDisease(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDoseNumber()) + tgt.setDoseNumber(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDoseNumberElement())); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSeriesDosesElement())); + 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/ImmunizationEvaluation43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationEvaluation43_50.java new file mode 100644 index 000000000..db420b84b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationEvaluation43_50.java @@ -0,0 +1,147 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ImmunizationEvaluation43_50 { + + public static org.hl7.fhir.r5.model.ImmunizationEvaluation convertImmunizationEvaluation(org.hl7.fhir.r4b.model.ImmunizationEvaluation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImmunizationEvaluation tgt = new org.hl7.fhir.r5.model.ImmunizationEvaluation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertImmunizationEvaluationStatus(src.getStatusElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasAuthority()) + tgt.setAuthority(Reference43_50.convertReference(src.getAuthority())); + if (src.hasTargetDisease()) + tgt.setTargetDisease(CodeableConcept43_50.convertCodeableConcept(src.getTargetDisease())); + if (src.hasImmunizationEvent()) + tgt.setImmunizationEvent(Reference43_50.convertReference(src.getImmunizationEvent())); + if (src.hasDoseStatus()) + tgt.setDoseStatus(CodeableConcept43_50.convertCodeableConcept(src.getDoseStatus())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getDoseStatusReason()) + tgt.addDoseStatusReason(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasSeries()) + tgt.setSeriesElement(String43_50.convertString(src.getSeriesElement())); + if (src.hasDoseNumber()) + tgt.setDoseNumber(src.getDoseNumber().primitiveValue()); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(src.getSeriesDoses().primitiveValue()); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImmunizationEvaluation convertImmunizationEvaluation(org.hl7.fhir.r5.model.ImmunizationEvaluation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImmunizationEvaluation tgt = new org.hl7.fhir.r4b.model.ImmunizationEvaluation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertImmunizationEvaluationStatus(src.getStatusElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasAuthority()) + tgt.setAuthority(Reference43_50.convertReference(src.getAuthority())); + if (src.hasTargetDisease()) + tgt.setTargetDisease(CodeableConcept43_50.convertCodeableConcept(src.getTargetDisease())); + if (src.hasImmunizationEvent()) + tgt.setImmunizationEvent(Reference43_50.convertReference(src.getImmunizationEvent())); + if (src.hasDoseStatus()) + tgt.setDoseStatus(CodeableConcept43_50.convertCodeableConcept(src.getDoseStatus())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDoseStatusReason()) + tgt.addDoseStatusReason(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasSeries()) + tgt.setSeriesElement(String43_50.convertString(src.getSeriesElement())); + if (src.hasDoseNumber()) + tgt.setDoseNumber(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDoseNumberElement())); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSeriesDosesElement())); + return tgt; + } + + 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; + } + + 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; + } +} \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationRecommendation43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationRecommendation43_50.java new file mode 100644 index 000000000..5958eaf20 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImmunizationRecommendation43_50.java @@ -0,0 +1,165 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ImmunizationRecommendation43_50 { + + public static org.hl7.fhir.r5.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.r4b.model.ImmunizationRecommendation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImmunizationRecommendation tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasAuthority()) + tgt.setAuthority(Reference43_50.convertReference(src.getAuthority())); + for (org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) + tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.r5.model.ImmunizationRecommendation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImmunizationRecommendation tgt = new org.hl7.fhir.r4b.model.ImmunizationRecommendation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasAuthority()) + tgt.setAuthority(Reference43_50.convertReference(src.getAuthority())); + for (org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation()) + tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent convertImmunizationRecommendationRecommendationComponent(org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getVaccineCode()) + tgt.addVaccineCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasTargetDisease()) + tgt.addTargetDisease(CodeableConcept43_50.convertCodeableConcept(src.getTargetDisease())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getContraindicatedVaccineCode()) + tgt.addContraindicatedVaccineCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasForecastStatus()) + tgt.setForecastStatus(CodeableConcept43_50.convertCodeableConcept(src.getForecastStatus())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getForecastReason()) + tgt.addForecastReason(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) + tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasSeries()) + tgt.setSeriesElement(String43_50.convertString(src.getSeriesElement())); + if (src.hasDoseNumber()) + tgt.setDoseNumber(src.getDoseNumber().primitiveValue()); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(src.getSeriesDoses().primitiveValue()); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingImmunization()) + tgt.addSupportingImmunization(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingPatientInformation()) + tgt.addSupportingPatientInformation(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent convertImmunizationRecommendationRecommendationComponent(org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getVaccineCode()) + tgt.addVaccineCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasTargetDisease()) + tgt.setTargetDisease(CodeableConcept43_50.convertCodeableConcept(src.getTargetDiseaseFirstRep())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getContraindicatedVaccineCode()) + tgt.addContraindicatedVaccineCode(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasForecastStatus()) + tgt.setForecastStatus(CodeableConcept43_50.convertCodeableConcept(src.getForecastStatus())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getForecastReason()) + tgt.addForecastReason(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion()) + tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasSeries()) + tgt.setSeriesElement(String43_50.convertString(src.getSeriesElement())); + if (src.hasDoseNumber()) + tgt.setDoseNumber(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDoseNumberElement())); + if (src.hasSeriesDoses()) + tgt.setSeriesDoses(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSeriesDosesElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingImmunization()) + tgt.addSupportingImmunization(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingPatientInformation()) + tgt.addSupportingPatientInformation(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent convertImmunizationRecommendationRecommendationDateCriterionComponent(org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValueElement(DateTime43_50.convertDateTime(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent convertImmunizationRecommendationRecommendationDateCriterionComponent(org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.r4b.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValueElement(DateTime43_50.convertDateTime(src.getValueElement())); + 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 new file mode 100644 index 000000000..b82f098dc --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ImplementationGuide43_50.java @@ -0,0 +1,2694 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.Utilities; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ImplementationGuide43_50 { + + static final String EXT_IG_DEFINITION_PARAMETER = "http://hl7.org/fhir/tools/StructureDefinition/ig-parameter"; + + public static org.hl7.fhir.r5.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.r4b.model.ImplementationGuide src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide tgt = new org.hl7.fhir.r5.model.ImplementationGuide(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasPackageId()) + tgt.setPackageIdElement(Id43_50.convertId(src.getPackageIdElement())); + if (src.hasLicense()) + tgt.setLicenseElement(convertSPDXLicense(src.getLicenseElement())); + tgt.setFhirVersion(src.getFhirVersion().stream() + .map(Enumerations43_50::convertFHIRVersion) + .collect(Collectors.toList())); + for (org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDependsOnComponent t : src.getDependsOn()) + tgt.addDependsOn(convertImplementationGuideDependsOnComponent(t)); + for (org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) + tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + if (src.hasDefinition()) + tgt.setDefinition(convertImplementationGuideDefinitionComponent(src.getDefinition())); + if (src.hasManifest()) + tgt.setManifest(convertImplementationGuideManifestComponent(src.getManifest())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.r5.model.ImplementationGuide src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide tgt = new org.hl7.fhir.r4b.model.ImplementationGuide(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasPackageId()) + tgt.setPackageIdElement(Id43_50.convertId(src.getPackageIdElement())); + if (src.hasLicense()) + tgt.setLicenseElement(convertSPDXLicense(src.getLicenseElement())); + tgt.setFhirVersion(src.getFhirVersion().stream() + .map(Enumerations43_50::convertFHIRVersion) + .collect(Collectors.toList())); + 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()) + tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); + if (src.hasDefinition()) + tgt.setDefinition(convertImplementationGuideDefinitionComponent(src.getDefinition())); + if (src.hasManifest()) + tgt.setManifest(convertImplementationGuideManifestComponent(src.getManifest())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertSPDXLicense(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.SPDXLicenseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case NOTOPENSOURCE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOTOPENSOURCE); + break; + case _0BSD: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense._0BSD); + break; + case AAL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AAL); + break; + case ABSTYLES: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ABSTYLES); + break; + case ADOBE2006: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ADOBE2006); + break; + case ADOBEGLYPH: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ADOBEGLYPH); + break; + case ADSL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ADSL); + break; + case AFL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL1_1); + break; + case AFL1_2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL1_2); + break; + case AFL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL2_0); + break; + case AFL2_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL2_1); + break; + case AFL3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFL3_0); + break; + case AFMPARSE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AFMPARSE); + break; + case AGPL1_0ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL1_0ONLY); + break; + case AGPL1_0ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL1_0ORLATER); + break; + case AGPL3_0ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL3_0ONLY); + break; + case AGPL3_0ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AGPL3_0ORLATER); + break; + case ALADDIN: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ALADDIN); + break; + case AMDPLPA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AMDPLPA); + break; + case AML: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AML); + break; + case AMPAS: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.AMPAS); + break; + case ANTLRPD: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ANTLRPD); + break; + case APACHE1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APACHE1_0); + break; + case APACHE1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APACHE1_1); + break; + case APACHE2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APACHE2_0); + break; + case APAFML: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APAFML); + break; + case APL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APL1_0); + break; + case APSL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL1_0); + break; + case APSL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL1_1); + break; + case APSL1_2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL1_2); + break; + case APSL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.APSL2_0); + break; + case ARTISTIC1_0CL8: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0CL8); + break; + case ARTISTIC1_0PERL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0PERL); + break; + case ARTISTIC1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0); + break; + case ARTISTIC2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ARTISTIC2_0); + break; + case BAHYPH: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BAHYPH); + break; + case BARR: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BARR); + break; + case BEERWARE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BEERWARE); + break; + case BITTORRENT1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BITTORRENT1_0); + break; + case BITTORRENT1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BITTORRENT1_1); + break; + case BORCEUX: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BORCEUX); + break; + case BSD1CLAUSE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD1CLAUSE); + break; + case BSD2CLAUSEFREEBSD: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEFREEBSD); + break; + case BSD2CLAUSENETBSD: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSENETBSD); + break; + case BSD2CLAUSEPATENT: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEPATENT); + break; + case BSD2CLAUSE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD2CLAUSE); + break; + case BSD3CLAUSEATTRIBUTION: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSEATTRIBUTION); + break; + case BSD3CLAUSECLEAR: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSECLEAR); + break; + case BSD3CLAUSELBNL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSELBNL); + break; + case BSD3CLAUSENONUCLEARLICENSE2014: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE2014); + break; + case BSD3CLAUSENONUCLEARLICENSE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE); + break; + case BSD3CLAUSENONUCLEARWARRANTY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARWARRANTY); + break; + case BSD3CLAUSE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD3CLAUSE); + break; + case BSD4CLAUSEUC: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD4CLAUSEUC); + break; + case BSD4CLAUSE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSD4CLAUSE); + break; + case BSDPROTECTION: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSDPROTECTION); + break; + case BSDSOURCECODE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSDSOURCECODE); + break; + case BSL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BSL1_0); + break; + case BZIP21_0_5: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BZIP21_0_5); + break; + case BZIP21_0_6: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.BZIP21_0_6); + break; + case CALDERA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CALDERA); + break; + case CATOSL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CATOSL1_1); + break; + case CCBY1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY1_0); + break; + case CCBY2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY2_0); + break; + case CCBY2_5: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY2_5); + break; + case CCBY3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY3_0); + break; + case CCBY4_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBY4_0); + break; + case CCBYNC1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC1_0); + break; + case CCBYNC2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC2_0); + break; + case CCBYNC2_5: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC2_5); + break; + case CCBYNC3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC3_0); + break; + case CCBYNC4_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNC4_0); + break; + case CCBYNCND1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND1_0); + break; + case CCBYNCND2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND2_0); + break; + case CCBYNCND2_5: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND2_5); + break; + case CCBYNCND3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND3_0); + break; + case CCBYNCND4_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCND4_0); + break; + case CCBYNCSA1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA1_0); + break; + case CCBYNCSA2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_0); + break; + case CCBYNCSA2_5: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_5); + break; + case CCBYNCSA3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA3_0); + break; + case CCBYNCSA4_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYNCSA4_0); + break; + case CCBYND1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND1_0); + break; + case CCBYND2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND2_0); + break; + case CCBYND2_5: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND2_5); + break; + case CCBYND3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND3_0); + break; + case CCBYND4_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYND4_0); + break; + case CCBYSA1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA1_0); + break; + case CCBYSA2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA2_0); + break; + case CCBYSA2_5: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA2_5); + break; + case CCBYSA3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA3_0); + break; + case CCBYSA4_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CCBYSA4_0); + break; + case CC01_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CC01_0); + break; + case CDDL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDDL1_0); + break; + case CDDL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDDL1_1); + break; + case CDLAPERMISSIVE1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDLAPERMISSIVE1_0); + break; + case CDLASHARING1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CDLASHARING1_0); + break; + case CECILL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL1_0); + break; + case CECILL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL1_1); + break; + case CECILL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL2_0); + break; + case CECILL2_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILL2_1); + break; + case CECILLB: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILLB); + break; + case CECILLC: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CECILLC); + break; + case CLARTISTIC: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CLARTISTIC); + break; + case CNRIJYTHON: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CNRIJYTHON); + break; + case CNRIPYTHONGPLCOMPATIBLE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CNRIPYTHONGPLCOMPATIBLE); + break; + case CNRIPYTHON: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CNRIPYTHON); + break; + case CONDOR1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CONDOR1_1); + break; + case CPAL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CPAL1_0); + break; + case CPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CPL1_0); + break; + case CPOL1_02: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CPOL1_02); + break; + case CROSSWORD: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CROSSWORD); + break; + case CRYSTALSTACKER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CRYSTALSTACKER); + break; + case CUAOPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CUAOPL1_0); + break; + case CUBE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CUBE); + break; + case CURL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.CURL); + break; + case DFSL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DFSL1_0); + break; + case DIFFMARK: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DIFFMARK); + break; + case DOC: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DOC); + break; + case DOTSEQN: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DOTSEQN); + break; + case DSDP: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DSDP); + break; + case DVIPDFM: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.DVIPDFM); + break; + case ECL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ECL1_0); + break; + case ECL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ECL2_0); + break; + case EFL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EFL1_0); + break; + case EFL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EFL2_0); + break; + case EGENIX: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EGENIX); + break; + case ENTESSA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ENTESSA); + break; + case EPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EPL1_0); + break; + case EPL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EPL2_0); + break; + case ERLPL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ERLPL1_1); + break; + case EUDATAGRID: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUDATAGRID); + break; + case EUPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUPL1_0); + break; + case EUPL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUPL1_1); + break; + case EUPL1_2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUPL1_2); + break; + case EUROSYM: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.EUROSYM); + break; + case FAIR: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FAIR); + break; + case FRAMEWORX1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FRAMEWORX1_0); + break; + case FREEIMAGE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FREEIMAGE); + break; + case FSFAP: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FSFAP); + break; + case FSFUL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FSFUL); + break; + case FSFULLR: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FSFULLR); + break; + case FTL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.FTL); + break; + case GFDL1_1ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_1ONLY); + break; + case GFDL1_1ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_1ORLATER); + break; + case GFDL1_2ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_2ONLY); + break; + case GFDL1_2ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_2ORLATER); + break; + case GFDL1_3ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_3ONLY); + break; + case GFDL1_3ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GFDL1_3ORLATER); + break; + case GIFTWARE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GIFTWARE); + break; + case GL2PS: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GL2PS); + break; + case GLIDE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GLIDE); + break; + case GLULXE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GLULXE); + break; + case GNUPLOT: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GNUPLOT); + break; + case GPL1_0ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL1_0ONLY); + break; + case GPL1_0ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL1_0ORLATER); + break; + case GPL2_0ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL2_0ONLY); + break; + case GPL2_0ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL2_0ORLATER); + break; + case GPL3_0ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL3_0ONLY); + break; + case GPL3_0ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GPL3_0ORLATER); + break; + case GSOAP1_3B: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.GSOAP1_3B); + break; + case HASKELLREPORT: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.HASKELLREPORT); + break; + case HPND: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.HPND); + break; + case IBMPIBS: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IBMPIBS); + break; + case ICU: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ICU); + break; + case IJG: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IJG); + break; + case IMAGEMAGICK: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IMAGEMAGICK); + break; + case IMATIX: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IMATIX); + break; + case IMLIB2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IMLIB2); + break; + case INFOZIP: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INFOZIP); + break; + case INTELACPI: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INTELACPI); + break; + case INTEL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INTEL); + break; + case INTERBASE1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.INTERBASE1_0); + break; + case IPA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IPA); + break; + case IPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.IPL1_0); + break; + case ISC: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ISC); + break; + case JASPER2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.JASPER2_0); + break; + case JSON: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.JSON); + break; + case LAL1_2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LAL1_2); + break; + case LAL1_3: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LAL1_3); + break; + case LATEX2E: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LATEX2E); + break; + case LEPTONICA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LEPTONICA); + break; + case LGPL2_0ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_0ONLY); + break; + case LGPL2_0ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_0ORLATER); + break; + case LGPL2_1ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_1ONLY); + break; + case LGPL2_1ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL2_1ORLATER); + break; + case LGPL3_0ONLY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL3_0ONLY); + break; + case LGPL3_0ORLATER: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPL3_0ORLATER); + break; + case LGPLLR: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LGPLLR); + break; + case LIBPNG: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LIBPNG); + break; + case LIBTIFF: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LIBTIFF); + break; + case LILIQP1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LILIQP1_1); + break; + case LILIQR1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LILIQR1_1); + break; + case LILIQRPLUS1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LILIQRPLUS1_1); + break; + case LINUXOPENIB: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LINUXOPENIB); + break; + case LPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPL1_0); + break; + case LPL1_02: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPL1_02); + break; + case LPPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_0); + break; + case LPPL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_1); + break; + case LPPL1_2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_2); + break; + case LPPL1_3A: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_3A); + break; + case LPPL1_3C: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.LPPL1_3C); + break; + case MAKEINDEX: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MAKEINDEX); + break; + case MIROS: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MIROS); + break; + case MIT0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MIT0); + break; + case MITADVERTISING: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITADVERTISING); + break; + case MITCMU: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITCMU); + break; + case MITENNA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITENNA); + break; + case MITFEH: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITFEH); + break; + case MIT: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MIT); + break; + case MITNFA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MITNFA); + break; + case MOTOSOTO: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MOTOSOTO); + break; + case MPICH2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPICH2); + break; + case MPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL1_0); + break; + case MPL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL1_1); + break; + case MPL2_0NOCOPYLEFTEXCEPTION: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL2_0NOCOPYLEFTEXCEPTION); + break; + case MPL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MPL2_0); + break; + case MSPL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MSPL); + break; + case MSRL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MSRL); + break; + case MTLL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MTLL); + break; + case MULTICS: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MULTICS); + break; + case MUP: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.MUP); + break; + case NASA1_3: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NASA1_3); + break; + case NAUMEN: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NAUMEN); + break; + case NBPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NBPL1_0); + break; + case NCSA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NCSA); + break; + case NETSNMP: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NETSNMP); + break; + case NETCDF: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NETCDF); + break; + case NEWSLETR: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NEWSLETR); + break; + case NGPL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NGPL); + break; + case NLOD1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NLOD1_0); + break; + case NLPL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NLPL); + break; + case NOKIA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOKIA); + break; + case NOSL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOSL); + break; + case NOWEB: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NOWEB); + break; + case NPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NPL1_0); + break; + case NPL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NPL1_1); + break; + case NPOSL3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NPOSL3_0); + break; + case NRL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NRL); + break; + case NTP: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NTP); + break; + case OCCTPL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OCCTPL); + break; + case OCLC2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OCLC2_0); + break; + case ODBL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ODBL1_0); + break; + case OFL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OFL1_0); + break; + case OFL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OFL1_1); + break; + case OGTSL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OGTSL); + break; + case OLDAP1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_1); + break; + case OLDAP1_2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_2); + break; + case OLDAP1_3: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_3); + break; + case OLDAP1_4: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP1_4); + break; + case OLDAP2_0_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_0_1); + break; + case OLDAP2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_0); + break; + case OLDAP2_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_1); + break; + case OLDAP2_2_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_2_1); + break; + case OLDAP2_2_2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_2_2); + break; + case OLDAP2_2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_2); + break; + case OLDAP2_3: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_3); + break; + case OLDAP2_4: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_4); + break; + case OLDAP2_5: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_5); + break; + case OLDAP2_6: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_6); + break; + case OLDAP2_7: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_7); + break; + case OLDAP2_8: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OLDAP2_8); + break; + case OML: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OML); + break; + case OPENSSL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OPENSSL); + break; + case OPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OPL1_0); + break; + case OSETPL2_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSETPL2_1); + break; + case OSL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL1_0); + break; + case OSL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL1_1); + break; + case OSL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL2_0); + break; + case OSL2_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL2_1); + break; + case OSL3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.OSL3_0); + break; + case PDDL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PDDL1_0); + break; + case PHP3_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PHP3_0); + break; + case PHP3_01: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PHP3_01); + break; + case PLEXUS: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PLEXUS); + break; + case POSTGRESQL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.POSTGRESQL); + break; + case PSFRAG: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PSFRAG); + break; + case PSUTILS: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PSUTILS); + break; + case PYTHON2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.PYTHON2_0); + break; + case QHULL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.QHULL); + break; + case QPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.QPL1_0); + break; + case RDISC: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RDISC); + break; + case RHECOS1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RHECOS1_1); + break; + case RPL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RPL1_1); + break; + case RPL1_5: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RPL1_5); + break; + case RPSL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RPSL1_0); + break; + case RSAMD: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RSAMD); + break; + case RSCPL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RSCPL); + break; + case RUBY: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.RUBY); + break; + case SAXPD: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SAXPD); + break; + case SAXPATH: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SAXPATH); + break; + case SCEA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SCEA); + break; + case SENDMAIL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SENDMAIL); + break; + case SGIB1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SGIB1_0); + break; + case SGIB1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SGIB1_1); + break; + case SGIB2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SGIB2_0); + break; + case SIMPL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SIMPL2_0); + break; + case SISSL1_2: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SISSL1_2); + break; + case SISSL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SISSL); + break; + case SLEEPYCAT: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SLEEPYCAT); + break; + case SMLNJ: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SMLNJ); + break; + case SMPPL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SMPPL); + break; + case SNIA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SNIA); + break; + case SPENCER86: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPENCER86); + break; + case SPENCER94: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPENCER94); + break; + case SPENCER99: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPENCER99); + break; + case SPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SPL1_0); + break; + case SUGARCRM1_1_3: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SUGARCRM1_1_3); + break; + case SWL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.SWL); + break; + case TCL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TCL); + break; + case TCPWRAPPERS: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TCPWRAPPERS); + break; + case TMATE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TMATE); + break; + case TORQUE1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TORQUE1_1); + break; + case TOSL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.TOSL); + break; + case UNICODEDFS2015: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNICODEDFS2015); + break; + case UNICODEDFS2016: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNICODEDFS2016); + break; + case UNICODETOU: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNICODETOU); + break; + case UNLICENSE: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UNLICENSE); + break; + case UPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.UPL1_0); + break; + case VIM: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.VIM); + break; + case VOSTROM: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.VOSTROM); + break; + case VSL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.VSL1_0); + break; + case W3C19980720: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.W3C19980720); + break; + case W3C20150513: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.W3C20150513); + break; + case W3C: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.W3C); + break; + case WATCOM1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.WATCOM1_0); + break; + case WSUIPA: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.WSUIPA); + break; + case WTFPL: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.WTFPL); + break; + case X11: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.X11); + break; + case XEROX: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XEROX); + break; + case XFREE861_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XFREE861_1); + break; + case XINETD: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XINETD); + break; + case XNET: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XNET); + break; + case XPP: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XPP); + break; + case XSKAT: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.XSKAT); + break; + case YPL1_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.YPL1_0); + break; + case YPL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.YPL1_1); + break; + case ZED: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZED); + break; + case ZEND2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZEND2_0); + break; + case ZIMBRA1_3: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZIMBRA1_3); + break; + case ZIMBRA1_4: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZIMBRA1_4); + break; + case ZLIBACKNOWLEDGEMENT: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZLIBACKNOWLEDGEMENT); + break; + case ZLIB: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZLIB); + break; + case ZPL1_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZPL1_1); + break; + case ZPL2_0: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZPL2_0); + break; + case ZPL2_1: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.ZPL2_1); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.ImplementationGuide.SPDXLicense.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertSPDXLicense(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.SPDXLicenseEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case NOTOPENSOURCE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NOTOPENSOURCE); + break; + case _0BSD: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense._0BSD); + break; + case AAL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AAL); + break; + case ABSTYLES: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ABSTYLES); + break; + case ADOBE2006: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ADOBE2006); + break; + case ADOBEGLYPH: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ADOBEGLYPH); + break; + case ADSL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ADSL); + break; + case AFL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AFL1_1); + break; + case AFL1_2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AFL1_2); + break; + case AFL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AFL2_0); + break; + case AFL2_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AFL2_1); + break; + case AFL3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AFL3_0); + break; + case AFMPARSE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AFMPARSE); + break; + case AGPL1_0ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AGPL1_0ONLY); + break; + case AGPL1_0ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AGPL1_0ORLATER); + break; + case AGPL3_0ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AGPL3_0ONLY); + break; + case AGPL3_0ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AGPL3_0ORLATER); + break; + case ALADDIN: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ALADDIN); + break; + case AMDPLPA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AMDPLPA); + break; + case AML: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AML); + break; + case AMPAS: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.AMPAS); + break; + case ANTLRPD: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ANTLRPD); + break; + case APACHE1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.APACHE1_0); + break; + case APACHE1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.APACHE1_1); + break; + case APACHE2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.APACHE2_0); + break; + case APAFML: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.APAFML); + break; + case APL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.APL1_0); + break; + case APSL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.APSL1_0); + break; + case APSL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.APSL1_1); + break; + case APSL1_2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.APSL1_2); + break; + case APSL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.APSL2_0); + break; + case ARTISTIC1_0CL8: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0CL8); + break; + case ARTISTIC1_0PERL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0PERL); + break; + case ARTISTIC1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ARTISTIC1_0); + break; + case ARTISTIC2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ARTISTIC2_0); + break; + case BAHYPH: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BAHYPH); + break; + case BARR: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BARR); + break; + case BEERWARE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BEERWARE); + break; + case BITTORRENT1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BITTORRENT1_0); + break; + case BITTORRENT1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BITTORRENT1_1); + break; + case BORCEUX: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BORCEUX); + break; + case BSD1CLAUSE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD1CLAUSE); + break; + case BSD2CLAUSEFREEBSD: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEFREEBSD); + break; + case BSD2CLAUSENETBSD: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD2CLAUSENETBSD); + break; + case BSD2CLAUSEPATENT: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD2CLAUSEPATENT); + break; + case BSD2CLAUSE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD2CLAUSE); + break; + case BSD3CLAUSEATTRIBUTION: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD3CLAUSEATTRIBUTION); + break; + case BSD3CLAUSECLEAR: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD3CLAUSECLEAR); + break; + case BSD3CLAUSELBNL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD3CLAUSELBNL); + break; + case BSD3CLAUSENONUCLEARLICENSE2014: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE2014); + break; + case BSD3CLAUSENONUCLEARLICENSE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARLICENSE); + break; + case BSD3CLAUSENONUCLEARWARRANTY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD3CLAUSENONUCLEARWARRANTY); + break; + case BSD3CLAUSE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD3CLAUSE); + break; + case BSD4CLAUSEUC: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD4CLAUSEUC); + break; + case BSD4CLAUSE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSD4CLAUSE); + break; + case BSDPROTECTION: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSDPROTECTION); + break; + case BSDSOURCECODE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSDSOURCECODE); + break; + case BSL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BSL1_0); + break; + case BZIP21_0_5: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BZIP21_0_5); + break; + case BZIP21_0_6: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.BZIP21_0_6); + break; + case CALDERA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CALDERA); + break; + case CATOSL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CATOSL1_1); + break; + case CCBY1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBY1_0); + break; + case CCBY2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBY2_0); + break; + case CCBY2_5: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBY2_5); + break; + case CCBY3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBY3_0); + break; + case CCBY4_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBY4_0); + break; + case CCBYNC1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNC1_0); + break; + case CCBYNC2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNC2_0); + break; + case CCBYNC2_5: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNC2_5); + break; + case CCBYNC3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNC3_0); + break; + case CCBYNC4_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNC4_0); + break; + case CCBYNCND1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCND1_0); + break; + case CCBYNCND2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCND2_0); + break; + case CCBYNCND2_5: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCND2_5); + break; + case CCBYNCND3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCND3_0); + break; + case CCBYNCND4_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCND4_0); + break; + case CCBYNCSA1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCSA1_0); + break; + case CCBYNCSA2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_0); + break; + case CCBYNCSA2_5: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCSA2_5); + break; + case CCBYNCSA3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCSA3_0); + break; + case CCBYNCSA4_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYNCSA4_0); + break; + case CCBYND1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYND1_0); + break; + case CCBYND2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYND2_0); + break; + case CCBYND2_5: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYND2_5); + break; + case CCBYND3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYND3_0); + break; + case CCBYND4_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYND4_0); + break; + case CCBYSA1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYSA1_0); + break; + case CCBYSA2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYSA2_0); + break; + case CCBYSA2_5: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYSA2_5); + break; + case CCBYSA3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYSA3_0); + break; + case CCBYSA4_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CCBYSA4_0); + break; + case CC01_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CC01_0); + break; + case CDDL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CDDL1_0); + break; + case CDDL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CDDL1_1); + break; + case CDLAPERMISSIVE1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CDLAPERMISSIVE1_0); + break; + case CDLASHARING1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CDLASHARING1_0); + break; + case CECILL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CECILL1_0); + break; + case CECILL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CECILL1_1); + break; + case CECILL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CECILL2_0); + break; + case CECILL2_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CECILL2_1); + break; + case CECILLB: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CECILLB); + break; + case CECILLC: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CECILLC); + break; + case CLARTISTIC: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CLARTISTIC); + break; + case CNRIJYTHON: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CNRIJYTHON); + break; + case CNRIPYTHONGPLCOMPATIBLE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CNRIPYTHONGPLCOMPATIBLE); + break; + case CNRIPYTHON: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CNRIPYTHON); + break; + case CONDOR1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CONDOR1_1); + break; + case CPAL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CPAL1_0); + break; + case CPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CPL1_0); + break; + case CPOL1_02: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CPOL1_02); + break; + case CROSSWORD: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CROSSWORD); + break; + case CRYSTALSTACKER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CRYSTALSTACKER); + break; + case CUAOPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CUAOPL1_0); + break; + case CUBE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CUBE); + break; + case CURL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.CURL); + break; + case DFSL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.DFSL1_0); + break; + case DIFFMARK: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.DIFFMARK); + break; + case DOC: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.DOC); + break; + case DOTSEQN: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.DOTSEQN); + break; + case DSDP: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.DSDP); + break; + case DVIPDFM: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.DVIPDFM); + break; + case ECL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ECL1_0); + break; + case ECL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ECL2_0); + break; + case EFL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EFL1_0); + break; + case EFL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EFL2_0); + break; + case EGENIX: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EGENIX); + break; + case ENTESSA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ENTESSA); + break; + case EPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EPL1_0); + break; + case EPL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EPL2_0); + break; + case ERLPL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ERLPL1_1); + break; + case EUDATAGRID: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EUDATAGRID); + break; + case EUPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EUPL1_0); + break; + case EUPL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EUPL1_1); + break; + case EUPL1_2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EUPL1_2); + break; + case EUROSYM: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.EUROSYM); + break; + case FAIR: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.FAIR); + break; + case FRAMEWORX1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.FRAMEWORX1_0); + break; + case FREEIMAGE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.FREEIMAGE); + break; + case FSFAP: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.FSFAP); + break; + case FSFUL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.FSFUL); + break; + case FSFULLR: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.FSFULLR); + break; + case FTL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.FTL); + break; + case GFDL1_1ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GFDL1_1ONLY); + break; + case GFDL1_1ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GFDL1_1ORLATER); + break; + case GFDL1_2ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GFDL1_2ONLY); + break; + case GFDL1_2ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GFDL1_2ORLATER); + break; + case GFDL1_3ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GFDL1_3ONLY); + break; + case GFDL1_3ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GFDL1_3ORLATER); + break; + case GIFTWARE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GIFTWARE); + break; + case GL2PS: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GL2PS); + break; + case GLIDE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GLIDE); + break; + case GLULXE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GLULXE); + break; + case GNUPLOT: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GNUPLOT); + break; + case GPL1_0ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GPL1_0ONLY); + break; + case GPL1_0ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GPL1_0ORLATER); + break; + case GPL2_0ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GPL2_0ONLY); + break; + case GPL2_0ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GPL2_0ORLATER); + break; + case GPL3_0ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GPL3_0ONLY); + break; + case GPL3_0ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GPL3_0ORLATER); + break; + case GSOAP1_3B: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.GSOAP1_3B); + break; + case HASKELLREPORT: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.HASKELLREPORT); + break; + case HPND: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.HPND); + break; + case IBMPIBS: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.IBMPIBS); + break; + case ICU: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ICU); + break; + case IJG: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.IJG); + break; + case IMAGEMAGICK: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.IMAGEMAGICK); + break; + case IMATIX: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.IMATIX); + break; + case IMLIB2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.IMLIB2); + break; + case INFOZIP: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.INFOZIP); + break; + case INTELACPI: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.INTELACPI); + break; + case INTEL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.INTEL); + break; + case INTERBASE1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.INTERBASE1_0); + break; + case IPA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.IPA); + break; + case IPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.IPL1_0); + break; + case ISC: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ISC); + break; + case JASPER2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.JASPER2_0); + break; + case JSON: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.JSON); + break; + case LAL1_2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LAL1_2); + break; + case LAL1_3: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LAL1_3); + break; + case LATEX2E: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LATEX2E); + break; + case LEPTONICA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LEPTONICA); + break; + case LGPL2_0ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LGPL2_0ONLY); + break; + case LGPL2_0ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LGPL2_0ORLATER); + break; + case LGPL2_1ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LGPL2_1ONLY); + break; + case LGPL2_1ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LGPL2_1ORLATER); + break; + case LGPL3_0ONLY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LGPL3_0ONLY); + break; + case LGPL3_0ORLATER: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LGPL3_0ORLATER); + break; + case LGPLLR: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LGPLLR); + break; + case LIBPNG: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LIBPNG); + break; + case LIBTIFF: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LIBTIFF); + break; + case LILIQP1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LILIQP1_1); + break; + case LILIQR1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LILIQR1_1); + break; + case LILIQRPLUS1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LILIQRPLUS1_1); + break; + case LINUXOPENIB: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LINUXOPENIB); + break; + case LPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LPL1_0); + break; + case LPL1_02: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LPL1_02); + break; + case LPPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LPPL1_0); + break; + case LPPL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LPPL1_1); + break; + case LPPL1_2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LPPL1_2); + break; + case LPPL1_3A: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LPPL1_3A); + break; + case LPPL1_3C: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.LPPL1_3C); + break; + case MAKEINDEX: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MAKEINDEX); + break; + case MIROS: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MIROS); + break; + case MIT0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MIT0); + break; + case MITADVERTISING: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MITADVERTISING); + break; + case MITCMU: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MITCMU); + break; + case MITENNA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MITENNA); + break; + case MITFEH: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MITFEH); + break; + case MIT: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MIT); + break; + case MITNFA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MITNFA); + break; + case MOTOSOTO: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MOTOSOTO); + break; + case MPICH2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MPICH2); + break; + case MPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MPL1_0); + break; + case MPL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MPL1_1); + break; + case MPL2_0NOCOPYLEFTEXCEPTION: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MPL2_0NOCOPYLEFTEXCEPTION); + break; + case MPL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MPL2_0); + break; + case MSPL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MSPL); + break; + case MSRL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MSRL); + break; + case MTLL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MTLL); + break; + case MULTICS: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MULTICS); + break; + case MUP: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.MUP); + break; + case NASA1_3: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NASA1_3); + break; + case NAUMEN: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NAUMEN); + break; + case NBPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NBPL1_0); + break; + case NCSA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NCSA); + break; + case NETSNMP: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NETSNMP); + break; + case NETCDF: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NETCDF); + break; + case NEWSLETR: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NEWSLETR); + break; + case NGPL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NGPL); + break; + case NLOD1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NLOD1_0); + break; + case NLPL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NLPL); + break; + case NOKIA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NOKIA); + break; + case NOSL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NOSL); + break; + case NOWEB: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NOWEB); + break; + case NPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NPL1_0); + break; + case NPL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NPL1_1); + break; + case NPOSL3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NPOSL3_0); + break; + case NRL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NRL); + break; + case NTP: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NTP); + break; + case OCCTPL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OCCTPL); + break; + case OCLC2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OCLC2_0); + break; + case ODBL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ODBL1_0); + break; + case OFL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OFL1_0); + break; + case OFL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OFL1_1); + break; + case OGTSL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OGTSL); + break; + case OLDAP1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP1_1); + break; + case OLDAP1_2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP1_2); + break; + case OLDAP1_3: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP1_3); + break; + case OLDAP1_4: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP1_4); + break; + case OLDAP2_0_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_0_1); + break; + case OLDAP2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_0); + break; + case OLDAP2_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_1); + break; + case OLDAP2_2_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_2_1); + break; + case OLDAP2_2_2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_2_2); + break; + case OLDAP2_2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_2); + break; + case OLDAP2_3: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_3); + break; + case OLDAP2_4: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_4); + break; + case OLDAP2_5: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_5); + break; + case OLDAP2_6: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_6); + break; + case OLDAP2_7: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_7); + break; + case OLDAP2_8: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OLDAP2_8); + break; + case OML: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OML); + break; + case OPENSSL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OPENSSL); + break; + case OPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OPL1_0); + break; + case OSETPL2_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OSETPL2_1); + break; + case OSL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OSL1_0); + break; + case OSL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OSL1_1); + break; + case OSL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OSL2_0); + break; + case OSL2_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OSL2_1); + break; + case OSL3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.OSL3_0); + break; + case PDDL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.PDDL1_0); + break; + case PHP3_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.PHP3_0); + break; + case PHP3_01: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.PHP3_01); + break; + case PLEXUS: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.PLEXUS); + break; + case POSTGRESQL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.POSTGRESQL); + break; + case PSFRAG: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.PSFRAG); + break; + case PSUTILS: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.PSUTILS); + break; + case PYTHON2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.PYTHON2_0); + break; + case QHULL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.QHULL); + break; + case QPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.QPL1_0); + break; + case RDISC: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.RDISC); + break; + case RHECOS1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.RHECOS1_1); + break; + case RPL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.RPL1_1); + break; + case RPL1_5: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.RPL1_5); + break; + case RPSL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.RPSL1_0); + break; + case RSAMD: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.RSAMD); + break; + case RSCPL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.RSCPL); + break; + case RUBY: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.RUBY); + break; + case SAXPD: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SAXPD); + break; + case SAXPATH: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SAXPATH); + break; + case SCEA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SCEA); + break; + case SENDMAIL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SENDMAIL); + break; + case SGIB1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SGIB1_0); + break; + case SGIB1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SGIB1_1); + break; + case SGIB2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SGIB2_0); + break; + case SIMPL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SIMPL2_0); + break; + case SISSL1_2: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SISSL1_2); + break; + case SISSL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SISSL); + break; + case SLEEPYCAT: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SLEEPYCAT); + break; + case SMLNJ: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SMLNJ); + break; + case SMPPL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SMPPL); + break; + case SNIA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SNIA); + break; + case SPENCER86: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SPENCER86); + break; + case SPENCER94: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SPENCER94); + break; + case SPENCER99: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SPENCER99); + break; + case SPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SPL1_0); + break; + case SUGARCRM1_1_3: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SUGARCRM1_1_3); + break; + case SWL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.SWL); + break; + case TCL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.TCL); + break; + case TCPWRAPPERS: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.TCPWRAPPERS); + break; + case TMATE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.TMATE); + break; + case TORQUE1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.TORQUE1_1); + break; + case TOSL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.TOSL); + break; + case UNICODEDFS2015: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.UNICODEDFS2015); + break; + case UNICODEDFS2016: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.UNICODEDFS2016); + break; + case UNICODETOU: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.UNICODETOU); + break; + case UNLICENSE: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.UNLICENSE); + break; + case UPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.UPL1_0); + break; + case VIM: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.VIM); + break; + case VOSTROM: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.VOSTROM); + break; + case VSL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.VSL1_0); + break; + case W3C19980720: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.W3C19980720); + break; + case W3C20150513: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.W3C20150513); + break; + case W3C: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.W3C); + break; + case WATCOM1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.WATCOM1_0); + break; + case WSUIPA: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.WSUIPA); + break; + case WTFPL: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.WTFPL); + break; + case X11: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.X11); + break; + case XEROX: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.XEROX); + break; + case XFREE861_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.XFREE861_1); + break; + case XINETD: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.XINETD); + break; + case XNET: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.XNET); + break; + case XPP: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.XPP); + break; + case XSKAT: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.XSKAT); + break; + case YPL1_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.YPL1_0); + break; + case YPL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.YPL1_1); + break; + case ZED: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ZED); + break; + case ZEND2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ZEND2_0); + break; + case ZIMBRA1_3: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ZIMBRA1_3); + break; + case ZIMBRA1_4: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ZIMBRA1_4); + break; + case ZLIBACKNOWLEDGEMENT: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ZLIBACKNOWLEDGEMENT); + break; + case ZLIB: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ZLIB); + break; + case ZPL1_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ZPL1_1); + break; + case ZPL2_0: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ZPL2_0); + break; + case ZPL2_1: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.ZPL2_1); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.ImplementationGuide.SPDXLicense.NULL); + break; + } + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent convertImplementationGuideDependsOnComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDependsOnComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUri()) + tgt.setUriElement(Canonical43_50.convertCanonical(src.getUriElement())); + if (src.hasPackageId()) + tgt.setPackageIdElement(Id43_50.convertId(src.getPackageIdElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDependsOnComponent convertImplementationGuideDependsOnComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDependsOnComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDependsOnComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDependsOnComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUri()) + tgt.setUriElement(Canonical43_50.convertCanonical(src.getUriElement())); + if (src.hasPackageId()) + tgt.setPackageIdElement(Id43_50.convertId(src.getPackageIdElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(Code43_50.convertResourceEnum(src.getTypeElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideGlobalComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(Code43_50.convertResourceEnum(src.getTypeElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent convertImplementationGuideDefinitionComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getGrouping()) + tgt.addGrouping(convertImplementationGuideDefinitionGroupingComponent(t)); + for (org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getResource()) + tgt.addResource(convertImplementationGuideDefinitionResourceComponent(t)); + if (src.hasPage()) + tgt.setPage(convertImplementationGuideDefinitionPageComponent(src.getPage())); + for (org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent t : src.getParameter()) + tgt.addParameter(convertImplementationGuideDefinitionParameterComponent(t)); + for (org.hl7.fhir.r4b.model.Extension e : org.hl7.fhir.r4b.utils.ToolingExtensions.getExtensions(src, EXT_IG_DEFINITION_PARAMETER)) { + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent p = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); + p.setCode(org.hl7.fhir.r4b.utils.ToolingExtensions.readStringExtension(e, "code")); + p.setValue(org.hl7.fhir.r4b.utils.ToolingExtensions.readStringExtension(e, "Value")); + tgt.addParameter(p); + } + for (org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent t : src.getTemplate()) + tgt.addTemplate(convertImplementationGuideDefinitionTemplateComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionComponent convertImplementationGuideDefinitionComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent t : src.getGrouping()) + tgt.addGrouping(convertImplementationGuideDefinitionGroupingComponent(t)); + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent t : src.getResource()) + tgt.addResource(convertImplementationGuideDefinitionResourceComponent(t)); + if (src.hasPage()) + tgt.setPage(convertImplementationGuideDefinitionPageComponent(src.getPage())); + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent t : src.getParameter()) { + if (Utilities.existsInList(t.getCode(), "apply", "path-resource", "path-pages", "path-tx-cache", "expansion-parameter", "rule-broken-links", "generate-xml", "generate-json", "generate-turtle", "html-template")) + tgt.addParameter(convertImplementationGuideDefinitionParameterComponent(t)); + else { + org.hl7.fhir.r4b.model.Extension e = new org.hl7.fhir.r4b.model.Extension(EXT_IG_DEFINITION_PARAMETER); + org.hl7.fhir.r4b.model.Extension eCode = new org.hl7.fhir.r4b.model.Extension("code", new org.hl7.fhir.r4b.model.StringType(t.getCode())); + org.hl7.fhir.r4b.model.Extension eValue = new org.hl7.fhir.r4b.model.Extension("value", new org.hl7.fhir.r4b.model.StringType(t.getValue())); + e.addExtension(eCode); + e.addExtension(eValue); + tgt.addExtension(e); + } + } + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent t : src.getTemplate()) + tgt.addTemplate(convertImplementationGuideDefinitionTemplateComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent convertImplementationGuideDefinitionGroupingComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertStringToMarkdown(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent convertImplementationGuideDefinitionGroupingComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionGroupingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent convertImplementationGuideDefinitionResourceComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + tgt.setFhirVersion(src.getFhirVersion().stream() + .map(Enumerations43_50::convertFHIRVersion) + .collect(Collectors.toList())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertStringToMarkdown(src.getDescriptionElement())); + if (src.hasExample()) + tgt.setExample(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getExample())); + if (src.hasGroupingId()) + tgt.setGroupingIdElement(Id43_50.convertId(src.getGroupingIdElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent convertImplementationGuideDefinitionResourceComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionResourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + tgt.setFhirVersion(src.getFhirVersion().stream() + .map(Enumerations43_50::convertFHIRVersion) + .collect(Collectors.toList())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasExample()) + tgt.setExample(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getExample())); + if (src.hasGroupingId()) + tgt.setGroupingIdElement(Id43_50.convertId(src.getGroupingIdElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent convertImplementationGuideDefinitionPageComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setName(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getName())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasGeneration()) + tgt.setGenerationElement(convertGuidePageGeneration(src.getGenerationElement())); + for (org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) + tgt.addPage(convertImplementationGuideDefinitionPageComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent convertImplementationGuideDefinitionPageComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setName(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getName())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasGeneration()) + tgt.setGenerationElement(convertGuidePageGeneration(src.getGenerationElement())); + for (org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage()) + tgt.addPage(convertImplementationGuideDefinitionPageComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent convertImplementationGuideDefinitionParameterComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.getCodeElement().setValueAsString(src.getCode().toCode()); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent convertImplementationGuideDefinitionParameterComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.getCodeElement().setValueAsString(src.getCode()); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.utils.GuideParameterCode convertGuideParameterCode(org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode src) throws FHIRException { + if (src == null) + return null; + switch (src) { + case APPLY: + return org.hl7.fhir.r5.utils.GuideParameterCode.APPLY; + case PATHRESOURCE: + return org.hl7.fhir.r5.utils.GuideParameterCode.PATHRESOURCE; + case PATHPAGES: + return org.hl7.fhir.r5.utils.GuideParameterCode.PATHPAGES; + case PATHTXCACHE: + return org.hl7.fhir.r5.utils.GuideParameterCode.PATHTXCACHE; + case EXPANSIONPARAMETER: + return org.hl7.fhir.r5.utils.GuideParameterCode.EXPANSIONPARAMETER; + case RULEBROKENLINKS: + return org.hl7.fhir.r5.utils.GuideParameterCode.RULEBROKENLINKS; + case GENERATEXML: + return org.hl7.fhir.r5.utils.GuideParameterCode.GENERATEXML; + case GENERATEJSON: + return org.hl7.fhir.r5.utils.GuideParameterCode.GENERATEJSON; + case GENERATETURTLE: + return org.hl7.fhir.r5.utils.GuideParameterCode.GENERATETURTLE; + case HTMLTEMPLATE: + return org.hl7.fhir.r5.utils.GuideParameterCode.HTMLTEMPLATE; + default: + return org.hl7.fhir.r5.utils.GuideParameterCode.NULL; + } + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode convertGuideParameterCode(org.hl7.fhir.r5.utils.GuideParameterCode src) throws FHIRException { + if (src == null) + return null; + switch (src) { + case APPLY: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.APPLY; + case PATHRESOURCE: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.PATHRESOURCE; + case PATHPAGES: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.PATHPAGES; + case PATHTXCACHE: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.PATHTXCACHE; + case EXPANSIONPARAMETER: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.EXPANSIONPARAMETER; + case RULEBROKENLINKS: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.RULEBROKENLINKS; + case GENERATEXML: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.GENERATEXML; + case GENERATEJSON: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.GENERATEJSON; + case GENERATETURTLE: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.GENERATETURTLE; + case HTMLTEMPLATE: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.HTMLTEMPLATE; + default: + return org.hl7.fhir.r4b.model.ImplementationGuide.GuideParameterCode.NULL; + } + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent convertImplementationGuideDefinitionTemplateComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasSource()) + tgt.setSourceElement(String43_50.convertString(src.getSourceElement())); + if (src.hasScope()) + tgt.setScopeElement(String43_50.convertString(src.getScopeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent convertImplementationGuideDefinitionTemplateComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideDefinitionTemplateComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasSource()) + tgt.setSourceElement(String43_50.convertString(src.getSourceElement())); + if (src.hasScope()) + tgt.setScopeElement(String43_50.convertString(src.getScopeElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent convertImplementationGuideManifestComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideManifestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRendering()) + tgt.setRenderingElement(Url43_50.convertUrl(src.getRenderingElement())); + for (org.hl7.fhir.r4b.model.ImplementationGuide.ManifestResourceComponent t : src.getResource()) + tgt.addResource(convertManifestResourceComponent(t)); + for (org.hl7.fhir.r4b.model.ImplementationGuide.ManifestPageComponent t : src.getPage()) + tgt.addPage(convertManifestPageComponent(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getImage()) tgt.getImage().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getOther()) tgt.getOther().add(String43_50.convertString(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideManifestComponent convertImplementationGuideManifestComponent(org.hl7.fhir.r5.model.ImplementationGuide.ImplementationGuideManifestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideManifestComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ImplementationGuideManifestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRendering()) + tgt.setRenderingElement(Url43_50.convertUrl(src.getRenderingElement())); + for (org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent t : src.getResource()) + tgt.addResource(convertManifestResourceComponent(t)); + for (org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent t : src.getPage()) + tgt.addPage(convertManifestPageComponent(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getImage()) tgt.getImage().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getOther()) tgt.getOther().add(String43_50.convertString(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent convertManifestResourceComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ManifestResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + if (src.hasExample()) + tgt.setExample(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getExample())); + if (src.hasRelativePath()) + tgt.setRelativePathElement(Url43_50.convertUrl(src.getRelativePathElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ManifestResourceComponent convertManifestResourceComponent(org.hl7.fhir.r5.model.ImplementationGuide.ManifestResourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ManifestResourceComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ManifestResourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasReference()) + tgt.setReference(Reference43_50.convertReference(src.getReference())); + if (src.hasExample()) + tgt.setExample(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getExample())); + if (src.hasRelativePath()) + tgt.setRelativePathElement(Url43_50.convertUrl(src.getRelativePathElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent convertManifestPageComponent(org.hl7.fhir.r4b.model.ImplementationGuide.ManifestPageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent tgt = new org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getAnchor()) tgt.getAnchor().add(String43_50.convertString(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ImplementationGuide.ManifestPageComponent convertManifestPageComponent(org.hl7.fhir.r5.model.ImplementationGuide.ManifestPageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ImplementationGuide.ManifestPageComponent tgt = new org.hl7.fhir.r4b.model.ImplementationGuide.ManifestPageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getAnchor()) tgt.getAnchor().add(String43_50.convertString(t)); + 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/InsurancePlan43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/InsurancePlan43_50.java new file mode 100644 index 000000000..a08fd0a23 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/InsurancePlan43_50.java @@ -0,0 +1,367 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.ExtendedContactDetail; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class InsurancePlan43_50 { + + public static org.hl7.fhir.r5.model.InsurancePlan convertInsurancePlan(org.hl7.fhir.r4b.model.InsurancePlan src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan tgt = new org.hl7.fhir.r5.model.InsurancePlan(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasOwnedBy()) + tgt.setOwnedBy(Reference43_50.convertReference(src.getOwnedBy())); + if (src.hasAdministeredBy()) + tgt.setAdministeredBy(Reference43_50.convertReference(src.getAdministeredBy())); + for (org.hl7.fhir.r4b.model.Reference t : src.getCoverageArea()) + tgt.addCoverageArea(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanContactComponent t : src.getContact()) + tgt.addContact(convertInsurancePlanContactComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getNetwork()) tgt.addNetwork(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanCoverageComponent t : src.getCoverage()) + tgt.addCoverage(convertInsurancePlanCoverageComponent(t)); + for (org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanComponent t : src.getPlan()) + tgt.addPlan(convertInsurancePlanPlanComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan convertInsurancePlan(org.hl7.fhir.r5.model.InsurancePlan src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan tgt = new org.hl7.fhir.r4b.model.InsurancePlan(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasOwnedBy()) + tgt.setOwnedBy(Reference43_50.convertReference(src.getOwnedBy())); + if (src.hasAdministeredBy()) + tgt.setAdministeredBy(Reference43_50.convertReference(src.getAdministeredBy())); + for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) + tgt.addCoverageArea(Reference43_50.convertReference(t)); + for (ExtendedContactDetail t : src.getContact()) + tgt.addContact(convertInsurancePlanContactComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) tgt.addNetwork(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent t : src.getCoverage()) + tgt.addCoverage(convertInsurancePlanCoverageComponent(t)); + for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent t : src.getPlan()) + tgt.addPlan(convertInsurancePlanPlanComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExtendedContactDetail convertInsurancePlanContactComponent(org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExtendedContactDetail tgt = new org.hl7.fhir.r5.model.ExtendedContactDetail(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPurpose()) + tgt.setPurpose(CodeableConcept43_50.convertCodeableConcept(src.getPurpose())); + if (src.hasName()) + tgt.setName(HumanName43_50.convertHumanName(src.getName())); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasAddress()) + tgt.setAddress(Address43_50.convertAddress(src.getAddress())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanContactComponent convertInsurancePlanContactComponent(org.hl7.fhir.r5.model.ExtendedContactDetail src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanContactComponent tgt = new org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanContactComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPurpose()) + tgt.setPurpose(CodeableConcept43_50.convertCodeableConcept(src.getPurpose())); + if (src.hasName()) + tgt.setName(HumanName43_50.convertHumanName(src.getName())); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasAddress()) + tgt.setAddress(Address43_50.convertAddress(src.getAddress())); + return tgt; + } + + public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent convertInsurancePlanCoverageComponent(org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanCoverageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.Reference t : src.getNetwork()) tgt.addNetwork(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitComponent t : src.getBenefit()) + tgt.addBenefit(convertCoverageBenefitComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanCoverageComponent convertInsurancePlanCoverageComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanCoverageComponent tgt = new org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanCoverageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) tgt.addNetwork(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent t : src.getBenefit()) + tgt.addBenefit(convertCoverageBenefitComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent convertCoverageBenefitComponent(org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasRequirement()) + tgt.setRequirementElement(String43_50.convertString(src.getRequirementElement())); + for (org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitLimitComponent t : src.getLimit()) + tgt.addLimit(convertCoverageBenefitLimitComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitComponent convertCoverageBenefitComponent(org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitComponent tgt = new org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasRequirement()) + tgt.setRequirementElement(String43_50.convertString(src.getRequirementElement())); + for (org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent t : src.getLimit()) + tgt.addLimit(convertCoverageBenefitLimitComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent convertCoverageBenefitLimitComponent(org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitLimitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(Quantity43_50.convertQuantity(src.getValue())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitLimitComponent convertCoverageBenefitLimitComponent(org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitLimitComponent tgt = new org.hl7.fhir.r4b.model.InsurancePlan.CoverageBenefitLimitComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(Quantity43_50.convertQuantity(src.getValue())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + return tgt; + } + + public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent convertInsurancePlanPlanComponent(org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.Reference t : src.getCoverageArea()) + tgt.addCoverageArea(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getNetwork()) tgt.addNetwork(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent t : src.getGeneralCost()) + tgt.addGeneralCost(convertInsurancePlanPlanGeneralCostComponent(t)); + for (org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent t : src.getSpecificCost()) + tgt.addSpecificCost(convertInsurancePlanPlanSpecificCostComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanComponent convertInsurancePlanPlanComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanComponent tgt = new org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea()) + tgt.addCoverageArea(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) tgt.addNetwork(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent t : src.getGeneralCost()) + tgt.addGeneralCost(convertInsurancePlanPlanGeneralCostComponent(t)); + for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent t : src.getSpecificCost()) + tgt.addSpecificCost(convertInsurancePlanPlanSpecificCostComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent convertInsurancePlanPlanGeneralCostComponent(org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasGroupSize()) + tgt.setGroupSizeElement(PositiveInt43_50.convertPositiveInt(src.getGroupSizeElement())); + if (src.hasCost()) + tgt.setCost(Money43_50.convertMoney(src.getCost())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent convertInsurancePlanPlanGeneralCostComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent tgt = new org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasGroupSize()) + tgt.setGroupSizeElement(PositiveInt43_50.convertPositiveInt(src.getGroupSizeElement())); + if (src.hasCost()) + tgt.setCost(Money43_50.convertMoney(src.getCost())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent convertInsurancePlanPlanSpecificCostComponent(org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + for (org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitComponent t : src.getBenefit()) + tgt.addBenefit(convertPlanBenefitComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent convertInsurancePlanPlanSpecificCostComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent tgt = new org.hl7.fhir.r4b.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + for (org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent t : src.getBenefit()) + tgt.addBenefit(convertPlanBenefitComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent convertPlanBenefitComponent(org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitCostComponent t : src.getCost()) + tgt.addCost(convertPlanBenefitCostComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitComponent convertPlanBenefitComponent(org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitComponent tgt = new org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent t : src.getCost()) + tgt.addCost(convertPlanBenefitCostComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent convertPlanBenefitCostComponent(org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasApplicability()) + tgt.setApplicability(CodeableConcept43_50.convertCodeableConcept(src.getApplicability())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getQualifiers()) + tgt.addQualifiers(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasValue()) + tgt.setValue(Quantity43_50.convertQuantity(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitCostComponent convertPlanBenefitCostComponent(org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitCostComponent tgt = new org.hl7.fhir.r4b.model.InsurancePlan.PlanBenefitCostComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasApplicability()) + tgt.setApplicability(CodeableConcept43_50.convertCodeableConcept(src.getApplicability())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getQualifiers()) + tgt.addQualifiers(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasValue()) + tgt.setValue(Quantity43_50.convertQuantity(src.getValue())); + 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/Invoice43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Invoice43_50.java new file mode 100644 index 000000000..7e695eb25 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Invoice43_50.java @@ -0,0 +1,322 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Money43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Invoice43_50 { + + public static org.hl7.fhir.r5.model.Invoice convertInvoice(org.hl7.fhir.r4b.model.Invoice src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Invoice tgt = new org.hl7.fhir.r5.model.Invoice(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertInvoiceStatus(src.getStatusElement())); + if (src.hasCancelledReason()) + tgt.setCancelledReasonElement(String43_50.convertString(src.getCancelledReasonElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasRecipient()) + tgt.setRecipient(Reference43_50.convertReference(src.getRecipient())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + for (org.hl7.fhir.r4b.model.Invoice.InvoiceParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertInvoiceParticipantComponent(t)); + if (src.hasIssuer()) + tgt.setIssuer(Reference43_50.convertReference(src.getIssuer())); + if (src.hasAccount()) + tgt.setAccount(Reference43_50.convertReference(src.getAccount())); + for (org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemComponent t : src.getLineItem()) + tgt.addLineItem(convertInvoiceLineItemComponent(t)); + for (org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getTotalPriceComponent()) + tgt.addTotalPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); + if (src.hasTotalNet()) + tgt.setTotalNet(Money43_50.convertMoney(src.getTotalNet())); + if (src.hasTotalGross()) + tgt.setTotalGross(Money43_50.convertMoney(src.getTotalGross())); + if (src.hasPaymentTerms()) + tgt.setPaymentTermsElement(MarkDown43_50.convertMarkdown(src.getPaymentTermsElement())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Invoice convertInvoice(org.hl7.fhir.r5.model.Invoice src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Invoice tgt = new org.hl7.fhir.r4b.model.Invoice(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertInvoiceStatus(src.getStatusElement())); + if (src.hasCancelledReason()) + tgt.setCancelledReasonElement(String43_50.convertString(src.getCancelledReasonElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasRecipient()) + tgt.setRecipient(Reference43_50.convertReference(src.getRecipient())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + for (org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertInvoiceParticipantComponent(t)); + if (src.hasIssuer()) + tgt.setIssuer(Reference43_50.convertReference(src.getIssuer())); + if (src.hasAccount()) + tgt.setAccount(Reference43_50.convertReference(src.getAccount())); + for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent t : src.getLineItem()) + tgt.addLineItem(convertInvoiceLineItemComponent(t)); + for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getTotalPriceComponent()) + tgt.addTotalPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); + if (src.hasTotalNet()) + tgt.setTotalNet(Money43_50.convertMoney(src.getTotalNet())); + if (src.hasTotalGross()) + tgt.setTotalGross(Money43_50.convertMoney(src.getTotalGross())); + if (src.hasPaymentTerms()) + tgt.setPaymentTermsElement(MarkDown43_50.convertMarkdown(src.getPaymentTermsElement())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r4b.model.Invoice.InvoiceParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Invoice.InvoiceParticipantComponent tgt = new org.hl7.fhir.r4b.model.Invoice.InvoiceParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent convertInvoiceLineItemComponent(org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasChargeItem()) + tgt.setChargeItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getChargeItem())); + for (org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getPriceComponent()) + tgt.addPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemComponent convertInvoiceLineItemComponent(org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemComponent tgt = new org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSequence()) + tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement())); + if (src.hasChargeItem()) + tgt.setChargeItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getChargeItem())); + for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getPriceComponent()) + tgt.addPriceComponent(convertInvoiceLineItemPriceComponentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent convertInvoiceLineItemPriceComponentComponent(org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemPriceComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertInvoicePriceComponentType(src.getTypeElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemPriceComponentComponent convertInvoiceLineItemPriceComponentComponent(org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemPriceComponentComponent tgt = new org.hl7.fhir.r4b.model.Invoice.InvoiceLineItemPriceComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertInvoicePriceComponentType(src.getTypeElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasFactor()) + tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + return tgt; + } + + static public org.hl7.fhir.r5.model.Enumeration convertInvoicePriceComponentType(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.InvoicePriceComponentTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case BASE: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.BASE); + break; + case SURCHARGE: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.SURCHARGE); + break; + case DEDUCTION: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DEDUCTION); + break; + case DISCOUNT: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DISCOUNT); + break; + case TAX: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.TAX); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.NULL); + break; + } + return tgt; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertInvoicePriceComponentType(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.InvoicePriceComponentTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case BASE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.BASE); + break; + case SURCHARGE: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.SURCHARGE); + break; + case DEDUCTION: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.DEDUCTION); + break; + case DISCOUNT: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.DISCOUNT); + break; + case TAX: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.TAX); + break; + case INFORMATIONAL: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.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/Library43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Library43_50.java new file mode 100644 index 000000000..4c22e3039 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Library43_50.java @@ -0,0 +1,180 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Attachment43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Library43_50 { + + public static org.hl7.fhir.r5.model.Library convertLibrary(org.hl7.fhir.r4b.model.Library src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Library tgt = new org.hl7.fhir.r5.model.Library(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r4b.model.ParameterDefinition t : src.getParameter()) + tgt.addParameter(ParameterDefinition43_50.convertParameterDefinition(t)); + for (org.hl7.fhir.r4b.model.DataRequirement t : src.getDataRequirement()) + tgt.addDataRequirement(DataRequirement43_50.convertDataRequirement(t)); + for (org.hl7.fhir.r4b.model.Attachment t : src.getContent()) tgt.addContent(Attachment43_50.convertAttachment(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Library convertLibrary(org.hl7.fhir.r5.model.Library src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Library tgt = new org.hl7.fhir.r4b.model.Library(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r5.model.ParameterDefinition t : src.getParameter()) + tgt.addParameter(ParameterDefinition43_50.convertParameterDefinition(t)); + for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement()) + tgt.addDataRequirement(DataRequirement43_50.convertDataRequirement(t)); + for (org.hl7.fhir.r5.model.Attachment t : src.getContent()) tgt.addContent(Attachment43_50.convertAttachment(t)); + 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/Linkage43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Linkage43_50.java new file mode 100644 index 000000000..99b55b28f --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Linkage43_50.java @@ -0,0 +1,134 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Linkage43_50 { + + public static org.hl7.fhir.r5.model.Linkage convertLinkage(org.hl7.fhir.r4b.model.Linkage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Linkage tgt = new org.hl7.fhir.r5.model.Linkage(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + for (org.hl7.fhir.r4b.model.Linkage.LinkageItemComponent t : src.getItem()) + tgt.addItem(convertLinkageItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Linkage convertLinkage(org.hl7.fhir.r5.model.Linkage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Linkage tgt = new org.hl7.fhir.r4b.model.Linkage(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + for (org.hl7.fhir.r5.model.Linkage.LinkageItemComponent t : src.getItem()) + tgt.addItem(convertLinkageItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Linkage.LinkageItemComponent convertLinkageItemComponent(org.hl7.fhir.r4b.model.Linkage.LinkageItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Linkage.LinkageItemComponent tgt = new org.hl7.fhir.r5.model.Linkage.LinkageItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertLinkageType(src.getTypeElement())); + if (src.hasResource()) + tgt.setResource(Reference43_50.convertReference(src.getResource())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Linkage.LinkageItemComponent convertLinkageItemComponent(org.hl7.fhir.r5.model.Linkage.LinkageItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Linkage.LinkageItemComponent tgt = new org.hl7.fhir.r4b.model.Linkage.LinkageItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertLinkageType(src.getTypeElement())); + if (src.hasResource()) + tgt.setResource(Reference43_50.convertReference(src.getResource())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..4a58d4bc3 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ListResource43_50.java @@ -0,0 +1,229 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ListResource43_50 { + + public static org.hl7.fhir.r5.model.ListResource convertListResource(org.hl7.fhir.r4b.model.ListResource src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ListResource tgt = new org.hl7.fhir.r5.model.ListResource(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertListStatus(src.getStatusElement())); + if (src.hasMode()) + tgt.setModeElement(convertListMode(src.getModeElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + if (src.hasOrderedBy()) + tgt.setOrderedBy(CodeableConcept43_50.convertCodeableConcept(src.getOrderedBy())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.ListResource.ListResourceEntryComponent t : src.getEntry()) + tgt.addEntry(convertListEntryComponent(t)); + if (src.hasEmptyReason()) + tgt.setEmptyReason(CodeableConcept43_50.convertCodeableConcept(src.getEmptyReason())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ListResource convertListResource(org.hl7.fhir.r5.model.ListResource src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ListResource tgt = new org.hl7.fhir.r4b.model.ListResource(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertListStatus(src.getStatusElement())); + if (src.hasMode()) + tgt.setModeElement(convertListMode(src.getModeElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + if (src.hasOrderedBy()) + tgt.setOrderedBy(CodeableConcept43_50.convertCodeableConcept(src.getOrderedBy())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent t : src.getEntry()) + tgt.addEntry(convertListEntryComponent(t)); + if (src.hasEmptyReason()) + tgt.setEmptyReason(CodeableConcept43_50.convertCodeableConcept(src.getEmptyReason())); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent convertListEntryComponent(org.hl7.fhir.r4b.model.ListResource.ListResourceEntryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent tgt = new org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFlag()) + tgt.setFlag(CodeableConcept43_50.convertCodeableConcept(src.getFlag())); + if (src.hasDeleted()) + tgt.setDeletedElement(Boolean43_50.convertBoolean(src.getDeletedElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasItem()) + tgt.setItem(Reference43_50.convertReference(src.getItem())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ListResource.ListResourceEntryComponent convertListEntryComponent(org.hl7.fhir.r5.model.ListResource.ListResourceEntryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ListResource.ListResourceEntryComponent tgt = new org.hl7.fhir.r4b.model.ListResource.ListResourceEntryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFlag()) + tgt.setFlag(CodeableConcept43_50.convertCodeableConcept(src.getFlag())); + if (src.hasDeleted()) + tgt.setDeletedElement(Boolean43_50.convertBoolean(src.getDeletedElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasItem()) + tgt.setItem(Reference43_50.convertReference(src.getItem())); + 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/Location43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Location43_50.java new file mode 100644 index 000000000..003093ae2 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Location43_50.java @@ -0,0 +1,336 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_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.Time43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Location43_50 { + + public static org.hl7.fhir.r5.model.Location convertLocation(org.hl7.fhir.r4b.model.Location src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Location tgt = new org.hl7.fhir.r5.model.Location(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertLocationStatus(src.getStatusElement())); + if (src.hasOperationalStatus()) + tgt.setOperationalStatus(Coding43_50.convertCoding(src.getOperationalStatus())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasMode()) + tgt.setModeElement(convertLocationMode(src.getModeElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasAddress()) + tgt.setAddress(Address43_50.convertAddress(src.getAddress())); + if (src.hasPhysicalType()) + tgt.setPhysicalType(CodeableConcept43_50.convertCodeableConcept(src.getPhysicalType())); + if (src.hasPosition()) + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + if (src.hasPartOf()) + tgt.setPartOf(Reference43_50.convertReference(src.getPartOf())); + for (org.hl7.fhir.r4b.model.Location.LocationHoursOfOperationComponent t : src.getHoursOfOperation()) + tgt.addHoursOfOperation(convertLocationHoursOfOperationComponent(t)); + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(String43_50.convertString(src.getAvailabilityExceptionsElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Location convertLocation(org.hl7.fhir.r5.model.Location src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Location tgt = new org.hl7.fhir.r4b.model.Location(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertLocationStatus(src.getStatusElement())); + if (src.hasOperationalStatus()) + tgt.setOperationalStatus(Coding43_50.convertCoding(src.getOperationalStatus())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasMode()) + tgt.setModeElement(convertLocationMode(src.getModeElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasAddress()) + tgt.setAddress(Address43_50.convertAddress(src.getAddress())); + if (src.hasPhysicalType()) + tgt.setPhysicalType(CodeableConcept43_50.convertCodeableConcept(src.getPhysicalType())); + if (src.hasPosition()) + tgt.setPosition(convertLocationPositionComponent(src.getPosition())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + if (src.hasPartOf()) + tgt.setPartOf(Reference43_50.convertReference(src.getPartOf())); + for (org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent t : src.getHoursOfOperation()) + tgt.addHoursOfOperation(convertLocationHoursOfOperationComponent(t)); + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(String43_50.convertString(src.getAvailabilityExceptionsElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r4b.model.Location.LocationPositionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r5.model.Location.LocationPositionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLongitude()) + tgt.setLongitudeElement(Decimal43_50.convertDecimal(src.getLongitudeElement())); + if (src.hasLatitude()) + tgt.setLatitudeElement(Decimal43_50.convertDecimal(src.getLatitudeElement())); + if (src.hasAltitude()) + tgt.setAltitudeElement(Decimal43_50.convertDecimal(src.getAltitudeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r5.model.Location.LocationPositionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r4b.model.Location.LocationPositionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLongitude()) + tgt.setLongitudeElement(Decimal43_50.convertDecimal(src.getLongitudeElement())); + if (src.hasLatitude()) + tgt.setLatitudeElement(Decimal43_50.convertDecimal(src.getLatitudeElement())); + if (src.hasAltitude()) + tgt.setAltitudeElement(Decimal43_50.convertDecimal(src.getAltitudeElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent convertLocationHoursOfOperationComponent(org.hl7.fhir.r4b.model.Location.LocationHoursOfOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + tgt.setDaysOfWeek(src.getDaysOfWeek().stream() + .map(Location43_50::convertDaysOfWeek) + .collect(Collectors.toList())); + if (src.hasAllDay()) + tgt.setAllDayElement(Boolean43_50.convertBoolean(src.getAllDayElement())); + if (src.hasOpeningTime()) + tgt.setOpeningTimeElement(Time43_50.convertTime(src.getOpeningTimeElement())); + if (src.hasClosingTime()) + tgt.setClosingTimeElement(Time43_50.convertTime(src.getClosingTimeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Location.LocationHoursOfOperationComponent convertLocationHoursOfOperationComponent(org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r4b.model.Location.LocationHoursOfOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + tgt.setDaysOfWeek(src.getDaysOfWeek().stream() + .map(Location43_50::convertDaysOfWeek) + .collect(Collectors.toList())); + if (src.hasAllDay()) + tgt.setAllDayElement(Boolean43_50.convertBoolean(src.getAllDayElement())); + if (src.hasOpeningTime()) + tgt.setOpeningTimeElement(Time43_50.convertTime(src.getOpeningTimeElement())); + if (src.hasClosingTime()) + tgt.setClosingTimeElement(Time43_50.convertTime(src.getClosingTimeElement())); + return tgt; + } + + 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; + } + + 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; + } +} \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MarketingStatus43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MarketingStatus43_50.java new file mode 100644 index 000000000..0fe998747 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MarketingStatus43_50.java @@ -0,0 +1,33 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class MarketingStatus43_50 extends BackboneElement43_50 { + public static org.hl7.fhir.r5.model.MarketingStatus convertMarketingStatus(org.hl7.fhir.r4b.model.MarketingStatus src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.MarketingStatus tgt = new org.hl7.fhir.r5.model.MarketingStatus(); + copyBackboneElement(src, tgt); + if (src.hasCountry()) tgt.setCountry(CodeableConcept43_50.convertCodeableConcept(src.getCountry())); + if (src.hasJurisdiction()) tgt.setJurisdiction(CodeableConcept43_50.convertCodeableConcept(src.getJurisdiction())); + if (src.hasStatus()) tgt.setStatus(CodeableConcept43_50.convertCodeableConcept(src.getStatus())); + if (src.hasDateRange()) tgt.setDateRange(Period43_50.convertPeriod(src.getDateRange())); + if (src.hasRestoreDate()) tgt.setRestoreDateElement(DateTime43_50.convertDateTime(src.getRestoreDateElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MarketingStatus convertMarketingStatus(org.hl7.fhir.r5.model.MarketingStatus src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.MarketingStatus tgt = new org.hl7.fhir.r4b.model.MarketingStatus(); + copyBackboneElement(src, tgt); + if (src.hasCountry()) tgt.setCountry(CodeableConcept43_50.convertCodeableConcept(src.getCountry())); + if (src.hasJurisdiction()) tgt.setJurisdiction(CodeableConcept43_50.convertCodeableConcept(src.getJurisdiction())); + if (src.hasStatus()) tgt.setStatus(CodeableConcept43_50.convertCodeableConcept(src.getStatus())); + if (src.hasDateRange()) tgt.setDateRange(Period43_50.convertPeriod(src.getDateRange())); + if (src.hasRestoreDate()) tgt.setRestoreDateElement(DateTime43_50.convertDateTime(src.getRestoreDateElement())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Measure43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Measure43_50.java new file mode 100644 index 000000000..eaaf556a4 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Measure43_50.java @@ -0,0 +1,376 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.Expression43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.RelatedArtifact43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Measure43_50 { + + public static org.hl7.fhir.r5.model.Measure convertMeasure(org.hl7.fhir.r4b.model.Measure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure tgt = new org.hl7.fhir.r5.model.Measure(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getLibrary()) + tgt.getLibrary().add(Canonical43_50.convertCanonical(t)); + if (src.hasDisclaimer()) + tgt.setDisclaimerElement(MarkDown43_50.convertMarkdown(src.getDisclaimerElement())); + if (src.hasScoring()) + tgt.setScoring(CodeableConcept43_50.convertCodeableConcept(src.getScoring())); + if (src.hasCompositeScoring()) + tgt.setCompositeScoring(CodeableConcept43_50.convertCodeableConcept(src.getCompositeScoring())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasRiskAdjustment()) + tgt.setRiskAdjustmentElement(String43_50.convertString(src.getRiskAdjustmentElement())); + if (src.hasRateAggregation()) + tgt.setRateAggregationElement(String43_50.convertString(src.getRateAggregationElement())); + if (src.hasRationale()) + tgt.setRationaleElement(MarkDown43_50.convertMarkdown(src.getRationaleElement())); + if (src.hasClinicalRecommendationStatement()) + tgt.setClinicalRecommendationStatementElement(MarkDown43_50.convertMarkdown(src.getClinicalRecommendationStatementElement())); + if (src.hasImprovementNotation()) + tgt.setImprovementNotation(CodeableConcept43_50.convertCodeableConcept(src.getImprovementNotation())); + for (org.hl7.fhir.r4b.model.MarkdownType t : src.getDefinition()) + tgt.getDefinition().add(MarkDown43_50.convertMarkdown(t)); + if (src.hasGuidance()) + tgt.setGuidanceElement(MarkDown43_50.convertMarkdown(src.getGuidanceElement())); + for (org.hl7.fhir.r4b.model.Measure.MeasureGroupComponent t : src.getGroup()) + tgt.addGroup(convertMeasureGroupComponent(t)); + for (org.hl7.fhir.r4b.model.Measure.MeasureSupplementalDataComponent t : src.getSupplementalData()) + tgt.addSupplementalData(convertMeasureSupplementalDataComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Measure convertMeasure(org.hl7.fhir.r5.model.Measure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Measure tgt = new org.hl7.fhir.r4b.model.Measure(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) + tgt.getLibrary().add(Canonical43_50.convertCanonical(t)); + if (src.hasDisclaimer()) + tgt.setDisclaimerElement(MarkDown43_50.convertMarkdown(src.getDisclaimerElement())); + if (src.hasScoring()) + tgt.setScoring(CodeableConcept43_50.convertCodeableConcept(src.getScoring())); + if (src.hasCompositeScoring()) + tgt.setCompositeScoring(CodeableConcept43_50.convertCodeableConcept(src.getCompositeScoring())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasRiskAdjustment()) + tgt.setRiskAdjustmentElement(String43_50.convertString(src.getRiskAdjustmentElement())); + if (src.hasRateAggregation()) + tgt.setRateAggregationElement(String43_50.convertString(src.getRateAggregationElement())); + if (src.hasRationale()) + tgt.setRationaleElement(MarkDown43_50.convertMarkdown(src.getRationaleElement())); + if (src.hasClinicalRecommendationStatement()) + tgt.setClinicalRecommendationStatementElement(MarkDown43_50.convertMarkdown(src.getClinicalRecommendationStatementElement())); + if (src.hasImprovementNotation()) + tgt.setImprovementNotation(CodeableConcept43_50.convertCodeableConcept(src.getImprovementNotation())); + for (org.hl7.fhir.r5.model.MarkdownType t : src.getDefinition()) + tgt.getDefinition().add(MarkDown43_50.convertMarkdown(t)); + if (src.hasGuidance()) + tgt.setGuidanceElement(MarkDown43_50.convertMarkdown(src.getGuidanceElement())); + for (org.hl7.fhir.r5.model.Measure.MeasureGroupComponent t : src.getGroup()) + tgt.addGroup(convertMeasureGroupComponent(t)); + for (org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent t : src.getSupplementalData()) + tgt.addSupplementalData(convertMeasureSupplementalDataComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Measure.MeasureGroupComponent convertMeasureGroupComponent(org.hl7.fhir.r4b.model.Measure.MeasureGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureGroupComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.Measure.MeasureGroupPopulationComponent t : src.getPopulation()) + tgt.addPopulation(convertMeasureGroupPopulationComponent(t)); + for (org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponent t : src.getStratifier()) + tgt.addStratifier(convertMeasureGroupStratifierComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Measure.MeasureGroupComponent convertMeasureGroupComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Measure.MeasureGroupComponent tgt = new org.hl7.fhir.r4b.model.Measure.MeasureGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent t : src.getPopulation()) + tgt.addPopulation(convertMeasureGroupPopulationComponent(t)); + for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent t : src.getStratifier()) + tgt.addStratifier(convertMeasureGroupStratifierComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent convertMeasureGroupPopulationComponent(org.hl7.fhir.r4b.model.Measure.MeasureGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(Expression43_50.convertExpression(src.getCriteria())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Measure.MeasureGroupPopulationComponent convertMeasureGroupPopulationComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Measure.MeasureGroupPopulationComponent tgt = new org.hl7.fhir.r4b.model.Measure.MeasureGroupPopulationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(Expression43_50.convertExpression(src.getCriteria())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent convertMeasureGroupStratifierComponent(org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(Expression43_50.convertExpression(src.getCriteria())); + for (org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponentComponent t : src.getComponent()) + tgt.addComponent(convertMeasureGroupStratifierComponentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponent convertMeasureGroupStratifierComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponent tgt = new org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(Expression43_50.convertExpression(src.getCriteria())); + for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent t : src.getComponent()) + tgt.addComponent(convertMeasureGroupStratifierComponentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent convertMeasureGroupStratifierComponentComponent(org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(Expression43_50.convertExpression(src.getCriteria())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponentComponent convertMeasureGroupStratifierComponentComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponentComponent tgt = new org.hl7.fhir.r4b.model.Measure.MeasureGroupStratifierComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(Expression43_50.convertExpression(src.getCriteria())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent convertMeasureSupplementalDataComponent(org.hl7.fhir.r4b.model.Measure.MeasureSupplementalDataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getUsage()) + tgt.addUsage(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(Expression43_50.convertExpression(src.getCriteria())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Measure.MeasureSupplementalDataComponent convertMeasureSupplementalDataComponent(org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Measure.MeasureSupplementalDataComponent tgt = new org.hl7.fhir.r4b.model.Measure.MeasureSupplementalDataComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getUsage()) + tgt.addUsage(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCriteria()) + tgt.setCriteria(Expression43_50.convertExpression(src.getCriteria())); + 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 new file mode 100644 index 000000000..8c3ac5800 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MeasureReport43_50.java @@ -0,0 +1,366 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Quantity43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class MeasureReport43_50 { + + public static org.hl7.fhir.r5.model.MeasureReport convertMeasureReport(org.hl7.fhir.r4b.model.MeasureReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport tgt = new org.hl7.fhir.r5.model.MeasureReport(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertMeasureReportStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setTypeElement(convertMeasureReportType(src.getTypeElement())); + if (src.hasMeasure()) + tgt.setMeasureElement(Canonical43_50.convertCanonical(src.getMeasureElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasReporter()) + tgt.setReporter(Reference43_50.convertReference(src.getReporter())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasImprovementNotation()) + tgt.setImprovementNotation(CodeableConcept43_50.convertCodeableConcept(src.getImprovementNotation())); + for (org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupComponent t : src.getGroup()) + tgt.addGroup(convertMeasureReportGroupComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getEvaluatedResource()) + tgt.addEvaluatedResource(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MeasureReport convertMeasureReport(org.hl7.fhir.r5.model.MeasureReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MeasureReport tgt = new org.hl7.fhir.r4b.model.MeasureReport(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertMeasureReportStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setTypeElement(convertMeasureReportType(src.getTypeElement())); + if (src.hasMeasure()) + tgt.setMeasureElement(Canonical43_50.convertCanonical(src.getMeasureElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasReporter()) + tgt.setReporter(Reference43_50.convertReference(src.getReporter())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasImprovementNotation()) + tgt.setImprovementNotation(CodeableConcept43_50.convertCodeableConcept(src.getImprovementNotation())); + for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent t : src.getGroup()) + tgt.addGroup(convertMeasureReportGroupComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEvaluatedResource()) + tgt.addEvaluatedResource(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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.DATACOLLECTION); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.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 DATACOLLECTION: + 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 { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupPopulationComponent t : src.getPopulation()) + tgt.addPopulation(convertMeasureReportGroupPopulationComponent(t)); + if (src.hasMeasureScore()) + tgt.setMeasureScore(Quantity43_50.convertQuantity(src.getMeasureScore())); + for (org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupStratifierComponent t : src.getStratifier()) + tgt.addStratifier(convertMeasureReportGroupStratifierComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupComponent convertMeasureReportGroupComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupComponent tgt = new org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent t : src.getPopulation()) + tgt.addPopulation(convertMeasureReportGroupPopulationComponent(t)); + if (src.hasMeasureScoreQuantity()) + tgt.setMeasureScore(Quantity43_50.convertQuantity(src.getMeasureScoreQuantity())); + for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent t : src.getStratifier()) + tgt.addStratifier(convertMeasureReportGroupStratifierComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent convertMeasureReportGroupPopulationComponent(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasCount()) + tgt.setCountElement(Integer43_50.convertInteger(src.getCountElement())); + if (src.hasSubjectResults()) + tgt.setSubjectResults(Reference43_50.convertReference(src.getSubjectResults())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupPopulationComponent convertMeasureReportGroupPopulationComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupPopulationComponent tgt = new org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupPopulationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasCount()) + tgt.setCountElement(Integer43_50.convertInteger(src.getCountElement())); + if (src.hasSubjectResults()) + tgt.setSubjectResults(Reference43_50.convertReference(src.getSubjectResults())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent convertMeasureReportGroupStratifierComponent(org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupStratifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponent t : src.getStratum()) + tgt.addStratum(convertStratifierGroupComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupStratifierComponent convertMeasureReportGroupStratifierComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupStratifierComponent tgt = new org.hl7.fhir.r4b.model.MeasureReport.MeasureReportGroupStratifierComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent t : src.getStratum()) + tgt.addStratum(convertStratifierGroupComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent convertStratifierGroupComponent(org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(CodeableConcept43_50.convertCodeableConcept(src.getValue())); + for (org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponentComponent t : src.getComponent()) + tgt.addComponent(convertStratifierGroupComponentComponent(t)); + for (org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupPopulationComponent t : src.getPopulation()) + tgt.addPopulation(convertStratifierGroupPopulationComponent(t)); + if (src.hasMeasureScore()) + tgt.setMeasureScore(Quantity43_50.convertQuantity(src.getMeasureScore())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponent convertStratifierGroupComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponent tgt = new org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValueCodeableConcept()) + tgt.setValue(CodeableConcept43_50.convertCodeableConcept(src.getValueCodeableConcept())); + for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent t : src.getComponent()) + tgt.addComponent(convertStratifierGroupComponentComponent(t)); + for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent t : src.getPopulation()) + tgt.addPopulation(convertStratifierGroupPopulationComponent(t)); + if (src.hasMeasureScoreQuantity()) + tgt.setMeasureScore(Quantity43_50.convertQuantity(src.getMeasureScoreQuantity())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent convertStratifierGroupComponentComponent(org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(CodeableConcept43_50.convertCodeableConcept(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponentComponent convertStratifierGroupComponentComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponentComponent tgt = new org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValueCodeableConcept()) + tgt.setValue(CodeableConcept43_50.convertCodeableConcept(src.getValueCodeableConcept())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent convertStratifierGroupPopulationComponent(org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasCount()) + tgt.setCountElement(Integer43_50.convertInteger(src.getCountElement())); + if (src.hasSubjectResults()) + tgt.setSubjectResults(Reference43_50.convertReference(src.getSubjectResults())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupPopulationComponent convertStratifierGroupPopulationComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupPopulationComponent tgt = new org.hl7.fhir.r4b.model.MeasureReport.StratifierGroupPopulationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasCount()) + tgt.setCountElement(Integer43_50.convertInteger(src.getCountElement())); + if (src.hasSubjectResults()) + tgt.setSubjectResults(Reference43_50.convertReference(src.getSubjectResults())); + 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/Media43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Media43_50.java new file mode 100644 index 000000000..9a9569dd8 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Media43_50.java @@ -0,0 +1,178 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Media43_50 { + + public static org.hl7.fhir.r5.model.DocumentReference convertMedia(org.hl7.fhir.r4b.model.Media src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.DocumentReference tgt = new org.hl7.fhir.r5.model.DocumentReference(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + // for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + // tgt.addIdentifier(convertIdentifier(t)); + // for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) + // tgt.addBasedOn(convertReference(t)); + // for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) + // tgt.addPartOf(convertReference(t)); + // if (src.hasStatus()) + // tgt.setStatus(convertMediaStatus(src.getStatus())); + // if (src.hasType()) + // tgt.setType(convertCodeableConcept(src.getType())); + // if (src.hasModality()) + // tgt.setModality(convertCodeableConcept(src.getModality())); + // if (src.hasView()) + // tgt.setView(convertCodeableConcept(src.getView())); + // if (src.hasSubject()) + // tgt.setSubject(convertReference(src.getSubject())); + // if (src.hasEncounter()) + // tgt.setEncounter(convertReference(src.getEncounter())); + // if (src.hasCreated()) + // tgt.setCreated(convertType(src.getCreated())); + // if (src.hasIssued()) + // tgt.setIssuedElement(convertInstant(src.getIssuedElement())); + // if (src.hasOperator()) + // tgt.setOperator(convertReference(src.getOperator())); + // for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + // tgt.addReasonCode(convertCodeableConcept(t)); + // if (src.hasBodySite()) + // tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + // if (src.hasDeviceName()) + // tgt.setDeviceNameElement(convertString(src.getDeviceNameElement())); + // if (src.hasDevice()) + // tgt.setDevice(convertReference(src.getDevice())); + // if (src.hasHeight()) + // tgt.setHeightElement(convertPositiveInt(src.getHeightElement())); + // if (src.hasWidth()) + // tgt.setWidthElement(convertPositiveInt(src.getWidthElement())); + // if (src.hasFrames()) + // tgt.setFramesElement(convertPositiveInt(src.getFramesElement())); + // if (src.hasDuration()) + // tgt.setDurationElement(convertDecimal(src.getDurationElement())); + // if (src.hasContent()) + // tgt.setContent(convertAttachment(src.getContent())); + // for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) + // tgt.addNote(convertAnnotation(t)); + return tgt; + } + + /** + * Todo: how do you decide that it maps to a media? + * + * @param src + * @return + * @throws FHIRException + */ + public static org.hl7.fhir.r4b.model.Media convertMedia(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Media tgt = new org.hl7.fhir.r4b.model.Media(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + // for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + // tgt.addIdentifier(convertIdentifier(t)); + // for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) + // tgt.addBasedOn(convertReference(t)); + // for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) + // tgt.addPartOf(convertReference(t)); + // if (src.hasStatus()) + // tgt.setStatus(convertMediaStatus(src.getStatus())); + // if (src.hasType()) + // tgt.setType(convertCodeableConcept(src.getType())); + // if (src.hasModality()) + // tgt.setModality(convertCodeableConcept(src.getModality())); + // if (src.hasView()) + // tgt.setView(convertCodeableConcept(src.getView())); + // if (src.hasSubject()) + // tgt.setSubject(convertReference(src.getSubject())); + // if (src.hasEncounter()) + // tgt.setEncounter(convertReference(src.getEncounter())); + // if (src.hasCreated()) + // tgt.setCreated(convertType(src.getCreated())); + // if (src.hasIssued()) + // tgt.setIssuedElement(convertInstant(src.getIssuedElement())); + // if (src.hasOperator()) + // tgt.setOperator(convertReference(src.getOperator())); + // for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode()) + // tgt.addReasonCode(convertCodeableConcept(t)); + // if (src.hasBodySite()) + // tgt.setBodySite(convertCodeableConcept(src.getBodySite())); + // if (src.hasDeviceName()) + // tgt.setDeviceNameElement(convertString(src.getDeviceNameElement())); + // if (src.hasDevice()) + // tgt.setDevice(convertReference(src.getDevice())); + // if (src.hasHeight()) + // tgt.setHeightElement(convertPositiveInt(src.getHeightElement())); + // if (src.hasWidth()) + // tgt.setWidthElement(convertPositiveInt(src.getWidthElement())); + // if (src.hasFrames()) + // tgt.setFramesElement(convertPositiveInt(src.getFramesElement())); + // if (src.hasDuration()) + // tgt.setDurationElement(convertDecimal(src.getDurationElement())); + // if (src.hasContent()) + // tgt.setContent(convertAttachment(src.getContent())); + // for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) + // tgt.addNote(convertAnnotation(t)); + return tgt; + } + // public static org.hl7.fhir.r5.model.Media.MediaStatus convertMediaStatus(org.hl7.fhir.r4b.model.Media.MediaStatus src) throws FHIRException { + // if (src == null) + // return null; + // switch (src) { + // case PREPARATION: return org.hl7.fhir.r5.model.Media.MediaStatus.PREPARATION; + // case INPROGRESS: return org.hl7.fhir.r5.model.Media.MediaStatus.INPROGRESS; + // case NOTDONE: return org.hl7.fhir.r5.model.Media.MediaStatus.NOTDONE; + // case ONHOLD: return org.hl7.fhir.r5.model.Media.MediaStatus.ONHOLD; + // case STOPPED: return org.hl7.fhir.r5.model.Media.MediaStatus.STOPPED; + // case COMPLETED: return org.hl7.fhir.r5.model.Media.MediaStatus.COMPLETED; + // case ENTEREDINERROR: return org.hl7.fhir.r5.model.Media.MediaStatus.ENTEREDINERROR; + // case UNKNOWN: return org.hl7.fhir.r5.model.Media.MediaStatus.UNKNOWN; + // default: return org.hl7.fhir.r5.model.Media.MediaStatus.NULL; + // } + // } + // + // public static org.hl7.fhir.r4b.model.Media.MediaStatus convertMediaStatus(org.hl7.fhir.r5.model.Media.MediaStatus src) throws FHIRException { + // if (src == null) + // return null; + // switch (src) { + // case PREPARATION: return org.hl7.fhir.r4b.model.Media.MediaStatus.PREPARATION; + // case INPROGRESS: return org.hl7.fhir.r4b.model.Media.MediaStatus.INPROGRESS; + // case NOTDONE: return org.hl7.fhir.r4b.model.Media.MediaStatus.NOTDONE; + // case ONHOLD: return org.hl7.fhir.r4b.model.Media.MediaStatus.ONHOLD; + // case STOPPED: return org.hl7.fhir.r4b.model.Media.MediaStatus.STOPPED; + // case COMPLETED: return org.hl7.fhir.r4b.model.Media.MediaStatus.COMPLETED; + // case ENTEREDINERROR: return org.hl7.fhir.r4b.model.Media.MediaStatus.ENTEREDINERROR; + // case UNKNOWN: return org.hl7.fhir.r4b.model.Media.MediaStatus.UNKNOWN; + // default: return org.hl7.fhir.r4b.model.Media.MediaStatus.NULL; + // } + // } +} \ No newline at end of file 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 new file mode 100644 index 000000000..3c773eb4c --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Medication43_50.java @@ -0,0 +1,191 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Ratio43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Medication43_50 { + + public static org.hl7.fhir.r5.model.Medication convertMedication(org.hl7.fhir.r4b.model.Medication src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Medication tgt = new org.hl7.fhir.r5.model.Medication(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationStatus(src.getStatusElement())); + if (src.hasManufacturer()) + tgt.setMarketingAuthorizationHolder(Reference43_50.convertReference(src.getManufacturer())); + if (src.hasForm()) + tgt.setDoseForm(CodeableConcept43_50.convertCodeableConcept(src.getForm())); + if (src.hasAmount()) + tgt.setTotalVolume(Ratio43_50.convertRatio(src.getAmount())); + for (org.hl7.fhir.r4b.model.Medication.MedicationIngredientComponent t : src.getIngredient()) + tgt.addIngredient(convertMedicationIngredientComponent(t)); + if (src.hasBatch()) + tgt.setBatch(convertMedicationBatchComponent(src.getBatch())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Medication convertMedication(org.hl7.fhir.r5.model.Medication src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Medication tgt = new org.hl7.fhir.r4b.model.Medication(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationStatus(src.getStatusElement())); + if (src.hasMarketingAuthorizationHolder()) + tgt.setManufacturer(Reference43_50.convertReference(src.getMarketingAuthorizationHolder())); + if (src.hasDoseForm()) + tgt.setForm(CodeableConcept43_50.convertCodeableConcept(src.getDoseForm())); + if (src.hasTotalVolume()) + tgt.setAmount(Ratio43_50.convertRatio(src.getTotalVolume())); + for (org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent t : src.getIngredient()) + tgt.addIngredient(convertMedicationIngredientComponent(t)); + if (src.hasBatch()) + tgt.setBatch(convertMedicationBatchComponent(src.getBatch())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r4b.model.Medication.MedicationIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent tgt = new org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasItemCodeableConcept()) + tgt.getItem().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getItemCodeableConcept())); + if (src.hasItemReference()) + tgt.getItem().setReference(Reference43_50.convertReference(src.getItemReference())); + if (src.hasIsActive()) + tgt.setIsActiveElement(Boolean43_50.convertBoolean(src.getIsActiveElement())); + if (src.hasStrength()) + tgt.setStrength(Ratio43_50.convertRatio(src.getStrength())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Medication.MedicationIngredientComponent tgt = new org.hl7.fhir.r4b.model.Medication.MedicationIngredientComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.getItem().hasConcept()) + tgt.setItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getItem().getConcept())); + if (src.getItem().hasReference()) + tgt.setItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getItem().getReference())); + if (src.hasIsActive()) + tgt.setIsActiveElement(Boolean43_50.convertBoolean(src.getIsActiveElement())); + if (src.hasStrengthRatio()) + tgt.setStrength(Ratio43_50.convertRatio(src.getStrengthRatio())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Medication.MedicationBatchComponent convertMedicationBatchComponent(org.hl7.fhir.r4b.model.Medication.MedicationBatchComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Medication.MedicationBatchComponent tgt = new org.hl7.fhir.r5.model.Medication.MedicationBatchComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLotNumber()) + tgt.setLotNumberElement(String43_50.convertString(src.getLotNumberElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(DateTime43_50.convertDateTime(src.getExpirationDateElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Medication.MedicationBatchComponent convertMedicationBatchComponent(org.hl7.fhir.r5.model.Medication.MedicationBatchComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Medication.MedicationBatchComponent tgt = new org.hl7.fhir.r4b.model.Medication.MedicationBatchComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLotNumber()) + tgt.setLotNumberElement(String43_50.convertString(src.getLotNumberElement())); + if (src.hasExpirationDate()) + tgt.setExpirationDateElement(DateTime43_50.convertDateTime(src.getExpirationDateElement())); + 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/MedicationAdministration43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationAdministration43_50.java new file mode 100644 index 000000000..aa5952dd0 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationAdministration43_50.java @@ -0,0 +1,268 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class MedicationAdministration43_50 { + + public static org.hl7.fhir.r5.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.r4b.model.MedicationAdministration src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationAdministration tgt = new org.hl7.fhir.r5.model.MedicationAdministration(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiates()) tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationAdministrationStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getStatusReason()) + tgt.addStatusReason(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasMedicationCodeableConcept()) + tgt.getMedication().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getMedicationCodeableConcept())); + if (src.hasMedicationReference()) + tgt.getMedication().setReference(Reference43_50.convertReference(src.getMedicationReference())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setEncounter(Reference43_50.convertReference(src.getContext())); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + if (src.hasEffective()) + tgt.setOccurence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective())); + for (org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + if (src.hasRequest()) + tgt.setRequest(Reference43_50.convertReference(src.getRequest())); + for (org.hl7.fhir.r4b.model.Reference t : src.getDevice()) tgt.addDevice(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasDosage()) + tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); + for (org.hl7.fhir.r4b.model.Reference t : src.getEventHistory()) + tgt.addEventHistory(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.r5.model.MedicationAdministration src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationAdministration tgt = new org.hl7.fhir.r4b.model.MedicationAdministration(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) tgt.getInstantiates().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationAdministrationStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) + tgt.addStatusReason(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategoryFirstRep())); + if (src.getMedication().hasConcept()) + tgt.setMedication(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMedication().getConcept())); + if (src.getMedication().hasReference()) + tgt.setMedication(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMedication().getReference())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setContext(Reference43_50.convertReference(src.getEncounter())); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + if (src.hasOccurence()) + tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurence())); + for (org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t)); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + if (src.hasRequest()) + tgt.setRequest(Reference43_50.convertReference(src.getRequest())); + for (org.hl7.fhir.r5.model.Reference t : src.getDevice()) tgt.addDevice(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasDosage()) + tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage())); + for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) + tgt.addEventHistory(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent tgt = new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationPerformerComponent tgt = new org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationPerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt = new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + if (src.hasSite()) + tgt.setSite(CodeableConcept43_50.convertCodeableConcept(src.getSite())); + if (src.hasRoute()) + tgt.setRoute(CodeableConcept43_50.convertCodeableConcept(src.getRoute())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.hasDose()) + tgt.setDose(SimpleQuantity43_50.convertSimpleQuantity(src.getDose())); + if (src.hasRate()) + tgt.setRate(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getRate())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt = new org.hl7.fhir.r4b.model.MedicationAdministration.MedicationAdministrationDosageComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + if (src.hasSite()) + tgt.setSite(CodeableConcept43_50.convertCodeableConcept(src.getSite())); + if (src.hasRoute()) + tgt.setRoute(CodeableConcept43_50.convertCodeableConcept(src.getRoute())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.hasDose()) + tgt.setDose(SimpleQuantity43_50.convertSimpleQuantity(src.getDose())); + if (src.hasRate()) + tgt.setRate(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getRate())); + 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/MedicationDispense43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationDispense43_50.java new file mode 100644 index 000000000..402fe6ef9 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationDispense43_50.java @@ -0,0 +1,295 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +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.MedicationDispense.MedicationDispenseStatusCodesEnumFactory; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class MedicationDispense43_50 { + + public static org.hl7.fhir.r5.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.r4b.model.MedicationDispense src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationDispense tgt = new org.hl7.fhir.r5.model.MedicationDispense(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationStatus(src.getStatusElement())); +// if (src.hasStatusReasonCodeableConcept()) +// tgt.getStatusReason().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getStatusReasonCodeableConcept())); +// if (src.hasStatusReasonReference()) +// tgt.getStatusReason().setReference(Reference43_50.convertReference(src.getStatusReasonReference())); + if (src.hasCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasMedicationCodeableConcept()) + tgt.getMedication().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getMedicationCodeableConcept())); + if (src.hasMedicationReference()) + tgt.getMedication().setReference(Reference43_50.convertReference(src.getMedicationReference())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setEncounter(Reference43_50.convertReference(src.getContext())); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAuthorizingPrescription()) + tgt.addAuthorizingPrescription(Reference43_50.convertReference(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasDaysSupply()) + tgt.setDaysSupply(SimpleQuantity43_50.convertSimpleQuantity(src.getDaysSupply())); + if (src.hasWhenPrepared()) + tgt.setWhenPreparedElement(DateTime43_50.convertDateTime(src.getWhenPreparedElement())); + if (src.hasWhenHandedOver()) + tgt.setWhenHandedOverElement(DateTime43_50.convertDateTime(src.getWhenHandedOverElement())); + if (src.hasDestination()) + tgt.setDestination(Reference43_50.convertReference(src.getDestination())); + for (org.hl7.fhir.r4b.model.Reference t : src.getReceiver()) tgt.addReceiver(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.Dosage t : src.getDosageInstruction()) + tgt.addDosageInstruction(Dosage43_50.convertDosage(t)); + if (src.hasSubstitution()) + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); +// for (org.hl7.fhir.r4b.model.Reference t : src.getDetectedIssue()) +// tgt.addDetectedIssue(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getEventHistory()) + tgt.addEventHistory(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.r5.model.MedicationDispense src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationDispense tgt = new org.hl7.fhir.r4b.model.MedicationDispense(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertStatus(src.getStatusElement())); +// if (src.getStatusReason().hasConcept()) +// tgt.setStatusReason(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getStatusReason().getConcept())); +// if (src.getStatusReason().hasReference()) +// tgt.setStatusReason(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getStatusReason().getReference())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategoryFirstRep())); + if (src.getMedication().hasConcept()) + tgt.setMedication(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMedication().getConcept())); + if (src.getMedication().hasReference()) + tgt.setMedication(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMedication().getReference())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setContext(Reference43_50.convertReference(src.getEncounter())); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertMedicationDispensePerformerComponent(t)); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (org.hl7.fhir.r5.model.Reference t : src.getAuthorizingPrescription()) + tgt.addAuthorizingPrescription(Reference43_50.convertReference(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasDaysSupply()) + tgt.setDaysSupply(SimpleQuantity43_50.convertSimpleQuantity(src.getDaysSupply())); + if (src.hasWhenPrepared()) + tgt.setWhenPreparedElement(DateTime43_50.convertDateTime(src.getWhenPreparedElement())); + if (src.hasWhenHandedOver()) + tgt.setWhenHandedOverElement(DateTime43_50.convertDateTime(src.getWhenHandedOverElement())); + if (src.hasDestination()) + tgt.setDestination(Reference43_50.convertReference(src.getDestination())); + for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction()) + tgt.addDosageInstruction(Dosage43_50.convertDosage(t)); + if (src.hasSubstitution()) + tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution())); +// for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) +// tgt.addDetectedIssue(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) + tgt.addEventHistory(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent tgt = new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispensePerformerComponent tgt = new org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispensePerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasWasSubstituted()) + tgt.setWasSubstitutedElement(Boolean43_50.convertBoolean(src.getWasSubstitutedElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReason()) + tgt.addReason(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getResponsibleParty()) + tgt.setResponsibleParty(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r4b.model.MedicationDispense.MedicationDispenseSubstitutionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasWasSubstituted()) + tgt.setWasSubstitutedElement(Boolean43_50.convertBoolean(src.getWasSubstitutedElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) + tgt.addReason(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasResponsibleParty()) + tgt.addResponsibleParty(Reference43_50.convertReference(src.getResponsibleParty())); + 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/MedicationKnowledge43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationKnowledge43_50.java new file mode 100644 index 000000000..f68f54bfd --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationKnowledge43_50.java @@ -0,0 +1,596 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeableConcept; +import org.hl7.fhir.r5.model.Coding; +import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent; +import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodesEnumFactory; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class MedicationKnowledge43_50 { + + public static org.hl7.fhir.r5.model.MedicationKnowledge convertMedicationKnowledge(org.hl7.fhir.r4b.model.MedicationKnowledge src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge tgt = new org.hl7.fhir.r5.model.MedicationKnowledge(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationKnowledgeStatus(src.getStatusElement())); +// if (src.hasManufacturer()) +// tgt.setSponsor(Reference43_50.convertReference(src.getManufacturer())); +// if (src.hasDoseForm()) +// tgt.setDoseForm(CodeableConcept43_50.convertCodeableConcept(src.getDoseForm())); +// if (src.hasAmount()) +// tgt.setAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getAmount())); + for (org.hl7.fhir.r4b.model.StringType t : src.getSynonym()) tgt.getName().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge()) + tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getAssociatedMedication()) + tgt.addAssociatedMedication(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProductType()) + tgt.addProductType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph()) + tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t)); +// for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient()) +// tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t)); + if (src.hasPreparationInstruction()) + tgt.setPreparationInstructionElement(MarkDown43_50.convertMarkdown(src.getPreparationInstructionElement())); +// for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getIntendedRoute()) +// tgt.addIntendedRoute(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost()) + tgt.addCost(convertMedicationKnowledgeCostComponent(t)); + for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram()) + tgt.addMonitoringProgram(convertMedicationKnowledgeMonitoringProgramComponent(t)); + // for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent t : src.getAdministrationGuidelines()) + // tgt.addAdministrationGuidelines(convertMedicationKnowledgeAdministrationGuidelinesComponent(t)); + for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent t : src.getMedicineClassification()) + tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t)); + if (src.hasPackaging()) + tgt.addPackaging(convertMedicationKnowledgePackagingComponent(src.getPackaging())); +// for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic()) +// tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t)); + // for (org.hl7.fhir.r4b.model.Reference t : src.getContraindication()) + // tgt.addContraindication(convertReference(t)); + for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory()) + tgt.addRegulatory(convertMedicationKnowledgeRegulatoryComponent(t)); + // for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent t : src.getKinetics()) + // tgt.addKinetics(convertMedicationKnowledgeKineticsComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge convertMedicationKnowledge(org.hl7.fhir.r5.model.MedicationKnowledge src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationKnowledgeStatus(src.getStatusElement())); +// if (src.hasSponsor()) +// tgt.setManufacturer(Reference43_50.convertReference(src.getSponsor())); +// if (src.hasDoseForm()) +// tgt.setDoseForm(CodeableConcept43_50.convertCodeableConcept(src.getDoseForm())); +// if (src.hasAmount()) +// tgt.setAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getAmount())); + for (org.hl7.fhir.r5.model.StringType t : src.getName()) tgt.getSynonym().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge()) + tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getAssociatedMedication()) + tgt.addAssociatedMedication(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProductType()) + tgt.addProductType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph()) + tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t)); +// for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient()) +// tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t)); + if (src.hasPreparationInstruction()) + tgt.setPreparationInstructionElement(MarkDown43_50.convertMarkdown(src.getPreparationInstructionElement())); +// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getIntendedRoute()) +// tgt.addIntendedRoute(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost()) + tgt.addCost(convertMedicationKnowledgeCostComponent(t)); + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram()) + tgt.addMonitoringProgram(convertMedicationKnowledgeMonitoringProgramComponent(t)); + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent t : src.getAdministrationGuidelines()) + // tgt.addAdministrationGuidelines(convertMedicationKnowledgeAdministrationGuidelinesComponent(t)); + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent t : src.getMedicineClassification()) + tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t)); + for (MedicationKnowledgePackagingComponent t : src.getPackaging()) + tgt.setPackaging(convertMedicationKnowledgePackagingComponent(t)); +// for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic()) +// tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t)); + // for (org.hl7.fhir.r5.model.Reference t : src.getContraindication()) + // tgt.addContraindication(convertReference(t)); + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory()) + tgt.addRegulatory(convertMedicationKnowledgeRegulatoryComponent(t)); + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent t : src.getKinetics()) + // tgt.addKinetics(convertMedicationKnowledgeKineticsComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent convertMedicationKnowledgeMonographComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonographComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonographComponent convertMedicationKnowledgeMonographComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonographComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonographComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + return tgt; + } + +// public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasItemCodeableConcept()) +// tgt.getItem().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getItemCodeableConcept())); +// if (src.hasItemReference()) +// tgt.getItem().setReference(Reference43_50.convertReference(src.getItemReference())); +// if (src.getIsActive()) +// tgt.setIsActive(new CodeableConcept(new Coding("ttp://terminology.hl7.org/CodeSystem/v3-RoleClass", "ACTI", "active ingredient "))); +// if (src.hasStrength()) +// tgt.setStrength(Ratio43_50.convertRatio(src.getStrength())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.getItem().hasConcept()) +// tgt.setItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getItem().getConcept())); +// if (src.getItem().hasReference()) +// tgt.setItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getItem().getReference())); +// if (src.hasIsActive()) +// tgt.setIsActive(src.getIsActive().hasCoding("http://terminology.hl7.org/CodeSystem/v3-RoleClass", "ACTI")); +// if (src.hasStrengthRatio()) +// tgt.setStrength(Ratio43_50.convertRatio(src.getStrengthRatio())); +// return tgt; +// } + + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent convertMedicationKnowledgeCostComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSource()) + tgt.setSourceElement(String43_50.convertString(src.getSourceElement())); + if (src.hasCost()) + tgt.setCost(Money43_50.convertMoney(src.getCost())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeCostComponent convertMedicationKnowledgeCostComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeCostComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeCostComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSource()) + tgt.setSourceElement(String43_50.convertString(src.getSourceElement())); + if (src.hasCostMoney()) + tgt.setCost(Money43_50.convertMoney(src.getCostMoney())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent convertMedicationKnowledgeMonitoringProgramComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent convertMedicationKnowledgeMonitoringProgramComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + return tgt; + } + + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent convertMedicationKnowledgeAdministrationGuidelinesComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent(); + // copyElement(src, tgt); + // for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent t : src.getDosage()) + // tgt.addDosage(convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(t)); + // if (src.hasIndication()) + // tgt.setIndication(convertType(src.getIndication())); + // for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t : src.getPatientCharacteristics()) + // tgt.addPatientCharacteristics(convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent convertMedicationKnowledgeAdministrationGuidelinesComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent(); + // copyElement(src, tgt); + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent t : src.getDosage()) + // tgt.addDosage(convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(t)); + // if (src.hasIndication()) + // tgt.setIndication(convertType(src.getIndication())); + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t : src.getPatientCharacteristics()) + // tgt.addPatientCharacteristics(convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent(); + // copyElement(src, tgt); + // if (src.hasType()) + // tgt.setType(convertCodeableConcept(src.getType())); + // for (org.hl7.fhir.r4b.model.Dosage t : src.getDosage()) + // tgt.addDosage(convertDosage(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent(); + // copyElement(src, tgt); + // if (src.hasType()) + // tgt.setType(convertCodeableConcept(src.getType())); + // for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) + // tgt.addDosage(convertDosage(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(); + // copyElement(src, tgt); + // if (src.hasCharacteristic()) + // tgt.setCharacteristic(convertType(src.getCharacteristic())); + // for (org.hl7.fhir.r4b.model.StringType t : src.getValue()) + // tgt.getValue().add(convertString(t)); + // return tgt; + // } + // + // public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(); + // copyElement(src, tgt); + // if (src.hasCharacteristic()) + // tgt.setCharacteristic(convertType(src.getCharacteristic())); + // for (org.hl7.fhir.r5.model.StringType t : src.getValue()) + // tgt.getValue().add(convertString(t)); + // return tgt; + // } + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent convertMedicationKnowledgeMedicineClassificationComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getClassification()) + tgt.addClassification(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent convertMedicationKnowledgeMedicineClassificationComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getClassification()) + tgt.addClassification(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent convertMedicationKnowledgePackagingComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgePackagingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); +// if (src.hasType()) +// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// if (src.hasQuantity()) +// tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgePackagingComponent convertMedicationKnowledgePackagingComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgePackagingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); +// if (src.hasType()) +// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// if (src.hasQuantity()) +// tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + return tgt; + } + +// public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasType()) +// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// if (src.hasValue()) +// tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent(); +// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); +// if (src.hasType()) +// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// if (src.hasValue()) +// tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); +// return tgt; +// } + + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent convertMedicationKnowledgeRegulatoryComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRegulatoryAuthority()) + tgt.setRegulatoryAuthority(Reference43_50.convertReference(src.getRegulatoryAuthority())); + for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent t : src.getSubstitution()) + tgt.addSubstitution(convertMedicationKnowledgeRegulatorySubstitutionComponent(t)); + // for (org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent t : src.getSchedule()) + // tgt.addSchedule(convertMedicationKnowledgeRegulatoryScheduleComponent(t)); + if (src.hasMaxDispense()) + tgt.setMaxDispense(convertMedicationKnowledgeRegulatoryMaxDispenseComponent(src.getMaxDispense())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent convertMedicationKnowledgeRegulatoryComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRegulatoryAuthority()) + tgt.setRegulatoryAuthority(Reference43_50.convertReference(src.getRegulatoryAuthority())); + for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent t : src.getSubstitution()) + tgt.addSubstitution(convertMedicationKnowledgeRegulatorySubstitutionComponent(t)); + // for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent t : src.getSchedule()) + // tgt.addSchedule(convertMedicationKnowledgeRegulatoryScheduleComponent(t)); + if (src.hasMaxDispense()) + tgt.setMaxDispense(convertMedicationKnowledgeRegulatoryMaxDispenseComponent(src.getMaxDispense())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent convertMedicationKnowledgeRegulatorySubstitutionComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowedElement(Boolean43_50.convertBoolean(src.getAllowedElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent convertMedicationKnowledgeRegulatorySubstitutionComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasAllowed()) + tgt.setAllowedElement(Boolean43_50.convertBoolean(src.getAllowedElement())); + return tgt; + } + + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent convertMedicationKnowledgeRegulatoryScheduleComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent(); + // copyElement(src, tgt); + // if (src.hasSchedule()) + // tgt.setSchedule(convertCodeableConcept(src.getSchedule())); + // return tgt; + // } + // + // public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent convertMedicationKnowledgeRegulatoryScheduleComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent(); + // copyElement(src, tgt); + // if (src.hasSchedule()) + // tgt.setSchedule(convertCodeableConcept(src.getSchedule())); + // return tgt; + // } + // + public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent convertMedicationKnowledgeRegulatoryMaxDispenseComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasPeriod()) + tgt.setPeriod(Duration43_50.convertDuration(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent convertMedicationKnowledgeRegulatoryMaxDispenseComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasPeriod()) + tgt.setPeriod(Duration43_50.convertDuration(src.getPeriod())); + return tgt; + } + // public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent convertMedicationKnowledgeKineticsComponent(org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent(); + // copyElement(src, tgt); + // for (org.hl7.fhir.r4b.model.Quantity t : src.getAreaUnderCurve()) + // tgt.addAreaUnderCurve(convertSimpleQuantity(t)); + // for (org.hl7.fhir.r4b.model.Quantity t : src.getLethalDose50()) + // tgt.addLethalDose50(convertSimpleQuantity(t)); + // if (src.hasHalfLifePeriod()) + // tgt.setHalfLifePeriod(convertDuration(src.getHalfLifePeriod())); + // return tgt; + // } + // + // public static org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent convertMedicationKnowledgeKineticsComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent src) throws FHIRException { + // if (src == null) + // return null; + // org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent tgt = new org.hl7.fhir.r4b.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent(); + // copyElement(src, tgt); + // for (org.hl7.fhir.r5.model.Quantity t : src.getAreaUnderCurve()) + // tgt.addAreaUnderCurve(convertSimpleQuantity(t)); + // for (org.hl7.fhir.r5.model.Quantity t : src.getLethalDose50()) + // tgt.addLethalDose50(convertSimpleQuantity(t)); + // if (src.hasHalfLifePeriod()) + // tgt.setHalfLifePeriod(convertDuration(src.getHalfLifePeriod())); + // 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 new file mode 100644 index 000000000..7047dcc5b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationRequest43_50.java @@ -0,0 +1,478 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class MedicationRequest43_50 { + + public static org.hl7.fhir.r5.model.MedicationRequest convertMedicationRequest(org.hl7.fhir.r4b.model.MedicationRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationRequest tgt = new org.hl7.fhir.r5.model.MedicationRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationRequestStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasIntent()) + tgt.setIntentElement(convertMedicationRequestIntent(src.getIntentElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriorityElement(convertMedicationRequestPriority(src.getPriorityElement())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasReportedBooleanType()) + tgt.setReportedElement(Boolean43_50.convertBoolean(src.getReportedBooleanType())); + if (src.hasReportedReference()) + tgt.addInformationSource(Reference43_50.convertReference(src.getReportedReference())); + if (src.hasMedicationCodeableConcept()) + tgt.getMedication().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getMedicationCodeableConcept())); + if (src.hasMedicationReference()) + tgt.getMedication().setReference(Reference43_50.convertReference(src.getMedicationReference())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + if (src.hasPerformer()) + tgt.addPerformer(Reference43_50.convertReference(src.getPerformer())); + if (src.hasPerformerType()) + tgt.setPerformerType(CodeableConcept43_50.convertCodeableConcept(src.getPerformerType())); + if (src.hasRecorder()) + tgt.setRecorder(Reference43_50.convertReference(src.getRecorder())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason().setConcept(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason().setReference(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier())); + if (src.hasCourseOfTherapyType()) + tgt.setCourseOfTherapyType(CodeableConcept43_50.convertCodeableConcept(src.getCourseOfTherapyType())); + for (org.hl7.fhir.r4b.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.Dosage t : src.getDosageInstruction()) + tgt.getDose().addDosageInstruction(Dosage43_50.convertDosage(t)); + if (src.hasDispenseRequest()) + tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); + if (src.hasSubstitution()) + tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); + if (src.hasPriorPrescription()) + tgt.setPriorPrescription(Reference43_50.convertReference(src.getPriorPrescription())); + for (org.hl7.fhir.r4b.model.Reference t : src.getDetectedIssue()) +// tgt.addDetectedIssue(Reference43_50.convertReference(t)); +// for (org.hl7.fhir.r4b.model.Reference t : src.getEventHistory()) + tgt.addEventHistory(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationRequest convertMedicationRequest(org.hl7.fhir.r5.model.MedicationRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationRequest tgt = new org.hl7.fhir.r4b.model.MedicationRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationRequestStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasIntent()) + tgt.setIntentElement(convertMedicationRequestIntent(src.getIntentElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriorityElement(convertMedicationRequestPriority(src.getPriorityElement())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasReported()) + tgt.setReported(Boolean43_50.convertBoolean(src.getReportedElement())); + if (src.hasInformationSource()) + tgt.setReported(Reference43_50.convertReference(src.getInformationSourceFirstRep())); + if (src.getMedication().hasReference()) + tgt.setMedication(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMedication().getReference())); + if (src.getMedication().hasConcept()) + tgt.setMedication(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMedication().getConcept())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation()) + tgt.addSupportingInformation(Reference43_50.convertReference(t)); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + if (src.hasPerformer()) + tgt.setPerformer(Reference43_50.convertReference(src.getPerformerFirstRep())); + if (src.hasPerformerType()) + tgt.setPerformerType(CodeableConcept43_50.convertCodeableConcept(src.getPerformerType())); + if (src.hasRecorder()) + tgt.setRecorder(Reference43_50.convertReference(src.getRecorder())); + for (org.hl7.fhir.r5.model.CodeableReference t : src.getReason()) { + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + } + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier())); + if (src.hasCourseOfTherapyType()) + tgt.setCourseOfTherapyType(CodeableConcept43_50.convertCodeableConcept(src.getCourseOfTherapyType())); + for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.Dosage t : src.getDose().getDosageInstruction()) + tgt.addDosageInstruction(Dosage43_50.convertDosage(t)); + if (src.hasDispenseRequest()) + tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest())); + if (src.hasSubstitution()) + tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution())); + if (src.hasPriorPrescription()) + tgt.setPriorPrescription(Reference43_50.convertReference(src.getPriorPrescription())); +// for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue()) +// tgt.addDetectedIssue(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory()) + tgt.addEventHistory(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasInitialFill()) + tgt.setInitialFill(convertMedicationRequestDispenseRequestInitialFillComponent(src.getInitialFill())); + if (src.hasDispenseInterval()) + tgt.setDispenseInterval(Duration43_50.convertDuration(src.getDispenseInterval())); + if (src.hasValidityPeriod()) + tgt.setValidityPeriod(Period43_50.convertPeriod(src.getValidityPeriod())); + if (src.hasNumberOfRepeatsAllowed()) + tgt.setNumberOfRepeatsAllowedElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberOfRepeatsAllowedElement())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasExpectedSupplyDuration()) + tgt.setExpectedSupplyDuration(Duration43_50.convertDuration(src.getExpectedSupplyDuration())); + if (src.hasPerformer()) + tgt.setDispenser(Reference43_50.convertReference(src.getPerformer())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestDispenseRequestComponent tgt = new org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestDispenseRequestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasInitialFill()) + tgt.setInitialFill(convertMedicationRequestDispenseRequestInitialFillComponent(src.getInitialFill())); + if (src.hasDispenseInterval()) + tgt.setDispenseInterval(Duration43_50.convertDuration(src.getDispenseInterval())); + if (src.hasValidityPeriod()) + tgt.setValidityPeriod(Period43_50.convertPeriod(src.getValidityPeriod())); + if (src.hasNumberOfRepeatsAllowed()) + tgt.setNumberOfRepeatsAllowedElement(UnsignedInt43_50.convertUnsignedInt(src.getNumberOfRepeatsAllowedElement())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasExpectedSupplyDuration()) + tgt.setExpectedSupplyDuration(Duration43_50.convertDuration(src.getExpectedSupplyDuration())); + if (src.hasDispenser()) + tgt.setPerformer(Reference43_50.convertReference(src.getDispenser())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent convertMedicationRequestDispenseRequestInitialFillComponent(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasDuration()) + tgt.setDuration(Duration43_50.convertDuration(src.getDuration())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent convertMedicationRequestDispenseRequestInitialFillComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent tgt = new org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasDuration()) + tgt.setDuration(Duration43_50.convertDuration(src.getDuration())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAllowed()) + tgt.setAllowed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAllowed())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestSubstitutionComponent tgt = new org.hl7.fhir.r4b.model.MedicationRequest.MedicationRequestSubstitutionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAllowed()) + tgt.setAllowed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAllowed())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + 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/MedicationStatement43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationStatement43_50.java new file mode 100644 index 000000000..259d5e962 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MedicationStatement43_50.java @@ -0,0 +1,203 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class MedicationStatement43_50 { + + public static org.hl7.fhir.r5.model.MedicationUsage convertMedicationStatement(org.hl7.fhir.r4b.model.MedicationStatement src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MedicationUsage tgt = new org.hl7.fhir.r5.model.MedicationUsage(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); +// for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); +// for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationStatementStatus(src.getStatusElement())); +// for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getStatusReason()) +// tgt.addStatusReason(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasMedicationCodeableConcept()) { + tgt.getMedication().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getMedicationCodeableConcept())); + } + if (src.hasMedicationReference()) { + tgt.getMedication().setReference(Reference43_50.convertReference(src.getMedicationReference())); + } + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasContext()) + tgt.setEncounter(Reference43_50.convertReference(src.getContext())); + if (src.hasEffective()) + tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective())); + if (src.hasDateAsserted()) + tgt.setDateAssertedElement(DateTime43_50.convertDateTime(src.getDateAssertedElement())); + if (src.hasInformationSource()) + tgt.addInformationSource(Reference43_50.convertReference(src.getInformationSource())); + for (org.hl7.fhir.r4b.model.Reference t : src.getDerivedFrom()) + tgt.addDerivedFrom(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.Dosage t : src.getDosage()) tgt.addDosage(Dosage43_50.convertDosage(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MedicationStatement convertMedicationStatement(org.hl7.fhir.r5.model.MedicationUsage src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MedicationStatement tgt = new org.hl7.fhir.r4b.model.MedicationStatement(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); +// for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); +// for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertMedicationStatementStatus(src.getStatusElement())); +// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason()) +// tgt.addStatusReason(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategoryFirstRep())); + if (src.getMedication().hasConcept()) { + tgt.setMedication(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMedication().getConcept())); + } + if (src.getMedication().hasReference()) { + tgt.setMedication(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMedication().getReference())); + } + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setContext(Reference43_50.convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective())); + if (src.hasDateAsserted()) + tgt.setDateAssertedElement(DateTime43_50.convertDateTime(src.getDateAssertedElement())); + if (src.hasInformationSource()) + tgt.setInformationSource(Reference43_50.convertReference(src.getInformationSourceFirstRep())); + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) + tgt.addDerivedFrom(Reference43_50.convertReference(t)); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(Dosage43_50.convertDosage(t)); + return tgt; + } + + 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.MedicationUsage.MedicationUsageStatusCodesEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case ACTIVE: + tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED); + break; + case COMPLETED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED); + break; + case ENTEREDINERROR: + tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ENTEREDINERROR); + break; + case INTENDED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED); + break; + case STOPPED: + tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED); + break; + case ONHOLD: + tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED); + break; + case UNKNOWN: + tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED); + break; + case NOTTAKEN: + tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.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: +// 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 UNKNOWN: +// tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.INTENDED); +// break; +// case STOPPED: +// tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.STOPPED); +// break; +// case ONHOLD: +// tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.ONHOLD); +// break; + case DRAFT: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.UNKNOWN); + break; +// case NOTTAKEN: +// tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.NOTTAKEN); +// break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.MedicationStatement.MedicationStatusCodes.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/MessageDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageDefinition43_50.java new file mode 100644 index 000000000..f3be9c2eb --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageDefinition43_50.java @@ -0,0 +1,302 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class MessageDefinition43_50 { + + public static org.hl7.fhir.r5.model.MessageDefinition convertMessageDefinition(org.hl7.fhir.r4b.model.MessageDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageDefinition tgt = new org.hl7.fhir.r5.model.MessageDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getReplaces()) + tgt.getReplaces().add(Canonical43_50.convertCanonical(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasBase()) + tgt.setBaseElement(Canonical43_50.convertCanonical(src.getBaseElement())); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getParent()) + tgt.getParent().add(Canonical43_50.convertCanonical(t)); + if (src.hasEvent()) + tgt.setEvent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEvent())); + if (src.hasCategory()) + tgt.setCategoryElement(convertMessageSignificanceCategory(src.getCategoryElement())); + for (org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) + tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + if (src.hasResponseRequired()) + tgt.setResponseRequiredElement(convertMessageheaderResponseRequest(src.getResponseRequiredElement())); + for (org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) + tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getGraph()) tgt.setGraphElement(Canonical43_50.convertCanonical(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MessageDefinition convertMessageDefinition(org.hl7.fhir.r5.model.MessageDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MessageDefinition tgt = new org.hl7.fhir.r4b.model.MessageDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces()) + tgt.getReplaces().add(Canonical43_50.convertCanonical(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasBase()) + tgt.setBaseElement(Canonical43_50.convertCanonical(src.getBaseElement())); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getParent()) + tgt.getParent().add(Canonical43_50.convertCanonical(t)); + if (src.hasEvent()) + tgt.setEvent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEvent())); + if (src.hasCategory()) + tgt.setCategoryElement(convertMessageSignificanceCategory(src.getCategoryElement())); + for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent t : src.getFocus()) + tgt.addFocus(convertMessageDefinitionFocusComponent(t)); + if (src.hasResponseRequired()) + tgt.setResponseRequiredElement(convertMessageheaderResponseRequest(src.getResponseRequiredElement())); + for (org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent t : src.getAllowedResponse()) + tgt.addAllowedResponse(convertMessageDefinitionAllowedResponseComponent(t)); + if (src.hasGraph()) + tgt.getGraph().add(Canonical43_50.convertCanonical(src.getGraphElement())); + return tgt; + } + + static public org.hl7.fhir.r5.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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent convertMessageDefinitionFocusComponent(org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionFocusComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent tgt = new org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertResourceEnum(src.getCodeElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + if (src.hasMin()) + tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionFocusComponent convertMessageDefinitionFocusComponent(org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionFocusComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionFocusComponent tgt = new org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionFocusComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertResourceEnum(src.getCodeElement())); + if (src.hasProfile()) + tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement())); + if (src.hasMin()) + tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent convertMessageDefinitionAllowedResponseComponent(org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionAllowedResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent tgt = new org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMessage()) + tgt.setMessageElement(Canonical43_50.convertCanonical(src.getMessageElement())); + if (src.hasSituation()) + tgt.setSituationElement(MarkDown43_50.convertMarkdown(src.getSituationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionAllowedResponseComponent convertMessageDefinitionAllowedResponseComponent(org.hl7.fhir.r5.model.MessageDefinition.MessageDefinitionAllowedResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionAllowedResponseComponent tgt = new org.hl7.fhir.r4b.model.MessageDefinition.MessageDefinitionAllowedResponseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMessage()) + tgt.setMessageElement(Canonical43_50.convertCanonical(src.getMessageElement())); + if (src.hasSituation()) + tgt.setSituationElement(MarkDown43_50.convertMarkdown(src.getSituationElement())); + 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/MessageHeader43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageHeader43_50.java new file mode 100644 index 000000000..a91585b3d --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/MessageHeader43_50.java @@ -0,0 +1,241 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.ContactPoint43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Id43_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.Url43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class MessageHeader43_50 { + + public static org.hl7.fhir.r5.model.MessageHeader convertMessageHeader(org.hl7.fhir.r4b.model.MessageHeader src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageHeader tgt = new org.hl7.fhir.r5.model.MessageHeader(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasEvent()) + tgt.setEvent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEvent())); + for (org.hl7.fhir.r4b.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) + tgt.addDestination(convertMessageDestinationComponent(t)); + if (src.hasSender()) + tgt.setSender(Reference43_50.convertReference(src.getSender())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + if (src.hasSource()) + tgt.setSource(convertMessageSourceComponent(src.getSource())); + if (src.hasResponsible()) + tgt.setResponsible(Reference43_50.convertReference(src.getResponsible())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + if (src.hasResponse()) + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + for (org.hl7.fhir.r4b.model.Reference t : src.getFocus()) tgt.addFocus(Reference43_50.convertReference(t)); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MessageHeader convertMessageHeader(org.hl7.fhir.r5.model.MessageHeader src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MessageHeader tgt = new org.hl7.fhir.r4b.model.MessageHeader(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasEvent()) + tgt.setEvent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEvent())); + for (org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) + tgt.addDestination(convertMessageDestinationComponent(t)); + if (src.hasSender()) + tgt.setSender(Reference43_50.convertReference(src.getSender())); + if (src.hasEnterer()) + tgt.setEnterer(Reference43_50.convertReference(src.getEnterer())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + if (src.hasSource()) + tgt.setSource(convertMessageSourceComponent(src.getSource())); + if (src.hasResponsible()) + tgt.setResponsible(Reference43_50.convertReference(src.getResponsible())); + if (src.hasReason()) + tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason())); + if (src.hasResponse()) + tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse())); + for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) tgt.addFocus(Reference43_50.convertReference(t)); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent convertMessageDestinationComponent(org.hl7.fhir.r4b.model.MessageHeader.MessageDestinationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTarget()) + tgt.setTarget(Reference43_50.convertReference(src.getTarget())); + if (src.hasEndpoint()) + tgt.setEndpointElement(Url43_50.convertUrl(src.getEndpointElement())); + if (src.hasReceiver()) + tgt.setReceiver(Reference43_50.convertReference(src.getReceiver())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MessageHeader.MessageDestinationComponent convertMessageDestinationComponent(org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MessageHeader.MessageDestinationComponent tgt = new org.hl7.fhir.r4b.model.MessageHeader.MessageDestinationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTarget()) + tgt.setTarget(Reference43_50.convertReference(src.getTarget())); + if (src.hasEndpoint()) + tgt.setEndpointElement(Url43_50.convertUrl(src.getEndpointElement())); + if (src.hasReceiver()) + tgt.setReceiver(Reference43_50.convertReference(src.getReceiver())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent convertMessageSourceComponent(org.hl7.fhir.r4b.model.MessageHeader.MessageSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasSoftware()) + tgt.setSoftwareElement(String43_50.convertString(src.getSoftwareElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasContact()) + tgt.setContact(ContactPoint43_50.convertContactPoint(src.getContact())); + if (src.hasEndpoint()) + tgt.setEndpointElement(Url43_50.convertUrl(src.getEndpointElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MessageHeader.MessageSourceComponent convertMessageSourceComponent(org.hl7.fhir.r5.model.MessageHeader.MessageSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MessageHeader.MessageSourceComponent tgt = new org.hl7.fhir.r4b.model.MessageHeader.MessageSourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasSoftware()) + tgt.setSoftwareElement(String43_50.convertString(src.getSoftwareElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasContact()) + tgt.setContact(ContactPoint43_50.convertContactPoint(src.getContact())); + if (src.hasEndpoint()) + tgt.setEndpointElement(Url43_50.convertUrl(src.getEndpointElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent convertMessageHeaderResponseComponent(org.hl7.fhir.r4b.model.MessageHeader.MessageHeaderResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(new org.hl7.fhir.r5.model.Identifier().setValue(src.getIdentifier())); + if (src.hasCode()) + tgt.setCodeElement(convertResponseType(src.getCodeElement())); + if (src.hasDetails()) + tgt.setDetails(Reference43_50.convertReference(src.getDetails())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.MessageHeader.MessageHeaderResponseComponent convertMessageHeaderResponseComponent(org.hl7.fhir.r5.model.MessageHeader.MessageHeaderResponseComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.MessageHeader.MessageHeaderResponseComponent tgt = new org.hl7.fhir.r4b.model.MessageHeader.MessageHeaderResponseComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifierElement(new org.hl7.fhir.r4b.model.IdType(src.getIdentifier().getValue())); + if (src.hasCode()) + tgt.setCodeElement(convertResponseType(src.getCodeElement())); + if (src.hasDetails()) + tgt.setDetails(Reference43_50.convertReference(src.getDetails())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..e0213c94c --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NamingSystem43_50.java @@ -0,0 +1,242 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +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.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class NamingSystem43_50 { + + public static org.hl7.fhir.r5.model.NamingSystem convertNamingSystem(org.hl7.fhir.r4b.model.NamingSystem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NamingSystem tgt = new org.hl7.fhir.r5.model.NamingSystem(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasKind()) + tgt.setKindElement(convertNamingSystemType(src.getKindElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasResponsible()) + tgt.setResponsibleElement(String43_50.convertString(src.getResponsibleElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + for (org.hl7.fhir.r4b.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) + tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.NamingSystem convertNamingSystem(org.hl7.fhir.r5.model.NamingSystem src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.NamingSystem tgt = new org.hl7.fhir.r4b.model.NamingSystem(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasKind()) + tgt.setKindElement(convertNamingSystemType(src.getKindElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasResponsible()) + tgt.setResponsibleElement(String43_50.convertString(src.getResponsibleElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + for (org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId()) + tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r4b.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertNamingSystemIdentifierType(src.getTypeElement())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasPreferred()) + tgt.setPreferredElement(Boolean43_50.convertBoolean(src.getPreferredElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.r5.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.NamingSystem.NamingSystemUniqueIdComponent tgt = new org.hl7.fhir.r4b.model.NamingSystem.NamingSystemUniqueIdComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertNamingSystemIdentifierType(src.getTypeElement())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasPreferred()) + tgt.setPreferredElement(Boolean43_50.convertBoolean(src.getPreferredElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..f5f13f63f --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/NutritionOrder43_50.java @@ -0,0 +1,470 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +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.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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class NutritionOrder43_50 { + + public static org.hl7.fhir.r5.model.NutritionOrder convertNutritionOrder(org.hl7.fhir.r4b.model.NutritionOrder src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder tgt = new org.hl7.fhir.r5.model.NutritionOrder(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiates()) tgt.getInstantiates().add(Uri43_50.convertUri(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertNutritionOrderStatus(src.getStatusElement())); + if (src.hasIntent()) + tgt.setIntentElement(convertNutritiionOrderIntent(src.getIntentElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasDateTime()) + tgt.setDateTimeElement(DateTime43_50.convertDateTime(src.getDateTimeElement())); + if (src.hasOrderer()) + tgt.setOrderer(Reference43_50.convertReference(src.getOrderer())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAllergyIntolerance()) + tgt.addAllergyIntolerance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getFoodPreferenceModifier()) + tgt.addFoodPreferenceModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getExcludeFoodModifier()) + tgt.addExcludeFoodModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOralDiet()) + tgt.setOralDiet(convertNutritionOrderOralDietComponent(src.getOralDiet())); + for (org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderSupplementComponent t : src.getSupplement()) + tgt.addSupplement(convertNutritionOrderSupplementComponent(t)); + if (src.hasEnteralFormula()) + tgt.setEnteralFormula(convertNutritionOrderEnteralFormulaComponent(src.getEnteralFormula())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.NutritionOrder convertNutritionOrder(org.hl7.fhir.r5.model.NutritionOrder src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.NutritionOrder tgt = new org.hl7.fhir.r4b.model.NutritionOrder(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiates()) tgt.getInstantiates().add(Uri43_50.convertUri(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertNutritionOrderStatus(src.getStatusElement())); + if (src.hasIntent()) + tgt.setIntentElement(convertNutritiionOrderIntent(src.getIntentElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasDateTime()) + tgt.setDateTimeElement(DateTime43_50.convertDateTime(src.getDateTimeElement())); + if (src.hasOrderer()) + tgt.setOrderer(Reference43_50.convertReference(src.getOrderer())); + for (org.hl7.fhir.r5.model.Reference t : src.getAllergyIntolerance()) + tgt.addAllergyIntolerance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFoodPreferenceModifier()) + tgt.addFoodPreferenceModifier(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getExcludeFoodModifier()) + tgt.addExcludeFoodModifier(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOralDiet()) + tgt.setOralDiet(convertNutritionOrderOralDietComponent(src.getOralDiet())); + for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent t : src.getSupplement()) + tgt.addSupplement(convertNutritionOrderSupplementComponent(t)); + if (src.hasEnteralFormula()) + tgt.setEnteralFormula(convertNutritionOrderEnteralFormulaComponent(src.getEnteralFormula())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent convertNutritionOrderOralDietComponent(org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Timing t : src.getSchedule()) tgt.addSchedule(Timing43_50.convertTiming(t)); + for (org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietNutrientComponent t : src.getNutrient()) + tgt.addNutrient(convertNutritionOrderOralDietNutrientComponent(t)); + for (org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietTextureComponent t : src.getTexture()) + tgt.addTexture(convertNutritionOrderOralDietTextureComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getFluidConsistencyType()) + tgt.addFluidConsistencyType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasInstruction()) + tgt.setInstructionElement(String43_50.convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietComponent convertNutritionOrderOralDietComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietComponent tgt = new org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Timing t : src.getSchedule()) tgt.addSchedule(Timing43_50.convertTiming(t)); + for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent t : src.getNutrient()) + tgt.addNutrient(convertNutritionOrderOralDietNutrientComponent(t)); + for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent t : src.getTexture()) + tgt.addTexture(convertNutritionOrderOralDietTextureComponent(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFluidConsistencyType()) + tgt.addFluidConsistencyType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasInstruction()) + tgt.setInstructionElement(String43_50.convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent convertNutritionOrderOralDietNutrientComponent(org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietNutrientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasModifier()) + tgt.setModifier(CodeableConcept43_50.convertCodeableConcept(src.getModifier())); + if (src.hasAmount()) + tgt.setAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietNutrientComponent convertNutritionOrderOralDietNutrientComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietNutrientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietNutrientComponent tgt = new org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietNutrientComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasModifier()) + tgt.setModifier(CodeableConcept43_50.convertCodeableConcept(src.getModifier())); + if (src.hasAmount()) + tgt.setAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getAmount())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent convertNutritionOrderOralDietTextureComponent(org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietTextureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasModifier()) + tgt.setModifier(CodeableConcept43_50.convertCodeableConcept(src.getModifier())); + if (src.hasFoodType()) + tgt.setFoodType(CodeableConcept43_50.convertCodeableConcept(src.getFoodType())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietTextureComponent convertNutritionOrderOralDietTextureComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderOralDietTextureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietTextureComponent tgt = new org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderOralDietTextureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasModifier()) + tgt.setModifier(CodeableConcept43_50.convertCodeableConcept(src.getModifier())); + if (src.hasFoodType()) + tgt.setFoodType(CodeableConcept43_50.convertCodeableConcept(src.getFoodType())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent convertNutritionOrderSupplementComponent(org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderSupplementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasProductName()) + tgt.setProductNameElement(String43_50.convertString(src.getProductNameElement())); + for (org.hl7.fhir.r4b.model.Timing t : src.getSchedule()) tgt.addSchedule(Timing43_50.convertTiming(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasInstruction()) + tgt.setInstructionElement(String43_50.convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderSupplementComponent convertNutritionOrderSupplementComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderSupplementComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderSupplementComponent tgt = new org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderSupplementComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasProductName()) + tgt.setProductNameElement(String43_50.convertString(src.getProductNameElement())); + for (org.hl7.fhir.r5.model.Timing t : src.getSchedule()) tgt.addSchedule(Timing43_50.convertTiming(t)); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasInstruction()) + tgt.setInstructionElement(String43_50.convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent convertNutritionOrderEnteralFormulaComponent(org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderEnteralFormulaComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasBaseFormulaType()) + tgt.setBaseFormulaType(CodeableConcept43_50.convertCodeableConcept(src.getBaseFormulaType())); + if (src.hasBaseFormulaProductName()) + tgt.setBaseFormulaProductNameElement(String43_50.convertString(src.getBaseFormulaProductNameElement())); + if (src.hasAdditiveType()) + tgt.setAdditiveType(CodeableConcept43_50.convertCodeableConcept(src.getAdditiveType())); + if (src.hasAdditiveProductName()) + tgt.setAdditiveProductNameElement(String43_50.convertString(src.getAdditiveProductNameElement())); + if (src.hasCaloricDensity()) + tgt.setCaloricDensity(SimpleQuantity43_50.convertSimpleQuantity(src.getCaloricDensity())); + if (src.hasRouteofAdministration()) + tgt.setRouteofAdministration(CodeableConcept43_50.convertCodeableConcept(src.getRouteofAdministration())); + for (org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent t : src.getAdministration()) + tgt.addAdministration(convertNutritionOrderEnteralFormulaAdministrationComponent(t)); + if (src.hasMaxVolumeToDeliver()) + tgt.setMaxVolumeToDeliver(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxVolumeToDeliver())); + if (src.hasAdministrationInstruction()) + tgt.setAdministrationInstructionElement(String43_50.convertString(src.getAdministrationInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderEnteralFormulaComponent convertNutritionOrderEnteralFormulaComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderEnteralFormulaComponent tgt = new org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderEnteralFormulaComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasBaseFormulaType()) + tgt.setBaseFormulaType(CodeableConcept43_50.convertCodeableConcept(src.getBaseFormulaType())); + if (src.hasBaseFormulaProductName()) + tgt.setBaseFormulaProductNameElement(String43_50.convertString(src.getBaseFormulaProductNameElement())); + if (src.hasAdditiveType()) + tgt.setAdditiveType(CodeableConcept43_50.convertCodeableConcept(src.getAdditiveType())); + if (src.hasAdditiveProductName()) + tgt.setAdditiveProductNameElement(String43_50.convertString(src.getAdditiveProductNameElement())); + if (src.hasCaloricDensity()) + tgt.setCaloricDensity(SimpleQuantity43_50.convertSimpleQuantity(src.getCaloricDensity())); + if (src.hasRouteofAdministration()) + tgt.setRouteofAdministration(CodeableConcept43_50.convertCodeableConcept(src.getRouteofAdministration())); + for (org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent t : src.getAdministration()) + tgt.addAdministration(convertNutritionOrderEnteralFormulaAdministrationComponent(t)); + if (src.hasMaxVolumeToDeliver()) + tgt.setMaxVolumeToDeliver(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxVolumeToDeliver())); + if (src.hasAdministrationInstruction()) + tgt.setAdministrationInstructionElement(String43_50.convertString(src.getAdministrationInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent convertNutritionOrderEnteralFormulaAdministrationComponent(org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent tgt = new org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSchedule()) + tgt.setSchedule(Timing43_50.convertTiming(src.getSchedule())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasRate()) + tgt.setRate(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getRate())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent convertNutritionOrderEnteralFormulaAdministrationComponent(org.hl7.fhir.r5.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent tgt = new org.hl7.fhir.r4b.model.NutritionOrder.NutritionOrderEnteralFormulaAdministrationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSchedule()) + tgt.setSchedule(Timing43_50.convertTiming(src.getSchedule())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasRate()) + tgt.setRate(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getRate())); + 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/Observation43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Observation43_50.java new file mode 100644 index 000000000..3535f3885 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Observation43_50.java @@ -0,0 +1,290 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Observation43_50 { + + public static org.hl7.fhir.r5.model.Observation convertObservation(org.hl7.fhir.r4b.model.Observation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Observation tgt = new org.hl7.fhir.r5.model.Observation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertObservationStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + for (org.hl7.fhir.r4b.model.Reference t : src.getFocus()) tgt.addFocus(Reference43_50.convertReference(t)); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective())); + if (src.hasIssued()) + tgt.setIssuedElement(Instant43_50.convertInstant(src.getIssuedElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t)); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(CodeableConcept43_50.convertCodeableConcept(src.getDataAbsentReason())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getInterpretation()) + tgt.addInterpretation(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.hasSpecimen()) + tgt.setSpecimen(Reference43_50.convertReference(src.getSpecimen())); + if (src.hasDevice()) + tgt.setDevice(Reference43_50.convertReference(src.getDevice())); + for (org.hl7.fhir.r4b.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) + tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getHasMember()) tgt.addHasMember(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getDerivedFrom()) + tgt.addDerivedFrom(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Observation.ObservationComponentComponent t : src.getComponent()) + tgt.addComponent(convertObservationComponentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Observation convertObservation(org.hl7.fhir.r5.model.Observation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Observation tgt = new org.hl7.fhir.r4b.model.Observation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertObservationStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + for (org.hl7.fhir.r5.model.Reference t : src.getFocus()) tgt.addFocus(Reference43_50.convertReference(t)); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasEffective()) + tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective())); + if (src.hasIssued()) + tgt.setIssuedElement(Instant43_50.convertInstant(src.getIssuedElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t)); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(CodeableConcept43_50.convertCodeableConcept(src.getDataAbsentReason())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getInterpretation()) + tgt.addInterpretation(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasBodySite()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.hasSpecimen()) + tgt.setSpecimen(Reference43_50.convertReference(src.getSpecimen())); + if (src.hasDevice()) + tgt.setDevice(Reference43_50.convertReference(src.getDevice())); + for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) + tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getHasMember()) tgt.addHasMember(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom()) + tgt.addDerivedFrom(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Observation.ObservationComponentComponent t : src.getComponent()) + tgt.addComponent(convertObservationComponentComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.r4b.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLow()) + tgt.setLow(SimpleQuantity43_50.convertSimpleQuantity(src.getLow())); + if (src.hasHigh()) + tgt.setHigh(SimpleQuantity43_50.convertSimpleQuantity(src.getHigh())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getAppliesTo()) + tgt.addAppliesTo(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasAge()) + tgt.setAge(Range43_50.convertRange(src.getAge())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Observation.ObservationReferenceRangeComponent tgt = new org.hl7.fhir.r4b.model.Observation.ObservationReferenceRangeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLow()) + tgt.setLow(SimpleQuantity43_50.convertSimpleQuantity(src.getLow())); + if (src.hasHigh()) + tgt.setHigh(SimpleQuantity43_50.convertSimpleQuantity(src.getHigh())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAppliesTo()) + tgt.addAppliesTo(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasAge()) + tgt.setAge(Range43_50.convertRange(src.getAge())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Observation.ObservationComponentComponent convertObservationComponentComponent(org.hl7.fhir.r4b.model.Observation.ObservationComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.r5.model.Observation.ObservationComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(CodeableConcept43_50.convertCodeableConcept(src.getDataAbsentReason())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getInterpretation()) + tgt.addInterpretation(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) + tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Observation.ObservationComponentComponent convertObservationComponentComponent(org.hl7.fhir.r5.model.Observation.ObservationComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Observation.ObservationComponentComponent tgt = new org.hl7.fhir.r4b.model.Observation.ObservationComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasDataAbsentReason()) + tgt.setDataAbsentReason(CodeableConcept43_50.convertCodeableConcept(src.getDataAbsentReason())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getInterpretation()) + tgt.addInterpretation(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Observation.ObservationReferenceRangeComponent t : src.getReferenceRange()) + tgt.addReferenceRange(convertObservationReferenceRangeComponent(t)); + 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/ObservationDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ObservationDefinition43_50.java new file mode 100644 index 000000000..f3030b6eb --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ObservationDefinition43_50.java @@ -0,0 +1,326 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50; +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 java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ObservationDefinition43_50 { + + public static org.hl7.fhir.r5.model.ObservationDefinition convertObservationDefinition(org.hl7.fhir.r4b.model.ObservationDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ObservationDefinition tgt = new org.hl7.fhir.r5.model.ObservationDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(t)); + tgt.setPermittedDataType(src.getPermittedDataType().stream() + .map(ObservationDefinition43_50::convertObservationDataType) + .collect(Collectors.toList())); + if (src.hasMultipleResultsAllowed()) + tgt.setMultipleResultsAllowedElement(Boolean43_50.convertBoolean(src.getMultipleResultsAllowedElement())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.hasPreferredReportName()) + tgt.setPreferredReportNameElement(String43_50.convertString(src.getPreferredReportNameElement())); + if (src.hasQuantitativeDetails()) + tgt.setQuantitativeDetails(convertObservationDefinitionQuantitativeDetailsComponent(src.getQuantitativeDetails())); +// for (org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent t : src.getQualifiedInterval()) tgt.addQualifiedInterval(convertObservationDefinitionQualifiedIntervalComponent(t)); +// if (src.hasValidCodedValueSet()) +// tgt.setValidCodedValueSet(convertReference(src.getValidCodedValueSet())); +// if (src.hasNormalCodedValueSet()) +// tgt.setNormalCodedValueSet(convertReference(src.getNormalCodedValueSet())); +// if (src.hasAbnormalCodedValueSet()) +// tgt.setAbnormalCodedValueSet(convertReference(src.getAbnormalCodedValueSet())); +// if (src.hasCriticalCodedValueSet()) +// tgt.setCriticalCodedValueSet(convertReference(src.getCriticalCodedValueSet())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ObservationDefinition convertObservationDefinition(org.hl7.fhir.r5.model.ObservationDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ObservationDefinition tgt = new org.hl7.fhir.r4b.model.ObservationDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + tgt.setPermittedDataType(src.getPermittedDataType().stream() + .map(ObservationDefinition43_50::convertObservationDataType) + .collect(Collectors.toList())); + if (src.hasMultipleResultsAllowed()) + tgt.setMultipleResultsAllowedElement(Boolean43_50.convertBoolean(src.getMultipleResultsAllowedElement())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.hasPreferredReportName()) + tgt.setPreferredReportNameElement(String43_50.convertString(src.getPreferredReportNameElement())); + if (src.hasQuantitativeDetails()) + tgt.setQuantitativeDetails(convertObservationDefinitionQuantitativeDetailsComponent(src.getQuantitativeDetails())); +// for (org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent t : src.getQualifiedInterval()) tgt.addQualifiedInterval(convertObservationDefinitionQualifiedIntervalComponent(t)); +// if (src.hasValidCodedValueSet()) +// tgt.setValidCodedValueSet(convertReference(src.getValidCodedValueSet())); +// if (src.hasNormalCodedValueSet()) +// tgt.setNormalCodedValueSet(convertReference(src.getNormalCodedValueSet())); +// if (src.hasAbnormalCodedValueSet()) +// tgt.setAbnormalCodedValueSet(convertReference(src.getAbnormalCodedValueSet())); +// if (src.hasCriticalCodedValueSet()) +// tgt.setCriticalCodedValueSet(convertReference(src.getCriticalCodedValueSet())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent convertObservationDefinitionQuantitativeDetailsComponent(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent tgt = new org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCustomaryUnit()) + tgt.setCustomaryUnit(CodeableConcept43_50.convertCodeableConcept(src.getCustomaryUnit())); + if (src.hasUnit()) + tgt.setUnit(CodeableConcept43_50.convertCodeableConcept(src.getUnit())); + if (src.hasConversionFactor()) + tgt.setConversionFactorElement(Decimal43_50.convertDecimal(src.getConversionFactorElement())); + if (src.hasDecimalPrecision()) + tgt.setDecimalPrecisionElement(Integer43_50.convertInteger(src.getDecimalPrecisionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent convertObservationDefinitionQuantitativeDetailsComponent(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent tgt = new org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDefinitionQuantitativeDetailsComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCustomaryUnit()) + tgt.setCustomaryUnit(CodeableConcept43_50.convertCodeableConcept(src.getCustomaryUnit())); + if (src.hasUnit()) + tgt.setUnit(CodeableConcept43_50.convertCodeableConcept(src.getUnit())); + if (src.hasConversionFactor()) + tgt.setConversionFactorElement(Decimal43_50.convertDecimal(src.getConversionFactorElement())); + if (src.hasDecimalPrecision()) + tgt.setDecimalPrecisionElement(Integer43_50.convertInteger(src.getDecimalPrecisionElement())); + return tgt; + } + +// public static org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent convertObservationDefinitionQualifiedIntervalComponent(org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent tgt = new org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent(); +// copyElement(src, tgt); +// if (src.hasCategory()) +// tgt.setCategoryElement(convertObservationRangeCategory(src.getCategoryElement())); +// if (src.hasRange()) +// tgt.setRange(convertRange(src.getRange())); +// if (src.hasContext()) +// tgt.setContext(convertCodeableConcept(src.getContext())); +// for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(convertCodeableConcept(t)); +// if (src.hasGender()) +// tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); +// if (src.hasAge()) +// tgt.setAge(convertRange(src.getAge())); +// if (src.hasGestationalAge()) +// tgt.setGestationalAge(convertRange(src.getGestationalAge())); +// if (src.hasCondition()) +// tgt.setConditionElement(convertString(src.getConditionElement())); +// return tgt; +// } +// +// public static org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent convertObservationDefinitionQualifiedIntervalComponent(org.hl7.fhir.r5.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent src) throws FHIRException { +// if (src == null) +// return null; +// org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent tgt = new org.hl7.fhir.r4b.model.ObservationDefinition.ObservationDefinitionQualifiedIntervalComponent(); +// copyElement(src, tgt); +// if (src.hasCategory()) +// tgt.setCategoryElement(convertObservationRangeCategory(src.getCategoryElement())); +// if (src.hasRange()) +// tgt.setRange(convertRange(src.getRange())); +// if (src.hasContext()) +// tgt.setContext(convertCodeableConcept(src.getContext())); +// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAppliesTo()) tgt.addAppliesTo(convertCodeableConcept(t)); +// if (src.hasGender()) +// tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); +// if (src.hasAge()) +// tgt.setAge(convertRange(src.getAge())); +// if (src.hasGestationalAge()) +// tgt.setGestationalAge(convertRange(src.getGestationalAge())); +// if (src.hasCondition()) +// tgt.setConditionElement(convertString(src.getConditionElement())); +// return tgt; +// } + + static public org.hl7.fhir.r5.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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..2e9a44de6 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationDefinition43_50.java @@ -0,0 +1,367 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeType; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class OperationDefinition43_50 { + + public static org.hl7.fhir.r5.model.OperationDefinition convertOperationDefinition(org.hl7.fhir.r4b.model.OperationDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition tgt = new org.hl7.fhir.r5.model.OperationDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasKind()) + tgt.setKindElement(convertOperationKind(src.getKindElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasAffectsState()) + tgt.setAffectsStateElement(Boolean43_50.convertBoolean(src.getAffectsStateElement())); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasComment()) + tgt.setCommentElement(MarkDown43_50.convertMarkdown(src.getCommentElement())); + if (src.hasBase()) + tgt.setBaseElement(Canonical43_50.convertCanonical(src.getBaseElement())); + for (org.hl7.fhir.r4b.model.CodeType t : src.getResource()) tgt.getResource().add(Code43_50.convertResourceEnum(t)); + if (src.hasSystem()) + tgt.setSystemElement(Boolean43_50.convertBoolean(src.getSystemElement())); + if (src.hasType()) + tgt.setTypeElement(Boolean43_50.convertBoolean(src.getTypeElement())); + if (src.hasInstance()) + tgt.setInstanceElement(Boolean43_50.convertBoolean(src.getInstanceElement())); + if (src.hasInputProfile()) + tgt.setInputProfileElement(Canonical43_50.convertCanonical(src.getInputProfileElement())); + if (src.hasOutputProfile()) + tgt.setOutputProfileElement(Canonical43_50.convertCanonical(src.getOutputProfileElement())); + for (org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) + tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + for (org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) + tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.OperationDefinition convertOperationDefinition(org.hl7.fhir.r5.model.OperationDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.OperationDefinition tgt = new org.hl7.fhir.r4b.model.OperationDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasKind()) + tgt.setKindElement(convertOperationKind(src.getKindElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasAffectsState()) + tgt.setAffectsStateElement(Boolean43_50.convertBoolean(src.getAffectsStateElement())); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasComment()) + tgt.setCommentElement(MarkDown43_50.convertMarkdown(src.getCommentElement())); + if (src.hasBase()) + tgt.setBaseElement(Canonical43_50.convertCanonical(src.getBaseElement())); + for (CodeType t : src.getResource()) tgt.getResource().add(Code43_50.convertResourceEnum(t)); + if (src.hasSystem()) + tgt.setSystemElement(Boolean43_50.convertBoolean(src.getSystemElement())); + if (src.hasType()) + tgt.setTypeElement(Boolean43_50.convertBoolean(src.getTypeElement())); + if (src.hasInstance()) + tgt.setInstanceElement(Boolean43_50.convertBoolean(src.getInstanceElement())); + if (src.hasInputProfile()) + tgt.setInputProfileElement(Canonical43_50.convertCanonical(src.getInputProfileElement())); + if (src.hasOutputProfile()) + tgt.setOutputProfileElement(Canonical43_50.convertCanonical(src.getOutputProfileElement())); + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getParameter()) + tgt.addParameter(convertOperationDefinitionParameterComponent(t)); + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent t : src.getOverload()) + tgt.addOverload(convertOperationDefinitionOverloadComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent convertOperationDefinitionParameterComponent(org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Code43_50.convertCode(src.getNameElement())); + if (src.hasUse()) + tgt.setUseElement(convertOperationParameterUse(src.getUseElement())); + if (src.hasMin()) + tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + if (src.hasType()) + tgt.getTypeElement().setValue(org.hl7.fhir.r5.model.Enumerations.FHIRAllTypes.fromCode(src.getType().toCode())); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getTargetProfile()) + tgt.getTargetProfile().add(Canonical43_50.convertCanonical(t)); + if (src.hasSearchType()) + tgt.setSearchTypeElement(Enumerations43_50.convertSearchParamType(src.getSearchTypeElement())); + if (src.hasBinding()) + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + for (org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent t : src.getReferencedFrom()) + tgt.addReferencedFrom(convertOperationDefinitionParameterReferencedFromComponent(t)); + for (org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) + tgt.addPart(convertOperationDefinitionParameterComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterComponent convertOperationDefinitionParameterComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterComponent tgt = new org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Code43_50.convertCode(src.getNameElement())); + if (src.hasUse()) + tgt.setUseElement(convertOperationParameterUse(src.getUseElement())); + if (src.hasMin()) + tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + if (src.hasType()) + tgt.getTypeElement().setValueAsString(src.getType().toCode()); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getTargetProfile()) + tgt.getTargetProfile().add(Canonical43_50.convertCanonical(t)); + if (src.hasSearchType()) + tgt.setSearchTypeElement(Enumerations43_50.convertSearchParamType(src.getSearchTypeElement())); + if (src.hasBinding()) + tgt.setBinding(convertOperationDefinitionParameterBindingComponent(src.getBinding())); + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent t : src.getReferencedFrom()) + tgt.addReferencedFrom(convertOperationDefinitionParameterReferencedFromComponent(t)); + for (org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterComponent t : src.getPart()) + tgt.addPart(convertOperationDefinitionParameterComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasStrength()) + tgt.setStrengthElement(Enumerations43_50.convertBindingStrength(src.getStrengthElement())); + if (src.hasValueSet()) + tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt = new org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterBindingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasStrength()) + tgt.setStrengthElement(Enumerations43_50.convertBindingStrength(src.getStrengthElement())); + if (src.hasValueSet()) + tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent convertOperationDefinitionParameterReferencedFromComponent(org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSource()) + tgt.setSourceElement(String43_50.convertString(src.getSourceElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(String43_50.convertString(src.getSourceIdElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent convertOperationDefinitionParameterReferencedFromComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent tgt = new org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionParameterReferencedFromComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSource()) + tgt.setSourceElement(String43_50.convertString(src.getSourceElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(String43_50.convertString(src.getSourceIdElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent convertOperationDefinitionOverloadComponent(org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionOverloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.StringType t : src.getParameterName()) + tgt.getParameterName().add(String43_50.convertString(t)); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionOverloadComponent convertOperationDefinitionOverloadComponent(org.hl7.fhir.r5.model.OperationDefinition.OperationDefinitionOverloadComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionOverloadComponent tgt = new org.hl7.fhir.r4b.model.OperationDefinition.OperationDefinitionOverloadComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.StringType t : src.getParameterName()) + tgt.getParameterName().add(String43_50.convertString(t)); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + 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/OperationOutcome43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationOutcome43_50.java new file mode 100644 index 000000000..58b80df1a --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OperationOutcome43_50.java @@ -0,0 +1,358 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class OperationOutcome43_50 { + + public static org.hl7.fhir.r5.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.r4b.model.OperationOutcome src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationOutcome tgt = new org.hl7.fhir.r5.model.OperationOutcome(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) + tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.r5.model.OperationOutcome src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.OperationOutcome tgt = new org.hl7.fhir.r4b.model.OperationOutcome(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue()) + tgt.addIssue(convertOperationOutcomeIssueComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent convertOperationOutcomeIssueComponent(org.hl7.fhir.r4b.model.OperationOutcome.OperationOutcomeIssueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSeverity()) + tgt.setSeverityElement(convertIssueSeverity(src.getSeverityElement())); + if (src.hasCode()) + tgt.setCodeElement(convertIssueType(src.getCodeElement())); + if (src.hasDetails()) + tgt.setDetails(CodeableConcept43_50.convertCodeableConcept(src.getDetails())); + if (src.hasDiagnostics()) + tgt.setDiagnosticsElement(String43_50.convertString(src.getDiagnosticsElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getLocation()) tgt.getLocation().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getExpression()) + tgt.getExpression().add(String43_50.convertString(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.OperationOutcome.OperationOutcomeIssueComponent convertOperationOutcomeIssueComponent(org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.OperationOutcome.OperationOutcomeIssueComponent tgt = new org.hl7.fhir.r4b.model.OperationOutcome.OperationOutcomeIssueComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSeverity()) + tgt.setSeverityElement(convertIssueSeverity(src.getSeverityElement())); + if (src.hasCode()) + tgt.setCodeElement(convertIssueType(src.getCodeElement())); + if (src.hasDetails()) + tgt.setDetails(CodeableConcept43_50.convertCodeableConcept(src.getDetails())); + if (src.hasDiagnostics()) + tgt.setDiagnosticsElement(String43_50.convertString(src.getDiagnosticsElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getLocation()) tgt.getLocation().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getExpression()) + tgt.getExpression().add(String43_50.convertString(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } +} \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Organization43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Organization43_50.java new file mode 100644 index 000000000..38c153746 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Organization43_50.java @@ -0,0 +1,122 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Organization43_50 { + + public static org.hl7.fhir.r5.model.Organization convertOrganization(org.hl7.fhir.r4b.model.Organization src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Organization tgt = new org.hl7.fhir.r5.model.Organization(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r4b.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + if (src.hasPartOf()) + tgt.setPartOf(Reference43_50.convertReference(src.getPartOf())); + for (org.hl7.fhir.r4b.model.Organization.OrganizationContactComponent t : src.getContact()) + tgt.addContact(convertOrganizationContactComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Organization convertOrganization(org.hl7.fhir.r5.model.Organization src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Organization tgt = new org.hl7.fhir.r4b.model.Organization(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + if (src.hasPartOf()) + tgt.setPartOf(Reference43_50.convertReference(src.getPartOf())); + for (org.hl7.fhir.r5.model.ExtendedContactDetail t : src.getContact()) + tgt.addContact(convertOrganizationContactComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ExtendedContactDetail convertOrganizationContactComponent(org.hl7.fhir.r4b.model.Organization.OrganizationContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ExtendedContactDetail tgt = new org.hl7.fhir.r5.model.ExtendedContactDetail(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPurpose()) + tgt.setPurpose(CodeableConcept43_50.convertCodeableConcept(src.getPurpose())); + if (src.hasName()) + tgt.setName(HumanName43_50.convertHumanName(src.getName())); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasAddress()) + tgt.setAddress(Address43_50.convertAddress(src.getAddress())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Organization.OrganizationContactComponent convertOrganizationContactComponent(org.hl7.fhir.r5.model.ExtendedContactDetail src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Organization.OrganizationContactComponent tgt = new org.hl7.fhir.r4b.model.Organization.OrganizationContactComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasPurpose()) + tgt.setPurpose(CodeableConcept43_50.convertCodeableConcept(src.getPurpose())); + if (src.hasName()) + tgt.setName(HumanName43_50.convertHumanName(src.getName())); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasAddress()) + tgt.setAddress(Address43_50.convertAddress(src.getAddress())); + 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/OrganizationAffiliation43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OrganizationAffiliation43_50.java new file mode 100644 index 000000000..0c0688e4e --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/OrganizationAffiliation43_50.java @@ -0,0 +1,100 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.ContactPoint43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class OrganizationAffiliation43_50 { + + public static org.hl7.fhir.r5.model.OrganizationAffiliation convertOrganizationAffiliation(org.hl7.fhir.r4b.model.OrganizationAffiliation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.OrganizationAffiliation tgt = new org.hl7.fhir.r5.model.OrganizationAffiliation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasOrganization()) + tgt.setOrganization(Reference43_50.convertReference(src.getOrganization())); + if (src.hasParticipatingOrganization()) + tgt.setParticipatingOrganization(Reference43_50.convertReference(src.getParticipatingOrganization())); + for (org.hl7.fhir.r4b.model.Reference t : src.getNetwork()) tgt.addNetwork(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getLocation()) tgt.addLocation(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getHealthcareService()) + tgt.addHealthcareService(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.OrganizationAffiliation convertOrganizationAffiliation(org.hl7.fhir.r5.model.OrganizationAffiliation src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.OrganizationAffiliation tgt = new org.hl7.fhir.r4b.model.OrganizationAffiliation(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasOrganization()) + tgt.setOrganization(Reference43_50.convertReference(src.getOrganization())); + if (src.hasParticipatingOrganization()) + tgt.setParticipatingOrganization(Reference43_50.convertReference(src.getParticipatingOrganization())); + for (org.hl7.fhir.r5.model.Reference t : src.getNetwork()) tgt.addNetwork(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getHealthcareService()) + tgt.addHealthcareService(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + 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/Parameters43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Parameters43_50.java new file mode 100644 index 000000000..5d4bcf9a5 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Parameters43_50.java @@ -0,0 +1,89 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Parameters43_50 { + + public static org.hl7.fhir.r5.model.Parameters convertParameters(org.hl7.fhir.r4b.model.Parameters src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Parameters tgt = new org.hl7.fhir.r5.model.Parameters(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt); + for (org.hl7.fhir.r4b.model.Parameters.ParametersParameterComponent t : src.getParameter()) + tgt.addParameter(convertParametersParameterComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Parameters convertParameters(org.hl7.fhir.r5.model.Parameters src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Parameters tgt = new org.hl7.fhir.r4b.model.Parameters(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt); + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getParameter()) + tgt.addParameter(convertParametersParameterComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.r4b.model.Parameters.ParametersParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasResource()) + tgt.setResource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getResource())); + for (org.hl7.fhir.r4b.model.Parameters.ParametersParameterComponent t : src.getPart()) + tgt.addPart(convertParametersParameterComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Parameters.ParametersParameterComponent tgt = new org.hl7.fhir.r4b.model.Parameters.ParametersParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasResource()) + tgt.setResource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getResource())); + for (org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent t : src.getPart()) + tgt.addPart(convertParametersParameterComponent(t)); + 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 new file mode 100644 index 000000000..cb053bf4c --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Patient43_50.java @@ -0,0 +1,256 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Patient43_50 { + + public static org.hl7.fhir.r5.model.Patient convertPatient(org.hl7.fhir.r4b.model.Patient src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Patient tgt = new org.hl7.fhir.r5.model.Patient(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r4b.model.HumanName t : src.getName()) tgt.addName(HumanName43_50.convertHumanName(t)); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(Date43_50.convertDate(src.getBirthDateElement())); + if (src.hasDeceased()) + tgt.setDeceased(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDeceased())); + for (org.hl7.fhir.r4b.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + if (src.hasMaritalStatus()) + tgt.setMaritalStatus(CodeableConcept43_50.convertCodeableConcept(src.getMaritalStatus())); + if (src.hasMultipleBirth()) + tgt.setMultipleBirth(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMultipleBirth())); + for (org.hl7.fhir.r4b.model.Attachment t : src.getPhoto()) tgt.addPhoto(Attachment43_50.convertAttachment(t)); + for (org.hl7.fhir.r4b.model.Patient.ContactComponent t : src.getContact()) + tgt.addContact(convertContactComponent(t)); + for (org.hl7.fhir.r4b.model.Patient.PatientCommunicationComponent t : src.getCommunication()) + tgt.addCommunication(convertPatientCommunicationComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getGeneralPractitioner()) + tgt.addGeneralPractitioner(Reference43_50.convertReference(t)); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + for (org.hl7.fhir.r4b.model.Patient.PatientLinkComponent t : src.getLink()) + tgt.addLink(convertPatientLinkComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Patient convertPatient(org.hl7.fhir.r5.model.Patient src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Patient tgt = new org.hl7.fhir.r4b.model.Patient(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(HumanName43_50.convertHumanName(t)); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(Date43_50.convertDate(src.getBirthDateElement())); + if (src.hasDeceased()) + tgt.setDeceased(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDeceased())); + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + if (src.hasMaritalStatus()) + tgt.setMaritalStatus(CodeableConcept43_50.convertCodeableConcept(src.getMaritalStatus())); + if (src.hasMultipleBirth()) + tgt.setMultipleBirth(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMultipleBirth())); + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(Attachment43_50.convertAttachment(t)); + for (org.hl7.fhir.r5.model.Patient.ContactComponent t : src.getContact()) + tgt.addContact(convertContactComponent(t)); + for (org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent t : src.getCommunication()) + tgt.addCommunication(convertPatientCommunicationComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getGeneralPractitioner()) + tgt.addGeneralPractitioner(Reference43_50.convertReference(t)); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + for (org.hl7.fhir.r5.model.Patient.PatientLinkComponent t : src.getLink()) + tgt.addLink(convertPatientLinkComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Patient.ContactComponent convertContactComponent(org.hl7.fhir.r4b.model.Patient.ContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Patient.ContactComponent tgt = new org.hl7.fhir.r5.model.Patient.ContactComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getRelationship()) + tgt.addRelationship(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasName()) + tgt.setName(HumanName43_50.convertHumanName(src.getName())); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasAddress()) + tgt.setAddress(Address43_50.convertAddress(src.getAddress())); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasOrganization()) + tgt.setOrganization(Reference43_50.convertReference(src.getOrganization())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Patient.ContactComponent convertContactComponent(org.hl7.fhir.r5.model.Patient.ContactComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Patient.ContactComponent tgt = new org.hl7.fhir.r4b.model.Patient.ContactComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) + tgt.addRelationship(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasName()) + tgt.setName(HumanName43_50.convertHumanName(src.getName())); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasAddress()) + tgt.setAddress(Address43_50.convertAddress(src.getAddress())); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasOrganization()) + tgt.setOrganization(Reference43_50.convertReference(src.getOrganization())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent convertPatientCommunicationComponent(org.hl7.fhir.r4b.model.Patient.PatientCommunicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage())); + if (src.hasPreferred()) + tgt.setPreferredElement(Boolean43_50.convertBoolean(src.getPreferredElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Patient.PatientCommunicationComponent convertPatientCommunicationComponent(org.hl7.fhir.r5.model.Patient.PatientCommunicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Patient.PatientCommunicationComponent tgt = new org.hl7.fhir.r4b.model.Patient.PatientCommunicationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage())); + if (src.hasPreferred()) + tgt.setPreferredElement(Boolean43_50.convertBoolean(src.getPreferredElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Patient.PatientLinkComponent convertPatientLinkComponent(org.hl7.fhir.r4b.model.Patient.PatientLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.r5.model.Patient.PatientLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOther()) + tgt.setOther(Reference43_50.convertReference(src.getOther())); + if (src.hasType()) + tgt.setTypeElement(convertLinkType(src.getTypeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Patient.PatientLinkComponent convertPatientLinkComponent(org.hl7.fhir.r5.model.Patient.PatientLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Patient.PatientLinkComponent tgt = new org.hl7.fhir.r4b.model.Patient.PatientLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOther()) + tgt.setOther(Reference43_50.convertReference(src.getOther())); + if (src.hasType()) + tgt.setTypeElement(convertLinkType(src.getTypeElement())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..8dcc77a1e --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PaymentNotice43_50.java @@ -0,0 +1,156 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Money43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Date43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class PaymentNotice43_50 { + + public static org.hl7.fhir.r5.model.PaymentNotice convertPaymentNotice(org.hl7.fhir.r4b.model.PaymentNotice src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PaymentNotice tgt = new org.hl7.fhir.r5.model.PaymentNotice(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertPaymentNoticeStatus(src.getStatusElement())); + if (src.hasRequest()) + tgt.setRequest(Reference43_50.convertReference(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(Reference43_50.convertReference(src.getResponse())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasPayment()) + tgt.setPayment(Reference43_50.convertReference(src.getPayment())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(Date43_50.convertDate(src.getPaymentDateElement())); + if (src.hasPayee()) + tgt.setPayee(Reference43_50.convertReference(src.getPayee())); + if (src.hasRecipient()) + tgt.setRecipient(Reference43_50.convertReference(src.getRecipient())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasPaymentStatus()) + tgt.setPaymentStatus(CodeableConcept43_50.convertCodeableConcept(src.getPaymentStatus())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PaymentNotice convertPaymentNotice(org.hl7.fhir.r5.model.PaymentNotice src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PaymentNotice tgt = new org.hl7.fhir.r4b.model.PaymentNotice(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertPaymentNoticeStatus(src.getStatusElement())); + if (src.hasRequest()) + tgt.setRequest(Reference43_50.convertReference(src.getRequest())); + if (src.hasResponse()) + tgt.setResponse(Reference43_50.convertReference(src.getResponse())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasProvider()) + tgt.setProvider(Reference43_50.convertReference(src.getProvider())); + if (src.hasPayment()) + tgt.setPayment(Reference43_50.convertReference(src.getPayment())); + if (src.hasPaymentDate()) + tgt.setPaymentDateElement(Date43_50.convertDate(src.getPaymentDateElement())); + if (src.hasPayee()) + tgt.setPayee(Reference43_50.convertReference(src.getPayee())); + if (src.hasRecipient()) + tgt.setRecipient(Reference43_50.convertReference(src.getRecipient())); + if (src.hasAmount()) + tgt.setAmount(Money43_50.convertMoney(src.getAmount())); + if (src.hasPaymentStatus()) + tgt.setPaymentStatus(CodeableConcept43_50.convertCodeableConcept(src.getPaymentStatus())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..1a493692b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Person43_50.java @@ -0,0 +1,164 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Person43_50 { + + public static org.hl7.fhir.r5.model.Person convertPerson(org.hl7.fhir.r4b.model.Person src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Person tgt = new org.hl7.fhir.r5.model.Person(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.HumanName t : src.getName()) tgt.addName(HumanName43_50.convertHumanName(t)); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(Date43_50.convertDate(src.getBirthDateElement())); + for (org.hl7.fhir.r4b.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + if (src.hasPhoto()) + tgt.addPhoto(Attachment43_50.convertAttachment(src.getPhoto())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r4b.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Person convertPerson(org.hl7.fhir.r5.model.Person src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Person tgt = new org.hl7.fhir.r4b.model.Person(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(HumanName43_50.convertHumanName(t)); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(Date43_50.convertDate(src.getBirthDateElement())); + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + if (src.hasPhoto()) + tgt.setPhoto(Attachment43_50.convertAttachment(src.getPhotoFirstRep())); + if (src.hasManagingOrganization()) + tgt.setManagingOrganization(Reference43_50.convertReference(src.getManagingOrganization())); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r5.model.Person.PersonLinkComponent t : src.getLink()) tgt.addLink(convertPersonLinkComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Person.PersonLinkComponent convertPersonLinkComponent(org.hl7.fhir.r4b.model.Person.PersonLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.r5.model.Person.PersonLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTarget()) + tgt.setTarget(Reference43_50.convertReference(src.getTarget())); + if (src.hasAssurance()) + tgt.setAssuranceElement(convertIdentityAssuranceLevel(src.getAssuranceElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Person.PersonLinkComponent convertPersonLinkComponent(org.hl7.fhir.r5.model.Person.PersonLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Person.PersonLinkComponent tgt = new org.hl7.fhir.r4b.model.Person.PersonLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTarget()) + tgt.setTarget(Reference43_50.convertReference(src.getTarget())); + if (src.hasAssurance()) + tgt.setAssuranceElement(convertIdentityAssuranceLevel(src.getAssuranceElement())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..d92781c56 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PlanDefinition43_50.java @@ -0,0 +1,936 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Duration43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.DataRequirement; +import org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionInputComponent; +import org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionOutputComponent; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class PlanDefinition43_50 { + + public static org.hl7.fhir.r5.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.r4b.model.PlanDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition tgt = new org.hl7.fhir.r5.model.PlanDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r4b.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getLibrary()) + tgt.getLibrary().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) + tgt.addGoal(convertPlanDefinitionGoalComponent(t)); + for (org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) + tgt.addAction(convertPlanDefinitionActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PlanDefinition convertPlanDefinition(org.hl7.fhir.r5.model.PlanDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PlanDefinition tgt = new org.hl7.fhir.r4b.model.PlanDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasSubtitle()) + tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasUsage()) + tgt.setUsageElement(String43_50.convertString(src.getUsageElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic()) + tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor()) + tgt.addAuthor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor()) + tgt.addEditor(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer()) + tgt.addReviewer(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser()) + tgt.addEndorser(ContactDetail43_50.convertContactDetail(t)); + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact()) + tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary()) + tgt.getLibrary().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent t : src.getGoal()) + tgt.addGoal(convertPlanDefinitionGoalComponent(t)); + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) + tgt.addAction(convertPlanDefinitionActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent convertPlanDefinitionGoalComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasDescription()) + tgt.setDescription(CodeableConcept43_50.convertCodeableConcept(src.getDescription())); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasStart()) + tgt.setStart(CodeableConcept43_50.convertCodeableConcept(src.getStart())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getAddresses()) + tgt.addAddresses(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.RelatedArtifact t : src.getDocumentation()) + tgt.addDocumentation(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) + tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalComponent convertPlanDefinitionGoalComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalComponent tgt = new org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasDescription()) + tgt.setDescription(CodeableConcept43_50.convertCodeableConcept(src.getDescription())); + if (src.hasPriority()) + tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority())); + if (src.hasStart()) + tgt.setStart(CodeableConcept43_50.convertCodeableConcept(src.getStart())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAddresses()) + tgt.addAddresses(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) + tgt.addDocumentation(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent t : src.getTarget()) + tgt.addTarget(convertPlanDefinitionGoalTargetComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent convertPlanDefinitionGoalTargetComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMeasure()) + tgt.setMeasure(CodeableConcept43_50.convertCodeableConcept(src.getMeasure())); + if (src.hasDetail()) + tgt.setDetail(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDetail())); + if (src.hasDue()) + tgt.setDue(Duration43_50.convertDuration(src.getDue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalTargetComponent convertPlanDefinitionGoalTargetComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionGoalTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalTargetComponent tgt = new org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionGoalTargetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMeasure()) + tgt.setMeasure(CodeableConcept43_50.convertCodeableConcept(src.getMeasure())); + if (src.hasDetail()) + tgt.setDetail(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDetail())); + if (src.hasDue()) + tgt.setDue(Duration43_50.convertDuration(src.getDue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent convertPlanDefinitionActionComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPrefix()) + tgt.setPrefixElement(String43_50.convertString(src.getPrefixElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasTextEquivalent()) + tgt.setTextEquivalentElement(String43_50.convertString(src.getTextEquivalentElement())); + if (src.hasPriority()) + tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReason()) + tgt.addReason(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.RelatedArtifact t : src.getDocumentation()) + tgt.addDocumentation(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r4b.model.IdType t : src.getGoalId()) tgt.getGoalId().add(Id43_50.convertId(t)); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + for (org.hl7.fhir.r4b.model.TriggerDefinition t : src.getTrigger()) + tgt.addTrigger(TriggerDefinition43_50.convertTriggerDefinition(t)); + for (org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) + tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); + for (org.hl7.fhir.r4b.model.DataRequirement t : src.getInput()) + tgt.addInput(wrapInput(DataRequirement43_50.convertDataRequirement(t))); + for (org.hl7.fhir.r4b.model.DataRequirement t : src.getOutput()) + tgt.addOutput(wrapOutput(DataRequirement43_50.convertDataRequirement(t))); + for (org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) + tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + for (org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasGroupingBehavior()) + tgt.setGroupingBehaviorElement(convertActionGroupingBehavior(src.getGroupingBehaviorElement())); + if (src.hasSelectionBehavior()) + tgt.setSelectionBehaviorElement(convertActionSelectionBehavior(src.getSelectionBehaviorElement())); + if (src.hasRequiredBehavior()) + tgt.setRequiredBehaviorElement(convertActionRequiredBehavior(src.getRequiredBehaviorElement())); + if (src.hasPrecheckBehavior()) + tgt.setPrecheckBehaviorElement(convertActionPrecheckBehavior(src.getPrecheckBehaviorElement())); + if (src.hasCardinalityBehavior()) + tgt.setCardinalityBehaviorElement(convertActionCardinalityBehavior(src.getCardinalityBehaviorElement())); + if (src.hasDefinition()) + tgt.setDefinition(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDefinition())); + if (src.hasTransform()) + tgt.setTransformElement(Canonical43_50.convertCanonical(src.getTransformElement())); + for (org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) + tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); + for (org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) + tgt.addAction(convertPlanDefinitionActionComponent(t)); + return tgt; + } + + private static PlanDefinitionActionOutputComponent wrapOutput(DataRequirement dr) { + return new PlanDefinitionActionOutputComponent().setRequirement(dr); + } + + private static PlanDefinitionActionInputComponent wrapInput(DataRequirement dr) { + return new PlanDefinitionActionInputComponent().setRequirement(dr); + } + + public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionComponent convertPlanDefinitionActionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionComponent tgt = new org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPrefix()) + tgt.setPrefixElement(String43_50.convertString(src.getPrefixElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasTextEquivalent()) + tgt.setTextEquivalentElement(String43_50.convertString(src.getTextEquivalentElement())); + if (src.hasPriority()) + tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement())); + if (src.hasCode()) tgt.addCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason()) + tgt.addReason(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getDocumentation()) + tgt.addDocumentation(RelatedArtifact43_50.convertRelatedArtifact(t)); + for (org.hl7.fhir.r5.model.IdType t : src.getGoalId()) tgt.getGoalId().add(Id43_50.convertId(t)); + if (src.hasSubject()) + tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject())); + for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger()) + tgt.addTrigger(TriggerDefinition43_50.convertTriggerDefinition(t)); + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent t : src.getCondition()) + tgt.addCondition(convertPlanDefinitionActionConditionComponent(t)); + for (PlanDefinitionActionInputComponent t : src.getInput()) + tgt.addInput(DataRequirement43_50.convertDataRequirement(t.getRequirement())); + for (PlanDefinitionActionOutputComponent t : src.getOutput()) + tgt.addOutput(DataRequirement43_50.convertDataRequirement(t.getRequirement())); + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent t : src.getRelatedAction()) + tgt.addRelatedAction(convertPlanDefinitionActionRelatedActionComponent(t)); + if (src.hasTiming()) + tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming())); + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertPlanDefinitionActionParticipantComponent(t)); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasGroupingBehavior()) + tgt.setGroupingBehaviorElement(convertActionGroupingBehavior(src.getGroupingBehaviorElement())); + if (src.hasSelectionBehavior()) + tgt.setSelectionBehaviorElement(convertActionSelectionBehavior(src.getSelectionBehaviorElement())); + if (src.hasRequiredBehavior()) + tgt.setRequiredBehaviorElement(convertActionRequiredBehavior(src.getRequiredBehaviorElement())); + if (src.hasPrecheckBehavior()) + tgt.setPrecheckBehaviorElement(convertActionPrecheckBehavior(src.getPrecheckBehaviorElement())); + if (src.hasCardinalityBehavior()) + tgt.setCardinalityBehaviorElement(convertActionCardinalityBehavior(src.getCardinalityBehaviorElement())); + if (src.hasDefinition()) + tgt.setDefinition(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDefinition())); + if (src.hasTransform()) + tgt.setTransformElement(Canonical43_50.convertCanonical(src.getTransformElement())); + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent t : src.getDynamicValue()) + tgt.addDynamicValue(convertPlanDefinitionActionDynamicValueComponent(t)); + for (org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionComponent t : src.getAction()) + tgt.addAction(convertPlanDefinitionActionComponent(t)); + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasKind()) + tgt.setKindElement(convertActionConditionKind(src.getKindElement())); + if (src.hasExpression()) + tgt.setExpression(Expression43_50.convertExpression(src.getExpression())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionConditionComponent convertPlanDefinitionActionConditionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionConditionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionConditionComponent tgt = new org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionConditionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasKind()) + tgt.setKindElement(convertActionConditionKind(src.getKindElement())); + if (src.hasExpression()) + tgt.setExpression(Expression43_50.convertExpression(src.getExpression())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasActionId()) + tgt.setTargetIdElement(Id43_50.convertId(src.getActionIdElement())); + if (src.hasRelationship()) + tgt.setRelationshipElement(convertActionRelationshipType(src.getRelationshipElement())); + if (src.hasOffset()) + tgt.setOffset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOffset())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent convertPlanDefinitionActionRelatedActionComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent tgt = new org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionRelatedActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTargetId()) + tgt.setActionIdElement(Id43_50.convertId(src.getTargetIdElement())); + if (src.hasRelationship()) + tgt.setRelationshipElement(convertActionRelationshipType(src.getRelationshipElement())); + if (src.hasOffset()) + tgt.setOffset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOffset())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertActionParticipantType(src.getTypeElement())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionParticipantComponent convertPlanDefinitionActionParticipantComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionParticipantComponent tgt = new org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertActionParticipantType(src.getTypeElement())); + if (src.hasRole()) + tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent tgt = new org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasExpression()) + tgt.setExpression(Expression43_50.convertExpression(src.getExpression())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent convertPlanDefinitionActionDynamicValueComponent(org.hl7.fhir.r5.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent tgt = new org.hl7.fhir.r4b.model.PlanDefinition.PlanDefinitionActionDynamicValueComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasExpression()) + tgt.setExpression(Expression43_50.convertExpression(src.getExpression())); + 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/Population43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Population43_50.java new file mode 100644 index 000000000..31b0f7bdd --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Population43_50.java @@ -0,0 +1,32 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Population43_50 { + public static org.hl7.fhir.r5.model.Population convertPopulation(org.hl7.fhir.r4b.model.Population src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.Population tgt = new org.hl7.fhir.r5.model.Population(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasAge()) tgt.setAge(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAge())); + if (src.hasGender()) tgt.setGender(CodeableConcept43_50.convertCodeableConcept(src.getGender())); + if (src.hasRace()) tgt.setRace(CodeableConcept43_50.convertCodeableConcept(src.getRace())); + if (src.hasPhysiologicalCondition()) + tgt.setPhysiologicalCondition(CodeableConcept43_50.convertCodeableConcept(src.getPhysiologicalCondition())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Population convertPopulation(org.hl7.fhir.r5.model.Population src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.Population tgt = new org.hl7.fhir.r4b.model.Population(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasAge()) tgt.setAge(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAge())); + if (src.hasGender()) tgt.setGender(CodeableConcept43_50.convertCodeableConcept(src.getGender())); + if (src.hasRace()) tgt.setRace(CodeableConcept43_50.convertCodeableConcept(src.getRace())); + if (src.hasPhysiologicalCondition()) + tgt.setPhysiologicalCondition(CodeableConcept43_50.convertCodeableConcept(src.getPhysiologicalCondition())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Practitioner43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Practitioner43_50.java new file mode 100644 index 000000000..0d8bc878d --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Practitioner43_50.java @@ -0,0 +1,122 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Practitioner43_50 { + + public static org.hl7.fhir.r5.model.Practitioner convertPractitioner(org.hl7.fhir.r4b.model.Practitioner src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Practitioner tgt = new org.hl7.fhir.r5.model.Practitioner(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r4b.model.HumanName t : src.getName()) tgt.addName(HumanName43_50.convertHumanName(t)); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r4b.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(Date43_50.convertDate(src.getBirthDateElement())); + for (org.hl7.fhir.r4b.model.Attachment t : src.getPhoto()) tgt.addPhoto(Attachment43_50.convertAttachment(t)); + for (org.hl7.fhir.r4b.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) + tgt.addQualification(convertPractitionerQualificationComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCommunication()) + tgt.addCommunication(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Practitioner convertPractitioner(org.hl7.fhir.r5.model.Practitioner src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Practitioner tgt = new org.hl7.fhir.r4b.model.Practitioner(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(HumanName43_50.convertHumanName(t)); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(Date43_50.convertDate(src.getBirthDateElement())); + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(Attachment43_50.convertAttachment(t)); + for (org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent t : src.getQualification()) + tgt.addQualification(convertPractitionerQualificationComponent(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication()) + tgt.addCommunication(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent convertPractitionerQualificationComponent(org.hl7.fhir.r4b.model.Practitioner.PractitionerQualificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasIssuer()) + tgt.setIssuer(Reference43_50.convertReference(src.getIssuer())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Practitioner.PractitionerQualificationComponent convertPractitionerQualificationComponent(org.hl7.fhir.r5.model.Practitioner.PractitionerQualificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Practitioner.PractitionerQualificationComponent tgt = new org.hl7.fhir.r4b.model.Practitioner.PractitionerQualificationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasIssuer()) + tgt.setIssuer(Reference43_50.convertReference(src.getIssuer())); + 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/PractitionerRole43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PractitionerRole43_50.java new file mode 100644 index 000000000..b60dfa52a --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/PractitionerRole43_50.java @@ -0,0 +1,240 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.ContactPoint43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +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.convertors.conv43_50.datatypes43_50.primitive43_50.Time43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class PractitionerRole43_50 { + + public static org.hl7.fhir.r5.model.PractitionerRole convertPractitionerRole(org.hl7.fhir.r4b.model.PractitionerRole src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PractitionerRole tgt = new org.hl7.fhir.r5.model.PractitionerRole(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasPractitioner()) + tgt.setPractitioner(Reference43_50.convertReference(src.getPractitioner())); + if (src.hasOrganization()) + tgt.setOrganization(Reference43_50.convertReference(src.getOrganization())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getLocation()) tgt.addLocation(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getHealthcareService()) + tgt.addHealthcareService(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) + tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); + for (org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) + tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(String43_50.convertString(src.getAvailabilityExceptionsElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PractitionerRole convertPractitionerRole(org.hl7.fhir.r5.model.PractitionerRole src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PractitionerRole tgt = new org.hl7.fhir.r4b.model.PractitionerRole(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + if (src.hasPractitioner()) + tgt.setPractitioner(Reference43_50.convertReference(src.getPractitioner())); + if (src.hasOrganization()) + tgt.setOrganization(Reference43_50.convertReference(src.getOrganization())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode()) + tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getLocation()) tgt.addLocation(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getHealthcareService()) + tgt.addHealthcareService(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent t : src.getAvailableTime()) + tgt.addAvailableTime(convertPractitionerRoleAvailableTimeComponent(t)); + for (org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent t : src.getNotAvailable()) + tgt.addNotAvailable(convertPractitionerRoleNotAvailableComponent(t)); + if (src.hasAvailabilityExceptions()) + tgt.setAvailabilityExceptionsElement(String43_50.convertString(src.getAvailabilityExceptionsElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint()) tgt.addEndpoint(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent convertPractitionerRoleAvailableTimeComponent(org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleAvailableTimeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + tgt.setDaysOfWeek(src.getDaysOfWeek().stream() + .map(PractitionerRole43_50::convertDaysOfWeek) + .collect(Collectors.toList())); + if (src.hasAllDay()) + tgt.setAllDayElement(Boolean43_50.convertBoolean(src.getAllDayElement())); + if (src.hasAvailableStartTime()) + tgt.setAvailableStartTimeElement(Time43_50.convertTime(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTime()) + tgt.setAvailableEndTimeElement(Time43_50.convertTime(src.getAvailableEndTimeElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleAvailableTimeComponent convertPractitionerRoleAvailableTimeComponent(org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleAvailableTimeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleAvailableTimeComponent tgt = new org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleAvailableTimeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + tgt.setDaysOfWeek(src.getDaysOfWeek().stream() + .map(PractitionerRole43_50::convertDaysOfWeek) + .collect(Collectors.toList())); + if (src.hasAllDay()) + tgt.setAllDayElement(Boolean43_50.convertBoolean(src.getAllDayElement())); + if (src.hasAvailableStartTime()) + tgt.setAvailableStartTimeElement(Time43_50.convertTime(src.getAvailableStartTimeElement())); + if (src.hasAvailableEndTime()) + tgt.setAvailableEndTimeElement(Time43_50.convertTime(src.getAvailableEndTimeElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent convertPractitionerRoleNotAvailableComponent(org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleNotAvailableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent tgt = new org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasDuring()) + tgt.setDuring(Period43_50.convertPeriod(src.getDuring())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleNotAvailableComponent convertPractitionerRoleNotAvailableComponent(org.hl7.fhir.r5.model.PractitionerRole.PractitionerRoleNotAvailableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleNotAvailableComponent tgt = new org.hl7.fhir.r4b.model.PractitionerRole.PractitionerRoleNotAvailableComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasDuring()) + tgt.setDuring(Period43_50.convertPeriod(src.getDuring())); + 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/Procedure43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Procedure43_50.java new file mode 100644 index 000000000..83b486685 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Procedure43_50.java @@ -0,0 +1,293 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Procedure43_50 { + + public static org.hl7.fhir.r5.model.Procedure convertProcedure(org.hl7.fhir.r4b.model.Procedure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Procedure tgt = new org.hl7.fhir.r5.model.Procedure(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertProcedureStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasPerformed()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getPerformed())); + if (src.hasRecorder()) + tgt.setRecorder(Reference43_50.convertReference(src.getRecorder())); + if (src.hasAsserter()) + tgt.setReported(Reference43_50.convertReference(src.getAsserter())); + for (org.hl7.fhir.r4b.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertProcedurePerformerComponent(t)); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getBodySite()) + tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOutcome()) + tgt.setOutcome(CodeableConcept43_50.convertCodeableConcept(src.getOutcome())); + for (org.hl7.fhir.r4b.model.Reference t : src.getReport()) tgt.addReport(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getComplication()) + tgt.addComplication(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getComplicationDetail()) + tgt.addComplicationDetail(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getFollowUp()) + tgt.addFollowUp(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) + tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getUsedReference()) + tgt.addUsed(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getUsedCode()) + tgt.addUsed(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Procedure convertProcedure(org.hl7.fhir.r5.model.Procedure src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Procedure tgt = new org.hl7.fhir.r4b.model.Procedure(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertProcedureStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategoryFirstRep())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setPerformed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasRecorder()) + tgt.setRecorder(Reference43_50.convertReference(src.getRecorder())); + if (src.hasReportedReference()) + tgt.setAsserter(Reference43_50.convertReference(src.getReportedReference())); + for (org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent t : src.getPerformer()) + tgt.addPerformer(convertProcedurePerformerComponent(t)); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) + tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOutcome()) + tgt.setOutcome(CodeableConcept43_50.convertCodeableConcept(src.getOutcome())); + for (org.hl7.fhir.r5.model.Reference t : src.getReport()) tgt.addReport(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getComplication()) + tgt.addComplication(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getComplicationDetail()) + tgt.addComplicationDetail(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getFollowUp()) + tgt.addFollowUp(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent t : src.getFocalDevice()) + tgt.addFocalDevice(convertProcedureFocalDeviceComponent(t)); + for (CodeableReference t : src.getUsed()) + if (t.hasReference()) + tgt.addUsedReference(Reference43_50.convertReference(t.getReference())); + for (CodeableReference t : src.getUsed()) + if (t.hasConcept()) + tgt.addUsedCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent convertProcedurePerformerComponent(org.hl7.fhir.r4b.model.Procedure.ProcedurePerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Procedure.ProcedurePerformerComponent convertProcedurePerformerComponent(org.hl7.fhir.r5.model.Procedure.ProcedurePerformerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Procedure.ProcedurePerformerComponent tgt = new org.hl7.fhir.r4b.model.Procedure.ProcedurePerformerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasFunction()) + tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction())); + if (src.hasActor()) + tgt.setActor(Reference43_50.convertReference(src.getActor())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent convertProcedureFocalDeviceComponent(org.hl7.fhir.r4b.model.Procedure.ProcedureFocalDeviceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAction()) + tgt.setAction(CodeableConcept43_50.convertCodeableConcept(src.getAction())); + if (src.hasManipulated()) + tgt.setManipulated(Reference43_50.convertReference(src.getManipulated())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Procedure.ProcedureFocalDeviceComponent convertProcedureFocalDeviceComponent(org.hl7.fhir.r5.model.Procedure.ProcedureFocalDeviceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Procedure.ProcedureFocalDeviceComponent tgt = new org.hl7.fhir.r4b.model.Procedure.ProcedureFocalDeviceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAction()) + tgt.setAction(CodeableConcept43_50.convertCodeableConcept(src.getAction())); + if (src.hasManipulated()) + tgt.setManipulated(Reference43_50.convertReference(src.getManipulated())); + 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/ProdCharacteristic43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ProdCharacteristic43_50.java new file mode 100644 index 000000000..a0f91d6ac --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ProdCharacteristic43_50.java @@ -0,0 +1,46 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Attachment43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Quantity43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class ProdCharacteristic43_50 { + public static org.hl7.fhir.r5.model.ProdCharacteristic convertProdCharacteristic(org.hl7.fhir.r4b.model.ProdCharacteristic src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ProdCharacteristic tgt = new org.hl7.fhir.r5.model.ProdCharacteristic(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasHeight()) tgt.setHeight(Quantity43_50.convertQuantity(src.getHeight())); + if (src.hasWidth()) tgt.setWidth(Quantity43_50.convertQuantity(src.getWidth())); + if (src.hasDepth()) tgt.setDepth(Quantity43_50.convertQuantity(src.getDepth())); + if (src.hasWeight()) tgt.setWeight(Quantity43_50.convertQuantity(src.getWeight())); + if (src.hasNominalVolume()) tgt.setNominalVolume(Quantity43_50.convertQuantity(src.getNominalVolume())); + if (src.hasExternalDiameter()) tgt.setExternalDiameter(Quantity43_50.convertQuantity(src.getExternalDiameter())); + if (src.hasShape()) tgt.setShapeElement(String43_50.convertString(src.getShapeElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getColor()) tgt.getColor().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getImprint()) tgt.getImprint().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.Attachment t : src.getImage()) tgt.addImage(Attachment43_50.convertAttachment(t)); + if (src.hasScoring()) tgt.setScoring(CodeableConcept43_50.convertCodeableConcept(src.getScoring())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ProdCharacteristic convertProdCharacteristic(org.hl7.fhir.r5.model.ProdCharacteristic src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ProdCharacteristic tgt = new org.hl7.fhir.r4b.model.ProdCharacteristic(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasHeight()) tgt.setHeight(Quantity43_50.convertQuantity(src.getHeight())); + if (src.hasWidth()) tgt.setWidth(Quantity43_50.convertQuantity(src.getWidth())); + if (src.hasDepth()) tgt.setDepth(Quantity43_50.convertQuantity(src.getDepth())); + if (src.hasWeight()) tgt.setWeight(Quantity43_50.convertQuantity(src.getWeight())); + if (src.hasNominalVolume()) tgt.setNominalVolume(Quantity43_50.convertQuantity(src.getNominalVolume())); + if (src.hasExternalDiameter()) tgt.setExternalDiameter(Quantity43_50.convertQuantity(src.getExternalDiameter())); + if (src.hasShape()) tgt.setShapeElement(String43_50.convertString(src.getShapeElement())); + for (org.hl7.fhir.r5.model.StringType t : src.getColor()) tgt.getColor().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getImprint()) tgt.getImprint().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.Attachment t : src.getImage()) tgt.addImage(Attachment43_50.convertAttachment(t)); + if (src.hasScoring()) tgt.setScoring(CodeableConcept43_50.convertCodeableConcept(src.getScoring())); + return tgt; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ProductShelfLife43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ProductShelfLife43_50.java new file mode 100644 index 000000000..ae03dcfce --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ProductShelfLife43_50.java @@ -0,0 +1,30 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Quantity43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class ProductShelfLife43_50 { + public static org.hl7.fhir.r5.model.ProductShelfLife convertProductShelfLife(org.hl7.fhir.r4b.model.ProductShelfLife src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.ProductShelfLife tgt = new org.hl7.fhir.r5.model.ProductShelfLife(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasPeriodDuration()) tgt.setPeriod(Quantity43_50.convertQuantity(src.getPeriodDuration())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialPrecautionsForStorage()) + tgt.addSpecialPrecautionsForStorage(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ProductShelfLife convertProductShelfLife(org.hl7.fhir.r5.model.ProductShelfLife src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.ProductShelfLife tgt = new org.hl7.fhir.r4b.model.ProductShelfLife(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasPeriodDuration()) tgt.setPeriod(Quantity43_50.convertQuantity(src.getPeriodDuration())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialPrecautionsForStorage()) + tgt.addSpecialPrecautionsForStorage(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } +} 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 new file mode 100644 index 000000000..b30caf28d --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Provenance43_50.java @@ -0,0 +1,209 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Signature43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Provenance43_50 { + + public static org.hl7.fhir.r5.model.Provenance convertProvenance(org.hl7.fhir.r4b.model.Provenance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Provenance tgt = new org.hl7.fhir.r5.model.Provenance(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Reference t : src.getTarget()) tgt.addTarget(Reference43_50.convertReference(t)); + if (src.hasOccurred()) + tgt.setOccurred(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurred())); + if (src.hasRecorded()) + tgt.setRecordedElement(Instant43_50.convertInstant(src.getRecordedElement())); + for (org.hl7.fhir.r4b.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri43_50.convertUri(t)); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReason()) + tgt.addAuthorization().setConcept(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasActivity()) + tgt.setActivity(CodeableConcept43_50.convertCodeableConcept(src.getActivity())); + for (org.hl7.fhir.r4b.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) + tgt.addAgent(convertProvenanceAgentComponent(t)); + for (org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) + tgt.addEntity(convertProvenanceEntityComponent(t)); + for (org.hl7.fhir.r4b.model.Signature t : src.getSignature()) tgt.addSignature(Signature43_50.convertSignature(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Provenance convertProvenance(org.hl7.fhir.r5.model.Provenance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Provenance tgt = new org.hl7.fhir.r4b.model.Provenance(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Reference t : src.getTarget()) tgt.addTarget(Reference43_50.convertReference(t)); + if (src.hasOccurred()) + tgt.setOccurred(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurred())); + if (src.hasRecorded()) + tgt.setRecordedElement(Instant43_50.convertInstant(src.getRecordedElement())); + for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri43_50.convertUri(t)); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + for (CodeableReference t : src.getAuthorization()) + if (t.hasConcept()) + tgt.addReason(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + if (src.hasActivity()) + tgt.setActivity(CodeableConcept43_50.convertCodeableConcept(src.getActivity())); + for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) + tgt.addAgent(convertProvenanceAgentComponent(t)); + for (org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent t : src.getEntity()) + tgt.addEntity(convertProvenanceEntityComponent(t)); + for (org.hl7.fhir.r5.model.Signature t : src.getSignature()) tgt.addSignature(Signature43_50.convertSignature(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent convertProvenanceAgentComponent(org.hl7.fhir.r4b.model.Provenance.ProvenanceAgentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent tgt = new org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getRole()) + tgt.addRole(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasWho()) + tgt.setWho(Reference43_50.convertReference(src.getWho())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Provenance.ProvenanceAgentComponent convertProvenanceAgentComponent(org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Provenance.ProvenanceAgentComponent tgt = new org.hl7.fhir.r4b.model.Provenance.ProvenanceAgentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole()) + tgt.addRole(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasWho()) + tgt.setWho(Reference43_50.convertReference(src.getWho())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRole()) + tgt.setRoleElement(convertProvenanceEntityRole(src.getRoleElement())); + if (src.hasWhat()) + tgt.setWhat(Reference43_50.convertReference(src.getWhat())); + for (org.hl7.fhir.r4b.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) + tgt.addAgent(convertProvenanceAgentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.r5.model.Provenance.ProvenanceEntityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.r4b.model.Provenance.ProvenanceEntityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRole()) + tgt.setRoleElement(convertProvenanceEntityRole(src.getRoleElement())); + if (src.hasWhat()) + tgt.setWhat(Reference43_50.convertReference(src.getWhat())); + for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent()) + tgt.addAgent(convertProvenanceAgentComponent(t)); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..28ba9b581 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Questionnaire43_50.java @@ -0,0 +1,541 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.VersionConvertorConstants; +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +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.Questionnaire.QuestionnaireAnswerConstraint; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Questionnaire43_50 { + + public static org.hl7.fhir.r5.model.Questionnaire convertQuestionnaire(org.hl7.fhir.r4b.model.Questionnaire src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire tgt = new org.hl7.fhir.r5.model.Questionnaire(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getDerivedFrom()) + tgt.getDerivedFrom().add(Canonical43_50.convertCanonical(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + for (org.hl7.fhir.r4b.model.CodeType t : src.getSubjectType()) + tgt.getSubjectType().add(Code43_50.convertResourceEnum(t)); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r4b.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Questionnaire convertQuestionnaire(org.hl7.fhir.r5.model.Questionnaire src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Questionnaire tgt = new org.hl7.fhir.r4b.model.Questionnaire(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getDerivedFrom()) + tgt.getDerivedFrom().add(Canonical43_50.convertCanonical(t)); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + for (CodeType t : src.getSubjectType()) tgt.getSubjectType().add(Code43_50.convertResourceEnum(t)); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasApprovalDate()) + tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement())); + if (src.hasLastReviewDate()) + tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement())); + if (src.hasEffectivePeriod()) + tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod())); + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t)); + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLinkId()) + tgt.setLinkIdElement(String43_50.convertString(src.getLinkIdElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Uri43_50.convertUri(src.getDefinitionElement())); + for (org.hl7.fhir.r4b.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t)); + if (src.hasPrefix()) + tgt.setPrefixElement(String43_50.convertString(src.getPrefixElement())); + if (src.hasText()) + tgt.setTextElement(MarkDown43_50.convertStringToMarkdown(src.getTextElement())); + if (src.hasType()) { + tgt.setTypeElement(convertQuestionnaireItemType(src.getTypeElement())); + if (src.getType() == QuestionnaireItemType.CHOICE) { + tgt.setAnswerConstraint(QuestionnaireAnswerConstraint.OPTIONSONLY); + } else if (src.getType() == QuestionnaireItemType.OPENCHOICE) { + tgt.setAnswerConstraint(QuestionnaireAnswerConstraint.OPTIONSORSTRING); + } + } + for (org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) + tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasEnableBehavior()) + tgt.setEnableBehaviorElement(convertEnableWhenBehavior(src.getEnableBehaviorElement())); + if (src.hasRequired()) + tgt.setRequiredElement(Boolean43_50.convertBoolean(src.getRequiredElement())); + if (src.hasRepeats()) + tgt.setRepeatsElement(Boolean43_50.convertBoolean(src.getRepeatsElement())); + if (src.hasReadOnly()) + tgt.setReadOnlyElement(Boolean43_50.convertBoolean(src.getReadOnlyElement())); + if (src.hasMaxLength()) + tgt.setMaxLengthElement(Integer43_50.convertInteger(src.getMaxLengthElement())); + if (src.hasAnswerValueSet()) + tgt.setAnswerValueSetElement(Canonical43_50.convertCanonical(src.getAnswerValueSetElement())); + for (org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) + tgt.addAnswerOption(convertQuestionnaireItemAnswerOptionComponent(t)); + for (org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemInitialComponent t : src.getInitial()) + tgt.addInitial(convertQuestionnaireItemInitialComponent(t)); + for (org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemComponent convertQuestionnaireItemComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemComponent tgt = new org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLinkId()) + tgt.setLinkIdElement(String43_50.convertString(src.getLinkIdElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Uri43_50.convertUri(src.getDefinitionElement())); + for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t)); + if (src.hasPrefix()) + tgt.setPrefixElement(String43_50.convertString(src.getPrefixElement())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + if (src.hasType()) + tgt.setTypeElement(convertQuestionnaireItemType(src.getTypeElement(), src.getAnswerConstraint())); + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) + tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); + if (src.hasEnableBehavior()) + tgt.setEnableBehaviorElement(convertEnableWhenBehavior(src.getEnableBehaviorElement())); + if (src.hasRequired()) + tgt.setRequiredElement(Boolean43_50.convertBoolean(src.getRequiredElement())); + if (src.hasRepeats()) + tgt.setRepeatsElement(Boolean43_50.convertBoolean(src.getRepeatsElement())); + if (src.hasReadOnly()) + tgt.setReadOnlyElement(Boolean43_50.convertBoolean(src.getReadOnlyElement())); + if (src.hasMaxLength()) + tgt.setMaxLengthElement(Integer43_50.convertInteger(src.getMaxLengthElement())); + if (src.hasAnswerValueSet()) + tgt.setAnswerValueSetElement(Canonical43_50.convertCanonical(src.getAnswerValueSetElement())); + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent t : src.getAnswerOption()) + tgt.addAnswerOption(convertQuestionnaireItemAnswerOptionComponent(t)); + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent t : src.getInitial()) + tgt.addInitial(convertQuestionnaireItemInitialComponent(t)); + for (org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireItemComponent(t)); + return tgt; + } + + 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; + } + + static public org.hl7.fhir.r4b.model.Enumeration convertQuestionnaireItemType(org.hl7.fhir.r5.model.Enumeration src, QuestionnaireAnswerConstraint constraint) 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.QuestionnaireItemTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL); + if (src.hasExtension(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL)) { + tgt.setValueAsString(src.getExtensionString(VersionConvertorConstants.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL)); + } else { + switch (src.getValue()) { + case GROUP: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.GROUP); + break; + case DISPLAY: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.DISPLAY); + break; + // case QUESTION: return org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.QUESTION; + case BOOLEAN: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.BOOLEAN); + break; + case DECIMAL: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.DECIMAL); + break; + case INTEGER: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.INTEGER); + break; + case DATE: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.DATE); + break; + case DATETIME: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.DATETIME); + break; + case TIME: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.TIME); + break; + case STRING: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.STRING); + break; + case TEXT: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.TEXT); + break; + case URL: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.URL); + break; + case CODING: + if (constraint == QuestionnaireAnswerConstraint.OPTIONSORSTRING) + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.OPENCHOICE); + else + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.CHOICE); + break; + case ATTACHMENT: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.ATTACHMENT); + break; + case REFERENCE: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.REFERENCE); + break; + case QUANTITY: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.QUANTITY); + break; + default: + tgt.setValue(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemType.NULL); + break; + } + } + return tgt; + } + + static public org.hl7.fhir.r5.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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuestion()) + tgt.setQuestionElement(String43_50.convertString(src.getQuestionElement())); + if (src.hasOperator()) + tgt.setOperatorElement(convertQuestionnaireItemOperator(src.getOperatorElement())); + if (src.hasAnswer()) + tgt.setAnswer(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAnswer())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemEnableWhenComponent convertQuestionnaireItemEnableWhenComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemEnableWhenComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemEnableWhenComponent tgt = new org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemEnableWhenComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuestion()) + tgt.setQuestionElement(String43_50.convertString(src.getQuestionElement())); + if (src.hasOperator()) + tgt.setOperatorElement(convertQuestionnaireItemOperator(src.getOperatorElement())); + if (src.hasAnswer()) + tgt.setAnswer(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAnswer())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent convertQuestionnaireItemAnswerOptionComponent(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemAnswerOptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasInitialSelected()) + tgt.setInitialSelectedElement(Boolean43_50.convertBoolean(src.getInitialSelectedElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemAnswerOptionComponent convertQuestionnaireItemAnswerOptionComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemAnswerOptionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemAnswerOptionComponent tgt = new org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemAnswerOptionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + if (src.hasInitialSelected()) + tgt.setInitialSelectedElement(Boolean43_50.convertBoolean(src.getInitialSelectedElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent convertQuestionnaireItemInitialComponent(org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemInitialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent tgt = new org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemInitialComponent convertQuestionnaireItemInitialComponent(org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemInitialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemInitialComponent tgt = new org.hl7.fhir.r4b.model.Questionnaire.QuestionnaireItemInitialComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + 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/QuestionnaireResponse43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/QuestionnaireResponse43_50.java new file mode 100644 index 000000000..eb2f66e2c --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/QuestionnaireResponse43_50.java @@ -0,0 +1,214 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50; +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.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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class QuestionnaireResponse43_50 { + + public static org.hl7.fhir.r5.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.r4b.model.QuestionnaireResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.QuestionnaireResponse tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasQuestionnaire()) + tgt.setQuestionnaireElement(Canonical43_50.convertCanonical(src.getQuestionnaireElement())); + if (src.hasStatus()) + tgt.setStatusElement(convertQuestionnaireResponseStatus(src.getStatusElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasAuthored()) + tgt.setAuthoredElement(DateTime43_50.convertDateTime(src.getAuthoredElement())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + for (org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.QuestionnaireResponse convertQuestionnaireResponse(org.hl7.fhir.r5.model.QuestionnaireResponse src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4b.model.QuestionnaireResponse(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifierFirstRep())); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasQuestionnaire()) + tgt.setQuestionnaireElement(Canonical43_50.convertCanonical(src.getQuestionnaireElement())); + if (src.hasStatus()) + tgt.setStatusElement(convertQuestionnaireResponseStatus(src.getStatusElement())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasAuthored()) + tgt.setAuthoredElement(DateTime43_50.convertDateTime(src.getAuthoredElement())); + if (src.hasAuthor()) + tgt.setAuthor(Reference43_50.convertReference(src.getAuthor())); + if (src.hasSource()) + tgt.setSource(Reference43_50.convertReference(src.getSource())); + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLinkId()) + tgt.setLinkIdElement(String43_50.convertString(src.getLinkIdElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Uri43_50.convertUri(src.getDefinitionElement())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) + tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + for (org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseItemComponent(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt = new org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLinkId()) + tgt.setLinkIdElement(String43_50.convertString(src.getLinkIdElement())); + if (src.hasDefinition()) + tgt.setDefinitionElement(Uri43_50.convertUri(src.getDefinitionElement())); + if (src.hasText()) + tgt.setTextElement(String43_50.convertString(src.getTextElement())); + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent t : src.getAnswer()) + tgt.addAnswer(convertQuestionnaireResponseItemAnswerComponent(t)); + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent convertQuestionnaireResponseItemAnswerComponent(org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + for (org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent convertQuestionnaireResponseItemAnswerComponent(org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent tgt = new org.hl7.fhir.r4b.model.QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + for (org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent t : src.getItem()) + tgt.addItem(convertQuestionnaireResponseItemComponent(t)); + 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/RelatedPerson43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/RelatedPerson43_50.java new file mode 100644 index 000000000..c879dea2b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/RelatedPerson43_50.java @@ -0,0 +1,122 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class RelatedPerson43_50 { + + public static org.hl7.fhir.r5.model.RelatedPerson convertRelatedPerson(org.hl7.fhir.r4b.model.RelatedPerson src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RelatedPerson tgt = new org.hl7.fhir.r5.model.RelatedPerson(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getRelationship()) + tgt.addRelationship(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.HumanName t : src.getName()) tgt.addName(HumanName43_50.convertHumanName(t)); + for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(Date43_50.convertDate(src.getBirthDateElement())); + for (org.hl7.fhir.r4b.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + for (org.hl7.fhir.r4b.model.Attachment t : src.getPhoto()) tgt.addPhoto(Attachment43_50.convertAttachment(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r4b.model.RelatedPerson.RelatedPersonCommunicationComponent t : src.getCommunication()) + tgt.addCommunication(convertRelatedPersonCommunicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.RelatedPerson convertRelatedPerson(org.hl7.fhir.r5.model.RelatedPerson src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.RelatedPerson tgt = new org.hl7.fhir.r4b.model.RelatedPerson(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRelationship()) + tgt.addRelationship(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.HumanName t : src.getName()) tgt.addName(HumanName43_50.convertHumanName(t)); + for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom()) + tgt.addTelecom(ContactPoint43_50.convertContactPoint(t)); + if (src.hasGender()) + tgt.setGenderElement(Enumerations43_50.convertAdministrativeGender(src.getGenderElement())); + if (src.hasBirthDate()) + tgt.setBirthDateElement(Date43_50.convertDate(src.getBirthDateElement())); + for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(Address43_50.convertAddress(t)); + for (org.hl7.fhir.r5.model.Attachment t : src.getPhoto()) tgt.addPhoto(Attachment43_50.convertAttachment(t)); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent t : src.getCommunication()) + tgt.addCommunication(convertRelatedPersonCommunicationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent convertRelatedPersonCommunicationComponent(org.hl7.fhir.r4b.model.RelatedPerson.RelatedPersonCommunicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent tgt = new org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage())); + if (src.hasPreferred()) + tgt.setPreferredElement(Boolean43_50.convertBoolean(src.getPreferredElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.RelatedPerson.RelatedPersonCommunicationComponent convertRelatedPersonCommunicationComponent(org.hl7.fhir.r5.model.RelatedPerson.RelatedPersonCommunicationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.RelatedPerson.RelatedPersonCommunicationComponent tgt = new org.hl7.fhir.r4b.model.RelatedPerson.RelatedPersonCommunicationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage())); + if (src.hasPreferred()) + tgt.setPreferredElement(Boolean43_50.convertBoolean(src.getPreferredElement())); + 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/Resource43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Resource43_50.java new file mode 100644 index 000000000..936416218 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Resource43_50.java @@ -0,0 +1,535 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50; +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Id43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Extension43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Meta43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Narrative43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class Resource43_50 { + + public final BaseAdvisor_43_50 advisor; + + public Resource43_50(BaseAdvisor_43_50 advisor) { + this.advisor = advisor; + } + + public void copyResource(org.hl7.fhir.r4b.model.Resource src, org.hl7.fhir.r5.model.Resource tgt) throws FHIRException { + if (src.hasId()) tgt.setIdElement(Id43_50.convertId(src.getIdElement())); + if (src.hasMeta()) tgt.setMeta(Meta43_50.convertMeta(src.getMeta())); + if (src.hasImplicitRules()) tgt.setImplicitRulesElement(Uri43_50.convertUri(src.getImplicitRulesElement())); + if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + } + + public void copyResource(org.hl7.fhir.r5.model.Resource src, org.hl7.fhir.r4b.model.Resource tgt) throws FHIRException { + if (src.hasId()) tgt.setIdElement(Id43_50.convertId(src.getIdElement())); + if (src.hasMeta()) tgt.setMeta(Meta43_50.convertMeta(src.getMeta())); + if (src.hasImplicitRules()) tgt.setImplicitRulesElement(Uri43_50.convertUri(src.getImplicitRulesElement())); + if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + } + + public org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.r4b.model.Resource src) throws FHIRException { + if (src == null) return null; + if (src instanceof org.hl7.fhir.r4b.model.Parameters) + return Parameters43_50.convertParameters((org.hl7.fhir.r4b.model.Parameters) src); + if (src instanceof org.hl7.fhir.r4b.model.Account) + return Account43_50.convertAccount((org.hl7.fhir.r4b.model.Account) src); + if (src instanceof org.hl7.fhir.r4b.model.ActivityDefinition) + return ActivityDefinition43_50.convertActivityDefinition((org.hl7.fhir.r4b.model.ActivityDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.AllergyIntolerance) + return AllergyIntolerance43_50.convertAllergyIntolerance((org.hl7.fhir.r4b.model.AllergyIntolerance) src); + if (src instanceof org.hl7.fhir.r4b.model.Appointment) + return Appointment43_50.convertAppointment((org.hl7.fhir.r4b.model.Appointment) src); + if (src instanceof org.hl7.fhir.r4b.model.AppointmentResponse) + return AppointmentResponse43_50.convertAppointmentResponse((org.hl7.fhir.r4b.model.AppointmentResponse) src); + if (src instanceof org.hl7.fhir.r4b.model.AuditEvent) + return AuditEvent43_50.convertAuditEvent((org.hl7.fhir.r4b.model.AuditEvent) src); + if (src instanceof org.hl7.fhir.r4b.model.Basic) return Basic43_50.convertBasic((org.hl7.fhir.r4b.model.Basic) src); + if (src instanceof org.hl7.fhir.r4b.model.Binary) + return Binary43_50.convertBinary((org.hl7.fhir.r4b.model.Binary) src); + if (src instanceof org.hl7.fhir.r4b.model.BiologicallyDerivedProduct) + return BiologicallyDerivedProduct43_50.convertBiologicallyDerivedProduct((org.hl7.fhir.r4b.model.BiologicallyDerivedProduct) src); + if (src instanceof org.hl7.fhir.r4b.model.BodyStructure) + return BodyStructure43_50.convertBodyStructure((org.hl7.fhir.r4b.model.BodyStructure) src); + if (src instanceof org.hl7.fhir.r4b.model.Bundle) + return Bundle43_50.convertBundle((org.hl7.fhir.r4b.model.Bundle) src); + if (src instanceof org.hl7.fhir.r4b.model.CapabilityStatement) + return CapabilityStatement43_50.convertCapabilityStatement((org.hl7.fhir.r4b.model.CapabilityStatement) src); + if (src instanceof org.hl7.fhir.r4b.model.CarePlan) + return CarePlan43_50.convertCarePlan((org.hl7.fhir.r4b.model.CarePlan) src); + if (src instanceof org.hl7.fhir.r4b.model.CareTeam) + return CareTeam43_50.convertCareTeam((org.hl7.fhir.r4b.model.CareTeam) src); + if (src instanceof org.hl7.fhir.r4b.model.ChargeItem) + return ChargeItem43_50.convertChargeItem((org.hl7.fhir.r4b.model.ChargeItem) src); + if (src instanceof org.hl7.fhir.r4b.model.ChargeItemDefinition) + return ChargeItemDefinition43_50.convertChargeItemDefinition((org.hl7.fhir.r4b.model.ChargeItemDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.Claim) return Claim43_50.convertClaim((org.hl7.fhir.r4b.model.Claim) src); + if (src instanceof org.hl7.fhir.r4b.model.ClaimResponse) + return ClaimResponse43_50.convertClaimResponse((org.hl7.fhir.r4b.model.ClaimResponse) src); + if (src instanceof org.hl7.fhir.r4b.model.ClinicalImpression) + return ClinicalImpression43_50.convertClinicalImpression((org.hl7.fhir.r4b.model.ClinicalImpression) src); + if (src instanceof org.hl7.fhir.r4b.model.CodeSystem) + return CodeSystem43_50.convertCodeSystem((org.hl7.fhir.r4b.model.CodeSystem) src); + if (src instanceof org.hl7.fhir.r4b.model.Communication) + return Communication43_50.convertCommunication((org.hl7.fhir.r4b.model.Communication) src); + if (src instanceof org.hl7.fhir.r4b.model.CommunicationRequest) + return CommunicationRequest43_50.convertCommunicationRequest((org.hl7.fhir.r4b.model.CommunicationRequest) src); + if (src instanceof org.hl7.fhir.r4b.model.CompartmentDefinition) + return CompartmentDefinition43_50.convertCompartmentDefinition((org.hl7.fhir.r4b.model.CompartmentDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.Composition) + return Composition43_50.convertComposition((org.hl7.fhir.r4b.model.Composition) src); + if (src instanceof org.hl7.fhir.r4b.model.ConceptMap) + return ConceptMap43_50.convertConceptMap((org.hl7.fhir.r4b.model.ConceptMap) src); + if (src instanceof org.hl7.fhir.r4b.model.Condition) + return Condition43_50.convertCondition((org.hl7.fhir.r4b.model.Condition) src); + if (src instanceof org.hl7.fhir.r4b.model.Consent) + return Consent43_50.convertConsent((org.hl7.fhir.r4b.model.Consent) src); + if (src instanceof org.hl7.fhir.r4b.model.Contract) + return Contract43_50.convertContract((org.hl7.fhir.r4b.model.Contract) src); + if (src instanceof org.hl7.fhir.r4b.model.Coverage) + return Coverage43_50.convertCoverage((org.hl7.fhir.r4b.model.Coverage) src); + if (src instanceof org.hl7.fhir.r4b.model.CoverageEligibilityRequest) + return CoverageEligibilityRequest43_50.convertCoverageEligibilityRequest((org.hl7.fhir.r4b.model.CoverageEligibilityRequest) src); + if (src instanceof org.hl7.fhir.r4b.model.DetectedIssue) + return DetectedIssue43_50.convertDetectedIssue((org.hl7.fhir.r4b.model.DetectedIssue) src); + if (src instanceof org.hl7.fhir.r4b.model.Device) + return Device43_50.convertDevice((org.hl7.fhir.r4b.model.Device) src); + if (src instanceof org.hl7.fhir.r4b.model.DeviceDefinition) + return DeviceDefinition43_50.convertDeviceDefinition((org.hl7.fhir.r4b.model.DeviceDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.DeviceMetric) + return DeviceMetric43_50.convertDeviceMetric((org.hl7.fhir.r4b.model.DeviceMetric) src); + if (src instanceof org.hl7.fhir.r4b.model.DeviceRequest) + return DeviceRequest43_50.convertDeviceRequest((org.hl7.fhir.r4b.model.DeviceRequest) src); + if (src instanceof org.hl7.fhir.r4b.model.DeviceUseStatement) + return DeviceUseStatement43_50.convertDeviceUseStatement((org.hl7.fhir.r4b.model.DeviceUseStatement) src); + if (src instanceof org.hl7.fhir.r4b.model.DiagnosticReport) + return DiagnosticReport43_50.convertDiagnosticReport((org.hl7.fhir.r4b.model.DiagnosticReport) src); + if (src instanceof org.hl7.fhir.r4b.model.DocumentManifest) + return DocumentManifest43_50.convertDocumentManifest((org.hl7.fhir.r4b.model.DocumentManifest) src); + if (src instanceof org.hl7.fhir.r4b.model.DocumentReference) + return DocumentReference43_50.convertDocumentReference((org.hl7.fhir.r4b.model.DocumentReference) src); + if (src instanceof org.hl7.fhir.r4b.model.Encounter) + return Encounter43_50.convertEncounter((org.hl7.fhir.r4b.model.Encounter) src); + if (src instanceof org.hl7.fhir.r4b.model.Endpoint) + return Endpoint43_50.convertEndpoint((org.hl7.fhir.r4b.model.Endpoint) src); + if (src instanceof org.hl7.fhir.r4b.model.EnrollmentRequest) + return EnrollmentRequest43_50.convertEnrollmentRequest((org.hl7.fhir.r4b.model.EnrollmentRequest) src); + if (src instanceof org.hl7.fhir.r4b.model.EpisodeOfCare) + return EpisodeOfCare43_50.convertEpisodeOfCare((org.hl7.fhir.r4b.model.EpisodeOfCare) src); + if (src instanceof org.hl7.fhir.r4b.model.EventDefinition) + return EventDefinition43_50.convertEventDefinition((org.hl7.fhir.r4b.model.EventDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.ExampleScenario) + return ExampleScenario43_50.convertExampleScenario((org.hl7.fhir.r4b.model.ExampleScenario) src); + if (src instanceof org.hl7.fhir.r4b.model.ExplanationOfBenefit) + return ExplanationOfBenefit43_50.convertExplanationOfBenefit((org.hl7.fhir.r4b.model.ExplanationOfBenefit) src); + if (src instanceof org.hl7.fhir.r4b.model.FamilyMemberHistory) + return FamilyMemberHistory43_50.convertFamilyMemberHistory((org.hl7.fhir.r4b.model.FamilyMemberHistory) src); + if (src instanceof org.hl7.fhir.r4b.model.Flag) return Flag43_50.convertFlag((org.hl7.fhir.r4b.model.Flag) src); + if (src instanceof org.hl7.fhir.r4b.model.Goal) return Goal43_50.convertGoal((org.hl7.fhir.r4b.model.Goal) src); + if (src instanceof org.hl7.fhir.r4b.model.GraphDefinition) + return GraphDefinition43_50.convertGraphDefinition((org.hl7.fhir.r4b.model.GraphDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.Group) return Group43_50.convertGroup((org.hl7.fhir.r4b.model.Group) src); + if (src instanceof org.hl7.fhir.r4b.model.GuidanceResponse) + return GuidanceResponse43_50.convertGuidanceResponse((org.hl7.fhir.r4b.model.GuidanceResponse) src); + if (src instanceof org.hl7.fhir.r4b.model.HealthcareService) + return HealthcareService43_50.convertHealthcareService((org.hl7.fhir.r4b.model.HealthcareService) src); + if (src instanceof org.hl7.fhir.r4b.model.ImagingStudy) + return ImagingStudy43_50.convertImagingStudy((org.hl7.fhir.r4b.model.ImagingStudy) src); + if (src instanceof org.hl7.fhir.r4b.model.Immunization) + return Immunization43_50.convertImmunization((org.hl7.fhir.r4b.model.Immunization) src); + if (src instanceof org.hl7.fhir.r4b.model.ImmunizationEvaluation) + return ImmunizationEvaluation43_50.convertImmunizationEvaluation((org.hl7.fhir.r4b.model.ImmunizationEvaluation) src); + if (src instanceof org.hl7.fhir.r4b.model.ImmunizationRecommendation) + return ImmunizationRecommendation43_50.convertImmunizationRecommendation((org.hl7.fhir.r4b.model.ImmunizationRecommendation) src); + if (src instanceof org.hl7.fhir.r4b.model.ImplementationGuide) + return ImplementationGuide43_50.convertImplementationGuide((org.hl7.fhir.r4b.model.ImplementationGuide) src); + if (src instanceof org.hl7.fhir.r4b.model.InsurancePlan) + return InsurancePlan43_50.convertInsurancePlan((org.hl7.fhir.r4b.model.InsurancePlan) src); + if (src instanceof org.hl7.fhir.r4b.model.Invoice) + return Invoice43_50.convertInvoice((org.hl7.fhir.r4b.model.Invoice) src); + if (src instanceof org.hl7.fhir.r4b.model.Library) + return Library43_50.convertLibrary((org.hl7.fhir.r4b.model.Library) src); + if (src instanceof org.hl7.fhir.r4b.model.Linkage) + return Linkage43_50.convertLinkage((org.hl7.fhir.r4b.model.Linkage) src); + if (src instanceof org.hl7.fhir.r4b.model.ListResource) + return ListResource43_50.convertListResource((org.hl7.fhir.r4b.model.ListResource) src); + if (src instanceof org.hl7.fhir.r4b.model.Location) + return Location43_50.convertLocation((org.hl7.fhir.r4b.model.Location) src); + if (src instanceof org.hl7.fhir.r4b.model.Measure) + return Measure43_50.convertMeasure((org.hl7.fhir.r4b.model.Measure) src); + if (src instanceof org.hl7.fhir.r4b.model.MeasureReport) + return MeasureReport43_50.convertMeasureReport((org.hl7.fhir.r4b.model.MeasureReport) src); + if (src instanceof org.hl7.fhir.r4b.model.Media) return Media43_50.convertMedia((org.hl7.fhir.r4b.model.Media) src); + if (src instanceof org.hl7.fhir.r4b.model.Medication) + return Medication43_50.convertMedication((org.hl7.fhir.r4b.model.Medication) src); + if (src instanceof org.hl7.fhir.r4b.model.MedicationAdministration) + return MedicationAdministration43_50.convertMedicationAdministration((org.hl7.fhir.r4b.model.MedicationAdministration) src); + if (src instanceof org.hl7.fhir.r4b.model.MedicationDispense) + return MedicationDispense43_50.convertMedicationDispense((org.hl7.fhir.r4b.model.MedicationDispense) src); + if (src instanceof org.hl7.fhir.r4b.model.MedicationKnowledge) + return MedicationKnowledge43_50.convertMedicationKnowledge((org.hl7.fhir.r4b.model.MedicationKnowledge) src); + if (src instanceof org.hl7.fhir.r4b.model.MedicationRequest) + return MedicationRequest43_50.convertMedicationRequest((org.hl7.fhir.r4b.model.MedicationRequest) src); + if (src instanceof org.hl7.fhir.r4b.model.MedicationStatement) + return MedicationStatement43_50.convertMedicationStatement((org.hl7.fhir.r4b.model.MedicationStatement) src); + if (src instanceof org.hl7.fhir.r4b.model.MessageDefinition) + return MessageDefinition43_50.convertMessageDefinition((org.hl7.fhir.r4b.model.MessageDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.MessageHeader) + return MessageHeader43_50.convertMessageHeader((org.hl7.fhir.r4b.model.MessageHeader) src); + if (src instanceof org.hl7.fhir.r4b.model.NamingSystem) + return NamingSystem43_50.convertNamingSystem((org.hl7.fhir.r4b.model.NamingSystem) src); + if (src instanceof org.hl7.fhir.r4b.model.NutritionOrder) + return NutritionOrder43_50.convertNutritionOrder((org.hl7.fhir.r4b.model.NutritionOrder) src); + if (src instanceof org.hl7.fhir.r4b.model.Observation) + return Observation43_50.convertObservation((org.hl7.fhir.r4b.model.Observation) src); + if (src instanceof org.hl7.fhir.r4b.model.ObservationDefinition) + return ObservationDefinition43_50.convertObservationDefinition((org.hl7.fhir.r4b.model.ObservationDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.OperationDefinition) + return OperationDefinition43_50.convertOperationDefinition((org.hl7.fhir.r4b.model.OperationDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.OperationOutcome) + return OperationOutcome43_50.convertOperationOutcome((org.hl7.fhir.r4b.model.OperationOutcome) src); + if (src instanceof org.hl7.fhir.r4b.model.Organization) + return Organization43_50.convertOrganization((org.hl7.fhir.r4b.model.Organization) src); + if (src instanceof org.hl7.fhir.r4b.model.OrganizationAffiliation) + return OrganizationAffiliation43_50.convertOrganizationAffiliation((org.hl7.fhir.r4b.model.OrganizationAffiliation) src); + if (src instanceof org.hl7.fhir.r4b.model.Patient) + return Patient43_50.convertPatient((org.hl7.fhir.r4b.model.Patient) src); + if (src instanceof org.hl7.fhir.r4b.model.PaymentNotice) + return PaymentNotice43_50.convertPaymentNotice((org.hl7.fhir.r4b.model.PaymentNotice) src); + if (src instanceof org.hl7.fhir.r4b.model.Person) + return Person43_50.convertPerson((org.hl7.fhir.r4b.model.Person) src); + if (src instanceof org.hl7.fhir.r4b.model.PlanDefinition) + return PlanDefinition43_50.convertPlanDefinition((org.hl7.fhir.r4b.model.PlanDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.Practitioner) + return Practitioner43_50.convertPractitioner((org.hl7.fhir.r4b.model.Practitioner) src); + if (src instanceof org.hl7.fhir.r4b.model.PractitionerRole) + return PractitionerRole43_50.convertPractitionerRole((org.hl7.fhir.r4b.model.PractitionerRole) src); + if (src instanceof org.hl7.fhir.r4b.model.Procedure) + return Procedure43_50.convertProcedure((org.hl7.fhir.r4b.model.Procedure) src); + if (src instanceof org.hl7.fhir.r4b.model.Provenance) + return Provenance43_50.convertProvenance((org.hl7.fhir.r4b.model.Provenance) src); + if (src instanceof org.hl7.fhir.r4b.model.Questionnaire) + return Questionnaire43_50.convertQuestionnaire((org.hl7.fhir.r4b.model.Questionnaire) src); + if (src instanceof org.hl7.fhir.r4b.model.QuestionnaireResponse) + return QuestionnaireResponse43_50.convertQuestionnaireResponse((org.hl7.fhir.r4b.model.QuestionnaireResponse) src); + if (src instanceof org.hl7.fhir.r4b.model.RelatedPerson) + return RelatedPerson43_50.convertRelatedPerson((org.hl7.fhir.r4b.model.RelatedPerson) src); + if (src instanceof org.hl7.fhir.r4b.model.RiskAssessment) + return RiskAssessment43_50.convertRiskAssessment((org.hl7.fhir.r4b.model.RiskAssessment) src); + if (src instanceof org.hl7.fhir.r4b.model.Schedule) + return Schedule43_50.convertSchedule((org.hl7.fhir.r4b.model.Schedule) src); + if (src instanceof org.hl7.fhir.r4b.model.SearchParameter) + return SearchParameter43_50.convertSearchParameter((org.hl7.fhir.r4b.model.SearchParameter) src); + if (src instanceof org.hl7.fhir.r4b.model.ServiceRequest) + return ServiceRequest43_50.convertServiceRequest((org.hl7.fhir.r4b.model.ServiceRequest) src); + if (src instanceof org.hl7.fhir.r4b.model.Slot) return Slot43_50.convertSlot((org.hl7.fhir.r4b.model.Slot) src); + if (src instanceof org.hl7.fhir.r4b.model.Specimen) + return Specimen43_50.convertSpecimen((org.hl7.fhir.r4b.model.Specimen) src); + if (src instanceof org.hl7.fhir.r4b.model.SpecimenDefinition) + return SpecimenDefinition43_50.convertSpecimenDefinition((org.hl7.fhir.r4b.model.SpecimenDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.StructureDefinition) + return StructureDefinition43_50.convertStructureDefinition((org.hl7.fhir.r4b.model.StructureDefinition) src); + if (src instanceof org.hl7.fhir.r4b.model.StructureMap) + return StructureMap43_50.convertStructureMap((org.hl7.fhir.r4b.model.StructureMap) src); + if (src instanceof org.hl7.fhir.r4b.model.Substance) + return Substance43_50.convertSubstance((org.hl7.fhir.r4b.model.Substance) src); + if (src instanceof org.hl7.fhir.r4b.model.SupplyDelivery) + return SupplyDelivery43_50.convertSupplyDelivery((org.hl7.fhir.r4b.model.SupplyDelivery) src); + if (src instanceof org.hl7.fhir.r4b.model.SupplyRequest) + return SupplyRequest43_50.convertSupplyRequest((org.hl7.fhir.r4b.model.SupplyRequest) src); + if (src instanceof org.hl7.fhir.r4b.model.Task) return Task43_50.convertTask((org.hl7.fhir.r4b.model.Task) src); + if (src instanceof org.hl7.fhir.r4b.model.TerminologyCapabilities) + return TerminologyCapabilities43_50.convertTerminologyCapabilities((org.hl7.fhir.r4b.model.TerminologyCapabilities) src); + if (src instanceof org.hl7.fhir.r4b.model.TestReport) + return TestReport43_50.convertTestReport((org.hl7.fhir.r4b.model.TestReport) src); + if (src instanceof org.hl7.fhir.r4b.model.TestScript) + return TestScript43_50.convertTestScript((org.hl7.fhir.r4b.model.TestScript) src); + if (src instanceof org.hl7.fhir.r4b.model.ValueSet) + return ValueSet43_50.convertValueSet((org.hl7.fhir.r4b.model.ValueSet) src); + if (src instanceof org.hl7.fhir.r4b.model.VerificationResult) + return VerificationResult43_50.convertVerificationResult((org.hl7.fhir.r4b.model.VerificationResult) src); + if (src instanceof org.hl7.fhir.r4b.model.VisionPrescription) + return VisionPrescription43_50.convertVisionPrescription((org.hl7.fhir.r4b.model.VisionPrescription) src); + if (advisor.failFastOnNullOrUnknownEntry()) { + throw new FHIRException("Unknown resource " + src.fhirType()); + } else { + return null; + } + } + + public org.hl7.fhir.r4b.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException { + if (src == null) return null; + if (src instanceof org.hl7.fhir.r5.model.Parameters) + return Parameters43_50.convertParameters((org.hl7.fhir.r5.model.Parameters) src); + if (src instanceof org.hl7.fhir.r5.model.Account) + return Account43_50.convertAccount((org.hl7.fhir.r5.model.Account) src); + if (src instanceof org.hl7.fhir.r5.model.ActivityDefinition) + return ActivityDefinition43_50.convertActivityDefinition((org.hl7.fhir.r5.model.ActivityDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.AllergyIntolerance) + return AllergyIntolerance43_50.convertAllergyIntolerance((org.hl7.fhir.r5.model.AllergyIntolerance) src); + if (src instanceof org.hl7.fhir.r5.model.Appointment) + return Appointment43_50.convertAppointment((org.hl7.fhir.r5.model.Appointment) src); + if (src instanceof org.hl7.fhir.r5.model.AppointmentResponse) + return AppointmentResponse43_50.convertAppointmentResponse((org.hl7.fhir.r5.model.AppointmentResponse) src); + if (src instanceof org.hl7.fhir.r5.model.AuditEvent) + return AuditEvent43_50.convertAuditEvent((org.hl7.fhir.r5.model.AuditEvent) src); + if (src instanceof org.hl7.fhir.r5.model.Basic) return Basic43_50.convertBasic((org.hl7.fhir.r5.model.Basic) src); + if (src instanceof org.hl7.fhir.r5.model.Binary) + return Binary43_50.convertBinary((org.hl7.fhir.r5.model.Binary) src); + if (src instanceof org.hl7.fhir.r5.model.BiologicallyDerivedProduct) + return BiologicallyDerivedProduct43_50.convertBiologicallyDerivedProduct((org.hl7.fhir.r5.model.BiologicallyDerivedProduct) src); + if (src instanceof org.hl7.fhir.r5.model.BodyStructure) + return BodyStructure43_50.convertBodyStructure((org.hl7.fhir.r5.model.BodyStructure) src); + if (src instanceof org.hl7.fhir.r5.model.Bundle) + return Bundle43_50.convertBundle((org.hl7.fhir.r5.model.Bundle) src); + if (src instanceof org.hl7.fhir.r5.model.CapabilityStatement) + return CapabilityStatement43_50.convertCapabilityStatement((org.hl7.fhir.r5.model.CapabilityStatement) src); + if (src instanceof org.hl7.fhir.r5.model.CarePlan) + return CarePlan43_50.convertCarePlan((org.hl7.fhir.r5.model.CarePlan) src); + if (src instanceof org.hl7.fhir.r5.model.CareTeam) + return CareTeam43_50.convertCareTeam((org.hl7.fhir.r5.model.CareTeam) src); + if (src instanceof org.hl7.fhir.r5.model.ChargeItem) + return ChargeItem43_50.convertChargeItem((org.hl7.fhir.r5.model.ChargeItem) src); + if (src instanceof org.hl7.fhir.r5.model.ChargeItemDefinition) + return ChargeItemDefinition43_50.convertChargeItemDefinition((org.hl7.fhir.r5.model.ChargeItemDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.Claim) return Claim43_50.convertClaim((org.hl7.fhir.r5.model.Claim) src); + if (src instanceof org.hl7.fhir.r5.model.ClaimResponse) + return ClaimResponse43_50.convertClaimResponse((org.hl7.fhir.r5.model.ClaimResponse) src); + if (src instanceof org.hl7.fhir.r5.model.ClinicalImpression) + return ClinicalImpression43_50.convertClinicalImpression((org.hl7.fhir.r5.model.ClinicalImpression) src); + if (src instanceof org.hl7.fhir.r5.model.CodeSystem) + return CodeSystem43_50.convertCodeSystem((org.hl7.fhir.r5.model.CodeSystem) src); + if (src instanceof org.hl7.fhir.r5.model.Communication) + return Communication43_50.convertCommunication((org.hl7.fhir.r5.model.Communication) src); + if (src instanceof org.hl7.fhir.r5.model.CommunicationRequest) + return CommunicationRequest43_50.convertCommunicationRequest((org.hl7.fhir.r5.model.CommunicationRequest) src); + if (src instanceof org.hl7.fhir.r5.model.CompartmentDefinition) + return CompartmentDefinition43_50.convertCompartmentDefinition((org.hl7.fhir.r5.model.CompartmentDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.Composition) + return Composition43_50.convertComposition((org.hl7.fhir.r5.model.Composition) src); + if (src instanceof org.hl7.fhir.r5.model.ConceptMap) + return ConceptMap43_50.convertConceptMap((org.hl7.fhir.r5.model.ConceptMap) src); + if (src instanceof org.hl7.fhir.r5.model.Condition) + return Condition43_50.convertCondition((org.hl7.fhir.r5.model.Condition) src); + if (src instanceof org.hl7.fhir.r5.model.Consent) + return Consent43_50.convertConsent((org.hl7.fhir.r5.model.Consent) src); + if (src instanceof org.hl7.fhir.r5.model.Contract) + return Contract43_50.convertContract((org.hl7.fhir.r5.model.Contract) src); + if (src instanceof org.hl7.fhir.r5.model.Coverage) + return Coverage43_50.convertCoverage((org.hl7.fhir.r5.model.Coverage) src); + if (src instanceof org.hl7.fhir.r5.model.CoverageEligibilityRequest) + return CoverageEligibilityRequest43_50.convertCoverageEligibilityRequest((org.hl7.fhir.r5.model.CoverageEligibilityRequest) src); + if (src instanceof org.hl7.fhir.r5.model.DetectedIssue) + return DetectedIssue43_50.convertDetectedIssue((org.hl7.fhir.r5.model.DetectedIssue) src); + if (src instanceof org.hl7.fhir.r5.model.Device) + return Device43_50.convertDevice((org.hl7.fhir.r5.model.Device) src); + if (src instanceof org.hl7.fhir.r5.model.DeviceDefinition) + return DeviceDefinition43_50.convertDeviceDefinition((org.hl7.fhir.r5.model.DeviceDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.DeviceMetric) + return DeviceMetric43_50.convertDeviceMetric((org.hl7.fhir.r5.model.DeviceMetric) src); + if (src instanceof org.hl7.fhir.r5.model.DeviceRequest) + return DeviceRequest43_50.convertDeviceRequest((org.hl7.fhir.r5.model.DeviceRequest) src); + if (src instanceof org.hl7.fhir.r5.model.DeviceUsage) + return DeviceUseStatement43_50.convertDeviceUseStatement((org.hl7.fhir.r5.model.DeviceUsage) src); + if (src instanceof org.hl7.fhir.r5.model.DiagnosticReport) + return DiagnosticReport43_50.convertDiagnosticReport((org.hl7.fhir.r5.model.DiagnosticReport) src); + if (src instanceof org.hl7.fhir.r5.model.DocumentManifest) + return DocumentManifest43_50.convertDocumentManifest((org.hl7.fhir.r5.model.DocumentManifest) src); + if (src instanceof org.hl7.fhir.r5.model.DocumentReference) + return DocumentReference43_50.convertDocumentReference((org.hl7.fhir.r5.model.DocumentReference) src); + if (src instanceof org.hl7.fhir.r5.model.Encounter) + return Encounter43_50.convertEncounter((org.hl7.fhir.r5.model.Encounter) src); + if (src instanceof org.hl7.fhir.r5.model.Endpoint) + return Endpoint43_50.convertEndpoint((org.hl7.fhir.r5.model.Endpoint) src); + if (src instanceof org.hl7.fhir.r5.model.EnrollmentRequest) + return EnrollmentRequest43_50.convertEnrollmentRequest((org.hl7.fhir.r5.model.EnrollmentRequest) src); + if (src instanceof org.hl7.fhir.r5.model.EpisodeOfCare) + return EpisodeOfCare43_50.convertEpisodeOfCare((org.hl7.fhir.r5.model.EpisodeOfCare) src); + if (src instanceof org.hl7.fhir.r5.model.EventDefinition) + return EventDefinition43_50.convertEventDefinition((org.hl7.fhir.r5.model.EventDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.ExampleScenario) + return ExampleScenario43_50.convertExampleScenario((org.hl7.fhir.r5.model.ExampleScenario) src); + if (src instanceof org.hl7.fhir.r5.model.ExplanationOfBenefit) + return ExplanationOfBenefit43_50.convertExplanationOfBenefit((org.hl7.fhir.r5.model.ExplanationOfBenefit) src); + if (src instanceof org.hl7.fhir.r5.model.FamilyMemberHistory) + return FamilyMemberHistory43_50.convertFamilyMemberHistory((org.hl7.fhir.r5.model.FamilyMemberHistory) src); + if (src instanceof org.hl7.fhir.r5.model.Flag) return Flag43_50.convertFlag((org.hl7.fhir.r5.model.Flag) src); + if (src instanceof org.hl7.fhir.r5.model.Goal) return Goal43_50.convertGoal((org.hl7.fhir.r5.model.Goal) src); + if (src instanceof org.hl7.fhir.r5.model.GraphDefinition) + return GraphDefinition43_50.convertGraphDefinition((org.hl7.fhir.r5.model.GraphDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.Group) return Group43_50.convertGroup((org.hl7.fhir.r5.model.Group) src); + if (src instanceof org.hl7.fhir.r5.model.GuidanceResponse) + return GuidanceResponse43_50.convertGuidanceResponse((org.hl7.fhir.r5.model.GuidanceResponse) src); + if (src instanceof org.hl7.fhir.r5.model.HealthcareService) + return HealthcareService43_50.convertHealthcareService((org.hl7.fhir.r5.model.HealthcareService) src); + if (src instanceof org.hl7.fhir.r5.model.ImagingStudy) + return ImagingStudy43_50.convertImagingStudy((org.hl7.fhir.r5.model.ImagingStudy) src); + if (src instanceof org.hl7.fhir.r5.model.Immunization) + return Immunization43_50.convertImmunization((org.hl7.fhir.r5.model.Immunization) src); + if (src instanceof org.hl7.fhir.r5.model.ImmunizationEvaluation) + return ImmunizationEvaluation43_50.convertImmunizationEvaluation((org.hl7.fhir.r5.model.ImmunizationEvaluation) src); + if (src instanceof org.hl7.fhir.r5.model.ImmunizationRecommendation) + return ImmunizationRecommendation43_50.convertImmunizationRecommendation((org.hl7.fhir.r5.model.ImmunizationRecommendation) src); + if (src instanceof org.hl7.fhir.r5.model.ImplementationGuide) + return ImplementationGuide43_50.convertImplementationGuide((org.hl7.fhir.r5.model.ImplementationGuide) src); + if (src instanceof org.hl7.fhir.r5.model.InsurancePlan) + return InsurancePlan43_50.convertInsurancePlan((org.hl7.fhir.r5.model.InsurancePlan) src); + if (src instanceof org.hl7.fhir.r5.model.Invoice) + return Invoice43_50.convertInvoice((org.hl7.fhir.r5.model.Invoice) src); + if (src instanceof org.hl7.fhir.r5.model.Library) + return Library43_50.convertLibrary((org.hl7.fhir.r5.model.Library) src); + if (src instanceof org.hl7.fhir.r5.model.Linkage) + return Linkage43_50.convertLinkage((org.hl7.fhir.r5.model.Linkage) src); + if (src instanceof org.hl7.fhir.r5.model.ListResource) + return ListResource43_50.convertListResource((org.hl7.fhir.r5.model.ListResource) src); + if (src instanceof org.hl7.fhir.r5.model.Location) + return Location43_50.convertLocation((org.hl7.fhir.r5.model.Location) src); + if (src instanceof org.hl7.fhir.r5.model.Measure) + return Measure43_50.convertMeasure((org.hl7.fhir.r5.model.Measure) src); + if (src instanceof org.hl7.fhir.r5.model.MeasureReport) + return MeasureReport43_50.convertMeasureReport((org.hl7.fhir.r5.model.MeasureReport) src); + if (src instanceof org.hl7.fhir.r5.model.DocumentReference) + return Media43_50.convertMedia((org.hl7.fhir.r5.model.DocumentReference) src); + if (src instanceof org.hl7.fhir.r5.model.Medication) + return Medication43_50.convertMedication((org.hl7.fhir.r5.model.Medication) src); + if (src instanceof org.hl7.fhir.r5.model.MedicationAdministration) + return MedicationAdministration43_50.convertMedicationAdministration((org.hl7.fhir.r5.model.MedicationAdministration) src); + if (src instanceof org.hl7.fhir.r5.model.MedicationDispense) + return MedicationDispense43_50.convertMedicationDispense((org.hl7.fhir.r5.model.MedicationDispense) src); + if (src instanceof org.hl7.fhir.r5.model.MedicationKnowledge) + return MedicationKnowledge43_50.convertMedicationKnowledge((org.hl7.fhir.r5.model.MedicationKnowledge) src); + if (src instanceof org.hl7.fhir.r5.model.MedicationRequest) + return MedicationRequest43_50.convertMedicationRequest((org.hl7.fhir.r5.model.MedicationRequest) src); + if (src instanceof org.hl7.fhir.r5.model.MedicationUsage) + return MedicationStatement43_50.convertMedicationStatement((org.hl7.fhir.r5.model.MedicationUsage) src); + if (src instanceof org.hl7.fhir.r5.model.MessageDefinition) + return MessageDefinition43_50.convertMessageDefinition((org.hl7.fhir.r5.model.MessageDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.MessageHeader) + return MessageHeader43_50.convertMessageHeader((org.hl7.fhir.r5.model.MessageHeader) src); + if (src instanceof org.hl7.fhir.r5.model.NamingSystem) + return NamingSystem43_50.convertNamingSystem((org.hl7.fhir.r5.model.NamingSystem) src); + if (src instanceof org.hl7.fhir.r5.model.NutritionOrder) + return NutritionOrder43_50.convertNutritionOrder((org.hl7.fhir.r5.model.NutritionOrder) src); + if (src instanceof org.hl7.fhir.r5.model.Observation) + return Observation43_50.convertObservation((org.hl7.fhir.r5.model.Observation) src); + if (src instanceof org.hl7.fhir.r5.model.ObservationDefinition) + return ObservationDefinition43_50.convertObservationDefinition((org.hl7.fhir.r5.model.ObservationDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.OperationDefinition) + return OperationDefinition43_50.convertOperationDefinition((org.hl7.fhir.r5.model.OperationDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.OperationOutcome) + return OperationOutcome43_50.convertOperationOutcome((org.hl7.fhir.r5.model.OperationOutcome) src); + if (src instanceof org.hl7.fhir.r5.model.Organization) + return Organization43_50.convertOrganization((org.hl7.fhir.r5.model.Organization) src); + if (src instanceof org.hl7.fhir.r5.model.OrganizationAffiliation) + return OrganizationAffiliation43_50.convertOrganizationAffiliation((org.hl7.fhir.r5.model.OrganizationAffiliation) src); + if (src instanceof org.hl7.fhir.r5.model.Patient) + return Patient43_50.convertPatient((org.hl7.fhir.r5.model.Patient) src); + if (src instanceof org.hl7.fhir.r5.model.PaymentNotice) + return PaymentNotice43_50.convertPaymentNotice((org.hl7.fhir.r5.model.PaymentNotice) src); + if (src instanceof org.hl7.fhir.r5.model.Person) + return Person43_50.convertPerson((org.hl7.fhir.r5.model.Person) src); + if (src instanceof org.hl7.fhir.r5.model.PlanDefinition) + return PlanDefinition43_50.convertPlanDefinition((org.hl7.fhir.r5.model.PlanDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.Practitioner) + return Practitioner43_50.convertPractitioner((org.hl7.fhir.r5.model.Practitioner) src); + if (src instanceof org.hl7.fhir.r5.model.PractitionerRole) + return PractitionerRole43_50.convertPractitionerRole((org.hl7.fhir.r5.model.PractitionerRole) src); + if (src instanceof org.hl7.fhir.r5.model.Procedure) + return Procedure43_50.convertProcedure((org.hl7.fhir.r5.model.Procedure) src); + if (src instanceof org.hl7.fhir.r5.model.Provenance) + return Provenance43_50.convertProvenance((org.hl7.fhir.r5.model.Provenance) src); + if (src instanceof org.hl7.fhir.r5.model.Questionnaire) + return Questionnaire43_50.convertQuestionnaire((org.hl7.fhir.r5.model.Questionnaire) src); + if (src instanceof org.hl7.fhir.r5.model.QuestionnaireResponse) + return QuestionnaireResponse43_50.convertQuestionnaireResponse((org.hl7.fhir.r5.model.QuestionnaireResponse) src); + if (src instanceof org.hl7.fhir.r5.model.RelatedPerson) + return RelatedPerson43_50.convertRelatedPerson((org.hl7.fhir.r5.model.RelatedPerson) src); + if (src instanceof org.hl7.fhir.r5.model.RiskAssessment) + return RiskAssessment43_50.convertRiskAssessment((org.hl7.fhir.r5.model.RiskAssessment) src); + if (src instanceof org.hl7.fhir.r5.model.Schedule) + return Schedule43_50.convertSchedule((org.hl7.fhir.r5.model.Schedule) src); + if (src instanceof org.hl7.fhir.r5.model.SearchParameter) + return SearchParameter43_50.convertSearchParameter((org.hl7.fhir.r5.model.SearchParameter) src); + if (src instanceof org.hl7.fhir.r5.model.ServiceRequest) + return ServiceRequest43_50.convertServiceRequest((org.hl7.fhir.r5.model.ServiceRequest) src); + if (src instanceof org.hl7.fhir.r5.model.Slot) return Slot43_50.convertSlot((org.hl7.fhir.r5.model.Slot) src); + if (src instanceof org.hl7.fhir.r5.model.Specimen) + return Specimen43_50.convertSpecimen((org.hl7.fhir.r5.model.Specimen) src); + if (src instanceof org.hl7.fhir.r5.model.SpecimenDefinition) + return SpecimenDefinition43_50.convertSpecimenDefinition((org.hl7.fhir.r5.model.SpecimenDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.StructureDefinition) + return StructureDefinition43_50.convertStructureDefinition((org.hl7.fhir.r5.model.StructureDefinition) src); + if (src instanceof org.hl7.fhir.r5.model.StructureMap) + return StructureMap43_50.convertStructureMap((org.hl7.fhir.r5.model.StructureMap) src); + if (src instanceof org.hl7.fhir.r5.model.Substance) + return Substance43_50.convertSubstance((org.hl7.fhir.r5.model.Substance) src); + if (src instanceof org.hl7.fhir.r5.model.SupplyDelivery) + return SupplyDelivery43_50.convertSupplyDelivery((org.hl7.fhir.r5.model.SupplyDelivery) src); + if (src instanceof org.hl7.fhir.r5.model.SupplyRequest) + return SupplyRequest43_50.convertSupplyRequest((org.hl7.fhir.r5.model.SupplyRequest) src); + if (src instanceof org.hl7.fhir.r5.model.Task) return Task43_50.convertTask((org.hl7.fhir.r5.model.Task) src); + if (src instanceof org.hl7.fhir.r5.model.TerminologyCapabilities) + return TerminologyCapabilities43_50.convertTerminologyCapabilities((org.hl7.fhir.r5.model.TerminologyCapabilities) src); + if (src instanceof org.hl7.fhir.r5.model.TestReport) + return TestReport43_50.convertTestReport((org.hl7.fhir.r5.model.TestReport) src); + if (src instanceof org.hl7.fhir.r5.model.TestScript) + return TestScript43_50.convertTestScript((org.hl7.fhir.r5.model.TestScript) src); + if (src instanceof org.hl7.fhir.r5.model.ValueSet) + return ValueSet43_50.convertValueSet((org.hl7.fhir.r5.model.ValueSet) src); + if (src instanceof org.hl7.fhir.r5.model.VerificationResult) + return VerificationResult43_50.convertVerificationResult((org.hl7.fhir.r5.model.VerificationResult) src); + if (src instanceof org.hl7.fhir.r5.model.VisionPrescription) + return VisionPrescription43_50.convertVisionPrescription((org.hl7.fhir.r5.model.VisionPrescription) src); + if (advisor.failFastOnNullOrUnknownEntry()) { + throw new FHIRException("Unknown resource " + src.fhirType()); + } else { + return null; + } + } + + public void copyDomainResource(org.hl7.fhir.r4b.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException { + copyResource(src, tgt); + if (src.hasText()) tgt.setText(Narrative43_50.convertNarrative(src.getText())); + src.getContained().stream() + .map(this::convertResource) + .forEach(tgt::addContained); + src.getExtension().forEach(extension -> { + if (advisor.useAdvisorForExtension(ConversionContext43_50.INSTANCE.path(), extension)) { + org.hl7.fhir.r5.model.Extension convertExtension = new org.hl7.fhir.r5.model.Extension(); + advisor.handleExtension(ConversionContext43_50.INSTANCE.path(), extension, convertExtension); + tgt.addExtension(convertExtension); + } else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension)) { + tgt.addExtension(Extension43_50.convertExtension(extension)); + } + }); + src.getModifierExtension().stream() + .filter(extension -> !advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension)) + .map(Extension43_50::convertExtension) + .forEach(tgt::addModifierExtension); + } + + public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.r4b.model.DomainResource tgt) throws FHIRException { + copyResource(src, tgt); + if (src.hasText()) tgt.setText(Narrative43_50.convertNarrative(src.getText())); + src.getContained().stream() + .map(this::convertResource) + .forEach(tgt::addContained); + src.getExtension().forEach(extension -> { + if (advisor.useAdvisorForExtension(ConversionContext43_50.INSTANCE.path(), extension)) { + org.hl7.fhir.r4b.model.Extension convertExtension = new org.hl7.fhir.r4b.model.Extension(); + advisor.handleExtension(ConversionContext43_50.INSTANCE.path(), extension, convertExtension); + tgt.addExtension(convertExtension); + } else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension)) { + tgt.addExtension(Extension43_50.convertExtension(extension)); + } + }); + src.getModifierExtension().stream() + .filter(extension -> !advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension)) + .map(Extension43_50::convertExtension) + .forEach(tgt::addModifierExtension); + } +} 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 new file mode 100644 index 000000000..69e412aaa --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/RiskAssessment43_50.java @@ -0,0 +1,239 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class RiskAssessment43_50 { + + public static org.hl7.fhir.r5.model.RiskAssessment convertRiskAssessment(org.hl7.fhir.r4b.model.RiskAssessment src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RiskAssessment tgt = new org.hl7.fhir.r5.model.RiskAssessment(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasBasedOn()) + tgt.setBasedOn(Reference43_50.convertReference(src.getBasedOn())); + if (src.hasParent()) + tgt.setParent(Reference43_50.convertReference(src.getParent())); + if (src.hasStatus()) + tgt.setStatusElement(convertRiskAssessmentStatus(src.getStatusElement())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasCondition()) + tgt.setCondition(Reference43_50.convertReference(src.getCondition())); + if (src.hasPerformer()) + tgt.setPerformer(Reference43_50.convertReference(src.getPerformer())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasis()) tgt.addBasis(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) + tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + if (src.hasMitigation()) + tgt.setMitigationElement(String43_50.convertString(src.getMitigationElement())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.RiskAssessment convertRiskAssessment(org.hl7.fhir.r5.model.RiskAssessment src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.RiskAssessment tgt = new org.hl7.fhir.r4b.model.RiskAssessment(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasBasedOn()) + tgt.setBasedOn(Reference43_50.convertReference(src.getBasedOn())); + if (src.hasParent()) + tgt.setParent(Reference43_50.convertReference(src.getParent())); + if (src.hasStatus()) + tgt.setStatusElement(convertRiskAssessmentStatus(src.getStatusElement())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasCondition()) + tgt.setCondition(Reference43_50.convertReference(src.getCondition())); + if (src.hasPerformer()) + tgt.setPerformer(Reference43_50.convertReference(src.getPerformer())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Reference t : src.getBasis()) tgt.addBasis(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent t : src.getPrediction()) + tgt.addPrediction(convertRiskAssessmentPredictionComponent(t)); + if (src.hasMitigation()) + tgt.setMitigationElement(String43_50.convertString(src.getMitigationElement())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent convertRiskAssessmentPredictionComponent(org.hl7.fhir.r4b.model.RiskAssessment.RiskAssessmentPredictionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOutcome()) + tgt.setOutcome(CodeableConcept43_50.convertCodeableConcept(src.getOutcome())); + if (src.hasProbability()) + tgt.setProbability(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProbability())); + if (src.hasQualitativeRisk()) + tgt.setQualitativeRisk(CodeableConcept43_50.convertCodeableConcept(src.getQualitativeRisk())); + if (src.hasRelativeRisk()) + tgt.setRelativeRiskElement(Decimal43_50.convertDecimal(src.getRelativeRiskElement())); + if (src.hasWhen()) + tgt.setWhen(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getWhen())); + if (src.hasRationale()) + tgt.setRationaleElement(String43_50.convertString(src.getRationaleElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.RiskAssessment.RiskAssessmentPredictionComponent convertRiskAssessmentPredictionComponent(org.hl7.fhir.r5.model.RiskAssessment.RiskAssessmentPredictionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.RiskAssessment.RiskAssessmentPredictionComponent tgt = new org.hl7.fhir.r4b.model.RiskAssessment.RiskAssessmentPredictionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOutcome()) + tgt.setOutcome(CodeableConcept43_50.convertCodeableConcept(src.getOutcome())); + if (src.hasProbability()) + tgt.setProbability(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProbability())); + if (src.hasQualitativeRisk()) + tgt.setQualitativeRisk(CodeableConcept43_50.convertCodeableConcept(src.getQualitativeRisk())); + if (src.hasRelativeRisk()) + tgt.setRelativeRiskElement(Decimal43_50.convertDecimal(src.getRelativeRiskElement())); + if (src.hasWhen()) + tgt.setWhen(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getWhen())); + if (src.hasRationale()) + tgt.setRationaleElement(String43_50.convertString(src.getRationaleElement())); + 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/Schedule43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Schedule43_50.java new file mode 100644 index 000000000..c986a9269 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Schedule43_50.java @@ -0,0 +1,90 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Schedule43_50 { + + public static org.hl7.fhir.r5.model.Schedule convertSchedule(org.hl7.fhir.r4b.model.Schedule src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Schedule tgt = new org.hl7.fhir.r5.model.Schedule(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getServiceCategory()) + tgt.addServiceCategory(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getServiceType()) + tgt.addServiceType(new CodeableReference().setConcept(CodeableConcept43_50.convertCodeableConcept(t))); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getActor()) tgt.addActor(Reference43_50.convertReference(t)); + if (src.hasPlanningHorizon()) + tgt.setPlanningHorizon(Period43_50.convertPeriod(src.getPlanningHorizon())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Schedule convertSchedule(org.hl7.fhir.r5.model.Schedule src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Schedule tgt = new org.hl7.fhir.r4b.model.Schedule(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasActive()) + tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory()) + tgt.addServiceCategory(CodeableConcept43_50.convertCodeableConcept(t)); + for (CodeableReference t : src.getServiceType()) + if (t.hasConcept()) + tgt.addServiceType(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getActor()) tgt.addActor(Reference43_50.convertReference(t)); + if (src.hasPlanningHorizon()) + tgt.setPlanningHorizon(Period43_50.convertPeriod(src.getPlanningHorizon())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + 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/SearchParameter43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java new file mode 100644 index 000000000..25c9962d3 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java @@ -0,0 +1,413 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CodeType; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class SearchParameter43_50 { + + public static org.hl7.fhir.r5.model.SearchParameter convertSearchParameter(org.hl7.fhir.r4b.model.SearchParameter src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SearchParameter tgt = new org.hl7.fhir.r5.model.SearchParameter(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDerivedFrom()) + tgt.setDerivedFromElement(Canonical43_50.convertCanonical(src.getDerivedFromElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + for (org.hl7.fhir.r4b.model.CodeType t : src.getBase()) tgt.getBase().add(Code43_50.convertResourceEnum(t)); + if (src.hasType()) + tgt.setTypeElement(Enumerations43_50.convertSearchParamType(src.getTypeElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasXpath()) + tgt.setXpathElement(String43_50.convertString(src.getXpathElement())); + if (src.hasXpathUsage()) + tgt.setXpathUsageElement(convertXPathUsageType(src.getXpathUsageElement())); + for (org.hl7.fhir.r4b.model.CodeType t : src.getTarget()) tgt.getTarget().add(Code43_50.convertResourceEnum(t)); + if (src.hasMultipleOr()) + tgt.setMultipleOrElement(Boolean43_50.convertBoolean(src.getMultipleOrElement())); + if (src.hasMultipleAnd()) + tgt.setMultipleAndElement(Boolean43_50.convertBoolean(src.getMultipleAndElement())); + tgt.setComparator(src.getComparator().stream() + .map(SearchParameter43_50::convertSearchComparator) + .collect(Collectors.toList())); + tgt.setModifier(src.getModifier().stream() + .map(SearchParameter43_50::convertSearchModifierCode) + .collect(Collectors.toList())); + for (org.hl7.fhir.r4b.model.StringType t : src.getChain()) tgt.getChain().add(String43_50.convertString(t)); + for (org.hl7.fhir.r4b.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) + tgt.addComponent(convertSearchParameterComponentComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SearchParameter convertSearchParameter(org.hl7.fhir.r5.model.SearchParameter src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SearchParameter tgt = new org.hl7.fhir.r4b.model.SearchParameter(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDerivedFrom()) + tgt.setDerivedFromElement(Canonical43_50.convertCanonical(src.getDerivedFromElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + for (CodeType t : src.getBase()) tgt.getBase().add(Code43_50.convertResourceEnum(t)); + if (src.hasType()) + tgt.setTypeElement(Enumerations43_50.convertSearchParamType(src.getTypeElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasXpath()) + tgt.setXpathElement(String43_50.convertString(src.getXpathElement())); + if (src.hasXpathUsage()) + tgt.setXpathUsageElement(convertXPathUsageType(src.getXpathUsageElement())); + for (CodeType t : src.getTarget()) tgt.getTarget().add(Code43_50.convertResourceEnum(t)); + if (src.hasMultipleOr()) + tgt.setMultipleOrElement(Boolean43_50.convertBoolean(src.getMultipleOrElement())); + if (src.hasMultipleAnd()) + tgt.setMultipleAndElement(Boolean43_50.convertBoolean(src.getMultipleAndElement())); + tgt.setComparator(src.getComparator().stream() + .map(SearchParameter43_50::convertSearchComparator) + .collect(Collectors.toList())); + tgt.setModifier(src.getModifier().stream() + .map(SearchParameter43_50::convertSearchModifierCode) + .collect(Collectors.toList())); + for (org.hl7.fhir.r5.model.StringType t : src.getChain()) tgt.getChain().add(String43_50.convertString(t)); + for (org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) + tgt.addComponent(convertSearchParameterComponentComponent(t)); + return tgt; + } + + 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.XPathUsageTypeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case NORMAL: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NORMAL); + break; + case PHONETIC: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.PHONETIC); + break; + case NEARBY: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.OTHER); + break; + case DISTANCE: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.OTHER); + break; + case OTHER: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.OTHER); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.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; + } + + 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.SearchParameter.SearchComparatorEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case EQ: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.EQ); + break; + case NE: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.NE); + break; + case GT: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.GT); + break; + case LT: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.LT); + break; + case GE: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.GE); + break; + case LE: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.LE); + break; + case SA: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.SA); + break; + case EB: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.EB); + break; + case AP: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.AP); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.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; + } + + 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.SearchParameter.SearchModifierCodeEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r4b.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r4b.model.SearchParameter.SearchParameterComponentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDefinition()) + tgt.setDefinitionElement(Canonical43_50.convertCanonical(src.getDefinitionElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + 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/ServiceRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ServiceRequest43_50.java new file mode 100644 index 000000000..a28f1ca27 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ServiceRequest43_50.java @@ -0,0 +1,380 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ServiceRequest43_50 { + + public static org.hl7.fhir.r5.model.ServiceRequest convertServiceRequest(org.hl7.fhir.r4b.model.ServiceRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ServiceRequest tgt = new org.hl7.fhir.r5.model.ServiceRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t)); + if (src.hasRequisition()) + tgt.setRequisition(Identifier43_50.convertIdentifier(src.getRequisition())); + if (src.hasStatus()) + tgt.setStatusElement(convertServiceRequestStatus(src.getStatusElement())); + if (src.hasIntent()) + tgt.setIntentElement(convertServiceRequestIntent(src.getIntentElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriorityElement(convertServiceRequestPriority(src.getPriorityElement())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getOrderDetail()) + tgt.addOrderDetail(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getQuantity())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasAsNeeded()) + tgt.setAsNeeded(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAsNeeded())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + if (src.hasPerformerType()) + tgt.setPerformerType(CodeableConcept43_50.convertCodeableConcept(src.getPerformerType())); + for (org.hl7.fhir.r4b.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getLocationCode()) + tgt.addLocation(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getLocationReference()) + tgt.addLocation(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getSpecimen()) tgt.addSpecimen(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getBodySite()) + tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasPatientInstruction()) + tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getRelevantHistory()) + tgt.addRelevantHistory(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ServiceRequest convertServiceRequest(org.hl7.fhir.r5.model.ServiceRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ServiceRequest tgt = new org.hl7.fhir.r4b.model.ServiceRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical()) + tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri()) + tgt.getInstantiatesUri().add(Uri43_50.convertUri(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t)); + if (src.hasRequisition()) + tgt.setRequisition(Identifier43_50.convertIdentifier(src.getRequisition())); + if (src.hasStatus()) + tgt.setStatusElement(convertServiceRequestStatus(src.getStatusElement())); + if (src.hasIntent()) + tgt.setIntentElement(convertServiceRequestIntent(src.getIntentElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPriority()) + tgt.setPriorityElement(convertServiceRequestPriority(src.getPriorityElement())); + if (src.hasDoNotPerform()) + tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getOrderDetail()) + tgt.addOrderDetail(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasQuantity()) + tgt.setQuantity(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getQuantity())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasAsNeeded()) + tgt.setAsNeeded(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAsNeeded())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + if (src.hasPerformerType()) + tgt.setPerformerType(CodeableConcept43_50.convertCodeableConcept(src.getPerformerType())); + for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t)); + for (CodeableReference t : src.getLocation()) + if (t.hasConcept()) + tgt.addLocationCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getLocation()) + if (t.hasReference()) + tgt.addLocationReference(Reference43_50.convertReference(t.getReference())); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo()) + tgt.addSupportingInfo(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen()) tgt.addSpecimen(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite()) + tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + if (src.hasPatientInstruction()) + tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) + tgt.addRelevantHistory(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..b7f0119b1 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Slot43_50.java @@ -0,0 +1,160 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Slot43_50 { + + public static org.hl7.fhir.r5.model.Slot convertSlot(org.hl7.fhir.r4b.model.Slot src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Slot tgt = new org.hl7.fhir.r5.model.Slot(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getServiceCategory()) + tgt.addServiceCategory(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getServiceType()) + tgt.addServiceType(new CodeableReference().setConcept(CodeableConcept43_50.convertCodeableConcept(t))); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasAppointmentType()) + tgt.addAppointmentType(CodeableConcept43_50.convertCodeableConcept(src.getAppointmentType())); + if (src.hasSchedule()) + tgt.setSchedule(Reference43_50.convertReference(src.getSchedule())); + if (src.hasStatus()) + tgt.setStatusElement(convertSlotStatus(src.getStatusElement())); + if (src.hasStart()) + tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement())); + if (src.hasOverbooked()) + tgt.setOverbookedElement(Boolean43_50.convertBoolean(src.getOverbookedElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Slot convertSlot(org.hl7.fhir.r5.model.Slot src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Slot tgt = new org.hl7.fhir.r4b.model.Slot(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory()) + tgt.addServiceCategory(CodeableConcept43_50.convertCodeableConcept(t)); + for (CodeableReference t : src.getServiceType()) + if (t.hasConcept()) + tgt.addServiceType(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty()) + tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasAppointmentType()) + tgt.setAppointmentType(CodeableConcept43_50.convertCodeableConcept(src.getAppointmentTypeFirstRep())); + if (src.hasSchedule()) + tgt.setSchedule(Reference43_50.convertReference(src.getSchedule())); + if (src.hasStatus()) + tgt.setStatusElement(convertSlotStatus(src.getStatusElement())); + if (src.hasStart()) + tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement())); + if (src.hasEnd()) + tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement())); + if (src.hasOverbooked()) + tgt.setOverbookedElement(Boolean43_50.convertBoolean(src.getOverbookedElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + 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; + } + + 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; + } +} \ 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 new file mode 100644 index 000000000..877a99d98 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Specimen43_50.java @@ -0,0 +1,266 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Specimen43_50 { + + public static org.hl7.fhir.r5.model.Specimen convertSpecimen(org.hl7.fhir.r4b.model.Specimen src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Specimen tgt = new org.hl7.fhir.r5.model.Specimen(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasAccessionIdentifier()) + tgt.setAccessionIdentifier(Identifier43_50.convertIdentifier(src.getAccessionIdentifier())); + if (src.hasStatus()) + tgt.setStatusElement(convertSpecimenStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasReceivedTime()) + tgt.setReceivedTimeElement(DateTime43_50.convertDateTime(src.getReceivedTimeElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getParent()) tgt.addParent(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getRequest()) tgt.addRequest(Reference43_50.convertReference(t)); + if (src.hasCollection()) + tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); + for (org.hl7.fhir.r4b.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) + tgt.addProcessing(convertSpecimenProcessingComponent(t)); + for (org.hl7.fhir.r4b.model.Specimen.SpecimenContainerComponent t : src.getContainer()) + tgt.addContainer(convertSpecimenContainerComponent(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCondition()) + tgt.addCondition(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Specimen convertSpecimen(org.hl7.fhir.r5.model.Specimen src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Specimen tgt = new org.hl7.fhir.r4b.model.Specimen(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasAccessionIdentifier()) + tgt.setAccessionIdentifier(Identifier43_50.convertIdentifier(src.getAccessionIdentifier())); + if (src.hasStatus()) + tgt.setStatusElement(convertSpecimenStatus(src.getStatusElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSubject()) + tgt.setSubject(Reference43_50.convertReference(src.getSubject())); + if (src.hasReceivedTime()) + tgt.setReceivedTimeElement(DateTime43_50.convertDateTime(src.getReceivedTimeElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getParent()) tgt.addParent(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) tgt.addRequest(Reference43_50.convertReference(t)); + if (src.hasCollection()) + tgt.setCollection(convertSpecimenCollectionComponent(src.getCollection())); + for (org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent t : src.getProcessing()) + tgt.addProcessing(convertSpecimenProcessingComponent(t)); + for (org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent t : src.getContainer()) + tgt.addContainer(convertSpecimenContainerComponent(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCondition()) + tgt.addCondition(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.r4b.model.Specimen.SpecimenCollectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCollector()) + tgt.setCollector(Reference43_50.convertReference(src.getCollector())); + if (src.hasCollected()) + tgt.setCollected(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCollected())); + if (src.hasDuration()) + tgt.setDuration(Duration43_50.convertDuration(src.getDuration())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.hasBodySite()) + tgt.getBodySite().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getBodySite())); + if (src.hasFastingStatus()) + tgt.setFastingStatus(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getFastingStatus())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.r5.model.Specimen.SpecimenCollectionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Specimen.SpecimenCollectionComponent tgt = new org.hl7.fhir.r4b.model.Specimen.SpecimenCollectionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCollector()) + tgt.setCollector(Reference43_50.convertReference(src.getCollector())); + if (src.hasCollected()) + tgt.setCollected(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCollected())); + if (src.hasDuration()) + tgt.setDuration(Duration43_50.convertDuration(src.getDuration())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasMethod()) + tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod())); + if (src.getBodySite().hasConcept()) + tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite().getConcept())); + if (src.hasFastingStatus()) + tgt.setFastingStatus(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getFastingStatus())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent convertSpecimenProcessingComponent(org.hl7.fhir.r4b.model.Specimen.SpecimenProcessingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasProcedure()) +// tgt.setProcedure(CodeableConcept43_50.convertCodeableConcept(src.getProcedure())); + for (org.hl7.fhir.r4b.model.Reference t : src.getAdditive()) tgt.addAdditive(Reference43_50.convertReference(t)); + if (src.hasTime()) + tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Specimen.SpecimenProcessingComponent convertSpecimenProcessingComponent(org.hl7.fhir.r5.model.Specimen.SpecimenProcessingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Specimen.SpecimenProcessingComponent tgt = new org.hl7.fhir.r4b.model.Specimen.SpecimenProcessingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasProcedure()) +// tgt.setProcedure(CodeableConcept43_50.convertCodeableConcept(src.getProcedure())); + for (org.hl7.fhir.r5.model.Reference t : src.getAdditive()) tgt.addAdditive(Reference43_50.convertReference(t)); + if (src.hasTime()) + tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent convertSpecimenContainerComponent(org.hl7.fhir.r4b.model.Specimen.SpecimenContainerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); +// for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) +// tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); +// if (src.hasDescription()) +// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasType()) +// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// if (src.hasCapacity()) +// tgt.setCapacity(SimpleQuantity43_50.convertSimpleQuantity(src.getCapacity())); +// if (src.hasSpecimenQuantity()) +// tgt.setSpecimenQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getSpecimenQuantity())); +// if (src.hasAdditive()) +// tgt.setAdditive(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAdditive())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Specimen.SpecimenContainerComponent convertSpecimenContainerComponent(org.hl7.fhir.r5.model.Specimen.SpecimenContainerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Specimen.SpecimenContainerComponent tgt = new org.hl7.fhir.r4b.model.Specimen.SpecimenContainerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); +// for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) +// tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); +// if (src.hasDescription()) +// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); +// if (src.hasType()) +// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); +// if (src.hasCapacity()) +// tgt.setCapacity(SimpleQuantity43_50.convertSimpleQuantity(src.getCapacity())); +// if (src.hasSpecimenQuantity()) +// tgt.setSpecimenQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getSpecimenQuantity())); +// if (src.hasAdditive()) +// tgt.setAdditive(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAdditive())); + 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/SpecimenDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SpecimenDefinition43_50.java new file mode 100644 index 000000000..239642dcd --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SpecimenDefinition43_50.java @@ -0,0 +1,265 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class SpecimenDefinition43_50 { + + public static org.hl7.fhir.r5.model.SpecimenDefinition convertSpecimenDefinition(org.hl7.fhir.r4b.model.SpecimenDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition tgt = new org.hl7.fhir.r5.model.SpecimenDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasTypeCollected()) + tgt.setTypeCollected(CodeableConcept43_50.convertCodeableConcept(src.getTypeCollected())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPatientPreparation()) + tgt.addPatientPreparation(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasTimeAspect()) + tgt.setTimeAspectElement(String43_50.convertString(src.getTimeAspectElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCollection()) + tgt.addCollection(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent t : src.getTypeTested()) + tgt.addTypeTested(convertSpecimenDefinitionTypeTestedComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SpecimenDefinition convertSpecimenDefinition(org.hl7.fhir.r5.model.SpecimenDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SpecimenDefinition tgt = new org.hl7.fhir.r4b.model.SpecimenDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasTypeCollected()) + tgt.setTypeCollected(CodeableConcept43_50.convertCodeableConcept(src.getTypeCollected())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPatientPreparation()) + tgt.addPatientPreparation(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasTimeAspect()) + tgt.setTimeAspectElement(String43_50.convertString(src.getTimeAspectElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCollection()) + tgt.addCollection(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent t : src.getTypeTested()) + tgt.addTypeTested(convertSpecimenDefinitionTypeTestedComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent convertSpecimenDefinitionTypeTestedComponent(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIsDerived()) + tgt.setIsDerivedElement(Boolean43_50.convertBoolean(src.getIsDerivedElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasPreference()) + tgt.setPreferenceElement(convertSpecimenContainedPreference(src.getPreferenceElement())); + if (src.hasContainer()) + tgt.setContainer(convertSpecimenDefinitionTypeTestedContainerComponent(src.getContainer())); + if (src.hasRequirement()) + tgt.setRequirementElement(String43_50.convertString(src.getRequirementElement())); + if (src.hasRetentionTime()) + tgt.setRetentionTime(Duration43_50.convertDuration(src.getRetentionTime())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getRejectionCriterion()) + tgt.addRejectionCriterion(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent t : src.getHandling()) + tgt.addHandling(convertSpecimenDefinitionTypeTestedHandlingComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent convertSpecimenDefinitionTypeTestedComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent tgt = new org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIsDerived()) + tgt.setIsDerivedElement(Boolean43_50.convertBoolean(src.getIsDerivedElement())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasPreference()) + tgt.setPreferenceElement(convertSpecimenContainedPreference(src.getPreferenceElement())); + if (src.hasContainer()) + tgt.setContainer(convertSpecimenDefinitionTypeTestedContainerComponent(src.getContainer())); + if (src.hasRequirement()) + tgt.setRequirementElement(String43_50.convertString(src.getRequirementElement())); + if (src.hasRetentionTime()) + tgt.setRetentionTime(Duration43_50.convertDuration(src.getRetentionTime())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRejectionCriterion()) + tgt.addRejectionCriterion(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent t : src.getHandling()) + tgt.addHandling(convertSpecimenDefinitionTypeTestedHandlingComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent convertSpecimenDefinitionTypeTestedContainerComponent(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMaterial()) + tgt.setMaterial(CodeableConcept43_50.convertCodeableConcept(src.getMaterial())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasCap()) + tgt.setCap(CodeableConcept43_50.convertCodeableConcept(src.getCap())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCapacity()) + tgt.setCapacity(SimpleQuantity43_50.convertSimpleQuantity(src.getCapacity())); + if (src.hasMinimumVolume()) + tgt.setMinimumVolume(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMinimumVolume())); + for (org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent t : src.getAdditive()) + tgt.addAdditive(convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(t)); + if (src.hasPreparation()) + tgt.setPreparationElement(String43_50.convertString(src.getPreparationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent convertSpecimenDefinitionTypeTestedContainerComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent tgt = new org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasMaterial()) + tgt.setMaterial(CodeableConcept43_50.convertCodeableConcept(src.getMaterial())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasCap()) + tgt.setCap(CodeableConcept43_50.convertCodeableConcept(src.getCap())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasCapacity()) + tgt.setCapacity(SimpleQuantity43_50.convertSimpleQuantity(src.getCapacity())); + if (src.hasMinimumVolume()) + tgt.setMinimumVolume(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMinimumVolume())); + for (org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent t : src.getAdditive()) + tgt.addAdditive(convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(t)); + if (src.hasPreparation()) + tgt.setPreparationElement(String43_50.convertString(src.getPreparationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAdditive()) + tgt.setAdditive(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAdditive())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent convertSpecimenDefinitionTypeTestedContainerAdditiveComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent tgt = new org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedContainerAdditiveComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAdditive()) + tgt.setAdditive(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAdditive())); + return tgt; + } + + public static org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent convertSpecimenDefinitionTypeTestedHandlingComponent(org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent tgt = new org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTemperatureQualifier()) + tgt.setTemperatureQualifier(CodeableConcept43_50.convertCodeableConcept(src.getTemperatureQualifier())); + if (src.hasTemperatureRange()) + tgt.setTemperatureRange(Range43_50.convertRange(src.getTemperatureRange())); + if (src.hasMaxDuration()) + tgt.setMaxDuration(Duration43_50.convertDuration(src.getMaxDuration())); + if (src.hasInstruction()) + tgt.setInstructionElement(String43_50.convertString(src.getInstructionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent convertSpecimenDefinitionTypeTestedHandlingComponent(org.hl7.fhir.r5.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent tgt = new org.hl7.fhir.r4b.model.SpecimenDefinition.SpecimenDefinitionTypeTestedHandlingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTemperatureQualifier()) + tgt.setTemperatureQualifier(CodeableConcept43_50.convertCodeableConcept(src.getTemperatureQualifier())); + if (src.hasTemperatureRange()) + tgt.setTemperatureRange(Range43_50.convertRange(src.getTemperatureRange())); + if (src.hasMaxDuration()) + tgt.setMaxDuration(Duration43_50.convertDuration(src.getMaxDuration())); + if (src.hasInstruction()) + tgt.setInstructionElement(String43_50.convertString(src.getInstructionElement())); + 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/StructureDefinition43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureDefinition43_50.java new file mode 100644 index 000000000..3b74f1910 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureDefinition43_50.java @@ -0,0 +1,393 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.ElementDefinition43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class StructureDefinition43_50 { + + public static org.hl7.fhir.r5.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r4b.model.StructureDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition tgt = new org.hl7.fhir.r5.model.StructureDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + for (org.hl7.fhir.r4b.model.Coding t : src.getKeyword()) tgt.addKeyword(Coding43_50.convertCoding(t)); + if (src.hasFhirVersion()) + tgt.setFhirVersionElement(Enumerations43_50.convertFHIRVersion(src.getFhirVersionElement())); + for (org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) + tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + if (src.hasKind()) + tgt.setKindElement(convertStructureDefinitionKind(src.getKindElement())); + if (src.hasAbstract()) + tgt.setAbstractElement(Boolean43_50.convertBoolean(src.getAbstractElement())); + for (org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) + tgt.addContext(convertStructureDefinitionContextComponent(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getContextInvariant()) + tgt.getContextInvariant().add(String43_50.convertString(t)); + if (src.hasType()) + tgt.setTypeElement(Uri43_50.convertUri(src.getTypeElement())); + if (src.hasBaseDefinition()) + tgt.setBaseDefinitionElement(Canonical43_50.convertCanonical(src.getBaseDefinitionElement())); + if (src.hasDerivation()) + tgt.setDerivationElement(convertTypeDerivationRule(src.getDerivationElement())); + if (src.hasSnapshot()) + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + if (src.hasDifferential()) + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r5.model.StructureDefinition src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureDefinition tgt = new org.hl7.fhir.r4b.model.StructureDefinition(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) tgt.addKeyword(Coding43_50.convertCoding(t)); + if (src.hasFhirVersion()) + tgt.setFhirVersionElement(Enumerations43_50.convertFHIRVersion(src.getFhirVersionElement())); + for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) + tgt.addMapping(convertStructureDefinitionMappingComponent(t)); + if (src.hasKind()) + tgt.setKindElement(convertStructureDefinitionKind(src.getKindElement())); + if (src.hasAbstract()) + tgt.setAbstractElement(Boolean43_50.convertBoolean(src.getAbstractElement())); + for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) + tgt.addContext(convertStructureDefinitionContextComponent(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getContextInvariant()) + tgt.getContextInvariant().add(String43_50.convertString(t)); + if (src.hasType()) + tgt.setTypeElement(Uri43_50.convertUri(src.getTypeElement())); + if (src.hasBaseDefinition()) + tgt.setBaseDefinitionElement(Canonical43_50.convertCanonical(src.getBaseDefinitionElement())); + if (src.hasDerivation()) + tgt.setDerivationElement(convertTypeDerivationRule(src.getDerivationElement())); + if (src.hasSnapshot()) + tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); + if (src.hasDifferential()) + tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentity()) + tgt.setIdentityElement(Id43_50.convertId(src.getIdentityElement())); + if (src.hasUri()) + tgt.setUriElement(Uri43_50.convertUri(src.getUriElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionMappingComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentity()) + tgt.setIdentityElement(Id43_50.convertId(src.getIdentityElement())); + if (src.hasUri()) + tgt.setUriElement(Uri43_50.convertUri(src.getUriElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasComment()) + tgt.setCommentElement(String43_50.convertString(src.getCommentElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent convertStructureDefinitionContextComponent(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertExtensionContextType(src.getTypeElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionContextComponent convertStructureDefinitionContextComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionContextComponent tgt = new org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionContextComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertExtensionContextType(src.getTypeElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.ElementDefinition t : src.getElement()) + tgt.addElement(ElementDefinition43_50.convertElementDefinition(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionSnapshotComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) + tgt.addElement(ElementDefinition43_50.convertElementDefinition(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.ElementDefinition t : src.getElement()) + tgt.addElement(ElementDefinition43_50.convertElementDefinition(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r4b.model.StructureDefinition.StructureDefinitionDifferentialComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) + tgt.addElement(ElementDefinition43_50.convertElementDefinition(t)); + 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/StructureMap43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureMap43_50.java new file mode 100644 index 000000000..f36315861 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/StructureMap43_50.java @@ -0,0 +1,871 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupTypeMode; +import org.hl7.fhir.r4b.utils.ToolingExtensions; +import org.hl7.fhir.r5.model.*; +import org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent; +import org.hl7.fhir.r5.utils.FHIRPathConstant; +import org.hl7.fhir.utilities.Utilities; + +import java.util.stream.Collectors; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class StructureMap43_50 { + + public static org.hl7.fhir.r5.model.StructureMap convertStructureMap(org.hl7.fhir.r4b.model.StructureMap src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap tgt = new org.hl7.fhir.r5.model.StructureMap(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + for (org.hl7.fhir.r4b.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) + tgt.addStructure(convertStructureMapStructureComponent(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getImport()) + tgt.getImport().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) + tgt.addGroup(convertStructureMapGroupComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureMap convertStructureMap(org.hl7.fhir.r5.model.StructureMap src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureMap tgt = new org.hl7.fhir.r4b.model.StructureMap(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + for (org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent t : src.getStructure()) + tgt.addStructure(convertStructureMapStructureComponent(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getImport()) + tgt.getImport().add(Canonical43_50.convertCanonical(t)); + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent t : src.getGroup()) + tgt.addGroup(convertStructureMapGroupComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Canonical43_50.convertCanonical(src.getUrlElement())); + if (src.hasMode()) + tgt.setModeElement(convertStructureMapModelMode(src.getModeElement())); + if (src.hasAlias()) + tgt.setAliasElement(String43_50.convertString(src.getAliasElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureMap.StructureMapStructureComponent convertStructureMapStructureComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapStructureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureMap.StructureMapStructureComponent tgt = new org.hl7.fhir.r4b.model.StructureMap.StructureMapStructureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Canonical43_50.convertCanonical(src.getUrlElement())); + if (src.hasMode()) + tgt.setModeElement(convertStructureMapModelMode(src.getModeElement())); + if (src.hasAlias()) + tgt.setAliasElement(String43_50.convertString(src.getAliasElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + if (src.hasExtends()) + tgt.setExtendsElement(Id43_50.convertId(src.getExtendsElement())); + if (src.hasTypeMode()) + tgt.setTypeModeElement(convertStructureMapGroupTypeMode(src.getTypeModeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + for (org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) + tgt.addInput(convertStructureMapGroupInputComponent(t)); + for (org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) + tgt.addRule(convertStructureMapGroupRuleComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupComponent convertStructureMapGroupComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupComponent tgt = new org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + if (src.hasExtends()) + tgt.setExtendsElement(Id43_50.convertId(src.getExtendsElement())); + if (src.hasTypeMode()) { + tgt.setTypeModeElement(convertStructureMapGroupTypeMode(src.getTypeModeElement())); + } else { + tgt.setTypeMode(StructureMapGroupTypeMode.NONE); + } + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent t : src.getInput()) + tgt.addInput(convertStructureMapGroupInputComponent(t)); + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) + tgt.addRule(convertStructureMapGroupRuleComponent(t)); + return tgt; + } + + 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; + } + + 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); + 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 { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + if (src.hasType()) + tgt.setTypeElement(String43_50.convertString(src.getTypeElement())); + if (src.hasMode()) + tgt.setModeElement(convertStructureMapInputMode(src.getModeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupInputComponent convertStructureMapGroupInputComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupInputComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupInputComponent tgt = new org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupInputComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + if (src.hasType()) + tgt.setTypeElement(String43_50.convertString(src.getTypeElement())); + if (src.hasMode()) + tgt.setModeElement(convertStructureMapInputMode(src.getModeElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + for (org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) + tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + for (org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) + tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + for (org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) + tgt.addRule(convertStructureMapGroupRuleComponent(t)); + for (org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) + tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleComponent convertStructureMapGroupRuleComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleComponent tgt = new org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent t : src.getSource()) + tgt.addSource(convertStructureMapGroupRuleSourceComponent(t)); + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent t : src.getTarget()) + tgt.addTarget(convertStructureMapGroupRuleTargetComponent(t)); + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleComponent t : src.getRule()) + tgt.addRule(convertStructureMapGroupRuleComponent(t)); + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent t : src.getDependent()) + tgt.addDependent(convertStructureMapGroupRuleDependentComponent(t)); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent convertStructureMapGroupRuleSourceComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContext()) + tgt.setContextElement(Id43_50.convertId(src.getContextElement())); + if (src.hasMin()) + tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasType()) + tgt.setTypeElement(String43_50.convertString(src.getTypeElement())); + if (src.hasDefaultValue()) + tgt.setDefaultValueElement((StringType) ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDefaultValue())); + if (src.hasElement()) + tgt.setElementElement(String43_50.convertString(src.getElementElement())); + if (src.hasListMode()) + tgt.setListModeElement(convertStructureMapSourceListMode(src.getListModeElement())); + if (src.hasVariable()) + tgt.setVariableElement(Id43_50.convertId(src.getVariableElement())); + if (src.hasCondition()) + tgt.setConditionElement(String43_50.convertString(src.getConditionElement())); + if (src.hasCheck()) + tgt.setCheckElement(String43_50.convertString(src.getCheckElement())); + if (src.hasLogMessage()) + tgt.setLogMessageElement(String43_50.convertString(src.getLogMessageElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleSourceComponent convertStructureMapGroupRuleSourceComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleSourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleSourceComponent tgt = new org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleSourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContext()) + tgt.setContextElement(Id43_50.convertId(src.getContextElement())); + if (src.hasMin()) + tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement())); + if (src.hasMax()) + tgt.setMaxElement(String43_50.convertString(src.getMaxElement())); + if (src.hasType()) + tgt.setTypeElement(String43_50.convertString(src.getTypeElement())); + if (src.hasDefaultValue()) + tgt.setDefaultValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDefaultValueElement())); + if (src.hasElement()) + tgt.setElementElement(String43_50.convertString(src.getElementElement())); + if (src.hasListMode()) + tgt.setListModeElement(convertStructureMapSourceListMode(src.getListModeElement())); + if (src.hasVariable()) + tgt.setVariableElement(Id43_50.convertId(src.getVariableElement())); + if (src.hasCondition()) + tgt.setConditionElement(String43_50.convertString(src.getConditionElement())); + if (src.hasCheck()) + tgt.setCheckElement(String43_50.convertString(src.getCheckElement())); + if (src.hasLogMessage()) + tgt.setLogMessageElement(String43_50.convertString(src.getLogMessageElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContext()) + tgt.setContextElement(Id43_50.convertId(src.getContextElement())); + if (src.hasContextType() && src.getContextType() != org.hl7.fhir.r4b.model.StructureMap.StructureMapContextType.VARIABLE) + throw new Error("This conversion is not supported. Consult code maintainers"); // this should never happens - no one knows what the intent was here. + if (src.hasElement()) + tgt.setElementElement(String43_50.convertString(src.getElementElement())); + if (src.hasVariable()) + tgt.setVariableElement(Id43_50.convertId(src.getVariableElement())); + tgt.setListMode(src.getListMode().stream() + .map(StructureMap43_50::convertStructureMapTargetListMode) + .collect(Collectors.toList())); + if (src.hasListRuleId()) + tgt.setListRuleIdElement(Id43_50.convertId(src.getListRuleIdElement())); + if (src.hasTransform()) + tgt.setTransformElement(convertStructureMapTransform(src.getTransformElement())); + for (org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) + tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetComponent convertStructureMapGroupRuleTargetComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetComponent tgt = new org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasContext()) + tgt.setContextElement(Id43_50.convertId(src.getContextElement())); + tgt.setContextType(org.hl7.fhir.r4b.model.StructureMap.StructureMapContextType.VARIABLE); + if (src.hasElement()) + tgt.setElementElement(String43_50.convertString(src.getElementElement())); + if (src.hasVariable()) + tgt.setVariableElement(Id43_50.convertId(src.getVariableElement())); + tgt.setListMode(src.getListMode().stream() + .map(StructureMap43_50::convertStructureMapTargetListMode) + .collect(Collectors.toList())); + if (src.hasListRuleId()) + tgt.setListRuleIdElement(Id43_50.convertId(src.getListRuleIdElement())); + if (src.hasTransform()) + tgt.setTransformElement(convertStructureMapTransform(src.getTransformElement())); + for (org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) + tgt.addParameter(convertStructureMapGroupRuleTargetParameterComponent(t)); + return tgt; + } + + 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.COLLATE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.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 COLLATE: + 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; + } + + 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; + } + + //DIRTY + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent convertStructureMapGroupRuleTargetParameterComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + + public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetParameterComponent convertStructureMapGroupRuleTargetParameterComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetParameterComponent tgt = new org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleTargetParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + //DIRTY + public static org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + for (org.hl7.fhir.r4b.model.StringType t : src.getVariable()) tgt.addParameter().setValue(convertVariableStringToParameterDataType(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.DataType convertVariableStringToParameterDataType(org.hl7.fhir.r4b.model.StringType it) { + org.hl7.fhir.r4b.model.Extension originalElementType = it.getExtensionByUrl(ToolingExtensions.EXT_ORIGINAL_ELEMENT_TYPE); + + return originalElementType != null ? convertVariableStringToParameterDataType(it, originalElementType) : convertVariableStringToGuessedParameterDataType(it); + } + + public static org.hl7.fhir.r5.model.DataType convertVariableStringToParameterDataType(org.hl7.fhir.r4b.model.StringType it, org.hl7.fhir.r4b.model.Extension originalElementType) { + if (!(originalElementType.getValue() instanceof org.hl7.fhir.r4b.model.UrlType)) { + throw new FHIRException(""); + } + org.hl7.fhir.r4b.model.UrlType url = (org.hl7.fhir.r4b.model.UrlType)originalElementType.getValue(); + switch (url.getValueAsString()) { + case "id" : return it.hasValue() ? new org.hl7.fhir.r5.model.IdType(it.getValueAsString()) : new org.hl7.fhir.r5.model.IdType(); + case "string" : return it.hasValue() ? new org.hl7.fhir.r5.model.StringType(it.getValueAsString()) : new org.hl7.fhir.r5.model.StringType(); + case "integer" : return it.hasValue() ? new org.hl7.fhir.r5.model.IntegerType(it.getValueAsString()) : new org.hl7.fhir.r5.model.IntegerType(); + case "decimal" : return it.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(it.getValueAsString()) : new org.hl7.fhir.r5.model.DecimalType(); + case "boolean" : return it.hasValue() ? new org.hl7.fhir.r5.model.BooleanType(it.getValueAsString()) : new org.hl7.fhir.r5.model.BooleanType(); + } + return null; + } + + public static org.hl7.fhir.r5.model.DataType convertVariableStringToGuessedParameterDataType(org.hl7.fhir.r4b.model.StringType it) { + final String stringValue = it.asStringValue(); + if (!FHIRPathConstant.isFHIRPathConstant(stringValue)) { + return new IdType(stringValue); + } else if (FHIRPathConstant.isFHIRPathStringConstant(stringValue)) + return new StringType(stringValue); + else { + return convertVariableStringToGuessedParameterConstantType(stringValue); + } + } + + public static DataType convertVariableStringToGuessedParameterConstantType(String stringValue) { + if (Utilities.isInteger(stringValue)) + return new IntegerType(stringValue); + else if (Utilities.isDecimal(stringValue, false)) + return new DecimalType(stringValue); + else if (Utilities.existsInList(stringValue, "true", "false")) + return new BooleanType(stringValue.equals("true")); + else + return new StringType(stringValue); + } + + //DIRTY + public static org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleDependentComponent convertStructureMapGroupRuleDependentComponent(org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleDependentComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleDependentComponent tgt = new org.hl7.fhir.r4b.model.StructureMap.StructureMapGroupRuleDependentComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Id43_50.convertId(src.getNameElement())); + for (StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) { + tgt.getVariable().add(convertStructureMapGroupRuleTargetParameterComponentToString(t)); + } + return tgt; + } + + public static org.hl7.fhir.r4b.model.StringType convertStructureMapGroupRuleTargetParameterComponentToString(StructureMapGroupRuleTargetParameterComponent src) { + org.hl7.fhir.r4b.model.StringType tgt = new org.hl7.fhir.r4b.model.StringType(); + org.hl7.fhir.instance.model.api.IPrimitiveType primitiveType; + if (src.hasValueIdType()) { + primitiveType = src.getValueIdType(); + } else if (src.hasValueStringType()) { + primitiveType = src.getValueStringType(); + } else if (src.hasValueIntegerType()) { + primitiveType = src.getValueIntegerType(); + } else if (src.hasValueDecimalType()) { + primitiveType = src.getValueDecimalType(); + } else if (src.hasValueBooleanType()) { + primitiveType = src.getValueBooleanType(); + } else { + throw new FHIRException("Unrecognized primitive type"); + } + tgt.setValueAsString(primitiveType.getValueAsString()); + ToolingExtensions.addUrlExtension(tgt, ToolingExtensions.EXT_ORIGINAL_ELEMENT_TYPE, primitiveType.fhirType()); + + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + 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/Substance43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Substance43_50.java new file mode 100644 index 000000000..12c4ae9c0 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Substance43_50.java @@ -0,0 +1,178 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Ratio43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50; +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.Identifier; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Substance43_50 { + + public static org.hl7.fhir.r5.model.Substance convertSubstance(org.hl7.fhir.r4b.model.Substance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Substance tgt = new org.hl7.fhir.r5.model.Substance(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertFHIRSubstanceStatus(src.getStatusElement())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasCode()) + tgt.getCode().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.Substance.SubstanceInstanceComponent t : src.getInstance()) + convertSubstanceInstanceComponent(t, tgt); + for (org.hl7.fhir.r4b.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) + tgt.addIngredient(convertSubstanceIngredientComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Substance convertSubstance(org.hl7.fhir.r5.model.Substance src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Substance tgt = new org.hl7.fhir.r4b.model.Substance(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertFHIRSubstanceStatus(src.getStatusElement())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory()) + tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.getCode().hasConcept()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode().getConcept())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.getInstance()) { + tgt.addInstance(convertSubstanceInstanceComponent(src)); + } + for (org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent t : src.getIngredient()) + tgt.addIngredient(convertSubstanceIngredientComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static void convertSubstanceInstanceComponent(org.hl7.fhir.r4b.model.Substance.SubstanceInstanceComponent src, org.hl7.fhir.r5.model.Substance tgt) throws FHIRException { + tgt.setInstance(true); + if (src.hasIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasExpiry()) + tgt.setExpiryElement(DateTime43_50.convertDateTime(src.getExpiryElement())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + } + + public static org.hl7.fhir.r4b.model.Substance.SubstanceInstanceComponent convertSubstanceInstanceComponent(org.hl7.fhir.r5.model.Substance src) throws FHIRException { + org.hl7.fhir.r4b.model.Substance.SubstanceInstanceComponent tgt = new org.hl7.fhir.r4b.model.Substance.SubstanceInstanceComponent(); + for (Identifier t : src.getIdentifier()) { + tgt.setIdentifier(Identifier43_50.convertIdentifier(t)); + } + if (src.hasExpiry()) + tgt.setExpiryElement(DateTime43_50.convertDateTime(src.getExpiryElement())); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.r4b.model.Substance.SubstanceIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(Ratio43_50.convertRatio(src.getQuantity())); + if (src.hasSubstance()) + tgt.setSubstance(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubstance())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.r5.model.Substance.SubstanceIngredientComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Substance.SubstanceIngredientComponent tgt = new org.hl7.fhir.r4b.model.Substance.SubstanceIngredientComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(Ratio43_50.convertRatio(src.getQuantity())); + if (src.hasSubstance()) + tgt.setSubstance(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubstance())); + 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/SubstanceAmount43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubstanceAmount43_50.java new file mode 100644 index 000000000..d3ea09a20 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SubstanceAmount43_50.java @@ -0,0 +1,54 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Quantity43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public class SubstanceAmount43_50 { + public static org.hl7.fhir.r4b.model.SubstanceAmount convertSubstanceAmount(org.hl7.fhir.r5.model.SubstanceAmount src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.SubstanceAmount tgt = new org.hl7.fhir.r4b.model.SubstanceAmount(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasAmount()) + tgt.setAmount(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAmount())); + if (src.hasAmountType()) tgt.setAmountType(CodeableConcept43_50.convertCodeableConcept(src.getAmountType())); + if (src.hasAmountText()) tgt.setAmountTextElement(String43_50.convertString(src.getAmountTextElement())); + if (src.hasReferenceRange()) + tgt.setReferenceRange(convertSubstanceAmountReferenceRangeComponent(src.getReferenceRange())); + return tgt; + } + + public static org.hl7.fhir.r5.model.SubstanceAmount convertSubstanceAmount(org.hl7.fhir.r4b.model.SubstanceAmount src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.SubstanceAmount tgt = new org.hl7.fhir.r5.model.SubstanceAmount(); + BackboneElement43_50.copyBackboneElement(src, tgt); + if (src.hasAmount()) + tgt.setAmount(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAmount())); + if (src.hasAmountType()) tgt.setAmountType(CodeableConcept43_50.convertCodeableConcept(src.getAmountType())); + if (src.hasAmountText()) tgt.setAmountTextElement(String43_50.convertString(src.getAmountTextElement())); + if (src.hasReferenceRange()) + tgt.setReferenceRange(convertSubstanceAmountReferenceRangeComponent(src.getReferenceRange())); + return tgt; + } + + public static org.hl7.fhir.r5.model.SubstanceAmount.SubstanceAmountReferenceRangeComponent convertSubstanceAmountReferenceRangeComponent(org.hl7.fhir.r4b.model.SubstanceAmount.SubstanceAmountReferenceRangeComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r5.model.SubstanceAmount.SubstanceAmountReferenceRangeComponent tgt = new org.hl7.fhir.r5.model.SubstanceAmount.SubstanceAmountReferenceRangeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasLowLimit()) tgt.setLowLimit(Quantity43_50.convertQuantity(src.getLowLimit())); + if (src.hasHighLimit()) tgt.setHighLimit(Quantity43_50.convertQuantity(src.getHighLimit())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SubstanceAmount.SubstanceAmountReferenceRangeComponent convertSubstanceAmountReferenceRangeComponent(org.hl7.fhir.r5.model.SubstanceAmount.SubstanceAmountReferenceRangeComponent src) throws FHIRException { + if (src == null) return null; + org.hl7.fhir.r4b.model.SubstanceAmount.SubstanceAmountReferenceRangeComponent tgt = new org.hl7.fhir.r4b.model.SubstanceAmount.SubstanceAmountReferenceRangeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + if (src.hasLowLimit()) tgt.setLowLimit(Quantity43_50.convertQuantity(src.getLowLimit())); + if (src.hasHighLimit()) tgt.setHighLimit(Quantity43_50.convertQuantity(src.getHighLimit())); + return tgt; + } +} 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 new file mode 100644 index 000000000..7532be742 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyDelivery43_50.java @@ -0,0 +1,168 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +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; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class SupplyDelivery43_50 { + + public static org.hl7.fhir.r5.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.r4b.model.SupplyDelivery src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SupplyDelivery tgt = new org.hl7.fhir.r5.model.SupplyDelivery(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertSupplyDeliveryStatus(src.getStatusElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSuppliedItem()) + tgt.setSuppliedItem(convertSupplyDeliverySuppliedItemComponent(src.getSuppliedItem())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasSupplier()) + tgt.setSupplier(Reference43_50.convertReference(src.getSupplier())); + if (src.hasDestination()) + tgt.setDestination(Reference43_50.convertReference(src.getDestination())); + for (org.hl7.fhir.r4b.model.Reference t : src.getReceiver()) tgt.addReceiver(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.r5.model.SupplyDelivery src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SupplyDelivery tgt = new org.hl7.fhir.r4b.model.SupplyDelivery(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertSupplyDeliveryStatus(src.getStatusElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasSuppliedItem()) + tgt.setSuppliedItem(convertSupplyDeliverySuppliedItemComponent(src.getSuppliedItem())); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasSupplier()) + tgt.setSupplier(Reference43_50.convertReference(src.getSupplier())); + if (src.hasDestination()) + tgt.setDestination(Reference43_50.convertReference(src.getDestination())); + for (org.hl7.fhir.r5.model.Reference t : src.getReceiver()) tgt.addReceiver(Reference43_50.convertReference(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent tgt = new org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasItem()) + tgt.setItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getItem())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent convertSupplyDeliverySuppliedItemComponent(org.hl7.fhir.r5.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent tgt = new org.hl7.fhir.r4b.model.SupplyDelivery.SupplyDeliverySuppliedItemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasQuantity()) + tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity())); + if (src.hasItem()) + tgt.setItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getItem())); + 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/SupplyRequest43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyRequest43_50.java new file mode 100644 index 000000000..13daa76f0 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SupplyRequest43_50.java @@ -0,0 +1,270 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Quantity43_50; +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.CodeableReference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class SupplyRequest43_50 { + + public static org.hl7.fhir.r5.model.SupplyRequest convertSupplyRequest(org.hl7.fhir.r4b.model.SupplyRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SupplyRequest tgt = new org.hl7.fhir.r5.model.SupplyRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertSupplyRequestStatus(src.getStatusElement())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasPriority()) + tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement())); + if (src.hasItem()) { + if (src.hasItemCodeableConcept()) { + tgt.getItem().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getItemCodeableConcept())); + } else { + tgt.getItem().setReference(Reference43_50.convertReference(src.getItemReference())); + } + } + if (src.hasQuantity()) + tgt.setQuantity(Quantity43_50.convertQuantity(src.getQuantity())); + for (org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestParameterComponent t : src.getParameter()) + tgt.addParameter(convertSupplyRequestParameterComponent(t)); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + for (org.hl7.fhir.r4b.model.Reference t : src.getSupplier()) tgt.addSupplier(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode()) + tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference()) + tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t)); + if (src.hasDeliverFrom()) + tgt.setDeliverFrom(Reference43_50.convertReference(src.getDeliverFrom())); + if (src.hasDeliverTo()) + tgt.setDeliverTo(Reference43_50.convertReference(src.getDeliverTo())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SupplyRequest convertSupplyRequest(org.hl7.fhir.r5.model.SupplyRequest src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SupplyRequest tgt = new org.hl7.fhir.r4b.model.SupplyRequest(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertSupplyRequestStatus(src.getStatusElement())); + if (src.hasCategory()) + tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory())); + if (src.hasPriority()) + tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement())); + if (src.hasItem()) { + if (src.getItem().hasReference()) { + tgt.setItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getItem().getReference())); + } else { + tgt.setItem(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getItem().getConcept())); + } + } + if (src.hasQuantity()) + tgt.setQuantity(Quantity43_50.convertQuantity(src.getQuantity())); + for (org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent t : src.getParameter()) + tgt.addParameter(convertSupplyRequestParameterComponent(t)); + if (src.hasOccurrence()) + tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + for (org.hl7.fhir.r5.model.Reference t : src.getSupplier()) tgt.addSupplier(Reference43_50.convertReference(t)); + for (CodeableReference t : src.getReason()) + if (t.hasConcept()) + tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept())); + for (CodeableReference t : src.getReason()) + if (t.hasReference()) + tgt.addReasonReference(Reference43_50.convertReference(t.getReference())); + if (src.hasDeliverFrom()) + tgt.setDeliverFrom(Reference43_50.convertReference(src.getDeliverFrom())); + if (src.hasDeliverTo()) + tgt.setDeliverTo(Reference43_50.convertReference(src.getDeliverTo())); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent convertSupplyRequestParameterComponent(org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent tgt = new org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestParameterComponent convertSupplyRequestParameterComponent(org.hl7.fhir.r5.model.SupplyRequest.SupplyRequestParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestParameterComponent tgt = new org.hl7.fhir.r4b.model.SupplyRequest.SupplyRequestParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + 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/Task43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Task43_50.java new file mode 100644 index 000000000..683dad228 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/Task43_50.java @@ -0,0 +1,474 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class Task43_50 { + + public static org.hl7.fhir.r5.model.Task convertTask(org.hl7.fhir.r4b.model.Task src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Task tgt = new org.hl7.fhir.r5.model.Task(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasInstantiatesCanonical()) + tgt.setInstantiatesCanonicalElement(Canonical43_50.convertCanonical(src.getInstantiatesCanonicalElement())); + if (src.hasInstantiatesUri()) + tgt.setInstantiatesUriElement(Uri43_50.convertUri(src.getInstantiatesUriElement())); + for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier())); + for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertTaskStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasBusinessStatus()) + tgt.setBusinessStatus(CodeableConcept43_50.convertCodeableConcept(src.getBusinessStatus())); + if (src.hasIntent()) + tgt.setIntentElement(convertTaskIntent(src.getIntentElement())); + if (src.hasPriority()) + tgt.setPriorityElement(convertTaskPriority(src.getPriorityElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasFocus()) + tgt.setFocus(Reference43_50.convertReference(src.getFocus())); + if (src.hasFor()) + tgt.setFor(Reference43_50.convertReference(src.getFor())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasExecutionPeriod()) + tgt.setExecutionPeriod(Period43_50.convertPeriod(src.getExecutionPeriod())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasLastModified()) + tgt.setLastModifiedElement(DateTime43_50.convertDateTime(src.getLastModifiedElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPerformerType()) + tgt.addPerformerType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOwner()) + tgt.setOwner(Reference43_50.convertReference(src.getOwner())); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + if (src.hasReasonCode()) + tgt.setReasonCode(CodeableConcept43_50.convertCodeableConcept(src.getReasonCode())); + if (src.hasReasonReference()) + tgt.setReasonReference(Reference43_50.convertReference(src.getReasonReference())); + for (org.hl7.fhir.r4b.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getRelevantHistory()) + tgt.addRelevantHistory(Reference43_50.convertReference(t)); + if (src.hasRestriction()) + tgt.setRestriction(convertTaskRestrictionComponent(src.getRestriction())); + for (org.hl7.fhir.r4b.model.Task.ParameterComponent t : src.getInput()) tgt.addInput(convertParameterComponent(t)); + for (org.hl7.fhir.r4b.model.Task.TaskOutputComponent t : src.getOutput()) + tgt.addOutput(convertTaskOutputComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Task convertTask(org.hl7.fhir.r5.model.Task src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Task tgt = new org.hl7.fhir.r4b.model.Task(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasInstantiatesCanonical()) + tgt.setInstantiatesCanonicalElement(Canonical43_50.convertCanonical(src.getInstantiatesCanonicalElement())); + if (src.hasInstantiatesUri()) + tgt.setInstantiatesUriElement(Uri43_50.convertUri(src.getInstantiatesUriElement())); + for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t)); + if (src.hasGroupIdentifier()) + tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier())); + for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertTaskStatus(src.getStatusElement())); + if (src.hasStatusReason()) + tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason())); + if (src.hasBusinessStatus()) + tgt.setBusinessStatus(CodeableConcept43_50.convertCodeableConcept(src.getBusinessStatus())); + if (src.hasIntent()) + tgt.setIntentElement(convertTaskIntent(src.getIntentElement())); + if (src.hasPriority()) + tgt.setPriorityElement(convertTaskPriority(src.getPriorityElement())); + if (src.hasCode()) + tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasFocus()) + tgt.setFocus(Reference43_50.convertReference(src.getFocus())); + if (src.hasFor()) + tgt.setFor(Reference43_50.convertReference(src.getFor())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasExecutionPeriod()) + tgt.setExecutionPeriod(Period43_50.convertPeriod(src.getExecutionPeriod())); + if (src.hasAuthoredOn()) + tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement())); + if (src.hasLastModified()) + tgt.setLastModifiedElement(DateTime43_50.convertDateTime(src.getLastModifiedElement())); + if (src.hasRequester()) + tgt.setRequester(Reference43_50.convertReference(src.getRequester())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPerformerType()) + tgt.addPerformerType(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasOwner()) + tgt.setOwner(Reference43_50.convertReference(src.getOwner())); + if (src.hasLocation()) + tgt.setLocation(Reference43_50.convertReference(src.getLocation())); + if (src.hasReasonCode()) + tgt.setReasonCode(CodeableConcept43_50.convertCodeableConcept(src.getReasonCode())); + if (src.hasReasonReference()) + tgt.setReasonReference(Reference43_50.convertReference(src.getReasonReference())); + for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory()) + tgt.addRelevantHistory(Reference43_50.convertReference(t)); + if (src.hasRestriction()) + tgt.setRestriction(convertTaskRestrictionComponent(src.getRestriction())); + for (org.hl7.fhir.r5.model.Task.ParameterComponent t : src.getInput()) tgt.addInput(convertParameterComponent(t)); + for (org.hl7.fhir.r5.model.Task.TaskOutputComponent t : src.getOutput()) + tgt.addOutput(convertTaskOutputComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.Task.TaskRestrictionComponent convertTaskRestrictionComponent(org.hl7.fhir.r4b.model.Task.TaskRestrictionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Task.TaskRestrictionComponent tgt = new org.hl7.fhir.r5.model.Task.TaskRestrictionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRepetitions()) + tgt.setRepetitionsElement(PositiveInt43_50.convertPositiveInt(src.getRepetitionsElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r4b.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Task.TaskRestrictionComponent convertTaskRestrictionComponent(org.hl7.fhir.r5.model.Task.TaskRestrictionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Task.TaskRestrictionComponent tgt = new org.hl7.fhir.r4b.model.Task.TaskRestrictionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRepetitions()) + tgt.setRepetitionsElement(PositiveInt43_50.convertPositiveInt(src.getRepetitionsElement())); + if (src.hasPeriod()) + tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod())); + for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.Task.ParameterComponent convertParameterComponent(org.hl7.fhir.r4b.model.Task.ParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Task.ParameterComponent tgt = new org.hl7.fhir.r5.model.Task.ParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Task.ParameterComponent convertParameterComponent(org.hl7.fhir.r5.model.Task.ParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Task.ParameterComponent tgt = new org.hl7.fhir.r4b.model.Task.ParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.Task.TaskOutputComponent convertTaskOutputComponent(org.hl7.fhir.r4b.model.Task.TaskOutputComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.Task.TaskOutputComponent tgt = new org.hl7.fhir.r5.model.Task.TaskOutputComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.Task.TaskOutputComponent convertTaskOutputComponent(org.hl7.fhir.r5.model.Task.TaskOutputComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.Task.TaskOutputComponent tgt = new org.hl7.fhir.r4b.model.Task.TaskOutputComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + 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/TerminologyCapabilities43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TerminologyCapabilities43_50.java new file mode 100644 index 000000000..76a0815b2 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TerminologyCapabilities43_50.java @@ -0,0 +1,488 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class TerminologyCapabilities43_50 { + + public static org.hl7.fhir.r5.model.TerminologyCapabilities convertTerminologyCapabilities(org.hl7.fhir.r4b.model.TerminologyCapabilities src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasKind()) + tgt.setKindElement(convertCapabilityStatementKind(src.getKindElement())); + if (src.hasSoftware()) + tgt.setSoftware(convertTerminologyCapabilitiesSoftwareComponent(src.getSoftware())); + if (src.hasImplementation()) + tgt.setImplementation(convertTerminologyCapabilitiesImplementationComponent(src.getImplementation())); + if (src.hasLockedDate()) + tgt.setLockedDateElement(Boolean43_50.convertBoolean(src.getLockedDateElement())); + for (org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent t : src.getCodeSystem()) + tgt.addCodeSystem(convertTerminologyCapabilitiesCodeSystemComponent(t)); + if (src.hasExpansion()) + tgt.setExpansion(convertTerminologyCapabilitiesExpansionComponent(src.getExpansion())); + if (src.hasCodeSearch()) + tgt.setCodeSearchElement(convertCodeSearchSupport(src.getCodeSearchElement())); + if (src.hasValidateCode()) + tgt.setValidateCode(convertTerminologyCapabilitiesValidateCodeComponent(src.getValidateCode())); + if (src.hasTranslation()) + tgt.setTranslation(convertTerminologyCapabilitiesTranslationComponent(src.getTranslation())); + if (src.hasClosure()) + tgt.setClosure(convertTerminologyCapabilitiesClosureComponent(src.getClosure())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities convertTerminologyCapabilities(org.hl7.fhir.r5.model.TerminologyCapabilities src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasKind()) + tgt.setKindElement(convertCapabilityStatementKind(src.getKindElement())); + if (src.hasSoftware()) + tgt.setSoftware(convertTerminologyCapabilitiesSoftwareComponent(src.getSoftware())); + if (src.hasImplementation()) + tgt.setImplementation(convertTerminologyCapabilitiesImplementationComponent(src.getImplementation())); + if (src.hasLockedDate()) + tgt.setLockedDateElement(Boolean43_50.convertBoolean(src.getLockedDateElement())); + for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent t : src.getCodeSystem()) + tgt.addCodeSystem(convertTerminologyCapabilitiesCodeSystemComponent(t)); + if (src.hasExpansion()) + tgt.setExpansion(convertTerminologyCapabilitiesExpansionComponent(src.getExpansion())); + if (src.hasCodeSearch()) + tgt.setCodeSearchElement(convertCodeSearchSupport(src.getCodeSearchElement())); + if (src.hasValidateCode()) + tgt.setValidateCode(convertTerminologyCapabilitiesValidateCodeComponent(src.getValidateCode())); + if (src.hasTranslation()) + tgt.setTranslation(convertTerminologyCapabilitiesTranslationComponent(src.getTranslation())); + if (src.hasClosure()) + tgt.setClosure(convertTerminologyCapabilitiesClosureComponent(src.getClosure())); + return tgt; + } + + 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; + } + + 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; + } + + 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.EXPLICIT); + break; + case ALL: + tgt.setValue(org.hl7.fhir.r5.model.TerminologyCapabilities.CodeSearchSupport.ALL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.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 EXPLICIT: + tgt.setValue(org.hl7.fhir.r4b.model.TerminologyCapabilities.CodeSearchSupport.EXPLICIT); + break; + case ALL: + 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 { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent convertTerminologyCapabilitiesSoftwareComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent convertTerminologyCapabilitiesImplementationComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasUrl()) + tgt.setUrlElement(Url43_50.convertUrl(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent convertTerminologyCapabilitiesImplementationComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesImplementationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasUrl()) + tgt.setUrlElement(Url43_50.convertUrl(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent convertTerminologyCapabilitiesCodeSystemComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUri()) + tgt.setUriElement(Canonical43_50.convertCanonical(src.getUriElement())); + for (org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent t : src.getVersion()) + tgt.addVersion(convertTerminologyCapabilitiesCodeSystemVersionComponent(t)); + if (src.hasSubsumption()) + tgt.setSubsumptionElement(Boolean43_50.convertBoolean(src.getSubsumptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent convertTerminologyCapabilitiesCodeSystemComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUri()) + tgt.setUriElement(Canonical43_50.convertCanonical(src.getUriElement())); + for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent t : src.getVersion()) + tgt.addVersion(convertTerminologyCapabilitiesCodeSystemVersionComponent(t)); + if (src.hasSubsumption()) + tgt.setSubsumptionElement(Boolean43_50.convertBoolean(src.getSubsumptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent convertTerminologyCapabilitiesCodeSystemVersionComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(String43_50.convertString(src.getCodeElement())); + if (src.hasIsDefault()) + tgt.setIsDefaultElement(Boolean43_50.convertBoolean(src.getIsDefaultElement())); + if (src.hasCompositional()) + tgt.setCompositionalElement(Boolean43_50.convertBoolean(src.getCompositionalElement())); + for (org.hl7.fhir.r4b.model.CodeType t : src.getLanguage()) tgt.getLanguage().add(Code43_50.convertCode(t)); + for (org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent t : src.getFilter()) + tgt.addFilter(convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(t)); + for (org.hl7.fhir.r4b.model.CodeType t : src.getProperty()) tgt.getProperty().add(Code43_50.convertCode(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent convertTerminologyCapabilitiesCodeSystemVersionComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(String43_50.convertString(src.getCodeElement())); + if (src.hasIsDefault()) + tgt.setIsDefaultElement(Boolean43_50.convertBoolean(src.getIsDefaultElement())); + if (src.hasCompositional()) + tgt.setCompositionalElement(Boolean43_50.convertBoolean(src.getCompositionalElement())); + for (org.hl7.fhir.r5.model.CodeType t : src.getLanguage()) tgt.getLanguage().add(Code43_50.convertCode(t)); + for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent t : src.getFilter()) + tgt.addFilter(convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(t)); + for (org.hl7.fhir.r5.model.CodeType t : src.getProperty()) tgt.getProperty().add(Code43_50.convertCode(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + for (org.hl7.fhir.r4b.model.CodeType t : src.getOp()) tgt.getOp().add(Code43_50.convertCode(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent convertTerminologyCapabilitiesCodeSystemVersionFilterComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemVersionFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + for (org.hl7.fhir.r5.model.CodeType t : src.getOp()) tgt.getOp().add(Code43_50.convertCode(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent convertTerminologyCapabilitiesExpansionComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasHierarchical()) + tgt.setHierarchicalElement(Boolean43_50.convertBoolean(src.getHierarchicalElement())); + if (src.hasPaging()) + tgt.setPagingElement(Boolean43_50.convertBoolean(src.getPagingElement())); + if (src.hasIncomplete()) + tgt.setIncompleteElement(Boolean43_50.convertBoolean(src.getIncompleteElement())); + for (org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent t : src.getParameter()) + tgt.addParameter(convertTerminologyCapabilitiesExpansionParameterComponent(t)); + if (src.hasTextFilter()) + tgt.setTextFilterElement(MarkDown43_50.convertMarkdown(src.getTextFilterElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent convertTerminologyCapabilitiesExpansionComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasHierarchical()) + tgt.setHierarchicalElement(Boolean43_50.convertBoolean(src.getHierarchicalElement())); + if (src.hasPaging()) + tgt.setPagingElement(Boolean43_50.convertBoolean(src.getPagingElement())); + if (src.hasIncomplete()) + tgt.setIncompleteElement(Boolean43_50.convertBoolean(src.getIncompleteElement())); + for (org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent t : src.getParameter()) + tgt.addParameter(convertTerminologyCapabilitiesExpansionParameterComponent(t)); + if (src.hasTextFilter()) + tgt.setTextFilterElement(MarkDown43_50.convertMarkdown(src.getTextFilterElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent convertTerminologyCapabilitiesExpansionParameterComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Code43_50.convertCode(src.getNameElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent convertTerminologyCapabilitiesExpansionParameterComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(Code43_50.convertCode(src.getNameElement())); + if (src.hasDocumentation()) + tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent convertTerminologyCapabilitiesValidateCodeComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTranslations()) + tgt.setTranslationsElement(Boolean43_50.convertBoolean(src.getTranslationsElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent convertTerminologyCapabilitiesValidateCodeComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTranslations()) + tgt.setTranslationsElement(Boolean43_50.convertBoolean(src.getTranslationsElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent convertTerminologyCapabilitiesTranslationComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasNeedsMap()) + tgt.setNeedsMapElement(Boolean43_50.convertBoolean(src.getNeedsMapElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent convertTerminologyCapabilitiesTranslationComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesTranslationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasNeedsMap()) + tgt.setNeedsMapElement(Boolean43_50.convertBoolean(src.getNeedsMapElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent convertTerminologyCapabilitiesClosureComponent(org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent tgt = new org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTranslation()) + tgt.setTranslationElement(Boolean43_50.convertBoolean(src.getTranslationElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent convertTerminologyCapabilitiesClosureComponent(org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent tgt = new org.hl7.fhir.r4b.model.TerminologyCapabilities.TerminologyCapabilitiesClosureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasTranslation()) + tgt.setTranslationElement(Boolean43_50.convertBoolean(src.getTranslationElement())); + 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/TestReport43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestReport43_50.java new file mode 100644 index 000000000..b7dcd92c3 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestReport43_50.java @@ -0,0 +1,524 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_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.Reference; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class TestReport43_50 { + + public static org.hl7.fhir.r5.model.TestReport convertTestReport(org.hl7.fhir.r4b.model.TestReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport tgt = new org.hl7.fhir.r5.model.TestReport(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(convertTestReportStatus(src.getStatusElement())); + if (src.hasTestScript()) + tgt.setTestScript(src.getTestScript().getReference()); + if (src.hasResult()) + tgt.setResultElement(convertTestReportResult(src.getResultElement())); + if (src.hasScore()) + tgt.setScoreElement(Decimal43_50.convertDecimal(src.getScoreElement())); + if (src.hasTester()) + tgt.setTesterElement(String43_50.convertString(src.getTesterElement())); + if (src.hasIssued()) + tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement())); + for (org.hl7.fhir.r4b.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertTestReportParticipantComponent(t)); + if (src.hasSetup()) + tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); + for (org.hl7.fhir.r4b.model.TestReport.TestReportTestComponent t : src.getTest()) + tgt.addTest(convertTestReportTestComponent(t)); + if (src.hasTeardown()) + tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport convertTestReport(org.hl7.fhir.r5.model.TestReport src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport tgt = new org.hl7.fhir.r4b.model.TestReport(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasStatus()) + tgt.setStatusElement(convertTestReportStatus(src.getStatusElement())); + if (src.hasTestScript()) + tgt.setTestScript(new Reference().setReference(src.getTestScript())); + if (src.hasResult()) + tgt.setResultElement(convertTestReportResult(src.getResultElement())); + if (src.hasScore()) + tgt.setScoreElement(Decimal43_50.convertDecimal(src.getScoreElement())); + if (src.hasTester()) + tgt.setTesterElement(String43_50.convertString(src.getTesterElement())); + if (src.hasIssued()) + tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement())); + for (org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) + tgt.addParticipant(convertTestReportParticipantComponent(t)); + if (src.hasSetup()) + tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); + for (org.hl7.fhir.r5.model.TestReport.TestReportTestComponent t : src.getTest()) + tgt.addTest(convertTestReportTestComponent(t)); + if (src.hasTeardown()) + tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r4b.model.TestReport.TestReportParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertTestReportParticipantType(src.getTypeElement())); + if (src.hasUri()) + tgt.setUriElement(Uri43_50.convertUri(src.getUriElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.r4b.model.TestReport.TestReportParticipantComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setTypeElement(convertTestReportParticipantType(src.getTypeElement())); + if (src.hasUri()) + tgt.setUriElement(Uri43_50.convertUri(src.getUriElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r4b.model.TestReport.TestReportSetupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.TestReport.SetupActionComponent t : src.getAction()) + tgt.addAction(convertSetupActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r4b.model.TestReport.TestReportSetupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.TestReport.SetupActionComponent t : src.getAction()) + tgt.addAction(convertSetupActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r4b.model.TestReport.SetupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r5.model.TestReport.SetupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.r4b.model.TestReport.SetupActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r4b.model.TestReport.SetupActionOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasResult()) + tgt.setResultElement(convertTestReportActionResult(src.getResultElement())); + if (src.hasMessage()) + tgt.setMessageElement(MarkDown43_50.convertMarkdown(src.getMessageElement())); + if (src.hasDetail()) + tgt.setDetailElement(Uri43_50.convertUri(src.getDetailElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.r4b.model.TestReport.SetupActionOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasResult()) + tgt.setResultElement(convertTestReportActionResult(src.getResultElement())); + if (src.hasMessage()) + tgt.setMessageElement(MarkDown43_50.convertMarkdown(src.getMessageElement())); + if (src.hasDetail()) + tgt.setDetailElement(Uri43_50.convertUri(src.getDetailElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4b.model.TestReport.SetupActionAssertComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasResult()) + tgt.setResultElement(convertTestReportActionResult(src.getResultElement())); + if (src.hasMessage()) + tgt.setMessageElement(MarkDown43_50.convertMarkdown(src.getMessageElement())); + if (src.hasDetail()) + tgt.setDetailElement(String43_50.convertString(src.getDetailElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.r4b.model.TestReport.SetupActionAssertComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasResult()) + tgt.setResultElement(convertTestReportActionResult(src.getResultElement())); + if (src.hasMessage()) + tgt.setMessageElement(MarkDown43_50.convertMarkdown(src.getMessageElement())); + if (src.hasDetail()) + tgt.setDetailElement(String43_50.convertString(src.getDetailElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.r4b.model.TestReport.TestReportTestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportTestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.TestReport.TestActionComponent t : src.getAction()) + tgt.addAction(convertTestActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.r5.model.TestReport.TestReportTestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.r4b.model.TestReport.TestReportTestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.TestReport.TestActionComponent t : src.getAction()) + tgt.addAction(convertTestActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.r4b.model.TestReport.TestActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.r5.model.TestReport.TestActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.r4b.model.TestReport.TestActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.r4b.model.TestReport.TestReportTeardownComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.TestReport.TeardownActionComponent t : src.getAction()) + tgt.addAction(convertTeardownActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r4b.model.TestReport.TestReportTeardownComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.TestReport.TeardownActionComponent t : src.getAction()) + tgt.addAction(convertTeardownActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r4b.model.TestReport.TeardownActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.TeardownActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r5.model.TestReport.TeardownActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.r4b.model.TestReport.TeardownActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + 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/TestScript43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestScript43_50.java new file mode 100644 index 000000000..cb783f9bb --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/TestScript43_50.java @@ -0,0 +1,1043 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_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.utils.ToolingExtensions; +import org.hl7.fhir.r5.model.TestScript.TestScriptScopeComponent; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class TestScript43_50 { + + public static org.hl7.fhir.r5.model.TestScript convertTestScript(org.hl7.fhir.r4b.model.TestScript src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript tgt = new org.hl7.fhir.r5.model.TestScript(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestScript.scope")) { + // the advisor will get this ignored. + TestScriptScopeComponent scope = tgt.addScope(); + scope.setArtifact(ext.getExtensionString("artifact")); + org.hl7.fhir.r4b.model.Extension se = ext.getExtensionByUrl("conformance"); + if (se != null) { + scope.setConformance(CodeableConcept43_50.convertCodeableConcept((org.hl7.fhir.r4b.model.CodeableConcept) se.getValue())); + } + se = ext.getExtensionByUrl("phase"); + if (se != null) { + scope.setPhase(CodeableConcept43_50.convertCodeableConcept((org.hl7.fhir.r4b.model.CodeableConcept) se.getValue())); + } + } + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getIdentifierFirstRep())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + for (org.hl7.fhir.r4b.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) + tgt.addOrigin(convertTestScriptOriginComponent(t)); + for (org.hl7.fhir.r4b.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) + tgt.addDestination(convertTestScriptDestinationComponent(t)); + if (src.hasMetadata()) + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + for (org.hl7.fhir.r4b.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) + tgt.addFixture(convertTestScriptFixtureComponent(t)); + for (org.hl7.fhir.r4b.model.Reference t : src.getProfile()) tgt.addProfile(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.TestScript.TestScriptVariableComponent t : src.getVariable()) + tgt.addVariable(convertTestScriptVariableComponent(t)); + if (src.hasSetup()) + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + for (org.hl7.fhir.r4b.model.TestScript.TestScriptTestComponent t : src.getTest()) + tgt.addTest(convertTestScriptTestComponent(t)); + if (src.hasTeardown()) + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript convertTestScript(org.hl7.fhir.r5.model.TestScript src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript tgt = new org.hl7.fhir.r4b.model.TestScript(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getIdentifierFirstRep())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + for (org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent t : src.getOrigin()) + tgt.addOrigin(convertTestScriptOriginComponent(t)); + for (org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent t : src.getDestination()) + tgt.addDestination(convertTestScriptDestinationComponent(t)); + if (src.hasMetadata()) + tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata())); + for (org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent t : src.getFixture()) + tgt.addFixture(convertTestScriptFixtureComponent(t)); + for (org.hl7.fhir.r5.model.Reference t : src.getProfile()) tgt.addProfile(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent t : src.getVariable()) + tgt.addVariable(convertTestScriptVariableComponent(t)); + if (src.hasSetup()) + tgt.setSetup(convertTestScriptSetupComponent(src.getSetup())); + for (org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent t : src.getTest()) + tgt.addTest(convertTestScriptTestComponent(t)); + if (src.hasTeardown()) + tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown())); + for (TestScriptScopeComponent scope : src.getScope()) { + org.hl7.fhir.r4b.model.Extension ext = tgt.addExtension(); + ext.setUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestScript.scope"); + if (scope.hasArtifact()) { + org.hl7.fhir.r4b.model.Extension se = ext.addExtension(); + se.setUrl("artifact"); + se.setValue(Canonical43_50.convertCanonical(scope.getArtifactElement())); + } + if (scope.hasConformance()) { + org.hl7.fhir.r4b.model.Extension se = ext.addExtension(); + se.setUrl("conformance"); + se.setValue(CodeableConcept43_50.convertCodeableConcept(scope.getConformance())); + } + if (scope.hasPhase()) { + org.hl7.fhir.r4b.model.Extension se = ext.addExtension(); + se.setUrl("phase"); + se.setValue(CodeableConcept43_50.convertCodeableConcept(scope.getPhase())); + } + } + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptOriginComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIndex()) + tgt.setIndexElement(Integer43_50.convertInteger(src.getIndexElement())); + if (src.hasProfile()) + tgt.setProfile(Coding43_50.convertCoding(src.getProfile())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptOriginComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIndex()) + tgt.setIndexElement(Integer43_50.convertInteger(src.getIndexElement())); + if (src.hasProfile()) + tgt.setProfile(Coding43_50.convertCoding(src.getProfile())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptDestinationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIndex()) + tgt.setIndexElement(Integer43_50.convertInteger(src.getIndexElement())); + if (src.hasProfile()) + tgt.setProfile(Coding43_50.convertCoding(src.getProfile())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptDestinationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIndex()) + tgt.setIndexElement(Integer43_50.convertInteger(src.getIndexElement())); + if (src.hasProfile()) + tgt.setProfile(Coding43_50.convertCoding(src.getProfile())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) + tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + for (org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) + tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink()) + tgt.addLink(convertTestScriptMetadataLinkComponent(t)); + for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability()) + tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataLinkComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRequired()) + tgt.setRequiredElement(Boolean43_50.convertBoolean(src.getRequiredElement())); + if (src.hasValidated()) + tgt.setValidatedElement(Boolean43_50.convertBoolean(src.getValidatedElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.IntegerType t : src.getOrigin()) tgt.getOrigin().add(Integer43_50.convertInteger(t)); + if (src.hasDestination()) + tgt.setDestinationElement(Integer43_50.convertInteger(src.getDestinationElement())); + for (org.hl7.fhir.r4b.model.UriType t : src.getLink()) tgt.getLink().add(Uri43_50.convertUri(t)); + if (src.hasCapabilities()) + tgt.setCapabilitiesElement(Canonical43_50.convertCanonical(src.getCapabilitiesElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptMetadataCapabilityComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasRequired()) + tgt.setRequiredElement(Boolean43_50.convertBoolean(src.getRequiredElement())); + if (src.hasValidated()) + tgt.setValidatedElement(Boolean43_50.convertBoolean(src.getValidatedElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.IntegerType t : src.getOrigin()) tgt.getOrigin().add(Integer43_50.convertInteger(t)); + if (src.hasDestination()) + tgt.setDestinationElement(Integer43_50.convertInteger(src.getDestinationElement())); + for (org.hl7.fhir.r5.model.UriType t : src.getLink()) tgt.getLink().add(Uri43_50.convertUri(t)); + if (src.hasCapabilities()) + tgt.setCapabilitiesElement(Canonical43_50.convertCanonical(src.getCapabilitiesElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAutocreate()) + tgt.setAutocreateElement(Boolean43_50.convertBoolean(src.getAutocreateElement())); + if (src.hasAutodelete()) + tgt.setAutodeleteElement(Boolean43_50.convertBoolean(src.getAutodeleteElement())); + if (src.hasResource()) + tgt.setResource(Reference43_50.convertReference(src.getResource())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptFixtureComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAutocreate()) + tgt.setAutocreateElement(Boolean43_50.convertBoolean(src.getAutocreateElement())); + if (src.hasAutodelete()) + tgt.setAutodeleteElement(Boolean43_50.convertBoolean(src.getAutodeleteElement())); + if (src.hasResource()) + tgt.setResource(Reference43_50.convertReference(src.getResource())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptVariableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDefaultValue()) + tgt.setDefaultValueElement(String43_50.convertString(src.getDefaultValueElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasHeaderField()) + tgt.setHeaderFieldElement(String43_50.convertString(src.getHeaderFieldElement())); + if (src.hasHint()) + tgt.setHintElement(String43_50.convertString(src.getHintElement())); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(Id43_50.convertId(src.getSourceIdElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptVariableComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDefaultValue()) + tgt.setDefaultValueElement(String43_50.convertString(src.getDefaultValueElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasHeaderField()) + tgt.setHeaderFieldElement(String43_50.convertString(src.getHeaderFieldElement())); + if (src.hasHint()) + tgt.setHintElement(String43_50.convertString(src.getHintElement())); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(Id43_50.convertId(src.getSourceIdElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptSetupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.TestScript.SetupActionComponent t : src.getAction()) + tgt.addAction(convertSetupActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptSetupComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.TestScript.SetupActionComponent t : src.getAction()) + tgt.addAction(convertSetupActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r4b.model.TestScript.SetupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r5.model.TestScript.SetupActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r4b.model.TestScript.SetupActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r4b.model.TestScript.SetupActionOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(Coding43_50.convertCoding(src.getType())); + if (src.hasResource()) + tgt.setResource(src.getResource().toCode()); + if (src.hasLabel()) + tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasAccept()) + tgt.setAcceptElement(Code43_50.convertCode(src.getAcceptElement())); + if (src.hasContentType()) + tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement())); + if (src.hasDestination()) + tgt.setDestinationElement(Integer43_50.convertInteger(src.getDestinationElement())); + if (src.hasEncodeRequestUrl()) + tgt.setEncodeRequestUrlElement(Boolean43_50.convertBoolean(src.getEncodeRequestUrlElement())); + if (src.hasMethod()) + tgt.setMethodElement(convertTestScriptRequestMethodCode(src.getMethodElement())); + if (src.hasOrigin()) + tgt.setOriginElement(Integer43_50.convertInteger(src.getOriginElement())); + if (src.hasParams()) + tgt.setParamsElement(String43_50.convertString(src.getParamsElement())); + for (org.hl7.fhir.r4b.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) + tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + if (src.hasRequestId()) + tgt.setRequestIdElement(Id43_50.convertId(src.getRequestIdElement())); + if (src.hasResponseId()) + tgt.setResponseIdElement(Id43_50.convertId(src.getResponseIdElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(Id43_50.convertId(src.getSourceIdElement())); + if (src.hasTargetId()) + tgt.setTargetIdElement(Id43_50.convertId(src.getTargetIdElement())); + if (src.hasUrl()) + tgt.setUrlElement(String43_50.convertString(src.getUrlElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r4b.model.TestScript.SetupActionOperationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasType()) + tgt.setType(Coding43_50.convertCoding(src.getType())); + if (src.hasResource()) + tgt.getResourceElement().setValueAsString(src.getResource()); + if (src.hasLabel()) + tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasAccept()) + tgt.setAcceptElement(Code43_50.convertCode(src.getAcceptElement())); + if (src.hasContentType()) + tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement())); + if (src.hasDestination()) + tgt.setDestinationElement(Integer43_50.convertInteger(src.getDestinationElement())); + if (src.hasEncodeRequestUrl()) + tgt.setEncodeRequestUrlElement(Boolean43_50.convertBoolean(src.getEncodeRequestUrlElement())); + if (src.hasMethod()) + tgt.setMethodElement(convertTestScriptRequestMethodCode(src.getMethodElement())); + if (src.hasOrigin()) + tgt.setOriginElement(Integer43_50.convertInteger(src.getOriginElement())); + if (src.hasParams()) + tgt.setParamsElement(String43_50.convertString(src.getParamsElement())); + for (org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader()) + tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t)); + if (src.hasRequestId()) + tgt.setRequestIdElement(Id43_50.convertId(src.getRequestIdElement())); + if (src.hasResponseId()) + tgt.setResponseIdElement(Id43_50.convertId(src.getResponseIdElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(Id43_50.convertId(src.getSourceIdElement())); + if (src.hasTargetId()) + tgt.setTargetIdElement(Id43_50.convertId(src.getTargetIdElement())); + if (src.hasUrl()) + tgt.setUrlElement(String43_50.convertString(src.getUrlElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r4b.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasField()) + tgt.setFieldElement(String43_50.convertString(src.getFieldElement())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r4b.model.TestScript.SetupActionOperationRequestHeaderComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasField()) + tgt.setFieldElement(String43_50.convertString(src.getFieldElement())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4b.model.TestScript.SetupActionAssertComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLabel()) + tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasDirection()) + tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement())); + if (src.hasCompareToSourceId()) + tgt.setCompareToSourceIdElement(String43_50.convertString(src.getCompareToSourceIdElement())); + if (src.hasCompareToSourceExpression()) + tgt.setCompareToSourceExpressionElement(String43_50.convertString(src.getCompareToSourceExpressionElement())); + if (src.hasCompareToSourcePath()) + tgt.setCompareToSourcePathElement(String43_50.convertString(src.getCompareToSourcePathElement())); + if (src.hasContentType()) + tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasHeaderField()) + tgt.setHeaderFieldElement(String43_50.convertString(src.getHeaderFieldElement())); + if (src.hasMinimumId()) + tgt.setMinimumIdElement(String43_50.convertString(src.getMinimumIdElement())); + if (src.hasNavigationLinks()) + tgt.setNavigationLinksElement(Boolean43_50.convertBoolean(src.getNavigationLinksElement())); + if (src.hasOperator()) + tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement())); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasRequestMethod()) + tgt.setRequestMethodElement(convertTestScriptRequestMethodCode(src.getRequestMethodElement())); + if (src.hasRequestURL()) + tgt.setRequestURLElement(String43_50.convertString(src.getRequestURLElement())); + if (src.hasResource()) + tgt.setResource(org.hl7.fhir.r5.model.TestScript.FHIRDefinedType.fromCode(src.getResource().toCode())); + if (src.hasResponse()) + tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement())); + if (src.hasResponseCode()) + tgt.setResponseCodeElement(String43_50.convertString(src.getResponseCodeElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(Id43_50.convertId(src.getSourceIdElement())); + if (src.hasValidateProfileId()) + tgt.setValidateProfileIdElement(Id43_50.convertId(src.getValidateProfileIdElement())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasWarningOnly()) + tgt.setWarningOnlyElement(Boolean43_50.convertBoolean(src.getWarningOnlyElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r4b.model.TestScript.SetupActionAssertComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLabel()) + tgt.setLabelElement(String43_50.convertString(src.getLabelElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + if (src.hasDirection()) + tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement())); + if (src.hasCompareToSourceId()) + tgt.setCompareToSourceIdElement(String43_50.convertString(src.getCompareToSourceIdElement())); + if (src.hasCompareToSourceExpression()) + tgt.setCompareToSourceExpressionElement(String43_50.convertString(src.getCompareToSourceExpressionElement())); + if (src.hasCompareToSourcePath()) + tgt.setCompareToSourcePathElement(String43_50.convertString(src.getCompareToSourcePathElement())); + if (src.hasContentType()) + tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement())); + if (src.hasExpression()) + tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement())); + if (src.hasHeaderField()) + tgt.setHeaderFieldElement(String43_50.convertString(src.getHeaderFieldElement())); + if (src.hasMinimumId()) + tgt.setMinimumIdElement(String43_50.convertString(src.getMinimumIdElement())); + if (src.hasNavigationLinks()) + tgt.setNavigationLinksElement(Boolean43_50.convertBoolean(src.getNavigationLinksElement())); + if (src.hasOperator()) + tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement())); + if (src.hasPath()) + tgt.setPathElement(String43_50.convertString(src.getPathElement())); + if (src.hasRequestMethod()) + tgt.setRequestMethodElement(convertTestScriptRequestMethodCode(src.getRequestMethodElement())); + if (src.hasRequestURL()) + tgt.setRequestURLElement(String43_50.convertString(src.getRequestURLElement())); + if (src.hasResource()) + tgt.getResourceElement().setValueAsString(src.getResource().toCode()); + if (src.hasResponse()) + tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement())); + if (src.hasResponseCode()) + tgt.setResponseCodeElement(String43_50.convertString(src.getResponseCodeElement())); + if (src.hasSourceId()) + tgt.setSourceIdElement(Id43_50.convertId(src.getSourceIdElement())); + if (src.hasValidateProfileId()) + tgt.setValidateProfileIdElement(Id43_50.convertId(src.getValidateProfileIdElement())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + if (src.hasWarningOnly()) + tgt.setWarningOnlyElement(Boolean43_50.convertBoolean(src.getWarningOnlyElement())); + return tgt; + } + + 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; + } + + 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; + } + + 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; + } + + 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; + } + + 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.BAD); + 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.UNPROCESSABLE); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.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 BAD: + 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 UNPROCESSABLE: + 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 { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.TestScript.TestActionComponent t : src.getAction()) + tgt.addAction(convertTestActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptTestComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasDescription()) + tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.TestScript.TestActionComponent t : src.getAction()) + tgt.addAction(convertTestActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.r4b.model.TestScript.TestActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.r5.model.TestScript.TestActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + if (src.hasAssert()) + tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.r4b.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r4b.model.TestScript.TeardownActionComponent t : src.getAction()) + tgt.addAction(convertTeardownActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TestScriptTeardownComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + for (org.hl7.fhir.r5.model.TestScript.TeardownActionComponent t : src.getAction()) + tgt.addAction(convertTeardownActionComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r4b.model.TestScript.TeardownActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TeardownActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r5.model.TestScript.TeardownActionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r4b.model.TestScript.TeardownActionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOperation()) + tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); + 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/ValueSet43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ValueSet43_50.java new file mode 100644 index 000000000..eeb8c3c98 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/ValueSet43_50.java @@ -0,0 +1,474 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class ValueSet43_50 { + + public static org.hl7.fhir.r5.model.ValueSet convertValueSet(org.hl7.fhir.r4b.model.ValueSet src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet tgt = new org.hl7.fhir.r5.model.ValueSet(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasImmutable()) + tgt.setImmutableElement(Boolean43_50.convertBoolean(src.getImmutableElement())); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasCompose()) + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasExpansion()) + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ValueSet convertValueSet(org.hl7.fhir.r5.model.ValueSet src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ValueSet tgt = new org.hl7.fhir.r4b.model.ValueSet(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + if (src.hasUrl()) + tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement())); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasTitle()) + tgt.setTitleElement(String43_50.convertString(src.getTitleElement())); + if (src.hasStatus()) + tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement())); + if (src.hasExperimental()) + tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement())); + if (src.hasDate()) + tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement())); + if (src.hasPublisher()) + tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement())); + for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) + tgt.addContact(ContactDetail43_50.convertContactDetail(t)); + if (src.hasDescription()) + tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement())); + for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) + tgt.addUseContext(UsageContext43_50.convertUsageContext(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) + tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasImmutable()) + tgt.setImmutableElement(Boolean43_50.convertBoolean(src.getImmutableElement())); + if (src.hasPurpose()) + tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); + if (src.hasCopyright()) + tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement())); + if (src.hasCompose()) + tgt.setCompose(convertValueSetComposeComponent(src.getCompose())); + if (src.hasExpansion()) + tgt.setExpansion(convertValueSetExpansionComponent(src.getExpansion())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLockedDate()) + tgt.setLockedDateElement(Date43_50.convertDate(src.getLockedDateElement())); + if (src.hasInactive()) + tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); + for (org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent t : src.getInclude()) + tgt.addInclude(convertConceptSetComponent(t)); + for (org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent t : src.getExclude()) + tgt.addExclude(convertConceptSetComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent convertValueSetComposeComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLockedDate()) + tgt.setLockedDateElement(Date43_50.convertDate(src.getLockedDateElement())); + if (src.hasInactive()) + tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getInclude()) + tgt.addInclude(convertConceptSetComponent(t)); + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent t : src.getExclude()) + tgt.addExclude(convertConceptSetComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSystem()) + tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + for (org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) + tgt.addConcept(convertConceptReferenceComponent(t)); + for (org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) + tgt.addFilter(convertConceptSetFilterComponent(t)); + for (org.hl7.fhir.r4b.model.CanonicalType t : src.getValueSet()) + tgt.getValueSet().add(Canonical43_50.convertCanonical(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ConceptSetComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSystem()) + tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent t : src.getConcept()) + tgt.addConcept(convertConceptReferenceComponent(t)); + for (org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent t : src.getFilter()) + tgt.addFilter(convertConceptSetFilterComponent(t)); + for (org.hl7.fhir.r5.model.CanonicalType t : src.getValueSet()) + tgt.getValueSet().add(Canonical43_50.convertCanonical(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + for (org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) + tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) + tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasUse()) + tgt.setUse(Coding43_50.convertCoding(src.getUse())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasLanguage()) + tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement())); + if (src.hasUse()) + tgt.setUse(Coding43_50.convertCoding(src.getUse())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProperty()) + tgt.setPropertyElement(Code43_50.convertCode(src.getPropertyElement())); + if (src.hasOp()) + tgt.setOpElement(convertFilterOperator(src.getOpElement())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent convertConceptSetFilterComponent(org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ConceptSetFilterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProperty()) + tgt.setPropertyElement(Code43_50.convertCode(src.getPropertyElement())); + if (src.hasOp()) + tgt.setOpElement(convertFilterOperator(src.getOpElement())); + if (src.hasValue()) + tgt.setValueElement(String43_50.convertString(src.getValueElement())); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifierElement(Uri43_50.convertUri(src.getIdentifierElement())); + if (src.hasTimestamp()) + tgt.setTimestampElement(DateTime43_50.convertDateTime(src.getTimestampElement())); + if (src.hasTotal()) + tgt.setTotalElement(Integer43_50.convertInteger(src.getTotalElement())); + if (src.hasOffset()) + tgt.setOffsetElement(Integer43_50.convertInteger(src.getOffsetElement())); + for (org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) + tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + for (org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) + tgt.addContains(convertValueSetExpansionContainsComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasIdentifier()) + tgt.setIdentifierElement(Uri43_50.convertUri(src.getIdentifierElement())); + if (src.hasTimestamp()) + tgt.setTimestampElement(DateTime43_50.convertDateTime(src.getTimestampElement())); + if (src.hasTotal()) + tgt.setTotalElement(Integer43_50.convertInteger(src.getTotalElement())); + if (src.hasOffset()) + tgt.setOffsetElement(Integer43_50.convertInteger(src.getOffsetElement())); + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter()) + tgt.addParameter(convertValueSetExpansionParameterComponent(t)); + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) + tgt.addContains(convertValueSetExpansionContainsComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent convertValueSetExpansionParameterComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionParameterComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasName()) + tgt.setNameElement(String43_50.convertString(src.getNameElement())); + if (src.hasValue()) + tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue())); + return tgt; + } + + public static org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSystem()) + tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasAbstract()) + tgt.setAbstractElement(Boolean43_50.convertBoolean(src.getAbstractElement())); + if (src.hasInactive()) + tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + for (org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) + tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + for (org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) + tgt.addContains(convertValueSetExpansionContainsComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent convertValueSetExpansionContainsComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent tgt = new org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasSystem()) + tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement())); + if (src.hasAbstract()) + tgt.setAbstractElement(Boolean43_50.convertBoolean(src.getAbstractElement())); + if (src.hasInactive()) + tgt.setInactiveElement(Boolean43_50.convertBoolean(src.getInactiveElement())); + if (src.hasVersion()) + tgt.setVersionElement(String43_50.convertString(src.getVersionElement())); + if (src.hasCode()) + tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); + if (src.hasDisplay()) + tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement())); + for (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent t : src.getDesignation()) + tgt.addDesignation(convertConceptReferenceDesignationComponent(t)); + for (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains()) + tgt.addContains(convertValueSetExpansionContainsComponent(t)); + 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/VerificationResult43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VerificationResult43_50.java new file mode 100644 index 000000000..fd2a7dd7b --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VerificationResult43_50.java @@ -0,0 +1,295 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Signature43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Timing43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Date43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class VerificationResult43_50 { + + public static org.hl7.fhir.r5.model.VerificationResult convertVerificationResult(org.hl7.fhir.r4b.model.VerificationResult src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VerificationResult tgt = new org.hl7.fhir.r5.model.VerificationResult(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Reference t : src.getTarget()) tgt.addTarget(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r4b.model.StringType t : src.getTargetLocation()) + tgt.getTargetLocation().add(String43_50.convertString(t)); + if (src.hasNeed()) + tgt.setNeed(CodeableConcept43_50.convertCodeableConcept(src.getNeed())); + if (src.hasStatus()) + tgt.setStatusElement(convertStatus(src.getStatusElement())); + if (src.hasStatusDate()) + tgt.setStatusDateElement(DateTime43_50.convertDateTime(src.getStatusDateElement())); + if (src.hasValidationType()) + tgt.setValidationType(CodeableConcept43_50.convertCodeableConcept(src.getValidationType())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getValidationProcess()) + tgt.addValidationProcess(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasFrequency()) + tgt.setFrequency(Timing43_50.convertTiming(src.getFrequency())); + if (src.hasLastPerformed()) + tgt.setLastPerformedElement(DateTime43_50.convertDateTime(src.getLastPerformedElement())); + if (src.hasNextScheduled()) + tgt.setNextScheduledElement(Date43_50.convertDate(src.getNextScheduledElement())); + if (src.hasFailureAction()) + tgt.setFailureAction(CodeableConcept43_50.convertCodeableConcept(src.getFailureAction())); + for (org.hl7.fhir.r4b.model.VerificationResult.VerificationResultPrimarySourceComponent t : src.getPrimarySource()) + tgt.addPrimarySource(convertVerificationResultPrimarySourceComponent(t)); + if (src.hasAttestation()) + tgt.setAttestation(convertVerificationResultAttestationComponent(src.getAttestation())); + for (org.hl7.fhir.r4b.model.VerificationResult.VerificationResultValidatorComponent t : src.getValidator()) + tgt.addValidator(convertVerificationResultValidatorComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.VerificationResult convertVerificationResult(org.hl7.fhir.r5.model.VerificationResult src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.VerificationResult tgt = new org.hl7.fhir.r4b.model.VerificationResult(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Reference t : src.getTarget()) tgt.addTarget(Reference43_50.convertReference(t)); + for (org.hl7.fhir.r5.model.StringType t : src.getTargetLocation()) + tgt.getTargetLocation().add(String43_50.convertString(t)); + if (src.hasNeed()) + tgt.setNeed(CodeableConcept43_50.convertCodeableConcept(src.getNeed())); + if (src.hasStatus()) + tgt.setStatusElement(convertStatus(src.getStatusElement())); + if (src.hasStatusDate()) + tgt.setStatusDateElement(DateTime43_50.convertDateTime(src.getStatusDateElement())); + if (src.hasValidationType()) + tgt.setValidationType(CodeableConcept43_50.convertCodeableConcept(src.getValidationType())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValidationProcess()) + tgt.addValidationProcess(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasFrequency()) + tgt.setFrequency(Timing43_50.convertTiming(src.getFrequency())); + if (src.hasLastPerformed()) + tgt.setLastPerformedElement(DateTime43_50.convertDateTime(src.getLastPerformedElement())); + if (src.hasNextScheduled()) + tgt.setNextScheduledElement(Date43_50.convertDate(src.getNextScheduledElement())); + if (src.hasFailureAction()) + tgt.setFailureAction(CodeableConcept43_50.convertCodeableConcept(src.getFailureAction())); + for (org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent t : src.getPrimarySource()) + tgt.addPrimarySource(convertVerificationResultPrimarySourceComponent(t)); + if (src.hasAttestation()) + tgt.setAttestation(convertVerificationResultAttestationComponent(src.getAttestation())); + for (org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent t : src.getValidator()) + tgt.addValidator(convertVerificationResultValidatorComponent(t)); + return tgt; + } + + 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.StatusEnumFactory()); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt); + switch (src.getValue()) { + case ATTESTED: + tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.Status.ATTESTED); + break; + case VALIDATED: + tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.Status.VALIDATED); + break; + case INPROCESS: + tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.Status.INPROCESS); + break; + case REQREVALID: + tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.Status.REQREVALID); + break; + case VALFAIL: + tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.Status.VALFAIL); + break; + case REVALFAIL: + tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.Status.REVALFAIL); + break; + default: + tgt.setValue(org.hl7.fhir.r5.model.VerificationResult.Status.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; + } + + public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent convertVerificationResultPrimarySourceComponent(org.hl7.fhir.r4b.model.VerificationResult.VerificationResultPrimarySourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent tgt = new org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasWho()) + tgt.setWho(Reference43_50.convertReference(src.getWho())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCommunicationMethod()) + tgt.addCommunicationMethod(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasValidationStatus()) + tgt.setValidationStatus(CodeableConcept43_50.convertCodeableConcept(src.getValidationStatus())); + if (src.hasValidationDate()) + tgt.setValidationDateElement(DateTime43_50.convertDateTime(src.getValidationDateElement())); + if (src.hasCanPushUpdates()) + tgt.setCanPushUpdates(CodeableConcept43_50.convertCodeableConcept(src.getCanPushUpdates())); + for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPushTypeAvailable()) + tgt.addPushTypeAvailable(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.VerificationResult.VerificationResultPrimarySourceComponent convertVerificationResultPrimarySourceComponent(org.hl7.fhir.r5.model.VerificationResult.VerificationResultPrimarySourceComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.VerificationResult.VerificationResultPrimarySourceComponent tgt = new org.hl7.fhir.r4b.model.VerificationResult.VerificationResultPrimarySourceComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasWho()) + tgt.setWho(Reference43_50.convertReference(src.getWho())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType()) + tgt.addType(CodeableConcept43_50.convertCodeableConcept(t)); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunicationMethod()) + tgt.addCommunicationMethod(CodeableConcept43_50.convertCodeableConcept(t)); + if (src.hasValidationStatus()) + tgt.setValidationStatus(CodeableConcept43_50.convertCodeableConcept(src.getValidationStatus())); + if (src.hasValidationDate()) + tgt.setValidationDateElement(DateTime43_50.convertDateTime(src.getValidationDateElement())); + if (src.hasCanPushUpdates()) + tgt.setCanPushUpdates(CodeableConcept43_50.convertCodeableConcept(src.getCanPushUpdates())); + for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPushTypeAvailable()) + tgt.addPushTypeAvailable(CodeableConcept43_50.convertCodeableConcept(t)); + return tgt; + } + + public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent convertVerificationResultAttestationComponent(org.hl7.fhir.r4b.model.VerificationResult.VerificationResultAttestationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent tgt = new org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasWho()) + tgt.setWho(Reference43_50.convertReference(src.getWho())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + if (src.hasCommunicationMethod()) + tgt.setCommunicationMethod(CodeableConcept43_50.convertCodeableConcept(src.getCommunicationMethod())); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasSourceIdentityCertificate()) + tgt.setSourceIdentityCertificateElement(String43_50.convertString(src.getSourceIdentityCertificateElement())); + if (src.hasProxyIdentityCertificate()) + tgt.setProxyIdentityCertificateElement(String43_50.convertString(src.getProxyIdentityCertificateElement())); + if (src.hasProxySignature()) + tgt.setProxySignature(Signature43_50.convertSignature(src.getProxySignature())); + if (src.hasSourceSignature()) + tgt.setSourceSignature(Signature43_50.convertSignature(src.getSourceSignature())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.VerificationResult.VerificationResultAttestationComponent convertVerificationResultAttestationComponent(org.hl7.fhir.r5.model.VerificationResult.VerificationResultAttestationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.VerificationResult.VerificationResultAttestationComponent tgt = new org.hl7.fhir.r4b.model.VerificationResult.VerificationResultAttestationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasWho()) + tgt.setWho(Reference43_50.convertReference(src.getWho())); + if (src.hasOnBehalfOf()) + tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf())); + if (src.hasCommunicationMethod()) + tgt.setCommunicationMethod(CodeableConcept43_50.convertCodeableConcept(src.getCommunicationMethod())); + if (src.hasDate()) + tgt.setDateElement(Date43_50.convertDate(src.getDateElement())); + if (src.hasSourceIdentityCertificate()) + tgt.setSourceIdentityCertificateElement(String43_50.convertString(src.getSourceIdentityCertificateElement())); + if (src.hasProxyIdentityCertificate()) + tgt.setProxyIdentityCertificateElement(String43_50.convertString(src.getProxyIdentityCertificateElement())); + if (src.hasProxySignature()) + tgt.setProxySignature(Signature43_50.convertSignature(src.getProxySignature())); + if (src.hasSourceSignature()) + tgt.setSourceSignature(Signature43_50.convertSignature(src.getSourceSignature())); + return tgt; + } + + public static org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent convertVerificationResultValidatorComponent(org.hl7.fhir.r4b.model.VerificationResult.VerificationResultValidatorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent tgt = new org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOrganization()) + tgt.setOrganization(Reference43_50.convertReference(src.getOrganization())); + if (src.hasIdentityCertificate()) + tgt.setIdentityCertificateElement(String43_50.convertString(src.getIdentityCertificateElement())); + if (src.hasAttestationSignature()) + tgt.setAttestationSignature(Signature43_50.convertSignature(src.getAttestationSignature())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.VerificationResult.VerificationResultValidatorComponent convertVerificationResultValidatorComponent(org.hl7.fhir.r5.model.VerificationResult.VerificationResultValidatorComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.VerificationResult.VerificationResultValidatorComponent tgt = new org.hl7.fhir.r4b.model.VerificationResult.VerificationResultValidatorComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasOrganization()) + tgt.setOrganization(Reference43_50.convertReference(src.getOrganization())); + if (src.hasIdentityCertificate()) + tgt.setIdentityCertificateElement(String43_50.convertString(src.getIdentityCertificateElement())); + if (src.hasAttestationSignature()) + tgt.setAttestationSignature(Signature43_50.convertSignature(src.getAttestationSignature())); + 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/VisionPrescription43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VisionPrescription43_50.java new file mode 100644 index 000000000..b38206918 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/VisionPrescription43_50.java @@ -0,0 +1,325 @@ +package org.hl7.fhir.convertors.conv43_50.resources43_50; + +import org.hl7.fhir.convertors.context.ConversionContext43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50; +import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50; +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.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50; +import org.hl7.fhir.exceptions.FHIRException; + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ +// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 +public class VisionPrescription43_50 { + + public static org.hl7.fhir.r5.model.VisionPrescription convertVisionPrescription(org.hl7.fhir.r4b.model.VisionPrescription src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VisionPrescription tgt = new org.hl7.fhir.r5.model.VisionPrescription(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertVisionStatus(src.getStatusElement())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasDateWritten()) + tgt.setDateWrittenElement(DateTime43_50.convertDateTime(src.getDateWrittenElement())); + if (src.hasPrescriber()) + tgt.setPrescriber(Reference43_50.convertReference(src.getPrescriber())); + for (org.hl7.fhir.r4b.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent t : src.getLensSpecification()) + tgt.addLensSpecification(convertVisionPrescriptionLensSpecificationComponent(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.VisionPrescription convertVisionPrescription(org.hl7.fhir.r5.model.VisionPrescription src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.VisionPrescription tgt = new org.hl7.fhir.r4b.model.VisionPrescription(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt); + for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) + tgt.addIdentifier(Identifier43_50.convertIdentifier(t)); + if (src.hasStatus()) + tgt.setStatusElement(convertVisionStatus(src.getStatusElement())); + if (src.hasCreated()) + tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement())); + if (src.hasPatient()) + tgt.setPatient(Reference43_50.convertReference(src.getPatient())); + if (src.hasEncounter()) + tgt.setEncounter(Reference43_50.convertReference(src.getEncounter())); + if (src.hasDateWritten()) + tgt.setDateWrittenElement(DateTime43_50.convertDateTime(src.getDateWrittenElement())); + if (src.hasPrescriber()) + tgt.setPrescriber(Reference43_50.convertReference(src.getPrescriber())); + for (org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent t : src.getLensSpecification()) + tgt.addLensSpecification(convertVisionPrescriptionLensSpecificationComponent(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent convertVisionPrescriptionLensSpecificationComponent(org.hl7.fhir.r4b.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent tgt = new org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProduct()) + tgt.setProduct(CodeableConcept43_50.convertCodeableConcept(src.getProduct())); + if (src.hasEye()) + tgt.setEyeElement(convertVisionEyes(src.getEyeElement())); + if (src.hasSphere()) + tgt.setSphereElement(Decimal43_50.convertDecimal(src.getSphereElement())); + if (src.hasCylinder()) + tgt.setCylinderElement(Decimal43_50.convertDecimal(src.getCylinderElement())); + if (src.hasAxis()) + tgt.setAxisElement(Integer43_50.convertInteger(src.getAxisElement())); + for (org.hl7.fhir.r4b.model.VisionPrescription.PrismComponent t : src.getPrism()) + tgt.addPrism(convertPrismComponent(t)); + if (src.hasAdd()) + tgt.setAddElement(Decimal43_50.convertDecimal(src.getAddElement())); + if (src.hasPower()) + tgt.setPowerElement(Decimal43_50.convertDecimal(src.getPowerElement())); + if (src.hasBackCurve()) + tgt.setBackCurveElement(Decimal43_50.convertDecimal(src.getBackCurveElement())); + if (src.hasDiameter()) + tgt.setDiameterElement(Decimal43_50.convertDecimal(src.getDiameterElement())); + if (src.hasDuration()) + tgt.setDuration(SimpleQuantity43_50.convertSimpleQuantity(src.getDuration())); + if (src.hasColor()) + tgt.setColorElement(String43_50.convertString(src.getColorElement())); + if (src.hasBrand()) + tgt.setBrandElement(String43_50.convertString(src.getBrandElement())); + for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + public static org.hl7.fhir.r4b.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent convertVisionPrescriptionLensSpecificationComponent(org.hl7.fhir.r5.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent tgt = new org.hl7.fhir.r4b.model.VisionPrescription.VisionPrescriptionLensSpecificationComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasProduct()) + tgt.setProduct(CodeableConcept43_50.convertCodeableConcept(src.getProduct())); + if (src.hasEye()) + tgt.setEyeElement(convertVisionEyes(src.getEyeElement())); + if (src.hasSphere()) + tgt.setSphereElement(Decimal43_50.convertDecimal(src.getSphereElement())); + if (src.hasCylinder()) + tgt.setCylinderElement(Decimal43_50.convertDecimal(src.getCylinderElement())); + if (src.hasAxis()) + tgt.setAxisElement(Integer43_50.convertInteger(src.getAxisElement())); + for (org.hl7.fhir.r5.model.VisionPrescription.PrismComponent t : src.getPrism()) + tgt.addPrism(convertPrismComponent(t)); + if (src.hasAdd()) + tgt.setAddElement(Decimal43_50.convertDecimal(src.getAddElement())); + if (src.hasPower()) + tgt.setPowerElement(Decimal43_50.convertDecimal(src.getPowerElement())); + if (src.hasBackCurve()) + tgt.setBackCurveElement(Decimal43_50.convertDecimal(src.getBackCurveElement())); + if (src.hasDiameter()) + tgt.setDiameterElement(Decimal43_50.convertDecimal(src.getDiameterElement())); + if (src.hasDuration()) + tgt.setDuration(SimpleQuantity43_50.convertSimpleQuantity(src.getDuration())); + if (src.hasColor()) + tgt.setColorElement(String43_50.convertString(src.getColorElement())); + if (src.hasBrand()) + tgt.setBrandElement(String43_50.convertString(src.getBrandElement())); + for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t)); + return tgt; + } + + 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; + } + + 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; + } + + public static org.hl7.fhir.r5.model.VisionPrescription.PrismComponent convertPrismComponent(org.hl7.fhir.r4b.model.VisionPrescription.PrismComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r5.model.VisionPrescription.PrismComponent tgt = new org.hl7.fhir.r5.model.VisionPrescription.PrismComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAmount()) + tgt.setAmountElement(Decimal43_50.convertDecimal(src.getAmountElement())); + if (src.hasBase()) + tgt.setBaseElement(convertVisionBase(src.getBaseElement())); + return tgt; + } + + public static org.hl7.fhir.r4b.model.VisionPrescription.PrismComponent convertPrismComponent(org.hl7.fhir.r5.model.VisionPrescription.PrismComponent src) throws FHIRException { + if (src == null) + return null; + org.hl7.fhir.r4b.model.VisionPrescription.PrismComponent tgt = new org.hl7.fhir.r4b.model.VisionPrescription.PrismComponent(); + ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt); + if (src.hasAmount()) + tgt.setAmountElement(Decimal43_50.convertDecimal(src.getAmountElement())); + if (src.hasBase()) + tgt.setBaseElement(convertVisionBase(src.getBaseElement())); + return tgt; + } + + 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; + } + + 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; + } +} \ No newline at end of file diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/ToolingExtensions.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/ToolingExtensions.java index 6e00efbf4..77df48205 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/ToolingExtensions.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/ToolingExtensions.java @@ -202,6 +202,9 @@ public class ToolingExtensions { public static final String EXT_EXPAND_GROUP = "http://hl7.org/fhir/StructureDefinition/valueset-expand-group"; public static final String EXT_BINDING_ADDITIONAL = "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"; + public static final String EXT_ORIGINAL_ITEM_TYPE = "http://hl7.org/fhir/tools/StructureDefinition/original-item-type"; + public static final String EXT_ORIGINAL_ELEMENT_TYPE = "http://hl7.org/fhir/tools/StructureDefinition/original-item-type"; + // specific extension helpers public static Extension makeIssueSource(Source source) { From b43c210e1ad3146c3701e041ec7c3fed34ef048d Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 28 Jul 2022 21:30:59 +1000 Subject: [PATCH 4/5] Rendering improvements for Documents --- .../hl7/fhir/r5/renderers/BundleRenderer.java | 119 +++++++++++------- .../r5/renderers/ProfileDrivenRenderer.java | 4 +- .../org/hl7/fhir/r5/renderers/Renderer.java | 5 +- .../fhir/r5/renderers/ResourceRenderer.java | 2 + .../src/main/resources/Messages.properties | 4 + 5 files changed, 84 insertions(+), 50 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java index 13399d504..18a8b99b4 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java @@ -209,15 +209,14 @@ public class BundleRenderer extends ResourceRenderer { } x.hr(); if (!comp.getText().hasDiv()) { - ResourceRenderer rr = RendererFactory.factory(comp, getContext()); - rr.render(comp); + ResourceRenderer rr = RendererFactory.factory(comp, getContext()); rr.render(comp); } if (comp.getText().hasDiv()) { x.addChildren(comp.getText().getDiv()); x.hr(); } for (SectionComponent section : comp.getSection()) { - addSection(x, section, 2, false); + addSection(x, section, 2, false, comp); } return false; } @@ -236,7 +235,7 @@ public class BundleRenderer extends ResourceRenderer { } - private void addSection(XhtmlNode x, SectionComponent section, int level, boolean nested) throws UnsupportedEncodingException, FHIRException, IOException { + private void addSection(XhtmlNode x, SectionComponent section, int level, boolean nested, Composition c) throws UnsupportedEncodingException, FHIRException, IOException { if (section.hasTitle() || section.hasCode() || section.hasText() || section.hasSection()) { XhtmlNode div = x.div(); if (section.hasTitle()) { @@ -246,14 +245,20 @@ public class BundleRenderer extends ResourceRenderer { } if (section.hasText()) { x.addChildren(section.getText().getDiv()); - } + } + if (section.hasEntry()) { + XhtmlNode ul = x.ul(); + for (Reference r : section.getEntry()) { + renderReference(c, ul.li(), r); + } + } if (section.hasSection()) { List sections = section.getSection(); for (SectionComponent child : sections) { if (nested) { - addSection(x.blockquote().para(), child, level+1, true); + addSection(x.blockquote().para(), child, level+1, true, c); } else { - addSection(x, child, level+1, true); + addSection(x, child, level+1, true, c); } } } @@ -263,58 +268,78 @@ public class BundleRenderer extends ResourceRenderer { public XhtmlNode render(Bundle b) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { - if (b.getType() == BundleType.DOCUMENT) { - if (!b.hasEntry() || !(b.getEntryFirstRep().hasResource() && b.getEntryFirstRep().getResource() instanceof Composition)) { - throw new FHIRException("Invalid document - first entry is not a Composition"); - } - XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); - renderDocument(x, b); - return x; - } else if ((b.getType() == BundleType.COLLECTION && allEntresAreHistoryProvenance(b))) { + if ((b.getType() == BundleType.COLLECTION && allEntresAreHistoryProvenance(b))) { return null; } else { - XhtmlNode root = new XhtmlNode(NodeType.Element, "div"); - root.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.getType().toCode())); + int start = 0; + boolean docMode = false; + XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); + if (b.getType() == BundleType.DOCUMENT) { + if (!b.hasEntry() || !(b.getEntryFirstRep().hasResource() && b.getEntryFirstRep().getResource() instanceof Composition)) { + throw new FHIRException("Invalid document - first entry is not a Composition"); + } + renderDocument(x, b); + start = 1; + docMode = true; + x.hr(); + x.h2().addText(formatMessage(RENDER_BUNDLE_DOCUMENT_CONTENT, b.getId(), b.getType().toCode())); + } else { + x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.getType().toCode())); + } int i = 0; for (BundleEntryComponent be : b.getEntry()) { i++; - if (be.hasFullUrl()) - root.an(makeInternalBundleLink(be.getFullUrl())); - if (be.hasResource() && be.getResource().hasId()) - root.an(be.getResource().getResourceType().name() + "_" + be.getResource().getId()); - root.hr(); - if (be.hasFullUrl()) { - root.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.getFullUrl())); - } else { - root.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i))); - } - if (be.hasRequest()) - renderRequest(root, be.getRequest()); - if (be.hasSearch()) - renderSearch(root, be.getSearch()); - if (be.hasResponse()) - renderResponse(root, be.getResponse()); - if (be.hasResource()) { - root.para().addText(formatMessage(RENDER_BUNDLE_RESOURCE, be.getResource().fhirType())); + if (i > start) { + if (be.hasFullUrl()) + x.an(makeInternalBundleLink(be.getFullUrl())); + if (be.hasResource() && be.getResource().hasId()) + x.an(be.getResource().getResourceType().name() + "_" + be.getResource().getId()); + x.hr(); + if (docMode) { + if (be.hasFullUrl() && be.hasResource()) { + x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_DOC_ENTRY_URD, Integer.toString(i), be.getFullUrl(), be.getResource().fhirType(), be.getResource().getIdBase())); + } else if (be.hasFullUrl()) { + x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_DOC_ENTRY_U, Integer.toString(i), be.getFullUrl())); + } else if (be.hasResource()) { + x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_DOC_ENTRY_RD, Integer.toString(i), be.getResource().fhirType(), be.getResource().getIdBase())); + } + } else { + if (be.hasFullUrl()) { + x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.getFullUrl())); + } else { + x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i))); + } + if (be.hasRequest()) + renderRequest(x, be.getRequest()); + if (be.hasSearch()) + renderSearch(x, be.getSearch()); + if (be.hasResponse()) + renderResponse(x, be.getResponse()); + } if (be.hasResource()) { - XhtmlNode xn = null; - if (be.getResource() instanceof DomainResource) { - DomainResource dr = (DomainResource) be.getResource(); - xn = dr.getText().getDiv(); + if (!docMode) { + x.para().addText(formatMessage(RENDER_BUNDLE_RESOURCE, be.getResource().fhirType())); } - if (xn == null || xn.isEmpty()) { - ResourceRenderer rr = RendererFactory.factory(be.getResource(), context); - try { - xn = rr.build(be.getResource()); - } catch (Exception e) { - xn = makeExceptionXhtml(e, "generating narrative"); + if (be.hasResource()) { + XhtmlNode xn = null; + if (be.getResource() instanceof DomainResource) { + DomainResource dr = (DomainResource) be.getResource(); + xn = dr.getText().getDiv(); } + if (xn == null || xn.isEmpty()) { + ResourceRenderer rr = RendererFactory.factory(be.getResource(), context); + try { + xn = rr.build(be.getResource()); + } catch (Exception e) { + xn = makeExceptionXhtml(e, "generating narrative"); + } + } + x.blockquote().para().getChildNodes().addAll(checkInternalLinks(b, xn.getChildNodes())); } - root.blockquote().para().getChildNodes().addAll(checkInternalLinks(b, xn.getChildNodes())); } } } - return root; + return x; } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java index a2cb61823..932b251b8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java @@ -104,7 +104,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer { @Override public boolean render(XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException { if (context.isAddGeneratedNarrativeHeader()) { - x.para().b().tx("Generated Narrative"); + x.para().b().tx("Generated Narrative: "+r.fhirType()); } if (context.isTechnicalMode()) { renderResourceHeader(r, x); @@ -647,7 +647,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer { private boolean generateByProfile(StructureDefinition profile, boolean showCodeDetails) { XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); if(context.isAddGeneratedNarrativeHeader()) { - x.para().b().tx("Generated Narrative"+(showCodeDetails ? " with Details" : "")); + x.para().b().tx("Generated Narrative: "+profile.present()+(showCodeDetails ? " with Details" : "")); } try { generateByProfile(rcontext.getResourceResource(), profile, rcontext.getResourceResource(), profile.getSnapshot().getElement(), profile.getSnapshot().getElement().get(0), getChildrenForPath(profile.getSnapshot().getElement(), rcontext.getResourceResource().getResourceType().toString()), x, rcontext.getResourceResource().getResourceType().toString(), showCodeDetails); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/Renderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/Renderer.java index 430e25359..41ccb5c36 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/Renderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/Renderer.java @@ -53,7 +53,10 @@ public class Renderer { protected static final String RENDER_BUNDLE_IF_MOD = "RENDER_BUNDLE_IF_MOD"; protected static final String RENDER_BUNDLE_IF_MATCH = "RENDER_BUNDLE_IF_MATCH"; protected static final String RENDER_BUNDLE_IF_NONE = "RENDER_BUNDLE_IF_NONE"; - + protected static final String RENDER_BUNDLE_DOCUMENT_CONTENT = "RENDER_BUNDLE_DOCUMENT_CONTENT"; + protected static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_URD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_URD"; + protected static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_U = "RENDER_BUNDLE_HEADER_DOC_ENTRY_U"; + protected static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_RD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_RD"; /** the plan here is to make this have it's own implementation of messages, rather than using the * validator messages, for better alignment with publisher I18n strategy diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java index c9b7f1281..72368b81a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java @@ -414,6 +414,8 @@ public abstract class ResourceRenderer extends DataRenderer { if (id != null || lang != null || versionId != null || lastUpdated != null) { XhtmlNode p = plateStyle(div.para()); p.tx("Resource "); + p.tx(r.fhirType()); + p.tx(" "); if (id != null) { p.tx("\""+id+"\" "); } diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index 9f9dda45e..7533aeaba 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -612,6 +612,10 @@ BUNDLE_RULE_NONE = No Rule BUNDLE_RULE_UNKNOWN = Bundle Rule refers to invalid resource {0} BUNDLE_RULE_INVALID_INDEX = Bundle Rules index is invalid ({0}) BUNDLE_RULE_PROFILE_UNKNOWN = Bundle Rules profile {1} is unknown for {0} +RENDER_BUNDLE_DOCUMENT_CONTENT = Additional Document Content +RENDER_BUNDLE_HEADER_DOC_ENTRY_URD = {0}. {1} ({2}/{3}) +RENDER_BUNDLE_HEADER_DOC_ENTRY_U = {0}. {1} +RENDER_BUNDLE_HEADER_DOC_ENTRY_RD = {0}. {2}/{3} UNABLE_TO_CHECK_IF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_ = Unable to determine whether the provided codes are in the value set {0} because the value set or a code system it depends on is not known to the validator TERMINOLOGY_TX_SYSTEM_WRONG_HTML = The code system reference {0} is wrong - the code system reference cannot be to an HTML page. This may be the correct reference: {1} TERMINOLOGY_TX_SYSTEM_WRONG_BUILD = The code system reference {0} is wrong - the code system reference cannot be a reference to build.fhir.org. This may be the correct reference: {1} From 482078df55f4bc5f9d6f54384e7ce3dadab6ddb0 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 28 Jul 2022 22:00:43 +1000 Subject: [PATCH 5/5] more R4B/R5 conversion --- .../VersionConvertorFactory_43_50.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_43_50.java diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_43_50.java new file mode 100644 index 000000000..e1db50aed --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_43_50.java @@ -0,0 +1,44 @@ +package org.hl7.fhir.convertors.factory; + +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50; +import org.hl7.fhir.convertors.conv43_50.VersionConvertor_43_50; +import org.hl7.fhir.exceptions.FHIRException; + +public final class VersionConvertorFactory_43_50 extends VersionConvertorFactory { + + public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.r4b.model.Resource src) throws FHIRException { + return convertResource(src, new BaseAdvisor_43_50()); + } + + public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.r4b.model.Resource src, BaseAdvisor_43_50 advisor) throws FHIRException { + cleanInputs(src, advisor); + return src != null ? new VersionConvertor_43_50(advisor).convertResource(src) : null; + } + + public static org.hl7.fhir.r4b.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException { + return convertResource(src, new BaseAdvisor_43_50()); + } + + public static org.hl7.fhir.r4b.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src, BaseAdvisor_43_50 advisor) throws FHIRException { + cleanInputs(src, advisor); + return src != null ? new VersionConvertor_43_50(advisor).convertResource(src) : null; + } + + public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.r4b.model.DataType src) throws FHIRException { + return convertType(src, new BaseAdvisor_43_50()); + } + + public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.r4b.model.DataType src, BaseAdvisor_43_50 advisor) throws FHIRException { + cleanInputs(src, advisor); + return src != null ? new VersionConvertor_43_50(advisor).convertType(src) : null; + } + + public static org.hl7.fhir.r4b.model.DataType convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException { + return convertType(src, new BaseAdvisor_43_50()); + } + + public static org.hl7.fhir.r4b.model.DataType convertType(org.hl7.fhir.r5.model.DataType src, BaseAdvisor_43_50 advisor) throws FHIRException { + cleanInputs(src, advisor); + return src != null ? new VersionConvertor_43_50(advisor).convertType(src) : null; + } +} \ No newline at end of file