From a6faece71b85d92deb9057a2609e83cfed28ab43 Mon Sep 17 00:00:00 2001 From: Lloyd McKenzie Date: Fri, 11 Mar 2022 11:16:04 -0700 Subject: [PATCH 1/2] Added R4B releases to the R4<->R5 conversion process Corrected release number for R4B to be 4.3xxx rather than 4.1xxx --- .../resources40_50/Enumerations40_50.java | 12 + .../org/hl7/fhir/r5/model/Enumerations.java | 482 +++++++++--------- 2 files changed, 253 insertions(+), 241 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Enumerations40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Enumerations40_50.java index 002f80841..eb3430632 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Enumerations40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/Enumerations40_50.java @@ -227,6 +227,12 @@ public class Enumerations40_50 { case _4_1_0: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_1_0); break; + case _4_3_0_CIBUILD: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_3_0CIBUILD); + break; + case _4_3_0_SNAPSHOT1: + tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_3_0SNAPSHOT1); + break; default: tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL); break; @@ -312,6 +318,12 @@ public class Enumerations40_50 { case _4_1_0: tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_1_0); break; + case _4_3_0CIBUILD: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_3_0_CIBUILD); + break; + case _4_3_0SNAPSHOT1: + tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_3_0_SNAPSHOT1); + break; default: tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL); break; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Enumerations.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Enumerations.java index d153c5280..f7d3edcef 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Enumerations.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Enumerations.java @@ -6874,71 +6874,71 @@ The primary difference between a medicationusage and a medicationadministration public static FHIRVersion fromCode(String codeString) throws FHIRException { if (codeString == null || "".equals(codeString)) return null; - if ("0.01".equals(codeString)) - return _0_01; - if ("0.05".equals(codeString)) - return _0_05; - if ("0.06".equals(codeString)) - return _0_06; - if ("0.11".equals(codeString)) - return _0_11; - if ("0.0.80".equals(codeString)) - return _0_0_80; - if ("0.0.81".equals(codeString)) - return _0_0_81; - if ("0.0.82".equals(codeString)) - return _0_0_82; - if ("0.4.0".equals(codeString)) - return _0_4_0; - if ("0.5.0".equals(codeString)) - return _0_5_0; - if ("1.0.0".equals(codeString)) - return _1_0_0; - if ("1.0.1".equals(codeString)) - return _1_0_1; - if ("1.0.2".equals(codeString)) - return _1_0_2; - if ("1.1.0".equals(codeString)) - return _1_1_0; - if ("1.4.0".equals(codeString)) - return _1_4_0; - if ("1.6.0".equals(codeString)) - return _1_6_0; - if ("1.8.0".equals(codeString)) - return _1_8_0; - if ("3.0.0".equals(codeString)) - return _3_0_0; - if ("3.0.1".equals(codeString)) - return _3_0_1; - if ("3.0.2".equals(codeString)) - return _3_0_2; - if ("3.3.0".equals(codeString)) - return _3_3_0; - if ("3.5.0".equals(codeString)) - return _3_5_0; - if ("4.0.0".equals(codeString)) - return _4_0_0; - if ("4.0.1".equals(codeString)) - return _4_0_1; - if ("4.1.0".equals(codeString)) - return _4_1_0; - if ("4.2.0".equals(codeString)) - return _4_2_0; - if ("4.3.0-snapshot1".equals(codeString)) - return _4_3_0SNAPSHOT1; - if ("4.3.0-cibuild".equals(codeString)) - return _4_3_0CIBUILD; - if ("4.4.0".equals(codeString)) - return _4_4_0; - if ("4.5.0".equals(codeString)) - return _4_5_0; - if ("4.6.0".equals(codeString)) - return _4_6_0; - if ("5.0.0-snapshot1".equals(codeString)) - return _5_0_0SNAPSHOT1; - if ("5.0.0-cibuild".equals(codeString)) - return _5_0_0CIBUILD; - throw new FHIRException("Unknown FHIRVersion code '"+codeString+"'"); + if ("0.01".equals(codeString)) + return _0_01; + if ("0.05".equals(codeString)) + return _0_05; + if ("0.06".equals(codeString)) + return _0_06; + if ("0.11".equals(codeString)) + return _0_11; + if ("0.0.80".equals(codeString)) + return _0_0_80; + if ("0.0.81".equals(codeString)) + return _0_0_81; + if ("0.0.82".equals(codeString)) + return _0_0_82; + if ("0.4.0".equals(codeString)) + return _0_4_0; + if ("0.5.0".equals(codeString)) + return _0_5_0; + if ("1.0.0".equals(codeString)) + return _1_0_0; + if ("1.0.1".equals(codeString)) + return _1_0_1; + if ("1.0.2".equals(codeString)) + return _1_0_2; + if ("1.1.0".equals(codeString)) + return _1_1_0; + if ("1.4.0".equals(codeString)) + return _1_4_0; + if ("1.6.0".equals(codeString)) + return _1_6_0; + if ("1.8.0".equals(codeString)) + return _1_8_0; + if ("3.0.0".equals(codeString)) + return _3_0_0; + if ("3.0.1".equals(codeString)) + return _3_0_1; + if ("3.0.2".equals(codeString)) + return _3_0_2; + if ("3.3.0".equals(codeString)) + return _3_3_0; + if ("3.5.0".equals(codeString)) + return _3_5_0; + if ("4.0.0".equals(codeString)) + return _4_0_0; + if ("4.0.1".equals(codeString)) + return _4_0_1; + if ("4.1.0".equals(codeString)) + return _4_1_0; + if ("4.2.0".equals(codeString)) + return _4_2_0; + if ("4.3.0-snapshot1".equals(codeString)) + return _4_3_0SNAPSHOT1; + if ("4.3.0-cibuild".equals(codeString)) + return _4_3_0CIBUILD; + if ("4.4.0".equals(codeString)) + return _4_4_0; + if ("4.5.0".equals(codeString)) + return _4_5_0; + if ("4.6.0".equals(codeString)) + return _4_6_0; + if ("5.0.0-snapshot1".equals(codeString)) + return _5_0_0SNAPSHOT1; + if ("5.0.0-cibuild".equals(codeString)) + return _5_0_0CIBUILD; + throw new FHIRException("Unknown FHIRVersion code '"+codeString+"'"); } public String toCode() { switch (this) { @@ -7104,51 +7104,51 @@ public String toCode(int len) { public static boolean isValidCode(String codeString) { if (codeString == null || "".equals(codeString)) return false; - if ("0.01".equals(codeString)) - return true; - if ("0.05".equals(codeString)) - return true; - if ("0.06".equals(codeString)) - return true; - if ("0.11".equals(codeString)) - return true; - if ("0.0.80".equals(codeString)) - return true; - if ("0.0.81".equals(codeString)) - return true; - if ("0.0.82".equals(codeString)) - return true; - if ("0.4.0".equals(codeString)) - return true; - if ("0.5.0".equals(codeString)) - return true; - if ("1.0.0".equals(codeString)) - return true; - if ("1.0.1".equals(codeString)) - return true; - if ("1.0.2".equals(codeString)) - return true; - if ("1.1.0".equals(codeString)) - return true; - if ("1.4.0".equals(codeString)) - return true; - if ("1.6.0".equals(codeString)) - return true; - if ("1.8.0".equals(codeString)) - return true; - if ("3.0.0".equals(codeString)) - return true; - if ("3.0.1".equals(codeString)) - return true; - if ("3.3.0".equals(codeString)) - return true; - if ("3.5.0".equals(codeString)) - return true; - if ("4.0.0".equals(codeString)) - return true; - if ("4.2.0".equals(codeString)) - return true; - return false; + if ("0.01".equals(codeString)) + return true; + if ("0.05".equals(codeString)) + return true; + if ("0.06".equals(codeString)) + return true; + if ("0.11".equals(codeString)) + return true; + if ("0.0.80".equals(codeString)) + return true; + if ("0.0.81".equals(codeString)) + return true; + if ("0.0.82".equals(codeString)) + return true; + if ("0.4.0".equals(codeString)) + return true; + if ("0.5.0".equals(codeString)) + return true; + if ("1.0.0".equals(codeString)) + return true; + if ("1.0.1".equals(codeString)) + return true; + if ("1.0.2".equals(codeString)) + return true; + if ("1.1.0".equals(codeString)) + return true; + if ("1.4.0".equals(codeString)) + return true; + if ("1.6.0".equals(codeString)) + return true; + if ("1.8.0".equals(codeString)) + return true; + if ("3.0.0".equals(codeString)) + return true; + if ("3.0.1".equals(codeString)) + return true; + if ("3.3.0".equals(codeString)) + return true; + if ("3.5.0".equals(codeString)) + return true; + if ("4.0.0".equals(codeString)) + return true; + if ("4.2.0".equals(codeString)) + return true; + return false; } @Override @@ -7158,7 +7158,7 @@ public String toCode(int len) { public boolean isR4B() { - return toCode().startsWith("4.1"); + return toCode().startsWith("4.3"); } // end addition @@ -7169,71 +7169,71 @@ public String toCode(int len) { if (codeString == null || "".equals(codeString)) if (codeString == null || "".equals(codeString)) return null; - if ("0.01".equals(codeString)) - return FHIRVersion._0_01; - if ("0.05".equals(codeString)) - return FHIRVersion._0_05; - if ("0.06".equals(codeString)) - return FHIRVersion._0_06; - if ("0.11".equals(codeString)) - return FHIRVersion._0_11; - if ("0.0.80".equals(codeString)) - return FHIRVersion._0_0_80; - if ("0.0.81".equals(codeString)) - return FHIRVersion._0_0_81; - if ("0.0.82".equals(codeString)) - return FHIRVersion._0_0_82; - if ("0.4.0".equals(codeString)) - return FHIRVersion._0_4_0; - if ("0.5.0".equals(codeString)) - return FHIRVersion._0_5_0; - if ("1.0.0".equals(codeString)) - return FHIRVersion._1_0_0; - if ("1.0.1".equals(codeString)) - return FHIRVersion._1_0_1; - if ("1.0.2".equals(codeString)) - return FHIRVersion._1_0_2; - if ("1.1.0".equals(codeString)) - return FHIRVersion._1_1_0; - if ("1.4.0".equals(codeString)) - return FHIRVersion._1_4_0; - if ("1.6.0".equals(codeString)) - return FHIRVersion._1_6_0; - if ("1.8.0".equals(codeString)) - return FHIRVersion._1_8_0; - if ("3.0.0".equals(codeString)) - return FHIRVersion._3_0_0; - if ("3.0.1".equals(codeString)) - return FHIRVersion._3_0_1; - if ("3.0.2".equals(codeString)) - return FHIRVersion._3_0_2; - if ("3.3.0".equals(codeString)) - return FHIRVersion._3_3_0; - if ("3.5.0".equals(codeString)) - return FHIRVersion._3_5_0; - if ("4.0.0".equals(codeString)) - return FHIRVersion._4_0_0; - if ("4.0.1".equals(codeString)) - return FHIRVersion._4_0_1; - if ("4.1.0".equals(codeString)) - return FHIRVersion._4_1_0; - if ("4.2.0".equals(codeString)) - return FHIRVersion._4_2_0; - if ("4.3.0-snapshot1".equals(codeString)) - return FHIRVersion._4_3_0SNAPSHOT1; - if ("4.3.0-cibuild".equals(codeString)) - return FHIRVersion._4_3_0CIBUILD; - if ("4.4.0".equals(codeString)) - return FHIRVersion._4_4_0; - if ("4.5.0".equals(codeString)) - return FHIRVersion._4_5_0; - if ("4.6.0".equals(codeString)) - return FHIRVersion._4_6_0; - if ("5.0.0-snapshot1".equals(codeString)) - return FHIRVersion._5_0_0SNAPSHOT1; - if ("5.0.0-cibuild".equals(codeString)) - return FHIRVersion._5_0_0CIBUILD; - throw new IllegalArgumentException("Unknown FHIRVersion code '"+codeString+"'"); + if ("0.01".equals(codeString)) + return FHIRVersion._0_01; + if ("0.05".equals(codeString)) + return FHIRVersion._0_05; + if ("0.06".equals(codeString)) + return FHIRVersion._0_06; + if ("0.11".equals(codeString)) + return FHIRVersion._0_11; + if ("0.0.80".equals(codeString)) + return FHIRVersion._0_0_80; + if ("0.0.81".equals(codeString)) + return FHIRVersion._0_0_81; + if ("0.0.82".equals(codeString)) + return FHIRVersion._0_0_82; + if ("0.4.0".equals(codeString)) + return FHIRVersion._0_4_0; + if ("0.5.0".equals(codeString)) + return FHIRVersion._0_5_0; + if ("1.0.0".equals(codeString)) + return FHIRVersion._1_0_0; + if ("1.0.1".equals(codeString)) + return FHIRVersion._1_0_1; + if ("1.0.2".equals(codeString)) + return FHIRVersion._1_0_2; + if ("1.1.0".equals(codeString)) + return FHIRVersion._1_1_0; + if ("1.4.0".equals(codeString)) + return FHIRVersion._1_4_0; + if ("1.6.0".equals(codeString)) + return FHIRVersion._1_6_0; + if ("1.8.0".equals(codeString)) + return FHIRVersion._1_8_0; + if ("3.0.0".equals(codeString)) + return FHIRVersion._3_0_0; + if ("3.0.1".equals(codeString)) + return FHIRVersion._3_0_1; + if ("3.0.2".equals(codeString)) + return FHIRVersion._3_0_2; + if ("3.3.0".equals(codeString)) + return FHIRVersion._3_3_0; + if ("3.5.0".equals(codeString)) + return FHIRVersion._3_5_0; + if ("4.0.0".equals(codeString)) + return FHIRVersion._4_0_0; + if ("4.0.1".equals(codeString)) + return FHIRVersion._4_0_1; + if ("4.1.0".equals(codeString)) + return FHIRVersion._4_1_0; + if ("4.2.0".equals(codeString)) + return FHIRVersion._4_2_0; + if ("4.3.0-snapshot1".equals(codeString)) + return FHIRVersion._4_3_0SNAPSHOT1; + if ("4.3.0-cibuild".equals(codeString)) + return FHIRVersion._4_3_0CIBUILD; + if ("4.4.0".equals(codeString)) + return FHIRVersion._4_4_0; + if ("4.5.0".equals(codeString)) + return FHIRVersion._4_5_0; + if ("4.6.0".equals(codeString)) + return FHIRVersion._4_6_0; + if ("5.0.0-snapshot1".equals(codeString)) + return FHIRVersion._5_0_0SNAPSHOT1; + if ("5.0.0-cibuild".equals(codeString)) + return FHIRVersion._5_0_0CIBUILD; + throw new IllegalArgumentException("Unknown FHIRVersion code '"+codeString+"'"); } public Enumeration fromType(Base code) throws FHIRException { if (code == null) @@ -7243,71 +7243,71 @@ public String toCode(int len) { String codeString = ((PrimitiveType) code).asStringValue(); if (codeString == null || "".equals(codeString)) return null; - if ("0.01".equals(codeString)) - return new Enumeration(this, FHIRVersion._0_01); - if ("0.05".equals(codeString)) - return new Enumeration(this, FHIRVersion._0_05); - if ("0.06".equals(codeString)) - return new Enumeration(this, FHIRVersion._0_06); - if ("0.11".equals(codeString)) - return new Enumeration(this, FHIRVersion._0_11); - if ("0.0.80".equals(codeString)) - return new Enumeration(this, FHIRVersion._0_0_80); - if ("0.0.81".equals(codeString)) - return new Enumeration(this, FHIRVersion._0_0_81); - if ("0.0.82".equals(codeString)) - return new Enumeration(this, FHIRVersion._0_0_82); - if ("0.4.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._0_4_0); - if ("0.5.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._0_5_0); - if ("1.0.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._1_0_0); - if ("1.0.1".equals(codeString)) - return new Enumeration(this, FHIRVersion._1_0_1); - if ("1.0.2".equals(codeString)) - return new Enumeration(this, FHIRVersion._1_0_2); - if ("1.1.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._1_1_0); - if ("1.4.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._1_4_0); - if ("1.6.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._1_6_0); - if ("1.8.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._1_8_0); - if ("3.0.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._3_0_0); - if ("3.0.1".equals(codeString)) - return new Enumeration(this, FHIRVersion._3_0_1); - if ("3.0.2".equals(codeString)) - return new Enumeration(this, FHIRVersion._3_0_2); - if ("3.3.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._3_3_0); - if ("3.5.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._3_5_0); - if ("4.0.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._4_0_0); - if ("4.0.1".equals(codeString)) - return new Enumeration(this, FHIRVersion._4_0_1); - if ("4.1.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._4_1_0); - if ("4.2.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._4_2_0); - if ("4.3.0-snapshot1".equals(codeString)) - return new Enumeration(this, FHIRVersion._4_3_0SNAPSHOT1); - if ("4.3.0-cibuild".equals(codeString)) - return new Enumeration(this, FHIRVersion._4_3_0CIBUILD); - if ("4.4.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._4_4_0); - if ("4.5.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._4_5_0); - if ("4.6.0".equals(codeString)) - return new Enumeration(this, FHIRVersion._4_6_0); - if ("5.0.0-snapshot1".equals(codeString)) - return new Enumeration(this, FHIRVersion._5_0_0SNAPSHOT1); - if ("5.0.0-cibuild".equals(codeString)) - return new Enumeration(this, FHIRVersion._5_0_0CIBUILD); - throw new FHIRException("Unknown FHIRVersion code '"+codeString+"'"); + if ("0.01".equals(codeString)) + return new Enumeration(this, FHIRVersion._0_01); + if ("0.05".equals(codeString)) + return new Enumeration(this, FHIRVersion._0_05); + if ("0.06".equals(codeString)) + return new Enumeration(this, FHIRVersion._0_06); + if ("0.11".equals(codeString)) + return new Enumeration(this, FHIRVersion._0_11); + if ("0.0.80".equals(codeString)) + return new Enumeration(this, FHIRVersion._0_0_80); + if ("0.0.81".equals(codeString)) + return new Enumeration(this, FHIRVersion._0_0_81); + if ("0.0.82".equals(codeString)) + return new Enumeration(this, FHIRVersion._0_0_82); + if ("0.4.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._0_4_0); + if ("0.5.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._0_5_0); + if ("1.0.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._1_0_0); + if ("1.0.1".equals(codeString)) + return new Enumeration(this, FHIRVersion._1_0_1); + if ("1.0.2".equals(codeString)) + return new Enumeration(this, FHIRVersion._1_0_2); + if ("1.1.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._1_1_0); + if ("1.4.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._1_4_0); + if ("1.6.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._1_6_0); + if ("1.8.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._1_8_0); + if ("3.0.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._3_0_0); + if ("3.0.1".equals(codeString)) + return new Enumeration(this, FHIRVersion._3_0_1); + if ("3.0.2".equals(codeString)) + return new Enumeration(this, FHIRVersion._3_0_2); + if ("3.3.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._3_3_0); + if ("3.5.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._3_5_0); + if ("4.0.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._4_0_0); + if ("4.0.1".equals(codeString)) + return new Enumeration(this, FHIRVersion._4_0_1); + if ("4.1.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._4_1_0); + if ("4.2.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._4_2_0); + if ("4.3.0-snapshot1".equals(codeString)) + return new Enumeration(this, FHIRVersion._4_3_0SNAPSHOT1); + if ("4.3.0-cibuild".equals(codeString)) + return new Enumeration(this, FHIRVersion._4_3_0CIBUILD); + if ("4.4.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._4_4_0); + if ("4.5.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._4_5_0); + if ("4.6.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._4_6_0); + if ("5.0.0-snapshot1".equals(codeString)) + return new Enumeration(this, FHIRVersion._5_0_0SNAPSHOT1); + if ("5.0.0-cibuild".equals(codeString)) + return new Enumeration(this, FHIRVersion._5_0_0CIBUILD); + throw new FHIRException("Unknown FHIRVersion code '"+codeString+"'"); } public String toCode(FHIRVersion code) { if (code == FHIRVersion._0_01) From 335800c9321d1120bed009d626aa0ff681461586 Mon Sep 17 00:00:00 2001 From: Lloyd McKenzie Date: Sun, 13 Mar 2022 20:56:40 -0600 Subject: [PATCH 2/2] Replaced hard-coded extension reference with constant value --- .../src/org/hl7/fhir/core/generator/analysis/Analyser.java | 4 ++-- .../hl7/fhir/core/generator/codegen/JavaBaseGenerator.java | 4 ++-- .../org/hl7/fhir/validation/instance/InstanceValidator.java | 2 +- .../instance/type/StructureDefinitionValidator.java | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) 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 732f9ed8a..37a64b79a 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 @@ -249,8 +249,8 @@ public class Analyser { } protected String getTypename(TypeRefComponent type) throws Exception { - if (type.hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")) { - return type.getExtensionString("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"); + if (type.hasExtension(ToolingExtensions.EXT_FHIR_TYPE)) { + return type.getExtensionString(ToolingExtensions.EXT_FHIR_TYPE); } else { return getTypeName(type.getCode()); } diff --git a/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/codegen/JavaBaseGenerator.java b/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/codegen/JavaBaseGenerator.java index e81bbb029..6ce0560dc 100644 --- a/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/codegen/JavaBaseGenerator.java +++ b/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/codegen/JavaBaseGenerator.java @@ -172,8 +172,8 @@ public class JavaBaseGenerator extends OutputStreamWriter { } protected String getTypename(TypeRefComponent type) throws Exception { - if (type.hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")) { - return type.getExtensionString("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"); + if (type.hasExtension(ToolingExtensions.EXT_FHIR_TYPE)) { + return type.getExtensionString(ToolingExtensions.EXT_FHIR_TYPE); } else { return getTypeName(type.getCode()); } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java index 54c748c7a..3e94b0f9d 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java @@ -1871,7 +1871,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat for (StructureDefinitionContextComponent ctxt : list) { res.add(ctxt.copy()); } - if ("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type".equals(extUrl)) { + if (ToolingExtensions.EXT_FHIR_TYPE.equals(extUrl)) { list.get(0).setExpression("ElementDefinition.type"); } // the history of this is a mess - see https://jira.hl7.org/browse/FHIR-13328 diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java index 0bbd1792a..a69ecaa9b 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java @@ -133,8 +133,8 @@ public class StructureDefinitionValidator extends BaseValidator { typeMustSupport = true; } String tc = type.getChildValue("code"); - if (type.hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")) { - tc = type.getExtensionValue("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type").primitiveValue(); + if (type.hasExtension(ToolingExtensions.EXT_FHIR_TYPE)) { + tc = type.getExtensionValue(ToolingExtensions.EXT_FHIR_TYPE).primitiveValue(); } if (Utilities.noString(tc) && type.hasChild("code")) { if (type.getNamedChild("code").hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type")) {