diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SearchParameter10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SearchParameter10_50.java index fdfd8ae37..fbdb5c66e 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SearchParameter10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/SearchParameter10_50.java @@ -10,8 +10,6 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri1 import org.hl7.fhir.dstu2.utils.ToolingExtensions; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; -import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.r5.model.Enumerations.AllResourceTypes; public class SearchParameter10_50 { @@ -38,7 +36,7 @@ public class SearchParameter10_50 { tgt.setRequirements(src.getPurpose()); if (src.hasCodeElement()) tgt.setCodeElement(Code10_50.convertCode(src.getCodeElement())); - for (Enumeration t : src.getBase()) tgt.setBase(t.getCode()); + for (CodeType t : src.getBase()) tgt.setBaseElement(Code10_50.convertCode(t)); if (src.hasType()) tgt.setTypeElement(Enumerations10_50.convertSearchParamType(src.getTypeElement())); if (src.hasDescription()) @@ -75,7 +73,7 @@ public class SearchParameter10_50 { tgt.setPurpose(src.getRequirements()); if (src.hasCodeElement()) tgt.setCodeElement(Code10_50.convertCode(src.getCodeElement())); - tgt.addBase(AllResourceTypes.fromCode(src.getBase())); + tgt.getBase().add(Code10_50.convertCode(src.getBaseElement())); if (src.hasType()) tgt.setTypeElement(Enumerations10_50.convertSearchParamType(src.getTypeElement())); if (src.hasDescription()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/SearchParameter14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/SearchParameter14_50.java index 3e6c242f7..66fef5020 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/SearchParameter14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/resources14_50/SearchParameter14_50.java @@ -11,8 +11,6 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Stri import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; -import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.r5.model.Enumerations.AllResourceTypes; public class SearchParameter14_50 { @@ -44,7 +42,7 @@ public class SearchParameter14_50 { tgt.setRequirements(src.getPurpose()); if (src.hasCodeElement()) tgt.setCodeElement(Code14_50.convertCode(src.getCodeElement())); - for (Enumeration t : src.getBase()) tgt.setBase(t.asStringValue()); + for (CodeType t : src.getBase()) tgt.setBase(t.asStringValue()); if (src.hasType()) tgt.setTypeElement(Enumerations14_50.convertSearchParamType(src.getTypeElement())); if (src.hasDescription()) @@ -87,7 +85,7 @@ public class SearchParameter14_50 { tgt.setPurpose(src.getRequirements()); if (src.hasCodeElement()) tgt.setCodeElement(Code14_50.convertCode(src.getCodeElement())); - tgt.addBase(AllResourceTypes.fromCode(src.getBase())); + tgt.getBase().add(Code14_50.convertCode(src.getBaseElement())); if (src.hasType()) tgt.setTypeElement(Enumerations14_50.convertSearchParamType(src.getTypeElement())); if (src.hasDescription()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SearchParameter30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SearchParameter30_50.java index 52784e083..eed145ced 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SearchParameter30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/resources30_50/SearchParameter30_50.java @@ -15,8 +15,6 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Stri import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; -import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.r5.model.Enumerations.AllResourceTypes; public class SearchParameter30_50 { @@ -215,7 +213,7 @@ public class SearchParameter30_50 { tgt.setPurposeElement(MarkDown30_50.convertMarkdown(src.getPurposeElement())); if (src.hasCode()) tgt.setCodeElement(Code30_50.convertCode(src.getCodeElement())); - for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.addBase(AllResourceTypes.fromCode(t.asStringValue())); + for (org.hl7.fhir.dstu3.model.CodeType t : src.getBase()) tgt.getBase().add(Code30_50.convertCode(t)); if (src.hasType()) tgt.setTypeElement(Enumerations30_50.convertSearchParamType(src.getTypeElement())); if (src.hasDerivedFrom()) @@ -270,7 +268,7 @@ public class SearchParameter30_50 { tgt.setPurposeElement(MarkDown30_50.convertMarkdown(src.getPurposeElement())); if (src.hasCode()) tgt.setCodeElement(Code30_50.convertCode(src.getCodeElement())); - for (Enumeration t : src.getBase()) tgt.addBase(t.getCode()); + for (CodeType t : src.getBase()) tgt.getBase().add(Code30_50.convertCode(t)); if (src.hasType()) tgt.setTypeElement(Enumerations30_50.convertSearchParamType(src.getTypeElement())); if (src.hasDerivedFrom()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SearchParameter40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SearchParameter40_50.java index 5449d8535..fd7b97ef7 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SearchParameter40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/SearchParameter40_50.java @@ -15,8 +15,6 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; -import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.r5.model.Enumerations.AllResourceTypes; /* Copyright (c) 2011+, HL7, Inc. @@ -82,7 +80,7 @@ public class SearchParameter40_50 { tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); if (src.hasCode()) tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); - for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.addBase(AllResourceTypes.fromCode(t.asStringValue())); + for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.getBase().add(Code40_50.convertCode(t)); if (src.hasType()) tgt.setTypeElement(Enumerations40_50.convertSearchParamType(src.getTypeElement())); if (src.hasExpression()) @@ -141,7 +139,7 @@ public class SearchParameter40_50 { tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); if (src.hasCode()) tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); - for (Enumeration t : src.getBase()) tgt.addBase(t.getCode()); + for (CodeType t : src.getBase()) tgt.getBase().add(Code40_50.convertCode(t)); if (src.hasType()) tgt.setTypeElement(Enumerations40_50.convertSearchParamType(src.getTypeElement())); if (src.hasExpression()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java index bb1b98948..1964bd53a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv43_50/resources43_50/SearchParameter43_50.java @@ -15,8 +15,6 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_ 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.CodeType; -import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.r5.model.Enumerations.AllResourceTypes; /* Copyright (c) 2011+, HL7, Inc. @@ -82,7 +80,7 @@ public class SearchParameter43_50 { 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.addBase(AllResourceTypes.fromCode(t.asStringValue())); + for (org.hl7.fhir.r4b.model.CodeType t : src.getBase()) tgt.getBase().add(Code43_50.convertCode(t)); if (src.hasType()) tgt.setTypeElement(Enumerations43_50.convertSearchParamType(src.getTypeElement())); if (src.hasExpression()) @@ -141,7 +139,7 @@ public class SearchParameter43_50 { tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement())); if (src.hasCode()) tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement())); - for (Enumeration t : src.getBase()) tgt.addBase(t.getCode()); + for (CodeType t : src.getBase()) tgt.getBase().add(Code43_50.convertCode(t)); if (src.hasType()) tgt.setTypeElement(Enumerations43_50.convertSearchParamType(src.getTypeElement())); if (src.hasExpression()) diff --git a/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/analysis/Analyser.java b/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/analysis/Analyser.java index 37d56243f..435d3e4f0 100644 --- a/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/analysis/Analyser.java +++ b/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/analysis/Analyser.java @@ -309,7 +309,7 @@ public class Analyser { if (!Utilities.existsInList(name, "Resource")) { for (SearchParameter sp : definitions.getSearchParams().getList()) { boolean relevant = false; - for (Enumeration c : sp.getBase()) { + for (CodeType c : sp.getBase()) { if (c.getValue().equals(name)) { relevant = true; break; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/JsonParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/JsonParser.java index 0f48bf72e..09e2eabea 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/JsonParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/JsonParser.java @@ -27903,9 +27903,9 @@ public class JsonParser extends JsonParserBase { JsonArray array = getJArray(json, "base"); for (int i = 0; i < array.size(); i++) { if (array.get(i).isJsonNull()) { - res.getBase().add(new Enumeration(new Enumerations.AllResourceTypesEnumFactory(), Enumerations.AllResourceTypes.NULL)); + res.getBase().add(new CodeType()); } else {; - res.getBase().add(parseEnumeration(array.get(i).getAsString(), Enumerations.AllResourceTypes.NULL, new Enumerations.AllResourceTypesEnumFactory())); + res.getBase().add(parseCode(array.get(i).getAsString())); } } }; @@ -27913,7 +27913,7 @@ public class JsonParser extends JsonParserBase { JsonArray array = getJArray(json, "_base"); for (int i = 0; i < array.size(); i++) { if (i == res.getBase().size()) - res.getBase().add(parseEnumeration(null, Enumerations.AllResourceTypes.NULL, new Enumerations.AllResourceTypesEnumFactory())); + res.getBase().add(new CodeType()); if (array.get(i) instanceof JsonObject) parseElementProperties(array.get(i).getAsJsonObject(), res.getBase().get(i)); } @@ -64718,13 +64718,13 @@ public class JsonParser extends JsonParserBase { } if (element.hasBase()) { openArray("base"); - for (Enumeration e : element.getBase()) - composeEnumerationCore(null, e, new Enumerations.AllResourceTypesEnumFactory(), true); + for (CodeType e : element.getBase()) + composeCodeCore(null, e, true); closeArray(); if (anyHasExtras(element.getBase())) { openArray("_base"); - for (Enumeration e : element.getBase()) - composeEnumerationExtras(null, e, new Enumerations.AllResourceTypesEnumFactory(), true); + for (CodeType e : element.getBase()) + composeCodeExtras(null, e, true); closeArray(); } }; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/RdfParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/RdfParser.java index 66a14e944..0ddde836c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/RdfParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/RdfParser.java @@ -22356,7 +22356,7 @@ public class RdfParser extends RdfParserBase { composeCode(t, "SearchParameter", "code", element.getCodeElement(), -1); } for (int i = 0; i < element.getBase().size(); i++) { - composeEnum(t, "SearchParameter", "base", element.getBase().get(i), i); + composeCode(t, "SearchParameter", "base", element.getBase().get(i), i); } if (element.hasTypeElement()) { composeEnum(t, "SearchParameter", "type", element.getTypeElement(), -1); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/XmlParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/XmlParser.java index 1619720f4..acb18bb8c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/XmlParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/XmlParser.java @@ -24175,7 +24175,7 @@ public class XmlParser extends XmlParserBase { } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) { res.setCodeElement(parseCode(xpp)); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) { - res.getBase().add(parseEnumeration(xpp, Enumerations.AllResourceTypes.NULL, new Enumerations.AllResourceTypesEnumFactory())); + res.getBase().add(parseCode(xpp)); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) { res.setTypeElement(parseEnumeration(xpp, Enumerations.SearchParamType.NULL, new Enumerations.SearchParamTypeEnumFactory())); } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) { @@ -55508,8 +55508,8 @@ public class XmlParser extends XmlParserBase { composeCode("code", element.getCodeElement()); } if (element.hasBase()) - for (Enumeration e : element.getBase()) - composeEnumeration("base", e, new Enumerations.AllResourceTypesEnumFactory()); + for (CodeType e : element.getBase()) + composeCode("base", e); if (element.hasTypeElement()) composeEnumeration("type", element.getTypeElement(), new Enumerations.SearchParamTypeEnumFactory()); if (element.hasExpressionElement()) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/SearchParameter.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/SearchParameter.java index b6390102a..94ca2e0ca 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/SearchParameter.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/SearchParameter.java @@ -1050,7 +1050,7 @@ public class SearchParameter extends CanonicalResource { @Child(name = "base", type = {CodeType.class}, order=16, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) @Description(shortDefinition="The resource type(s) this search parameter applies to", formalDefinition="The base resource type(s) that this search parameter can be used against." ) @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/all-resource-types") - protected List> base; + protected List base; /** * The type of value that a search parameter may contain, and how the content is interpreted. @@ -1146,7 +1146,7 @@ public class SearchParameter extends CanonicalResource { /** * Constructor */ - public SearchParameter(String url, String name, PublicationStatus status, String description, String code, AllResourceTypes base, SearchParamType type) { + public SearchParameter(String url, String name, PublicationStatus status, String description, String code, String base, SearchParamType type) { super(); this.setUrl(url); this.setName(name); @@ -1934,16 +1934,16 @@ public class SearchParameter extends CanonicalResource { /** * @return {@link #base} (The base resource type(s) that this search parameter can be used against.) */ - public List> getBase() { + public List getBase() { if (this.base == null) - this.base = new ArrayList>(); + this.base = new ArrayList(); return this.base; } /** * @return Returns a reference to this for easy method chaining */ - public SearchParameter setBase(List> theBase) { + public SearchParameter setBase(List theBase) { this.base = theBase; return this; } @@ -1951,7 +1951,7 @@ public class SearchParameter extends CanonicalResource { public boolean hasBase() { if (this.base == null) return false; - for (Enumeration item : this.base) + for (CodeType item : this.base) if (!item.isEmpty()) return true; return false; @@ -1960,10 +1960,10 @@ public class SearchParameter extends CanonicalResource { /** * @return {@link #base} (The base resource type(s) that this search parameter can be used against.) */ - public Enumeration addBaseElement() {//2 - Enumeration t = new Enumeration(new AllResourceTypesEnumFactory()); + public CodeType addBaseElement() {//2 + CodeType t = new CodeType(); if (this.base == null) - this.base = new ArrayList>(); + this.base = new ArrayList(); this.base.add(t); return t; } @@ -1971,11 +1971,11 @@ public class SearchParameter extends CanonicalResource { /** * @param value {@link #base} (The base resource type(s) that this search parameter can be used against.) */ - public SearchParameter addBase(AllResourceTypes value) { //1 - Enumeration t = new Enumeration(new AllResourceTypesEnumFactory()); - t.setValue(value); + public SearchParameter addBase(String code) { //1 + CodeType t = new CodeType(); + t.setValue(code); if (this.base == null) - this.base = new ArrayList>(); + this.base = new ArrayList(); this.base.add(t); return this; } @@ -1983,11 +1983,11 @@ public class SearchParameter extends CanonicalResource { /** * @param value {@link #base} (The base resource type(s) that this search parameter can be used against.) */ - public boolean hasBase(AllResourceTypes value) { + public boolean hasBase(String code) { if (this.base == null) return false; - for (Enumeration v : this.base) - if (v.getValue().equals(value)) // code + for (CodeType v : this.base) + if (v.getValue().equals(code)) // code return true; return false; } @@ -2838,8 +2838,8 @@ public class SearchParameter extends CanonicalResource { this.code = TypeConvertor.castToCode(value); // CodeType return value; case 3016401: // base - value = new AllResourceTypesEnumFactory().fromType(TypeConvertor.castToCode(value)); - this.getBase().add((Enumeration) value); // Enumeration + value = TypeConvertor.castToCode(value); + this.getBase().add((CodeType) value); // Enumeration return value; case 3575610: // type value = new SearchParamTypeEnumFactory().fromType(TypeConvertor.castToCode(value)); @@ -2919,8 +2919,8 @@ public class SearchParameter extends CanonicalResource { } else if (name.equals("code")) { this.code = TypeConvertor.castToCode(value); // CodeType } else if (name.equals("base")) { - value = new AllResourceTypesEnumFactory().fromType(TypeConvertor.castToCode(value)); - this.getBase().add((Enumeration) value); + value = TypeConvertor.castToCode(value); + this.getBase().add((CodeType) value); } else if (name.equals("type")) { value = new SearchParamTypeEnumFactory().fromType(TypeConvertor.castToCode(value)); this.type = (Enumeration) value; // Enumeration @@ -3162,8 +3162,8 @@ public class SearchParameter extends CanonicalResource { dst.purpose = purpose == null ? null : purpose.copy(); dst.code = code == null ? null : code.copy(); if (base != null) { - dst.base = new ArrayList>(); - for (Enumeration i : base) + dst.base = new ArrayList(); + for (CodeType i : base) dst.base.add(i.copy()); }; dst.type = type == null ? null : type.copy(); @@ -4476,15 +4476,6 @@ public class SearchParameter extends CanonicalResource { public boolean supportsCopyright() { return false; } - - public boolean hasBase(String n) { - for (Enumeration b : getBase()) { - if (b.getCode().equals(n)) { - return true; - } - } - return false; - } // end addition diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SearchParameterRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SearchParameterRenderer.java index 3a20887c2..768540e24 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SearchParameterRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SearchParameterRenderer.java @@ -7,7 +7,6 @@ import java.util.List; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.CodeType; import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.r5.model.Enumerations.AllResourceTypes; import org.hl7.fhir.r5.model.OperationDefinition; import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.SearchParameter; @@ -50,7 +49,7 @@ public class SearchParameterRenderer extends TerminologyRenderer { XhtmlNode tr = tbl.tr(); tr.td().tx(Utilities.pluralize("Resource", spd.getBase().size())); XhtmlNode td = tr.td(); - for (Enumeration t : spd.getBase()) { + for (CodeType t : spd.getBase()) { StructureDefinition sd = context.getWorker().fetchTypeDefinition(t.toString()); if (sd != null && sd.hasUserData("path")) { td.ah(sd.getUserString("path")).sep(", ").tx(t.getCode());