diff --git a/.gitignore b/.gitignore index 8e30bfb3c..7c74f3f96 100644 --- a/.gitignore +++ b/.gitignore @@ -307,3 +307,5 @@ local.properties /org.hl7.fhir.r4b.new org.hl7.fhir.r5/var/lib/.fhir/packages/ + +org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/DebugUtilities.java diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 709d30cb3..dd745902c 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.2.14-SNAPSHOT + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImplementationGuide40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImplementationGuide40_50.java index aff3d0396..8b5f92a6c 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImplementationGuide40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/ImplementationGuide40_50.java @@ -318,8 +318,10 @@ public class ImplementationGuide40_50 { tgt.setDescriptionElement(String40_50.convertStringToMarkdown(src.getDescriptionElement())); if (src.hasExampleBooleanType()) tgt.setIsExampleElement(Boolean40_50.convertBoolean(src.getExampleBooleanType())); - if (src.hasExampleCanonicalType()) + if (src.hasExampleCanonicalType()) { + tgt.setIsExample(true); tgt.getProfile().add(Canonical40_50.convertCanonical(src.getExampleCanonicalType())); + } if (src.hasGroupingId()) tgt.setGroupingIdElement(Id40_50.convertId(src.getGroupingIdElement())); return tgt; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/NpmPackageVersionConverter.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/NpmPackageVersionConverter.java index 7684e55a7..cd7e5182b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/NpmPackageVersionConverter.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/NpmPackageVersionConverter.java @@ -300,7 +300,6 @@ public class NpmPackageVersionConverter { } throw new Error("Unknown version " + currentVersion + " -> " + version); } catch (Exception ex) { - ex.printStackTrace(); errors.add("Error converting " + n + ": " + ex.getMessage()); return null; } @@ -336,6 +335,7 @@ public class NpmPackageVersionConverter { } } + private void convertResourceR5(Resource res) { if (res instanceof ImplementationGuide) { ImplementationGuide ig = (ImplementationGuide) res; diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/OIDAssigner.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/OIDAssigner.java new file mode 100644 index 000000000..03bf16558 --- /dev/null +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/OIDAssigner.java @@ -0,0 +1,308 @@ +package org.hl7.fhir.convertors.misc; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; + +import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat; +import org.hl7.fhir.utilities.IniFile; +import org.hl7.fhir.utilities.VersionUtilities; + +public class OIDAssigner { + + + public static void main(String[] args) throws Exception { + new OIDAssigner().execute(args[0], args[1], args[2]); + } + + private void execute(String oidSource, String folder, String version) { + IniFile oids = new IniFile(oidSource); + File f = new File(folder); + process(oids, f, version); + } + + private void process(IniFile oids, File folder, String version) { + for (File f : folder.listFiles()) { + if (f.isDirectory()) { + process(oids, f, version); + } else if (f.getName().endsWith(".xml")) { + processFile(oids, f, version, FhirFormat.XML); + } else if (f.getName().endsWith(".json")) { + processFile(oids, f, version, FhirFormat.JSON); + } + } + } + + private void processFile(IniFile oids, File f, String version, FhirFormat fmt) { + switch (VersionUtilities.getMajMin(version)) { + case "1.0" : processFileR2(oids, f, fmt); + case "3.0" : processFileR3(oids, f, fmt); + case "4.0" : processFileR4(oids, f, fmt); + case "4.3" : processFileR4B(oids, f, fmt); + case "5.0" : processFileR5(oids, f, fmt); + } + } + + private void processFileR2(IniFile oids, File f, FhirFormat fmt) { + org.hl7.fhir.dstu2.formats.IParser parser = fmt == FhirFormat.JSON ? new org.hl7.fhir.dstu2.formats.JsonParser() : new org.hl7.fhir.dstu2.formats.XmlParser(); + try { + boolean save = false; + org.hl7.fhir.dstu2.model.Resource r = parser.parse(new FileInputStream(f)); + if (r instanceof org.hl7.fhir.dstu2.model.ValueSet) { + org.hl7.fhir.dstu2.model.ValueSet vs = (org.hl7.fhir.dstu2.model.ValueSet) r; + boolean hasOid = isOid(vs.getIdentifier()); + if (!hasOid) { + String oid = getOid(oids, "ValueSet", vs.getUrl()); + vs.setIdentifier(new org.hl7.fhir.dstu2.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (r instanceof org.hl7.fhir.dstu2.model.ConceptMap) { + org.hl7.fhir.dstu2.model.ConceptMap cm = (org.hl7.fhir.dstu2.model.ConceptMap) r; + boolean hasOid = isOid(cm.getIdentifier()); + if (!hasOid) { + String oid = getOid(oids, "ConceptMap", cm.getUrl()); + cm.setIdentifier(new org.hl7.fhir.dstu2.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (r instanceof org.hl7.fhir.dstu2.model.StructureDefinition) { + org.hl7.fhir.dstu2.model.StructureDefinition sd = (org.hl7.fhir.dstu2.model.StructureDefinition) r; + boolean hasOid = false; + for (org.hl7.fhir.dstu2.model.Identifier id : sd.getIdentifier()) { + if (isOid(id)) { + hasOid = true; + } + } + if (!hasOid) { + String oid = getOid(oids, "StructureDefinition", sd.getUrl()); + sd.getIdentifier().add(new org.hl7.fhir.dstu2.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (save) { + parser.setOutputStyle(org.hl7.fhir.dstu2.formats.IParser.OutputStyle.PRETTY).compose(new FileOutputStream(f), r); + } + } catch (Exception e) { + System.out.println("Erro processing "+f.getAbsolutePath()+": "+e.getMessage()); + } + } + + + private void processFileR3(IniFile oids, File f, FhirFormat fmt) { + org.hl7.fhir.dstu3.formats.IParser parser = fmt == FhirFormat.JSON ? new org.hl7.fhir.dstu3.formats.JsonParser() : new org.hl7.fhir.dstu3.formats.XmlParser(); + try { + boolean save = false; + org.hl7.fhir.dstu3.model.Resource r = parser.parse(new FileInputStream(f)); + if (r instanceof org.hl7.fhir.dstu3.model.CodeSystem) { + org.hl7.fhir.dstu3.model.CodeSystem cs = (org.hl7.fhir.dstu3.model.CodeSystem) r; + boolean hasOid = isOid(cs.getIdentifier()); + if (!hasOid) { + String oid = getOid(oids, "CodeSystem", cs.getUrl()); + cs.setIdentifier(new org.hl7.fhir.dstu3.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (r instanceof org.hl7.fhir.dstu3.model.ValueSet) { + org.hl7.fhir.dstu3.model.ValueSet vs = (org.hl7.fhir.dstu3.model.ValueSet) r; + boolean hasOid = false; + for (org.hl7.fhir.dstu3.model.Identifier id : vs.getIdentifier()) { + if (isOid(id)) { + hasOid = true; + } + } + if (!hasOid) { + String oid = getOid(oids, "ValueSet", vs.getUrl()); + vs.getIdentifier().add(new org.hl7.fhir.dstu3.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (r instanceof org.hl7.fhir.dstu3.model.ConceptMap) { + org.hl7.fhir.dstu3.model.ConceptMap cm = (org.hl7.fhir.dstu3.model.ConceptMap) r; + boolean hasOid = isOid(cm.getIdentifier()); + if (!hasOid) { + String oid = getOid(oids, "ConceptMap", cm.getUrl()); + cm.setIdentifier(new org.hl7.fhir.dstu3.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (r instanceof org.hl7.fhir.dstu3.model.StructureDefinition) { + org.hl7.fhir.dstu3.model.StructureDefinition sd = (org.hl7.fhir.dstu3.model.StructureDefinition) r; + boolean hasOid = false; + for (org.hl7.fhir.dstu3.model.Identifier id : sd.getIdentifier()) { + if (isOid(id)) { + hasOid = true; + } + } + if (!hasOid) { + String oid = getOid(oids, "StructureDefinition", sd.getUrl()); + sd.getIdentifier().add(new org.hl7.fhir.dstu3.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (save) { + parser.setOutputStyle(org.hl7.fhir.dstu3.formats.IParser.OutputStyle.PRETTY).compose(new FileOutputStream(f), r); + } + } catch (Exception e) { + System.out.println("Erro processing "+f.getAbsolutePath()+": "+e.getMessage()); + } + } + + + private void processFileR4(IniFile oids, File f, FhirFormat fmt) { + org.hl7.fhir.r4.formats.IParser parser = fmt == FhirFormat.JSON ? new org.hl7.fhir.r4.formats.JsonParser() : new org.hl7.fhir.r4.formats.XmlParser(); + try { + boolean save = false; + org.hl7.fhir.r4.model.Resource r = parser.parse(new FileInputStream(f)); + if (r instanceof org.hl7.fhir.r4.model.CodeSystem) { + org.hl7.fhir.r4.model.CodeSystem cs = (org.hl7.fhir.r4.model.CodeSystem) r; + boolean hasOid = false; + for (org.hl7.fhir.r4.model.Identifier id : cs.getIdentifier()) { + if (isOid(id)) { + hasOid = true; + } + } + if (!hasOid) { + String oid = getOid(oids, "CodeSystem", cs.getUrl()); + cs.getIdentifier().add(new org.hl7.fhir.r4.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (r instanceof org.hl7.fhir.r4.model.ValueSet) { + org.hl7.fhir.r4.model.ValueSet vs = (org.hl7.fhir.r4.model.ValueSet) r; + boolean hasOid = false; + for (org.hl7.fhir.r4.model.Identifier id : vs.getIdentifier()) { + if (isOid(id)) { + hasOid = true; + } + } + if (!hasOid) { + String oid = getOid(oids, "ValueSet", vs.getUrl()); + vs.getIdentifier().add(new org.hl7.fhir.r4.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (r instanceof org.hl7.fhir.r4.model.ConceptMap) { + org.hl7.fhir.r4.model.ConceptMap cm = (org.hl7.fhir.r4.model.ConceptMap) r; + boolean hasOid = isOid(cm.getIdentifier()); + if (!hasOid) { + String oid = getOid(oids, "ConceptMap", cm.getUrl()); + cm.setIdentifier(new org.hl7.fhir.r4.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (r instanceof org.hl7.fhir.r4.model.StructureDefinition) { + org.hl7.fhir.r4.model.StructureDefinition sd = (org.hl7.fhir.r4.model.StructureDefinition) r; + boolean hasOid = false; + for (org.hl7.fhir.r4.model.Identifier id : sd.getIdentifier()) { + if (isOid(id)) { + hasOid = true; + } + } + if (!hasOid) { + String oid = getOid(oids, "StructureDefinition", sd.getUrl()); + sd.getIdentifier().add(new org.hl7.fhir.r4.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (save) { + parser.setOutputStyle(org.hl7.fhir.r4.formats.IParser.OutputStyle.PRETTY).compose(new FileOutputStream(f), r); + } + } catch (Exception e) { + System.out.println("Erro processing "+f.getAbsolutePath()+": "+e.getMessage()); + } + } + + private void processFileR4B(IniFile oids, File f, FhirFormat fmt) { + org.hl7.fhir.r4b.formats.IParser parser = fmt == FhirFormat.JSON ? new org.hl7.fhir.r4b.formats.JsonParser() : new org.hl7.fhir.r4b.formats.XmlParser(); + try { + boolean save = false; + org.hl7.fhir.r4b.model.Resource r = parser.parse(new FileInputStream(f)); + if (r instanceof org.hl7.fhir.r4b.model.CanonicalResource) { + org.hl7.fhir.r4b.model.CanonicalResource cs = (org.hl7.fhir.r4b.model.CanonicalResource) r; + boolean hasOid = false; + for (org.hl7.fhir.r4b.model.Identifier id : cs.getIdentifier()) { + if (isOid(id)) { + hasOid = true; + } + } + if (!hasOid) { + String oid = getOid(oids, r.fhirType(), cs.getUrl()); + cs.getIdentifier().add(new org.hl7.fhir.r4b.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (save) { + parser.setOutputStyle(org.hl7.fhir.r4b.formats.IParser.OutputStyle.PRETTY).compose(new FileOutputStream(f), r); + } + } catch (Exception e) { + System.out.println("Erro processing "+f.getAbsolutePath()+": "+e.getMessage()); + } + } + + + private void processFileR5(IniFile oids, File f, FhirFormat fmt) { + org.hl7.fhir.r5.formats.IParser parser = fmt == FhirFormat.JSON ? new org.hl7.fhir.r5.formats.JsonParser() : new org.hl7.fhir.r5.formats.XmlParser(); + try { + boolean save = false; + org.hl7.fhir.r5.model.Resource r = parser.parse(new FileInputStream(f)); + if (r instanceof org.hl7.fhir.r5.model.CanonicalResource) { + org.hl7.fhir.r5.model.CanonicalResource cs = (org.hl7.fhir.r5.model.CanonicalResource) r; + boolean hasOid = false; + for (org.hl7.fhir.r5.model.Identifier id : cs.getIdentifier()) { + if (isOid(id)) { + hasOid = true; + } + } + if (!hasOid) { + String oid = getOid(oids, r.fhirType(), cs.getUrl()); + cs.getIdentifier().add(new org.hl7.fhir.r5.model.Identifier().setSystem("urn:ietf:rfc:3986").setValue("urn:oid:"+oid)); + save = true; + } + } + if (save) { + parser.setOutputStyle(org.hl7.fhir.r5.formats.IParser.OutputStyle.PRETTY).compose(new FileOutputStream(f), r); + } + } catch (Exception e) { + System.out.println("Erro processing "+f.getAbsolutePath()+": "+e.getMessage()); + } + } + + private boolean isOid(org.hl7.fhir.dstu2.model.Identifier id) { + return "urn:ietf:rfc:3986".equals(id.getSystem()) && id.hasValue() && id.getValue().startsWith("urn:oid:"); + } + + private boolean isOid(org.hl7.fhir.dstu3.model.Identifier id) { + return "urn:ietf:rfc:3986".equals(id.getSystem()) && id.hasValue() && id.getValue().startsWith("urn:oid:"); + } + + private boolean isOid(org.hl7.fhir.r4.model.Identifier id) { + return "urn:ietf:rfc:3986".equals(id.getSystem()) && id.hasValue() && id.getValue().startsWith("urn:oid:"); + } + + private boolean isOid(org.hl7.fhir.r4b.model.Identifier id) { + return "urn:ietf:rfc:3986".equals(id.getSystem()) && id.hasValue() && id.getValue().startsWith("urn:oid:"); + } + + private boolean isOid(org.hl7.fhir.r5.model.Identifier id) { + return "urn:ietf:rfc:3986".equals(id.getSystem()) && id.hasValue() && id.getValue().startsWith("urn:oid:"); + } + + private String getOid(IniFile oids, String rt, String url) { + String root = oids.getStringProperty("Roots", rt); + if (root == null) { + throw new Error("no OID.ini entry for "+rt); + } + String oid = oids.getStringProperty(rt, url); + if (oid != null) { + return oid; + } + int key = oids.getIntegerProperty("Key", rt); + key++; + oid = root+"."+key; + oids.setIntegerProperty("Key", rt, key, null); + oids.setStringProperty(rt, url, oid, null); + oids.save(); + return oid; + } +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR2.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR2.java index 31cdb891f..21be0fed9 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR2.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR2.java @@ -117,6 +117,13 @@ public class TerminologyClientR2 implements ITerminologyClient { p2 = client.operateType(org.hl7.fhir.dstu2.model.ValueSet.class, "validate-code", p2); return (Parameters) VersionConvertorFactory_10_50.convertResource(p2); } + + @Override + public Parameters subsumes(Parameters pin) throws FHIRException { + org.hl7.fhir.dstu2.model.Parameters p2 = (org.hl7.fhir.dstu2.model.Parameters) VersionConvertorFactory_10_50.convertResource(pin); + p2 = client.operateType(org.hl7.fhir.dstu2.model.ValueSet.class, "subsumes", p2); + return (Parameters) VersionConvertorFactory_10_50.convertResource(p2); + } @Override public Parameters validateVS(Parameters pin) throws FHIRException { @@ -238,4 +245,5 @@ public class TerminologyClientR2 implements ITerminologyClient { org.hl7.fhir.dstu2.model.Bundle result = client.search(type, criteria); return result == null ? null : (Bundle) VersionConvertorFactory_10_50.convertResource(result); } + } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR3.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR3.java index 8aa22c3e5..839c4aed4 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR3.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR3.java @@ -242,4 +242,11 @@ public class TerminologyClientR3 implements ITerminologyClient { } + @Override + public Parameters subsumes(Parameters pin) throws FHIRException { + org.hl7.fhir.dstu3.model.Parameters p2 = (org.hl7.fhir.dstu3.model.Parameters) VersionConvertorFactory_30_50.convertResource(pin); + p2 = client.operateType(org.hl7.fhir.dstu3.model.CodeSystem.class, "subsumes", p2); + return (Parameters) VersionConvertorFactory_30_50.convertResource(p2); + } + } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java index e0af0a4ff..fd5f68f1b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java @@ -111,6 +111,25 @@ public class TerminologyClientR4 implements ITerminologyClient { } } + + @Override + public Parameters subsumes(Parameters pin) throws FHIRException { + try { + org.hl7.fhir.r4.model.Parameters p2 = (org.hl7.fhir.r4.model.Parameters) VersionConvertorFactory_40_50.convertResource(pin); + p2 = client.operateType(org.hl7.fhir.r4.model.CodeSystem.class, "subsumes", p2); + return (Parameters) VersionConvertorFactory_40_50.convertResource(p2); + } catch (EFhirClientException e) { + if (e.getServerErrors().size() == 1) { + OperationOutcome op = (OperationOutcome) VersionConvertorFactory_40_50.convertResource(e.getServerErrors().get(0)); + throw new org.hl7.fhir.r5.utils.client.EFhirClientException(e.getMessage(), op, e); + } else { + throw new org.hl7.fhir.r5.utils.client.EFhirClientException(e.getMessage(), e); + } + } catch (IOException e) { + throw new FHIRException(e); + } + } + @Override public Parameters validateVS(Parameters pin) throws FHIRException { try { @@ -249,6 +268,5 @@ public class TerminologyClientR4 implements ITerminologyClient { org.hl7.fhir.r4.model.Bundle result = client.search(type, criteria); return result == null ? null : (Bundle) VersionConvertorFactory_40_50.convertResource(result); } - } \ No newline at end of file diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/Convertor_Factory_40_50Test.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/Convertor_Factory_40_50Test.java index 6695968e6..86ff6a5ad 100644 --- a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/Convertor_Factory_40_50Test.java +++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/Convertor_Factory_40_50Test.java @@ -66,14 +66,14 @@ class Convertor_Factory_40_50Test { StructureMapUtilities smu5 = new StructureMapUtilities(context, mock(org.hl7.fhir.r5.utils.structuremap.ITransformerServices.class)); org.hl7.fhir.r5.model.StructureMap mapR5 = smu5.parse(CONTENT, "map"); - assertEquals("tgt", mapR5.getGroup().get(0).getRule().get(0).getTarget().get(0).getParameter().get(0).getValueIdType().getValue()); + assertEquals("tgt", mapR5.getGroup().get(0).getRule().get(0).getTarget().get(0).getContext()); assertEquals("item.answer.valueString", mapR5.getGroup().get(1).getRule().get(0).getTarget().get(0).getParameter().get(0).getValueStringType().getValue()); assertEquals("item", mapR5.getGroup().get(0).getRule().get(0).getDependent().get(0).getParameter().get(0).getValueIdType().getValueAsString()); assertEquals("patient", mapR5.getGroup().get(0).getRule().get(0).getDependent().get(0).getParameter().get(1).getValueIdType().getValueAsString()); org.hl7.fhir.r4.model.StructureMap mapR4 = (org.hl7.fhir.r4.model.StructureMap) VersionConvertorFactory_40_50.convertResource(mapR5); - assertEquals("tgt", mapR4.getGroup().get(0).getRule().get(0).getTarget().get(0).getParameter().get(0).getValueIdType().getValue()); + assertEquals("tgt", mapR4.getGroup().get(0).getRule().get(0).getTarget().get(0).getContext()); assertEquals("item.answer.valueString", mapR4.getGroup().get(1).getRule().get(0).getTarget().get(0).getParameter().get(0).getValueStringType().getValue()); assertEquals("item", mapR4.getGroup().get(0).getRule().get(0).getDependent().get(0).getVariable().get(0).getValueAsString()); assertEquals("patient", mapR4.getGroup().get(0).getRule().get(0).getDependent().get(0).getVariable().get(1).getValueAsString()); @@ -87,7 +87,7 @@ class Convertor_Factory_40_50Test { StructureMap mapR5Back = (StructureMap) VersionConvertorFactory_40_50.convertResource(mapR4); - assertEquals("tgt", mapR5Back.getGroup().get(0).getRule().get(0).getTarget().get(0).getParameter().get(0).getValueIdType().getValue()); + assertEquals("tgt", mapR5Back.getGroup().get(0).getRule().get(0).getTarget().get(0).getContext()); assertEquals("item.answer.valueString", mapR5Back.getGroup().get(1).getRule().get(0).getTarget().get(0).getParameter().get(0).getValueStringType().getValue()); assertEquals("item", mapR5Back.getGroup().get(0).getRule().get(0).getDependent().get(0).getParameter().get(0).getValueIdType().getValueAsString()); assertEquals("patient", mapR5Back.getGroup().get(0).getRule().get(0).getDependent().get(0).getParameter().get(1).getValueIdType().getValueAsString()); diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index a1f0bd629..034456d17 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.2.14-SNAPSHOT + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/ProfileUtilities.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/ProfileUtilities.java index ee861cc83..5701beccc 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/ProfileUtilities.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/ProfileUtilities.java @@ -70,6 +70,7 @@ import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -1281,7 +1282,7 @@ public class ProfileUtilities { public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics); TableModel model = gen.initNormalTable(corePath, false, true, ed.getId(), false, TableGenerationMode.XML); boolean deep = false; @@ -1566,7 +1567,7 @@ public class ProfileUtilities { boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, Set outputTracker) throws IOException, FHIRException { assert (diff != snapshot);// check it's ok to get rid of one of these - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics); TableModel model = gen.initNormalTable(corePath, false, true, profile.getId() + (diff ? "d" : "s"), false, TableGenerationMode.XML); List list = diff ? profile.getDifferential().getElement() : profile.getSnapshot().getElement(); diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/client/ResourceAddress.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/client/ResourceAddress.java index 00eedbdc8..7ff64f2bc 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/client/ResourceAddress.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/client/ResourceAddress.java @@ -87,7 +87,7 @@ public class ResourceAddress { } public URI resolveOperationUri(Class resourceClass, String opName) { - return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) + "/" + opName); + return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) + "$" + opName); } public URI resolveOperationUri(Class resourceClass, String opName, diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index cd9004bc7..5c32d9102 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.2.14-SNAPSHOT + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/ProfileUtilities.java b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/ProfileUtilities.java index 6c5375015..35530de7b 100644 --- a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/ProfileUtilities.java +++ b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/ProfileUtilities.java @@ -71,6 +71,7 @@ import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -1283,7 +1284,7 @@ public class ProfileUtilities { public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics); TableModel model = gen.initNormalTable(corePath, false, true, ed.getId(), false, TableGenerationMode.XML); boolean deep = false; @@ -1565,7 +1566,7 @@ public class ProfileUtilities { boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, boolean logicalModel, Set outputTracker) throws IOException, FHIRException { assert (diff != snapshot);// check it's ok to get rid of one of these - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics); TableModel model = gen.initNormalTable(corePath, false, true, profile.getId() + (diff ? "d" : "s"), false, TableGenerationMode.XML); List list = diff ? profile.getDifferential().getElement() : profile.getSnapshot().getElement(); diff --git a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/ResourceAddress.java b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/ResourceAddress.java index e81e3d71a..835d38284 100644 --- a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/ResourceAddress.java +++ b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/ResourceAddress.java @@ -87,7 +87,7 @@ public class ResourceAddress { } public URI resolveOperationUri(Class resourceClass, String opName) { - return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) + "/" + opName); + return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) + "$" + opName); } public URI resolveOperationUri(Class resourceClass, String opName, diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index b750ea8c9..8524a60c6 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.2.14-SNAPSHOT + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/conformance/ProfileUtilities.java b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/conformance/ProfileUtilities.java index 665f07f06..945274c62 100644 --- a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/conformance/ProfileUtilities.java +++ b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/conformance/ProfileUtilities.java @@ -96,6 +96,7 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.Source; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator; @@ -1620,8 +1621,7 @@ public class ProfileUtilities extends TranslatingUtilities { } public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, String imagePath, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics); TableModel model = gen.initNormalTable(corePath, false, true, ed.getId(), false, TableGenerationMode.XML); boolean deep = false; @@ -1989,8 +1989,7 @@ public class ProfileUtilities extends TranslatingUtilities { public XhtmlNode generateTable(String defFile, StructureDefinition profile, boolean diff, String imageFolder, boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, String imagePath, boolean logicalModel, boolean allInvariants, Set outputTracker) throws IOException, FHIRException { assert(diff != snapshot);// check it's ok to get rid of one of these - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics); TableModel model = gen.initNormalTable(corePath, false, true, profile.getId()+(diff ? "d" : "s"), false, TableGenerationMode.XML); List list = diff ? profile.getDifferential().getElement() : profile.getSnapshot().getElement(); List profiles = new ArrayList(); @@ -2005,8 +2004,7 @@ public class ProfileUtilities extends TranslatingUtilities { public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics); TableModel model = gen.initGridTable(corePath, profile.getId()); List list = profile.getSnapshot().getElement(); List profiles = new ArrayList(); @@ -3482,8 +3480,7 @@ public class ProfileUtilities extends TranslatingUtilities { } public XhtmlNode generateSpanningTable(StructureDefinition profile, String imageFolder, boolean onlyConstraints, String constraintPrefix, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, false); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, false); TableModel model = initSpanningTable(gen, "", false, profile.getId()); Set processed = new HashSet(); SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix); diff --git a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/ResourceUtilities.java b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/ResourceUtilities.java index 0694f0a56..7343423c1 100644 --- a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/ResourceUtilities.java +++ b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/ResourceUtilities.java @@ -85,13 +85,13 @@ public class ResourceUtilities { StringBuilder b = new StringBuilder(); for (OperationOutcomeIssueComponent t : error.getIssue()) if (t.getSeverity() == IssueSeverity.ERROR) - b.append("Error:" +gen(t.getDetails())+"\r\n"); + b.append("Error: " +gen(t.getDetails())+"\r\n"); else if (t.getSeverity() == IssueSeverity.FATAL) - b.append("Fatal:" +gen(t.getDetails())+"\r\n"); + b.append("Fatal: " +gen(t.getDetails())+"\r\n"); else if (t.getSeverity() == IssueSeverity.WARNING) - b.append("Warning:" +gen(t.getDetails())+"\r\n"); + b.append("Warning: " +gen(t.getDetails())+"\r\n"); else if (t.getSeverity() == IssueSeverity.INFORMATION) - b.append("Information:" +gen(t.getDetails())+"\r\n"); + b.append("Information: " +gen(t.getDetails())+"\r\n"); return b.toString(); } diff --git a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/client/ResourceAddress.java b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/client/ResourceAddress.java index eed499be8..b32b33e9a 100644 --- a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/client/ResourceAddress.java +++ b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/client/ResourceAddress.java @@ -93,7 +93,7 @@ public class ResourceAddress { } public URI resolveOperationUri(Class resourceClass, String opName) { - return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) +"/"+opName); + return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) +"$"+opName); } public URI resolveOperationUri(Class resourceClass, String opName, Map parameters) { diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 3cd4f7870..6519142e0 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.2.14-SNAPSHOT + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/conformance/ProfileUtilities.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/conformance/ProfileUtilities.java index 981b00a61..42718a344 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/conformance/ProfileUtilities.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/conformance/ProfileUtilities.java @@ -103,6 +103,7 @@ import org.hl7.fhir.utilities.FhirPublication; import org.hl7.fhir.utilities.TerminologyServiceOptions; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.VersionUtilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.Source; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator; @@ -2386,8 +2387,7 @@ public class ProfileUtilities extends TranslatingUtilities { public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, String imagePath, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true); TableModel model = gen.initNormalTable(corePath, false, true, ed.getId(), false, TableGenerationMode.XML); boolean deep = false; @@ -2792,8 +2792,7 @@ public class ProfileUtilities extends TranslatingUtilities { boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, String imagePath, boolean logicalModel, boolean allInvariants, Set outputTracker) throws IOException, FHIRException { assert (diff != snapshot);// check it's ok to get rid of one of these - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true); TableModel model = gen.initNormalTable(corePath, false, true, profile.getId() + (diff ? "d" : "s"), false, TableGenerationMode.XML); List list = diff ? profile.getDifferential().getElement() : profile.getSnapshot().getElement(); @@ -2817,8 +2816,7 @@ public class ProfileUtilities extends TranslatingUtilities { public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true); TableModel model = gen.initGridTable(corePath, profile.getId()); List list = profile.getSnapshot().getElement(); List profiles = new ArrayList(); @@ -4969,8 +4967,7 @@ public class ProfileUtilities extends TranslatingUtilities { public XhtmlNode generateSpanningTable(StructureDefinition profile, String imageFolder, boolean onlyConstraints, String constraintPrefix, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, false, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, false, true); TableModel model = initSpanningTable(gen, "", false, profile.getId()); Set processed = new HashSet(); SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix); diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/ResourceUtilities.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/ResourceUtilities.java index 6a49ad860..38ab37fc8 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/ResourceUtilities.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/ResourceUtilities.java @@ -81,13 +81,13 @@ public class ResourceUtilities { if (first) first = false; else b.append("\r\n"); String txt = t.hasDiagnostics() ? t.getDiagnostics() : gen(t.getDetails()); if (t.getSeverity() == IssueSeverity.ERROR) - b.append("Error:" + txt); + b.append("Error: " + txt); else if (t.getSeverity() == IssueSeverity.FATAL) - b.append("Fatal:" + txt); + b.append("Fatal: " + txt); else if (t.getSeverity() == IssueSeverity.WARNING) - b.append("Warning:" + txt); + b.append("Warning: " + txt); else if (t.getSeverity() == IssueSeverity.INFORMATION) - b.append("Information:" + txt); + b.append("Information: " + txt); } return b.toString(); } diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/ResourceAddress.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/ResourceAddress.java index 16df4f0cb..fe2f30cbe 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/ResourceAddress.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/ResourceAddress.java @@ -88,7 +88,7 @@ public class ResourceAddress { } public URI resolveOperationUri(Class resourceClass, String opName) { - return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) + "/" + opName); + return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) + "$" + opName); } public URI resolveGetResource(Class resourceClass, String id) { diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 93272d655..58e564f1d 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.2.14-SNAPSHOT + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CanonicalResourceComparer.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CanonicalResourceComparer.java index 510778e04..b6f07255a 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CanonicalResourceComparer.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CanonicalResourceComparer.java @@ -19,6 +19,7 @@ import org.hl7.fhir.r4b.model.Coding; import org.hl7.fhir.r4b.model.PrimitiveType; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -291,7 +292,7 @@ public abstract class CanonicalResourceComparer extends ResourceComparer { public XhtmlNode renderMetadata(CanonicalResourceComparison comparison, String id, String prefix) throws FHIRException, IOException { // columns: code, display (left|right), properties (left|right) - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); model.getTitles().add(gen.new Title(null, null, "Name", "Property Name", null, 100)); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CapabilityStatementComparer.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CapabilityStatementComparer.java index 7fcbbe547..5551e3a03 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CapabilityStatementComparer.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CapabilityStatementComparer.java @@ -34,6 +34,7 @@ import org.hl7.fhir.r4b.model.PrimitiveType; import org.hl7.fhir.r4b.model.Resource; import org.hl7.fhir.r4b.model.StructureDefinition; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -867,7 +868,7 @@ public class CapabilityStatementComparer extends CanonicalResourceComparer { // comments public XhtmlNode renderStatements(CapabilityStatementComparison comparison, String id, String prefix) throws FHIRException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); model.getTitles().add(gen.new Title(null, null, "Type", "The type of item", null, 100)); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CodeSystemComparer.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CodeSystemComparer.java index 4b50180fa..b56c1ca64 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CodeSystemComparer.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/CodeSystemComparer.java @@ -16,6 +16,7 @@ import org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent; import org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent; import org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -348,7 +349,7 @@ public class CodeSystemComparer extends CanonicalResourceComparer { public XhtmlNode renderConcepts(CodeSystemComparison comparison, String id, String prefix) throws FHIRException, IOException { // columns: code, display (left|right), properties (left|right) - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); model.getTitles().add(gen.new Title(null, null, "Code", "The code for the concept", null, 100)); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/ProfileComparer.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/ProfileComparer.java index b9c4184f8..7cebd264c 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/ProfileComparer.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/ProfileComparer.java @@ -33,6 +33,7 @@ import org.hl7.fhir.r4b.model.ValueSet; import org.hl7.fhir.r4b.utils.DefinitionNavigator; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator; @@ -1027,8 +1028,7 @@ public class ProfileComparer extends CanonicalResourceComparer { public XhtmlNode renderStructure(ProfileComparison comp, String id, String prefix, String corePath) throws FHIRException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false, true); - gen.setTranslator(session.getContextRight().translator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false, true); TableModel model = gen.initComparisonTable(corePath, id); genElementComp(null /* oome back to this later */, gen, model.getRows(), comp.combined, corePath, prefix, null, true); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/ValueSetComparer.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/ValueSetComparer.java index 1b7e0cb1e..0afdfec7e 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/ValueSetComparer.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/comparison/ValueSetComparer.java @@ -19,6 +19,7 @@ import org.hl7.fhir.r4b.model.ValueSet.ValueSetComposeComponent; import org.hl7.fhir.r4b.model.ValueSet.ValueSetExpansionContainsComponent; import org.hl7.fhir.r4b.terminologies.ValueSetExpander.ValueSetExpansionOutcome; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -577,7 +578,7 @@ public class ValueSetComparer extends CanonicalResourceComparer { } public XhtmlNode renderCompose(ValueSetComparison csc, String id, String prefix) throws FHIRException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "comparison"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); model.getTitles().add(gen.new Title(null, null, "Item", "The type of item being compared", null, 100)); @@ -778,7 +779,7 @@ public class ValueSetComparer extends CanonicalResourceComparer { boolean hasAbstract = findAbstract(csc.getExpansion()); boolean hasInactive = findInactive(csc.getExpansion()); - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "comparison"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); if (hasSystem) { diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/conformance/ProfileUtilities.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/conformance/ProfileUtilities.java index 892fadaad..007469b98 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/conformance/ProfileUtilities.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/conformance/ProfileUtilities.java @@ -121,6 +121,7 @@ import org.hl7.fhir.utilities.MarkDownProcessor; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.i18n.I18nConstants; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -3874,8 +3875,7 @@ public class ProfileUtilities extends TranslatingUtilities { public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, String imagePath, Set outputTracker, RenderingContext rc) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true); TableModel model = gen.initNormalTable(corePath, false, true, ed.getId() + (full ? "f" : "n"), true, TableGenerationMode.XHTML); @@ -4443,8 +4443,7 @@ public class ProfileUtilities extends TranslatingUtilities { boolean logicalModel, boolean allInvariants, Set outputTracker, boolean active, boolean mustSupport, RenderingContext rc) throws IOException, FHIRException { assert (diff != snapshot);// check it's ok to get rid of one of these - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true); TableModel model = gen.initNormalTable(corePath, false, true, profile.getId() + (diff ? "d" : "s"), active, active ? TableGenerationMode.XHTML : TableGenerationMode.XML); List list = new ArrayList<>(); @@ -4545,8 +4544,7 @@ public class ProfileUtilities extends TranslatingUtilities { public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, inlineGraphics, true); TableModel model = gen.initGridTable(corePath, profile.getId()); List list = profile.getSnapshot().getElement(); List profiles = new ArrayList(); @@ -7116,8 +7114,7 @@ public class ProfileUtilities extends TranslatingUtilities { public XhtmlNode generateSpanningTable(StructureDefinition profile, String imageFolder, boolean onlyConstraints, String constraintPrefix, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, false, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), imageFolder, false, true); TableModel model = initSpanningTable(gen, "", false, profile.getId()); Set processed = new HashSet(); SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/QuestionnaireRenderer.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/QuestionnaireRenderer.java index 641008b8e..b5a0488cd 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/QuestionnaireRenderer.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/QuestionnaireRenderer.java @@ -29,6 +29,7 @@ import org.hl7.fhir.r4b.renderers.utils.RenderingContext; import org.hl7.fhir.r4b.terminologies.ValueSetExpander.ValueSetExpansionOutcome; import org.hl7.fhir.r4b.utils.ToolingExtensions; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator; import org.hl7.fhir.utilities.xhtml.NodeType; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell; @@ -74,7 +75,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (doOpts) { x.b().tx("Structure"); } - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("qtree=" + q.getId(), !forResource); model.setAlternating(true); @@ -511,7 +512,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } private boolean renderLogic(XhtmlNode x, Questionnaire q) throws FHIRException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("qtree=" + q.getId(), true); model.setAlternating(true); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/QuestionnaireResponseRenderer.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/QuestionnaireResponseRenderer.java index 2085c644f..c20e65358 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/QuestionnaireResponseRenderer.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/renderers/QuestionnaireResponseRenderer.java @@ -30,6 +30,7 @@ import org.hl7.fhir.r4b.renderers.utils.RenderingContext; import org.hl7.fhir.r4b.terminologies.ValueSetExpander.ValueSetExpansionOutcome; import org.hl7.fhir.r4b.utils.ToolingExtensions; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator; import org.hl7.fhir.utilities.xhtml.NodeType; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell; @@ -79,7 +80,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { } public boolean renderTree(XhtmlNode x, ResourceWrapper qr) throws UnsupportedEncodingException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("qtree=" + qr.getId(), false); model.setAlternating(true); @@ -107,7 +108,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { } public boolean renderTree(XhtmlNode x, QuestionnaireResponse q) throws UnsupportedEncodingException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("qtree=" + q.getId(), true); model.setAlternating(true); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/ResourceUtilities.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/ResourceUtilities.java index eb2569b98..373f7af1e 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/ResourceUtilities.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/ResourceUtilities.java @@ -79,13 +79,13 @@ public class ResourceUtilities { StringBuilder b = new StringBuilder(); for (OperationOutcomeIssueComponent t : error.getIssue()) { if (t.getSeverity() == IssueSeverity.ERROR) { - b.append("Error:" + gen(t.getDetails()) + "\r\n"); + b.append("Error: " + gen(t.getDetails()) + "\r\n"); } else if (t.getSeverity() == IssueSeverity.FATAL) { - b.append("Fatal:" + gen(t.getDetails()) + "\r\n"); + b.append("Fatal: " + gen(t.getDetails()) + "\r\n"); } else if (t.getSeverity() == IssueSeverity.WARNING) { - b.append("Warning:" + gen(t.getDetails()) + "\r\n"); + b.append("Warning: " + gen(t.getDetails()) + "\r\n"); } else if (t.getSeverity() == IssueSeverity.INFORMATION) { - b.append("Information:" + gen(t.getDetails()) + "\r\n"); + b.append("Information: " + gen(t.getDetails()) + "\r\n"); } } return b.toString(); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/client/ResourceAddress.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/client/ResourceAddress.java index 8a1260cd5..7a8b5b53b 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/client/ResourceAddress.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/client/ResourceAddress.java @@ -87,7 +87,7 @@ public class ResourceAddress { } public URI resolveOperationUri(Class resourceClass, String opName) { - return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) + "/" + opName); + return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) + "$" + opName); } public URI resolveOperationUri(Class resourceClass, String opName, diff --git a/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/StructureMapUtilitiesTest.java b/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/StructureMapUtilitiesTest.java index fae52a446..661044d21 100644 --- a/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/StructureMapUtilitiesTest.java +++ b/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/StructureMapUtilitiesTest.java @@ -63,7 +63,7 @@ public class StructureMapUtilitiesTest implements ITransformerServices { @Test public void testSyntax() throws IOException, FHIRException { StructureMapUtilities scu = new StructureMapUtilities(context, this); - String fileMap = TestingUtilities.loadTestResource("r5", "structure-mapping", "syntax.map"); + String fileMap = TestingUtilities.loadTestResource("r4b", "structure-mapping", "syntax.map"); System.out.println(fileMap); StructureMap structureMap = scu.parse(fileMap, "Syntax"); diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 0c80a7a86..3a06b8718 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.2.14-SNAPSHOT + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CanonicalResourceComparer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CanonicalResourceComparer.java index 2d7e14654..b3ab7b120 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CanonicalResourceComparer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CanonicalResourceComparer.java @@ -19,6 +19,7 @@ import org.hl7.fhir.r5.model.DataType; import org.hl7.fhir.r5.model.PrimitiveType; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -591,7 +592,7 @@ public abstract class CanonicalResourceComparer extends ResourceComparer { public XhtmlNode renderMetadata(CanonicalResourceComparison comparison, String id, String prefix) throws FHIRException, IOException { // columns: code, display (left|right), properties (left|right) - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); model.getTitles().add(gen.new Title(null, null, "Name", "Property Name", null, 100)); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CapabilityStatementComparer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CapabilityStatementComparer.java index 8a3594345..76184d9d0 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CapabilityStatementComparer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CapabilityStatementComparer.java @@ -30,6 +30,7 @@ import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.utils.ToolingExtensions; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -742,7 +743,7 @@ public class CapabilityStatementComparer extends CanonicalResourceComparer { // 6 columns: path | left value | left doco | right value | right doco | comments public XhtmlNode renderStatements(CapabilityStatementComparison comparison, String id, String prefix) throws FHIRException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); model.getTitles().add(gen.new Title(null, null, "Type", "The type of item", null, 100)); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CodeSystemComparer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CodeSystemComparer.java index e345aad0e..4a4a9cd22 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CodeSystemComparer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CodeSystemComparer.java @@ -17,6 +17,7 @@ import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent; import org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent; import org.hl7.fhir.r5.model.CodeSystem.PropertyComponent; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -519,7 +520,7 @@ public class CodeSystemComparer extends CanonicalResourceComparer { public XhtmlNode renderConcepts(CodeSystemComparison comparison, String id, String prefix) throws FHIRException, IOException { // columns: code, display (left|right), properties (left|right) - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); model.getTitles().add(gen.new Title(null, null, "Code", "The code for the concept", null, 100)); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java index c67870811..93cdd9da7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java @@ -42,6 +42,7 @@ import org.hl7.fhir.r5.renderers.utils.RenderingContext.ResourceRendererMode; import org.hl7.fhir.r5.utils.DefinitionNavigator; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator; @@ -1251,8 +1252,7 @@ public class StructureDefinitionComparer extends CanonicalResourceComparer imple } public XhtmlNode renderStructure(ProfileComparison comp, String id, String prefix, String corePath) throws FHIRException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false, true); - gen.setTranslator(session.getContextRight().translator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "compare"), false, true); TableModel model = gen.initComparisonTable(corePath, id); genElementComp(null /* come back to this later */, gen, model.getRows(), comp.combined, corePath, prefix, null, true); return gen.generate(model, prefix, 0, null); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ValueSetComparer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ValueSetComparer.java index 5cba9a5c8..a5f8126a0 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ValueSetComparer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ValueSetComparer.java @@ -18,6 +18,7 @@ import org.hl7.fhir.r5.model.ValueSet.ValueSetComposeComponent; import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent; import org.hl7.fhir.r5.terminologies.expansion.ValueSetExpansionOutcome; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; @@ -588,7 +589,7 @@ public class ValueSetComparer extends CanonicalResourceComparer { } public XhtmlNode renderCompose(ValueSetComparison csc, String id, String prefix) throws FHIRException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "comparison"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); model.getTitles().add(gen.new Title(null, null, "Item", "The type of item being compared", null, 100)); @@ -779,7 +780,7 @@ public class ValueSetComparer extends CanonicalResourceComparer { boolean hasAbstract = findAbstract(csc.getExpansion()); boolean hasInactive = findInactive(csc.getExpansion()); - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "comparison"), false); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(new RenderingI18nContext(), Utilities.path("[tmp]", "comparison"), false); TableModel model = gen.new TableModel(id, true); model.setAlternating(true); if (hasSystem) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/R5ExtensionsLoader.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/R5ExtensionsLoader.java index a207c3b68..7cf33370e 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/R5ExtensionsLoader.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/R5ExtensionsLoader.java @@ -190,7 +190,10 @@ public class R5ExtensionsLoader { context.cacheResourceFromPackage(vs, vs.getSourcePackage()); for (ConceptSetComponent inc : vs.getCompose().getInclude()) { for (CanonicalType t : inc.getValueSet()) { - loadValueSet(t.asStringValue(), context, valueSets, codeSystems); + ValueSet vsi = context.fetchResource(ValueSet.class, t.getValue()); + if (vsi == null) { + loadValueSet(t.asStringValue(), context, valueSets, codeSystems); + } } if (inc.hasSystem()) { if (!inc.hasVersion()) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java index 245d74bd8..93f8cf074 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfilePathProcessor.java @@ -16,6 +16,7 @@ import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingComponent import org.hl7.fhir.r5.model.ElementDefinition.SlicingRules; import org.hl7.fhir.r5.model.OperationOutcome.IssueType; import org.hl7.fhir.r5.model.StructureDefinition; +import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent; import org.hl7.fhir.r5.utils.ToolingExtensions; import org.hl7.fhir.utilities.Utilities; @@ -170,6 +171,7 @@ public class ProfilePathProcessor { ElementDefinition currentBase = cursors.base.getElement().get(cursors.baseCursor); String currentBasePath = profileUtilities.fixedPathSource(getContextPathSource(), currentBase.getPath(), getRedirector()); debugProcessPathsIteration(cursors, currentBasePath); + checkDiffAssignedAndCursor(cursors); List diffMatches = profileUtilities.getDiffMatches(getDifferential(), currentBasePath, cursors.diffCursor, getDiffLimit(), getProfileName()); // get a list of matching elements in scope // in the simple case, source is not sliced. @@ -194,6 +196,25 @@ public class ProfilePathProcessor { return res; } + private void checkDiffAssignedAndCursor(ProfilePathProcessorState cursors) { +// int i = 0; +// List list = getDifferential().getElement(); +// for (ElementDefinition ed : list) { +// boolean assigned = ed.hasUserData("derived.pointer"); +// if (i < cursors.diffCursor) { +// if (!assigned) { +// throw new Error("what?"); +// } +// } else if (i > cursors.diffCursor) { +// if (assigned) { +// throw new Error("what!?"); +// } +// } +// i++; +// } + + } + private void debugProcessPathsIteration(ProfilePathProcessorState cursors, String currentBasePath) { if (profileUtilities.isDebug()) { System.out.println(getDebugIndent() + " - " + currentBasePath + ": "+ @@ -621,7 +642,12 @@ public class ProfilePathProcessor { if (firstTypeStructureDefinition.getSnapshot().getElement().isEmpty()) { throw new FHIRException(profileUtilities.getContext().formatMessage(I18nConstants.SNAPSHOT_IS_EMPTY, firstTypeStructureDefinition.getVersionedUrl(), "Source for first element")); } else { - src = firstTypeStructureDefinition.getSnapshot().getElement().get(0); + src = firstTypeStructureDefinition.getSnapshot().getElement().get(0).copy(); + if (!src.getPath().contains(".") && firstTypeStructureDefinition.getKind() == StructureDefinitionKind.RESOURCE) { + // we can't migrate the constraints in this case, because the sense of %resource changes when the root resource + // is treated as an element. The validator will enforce the constraint + src.getConstraint().clear(); // + } } } template = src.copy().setPath(currentBase.getPath()); @@ -1063,7 +1089,7 @@ public class ProfilePathProcessor { } // throw new Error("Not done yet"); // } else if (currentBase.getType().get(0).getCode().equals("BackboneElement") && diffMatches.size() > 0 && diffMatches.get(0).hasSliceName()) { - } else if (currentBase.getType().get(0).getCode().equals("BackboneElement")) { + } else if (!currentBase.getType().isEmpty() && currentBase.getType().get(0).getCode().equals("BackboneElement")) { // We need to copy children of the backbone element before we start messing around with slices int newBaseLimit = profileUtilities.findEndOfElement(cursors.base, cursors.baseCursor); for (int i = cursors.baseCursor + 1; i <= newBaseLimit; i++) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java index 24005ce10..407dcfcb1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/profile/ProfileUtilities.java @@ -99,7 +99,6 @@ import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent; import org.hl7.fhir.r5.terminologies.expansion.ValueSetExpansionOutcome; import org.hl7.fhir.r5.terminologies.utilities.ValidationResult; import org.hl7.fhir.r5.utils.ToolingExtensions; -import org.hl7.fhir.r5.utils.TranslatingUtilities; import org.hl7.fhir.r5.utils.XVerExtensionManager; import org.hl7.fhir.r5.utils.XVerExtensionManager.XVerExtensionStatus; import org.hl7.fhir.r5.utils.formats.CSVWriter; @@ -136,7 +135,7 @@ import org.hl7.fhir.utilities.xml.SchematronWriter.Section; * @author Grahame * */ -public class ProfileUtilities extends TranslatingUtilities { +public class ProfileUtilities { private static boolean suppressIgnorableExceptions; @@ -433,7 +432,7 @@ public class ProfileUtilities extends TranslatingUtilities { private boolean wantFixDifferentialFirstElementType; private Set masterSourceFileNames; private Set localFileNames; - private Map childMapCache = new HashMap<>(); + private Map childMapCache = new HashMap<>(); private AllowUnknownProfile allowUnknownProfile = AllowUnknownProfile.ALL_TYPES; private MappingMergeModeOption mappingMergeMode = MappingMergeModeOption.APPEND; private boolean forPublication; @@ -479,8 +478,9 @@ public class ProfileUtilities extends TranslatingUtilities { } public SourcedChildDefinitions getChildMap(StructureDefinition profile, ElementDefinition element) throws DefinitionException { - if (childMapCache.containsKey(element)) { - return childMapCache.get(element); + String cacheKey = "cm."+profile.getVersionedUrl()+"#"+(element.hasId() ? element.getId() : element.getPath()); + if (childMapCache.containsKey(cacheKey)) { + return childMapCache.get(cacheKey); } StructureDefinition src = profile; if (element.getContentReference() != null) { @@ -524,7 +524,7 @@ public class ProfileUtilities extends TranslatingUtilities { break; } SourcedChildDefinitions result = new SourcedChildDefinitions(src, res); - childMapCache.put(element, result); + childMapCache.put(cacheKey, result); return result; } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java index d42510ef1..f81f2ddf7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java @@ -78,6 +78,7 @@ import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent import org.hl7.fhir.r5.model.Enumerations.PublicationStatus; import org.hl7.fhir.r5.model.IdType; import org.hl7.fhir.r5.model.Identifier; +import org.hl7.fhir.r5.model.IntegerType; import org.hl7.fhir.r5.model.ImplementationGuide; import org.hl7.fhir.r5.model.Library; import org.hl7.fhir.r5.model.Measure; @@ -101,9 +102,7 @@ import org.hl7.fhir.r5.model.StringType; import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule; import org.hl7.fhir.r5.model.StructureMap; -import org.hl7.fhir.r5.model.TerminologyCapabilities; -import org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent; -import org.hl7.fhir.r5.model.TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent; + import org.hl7.fhir.r5.model.UriType; import org.hl7.fhir.r5.model.UrlType; import org.hl7.fhir.r5.model.ValueSet; @@ -129,8 +128,8 @@ import org.hl7.fhir.r5.terminologies.utilities.TerminologyCache.SourcedValueSet; import org.hl7.fhir.r5.terminologies.validation.VSCheckerException; import org.hl7.fhir.r5.terminologies.validation.ValueSetValidator; import org.hl7.fhir.r5.terminologies.ValueSetUtilities; -import org.hl7.fhir.r5.terminologies.client.TerminologyClientR5.TerminologyClientR5Factory; import org.hl7.fhir.r5.terminologies.client.TerminologyClientManager; +import org.hl7.fhir.r5.terminologies.client.TerminologyClientR5; import org.hl7.fhir.r5.terminologies.client.TerminologyClientContext; import org.hl7.fhir.r5.utils.PackageHackerR5; import org.hl7.fhir.r5.utils.ResourceUtilities; @@ -138,10 +137,8 @@ import org.hl7.fhir.r5.utils.ToolingExtensions; import org.hl7.fhir.r5.utils.client.EFhirClientException; import org.hl7.fhir.r5.utils.validation.ValidationContextCarrier; import org.hl7.fhir.utilities.FhirPublication; -import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.TimeTracker; import org.hl7.fhir.utilities.ToolingClientLogger; -import org.hl7.fhir.utilities.TranslationServices; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.i18n.I18nBase; @@ -234,7 +231,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte private Object lock = new Object(); // used as a lock for the data that follows protected String version; // although the internal resources are all R5, the version of FHIR they describe may not be - protected final TerminologyClientManager terminologyClientManager = new TerminologyClientManager(null, UUID.randomUUID().toString()); + protected final TerminologyClientManager terminologyClientManager = new TerminologyClientManager(new TerminologyClientR5.TerminologyClientR5Factory(), UUID.randomUUID().toString()); private boolean minimalMemory = false; private Map> allResourcesById = new HashMap>(); @@ -277,7 +274,6 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte private int expandCodesLimit = 1000; protected ILoggingService logger = new SystemOutLoggingService(); protected Parameters expParameters; - private TranslationServices translator = new NullTranslator(); private Map packages = new HashMap<>(); @Getter @@ -312,7 +308,6 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte protected void copy(BaseWorkerContext other) { synchronized (other.lock) { // tricky, because you need to lock this as well, but it's really not in use yet allResourcesById.putAll(other.allResourcesById); - translator = other.translator; codeSystems.copy(other.codeSystems); valueSets.copy(other.valueSets); maps.copy(other.maps); @@ -851,7 +846,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte return res; } Set systems = findRelevantSystems(vs); - TerminologyClientContext tc = terminologyClientManager.chooseServer(systems, true); + TerminologyClientContext tc = terminologyClientManager.chooseServer(vs, systems, true); if (tc == null) { return new ValueSetExpansionOutcome("No server available", TerminologyServiceErrorClass.INTERNAL_ERROR, true); } @@ -915,7 +910,8 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte } Parameters p = pIn.copy(); - + p.setParameter("_limit",new IntegerType("10000")); + p.setParameter("_incomplete", new BooleanType("true")); if (vs.hasExpansion()) { return new ValueSetExpansionOutcome(vs.copy()); } @@ -978,7 +974,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte p.addParameter().setName("cache-id").setValue(new IdType(terminologyClientManager.getCacheId())); Set systems = findRelevantSystems(vs); - TerminologyClientContext tc = terminologyClientManager.chooseServer(systems, true); + TerminologyClientContext tc = terminologyClientManager.chooseServer(vs, systems, true); addDependentResources(tc, p, vs); @@ -1108,7 +1104,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte } if (batch.getEntry().size() > 0) { - TerminologyClientContext tc = terminologyClientManager.chooseServer(systems, false); + TerminologyClientContext tc = terminologyClientManager.chooseServer(vs, systems, false); Bundle resp = processBatch(tc, batch, systems); for (int i = 0; i < batch.getEntry().size(); i++) { CodingValidationRequest t = (CodingValidationRequest) batch.getEntry().get(i).getUserData("source"); @@ -1213,7 +1209,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte systems.add(codingValidationRequest.getCoding().getSystem()); } } - TerminologyClientContext tc = terminologyClientManager.chooseServer(systems, false); + TerminologyClientContext tc = terminologyClientManager.chooseServer(vs, systems, false); if (batch.getEntry().size() > 0) { Bundle resp = processBatch(tc, batch, systems); @@ -1291,7 +1287,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte vsc.setUnknownSystems(unknownSystems); vsc.setThrowToServer(options.isUseServer() && terminologyClientManager.hasClient()); if (!ValueSetUtilities.isServerSide(code.getSystem())) { - res = vsc.validateCode(path, code); + res = vsc.validateCode(path, code.copy()); if (txCache != null && cachingAllowed) { txCache.cacheValidation(cacheToken, res, TerminologyCache.TRANSIENT); } @@ -1346,9 +1342,9 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte } Set systems = findRelevantSystems(code, vs); - TerminologyClientContext tc = terminologyClientManager.chooseServer(systems, false); + TerminologyClientContext tc = terminologyClientManager.chooseServer(vs, systems, false); - String csumm =cachingAllowed && txCache != null ? txCache.summary(code) : null; + String csumm = cachingAllowed && txCache != null ? txCache.summary(code) : null; if (cachingAllowed && txCache != null) { txLog("$validate "+csumm+(vs == null ? "" : " for "+ txCache.summary(vs))+" on "+tc.getAddress()); } else { @@ -1365,7 +1361,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte } if (!res.isOk() && localError != null) { res.setDiagnostics("Local Error: "+localError.trim()+". Server Error: "+res.getMessage()); - } else if (!res.isOk() && res.getUnknownSystems() != null && res.getUnknownSystems().contains(codeKey) && localWarning != null) { + } else if (!res.isOk() && res.getErrorClass() == TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED && res.getUnknownSystems() != null && res.getUnknownSystems().contains(codeKey) && localWarning != null) { // we had some problem evaluating locally, but the server doesn't know the code system, so we'll just go with the local error res = new ValidationResult(IssueSeverity.WARNING, localWarning, null); res.setDiagnostics("Local Warning: "+localWarning.trim()+". Server Error: "+res.getMessage()); @@ -1378,6 +1374,83 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte return res; } + + /** + * ask the terminology system whether parent subsumes child. + * + * @return true if it does, false if it doesn't, and null if it's not know whether it does + */ + public Boolean subsumes(ValidationOptions optionsArg, Coding parent, Coding child) { + ValidationOptions options = optionsArg != null ? optionsArg : ValidationOptions.defaults(); + + if (parent.hasSystem()) { + codeSystemsUsed.add(parent.getSystem()); + } else { + return null; + } + if (child.hasSystem()) { + codeSystemsUsed.add(child.getSystem()); + } else { + return null; + } + + final CacheToken cacheToken = cachingAllowed && txCache != null ? txCache.generateSubsumesToken(options, parent, child, expParameters) : null; + if (cachingAllowed && txCache != null) { + Boolean res = txCache.getSubsumes(cacheToken); + if (res != null) { + return res; + } + } + + if (options.isUseClient() && parent.getSystem().equals(child.getSystem())) { + CodeSystem cs = fetchCodeSystem(parent.getSystem()); + if (cs != null) { + Boolean b = CodeSystemUtilities.subsumes(cs, parent.getCode(), child.getCode()); + if (txCache != null && cachingAllowed) { + txCache.cacheSubsumes(cacheToken, b, true); + } + return b; + } + } + + if (!terminologyClientManager.hasClient() || !options.isUseServer() || unsupportedCodeSystems.contains(parent.getSystem()) || unsupportedCodeSystems.contains(child.getSystem()) || noTerminologyServer) { + return null; + } + + Set systems = new HashSet<>(); + systems.add(parent.getSystem()); + systems.add(child.getSystem()); + TerminologyClientContext tc = terminologyClientManager.chooseServer(null, systems, false); + + txLog("$subsumes "+parent.toString()+" > "+child.toString()+" on "+tc.getAddress()); + + try { + Parameters pIn = new Parameters(); + pIn.addParameter().setName("codingA").setValue(parent); + pIn.addParameter().setName("codingB").setValue(child); + if (txLog != null) { + txLog.clearLastId(); + } + Parameters pOut = tc.getClient().subsumes(pIn); + return processSubsumesResult(pOut, tc.getClient().getAddress()); + } catch (Exception e) { + // e.printStackTrace(); + } + return null; + } + + + public Boolean processSubsumesResult(Parameters pOut, String server) { + for (ParametersParameterComponent p : pOut.getParameter()) { + if (p.hasValue()) { + if (p.getName().equals("outcome")) { + return Utilities.existsInList(p.getValue().primitiveValue(), "equivalent", "subsumes"); + } + } + } + return null; + } + protected ValueSetExpander constructValueSetExpanderSimple(ValidationOptions options) { return new ValueSetExpander(this, new TerminologyOperationContext(this, options)).setDebug(logger.isDebugLogging()); } @@ -1538,7 +1611,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte return new ValidationResult(IssueSeverity.ERROR, "Error validating code: running without terminology services", TerminologyServiceErrorClass.NOSERVICE, null); } Set systems = findRelevantSystems(code, vs); - TerminologyClientContext tc = terminologyClientManager.chooseServer(systems, false); + TerminologyClientContext tc = terminologyClientManager.chooseServer(vs, systems, false); txLog("$validate "+txCache.summary(code)+" for "+ txCache.summary(vs)+" on "+tc.getAddress()); try { @@ -1780,6 +1853,8 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte } else if (p.getName().equals("x-caused-by-unknown-system")) { err = TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED; unknownSystems.add(((PrimitiveType) p.getValue()).asStringValue()); + } else if (p.getName().equals("x-unknown-system")) { + unknownSystems.add(((PrimitiveType) p.getValue()).asStringValue()); } else if (p.getName().equals("warning-withdrawn")) { String msg = ((PrimitiveType) p.getValue()).asStringValue(); OperationOutcomeIssueComponent iss = new OperationOutcomeIssueComponent(org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity.INFORMATION, org.hl7.fhir.r5.model.OperationOutcome.IssueType.BUSINESSRULE); @@ -2562,55 +2637,6 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte } } - public TranslationServices translator() { - return translator; - } - - public void setTranslator(TranslationServices translator) { - this.translator = translator; - } - - public class NullTranslator implements TranslationServices { - - @Override - public String translate(String context, String value, String targetLang) { - return value; - } - - @Override - public String translate(String context, String value) { - return value; - } - - @Override - public String toStr(float value) { - return null; - } - - @Override - public String toStr(Date value) { - return null; - } - - @Override - public String translateAndFormat(String contest, String lang, String value, Object... args) { - return String.format(value, args); - } - - @Override - public Map translations(String value) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Set listTranslations(String category) { - // TODO Auto-generated method stub - return null; - } - - } - public void reportStatus(JsonObject json) { synchronized (lock) { json.addProperty("codeystem-count", codeSystems.size()); @@ -3220,5 +3246,96 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte } return result; } - + + @Override + public List fetchResourcesByUrl(Class class_, String uri) { + List res = new ArrayList<>(); + if (uri != null && !uri.startsWith("#")) { + if (class_ == StructureDefinition.class) { + uri = ProfileUtilities.sdNs(uri, null); + } + assert !uri.contains("|"); + if (uri.contains("#")) { + uri = uri.substring(0, uri.indexOf("#")); + } + synchronized (lock) { + if (class_ == Resource.class || class_ == null) { + for (Map rt : allResourcesById.values()) { + for (ResourceProxy r : rt.values()) { + if (uri.equals(r.getUrl())) { + res.add((T) r.getResource()); + } + } + } + } + if (class_ == ImplementationGuide.class || class_ == Resource.class || class_ == null) { + for (ImplementationGuide cr : guides.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == CapabilityStatement.class || class_ == Resource.class || class_ == null) { + for (CapabilityStatement cr : capstmts.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == Measure.class || class_ == Resource.class || class_ == null) { + for (Measure cr : measures.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == Library.class || class_ == Resource.class || class_ == null) { + for (Library cr : libraries.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == StructureDefinition.class || class_ == Resource.class || class_ == null) { + for (StructureDefinition cr : structures.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == StructureMap.class || class_ == Resource.class || class_ == null) { + for (StructureMap cr : transforms.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == NamingSystem.class || class_ == Resource.class || class_ == null) { + for (NamingSystem cr : systems.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == ValueSet.class || class_ == Resource.class || class_ == null) { + for (ValueSet cr : valueSets.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == CodeSystem.class || class_ == Resource.class || class_ == null) { + for (CodeSystem cr : codeSystems.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == ConceptMap.class || class_ == Resource.class || class_ == null) { + for (ConceptMap cr : maps.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == ActorDefinition.class || class_ == Resource.class || class_ == null) { + for (ActorDefinition cr : actors.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == Requirements.class || class_ == Resource.class || class_ == null) { + for (Requirements cr : requirements.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == PlanDefinition.class || class_ == Resource.class || class_ == null) { + for (PlanDefinition cr : plans.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == OperationDefinition.class || class_ == Resource.class || class_ == null) { + for (OperationDefinition cr : operations.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == Questionnaire.class || class_ == Resource.class || class_ == null) { + for (Questionnaire cr : questionnaires.getForUrl(uri)) { + res.add((T) cr); + } + } else if (class_ == SearchParameter.class || class_ == Resource.class || class_ == null) { + for (SearchParameter cr : searchParameters.getForUrl(uri)) { + res.add((T) cr); + } + } + } + } + return res; + } + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/CanonicalResourceManager.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/CanonicalResourceManager.java index 0b580e231..1d783d06f 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/CanonicalResourceManager.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/CanonicalResourceManager.java @@ -537,6 +537,16 @@ public class CanonicalResourceManager { } } + public List getForUrl(String url) { + List res = new ArrayList<>(); + List.CachedCanonicalResource> list = listForUrl.get(url); + if (list != null) { + for (CanonicalResourceManager.CachedCanonicalResource t : list) { + res.add(t.getResource()); + } + } + return res; + } /** * This is asking for a packaged version aware resolution diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java index af32ead2f..57fbb2693 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java @@ -47,6 +47,7 @@ public class ContextUtilities implements ProfileKnowledgeProvider { private List allStructuresList = new ArrayList(); private List canonicalResourceNames; private List concreteResourceNames; + private Set concreteResourceNameSet; public ContextUtilities(IWorkerContext context) { super(); @@ -317,6 +318,9 @@ public class ContextUtilities implements ProfileKnowledgeProvider { @Override public boolean isResource(String t) { + if (getConcreteResourceSet().contains(t)) { + return true; + } StructureDefinition sd; try { sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+t); @@ -370,16 +374,22 @@ public class ContextUtilities implements ProfileKnowledgeProvider { return null; } - public List getConcreteResources() { - if (concreteResourceNames == null) { - concreteResourceNames = new ArrayList<>(); - Set names = new HashSet<>(); - for (StructureDefinition sd : allStructures()) { - if (sd.getKind() == StructureDefinitionKind.RESOURCE && !sd.getAbstract()) { - names.add(sd.getType()); + public Set getConcreteResourceSet() { + if (concreteResourceNameSet == null) { + concreteResourceNameSet = new HashSet<>(); + for (StructureDefinition sd : getStructures()) { + if (sd.getKind() == StructureDefinitionKind.RESOURCE && !sd.getAbstract() && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION) { + concreteResourceNameSet.add(sd.getType()); } } - concreteResourceNames.addAll(Utilities.sorted(names)); + } + return concreteResourceNameSet; + } + + public List getConcreteResources() { + if (concreteResourceNames == null) { + concreteResourceNames = new ArrayList<>(); + concreteResourceNames.addAll(Utilities.sorted(getConcreteResourceSet())); } return concreteResourceNames; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java index 1238b6400..987524b92 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java @@ -72,7 +72,6 @@ import org.hl7.fhir.r5.utils.validation.IResourceValidator; import org.hl7.fhir.r5.utils.validation.ValidationContextCarrier; import org.hl7.fhir.utilities.FhirPublication; import org.hl7.fhir.utilities.TimeTracker; -import org.hl7.fhir.utilities.TranslationServices; import org.hl7.fhir.utilities.npm.BasePackageCacheManager; import org.hl7.fhir.utilities.npm.NpmPackage; import org.hl7.fhir.utilities.validation.ValidationMessage; @@ -191,6 +190,15 @@ public interface IWorkerContext { public List fetchResourcesByType(Class class_, FhirPublication fhirVersion); public List fetchResourcesByType(Class class_); + + /** + * Fetch all the resources for the given URL - all matching versions + * + * @param url + * @return + */ + public List fetchResourcesByUrl(Class class_, String url); + /** * Variation of fetchResource when you have a string type, and don't need the right class * @@ -379,6 +387,8 @@ public interface IWorkerContext { /** * Access to the contexts internationalised error messages + * + * For rendering internationalization, see RenderingContext * * @param theMessage * @param theMessageArguments @@ -497,7 +507,6 @@ public interface IWorkerContext { // todo: figure these out public Map getNSUrlMap(); - public TranslationServices translator(); public void setLogger(@Nonnull ILoggingService logger); public ILoggingService getLogger(); @@ -640,4 +649,11 @@ public interface IWorkerContext { public T findTxResource(Class class_, String canonical); public T findTxResource(Class class_, String canonical, String version); + /** + * ask the terminology system whether parent subsumes child. + * + * @return true if it does, false if it doesn't, and null if it's not know whether it does + */ + public Boolean subsumes(ValidationOptions options, Coding parent, Coding child); + } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java index f742e3274..c671d79e5 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java @@ -514,7 +514,7 @@ public class Element extends Base implements NamedItem { } private boolean isDataType(Base v) { - return v instanceof DataType && new ContextUtilities(property.getContext()).getTypeNames().contains(v.fhirType()); + return v instanceof DataType && property.getContextUtils().getTypeNames().contains(v.fhirType()); } @Override @@ -1342,6 +1342,23 @@ public class Element extends Base implements NamedItem { children.add(ne); return ne; } + // polymorphic support + if (p.getName().endsWith("[x]")) { + String base = p.getName().substring(0, p.getName().length()-3); + + if (name.startsWith(base)) { + String type = name.substring(base.length()); + if (p.getContextUtils().isPrimitiveType(Utilities.uncapitalize(type))) { + type = Utilities.uncapitalize(type); + } + if (p.canBeType(type)) { + Element ne = new Element(name, p).setFormat(format); + ne.setType(type); + children.add(ne); + return ne; + } + } + } } throw new Error("Unrecognised property '"+name+"' on "+this.name); @@ -1496,7 +1513,7 @@ public class Element extends Base implements NamedItem { ext.addElement("valueCode").setValue(lang); ext = t.addElement("extension"); - ext.addElement("url").setValue("value"); + ext.addElement("url").setValue("content"); ext.addElement("valueString").setValue(translation); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/FmlParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/FmlParser.java index dd4a4cfac..6ec684800 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/FmlParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/FmlParser.java @@ -134,7 +134,7 @@ public class FmlParser extends ParserBase { lexer.token("conceptmap"); Element map = structureMap.makeElement("contained"); StructureDefinition sd = context.fetchTypeDefinition("ConceptMap"); - map.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(map.getElementProperty() != null ? map.getElementProperty() : map.getProperty()), map.getProperty()); + map.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd, getProfileUtilities(), getContextUtilities()), SpecialElement.fromProperty(map.getElementProperty() != null ? map.getElementProperty() : map.getProperty()), map.getProperty()); map.setType("ConceptMap"); Element eid = map.makeElement("id").markLocation(lexer.getCurrentLocation()); String id = lexer.readConstant("map id"); @@ -225,6 +225,8 @@ public class FmlParser extends ParserBase { String token = lexer.take(); if (token.equals("-")) return ConceptMapRelationship.RELATEDTO; + if (token.equals("=")) // temporary + return ConceptMapRelationship.RELATEDTO; if (token.equals("==")) return ConceptMapRelationship.EQUIVALENT; if (token.equals("!=")) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java index a679cdd8e..cbdac7100 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java @@ -86,22 +86,15 @@ public class JsonParser extends ParserBase { private JsonCreator json; private boolean allowComments; - private ProfileUtilities profileUtilities; private Element baseElement; - private ContextUtilities contextUtilities; public JsonParser(IWorkerContext context, ProfileUtilities utilities) { - super(context); + super(context, utilities); - this.profileUtilities = utilities; - contextUtilities = new ContextUtilities(context); } public JsonParser(IWorkerContext context) { super(context); - - this.profileUtilities = new ProfileUtilities(this.context, null, null, new FHIRPathEngine(context)); - contextUtilities = new ContextUtilities(context); } public Element parse(String source, String type) throws Exception { @@ -128,7 +121,7 @@ public class JsonParser extends ParserBase { nEd.addType().setCode(type); nEd.setMax(obj.getProperties().get(0).getValue().isJsonArray() ? "*" : "1"); } - Element result = new Element(type, new Property(context, sd.getSnapshot().getElement().get(0), sd, this.profileUtilities)).setFormat(FhirFormat.JSON); + Element result = new Element(type, new Property(context, sd.getSnapshot().getElement().get(0), sd, this.getProfileUtilities(), this.getContextUtilities())).setFormat(FhirFormat.JSON); result.setPath(type); checkObject(focusFragment.getErrors(), obj, result, path); result.setType(type); @@ -199,7 +192,7 @@ public class JsonParser extends ParserBase { name = sd.getType(); path = sd.getTypeTail(); } - baseElement = new Element(name, new Property(context, sd.getSnapshot().getElement().get(0), sd, this.profileUtilities)).setFormat(FhirFormat.JSON); + baseElement = new Element(name, new Property(context, sd.getSnapshot().getElement().get(0), sd, this.getProfileUtilities(), this.getContextUtilities())).setFormat(FhirFormat.JSON); checkObject(errors, object, baseElement, path); baseElement.markLocation(line(object), col(object)); baseElement.setType(name); @@ -259,9 +252,9 @@ public class JsonParser extends ParserBase { if (policy != ValidationPolicy.NONE) { for (JsonProperty e : children) { if (e.getTag() == 0) { - StructureDefinition sd = element.getProperty().isLogical() ? contextUtilities.fetchByJsonName(e.getName()) : null; + StructureDefinition sd = element.getProperty().isLogical() ? getContextUtilities().fetchByJsonName(e.getName()) : null; if (sd != null) { - Property property = new Property(context, sd.getSnapshot().getElementFirstRep(), sd, element.getProperty().getUtils()); + Property property = new Property(context, sd.getSnapshot().getElementFirstRep(), sd, element.getProperty().getUtils(), element.getProperty().getContextUtils()); parseChildItem(errors, path, children, element, property); } else if ("fhir_comments".equals(e.getName()) && (VersionUtilities.isR2BVer(context.getVersion()) || VersionUtilities.isR2Ver(context.getVersion()))) { if (!e.getValue().isJsonArray()) { @@ -341,7 +334,7 @@ public class JsonParser extends ParserBase { if (type == null) { logError(errors, ValidationMessage.NO_RULE_DATE, line(je), col(je), path, IssueType.STRUCTURE, this.context.formatMessage(I18nConstants.UNRECOGNISED_PROPERTY_TYPE, describeType(je), property.getName(), property.typeSummary()), IssueSeverity.ERROR); } else if (property.hasType(type)) { - Property np = new Property(property.getContext(), property.getDefinition(), property.getStructure(), property.getUtils(), type); + Property np = new Property(property.getContext(), property.getDefinition(), property.getStructure(), property.getUtils(), property.getContextUtils(), type); parseChildPrimitive(errors, jp, getJsonPropertyByName("_"+property.getJsonName(), children), context, np, path, property.getName(), false); } else { logError(errors, ValidationMessage.NO_RULE_DATE, line(je), col(je), path, IssueType.STRUCTURE, this.context.formatMessage(I18nConstants.UNRECOGNISED_PROPERTY_TYPE_WRONG, describeType(je), property.getName(), type, property.typeSummary()), IssueSeverity.ERROR); @@ -474,7 +467,7 @@ public class JsonParser extends ParserBase { if (type == null) { logError(errors, ValidationMessage.NO_RULE_DATE, line(pv.getValue()), col(pv.getValue()), path, IssueType.STRUCTURE, this.context.formatMessage(I18nConstants.UNRECOGNISED_PROPERTY_TYPE, describeType(pv.getValue()), propV.getName(), propV.typeSummary()), IssueSeverity.ERROR); } else if (propV.hasType(type)) { - pvl = new Property(propV.getContext(), propV.getDefinition(), propV.getStructure(), propV.getUtils(), type); + pvl = new Property(propV.getContext(), propV.getDefinition(), propV.getStructure(), propV.getUtils(), propV.getContextUtils(), type); ok = true; } else { logError(errors, ValidationMessage.NO_RULE_DATE, line(pv.getValue()), col(pv.getValue()), path, IssueType.STRUCTURE, this.context.formatMessage(I18nConstants.UNRECOGNISED_PROPERTY_TYPE_WRONG, describeType(pv.getValue()), propV.getName(), type, propV.typeSummary()), IssueSeverity.ERROR); @@ -713,7 +706,7 @@ public class JsonParser extends ParserBase { if (sd == null) { logError(errors, ValidationMessage.NO_RULE_DATE, line(res), col(res), npath, IssueType.INVALID, context.formatMessage(I18nConstants.CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_, name), IssueSeverity.FATAL); } else { - parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd, this.profileUtilities), SpecialElement.fromProperty(parent.getProperty()), elementProperty); + parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd, this.getProfileUtilities(), this.getContextUtilities()), SpecialElement.fromProperty(parent.getProperty()), elementProperty); parent.setType(name); parseChildren(errors, npath, res, parent, true, null); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java index 35c46d202..a454ad9da 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java @@ -9,12 +9,19 @@ import java.util.Set; import org.checkerframework.checker.units.qual.cd; import org.hl7.fhir.r5.context.ContextUtilities; import org.hl7.fhir.r5.context.IWorkerContext; +import org.hl7.fhir.r5.model.Base; import org.hl7.fhir.r5.model.CodeSystem; import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent; import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent; import org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent; +import org.hl7.fhir.r5.model.ContactDetail; import org.hl7.fhir.r5.model.DataType; +import org.hl7.fhir.r5.model.ElementDefinition; +import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingAdditionalComponent; +import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent; import org.hl7.fhir.r5.model.Resource; +import org.hl7.fhir.r5.model.StringType; +import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.terminologies.CodeSystemUtilities; import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.Utilities; @@ -24,6 +31,10 @@ import org.hl7.fhir.utilities.i18n.LanguageFileProducer; import org.hl7.fhir.utilities.i18n.LanguageFileProducer.LanguageProducerLanguageSession; import org.hl7.fhir.utilities.i18n.LanguageFileProducer.TextUnit; import org.hl7.fhir.utilities.i18n.LanguageFileProducer.TranslationUnit; +import org.hl7.fhir.utilities.validation.ValidationMessage; +import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; +import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; +import org.hl7.fhir.utilities.validation.ValidationMessage.Source; /** * in here: @@ -77,7 +88,6 @@ public class LanguageUtils { } } } - private String contextForElement(Element element) { throw new Error("Not done yet"); @@ -110,7 +120,7 @@ public class LanguageUtils { } private boolean isTranslatable(Element element) { - return element.getProperty().isTranslatable() && !Utilities.existsInList(pathForElement(element), "CanonicalResource.version"); + return element.getProperty().isTranslatable(); } private String pathForElement(Element element) { @@ -132,11 +142,85 @@ public class LanguageUtils { return bp; } - public int importFromTranslations(Element resource, Set translations) { - return importFromTranslations(null, resource, translations); + + public int importFromTranslations(Element resource, List translations) { + return importFromTranslations(null, resource, translations, new HashSet<>()); } - private int importFromTranslations(Element parent, Element element, Set translations) { + public int importFromTranslations(Element resource, List translations, List messages) { + Set usedUnits = new HashSet<>(); + int r = 0; + if (resource.fhirType().equals("StructureDefinition")) { + r = importFromTranslationsForSD(null, resource, translations, usedUnits); + } else { + r = importFromTranslations(null, resource, translations, usedUnits); + } + for (TranslationUnit t : translations) { + if (!usedUnits.contains(t)) { + messages.add(new ValidationMessage(Source.Publisher, IssueType.INFORMATIONAL, t.getId(), "Unused '"+t.getLanguage()+"' translation '"+t.getSrcText()+"' -> '"+t.getTgtText()+"'", IssueSeverity.INFORMATION)); + } + } + return r; + } + + + /* + * */ + private int importFromTranslationsForSD(Object object, Element resource, List translations, Set usedUnits) { + int r = 0; + r = r + checkForTranslations(translations, usedUnits, resource, "name", "name"); + r = r + checkForTranslations(translations, usedUnits, resource, "title", "title"); + r = r + checkForTranslations(translations, usedUnits, resource, "publisher", "publisher"); + for (Element cd : resource.getChildrenByName("contact")) { + r = r + checkForTranslations(translations, usedUnits, cd, "contact.name", "name"); + } + r = r + checkForTranslations(translations, usedUnits, resource, "purpose", "purpose"); + r = r + checkForTranslations(translations, usedUnits, resource, "copyright", "copyright"); + Element diff = resource.getNamedChild("differential"); + if (diff != null) { + for (Element ed : diff.getChildrenByName("element")) { + String id = ed.getNamedChildValue("id"); + r = r + checkForTranslations(translations, usedUnits, ed, id+"/label", "label"); + r = r + checkForTranslations(translations, usedUnits, ed, id+"/short", "short"); + r = r + checkForTranslations(translations, usedUnits, ed, id+"/definition", "definition"); + r = r + checkForTranslations(translations, usedUnits, ed, id+"/comment", "comment"); + r = r + checkForTranslations(translations, usedUnits, ed, id+"/requirements", "requirements"); + r = r + checkForTranslations(translations, usedUnits, ed, id+"/meaningWhenMissing", "meaningWhenMissing"); + r = r + checkForTranslations(translations, usedUnits, ed, id+"/orderMeaning", "orderMeaning"); + // for (ElementDefinitionConstraintComponent con : ed.getConstraint()) { + // addToList(list, lang, con, ed.getId()+"/constraint", "human", con.getHumanElement()); + // } + // if (ed.hasBinding()) { + // addToList(list, lang, ed.getBinding(), ed.getId()+"/b/desc", "description", ed.getBinding().getDescriptionElement()); + // for (ElementDefinitionBindingAdditionalComponent ab : ed.getBinding().getAdditional()) { + // addToList(list, lang, ab, ed.getId()+"/ab/doco", "documentation", ab.getDocumentationElement()); + // addToList(list, lang, ab, ed.getId()+"/ab/short", "shortDoco", ab.getShortDocoElement()); + // } + // } + } + } + return r; + } + + private int checkForTranslations(List translations, Set usedUnits, Element context, String tname, String pname) { + int r = 0; + Element child = context.getNamedChild(pname); + if (child != null) { + String v = child.primitiveValue(); + if (v != null) { + for (TranslationUnit tu : translations) { + if (tname.equals(tu.getId()) && v.equals(tu.getSrcText())) { + usedUnits.add(tu); + child.setTranslation(tu.getLanguage(), tu.getTgtText()); + r++; + } + } + } + } + return r; + } + + private int importFromTranslations(Element parent, Element element, List translations, Set usedUnits) { int t = 0; if (element.isPrimitive() && isTranslatable(element)) { String base = element.primitiveValue(); @@ -146,13 +230,14 @@ public class LanguageUtils { t++; if (!handleAsSpecial(parent, element, translation)) { element.setTranslation(translation.getLanguage(), translation.getTgtText()); + usedUnits.add(translation); } } } } for (Element c: element.getChildren()) { if (!c.getName().equals("designation")) { - t = t + importFromTranslations(element, c, translations); + t = t + importFromTranslations(element, c, translations, usedUnits); } } return t; @@ -193,7 +278,7 @@ public class LanguageUtils { return true; } - private Set findTranslations(String path, String src, Set translations) { + private Set findTranslations(String path, String src, List translations) { Set res = new HashSet<>(); for (TranslationUnit translation : translations) { if (path.equals(translation.getId()) && src.equals(translation.getSrcText())) { @@ -290,22 +375,64 @@ public class LanguageUtils { } public static boolean handlesAsResource(Resource resource) { - return (resource instanceof CodeSystem && resource.hasUserData(SUPPLEMENT_NAME)); + return (resource instanceof CodeSystem && resource.hasUserData(SUPPLEMENT_NAME)) || (resource instanceof StructureDefinition); } public static boolean handlesAsElement(Element element) { - return false; // for now... + return true; // for now... } public static List generateTranslations(Resource res, String lang) { List list = new ArrayList<>(); - CodeSystem cs = (CodeSystem) res; - for (ConceptDefinitionComponent cd : cs.getConcept()) { - generateTranslations(list, cd, lang); + if (res instanceof StructureDefinition) { + StructureDefinition sd = (StructureDefinition) res; + generateTranslations(list, sd, lang); + } else { + CodeSystem cs = (CodeSystem) res; + for (ConceptDefinitionComponent cd : cs.getConcept()) { + generateTranslations(list, cd, lang); + } } return list; } + private static void generateTranslations(List list, StructureDefinition sd, String lang) { + addToList(list, lang, sd, "name", "name", sd.getNameElement()); + addToList(list, lang, sd, "title", "title", sd.getTitleElement()); + addToList(list, lang, sd, "publisher", "publisher", sd.getPublisherElement()); + for (ContactDetail cd : sd.getContact()) { + addToList(list, lang, cd, "contact.name", "name", cd.getNameElement()); + } + addToList(list, lang, sd, "purpose", "purpose", sd.getPurposeElement()); + addToList(list, lang, sd, "copyright", "copyright", sd.getCopyrightElement()); + for (ElementDefinition ed : sd.getDifferential().getElement()) { + addToList(list, lang, ed, ed.getId()+"/label", "label", ed.getLabelElement()); + addToList(list, lang, ed, ed.getId()+"/short", "short", ed.getShortElement()); + addToList(list, lang, ed, ed.getId()+"/definition", "definition", ed.getDefinitionElement()); + addToList(list, lang, ed, ed.getId()+"/comment", "comment", ed.getCommentElement()); + addToList(list, lang, ed, ed.getId()+"/requirements", "requirements", ed.getRequirementsElement()); + addToList(list, lang, ed, ed.getId()+"/meaningWhenMissing", "meaningWhenMissing", ed.getMeaningWhenMissingElement()); + addToList(list, lang, ed, ed.getId()+"/orderMeaning", "orderMeaning", ed.getOrderMeaningElement()); + for (ElementDefinitionConstraintComponent con : ed.getConstraint()) { + addToList(list, lang, con, ed.getId()+"/constraint", "human", con.getHumanElement()); + } + if (ed.hasBinding()) { + addToList(list, lang, ed.getBinding(), ed.getId()+"/b/desc", "description", ed.getBinding().getDescriptionElement()); + for (ElementDefinitionBindingAdditionalComponent ab : ed.getBinding().getAdditional()) { + addToList(list, lang, ab, ed.getId()+"/ab/doco", "documentation", ab.getDocumentationElement()); + addToList(list, lang, ab, ed.getId()+"/ab/short", "shortDoco", ab.getShortDocoElement()); + } + } + } + } + + private static void addToList(List list, String lang, Base ctxt, String name, String propName, DataType value) { + if (value != null && value.hasPrimitiveValue()) { + list.add(new TranslationUnit(lang, name, ctxt.getNamedProperty(propName).getDefinition(), value.primitiveValue(), value.getTranslation(lang))); + } + + } + private static void generateTranslations(List list, ConceptDefinitionComponent cd, String lang) { String code = cd.getCode(); String display = cd.getDisplay(); @@ -334,4 +461,51 @@ public class LanguageUtils { return cd.getDefinition(); } } + + public static List generateTranslations(Element e, String lang) { + List list = new ArrayList<>(); + generateTranslations(e, lang, list); + return list; + } + + private static void generateTranslations(Element e, String lang, List list) { + if (e.getProperty().isTranslatable()) { + String id = e.getProperty().getDefinition().getPath(); + String context = e.getProperty().getDefinition().getDefinition(); + String src = e.primitiveValue(); + String tgt = getTranslation(e, lang); + list.add(new TranslationUnit(lang, id, context, src, tgt)); + } + if (e.hasChildren()) { + for (Element c : e.getChildren()) { + generateTranslations(c, lang, list); + } + } + + } + + private static String getTranslation(Element e, String lang) { + if (!e.hasChildren()) { + return null; + } + for (Element ext : e.getChildren()) { + if ("Extension".equals(ext.fhirType()) && "http://hl7.org/fhir/StructureDefinition/translation".equals(ext.getNamedChildValue("url"))) { + String l = null; + String v = null; + for (Element subExt : ext.getChildren()) { + if ("Extension".equals(subExt.fhirType()) && "lang".equals(subExt.getNamedChildValue("url"))) { + l = subExt.getNamedChildValue("value"); + } + if ("Extension".equals(subExt.fhirType()) && "content".equals(subExt.getNamedChildValue("url"))) { + v = subExt.getNamedChildValue("value"); + } + } + if (lang.equals(l)) { + return v; + } + } + } + return null; + } + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java index b78b5d7a5..49baa8525 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java @@ -39,8 +39,10 @@ import java.util.List; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRFormatError; +import org.hl7.fhir.r5.conformance.profile.ProfileUtilities; import org.hl7.fhir.r5.context.ContextUtilities; import org.hl7.fhir.r5.context.IWorkerContext; +import org.hl7.fhir.r5.fhirpath.FHIRPathEngine; import org.hl7.fhir.r5.formats.FormatUtilities; import org.hl7.fhir.r5.formats.IParser.OutputStyle; import org.hl7.fhir.r5.model.StructureDefinition; @@ -89,14 +91,26 @@ public abstract class ParserBase { protected IdRenderingPolicy idPolicy = IdRenderingPolicy.All; protected StructureDefinition logical; protected IDigitalSignatureServices signatureServices; - - public ParserBase(IWorkerContext context) { + private ProfileUtilities profileUtilities; + private ContextUtilities contextUtilities; + + public ParserBase(IWorkerContext context, ProfileUtilities utilities) { super(); this.context = context; + this.profileUtilities = utilities; + contextUtilities = new ContextUtilities(context); policy = ValidationPolicy.NONE; } - public void setupValidation(ValidationPolicy policy) { + public ParserBase(IWorkerContext context) { + super(); + this.context = context; + this.profileUtilities = new ProfileUtilities(context, null, null, new FHIRPathEngine(context)); + contextUtilities = new ContextUtilities(context); + policy = ValidationPolicy.NONE; + } + + public void setupValidation(ValidationPolicy policy) { this.policy = policy; } @@ -215,19 +229,19 @@ public abstract class ParserBase { // first pass: only look at base definitions for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) { if (sd.getUrl().equals("http://hl7.org/fhir/StructureDefinition/"+name)) { - new ContextUtilities(context).generateSnapshot(sd); + contextUtilities.generateSnapshot(sd); return sd; } } for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) { if (name.equals(sd.getTypeName()) && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION) { - new ContextUtilities(context).generateSnapshot(sd); + contextUtilities.generateSnapshot(sd); return sd; } } for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) { if (name.equals(sd.getUrl()) && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION) { - new ContextUtilities(context).generateSnapshot(sd); + contextUtilities.generateSnapshot(sd); return sd; } } @@ -304,4 +318,22 @@ public abstract class ParserBase { return element.getNamedChildValue("reference"); } } + + public IWorkerContext getContext() { + return context; + } + + public ValidationPolicy getPolicy() { + return policy; + } + + public ProfileUtilities getProfileUtilities() { + return profileUtilities; + } + + public ContextUtilities getContextUtilities() { + return contextUtilities; + } + + } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Property.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Property.java index 128c7ce45..6a5e8a22a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Property.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Property.java @@ -38,6 +38,7 @@ import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.conformance.profile.ProfileUtilities; import org.hl7.fhir.r5.conformance.profile.ProfileUtilities.SourcedChildDefinitions; +import org.hl7.fhir.r5.context.ContextUtilities; import org.hl7.fhir.r5.context.IWorkerContext; import org.hl7.fhir.r5.fhirpath.TypeDetails; import org.hl7.fhir.r5.formats.FormatUtilities; @@ -60,21 +61,24 @@ public class Property { private ElementDefinition definition; private StructureDefinition structure; private ProfileUtilities profileUtilities; + private ContextUtilities utils; private TypeRefComponent type; - public Property(IWorkerContext context, ElementDefinition definition, StructureDefinition structure, ProfileUtilities profileUtilities) { + public Property(IWorkerContext context, ElementDefinition definition, StructureDefinition structure, ProfileUtilities profileUtilities, ContextUtilities utils) { this.context = context; this.definition = definition; this.structure = structure; + this.utils = utils; this.profileUtilities = profileUtilities; } - public Property(IWorkerContext context, ElementDefinition definition, StructureDefinition structure, ProfileUtilities profileUtilities, String type) { + public Property(IWorkerContext context, ElementDefinition definition, StructureDefinition structure, ProfileUtilities profileUtilities, ContextUtilities utils, String type) { this.context = context; this.definition = definition; this.structure = structure; this.profileUtilities = profileUtilities; + this.utils = utils; for (TypeRefComponent tr : definition.getType()) { if (tr.getWorkingCode().equals(type)) { this.type = tr; @@ -83,7 +87,7 @@ public class Property { } public Property(IWorkerContext context, ElementDefinition definition, StructureDefinition structure) { - this(context, definition, structure, new ProfileUtilities(context, null, null)); + this(context, definition, structure, new ProfileUtilities(context, null, null), new ContextUtilities(context)); } public String getName() { @@ -265,10 +269,10 @@ public class Property { public boolean isResource() { if (type != null) { String tc = type.getCode(); - return (("Resource".equals(tc) || "DomainResource".equals(tc)) || Utilities.existsInList(tc, context.getResourceNames())); + return (("Resource".equals(tc) || "DomainResource".equals(tc)) || utils.isResource(tc)); } else if (definition.getType().size() > 0) { String tc = definition.getType().get(0).getCode(); - return definition.getType().size() == 1 && (("Resource".equals(tc) || "DomainResource".equals(tc)) || Utilities.existsInList(tc, context.getResourceNames())); + return definition.getType().size() == 1 && (("Resource".equals(tc) || "DomainResource".equals(tc)) || utils.isResource(tc)); } else { return !definition.getPath().contains(".") && (structure.getKind() == StructureDefinitionKind.RESOURCE); @@ -425,7 +429,7 @@ public class Property { } List properties = new ArrayList(); for (ElementDefinition child : children.getList()) { - properties.add(new Property(context, child, sd, this.profileUtilities)); + properties.add(new Property(context, child, sd, this.profileUtilities, this.utils)); } profileUtilities.getCachedPropertyList().put(cacheKey, properties); return properties; @@ -485,7 +489,7 @@ public class Property { } List properties = new ArrayList(); for (ElementDefinition child : children.getList()) { - properties.add(new Property(context, child, sd, this.profileUtilities)); + properties.add(new Property(context, child, sd, this.profileUtilities, this.utils)); } return properties; } @@ -613,6 +617,9 @@ public class Property { public ProfileUtilities getUtils() { return profileUtilities; } + public ContextUtilities getContextUtils() { + return utils; + } public boolean isJsonPrimitiveChoice() { return ToolingExtensions.readBoolExtension(definition, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE); @@ -634,14 +641,32 @@ public class Property { public boolean isTranslatable() { boolean ok = ToolingExtensions.readBoolExtension(definition, ToolingExtensions.EXT_TRANSLATABLE); - if (!ok && !Utilities.existsInList(definition.getBase().getPath(), "Reference.reference", "Coding.version", "Identifier.value", "SampledData.offsets", "SampledData.data", "ContactPoint.value")) { + if (!ok && !definition.getPath().endsWith(".id") && !Utilities.existsInList(definition.getBase().getPath(), "Resource.id", "Reference.reference", "Coding.version", "Identifier.value", "SampledData.offsets", "SampledData.data", "ContactPoint.value")) { String t = getType(); ok = Utilities.existsInList(t, "string", "markdown"); } + if (Utilities.existsInList(pathForElement(getStructure().getType(), getDefinition().getBase().getPath()), "CanonicalResource.version")) { + return false; + } return ok; + } + + + private String pathForElement(String type, String path) { + // special case support for metadata elements prior to R5: + if (utils.getCanonicalResourceNames().contains(type)) { + String fp = path.replace(type+".", "CanonicalResource."); + if (Utilities.existsInList(fp, + "CanonicalResource.url", "CanonicalResource.identifier", "CanonicalResource.version", "CanonicalResource.name", + "CanonicalResource.title", "CanonicalResource.status", "CanonicalResource.experimental", "CanonicalResource.date", + "CanonicalResource.publisher", "CanonicalResource.contact", "CanonicalResource.description", "CanonicalResource.useContext", + "CanonicalResource.jurisdiction")) { + return fp; + } + } + return path; } - - + public String getXmlTypeName() { TypeRefComponent tr = type; if (tr == null) { @@ -670,5 +695,15 @@ public class Property { return Utilities.existsInList(tr.getWorkingCode(), "Reference", "url", "uri", "canonical"); } + + public boolean canBeType(String type) { + for (TypeRefComponent tr : getDefinition().getType()) { + if (type.equals(tr.getWorkingCode())) { + return true; + } + } + return false; + } + } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ResourceParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ResourceParser.java index bfbf759b0..f12815582 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ResourceParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ResourceParser.java @@ -50,7 +50,7 @@ public class ResourceParser extends ParserBase { if (sd == null) { throw new FHIRException("No definition exists for "+resource.fhirType()); } - Property p = new Property(context, sd.getSnapshot().getElement().get(0), sd, new ProfileUtilities(context, null, null)); + Property p = new Property(context, sd.getSnapshot().getElement().get(0), sd, getProfileUtilities(), getContextUtilities()); String path = resource.fhirType(); Element e = new Element(resource.fhirType(), p); @@ -106,7 +106,7 @@ public class ResourceParser extends ParserBase { StructureDefinition sd = context.fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(v.fhirType(), null)); if (sd == null) throw new FHIRFormatError(context.formatMessage(I18nConstants.CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_, v.fhirType())); - n.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(n.getProperty()), p); + n.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd, getProfileUtilities(), getContextUtilities()), SpecialElement.fromProperty(n.getProperty()), p); n.setType(v.fhirType()); parseChildren(npath, v, n); } else { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/TurtleParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/TurtleParser.java index 91c160ed3..28df24d55 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/TurtleParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/TurtleParser.java @@ -151,7 +151,7 @@ public class TurtleParser extends ParserBase { if (sd == null) return null; - Element result = new Element(name, new Property(context, sd.getSnapshot().getElement().get(0), sd)).setFormat(FhirFormat.TURTLE); + Element result = new Element(name, new Property(context, sd.getSnapshot().getElement().get(0), sd, getProfileUtilities(), getContextUtilities())).setFormat(FhirFormat.TURTLE); result.markLocation(cmp.getLine(), cmp.getCol()); result.setType(name); parseChildren(errors, src, path, cmp, result, false); @@ -279,7 +279,7 @@ public class TurtleParser extends ParserBase { Element n = new Element(tail(name), property).markLocation(object.getLine(), object.getCol()).setFormat(FhirFormat.TURTLE); element.getChildren().add(n); - n.updateProperty(new Property(this.context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(n.getProperty()), property); + n.updateProperty(new Property(this.context, sd.getSnapshot().getElement().get(0), sd, getProfileUtilities(), getContextUtilities()), SpecialElement.fromProperty(n.getProperty()), property); n.setType(rt); parseChildren(errors, src, npath, obj, n, false); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/VerticalBarParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/VerticalBarParser.java index cca033fef..5226ac7a1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/VerticalBarParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/VerticalBarParser.java @@ -456,7 +456,7 @@ public class VerticalBarParser extends ParserBase { @Override public List parse(InputStream inStream) throws IOException, FHIRFormatError, DefinitionException, FHIRException { StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/v2/StructureDefinition/Message"); - Element message = new Element("Message", new Property(context, sd.getSnapshot().getElementFirstRep(), sd)); + Element message = new Element("Message", new Property(context, sd.getSnapshot().getElementFirstRep(), sd, getProfileUtilities(), getContextUtilities())); byte[] content = TextFile.streamToBytes(inStream); ByteArrayInputStream stream = new ByteArrayInputStream(content); VerticalBarParserReader reader = new VerticalBarParserReader(new BufferedInputStream(stream), charset); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/XmlParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/XmlParser.java index 1313420b0..6ffe75df2 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/XmlParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/XmlParser.java @@ -231,7 +231,7 @@ public class XmlParser extends ParserBase { if (sd == null) return null; - Element result = new Element(element.getLocalName(), new Property(context, sd.getSnapshot().getElement().get(0), sd)).setFormat(FhirFormat.XML); + Element result = new Element(element.getLocalName(), new Property(context, sd.getSnapshot().getElement().get(0), sd, getProfileUtilities(), getContextUtilities())).setFormat(FhirFormat.XML); result.setPath(element.getLocalName()); checkElement(errors, element, result, path, result.getProperty(), false); result.markLocation(line(element, false), col(element, false)); @@ -321,7 +321,7 @@ public class XmlParser extends ParserBase { public Element parse(List errors, org.w3c.dom.Element base, String type) throws Exception { StructureDefinition sd = getDefinition(errors, 0, 0, FormatUtilities.FHIR_NS, type); - Element result = new Element(base.getLocalName(), new Property(context, sd.getSnapshot().getElement().get(0), sd)).setFormat(FhirFormat.XML).setNativeObject(base); + Element result = new Element(base.getLocalName(), new Property(context, sd.getSnapshot().getElement().get(0), sd, getProfileUtilities(), getContextUtilities())).setFormat(FhirFormat.XML).setNativeObject(base); result.setPath(base.getLocalName()); String path = "/"+pathPrefix(base.getNamespaceURI())+base.getLocalName(); checkElement(errors, base, result, path, result.getProperty(), false); @@ -662,7 +662,7 @@ public class XmlParser extends ParserBase { StructureDefinition sd = context.fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, null)); if (sd == null) throw new FHIRFormatError(context.formatMessage(I18nConstants.CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_, res.getLocalName())); - parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(parent.getProperty()), elementProperty); + parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd, getProfileUtilities(), getContextUtilities()), SpecialElement.fromProperty(parent.getProperty()), elementProperty); parent.setType(name); parseChildren(errors, res.getLocalName(), res, parent); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/FHIRPathEngine.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/FHIRPathEngine.java index 4432b2145..299ebc3a1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/FHIRPathEngine.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/FHIRPathEngine.java @@ -3253,7 +3253,7 @@ public class FHIRPathEngine { return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean); } case SubsetOf : { - checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, focus); + checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, focus.toUnordered()); return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean); } case SupersetOf : { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/TypeDetails.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/TypeDetails.java index 9f0ba59cb..d904fb37b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/TypeDetails.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/TypeDetails.java @@ -405,6 +405,16 @@ public class TypeDetails { result.types.addAll(types); return result; } + public TypeDetails toOrdered() { + TypeDetails result = new TypeDetails(CollectionStatus.ORDERED); + result.types.addAll(types); + return result; + } + public TypeDetails toUnordered() { + TypeDetails result = new TypeDetails(CollectionStatus.UNORDERED); + result.types.addAll(types); + return result; + } public CollectionStatus getCollectionStatus() { return collectionStatus; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/FormatUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/FormatUtilities.java index 91dcf9622..0b967a5b6 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/FormatUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/formats/FormatUtilities.java @@ -107,7 +107,7 @@ public abstract class FormatUtilities { } public static boolean isValidId(String tail) { - return tail.matches(ID_REGEX); + return tail == null ? false : tail.matches(ID_REGEX); } public static String makeId(String candidate) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/CanonicalResource.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/CanonicalResource.java index b15edab4e..b874cf138 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/CanonicalResource.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/CanonicalResource.java @@ -596,6 +596,9 @@ public abstract class CanonicalResource extends DomainResource { } public String present() { + if (hasUserData("presentation")) { + return getUserString("presentation"); + } if (hasTitle()) return getTitle(); if (hasName()) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Coding.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Coding.java index b4d85aafa..c04f37b64 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Coding.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Coding.java @@ -562,9 +562,28 @@ public class Coding extends DataType implements IBaseCoding, ICompositeType, ICo base = base + "#"+getCode(); if (hasDisplay()) base = base+": '"+getDisplay()+"'"; - return base; - + return base; } + + public static Coding fromLiteral(String value) { + String sv = value.contains("#") ? value.substring(0, value.indexOf("#")) : value; + String cp = value.contains("#") ? value.substring(value.indexOf("#")+1) : null; + + String system = sv.contains("|") ? sv.substring(0, sv.indexOf("|")) : sv; + String version = sv.contains("|") ? sv.substring(sv.indexOf("|")+1) : null; + + String code = cp != null && cp.contains("'") ? cp.substring(0, cp.indexOf("'")) : cp; + String display = cp != null && cp.contains("'") ? cp.substring(cp.indexOf("'")+1) : null; + if (display != null) { + display = display.trim(); + display = display.substring(0, display.length() -1); + } + if ((system == null || !Utilities.isAbsoluteUrl(system)) && code == null) { + return null; + } else { + return new Coding(system, version, code, display); + } + } public boolean matches(Coding other) { return other.hasCode() && this.hasCode() && other.hasSystem() && this.hasSystem() && this.getCode().equals(other.getCode()) && this.getSystem().equals(other.getSystem()) ; @@ -629,5 +648,9 @@ public class Coding extends DataType implements IBaseCoding, ICompositeType, ICo } // end addition + public String getVersionedSystem() { + return hasVersion() ? getSystem()+"|"+getVersion() : getSystem(); + } + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ConceptMap.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ConceptMap.java index c288f84e3..e83e46265 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ConceptMap.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ConceptMap.java @@ -1777,10 +1777,24 @@ public class ConceptMap extends MetadataResource { } + public SourceElementComponent getOrAddElement(String code) { + for (SourceElementComponent e : getElement()) { + if (code.equals(e.getCode())) { + return e; + } + } + return addElement().setCode(code); + } + } @Block() public static class SourceElementComponent extends BackboneElement implements IBaseBackboneElement { + @Override + public String toString() { + return "SourceElementComponent [code=" + code + ", display=" + display + ", noMap=" + noMap + "]"; + } + /** * Identity (code or path) or the element/item being mapped. */ @@ -2260,10 +2274,30 @@ public class ConceptMap extends MetadataResource { } + public boolean hasTargetCode(String code) { + for (TargetElementComponent tgt : getTarget()) { + if (code.equals(tgt.getCode())) { + return true; + } + } + return false; + } + + public TargetElementComponent addTarget(String code, ConceptMapRelationship relationship) { + TargetElementComponent tgt = addTarget(); + tgt.setCode(code); + tgt.setRelationship(relationship); + return tgt; + } } @Block() public static class TargetElementComponent extends BackboneElement implements IBaseBackboneElement { + @Override + public String toString() { + return "TargetElementComponent [code=" + code + ", relationship=" + relationship + "]"; + } + /** * Identity (code or path) or the element/item that the map refers to. */ @@ -8572,7 +8606,42 @@ public class ConceptMap extends MetadataResource { private String tail(String uri) { return uri.contains("/") ? uri.substring(uri.lastIndexOf("/")+1) : uri; } + + public ConceptMapGroupComponent getGroup(String su, String tu) { + for (ConceptMapGroupComponent g : getGroup()) { + if (su.equals(g.getSource()) && tu.equals(g.getTarget())) { + return g; + } + } + return null; + } + + public ConceptMapGroupComponent forceGroup(String su, String tu) { + for (ConceptMapGroupComponent g : getGroup()) { + if (su.equals(g.getSource()) && tu.equals(g.getTarget())) { + return g; + } + } + ConceptMapGroupComponent g = addGroup(); + g.setSource(su); + g.setTarget(tu); + return g; + + } + + public List getGroups(String su) { + List res = new ArrayList<>(); + + for (ConceptMapGroupComponent g : getGroup()) { + if (su.equals(g.getSource())) { + res.add(g); + } + } + return res; + } + // end addition + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/DataType.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/DataType.java index 7db305055..808d3bb22 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/DataType.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/DataType.java @@ -4,19 +4,19 @@ package org.hl7.fhir.r5.model; /* 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 \ + + * 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, \ + * 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 + * 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. \ @@ -27,7 +27,7 @@ package org.hl7.fhir.r5.model; 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 Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0 @@ -35,6 +35,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import org.hl7.fhir.r5.model.Enumerations.*; +import org.hl7.fhir.r5.utils.ToolingExtensions; import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.instance.model.api.ICompositeType; @@ -52,26 +53,40 @@ import ca.uhn.fhir.model.api.IElement; @DatatypeDef(name="DataType") public abstract class DataType extends Element implements IBaseDatatype, IElement { - private static final long serialVersionUID = 0L; + private static final long serialVersionUID = 0L; /** * Constructor */ - public DataType() { - super(); - } + public DataType() { + super(); + } public String fhirType() { return "DataType"; } - public abstract DataType copy(); + public abstract DataType copy(); - public void copyValues(DataType dst) { - super.copyValues(dst); + public void copyValues(DataType dst) { + super.copyValues(dst); + } + + + public String getTranslation(String l) throws FHIRException { + for (Extension e : getExtension()) { + if (e.getUrl().equals(ToolingExtensions.EXT_TRANSLATION)) { + String lang = ToolingExtensions.readStringExtension(e, "lang"); + if (lang.equals(l)) + return e.getExtensionString("content"); } - - + } + return null; + } + + public boolean isTranslatable() { + return false; + } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ElementDefinition.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ElementDefinition.java index 3cf91c952..7d7f1ce4b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ElementDefinition.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ElementDefinition.java @@ -4605,6 +4605,11 @@ public boolean hasTarget() { } + @Override + public String toString() { + return key + ":" + expression + (severity == null ? "("+severity.asStringValue()+")" : ""); + } + } @Block() @@ -13093,6 +13098,10 @@ If a pattern[x] is declared on a repeating element, the pattern applies to all r return t; } + public boolean repeats() { + return !Utilities.existsInList(getMax(), "0", "1"); + } + // end addition } 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 a4d51b168..f2600f6d7 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 @@ -3829,6 +3829,17 @@ public class Enumerations { default: return "?"; } } + public String getSymbol() { + switch (this) { + case RELATEDTO: return "-"; + case EQUIVALENT: return "="; + case SOURCEISNARROWERTHANTARGET: return "<"; + case SOURCEISBROADERTHANTARGET: return ">"; + case NOTRELATEDTO: return "!="; + case NULL: return null; + default: return "?"; + } + } } public static class ConceptMapRelationshipEnumFactory implements EnumFactory { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ExtensionHelper.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ExtensionHelper.java index 156a59f9e..ddc3984d5 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ExtensionHelper.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ExtensionHelper.java @@ -114,15 +114,19 @@ public class ExtensionHelper { * @return The extension, if on this element, else null. will check modifier extensions too */ public static Extension getExtension(BackboneElement element, String name) { - if (name == null || element == null || !element.hasExtension()) + if (name == null || element == null) return null; - for (Extension e : element.getModifierExtension()) { - if (name.equals(e.getUrl())) - return e; + if (element.hasModifierExtension()) { + for (Extension e : element.getModifierExtension()) { + if (name.equals(e.getUrl())) + return e; + } } - for (Extension e : element.getExtension()) { - if (name.equals(e.getUrl())) - return e; + if (element.hasExtension()) { + for (Extension e : element.getExtension()) { + if (name.equals(e.getUrl())) + return e; + } } return null; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/MarkdownType.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/MarkdownType.java index b632ebfc9..2e0463520 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/MarkdownType.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/MarkdownType.java @@ -79,4 +79,9 @@ public class MarkdownType extends StringType implements Comparable return "markdown"; } + @Override + public boolean isTranslatable() { + return true; + } + } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StringType.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StringType.java index 63a9e6186..3a1f86934 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StringType.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StringType.java @@ -99,15 +99,8 @@ public class StringType extends PrimitiveType { return "string"; } - public String getTranslation(String l) throws FHIRException { - for (Extension e : getExtension()) { - if (e.getUrl().equals(ToolingExtensions.EXT_TRANSLATION)) { - String lang = ToolingExtensions.readStringExtension(e, "lang"); - if (lang.equals(l)) - return e.getExtensionString("content"); - } - } - return null; + @Override + public boolean isTranslatable() { + return true; } - } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StructureDefinition.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StructureDefinition.java index 4705cbab3..7f659bc4d 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StructureDefinition.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/StructureDefinition.java @@ -1499,6 +1499,34 @@ public class StructureDefinition extends CanonicalResource { } +//added from java-adornments.txt: + + public ElementDefinition getElementByPath(String path) { + if (path == null) { + return null; + } + for (ElementDefinition ed : getElement()) { + if (path.equals(ed.getPath()) || (path+"[x]").equals(ed.getPath())) { + return ed; + } + } + return null; + } + + + public ElementDefinition getElementById(String id) { + if (id == null) { + return null; + } + for (ElementDefinition ed : getElement()) { + if (id.equals(ed.getId())) { + return ed; + } + } + return null; + } + +//end addition } /** diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ValueSet.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ValueSet.java index 7b1f724cd..3f7c72a7b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ValueSet.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ValueSet.java @@ -1150,6 +1150,15 @@ public class ValueSet extends MetadataResource { } + public boolean hasConcept(String code) { + for (ConceptReferenceComponent c : getConcept()) { + if (code.equals(c.getCode())) { + return true; + } + } + return false; + } + } @Block() diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ActorDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ActorDefinitionRenderer.java index 8eb8629c1..f53ae08b9 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ActorDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ActorDefinitionRenderer.java @@ -33,13 +33,13 @@ public class ActorDefinitionRenderer extends ResourceRenderer { public boolean render(XhtmlNode x, ActorDefinition acd) throws FHIRFormatError, DefinitionException, IOException { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Actor: "+acd.getName()); + tr.td().b().tx(/*!#*/"Actor: "+acd.getName()); tr.td().tx(acd.getTitle()); - tr.td().tx("Type: " + acd.getType().toCode()); + tr.td().tx(/*!#*/"Type: " + acd.getType().toCode()); XhtmlNode td = tbl.tr().td().colspan("3"); addMarkdown(td, acd.getDocumentation()); if (acd.hasReference()) { - tbl.tr().td().tx("References:"); + tbl.tr().td().tx(/*!#*/"References:"); td = tr.td().colspan("2"); boolean first = true; for (UrlType t : acd.getReference()) { @@ -48,7 +48,7 @@ public class ActorDefinitionRenderer extends ResourceRenderer { } } if (acd.hasCapabilities()) { - tbl.tr().td().tx("Capabilities:"); + tbl.tr().td().tx(/*!#*/"Capabilities:"); td = tr.td().colspan("2"); CapabilityStatement cs = context.getWorker().fetchResource(CapabilityStatement.class, acd.getCapabilities(), acd); if (cs != null) { @@ -58,7 +58,7 @@ public class ActorDefinitionRenderer extends ResourceRenderer { } } if (acd.hasDerivedFrom()) { - tbl.tr().td().tx("Derived from:"); + tbl.tr().td().tx(/*!#*/"Derived from:"); td = tr.td().colspan("2"); boolean first = true; for (UrlType t : acd.getReference()) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java index ee08c40aa..5c97b45cc 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java @@ -231,16 +231,16 @@ public class AdditionalBindingsRenderer { XhtmlNode tr = new XhtmlNode(NodeType.Element, "tr"); children.add(tr); - tr.td().style("font-size: 11px").b().tx("Additional Bindings"); - tr.td().style("font-size: 11px").tx("Purpose"); + tr.td().style("font-size: 11px").b().tx(/*!#*/"Additional Bindings"); + tr.td().style("font-size: 11px").tx(/*!#*/"Purpose"); if (usage) { - tr.td().style("font-size: 11px").tx("Usage"); + tr.td().style("font-size: 11px").tx(/*!#*/"Usage"); } if (any) { - tr.td().style("font-size: 11px").tx("Any"); + tr.td().style("font-size: 11px").tx(/*!#*/"Any"); } if (doco) { - tr.td().style("font-size: 11px").tx("Documentation"); + tr.td().style("font-size: 11px").tx(/*!#*/"Documentation"); } for (AdditionalBindingDetail binding : bindings) { tr = new XhtmlNode(NodeType.Element, "tr"); @@ -296,8 +296,8 @@ public class AdditionalBindingsRenderer { } } if (any) { - String newRepeat = binding.any ? "Any repeats" : "All repeats"; - String oldRepeat = binding.compare!=null && binding.compare.any ? "Any repeats" : "All repeats"; + String newRepeat = binding.any ? /*!#*/"Any repeats" : /*!#*/"All repeats"; + String oldRepeat = binding.compare!=null && binding.compare.any ? /*!#*/"Any repeats" : /*!#*/"All repeats"; compareString(tr.td().style("font-size: 11px"), newRepeat, oldRepeat); } if (doco) { @@ -338,54 +338,54 @@ public class AdditionalBindingsRenderer { boolean r5 = context == null || context.getWorker() == null ? false : VersionUtilities.isR5Plus(context.getWorker().getVersion()); switch (purpose) { case "maximum": - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-maximum" : corePath+"extension-elementdefinition-maxvalueset.html", "A required binding, for use when the binding strength is 'extensible' or 'preferred'").tx("Max Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-maximum" : corePath+"extension-elementdefinition-maxvalueset.html", /*!#*/"A required binding, for use when the binding strength is 'extensible' or 'preferred'").tx(/*!#*/"Max Binding"); break; case "minimum": - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-minimum" : corePath+"extension-elementdefinition-minvalueset.html", "The minimum allowable value set - any conformant system SHALL support all these codes").tx("Min Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-minimum" : corePath+"extension-elementdefinition-minvalueset.html", /*!#*/"The minimum allowable value set - any conformant system SHALL support all these codes").tx(/*!#*/"Min Binding"); break; case "required" : - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-required" : corePath+"terminologies.html#strength", "Validators will check this binding (strength = required)").tx("Required Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-required" : corePath+"terminologies.html#strength", /*!#*/"Validators will check this binding (strength = required)").tx(/*!#*/"Required Binding"); break; case "extensible" : - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-extensible" : corePath+"terminologies.html#strength", "Validators will check this binding (strength = extensible)").tx("Extensible Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-extensible" : corePath+"terminologies.html#strength", /*!#*/"Validators will check this binding (strength = extensible)").tx(/*!#*/"Extensible Binding"); break; case "current" : if (r5) { - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-current" : corePath+"terminologies.html#strength", "New records are required to use this value set, but legacy records may use other codes").tx("Current Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-current" : corePath+"terminologies.html#strength", /*!#*/"New records are required to use this value set, but legacy records may use other codes").tx(/*!#*/"Current Binding"); } else { - td.span(null, "New records are required to use this value set, but legacy records may use other codes").tx("Required"); + td.span(null, /*!#*/"New records are required to use this value set, but legacy records may use other codes").tx(/*!#*/"Required"); } break; case "preferred" : if (r5) { - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-preferred" : corePath+"terminologies.html#strength", "This is the value set that is recommended (documentation should explain why)").tx("Preferred Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-preferred" : corePath+"terminologies.html#strength", /*!#*/"This is the value set that is recommended (documentation should explain why)").tx(/*!#*/"Preferred Binding"); } else { - td.span(null, "This is the value set that is recommended (documentation should explain why)").tx("Recommended"); + td.span(null, /*!#*/"This is the value set that is recommended (documentation should explain why)").tx(/*!#*/"Recommended"); } break; case "ui" : if (r5) { - td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-ui" : corePath+"terminologies.html#strength", "This value set is provided to user look up in a given context").tx("UI Binding"); + td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-ui" : corePath+"terminologies.html#strength", /*!#*/"This value set is provided to user look up in a given context").tx(/*!#*/"UI Binding"); } else { - td.span(null, "This value set is provided to user look up in a given context").tx("UI"); + td.span(null, /*!#*/"This value set is provided to user look up in a given context").tx(/*!#*/"UI"); } break; case "starter" : if (r5) { td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-starter" : corePath+"terminologies.html#strength", "This value set is a good set of codes to start with when designing your system").tx("Starter Set"); } else { - td.span(null, "This value set is a good set of codes to start with when designing your system").tx("Starter"); + td.span(null, /*!#*/"This value set is a good set of codes to start with when designing your system").tx(/*!#*/"Starter"); } break; case "component" : if (r5) { td.ah(r5 ? corePath+"valueset-additional-binding-purpose.html#additional-binding-purpose-component" : corePath+"terminologies.html#strength", "This value set is a component of the base value set").tx("Component"); } else { - td.span(null, "This value set is a component of the base value set").tx("Component"); + td.span(null, /*!#*/"This value set is a component of the base value set").tx(/*!#*/"Component"); } break; default: - td.span(null, "Unknown code for purpose").tx(purpose); + td.span(null, /*!#*/"Unknown code for purpose").tx(purpose); } } @@ -430,7 +430,7 @@ public class AdditionalBindingsRenderer { children.tx(" ("); boolean ffirst = !b.getAny(); if (b.getAny()) { - children.tx("any repeat"); + children.tx(/*!#*/"any repeat"); } for (UsageContext uc : b.getUsage()) { if (ffirst) ffirst = false; else children.tx(","); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BinaryRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BinaryRenderer.java index acff38958..6d538d207 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BinaryRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BinaryRenderer.java @@ -45,7 +45,7 @@ public class BinaryRenderer { public void render(XhtmlNode x, Binary bin) throws IOException { filenames.clear(); if (!bin.hasContentType()) { - error(x, "No Content Type"); + error(x, /*!#*/"No Content Type"); } else if (bin.getContentType().startsWith("image/")) { image(x, bin); } else if (isXml(bin.getContentType())) { @@ -75,7 +75,7 @@ public class BinaryRenderer { } if (ext == null) { - error(x, "The Image Type '"+bin.getContentType()+"' is not rendered in this context"); + error(x, /*!#*/"The Image Type '"+bin.getContentType()+"' is not rendered in this context"); } else { String fn = "Binary-Native-"+bin.getId()+ext; TextFile.bytesToFile(bin.getContent(), Utilities.path(folder, fn)); 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 85c3239ec..f31bbff8a 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 @@ -62,13 +62,13 @@ public class BundleRenderer extends ResourceRenderer { List entries = b.children("entry"); if ("document".equals(b.get("type").primitiveValue())) { if (entries.isEmpty() || (entries.get(0).has("resource") && !"Composition".equals(entries.get(0).get("resource").fhirType()))) - throw new FHIRException("Invalid document '"+b.getId()+"' - first entry is not a Composition ('"+entries.get(0).get("resource").fhirType()+"')"); + throw new FHIRException(/*!#*/"Invalid document '"+b.getId()+"' - first entry is not a Composition ('"+entries.get(0).get("resource").fhirType()+"')"); return renderDocument(x, b, entries); } else if ("collection".equals(b.get("type").primitiveValue()) && allEntriesAreHistoryProvenance(entries)) { // nothing } else { XhtmlNode root = new XhtmlNode(NodeType.Element, "div"); - root.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.get("type").primitiveValue())); + root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.get("type").primitiveValue())); int i = 0; for (BaseWrapper be : entries) { i++; @@ -85,9 +85,9 @@ public class BundleRenderer extends ResourceRenderer { } root.hr(); if (be.has("fullUrl")) { - root.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.get("fullUrl").primitiveValue())); + root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.get("fullUrl").primitiveValue())); } else { - root.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i))); + root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i))); } // if (be.hasRequest()) // renderRequest(root, be.getRequest()); @@ -96,7 +96,7 @@ public class BundleRenderer extends ResourceRenderer { // if (be.hasResponse()) // renderResponse(root, be.getResponse()); if (be.has("resource")) { - root.para().addText(formatMessage(RENDER_BUNDLE_RESOURCE, be.get("resource").fhirType())); + root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_RESOURCE, be.get("resource").fhirType())); ResourceWrapper rw = be.getChildByName("resource").getAsResource(); XhtmlNode xn = rw.getNarrative(); if (xn == null || xn.isEmpty()) { @@ -106,7 +106,7 @@ public class BundleRenderer extends ResourceRenderer { xn = rr.render(rw); } catch (Exception e) { xn = new XhtmlNode(); - xn.para().b().tx("Exception generating narrative: "+e.getMessage()); + xn.para().b().tx(/*!#*/"Exception generating narrative: "+e.getMessage()); } } root.blockquote().para().addChildren(xn); @@ -280,15 +280,15 @@ public class BundleRenderer extends ResourceRenderer { 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"); + 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())); + x.h2().addText(formatMessage(RenderingContext.RENDER_BUNDLE_DOCUMENT_CONTENT, b.getId(), b.getType().toCode())); } else { - x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.getType().toCode())); + x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ROOT, b.getId(), b.getType().toCode())); } int i = 0; for (BundleEntryComponent be : b.getEntry()) { @@ -307,17 +307,17 @@ public class BundleRenderer extends ResourceRenderer { 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())); + x.para().addText(formatMessage(RenderingContext.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())); + x.para().addText(formatMessage(RenderingContext.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())); + x.para().addText(formatMessage(RenderingContext.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())); + x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ENTRY_URL, Integer.toString(i), be.getFullUrl())); } else { - x.para().addText(formatMessage(RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i))); + x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_HEADER_ENTRY, Integer.toString(i))); } if (be.hasRequest()) renderRequest(x, be.getRequest()); @@ -328,7 +328,7 @@ public class BundleRenderer extends ResourceRenderer { } if (be.hasResource()) { if (!docMode) { - x.para().addText(formatMessage(RENDER_BUNDLE_RESOURCE, be.getResource().fhirType())); + x.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_RESOURCE, be.getResource().fhirType())); } if (be.hasResource()) { XhtmlNode xn = null; @@ -342,7 +342,7 @@ public class BundleRenderer extends ResourceRenderer { rr.setRcontext(new ResourceContext(rcontext, be.getResource())); xn = rr.build(be.getResource()); } catch (Exception e) { - xn = makeExceptionXhtml(e, "generating narrative"); + xn = makeExceptionXhtml(e, /*!#*/"generating narrative"); } } x.blockquote().para().getChildNodes().addAll(checkInternalLinks(b, xn.getChildNodes())); @@ -401,42 +401,42 @@ public class BundleRenderer extends ResourceRenderer { private void renderSearch(XhtmlNode root, BundleEntrySearchComponent search) { StringBuilder b = new StringBuilder(); - b.append(formatMessage(RENDER_BUNDLE_SEARCH)); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_SEARCH)); if (search.hasMode()) - b.append(formatMessage(RENDER_BUNDLE_SEARCH_MODE, search.getMode().toCode())); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_SEARCH_MODE, search.getMode().toCode())); if (search.hasScore()) { if (search.hasMode()) b.append(","); - b.append(formatMessage(RENDER_BUNDLE_SEARCH_SCORE, search.getScore())); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_SEARCH_SCORE, search.getScore())); } root.para().addText(b.toString()); } private void renderResponse(XhtmlNode root, BundleEntryResponseComponent response) { - root.para().addText(formatMessage(RENDER_BUNDLE_RESPONSE)); + root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_RESPONSE)); StringBuilder b = new StringBuilder(); b.append(response.getStatus()+"\r\n"); if (response.hasLocation()) - b.append(formatMessage(RENDER_BUNDLE_LOCATION, response.getLocation())+"\r\n"); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_LOCATION, response.getLocation())+"\r\n"); if (response.hasEtag()) - b.append(formatMessage(RENDER_BUNDLE_ETAG, response.getEtag())+"\r\n"); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_ETAG, response.getEtag())+"\r\n"); if (response.hasLastModified()) - b.append(formatMessage(RENDER_BUNDLE_LAST_MOD, response.getEtag())+"\r\n"); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_LAST_MOD, response.getEtag())+"\r\n"); root.pre().addText(b.toString()); } private void renderRequest(XhtmlNode root, BundleEntryRequestComponent request) { - root.para().addText(formatMessage(RENDER_BUNDLE_REQUEST)); + root.para().addText(formatMessage(RenderingContext.RENDER_BUNDLE_REQUEST)); StringBuilder b = new StringBuilder(); b.append(request.getMethod()+" "+request.getUrl()+"\r\n"); if (request.hasIfNoneMatch()) - b.append(formatMessage(RENDER_BUNDLE_IF_NON_MATCH, request.getIfNoneMatch())+"\r\n"); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_IF_NON_MATCH, request.getIfNoneMatch())+"\r\n"); if (request.hasIfModifiedSince()) - b.append(formatMessage(RENDER_BUNDLE_IF_MOD, request.getIfModifiedSince())+"\r\n"); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_IF_MOD, request.getIfModifiedSince())+"\r\n"); if (request.hasIfMatch()) - b.append(formatMessage(RENDER_BUNDLE_IF_MATCH, request.getIfMatch())+"\r\n"); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_IF_MATCH, request.getIfMatch())+"\r\n"); if (request.hasIfNoneExist()) - b.append(formatMessage(RENDER_BUNDLE_IF_NONE, request.getIfNoneExist())+"\r\n"); + b.append(formatMessage(RenderingContext.RENDER_BUNDLE_IF_NONE, request.getIfNoneExist())+"\r\n"); root.pre().addText(b.toString()); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CapabilityStatementRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CapabilityStatementRenderer.java index 7099922e4..592258de2 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CapabilityStatementRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CapabilityStatementRenderer.java @@ -700,26 +700,26 @@ public class CapabilityStatementRenderer extends ResourceRenderer { private void addSummaryTable(XhtmlNode x, CapabilityStatement.CapabilityStatementRestComponent rest, boolean hasVRead, boolean hasPatch, boolean hasDelete, boolean hasHistory, boolean hasUpdates, int count) throws IOException { XhtmlNode t = x.div().attribute("class","table-responsive").table("table table-condensed table-hover"); XhtmlNode tr = t.addTag("thead").tr(); - tr.th().b().tx("Resource Type"); - tr.th().b().tx("Profile"); - tr.th().attribute("class", "text-center").b().attribute("title", "GET a resource (read interaction)").tx("R"); + tr.th().b().tx(/*!#*/"Resource Type"); + tr.th().b().tx(/*!#*/"Profile"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET a resource (read interaction)").tx("R"); if (hasVRead) - tr.th().attribute("class", "text-center").b().attribute("title", "GET past versions of resources (vread interaction)").tx("V-R"); - tr.th().attribute("class", "text-center").b().attribute("title", "GET all set of resources of the type (search interaction)").tx("S"); - tr.th().attribute("class", "text-center").b().attribute("title", "PUT a new resource version (update interaction)").tx("U"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET past versions of resources (vread interaction)").tx("V-R"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET all set of resources of the type (search interaction)").tx("S"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"PUT a new resource version (update interaction)").tx("U"); if (hasPatch) - tr.th().attribute("class", "text-center").b().attribute("title", "PATCH a new resource version (patch interaction)").tx("P"); - tr.th().attribute("class", "text-center").b().attribute("title", "POST a new resource (create interaction)").tx("C"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"PATCH a new resource version (patch interaction)").tx("P"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"POST a new resource (create interaction)").tx("C"); if (hasDelete) - tr.th().attribute("class", "text-center").b().attribute("title", "DELETE a resource (delete interaction)").tx("D"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"DELETE a resource (delete interaction)").tx("D"); if (hasUpdates) - tr.th().attribute("class", "text-center").b().attribute("title", "GET changes to a resource (history interaction on instance)").tx("H-I"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET changes to a resource (history interaction on instance)").tx("H-I"); if (hasHistory) - tr.th().attribute("class", "text-center").b().attribute("title", "GET changes for all resources of the type (history interaction on type)").tx("H-T"); - tr.th().b().attribute("title", "Required and recommended search parameters").tx("Searches"); + tr.th().attribute("class", "text-center").b().attribute("title", /*!#*/"GET changes for all resources of the type (history interaction on type)").tx("H-T"); + tr.th().b().attribute("title", /*!#*/"Required and recommended search parameters").tx(/*!#*/"Searches"); tr.th().code().b().tx("_include"); tr.th().code().b().tx("_revinclude"); - tr.th().b().tx("Operations"); + tr.th().b().tx(/*!#*/"Operations"); XhtmlNode tbody = t.addTag("tbody"); XhtmlNode profCell = null; @@ -744,12 +744,12 @@ public class CapabilityStatementRenderer extends ResourceRenderer { //profCell.ah(r.getProfile()).addText(r.getProfile()); if (hasSupProf) { profCell.br(); - profCell.addTag("em").addText("Additional supported profiles:"); + profCell.addTag("em").addText(/*!#*/"Additional supported profiles:"); renderSupportedProfiles(profCell, r); } } else { //Case of only supported profiles - profCell.addText("Supported profiles:"); + profCell.addText(/*!#*/"Supported profiles:"); renderSupportedProfiles(profCell, r); } //Show capabilities @@ -809,17 +809,17 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } if (r.hasExtension(ToolingExtensions.EXT_PROFILE_MAPPING)) { profCell.br(); - profCell.b().tx("Profile Mapping"); + profCell.b().tx(/*!#*/"Profile Mapping"); XhtmlNode tbl = profCell.table("grid"); boolean doco = false; for (Extension ext : r.getExtensionsByUrl(ToolingExtensions.EXT_PROFILE_MAPPING)) { doco = doco || ext.hasExtension("documentation"); } XhtmlNode tr = tbl.tr(); - tr.th().tx("Criteria"); - tr.th().tx("Profile"); + tr.th().tx(/*!#*/"Criteria"); + tr.th().tx(/*!#*/"Profile"); if (doco) { - tr.th().tx("Criteria"); + tr.th().tx(/*!#*/"Criteria"); } for (Extension ext : r.getExtensionsByUrl(ToolingExtensions.EXT_PROFILE_MAPPING)) { tr = tbl.tr(); @@ -936,7 +936,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } else { panelHead = panel.div().attribute("class", "panel-heading").h(nextLevel,r.getType() + countString).attribute("class", "panel-title"); - panelHead.span("float: right;","").addText("Resource Conformance: " + getResourceExpectation(r)); + panelHead.span("float: right;","").addText(/*!#*/"Resource Conformance: " + getResourceExpectation(r)); panelHead.addText(r.getType()); body = panel.div().attribute("class", "panel-body").div().attribute("class", "container"); } @@ -950,17 +950,17 @@ public class CapabilityStatementRenderer extends ResourceRenderer { String refPolicyWidth = "col-lg-3"; if (!Utilities.noString(text)) { cell = row.div().attribute("class", "col-lg-6"); - addLead(cell,"Base System Profile"); + addLead(cell,/*!#*/"Base System Profile"); cell.br(); addResourceLink(cell, text, text); cell=row.div().attribute("class", "col-lg-3"); - addLead(cell, "Profile Conformance"); + addLead(cell, /*!#*/"Profile Conformance"); cell.br(); cell.b().addText(getProfileExpectation(r.getProfileElement())); } else { //No profile, use FHIR Core Resource cell = row.div().attribute("class", "col-lg-4"); - addLead(cell,"Core FHIR Resource"); + addLead(cell,/*!#*/"Core FHIR Resource"); cell.br(); cell.ah(currentFhirBase + r.getType().toLowerCase() + ".html").addText(r.getType()); pullInteraction = true; @@ -968,7 +968,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } cell = row.div().attribute("class", refPolicyWidth); - addLead(cell,"Reference Policy"); + addLead(cell,/*!#*/"Reference Policy"); cell.br(); addSeparatedListOfCodes(cell, getReferencePolicyStrings(r.getReferencePolicy()) , ","); if (pullInteraction) { @@ -979,7 +979,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { if (supportedProfiles.size() > 0) { row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-6"); - addLead(cell,"Supported Profiles"); + addLead(cell,/*!#*/"Supported Profiles"); XhtmlNode para = cell.para(); boolean first = true; for (CanonicalType c : supportedProfiles) { @@ -1004,7 +1004,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { if (!Utilities.noString(mdText)) { row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-12"); - addLead(cell,"Documentation"); + addLead(cell,/*!#*/"Documentation"); addMarkdown(cell.blockquote(), mdText); } @@ -1028,12 +1028,12 @@ public class CapabilityStatementRenderer extends ResourceRenderer { XhtmlNode tr; row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-12"); - addLead(cell,"Extended Operations"); + addLead(cell,/*!#*/"Extended Operations"); table = cell.table("table table-condensed table-hover"); tr = table.addTag("thead").tr(); - tr.th().addText("Conformance"); - tr.th().addText("Operation"); - tr.th().addText("Documentation"); + tr.th().addText(/*!#*/"Conformance"); + tr.th().addText(/*!#*/"Operation"); + tr.th().addText(/*!#*/"Documentation"); tbody = table.addTag("tbody"); addOps(tbody, map, "supported"); addOps(tbody, map, "SHALL"); @@ -1089,7 +1089,7 @@ public class CapabilityStatementRenderer extends ResourceRenderer { } } XhtmlNode cell = row.div().attribute("class", widthString); - addLead(cell, "Interaction summary"); + addLead(cell, /*!#*/"Interaction summary"); cell.br(); XhtmlNode ul = cell.ul(); addInteractionSummaryList(ul, "SHALL", shalls); @@ -1154,13 +1154,13 @@ public class CapabilityStatementRenderer extends ResourceRenderer { XhtmlNode tr; row = body.div().attribute("class", "row"); cell = row.div().attribute("class", "col-lg-7"); - addLead(cell,"Search Parameters"); + addLead(cell,/*!#*/"Search Parameters"); table = cell.table("table table-condensed table-hover"); tr = table.addTag("thead").tr(); - tr.th().addText("Conformance"); - tr.th().addText("Parameter"); - tr.th().addText("Type"); - tr.th().addText("Documentation"); + tr.th().addText(/*!#*/"Conformance"); + tr.th().addText(/*!#*/"Parameter"); + tr.th().addText(/*!#*/"Type"); + tr.th().addText(/*!#*/"Documentation"); tbody = table.addTag("tbody"); Map> map = sParams.getIndbyExp(); addIndRows(tbody, map, "supported"); @@ -1170,12 +1170,12 @@ public class CapabilityStatementRenderer extends ResourceRenderer { addIndRows(tbody, map, "SHOULD-NOT"); cell = row.div().attribute("class", "col-lg-5"); if (!isCombinedEmpty(comboMap)) { - addLead(cell,"Combined Search Parameters"); + addLead(cell,/*!#*/"Combined Search Parameters"); table = cell.table("table table-condensed table-hover"); tr = table.addTag("thead").tr(); - tr.th().addText("Conformance"); - tr.th().addText("Parameters"); - tr.th().addText("Types"); + tr.th().addText(/*!#*/"Conformance"); + tr.th().addText(/*!#*/"Parameters"); + tr.th().addText(/*!#*/"Types"); tbody = table.addTag("tbody"); addComboRows(tbody, comboMap, "supported"); addComboRows(tbody, comboMap, "SHALL"); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java index e84e767ac..aa81505f3 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java @@ -11,6 +11,7 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.r5.comparison.VersionComparisonAnnotation; import org.hl7.fhir.r5.model.BooleanType; +import org.hl7.fhir.r5.model.CanonicalResource; import org.hl7.fhir.r5.model.CodeSystem; import org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode; import org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent; @@ -81,13 +82,13 @@ public class CodeSystemRenderer extends TerminologyRenderer { private void generateFilters(XhtmlNode x, CodeSystem cs) { if (cs.hasFilter()) { - x.para().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Filters", getContext().getLang())); + x.para().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTERS)); XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Code", getContext().getLang())); - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Description", getContext().getLang())); - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "operator", getContext().getLang())); - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Value", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTER_CODE)); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTER_DESC)); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTER_OP)); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_FILTER_VALUE)); for (CodeSystemFilterComponent f : cs.getFilter()) { tr = tbl.tr(); renderStatus(f, tr.td()).tx(f.getCode()); @@ -111,20 +112,20 @@ public class CodeSystemRenderer extends TerminologyRenderer { hasDescription = hasDescription || p.hasDescription(); } - x.para().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Properties", getContext().getLang())); - x.para().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "This code system defines the following properties for its concepts", getContext().getLang())); + x.para().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROPS)); + x.para().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROPS_DESC)); XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); if (hasRendered) { - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Name", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_NAME)); } - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Code", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_CODE)); if (hasURI) { - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "URI", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_URI)); } - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Type", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_TYPE)); if (hasDescription) { - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Description", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_PROP_DESC)); } for (PropertyComponent p : cs.getProperty()) { tr = tbl.tr(); @@ -148,32 +149,32 @@ public class CodeSystemRenderer extends TerminologyRenderer { private String sentenceForContent(CodeSystemContentMode mode, CodeSystem cs) { switch (mode) { - case COMPLETE: return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_COMPLETE); - case EXAMPLE: return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_EXAMPLE); - case FRAGMENT: return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_FRAGMENT); - case NOTPRESENT: return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_NOTPRESENT); + case COMPLETE: return formatMessage(I18nConstants.RND_CS_CONTENT_COMPLETE); + case EXAMPLE: return formatMessage(I18nConstants.RND_CS_CONTENT_EXAMPLE); + case FRAGMENT: return formatMessage(I18nConstants.RND_CS_CONTENT_FRAGMENT); + case NOTPRESENT: return formatMessage(I18nConstants.RND_CS_CONTENT_NOTPRESENT); case SUPPLEMENT: boolean properties = CodeSystemUtilities.hasProperties(cs); boolean designations = CodeSystemUtilities.hasDesignations(cs); String features; if (properties && designations) { - features = "displays and properties"; + features = /*!#*/"displays and properties"; } else if (properties) { - features = "properties"; + features = /*!#*/"properties"; } else if (designations) { - features = "displays"; + features = /*!#*/"displays"; } else { - features = "features"; // ? + features = /*!#*/"features"; // ? } - return context.getContext().formatMessage(I18nConstants.RND_CS_CONTENT_SUPPLEMENT, features); + return formatMessage(I18nConstants.RND_CS_CONTENT_SUPPLEMENT, features); default: - throw new FHIRException("Unknown CodeSystemContentMode mode"); + throw new FHIRException(/*!#*/"Unknown CodeSystemContentMode mode"); } } private boolean generateCodeSystemContent(XhtmlNode x, CodeSystem cs, boolean hasExtensions, List maps, boolean props) throws FHIRFormatError, DefinitionException, IOException { if (props) { - x.para().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Concepts", getContext().getLang())); + x.para().b().tx(formatMessage(RenderingContext.RENDER_CODESYSTEM_CONCEPTS)); } XhtmlNode p = x.para(); renderStatus(cs.getUrlElement(), p.param("cs")).code().tx(cs.getUrl()); @@ -233,10 +234,10 @@ public class CodeSystemRenderer extends TerminologyRenderer { } if (langs.size() >= 2) { Collections.sort(langs); - x.para().b().tx("Additional Language Displays"); + x.para().b().tx(/*!#*/"Additional Language Displays"); t = x.table("codes"); XhtmlNode tr = t.tr(); - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String lang : langs) tr.td().b().addText(describeLang(lang)); for (ConceptDefinitionComponent c : cs.getConcept()) { @@ -249,11 +250,11 @@ public class CodeSystemRenderer extends TerminologyRenderer { private void makeHierarchyParam(XhtmlNode x, CodeSystem cs, Enumeration hm) { if (hm.hasValue()) { String s = hm.getValue().getDisplay(); - renderStatus(hm, x).tx(" in a "+s+" heirarchy"); + renderStatus(hm, x).tx(" "+/*!#*/"in a "+s+" heirarchy"); } else if (VersionComparisonAnnotation.hasDeleted(cs, "hierarchyMeaning")) { makeHierarchyParam(x, null, (Enumeration) VersionComparisonAnnotation.getDeleted(cs, "hierarchyMeaning").get(0)); } else if (CodeSystemUtilities.hasHierarchy(cs)) { - x.tx(" in an undefined heirarchy"); + x.tx(" "+/*!#*/"in an undefined heirarchy"); } else { x.tx(""); } @@ -284,7 +285,7 @@ public class CodeSystemRenderer extends TerminologyRenderer { private void addCopyColumn(XhtmlNode tr) { if (context.isCopyButton()) { - tr.td().b().tx("Copy"); + tr.td().b().tx(/*!#*/"Copy"); } } @@ -462,11 +463,11 @@ public class CodeSystemRenderer extends TerminologyRenderer { td = tr.td(); Boolean b = CodeSystemUtilities.isDeprecated(cs, c, false); if (b != null && b) { - smartAddText(td, getContext().getWorker().translator().translate("xhtml-gen-cs", "Deprecated", getContext().getLang())); + smartAddText(td, formatMessage(RenderingContext.RENDER_CODESYSTEM_DEPRECATED)); hasExtensions = true; if (ToolingExtensions.hasExtension(c, ToolingExtensions.EXT_REPLACED_BY)) { Coding cc = (Coding) ToolingExtensions.getExtension(c, ToolingExtensions.EXT_REPLACED_BY).getValue(); - td.tx(" (replaced by "); + td.tx(" "+/*!#*/"(replaced by "); String url = getCodingReference(cc, system); if (url != null) { td.ah(url).addText(cc.getCode()); @@ -539,8 +540,15 @@ public class CodeSystemRenderer extends TerminologyRenderer { if (first) first = false; else td.addText(", "); if (pcv.hasValueCoding()) { td.addText(pcv.getValueCoding().getCode()); - } else if (pcv.hasValueStringType() && Utilities.isAbsoluteUrlLinkable(pcv.getValue().primitiveValue())) { - td.ah(pcv.getValue().primitiveValue()).tx(pcv.getValue().primitiveValue()); + } else if (pcv.hasValueStringType() && Utilities.isAbsoluteUrl(pcv.getValue().primitiveValue())) { + CanonicalResource cr = (CanonicalResource) context.getContext().fetchResource(Resource.class, pcv.getValue().primitiveValue()); + if (cr != null) { + td.ah(cr.getWebPath(), cr.getVersionedUrl()).tx(cr.present()); + } else if (Utilities.isAbsoluteUrlLinkable(pcv.getValue().primitiveValue())) { + td.ah(pcv.getValue().primitiveValue()).tx(pcv.getValue().primitiveValue()); + } else { + td.code(pcv.getValue().primitiveValue()); + } } else if ("parent".equals(pcv.getCode())) { td.ah("#"+cs.getId()+"-"+Utilities.nmtokenize(pcv.getValue().primitiveValue())).addText(pcv.getValue().primitiveValue()); } else { @@ -598,9 +606,9 @@ public class CodeSystemRenderer extends TerminologyRenderer { } if (context.isCopyButton()) { td = tr.td(); - clipboard(td, "icon_clipboard_x.png", "XML", "\n"+(cs.getVersionNeeded() ? "\n" : "")+"\n\n"); + clipboard(td, "icon_clipboard_x.png", /*!#*/"XML", "\n"+(cs.getVersionNeeded() ? "\n" : "")+"\n\n"); td.nbsp(); - clipboard(td, "icon_clipboard_j.png", "JSON", "\"system\" : \""+Utilities.escapeXml(cs.getUrl())+"\",\n"+(cs.getVersionNeeded() ? "\"version\" : \""+Utilities.escapeXml(cs.getVersion())+"\",\n" : "")+"\"code\" : \""+Utilities.escapeXml(c.getCode())+"\",\n\"display\" : \""+Utilities.escapeXml(c.getDisplay())+"\"\n"); + clipboard(td, "icon_clipboard_j.png", /*!#*/"JSON", "\"system\" : \""+Utilities.escapeXml(cs.getUrl())+"\",\n"+(cs.getVersionNeeded() ? "\"version\" : \""+Utilities.escapeXml(cs.getVersion())+"\",\n" : "")+"\"code\" : \""+Utilities.escapeXml(c.getCode())+"\",\n\"display\" : \""+Utilities.escapeXml(c.getDisplay())+"\"\n"); } return hasExtensions; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java index c6ab07684..6f3e88317 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java @@ -1,6 +1,9 @@ package org.hl7.fhir.r5.renderers; import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -9,8 +12,10 @@ import java.util.Map; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.r5.model.CodeSystem; +import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.ConceptMap; import org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent; +import org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode; import org.hl7.fhir.r5.model.ConceptMap.MappingPropertyComponent; import org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent; import org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent; @@ -22,11 +27,255 @@ import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.renderers.utils.RenderingContext; import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext; import org.hl7.fhir.r5.utils.ToolingExtensions; +import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.xhtml.NodeType; import org.hl7.fhir.utilities.xhtml.XhtmlNode; public class ConceptMapRenderer extends TerminologyRenderer { + public enum RenderMultiRowSortPolicy { + UNSORTED, FIRST_COL, LAST_COL + + } + + public interface IMultiMapRendererAdvisor { + public List getMembers(String uri); + public boolean describeMap(ConceptMap map, XhtmlNode x); + public String getLink(String system, String code); + } + + public static class MultipleMappingRowSorter implements Comparator { + + private boolean first; + + protected MultipleMappingRowSorter(boolean first) { + super(); + this.first = first; + } + + @Override + public int compare(MultipleMappingRow o1, MultipleMappingRow o2) { + String s1 = first ? o1.firstCode() : o1.lastCode(); + String s2 = first ? o2.firstCode() : o2.lastCode(); + return s1.compareTo(s2); + } + } + + public static class Cell { + + private String system; + private String code; + private String display; + private String relationship; + private String relComment; + public boolean renderedRel; + public boolean renderedCode; + private Cell clone; + + protected Cell() { + super(); + } + + public Cell(String system, String code, String display) { + this.system = system; + this.code = code; + this.display = display; + } + + public Cell(String system, String code, String relationship, String comment) { + this.system = system; + this.code = code; + this.relationship = relationship; + this.relComment = comment; + } + + public boolean matches(String system, String code) { + return (system != null && system.equals(this.system)) && (code != null && code.equals(this.code)); + } + + public String present() { + if (system == null) { + return code; + } else { + return code; //+(clone == null ? "" : " (@"+clone.code+")"); + } + } + + public Cell copy(boolean clone) { + Cell res = new Cell(); + res.system = system; + res.code = code; + res.display = display; + res.relationship = relationship; + res.relComment = relComment; + res.renderedRel = renderedRel; + res.renderedCode = renderedCode; + if (clone) { + res.clone = this; + } + return res; + } + + @Override + public String toString() { + return relationship+" "+system + "#" + code + " \"" + display + "\""; + } + + } + + + public static class MultipleMappingRowItem { + List cells = new ArrayList<>(); + + @Override + public String toString() { + CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); + for (Cell cell : cells) { + if (cell.relationship != null) { + b.append(cell.relationship+cell.code); + } else { + b.append(cell.code); + } + } + return b.toString(); + } + } + + public static class MultipleMappingRow { + private List rowSets = new ArrayList<>(); + private MultipleMappingRow stickySource; + + public MultipleMappingRow(int i, String system, String code, String display) { + MultipleMappingRowItem row = new MultipleMappingRowItem(); + rowSets.add(row); + for (int c = 0; c < i; c++) { + row.cells.add(new Cell()); // blank cell spaces + } + row.cells.add(new Cell(system, code, display)); + } + + + public MultipleMappingRow(MultipleMappingRow stickySource) { + this.stickySource = stickySource; + } + + @Override + public String toString() { + CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); + for (MultipleMappingRowItem rowSet : rowSets) { + b.append(""+rowSet.cells.size()); + } + CommaSeparatedStringBuilder b2 = new CommaSeparatedStringBuilder(";"); + for (MultipleMappingRowItem rowSet : rowSets) { + b2.append(rowSet.toString()); + } + return ""+rowSets.size()+" ["+b.toString()+"] ("+b2.toString()+")"; + } + + + public String lastCode() { + MultipleMappingRowItem first = rowSets.get(0); + for (int i = first.cells.size()-1; i >= 0; i--) { + if (first.cells.get(i).code != null) { + return first.cells.get(i).code; + } + } + return ""; + } + + public String firstCode() { + MultipleMappingRowItem first = rowSets.get(0); + for (int i = 0; i < first.cells.size(); i++) { + if (first.cells.get(i).code != null) { + return first.cells.get(i).code; + } + } + return ""; + } + + public void addSource(MultipleMappingRow sourceRow, List rowList, ConceptMapRelationship relationship, String comment) { + // we already have a row, and we're going to collapse the rows on sourceRow into here, and add a matching terminus + assert sourceRow.rowSets.get(0).cells.size() == rowSets.get(0).cells.size()-1; + rowList.remove(sourceRow); + Cell template = rowSets.get(0).cells.get(rowSets.get(0).cells.size()-1); + for (MultipleMappingRowItem row : sourceRow.rowSets) { + row.cells.add(new Cell(template.system, template.code, relationship.getSymbol(), comment)); + } + rowSets.addAll(sourceRow.rowSets); + } + + public void addTerminus() { + for (MultipleMappingRowItem row : rowSets) { + row.cells.add(new Cell(null, null, "X", null)); + } + } + + public void addTarget(String system, String code, ConceptMapRelationship relationship, String comment, List sets, int colCount) { + if (rowSets.get(0).cells.size() == colCount+1) { // if it's already has a target for this col then we have to clone (and split) the rows + for (MultipleMappingRowItem row : rowSets) { + row.cells.add(new Cell(system, code, relationship.getSymbol(), comment)); + } + } else { + MultipleMappingRow nrow = new MultipleMappingRow(this); + for (MultipleMappingRowItem row : rowSets) { + MultipleMappingRowItem n = new MultipleMappingRowItem(); + for (int i = 0; i < row.cells.size()-1; i++) { // note to skip the last + n.cells.add(row.cells.get(i).copy(true)); + } + n.cells.add(new Cell(system, code, relationship.getSymbol(), comment)); + nrow.rowSets.add(n); + } + sets.add(sets.indexOf(this), nrow); + } + } + + public String lastSystem() { + MultipleMappingRowItem first = rowSets.get(0); + for (int i = first.cells.size()-1; i >= 0; i--) { + if (first.cells.get(i).system != null) { + return first.cells.get(i).system; + } + } + return ""; + } + + public void addCopy(String system) { + for (MultipleMappingRowItem row : rowSets) { + row.cells.add(new Cell(system, lastCode(), "=", null)); + } + } + + + public boolean alreadyHasMappings(int i) { + for (MultipleMappingRowItem row : rowSets) { + if (row.cells.size() > i+1) { + return true; + } + } + return false; + } + + + public Cell getLastSource(int i) { + for (MultipleMappingRowItem row : rowSets) { + return row.cells.get(i+1); + } + throw new Error("Should not get here"); // return null + } + + + public void cloneSource(int i, Cell cell) { + MultipleMappingRowItem row = new MultipleMappingRowItem(); + rowSets.add(row); + for (int c = 0; c < i-1; c++) { + row.cells.add(new Cell()); // blank cell spaces + } + row.cells.add(cell.copy(true)); + row.cells.add(rowSets.get(0).cells.get(rowSets.get(0).cells.size()-1).copy(false)); + } + } + public ConceptMapRenderer(RenderingContext context) { super(context); } @@ -45,23 +294,23 @@ public class ConceptMapRenderer extends TerminologyRenderer { } XhtmlNode p = x.para(); - p.tx("Mapping from "); + p.tx(/*!#*/"Mapping from "); if (cm.hasSourceScope()) AddVsRef(cm.getSourceScope().primitiveValue(), p, cm); else - p.tx("(not specified)"); - p.tx(" to "); + p.tx(/*!#*/"(not specified)"); + p.tx(" "+/*!#*/"to "); if (cm.hasTargetScope()) AddVsRef(cm.getTargetScope().primitiveValue(), p, cm); else - p.tx("(not specified)"); + p.tx(/*!#*/"(not specified)"); p = x.para(); if (cm.getExperimental()) - p.addText(Utilities.capitalize(cm.getStatus().toString())+" (not intended for production usage). "); + p.addText(Utilities.capitalize(cm.getStatus().toString())+" "+/*!#*/"(not intended for production usage). "); else p.addText(Utilities.capitalize(cm.getStatus().toString())+". "); - p.tx("Published on "+(cm.hasDate() ? display(cm.getDateElement()) : "?ngen-10?")+" by "+cm.getPublisher()); + p.tx(/*!#*/"Published on "+(cm.hasDate() ? display(cm.getDateElement()) : "?ngen-10?")+" by "+cm.getPublisher()); if (!cm.getContact().isEmpty()) { p.tx(" ("); boolean firsti = true; @@ -131,18 +380,18 @@ public class ConceptMapRenderer extends TerminologyRenderer { x.hr(); } XhtmlNode pp = x.para(); - pp.b().tx("Group "+gc); - pp.tx("Mapping from "); + pp.b().tx(/*!#*/"Group "+gc); + pp.tx(/*!#*/"Mapping from "); if (grp.hasSource()) { renderCanonical(cm, pp, grp.getSource()); } else { - pp.code("unspecified code system"); + pp.code(/*!#*/"unspecified code system"); } pp.tx(" to "); if (grp.hasTarget()) { renderCanonical(cm, pp, grp.getTarget()); } else { - pp.code("unspecified code system"); + pp.code(/*!#*/"unspecified code system"); } String display; @@ -150,11 +399,11 @@ public class ConceptMapRenderer extends TerminologyRenderer { // simple XhtmlNode tbl = x.table( "grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Source Code"); - tr.td().b().tx("Relationship"); - tr.td().b().tx("Target Code"); + tr.td().b().tx(/*!#*/"Source Code"); + tr.td().b().tx(/*!#*/"Relationship"); + tr.td().b().tx(/*!#*/"Target Code"); if (comment) - tr.td().b().tx("Comment"); + tr.td().b().tx(/*!#*/"Comment"); for (SourceElementComponent ccl : grp.getElement()) { tr = tbl.tr(); XhtmlNode td = tr.td(); @@ -201,21 +450,21 @@ public class ConceptMapRenderer extends TerminologyRenderer { XhtmlNode tbl = x.table( "grid"); XhtmlNode tr = tbl.tr(); XhtmlNode td; - tr.td().colspan(Integer.toString(1+sources.size())).b().tx("Source Concept Details"); + tr.td().colspan(Integer.toString(1+sources.size())).b().tx(/*!#*/"Source Concept Details"); if (hasRelationships) { - tr.td().b().tx("Relationship"); + tr.td().b().tx(/*!#*/"Relationship"); } - tr.td().colspan(Integer.toString(1+targets.size())).b().tx("Target Concept Details"); + tr.td().colspan(Integer.toString(1+targets.size())).b().tx(/*!#*/"Target Concept Details"); if (comment) { - tr.td().b().tx("Comment"); + tr.td().b().tx(/*!#*/"Comment"); } - tr.td().colspan(Integer.toString(1+targets.size())).b().tx("Properties"); + tr.td().colspan(Integer.toString(1+targets.size())).b().tx(/*!#*/"Properties"); tr = tbl.tr(); if (sources.get("code").size() == 1) { String url = sources.get("code").iterator().next(); renderCSDetailsLink(tr, url, true); } else - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String s : sources.keySet()) { if (s != null && !s.equals("code")) { if (sources.get(s).size() == 1) { @@ -232,7 +481,7 @@ public class ConceptMapRenderer extends TerminologyRenderer { String url = targets.get("code").iterator().next(); renderCSDetailsLink(tr, url, true); } else - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String s : targets.keySet()) { if (s != null && !s.equals("code")) { if (targets.get(s).size() == 1) { @@ -429,8 +678,8 @@ public class ConceptMapRenderer extends TerminologyRenderer { if (span2) { td.colspan("2"); } - td.b().tx("Codes"); - td.tx(" from "); + td.b().tx(/*!#*/"Codes"); + td.tx(" "+/*!#*/"from "); if (cs == null) td.tx(url); else @@ -475,4 +724,257 @@ public class ConceptMapRenderer extends TerminologyRenderer { return null; } + public static XhtmlNode renderMultipleMaps(String start, String startLink, List maps, IMultiMapRendererAdvisor advisor, RenderMultiRowSortPolicy sort) { + // 1+1 column for each provided map + List rowSets = new ArrayList<>(); + for (int i = 0; i < maps.size(); i++) { + populateRows(rowSets, maps.get(i), i, advisor); + } + collateRows(rowSets); + if (sort != RenderMultiRowSortPolicy.UNSORTED) { + Collections.sort(rowSets, new MultipleMappingRowSorter(sort == RenderMultiRowSortPolicy.FIRST_COL)); + } + XhtmlNode div = new XhtmlNode(NodeType.Element, "div"); + XhtmlNode tbl = div.table("none").style("text-align: left; border-spacing: 0; padding: 5px"); + XhtmlNode tr = tbl.tr(); + styleCell(tr.td(), false, true, 5).b().ahOrNot(startLink).tx(start); + for (ConceptMap map : maps) { + XhtmlNode td = styleCell(tr.td(), false, true, 5).colspan(2); + if (!advisor.describeMap(map, td)) { + if (map.hasWebPath()) { + td.b().ah(map.getWebPath(), map.getVersionedUrl()).tx(map.present()); + } else { + td.b().tx(map.present()); + } + } + } + for (MultipleMappingRow row : rowSets) { + renderMultiRow(tbl, row, maps, advisor); + } + return div; + } + + private static void collateRows(List rowSets) { + List toDelete = new ArrayList(); + for (MultipleMappingRow rowSet : rowSets) { + MultipleMappingRow tgt = rowSet.stickySource; + while (toDelete.contains(tgt)) { + tgt = tgt.stickySource; + } + if (tgt != null && rowSets.contains(tgt)) { + tgt.rowSets.addAll(rowSet.rowSets); + toDelete.add(rowSet); + } + } + rowSets.removeAll(toDelete); + } + + private static void renderMultiRow(XhtmlNode tbl, MultipleMappingRow rows, List maps, IMultiMapRendererAdvisor advisor) { + int rowCounter = 0; + for (MultipleMappingRowItem row : rows.rowSets) { + XhtmlNode tr = tbl.tr(); + boolean first = true; + int cellCounter = 0; + Cell last = null; + for (Cell cell : row.cells) { + if (first) { + if (!cell.renderedCode) { + int c = 1; + for (int i = rowCounter + 1; i < rows.rowSets.size(); i++) { + if (cell.code != null && rows.rowSets.get(i).cells.size() > cellCounter && cell.code.equals(rows.rowSets.get(i).cells.get(cellCounter).code)) { + rows.rowSets.get(i).cells.get(cellCounter).renderedCode = true; + c++; + } else { + break; + } + } + if (cell.code == null) { + styleCell(tr.td(), rowCounter == 0, true, 5).rowspan(c).style("background-color: #eeeeee"); + } else { + String link = advisor.getLink(cell.system, cell.code); + XhtmlNode x = null; + if (link != null) { + x = styleCell(tr.td(), rowCounter == 0, true, 5).attributeNN("title", cell.display).rowspan(c).ah(link); + } else { + x = styleCell(tr.td(), rowCounter == 0, true, 5).attributeNN("title", cell.display).rowspan(c); + } +// if (cell.clone != null) { +// x.style("color: grey"); +// } + x.tx(cell.present()); + } + } + first = false; + } else { + if (!cell.renderedRel) { + int c = 1; + for (int i = rowCounter + 1; i < rows.rowSets.size(); i++) { + if ((cell.relationship != null && rows.rowSets.get(i).cells.size() > cellCounter && cell.relationship.equals(rows.rowSets.get(i).cells.get(cellCounter).relationship)) && + (cell.code != null && cell.code.equals(rows.rowSets.get(i).cells.get(cellCounter).code)) && + (last.code != null && cell.code.equals(rows.rowSets.get(i).cells.get(cellCounter-1).code))) { + rows.rowSets.get(i).cells.get(cellCounter).renderedRel = true; + c++; + } else { + break; + } + } + if (last.code == null || cell.code == null) { + styleCell(tr.td(), rowCounter == 0, true, 5).style("background-color: #eeeeee"); + } else if (cell.relationship != null) { + styleCell(tr.tdW(16), rowCounter == 0, true, 0).attributeNN("title", cell.relComment).rowspan(c).style("background-color: LightGrey; text-align: center; vertical-align: middle; color: white").tx(cell.relationship); + } else { + styleCell(tr.tdW(16), rowCounter == 0, false, 0).rowspan(c); + } + } + if (!cell.renderedCode) { + int c = 1; + for (int i = rowCounter + 1; i < rows.rowSets.size(); i++) { + if (cell.code != null && rows.rowSets.get(i).cells.size() > cellCounter && cell.code.equals(rows.rowSets.get(i).cells.get(cellCounter).code)) { + rows.rowSets.get(i).cells.get(cellCounter).renderedCode = true; + c++; + } else { + break; + } + } + if (cell.code == null) { + styleCell(tr.td(), rowCounter == 0, true, 5).rowspan(c).style("background-color: #eeeeee"); + } else { + String link = advisor.getLink(cell.system, cell.code); + XhtmlNode x = null; + if (link != null) { + x = styleCell(tr.td(), rowCounter == 0, true, 5).attributeNN("title", cell.display).rowspan(c).ah(link); + } else { + x = styleCell(tr.td(), rowCounter == 0, true, 5).attributeNN("title", cell.display).rowspan(c); + } +// if (cell.clone != null) { +// x.style("color: grey"); +// } + x.tx(cell.present()); + } + } + } + last = cell; + cellCounter++; + } + rowCounter++; + } + } + + private static XhtmlNode styleCell(XhtmlNode td, boolean firstrow, boolean sides, int padding) { + if (firstrow) { + td.style("vertical-align: middle; border-top: 1px solid black; padding: "+padding+"px"); + } else { + td.style("vertical-align: middle; border-top: 1px solid LightGrey; padding: "+padding+"px"); + } + if (sides) { + td.style("border-left: 1px solid LightGrey; border-right: 2px solid LightGrey"); + } + return td; + } + + private static void populateRows(List rowSets, ConceptMap map, int i, IMultiMapRendererAdvisor advisor) { + // if we can resolve the value set, we create entries for it + if (map.hasSourceScope()) { + List codings = advisor.getMembers(map.getSourceScope().primitiveValue()); + if (codings != null) { + for (Coding c : codings) { + MultipleMappingRow row = i == 0 ? null : findExistingRowBySource(rowSets, c.getSystem(), c.getCode(), i); + if (row == null) { + row = new MultipleMappingRow(i, c.getSystem(), c.getCode(), c.getDisplay()); + rowSets.add(row); + } + + } + } + } + + for (ConceptMapGroupComponent grp : map.getGroup()) { + for (SourceElementComponent src : grp.getElement()) { + MultipleMappingRow row = findExistingRowBySource(rowSets, grp.getSource(), src.getCode(), i); + if (row == null) { + row = new MultipleMappingRow(i, grp.getSource(), src.getCode(), src.getDisplay()); + rowSets.add(row); + } + if (src.getNoMap()) { + row.addTerminus(); + } else { + List todo = new ArrayList<>(); + for (TargetElementComponent tgt : src.getTarget()) { + MultipleMappingRow trow = findExistingRowByTarget(rowSets, grp.getTarget(), tgt.getCode(), i); + if (trow == null) { + row.addTarget(grp.getTarget(), tgt.getCode(), tgt.getRelationship(), tgt.getComment(), rowSets, i); + } else { + todo.add(tgt); + } + } + // we've already got a mapping to these targets. So we gather them under the one mapping - but do this after the others are done + for (TargetElementComponent t : todo) { + MultipleMappingRow trow = findExistingRowByTarget(rowSets, grp.getTarget(), t.getCode(), i); + if (row.alreadyHasMappings(i)) { + // src is already mapped, and so is target, and now we need to map src to target too + // we have to clone src, but we only clone the last + trow.cloneSource(i, row.getLastSource(i)); + } else { + trow.addSource(row, rowSets, t.getRelationship(), t.getComment()); + } + } + } + } + boolean copy = grp.hasUnmapped() && grp.getUnmapped().getMode() == ConceptMapGroupUnmappedMode.USESOURCECODE; + if (copy) { + for (MultipleMappingRow row : rowSets) { + if (row.rowSets.get(0).cells.size() == i && row.lastSystem().equals(grp.getSource())) { + row.addCopy(grp.getTarget()); + } + } + } + } + for (MultipleMappingRow row : rowSets) { + if (row.rowSets.get(0).cells.size() == i) { + row.addTerminus(); + } + } + if (map.hasTargetScope()) { + List codings = advisor.getMembers(map.getTargetScope().primitiveValue()); + if (codings != null) { + for (Coding c : codings) { + MultipleMappingRow row = findExistingRowByTarget(rowSets, c.getSystem(), c.getCode(), i); + if (row == null) { + row = new MultipleMappingRow(i+1, c.getSystem(), c.getCode(), c.getDisplay()); + rowSets.add(row); + } else { + for (MultipleMappingRowItem cells : row.rowSets) { + Cell last = cells.cells.get(cells.cells.size() -1); + if (last.system != null && last.system.equals(c.getSystem()) && last.code.equals(c.getCode()) && last.display == null) { + last.display = c.getDisplay(); + } + } + } + } + } + } + + } + + private static MultipleMappingRow findExistingRowByTarget(List rows, String system, String code, int i) { + for (MultipleMappingRow row : rows) { + for (MultipleMappingRowItem cells : row.rowSets) { + if (cells.cells.size() > i + 1 && cells.cells.get(i+1).matches(system, code)) { + return row; + } + } + } + return null; + } + + private static MultipleMappingRow findExistingRowBySource(List rows, String system, String code, int i) { + for (MultipleMappingRow row : rows) { + for (MultipleMappingRowItem cells : row.rowSets) { + if (cells.cells.size() > i && cells.cells.get(i).matches(system, code)) { + return row; + } + } + } + return null; + } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index 79aaf7c90..5ea50fa1a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -159,10 +159,15 @@ public class DataRenderer extends Renderer implements CodeResolver { parts[0] = parts[0].substring(0, parts[0].indexOf(".")); } StructureDefinition p = getContext().getWorker().fetchResource(StructureDefinition.class, parts[0]); - if (p == null) + if (p == null) { p = getContext().getWorker().fetchTypeDefinition(parts[0]); - if (p == null) + } + if (context.getTypeMap().containsKey(parts[0])) { + p = getContext().getWorker().fetchTypeDefinition(context.getTypeMap().get(parts[0])); + } + if (p == null) { p = getContext().getWorker().fetchResource(StructureDefinition.class, link); + } if (p != null) { if ("Extension".equals(p.getType())) { path = null; @@ -175,9 +180,10 @@ public class DataRenderer extends Renderer implements CodeResolver { if (url == null) { url = p.getUserString("filename"); } - } else - throw new DefinitionException("Unable to resolve markdown link "+link); - + } else { + throw new DefinitionException(/*!#*/"Unable to resolve markdown link "+link); + } + text = left+"["+link+"]("+url+(path == null ? "" : "#"+path)+")"+right; } @@ -210,18 +216,18 @@ public class DataRenderer extends Renderer implements CodeResolver { private static String month(String m) { switch (m) { - case "1" : return "Jan"; - case "2" : return "Feb"; - case "3" : return "Mar"; - case "4" : return "Apr"; - case "5" : return "May"; - case "6" : return "Jun"; - case "7" : return "Jul"; - case "8" : return "Aug"; - case "9" : return "Sep"; - case "10" : return "Oct"; - case "11" : return "Nov"; - case "12" : return "Dec"; + case "1" : return /*!#*/"Jan"; + case "2" : return /*!#*/"Feb"; + case "3" : return /*!#*/"Mar"; + case "4" : return/*!#*/ "Apr"; + case "5" : return /*!#*/"May"; + case "6" : return /*!#*/"Jun"; + case "7" : return /*!#*/"Jul"; + case "8" : return /*!#*/"Aug"; + case "9" : return /*!#*/"Sep"; + case "10" : return /*!#*/"Oct"; + case "11" : return /*!#*/"Nov"; + case "12" : return /*!#*/"Dec"; default: return null; } } @@ -241,16 +247,16 @@ public class DataRenderer extends Renderer implements CodeResolver { ed = p[p.length-1]; } switch (ed) { - case "900000000000207008": return "Intl"+dt; - case "731000124108": return "US"+dt; - case "32506021000036107": return "AU"+dt; - case "449081005": return "ES"+dt; - case "554471000005108": return "DK"+dt; - case "11000146104": return "NL"+dt; - case "45991000052106": return "SE"+dt; - case "999000041000000102": return "UK"+dt; - case "20611000087101": return "CA"+dt; - case "11000172109": return "BE"+dt; + case "900000000000207008": return /*!#*/"Intl"+dt; + case "731000124108": return /*!#*/"US"+dt; + case "32506021000036107": return /*!#*/"AU"+dt; + case "449081005": return /*!#*/"ES"+dt; + case "554471000005108": return /*!#*/"DK"+dt; + case "11000146104": return /*!#*/"NL"+dt; + case "45991000052106": return /*!#*/"SE"+dt; + case "999000041000000102": return /*!#*/"UK"+dt; + case "20611000087101": return /*!#*/"CA"+dt; + case "11000172109": return /*!#*/"BE"+dt; default: return "??"+dt; } } else { @@ -260,38 +266,38 @@ public class DataRenderer extends Renderer implements CodeResolver { public static String describeSystem(String system) { if (system == null) - return "[not stated]"; + return /*!#*/"[not stated]"; if (system.equals("http://loinc.org")) - return "LOINC"; + return /*!#*/"LOINC"; if (system.startsWith("http://snomed.info")) - return "SNOMED CT"; + return /*!#*/"SNOMED CT"; if (system.equals("http://www.nlm.nih.gov/research/umls/rxnorm")) - return "RxNorm"; + return /*!#*/"RxNorm"; if (system.equals("http://hl7.org/fhir/sid/icd-9")) - return "ICD-9"; + return /*!#*/"ICD-9"; if (system.equals("http://dicom.nema.org/resources/ontology/DCM")) - return "DICOM"; + return /*!#*/"DICOM"; if (system.equals("http://unitsofmeasure.org")) - return "UCUM"; + return /*!#*/"UCUM"; return system; } public String displaySystem(String system) { if (system == null) - return "[not stated]"; + return /*!#*/"[not stated]"; if (system.equals("http://loinc.org")) - return "LOINC"; + return /*!#*/"LOINC"; if (system.startsWith("http://snomed.info")) - return "SNOMED CT"; + return /*!#*/"SNOMED CT"; if (system.equals("http://www.nlm.nih.gov/research/umls/rxnorm")) - return "RxNorm"; + return /*!#*/"RxNorm"; if (system.equals("http://hl7.org/fhir/sid/icd-9")) - return "ICD-9"; + return /*!#*/"ICD-9"; if (system.equals("http://dicom.nema.org/resources/ontology/DCM")) - return "DICOM"; + return /*!#*/"DICOM"; if (system.equals("http://unitsofmeasure.org")) - return "UCUM"; + return /*!#*/"UCUM"; CodeSystem cs = context.getContext().fetchCodeSystem(system); if (cs != null) { @@ -304,7 +310,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (system.contains("/")) { return system.substring(system.lastIndexOf("/")+1); } else { - return "unknown"; + return /*!#*/"unknown"; } } @@ -335,7 +341,7 @@ public class DataRenderer extends Renderer implements CodeResolver { protected String describeLang(String lang) { // special cases: if ("fr-CA".equals(lang)) { - return "French (Canadian)"; // this one was omitted from the value set + return /*!#*/"French (Canadian)"; // this one was omitted from the value set } ValueSet v = getContext().getWorker().findTxResource(ValueSet.class, "http://hl7.org/fhir/ValueSet/languages"); if (v != null) { @@ -402,10 +408,6 @@ public class DataRenderer extends Renderer implements CodeResolver { // -- 4. Language support ------------------------------------------------------ - protected String translate(String source, String content) { - return content; - } - public String gt(@SuppressWarnings("rawtypes") PrimitiveType value) { return value.primitiveValue(); } @@ -470,7 +472,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } else { // somehow have to do better than this XhtmlNode li = ul.li(); - li.b().tx("WARNING: Unrenderable Modifier Extension!"); + li.b().tx(/*!#*/"WARNING: Unrenderable Modifier Extension!"); } } for (Extension ext : element.getExtension()) { @@ -520,7 +522,7 @@ public class DataRenderer extends Renderer implements CodeResolver { render(div, ext.getValue()); } else { // somehow have to do better than this - div.b().tx("WARNING: Unrenderable Modifier Extension!"); + div.b().tx(/*!#*/"WARNING: Unrenderable Modifier Extension!"); } } for (Extension ext : element.getExtension()) { @@ -551,7 +553,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (b instanceof DataType) { return display((DataType) b); } else { - return "No display for "+b.fhirType(); + return /*!#*/"No display for "+b.fhirType(); } } @@ -587,7 +589,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } else if (type.isPrimitive()) { return type.primitiveValue(); } else { - return "No display for "+type.fhirType(); + return /*!#*/"No display for "+type.fhirType(); } } @@ -669,7 +671,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } public String display(BaseWrapper type) { - return "to do"; + return /*!#*/"to do"; } public void render(XhtmlNode x, BaseWrapper type) throws FHIRFormatError, DefinitionException, IOException { @@ -677,13 +679,13 @@ public class DataRenderer extends Renderer implements CodeResolver { try { base = type.getBase(); } catch (FHIRException | IOException e) { - x.tx("Error: " + e.getMessage()); // this shouldn't happen - it's an error in the library itself + x.tx(/*!#*/"Error: " + e.getMessage()); // this shouldn't happen - it's an error in the library itself return; } if (base instanceof DataType) { render(x, (DataType) base); } else { - x.tx("to do: "+base.fhirType()); + x.tx(/*!#*/"to do: "+base.fhirType()); } } @@ -691,7 +693,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (b instanceof DataType) { render(x, (DataType) b); } else { - x.tx("No display for "+b.fhirType()); + x.tx(/*!#*/"No display for "+b.fhirType()); } } @@ -745,7 +747,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } else if (type.isPrimitive()) { x.tx(type.primitiveValue()); } else { - x.tx("No display for "+type.fhirType()); + x.tx(/*!#*/"No display for "+type.fhirType()); } } @@ -837,7 +839,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } if (a.hasAuthor()) { - b.append("By "); + b.append(/*!#*/"By "); if (a.hasAuthorReference()) { b.append(a.getAuthorReference().getReference()); } else if (a.hasAuthorStringType()) { @@ -1025,7 +1027,7 @@ public class DataRenderer extends Renderer implements CodeResolver { systemName = cs != null ? cs.present() : describeSystem(c.getSystem()); link = getLinkForCode(c.getSystem(), c.getVersion(), c.getCode()); - hint = systemName+": "+display+(c.hasVersion() ? " (version = "+c.getVersion()+")" : ""); + hint = systemName+": "+display+(c.hasVersion() ? " "+/*!#*/"(version = "+c.getVersion()+")" : ""); return new CodeResolution(systemName, systemLink, link, display, hint); } @@ -1060,7 +1062,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.tx(s); } if (c.hasVersion()) { - x.tx(" (version = "+c.getVersion()+")"); + x.tx(" "+/*!#*/"(version = "+c.getVersion()+")"); } } @@ -1075,7 +1077,7 @@ public class DataRenderer extends Renderer implements CodeResolver { s = c.getCode(); if (showCodeDetails) { - x.addText(s+" (Details: "+TerminologyRenderer.describeSystem(c.getSystem())+" code "+c.getCode()+" = '"+lookupCode(c.getSystem(), c.getVersion(), c.getCode())+"', stated as '"+c.getDisplay()+"')"); + x.addText(s+" "+/*!#*/"(Details: "+TerminologyRenderer.describeSystem(c.getSystem())+" code "+c.getCode()+" = '"+lookupCode(c.getSystem(), c.getVersion(), c.getCode())+"', stated as '"+c.getDisplay()+"')"); } else x.span(null, "{"+c.getSystem()+" "+c.getCode()+"}").addText(s); } @@ -1195,25 +1197,31 @@ public class DataRenderer extends Renderer implements CodeResolver { } } - x.span(null, "Codes: "+b.toString()).addText(s); + x.span(null, /*!#*/"Codes: "+b.toString()).addText(s); } } protected String displayIdentifier(Identifier ii) { String s = Utilities.noString(ii.getValue()) ? "?ngen-9?" : ii.getValue(); - NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem()); - if (ns != null) { - s = ns.present()+"#"+s; - } - if (ii.hasType()) { - if (ii.getType().hasText()) - s = ii.getType().getText()+":\u00A0"+s; - else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasDisplay()) - s = ii.getType().getCoding().get(0).getDisplay()+": "+s; - else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasCode()) - s = lookupCode(ii.getType().getCoding().get(0).getSystem(), ii.getType().getCoding().get(0).getVersion(), ii.getType().getCoding().get(0).getCode())+": "+s; - } else { - s = "id:\u00A0"+s; + if ("urn:ietf:rfc:3986".equals(ii.getSystem()) && s.startsWith("urn:oid:")) { + s = "OID:"+s.substring(8); + } else if ("urn:ietf:rfc:3986".equals(ii.getSystem()) && s.startsWith("urn:uuid:")) { + s = "UUID:"+s.substring(9); + } else { + NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem()); + if (ns != null) { + s = ns.present()+"#"+s; + } + if (ii.hasType()) { + if (ii.getType().hasText()) + s = ii.getType().getText()+":\u00A0"+s; + else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasDisplay()) + s = ii.getType().getCoding().get(0).getDisplay()+": "+s; + else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasCode()) + s = lookupCode(ii.getType().getCoding().get(0).getSystem(), ii.getType().getCoding().get(0).getVersion(), ii.getType().getCoding().get(0).getCode())+": "+s; + } else if (ii.hasSystem()) { + s = ii.getSystem()+"#"+s; + } } if (ii.hasUse() || ii.hasPeriod()) { @@ -1234,24 +1242,32 @@ public class DataRenderer extends Renderer implements CodeResolver { protected void renderIdentifier(XhtmlNode x, Identifier ii) { if (ii.hasType()) { - if (ii.getType().hasText()) - x.tx(ii.getType().getText()+":"); - else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasDisplay()) - x.tx(ii.getType().getCoding().get(0).getDisplay()+":"); - else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasCode()) - x.tx(lookupCode(ii.getType().getCoding().get(0).getSystem(), ii.getType().getCoding().get(0).getVersion(), ii.getType().getCoding().get(0).getCode())+":"); - } else { - x.tx("id:"); - } - x.nbsp(); - - NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem()); - if (ns != null) { - if (ns.hasWebPath()) { - x.ah(ns.getWebPath()).tx("#"); - } else { - x.tx(ns.present()+"#"); + if (ii.getType().hasText()) { + x.tx(ii.getType().getText()); + } else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasDisplay()) { + x.tx(ii.getType().getCoding().get(0).getDisplay()); + } else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasCode()) { + x.tx(lookupCode(ii.getType().getCoding().get(0).getSystem(), ii.getType().getCoding().get(0).getVersion(), ii.getType().getCoding().get(0).getCode())); } + x.tx("/"); + } else if (ii.hasSystem()) { + NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem()); + if (ns != null) { + if (ns.hasWebPath()) { + x.ah(ns.getWebPath(), ns.getDescription()).tx(ns.present()); + } else { + x.tx(ns.present()); + } + } else { + switch (ii.getSystem()) { + case "urn:oid:2.51.1.3": + x.ah("https://www.gs1.org/standards/id-keys/gln", /*!#*/"Global Location Number").tx("GLN"); + break; + default: + x.code(ii.getSystem()); + } + } + x.tx("/"); } x.tx(Utilities.noString(ii.getValue()) ? "?ngen-9?" : ii.getValue()); @@ -1259,7 +1275,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.nbsp(); x.tx("("); if (ii.hasUse()) { - x.tx("use:"); + x.tx(/*!#*/"use:"); x.nbsp(); x.tx(ii.getUse().toString()); } @@ -1268,7 +1284,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.nbsp(); } if (ii.hasPeriod()) { - x.tx("period:"); + x.tx(/*!#*/"period:"); x.nbsp(); x.tx(displayPeriod(ii.getPeriod())); } @@ -1391,7 +1407,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } c.code().tx(expr.getExpression()); } else if (expr.hasReference()) { - p.ah(expr.getReference()).tx("source"); + p.ah(expr.getReference()).tx(/*!#*/"source"); } if (expr.hasName() || expr.hasDescription()) { p.tx("("); @@ -1452,9 +1468,9 @@ public class DataRenderer extends Renderer implements CodeResolver { protected void displayContactPoint(XhtmlNode p, ContactPoint c) { if (c != null) { if (c.getSystem() == ContactPointSystem.PHONE) { - p.tx("Phone: "+c.getValue()); + p.tx(/*!#*/"Phone: "+c.getValue()); } else if (c.getSystem() == ContactPointSystem.FAX) { - p.tx("Fax: "+c.getValue()); + p.tx(/*!#*/"Fax: "+c.getValue()); } else if (c.getSystem() == ContactPointSystem.EMAIL) { p.tx(c.getValue()); } else if (c.getSystem() == ContactPointSystem.URL) { @@ -1469,11 +1485,11 @@ public class DataRenderer extends Renderer implements CodeResolver { protected void addTelecom(XhtmlNode p, ContactPoint c) { if (c.getSystem() == ContactPointSystem.PHONE) { - p.tx("Phone: "+c.getValue()); + p.tx(/*!#*/"Phone: "+c.getValue()); } else if (c.getSystem() == ContactPointSystem.FAX) { - p.tx("Fax: "+c.getValue()); + p.tx(/*!#*/"Fax: "+c.getValue()); } else if (c.getSystem() == ContactPointSystem.EMAIL) { - p.ah( "mailto:"+c.getValue()).addText(c.getValue()); + p.ah("mailto:"+c.getValue()).addText(c.getValue()); } else if (c.getSystem() == ContactPointSystem.URL) { if (c.getValue().length() > 30) p.ah(c.getValue()).addText(c.getValue().substring(0, 30)+"..."); @@ -1485,8 +1501,8 @@ public class DataRenderer extends Renderer implements CodeResolver { if (system == null) return ""; switch (system) { - case PHONE: return "ph: "; - case FAX: return "fax: "; + case PHONE: return /*!#*/"ph: "; + case FAX: return /*!#*/"fax: "; default: return ""; } @@ -1524,7 +1540,7 @@ public class DataRenderer extends Renderer implements CodeResolver { x.tx("(unit "+q.getCode()+" from "+q.getSystem()+")"); } if (showCodeDetails && q.hasCode()) { - x.span("background: LightGoldenRodYellow", null).tx(" (Details: "+TerminologyRenderer.describeSystem(q.getSystem())+" code "+q.getCode()+" = '"+lookupCode(q.getSystem(), null, q.getCode())+"')"); + x.span("background: LightGoldenRodYellow", null).tx(" "+/*!#*/"(Details: "+TerminologyRenderer.describeSystem(q.getSystem())+" code "+q.getCode()+" = '"+lookupCode(q.getSystem(), null, q.getCode())+"')"); } } @@ -1568,13 +1584,13 @@ public class DataRenderer extends Renderer implements CodeResolver { public String displayPeriod(Period p) { String s = !p.hasStart() ? "(?)" : displayDateTime(p.getStartElement()); s = s + " --> "; - return s + (!p.hasEnd() ? "(ongoing)" : displayDateTime(p.getEndElement())); + return s + (!p.hasEnd() ? /*!#*/"(ongoing)" : displayDateTime(p.getEndElement())); } public void renderPeriod(XhtmlNode x, Period p) { x.addText(!p.hasStart() ? "??" : displayDateTime(p.getStartElement())); x.tx(" --> "); - x.addText(!p.hasEnd() ? "(ongoing)" : displayDateTime(p.getEndElement())); + x.addText(!p.hasEnd() ? /*!#*/"(ongoing)" : displayDateTime(p.getEndElement())); } public void renderUsageContext(XhtmlNode x, UsageContext u) throws FHIRFormatError, DefinitionException, IOException { @@ -1586,31 +1602,31 @@ public class DataRenderer extends Renderer implements CodeResolver { public void renderTriggerDefinition(XhtmlNode x, TriggerDefinition td) throws FHIRFormatError, DefinitionException, IOException { if (x.isPara()) { - x.b().tx("Type"); + x.b().tx(/*!#*/"Type"); x.tx(": "); x.tx(td.getType().getDisplay()); if (td.hasName()) { x.tx(", "); - x.b().tx("Name"); + x.b().tx(/*!#*/"Name"); x.tx(": "); x.tx(td.getType().getDisplay()); } if (td.hasCode()) { x.tx(", "); - x.b().tx("Code"); + x.b().tx(/*!#*/"Code"); x.tx(": "); renderCodeableConcept(x, td.getCode()); } if (td.hasTiming()) { x.tx(", "); - x.b().tx("Timing"); + x.b().tx(/*!#*/"Timing"); x.tx(": "); render(x, td.getTiming()); } if (td.hasCondition()) { x.tx(", "); - x.b().tx("Condition"); + x.b().tx(/*!#*/"Condition"); x.tx(": "); renderExpression(x, td.getCondition()); } @@ -1618,27 +1634,27 @@ public class DataRenderer extends Renderer implements CodeResolver { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Type"); + tr.td().b().tx(/*!#*/"Type"); tr.td().tx(td.getType().getDisplay()); if (td.hasName()) { tr = tbl.tr(); - tr.td().b().tx("Name"); + tr.td().b().tx(/*!#*/"Name"); tr.td().tx(td.getType().getDisplay()); } if (td.hasCode()) { tr = tbl.tr(); - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); renderCodeableConcept(tr.td(), td.getCode()); } if (td.hasTiming()) { tr = tbl.tr(); - tr.td().b().tx("Timing"); + tr.td().b().tx(/*!#*/"Timing"); render(tr.td(), td.getTiming()); } if (td.hasCondition()) { tr = tbl.tr(); - tr.td().b().tx("Condition"); + tr.td().b().tx(/*!#*/"Condition"); renderExpression(tr.td(), td.getCondition()); } } @@ -1648,7 +1664,7 @@ public class DataRenderer extends Renderer implements CodeResolver { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); XhtmlNode td = tr.td().colspan("2"); - td.b().tx("Type"); + td.b().tx(/*!#*/"Type"); td.tx(": "); StructureDefinition sd = context.getWorker().fetchTypeDefinition(dr.getType().toCode()); if (sd != null && sd.hasWebPath()) { @@ -1673,7 +1689,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (dr.hasSubject()) { tr = tbl.tr(); td = tr.td().colspan("2"); - td.b().tx("Subject"); + td.b().tx(/*!#*/"Subject"); if (dr.hasSubjectReference()) { renderReference(td, dr.getSubjectReference()); } else { @@ -1682,24 +1698,24 @@ public class DataRenderer extends Renderer implements CodeResolver { } if (dr.hasCodeFilter() || dr.hasDateFilter()) { tr = tbl.tr().backgroundColor("#efefef"); - tr.td().tx("Filter"); - tr.td().tx("Value"); + tr.td().tx(/*!#*/"Filter"); + tr.td().tx(/*!#*/"Value"); } for (DataRequirementCodeFilterComponent cf : dr.getCodeFilter()) { tr = tbl.tr(); if (cf.hasPath()) { tr.td().tx(cf.getPath()); } else { - tr.td().tx("Search on " +cf.getSearchParam()); + tr.td().tx(/*!#*/"Search on " +cf.getSearchParam()); } if (cf.hasValueSet()) { td = tr.td(); - td.tx("In ValueSet "); + td.tx(/*!#*/"In ValueSet "); render(td, cf.getValueSetElement()); } else { boolean first = true; td = tr.td(); - td.tx("One of these codes: "); + td.tx(/*!#*/"One of these codes: "); for (Coding c : cf.getCode()) { if (first) first = false; else td.tx(", "); render(td, c); @@ -1711,7 +1727,7 @@ public class DataRenderer extends Renderer implements CodeResolver { if (cf.hasPath()) { tr.td().tx(cf.getPath()); } else { - tr.td().tx("Search on " +cf.getSearchParam()); + tr.td().tx(/*!#*/"Search on " +cf.getSearchParam()); } render(tr.td(), cf.getValue()); } @@ -1719,7 +1735,7 @@ public class DataRenderer extends Renderer implements CodeResolver { tr = tbl.tr(); td = tr.td().colspan("2"); if (dr.hasLimit()) { - td.b().tx("Limit"); + td.b().tx(/*!#*/"Limit"); td.tx(": "); td.tx(dr.getLimit()); if (dr.hasSort()) { @@ -1727,7 +1743,7 @@ public class DataRenderer extends Renderer implements CodeResolver { } } if (dr.hasSort()) { - td.b().tx("Sort"); + td.b().tx(/*!#*/"Sort"); td.tx(": "); boolean first = true; for (DataRequirementSortComponent p : dr.getSort()) { @@ -1743,7 +1759,7 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displayTiming(Timing s) throws FHIRException { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); if (s.hasCode()) - b.append("Code: "+displayCodeableConcept(s.getCode())); + b.append(/*!#*/"Code: "+displayCodeableConcept(s.getCode())); if (s.getEvent().size() > 0) { CommaSeparatedStringBuilder c = new CommaSeparatedStringBuilder(); @@ -1754,17 +1770,17 @@ public class DataRenderer extends Renderer implements CodeResolver { c.append("??"); } } - b.append("Events: "+ c.toString()); + b.append(/*!#*/"Events: "+ c.toString()); } if (s.hasRepeat()) { TimingRepeatComponent rep = s.getRepeat(); if (rep.hasBoundsPeriod() && rep.getBoundsPeriod().hasStart()) - b.append("Starting "+displayDateTime(rep.getBoundsPeriod().getStartElement())); + b.append(/*!#*/"Starting "+displayDateTime(rep.getBoundsPeriod().getStartElement())); if (rep.hasCount()) - b.append("Count "+Integer.toString(rep.getCount())+" times"); + b.append(/*!#*/"Count "+Integer.toString(rep.getCount())+" times"); if (rep.hasDuration()) - b.append("Duration "+rep.getDuration().toPlainString()+displayTimeUnits(rep.getPeriodUnit())); + b.append(/*!#*/"Duration "+rep.getDuration().toPlainString()+displayTimeUnits(rep.getPeriodUnit())); if (rep.hasWhen()) { String st = ""; @@ -1777,14 +1793,14 @@ public class DataRenderer extends Renderer implements CodeResolver { } else { String st = ""; if (!rep.hasFrequency() || (!rep.hasFrequencyMax() && rep.getFrequency() == 1) ) - st = "Once"; + st = /*!#*/"Once"; else { st = Integer.toString(rep.getFrequency()); if (rep.hasFrequencyMax()) st = st + "-"+Integer.toString(rep.getFrequency()); } if (rep.hasPeriod()) { - st = st + " per "+rep.getPeriod().toPlainString(); + st = st + " "+/*!#*/"per "+rep.getPeriod().toPlainString(); if (rep.hasPeriodMax()) st = st + "-"+rep.getPeriodMax().toPlainString(); st = st + " "+displayTimeUnits(rep.getPeriodUnit()); @@ -1792,7 +1808,7 @@ public class DataRenderer extends Renderer implements CodeResolver { b.append(st); } if (rep.hasBoundsPeriod() && rep.getBoundsPeriod().hasEnd()) - b.append("Until "+displayDateTime(rep.getBoundsPeriod().getEndElement())); + b.append(/*!#*/"Until "+displayDateTime(rep.getBoundsPeriod().getEndElement())); } return b.toString(); } @@ -1808,20 +1824,20 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displayEventCode(EventTiming when) { switch (when) { - case C: return "at meals"; - case CD: return "at lunch"; - case CM: return "at breakfast"; - case CV: return "at dinner"; - case AC: return "before meals"; - case ACD: return "before lunch"; - case ACM: return "before breakfast"; - case ACV: return "before dinner"; - case HS: return "before sleeping"; - case PC: return "after meals"; - case PCD: return "after lunch"; - case PCM: return "after breakfast"; - case PCV: return "after dinner"; - case WAKE: return "after waking"; + case C: return /*!#*/"at meals"; + case CD: return /*!#*/"at lunch"; + case CM: return /*!#*/"at breakfast"; + case CV: return /*!#*/"at dinner"; + case AC: return /*!#*/"before meals"; + case ACD: return /*!#*/"before lunch"; + case ACM: return /*!#*/"before breakfast"; + case ACV: return /*!#*/"before dinner"; + case HS: return /*!#*/"before sleeping"; + case PC: return /*!#*/"after meals"; + case PCD: return /*!#*/"after lunch"; + case PCM: return /*!#*/"after breakfast"; + case PCV: return /*!#*/"after dinner"; + case WAKE: return /*!#*/"after waking"; default: return "?ngen-6?"; } } @@ -1849,29 +1865,29 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displaySampledData(SampledData s) { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); if (s.hasOrigin()) - b.append("Origin: "+displayQuantity(s.getOrigin())); + b.append(/*!#*/"Origin: "+displayQuantity(s.getOrigin())); if (s.hasInterval()) { - b.append("Interval: "+s.getInterval().toString()); + b.append(/*!#*/"Interval: "+s.getInterval().toString()); if (s.hasIntervalUnit()) b.append(s.getIntervalUnit().toString()); } if (s.hasFactor()) - b.append("Factor: "+s.getFactor().toString()); + b.append(/*!#*/"Factor: "+s.getFactor().toString()); if (s.hasLowerLimit()) - b.append("Lower: "+s.getLowerLimit().toString()); + b.append(/*!#*/"Lower: "+s.getLowerLimit().toString()); if (s.hasUpperLimit()) - b.append("Upper: "+s.getUpperLimit().toString()); + b.append(/*!#*/"Upper: "+s.getUpperLimit().toString()); if (s.hasDimensions()) - b.append("Dimensions: "+s.getDimensions()); + b.append(/*!#*/"Dimensions: "+s.getDimensions()); if (s.hasData()) - b.append("Data: "+s.getData()); + b.append(/*!#*/"Data: "+s.getData()); return b.toString(); } @@ -1889,7 +1905,7 @@ public class DataRenderer extends Renderer implements CodeResolver { XhtmlNode xn; xn = new XhtmlNode(NodeType.Element, "div"); XhtmlNode p = xn.para(); - p.b().tx("Exception "+function+": "+e.getMessage()); + p.b().tx(/*!#*/"Exception "+function+": "+e.getMessage()); p.addComment(getStackTrace(e)); return xn; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java index 13680d5aa..d906db817 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java @@ -62,7 +62,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { XhtmlNode tr; if (dr.has("subject")) { tr = tbl.tr(); - tr.td().tx("Subject"); + tr.td().tx(/*!#*/"Subject"); populateSubjectSummary(tr.td(), getProperty(dr, "subject").value()); } @@ -71,13 +71,13 @@ public class DiagnosticReportRenderer extends ResourceRenderer { if (dr.has("effective[x]")) { tr = tbl.tr(); - tr.td().tx("When For"); + tr.td().tx(/*!#*/"When For"); eff = (DataType) getProperty(dr, "effective[x]").value().getBase(); render(tr.td(), eff); } if (dr.has("issued")) { tr = tbl.tr(); - tr.td().tx("Reported"); + tr.td().tx(/*!#*/"Reported"); eff = (DataType) getProperty(dr, "issued").value().getBase(); render(tr.td(), getProperty(dr, "issued").value()); } @@ -85,7 +85,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { pw = getProperty(dr, "perfomer"); if (valued(pw)) { tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Performer", pw.getValues().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Performer", pw.getValues().size())); XhtmlNode tdr = tr.td(); for (BaseWrapper v : pw.getValues()) { tdr.tx(" "); @@ -95,7 +95,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { pw = getProperty(dr, "identifier"); if (valued(pw)) { tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Identifier", pw.getValues().size())+":"); + tr.td().tx(Utilities.pluralize(/*!#*/"Identifier", pw.getValues().size())+":"); XhtmlNode tdr = tr.td(); for (BaseWrapper v : pw.getValues()) { tdr.tx(" "); @@ -105,7 +105,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { pw = getProperty(dr, "request"); if (valued(pw)) { tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Request", pw.getValues().size())+":"); + tr.td().tx(Utilities.pluralize(/*!#*/"Request", pw.getValues().size())+":"); XhtmlNode tdr = tr.td(); for (BaseWrapper v : pw.getValues()) { tdr.tx(" "); @@ -115,7 +115,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { } - x.para().b().tx("Report Details"); + x.para().b().tx(/*!#*/"Report Details"); pw = getProperty(dr, "result"); if (valued(pw)) { @@ -138,7 +138,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { } if (valued(pw)) { XhtmlNode p = x.para(); - p.b().tx("Coded Conclusions :"); + p.b().tx(/*!#*/"Coded Conclusions :"); XhtmlNode ul = x.ul(); for (BaseWrapper v : pw.getValues()) { render(ul.li(), v); @@ -174,11 +174,11 @@ public class DiagnosticReportRenderer extends ResourceRenderer { private void populateSubjectSummary(XhtmlNode container, BaseWrapper subject) throws UnsupportedEncodingException, FHIRException, IOException, EOperationOutcome { ResourceWrapper r = fetchResource(subject); if (r == null) - container.tx("Unable to get Patient Details"); + container.tx(/*!#*/"Unable to get Patient Details"); else if (r.getName().equals("Patient")) generatePatientSummary(container, r); else - container.tx("Not done yet"); + container.tx(/*!#*/"Not done yet"); } private void generatePatientSummary(XhtmlNode c, ResourceWrapper r) throws FHIRFormatError, DefinitionException, FHIRException, IOException, EOperationOutcome { @@ -218,22 +218,22 @@ public class DiagnosticReportRenderer extends ResourceRenderer { if (issued) cs++; if (effectiveTime) cs++; XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Code"); - tr.td().b().tx("Value"); + tr.td().b().tx(/*!#*/"Code"); + tr.td().b().tx(/*!#*/"Value"); if (refRange) { - tr.td().b().tx("Reference Range"); + tr.td().b().tx(/*!#*/"Reference Range"); } if (flags) { - tr.td().b().tx("Flags"); + tr.td().b().tx(/*!#*/"Flags"); } if (note) { - tr.td().b().tx("Note"); + tr.td().b().tx(/*!#*/"Note"); } if (effectiveTime) { - tr.td().b().tx("When For"); + tr.td().b().tx(/*!#*/"When For"); } if (issued) { - tr.td().b().tx("Reported"); + tr.td().b().tx(/*!#*/"Reported"); } for (ObservationNode o : observations) { addObservationToTable(tbl, o, 0, Integer.toString(cs), refRange, flags, note, effectiveTime, issued, eff, iss); @@ -340,13 +340,13 @@ public class DiagnosticReportRenderer extends ResourceRenderer { XhtmlNode tr = tbl.tr(); if (o.obs != null && o.obs.getReference() == null) { XhtmlNode td = tr.td().colspan(cs); - td.i().tx("This Observation could not be resolved"); + td.i().tx(/*!#*/"This Observation could not be resolved"); } else { if (o.obs != null && o.obs.getResource() != null) { addObservationToTable(tr, o.obs.getResource(), i, o.obs.getReference(), refRange, flags, note, effectiveTime, issued, eff, iss); } else { XhtmlNode td = tr.td().colspan(cs); - td.i().tx("Observation"); + td.i().tx(/*!#*/"Observation"); } if (o.contained != null) { for (ObservationNode c : o.contained) { @@ -380,7 +380,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { pw = getProperty(obs, "dataAbsentReason"); if (valued(pw)) { XhtmlNode span = td.span("color: maroon", "Error"); - span.tx("Error: "); + span.tx(/*!#*/"Error: "); render(span.b(), pw.value()); } } @@ -421,7 +421,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { PropertyWrapper pwrA = getProperty(v, "age"); if (valued(pwr) || valued(pwrA)) { boolean firstA = true; - td.tx(" for "); + td.tx(" "+/*!#*/"for "); if (valued(pwr)) { for (BaseWrapper va : pwr.getValues()) { if (firstA) firstA = false; else td.tx(", "); @@ -430,7 +430,7 @@ public class DiagnosticReportRenderer extends ResourceRenderer { } if (valued(pwrA)) { if (firstA) firstA = false; else td.tx(", "); - td.tx("Age "); + td.tx(/*!#*/"Age "); render(td, pwrA.value()); } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ExampleScenarioRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ExampleScenarioRenderer.java index bec93686e..7f2a5544e 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ExampleScenarioRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ExampleScenarioRenderer.java @@ -43,11 +43,11 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { case PROCESSES: return renderProcesses(x, scen); default: - throw new FHIRException("Unknown ExampleScenario Renderer Mode " + context.getScenarioMode()); + throw new FHIRException(/*!#*/"Unknown ExampleScenario Renderer Mode " + context.getScenarioMode()); } } } catch (Exception e) { - throw new FHIRException("Error rendering ExampleScenario " + scen.getUrl(), e); + throw new FHIRException(/*!#*/"Error rendering ExampleScenario " + scen.getUrl(), e); } } @@ -105,7 +105,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { for (ExampleScenarioProcessStepComponent step: process.getStep()) { plantUml += toPlantUml(step, stepPrefix(prefix, step, stepCount), scen, actorsActive, actorKeys); if (step.getPause()) - plantUml += "... time passes ...\n"; + plantUml += /*!#*/"... time passes ...\n"; stepCount++; } @@ -119,7 +119,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { XhtmlNode n = new XhtmlDocument(); renderCanonical(scen, n, step.getWorkflow()); XhtmlNode ref = n.getChildNodes().get(0); - plantUml += noteOver(scen.getActor(), "Step " + trimPrefix(prefix) + " - See scenario\n" + creolLink(ref.getContent(), ref.getAttribute("href"))); + plantUml += noteOver(scen.getActor(), /*!#*/"Step " + trimPrefix(prefix) + " - See scenario\n" + creolLink(ref.getContent(), ref.getAttribute("href"))); } else if (step.hasProcess()) plantUml += toPlantUml(step.getProcess(), prefix, scen, actorKeys); else { @@ -211,9 +211,9 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { public boolean renderActors(XhtmlNode x, ExampleScenario scen) throws IOException { XhtmlNode tbl = x.table("table-striped table-bordered"); XhtmlNode thead = tbl.tr(); - thead.th().addText("Name"); - thead.th().addText("Type"); - thead.th().addText("Description"); + thead.th().addText(/*!#*/"Name"); + thead.th().addText(/*!#*/"Type"); + thead.th().addText(/*!#*/"Description"); for (ExampleScenarioActorComponent actor : scen.getActor()) { XhtmlNode tr = tbl.tr(); XhtmlNode nameCell = tr.td(); @@ -228,10 +228,10 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { public boolean renderInstances(XhtmlNode x, ExampleScenario scen) throws IOException { XhtmlNode tbl = x.table("table-striped table-bordered"); XhtmlNode thead = tbl.tr(); - thead.th().addText("Name"); - thead.th().addText("Type"); - thead.th().addText("Content"); - thead.th().addText("Description"); + thead.th().addText(/*!#*/"Name"); + thead.th().addText(/*!#*/"Type"); + thead.th().addText(/*!#*/"Content"); + thead.th().addText(/*!#*/"Description"); Map instanceNames = new HashMap(); for (ExampleScenarioInstanceComponent instance : scen.getInstance()) { @@ -254,7 +254,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { if (!instance.hasStructureVersion() || instance.getStructureType().getSystem().equals("")) { if (instance.hasStructureVersion()) - typeCell.tx("FHIR version " + instance.getStructureVersion() + " "); + typeCell.tx(/*!#*/"FHIR version " + instance.getStructureVersion() + " "); if (instance.hasStructureProfile()) { renderCanonical(scen, typeCell, instance.getStructureProfile().toString()); } else { @@ -262,7 +262,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { } } else { render(typeCell, instance.getStructureVersionElement()); - typeCell.tx(" version " + instance.getStructureVersion()); + typeCell.tx(" "+/*!#*/"version " + instance.getStructureVersion()); if (instance.hasStructureProfile()) { typeCell.tx(" "); renderCanonical(scen, typeCell, instance.getStructureProfile().toString()); @@ -280,7 +280,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { XhtmlNode descCell = row.td(); addMarkdown(descCell, instance.getDescription()); if (instance.hasContainedInstance()) { - descCell.b().tx("Contains: "); + descCell.b().tx(/*!#*/"Contains: "); int containedCount = 1; for (ExampleScenarioInstanceContainedInstanceComponent contained: instance.getContainedInstance()) { String key = "i_" + contained.getInstanceReference(); @@ -341,26 +341,26 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { public void renderProcess(XhtmlNode x, ExampleScenarioProcessComponent process, String prefix, Map actors, Map instances) throws IOException { XhtmlNode div = x.div(); div.an("p_" + prefix); - div.b().tx("Process: " + process.getTitle()); + div.b().tx(/*!#*/"Process: " + process.getTitle()); if (process.hasDescription()) addMarkdown(div, process.getDescription()); if (process.hasPreConditions()) { - div.para().b().i().tx("Pre-conditions:"); + div.para().b().i().tx(/*!#*/"Pre-conditions:"); addMarkdown(div, process.getPreConditions()); } if (process.hasPostConditions()) { - div.para().b().i().tx("Post-conditions:"); + div.para().b().i().tx(/*!#*/"Post-conditions:"); addMarkdown(div, process.getPostConditions()); } XhtmlNode tbl = div.table("table-striped table-bordered").style("width:100%"); XhtmlNode thead = tbl.tr(); - thead.th().addText("Step"); - thead.th().addText("Name"); - thead.th().addText("Description"); - thead.th().addText("Initator"); - thead.th().addText("Receiver"); - thead.th().addText("Request"); - thead.th().addText("Response"); + thead.th().addText(/*!#*/"Step"); + thead.th().addText(/*!#*/"Name"); + thead.th().addText(/*!#*/"Description"); + thead.th().addText(/*!#*/"Initator"); + thead.th().addText(/*!#*/"Receiver"); + thead.th().addText(/*!#*/"Request"); + thead.th().addText(/*!#*/"Response"); int stepCount = 1; for (ExampleScenarioProcessStepComponent step: process.getStep()) { renderStep(tbl, step, stepPrefix(prefix, step, stepCount), actors, instances); @@ -407,13 +407,13 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { prefixCell.tx(stepLabel.substring(stepLabel.indexOf(".") + 1)); if (step.hasProcess()) { XhtmlNode n = row.td().colspan(6); - n.tx("See subprocess" ); + n.tx(/*!#*/"See subprocess" ); n.ah("#p_" + stepLabel, step.getProcess().getTitle()); - n.tx(" below"); + n.tx(" "+/*!#*/"below"); } else if (step.hasWorkflow()) { XhtmlNode n = row.td().colspan(6); - n.tx("See other scenario "); + n.tx(/*!#*/"See other scenario "); String link = new ContextUtilities(context.getWorker()).getLinkForUrl(context.getLink(KnownLinkType.SPEC), step.getWorkflow()); n.ah(link, step.getProcess().getTitle()); @@ -438,7 +438,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { int altNum = 1; for (ExampleScenarioProcessStepAlternativeComponent alt : step.getAlternative()) { XhtmlNode altHeading = tbl.tr().colspan(7).td(); - altHeading.para().i().tx("Alternative " + alt.getTitle()); + altHeading.para().i().tx(/*!#*/"Alternative " + alt.getTitle()); if (alt.hasDescription()) addMarkdown(altHeading, alt.getDescription()); int stepCount = 1; @@ -458,7 +458,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { return; ExampleScenarioActorComponent actor = actors.get(actorId); if (actor==null) - throw new FHIRException("Unable to find referenced actor " + actorId); + throw new FHIRException(/*!#*/"Unable to find referenced actor " + actorId); actorCell.ah("#a_" + actor.getKey(), actor.getDescription()).tx(actor.getTitle()); } @@ -468,7 +468,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { return; ExampleScenarioInstanceComponent instance = instances.get(instanceRef.getInstanceReference()); if (instance==null) - throw new FHIRException("Unable to find referenced instance " + instanceRef.getInstanceReference()); + throw new FHIRException(/*!#*/"Unable to find referenced instance " + instanceRef.getInstanceReference()); if (instanceRef.hasVersionReference()) { ExampleScenarioInstanceVersionComponent theVersion = null; for (ExampleScenarioInstanceVersionComponent version: instance.getVersion()) { @@ -478,7 +478,7 @@ public class ExampleScenarioRenderer extends TerminologyRenderer { } } if (theVersion==null) - throw new FHIRException("Unable to find referenced version " + instanceRef.getVersionReference() + " within instance " + instanceRef.getInstanceReference()); + throw new FHIRException(/*!#*/"Unable to find referenced version " + instanceRef.getVersionReference() + " within instance " + instanceRef.getInstanceReference()); instanceCell.ah("#i_" + instance.getKey() + "v_"+ theVersion.getKey() , theVersion.getDescription()).tx(theVersion.getTitle()); } else diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ImplementationGuideRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ImplementationGuideRenderer.java index c44349623..bf2960859 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ImplementationGuideRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ImplementationGuideRenderer.java @@ -28,7 +28,7 @@ public class ImplementationGuideRenderer extends ResourceRenderer { public boolean render(XhtmlNode x, ImplementationGuide ig) throws FHIRFormatError, DefinitionException, IOException { x.h2().addText(ig.getName()); - x.para().tx("The official URL for this implementation guide is: "); + x.para().tx(/*!#*/"The official URL for this implementation guide is: "); x.pre().tx(ig.getUrl()); addMarkdown(x, ig.getDescription()); return true; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java index a77bad3a8..bc8ce887b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java @@ -49,32 +49,32 @@ public class LibraryRenderer extends ResourceRenderer { boolean email = hasCT(authors, "email") || hasCT(editors, "email") || hasCT(reviewers, "email") || hasCT(endorsers, "email"); boolean phone = hasCT(authors, "phone") || hasCT(editors, "phone") || hasCT(reviewers, "phone") || hasCT(endorsers, "phone"); boolean url = hasCT(authors, "url") || hasCT(editors, "url") || hasCT(reviewers, "url") || hasCT(endorsers, "url"); - x.h2().tx("Participants"); + x.h2().tx(/*!#*/"Participants"); XhtmlNode t = x.table("grid"); if (authors != null) { for (BaseWrapper cd : authors.getValues()) { - participantRow(t, "Author", cd, email, phone, url); + participantRow(t, /*!#*/"Author", cd, email, phone, url); } } if (authors != null) { for (BaseWrapper cd : editors.getValues()) { - participantRow(t, "Editor", cd, email, phone, url); + participantRow(t, /*!#*/"Editor", cd, email, phone, url); } } if (authors != null) { for (BaseWrapper cd : reviewers.getValues()) { - participantRow(t, "Reviewer", cd, email, phone, url); + participantRow(t, /*!#*/"Reviewer", cd, email, phone, url); } } if (authors != null) { for (BaseWrapper cd : endorsers.getValues()) { - participantRow(t, "Endorser", cd, email, phone, url); + participantRow(t, /*!#*/"Endorser", cd, email, phone, url); } } } PropertyWrapper artifacts = lib.getChildByName("relatedArtifact"); if (artifacts != null && artifacts.hasValues()) { - x.h2().tx("Related Artifacts"); + x.h2().tx(/*!#*/"Related Artifacts"); XhtmlNode t = x.table("grid"); boolean label = false; boolean display = false; @@ -90,7 +90,7 @@ public class LibraryRenderer extends ResourceRenderer { } PropertyWrapper parameters = lib.getChildByName("parameter"); if (parameters != null && parameters.hasValues()) { - x.h2().tx("Parameters"); + x.h2().tx(/*!#*/"Parameters"); XhtmlNode t = x.table("grid"); boolean doco = false; for (BaseWrapper p : parameters.getValues()) { @@ -102,14 +102,14 @@ public class LibraryRenderer extends ResourceRenderer { } PropertyWrapper dataRequirements = lib.getChildByName("dataRequirement"); if (dataRequirements != null && dataRequirements.hasValues()) { - x.h2().tx("Data Requirements"); + x.h2().tx(/*!#*/"Data Requirements"); for (BaseWrapper p : dataRequirements.getValues()) { renderDataRequirement(x, (DataRequirement) p.getBase()); } } PropertyWrapper contents = lib.getChildByName("content"); if (contents != null) { - x.h2().tx("Contents"); + x.h2().tx(/*!#*/"Contents"); boolean isCql = false; int counter = 0; for (BaseWrapper p : contents.getValues()) { @@ -151,23 +151,23 @@ public class LibraryRenderer extends ResourceRenderer { boolean email = hasCT(lib.getAuthor(), "email") || hasCT(lib.getEditor(), "email") || hasCT(lib.getReviewer(), "email") || hasCT(lib.getEndorser(), "email"); boolean phone = hasCT(lib.getAuthor(), "phone") || hasCT(lib.getEditor(), "phone") || hasCT(lib.getReviewer(), "phone") || hasCT(lib.getEndorser(), "phone"); boolean url = hasCT(lib.getAuthor(), "url") || hasCT(lib.getEditor(), "url") || hasCT(lib.getReviewer(), "url") || hasCT(lib.getEndorser(), "url"); - x.h2().tx("Participants"); + x.h2().tx(/*!#*/"Participants"); XhtmlNode t = x.table("grid"); for (ContactDetail cd : lib.getAuthor()) { - participantRow(t, "Author", cd, email, phone, url); + participantRow(t, /*!#*/"Author", cd, email, phone, url); } for (ContactDetail cd : lib.getEditor()) { - participantRow(t, "Editor", cd, email, phone, url); + participantRow(t, /*!#*/"Editor", cd, email, phone, url); } for (ContactDetail cd : lib.getReviewer()) { - participantRow(t, "Reviewer", cd, email, phone, url); + participantRow(t, /*!#*/"Reviewer", cd, email, phone, url); } for (ContactDetail cd : lib.getEndorser()) { - participantRow(t, "Endorser", cd, email, phone, url); + participantRow(t, /*!#*/"Endorser", cd, email, phone, url); } } if (lib.hasRelatedArtifact()) { - x.h2().tx("Related Artifacts"); + x.h2().tx(/*!#*/"Related Artifacts"); XhtmlNode t = x.table("grid"); boolean label = false; boolean display = false; @@ -182,7 +182,7 @@ public class LibraryRenderer extends ResourceRenderer { } } if (lib.hasParameter()) { - x.h2().tx("Parameters"); + x.h2().tx(/*!#*/"Parameters"); XhtmlNode t = x.table("grid"); boolean doco = false; for (ParameterDefinition p : lib.getParameter()) { @@ -193,13 +193,13 @@ public class LibraryRenderer extends ResourceRenderer { } } if (lib.hasDataRequirement()) { - x.h2().tx("Data Requirements"); + x.h2().tx(/*!#*/"Data Requirements"); for (DataRequirement p : lib.getDataRequirement()) { renderDataRequirement(x, p); } } if (lib.hasContent()) { - x.h2().tx("Contents"); + x.h2().tx(/*!#*/"Contents"); boolean isCql = false; int counter = 0; for (Attachment att : lib.getContent()) { @@ -356,7 +356,7 @@ public class LibraryRenderer extends ResourceRenderer { p.tx(att.getTitle()); p.tx(": "); } - p.code().tx("No Content"); + p.code().tx(/*!#*/"No Content"); p.tx(" ("); p.code().tx(att.getContentType()); p.tx(lang(att)); @@ -405,10 +405,10 @@ public class LibraryRenderer extends ResourceRenderer { p.tx(att.getTitle()); p.tx(": "); } - p.code().tx("Content not shown - ("); + p.code().tx(/*!#*/"Content not shown - ("); p.code().tx(att.getContentType()); p.tx(lang(att)); - p.tx(", size = "+Utilities.describeSize(att.getData().length)+")"); + p.tx(/*!#*/", size = "+Utilities.describeSize(att.getData().length)+")"); } } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ListRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ListRenderer.java index 90976a736..95826f632 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ListRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ListRenderer.java @@ -40,33 +40,33 @@ public class ListRenderer extends ResourceRenderer { XhtmlNode tr = t.tr(); XhtmlNode td = tr.td(); if (list.has("date")) { - td.tx("Date: "+list.get("date").dateTimeValue().toHumanDisplay()); + td.tx(/*!#*/"Date: "+list.get("date").dateTimeValue().toHumanDisplay()); } if (list.has("mode")) { - td.tx("Mode: "+list.get("mode").primitiveValue()); + td.tx(/*!#*/"Mode: "+list.get("mode").primitiveValue()); } if (list.has("status")) { - td.tx("Status: "+list.get("status").primitiveValue()); + td.tx(/*!#*/"Status: "+list.get("status").primitiveValue()); } if (list.has("code")) { - td.tx("Code: "+displayBase(list.get("code"))); + td.tx(/*!#*/"Code: "+displayBase(list.get("code"))); } tr = t.tr(); td = tr.td(); if (list.has("subject")) { - td.tx("Subject: "); + td.tx(/*!#*/"Subject: "); shortForRef(td, list.get("subject")); } if (list.has("encounter")) { - td.tx("Encounter: "); + td.tx(/*!#*/"Encounter: "); shortForRef(td, list.get("encounter")); } if (list.has("source")) { - td.tx("Source: "); + td.tx(/*!#*/"Source: "); shortForRef(td, list.get("encounter")); } if (list.has("orderedBy")) { - td.tx("Order: "+displayBase(list.get("orderedBy"))); + td.tx(/*!#*/"Order: "+displayBase(list.get("orderedBy"))); } // for (Annotation a : list.getNote()) { // renderAnnotation(a, x); @@ -81,15 +81,15 @@ public class ListRenderer extends ResourceRenderer { } t = x.table("grid"); tr = t.tr().style("backgound-color: #eeeeee"); - tr.td().b().tx("Items"); + tr.td().b().tx(/*!#*/"Items"); if (date) { - tr.td().tx("Date"); + tr.td().tx(/*!#*/"Date"); } if (flag) { - tr.td().tx("Flag"); + tr.td().tx(/*!#*/"Flag"); } if (deleted) { - tr.td().tx("Deleted"); + tr.td().tx(/*!#*/"Deleted"); } for (BaseWrapper e : list.children("entry")) { tr = t.tr(); @@ -113,16 +113,16 @@ public class ListRenderer extends ResourceRenderer { XhtmlNode t = x.table("clstu"); XhtmlNode tr = t.tr(); if (list.hasDate()) { - tr.td().tx("Date: "+list.getDate().toLocaleString()); + tr.td().tx(/*!#*/"Date: "+list.getDate().toLocaleString()); } if (list.hasMode()) { - tr.td().tx("Mode: "+list.getMode().getDisplay()); + tr.td().tx(/*!#*/"Mode: "+list.getMode().getDisplay()); } if (list.hasStatus()) { - tr.td().tx("Status: "+list.getStatus().getDisplay()); + tr.td().tx(/*!#*/"Status: "+list.getStatus().getDisplay()); } if (list.hasCode()) { - tr.td().tx("Code: "+display(list.getCode())); + tr.td().tx(/*!#*/"Code: "+display(list.getCode())); } tr = t.tr(); if (list.hasSubject()) { @@ -130,7 +130,7 @@ public class ListRenderer extends ResourceRenderer { shortForRef(tr.td().txN("Subject: "), list.getSubjectFirstRep()); } else { XhtmlNode td = tr.td(); - td.txN("Subject: "); + td.txN(/*!#*/"Subject: "); int i = 0; for (Reference subj : list.getSubject()) { if (i == list.getSubject().size() - 1) { @@ -143,13 +143,13 @@ public class ListRenderer extends ResourceRenderer { } } if (list.hasEncounter()) { - shortForRef(tr.td().txN("Encounter: "), list.getEncounter()); + shortForRef(tr.td().txN(/*!#*/"Encounter: "), list.getEncounter()); } if (list.hasSource()) { - shortForRef(tr.td().txN("Source: "), list.getEncounter()); + shortForRef(tr.td().txN(/*!#*/"Source: "), list.getEncounter()); } if (list.hasOrderedBy()) { - tr.td().tx("Order: "+display(list.getOrderedBy())); + tr.td().tx(/*!#*/"Order: "+display(list.getOrderedBy())); } for (Annotation a : list.getNote()) { renderAnnotation(x, a); @@ -164,15 +164,15 @@ public class ListRenderer extends ResourceRenderer { } t = x.table("grid"); tr = t.tr().style("backgound-color: #eeeeee"); - tr.td().b().tx("Items"); + tr.td().b().tx(/*!#*/"Items"); if (date) { - tr.td().tx("Date"); + tr.td().tx(/*!#*/"Date"); } if (flag) { - tr.td().tx("Flag"); + tr.td().tx(/*!#*/"Flag"); } if (deleted) { - tr.td().tx("Deleted"); + tr.td().tx(/*!#*/"Deleted"); } for (ListResourceEntryComponent e : list.getEntry()) { tr = t.tr(); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/NamingSystemRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/NamingSystemRenderer.java index dfb88d5c3..8b12afcfc 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/NamingSystemRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/NamingSystemRenderer.java @@ -30,33 +30,33 @@ public class NamingSystemRenderer extends ResourceRenderer { } public boolean render(XhtmlNode x, NamingSystem ns) throws FHIRFormatError, DefinitionException, IOException { - x.h3().tx("Summary"); + x.h3().tx(/*!#*/"Summary"); XhtmlNode tbl = x.table("grid"); - row(tbl, "Defining URL", ns.getUrl()); + row(tbl, /*!#*/"Defining URL", ns.getUrl()); if (ns.hasVersion()) { - row(tbl, "Version", ns.getVersion()); + row(tbl, /*!#*/"Version", ns.getVersion()); } if (ns.hasName()) { - row(tbl, "Name", gt(ns.getNameElement())); + row(tbl, /*!#*/"Name", gt(ns.getNameElement())); } if (ns.hasTitle()) { - row(tbl, "Title", gt(ns.getTitleElement())); + row(tbl, /*!#*/"Title", gt(ns.getTitleElement())); } - row(tbl, "Status", ns.getStatus().toCode()); + row(tbl, /*!#*/"Status", ns.getStatus().toCode()); if (ns.hasDescription()) { - addMarkdown(row(tbl, "Definition"), ns.getDescription()); + addMarkdown(row(tbl, /*!#*/"Definition"), ns.getDescription()); } if (ns.hasPublisher()) { - row(tbl, "Publisher", gt(ns.getPublisherElement())); + row(tbl, /*!#*/"Publisher", gt(ns.getPublisherElement())); } if (ns.hasExtension(ToolingExtensions.EXT_WORKGROUP)) { renderCommitteeLink(row(tbl, "Committee"), ns); } if (CodeSystemUtilities.hasOID(ns)) { - row(tbl, "OID", CodeSystemUtilities.getOID(ns)).tx("("+translate("ns.summary", "for OID based terminology systems")+")"); + row(tbl, /*!#*/"OID", CodeSystemUtilities.getOID(ns)).tx("("+(/*!#*/"for OID based terminology systems")+")"); } if (ns.hasCopyright()) { - addMarkdown(row(tbl, "Copyright"), ns.getCopyright()); + addMarkdown(row(tbl, /*!#*/"Copyright"), ns.getCopyright()); } boolean hasPreferred = false; boolean hasPeriod = false; @@ -66,19 +66,19 @@ public class NamingSystemRenderer extends ResourceRenderer { hasPeriod = hasPeriod || id.hasPeriod(); hasComment = hasComment || id.hasComment(); } - x.h3().tx("Identifiers"); + x.h3().tx(/*!#*/"Identifiers"); tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx(translate("ns.summary", "Type")); - tr.td().b().tx(translate("ns.summary", "Value")); + tr.td().b().tx((/*!#*/"Type")); + tr.td().b().tx((/*!#*/"Value")); if (hasPreferred) { - tr.td().b().tx(translate("ns.summary", "Preferred")); + tr.td().b().tx((/*!#*/"Preferred")); } if (hasPeriod) { - tr.td().b().tx(translate("ns.summary", "Period")); + tr.td().b().tx((/*!#*/"Period")); } if (hasComment) { - tr.td().b().tx(translate("ns.summary", "Comment")); + tr.td().b().tx((/*!#*/"Comment")); } for (NamingSystemUniqueIdComponent id : ns.getUniqueId()) { tr = tbl.tr(); @@ -100,7 +100,7 @@ public class NamingSystemRenderer extends ResourceRenderer { private XhtmlNode row(XhtmlNode tbl, String name) { XhtmlNode tr = tbl.tr(); XhtmlNode td = tr.td(); - td.tx(translate("ns.summary", name)); + td.tx((name)); return tr.td(); } private XhtmlNode row(XhtmlNode tbl, String name, String value) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ObligationsRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ObligationsRenderer.java index 54b4fd4ba..c891ddc35 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ObligationsRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ObligationsRenderer.java @@ -353,21 +353,21 @@ public class ObligationsRenderer { XhtmlNode tr = new XhtmlNode(NodeType.Element, "tr"); children.add(tr); - tr.td().style("font-size: 11px").b().tx("Obligations"); + tr.td().style("font-size: 11px").b().tx(/*!#*/"Obligations"); if (actor) { - tr.td().style("font-size: 11px").tx("Actor"); + tr.td().style("font-size: 11px").tx(/*!#*/"Actor"); } if (elementId) { - tr.td().style("font-size: 11px").tx("Elements"); + tr.td().style("font-size: 11px").tx(/*!#*/"Elements"); } if (usage) { - tr.td().style("font-size: 11px").tx("Usage"); + tr.td().style("font-size: 11px").tx(/*!#*/"Usage"); } if (doco) { - tr.td().style("font-size: 11px").tx("Documentation"); + tr.td().style("font-size: 11px").tx(/*!#*/"Documentation"); } if (filter) { - tr.td().style("font-size: 11px").tx("Filter"); + tr.td().style("font-size: 11px").tx(/*!#*/"Filter"); } for (ObligationDetail ob : obligations) { tr = new XhtmlNode(NodeType.Element, "tr"); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java index 3d9fdbda7..9d47cf2f7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java @@ -44,22 +44,22 @@ public class OperationDefinitionRenderer extends TerminologyRenderer { if (context.isHeader()) { x.h2().addText(opd.getName()); x.para().addText(Utilities.capitalize(opd.getKind().toString())+": "+opd.getName()); - x.para().tx("The official URL for this operation definition is: "); + x.para().tx(/*!#*/"The official URL for this operation definition is: "); x.pre().tx(opd.getUrl()); addMarkdown(x, opd.getDescription());} if (opd.getSystem()) - x.para().tx("URL: [base]/$"+opd.getCode()); + x.para().tx(/*!#*/"URL: [base]/$"+opd.getCode()); for (Enumeration c : opd.getResource()) { if (opd.getType()) - x.para().tx("URL: [base]/"+c.getCode()+"/$"+opd.getCode()); + x.para().tx(/*!#*/"URL: [base]/"+c.getCode()+"/$"+opd.getCode()); if (opd.getInstance()) - x.para().tx("URL: [base]/"+c.getCode()+"/[id]/$"+opd.getCode()); + x.para().tx(/*!#*/"URL: [base]/"+c.getCode()+"/[id]/$"+opd.getCode()); } if (opd.hasInputProfile()) { XhtmlNode p = x.para(); - p.tx("Input parameters Profile: "); + p.tx(/*!#*/"Input parameters Profile: "); StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, opd.getInputProfile(), opd); if (sd == null) { p.pre().tx(opd.getInputProfile()); @@ -69,7 +69,7 @@ public class OperationDefinitionRenderer extends TerminologyRenderer { } if (opd.hasOutputProfile()) { XhtmlNode p = x.para(); - p.tx("Output parameters Profile: "); + p.tx(/*!#*/"Output parameters Profile: "); StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, opd.getOutputProfile(), opd); if (sd == null) { p.pre().tx(opd.getOutputProfile()); @@ -77,16 +77,16 @@ public class OperationDefinitionRenderer extends TerminologyRenderer { p.ah(sd.getWebPath()).tx(sd.present()); } } - x.para().tx("Parameters"); + x.para().tx(/*!#*/"Parameters"); XhtmlNode tbl = x.table( "grid"); XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Use"); - tr.td().b().tx("Name"); - tr.td().b().tx("Scope"); - tr.td().b().tx("Cardinality"); - tr.td().b().tx("Type"); - tr.td().b().tx("Binding"); - tr.td().b().tx("Documentation"); + tr.td().b().tx(/*!#*/"Use"); + tr.td().b().tx(/*!#*/"Name"); + tr.td().b().tx(/*!#*/"Scope"); + tr.td().b().tx(/*!#*/"Cardinality"); + tr.td().b().tx(/*!#*/"Type"); + tr.td().b().tx(/*!#*/"Binding"); + tr.td().b().tx(/*!#*/"Documentation"); for (OperationDefinitionParameterComponent p : opd.getParameter()) { genOpParam(tbl, "", p, opd); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationOutcomeRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationOutcomeRenderer.java index b5db9e185..24112e4e5 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationOutcomeRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationOutcomeRenderer.java @@ -41,17 +41,17 @@ public class OperationOutcomeRenderer extends ResourceRenderer { hasSource = hasSource || ExtensionHelper.hasExtension(i, ToolingExtensions.EXT_ISSUE_SOURCE); } if (success) - x.para().tx("All OK"); + x.para().tx(/*!#*/"All OK"); if (op.getIssue().size() > 0) { XhtmlNode tbl = x.table("grid"); // on the basis that we'll most likely be rendered using the standard fhir css, but it doesn't really matter XhtmlNode tr = tbl.tr(); - tr.td().b().tx("Severity"); - tr.td().b().tx("Location"); - tr.td().b().tx("Code"); - tr.td().b().tx("Details"); - tr.td().b().tx("Diagnostics"); + tr.td().b().tx(/*!#*/"Severity"); + tr.td().b().tx(/*!#*/"Location"); + tr.td().b().tx(/*!#*/"Code"); + tr.td().b().tx(/*!#*/"Details"); + tr.td().b().tx(/*!#*/"Diagnostics"); if (hasSource) - tr.td().b().tx("Source"); + tr.td().b().tx(/*!#*/"Source"); for (OperationOutcomeIssueComponent i : op.getIssue()) { tr = tbl.tr(); tr.td().addText(i.getSeverity().toString()); @@ -82,12 +82,12 @@ public class OperationOutcomeRenderer extends ResourceRenderer { } public String display(OperationOutcome oo) { - return "todo"; + return /*!#*/"todo"; } @Override public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException { - return "Not done yet"; + return /*!#*/"Not done yet"; } @Override diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java index 646156cb1..892690118 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java @@ -31,7 +31,7 @@ public class ParametersRenderer extends ResourceRenderer { @Override public boolean render(XhtmlNode x, Resource r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { - x.h2().tx("Parameters"); + x.h2().tx(/*!#*/"Parameters"); XhtmlNode tbl = x.table("grid"); params(tbl, ((Parameters) r).getParameter(), 0); return false; @@ -49,7 +49,7 @@ public class ParametersRenderer extends ResourceRenderer { @Override public boolean render(XhtmlNode x, ResourceWrapper params) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { - x.h2().tx("Parameters"); + x.h2().tx(/*!#*/"Parameters"); XhtmlNode tbl = x.table("grid"); PropertyWrapper pw = getProperty(params, "parameter"); if (valued(pw)) { @@ -95,7 +95,7 @@ public class ParametersRenderer extends ResourceRenderer { public XhtmlNode render(Parameters params) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { XhtmlNode div = new XhtmlNode(NodeType.Element, "div"); - div.h2().tx("Parameters"); + div.h2().tx(/*!#*/"Parameters"); XhtmlNode tbl = div.table("grid"); params(tbl, params.getParameter(), 0); return div; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java index 4cfe3e914..898b16ecc 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java @@ -32,6 +32,7 @@ import org.hl7.fhir.r5.renderers.utils.BaseWrappers.BaseWrapper; import org.hl7.fhir.r5.renderers.utils.BaseWrappers.PropertyWrapper; import org.hl7.fhir.r5.renderers.utils.BaseWrappers.ResourceWrapper; import org.hl7.fhir.r5.renderers.utils.RenderingContext; +import org.hl7.fhir.r5.utils.EOperationOutcome; import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.xhtml.XhtmlNode; @@ -224,18 +225,18 @@ public class PatientRenderer extends ResourceRenderer { b.append(display(name)); b.append(" "); if (dob == null) { - b.append("(no stated gender)"); + b.append("(no stated gender)"/*!#*/); } else { b.append(gender); } b.append(", "); if (dob == null) { - b.append("DoB Unknown"); + b.append("DoB Unknown"/*!#*/); } else { - b.append("DoB: "+display(dob)); + b.append(/*!#*/"DoB: "+display(dob)); } if (id != null) { - b.append(" ( "); + b.append(" "+/*!#*/"( "); b.append(display(id)); b.append(")"); } @@ -244,21 +245,21 @@ public class PatientRenderer extends ResourceRenderer { public void describe(XhtmlNode x, HumanName name, String gender, DateType dob, Identifier id) throws UnsupportedEncodingException, IOException { if (name == null) { - x.b().tx("Anonymous Patient"); // todo: is this appropriate? + x.b().tx(/*!#*/"Anonymous Patient"); // todo: is this appropriate? } else { render(x.b(), name); } x.tx(" "); if (gender == null) { - x.tx("(no stated gender)"); + x.tx(/*!#*/"(no stated gender)"); } else { x.tx(gender); } x.tx(", "); if (dob == null) { - x.tx("DoB Unknown"); + x.tx(/*!#*/"DoB Unknown"); } else { - x.tx("DoB: "); + x.tx(/*!#*/"DoB: "); render(x, dob); } if (id != null) { @@ -269,7 +270,7 @@ public class PatientRenderer extends ResourceRenderer { } @Override - public boolean render(XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException { + public boolean render(XhtmlNode x, ResourceWrapper r) throws IOException, FHIRException, EOperationOutcome { // banner describe(makeBanner(x.para()), r); x.hr(); @@ -295,9 +296,22 @@ public class PatientRenderer extends ResourceRenderer { if (tbl.isEmpty()) { x.remove(tbl); } + if (r.has("contained") && context.isTechnicalMode()) { + x.hr(); + x.para().b().tx(/*!#*/"Contained Resources"); + addContained(x, r.getContained()); + } return false; } + private void addContained(XhtmlNode x, List list) throws FHIRFormatError, DefinitionException, FHIRException, IOException, EOperationOutcome { + for (ResourceWrapper c : list) { + x.hr(); + x.an(c.getId()); + new RendererFactory().factory(c, context).render(x, c); + } + } + private void addExtensions(XhtmlNode tbl, ResourceWrapper r) throws UnsupportedEncodingException, FHIRException, IOException { Map> extensions = new HashMap<>(); PropertyWrapper pw = getProperty(r, "extension"); @@ -378,13 +392,13 @@ public class PatientRenderer extends ResourceRenderer { }; if (ids.size() == 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Other Id:", "Other Ids (see the one above)"); + nameCell(tr, /*!#*/"Other Id:", /*!#*/"Other Ids (see the one above)"); XhtmlNode td = tr.td(); td.colspan("3"); render(r, td, ids.get(0)); } else if (ids.size() > 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Other Ids:", "Other Ids (see the one above)"); + nameCell(tr, /*!#*/"Other Ids:", /*!#*/"Other Ids (see the one above)"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -411,16 +425,16 @@ public class PatientRenderer extends ResourceRenderer { } if (langs.size() == 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Language:", "Languages spoken"); + nameCell(tr, /*!#*/"Language:", /*!#*/"Languages spoken"); XhtmlNode td = tr.td(); td.colspan("3"); render(r, td, langs.get(0)); if (prefLang != null) { - td.tx(" (preferred)"); + td.tx(" "+/*!#*/"(preferred)"); } } else if (langs.size() > 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Languages:", "Languages spoken"); + nameCell(tr, /*!#*/"Languages:", /*!#*/"Languages spoken"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -428,7 +442,7 @@ public class PatientRenderer extends ResourceRenderer { XhtmlNode li = ul.li(); render(r, li, i); if (i == prefLang) { - li.tx(" (preferred)"); + li.tx(" "+/*!#*/"(preferred)"); } } } @@ -440,13 +454,13 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper pw = getProperty(r, "generalPractitioner"); if (pw != null) { for (BaseWrapper t : pw.getValues()) { - refs.add(new NamedReferance("General Practitioner", (Reference) t.getBase(), t)); + refs.add(new NamedReferance(/*!#*/"General Practitioner", (Reference) t.getBase(), t)); } } pw = getProperty(r, "managingOrganization"); if (pw != null) { for (BaseWrapper t : pw.getValues()) { - refs.add(new NamedReferance("Managing Organization", (Reference) t.getBase(), t)); + refs.add(new NamedReferance(/*!#*/"Managing Organization", (Reference) t.getBase(), t)); } } pw = getProperty(r, "link"); @@ -470,7 +484,7 @@ public class PatientRenderer extends ResourceRenderer { if (refs.size() > 0) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Links:", "Patient Links"); + nameCell(tr, /*!#*/"Links:", /*!#*/"Patient Links"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -485,10 +499,10 @@ public class PatientRenderer extends ResourceRenderer { private String describeLinkedRecord(String type) { switch (type) { - case "replaced-by" : return "This record replaced by"; - case "replaces": return "This record replaces"; - case "refer": return "Please refer to"; - case "seealso": return "Also see"; + case "replaced-by" : return /*!#*/"This record replaced by"; + case "replaces": return /*!#*/"This record replaces"; + case "refer": return /*!#*/"Please refer to"; + case "seealso": return /*!#*/"Also see"; } return "Unknown"; } @@ -550,9 +564,9 @@ public class PatientRenderer extends ResourceRenderer { } XhtmlNode tr = tbl.tr(); if (rels.size() == 1) { - nameCell(tr, (rels.get(0).getCodingFirstRep().hasDisplay() ? rels.get(0).getCodingFirstRep().getDisplay() : display(rels.get(0)))+":", "Nominated Contact: "+display(rels.get(0))); + nameCell(tr, (rels.get(0).getCodingFirstRep().hasDisplay() ? rels.get(0).getCodingFirstRep().getDisplay() : display(rels.get(0)))+":", /*!#*/"Nominated Contact: "+display(rels.get(0))); } else { - nameCell(tr, "Contact", "Patient contact"); + nameCell(tr, /*!#*/"Contact", /*!#*/"Patient contact"); } XhtmlNode td = tr.td(); td.colspan("3"); @@ -562,15 +576,15 @@ public class PatientRenderer extends ResourceRenderer { li = ul.li(); render(r, li, name); if (gender != null) { - li.tx(" ("+gender+")"); + li.tx(" "+/*!#*/"("+gender+")"); } } else if (gender != null) { li = ul.li(); - li.tx("Gender: "+gender); + li.tx(/*!#*/"Gender: "+gender); } if (rels.size() > 1) { li = ul.li(); - li.tx("Relationships: "); + li.tx(/*!#*/"Relationships: "); boolean first = true; for (CodeableConcept rel : rels) { if (first) first = false; else li.tx(", "); @@ -585,12 +599,12 @@ public class PatientRenderer extends ResourceRenderer { } if (organization != null) { li = ul.li(); - li.tx("Organization: "); + li.tx(/*!#*/"Organization: "); render(r, li, organization); } if (period != null) { li = ul.li(); - li.tx("Valid Period: "); + li.tx(/*!#*/"Valid Period: "); render(r, li, period); } } @@ -610,13 +624,13 @@ public class PatientRenderer extends ResourceRenderer { }; if (names.size() == 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Alt. Name:", "Alternate names (see the one above)"); + nameCell(tr, /*!#*/"Alt. Name:", /*!#*/"Alternate names (see the one above)"); XhtmlNode td = tr.td(); td.colspan("3"); render(r, td, names.get(0)); } else if (names.size() > 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Alt Names:", "Alternate names (see the one above)"); + nameCell(tr, /*!#*/"Alt Names:", /*!#*/"Alternate names (see the one above)"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -639,7 +653,7 @@ public class PatientRenderer extends ResourceRenderer { } if (tels.size() + adds.size() == 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Contact Detail:", "Ways to contact the Patient"); + nameCell(tr, /*!#*/"Contact Detail:", /*!#*/"Ways to contact the Patient"); XhtmlNode td = tr.td(); td.colspan("3"); if (adds.isEmpty()) { @@ -649,7 +663,7 @@ public class PatientRenderer extends ResourceRenderer { } } else if (tels.size() + adds.size() > 1) { XhtmlNode tr = tbl.tr(); - nameCell(tr, "Contact Details:", "Ways to contact the Patient"); + nameCell(tr, /*!#*/"Contact Details:", /*!#*/"Ways to contact the Patient"); XhtmlNode td = tr.td(); td.colspan("3"); XhtmlNode ul = td.ul(); @@ -684,7 +698,7 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper a = r.getChildByName("active"); if (a.hasValues()) { pos++; - nameCell(tr, "Active:", "Record is active"); + nameCell(tr, /*!#*/"Active:", /*!#*/"Record is active"); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -696,7 +710,7 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper a = r.getChildByName("deceased[x]"); if (a.hasValues()) { pos++; - nameCell(tr, "Deceased:", "Known status of Patient"); + nameCell(tr, /*!#*/"Deceased:", /*!#*/"Known status of Patient"); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -711,7 +725,7 @@ public class PatientRenderer extends ResourceRenderer { if (pos == 3) { tr = tbl.tr(); } - nameCell(tr, "Marital Status:", "Known Marital status of Patient"); + nameCell(tr, /*!#*/"Marital Status:", /*!#*/"Known Marital status of Patient"); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -726,7 +740,7 @@ public class PatientRenderer extends ResourceRenderer { if (pos == 3) { tr = tbl.tr(); } - nameCell(tr, "Multiple Birth:", "Known multipleBirth status of Patient"); + nameCell(tr, /*!#*/"Multiple Birth:", /*!#*/"Known multipleBirth status of Patient"); XhtmlNode td = tr.td(); if (pos == count) { td.colspan("3"); @@ -769,7 +783,7 @@ public class PatientRenderer extends ResourceRenderer { String n = UUID.randomUUID().toString().toLowerCase()+ext; TextFile.bytesToFile(att.getData(), new File(Utilities.path(context.getDestDir(), n))); context.registerFile(n); - td.img(n, "patient photo"); + td.img(n, /*!#*/"patient photo"); } return; } 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 0fc35a82b..c1b0d865c 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 @@ -107,9 +107,10 @@ public class ProfileDrivenRenderer extends ResourceRenderer { boolean idDone = false; XhtmlNode p = x.para(); if (context.isAddGeneratedNarrativeHeader()) { - p.b().tx("Generated Narrative: "+r.fhirType()+(context.isContained() ? " #"+r.getId() : "")); + p.b().tx(/*!#*/"Generated Narrative: "+r.fhirType()+(context.isContained() ? " #"+r.getId() : "")); if (!Utilities.noString(r.getId())) { p.an(r.getId()); + p.an("hc"+r.getId()); } idDone = true; } @@ -119,11 +120,12 @@ public class ProfileDrivenRenderer extends ResourceRenderer { } if (!Utilities.noString(r.getId()) && !idDone) { x.para().an(r.getId()); + x.para().an("hc"+r.getId()); } try { StructureDefinition sd = r.getDefinition(); if (sd == null) { - throw new FHIRException("Cannot find definition for "+r.fhirType()); + throw new FHIRException(/*!#*/"Cannot find definition for "+r.fhirType()); } else { ElementDefinition ed = sd.getSnapshot().getElement().get(0); containedIds.clear(); @@ -131,9 +133,9 @@ public class ProfileDrivenRenderer extends ResourceRenderer { generateByProfile(r, sd, r.root(), sd.getSnapshot().getElement(), ed, context.getProfileUtilities().getChildList(sd, ed), x, r.fhirType(), context.isTechnicalMode(), 0); } } catch (Exception e) { - System.out.println("Error Generating Narrative for "+r.fhirType()+"/"+r.getId()+": "+e.getMessage()); + System.out.println(/*!#*/"Error Generating Narrative for "+r.fhirType()+"/"+r.getId()+": "+e.getMessage()); e.printStackTrace(); - x.para().b().style("color: maroon").tx("Exception generating Narrative: "+e.getMessage()); + x.para().b().style("color: maroon").tx(/*!#*/"Exception generating Narrative: "+e.getMessage()); } return hasExtensions; } @@ -479,7 +481,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer { Reference r = (Reference) e; if (r.getReference() != null && r.getReference().contains("#")) { if (containedIds.contains(r.getReference().substring(1))) { - x.ah(r.getReference()).tx("See "+r.getReference()); + x.ah("#hc"+r.getReference().substring(1)).tx("See "+r.getReference()); } else { // in this case, we render the resource in line ResourceWrapper rw = null; @@ -493,7 +495,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer { } else { String ref = context.getResolver() != null ?context.getResolver().urlForContained(context, res.fhirType(), res.getId(), rw.fhirType(), rw.getId()) : null; if (ref == null) { - x.an(rw.getId()); + x.an("hc"+rw.getId()); RenderingContext ctxtc = context.copy(); ctxtc.setAddGeneratedNarrativeHeader(false); ctxtc.setContained(true); @@ -831,19 +833,12 @@ public class ProfileDrivenRenderer extends ResourceRenderer { if ("DomainResource.contained".equals(child.getBase().getPath())) { if (round2) { for (BaseWrapper v : p.getValues()) { - if (v.getBase() != null && !RendererFactory.hasSpecificRenderer(v.fhirType())) { + if (v.getResource() != null && !RendererFactory.hasSpecificRenderer(v.fhirType())) { x.hr(); RenderingContext ctxt = context.copy(); ctxt.setContained(true); ResourceRenderer rnd = RendererFactory.factory(v.fhirType(), ctxt); - ResourceWrapper rw = null; - if (v.getBase() instanceof org.hl7.fhir.r5.elementmodel.Element) { - rw = new ElementWrappers.ResourceWrapperMetaElement(ctxt, (org.hl7.fhir.r5.elementmodel.Element) v.getBase()); - } else if (v.getBase() instanceof Resource){ - rw = new DirectWrappers.ResourceWrapperDirect(ctxt, (Resource) v.getBase()); - } else { - throw new FHIRException("Not handled: base = "+v.getBase().getClass().getName()); - } + ResourceWrapper rw = v.getResource(); rnd.render(x.blockquote(), rw); } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProvenanceRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProvenanceRenderer.java index 6a177df65..4598a0d33 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProvenanceRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProvenanceRenderer.java @@ -29,10 +29,10 @@ public class ProvenanceRenderer extends ResourceRenderer { if (!prv.getTarget().isEmpty()) { if (prv.getTarget().size() == 1) { XhtmlNode p = x.para(); - p.tx("Provenance for "); + p.tx(/*!#*/"Provenance for "); renderReference(prv, p, prv.getTargetFirstRep()); } else { - x.para().tx("Provenance for:"); + x.para().tx(/*!#*/"Provenance for:"); XhtmlNode ul = x.ul(); for (Reference ref : prv.getTarget()) { renderReference(prv, ul.li(), ref); @@ -40,12 +40,12 @@ public class ProvenanceRenderer extends ResourceRenderer { } } // summary table - x.para().tx("Summary"); + x.para().tx(/*!#*/"Summary"); XhtmlNode t = x.table("grid"); XhtmlNode tr; if (prv.hasOccurred()) { tr = t.tr(); - tr.td().tx("Occurrence"); + tr.td().tx(/*!#*/"Occurrence"); if (prv.hasOccurredPeriod()) { renderPeriod(tr.td(), prv.getOccurredPeriod()); } else { @@ -54,12 +54,12 @@ public class ProvenanceRenderer extends ResourceRenderer { } if (prv.hasRecorded()) { tr = t.tr(); - tr.td().tx("Recorded"); + tr.td().tx(/*!#*/"Recorded"); tr.td().addText(prv.getRecordedElement().toHumanDisplay()); } if (prv.hasPolicy()) { tr = t.tr(); - tr.td().tx("Policy"); + tr.td().tx(/*!#*/"Policy"); if (prv.getPolicy().size() == 1) { renderUri(tr.td(), prv.getPolicy().get(0)); } else { @@ -71,12 +71,12 @@ public class ProvenanceRenderer extends ResourceRenderer { } if (prv.hasLocation()) { tr = t.tr(); - tr.td().tx("Location"); + tr.td().tx(/*!#*/"Location"); renderReference(prv, tr.td(), prv.getLocation()); } if (prv.hasActivity()) { tr = t.tr(); - tr.td().tx("Activity"); + tr.td().tx(/*!#*/"Activity"); renderCodeableConcept(tr.td(), prv.getActivity(), false); } @@ -88,18 +88,18 @@ public class ProvenanceRenderer extends ResourceRenderer { hasRole = hasRole || a.hasRole(); hasOnBehalfOf = hasOnBehalfOf || a.hasOnBehalfOf(); } - x.para().b().tx("Agents"); + x.para().b().tx(/*!#*/"Agents"); t = x.table("grid"); tr = t.tr(); if (hasType) { - tr.td().b().tx("Type"); + tr.td().b().tx(/*!#*/"Type"); } if (hasRole) { - tr.td().b().tx("Role"); + tr.td().b().tx(/*!#*/"Role"); } - tr.td().b().tx("who"); + tr.td().b().tx(/*!#*/"who"); if (hasOnBehalfOf) { - tr.td().b().tx("On Behalf Of"); + tr.td().b().tx(/*!#*/"On Behalf Of"); } for (ProvenanceAgentComponent a : prv.getAgent()) { tr = t.tr(); @@ -147,12 +147,12 @@ public class ProvenanceRenderer extends ResourceRenderer { } public String display(Provenance prv) throws UnsupportedEncodingException, IOException { - return "Provenance for "+displayReference(prv, prv.getTargetFirstRep()); + return /*!#*/"Provenance for "+displayReference(prv, prv.getTargetFirstRep()); } @Override public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException { - return "Not done yet"; + return /*!#*/"Not done yet"; } } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java index 58dc01eb1..3c99533e6 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java @@ -7,6 +7,7 @@ import java.util.List; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.context.ContextUtilities; +import org.hl7.fhir.r5.model.CanonicalResource; import org.hl7.fhir.r5.model.CanonicalType; import org.hl7.fhir.r5.model.CodeType; import org.hl7.fhir.r5.model.CodeableConcept; @@ -67,9 +68,9 @@ public class QuestionnaireRenderer extends TerminologyRenderer { boolean doOpts = context.getDefinitionsTarget() == null && hasAnyOptions(q.getItem()); if (doOpts) { - x.b().tx("Structure"); + x.b().tx(/*!#*/"Structure"); } - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("qtree="+q.getId(), context.getRules() == GenerationRules.IG_PUBLISHER); model.setAlternating(true); if (context.getRules() == GenerationRules.VALID_RESOURCE || context.isInlineGraphics()) { @@ -78,14 +79,14 @@ public class QuestionnaireRenderer extends TerminologyRenderer { model.setDocoImg(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "help16.png")); } model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table"); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "LinkId"), translate("sd.hint", "The linkId for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Text"), translate("sd.hint", "Text for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Cardinality"), translate("sd.hint", "Minimum and Maximum # of times the the itemcan appear in the instance"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Type"), translate("sd.hint", "The type of the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"LinkId", /*!#*/"The linkId for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Text", /*!#*/"Text for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Cardinality", /*!#*/"Minimum and Maximum # of times the the itemcan appear in the instance", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Type", /*!#*/"The type of the item", null, 0)); if (hasFlags) { - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Flags"), translate("sd.hint", "Other attributes of the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Flags", /*!#*/"Other attributes of the item", null, 0)); } - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Description & Constraints"), translate("sd.hint", "Additional information about the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Description & Constraints", /*!#*/"Additional information about the item", null, 0)); boolean hasExt = false; // first we add a root for the questionaire itself @@ -104,7 +105,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { private void renderOptions(Questionnaire q, XhtmlNode x) { if (hasAnyOptions(q.getItem())) { x.hr(); - x.para().b().tx("Option Sets"); + x.para().b().tx(/*!#*/"Option Sets"); renderOptions(q.getItem(), x); } } @@ -123,7 +124,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { useSelect = useSelect || opt.getInitialSelected(); } x.an("opt-item."+i.getLinkId()); - x.para().b().tx("Answer options for "+i.getLinkId()); + x.para().b().tx(/*!#*/"Answer options for "+i.getLinkId()); XhtmlNode ul = x.ul(); for (QuestionnaireItemAnswerOptionComponent opt : i.getAnswerOption()) { XhtmlNode li = ul.li(); @@ -208,11 +209,11 @@ public class QuestionnaireRenderer extends TerminologyRenderer { Row r = gen.new Row(); rows.add(r); - r.setIcon("icon_q_root.gif", "QuestionnaireRoot"); + r.setIcon("icon_q_root.gif", /*!#*/"QuestionnaireRoot"); r.getCells().add(gen.new Cell(null, null, q.getName(), null, null)); r.getCells().add(gen.new Cell(null, null, q.getDescription(), null, null)); r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell(null, null, "Questionnaire", null, null)); + r.getCells().add(gen.new Cell(null, null, /*!#*/"Questionnaire", null, null)); if (hasFlags) { r.getCells().add(gen.new Cell(null, null, "", null, null)); } @@ -224,14 +225,15 @@ public class QuestionnaireRenderer extends TerminologyRenderer { return Utilities.pathURL(context.getLink(KnownLinkType.SPEC), path); } - private String getSDCLink(String path) { - if (Utilities.isAbsoluteUrl(path)) { - StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, path); - if (sd != null) { - return sd.getWebPath(); - } else { - return path.replace("StructureDefinition/", "StructureDefinition-")+".html"; - } + private String getSDCLink(String url, String path) { + StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, url); + if (sd == null) { + sd = context.getContext().fetchResource(StructureDefinition.class, path); + } + if (sd != null && sd.hasWebPath()) { + return sd.getWebPath(); + } else if (Utilities.isAbsoluteUrl(path)) { + return path.replace("StructureDefinition/", "StructureDefinition-")+".html"; } else { return Utilities.pathURL("http://hl7.org/fhir/uv/sdc", path); // for now? } @@ -261,45 +263,45 @@ public class QuestionnaireRenderer extends TerminologyRenderer { Cell flags = gen.new Cell(); r.getCells().add(flags); if (i.getReadOnly()) { - flags.addPiece(gen.new Piece(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "questionnaire-definitions.html#Questionnaire.item.readOnly"), null, "Is Readonly").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-readonly.png")))); + flags.addPiece(gen.new Piece(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "questionnaire-definitions.html#Questionnaire.item.readOnly"), null, /*!#*/"Is Readonly").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-readonly.png")))); } if (ToolingExtensions.readBoolExtension(i, "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject")) { - flags.addPiece(gen.new Piece(getSDCLink("StructureDefinition-sdc-questionnaire-isSubject.html"), null, "Can change the subject of the questionnaire").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-subject.png")))); + flags.addPiece(gen.new Piece(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "StructureDefinition-sdc-questionnaire-isSubject.html"), null, /*!#*/"Can change the subject of the questionnaire").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-subject.png")))); } if (ToolingExtensions.readBoolExtension(i, ToolingExtensions.EXT_Q_HIDDEN)) { - flags.addPiece(gen.new Piece(getSpecLink("extension-questionnaire-hidden.html"), null, "Is a hidden item").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-hidden.png")))); + flags.addPiece(gen.new Piece(getSpecLink("extension-questionnaire-hidden.html"), null, /*!#*/"Is a hidden item").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-hidden.png")))); } if (ToolingExtensions.readBoolExtension(i, ToolingExtensions.EXT_Q_OTP_DISP)) { - flags.addPiece(gen.new Piece(getSDCLink("StructureDefinition-sdc-questionnaire-optionalDisplay.html"), null, "Is optional to display").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-optional.png")))); + flags.addPiece(gen.new Piece(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-optionalDisplay", "StructureDefinition-sdc-questionnaire-optionalDisplay.html"), null, /*!#*/"Is optional to display").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-optional.png")))); } if (i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod")) { - flags.addPiece(gen.new Piece(getSDCLink("StructureDefinition-sdc-questionnaire-observationLinkPeriod.html"), null, "Is linked to an observation").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-observation.png")))); + flags.addPiece(gen.new Piece(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod", "StructureDefinition-sdc-questionnaire-observationLinkPeriod.html"), null, /*!#*/"Is linked to an observation").addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-observation.png")))); } if (i.hasExtension(ToolingExtensions.EXT_Q_CHOICE_ORIENT)) { String code = ToolingExtensions.readStringExtension(i, ToolingExtensions.EXT_Q_CHOICE_ORIENT); - flags.addPiece(gen.new Piece(getSpecLink("extension-questionnaire-choiceorientation.html"), null, "Orientation: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); + flags.addPiece(gen.new Piece(getSpecLink("extension-questionnaire-choiceorientation.html"), null, /*!#*/"Orientation: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); } if (i.hasExtension(ToolingExtensions.EXT_Q_DISPLAY_CAT)) { CodeableConcept cc = i.getExtensionByUrl(ToolingExtensions.EXT_Q_DISPLAY_CAT).getValueCodeableConcept(); String code = cc.getCode("http://hl7.org/fhir/questionnaire-display-category"); - flags.addPiece(gen.new Piece("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", null, "Category: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); + flags.addPiece(gen.new Piece("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", null, /*!#*/"Category: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); } } Cell defn = gen.new Cell(); r.getCells().add(defn); if (i.hasMaxLength()) { - defn.getPieces().add(gen.new Piece(null, "Max Length: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Max Length: ", null)); defn.getPieces().add(gen.new Piece(null, Integer.toString(i.getMaxLength()), null)); } if (i.hasDefinition()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Definition: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Definition: ", null)); genDefinitionLink(gen, i, defn, q); } if (i.hasEnableWhen()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - Piece p = gen.new Piece(null, "Enable When: ", null); + Piece p = gen.new Piece(null, /*!#*/"Enable When: ", null); defn.getPieces().add(p); if (i.getEnableWhen().size() == 1) { XhtmlNode x = new XhtmlNode(NodeType.Element, "span"); @@ -315,7 +317,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } if (i.hasAnswerValueSet()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Value Set: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Value Set: ", null)); if (!Utilities.noString(i.getAnswerValueSet()) && i.getAnswerValueSet().startsWith("#")) { ValueSet vs = (ValueSet) q.getContained(i.getAnswerValueSet().substring(1)); if (vs == null) { @@ -334,7 +336,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } if (i.hasAnswerOption()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Options: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Options: ", null)); if (context.getDefinitionsTarget() == null) { // if we don't have a definitions target, we'll add them below. defn.getPieces().add(gen.new Piece("#opt-item."+i.getLinkId(), Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), null)); @@ -345,7 +347,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (i.hasInitial()) { for (QuestionnaireItemInitialComponent v : i.getInitial()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Initial Value: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Initial Value: ", null)); defn.getPieces().add(gen.new Piece(null, v.getValue().fhirType(), null)); defn.getPieces().add(gen.new Piece(null, " = ", null)); if (v.getValue().isPrimitive()) { @@ -373,26 +375,26 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression")) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Expressions: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Expressions: ", null)); Piece p = gen.new Piece("ul"); defn.getPieces().add(p); for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression")) { - addExpression(p, e.getValueExpression(), "Initial Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Initial Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression")) { - addExpression(p, e.getValueExpression(), "Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext")) { - addExpression(p, e.getValueExpression(), "Item Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); + addExpression(p, e.getValueExpression(), /*!#*/"Item Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression")) { - addExpression(p, e.getValueExpression(), "Enable When", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Enable When", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression")) { - addExpression(p, e.getValueExpression(), "Calculated Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Calculated Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression")) { - addExpression(p, e.getValueExpression(), "Candidates", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Candidates", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); } } @@ -447,13 +449,18 @@ public class QuestionnaireRenderer extends TerminologyRenderer { private void addExpression(Piece p, Expression exp, String label, String url) { XhtmlNode x = new XhtmlNode(NodeType.Element, "li").style("font-size: 11px"); p.addHtml(x); - x.ah(url).tx(label); + CanonicalResource cr = (CanonicalResource) context.getContext().fetchResource(Resource.class, url); + if (cr != null && cr.hasWebPath()) { + x.ah(cr.getWebPath()).tx(label); + } else { + x.ah(url).tx(label); + } x.tx(": "); x.code(exp.getExpression()); } private boolean renderLogic(XhtmlNode x, Questionnaire q) throws FHIRException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("qtree="+q.getId(), true); model.setAlternating(true); if (context.getRules() == GenerationRules.VALID_RESOURCE || context.isInlineGraphics()) { @@ -462,8 +469,8 @@ public class QuestionnaireRenderer extends TerminologyRenderer { model.setDocoImg(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "help16.png")); } model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table"); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "LinkId"), translate("sd.hint", "The linkId for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Description & Constraints"), translate("sd.hint", "Additional information about the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"LinkId", /*!#*/"The linkId for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Description & Constraints", /*!#*/"Additional information about the item", null, 0)); boolean hasExt = false; if (!q.hasItem()) { @@ -489,22 +496,22 @@ public class QuestionnaireRenderer extends TerminologyRenderer { r.getCells().add(defn); if (i.hasMaxLength()) { - defn.getPieces().add(gen.new Piece(null, "Max Length: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Max Length: ", null)); defn.getPieces().add(gen.new Piece(null, Integer.toString(i.getMaxLength()), null)); } if (i.hasDefinition()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Definition: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Definition: ", null)); genDefinitionLink(gen, i, defn, q); } if (i.hasEnableWhen()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Enable When: ", null)); - defn.getPieces().add(gen.new Piece(null, "todo", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Enable When: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"todo", null)); } if (i.hasAnswerValueSet()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Value Set: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Value Set: ", null)); if (Utilities.noString(i.getAnswerValueSet()) && i.getAnswerValueSet().startsWith("#")) { ValueSet vs = (ValueSet) q.getContained(i.getAnswerValueSet().substring(1)); if (vs == null) { @@ -523,13 +530,13 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } if (i.hasAnswerOption()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Options: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Options: ", null)); defn.getPieces().add(gen.new Piece(context.getDefinitionsTarget()+"#item."+i.getLinkId(), Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), null)); } if (i.hasInitial()) { for (QuestionnaireItemInitialComponent v : i.getInitial()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Initial Value: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Initial Value: ", null)); defn.getPieces().add(gen.new Piece(null, v.getValue().fhirType(), null)); defn.getPieces().add(gen.new Piece(null, " = ", null)); if (v.getValue().isPrimitive()) { @@ -557,26 +564,26 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression") || i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression")) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Expressions: ", null)); + defn.getPieces().add(gen.new Piece(null, /*!#*/"Expressions: ", null)); Piece p = gen.new Piece("ul"); defn.getPieces().add(p); for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression")) { - addExpression(p, e.getValueExpression(), "Initial Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Initial Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression")) { - addExpression(p, e.getValueExpression(), "Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext")) { - addExpression(p, e.getValueExpression(), "Item Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); + addExpression(p, e.getValueExpression(), /*!#*/"Item Context", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemContext"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression")) { - addExpression(p, e.getValueExpression(), "Enable When", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Enable When", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression")) { - addExpression(p, e.getValueExpression(), "Calculated Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Calculated Value", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression"); } for (Extension e : i.getExtensionsByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression")) { - addExpression(p, e.getValueExpression(), "Candidates", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); + addExpression(p, e.getValueExpression(), /*!#*/"Candidates", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression"); } } @@ -633,7 +640,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } p.span(null, "linkId: "+i.getLinkId()).tx(i.getText()); if (i.getRequired()) { - p.span("color: red", "Mandatory").tx("*"); + p.span("color: red", /*!#*/"Mandatory").tx("*"); } XhtmlNode input = null; @@ -712,39 +719,39 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (ToolingExtensions.readBoolExtension(i, "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject")) { hasFlag = true; - flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject"), "Can change the subject of the questionnaire").img(getImgPath("icon-qi-subject.png"), "icon"); + flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "StructureDefinition-sdc-questionnaire-isSubject.html"), /*!#*/"Can change the subject of the questionnaire").img(getImgPath("icon-qi-subject.png"), "icon"); } if (ToolingExtensions.readBoolExtension(i, ToolingExtensions.EXT_Q_HIDDEN)) { hasFlag = true; - flags.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "extension-questionnaire-hidden.html"), "Is a hidden item").img(getImgPath("icon-qi-hidden.png"), "icon"); + flags.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "extension-questionnaire-hidden.html"), /*!#*/"Is a hidden item").img(getImgPath("icon-qi-hidden.png"), "icon"); d.style("background-color: #eeeeee"); } if (ToolingExtensions.readBoolExtension(i, ToolingExtensions.EXT_Q_OTP_DISP)) { hasFlag = true; - flags.ah(getSDCLink(ToolingExtensions.EXT_Q_OTP_DISP), "Is optional to display").img(getImgPath("icon-qi-optional.png"), "icon"); + flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-optionalDisplay", "StructureDefinition-sdc-questionnaire-optionalDisplay.html"), /*!#*/"Is optional to display").img(getImgPath("icon-qi-optional.png"), "icon"); } if (i.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod")) { hasFlag = true; - flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod"), "Is linked to an observation").img(getImgPath("icon-qi-observation.png"), "icon"); + flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod", "StructureDefinition-sdc-questionnaire-observationLinkPeriod.html"), /*!#*/"Is linked to an observation").img(getImgPath("icon-qi-observation.png"), "icon"); } if (i.hasExtension(ToolingExtensions.EXT_Q_DISPLAY_CAT)) { CodeableConcept cc = i.getExtensionByUrl(ToolingExtensions.EXT_Q_DISPLAY_CAT).getValueCodeableConcept(); String code = cc.getCode("http://hl7.org/fhir/questionnaire-display-category"); hasFlag = true; - flags.ah("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", "Category: "+code).img(getImgPath("icon-qi-" + code + ".png"), "icon"); + flags.ah("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", /*!#*/"Category: "+code).img(getImgPath("icon-qi-" + code + ".png"), "icon"); } if (i.hasMaxLength()) { - item(ul, "Max Length", Integer.toString(i.getMaxLength())); + item(ul, /*!#*/"Max Length", Integer.toString(i.getMaxLength())); } if (i.hasDefinition()) { - genDefinitionLink(item(ul, "Definition"), i, q); + genDefinitionLink(item(ul, /*!#*/"Definition"), i, q); } if (i.hasEnableWhen()) { - item(ul, "Enable When", "todo"); + item(ul, /*!#*/"Enable When", "todo"); } if (i.hasAnswerValueSet()) { - XhtmlNode ans = item(ul, "Answers"); + XhtmlNode ans = item(ul, /*!#*/"Answers"); if (!Utilities.noString(i.getAnswerValueSet()) && i.getAnswerValueSet().startsWith("#")) { ValueSet vs = (ValueSet) q.getContained(i.getAnswerValueSet().substring(1)); if (vs == null || !vs.hasWebPath()) { @@ -762,10 +769,10 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } } if (i.hasAnswerOption()) { - item(ul, "Answers", Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), context.getDefinitionsTarget()+"#item."+i.getLinkId()); + item(ul, /*!#*/"Answers", Integer.toString(i.getAnswerOption().size())+" "+Utilities.pluralize("option", i.getAnswerOption().size()), context.getDefinitionsTarget()+"#item."+i.getLinkId()); } if (i.hasInitial()) { - XhtmlNode vi = item(ul, "Initial Values"); + XhtmlNode vi = item(ul, /*!#*/"Initial Values"); boolean first = true; for (QuestionnaireItemInitialComponent v : i.getInitial()) { if (first) first = false; else vi.tx(", "); @@ -876,13 +883,13 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } public String display(Questionnaire q) throws UnsupportedEncodingException, IOException { - return "Questionnaire "+q.present(); + return /*!#*/"Questionnaire "+q.present(); } private boolean renderLinks(XhtmlNode x, Questionnaire q) { - x.para().tx("Try this questionnaire out:"); + x.para().tx(/*!#*/"Try this questionnaire out:"); XhtmlNode ul = x.ul(); - ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx("NLM Forms Library"); + ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx(/*!#*/"NLM Forms Library"); return false; } @@ -901,42 +908,42 @@ public class QuestionnaireRenderer extends TerminologyRenderer { XhtmlNode td = tbl.tr().td("structure").colspan("2").span(null, null).attribute("class", "self-link-parent"); td.an(q.getId()); td.img(getImgPath("icon_q_root.gif"), "icon"); - td.tx(" Questionnaire "); + td.tx(" "+/*!#*/"Questionnaire "); td.b().tx(q.getId()); // general information - defn(tbl, "URL", q.getUrl()); - defn(tbl, "Version", q.getVersion()); - defn(tbl, "Name", q.getName()); - defn(tbl, "Title", q.getTitle()); + defn(tbl, /*!#*/"URL", q.getUrl()); + defn(tbl, /*!#*/"Version", q.getVersion()); + defn(tbl, /*!#*/"Name", q.getName()); + defn(tbl, /*!#*/"Title", q.getTitle()); if (q.hasDerivedFrom()) { - td = defn(tbl, "Derived From"); + td = defn(tbl, /*!#*/"Derived From"); boolean first = true; for (CanonicalType c : q.getDerivedFrom()) { if (first) first = false; else td.tx(", "); td.tx(c.asStringValue()); // todo: make these a reference } } - defn(tbl, "Status", q.getStatus().getDisplay()); - defn(tbl, "Experimental", q.getExperimental()); - defn(tbl, "Publication Date", q.getDateElement().primitiveValue()); - defn(tbl, "Approval Date", q.getApprovalDateElement().primitiveValue()); - defn(tbl, "Last Review Date", q.getLastReviewDateElement().primitiveValue()); + defn(tbl, /*!#*/"Status", q.getStatus().getDisplay()); + defn(tbl, /*!#*/"Experimental", q.getExperimental()); + defn(tbl, /*!#*/"Publication Date", q.getDateElement().primitiveValue()); + defn(tbl, /*!#*/"Approval Date", q.getApprovalDateElement().primitiveValue()); + defn(tbl, /*!#*/"Last Review Date", q.getLastReviewDateElement().primitiveValue()); if (q.hasEffectivePeriod()) { - renderPeriod(defn(tbl, "Effective Period"), q.getEffectivePeriod()); + renderPeriod(defn(tbl, /*!#*/"Effective Period"), q.getEffectivePeriod()); } if (q.hasSubjectType()) { - td = defn(tbl, "Subject Type"); + td = defn(tbl, /*!#*/"Subject Type"); boolean first = true; for (CodeType c : q.getSubjectType()) { if (first) first = false; else td.tx(", "); td.tx(c.asStringValue()); } } - defn(tbl, "Description", q.getDescription()); - defn(tbl, "Purpose", q.getPurpose()); - defn(tbl, "Copyright", q.getCopyright()); + defn(tbl, /*!#*/"Description", q.getDescription()); + defn(tbl, /*!#*/"Purpose", q.getPurpose()); + defn(tbl, /*!#*/"Copyright", q.getCopyright()); if (q.hasCode()) { td = defn(tbl, Utilities.pluralize("Code", q.getCode().size())); boolean first = true; @@ -961,37 +968,37 @@ public class QuestionnaireRenderer extends TerminologyRenderer { td.b().tx(qi.getLinkId()); // general information - defn(tbl, "Link Id", qi.getLinkId()); - defn(tbl, "Prefix", qi.getPrefix()); - defn(tbl, "Text", qi.getText()); - defn(tbl, "Type", qi.getType().getDisplay()); - defn(tbl, "Required", qi.getRequired(), true); - defn(tbl, "Repeats", qi.getRepeats(), true); - defn(tbl, "Read Only", qi.getReadOnly(), false); + defn(tbl, /*!#*/"Link Id", qi.getLinkId()); + defn(tbl, /*!#*/"Prefix", qi.getPrefix()); + defn(tbl, /*!#*/"Text", qi.getText()); + defn(tbl, /*!#*/"Type", qi.getType().getDisplay()); + defn(tbl, /*!#*/"Required", qi.getRequired(), true); + defn(tbl, /*!#*/"Repeats", qi.getRepeats(), true); + defn(tbl, /*!#*/"Read Only", qi.getReadOnly(), false); if (ToolingExtensions.readBoolExtension(qi, "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject")) { - defn(tbl, "Subject", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "This element changes who the subject of the question is", null); + defn(tbl, /*!#*/"Subject", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject", "This element changes who the subject of the question is", null); } // content control - defn(tbl, "Max Length", qi.getMaxLength()); + defn(tbl, /*!#*/"Max Length", qi.getMaxLength()); if (qi.hasAnswerValueSet()) { - defn(tbl, "Value Set", qi.getDefinition(), context.getWorker().findTxResource(ValueSet.class, qi.getAnswerValueSet(), q)); + defn(tbl, /*!#*/"Value Set", qi.getDefinition(), context.getWorker().findTxResource(ValueSet.class, qi.getAnswerValueSet(), q)); } if (qi.hasAnswerOption()) { XhtmlNode tr = tbl.tr(); - tr.td().tx("Allowed Answers"); + tr.td().tx(/*!#*/"Allowed Answers"); XhtmlNode ul = tr.td().ul(); for (QuestionnaireItemAnswerOptionComponent ans : qi.getAnswerOption()) { XhtmlNode li = ul.li(); render(li, ans.getValue()); if (ans.getInitialSelected()) { - li.tx(" (initially selected)"); + li.tx(" "+/*!#*/"(initially selected)"); } } } if (qi.hasInitial()) { XhtmlNode tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Initial Answer", qi.getInitial().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Initial Answer", qi.getInitial().size())); if (qi.getInitial().size() == 1) { render(tr.td(), qi.getInitialFirstRep().getValue()); } else { @@ -1010,20 +1017,20 @@ public class QuestionnaireRenderer extends TerminologyRenderer { render(tr.td(), qi.getExtensionByUrl(ToolingExtensions.EXT_Q_DISPLAY_CAT).getValue()); } if (ToolingExtensions.readBoolExtension(qi, ToolingExtensions.EXT_Q_HIDDEN)) { - defn(tbl, "Hidden Item", ToolingExtensions.EXT_Q_DISPLAY_CAT, "This item is a hidden question", null); + defn(tbl, /*!#*/"Hidden Item", ToolingExtensions.EXT_Q_DISPLAY_CAT, "This item is a hidden question", null); } if (ToolingExtensions.readBoolExtension(qi, ToolingExtensions.EXT_Q_OTP_DISP)) { - defn(tbl, "Hidden Item", ToolingExtensions.EXT_Q_OTP_DISP, "This item is optional to display", null); + defn(tbl, /*!#*/"Hidden Item", ToolingExtensions.EXT_Q_OTP_DISP, "This item is optional to display", null); } // formal definitions if (qi.hasDefinition()) { - genDefinitionLink(defn(tbl, "Definition"), qi, q); + genDefinitionLink(defn(tbl, /*!#*/"Definition"), qi, q); } if (qi.hasCode()) { XhtmlNode tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Code", qi.getCode().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Code", qi.getCode().size())); XhtmlNode ul = tr.td().ul(); for (Coding c : qi.getCode()) { renderCodingWithDetails(ul.li(), c); @@ -1031,22 +1038,27 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } if (qi.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod")) { XhtmlNode tr = tbl.tr(); - tr.td().ah("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod").tx("Observation Link Period"); + StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, ToolingExtensions.EXT_O_LINK_PERIOD); + if (sd != null && sd.hasWebPath()) { + tr.td().ah(sd.getWebPath()).tx(/*!#*/"Observation Link Period"); + } else { + tr.td().ah("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod").tx(/*!#*/"Observation Link Period"); + } render(tr.td(), qi.getExtensionByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationLinkPeriod").getValue()); } // dynamic management if (qi.hasEnableWhen()) { XhtmlNode tr = tbl.tr(); - tr.td().tx("Enable When"); + tr.td().tx(/*!#*/"Enable When"); td = tr.td(); if (qi.getEnableWhen().size() == 1) { renderEnableWhen(td, qi.getEnableWhen().get(0)); } else { if (qi.hasEnableBehavior()) { - td.tx(qi.getEnableBehavior().getDisplay()+" are true:"); + td.tx(qi.getEnableBehavior().getDisplay()+" "+/*!#*/"are true:"); } else { - td.tx("?? are true:"); + td.tx(/*!#*/"?? are true:"); } XhtmlNode ul = td.ul(); for (QuestionnaireItemEnableWhenComponent ew : qi.getEnableWhen()) { @@ -1071,11 +1083,11 @@ public class QuestionnaireRenderer extends TerminologyRenderer { private void defn(XhtmlNode tbl, String name, String url, Resource res) throws UnsupportedEncodingException, IOException { if (res != null && res.hasWebPath()) { - defn(tbl, "Definition", RendererFactory.factory(res, context).display(res), res.getWebPath()); + defn(tbl, /*!#*/"Definition", RendererFactory.factory(res, context).display(res), res.getWebPath()); } else if (Utilities.isAbsoluteUrlLinkable(url)) { - defn(tbl, "Definition", url, url); + defn(tbl, /*!#*/"Definition", url, url); } { - defn(tbl, "Definition", url); + defn(tbl, /*!#*/"Definition", url); } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java index 4078d8063..e1c68fcba 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java @@ -45,7 +45,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // case DEFNS: return renderDefns(x, q); case TREE: return renderTree(x, q); default: - throw new Error("Unknown QuestionnaireResponse Renderer Mode"); + throw new Error(/*!#*/"Unknown QuestionnaireResponse Renderer Mode"); } } @@ -57,12 +57,12 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // case DEFNS: return renderDefns(x, q); case TREE: return renderTree(x, qr); default: - throw new Error("Unknown QuestionnaireResponse Renderer Mode"); + throw new Error(/*!#*/"Unknown QuestionnaireResponse Renderer Mode"); } } public boolean renderTree(XhtmlNode x, ResourceWrapper qr) throws UnsupportedEncodingException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("qtree="+qr.getId(), false); model.setAlternating(true); if (context.getRules() == GenerationRules.VALID_RESOURCE || context.isInlineGraphics()) { @@ -71,10 +71,10 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { model.setDocoImg(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "help16.png")); } model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table"); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "LinkId"), translate("sd.hint", "The linkId for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Text"), translate("sd.hint", "Text for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Definition"), translate("sd.hint", "Minimum and Maximum # of times the the itemcan appear in the instance"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Answer"), translate("sd.hint", "The type of the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"LinkId", /*!#*/"The linkId for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Text", /*!#*/"Text for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Definition", /*!#*/"Minimum and Maximum # of times the the itemcan appear in the instance", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Answer", /*!#*/"The type of the item", null, 0)); boolean hasExt = false; // first we add a root for the questionaire itself @@ -89,7 +89,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { } public boolean renderTree(XhtmlNode x, QuestionnaireResponse q) throws UnsupportedEncodingException, IOException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("qtree="+q.getId(), true); model.setAlternating(true); if (context.getRules() == GenerationRules.VALID_RESOURCE || context.isInlineGraphics()) { @@ -98,10 +98,10 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { model.setDocoImg(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "help16.png")); } model.setDocoRef(context.getLink(KnownLinkType.SPEC)+"formats.html#table"); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "LinkId"), translate("sd.hint", "The linkId for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Text"), translate("sd.hint", "Text for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Definition"), translate("sd.hint", "Minimum and Maximum # of times the the itemcan appear in the instance"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Answer"), translate("sd.hint", "The type of the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"LinkId", /*!#*/"The linkId for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Text", /*!#*/"Text for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Definition", /*!#*/"Minimum and Maximum # of times the the itemcan appear in the instance", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Answer", /*!#*/"The type of the item", null, 0)); boolean hasExt = false; // first we add a root for the questionaire itself @@ -120,10 +120,10 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { Row r = gen.new Row(); rows.add(r); - r.setIcon("icon_q_root.gif", "QuestionnaireResponseRoot"); + r.setIcon("icon_q_root.gif", /*!#*/"QuestionnaireResponseRoot"); r.getCells().add(gen.new Cell(null, null, q.getId(), null, null)); r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell(null, null, "QuestionnaireResponse", null, null)); + r.getCells().add(gen.new Cell(null, null, /*!#*/"QuestionnaireResponse", null, null)); r.getCells().add(gen.new Cell(null, null, "", null, null)); return r; } @@ -136,18 +136,18 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { String ref = b == null ? null : b.primitiveValue(); Questionnaire q = context.getContext().fetchResource(Questionnaire.class, ref); - r.setIcon("icon_q_root.gif", "QuestionnaireResponseRoot"); + r.setIcon("icon_q_root.gif", /*!#*/"QuestionnaireResponseRoot"); r.getCells().add(gen.new Cell(null, null, qr.getId(), null, null)); r.getCells().add(gen.new Cell(null, null, "", null, null)); if (ref == null ) { r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell("Questionnaire:", null, "None specified", null, null)); + r.getCells().add(gen.new Cell(/*!#*/"Questionnaire:", null, /*!#*/"None specified", null, null)); } else if (q == null || !q.hasWebPath()) { r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell("Questionnaire:", null, ref, null, null)); + r.getCells().add(gen.new Cell(/*!#*/"Questionnaire:", null, ref, null, null)); } else{ r.getCells().add(gen.new Cell(null, null, "", null, null)); - r.getCells().add(gen.new Cell("Questionnaire:", q.getWebPath(), q.present(), null, null)); + r.getCells().add(gen.new Cell(/*!#*/"Questionnaire:", q.getWebPath(), q.present(), null, null)); } return r; } @@ -168,9 +168,9 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { } } if (hasItem) { - r.setIcon("icon-q-group.png", "Group"); + r.setIcon("icon-q-group.png", /*!#*/"Group"); } else { - r.setIcon("icon-q-string.png", "Item"); + r.setIcon("icon-q-string.png", /*!#*/"Item"); } String linkId = i.has("linkId") ? i.get("linkId").primitiveValue() : "??"; String text = i.has("text") ? i.get("text").primitiveValue() : ""; @@ -235,9 +235,9 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { hasItem = a.hasItem(); } if (hasItem) { - r.setIcon("icon-q-group.png", "Group"); + r.setIcon("icon-q-group.png", /*!#*/"Group"); } else { - r.setIcon("icon-q-string.png", "Item"); + r.setIcon("icon-q-string.png", /*!#*/"Item"); } r.getCells().add(gen.new Cell(null, context.getDefinitionsTarget() == null ? "" : context.getDefinitionsTarget()+"#item."+i.getLinkId(), i.getLinkId(), null, null)); r.getCells().add(gen.new Cell(null, null, i.getText(), null, null)); @@ -327,7 +327,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { public boolean renderForm(XhtmlNode x, ResourceWrapper q) throws UnsupportedEncodingException, IOException { boolean hasExt = false; XhtmlNode d = x.div(); - d.tx("todo"); + d.tx(/*!#*/"todo"); // boolean hasPrefix = false; // for (QuestionnaireItemComponent c : q.getItem()) { // hasPrefix = hasPrefix || doesItemHavePrefix(c); @@ -370,7 +370,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // p.span(null, "linkId: "+i.getLinkId()).tx(i.getText()); // if (i.getRequired()) { -// p.span("color: red", "Mandatory").tx("*"); +// p.span("color: red", /*!#*/"Mandatory").tx("*"); // } // // XhtmlNode input = null; @@ -605,16 +605,16 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // private boolean renderLinks(XhtmlNode x, QuestionnaireResponse q) { - x.para().tx("Try this QuestionnaireResponse out:"); + x.para().tx(/*!#*/"Try this QuestionnaireResponse out:"); XhtmlNode ul = x.ul(); - ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx("NLM Forms Library"); + ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx(/*!#*/"NLM Forms Library"); return false; } private boolean renderLinks(XhtmlNode x, ResourceWrapper q) { - x.para().tx("Try this QuestionnaireResponse out:"); + x.para().tx(/*!#*/"Try this QuestionnaireResponse out:"); XhtmlNode ul = x.ul(); - ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx("NLM Forms Library"); + ul.li().ah("http://todo.nlm.gov/path?mode=ig&src="+Utilities.pathURL(context.getLink(KnownLinkType.SELF), "package.tgz")+"&q="+q.getId()+".json").tx(/*!#*/"NLM Forms Library"); return false; } @@ -711,13 +711,13 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // if (qi.hasAnswerOption()) { // XhtmlNode tr = tbl.tr(); -// tr.td().tx("Allowed Answers"); +// tr.td().tx(/*!#*/"Allowed Answers"); // XhtmlNode ul = tr.td().ul(); // for (QuestionnaireItemAnswerOptionComponent ans : qi.getAnswerOption()) { // XhtmlNode li = ul.li(); // render(li, ans.getValue()); // if (ans.getInitialSelected()) { -// li.tx(" (initially selected)"); +// li.tx(/*!#*/" (initially selected)"); // } // } // } @@ -738,7 +738,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // // appearance // if (qi.hasExtension(" http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory")) { // XhtmlNode tr = tbl.tr(); -// tr.td().ah("http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory").tx("Display Category"); +// tr.td().ah("http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory").tx(/*!#*/"Display Category"); // render(tr.td(), qi.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory").getValue()); // } // if (ToolingExtensions.readBoolExtension(qi, "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-hidden")) { @@ -763,14 +763,14 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // } // if (qi.hasExtension("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-observationLinkPeriod")) { // XhtmlNode tr = tbl.tr(); -// tr.td().ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-observationLinkPeriod").tx("Observation Link Period"); +// tr.td().ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-observationLinkPeriod").tx(/*!#*/"Observation Link Period"); // render(tr.td(), qi.getExtensionByUrl("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-observationLinkPeriod").getValue()); // } // // // dynamic management // if (qi.hasEnableWhen()) { // XhtmlNode tr = tbl.tr(); -// tr.td().tx("Enable When"); +// tr.td().tx(/*!#*/"Enable When"); // td = tr.td(); // if (qi.getEnableWhen().size() == 1) { // renderEnableWhen(td, qi.getEnableWhen().get(0)); @@ -876,12 +876,12 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { @Override public String display(Resource r) throws UnsupportedEncodingException, IOException { - return "todo"; + return /*!#*/"todo"; } @Override public String display(ResourceWrapper r) throws UnsupportedEncodingException, IOException { - return "Not done yet"; + return /*!#*/"Not done yet"; } } \ No newline at end of file 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 b555b6867..cff967a4b 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 @@ -1,13 +1,15 @@ package org.hl7.fhir.r5.renderers; +import java.util.Date; + import org.hl7.fhir.r5.comparison.VersionComparisonAnnotation; import org.hl7.fhir.r5.context.IWorkerContext; import org.hl7.fhir.r5.model.Base; +import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.renderers.utils.RenderingContext; import org.hl7.fhir.r5.renderers.utils.RenderingContext.GenerationRules; import org.hl7.fhir.r5.renderers.utils.RenderingContext.KnownLinkType; import org.hl7.fhir.r5.renderers.utils.RenderingContext.ResourceRendererMode; -import org.hl7.fhir.r5.utils.TranslatingUtilities; import org.hl7.fhir.utilities.MarkDownProcessor; import org.hl7.fhir.utilities.StandardsStatus; import org.hl7.fhir.utilities.Utilities; @@ -33,7 +35,7 @@ import org.hl7.fhir.utilities.xhtml.XhtmlNode; * @author graha * */ -public class Renderer extends TranslatingUtilities { +public class Renderer { protected RenderingContext context; @@ -46,42 +48,14 @@ public class Renderer extends TranslatingUtilities { } - protected static final String RENDER_BUNDLE_HEADER_ROOT = "RENDER_BUNDLE_HEADER_ROOT"; - protected static final String RENDER_BUNDLE_HEADER_ENTRY = "RENDER_BUNDLE_HEADER_ENTRY"; - protected static final String RENDER_BUNDLE_HEADER_ENTRY_URL = "RENDER_BUNDLE_HEADER_ENTRY_URL"; - protected static final String RENDER_BUNDLE_RESOURCE = "RENDER_BUNDLE_RESOURCE"; - protected static final String RENDER_BUNDLE_SEARCH = "RENDER_BUNDLE_SEARCH"; - protected static final String RENDER_BUNDLE_SEARCH_MODE = "RENDER_BUNDLE_SEARCH_MODE"; - protected static final String RENDER_BUNDLE_SEARCH_SCORE = "RENDER_BUNDLE_SEARCH_SCORE"; - protected static final String RENDER_BUNDLE_RESPONSE = "RENDER_BUNDLE_RESPONSE"; - protected static final String RENDER_BUNDLE_LOCATION = "RENDER_BUNDLE_LOCATION"; - protected static final String RENDER_BUNDLE_ETAG = "RENDER_BUNDLE_ETAG"; - protected static final String RENDER_BUNDLE_LAST_MOD = "RENDER_BUNDLE_LAST_MOD"; - protected static final String RENDER_BUNDLE_REQUEST = "RENDER_BUNDLE_REQUEST"; - protected static final String RENDER_BUNDLE_IF_NON_MATCH = "RENDER_BUNDLE_IF_NON_MATCH"; - 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 - * - * @param theMessage - * @param theMessageArguments - * @return - */ protected String formatMessage(String theMessage, Object... theMessageArguments) { - return context.getWorker().formatMessage(theMessage, theMessageArguments); + return context.formatMessage(theMessage, theMessageArguments); } public void genStandardsStatus(XhtmlNode td, StandardsStatus ss) { if (ss != null) { td.tx(" "); - XhtmlNode a = td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "versions.html#std-process"), "Standards Status = "+ss.toDisplay()); + XhtmlNode a = td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "versions.html#std-process"), /*!#*/"Standards Status = "+ss.toDisplay()); a.style("padding-left: 3px; padding-right: 3px; border: 1px grey solid; font-weight: bold; color: black; background-color: "+ss.getColor()); a.tx(ss.getAbbrev()); } @@ -98,21 +72,21 @@ public class Renderer extends TranslatingUtilities { switch (vca.getType()) { case Added: XhtmlNode spanOuter = x.span("border: solid 1px #dddddd; margin: 2px; padding: 2px", null); - XhtmlNode spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been added since "+context.getChangeVersion()); + XhtmlNode spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been added since "+context.getChangeVersion()); spanInner.img("icon-change-add.png", "icon"); - spanInner.tx(" Added:"); + spanInner.tx(" "+/*!#*/"Added:"); return spanOuter; case Changed: spanOuter = x.span("border: solid 1px #dddddd; margin: 2px; padding: 2px", null); - spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been changed since "+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+vca.getOriginal()+"')" : "")); + spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been changed since "+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+vca.getOriginal()+"')" : "")); spanInner.img("icon-change-edit.png", "icon"); - spanInner.tx(" Changed:"); + spanInner.tx(" "+/*!#*/"Changed:"); return spanOuter; case Deleted: spanOuter = x.span("border: solid 1px #dddddd; margin: 2px; padding: 2px", null); - spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been removed since "+context.getChangeVersion()); + spanInner = spanOuter.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been removed since "+context.getChangeVersion()); spanInner.img("icon-change-remove.png", "icon"); - spanInner.tx(" Removed:"); + spanInner.tx(" "+/*!#*/"Removed:"); return spanOuter.strikethrough(); default: return x; @@ -130,21 +104,21 @@ public class Renderer extends TranslatingUtilities { switch (vca.getType()) { case Added: XhtmlNode divOuter = x.div("border: solid 1px #dddddd; margin: 2px; padding: 2px"); - XhtmlNode spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been added since "+context.getChangeVersion()); + XhtmlNode spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been added since "+context.getChangeVersion()); spanInner.img("icon-change-add.png", "icon"); - spanInner.tx(" Added:"); + spanInner.tx(" "+/*!#*/"Added:"); return divOuter; case Changed: divOuter = x.div("border: solid 1px #dddddd; margin: 2px; padding: 2px"); - spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been changed since "+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+(vca.getOriginal())+"')" : "")); + spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been changed since "+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+(vca.getOriginal())+"')" : "")); spanInner.img("icon-change-edit.png", "icon"); - spanInner.tx(" Changed:"); + spanInner.tx(" "+/*!#*/"Changed:"); return divOuter; case Deleted: divOuter = x.div("border: solid 1px #dddddd; margin: 2px; padding: 2px"); - spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been removed since "+context.getChangeVersion()); + spanInner = divOuter.para().style("margin: 0").span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been removed since "+context.getChangeVersion()); spanInner.img("icon-change-remove.png", "icon"); - spanInner.tx(" Removed:"); + spanInner.tx(" "+/*!#*/"Removed:"); return divOuter.strikethrough(); default: return x; @@ -166,27 +140,27 @@ public class Renderer extends TranslatingUtilities { tr.style("border: solid 1px #dddddd; margin: 2px; padding: 2px"); } XhtmlNode td = tr.td(); - XhtmlNode span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This row of content has been added since "+context.getChangeVersion()); + XhtmlNode span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px",/*!#*/"This row of content has been added since "+context.getChangeVersion()); span.img("icon-change-add.png", "icon"); - span.tx(" Added:"); + span.tx(" "+/*!#*/"Added:"); XhtmlNode x = new XhtmlNode(NodeType.Element, "holder"); - x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This row of content has been added since "+context.getChangeVersion()).tx(" "); + x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This row of content has been added since "+context.getChangeVersion()).tx(" "); tr.styleCells(x); return td; case Changed: td = tr.td(); - span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This row of content has been changed since"+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+vca.getOriginal()+"')" : "")); + span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This row of content has been changed since"+context.getChangeVersion()+(vca.getOriginal() != null ? " (was '"+vca.getOriginal()+"')" : "")); span.img("icon-change-edit.png", "icon"); - span.tx(" Changed:"); + span.tx(" "+/*!#*/"Changed:"); return td; case Deleted: tr.style("text-decoration: line-through"); td = tr.td(); - span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been removed since "+context.getChangeVersion()); + span = td.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been removed since "+context.getChangeVersion()); span.img("icon-change-remove.png", "icon"); - span.tx(" Removed:"); + span.tx(" "+/*!#*/"Removed:"); x = new XhtmlNode(NodeType.Element, "holder"); - x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px; text-decoration: none", "This row of content has been added since "+context.getChangeVersion()).tx(" "); + x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px; text-decoration: none", /*!#*/"This row of content has been added since "+context.getChangeVersion()).tx(" "); tr.styleCells(x); return td; default: @@ -199,24 +173,24 @@ public class Renderer extends TranslatingUtilities { VersionComparisonAnnotation self = (VersionComparisonAnnotation) base.getUserData(VersionComparisonAnnotation.USER_DATA_NAME); switch (self.getType()) { case Added: - XhtmlNode spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been added since "+version); + XhtmlNode spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been added since "+version); spanInner.img("icon-change-add.png", "icon"); - spanInner.tx(" Added"); + spanInner.tx(" "+/*!#*/"Added"); return; case Changed: if (self.getComp().noChangeOtherThanMetadata(metadataFields)) { x.span("color: #eeeeee").tx("n/c"); return; } else { - spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been changed since "+version+(self.getOriginal() != null ? " (was '"+(self.getOriginal())+"')" : "")); + spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been changed since "+version+(self.getOriginal() != null ? " (was '"+(self.getOriginal())+"')" : "")); spanInner.img("icon-change-edit.png", "icon"); - spanInner.tx(" Changed"); + spanInner.tx(" "+/*!#*/"Changed"); } return; case Deleted: - spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", "This content has been added since "+version); + spanInner = x.span("background-color: #fff2ff; border-left: solid 3px #ffa0ff; margin: 2px; padding: 2px", /*!#*/"This content has been added since "+version); spanInner.img("icon-change-remove.png", "icon"); - spanInner.tx(" Removed"); + spanInner.tx(" "+/*!#*/"Removed"); return; default: x.span("color: #eeeeee").tx("n/c"); @@ -227,4 +201,20 @@ public class Renderer extends TranslatingUtilities { } } + + public String egt(@SuppressWarnings("rawtypes") Enumeration value) { + if (value == null || !value.hasPrimitiveValue()) { + return null; + } else { + return (value == null || !value.hasPrimitiveValue()) ? null : value.asStringValue(); + } + } + + public String toStr(int value) { + return Integer.toString(value); + } + + public String toStr(Date value) { + return value.toString(); + } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/RequirementsRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/RequirementsRenderer.java index 63b8fb42e..aa91936a7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/RequirementsRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/RequirementsRenderer.java @@ -43,14 +43,14 @@ public class RequirementsRenderer extends ResourceRenderer { if (req.getActor().size() == 1) { ActorDefinition acd = context.getWorker().fetchResource(ActorDefinition.class, req.getActor().get(0).getValue(), req); XhtmlNode p = x.para(); - p.tx("These requirements apply to the actor "); + p.tx(/*!#*/"These requirements apply to the actor "); if (acd == null) { p.code(req.getActor().get(0).getValue()); } else { p.ah(acd.getWebPath()).tx(acd.present()); } } else { - x.para().tx("These requirements apply to the following actors:"); + x.para().tx(/*!#*/"These requirements apply to the following actors:"); XhtmlNode ul = x.ul(); for (CanonicalType a : req.getActor()) { ActorDefinition acd = context.getWorker().fetchResource(ActorDefinition.class, a.getValue(), req); @@ -66,14 +66,14 @@ public class RequirementsRenderer extends ResourceRenderer { if (req.getDerivedFrom().size() == 1) { Requirements reqd = context.getWorker().fetchResource(Requirements.class, req.getDerivedFrom().get(0).getValue(), req); XhtmlNode p = x.para(); - p.tx("These requirements derive from "); + p.tx(/*!#*/"These requirements derive from "); if (reqd == null) { p.code(req.getDerivedFrom().get(0).getValue()); } else { p.ah(reqd.getWebPath()).tx(reqd.present()); } } else { - x.para().tx("These requirements are derived from the following requirements:"); + x.para().tx(/*!#*/"These requirements are derived from the following requirements:"); XhtmlNode ul = x.ul(); for (CanonicalType a : req.getDerivedFrom()) { Requirements reqd = context.getWorker().fetchResource(Requirements.class, a.getValue(), req); @@ -87,7 +87,7 @@ public class RequirementsRenderer extends ResourceRenderer { } if (req.hasReference()) { XhtmlNode p = x.para(); - p.tx("References: "); + p.tx(/*!#*/"References: "); int i = 0; for (UrlType c : req.getReference()) { i++; @@ -121,11 +121,11 @@ public class RequirementsRenderer extends ResourceRenderer { td = tr.td(); addMarkdown(td, stmt.getRequirement()); if (stmt.hasDerivedFrom() || stmt.hasSatisfiedBy() || stmt.hasReference() || stmt.hasSource()) { - td.para().tx("Links:"); + td.para().tx(/*!#*/"Links:"); XhtmlNode ul = td.ul(); if (stmt.hasDerivedFrom()) { XhtmlNode li = ul.li(); - li.tx("Derived From: "); + li.tx(/*!#*/"Derived From: "); String url = stmt.getDerivedFrom(); String key = url.contains("#") ? url.substring(url.indexOf("#")+1) : ""; if (url.contains("#")) { url = url.substring(0, url.indexOf("#")); }; @@ -143,7 +143,7 @@ public class RequirementsRenderer extends ResourceRenderer { } if (stmt.hasSatisfiedBy()) { XhtmlNode li = ul.li(); - li.tx("Satisfied By: "); + li.tx(/*!#*/"Satisfied By: "); first = true; for (UrlType c : stmt.getSatisfiedBy()) { if (first) first = false; else li.tx(", "); @@ -162,7 +162,7 @@ public class RequirementsRenderer extends ResourceRenderer { } if (stmt.hasReference()) { XhtmlNode li = ul.li(); - li.tx("References: "); + li.tx(/*!#*/"References: "); int i = 0; for (UrlType c : stmt.getReference()) { i++; @@ -176,7 +176,7 @@ public class RequirementsRenderer extends ResourceRenderer { } if (stmt.hasSource()) { XhtmlNode li = ul.li(); - li.tx("Source: "); + li.tx(/*!#*/"Source: "); first = true; for (Reference c : stmt.getSource()) { if (first) first = false; else li.tx(", "); 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 53dab1568..684833bfb 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 @@ -92,6 +92,12 @@ public abstract class ResourceRenderer extends DataRenderer { XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); boolean hasExtensions; hasExtensions = render(x, r); + String an = r.fhirType()+"_"+r.getId(); + if (context.isAddName()) { + if (!hasAnchorName(x, an)) { + injectAnchorName(x, an); + } + } inject(r, x, hasExtensions ? NarrativeStatus.EXTENSIONS : NarrativeStatus.GENERATED); } @@ -99,12 +105,53 @@ public abstract class ResourceRenderer extends DataRenderer { assert r.getContext() == context; XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); boolean hasExtensions = render(x, r); + + String an = r.fhirType()+"_"+r.getId(); + if (context.isAddName()) { + if (!hasAnchorName(x, an)) { + injectAnchorName(x, an); + } + } if (r.hasNarrative()) { r.injectNarrative(x, hasExtensions ? NarrativeStatus.EXTENSIONS : NarrativeStatus.GENERATED); } return x; } + public XhtmlNode checkNarrative(ResourceWrapper r) throws IOException, FHIRException, EOperationOutcome { + assert r.getContext() == context; + XhtmlNode x = r.getNarrative(); + String an = r.fhirType()+"_"+r.getId(); + if (context.isAddName()) { + if (!hasAnchorName(x, an)) { + injectAnchorName(x, an); + } + } + return x; + } + + private void injectAnchorName(XhtmlNode x, String an) { + XhtmlNode ip = x; + while (ip.hasChildren() && "div".equals(ip.getChildNodes().get(0).getName())) { + ip = ip.getChildNodes().get(0); + } + ip.addTag(0, "a").setAttribute("name", an).tx(" "); + } + + protected boolean hasAnchorName(XhtmlNode x, String an) { + if ("a".equals(x.getName()) && an.equals(x.getAttribute("name"))) { + return true; + } + if (x.hasChildren()) { + for (XhtmlNode c : x.getChildNodes()) { + if (hasAnchorName(c, an)) { + return true; + } + } + } + return false; + } + public abstract boolean render(XhtmlNode x, Resource r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome; public boolean render(XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { @@ -163,11 +210,11 @@ public abstract class ResourceRenderer extends DataRenderer { CanonicalResource cr = (CanonicalResource) target; if (url.contains("|")) { if (target.hasWebPath()) { - x.ah(target.getWebPath()).tx(cr.present()+" (version "+cr.getVersion()+")"); + x.ah(target.getWebPath()).tx(cr.present()+/*!#*/" (version "+cr.getVersion()+")"); } else { url = url.substring(0, url.indexOf("|")); x.code().tx(url); - x.tx(": "+cr.present()+" (version "+cr.getVersion()+")"); + x.tx(": "+cr.present()+/*!#*/" (version "+cr.getVersion()+")"); } } else { if (target.hasWebPath()) { @@ -235,14 +282,14 @@ public abstract class ResourceRenderer extends DataRenderer { if (tr != null && tr.getReference() != null) { link = tr.getReference(); } else if (r.getReference().contains("?")) { - text.append("Conditional Reference: "); + text.append(/*!#*/"Conditional Reference: "); } else { link = r.getReference(); } } } if (tr != null && tr.getReference() != null && tr.getReference().startsWith("#")) { - text.append("See above ("); + text.append(/*!#*/"See above ("); } // what to display: if text is provided, then that. if the reference was resolved, then show the name, or the generated narrative String display = r.hasDisplayElement() ? r.getDisplay() : null; @@ -286,7 +333,7 @@ public abstract class ResourceRenderer extends DataRenderer { } else if (name != null) { text.append(name); } else { - text.append(". Description: (todo)"); + text.append(/*!#*/". Description: (todo)"); } } if (tr != null && tr.getReference() != null && tr.getReference().startsWith("#")) { @@ -309,19 +356,21 @@ public abstract class ResourceRenderer extends DataRenderer { if (tr != null && tr.getReference() != null) { c = x.ah(tr.getReference()); } else if (r.getReference().contains("?")) { - x.tx("Conditional Reference: "); + x.tx(/*!#*/"Conditional Reference: "); c = x.code(""); } else { c = x.ah(r.getReference()); } + } else if ("#".equals(r.getReference())) { + c = x.ah("#"); } else { - c = x.ah(r.getReference()); + c = x.ah("#hc"+r.getReference().substring(1)); } } else { c = x.span(null, null); } if (tr != null && tr.getReference() != null && tr.getReference().startsWith("#")) { - c.tx("See above ("); + c.tx(/*!#*/"See above ("); } // what to display: if text is provided, then that. if the reference was resolved, then show the name, or the generated narrative String display = r.hasDisplayElement() ? r.getDisplay() : null; @@ -365,7 +414,7 @@ public abstract class ResourceRenderer extends DataRenderer { } else if (name != null) { c.addText(name); } else { - c.tx(". Generated Summary: "); + c.tx(/*!#*/". Generated Summary: "); if (tr != null) { new ProfileDrivenRenderer(context).generateResourceSummary(c, tr.getResource(), true, r.getReference().startsWith("#"), true); } @@ -397,7 +446,7 @@ public abstract class ResourceRenderer extends DataRenderer { if (r.has("display")) { c.addText(r.get("display").primitiveValue()); if (tr != null && tr.getResource() != null) { - c.tx(". Generated Summary: "); + c.tx(/*!#*/". Generated Summary: "); new ProfileDrivenRenderer(context).generateResourceSummary(c, tr.getResource(), true, v.startsWith("#"), false); } } else if (tr != null && tr.getResource() != null) { @@ -438,7 +487,11 @@ public abstract class ResourceRenderer extends DataRenderer { String bundleUrl = null; Element br = bundleElement.getNamedChild("resource", false); if (br.getChildValue("id") != null) { - bundleUrl = "#" + br.fhirType() + "_" + br.getChildValue("id"); + if ("Bundle".equals(br.fhirType())) { + bundleUrl = "#"; + } else { + bundleUrl = "#" + br.fhirType() + "_" + br.getChildValue("id"); + } } else { bundleUrl = "#" +fullUrlToAnchor(bundleElement.getChildValue("fullUrl")); } @@ -472,12 +525,12 @@ public abstract class ResourceRenderer extends DataRenderer { protected void generateCopyright(XhtmlNode x, CanonicalResource cs) { XhtmlNode p = x.para(); - p.b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Copyright Statement:", context.getLang())); + p.b().tx(getContext().formatMessage(RenderingContext.RENDER_RESOURCE_COPYRIGHT)); smartAddText(p, " " + cs.getCopyright()); } public String displayReference(Resource res, Reference r) throws UnsupportedEncodingException, IOException { - return "todo"; + return /*!#*/"todo"; } @@ -522,10 +575,10 @@ public abstract class ResourceRenderer extends DataRenderer { protected String describeStatus(PublicationStatus status, boolean experimental) { switch (status) { - case ACTIVE: return experimental ? "Experimental" : "Active"; - case DRAFT: return "draft"; - case RETIRED: return "retired"; - default: return "Unknown"; + case ACTIVE: return experimental ? /*!#*/"Experimental" : /*!#*/"Active"; + case DRAFT: return /*!#*/"draft"; + case RETIRED: return /*!#*/"retired"; + default: return /*!#*/"Unknown"; } } @@ -559,7 +612,7 @@ public abstract class ResourceRenderer extends DataRenderer { String id = getPrimitiveValue(r, "id"); if (doId) { - div.an(id); + div.an("hc"+id); } String lang = getPrimitiveValue(r, "language"); @@ -571,35 +624,35 @@ 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(/*!#*/"Resource "); p.tx(r.fhirType()); p.tx(" "); if (id != null) { p.tx("\""+id+"\" "); } if (versionId != null) { - p.tx("Version \""+versionId+"\" "); + p.tx(/*!#*/"Version \""+versionId+"\" "); } if (lastUpdated != null) { - p.tx("Updated \""); + p.tx(/*!#*/"Updated \""); renderDateTime(p, lastUpdated); p.tx("\" "); } if (lang != null) { - p.tx(" (Language \""+lang+"\") "); + p.tx(/*!#*/" (Language \""+lang+"\") "); } } if (ir != null) { - plateStyle(div.para()).b().tx("Special rules apply: "+ir+"!"); + plateStyle(div.para()).b().tx(/*!#*/"Special rules apply: "+ir+"!"); } if (source != null) { - plateStyle(div.para()).tx("Information Source: "+source+"!"); + plateStyle(div.para()).tx(/*!#*/"Information Source: "+source+"!"); } if (meta != null) { PropertyWrapper pl = meta.getChildByName("profile"); if (pl.hasValues()) { XhtmlNode p = plateStyle(div.para()); - p.tx(Utilities.pluralize("Profile", pl.getValues().size())+": "); + p.tx(Utilities.pluralize(/*!#*/"Profile", pl.getValues().size())+": "); boolean first = true; for (BaseWrapper bw : pl.getValues()) { if (first) first = false; else p.tx(", "); @@ -609,7 +662,7 @@ public abstract class ResourceRenderer extends DataRenderer { PropertyWrapper tl = meta.getChildByName("tag"); if (tl.hasValues()) { XhtmlNode p = plateStyle(div.para()); - p.tx(Utilities.pluralize("Tag", tl.getValues().size())+": "); + p.tx(Utilities.pluralize(/*!#*/"Tag", tl.getValues().size())+": "); boolean first = true; for (BaseWrapper bw : tl.getValues()) { if (first) first = false; else p.tx(", "); @@ -623,7 +676,7 @@ public abstract class ResourceRenderer extends DataRenderer { PropertyWrapper sl = meta.getChildByName("security"); if (sl.hasValues()) { XhtmlNode p = plateStyle(div.para()); - p.tx(Utilities.pluralize("Security Label", tl.getValues().size())+": "); + p.tx(Utilities.pluralize(/*!#*/"Security Label", tl.getValues().size())+": "); boolean first = true; for (BaseWrapper bw : sl.getValues()) { if (first) first = false; else p.tx(", "); @@ -655,7 +708,7 @@ public abstract class ResourceRenderer extends DataRenderer { render(dr); } catch (Exception e) { XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); - x.para().tx("Error rendering: "+e.getMessage()); + x.para().tx(/*!#*/"Error rendering: "+e.getMessage()); dr.setText(null); inject(dr, x, NarrativeStatus.GENERATED); } 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 d7c9b260e..8e49aa4e4 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 @@ -47,7 +47,7 @@ public class SearchParameterRenderer extends TerminologyRenderer { genStandardsStatus(h2, ss); } XhtmlNode p = x.para(); - p.tx("Parameter "); + p.tx(/*!#*/"Parameter "); p.code().tx(spd.getCode()); p.tx(":"); p.code().tx(spd.getType().toCode()); @@ -55,7 +55,7 @@ public class SearchParameterRenderer extends TerminologyRenderer { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Resource", spd.getBase().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Resource", spd.getBase().size())); XhtmlNode td = tr.td(); for (Enumeration t : spd.getBase()) { StructureDefinition sd = context.getWorker().fetchTypeDefinition(t.getCode()); @@ -68,23 +68,23 @@ public class SearchParameterRenderer extends TerminologyRenderer { } } tr = tbl.tr(); - tr.td().tx("Expression"); + tr.td().tx(/*!#*/"Expression"); if (spd.hasExpression()) { tr.td().code().tx(spd.getExpression()); } else { - tr.td().tx("(none)"); + tr.td().tx(/*!#*/"(none)"); } if (spd.hasProcessingMode()) { tr = tbl.tr(); - tr.td().tx("Processing Mode"); + tr.td().tx(/*!#*/"Processing Mode"); tr.td().tx(spd.getProcessingMode().getDisplay()); } if (spd.hasTarget()) { tr = tbl.tr(); - tr.td().tx(Utilities.pluralize("Target Resources", spd.getTarget().size())); + tr.td().tx(Utilities.pluralize(/*!#*/"Target Resources", spd.getTarget().size())); td = tr.td(); if (isAllConcreteResources(spd.getTarget())) { - td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "resourcelist.html")).tx("All Resources"); + td.ah(Utilities.pathURL(context.getLink(KnownLinkType.SPEC), "resourcelist.html")).tx(/*!#*/"All Resources"); } else { for (Enumeration t : spd.getTarget()) { StructureDefinition sd = context.getWorker().fetchTypeDefinition(t.getCode()); @@ -99,28 +99,28 @@ public class SearchParameterRenderer extends TerminologyRenderer { } } tr = tbl.tr(); - tr.td().tx("Multiples"); + tr.td().tx(/*!#*/"Multiples"); XhtmlNode ul = tr.td().ul(); if (!spd.hasMultipleAnd()) { - ul.li().tx("multipleAnd: It's up to the server whether the parameter may repeat in order to specify multiple values that must all be true"); + ul.li().tx(/*!#*/"multipleAnd: It's up to the server whether the parameter may repeat in order to specify multiple values that must all be true"); } else if (spd.getMultipleAnd()) { - ul.li().tx("multipleAnd: The parameter may repeat in order to specify multiple values that must all be true"); + ul.li().tx(/*!#*/"multipleAnd: The parameter may repeat in order to specify multiple values that must all be true"); } else { - ul.li().tx("multipleAnd: The parameter may only appear once"); + ul.li().tx(/*!#*/"multipleAnd: The parameter may only appear once"); } if (!spd.hasMultipleOr()) { - ul.li().tx("multipleOr: It's up to the server whether the parameter can have multiple values (separated by comma) where at least one must be true"); + ul.li().tx(/*!#*/"multipleOr: It's up to the server whether the parameter can have multiple values (separated by comma) where at least one must be true"); } else if (spd.getMultipleOr()) { - ul.li().tx("multipleOr: The parameter may have multiple values (separated by comma) where at least one must be true"); + ul.li().tx(/*!#*/"multipleOr: The parameter may have multiple values (separated by comma) where at least one must be true"); } else { - ul.li().tx("multipleOr: The parameter may only have one value (no comma separators)"); + ul.li().tx(/*!#*/"multipleOr: The parameter may only have one value (no comma separators)"); } if (spd.hasComparator()) { tr = tbl.tr(); - tr.td().tx("Comparators"); + tr.td().tx(/*!#*/"Comparators"); td = tr.td(); - td.tx("Allowed: "); + td.tx(/*!#*/"Allowed: "); for (Enumeration t : spd.getComparator()) { td.sep(", "); td.tx(t.asStringValue()); @@ -128,9 +128,9 @@ public class SearchParameterRenderer extends TerminologyRenderer { } if (spd.hasModifier()) { tr = tbl.tr(); - tr.td().tx("Modifiers"); + tr.td().tx(/*!#*/"Modifiers"); td = tr.td(); - td.tx("Allowed: "); + td.tx(/*!#*/"Allowed: "); for (Enumeration t : spd.getModifier()) { td.sep(", "); td.tx(t.asStringValue()); @@ -138,9 +138,9 @@ public class SearchParameterRenderer extends TerminologyRenderer { } if (spd.hasChain()) { tr = tbl.tr(); - tr.td().tx("Chains"); + tr.td().tx(/*!#*/"Chains"); td = tr.td(); - td.tx("Allowed: "); + td.tx(/*!#*/"Allowed: "); for (StringType t : spd.getChain()) { td.sep(", "); td.tx(t.asStringValue()); @@ -148,7 +148,7 @@ public class SearchParameterRenderer extends TerminologyRenderer { } if (spd.hasComponent()) { - x.para().b().tx("Components"); + x.para().b().tx(/*!#*/"Components"); tbl = x.table("grid"); for (SearchParameterComponentComponent t : spd.getComponent()) { tr = tbl.tr(); @@ -167,7 +167,7 @@ public class SearchParameterRenderer extends TerminologyRenderer { private boolean isAllConcreteResources(List> list) { for (String s : context.getWorker().getResourceNames()) { StructureDefinition sd = context.getWorker().fetchTypeDefinition(s); - if (!sd.getAbstract() && !Utilities.existsInList(sd.getType(), "Parameters")) { + if (!sd.getAbstract() && !Utilities.existsInList(sd.getType(), /*!#*/"Parameters")) { boolean found = false; for (Enumeration c : list) { found = found || sd.getName().equals(c.getCode()); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java index 55be947f4..46218d744 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java @@ -217,7 +217,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { public void renderDetails(XhtmlNode f) { f = renderStatus(value, f); - f.b().attribute("title", "Formal Invariant Identifier").tx(value.getKey()); + f.b().attribute("title", /*!#*/"Formal Invariant Identifier").tx(value.getKey()); f.tx(": "); if (value.hasHuman()) { renderStatus(value.getHumanElement(), f).tx(value.getHuman()); @@ -491,7 +491,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (!url.equals(source.getUrl())) { source = context.getWorker().fetchResource(StructureDefinition.class, url, source); if (source == null) { - throw new FHIRException("Unable to resolve StructureDefinition "+url+" resolving content reference "+contentReference); + throw new FHIRException(/*!#*/"Unable to resolve StructureDefinition "+url+" resolving content reference "+contentReference); } elements = source.getSnapshot().getElement(); } @@ -504,13 +504,12 @@ public class StructureDefinitionRenderer extends ResourceRenderer { return new ElementInStructure(source, ed); } } - throw new Error("getElementByName: can't find "+contentReference+" in "+elements.toString()+" from "+source.getUrl()); + throw new Error(/*!#*/"getElementByName: can't find "+contentReference+" in "+elements.toString()+" from "+source.getUrl()); // return null; } public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, imageFolder, inlineGraphics, true); TableModel model = gen.initGridTable(corePath, profile.getId()); List list = profile.getSnapshot().getElement(); List profiles = new ArrayList(); @@ -549,8 +548,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { public XhtmlNode generateTable(String defFile, StructureDefinition profile, boolean diff, String imageFolder, boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, String imagePath, boolean logicalModel, boolean allInvariants, Set outputTracker, boolean mustSupport, RenderingContext rc, String anchorPrefix) throws IOException, FHIRException { assert(diff != snapshot);// check it's ok to get rid of one of these - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, imageFolder, inlineGraphics, true); List list; if (diff) @@ -575,7 +573,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { model = gen.initNormalTable(corePath, false, true, profile.getId()+(diff ? "d" : "s"), rc.getRules() == GenerationRules.IG_PUBLISHER, rc.getRules() == GenerationRules.IG_PUBLISHER ? TableGenerationMode.XHTML : TableGenerationMode.XML); break; default: - throw new Error("Unknown structure mode"); + throw new Error(/*!#*/"Unknown structure mode"); } List profiles = new ArrayList(); @@ -594,37 +592,37 @@ public class StructureDefinitionRenderer extends ResourceRenderer { Set cols = new HashSet<>(); scanBindings(cols, list, list.get(0)); if (cols.contains("required")) { - columns.add(new Column("required", "Required", "Concepts must come from this value set")); + columns.add(new Column("required", /*!#*/"Required", /*!#*/"Concepts must come from this value set")); } if (cols.contains("extensible")) { - columns.add(new Column("extensible", "Extensible", "Concepts must come from this value set if an appropriate concept is in the value set ")); + columns.add(new Column("extensible", /*!#*/"Extensible", /*!#*/"Concepts must come from this value set if an appropriate concept is in the value set ")); } if (cols.contains("maximum")) { - columns.add(new Column("maximum", "Maximum", "A required binding for additional codes, for use when the binding strength is 'extensible' or 'preferred'")); + columns.add(new Column("maximum", /*!#*/"Maximum", /*!#*/"A required binding for additional codes, for use when the binding strength is 'extensible' or 'preferred'")); } if (cols.contains("minimum")) { - columns.add(new Column("minimum", "Minimum", "The minimum allowable value set - any conformant system SHALL support all these codes")); + columns.add(new Column("minimum", /*!#*/"Minimum", /*!#*/"The minimum allowable value set - any conformant system SHALL support all these codes")); } if (cols.contains("candidate")) { - columns.add(new Column("candidate", "Candidate", "This value set is a candidate to substitute for the overall conformance value set in some situations; usually these are defined in the documentation")); + columns.add(new Column("candidate", /*!#*/"Candidate", /*!#*/"This value set is a candidate to substitute for the overall conformance value set in some situations; usually these are defined in the documentation")); } if (cols.contains("current")) { - columns.add(new Column("current", "Current", "New records are required to use this value set, but legacy records may use other codes. The definition of 'new record' is difficult, since systems often create new records based on pre-existing data. Usually 'current' bindings are mandated by an external authority that makes clear rules around this")); + columns.add(new Column("current", /*!#*/"Current", /*!#*/"New records are required to use this value set, but legacy records may use other codes. The definition of 'new record' is difficult, since systems often create new records based on pre-existing data. Usually 'current' bindings are mandated by an external authority that makes clear rules around this")); } if (cols.contains("preferred")) { - columns.add(new Column("preferred", "Preferred", "This is the value set that is preferred in a given context (documentation should explain why)")); + columns.add(new Column("preferred", /*!#*/"Preferred", /*!#*/"This is the value set that is preferred in a given context (documentation should explain why)")); } if (cols.contains("ui")) { - columns.add(new Column("ui", "UI", "This value set is provided for user look up in a given context. Typically, these valuesets only include a subset of codes relevant for input in a context")); + columns.add(new Column("ui", /*!#*/"UI", /*!#*/"This value set is provided for user look up in a given context. Typically, these valuesets only include a subset of codes relevant for input in a context")); } if (cols.contains("starter")) { - columns.add(new Column("starter", "Starter", "This value set is a good set of codes to start with when designing your system")); + columns.add(new Column("starter", /*!#*/"Starter", /*!#*/"This value set is a good set of codes to start with when designing your system")); } if (cols.contains("component")) { - columns.add(new Column("component", "Component", "This value set is a component of the base value set. Usually this is called out so that documentation can be written about a portion of the value set")); + columns.add(new Column("component", /*!#*/"Component", /*!#*/"This value set is a component of the base value set. Usually this is called out so that documentation can be written about a portion of the value set")); } if (cols.contains("example")) { - columns.add(new Column("example", "Example", "Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included.")); + columns.add(new Column("example", /*!#*/"Example", /*!#*/"Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included.")); } } @@ -633,16 +631,16 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (ed.getBinding().hasValueSet() && ed.getBinding().hasStrength()) { switch (ed.getBinding().getStrength()) { case EXAMPLE: - cols.add("example"); + cols.add(/*!#*/"example"); break; case EXTENSIBLE: - cols.add("extensible"); + cols.add(/*!#*/"extensible"); break; case PREFERRED: - cols.add("preferred"); + cols.add(/*!#*/"preferred"); break; case REQUIRED: - cols.add("required"); + cols.add(/*!#*/"required"); break; default: break; @@ -667,15 +665,15 @@ public class StructureDefinitionRenderer extends ResourceRenderer { scanObligations(cols, list, list.get(0)); if (cols.contains("$all")) { - columns.add(new Column("$all", "All Actors", "Obligations that apply to all actors")); + columns.add(new Column("$all", /*!#*/"All Actors", /*!#*/"Obligations that apply to all actors")); } for (String col : cols) { if (!"$all".equals(col)) { ActorDefinition actor = context.getWorker().fetchResource(ActorDefinition.class, col); if (actor == null) { - columns.add(new Column(col, tail(col), "Obligations that apply to the undefined actor "+col, col)); + columns.add(new Column(col, tail(col), /*!#*/"Obligations that apply to the undefined actor "+col, col)); } else { - columns.add(new Column(col, actor.getName(), "Obligations that apply to the actor "+actor.present(), actor.getWebPath())); + columns.add(new Column(col, actor.getName(), /*!#*/"Obligations that apply to the actor "+actor.present(), actor.getWebPath())); } } } @@ -708,9 +706,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { model.setDocoImg(Utilities.pathURL(prefix, "help16.png")); } model.setDocoRef(Utilities.pathURL("https://build.fhir.org/ig/FHIR/ig-guidance", "readingIgs.html#table-views")); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", "Name"), translate("sd.hint", "The logical name of the element"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (/*!#*/"Name"), (/*!#*/"The logical name of the element"), null, 0)); for (Column col : columns) { - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("sd.head", col.title), translate("sd.hint", col.hint), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), (/*!#*/col.title), (/*!#*/col.hint), null, 0)); } return model; } @@ -792,8 +790,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { UnusedTracker used = new UnusedTracker(); String ref = defPath == null ? null : defPath + anchorPrefix + element.getId(); String sName = tail(element.getPath()); - if (element.hasSliceName()) + if (element.hasSliceName()) { sName = sName +":"+element.getSliceName(); + } used.used = true; if (logicalModel) { if (element.hasRepresentation(PropertyRepresentation.XMLATTR)) { @@ -848,7 +847,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.setColor(context.getProfileUtilities().getRowColor(element, isConstraintMode)); hrow.setLineColor(1); hrow.setIcon("icon_element.gif", HierarchicalTableGenerator.TEXT_ICON_ELEMENT); - hrow.getCells().add(gen.new Cell(null, null, sName+":All Slices", "", null)); + hrow.getCells().add(gen.new Cell(null, null, sName+/*!#*/":All Slices", "", null)); switch (context.getStructureMode()) { case BINDINGS: case OBLIGATIONS: @@ -860,7 +859,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.getCells().add(gen.new Cell()); hrow.getCells().add(gen.new Cell()); hrow.getCells().add(gen.new Cell()); - hrow.getCells().add(gen.new Cell(null, null, "Content/Rules for all slices", "", null)); + hrow.getCells().add(gen.new Cell(null, null, /*!#*/"Content/Rules for all slices", "", null)); break; } row.getSubRows().add(hrow); @@ -873,7 +872,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.setColor(context.getProfileUtilities().getRowColor(element, isConstraintMode)); hrow.setLineColor(1); hrow.setIcon("icon_element.gif", HierarchicalTableGenerator.TEXT_ICON_ELEMENT); - hrow.getCells().add(gen.new Cell(null, null, sName+":All Types", "", null)); + hrow.getCells().add(gen.new Cell(null, null, sName+/*!#*/":All Types", "", null)); switch (context.getStructureMode()) { case BINDINGS: case OBLIGATIONS: @@ -885,7 +884,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { hrow.getCells().add(gen.new Cell()); hrow.getCells().add(gen.new Cell()); hrow.getCells().add(gen.new Cell()); - hrow.getCells().add(gen.new Cell(null, null, "Content/Rules for all Types", "", null)); + hrow.getCells().add(gen.new Cell(null, null, /*!#*/"Content/Rules for all Types", "", null)); } row.getSubRows().add(hrow); row = hrow; @@ -1012,13 +1011,13 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String imagePath, boolean root, boolean logicalModel, boolean allInvariants, StructureDefinition profile, Row typesRow, Row row, boolean hasDef, boolean ext, UnusedTracker used, String ref, String sName, List elements) throws IOException { String hint = ""; - hint = checkAdd(hint, (element.hasSliceName() ? translate("sd.table", "Slice")+" "+element.getSliceName() : "")); + hint = checkAdd(hint, (element.hasSliceName() ? (/*!#*/"Slice")+" "+element.getSliceName() : "")); if (hasDef && element.hasDefinition()) { hint = checkAdd(hint, (hasDef && element.hasSliceName() ? ": " : "")); hint = checkAdd(hint, !hasDef ? null : gt(element.getDefinitionElement())); } if (element.hasSlicing() && slicesExist(elements, element)) { // some elements set up slicing but don't actually slice, so we don't augment the name - sName = "Slices for "+sName; + sName = /*!#*/"Slices for "+sName; } Cell left = gen.new Cell(null, ref, sName, hint, null); row.getCells().add(left); @@ -1033,32 +1032,32 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(gc); res.add(gc); if (element != null && element.getIsModifier()) { - checkForNoChange(element.getIsModifierElement(), gc.addStyledText(translate("sd.table", "This element is a modifier element"), "?!", null, null, null, false)); + checkForNoChange(element.getIsModifierElement(), gc.addStyledText((/*!#*/"This element is a modifier element"), "?!", null, null, null, false)); } if (element != null) { if (element.getMustSupport() && element.hasExtension(ToolingExtensions.EXT_OBLIGATION_CORE, ToolingExtensions.EXT_OBLIGATION_TOOLS)) { - checkForNoChange(element.getMustSupportElement(), gc.addStyledText(translate("sd.table", "This element has obligations and must be supported"), "SO", "white", "red", null, false)); + checkForNoChange(element.getMustSupportElement(), gc.addStyledText((/*!#*/"This element has obligations and must be supported"), "SO", "white", "red", null, false)); } else if (element.getMustSupport()) { - checkForNoChange(element.getMustSupportElement(), gc.addStyledText(translate("sd.table", "This element must be supported"), "S", "white", "red", null, false)); + checkForNoChange(element.getMustSupportElement(), gc.addStyledText((/*!#*/"This element must be supported"), "S", "white", "red", null, false)); } else if (element != null && element.hasExtension(ToolingExtensions.EXT_OBLIGATION_CORE, ToolingExtensions.EXT_OBLIGATION_TOOLS)) { - checkForNoChange(element.getMustSupportElement(), gc.addStyledText(translate("sd.table", "This element has obligations"), "O", "white", "red", null, false)); + checkForNoChange(element.getMustSupportElement(), gc.addStyledText((/*!#*/"This element has obligations"), "O", "white", "red", null, false)); } } if (element != null && element.getIsSummary()) { - checkForNoChange(element.getIsSummaryElement(), gc.addStyledText(translate("sd.table", "This element is included in summaries"), "\u03A3", null, null, null, false)); + checkForNoChange(element.getIsSummaryElement(), gc.addStyledText((/*!#*/"This element is included in summaries"), "\u03A3", null, null, null, false)); } if (element != null && element.getMustHaveValue()) { - checkForNoChange(element.getMustHaveValueElement(), gc.addStyledText(translate("sd.table", "This primitive element must have a value"), "V", "maroon", null, null, true)); + checkForNoChange(element.getMustHaveValueElement(), gc.addStyledText((/*!#*/"This primitive element must have a value"), "V", "maroon", null, null, true)); } if (element != null && (hasNonBaseConstraints(element.getConstraint()) || hasNonBaseConditions(element.getCondition()))) { Piece p = gc.addText(CONSTRAINT_CHAR); - p.setHint(translate("sd.table", "This element has or is affected by constraints ("+listConstraintsAndConditions(element)+")")); + p.setHint((/*!#*/"This element has or is affected by constraints ("+listConstraintsAndConditions(element)+")")); p.addStyle(CONSTRAINT_STYLE); p.setReference(Utilities.pathURL(VersionUtilities.getSpecUrl(context.getWorker().getVersion()), "conformance-rules.html#constraints")); } if (element != null && element.hasExtension(ToolingExtensions.EXT_STANDARDS_STATUS)) { StandardsStatus ss = StandardsStatus.fromCode(element.getExtensionString(ToolingExtensions.EXT_STANDARDS_STATUS)); - gc.addStyledText("Standards Status = "+ss.toDisplay(), ss.getAbbrev(), "black", ss.getColor(), context.getWorker().getSpecUrl()+"versions.html#std-process", true); + gc.addStyledText(/*!#*/"Standards Status = "+ss.toDisplay(), ss.getAbbrev(), "black", ss.getColor(), context.getWorker().getSpecUrl()+"versions.html#std-process", true); } ExtensionContext extDefn = null; @@ -1075,14 +1074,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String name = element.hasSliceName() ? element.getSliceName() : urltail(eurl); nameCell.getPieces().get(0).setText(name); // left.getPieces().get(0).setReference((String) extDefn.getExtensionStructure().getTag("filename")); - nameCell.getPieces().get(0).setHint(translate("sd.table", "Extension URL")+" = "+extDefn.getUrl()); + nameCell.getPieces().get(0).setHint((/*!#*/"Extension URL")+" = "+extDefn.getUrl()); res.add(genCardinality(gen, element, row, hasDef, used, extDefn.getElement())); ElementDefinition valueDefn = extDefn.getExtensionValueDefinition(); if (valueDefn != null && !"0".equals(valueDefn.getMax())) res.add(genTypes(gen, row, valueDefn, profileBaseFileName, profile, corePath, imagePath, root, mustSupport)); else // if it's complex, we just call it nothing // genTypes(gen, row, extDefn.getSnapshot().getElement().get(0), profileBaseFileName, profile); - res.add(addCell(row, gen.new Cell(null, null, "("+translate("sd.table", "Complex")+")", null, null))); + res.add(addCell(row, gen.new Cell(null, null, "("+(/*!#*/"Complex")+")", null, null))); res.add(generateDescription(gen, row, element, extDefn.getElement(), used.used, null, extDefn.getUrl(), profile, corePath, imagePath, root, logicalModel, allInvariants, valueDefn, snapshot, mustSupport, allowSubRows, rc)); } } else { @@ -1135,9 +1134,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (definition.hasExtension(ToolingExtensions.EXT_JSON_EMPTY)) { String code = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_EMPTY); if ("present".equals(code)) { - hint = "This element is present as a JSON Array even when there are no items in the instance"; + hint = /*!#*/"This element is present as a JSON Array even when there are no items in the instance"; } else { - hint = "This element may be present as a JSON Array even when there are no items in the instance"; + hint = /*!#*/"This element may be present as a JSON Array even when there are no items in the instance"; } } } @@ -1200,7 +1199,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.setColor(context.getProfileUtilities().getRowColor(parent, isConstraintMode)); row.setLineColor(1); row.setIcon("icon_choice.gif", HierarchicalTableGenerator.TEXT_ICON_CHOICE); - row.getCells().add(gen.new Cell(null, null, "(Choice of one)", "", null)); + row.getCells().add(gen.new Cell(null, null, /*!#*/"(Choice of one)", "", null)); row.getCells().add(gen.new Cell()); row.getCells().add(gen.new Cell(null, null, (grp.isMandatory() ? "1" : "0")+"..1", "", null)); row.getCells().add(gen.new Cell()); @@ -1267,18 +1266,18 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (used) { if (logicalModel && ToolingExtensions.hasAnyOfExtensions(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { if (root) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML Namespace")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); } else if (!root && ToolingExtensions.hasAnyOfExtensions(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) && !ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED).equals(ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED))) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML Namespace")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); } } if (root) { if (profile != null && profile.getAbstract()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "This is an abstract "+(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profile" : "type")+". ", null)); + c.addPiece(gen.new Piece(null, /*!#*/"This is an abstract "+(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profile" : "type")+". ", null)); List children = new ArrayList<>(); for (StructureDefinition sd : context.getWorker().fetchResourcesByType(StructureDefinition.class)) { @@ -1287,7 +1286,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } } if (!children.isEmpty()) { - c.addPiece(gen.new Piece(null, "Child "+(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profiles" : "types")+": ", null)); + c.addPiece(gen.new Piece(null, /*!#*/"Child "+(profile.getDerivation() == TypeDerivationRule.CONSTRAINT ? "profiles" : "types")+": ", null)); boolean first = true; for (StructureDefinition sd : children) { if (first) first = false; else c.addPiece(gen.new Piece(null, ", ", null)); @@ -1300,7 +1299,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { getAncestorElements(profile, ancestors); if (ancestors.size() > 0) { c.addPiece(gen.new Piece("br")); - c.addPiece(gen.new Piece(null, "Elements defined in Ancestors: ", null)); + c.addPiece(gen.new Piece(null, /*!#*/"Elements defined in Ancestors: ", null)); boolean first = true; for (SourcedElementDefinition ed : ancestors) { if (first) @@ -1331,10 +1330,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String ref2 = null; String fixedUrl = null; if (ed != null) { - String p = ed.getWebPath(); - if (p != null) { - ref = p.startsWith("http:") || context.getRules() == GenerationRules.IG_PUBLISHER ? p : Utilities.pathURL(corePath, p); - } + String p = ed.getWebPath(); fixedUrl = getFixedUrl(ed); if (fixedUrl != null) {// if its null, we guess that it's not a profiled extension? if (fixedUrl.equals(url)) @@ -1352,14 +1348,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (fixedUrl == null) { if (!Utilities.noString(fullUrl)) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "URL")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"URL")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref, fullUrl, null)); } } else { // reference to a profile take on the extension show the base URL - c.getPieces().add(gen.new Piece(null, translate("sd.table", "URL")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"URL")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref2, fixedUrl, null)); - c.getPieces().add(gen.new Piece(null, translate("sd.table", " profiled by ")+" ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/" "+/*!#*/"profiled by ")+" ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref, fullUrl, null)); } @@ -1367,26 +1363,26 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (definition.hasSlicing()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "Slice")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"Slice")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, describeSlice(definition.getSlicing()), null)); } if (!definition.getPath().contains(".") && ToolingExtensions.hasExtension(profile, ToolingExtensions.EXT_BINDING_STYLE)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "Binding")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, "This type can be bound to a value set using the ", null)); + c.getPieces().add(gen.new Piece(null, (/*!#*/"Binding")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"This type can be bound to a value set using the ", null)); c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_BINDING_STYLE), null)); - c.getPieces().add(gen.new Piece(null, " binding style", null)); + c.getPieces().add(gen.new Piece(null, " "+/*!#*/"binding style", null)); } if (definition.hasValueAlternatives()) { addCanonicalList(gen, c, definition.getValueAlternatives(), "The primitive value may be replaced by the extension", true); } if (definition.hasExtension(ToolingExtensions.EXT_IMPLIED_PREFIX)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "When this element is read ", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"When this element is read ", null)); Piece piece = gen.new Piece("code"); piece.addHtml(new XhtmlNode(NodeType.Text).setContent(ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_IMPLIED_PREFIX))); c.getPieces().add(piece); - c.getPieces().add(gen.new Piece(null, " is prefixed to the value before validation", null)); + c.getPieces().add(gen.new Piece(null, " "+/*!#*/"is prefixed to the value before validation", null)); } if (definition.hasExtension(ToolingExtensions.EXT_EXTENSION_STYLE)) { @@ -1394,9 +1390,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String es = definition.getExtensionString(ToolingExtensions.EXT_EXTENSION_STYLE); if ("named-elements".equals(es)) { if (rc.hasLink(KnownLinkType.JSON_NAMES)) { - c.getPieces().add(gen.new Piece(rc.getLink(KnownLinkType.JSON_NAMES), "This element can be extended by named JSON elements", null)); + c.getPieces().add(gen.new Piece(rc.getLink(KnownLinkType.JSON_NAMES), /*!#*/"This element can be extended by named JSON elements", null)); } else { - c.getPieces().add(gen.new Piece(ToolingExtensions.WEB_EXTENSION_STYLE, "This element can be extended by named JSON elements", null)); + c.getPieces().add(gen.new Piece(ToolingExtensions.WEB_EXTENSION_STYLE, /*!#*/"This element can be extended by named JSON elements", null)); } } } @@ -1404,61 +1400,61 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String df = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_DATE_FORMAT); if (df != null) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Date Format: "+df, null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Date Format: "+df, null)); } } if (definition.hasExtension(ToolingExtensions.EXT_ID_EXPECTATION)) { String ide = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_ID_EXPECTATION); if (ide.equals("optional")) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Id may or not be present (this is the default for elements but not resources)", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Id may or not be present (this is the default for elements but not resources)", null)); } else if (ide.equals("required")) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Id is required to be present (this is the default for resources but not elements)", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Id is required to be present (this is the default for resources but not elements)", null)); } else if (ide.equals("required")) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "An ID is not allowed in this context", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"An id is not allowed in this context", null)); } } if (definition.hasExtension(ToolingExtensions.EXT_ID_CHOICE_GROUP)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "Choice Group")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, "This is a repeating choice group that does not appear directly in the instance", null)); + c.getPieces().add(gen.new Piece(null, (/*!#*/"Choice Group")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"This is a repeating choice group that does not appear directly in the instance", null)); } if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED), null)); c.getPieces().add(gen.new Piece(null, " (", null)); c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); c.getPieces().add(gen.new Piece(null, ")", null)); } else { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Element Name")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML Element Name")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED), null)); } } else if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"XML Namespace")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); } if (definition.hasExtension(ToolingExtensions.EXT_JSON_EMPTY)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } String code = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_EMPTY); if ("present".equals(code)) { - c.getPieces().add(gen.new Piece(null, "JSON: This element is present as a JSON Array even when there are no items in the instance", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: This element is present as a JSON Array even when there are no items in the instance", null)); } else { - c.getPieces().add(gen.new Piece(null, "JSON: This element may be present as a JSON Array even when there are no items in the instance", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: This element may be present as a JSON Array even when there are no items in the instance", null)); } } String jn = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED); if (!Utilities.noString(jn)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } if (definition.getPath().contains(".")) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "JSON Property Name")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"JSON Property Name")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, jn, null)); } else { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "JSON Property Name for Type")+": ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"JSON Property Name for Type")+": ", null).addStyle("font-weight:bold")); Piece piece = gen.new Piece("code"); piece.addHtml(new XhtmlNode(NodeType.Text).setContent(jn)); c.getPieces().add(piece); @@ -1467,27 +1463,27 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (ToolingExtensions.readBoolExtension(definition, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "JSON: The type of this element is inferred from the JSON type in the instance", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: The type of this element is inferred from the JSON type in the instance", null)); } if (ToolingExtensions.readBoolExtension(definition, ToolingExtensions.EXT_JSON_NULLABLE)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "JSON: This object can be represented as null in the JSON structure (which counts as 'present' for cardinality purposes)", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: This object can be represented as null in the JSON structure (which counts as 'present' for cardinality purposes)", null)); } if (definition.hasExtension(ToolingExtensions.EXT_JSON_PROP_KEY)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } String code = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_PROP_KEY); - c.getPieces().add(gen.new Piece(null, "JSON: Represented as a single JSON Object with named properties using the value of the "+code+" child as the key", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: Represented as a single JSON Object with named properties using the value of the "+code+" child as the key", null)); } if (definition.hasExtension(ToolingExtensions.EXT_TYPE_SPEC)) { for (Extension e : definition.getExtensionsByUrl(ToolingExtensions.EXT_TYPE_SPEC)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } String cond = ToolingExtensions.readStringExtension(e, "condition"); String type = ToolingExtensions.readStringExtension(e, "type"); - c.getPieces().add(gen.new Piece(null, "JSON: If ", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"JSON: If ", null)); Piece piece = gen.new Piece("code"); piece.addHtml(new XhtmlNode(NodeType.Text).setContent(cond)); c.getPieces().add(piece); - c.getPieces().add(gen.new Piece(null, "then the type is ", null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"then the type is ", null)); StructureDefinition sd = context.getWorker().fetchTypeDefinition(type); if (sd == null) { c.getPieces().add(gen.new Piece("")); @@ -1501,7 +1497,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (root) { if (ToolingExtensions.readBoolExtension(profile, ToolingExtensions.EXT_OBLIGATION_PROFILE_FLAG)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "This is an obligation profile that only contains obligations and additional bindings", null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"This is an obligation profile that only contains obligations and additional bindings", null).addStyle("font-weight:bold")); } addCanonicalListExt(gen, c, profile.getExtensionsByUrl(ToolingExtensions.EXT_OBLIGATION_INHERITS), "This profile picks up obligations and additional bindings from the profile", true); addCanonicalListExt(gen, c, profile.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE), "This profile also imposes the profile", true); @@ -1511,31 +1507,31 @@ public class StructureDefinitionRenderer extends ResourceRenderer { Extension lt = ToolingExtensions.getExtension(profile, ToolingExtensions.EXT_LOGICAL_TARGET); if (lt == null || !lt.hasValueBooleanType()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; } else if (lt.getValue().hasExtension(ToolingExtensions.EXT_DAR)) { } else if (!lt.getValueBooleanType().hasValue()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this logical model are not marked to be the target of a Reference", null).addStyle("font-weight:bold")); ; } else if (lt.getValueBooleanType().booleanValue()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "Instances of this logical model can be the target of a Reference", null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this logical model can be the target of a Reference", null).addStyle("font-weight:bold")); } else { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.addPiece(gen.new Piece(null, "Instances of this logical model cannot be the target of a Reference", null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this logical model cannot be the target of a Reference", null).addStyle("font-weight:bold")); } String ps = ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_PROFILE_STYLE); if (ps != null) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } if ("cda".equals(ps)) { - c.addPiece(gen.new Piece(null, "Instances of this type are validated by templateId", null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this type are validated by templateId", null).addStyle("font-weight:bold")); } else { - c.addPiece(gen.new Piece(null, "Instances of this type are validated using an unknown approach: "+ps, null).addStyle("font-weight:bold")); + c.addPiece(gen.new Piece(null, /*!#*/"Instances of this type are validated using an unknown approach: "+ps, null).addStyle("font-weight:bold")); } } Extension lc = ToolingExtensions.getExtension(profile, ToolingExtensions.EXT_LOGICAL_CONTAINER); if (lc != null && lc.hasValueUriType()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "Logical Container")+": ", "The root class that contains instances of this class").addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, (/*!#*/"Logical Container")+": ", /*!#*/"The root class that contains instances of this class").addStyle("font-weight:bold")); String uri = lc.getValue().primitiveValue(); StructureDefinition lct = context.getContext().fetchTypeDefinition(uri); @@ -1557,7 +1553,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); BindingResolution br = context.getPkp() == null ? makeNullBr(binding) : context.getPkp().resolveBinding(profile, binding, definition.getPath()); - c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, translate("sd.table", "Binding")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, (/*!#*/"Binding")+": ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(binding.getValueSetElement(), checkAddExternalFlag(br, gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !context.getPkp().prependLinks() ? br.url : corePath+br.url, br.display, br.uri)))); if (binding.hasStrength()) { c.getPieces().add(checkForNoChange(binding.getStrengthElement(), gen.new Piece(null, " (", null))); @@ -1583,7 +1579,8 @@ public class StructureDefinitionRenderer extends ResourceRenderer { abr.render(gen, c); } for (ElementDefinitionConstraintComponent inv : definition.getConstraint()) { - if (!inv.hasSource() || profile == null || inv.getSource().equals(profile.getUrl()) || allInvariants) { +// if (!inv.hasSource() || profile == null || inv.getSource().equals(profile.getUrl()) || allInvariants) { + if (!inv.hasSource() || profile == null || allInvariants || (!isAbstractBaseProfile(inv.getSource()) && !"http://hl7.org/fhir/StructureDefinition/Extension".equals(inv.getSource()))) { if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); c.getPieces().add(checkForNoChange(inv, gen.new Piece(null, inv.getKey()+": ", null).addStyle("font-weight:bold"))); @@ -1594,14 +1591,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (c.getPieces().size() > 0) c.addPiece(gen.new Piece("br")); if (definition.hasOrderMeaning()) { - c.getPieces().add(gen.new Piece(null, "This repeating element order: "+definition.getOrderMeaning(), null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"This repeating element order: "+definition.getOrderMeaning(), null)); } else { // don't show this, this it's important: c.getPieces().add(gen.new Piece(null, "This repeating element has no defined order", null)); } } if (definition.hasFixed()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, translate("sd.table", "Fixed Value")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, (/*!#*/"Fixed Value")+": ", null).addStyle("font-weight:bold"))); if (!useTableForFixedValues || !allowSubRows || definition.getFixed().isPrimitive()) { String s = buildJson(definition.getFixed()); String link = null; @@ -1609,7 +1606,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { link = context.getPkp().getLinkForUrl(corePath, s); c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(link, s, null).addStyle("color: darkgreen"))); } else { - c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "As shown", null).addStyle("color: darkgreen"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, /*!#*/"As shown", null).addStyle("color: darkgreen"))); genFixedValue(gen, row, definition.getFixed(), snapshot, false, corePath, false); } if (isCoded(definition.getFixed()) && !hasDescription(definition.getFixed())) { @@ -1619,17 +1616,17 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } } else if (definition.hasPattern()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, translate("sd.table", "Required Pattern")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, (/*!#*/"Required Pattern")+": ", null).addStyle("font-weight:bold"))); if (!useTableForFixedValues || !allowSubRows || definition.getPattern().isPrimitive()) c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, buildJson(definition.getPattern()), null).addStyle("color: darkgreen"))); else { - c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, "At least the following", null).addStyle("color: darkgreen"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, /*!#*/"At least the following", null).addStyle("color: darkgreen"))); genFixedValue(gen, row, definition.getPattern(), snapshot, true, corePath, mustSupportOnly); } } else if (definition.hasExample()) { for (ElementDefinitionExampleComponent ex : definition.getExample()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, translate("sd.table", "Example")+("".equals("General")? "" : " "+ex.getLabel())+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, (/*!#*/"Example")+("".equals("General")? "" : " "+ex.getLabel())+": ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, buildJson(ex.getValue()), null).addStyle("color: darkgreen"))); } } @@ -1670,6 +1667,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { return c; } + private boolean isAbstractBaseProfile(String source) { + StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, source); + return (sd != null) && sd.getAbstract() && sd.hasUrl() && sd.getUrl().startsWith("http://hl7.org/fhir/StructureDefinition/"); + } + private Piece checkAddExternalFlag(BindingResolution br, Piece piece) { if (br.external) { piece.setTagImg("external.png"); @@ -1763,13 +1765,13 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (e.hasContentReference()) { ElementInStructure ed = getElementByName(profile.getSnapshot().getElement(), e.getContentReference(), profile); if (ed == null) - c.getPieces().add(gen.new Piece(null, translate("sd.table", "Unknown reference to %s", e.getContentReference()), null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Unknown reference to "+ e.getContentReference(), null)); else { if (ed.getSource() == profile) { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "See ", ed.getElement().getPath()), null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"See ", null)); c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), tail(ed.getElement().getPath()), ed.getElement().getPath())); } else { - c.getPieces().add(gen.new Piece(null, translate("sd.table", "See ", ed.getElement().getPath()), null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"See ", null)); c.getPieces().add(gen.new Piece(pfx(corePath, ed.getSource().getWebPath())+"#"+ed.getElement().getPath(), tail(ed.getElement().getPath())+" ("+ed.getSource().getTypeName()+")", ed.getElement().getPath())); } } @@ -1828,7 +1830,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (!mustSupportMode && isMustSupportDirect(t) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } c.getPieces().add(gen.new Piece(null, "(", null)); boolean tfirst = true; @@ -1841,7 +1843,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { genTargetLink(gen, profileBaseFileName, corePath, c, t, u.getValue(), null); if (!mustSupportMode && isMustSupport(u) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This target must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This target must be supported"), "S", "white", "red", null, false); } } } @@ -1888,7 +1890,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (!mustSupportMode && isMustSupport(p) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This profile must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This profile must be supported"), "S", "white", "red", null, false); } } } @@ -1908,7 +1910,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (!mustSupportMode && isMustSupportDirect(t) && e.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } } } @@ -2119,7 +2121,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private BindingResolution makeNullBr(ElementDefinitionBindingComponent binding) { BindingResolution br = new BindingResolution(); br.url = "http://none.none/none"; - br.display = "todo"; + br.display = /*!#*/"todo"; return br; } @@ -2183,7 +2185,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(c); if (!pattern) { c.addPiece(gen.new Piece(null, "0..0", null)); - row.setIcon("icon_fixed.gif", "Fixed Value" /*HierarchicalTableGenerator.TEXT_ICON_FIXED*/); + row.setIcon("icon_fixed.gif", /*!#*/"Fixed Value" /*HierarchicalTableGenerator.TEXT_ICON_FIXED*/); } else if (context.getContext().isPrimitiveType(t.getTypeCode())) { row.setIcon("icon_primitive.png", HierarchicalTableGenerator.TEXT_ICON_PRIMITIVE); c.addPiece(gen.new Piece(null, "0.."+(t.getMaxCardinality() == 2147483647 ? "*": Integer.toString(t.getMaxCardinality())), null)); @@ -2217,7 +2219,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { for (Base b : t.getValues()) { Row row = gen.new Row(); erow.getSubRows().add(row); - row.setIcon("icon_fixed.gif", "Fixed Value" /*HierarchicalTableGenerator.TEXT_ICON_FIXED*/); + row.setIcon("icon_fixed.gif", /*!#*/"Fixed Value" /*HierarchicalTableGenerator.TEXT_ICON_FIXED*/); Cell c = gen.new Cell(); row.getCells().add(c); @@ -2255,7 +2257,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(c); c.addPiece(gen.new Piece(null, ed.getShort(), null)); c.addPiece(gen.new Piece("br")); - c.getPieces().add(gen.new Piece(null, "Fixed Value: ", null).addStyle("font-weight: bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Fixed Value: ", null).addStyle("font-weight: bold")); String s = b.primitiveValue(); // ok. let's see if we can find a relevant link for this String link = null; @@ -2268,8 +2270,8 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(c); c.addPiece(gen.new Piece(null, ed.getShort(), null)); c.addPiece(gen.new Piece("br")); - c.getPieces().add(gen.new Piece(null, "Fixed Value: ", null).addStyle("font-weight: bold")); - c.getPieces().add(gen.new Piece(null, "(complex)", null).addStyle("color: darkgreen")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Fixed Value: ", null).addStyle("font-weight: bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"(complex)", null).addStyle("color: darkgreen")); genFixedValue(gen, row, (DataType) b, snapshot, pattern, corePath, skipnoValue); } } @@ -2346,12 +2348,12 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (definition.hasContentReference()) { ElementInStructure ed = getElementByName(profile.getSnapshot().getElement(), definition.getContentReference(), profile); if (ed == null) - c.getPieces().add(gen.new Piece(null, "Unknown reference to "+definition.getContentReference(), null)); + c.getPieces().add(gen.new Piece(null, /*!#*/"Unknown reference to "+definition.getContentReference(), null)); else { if (ed.getSource() == profile) { - c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), "See "+ed.getElement().getPath(), null)); + c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), /*!#*/"See "+ed.getElement().getPath(), null)); } else { - c.getPieces().add(gen.new Piece(ed.getSource().getWebPath()+"#"+ed.getElement().getPath(), "See "+ed.getSource().getTypeName()+"."+ed.getElement().getPath(), null)); + c.getPieces().add(gen.new Piece(ed.getSource().getWebPath()+"#"+ed.getElement().getPath(), /*!#*/"See "+ed.getSource().getTypeName()+"."+ed.getElement().getPath(), null)); } } } @@ -2370,13 +2372,13 @@ public class StructureDefinitionRenderer extends ResourceRenderer { ref = p.startsWith("http:") || context.getRules() == GenerationRules.IG_PUBLISHER ? p : Utilities.pathURL(corePath, p); } } - c.getPieces().add(gen.new Piece(null, "URL: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"URL: ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(ref, fullUrl, null)); } if (definition.hasSlicing()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Slice: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Slice: ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, describeSlice(definition.getSlicing()), null)); } if (definition != null) { @@ -2389,7 +2391,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); BindingResolution br = context.getPkp().resolveBinding(profile, binding, definition.getPath()); - c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, "Binding: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, /*!#*/"Binding: ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(binding, checkAddExternalFlag(br, gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !context.getPkp().prependLinks() ? br.url : corePath+br.url, br.display, br.uri)))); if (binding.hasStrength()) { c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, " (", null))); @@ -2412,7 +2414,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (definition.hasFixed()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "Fixed Value: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, /*!#*/"Fixed Value: ", null).addStyle("font-weight:bold"))); String s = buildJson(definition.getFixed()); String link = null; if (Utilities.isAbsoluteUrl(s)) @@ -2420,18 +2422,18 @@ public class StructureDefinitionRenderer extends ResourceRenderer { c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(link, s, null).addStyle("color: darkgreen"))); } else if (definition.hasPattern()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, "Required Pattern: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, /*!#*/"Required Pattern: ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, buildJson(definition.getPattern()), null).addStyle("color: darkgreen"))); } else if (definition.hasExample()) { for (ElementDefinitionExampleComponent ex : definition.getExample()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, "Example'"+("".equals("General")? "": " "+ex.getLabel()+"'")+": ", "").addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, /*!#*/"Example'"+("".equals("General")? "": " "+ex.getLabel()+"'")+": ", "").addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(ex, gen.new Piece(null, buildJson(ex.getValue()), null).addStyle("color: darkgreen"))); } } if (definition.hasMaxLength() && definition.getMaxLength()!=0) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(checkForNoChange(definition.getMaxLengthElement(), gen.new Piece(null, "Max Length: ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(definition.getMaxLengthElement(), gen.new Piece(null, /*!#*/"Max Length: ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(definition.getMaxLengthElement(), gen.new Piece(null, Integer.toString(definition.getMaxLength()), null).addStyle("color: darkgreen"))); } if (profile != null) { @@ -2452,14 +2454,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } if (definition.hasDefinition()) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Definition: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Definition: ", null).addStyle("font-weight:bold")); c.addPiece(gen.new Piece("br")); c.addMarkdown(definition.getDefinition()); // c.getPieces().add(checkForNoChange(definition.getCommentElement(), gen.new Piece(null, definition.getComment(), null))); } if (definition.getComment()!=null) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, "Comments: ", null).addStyle("font-weight:bold")); + c.getPieces().add(gen.new Piece(null, /*!#*/"Comments: ", null).addStyle("font-weight:bold")); c.addPiece(gen.new Piece("br")); c.addMarkdown(definition.getComment()); // c.getPieces().add(checkForNoChange(definition.getCommentElement(), gen.new Piece(null, definition.getComment(), null))); @@ -2566,15 +2568,22 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } public String listConstraintsAndConditions(ElementDefinition element) { + Set ids = new HashSet<>(); CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); for (ElementDefinitionConstraintComponent con : element.getConstraint()) { if (!isBaseConstraint(con)) { - b.append(con.getKey()); + if (!ids.contains(con.getKey())) { + ids.add(con.getKey()); + b.append(con.getKey()); + } } } for (IdType id : element.getCondition()) { if (!isBaseCondition(id)) { - b.append(id.asStringValue()); + if (!ids.contains(id.asStringValue())) { + ids.add(id.asStringValue()); + b.append(id.asStringValue()); + } } } return b.toString(); @@ -2612,7 +2621,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { c.getPieces().add(gen.new Piece(corePath+"references.html#Reference", "Reference", null)); if (!mustSupportMode && isMustSupportDirect(tr) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } c.getPieces().add(gen.new Piece(null, "(", null)); } @@ -2624,7 +2633,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { genTargetLink(gen, profileBaseFileName, corePath, c, tr, rt.getValue(), src); if (!mustSupportMode && isMustSupport(rt) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This target must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This target must be supported"), "S", "white", "red", null, false); } first = false; } @@ -2652,7 +2661,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { choicerow.getCells().add(c); if (!mustSupportMode && isMustSupport(tr) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } } else { used = true; @@ -2664,7 +2673,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { choicerow.getCells().add(c); if (!mustSupportMode && isMustSupport(tr) && element.getMustSupport()) { c.addPiece(gen.new Piece(null, " ", null)); - c.addStyledText(translate("sd.table", "This type must be supported"), "S", "white", "red", null, false); + c.addStyledText((/*!#*/"This type must be supported"), "S", "white", "red", null, false); } } if (tr.hasProfile() && used) { @@ -2681,7 +2690,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { typeCell.addPiece(gen.new Piece(psd.getWebPath(), psd.getName(), psd.present())); if (!mustSupportMode && isMustSupport(pt) && element.getMustSupport()) { typeCell.addPiece(gen.new Piece(null, " ", null)); - typeCell.addStyledText(translate("sd.table", "This profile must be supported"), "S", "white", "red", null, false); + typeCell.addStyledText((/*!#*/"This profile must be supported"), "S", "white", "red", null, false); } } } @@ -2730,7 +2739,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } private String describeSlice(ElementDefinitionSlicingComponent slicing) { - return translate("sd.table", "%s, %s by %s", slicing.getOrdered() ? translate("sd.table", "Ordered") : translate("sd.table", "Unordered"), describe(slicing.getRules()), commas(slicing.getDiscriminator())); + return formatMessage(RenderingContext.SD_SLICING_INFO, slicing.getOrdered() ? (/*!#*/"Ordered") : (/*!#*/"Unordered"), describe(slicing.getRules()), commas(slicing.getDiscriminator())); } @@ -2745,11 +2754,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private String describe(SlicingRules rules) { if (rules == null) - return translate("sd.table", "Unspecified"); + return (/*!#*/"Unspecified"); switch (rules) { - case CLOSED : return translate("sd.table", "Closed"); - case OPEN : return translate("sd.table", "Open"); - case OPENATEND : return translate("sd.table", "Open At End"); + case CLOSED : return (/*!#*/"Closed"); + case OPEN : return (/*!#*/"Open"); + case OPENATEND : return (/*!#*/"Open At End"); default: return "?gen-sr?"; } @@ -2838,7 +2847,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (open) b.append("]"); } else - res.setDescription("Base FHIR "+profile.getName()); + res.setDescription(/*!#*/"Base FHIR "+profile.getName()); res.setType(b.toString()); return res ; } @@ -2859,7 +2868,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String system = TerminologyRenderer.describeSystem(uri); if (Utilities.isURL(system)) { if (system.equals("http://cap.org/protocols")) - system = "CAP Code"; + system = /*!#*/"CAP Code"; } return system+" "+value.getCode(); } @@ -2887,10 +2896,10 @@ public class StructureDefinitionRenderer extends ResourceRenderer { model.setDocoImg(Utilities.pathURL(prefix, "help16.png")); } model.setDocoRef(Utilities.pathURL(prefix, "formats.html#table")); // todo: change to graph definition - model.getTitles().add(gen.new Title(null, model.getDocoRef(), "Property", "A profiled resource", null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), "Card.", "Minimum and Maximum # of times the the element can appear in the instance", null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), "Content", "What goes here", null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), "Description", "Description of the profile", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Property", /*!#*/"A profiled resource", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Card.", /*!#*/"Minimum and Maximum # of times the the element can appear in the instance", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Content", /*!#*/"What goes here", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Description", /*!#*/"Description of the profile", null, 0)); return model; } @@ -2917,8 +2926,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { public XhtmlNode generateSpanningTable(StructureDefinition profile, String imageFolder, boolean onlyConstraints, String constraintPrefix, Set outputTracker) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, false, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, imageFolder, false, true); TableModel model = initSpanningTable(gen, "", false, profile.getId()); Set processed = new HashSet(); SpanEntry span = buildSpanningTable("(focus)", "", profile, processed, onlyConstraints, constraintPrefix); @@ -3008,9 +3016,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (first) first = false; else x.br(); String cond = ToolingExtensions.readStringExtension(e, "condition"); String type = ToolingExtensions.readStringExtension(e, "type"); - x.tx("If "); + x.tx(/*!#*/"If "); x.code().tx(cond); - x.tx(" then the type is "); + x.tx(" "+/*!#*/"then the type is "); StructureDefinition sd = context.getContext().fetchTypeDefinition(type); if (sd == null) { x.code().tx(type); @@ -3022,8 +3030,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } public XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, String imagePath, Set outputTracker, RenderingContext rc) throws IOException, FHIRException { - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(imageFolder, inlineGraphics, true); - gen.setTranslator(getTranslator()); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, imageFolder, inlineGraphics, true); TableModel model = gen.initNormalTable(corePath, false, true, ed.getId()+(full ? "f" : "n"), true, TableGenerationMode.XHTML); boolean deep = false; @@ -3103,7 +3110,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (!full && !(deep || vdeep) && ved != null && ved.hasBinding()) { c.addPiece(gen.new Piece("br")); BindingResolution br = context.getPkp().resolveBinding(ed, ved.getBinding(), ved.getPath()); - c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(null, translate("sd.table", "Binding")+": ", null).addStyle("font-weight:bold"))); + c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(null, (/*!#*/"Binding")+": ", null).addStyle("font-weight:bold"))); c.getPieces().add(checkForNoChange(ved.getBinding(), checkAddExternalFlag(br, gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !context.getPkp().prependLinks() ? br.url : corePath+br.url, br.display, br.uri)))); if (ved.getBinding().hasStrength()) { c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(null, " (", null))); @@ -3253,7 +3260,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { sd = (StructureDefinition) context.getContext().fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/Element"); } if (sd == null) { - throw new FHIRException("Unable to retrieve StructureDefinition with URL " + url); + throw new FHIRException(/*!#*/"Unable to retrieve StructureDefinition with URL " + url); } } sdCache = new HashMap(); @@ -3315,6 +3322,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (!tl.contains(tc)) { aliases.add(name.replace("[x]", Utilities.capitalize(tc))); aliases.add(name+":"+name.replace("[x]", Utilities.capitalize(tc))); + aliases.add(name.replace("[x]", Utilities.capitalize(tc))+":"+name.replace("[x]", Utilities.capitalize(tc))); tl.add(tc); } } @@ -3334,7 +3342,6 @@ public class StructureDefinitionRenderer extends ResourceRenderer { list.addAll(generated); } ElementDefinition ed = stack.get(stack.size()-1); - // now we have all the possible names, but some of them might be inappropriate if we've // already generated a type slicer. On the other hand, if we've already done that, we're // going to steal any type specific ones off it. @@ -3561,60 +3568,60 @@ public class StructureDefinitionRenderer extends ResourceRenderer { boolean slicedExtension = d.hasSliceName() && (d.getPath().endsWith(".extension") || d.getPath().endsWith(".modifierExtension")); // int slicedExtensionMode = (mode == GEN_MODE_KEY) && slicedExtension ? GEN_MODE_SNAP : mode; // see ProfileUtilities.checkExtensionDoco / Task 3970 if (d.hasSliceName()) { - tableRow(tbl, "Slice Name", "profiling.html#slicing", strikethrough, compareString(d.getSliceName(), d.getSliceNameElement(), null, (compare != null ? compare.getSliceName() : null), d, null, "sliceName", mode, false, false)); - tableRow(tbl, "Slice Constraining", "profiling.html#slicing", strikethrough, compareString(encodeValue(d.getSliceIsConstrainingElement(), null), d.getSliceIsConstrainingElement(), null, (compare != null ? encodeValue(compare.getSliceIsConstrainingElement(), null) : null), d, null, "sliceName", mode, false, false)); + tableRow(tbl, /*!#*/"Slice Name", "profiling.html#slicing", strikethrough, compareString(d.getSliceName(), d.getSliceNameElement(), null, (compare != null ? compare.getSliceName() : null), d, null, "sliceName", mode, false, false)); + tableRow(tbl, /*!#*/"Slice Constraining", "profiling.html#slicing", strikethrough, compareString(encodeValue(d.getSliceIsConstrainingElement(), null), d.getSliceIsConstrainingElement(), null, (compare != null ? encodeValue(compare.getSliceIsConstrainingElement(), null) : null), d, null, "sliceName", mode, false, false)); } - tableRow(tbl, "Definition", null, strikethrough, compareMarkdown(sd.getName(), d.getDefinitionElement(), (compare==null) || slicedExtension ? null : compare.getDefinitionElement(), mode)); - tableRow(tbl, "Short", null, strikethrough, compareString(d.hasShort() ? d.getShort() : null, d.getShortElement(), null, "short", d, compare!= null && compare.hasShortElement() ? compare.getShort() : null, null, mode, false, false)); - tableRow(tbl, "Comments", null, strikethrough, compareMarkdown(sd.getName(), d.getCommentElement(), (compare==null) || slicedExtension ? null : compare.getCommentElement(), mode)); - tableRow(tbl, "Note", null, strikethrough, businessIdWarning(sd.getName(), tail(d.getPath()))); - tableRow(tbl, "Control", "conformance-rules.html#conformance", strikethrough, describeCardinality(d, compare, mode)); - tableRow(tbl, "Binding", "terminologies.html", strikethrough, describeBinding(sd, d, d.getPath(), compare, mode)); + tableRow(tbl, /*!#*/"Definition", null, strikethrough, compareMarkdown(sd.getName(), d.getDefinitionElement(), (compare==null) || slicedExtension ? null : compare.getDefinitionElement(), mode)); + tableRow(tbl, /*!#*/"Short", null, strikethrough, compareString(d.hasShort() ? d.getShort() : null, d.getShortElement(), null, "short", d, compare!= null && compare.hasShortElement() ? compare.getShort() : null, null, mode, false, false)); + tableRow(tbl, /*!#*/"Comments", null, strikethrough, compareMarkdown(sd.getName(), d.getCommentElement(), (compare==null) || slicedExtension ? null : compare.getCommentElement(), mode)); + tableRow(tbl, /*!#*/"Note", null, strikethrough, businessIdWarning(sd.getName(), tail(d.getPath()))); + tableRow(tbl, /*!#*/"Control", "conformance-rules.html#conformance", strikethrough, describeCardinality(d, compare, mode)); + tableRow(tbl, /*!#*/"Binding", "terminologies.html", strikethrough, describeBinding(sd, d, d.getPath(), compare, mode)); if (d.hasContentReference()) { - tableRow(tbl, "Type", null, strikethrough, "See " + d.getContentReference().substring(1)); + tableRow(tbl, /*!#*/"Type", null, strikethrough, /*!#*/"See " + d.getContentReference().substring(1)); } else { - tableRow(tbl, "Type", "datatypes.html", strikethrough, describeTypes(d.getType(), false, d, compare, mode, value, compareValue, sd)); + tableRow(tbl, /*!#*/"Type", "datatypes.html", strikethrough, describeTypes(d.getType(), false, d, compare, mode, value, compareValue, sd)); } if (d.hasExtension(ToolingExtensions.EXT_DEF_TYPE)) { - tableRow(tbl, "Default Type", "datatypes.html", strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DEF_TYPE)); + tableRow(tbl, /*!#*/"Default Type", "datatypes.html", strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DEF_TYPE)); } if (d.hasExtension(ToolingExtensions.EXT_TYPE_SPEC)) { - tableRow(tbl, Utilities.pluralize("Type Specifier", d.getExtensionsByUrl(ToolingExtensions.EXT_TYPE_SPEC).size()), "datatypes.html", strikethrough, formatTypeSpecifiers(d)); + tableRow(tbl, Utilities.pluralize(/*!#*/"Type Specifier", d.getExtensionsByUrl(ToolingExtensions.EXT_TYPE_SPEC).size()), "datatypes.html", strikethrough, formatTypeSpecifiers(d)); } if (d.getPath().endsWith("[x]") && !d.prohibited()) { - tableRow(tbl, "[x] Note", null, strikethrough).ahWithText("See ", spec("formats.html#choice"), null, "Choice of Data Types", " for further information about how to use [x]"); + tableRow(tbl, /*!#*/"[x] Note", null, strikethrough).ahWithText("See ", spec("formats.html#choice"), null, /*!#*/"Choice of Data Types", " for further information about how to use [x]"); } - tableRow(tbl, "Is Modifier", "conformance-rules.html#ismodifier", strikethrough, presentModifier(d, mode, compare)); + tableRow(tbl, /*!#*/"Is Modifier", "conformance-rules.html#ismodifier", strikethrough, presentModifier(d, mode, compare)); if (d.getMustHaveValue()) { - tableRow(tbl, "Primitive Value", "elementdefinition.html#primitives", strikethrough, "This primitive type must have a value (the value must be present, and cannot be replaced by an extension)"); + tableRow(tbl, /*!#*/"Primitive Value", "elementdefinition.html#primitives", strikethrough, /*!#*/"This primitive type must have a value (the value must be present, and cannot be replaced by an extension)"); } else if (d.hasValueAlternatives()) { - tableRow(tbl, "Primitive Value", "elementdefinition.html#primitives", strikethrough, renderCanonicalList("This primitive type may be present, or absent if replaced by one of the following extensions: ", d.getValueAlternatives())); + tableRow(tbl, /*!#*/"Primitive Value", "elementdefinition.html#primitives", strikethrough, renderCanonicalList(/*!#*/"This primitive type may be present, or absent if replaced by one of the following extensions: ", d.getValueAlternatives())); } else if (hasPrimitiveTypes(d)) { - tableRow(tbl, "Primitive Value", "elementdefinition.html#primitives", strikethrough, "This primitive element may be present, or absent, or replaced by an extension"); + tableRow(tbl, /*!#*/"Primitive Value", "elementdefinition.html#primitives", strikethrough, /*!#*/"This primitive element may be present, or absent, or replaced by an extension"); } if (ToolingExtensions.hasAllowedUnits(d)) { - tableRow(tbl, "Allowed Units", "http://hl7.org/fhir/extensions/StructureDefinition-elementdefinition-allowedUnits.html", strikethrough, describeAllowedUnits(d)); + tableRow(tbl, /*!#*/"Allowed Units", "http://hl7.org/fhir/extensions/StructureDefinition-elementdefinition-allowedUnits.html", strikethrough, describeAllowedUnits(d)); } - tableRow(tbl, "Must Support", "conformance-rules.html#mustSupport", strikethrough, displayBoolean(d.getMustSupport(), d.getMustSupportElement(), "mustSupport", d, compare==null ? null : compare.getMustSupportElement(), mode)); + tableRow(tbl, /*!#*/"Must Support", "conformance-rules.html#mustSupport", strikethrough, displayBoolean(d.getMustSupport(), d.getMustSupportElement(), "mustSupport", d, compare==null ? null : compare.getMustSupportElement(), mode)); if (d.getMustSupport()) { if (hasMustSupportTypes(d.getType())) { - tableRow(tbl, "Must Support Types", "datatypes.html", strikethrough, describeTypes(d.getType(), true, d, compare, mode, null, null, sd)); + tableRow(tbl, /*!#*/"Must Support Types", "datatypes.html", strikethrough, describeTypes(d.getType(), true, d, compare, mode, null, null, sd)); } else if (hasChoices(d.getType())) { - tableRow(tbl, "Must Support Types", "datatypes.html", strikethrough, "No must-support rules about the choice of types/profiles"); + tableRow(tbl, /*!#*/"Must Support Types", "datatypes.html", strikethrough, /*!#*/"No must-support rules about the choice of types/profiles"); } } if (root && sd.getKind() == StructureDefinitionKind.LOGICAL) { Extension lt = ToolingExtensions.getExtension(sd, ToolingExtensions.EXT_LOGICAL_TARGET); if (lt == null || !lt.hasValue()) { - tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model are not marked to be the target of a Reference"); + tableRow(tbl, /*!#*/"Logical Model", null, strikethrough, /*!#*/"Instances of this logical model are not marked to be the target of a Reference"); } else if (lt.getValue().hasExtension(ToolingExtensions.EXT_DAR)) { } else if (lt.getValueBooleanType().hasValue()) { - tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model are not marked to be the target of a Reference"); + tableRow(tbl, /*!#*/"Logical Model", null, strikethrough, /*!#*/"Instances of this logical model are not marked to be the target of a Reference"); } else if (lt.getValueBooleanType().booleanValue()) { - tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model can be the target of a Reference"); + tableRow(tbl, /*!#*/"Logical Model", null, strikethrough, /*!#*/"Instances of this logical model can be the target of a Reference"); } else { - tableRow(tbl, "Logical Model", null, strikethrough, "Instances of this logical model cannot be the target of a Reference"); + tableRow(tbl, /*!#*/"Logical Model", null, strikethrough, /*!#*/"Instances of this logical model cannot be the target of a Reference"); } Extension lc = ToolingExtensions.getExtension(sd, ToolingExtensions.EXT_LOGICAL_CONTAINER); @@ -3622,79 +3629,79 @@ public class StructureDefinitionRenderer extends ResourceRenderer { String uri = lc.getValue().primitiveValue(); StructureDefinition lct = context.getContext().fetchTypeDefinition(uri); if (lct != null) { - tableRowLink(tbl, "Logical Container", null, strikethrough, lct.present(), lct.getWebPath()); + tableRowLink(tbl, /*!#*/"Logical Container", null, strikethrough, lct.present(), lct.getWebPath()); } else { - tableRow(tbl, "Logical Container", null, strikethrough, uri); + tableRow(tbl, /*!#*/"Logical Container", null, strikethrough, uri); } } String ps = ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_PROFILE_STYLE); if (ps != null) { if ("cda".equals(ps)) { - tableRow(tbl, "Validation", null, strikethrough, "Instances of this type are validated by templateId"); + tableRow(tbl, /*!#*/"Validation", null, strikethrough, /*!#*/"Instances of this type are validated by templateId"); } else { - tableRow(tbl, "Validation", null, strikethrough, "Instances of this type are validated using an unknown approach: "+ps); + tableRow(tbl, /*!#*/"Validation", null, strikethrough, /*!#*/"Instances of this type are validated using an unknown approach: "+ps); } } } if (root && sd.hasExtension(ToolingExtensions.EXT_SD_IMPOSE_PROFILE)) { - tableRow(tbl, "Impose Profile", "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-imposeProfile.html", strikethrough, - renderCanonicalListExt("This profile also requires that the instance also conform this additional profile: ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE))); + tableRow(tbl, /*!#*/"Impose Profile", "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-imposeProfile.html", strikethrough, + renderCanonicalListExt(/*!#*/"This profile also requires that the instance also conform this additional profile: ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE))); } if (root && sd.hasExtension(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE)) { - tableRow(tbl, "Complies with Profile", "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-compliesWithProfile.html", strikethrough, - renderCanonicalListExt("This profile compiles with the profile ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE))); + tableRow(tbl, /*!#*/"Complies with Profile", "http://hl7.org/fhir/extensions/StructureDefinition-structuredefinition-compliesWithProfile.html", strikethrough, + renderCanonicalListExt(/*!#*/"This profile compiles with the profile ", sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE))); } - tableRow(tbl, "Obligations", null, strikethrough, describeObligations(d, root, sd)); + tableRow(tbl, /*!#*/"Obligations", null, strikethrough, describeObligations(d, root, sd)); if (d.hasExtension(ToolingExtensions.EXT_EXTENSION_STYLE)) { String es = d.getExtensionString(ToolingExtensions.EXT_EXTENSION_STYLE); if ("named-elements".equals(es)) { if (context.hasLink(KnownLinkType.JSON_NAMES)) { - tableRow(tbl, "Extension Style", context.getLink(KnownLinkType.JSON_NAMES), strikethrough, "This element can be extended by named JSON elements"); + tableRow(tbl, /*!#*/"Extension Style", context.getLink(KnownLinkType.JSON_NAMES), strikethrough, /*!#*/"This element can be extended by named JSON elements"); } else { - tableRow(tbl, "Extension Style", ToolingExtensions.WEB_EXTENSION_STYLE, strikethrough, "This element can be extended by named JSON elements"); + tableRow(tbl, /*!#*/"Extension Style", ToolingExtensions.WEB_EXTENSION_STYLE, strikethrough, /*!#*/"This element can be extended by named JSON elements"); } } } if (!d.getPath().contains(".") && ToolingExtensions.hasExtension(sd, ToolingExtensions.EXT_BINDING_STYLE)) { - tableRow(tbl, "Binding Style", ToolingExtensions.WEB_BINDING_STYLE, strikethrough, - "This type can be bound to a value set using the " + ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_BINDING_STYLE)+" binding style"); + tableRow(tbl, /*!#*/"Binding Style", ToolingExtensions.WEB_BINDING_STYLE, strikethrough, + /*!#*/"This type can be bound to a value set using the " + ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_BINDING_STYLE)+" binding style"); } if (d.hasExtension(ToolingExtensions.EXT_DATE_FORMAT)) { - tableRow(tbl, "Date Format", null, strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DATE_FORMAT)); + tableRow(tbl, /*!#*/"Date Format", null, strikethrough, ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_DATE_FORMAT)); } String ide = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_ID_EXPECTATION); if (ide != null) { if (ide.equals("optional")) { - tableRow(tbl, "ID Expectation", null, strikethrough, "Id may or not be present (this is the default for elements but not resources)"); + tableRow(tbl, /*!#*/"ID Expectation", null, strikethrough, /*!#*/"Id may or not be present (this is the default for elements but not resources)"); } else if (ide.equals("required")) { - tableRow(tbl, "ID Expectation", null, strikethrough, "Id is required to be present (this is the default for resources but not elements)"); + tableRow(tbl, /*!#*/"ID Expectation", null, strikethrough, /*!#*/"Id is required to be present (this is the default for resources but not elements)"); } else if (ide.equals("required")) { - tableRow(tbl, "ID Expectation", null, strikethrough, "An ID is not allowed in this context"); + tableRow(tbl, /*!#*/"ID Expectation", null, strikethrough, /*!#*/"An ID is not allowed in this context"); } } if (d.hasExtension(ToolingExtensions.EXT_ID_CHOICE_GROUP)) { - tableRow(tbl, "Choice Group", null, strikethrough, "This is a repeating choice group that does not appear directly in the instance"); + tableRow(tbl, /*!#*/"Choice Group", null, strikethrough, /*!#*/"This is a repeating choice group that does not appear directly in the instance"); } // tooling extensions for formats if (ToolingExtensions.hasAnyOfExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { - tableRow(tbl, "JSON Format", null, strikethrough, describeJson(d)); + tableRow(tbl, /*!#*/"JSON Format", null, strikethrough, describeJson(d)); } if (d.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) || sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) || d.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED) || sd.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED) || d.hasRepresentation()) { - tableRow(tbl, "XML Format", null, strikethrough, describeXml(sd, d, root)); + tableRow(tbl, /*!#*/"XML Format", null, strikethrough, describeXml(sd, d, root)); } if (d.hasExtension(ToolingExtensions.EXT_IMPLIED_PREFIX)) { - tableRow(tbl, "String Format", null, strikethrough).codeWithText("When this element is read ", ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_IMPLIED_PREFIX), "is prefixed to the value before validation"); + tableRow(tbl, /*!#*/"String Format", null, strikethrough).codeWithText(/*!#*/"When this element is read ", ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_IMPLIED_PREFIX), /*!#*/"is prefixed to the value before validation"); } if (d.hasExtension(ToolingExtensions.EXT_STANDARDS_STATUS)) { @@ -3704,34 +3711,34 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (sdb != null) { StandardsStatus base = determineStandardsStatus(sdb, (ElementDefinition) d.getUserData("derived.pointer")); if (base != null) { - tableRow(tbl, "Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()+" (from "+base.toDisplay()+")"); + tableRow(tbl, /*!#*/"Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()+" (from "+base.toDisplay()+")"); } else { - tableRow(tbl, "Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()); + tableRow(tbl, /*!#*/"Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()); } } else { - tableRow(tbl, "Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()); + tableRow(tbl, /*!#*/"Standards Status", "versions.html#std-process", strikethrough, ss.toDisplay()); } } if (mode != GEN_MODE_DIFF && d.hasIsSummary()) { - tableRow(tbl, "Summary", "search.html#summary", strikethrough, Boolean.toString(d.getIsSummary())); + tableRow(tbl, /*!#*/"Summary", "search.html#summary", strikethrough, Boolean.toString(d.getIsSummary())); } - tableRow(tbl, "Requirements", null, strikethrough, compareMarkdown(sd.getName(), d.getRequirementsElement(), (compare==null) || slicedExtension ? null : compare.getRequirementsElement(), mode)); - tableRow(tbl, "Label", null, strikethrough, compareString(d.getLabel(), d.getLabelElement(), null, "label", d, (compare != null ? compare.getLabel() : null), null, mode, false, false)); - tableRow(tbl, "Alternate Names", null, strikethrough, compareSimpleTypeLists(d.getAlias(), ((compare==null) || slicedExtension ? null : compare.getAlias()), mode)); - tableRow(tbl, "Definitional Codes", null, strikethrough, compareDataTypeLists(d.getCode(), ((compare==null) || slicedExtension ? null : compare.getCode()), mode)); - tableRow(tbl, "Min Value", null, strikethrough, compareString(d.hasMinValue() ? encodeValue(d.getMinValue(), null) : null, d.getMinValue(), null, "minValue", d, compare!= null && compare.hasMinValue() ? encodeValue(compare.getMinValue(), null) : null, null, mode, false, false)); - tableRow(tbl, "Max Value", null, strikethrough, compareString(d.hasMaxValue() ? encodeValue(d.getMaxValue(), null) : null, d.getMaxValue(), null, "maxValue", d, compare!= null && compare.hasMaxValue() ? encodeValue(compare.getMaxValue(), null) : null, null, mode, false, false)); - tableRow(tbl, "Max Length", null, strikethrough, compareString(d.hasMaxLength() ? toStr(d.getMaxLength()) : null, d.getMaxLengthElement(), null, "maxLength", d, compare!= null && compare.hasMaxLengthElement() ? toStr(compare.getMaxLength()) : null, null, mode, false, false)); - tableRow(tbl, "Value Required", null, strikethrough, compareString(encodeValue(d.getMustHaveValueElement(), null), d.getMustHaveValueElement(), null, (compare != null ? encodeValue(compare.getMustHaveValueElement(), null) : null), d, null, "mustHaveValueElement", mode, false, false)); - tableRow(tbl, "Value Alternatives", null, strikethrough, compareSimpleTypeLists(d.getValueAlternatives(), ((compare==null) || slicedExtension ? null : compare.getValueAlternatives()), mode)); - tableRow(tbl, "Default Value", null, strikethrough, encodeValue(d.getDefaultValue(), "defaultValue", d, compare==null ? null : compare.getDefaultValue(), mode, d.getName())); - tableRow(tbl, "Meaning if Missing", null, strikethrough, d.getMeaningWhenMissing()); - tableRow(tbl, "Fixed Value", null, strikethrough, encodeValue(d.getFixed(), "fixed", d, compare==null ? null : compare.getFixed(), mode, d.getName())); - tableRow(tbl, "Pattern Value", null, strikethrough, encodeValue(d.getPattern(), "pattern", d, compare==null ? null : compare.getPattern(), mode, d.getName())); - tableRow(tbl, "Example", null, strikethrough, encodeValues(d.getExample())); - tableRow(tbl, "Invariants", null, strikethrough, invariants(d.getConstraint(), compare==null ? null : compare.getConstraint(), d, mode)); - tableRow(tbl, "LOINC Code", null, strikethrough, getMapping(sd, d, LOINC_MAPPING, compare, mode)); - tableRow(tbl, "SNOMED-CT Code", null, strikethrough, getMapping(sd, d, SNOMED_MAPPING, compare, mode)); + tableRow(tbl, /*!#*/"Requirements", null, strikethrough, compareMarkdown(sd.getName(), d.getRequirementsElement(), (compare==null) || slicedExtension ? null : compare.getRequirementsElement(), mode)); + tableRow(tbl, /*!#*/"Label", null, strikethrough, compareString(d.getLabel(), d.getLabelElement(), null, "label", d, (compare != null ? compare.getLabel() : null), null, mode, false, false)); + tableRow(tbl, /*!#*/"Alternate Names", null, strikethrough, compareSimpleTypeLists(d.getAlias(), ((compare==null) || slicedExtension ? null : compare.getAlias()), mode)); + tableRow(tbl, /*!#*/"Definitional Codes", null, strikethrough, compareDataTypeLists(d.getCode(), ((compare==null) || slicedExtension ? null : compare.getCode()), mode)); + tableRow(tbl, /*!#*/"Min Value", null, strikethrough, compareString(d.hasMinValue() ? encodeValue(d.getMinValue(), null) : null, d.getMinValue(), null, "minValue", d, compare!= null && compare.hasMinValue() ? encodeValue(compare.getMinValue(), null) : null, null, mode, false, false)); + tableRow(tbl, /*!#*/"Max Value", null, strikethrough, compareString(d.hasMaxValue() ? encodeValue(d.getMaxValue(), null) : null, d.getMaxValue(), null, "maxValue", d, compare!= null && compare.hasMaxValue() ? encodeValue(compare.getMaxValue(), null) : null, null, mode, false, false)); + tableRow(tbl, /*!#*/"Max Length", null, strikethrough, compareString(d.hasMaxLength() ? toStr(d.getMaxLength()) : null, d.getMaxLengthElement(), null, "maxLength", d, compare!= null && compare.hasMaxLengthElement() ? toStr(compare.getMaxLength()) : null, null, mode, false, false)); + tableRow(tbl, /*!#*/"Value Required", null, strikethrough, compareString(encodeValue(d.getMustHaveValueElement(), null), d.getMustHaveValueElement(), null, (compare != null ? encodeValue(compare.getMustHaveValueElement(), null) : null), d, null, "mustHaveValueElement", mode, false, false)); + tableRow(tbl, /*!#*/"Value Alternatives", null, strikethrough, compareSimpleTypeLists(d.getValueAlternatives(), ((compare==null) || slicedExtension ? null : compare.getValueAlternatives()), mode)); + tableRow(tbl, /*!#*/"Default Value", null, strikethrough, encodeValue(d.getDefaultValue(), "defaultValue", d, compare==null ? null : compare.getDefaultValue(), mode, d.getName())); + tableRow(tbl, /*!#*/"Meaning if Missing", null, strikethrough, d.getMeaningWhenMissing()); + tableRow(tbl, /*!#*/"Fixed Value", null, strikethrough, encodeValue(d.getFixed(), "fixed", d, compare==null ? null : compare.getFixed(), mode, d.getName())); + tableRow(tbl, /*!#*/"Pattern Value", null, strikethrough, encodeValue(d.getPattern(), "pattern", d, compare==null ? null : compare.getPattern(), mode, d.getName())); + tableRow(tbl, /*!#*/"Example", null, strikethrough, encodeValues(d.getExample())); + tableRow(tbl, /*!#*/"Invariants", null, strikethrough, invariants(d.getConstraint(), compare==null ? null : compare.getConstraint(), d, mode)); + tableRow(tbl, /*!#*/"LOINC Code", null, strikethrough, getMapping(sd, d, LOINC_MAPPING, compare, mode)); + tableRow(tbl, /*!#*/"SNOMED-CT Code", null, strikethrough, getMapping(sd, d, SNOMED_MAPPING, compare, mode)); tbl.tx("\r\n"); } @@ -3740,7 +3747,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (x1 != null) { XhtmlNode x2 = compareString(encodeValue(d.getIsModifierReasonElement(), null), d.getIsModifierReasonElement(), null, "isModifierReason", d, compare == null ? null : encodeValue(compare.getIsModifierReasonElement(), null), null, mode, false, false); if (x2 != null) { - x1.tx(" because "); + x1.tx(" "+/*!#*/"because "); x1.copyAllContent(x2); } } @@ -3757,19 +3764,19 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (d.hasRepresentation(pr)) { switch (pr) { case CDATEXT: - ret.tx("This property is represented as CDA Text in the XML."); + ret.tx(/*!#*/"This property is represented as CDA Text in the XML."); break; case TYPEATTR: - ret.codeWithText("The type of this property is determined using the ", "xsi:type", "attribute."); + ret.codeWithText(/*!#*/"The type of this property is determined using the ", "xsi:type", "attribute."); break; case XHTML: - ret.tx("This property is represented as XHTML Text in the XML."); + ret.tx(/*!#*/"This property is represented as XHTML Text in the XML."); break; case XMLATTR: - ret.tx("In the XML format, this property is represented as an attribute."); + ret.tx(/*!#*/"In the XML format, this property is represented as an attribute."); break; case XMLTEXT: - ret.tx("In the XML format, this property is represented as unadorned text."); + ret.tx(/*!#*/"In the XML format, this property is represented as unadorned text."); break; default: } @@ -3780,11 +3787,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { name = ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); } if (name != null) { - ret.codeWithText("In the XML format, this property has the namespace ", name, "."); + ret.codeWithText(/*!#*/"In the XML format, this property has the namespace ", name, "."); } name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED); if (name != null) { - ret.codeWithText("In the XML format, this property has the actual name", name, "."); + ret.codeWithText(/*!#*/"In the XML format, this property has the actual name", name, "."); } return ret; } @@ -3798,33 +3805,33 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (code != null) { switch (code) { case "present": - ul.li().tx("The JSON Array for this property is present even when there are no items in the instance (e.g. as an empty array)"); + ul.li().tx(/*!#*/"The JSON Array for this property is present even when there are no items in the instance (e.g. as an empty array)"); break; case "absent": - ul.li().tx("The JSON Array for this property is not present when there are no items in the instance (e.g. never as an empty array)"); + ul.li().tx(/*!#*/"The JSON Array for this property is not present when there are no items in the instance (e.g. never as an empty array)"); break; case "either": - ul.li().tx("The JSON Array for this property may be present even when there are no items in the instance (e.g. may be present as an empty array)"); + ul.li().tx(/*!#*/"The JSON Array for this property may be present even when there are no items in the instance (e.g. may be present as an empty array)"); break; } } String jn = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED); if (jn != null) { if (d.getPath().contains(".")) { - ul.li().codeWithText("This property appears in JSON with the property name ", jn, null); + ul.li().codeWithText(/*!#*/"This property appears in JSON with the property name ", jn, null); } else { - ul.li().codeWithText("This type can appear in JSON with the property name ", jn, " (in elements using named extensions)"); + ul.li().codeWithText(/*!#*/"This type can appear in JSON with the property name ", jn, " (in elements using named extensions)"); } } code = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_PROP_KEY); if (code != null) { - ul.li().codeWithText("This repeating object is represented as a single JSON object with named properties. The name of the property (key) is the value of the ", code, " child"); + ul.li().codeWithText(/*!#*/"This repeating object is represented as a single JSON object with named properties. The name of the property (key) is the value of the ", code, " child"); } if (ToolingExtensions.readBoolExtension(d, ToolingExtensions.EXT_JSON_NULLABLE)) { - ul.li().tx("This object can be represented as null in the JSON structure (which counts as 'present' for cardinality purposes)"); + ul.li().tx(/*!#*/"This object can be represented as null in the JSON structure (which counts as 'present' for cardinality purposes)"); } if (ToolingExtensions.readBoolExtension(d, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { - ul.li().tx("The type of this element is inferred from the JSON type in the instance"); + ul.li().tx(/*!#*/"The type of this element is inferred from the JSON type in the instance"); } switch (ul.getChildNodes().size()) { @@ -3843,12 +3850,12 @@ public class StructureDefinitionRenderer extends ResourceRenderer { XhtmlNode ul = ret.ul(); if (root) { if (sdx.hasExtension(ToolingExtensions.EXT_OBLIGATION_PROFILE_FLAG)) { - ul.li().tx("This is an obligation profile that only contains obligations and additional bindings"); + ul.li().tx(/*!#*/"This is an obligation profile that only contains obligations and additional bindings"); } for (Extension ext : sdx.getExtensionsByUrl(ToolingExtensions.EXT_OBLIGATION_INHERITS)) { String iu = ext.getValue().primitiveValue(); XhtmlNode bb = ul.li(); - bb.tx("This profile picks up obligations and additional bindings from "); + bb.tx(/*!#*/"This profile picks up obligations and additional bindings from "); StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, iu); if (sd == null) { bb.code().tx(iu); @@ -3881,13 +3888,13 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (au instanceof CanonicalType) { String url = ((CanonicalType) au).asStringValue(); ValueSet vs = context.getContext().findTxResource(ValueSet.class, url); - ret.tx("Value set "); + ret.tx(/*!#*/"Value set "); genCT(ret, url, vs); return ret; } else if (au instanceof CodeableConcept) { CodeableConcept cc = (CodeableConcept) au; if (cc.getCoding().size() != 1) { - ret.tx("One of:"); + ret.tx(/*!#*/"One of:"); } ret.tx(summarise(cc)); return ret; @@ -3960,23 +3967,23 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private String sliceOrderString(ElementDefinitionSlicingComponent slicing) { if (slicing.getOrdered()) - return "ordered"; + return /*!#*/"ordered"; else - return "unordered"; + return /*!#*/"unordered"; } private void generateSlicing(XhtmlNode tbl, StructureDefinition profile, ElementDefinition ed, ElementDefinitionSlicingComponent slicing, ElementDefinition compare, int mode, boolean strikethrough) throws IOException { XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); - x.codeWithText("This element introduces a set of slices on ", ed.getPath(), ". The slices are "); + x.codeWithText(/*!#*/"This element introduces a set of slices on ", ed.getPath(), ". The slices are "); String newOrdered = sliceOrderString(slicing); String oldOrdered = (compare==null || !compare.hasSlicing()) ? null : sliceOrderString(compare.getSlicing()); compareString(x, newOrdered, slicing.getOrderedElement(), null, null, null, oldOrdered, null, mode, false, false); - x.tx(" and "); + x.tx(" "+/*!#*/"and "); compareString(x, slicing.hasRules() ? slicing.getRules().getDisplay() : null, slicing.getRulesElement(), null, "rules", slicing, compare!=null && compare.hasSlicing() && compare.getSlicing().hasRules() ? compare.getSlicing().getRules().getDisplay() : null, null, mode, false, false); if (slicing.hasDiscriminator()) { - x.tx(", and can be differentiated using the following discriminators: "); + x.tx(/*!#*/", and can be differentiated using the following discriminators: "); StatusList list = new StatusList<>(); for (ElementDefinitionSlicingDiscriminatorComponent d : slicing.getDiscriminator()) { list.add(new DiscriminatorWithStatus(d)); @@ -3991,7 +3998,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { rc.render(x.li()); } } else { - x.tx(", and defines no discriminators to differentiate the slices"); + x.tx(/*!#*/", and defines no discriminators to differentiate the slices"); } tableRow(tbl, "Slicing", "profiling.html#slicing", strikethrough, x); tbl.tx("\r\n"); @@ -4070,15 +4077,15 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private XhtmlNode businessIdWarning(String resource, String name) { if (name.equals("identifier")) { XhtmlNode ret = new XhtmlNode(NodeType.Element, "div"); - ret.tx("This is a business identifier, not a resource identifier (see "); - ret.ah(corePath + "resource.html#identifiers").tx("discussion"); + ret.tx(/*!#*/"This is a business identifier, not a resource identifier (see "); + ret.ah(corePath + "resource.html#identifiers").tx(/*!#*/"discussion"); ret.tx(")"); return ret; } if (name.equals("version")) {// && !resource.equals("Device")) XhtmlNode ret = new XhtmlNode(NodeType.Element, "div"); - ret.tx("This is a business versionId, not a resource version id (see "); - ret.ah(corePath + "resource.html#versions").tx("discussion"); + ret.tx(/*!#*/"This is a business versionId, not a resource version id (see "); + ret.ah(corePath + "resource.html#versions").tx(/*!#*/"discussion"); ret.tx(")"); return ret; } @@ -4110,7 +4117,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { XhtmlNode t = compareSimpleTypeLists(d.getCondition(), compare == null ? null : compare.getCondition(), mode); if (t != null) { x.br(); - x.tx("This element is affected by the following invariants: "); + x.tx(/*!#*/"This element is affected by the following invariants: "); x.copyAllContent(t); } return x; @@ -4138,7 +4145,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } else { boolean first = true; if (types.size() > 1) { - ret.tx("Choice of: "); + ret.tx(/*!#*/"Choice of: "); } Map map = new HashMap(); for (TypeRefComponent t : compareTypes) { @@ -4184,11 +4191,11 @@ public class StructureDefinitionRenderer extends ResourceRenderer { return null; case 2: XhtmlNode x = new XhtmlNode(NodeType.Element, "div"); - x.tx(" (Complex Extension)"); + x.tx(" "+/*!#*/"(Complex Extension)"); return x; case 3: x = new XhtmlNode(NodeType.Element, "div"); - x.tx(" (Extension Type: "); + x.tx(" "+/*!#*/"(Extension Type: "); x.copyAllContent(describeTypes(value.getType(), false, value, compareValue, compMode, null, null, sd)); x.tx(")"); return x; @@ -4444,7 +4451,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { span.tx("to "); XhtmlNode ispan = span.spanClss("copy-text-inline"); ispan.code().tx(binding.getValueSet()); - ispan.button("btn-copy", "Click to Copy URL").attribute("data-clipboard-text", binding.getValueSet()); + ispan.button("btn-copy", /*!#*/"Click to Copy URL").attribute("data-clipboard-text", binding.getValueSet()); } span.tx(")"); } @@ -4462,17 +4469,17 @@ public class StructureDefinitionRenderer extends ResourceRenderer { private String conf(ElementDefinitionBindingComponent def) { if (def.getStrength() == null) { - return "For codes, see "; + return /*!#*/"For codes, see "; } switch (def.getStrength()) { case EXAMPLE: - return "For example codes, see "; + return /*!#*/"For example codes, see "; case PREFERRED: - return "The codes SHOULD be taken from "; + return /*!#*/"The codes SHOULD be taken from "; case EXTENSIBLE: - return "Unless not suitable, these codes SHALL be taken from "; + return /*!#*/"Unless not suitable, these codes SHALL be taken from "; case REQUIRED: - return "The codes SHALL be taken from "; + return /*!#*/"The codes SHALL be taken from "; default: return "?sd-conf?"; } @@ -4638,17 +4645,17 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } return b.toString(); } else { - throw new FHIRException("Error describing concept - not done yet (no codings, no text)"); + throw new FHIRException(/*!#*/"Error describing concept - not done yet (no codings, no text)"); } } private String summarise(Coding coding) throws FHIRException { if ("http://snomed.info/sct".equals(coding.getSystem())) - return "" + translate("sd.summary", "SNOMED CT code") + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); + return "" + (/*!#*/"SNOMED CT code") + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); if ("http://loinc.org".equals(coding.getSystem())) - return "" + translate("sd.summary", "LOINC code") + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); + return "" + (/*!#*/"LOINC code") + " " + coding.getCode() + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); if ("http://unitsofmeasure.org/".equals(coding.getSystem())) - return " (" + translate("sd.summary", "UCUM") + ": " + coding.getCode() + ")"; + return " (" + (/*!#*/"UCUM") + ": " + coding.getCode() + ")"; CodeSystem cs = context.getContext().fetchCodeSystem(coding.getSystem()); if (cs == null) return "" + coding.getCode() + "" + (!coding.hasDisplay() ? "" : "(\"" + gt(coding.getDisplayElement()) + "\")"); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java index 2332e94b3..829034c61 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureMapRenderer.java @@ -61,7 +61,7 @@ public class StructureMapRenderer extends TerminologyRenderer { private static final String COLOR_SYNTAX = "navy"; private static final boolean RENDER_MULTIPLE_TARGETS_ONELINE = true; private static final String COLOR_SPECIAL = "#b36b00"; - private static final String DEFAULT_COMMENT = "This element was not defined prior to R5"; + private static final String DEFAULT_COMMENT = /*!#*/"This element was not defined prior to R5"; private String clauseComment = DEFAULT_COMMENT; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SubscriptionTopicRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SubscriptionTopicRenderer.java index 327ffa80b..2d96d61f0 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SubscriptionTopicRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/SubscriptionTopicRenderer.java @@ -49,39 +49,39 @@ public class SubscriptionTopicRenderer extends ResourceRenderer { } if (st.hasResourceTrigger()) { - TableData td = new TableData("Resource Triggers"); + TableData td = new TableData(/*!#*/"Resource Triggers"); for (SubscriptionTopicResourceTriggerComponent rt : st.getResourceTrigger()) { TableRowData tr = td.addRow(); if (rt.hasResource()) { - tr.value("Resource", rt.getResourceElement()); + tr.value(/*!#*/"Resource", rt.getResourceElement()); } for (Enumeration t : rt.getSupportedInteraction()) { - tr.value("Interactions", t); + tr.value(/*!#*/"Interactions", t); } if (rt.hasQueryCriteria()) { StringBuilder md = new StringBuilder(); if (rt.getQueryCriteria().hasPrevious()) { - md.append("* previous = "+rt.getQueryCriteria().getPrevious()+"\r\n"); + md.append(/*!#*/"* previous = "+rt.getQueryCriteria().getPrevious()+"\r\n"); } if (rt.getQueryCriteria().hasResultForCreate()) { - md.append("* create result = "+rt.getQueryCriteria().getResultForCreate()+"\r\n"); + md.append(/*!#*/"* create result = "+rt.getQueryCriteria().getResultForCreate()+"\r\n"); } if (rt.getQueryCriteria().hasCurrent()) { - md.append("* create result = "+rt.getQueryCriteria().getCurrent()+"\r\n"); + md.append(/*!#*/"* create result = "+rt.getQueryCriteria().getCurrent()+"\r\n"); } if (rt.getQueryCriteria().hasPrevious()) { - md.append("* delete result = "+rt.getQueryCriteria().getResultForDelete()+"\r\n"); + md.append(/*!#*/"* delete result = "+rt.getQueryCriteria().getResultForDelete()+"\r\n"); } if (rt.getQueryCriteria().hasRequireBoth()) { - md.append("* require both = "+rt.getQueryCriteria().getRequireBoth()+"\r\n"); + md.append(/*!#*/"* require both = "+rt.getQueryCriteria().getRequireBoth()+"\r\n"); } - tr.value("Criteria", new MarkdownType(md.toString())); + tr.value(/*!#*/"Criteria", new MarkdownType(md.toString())); } if (rt.hasFhirPathCriteriaElement()) { - tr.value("FHIR Path", rt.getFhirPathCriteriaElement()); + tr.value(/*!#*/"FHIR Path", rt.getFhirPathCriteriaElement()); } if (rt.hasDescription()) { - tr.value("Description", rt.getDescriptionElement()); + tr.value(/*!#*/"Description", rt.getDescriptionElement()); } } renderTable(td, x); @@ -92,13 +92,13 @@ public class SubscriptionTopicRenderer extends ResourceRenderer { for (SubscriptionTopicEventTriggerComponent rt : st.getEventTrigger()) { TableRowData tr = td.addRow(); if (rt.hasResource()) { - tr.value("Resource", rt.getResourceElement()); + tr.value(/*!#*/"Resource", rt.getResourceElement()); } if (rt.hasEvent()) { - tr.value("Event", rt.getEvent()); + tr.value(/*!#*/"Event", rt.getEvent()); } if (rt.hasDescription()) { - tr.value("Description", rt.getDescriptionElement()); + tr.value(/*!#*/"Description", rt.getDescriptionElement()); } } renderTable(td, x); @@ -109,19 +109,19 @@ public class SubscriptionTopicRenderer extends ResourceRenderer { for (SubscriptionTopicCanFilterByComponent rt : st.getCanFilterBy()) { TableRowData tr = td.addRow(); if (rt.hasResource()) { - tr.value("Resource", rt.getResourceElement()); + tr.value(/*!#*/"Resource", rt.getResourceElement()); } if (rt.hasFilterParameter()) { - tr.value("Filter Parameter", rt.getFilterParameterElement()); + tr.value(/*!#*/"Filter Parameter", rt.getFilterParameterElement()); } if (rt.hasFilterDefinition()) { - tr.value("Filter Definition", rt.getFilterDefinitionElement()); + tr.value(/*!#*/"Filter Definition", rt.getFilterDefinitionElement()); } for (Enumeration t : rt.getComparator()) { - tr.value("Comparators", t); + tr.value(/*!#*/"Comparators", t); } for (Enumeration t : rt.getModifier()) { - tr.value("Modifiers", t); + tr.value(/*!#*/"Modifiers", t); } } renderTable(td, x); @@ -132,13 +132,13 @@ public class SubscriptionTopicRenderer extends ResourceRenderer { for (SubscriptionTopicNotificationShapeComponent rt : st.getNotificationShape()) { TableRowData tr = td.addRow(); if (rt.hasResource()) { - tr.value("Resource", rt.getResourceElement()); + tr.value(/*!#*/"Resource", rt.getResourceElement()); } for (StringType t : rt.getInclude()) { - tr.value("Includes", t); + tr.value(/*!#*/"Includes", t); } for (StringType t : rt.getRevInclude()) { - tr.value("Reverse Includes", t); + tr.value(/*!#*/"Reverse Includes", t); } } renderTable(td, x); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java index a1102871e..7f994273e 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java @@ -209,23 +209,23 @@ public abstract class TerminologyRenderer extends ResourceRenderer { protected XhtmlNode addTableHeaderRowStandard(XhtmlNode t, boolean hasHierarchy, boolean hasDisplay, boolean definitions, boolean comments, boolean version, boolean deprecated, List properties, List langs, Map designations, boolean doDesignations) { XhtmlNode tr = t.tr(); if (hasHierarchy) { - tr.td().b().tx("Lvl"); + tr.td().b().tx(/*!#*/"Lvl"); } - tr.td().attribute("style", "white-space:nowrap").b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Code", getContext().getLang())); + tr.td().attribute("style", "white-space:nowrap").b().tx(formatMessage(RenderingContext.RENDER_TX_CODE)); if (hasDisplay) { - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Display", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_DISPLAY)); } if (definitions) { - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Definition", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_DEFINITION)); } if (deprecated) { - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Deprecated", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_DEPRECATED)); } if (comments) { - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Comments", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_COMMENTS)); } if (version) { - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", "Version", getContext().getLang())); + tr.td().b().tx(formatMessage(RenderingContext.RENDER_TX_VERSION)); } if (properties != null) { for (PropertyComponent pc : properties) { @@ -236,7 +236,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer { display = pc.getCode(); } } - tr.td().b().tx(getContext().getWorker().translator().translate("xhtml-gen-cs", display, getContext().getLang())); + tr.td().b().tx(display); } } if (doDesignations) { @@ -307,7 +307,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer { a.addText(value); } else if (value.equals("http://snomed.info/sct") || value.equals("http://snomed.info/id")) { XhtmlNode a = li.ah(value); - a.tx("SNOMED-CT"); + a.tx(/*!#*/"SNOMED-CT"); } else { if (value.startsWith("http://hl7.org") && !Utilities.existsInList(value, "http://hl7.org/fhir/sid/icd-10-us")) { @@ -329,7 +329,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer { protected void clipboard(XhtmlNode x, String img, String title, String source) { - XhtmlNode span = x.span("cursor: pointer", "Copy "+title+" Format to clipboard"); + XhtmlNode span = x.span("cursor: pointer", /*!#*/"Copy "+title+" Format to clipboard"); span.attribute("onClick", "navigator.clipboard.writeText('"+Utilities.escapeJson(source)+"');"); span.img(img, "btn").setAttribute("width", "24px").setAttribute("height", "16px"); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TestPlanRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TestPlanRenderer.java index 86ffa34ad..bf1805c2d 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TestPlanRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TestPlanRenderer.java @@ -45,7 +45,7 @@ public class TestPlanRenderer extends ResourceRenderer { XhtmlNode p = null; if (!tp.getContact().isEmpty()) { p = x.para(); - p.b().tx("Contact:"); + p.b().tx(/*!#*/"Contact:"); p.tx(" ("); boolean firsti = true; for (ContactDetail ci : tp.getContact()) { @@ -69,7 +69,7 @@ public class TestPlanRenderer extends ResourceRenderer { if (tp.hasCategory()) { p = x.para(); - p.b().tx("Category: "); + p.b().tx(/*!#*/"Category: "); boolean first = true; for (CodeableConcept cc : tp.getCategory()) { if (first) @@ -83,10 +83,10 @@ public class TestPlanRenderer extends ResourceRenderer { if (tp.hasScope()) { if (tp.getScope().size() == 1) { p = x.para(); - p.b().tx("Test Plan Scope: "); + p.b().tx(/*!#*/"Test Plan Scope: "); renderReference(tp, p, tp.getScopeFirstRep()); } else { - x.para().b().tx("Test Plan Scopes:"); + x.para().b().tx(/*!#*/"Test Plan Scopes:"); XhtmlNode ul = x.ul(); for (Reference ref : tp.getScope()) { renderReference(tp, ul.li(), ref); @@ -97,7 +97,7 @@ public class TestPlanRenderer extends ResourceRenderer { if (tp.hasDependency()) { if (tp.getDependency().size() == 1) { p = x.para(); - p.b().tx("Test Plan Dependency: "); + p.b().tx(/*!#*/"Test Plan Dependency: "); XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); if (!Utilities.noString(tp.getDependencyFirstRep().getDescription())) { @@ -106,7 +106,7 @@ public class TestPlanRenderer extends ResourceRenderer { tr = t.tr(); renderReference(tp, tr.td(), tp.getDependencyFirstRep().getPredecessor()); } else { - x.para().b().tx("Test Plan Dependencies:"); + x.para().b().tx(/*!#*/"Test Plan Dependencies:"); XhtmlNode ul = x.ul(); XhtmlNode li = null; for (TestPlanDependencyComponent d : tp.getDependency()) { @@ -115,7 +115,7 @@ public class TestPlanRenderer extends ResourceRenderer { addMarkdown(li, d.getDescription()); } else { - li.addText("Dependency - no description"); + li.addText(/*!#*/"Dependency - no description"); } if (d.hasPredecessor()) { XhtmlNode liul = li.ul(); @@ -132,15 +132,15 @@ public class TestPlanRenderer extends ResourceRenderer { if (tp.hasTestCase()) { for (TestPlanTestCaseComponent tc : tp.getTestCase()) { - x.h2().addText("Test Case" + (tc.hasSequence() ? " - Sequence" + tc.getSequence() : "")); + x.h2().addText(/*!#*/"Test Case" + (tc.hasSequence() ? " - Sequence" + tc.getSequence() : "")); if (tc.hasScope()) { if (tc.getScope().size() == 1) { p = x.para(); - p.b().tx("Test Case Scope: "); + p.b().tx(/*!#*/"Test Case Scope: "); renderReference(tp, p, tc.getScopeFirstRep()); } else { - x.para().b().tx("Test Case Scopes:"); + x.para().b().tx(/*!#*/"Test Case Scopes:"); XhtmlNode ul = x.ul(); for (Reference ref : tc.getScope()) { renderReference(tp, ul.li(), ref); @@ -150,7 +150,7 @@ public class TestPlanRenderer extends ResourceRenderer { if (tc.hasDependency()) { if (tc.getDependency().size() == 1) { - x.h3().addText("Test Case Dependency"); + x.h3().addText(/*!#*/"Test Case Dependency"); XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); if (!Utilities.noString(tc.getDependencyFirstRep().getDescription())) { @@ -159,7 +159,7 @@ public class TestPlanRenderer extends ResourceRenderer { tr = t.tr(); renderReference(tp, tr.td(), tc.getDependencyFirstRep().getPredecessor()); } else { - x.h3().addText("Test Case Dependencies"); + x.h3().addText(/*!#*/"Test Case Dependencies"); XhtmlNode ul = x.ul(); XhtmlNode li = null; for (TestCaseDependencyComponent d : tc.getDependency()) { @@ -168,7 +168,7 @@ public class TestPlanRenderer extends ResourceRenderer { addMarkdown(li, d.getDescription()); } else { - li.addText("Dependency - no description"); + li.addText(/*!#*/"Dependency - no description"); } if (d.hasPredecessor()) { XhtmlNode liul = li.ul(); @@ -181,14 +181,14 @@ public class TestPlanRenderer extends ResourceRenderer { if (tc.hasTestRun()) { if (tc.getTestRun().size() == 1) { - x.h3().addText("Test Run"); + x.h3().addText(/*!#*/"Test Run"); renderTestRun(x, tp, tc.getTestRunFirstRep()); } else { int count = 0; for (TestPlanTestCaseTestRunComponent trun : tc.getTestRun()) { count++; - x.h3().addText("Test Run " + count); + x.h3().addText(/*!#*/"Test Run " + count); renderTestRun(x, tp, trun); } } @@ -196,14 +196,14 @@ public class TestPlanRenderer extends ResourceRenderer { if (tc.hasTestData()) { if (tc.getTestData().size() == 1) { - x.h3().addText("Test Data"); + x.h3().addText(/*!#*/"Test Data"); renderTestData(x, tp, tc.getTestDataFirstRep()); } else { int count = 0; for (TestPlanTestCaseTestDataComponent tdata : tc.getTestData()) { count++; - x.h3().addText("Test Data " + count); + x.h3().addText(/*!#*/"Test Data " + count); renderTestData(x, tp, tdata); } } @@ -211,14 +211,14 @@ public class TestPlanRenderer extends ResourceRenderer { if (tc.hasAssertion()) { if (tc.getAssertion().size() == 1) { - x.h3().addText("Assertion"); + x.h3().addText(/*!#*/"Assertion"); renderAssertion(x, tp, tc.getAssertionFirstRep()); } else { int count = 0; for (TestPlanTestCaseAssertionComponent as : tc.getAssertion()) { count++; - x.h3().addText("Assertion " + count); + x.h3().addText(/*!#*/"Assertion " + count); renderAssertion(x, tp, as); } } @@ -237,8 +237,8 @@ public class TestPlanRenderer extends ResourceRenderer { if (trun.hasScript()) { XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); - tr.td().b().addText("Language"); - tr.td().b().addText("Source[x]"); + tr.td().b().addText(/*!#*/"Language"); + tr.td().b().addText(/*!#*/"Source[x]"); tr = t.tr(); if (trun.getScript().hasLanguage()) { renderCodeableConcept(tr.td(), trun.getScript().getLanguage(), false); @@ -261,9 +261,9 @@ public class TestPlanRenderer extends ResourceRenderer { private void renderTestData(XhtmlNode x, TestPlan tp, TestPlanTestCaseTestDataComponent tdata) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); - tr.td().b().addText("Type"); - tr.td().b().addText("Content"); - tr.td().b().addText("Source[x]"); + tr.td().b().addText(/*!#*/"Type"); + tr.td().b().addText(/*!#*/"Content"); + tr.td().b().addText(/*!#*/"Source[x]"); tr = t.tr(); if (tdata.hasType()) { renderCoding(tr.td(), tdata.getType()); @@ -291,9 +291,9 @@ public class TestPlanRenderer extends ResourceRenderer { private void renderAssertion(XhtmlNode x, TestPlan tp, TestPlanTestCaseAssertionComponent as) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome { XhtmlNode t = x.table("grid"); XhtmlNode tr = t.tr(); - tr.td().b().addText("Type"); - tr.td().b().addText("Content"); - tr.td().b().addText("Result"); + tr.td().b().addText(/*!#*/"Type"); + tr.td().b().addText(/*!#*/"Content"); + tr.td().b().addText(/*!#*/"Result"); tr = t.tr(); if (as.hasType()) { XhtmlNode td = tr.td(); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java index ec6a9f967..e235ad9d8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java @@ -78,10 +78,12 @@ public class ValueSetRenderer extends TerminologyRenderer { super(context, rcontext); } - private static final String ABSTRACT_CODE_HINT = "This code is not selectable ('Abstract')"; + private static final String ABSTRACT_CODE_HINT = /*!#*/"This code is not selectable ('Abstract')"; private static final int MAX_DESIGNATIONS_IN_LINE = 5; + private static final int MAX_BATCH_VALIDATION_SIZE = 1000; + private List renderingMaps = new ArrayList(); public boolean render(XhtmlNode x, Resource dr) throws FHIRFormatError, DefinitionException, IOException { @@ -183,7 +185,7 @@ public class ValueSetRenderer extends TerminologyRenderer { if (header) { XhtmlNode h = x.addTag(getHeader()); - h.tx("Value Set Contents"); + h.tx(/*!#*/"Value Set Contents"); if (IsNotFixedExpansion(vs)) addMarkdown(x, vs.getDescription()); if (vs.hasCopyright()) @@ -205,9 +207,9 @@ public class ValueSetRenderer extends TerminologyRenderer { // } String msg = null; if (vs.getExpansion().getContains().isEmpty()) { - msg = "This value set cannot be expanded because of the way it is defined - it has an infinite number of members."; // not sure that's true? + msg = /*!#*/"This value set cannot be expanded because of the way it is defined - it has an infinite number of members."; // not sure that's true? } else { - msg = "This value set cannot be fully expanded, but a selection ("+countMembership(vs)+" codes) of the whole set of codes is shown here."; + msg = /*!#*/"This value set cannot be fully expanded, but a selection ("+countMembership(vs)+" codes) of the whole set of codes is shown here."; } x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px").addText(msg); } else { @@ -215,17 +217,17 @@ public class ValueSetRenderer extends TerminologyRenderer { if (vs.getExpansion().hasTotal()) { if (count != vs.getExpansion().getTotal()) { x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px") - .addText("This value set has "+(hasFragment ? "at least " : "")+vs.getExpansion().getTotal()+" codes in it. In order to keep the publication size manageable, only a selection ("+count+" codes) of the whole set of codes is shown."); + .addText(/*!#*/"This value set has "+(hasFragment ? "at least " : "")+vs.getExpansion().getTotal()+" codes in it. In order to keep the publication size manageable, only a selection ("+count+" codes) of the whole set of codes is shown."); } else { - x.para().tx("This value set contains "+(hasFragment ? "at least " : "")+vs.getExpansion().getTotal()+" concepts."); + x.para().tx(/*!#*/"This value set contains "+(hasFragment ? "at least " : "")+vs.getExpansion().getTotal()+" concepts."); } } else if (count == 1000) { // it's possible that there's exactly 1000 codes, in which case wht we're about to do is wrong // work in progress to tighten up the terminology system to always return a total... - String msg = "This value set has >1000 codes in it. In order to keep the publication size manageable, only a selection (1000 codes) of the whole set of codes is shown"; + String msg = /*!#*/"This value set has >1000 codes in it. In order to keep the publication size manageable, only a selection (1000 codes) of the whole set of codes is shown"; x.para().style("border: maroon 1px solid; background-color: #FFCCCC; font-weight: bold; padding: 8px").addText(msg); } else { - x.para().tx("This value set expansion contains "+count+" concepts."); + x.para().tx(/*!#*/"This value set expansion contains "+count+" concepts."); } } @@ -243,21 +245,21 @@ public class ValueSetRenderer extends TerminologyRenderer { XhtmlNode t = x.table( "codes"); XhtmlNode tr = t.tr(); if (doLevel) - tr.td().b().tx("Level"); - tr.td().attribute("style", "white-space:nowrap").b().tx("Code"); - tr.td().b().tx("System"); + tr.td().b().tx(/*!#*/"Level"); + tr.td().attribute("style", "white-space:nowrap").b().tx(/*!#*/"Code"); + tr.td().b().tx(/*!#*/"System"); XhtmlNode tdDisp = tr.td(); - tdDisp.b().tx("Display"); + tdDisp.b().tx(/*!#*/"Display"); boolean doDesignations = false; for (ValueSetExpansionContainsComponent c : vs.getExpansion().getContains()) { scanForDesignations(c, langs, designations); } scanForProperties(vs.getExpansion(), langs, properties); if (doInactive) { - tr.td().b().tx("Inactive"); + tr.td().b().tx(/*!#*/"Inactive"); } if (doDefinition) { - tr.td().b().tx("Definition"); + tr.td().b().tx(/*!#*/"Definition"); doDesignations = false; for (String n : Utilities.sorted(properties.keySet())) { tr.td().b().ah(properties.get(n)).addText(n); @@ -293,15 +295,15 @@ public class ValueSetRenderer extends TerminologyRenderer { if (!doDesignations && langs.size() + designations.size() > 0) { Collections.sort(langs); if (designations.size() == 0) { - x.para().b().tx("Additional Language Displays"); + x.para().b().tx(/*!#*/"Additional Language Displays"); } else if (langs.size() == 0) { - x.para().b().tx("Additional Designations"); + x.para().b().tx(/*!#*/"Additional Designations"); } else { - x.para().b().tx("Additional Designations and Language Displays"); + x.para().b().tx(/*!#*/"Additional Designations and Language Displays"); } t = x.table("codes"); tr = t.tr(); - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String url : designations.keySet()) { tr.td().b().addText(designations.get(url)); } @@ -341,8 +343,8 @@ public class ValueSetRenderer extends TerminologyRenderer { } private boolean generateContentModeNotices(XhtmlNode x, ValueSetExpansionComponent expansion, Resource vs) { - generateContentModeNotice(x, expansion, "example", "Expansion based on example code system", vs); - return generateContentModeNotice(x, expansion, "fragment", "Expansion based on code system fragment", vs); + generateContentModeNotice(x, expansion, "example", /*!#*/"Expansion based on example code system", vs); + return generateContentModeNotice(x, expansion, "fragment", /*!#*/"Expansion based on code system fragment", vs); } private boolean generateContentModeNotice(XhtmlNode x, ValueSetExpansionComponent expansion, String mode, String text, Resource vs) { @@ -485,14 +487,14 @@ public class ValueSetRenderer extends TerminologyRenderer { if (versions.size() == 1 && versions.get(s).size() == 1) { for (String v : versions.get(s)) { // though there'll only be one XhtmlNode p = x.para().style("border: black 1px dotted; background-color: #EEEEEE; padding: 8px; margin-bottom: 8px"); - p.tx("Expansion based on "); + p.tx(/*!#*/"Expansion based on "); expRef(p, s, v, vs); } } else { for (String v : versions.get(s)) { if (first) { div = x.div().style("border: black 1px dotted; background-color: #EEEEEE; padding: 8px; margin-bottom: 8px"); - div.para().tx("Expansion based on: "); + div.para().tx(/*!#*/"Expansion based on: "); ul = div.ul(); first = false; } @@ -512,30 +514,30 @@ public class ValueSetRenderer extends TerminologyRenderer { if (parts.length >= 5) { String m = describeModule(parts[4]); if (parts.length == 7) { - x.tx("SNOMED CT "+m+" edition "+formatSCTDate(parts[6])); + x.tx(/*!#*/"SNOMED CT "+m+" edition "+formatSCTDate(parts[6])); } else { - x.tx("SNOMED CT "+m+" edition"); + x.tx(/*!#*/"SNOMED CT "+m+" edition"); } } else { - x.tx(describeSystem(u)+" version "+v); + x.tx(describeSystem(u)+" "+/*!#*/"version "+v); } } else if (u.equals("http://loinc.org")) { String vd = describeLoincVer(v); if (vd != null) { - x.tx("Loinc v"+v+" ("+vd+")"); + x.tx(/*!#*/"Loinc v"+v+" ("+vd+")"); } else { - x.tx("Loinc v"+v); + x.tx(/*!#*/"Loinc v"+v); } } else if (Utilities.noString(v)) { CanonicalResource cr = (CanonicalResource) getContext().getWorker().fetchResource(Resource.class, u, source); if (cr != null) { if (cr.hasWebPath()) { - x.ah(cr.getWebPath()).tx(t+" "+cr.present()+" (no version) ("+cr.fhirType()+")"); + x.ah(cr.getWebPath()).tx(t+" "+cr.present()+" "+/*!#*/"(no version) ("+cr.fhirType()+")"); } else { - x.tx(t+" "+describeSystem(u)+" (no version) ("+cr.fhirType()+")"); + x.tx(t+" "+describeSystem(u)+" "+/*!#*/"(no version) ("+cr.fhirType()+")"); } } else { - x.tx(t+" "+describeSystem(u)+" (no version)"); + x.tx(t+" "+describeSystem(u)+" "+/*!#*/"(no version)"); } } else { CanonicalResource cr = (CanonicalResource) getContext().getWorker().fetchResource(Resource.class, u+"|"+v, source); @@ -546,7 +548,7 @@ public class ValueSetRenderer extends TerminologyRenderer { x.tx(t+" "+describeSystem(u)+" v"+v+" ("+cr.fhirType()+")"); } } else { - x.tx(t+" "+describeSystem(u)+" version "+v); + x.tx(t+" "+describeSystem(u)+" "+/*!#*/"version "+v); } } } @@ -618,21 +620,21 @@ public class ValueSetRenderer extends TerminologyRenderer { private String describeModule(String module) { if ("900000000000207008".equals(module)) - return "International"; + return /*!#*/"International"; if ("731000124108".equals(module)) - return "United States"; + return /*!#*/"United States"; if ("32506021000036107".equals(module)) - return "Australian"; + return /*!#*/"Australian"; if ("449081005".equals(module)) - return "Spanish"; + return /*!#*/"Spanish"; if ("554471000005108".equals(module)) - return "Danish"; + return /*!#*/"Danish"; if ("11000146104".equals(module)) - return "Dutch"; + return /*!#*/"Dutch"; if ("45991000052106".equals(module)) - return "Swedish"; + return /*!#*/"Swedish"; if ("999000041000000102".equals(module)) - return "United Kingdon"; + return /*!#*/"United Kingdon"; return module; } @@ -826,7 +828,7 @@ public class ValueSetRenderer extends TerminologyRenderer { if (doInactive) { td = tr.td(); if (c.getInactive()) { - td.tx("inactive"); + td.tx(/*!#*/"inactive"); } } if (doDefinition) { @@ -958,26 +960,26 @@ public class ValueSetRenderer extends TerminologyRenderer { hasExtensions = genInclude(x.ul(), vs.getCompose().getInclude().get(0), "Include", langs, doDesignations, maps, designations, index, vs) || hasExtensions; } else { XhtmlNode p = x.para(); - p.tx("This value set includes codes based on the following rules:"); + p.tx(/*!#*/"This value set includes codes based on the following rules:"); XhtmlNode ul = x.ul(); for (ConceptSetComponent inc : vs.getCompose().getInclude()) { - hasExtensions = genInclude(ul, inc, "Include", langs, doDesignations, maps, designations, index, vs) || hasExtensions; + hasExtensions = genInclude(ul, inc, /*!#*/"Include", langs, doDesignations, maps, designations, index, vs) || hasExtensions; index++; } for (Base inc : VersionComparisonAnnotation.getDeleted(vs.getCompose(), "include")) { - genInclude(ul, (ConceptSetComponent) inc, "Include", langs, doDesignations, maps, designations, index, vs); + genInclude(ul, (ConceptSetComponent) inc, /*!#*/"Include", langs, doDesignations, maps, designations, index, vs); index++; } if (vs.getCompose().hasExclude() || VersionComparisonAnnotation.hasDeleted(vs.getCompose(), "exclude")) { p = x.para(); - p.tx("This value set excludes codes based on the following rules:"); + p.tx(/*!#*/"This value set excludes codes based on the following rules:"); ul = x.ul(); for (ConceptSetComponent exc : vs.getCompose().getExclude()) { - hasExtensions = genInclude(ul, exc, "Exclude", langs, doDesignations, maps, designations, index, vs) || hasExtensions; + hasExtensions = genInclude(ul, exc, /*!#*/"Exclude", langs, doDesignations, maps, designations, index, vs) || hasExtensions; index++; } for (Base inc : VersionComparisonAnnotation.getDeleted(vs.getCompose(), "exclude")) { - genInclude(ul, (ConceptSetComponent) inc, "Exclude", langs, doDesignations, maps, designations, index, vs); + genInclude(ul, (ConceptSetComponent) inc, /*!#*/"Exclude", langs, doDesignations, maps, designations, index, vs); index++; } } @@ -988,15 +990,15 @@ public class ValueSetRenderer extends TerminologyRenderer { if (!doDesignations && langs.size() + designations.size() > 0) { Collections.sort(langs); if (designations.size() == 0) { - x.para().b().tx("Additional Language Displays"); + x.para().b().tx(/*!#*/"Additional Language Displays"); } else if (langs.size() == 0) { - x.para().b().tx("Additional Designations"); + x.para().b().tx(/*!#*/"Additional Designations"); } else { - x.para().b().tx("Additional Designations and Language Displays"); + x.para().b().tx(/*!#*/"Additional Designations and Language Displays"); } XhtmlNode t = x.table("codes"); XhtmlNode tr = t.tr(); - tr.td().b().tx("Code"); + tr.td().b().tx(/*!#*/"Code"); for (String url : designations.keySet()) { tr.td().b().addText(designations.get(url)); } @@ -1015,24 +1017,24 @@ public class ValueSetRenderer extends TerminologyRenderer { } private void renderExpansionRules(XhtmlNode x, ConceptSetComponent inc, int index, Map definitions) throws FHIRException, IOException { - String s = "This include specifies a heirarchy for when value sets are generated for use in a User Interface, but the rules are not properly defined"; + String s = /*!#*/"This include specifies a heirarchy for when value sets are generated for use in a User Interface, but the rules are not properly defined"; if (inc.hasExtension(ToolingExtensions.EXT_EXPAND_RULES)) { String rule = inc.getExtensionString(ToolingExtensions.EXT_EXPAND_RULES); if (rule != null) { switch (rule) { - case "all-codes": s = "This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains all the codes, and also this structure:"; - case "ungrouped": s = "This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains this structure, and any codes not found in the structure:"; - case "groups-only": s = "This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains this structure:"; + case "all-codes": s = /*!#*/"This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains all the codes, and also this structure:"; + case "ungrouped": s = /*!#*/"This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains this structure, and any codes not found in the structure:"; + case "groups-only": s = /*!#*/"This include specifies a heirarchy for when value sets are generated for use in a User Interface. The expansion contains this structure:"; } } } x.br(); x.tx(s); - HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context.getDestDir(), context.isInlineGraphics(), true); + HierarchicalTableGenerator gen = new HierarchicalTableGenerator(context, context.getDestDir(), context.isInlineGraphics(), true); TableModel model = gen.new TableModel("exp.h="+index, context.getRules() == GenerationRules.IG_PUBLISHER); model.setAlternating(true); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("vs.exp.header", "Code"), translate("vs.exp.hint", "The code for the item"), null, 0)); - model.getTitles().add(gen.new Title(null, model.getDocoRef(), translate("vs.exp.header", "Display"), translate("vs.exp.hint", "The display for the item"), null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Code", /*!#*/"The code for the item", null, 0)); + model.getTitles().add(gen.new Title(null, model.getDocoRef(), /*!#*/"Display", /*!#*/"The display for the item", null, 0)); for (Extension ext : inc.getExtensionsByUrl(ToolingExtensions.EXT_EXPAND_GROUP)) { renderExpandGroup(gen, model, ext, inc, definitions); @@ -1140,9 +1142,9 @@ public class ValueSetRenderer extends TerminologyRenderer { } switch (url) { case "http://snomed.info/sct#900000000000003001": - return "Fully specified name"; + return /*!#*/"Fully specified name"; case "http://snomed.info/sct#900000000000013009": - return "Synonym"; + return /*!#*/"Synonym"; default: // As specified in http://www.hl7.org/fhir/valueset-definitions.html#ValueSet.compose.include.concept.designation.use and in http://www.hl7.org/fhir/codesystem-definitions.html#CodeSystem.concept.designation.use the terminology binding is extensible. return url; @@ -1176,14 +1178,14 @@ public class ValueSetRenderer extends TerminologyRenderer { if (inc.hasSystem()) { CodeSystem e = getContext().getWorker().fetchCodeSystem(inc.getSystem()); if (inc.getConcept().size() == 0 && inc.getFilter().size() == 0) { - li.addText(type+" all codes defined in "); + li.addText(type+" "+/*!#*/"all codes defined in "); addCsRef(inc, li, e); } else { if (inc.getConcept().size() > 0) { - li.addText(type+" these codes as defined in "); + li.addText(type+" "+/*!#*/"these codes as defined in "); addCsRef(inc, li, e); if (inc.hasVersion()) { - li.addText(" version "); + li.addText(" "+/*!#*/"version "); li.code(inc.getVersion()); } @@ -1210,24 +1212,24 @@ public class ValueSetRenderer extends TerminologyRenderer { } } if (inc.getFilter().size() > 0) { - li.addText(type+" codes from "); + li.addText(type+" "+/*!#*/"codes from "); addCsRef(inc, li, e); - li.tx(" where "); + li.tx(" "+/*!#*/"where "); for (int i = 0; i < inc.getFilter().size(); i++) { ConceptSetFilterComponent f = inc.getFilter().get(i); if (i > 0) { if (i == inc.getFilter().size()-1) { - li.tx(" and "); + li.tx(" "+/*!#*/"and "); } else { - li.tx(", "); + li.tx(/*!#*/", "); } } XhtmlNode wli = renderStatus(f, li); if (f.getOp() == FilterOperator.EXISTS) { if (f.getValue().equals("true")) { - wli.tx(f.getProperty()+" exists"); + wli.tx(f.getProperty()+" "+/*!#*/"exists"); } else { - wli.tx(f.getProperty()+" doesn't exist"); + wli.tx(f.getProperty()+" "+/*!#*/"doesn't exist"); } } else { wli.tx(f.getProperty()+" "+describe(f.getOp())+" "); @@ -1255,7 +1257,7 @@ public class ValueSetRenderer extends TerminologyRenderer { } } if (inc.hasValueSet()) { - li.tx(", where the codes are contained in "); + li.tx(/*!#*/", where the codes are contained in "); boolean first = true; for (UriType vs : inc.getValueSet()) { if (first) @@ -1271,7 +1273,7 @@ public class ValueSetRenderer extends TerminologyRenderer { renderExpansionRules(li, inc, index, definitions); } } else { - li.tx("Import all the codes that are contained in "); + li.tx(/*!#*/"Import all the codes that are contained in "); if (inc.getValueSet().size() < 4) { boolean first = true; for (UriType vs : inc.getValueSet()) { @@ -1322,7 +1324,7 @@ public class ValueSetRenderer extends TerminologyRenderer { if (hasComments) { td = tr.td(); if (ExtensionHelper.hasExtension(c, ToolingExtensions.EXT_VS_COMMENT)) { - smartAddText(td, "Note: "+ToolingExtensions.readStringExtension(c, ToolingExtensions.EXT_VS_COMMENT)); + smartAddText(td, /*!#*/"Note: "+ToolingExtensions.readStringExtension(c, ToolingExtensions.EXT_VS_COMMENT)); } } if (doDesignations) { @@ -1403,7 +1405,7 @@ public class ValueSetRenderer extends TerminologyRenderer { ValueSetExpansionOutcome vso = getContext().getWorker().expandVS(vs, true, false); ValueSet valueset = vso.getValueset(); if (valueset == null) - throw new TerminologyServiceException("Error Expanding ValueSet: "+vso.getError()); + throw new TerminologyServiceException(/*!#*/"Error Expanding ValueSet: "+vso.getError()); vse = valueset.getExpansion(); } catch (Exception e1) { @@ -1431,12 +1433,23 @@ public class ValueSetRenderer extends TerminologyRenderer { } } if (!context.isNoSlowLookup() && !serverList.isEmpty()) { - getContext().getWorker().validateCodeBatch(getContext().getTerminologyServiceOptions(), serverList, null); - for (CodingValidationRequest vr : serverList) { - ConceptDefinitionComponent v = vr.getResult().asConceptDefinition(); - if (v != null) { - results.put(vr.getCoding().getCode(), v); + try { + // todo: split this into 10k batches + int i = 0; + while (serverList.size() > i) { + int len = Integer.min(serverList.size(), MAX_BATCH_VALIDATION_SIZE); + List list = serverList.subList(i, i+len); + i += len; + getContext().getWorker().validateCodeBatch(getContext().getTerminologyServiceOptions(), list, null); + for (CodingValidationRequest vr : list) { + ConceptDefinitionComponent v = vr.getResult().asConceptDefinition(); + if (v != null) { + results.put(vr.getCoding().getCode(), v); + } + } } + } catch (Exception e1) { + return null; } } return results; @@ -1489,18 +1502,18 @@ public class ValueSetRenderer extends TerminologyRenderer { private String describe(FilterOperator op) { if (op == null) - return " null "; + return " "+/*!#*/"null "; switch (op) { - case EQUAL: return " = "; - case ISA: return " is-a "; - case ISNOTA: return " is-not-a "; - case REGEX: return " matches (by regex) "; - case NULL: return " ?ngen-13? "; - case IN: return " in "; - case NOTIN: return " not in "; - case DESCENDENTOF: return " descends from "; - case EXISTS: return " exists "; - case GENERALIZES: return " generalizes "; + case EQUAL: return " "+/*!#*/"= "; + case ISA: return " "+/*!#*/"is-a "; + case ISNOTA: return " "+/*!#*/"is-not-a "; + case REGEX: return " "+/*!#*/"matches (by regex) "; + case NULL: return " "+/*!#*/"?ngen-13? "; + case IN: return " "+/*!#*/"in "; + case NOTIN: return " "+/*!#*/"not in "; + case DESCENDENTOF: return " "+/*!#*/"descends from "; + case EXISTS: return " "+/*!#*/"exists "; + case GENERALIZES: return " "+/*!#*/"generalizes "; } return null; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/BaseWrappers.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/BaseWrappers.java index 67a09994d..66ba376f7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/BaseWrappers.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/BaseWrappers.java @@ -62,6 +62,7 @@ public class BaseWrappers { public interface BaseWrapper extends WrapperBase { public Base getBase() throws UnsupportedEncodingException, IOException, FHIRException; + public ResourceWrapper getResource() throws UnsupportedEncodingException, IOException, FHIRException; // for contained, etc public PropertyWrapper getChildByName(String tail); public String fhirType(); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DOMWrappers.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DOMWrappers.java index d62204ca6..8f33c2980 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DOMWrappers.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DOMWrappers.java @@ -102,6 +102,19 @@ public class DOMWrappers { return type; } + @Override + public ResourceWrapper getResource() throws UnsupportedEncodingException, IOException, FHIRException { + Element r = XMLUtil.getFirstChild(element); + StructureDefinition sd = getContext().getContext().fetchTypeDefinition(r.getLocalName()); + if (sd == null) { + throw new FHIRException("Unable to find definition for type "+type+" @ "+definition.getPath()); + } + if (sd.getKind() != StructureDefinitionKind.RESOURCE) { + throw new FHIRException("Definition for type "+type+" is not for a resource @ "+definition.getPath()); + } + return new ResourceWrapperElement(context, r, sd); + } + } public static class PropertyWrapperElement extends RendererWrapperImpl implements PropertyWrapper { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DirectWrappers.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DirectWrappers.java index 37304c3a9..78d4eb7ec 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DirectWrappers.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DirectWrappers.java @@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; +import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.model.Base; import org.hl7.fhir.r5.model.CanonicalResource; import org.hl7.fhir.r5.model.DomainResource; @@ -109,7 +110,7 @@ public class DirectWrappers { @Override public ResourceWrapper getAsResource() { - throw new Error("Not implemented yet"); + return new ResourceWrapperDirect(context, (Resource) wrapped.getValues().get(0)); } @Override @@ -164,6 +165,11 @@ public class DirectWrappers { return wrapped.fhirType(); } + @Override + public ResourceWrapper getResource() throws UnsupportedEncodingException, IOException, FHIRException { + return new DirectWrappers.ResourceWrapperDirect(getContext(), (Resource) wrapped); + } + } public static class ResourceWrapperDirect extends WrapperBaseImpl implements ResourceWrapper { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java index 568344a5f..fcdb83fae 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java @@ -109,6 +109,11 @@ public class ElementWrappers { return element.fhirType(); } + @Override + public ResourceWrapper getResource() throws UnsupportedEncodingException, IOException, FHIRException { + return new ElementWrappers.ResourceWrapperMetaElement(getContext(), element); + } + } public static class ResourceWrapperMetaElement extends WrapperBaseImpl implements ResourceWrapper { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/RenderingContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/RenderingContext.java index 8d714ec1f..2a465c95a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/RenderingContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/RenderingContext.java @@ -24,9 +24,10 @@ import org.hl7.fhir.utilities.MarkDownProcessor; import org.hl7.fhir.utilities.MarkDownProcessor.Dialect; import org.hl7.fhir.utilities.StandardsStatus; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; import org.hl7.fhir.utilities.validation.ValidationOptions; -public class RenderingContext { +public class RenderingContext extends RenderingI18nContext { // provides liquid templates, if they are available for the content public interface ILiquidTemplateProvider { @@ -215,6 +216,9 @@ public class RenderingContext { private Map links = new HashMap<>(); private Map namedLinks = new HashMap<>(); + private boolean addName = false; + private Map typeMap = new HashMap<>(); // type aliases that can be resolved in Markdown type links (mainly for cross-version usage) + /** * * @param context - access to all related resources that might be needed @@ -279,6 +283,7 @@ public class RenderingContext { res.changeVersion = changeVersion; res.terminologyServiceOptions = terminologyServiceOptions.copy(); + res.typeMap.putAll(typeMap); return res; } @@ -534,9 +539,8 @@ public class RenderingContext { } } - public RenderingContext setLocale(Locale locale) { + public void setLocale(Locale locale) { this.locale = locale; - return this; } @@ -728,5 +732,18 @@ public class RenderingContext { this.fixedFormat = fixedFormat; } + public boolean isAddName() { + return addName; + } + + public RenderingContext setAddName(boolean addName) { + this.addName = addName; + return this; + } + + public Map getTypeMap() { + return typeMap; + } + } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/CodeSystemUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/CodeSystemUtilities.java index 3ff4c0560..6a35595db 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/CodeSystemUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/CodeSystemUtilities.java @@ -33,6 +33,7 @@ package org.hl7.fhir.r5.terminologies; import java.util.ArrayList; import java.util.Calendar; +import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; @@ -199,13 +200,22 @@ public class CodeSystemUtilities extends TerminologyUtilities { public static boolean isNotSelectable(CodeSystem cs, ConceptDefinitionComponent def) { + String pd = getPropertyByUrl(cs, "http://hl7.org/fhir/concept-properties#notSelectable"); + if (pd == null) { + pd = "notSelectable"; + } for (ConceptPropertyComponent p : def.getProperty()) { - if ("notSelectable".equals(p.getCode()) && p.hasValue() && p.getValue() instanceof BooleanType) + if (pd.equals(p.getCode()) && p.hasValue() && p.getValue() instanceof BooleanType) return ((BooleanType) p.getValue()).getValue(); } return false; } + public static boolean isNotSelectable(CodeSystem cs, String code) { + ConceptDefinitionComponent cd = findCode(cs.getConcept(), code); + return cd == null ? false : isNotSelectable(cs, cd); + } + public static void setNotSelectable(CodeSystem cs, ConceptDefinitionComponent concept) throws FHIRFormatError { defineNotSelectableProperty(cs); ConceptPropertyComponent p = getProperty(concept, "notSelectable"); @@ -224,6 +234,15 @@ public class CodeSystemUtilities extends TerminologyUtilities { concept.addProperty().setCode(code).setValue(value); } + public static void setProperty(CodeSystem cs, ConceptDefinitionComponent concept, String url, String code, DataType value) throws FHIRFormatError { + defineProperty(cs, code, propertyTypeForValue(value), url); + ConceptPropertyComponent p = getProperty(concept, code); + if (p != null) + p.setValue(value); + else + concept.addProperty().setCode(code).setValue(value); + } + private static PropertyType propertyTypeForValue(DataType value) { if (value instanceof BooleanType) { @@ -252,6 +271,9 @@ public class CodeSystemUtilities extends TerminologyUtilities { private static String defineProperty(CodeSystem cs, String code, PropertyType pt) { String url = "http://hl7.org/fhir/concept-properties#"+code; + return defineProperty(cs, code, pt, url); + } + private static String defineProperty(CodeSystem cs, String code, PropertyType pt, String url) { for (PropertyComponent p : cs.getProperty()) { if (p.hasCode() && p.getCode().equals(code)) { if (!p.getUri().equals(url)) { @@ -476,6 +498,28 @@ public class CodeSystemUtilities extends TerminologyUtilities { return null; } + + public static List findCodeWithParents(List parents, List list, String code) { + for (ConceptDefinitionComponent c : list) { + if (c.hasCode() && c.getCode().equals(code)) { + return addToList(parents, c); + } + List s = findCodeWithParents(addToList(parents, c), c.getConcept(), code); + if (s != null) + return s; + } + return null; + } + + private static List addToList(List parents, ConceptDefinitionComponent c) { + List res = new ArrayList(); + if (parents != null) { + res.addAll(parents); + } + res.add(c); + return res; + } + public static ConceptDefinitionComponent findCodeOrAltCode(List list, String code, String use) { for (ConceptDefinitionComponent c : list) { if (c.hasCode() && c.getCode().equals(code)) @@ -882,6 +926,7 @@ public class CodeSystemUtilities extends TerminologyUtilities { } public static boolean hasPropertyDef(CodeSystem cs, String property) { + for (PropertyComponent pd : cs.getProperty()) { if (pd.hasCode() && pd.getCode().equals(property)) { return true; @@ -896,6 +941,10 @@ public class CodeSystemUtilities extends TerminologyUtilities { } public static DataType getProperty(CodeSystem cs, ConceptDefinitionComponent def, String property) { + PropertyComponent defn = getPropertyDefinition(cs, property); + if (defn != null) { + property = defn.getCode(); + } ConceptPropertyComponent cp = getProperty(def, property); return cp == null ? null : cp.getValue(); } @@ -928,5 +977,99 @@ public class CodeSystemUtilities extends TerminologyUtilities { return v.primitiveValue(); } } + + public static Boolean subsumes(CodeSystem cs, String pc, String cc) { + if (pc.equals(cc)) { + return true; + } + List child = findCodeWithParents(null, cs.getConcept(), cc); + for (ConceptDefinitionComponent item : child) { + if (pc.equals(item.getCode())) { + return true; + } + } + return false; + } + + public static Set codes(CodeSystem cs) { + Set res = new HashSet<>(); + addCodes(res, cs.getConcept()); + return res; + } + + private static void addCodes(Set res, List list) { + for (ConceptDefinitionComponent cd : list) { + if (cd.hasCode()) { + res.add(cd.getCode()); + } + if (cd.hasConcept()) { + addCodes(res, cd.getConcept()); + } + } + } + + /** + * property in this case is the name of a property that appears in a ValueSet filter + * + * @param cs + * @param property + * @return + */ + public static PropertyComponent getPropertyDefinition(CodeSystem cs, String property) { + String uri = getStandardPropertyUri(property); + if (uri != null) { + for (PropertyComponent cp : cs.getProperty()) { + if (uri.equals(cp.getUri())) { + return cp; + } + } + } + for (PropertyComponent cp : cs.getProperty()) { + if (cp.getCode().equals(property)) { + return cp; + } + } + return null; + } + + public static boolean isDefinedProperty(CodeSystem cs, String property) { + String uri = getStandardPropertyUri(property); + if (uri != null) { + for (PropertyComponent cp : cs.getProperty()) { + if (uri.equals(cp.getUri())) { + return true; + } + } + } + for (PropertyComponent cp : cs.getProperty()) { + if (cp.getCode().equals(property) && (uri == null || !cp.hasUri())) { // if uri is right, will return from above + return true; + } + } + return false; + } + + + private static String getStandardPropertyUri(String property) { + switch (property) { + case "status" : return "http://hl7.org/fhir/concept-properties#status"; + case "inactive" : return "http://hl7.org/fhir/concept-properties#inactive"; + case "effectiveDate" : return "http://hl7.org/fhir/concept-properties#effectiveDate"; + case "deprecationDate" : return "http://hl7.org/fhir/concept-properties#deprecationDate"; + case "retirementDate" : return "http://hl7.org/fhir/concept-properties#retirementDate"; + case "notSelectable" : return "http://hl7.org/fhir/concept-properties#notSelectable"; + case "parent" : return "http://hl7.org/fhir/concept-properties#parent"; + case "child" : return "http://hl7.org/fhir/concept-properties#child"; + case "partOf" : return "http://hl7.org/fhir/concept-properties#partOf"; + case "synonym" : return "http://hl7.org/fhir/concept-properties#synonym"; + case "comment" : return "http://hl7.org/fhir/concept-properties#comment"; + case "itemWeight" : return "http://hl7.org/fhir/concept-properties#itemWeight"; + } + return null; + } + + public static boolean isExemptFromMultipleVersionChecking(String url) { + return Utilities.existsInList(url, "http://snomed.info/sct", "http://loinc.org"); + } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ConceptMapUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ConceptMapUtilities.java index 698a7689c..7a11c90c2 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ConceptMapUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ConceptMapUtilities.java @@ -1,8 +1,16 @@ package org.hl7.fhir.r5.terminologies; import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; +import java.util.Set; +import org.hl7.fhir.r5.model.Base; import org.hl7.fhir.r5.model.CanonicalType; import org.hl7.fhir.r5.model.CodeSystem; import org.hl7.fhir.r5.model.Coding; @@ -10,6 +18,10 @@ import org.hl7.fhir.r5.model.ConceptMap; import org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent; import org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent; import org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent; +import org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship; +import org.hl7.fhir.r5.terminologies.ConceptMapUtilities.ConceptMapElementSorter; +import org.hl7.fhir.r5.terminologies.ConceptMapUtilities.ElementMappingPair; +import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.r5.model.Identifier; import org.hl7.fhir.r5.model.Meta; import org.hl7.fhir.r5.model.UriType; @@ -17,6 +29,70 @@ import org.hl7.fhir.r5.model.ValueSet; public class ConceptMapUtilities { + public static class TargetSorter implements Comparator { + + @Override + public int compare(TargetElementComponent o1, TargetElementComponent o2) { + return o1.getCode().compareTo(o2.getCode()); + } + + } + + public static class ElementSorter implements Comparator { + + @Override + public int compare(SourceElementComponent o1, SourceElementComponent o2) { + return o1.getCode().compareTo(o2.getCode()); + } + + } + + public static class ElementMappingPair { + + private SourceElementComponent src; + private TargetElementComponent tgt; + + public ElementMappingPair(SourceElementComponent src, TargetElementComponent tgt) { + this.src = src; + this.tgt = tgt; + } + + } + + public static class TranslatedCode { + private String code; + private ConceptMapRelationship relationship; + public TranslatedCode(String code, ConceptMapRelationship relationship) { + super(); + this.code = code; + this.relationship = relationship; + } + public String getCode() { + return code; + } + public ConceptMapRelationship getRelationship() { + return relationship; + } + + } + + public static class ConceptMapElementSorter implements Comparator { + + @Override + public int compare(SourceElementComponent o1, SourceElementComponent o2) { + return o1.getCode().compareTo(o2.getCode()); + } + + } + + public static class ConceptMapTargetElementSorter implements Comparator { + + @Override + public int compare(TargetElementComponent o1, TargetElementComponent o2) { + return o1.getCode().compareTo(o2.getCode()); + } + + } public static boolean hasOID(ConceptMap cm) { return getOID(cm) != null; } @@ -85,4 +161,525 @@ public class ConceptMapUtilities { return cm; } + public static ConceptMap invert(ConceptMap src, String id, String url, String name, boolean collate) { + ConceptMap dst = src.copy(); + dst.setId(id); + dst.setUrl(url); + dst.setName(name); + dst.getGroup().clear(); + dst.setSourceScope(src.getTargetScope()); + dst.setTargetScope(src.getSourceScope()); + for (ConceptMapGroupComponent gs : src.getGroup()) { + ConceptMapGroupComponent gd = dst.addGroup(); + gd.setTargetElement(gs.getSourceElement()); + gd.setSourceElement(gs.getTargetElement()); + Map dstMap = new HashMap<>(); + for (SourceElementComponent es : gs.getElement()) { + for (TargetElementComponent ts : es.getTarget()) { + SourceElementComponent ed = collate ? dstMap.get(ts.getCode()) : null; + if (ed == null) { + ed = gd.addElement(); + ed.setCodeElement(ts.getCodeElement()); + if (collate) { + dstMap.put(ed.getCode(), ed); + } + } + TargetElementComponent td = ed.addTarget(); + td.setCode(es.getCode()); + td.setComment(ts.getComment()); + td.setRelationship(invertRelationship(ts.getRelationship())); + } + } + } + return dst; + } + + private static ConceptMapRelationship invertRelationship(ConceptMapRelationship relationship) { + if (relationship == null) { + return null; + } + switch (relationship) { + case EQUIVALENT: + return ConceptMapRelationship.EQUIVALENT; + case NOTRELATEDTO: + return ConceptMapRelationship.NOTRELATEDTO; + case NULL: + return ConceptMapRelationship.NULL; + case RELATEDTO: + return ConceptMapRelationship.RELATEDTO; + case SOURCEISBROADERTHANTARGET: + return ConceptMapRelationship.SOURCEISNARROWERTHANTARGET; + case SOURCEISNARROWERTHANTARGET: + return ConceptMapRelationship.SOURCEISBROADERTHANTARGET; + default: + return null; + } + } + + public static ConceptMap collapse(String id, String url, boolean cumulative, ConceptMap src, ConceptMap... sequence) { + ConceptMap res = src.copy(); + res.setId(id); + res.setUrl(url); + + for (ConceptMap cm : sequence) { + if (res.hasTargetScope() && cm.hasTargetScope()) { + if (!cm.getSourceScope().primitiveValue().equals(res.getTargetScope().primitiveValue())) { + throw new Error("Mismatch between sequential concept maps: target was "+res.getTargetScope()+" and source is "+cm.getSourceScope()); + } else { + res.setTargetScope(cm.getTargetScope()); + } + } else { + res.setTargetScope(null); + } + } + + for (ConceptMapGroupComponent gd : res.getGroup()) { + for (ConceptMap cm : sequence) { + for (ConceptMapGroupComponent gt : cm.getGroup()) { + if (gt.getSource().equals(gd.getTarget())) { + gd.setTarget(gt.getTarget()); + + List processed = new ArrayList(); + for (SourceElementComponent ed : gd.getElement()) { + List list = new ArrayList<>(); + list.addAll(ed.getTarget()); + ed.getTarget().clear(); + for (TargetElementComponent ts : list) { + for (SourceElementComponent et : gt.getElement()) { + if (et.getCode().equals(ed.getCode())) { + processed.add(et); + for (TargetElementComponent tt : et.getTarget()) { + ed.addTarget().setCode(tt.getCode()).setRelationship(combineRelationships(ts.getRelationship(), tt.getRelationship())); + } + } + } + } + if (ed.getTarget().isEmpty()) { + if (cumulative) { + ed.getTarget().addAll(list); + } else { + ed.setNoMap(true); + } + } + } + if (cumulative) { + for (SourceElementComponent et : gt.getElement()) { + if (!processed.contains(et)) { + gd.addElement(et.copy()); + } + } + } + } + Collections.sort(gt.getElement(), new ConceptMapElementSorter()); + for (SourceElementComponent e: gt.getElement()) { + Collections.sort(e.getTarget(), new ConceptMapTargetElementSorter()); + } + } + } + } + return res; + } + + public static ConceptMapRelationship combineRelationships(ConceptMapRelationship rel1, ConceptMapRelationship rel2) { + switch (rel1) { + case EQUIVALENT: + return rel2; + case NOTRELATEDTO: + return ConceptMapRelationship.NOTRELATEDTO; + case NULL: + return null; + case RELATEDTO: + return rel2; + case SOURCEISBROADERTHANTARGET: + switch (rel2) { + case EQUIVALENT: + return ConceptMapRelationship.SOURCEISBROADERTHANTARGET; + case NOTRELATEDTO: + return ConceptMapRelationship.NOTRELATEDTO; + case NULL: + return null; + case RELATEDTO: + return ConceptMapRelationship.RELATEDTO; + case SOURCEISBROADERTHANTARGET: + return ConceptMapRelationship.SOURCEISBROADERTHANTARGET; + case SOURCEISNARROWERTHANTARGET: + return ConceptMapRelationship.RELATEDTO; + } + case SOURCEISNARROWERTHANTARGET: + switch (rel2) { + case EQUIVALENT: + return ConceptMapRelationship.SOURCEISNARROWERTHANTARGET; + case NOTRELATEDTO: + return ConceptMapRelationship.NOTRELATEDTO; + case NULL: + return null; + case RELATEDTO: + return ConceptMapRelationship.RELATEDTO; + case SOURCEISBROADERTHANTARGET: + return ConceptMapRelationship.RELATEDTO; + case SOURCEISNARROWERTHANTARGET: + return ConceptMapRelationship.SOURCEISNARROWERTHANTARGET; + } + } + return null; + } + + public static boolean checkReciprocal(ConceptMap left, ConceptMap right, List issues, boolean makeChanges) { + boolean changed = false; + if (!Base.compareDeep(left.getTargetScope(), right.getSourceScope(), true)) { + issues.add("scopes are not reciprocal: "+left.getTargetScope()+" vs "+right.getSourceScope()); + } + if (!Base.compareDeep(left.getSourceScope(), right.getTargetScope(), true)) { + issues.add("scopes are not reciprocal: "+left.getSourceScope()+" vs "+right.getTargetScope()); + } + for (ConceptMapGroupComponent gl : left.getGroup()) { + ConceptMapGroupComponent gr = findMatchingGroup(right.getGroup(), gl.getTarget(), gl.getSource()); + if (gr == null) { + for (SourceElementComponent e : gl.getElement()) { + for (TargetElementComponent t : e.getTarget()) { + if (t.getRelationship() != ConceptMapRelationship.NOTRELATEDTO) { + if (makeChanges) { + changed = true; + right.forceGroup(gl.getTarget(), gl.getSource()).getOrAddElement(t.getCode()).addTarget(e.getCode(), inverse(t.getRelationship())); + } else { + issues.add("left maps from "+gl.getSource()+"#"+e.getCode()+" to "+gl.getTarget()+"#"+t.getCode()+" but right has no matching reverse map"); + } + } + } + } + } else { + for (SourceElementComponent srcL : gl.getElement()) { + if (!srcL.getNoMap()) { + for (TargetElementComponent tgtL : srcL.getTarget()) { + List pairs = getMappings(gr, tgtL.getCode(), srcL.getCode()); + if (tgtL.getRelationship() == null) { + issues.add("Left map has relationship "+srcL.getCode()+" with no relationship"); + } else switch (tgtL.getRelationship()) { + case EQUIVALENT: + if (pairs.isEmpty()) { + if (makeChanges) { + changed = true; + gr.getOrAddElement(tgtL.getCode()).addTarget(srcL.getCode(), ConceptMapRelationship.EQUIVALENT); + } else { + issues.add("Left map says that "+srcL.getCode()+" is equivalent to "+tgtL.getCode()+" but there's no reverse relationship"); + } + } else for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.EQUIVALENT) { + issues.add("Left map says that "+srcL.getCode()+" is equivalent to "+tgtL.getCode()+" but the reverse relationship has type "+pair.tgt.getRelationship().toCode()); + } + } + break; + case RELATEDTO: + if (pairs.isEmpty()) { + issues.add("Left map says that "+srcL.getCode()+" is related to "+tgtL.getCode()+" but there's no reverse relationship"); + } else for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.EQUIVALENT && pair.tgt.getRelationship() != ConceptMapRelationship.RELATEDTO) { + issues.add("Left map says that "+srcL.getCode()+" is related to "+tgtL.getCode()+" but the reverse relationship has type "+pair.tgt.getRelationship().toCode()); + } + } + break; + case SOURCEISBROADERTHANTARGET: + if (pairs.isEmpty()) { + issues.add("Left map says that "+srcL.getCode()+" is broader than "+tgtL.getCode()+" but there's no reverse relationship"); + } else for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.SOURCEISNARROWERTHANTARGET) { + issues.add("Left map says that "+srcL.getCode()+" is broader than "+tgtL.getCode()+" but the reverse relationship has type "+pair.tgt.getRelationship().toCode()); + } + } + break; + case SOURCEISNARROWERTHANTARGET: + if (pairs.isEmpty()) { + issues.add("Left map says that "+srcL.getCode()+" is narrower than "+tgtL.getCode()+" but there's no reverse relationship"); + } else for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.SOURCEISBROADERTHANTARGET) { + issues.add("Left map says that "+srcL.getCode()+" is narrower than "+tgtL.getCode()+" but the reverse relationship has type "+pair.tgt.getRelationship().toCode()); + } + } + break; + case NOTRELATEDTO: + for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.NOTRELATEDTO) { + issues.add("Left map says that "+srcL.getCode()+" is not related to "+tgtL.getCode()+" but a reverse relationship exists with type "+pair.tgt.getRelationship().toCode()); + } + } + break; + } + } + } else { + for (SourceElementComponent srcR : gr.getElement()) { + for (TargetElementComponent tgtR : srcR.getTarget()) { + if (srcL.getCode().equals(tgtR.getCode())) { + issues.add("Left map says that there is no relationship for "+srcL.getCode()+" but right map has a "+tgtR.getRelationship().toCode()+" mapping to it from "+srcR.getCode()); + } + } + } + } + } + } + } + for (ConceptMapGroupComponent gr : right.getGroup()) { + ConceptMapGroupComponent gl = findMatchingGroup(left.getGroup(), gr.getTarget(), gr.getSource()); + if (gl == null) { + for (SourceElementComponent e : gr.getElement()) { + for (TargetElementComponent t : e.getTarget()) { + if (t.getRelationship() != ConceptMapRelationship.NOTRELATEDTO) { + if (makeChanges) { + changed = true; + left.forceGroup(gr.getTarget(), gr.getSource()).getOrAddElement(t.getCode()).addTarget(e.getCode(), inverse(t.getRelationship())); + } else { + issues.add("left maps from "+gr.getSource()+"#"+e.getCode()+" to "+gr.getTarget()+"#"+t.getCode()+" but right has no matching reverse map"); + } + } + } + } + } else { + for (SourceElementComponent srcR : gr.getElement()) { + if (!"CHECK!".equals(srcR.getCode())) { + if (!srcR.getNoMap()) { + for (TargetElementComponent tgtR : srcR.getTarget()) { + List pairs = getMappings(gl, tgtR.getCode(), srcR.getCode()); + if (tgtR.getRelationship() == null) { + issues.add("Right map has relationship "+srcR.getCode()+" with no relationship"); + } else switch (tgtR.getRelationship()) { + case EQUIVALENT: + if (pairs.isEmpty()) { + if (makeChanges) { + changed = true; + gl.getOrAddElement(tgtR.getCode()).addTarget(srcR.getCode(), ConceptMapRelationship.EQUIVALENT); + } else { + issues.add("Right map says that "+srcR.getCode()+" is equivalent to "+tgtR.getCode()+" but there's no reverse relationship"); + } + } else for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.EQUIVALENT) { + issues.add("Right map says that "+srcR.getCode()+" is equivalent to "+tgtR.getCode()+" but the reverse relationship has type "+pair.tgt.getRelationship().toCode()); + } + } + break; + case RELATEDTO: + if (pairs.isEmpty()) { + issues.add("Right map says that "+srcR.getCode()+" is related to "+tgtR.getCode()+" but there's no reverse relationship"); + } else for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.EQUIVALENT && pair.tgt.getRelationship() != ConceptMapRelationship.RELATEDTO) { + issues.add("Right map says that "+srcR.getCode()+" is equivalent to "+tgtR.getCode()+" but the reverse relationship has type "+pair.tgt.getRelationship().toCode()); + } + } + break; + case SOURCEISBROADERTHANTARGET: + if (pairs.isEmpty()) { + issues.add("Right map says that "+srcR.getCode()+" is broader than "+tgtR.getCode()+" but there's no reverse relationship"); + } else for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.SOURCEISNARROWERTHANTARGET) { + issues.add("Right map says that "+srcR.getCode()+" is broader than "+tgtR.getCode()+" but the reverse relationship has type "+pair.tgt.getRelationship().toCode()); + } + } + break; + case SOURCEISNARROWERTHANTARGET: + if (pairs.isEmpty()) { + issues.add("Right map says that "+srcR.getCode()+" is narrower than "+tgtR.getCode()+" but there's no reverse relationship"); + } else for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.SOURCEISBROADERTHANTARGET) { + issues.add("Right map says that "+srcR.getCode()+" is narrower than "+tgtR.getCode()+" but the reverse relationship has type "+pair.tgt.getRelationship().toCode()); + } + } + break; + case NOTRELATEDTO: + for (ElementMappingPair pair : pairs) { + if (pair.tgt.getRelationship() != ConceptMapRelationship.NOTRELATEDTO) { + issues.add("Right map says that "+srcR.getCode()+" is not related to "+tgtR.getCode()+" but a reverse relationship exists with type "+pair.tgt.getRelationship().toCode()); + } + } + break; + } + } + } else { + for (SourceElementComponent srcL : gr.getElement()) { + for (TargetElementComponent tgtL : srcL.getTarget()) { + if (srcR.getCode().equals(tgtL.getCode())) { + issues.add("Right map says that there is no relationship for "+srcR.getCode()+" but right map has a "+tgtL.getRelationship().toCode()+" mapping to it from "+srcL.getCode()); + } + } + } + } + } + } + } + } + return changed; + } + + private static ConceptMapRelationship inverse(ConceptMapRelationship relationship) { + switch (relationship) { + case EQUIVALENT: return ConceptMapRelationship.EQUIVALENT; + case RELATEDTO: return ConceptMapRelationship.RELATEDTO; + case SOURCEISBROADERTHANTARGET: return ConceptMapRelationship.SOURCEISNARROWERTHANTARGET; + case SOURCEISNARROWERTHANTARGET: return ConceptMapRelationship.SOURCEISBROADERTHANTARGET; + default: return null; + } + } + + private static boolean hasActualMappings(ConceptMapGroupComponent gr) { + for (SourceElementComponent e : gr.getElement()) { + for (TargetElementComponent tgt : e.getTarget()) { + if (tgt.getRelationship() != ConceptMapRelationship.NOTRELATEDTO) { + return true; + } + } + } + return false; + } + + private static List getMappings(ConceptMapGroupComponent g, String source, String target) { + List res = new ArrayList(); + + for (SourceElementComponent src : g.getElement()) { + for (TargetElementComponent tgt : src.getTarget()) { + if (source.equals(src.getCode()) && target.equals(tgt.getCode())) { + res.add(new ElementMappingPair(src, tgt)); + } + } + } + return res; + } + + private static ConceptMapGroupComponent findMatchingGroup(List groups, String source, String target) { + for (ConceptMapGroupComponent g : groups) { + if (source.equals(g.getSource()) && target.equals(g.getTarget())) { + return g; + } + } + return null; + } + + /** + * + * @param cmF + * @return true if all the maps simply map to the same code + */ + public static boolean isUnityMap(ConceptMap cm) { + for (ConceptMapGroupComponent grp : cm.getGroup()) { + for (SourceElementComponent src : grp.getElement()) { + if (src.hasNoMap()) { + return false; + } + if (src.getTarget().size() != 1) { + return false; + } + if (src.getTargetFirstRep().getRelationship() != ConceptMapRelationship.EQUIVALENT && src.getTargetFirstRep().getRelationship() != ConceptMapRelationship.RELATEDTO) { + return false; + } + if (!src.getCode().equals(src.getTargetFirstRep().getCode())) { + return false; + } + } + } + return true; + } + + public static int mapCount(ConceptMap cm) { + int i = 0; + for (ConceptMapGroupComponent grp : cm.getGroup()) { + for (SourceElementComponent src : grp.getElement()) { + i = i + src.getTarget().size(); + } + } + return i; + } + + public static Set listCodesWithNoMappings(Set codes, ConceptMap map) { + Set res = new HashSet<>(); + for (Coding c : codes) { + if (c != null && c.hasCode()) { + boolean found = false; + for (ConceptMapGroupComponent grp : map.getGroup()) { + if (matchesCoding(grp, c)) { + for (SourceElementComponent src : grp.getElement()) { + if (c.getCode().equals(src.getCode())) { + for (TargetElementComponent tgt : src.getTarget()) { + if (tgt.getRelationship() == ConceptMapRelationship.RELATEDTO || tgt.getRelationship() == ConceptMapRelationship.EQUIVALENT || tgt.getRelationship() == ConceptMapRelationship.SOURCEISNARROWERTHANTARGET) { + found = true; + } + } + } + } + } + } + if (!found) { + res.add(c); + } + } + } + return res; + } + + private static boolean matchesCoding(ConceptMapGroupComponent grp, Coding code) { + return code.getSystem().equals(grp.getSource()) || (code.getSystem()+"|"+code.getVersion()).equals(grp.getSource()); + } + + public static List translateCode(String name, String defaultValue, ConceptMap... cmList) { + List res = translateCode(name, cmList); + if (res.isEmpty()) { + res.add(defaultValue); + } + return res; + } + public static List translateCode(String name, ConceptMap... cmList) { + List res = new ArrayList<>(); + res.add(name); + for (ConceptMap cm : cmList) { + res = translateCodes(res, cm); + } + return res; + } + + private static List translateCodes(List codes, ConceptMap cm) { + List res = new ArrayList<>(); + for (ConceptMapGroupComponent g : cm.getGroup()) { + for (SourceElementComponent e : g.getElement()) { + if (Utilities.existsInList(e.getCode(), codes)) { + for (TargetElementComponent t : e.getTarget()) { + if (t.getRelationship() == ConceptMapRelationship.EQUIVALENT || t.getRelationship() == ConceptMapRelationship.RELATEDTO || + t.getRelationship() == ConceptMapRelationship.SOURCEISBROADERTHANTARGET ||t.getRelationship() == ConceptMapRelationship.SOURCEISNARROWERTHANTARGET) { + res.add(t.getCode()); + } + } + } + } + } + return res; + } + + public static List translateCoding(Coding code, ConceptMap... cmList) { + List res = new ArrayList<>(); + for (ConceptMap cm : cmList) { + res = translateCodings(res, cm); + } + return res; + } + + private static List translateCodings(List codes, ConceptMap cm) { + List res = new ArrayList<>(); + for (ConceptMapGroupComponent g : cm.getGroup()) { + for (SourceElementComponent e : g.getElement()) { + if (hasCode(g.getSource(), e.getCode(), codes)) { + for (TargetElementComponent t : e.getTarget()) { + if (t.getRelationship() == ConceptMapRelationship.EQUIVALENT || t.getRelationship() == ConceptMapRelationship.RELATEDTO || + t.getRelationship() == ConceptMapRelationship.SOURCEISBROADERTHANTARGET ||t.getRelationship() == ConceptMapRelationship.SOURCEISNARROWERTHANTARGET) { + res.add(new Coding().setSystem(g.getTarget()).setCode((t.getCode()))); + } + } + } + } + } + return res; + } + + private static boolean hasCode(String system, String code, List codes) { + for (Coding c : codes) { + if (system.equals(c.getSystem()) && code.equals(c.getCode())) { + return true; + } + } + return false; + } + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetUtilities.java index 18595344f..479c9644e 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetUtilities.java @@ -479,4 +479,25 @@ public class ValueSetUtilities extends TerminologyUtilities { return false; } + + public static Set codes(ValueSet vs, CodeSystem cs) { + Set res = new HashSet<>(); + for (ConceptSetComponent inc : vs.getCompose().getInclude()) { + if (inc.getSystem().equals(cs.getUrl())) { + addCodes(res, inc, cs.getConcept()); + } + } + return res; + } + + private static void addCodes(Set res, ConceptSetComponent inc, List list) { + for (ConceptDefinitionComponent cd : list) { + if (cd.hasCode() && (!inc.hasConcept() || inc.hasConcept(cd.getCode()))) { + res.add(cd.getCode()); + } + if (cd.hasConcept()) { + addCodes(res, inc, cd.getConcept()); + } + } + } } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/ITerminologyClient.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/ITerminologyClient.java index e5bbf0a2b..c7f2dfcc8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/ITerminologyClient.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/ITerminologyClient.java @@ -54,6 +54,7 @@ public interface ITerminologyClient { ValueSet expandValueset(ValueSet vs, Parameters p) throws FHIRException; Parameters validateCS(Parameters pin) throws FHIRException; Parameters validateVS(Parameters pin) throws FHIRException; + Parameters subsumes(Parameters pin) throws FHIRException; ITerminologyClient setTimeoutFactor(int i) throws FHIRException; ToolingClientLogger getLogger(); ITerminologyClient setLogger(ToolingClientLogger txLog) throws FHIRException; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientContext.java index 59a2ea137..5bc24d3ea 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientContext.java @@ -75,6 +75,12 @@ public class TerminologyClientContext { return client; } + public void seeUse(Set systems, TerminologyClientContextUseType useType) { + for (String s : systems) { + seeUse(s, useType); + } + } + public void seeUse(String s, TerminologyClientContextUseType useType) { TerminologyClientContextUseCount uc = useCounts.get(s); if (uc == null) { @@ -185,4 +191,11 @@ public class TerminologyClientContext { } return false; } + + @Override + public String toString() { + return client.getAddress(); + } + + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientManager.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientManager.java index fca5bfcaa..2f74fda39 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientManager.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientManager.java @@ -24,15 +24,53 @@ import org.hl7.fhir.r5.model.TerminologyCapabilities; import org.hl7.fhir.r5.model.ValueSet; import org.hl7.fhir.r5.terminologies.ValueSetUtilities; import org.hl7.fhir.r5.terminologies.client.TerminologyClientContext.TerminologyClientContextUseType; +import org.hl7.fhir.r5.terminologies.client.TerminologyClientManager.ServerOptionList; import org.hl7.fhir.r5.terminologies.utilities.TerminologyCache; import org.hl7.fhir.r5.terminologies.utilities.TerminologyCache.SourcedValueSet; import org.hl7.fhir.r5.utils.ToolingExtensions; +import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.ToolingClientLogger; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.json.model.JsonObject; import org.hl7.fhir.utilities.json.parser.JsonParser; public class TerminologyClientManager { + public class ServerOptionList { + private List authoritative = new ArrayList(); + private List candidates = new ArrayList(); + + public ServerOptionList(String address) { + candidates.add(address); + } + + public ServerOptionList() { + } + + public ServerOptionList(List auth, List cand) { + authoritative.addAll(auth); + candidates.addAll(cand); + } + + public void replace(String src, String dst) { + for (int i = 0; i < candidates.size(); i++) { + if (candidates.get(i).contains("://"+src)) { + candidates.set(i, candidates.get(i).replace("://"+src, "://"+dst)); + } + } + for (int i = 0; i < authoritative.size(); i++) { + if (authoritative.get(i).contains("://"+src)) { + authoritative.set(i, authoritative.get(i).replace("://"+src, "://"+dst)); + } + } + } + + @Override + public String toString() { + return "auth = " + CommaSeparatedStringBuilder.join("|", authoritative)+ ", candidates=" + CommaSeparatedStringBuilder.join("|", candidates); + } + + } + public ITerminologyClientFactory getFactory() { return factory; } @@ -50,8 +88,8 @@ public class TerminologyClientManager { private String cacheId; private List serverList = new ArrayList<>(); // clients by server address private Map serverMap = new HashMap<>(); // clients by server address - private Map resMap = new HashMap<>(); // client resolution list - private List internalErrors = new ArrayList<>(); + private Map resMap = new HashMap<>(); // client resolution list + private List internalLog = new ArrayList<>(); protected Parameters expParameters; private TerminologyCache cache; @@ -82,40 +120,92 @@ public class TerminologyClientManager { } - public TerminologyClientContext chooseServer(Set systems, boolean expand) throws TerminologyServiceException { + public TerminologyClientContext chooseServer(ValueSet vs, Set systems, boolean expand) throws TerminologyServiceException { if (serverList.isEmpty()) { return null; } - if (systems.contains(UNRESOLVED_VALUESET)) { + if (systems.contains(UNRESOLVED_VALUESET) || systems.isEmpty()) { return serverList.get(0); } - Set clients = new HashSet<>(); + List choices = new ArrayList<>(); for (String s : systems) { - clients.add(findServerForSystem(s, expand)); + choices.add(findServerForSystem(s, expand)); + } + + // first we look for a server that's authoritative for all of them + for (ServerOptionList ol : choices) { + for (String s : ol.authoritative) { + boolean ok = true; + for (ServerOptionList t : choices) { + if (!t.authoritative.contains(s)) { + ok = false; + } + } + if (ok) { + return findClient(s, systems, expand); + } + } } - if (clients.size() == 1) { - return clients.iterator().next(); + + // now we look for a server that's authoritative for one of them and a candidate for the others + for (ServerOptionList ol : choices) { + for (String s : ol.authoritative) { + boolean ok = true; + for (ServerOptionList t : choices) { + if (!t.authoritative.contains(s) && !t.candidates.contains(s)) { + ok = false; + } + } + if (ok) { + return findClient(s, systems, expand); + } + } + } + + // now we look for a server that's a candidate for all of them + for (ServerOptionList ol : choices) { + for (String s : ol.candidates) { + boolean ok = true; + for (ServerOptionList t : choices) { + if (!t.candidates.contains(s)) { + ok = false; + } + } + if (ok) { + return findClient(s, systems, expand); + } + } + } + + // no agreement? Then what we do depends + if (vs != null) { + if (vs.hasUserData("External.Link")) { + if (systems.size() == 1) { + internalLog.add(vs.getVersionedUrl()+" uses the system "+systems.toString()+" not handled by any servers. Using source @ '"+vs.getUserString("External.Link")+"'"); + } else { + internalLog.add(vs.getVersionedUrl()+" includes multiple systems "+systems.toString()+" best handled by multiple servers: "+choices.toString()+". Using source @ '"+vs.getUserString("External.Link")+"'"); + } + return findClient(vs.getUserString("External.Link"), systems, expand); + } else { + if (systems.size() == 1) { + internalLog.add(vs.getVersionedUrl()+" uses the system "+systems.toString()+" not handled by any servers. Using master @ '"+serverList.get(0)+"'"); + } else { + internalLog.add(vs.getVersionedUrl()+" includes multiple systems "+systems.toString()+" best handled by multiple servers: "+choices.toString()+". Using master @ '"+serverList.get(0)+"'"); + } + return findClient(serverList.get(0).getAddress(), systems, expand); + } } else { - System.out.println("systems: "+systems.toString()); - return serverList.get(0); + if (systems.size() == 1) { + internalLog.add("Request for system "+systems.toString()+" not handled by any servers. Using master @ '"+serverList.get(0)+"'"); + } else { + internalLog.add("Request for multiple systems "+systems.toString()+" best handled by multiple servers: "+choices.toString()+". Using master @ '"+serverList.get(0)+"'"); + } + return findClient(serverList.get(0).getAddress(), systems, expand); } } - private TerminologyClientContext findServerForSystem(String s, boolean expand) throws TerminologyServiceException { - String server = resMap.get(s); - if (server == null) { - server = decideWhichServer(s); - // testing support - if (server != null && server.contains("://tx.fhir.org")) { - try { - server = server.replace("tx.fhir.org", new URL(getMasterClient().getAddress()).getHost()); - } catch (MalformedURLException e) { - } - } - resMap.put(s, server); - save(); - } + private TerminologyClientContext findClient(String server, Set systems, boolean expand) { TerminologyClientContext client = serverMap.get(server); if (client == null) { try { @@ -127,13 +217,28 @@ public class TerminologyClientManager { serverList.add(client); serverMap.put(server, client); } - client.seeUse(s, expand ? TerminologyClientContextUseType.expand : TerminologyClientContextUseType.validate); + client.seeUse(systems, expand ? TerminologyClientContextUseType.expand : TerminologyClientContextUseType.validate); return client; } - private String decideWhichServer(String url) { + private ServerOptionList findServerForSystem(String s, boolean expand) throws TerminologyServiceException { + ServerOptionList serverList = resMap.get(s); + if (serverList == null) { + serverList = decideWhichServer(s); + // testing support + try { + serverList.replace("tx.fhir.org", new URL(getMasterClient().getAddress()).getHost()); + } catch (MalformedURLException e) { + } + resMap.put(s, serverList); + save(); + } + return serverList; + } + + private ServerOptionList decideWhichServer(String url) { if (IGNORE_TX_REGISTRY) { - return getMasterClient().getAddress(); + return new ServerOptionList(getMasterClient().getAddress()); } if (expParameters != null) { if (!url.contains("|")) { @@ -157,23 +262,25 @@ public class TerminologyClientManager { request = request + "&usage="+usage; } try { + ServerOptionList ret = new ServerOptionList(); JsonObject json = JsonParser.parseObjectFromUrl(request); for (JsonObject item : json.getJsonObjects("authoritative")) { - return item.asString("url"); + ret.authoritative.add(item.asString("url")); } for (JsonObject item : json.getJsonObjects("candidates")) { - return item.asString("url"); + ret.candidates.add(item.asString("url")); } + return ret; } catch (Exception e) { String msg = "Error resolving system "+url+": "+e.getMessage()+" ("+request+")"; - if (!internalErrors.contains(msg)) { - internalErrors.add(msg); + if (!internalLog.contains(msg)) { + internalLog.add(msg); } if (!monitorServiceURL.contains("tx.fhir.org")) { e.printStackTrace(); } } - return getMasterClient().getAddress(); + return new ServerOptionList( getMasterClient().getAddress()); } @@ -248,7 +355,11 @@ public class TerminologyClientManager { if (cacheFile.exists()) { JsonObject json = JsonParser.parseObject(cacheFile); for (JsonObject pair : json.getJsonObjects("systems")) { - resMap.put(pair.asString("system"), pair.asString("server")); + if (pair.has("server")) { + resMap.put(pair.asString("system"), new ServerOptionList(pair.asString("server"))); + } else { + resMap.put(pair.asString("system"), new ServerOptionList(pair.getStrings("authoritative"), pair.getStrings("candidates"))); + } } } } catch (Exception e) { @@ -264,7 +375,8 @@ public class TerminologyClientManager { JsonObject si = new JsonObject(); json.forceArray("systems").add(si); si.add("system", s); - si.add("server", resMap.get(s)); + si.add("authoritative", resMap.get(s).authoritative); + si.add("candidates", resMap.get(s).candidates); } try { JsonParser.compose(json, cacheFile, true); @@ -273,8 +385,8 @@ public class TerminologyClientManager { } } - public List getInternalErrors() { - return internalErrors; + public List getInternalLog() { + return internalLog; } public List getServerList() { @@ -377,8 +489,8 @@ public class TerminologyClientManager { } catch (Exception e) { e.printStackTrace(); String msg = "Error resolving valueSet "+canonical+": "+e.getMessage()+" ("+request+")"; - if (!internalErrors.contains(msg)) { - internalErrors.add(msg); + if (!internalLog.contains(msg)) { + internalLog.add(msg); } e.printStackTrace(); return null; @@ -393,5 +505,5 @@ public class TerminologyClientManager { } return false; } - + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientR5.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientR5.java index 002be62a3..ef257dda3 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientR5.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/TerminologyClientR5.java @@ -135,6 +135,11 @@ public class TerminologyClientR5 implements ITerminologyClient { return client.operateType(CodeSystem.class, "validate-code", pin); } + @Override + public Parameters subsumes(Parameters pin) { + return client.operateType(CodeSystem.class, "subsumes", pin); + } + @Override public Parameters validateVS(Parameters pin) { return client.operateType(ValueSet.class, "validate-code", pin); @@ -256,4 +261,5 @@ public class TerminologyClientR5 implements ITerminologyClient { return client.search(type, criteria); } + } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/KnownPropertyFilter.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/KnownPropertyFilter.java new file mode 100644 index 000000000..aa3da1af2 --- /dev/null +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/KnownPropertyFilter.java @@ -0,0 +1,58 @@ +package org.hl7.fhir.r5.terminologies.expansion; + +import java.util.List; + +import org.hl7.fhir.r5.model.CodeSystem; +import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent; +import org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent; +import org.hl7.fhir.r5.model.CodeSystem.PropertyComponent; +import org.hl7.fhir.r5.model.CodeSystem.PropertyType; +import org.hl7.fhir.r5.model.Enumerations.FilterOperator; +import org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent; +import org.hl7.fhir.utilities.Utilities; + +public class KnownPropertyFilter extends ConceptFilter { + + private ConceptSetFilterComponent filter; + private String code; + + public KnownPropertyFilter(List allErrors, ConceptSetFilterComponent fc, String code) { + super (allErrors); + this.filter = fc; + this.code = code; + } + + @Override + public boolean includeConcept(CodeSystem cs, ConceptDefinitionComponent def) { + ConceptPropertyComponent pc = getPropertyForConcept(def); + if (pc != null) { + String v = pc.getValue().isPrimitive() ? pc.getValue().primitiveValue() : null; + switch (filter.getOp()) { + case DESCENDENTOF: throw fail("not supported yet: "+filter.getOp().toCode()); + case EQUAL: return filter.getValue().equals(v); + case EXISTS: throw fail("not supported yet: "+filter.getOp().toCode()); + case GENERALIZES: throw fail("not supported yet: "+filter.getOp().toCode()); + case IN: return Utilities.existsInListTrimmed(v, filter.getValue().split("\\,")); + case ISA: throw fail("not supported yet: "+filter.getOp().toCode()); + case ISNOTA: throw fail("not supported yet: "+filter.getOp().toCode()); + case NOTIN: return Utilities.existsInListTrimmed(v, filter.getValue().split("\\,")); + case NULL: throw fail("not supported yet: "+filter.getOp().toCode()); + case REGEX: throw fail("not supported yet: "+filter.getOp().toCode()); + default: + throw fail("Shouldn't get here"); + } + } else { + return false; + } + } + + private ConceptPropertyComponent getPropertyForConcept(ConceptDefinitionComponent def) { + for (ConceptPropertyComponent pc : def.getProperty()) { + if (pc.hasCode() && pc.getCode().equals(code)) { + return pc; + } + } + return null; + } + +} \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/PropertyFilter.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/PropertyFilter.java index 3af987e8f..2dea7557c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/PropertyFilter.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/PropertyFilter.java @@ -9,6 +9,7 @@ import org.hl7.fhir.r5.model.CodeSystem.PropertyComponent; import org.hl7.fhir.r5.model.CodeSystem.PropertyType; import org.hl7.fhir.r5.model.Enumerations.FilterOperator; import org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent; +import org.hl7.fhir.utilities.Utilities; public class PropertyFilter extends ConceptFilter { @@ -31,25 +32,23 @@ public class PropertyFilter extends ConceptFilter { case EQUAL: return filter.getValue().equals(v); case EXISTS: throw fail("not supported yet: "+filter.getOp().toCode()); case GENERALIZES: throw fail("not supported yet: "+filter.getOp().toCode()); - case IN: throw fail("not supported yet: "+filter.getOp().toCode()); + case IN: return Utilities.existsInListTrimmed(v, filter.getValue().split("\\,")); case ISA: throw fail("not supported yet: "+filter.getOp().toCode()); case ISNOTA: throw fail("not supported yet: "+filter.getOp().toCode()); - case NOTIN: throw fail("not supported yet: "+filter.getOp().toCode()); + case NOTIN: return !Utilities.existsInListTrimmed(v, filter.getValue().split("\\,")); case NULL: throw fail("not supported yet: "+filter.getOp().toCode()); case REGEX: throw fail("not supported yet: "+filter.getOp().toCode()); default: throw fail("Shouldn't get here"); } - } else if (property.getType() == PropertyType.BOOLEAN && filter.getOp() == FilterOperator.EQUAL) { - return "false".equals(filter.getValue()); } else { - return false; + return filter.getOp() == FilterOperator.NOTIN; } } private ConceptPropertyComponent getPropertyForConcept(ConceptDefinitionComponent def) { for (ConceptPropertyComponent pc : def.getProperty()) { - if (pc.getCode().equals(property.getCode())) { + if (pc.hasCode() && pc.getCode().equals(property.getCode())) { return pc; } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/ValueSetExpander.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/ValueSetExpander.java index febe4a4f9..9893a0420 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/ValueSetExpander.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/ValueSetExpander.java @@ -255,7 +255,7 @@ public class ValueSetExpander extends ValueSetProcessBase { } } - if (expParams.getParameterBool("includeDesignations")) { + if (expParams.getParameterBool("includeDesignations") && designations != null) { for (ConceptDefinitionDesignationComponent t : designations) { if (t != pref && (t.hasLanguage() || t.hasUse()) && t.getValue() != null && passesDesignationFilter(t)) { @@ -680,8 +680,6 @@ public class ValueSetExpander extends ValueSetProcessBase { if (debug) { e.printStackTrace(); } - // well, we couldn't expand, so we'll return an interface to a checker that can check membership of the set - // that might fail too, but it might not, later. return new ValueSetExpansionOutcome(e.getMessage(), TerminologyServiceErrorClass.UNKNOWN, allErrors, e instanceof EFhirClientException || e instanceof TerminologyServiceException); } } @@ -882,6 +880,8 @@ public class ValueSetExpander extends ValueSetProcessBase { if (vso.getError() != null) { addErrors(vso.getAllErrors()); throw fail("Unable to expand imported value set "+vs.getUrl()+": " + vso.getError()); + } else if (vso.getValueset() == null) { + throw fail("Unable to expand imported value set "+vs.getUrl()+" but no error"); } if (vs.hasVersion() || REPORT_VERSION_ANYWAY) { UriType u = new UriType(vs.getUrl() + (vs.hasVersion() ? "|"+vs.getVersion() : "")); @@ -1220,12 +1220,22 @@ public class ValueSetExpander extends ValueSetProcessBase { } } } - } else if (isDefinedProperty(cs, fc.getProperty())) { + } else if (CodeSystemUtilities.isDefinedProperty(cs, fc.getProperty())) { for (ConceptDefinitionComponent def : cs.getConcept()) { + PropertyFilter pf = new PropertyFilter(allErrors, fc, CodeSystemUtilities.getPropertyDefinition(cs, fc.getProperty())); if (exclude) { - excludeCodeAndDescendents(wc, cs, inc.getSystem(), def, null, imports, null, new PropertyFilter(allErrors, fc, getPropertyDefinition(cs, fc.getProperty())), filters, exp); + excludeCodeAndDescendents(wc, cs, inc.getSystem(), def, null, imports, null, pf, filters, exp); } else { - addCodeAndDescendents(wc, cs, inc.getSystem(), def, null, expParams, imports, null, new PropertyFilter(allErrors, fc, getPropertyDefinition(cs, fc.getProperty())), noInactive, exp.getProperty(), filters, exp); + addCodeAndDescendents(wc, cs, inc.getSystem(), def, null, expParams, imports, null, pf, noInactive, exp.getProperty(), filters, exp); + } + } + } else if (isKnownProperty(fc.getProperty(), cs)) { + for (ConceptDefinitionComponent def : cs.getConcept()) { + KnownPropertyFilter pf = new KnownPropertyFilter(allErrors, fc, fc.getProperty()); + if (exclude) { + excludeCodeAndDescendents(wc, cs, inc.getSystem(), def, null, imports, null, pf, filters, exp); + } else { + addCodeAndDescendents(wc, cs, inc.getSystem(), def, null, expParams, imports, null, pf, noInactive, exp.getProperty(), filters, exp); } } } else if ("code".equals(fc.getProperty()) && fc.getOp() == FilterOperator.REGEX) { @@ -1241,6 +1251,10 @@ public class ValueSetExpander extends ValueSetProcessBase { } } + private boolean isKnownProperty(String property, CodeSystem cs) { + return Utilities.existsInList(property, "notSelectable"); + } + private List mergeDesignations(ConceptDefinitionComponent def, List list) { List res = new ArrayList<>(); @@ -1251,23 +1265,7 @@ public class ValueSetExpander extends ValueSetProcessBase { return res; } - private PropertyComponent getPropertyDefinition(CodeSystem cs, String property) { - for (PropertyComponent cp : cs.getProperty()) { - if (cp.getCode().equals(property)) { - return cp; - } - } - return null; - } - - private boolean isDefinedProperty(CodeSystem cs, String property) { - for (PropertyComponent cp : cs.getProperty()) { - if (cp.getCode().equals(property)) { - return true; - } - } - return false; - } + private void addFragmentWarning(ValueSetExpansionComponent exp, CodeSystem cs) { String url = cs.getVersionedUrl(); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/utilities/TerminologyCache.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/utilities/TerminologyCache.java index 83cacdcab..f02055817 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/utilities/TerminologyCache.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/utilities/TerminologyCache.java @@ -148,6 +148,21 @@ public class TerminologyCache { } } + public static class SubsumesResult { + + private Boolean result; + + protected SubsumesResult(Boolean result) { + super(); + this.result = result; + } + + public Boolean getResult() { + return result; + } + + } + protected SystemNameKeyGenerator getSystemNameKeyGenerator() { return systemNameKeyGenerator; } @@ -218,6 +233,7 @@ public class TerminologyCache { private boolean persistent; private ValidationResult v; private ValueSetExpansionOutcome e; + private SubsumesResult s; } private class NamedCache { @@ -381,9 +397,9 @@ public class TerminologyCache { if (code.hasSystem()) { ct.setName(code.getSystem()); ct.hasVersion = code.hasVersion(); - } - else + } else { ct.name = NAME_FOR_NO_SYSTEM; + } ct.setName(vsUrl); JsonParser json = new JsonParser(); json.setOutputStyle(OutputStyle.PRETTY); @@ -633,6 +649,9 @@ public class TerminologyCache { if (ce.e.getValueset() != null) sw.write(" \"valueSet\" : "+json.composeString(ce.e.getValueset()).trim()+",\r\n"); sw.write(" \"error\" : \""+Utilities.escapeJson(ce.e.getError()).trim()+"\"\r\n}\r\n"); + } else if (ce.s != null) { + sw.write("s: {\r\n"); + sw.write(" \"result\" : "+ce.s.result+"\r\n}\r\n"); } else { sw.write("v: {\r\n"); boolean first = true; @@ -743,15 +762,17 @@ public class TerminologyCache { CacheEntry ce = new CacheEntry(); ce.persistent = true; ce.request = request; - boolean e = resultString.charAt(0) == 'e'; + char e = resultString.charAt(0); resultString = resultString.substring(3); JsonObject o = (JsonObject) new com.google.gson.JsonParser().parse(resultString); String error = loadJS(o.get("error")); - if (e) { + if (e == 'e') { if (o.has("valueSet")) ce.e = new ValueSetExpansionOutcome((ValueSet) new JsonParser().parse(o.getAsJsonObject("valueSet")), error, TerminologyServiceErrorClass.UNKNOWN, o.has("from-server")); else ce.e = new ValueSetExpansionOutcome(error, TerminologyServiceErrorClass.UNKNOWN, o.has("from-server")); + } else if (e == 's') { + ce.s = new SubsumesResult(o.get("result").getAsBoolean()); } else { String t = loadJS(o.get("severity")); IssueSeverity severity = t == null ? null : IssueSeverity.fromCode(t); @@ -934,15 +955,15 @@ public class TerminologyCache { public Map servers() { Map servers = new HashMap<>(); - servers.put("http://local.fhir.org/r2", "tx.fhir.org"); - servers.put("http://local.fhir.org/r3", "tx.fhir.org"); - servers.put("http://local.fhir.org/r4", "tx.fhir.org"); - servers.put("http://local.fhir.org/r5", "tx.fhir.org"); - - servers.put("http://tx-dev.fhir.org/r2", "tx.fhir.org"); - servers.put("http://tx-dev.fhir.org/r3", "tx.fhir.org"); - servers.put("http://tx-dev.fhir.org/r4", "tx.fhir.org"); - servers.put("http://tx-dev.fhir.org/r5", "tx.fhir.org"); +// servers.put("http://local.fhir.org/r2", "tx.fhir.org"); +// servers.put("http://local.fhir.org/r3", "tx.fhir.org"); +// servers.put("http://local.fhir.org/r4", "tx.fhir.org"); +// servers.put("http://local.fhir.org/r5", "tx.fhir.org"); +// +// servers.put("http://tx-dev.fhir.org/r2", "tx.fhir.org"); +// servers.put("http://tx-dev.fhir.org/r3", "tx.fhir.org"); +// servers.put("http://tx-dev.fhir.org/r4", "tx.fhir.org"); +// servers.put("http://tx-dev.fhir.org/r5", "tx.fhir.org"); servers.put("http://tx.fhir.org/r2", "tx.fhir.org"); servers.put("http://tx.fhir.org/r3", "tx.fhir.org"); @@ -1002,5 +1023,58 @@ public class TerminologyCache { } } + public CacheToken generateSubsumesToken(ValidationOptions options, Coding parent, Coding child, Parameters expParameters) { + try { + CacheToken ct = new CacheToken(); + if (parent.hasSystem()) { + ct.setName(parent.getSystem()); + } + if (child.hasSystem()) { + ct.setName(child.getSystem()); + } + ct.hasVersion = parent.hasVersion() || child.hasVersion(); + JsonParser json = new JsonParser(); + json.setOutputStyle(OutputStyle.PRETTY); + String expJS = json.composeString(expParameters); + ct.request = "{\"op\": \"subsumes\", \"parent\" : "+json.composeString(parent, "code")+", \"child\" :"+json.composeString(child, "code")+(options == null ? "" : ", "+options.toJson())+", \"profile\": "+expJS+"}"; + ct.key = String.valueOf(hashJson(ct.request)); + return ct; + } catch (IOException e) { + throw new Error(e); + } + } + + public Boolean getSubsumes(CacheToken cacheToken) { + if (cacheToken.key == null) { + return null; + } + synchronized (lock) { + requestCount++; + NamedCache nc = getNamedCache(cacheToken); + CacheEntry e = nc.map.get(cacheToken.key); + if (e == null) { + networkCount++; + return null; + } else { + hitCount++; + return e.s.result; + } + } + + } + + public void cacheSubsumes(CacheToken cacheToken, Boolean b, boolean persistent) { + if (cacheToken.key != null) { + synchronized (lock) { + NamedCache nc = getNamedCache(cacheToken); + CacheEntry e = new CacheEntry(); + e.request = cacheToken.request; + e.persistent = persistent; + e.s = new SubsumesResult(b); + store(cacheToken, persistent, nc, e); + } + } + } + } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java index 4ec3e3444..8cbf002a1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/validation/ValueSetValidator.java @@ -356,6 +356,9 @@ public class ValueSetValidator extends ValueSetProcessBase { res.setVersion(foundCoding.hasVersion() ? foundCoding.getVersion() : foundCoding.hasUserData("cs") ? ((CodeSystem) foundCoding.getUserData("cs")).getVersion() : null); res.setDisplay(cd.getDisplay()); } + if (info.getErr() != null) { + res.setErrorClass(info.getErr()); + } res.setUnknownSystems(unknownSystems); res.addCodeableConcept(vcc); return res; @@ -478,7 +481,7 @@ public class ValueSetValidator extends ValueSetProcessBase { VersionInfo vi = new VersionInfo(this); checkCanonical(issues, path, valueset, valueset); - String system = code.hasSystem() ? code.getSystem() : getValueSetSystemOrNull(); + String system = code.getSystem(); if (!options.isMembershipOnly()) { if (system == null && !code.hasDisplay() && options.isGuessSystem()) { // dealing with just a plain code (enum) List problems = new ArrayList<>(); @@ -487,7 +490,10 @@ public class ValueSetValidator extends ValueSetProcessBase { if (problems.size() == 0) { throw new Error("Unable to resolve systems but no reason why"); // this is an error in the java code } else if (problems.size() == 1) { - return new ValidationResult(IssueSeverity.ERROR, problems.get(0).getMessage(), makeIssue(IssueSeverity.ERROR, IssueType.UNKNOWN, path, problems.get(0).getMessage(), problems.get(0).getCode(), null)); + String msg = context.formatMessagePlural(1, I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getVersionedUrl(), "'"+code.toString()+"'"); + issues.addAll(makeIssue(IssueSeverity.ERROR, IssueType.CODEINVALID, "code", msg, OpIssueCode.NotInVS, null)); + issues.addAll(makeIssue(IssueSeverity.ERROR, IssueType.NOTFOUND, "code", problems.get(0).getMessage(), problems.get(0).getCode(), null)); + return new ValidationResult(IssueSeverity.ERROR, problems.get(0).getMessage()+"; "+msg, issues); } else { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder("; "); for (StringWithCode s : problems) { @@ -584,13 +590,14 @@ public class ValueSetValidator extends ValueSetProcessBase { break; } warningMessage = warningMessage + ", so the code has not been validated"; - if (!inExpansion && cs.getContent() != CodeSystemContentMode.FRAGMENT) { // we're going to give it a go if it's a fragment + if (!options.isExampleOK() && !inExpansion && cs.getContent() != CodeSystemContentMode.FRAGMENT) { // we're going to give it a go if it's a fragment throw new VSCheckerException(warningMessage, null, true); } } if (cs != null /*&& (cs.getContent() == CodeSystemContentMode.COMPLETE || cs.getContent() == CodeSystemContentMode.FRAGMENT)*/) { - if (!(cs.getContent() == CodeSystemContentMode.COMPLETE || cs.getContent() == CodeSystemContentMode.FRAGMENT)) { + if (!(cs.getContent() == CodeSystemContentMode.COMPLETE || cs.getContent() == CodeSystemContentMode.FRAGMENT || + (options.isExampleOK() && cs.getContent() == CodeSystemContentMode.EXAMPLE))) { if (inInclude) { ConceptReferenceComponent cc = findInInclude(code); if (cc != null) { @@ -602,7 +609,7 @@ public class ValueSetValidator extends ValueSetProcessBase { } } // we can't validate that here. - throw new FHIRException("Unable to evaluate based on empty code system"); + throw new FHIRException("Unable to evaluate based on code system with status = "+cs.getContent().toCode()); } res = validateCode(path, code, cs, null, info); res.setIssues(issues); @@ -669,7 +676,7 @@ public class ValueSetValidator extends ValueSetProcessBase { res.setDefinition(null); res.setSystem(null); res.setDisplay(null); - res.setUnknownSystems(unknownSystems); + res.setUnknownSystems(unknownSystems); // } } else if (warningMessage!=null) { String msg = context.formatMessage(I18nConstants.CODE_FOUND_IN_EXPANSION_HOWEVER_, warningMessage); @@ -832,7 +839,7 @@ public class ValueSetValidator extends ValueSetProcessBase { } private ValidationResult validateCode(String path, Coding code, CodeSystem cs, CodeableConcept vcc, ValidationProcessInfo info) { - ConceptDefinitionComponent cc = cs.hasUserData("tx.cs.special") ? ((SpecialCodeSystem) cs.getUserData("tx.cs.special")).findConcept(code) : findCodeInConcept(cs.getConcept(), code.getCode(), allAltCodes); + ConceptDefinitionComponent cc = cs.hasUserData("tx.cs.special") ? ((SpecialCodeSystem) cs.getUserData("tx.cs.special")).findConcept(code) : findCodeInConcept(cs.getConcept(), code.getCode(), cs.getCaseSensitive(), allAltCodes); if (cc == null) { cc = findSpecialConcept(code, cs); } @@ -844,6 +851,11 @@ public class ValueSetValidator extends ValueSetProcessBase { String msg = context.formatMessage(I18nConstants.UNKNOWN_CODE_IN_VERSION, code.getCode(), cs.getUrl(), cs.getVersion()); return new ValidationResult(IssueSeverity.ERROR, msg, makeIssue(IssueSeverity.ERROR, IssueType.CODEINVALID, path+".code", msg, OpIssueCode.InvalidCode, null)); } + } else { + if (!cc.getCode().equals(code.getCode())) { + String msg = context.formatMessage(I18nConstants.CODE_CASE_DIFFERENCE, code.getCode(), cc.getCode(), cs.getVersionedUrl()); + info.addIssue(makeIssue(IssueSeverity.INFORMATION, IssueType.BUSINESSRULE, path+".code", msg, OpIssueCode.CodeRule, null)); + } } Coding vc = new Coding().setCode(cc.getCode()).setSystem(cs.getUrl()).setVersion(cs.getVersion()).setDisplay(getPreferredDisplay(cc, cs)); if (vcc != null) { @@ -983,40 +995,6 @@ public class ValueSetValidator extends ValueSetProcessBase { return null; } - private String getValueSetSystemOrNull() throws FHIRException { - if (valueset == null) { - return null; - } - if (!options.isGuessSystem()) { - return null; - } - if (valueset.getCompose().getInclude().size() == 0) { - if (!valueset.hasExpansion() || valueset.getExpansion().getContains().size() == 0) { - return null; - } else { - String cs = valueset.getExpansion().getContains().get(0).getSystem(); - if (cs != null && checkSystem(valueset.getExpansion().getContains(), cs)) { - return cs; - } else { - return null; - } - } - } - for (ConceptSetComponent inc : valueset.getCompose().getInclude()) { - if (inc.hasValueSet()) { - return null; - } - if (!inc.hasSystem()) { - return null; - } - } - if (valueset.getCompose().getInclude().size() == 1) { - return valueset.getCompose().getInclude().get(0).getSystem(); - } - - return null; - } - /* * Check that all system values within an expansion correspond to the specified system value */ @@ -1029,19 +1007,19 @@ public class ValueSetValidator extends ValueSetProcessBase { return true; } - private ConceptDefinitionComponent findCodeInConcept(ConceptDefinitionComponent concept, String code, AlternateCodesProcessingRules altCodeRules) { + private ConceptDefinitionComponent findCodeInConcept(ConceptDefinitionComponent concept, String code, boolean caseSensitive, AlternateCodesProcessingRules altCodeRules) { opContext.deadCheck(); if (code.equals(concept.getCode())) { return concept; } - ConceptDefinitionComponent cc = findCodeInConcept(concept.getConcept(), code, altCodeRules); + ConceptDefinitionComponent cc = findCodeInConcept(concept.getConcept(), code, caseSensitive, altCodeRules); if (cc != null) { return cc; } if (concept.hasUserData(CodeSystemUtilities.USER_DATA_CROSS_LINK)) { List children = (List) concept.getUserData(CodeSystemUtilities.USER_DATA_CROSS_LINK); for (ConceptDefinitionComponent c : children) { - cc = findCodeInConcept(c, code, altCodeRules); + cc = findCodeInConcept(c, code, caseSensitive, altCodeRules); if (cc != null) { return cc; } @@ -1050,15 +1028,15 @@ public class ValueSetValidator extends ValueSetProcessBase { return null; } - private ConceptDefinitionComponent findCodeInConcept(List concept, String code, AlternateCodesProcessingRules altCodeRules) { + private ConceptDefinitionComponent findCodeInConcept(List concept, String code, boolean caseSensitive, AlternateCodesProcessingRules altCodeRules) { for (ConceptDefinitionComponent cc : concept) { - if (code.equals(cc.getCode())) { + if (code.equals(cc.getCode()) || (!caseSensitive && (code.equalsIgnoreCase(cc.getCode())))) { return cc; } if (Utilities.existsInList(code, alternateCodes(cc, altCodeRules))) { return cc; } - ConceptDefinitionComponent c = findCodeInConcept(cc, code, altCodeRules); + ConceptDefinitionComponent c = findCodeInConcept(cc, code, caseSensitive, altCodeRules); if (c != null) { return c; } @@ -1084,10 +1062,10 @@ public class ValueSetValidator extends ValueSetProcessBase { return null; } if (sys.size() == 0) { - problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_NO_MATCHES, code))); + problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_NO_MATCHES, code, valueset.getVersionedUrl()))); return null; } else if (sys.size() > 1) { - problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_MULTIPLE_MATCHES, sys.toString()))); + problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_MULTIPLE_MATCHES, code, valueset.getVersionedUrl(), sys.toString()))); return null; } else { return sys.iterator().next(); @@ -1098,7 +1076,7 @@ public class ValueSetValidator extends ValueSetProcessBase { if (valueset.hasCompose()) { // ignore excludes - they can't make any difference if (!valueset.getCompose().hasInclude() && !valueset.getExpansion().hasContains()) { - problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_NO_INCLUDES_OR_EXPANSION, valueset.getVersionedUrl()))); + problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_NO_INCLUDES_OR_EXPANSION, code, valueset.getVersionedUrl()))); } int i = 0; @@ -1111,19 +1089,29 @@ public class ValueSetValidator extends ValueSetProcessBase { } } } else if (!vsi.hasSystem()) { - problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_INCLUDE_WITH_NO_SYSTEM, valueset.getVersionedUrl(), i))); + problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_INCLUDE_WITH_NO_SYSTEM, code, valueset.getVersionedUrl(), i))); return false; } if (vsi.hasSystem()) { if (vsi.hasFilter()) { - problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_INCLUDE_WITH_FILTER, valueset.getVersionedUrl(), i, vsi.getSystem()))); - return false; + ValueSet vsDummy = new ValueSet(); + vsDummy.setUrl(Utilities.makeUuidUrn()); + vsDummy.setStatus(PublicationStatus.ACTIVE); + vsDummy.getCompose().addInclude(vsi); + Coding c = new Coding().setCode(code).setSystem(vsi.getSystem()); + ValidationResult vr = context.validateCode(options.withGuessSystem(false), c, vsDummy); + if (vr.isOk()) { + sys.add(vsi.getSystem()); + } else { + problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_INCLUDE_WITH_FILTER, code, valueset.getVersionedUrl(), i, vsi.getSystem()))); + return false; + } } CodeSystemProvider csp = CodeSystemProvider.factory(vsi.getSystem()); if (csp != null) { Boolean ok = csp.checkCode(code); if (ok == null) { - problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM_SYSTEM_IS_INDETERMINATE, valueset.getVersionedUrl(), vsi.getSystem()))); + problems.add(new StringWithCode(OpIssueCode.InferFailed, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM_SYSTEM_IS_INDETERMINATE, code, valueset.getVersionedUrl(), vsi.getSystem()))); sys.add(vsi.getSystem()); } else if (ok) { sys.add(vsi.getSystem()); @@ -1140,7 +1128,7 @@ public class ValueSetValidator extends ValueSetProcessBase { } } } else { - ConceptDefinitionComponent cc = findCodeInConcept(cs.getConcept(), code, allAltCodes); + ConceptDefinitionComponent cc = findCodeInConcept(cs.getConcept(), code, cs.getCaseSensitive(), allAltCodes); if (cc != null) { sys.add(vsi.getSystem()); } @@ -1153,15 +1141,25 @@ public class ValueSetValidator extends ValueSetProcessBase { } } } else { - // we'll try to expand this one then - ValueSetExpansionOutcome vse = context.expandVS(vsi, false, false); - if (vse.isOk()) { - if (!checkSystems(vse.getValueset().getExpansion().getContains(), code, sys, problems)) { + ValueSet vsDummy = new ValueSet(); + vsDummy.setUrl(Utilities.makeUuidUrn()); + vsDummy.setStatus(PublicationStatus.ACTIVE); + vsDummy.getCompose().addInclude(vsi); + ValidationResult vr = context.validateCode(options.withNoClient(), code, vsDummy); + if (vr.isOk()) { + sys.add(vsi.getSystem()); + } else { + // ok, we'll try to expand this one then + ValueSetExpansionOutcome vse = context.expandVS(vsi, false, false); + if (vse.isOk()) { + if (!checkSystems(vse.getValueset().getExpansion().getContains(), code, sys, problems)) { + return false; + } + } else { + problems.add(new StringWithCode(OpIssueCode.NotFound, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_INCLUDE_WITH_UNKNOWN_SYSTEM, code, valueset.getVersionedUrl(), i, vsi.getSystem(), vse.getAllErrors().toString()))); return false; } - } else { - problems.add(new StringWithCode(OpIssueCode.NotFound, context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_INCLUDE_WITH_UNKNOWN_SYSTEM, valueset.getVersionedUrl(), i, vsi.getSystem(), vse.getAllErrors().toString()))); - return false; + } } } @@ -1309,6 +1307,7 @@ public class ValueSetValidator extends ValueSetProcessBase { } return res.isOk(); } else { + info.setErr(TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED); if (unknownSystems != null) { if (version == null) { unknownSystems.add(system); @@ -1367,14 +1366,20 @@ public class ValueSetValidator extends ValueSetProcessBase { return codeInConceptFilter(cs, f, code); else if ("code".equals(f.getProperty()) && f.getOp() == FilterOperator.REGEX) return codeInRegexFilter(cs, f, code); - else if (CodeSystemUtilities.hasPropertyDef(cs, f.getProperty())) { + else if (CodeSystemUtilities.isDefinedProperty(cs, f.getProperty())) { return codeInPropertyFilter(cs, f, code); + } else if (isKnownProperty(f.getProperty())) { + return codeInKnownPropertyFilter(cs, f, code); } else { System.out.println("todo: handle filters with property = "+f.getProperty()+" "+f.getOp().toCode()); throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_HANDLE_SYSTEM__FILTER_WITH_PROPERTY__, cs.getUrl(), f.getProperty(), f.getOp().toCode())); } } + private boolean isKnownProperty(String code) { + return Utilities.existsInList(code, "notSelectable"); + } + private boolean codeInPropertyFilter(CodeSystem cs, ConceptSetFilterComponent f, String code) { switch (f.getOp()) { case EQUAL: @@ -1391,11 +1396,64 @@ public class ValueSetValidator extends ValueSetProcessBase { } d = CodeSystemUtilities.getProperty(cs, code, f.getProperty()); return d != null && d.primitiveValue() != null && d.primitiveValue().matches(f.getValue()); + case IN: + if (f.getValue() == null) { + return false; + } + String[] values = f.getValue().split("\\,"); + d = CodeSystemUtilities.getProperty(cs, code, f.getProperty()); + if (d != null) { + String v = d.primitiveValue(); + for (String value : values) { + if (v != null && v.equals(value.trim())) { + return true; + } + } + } + return false; + case NOTIN: + if (f.getValue() == null) { + return true; + } + values = f.getValue().split("\\,"); + d = CodeSystemUtilities.getProperty(cs, code, f.getProperty()); + if (d != null) { + String v = d.primitiveValue(); + for (String value : values) { + if (v != null && v.equals(value.trim())) { + return false; + } + } + } + return true; default: System.out.println("todo: handle property filters with op = "+f.getOp()); throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_HANDLE_SYSTEM__PROPERTY_FILTER_WITH_OP__, cs.getUrl(), f.getOp())); } } + + private boolean codeInKnownPropertyFilter(CodeSystem cs, ConceptSetFilterComponent f, String code) { + + switch (f.getOp()) { + case EQUAL: + if (f.getValue() == null) { + return false; + } + DataType d = CodeSystemUtilities.getProperty(cs, code, f.getProperty()); + return d != null && f.getValue().equals(d.primitiveValue()); + case EXISTS: + return CodeSystemUtilities.getProperty(cs, code, f.getProperty()) != null; + case REGEX: + if (f.getValue() == null) { + return false; + } + d = CodeSystemUtilities.getProperty(cs, code, f.getProperty()); + return d != null && d.primitiveValue() != null && d.primitiveValue().matches(f.getValue()); + default: + System.out.println("todo: handle known property filters with op = "+f.getOp()); + throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_HANDLE_SYSTEM__PROPERTY_FILTER_WITH_OP__, cs.getUrl(), f.getOp())); + } + } private boolean codeInRegexFilter(CodeSystem cs, ConceptSetFilterComponent f, String code) { return code.matches(f.getValue()); @@ -1416,11 +1474,11 @@ public class ValueSetValidator extends ValueSetProcessBase { if (!excludeRoot && code.equals(f.getValue())) { return true; } - ConceptDefinitionComponent cc = findCodeInConcept(cs.getConcept(), f.getValue(), altCodeParams); + ConceptDefinitionComponent cc = findCodeInConcept(cs.getConcept(), f.getValue(), cs.getCaseSensitive(), altCodeParams); if (cc == null) { return false; } - ConceptDefinitionComponent cc2 = findCodeInConcept(cc, code, altCodeParams); + ConceptDefinitionComponent cc2 = findCodeInConcept(cc, code, cs.getCaseSensitive(), altCodeParams); return cc2 != null && cc2 != cc; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/test/utils/CompareUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/test/utils/CompareUtilities.java index 3c743c2da..3e8e89e18 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/test/utils/CompareUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/test/utils/CompareUtilities.java @@ -31,12 +31,12 @@ public class CompareUtilities extends BaseTestingUtilities { private static final boolean SHOW_DIFF = false; private JsonObject externals; - + public String createNotEqualMessage(final String message, final String expected, final String actual) { return new StringBuilder() - .append(message).append('\n') - .append("Expected :").append(presentExpected(expected)).append('\n') - .append("Actual :").append("\""+actual+"\"").toString(); + .append(message).append('\n') + .append("Expected :").append(presentExpected(expected)).append('\n') + .append("Actual :").append("\""+actual+"\"").toString(); } private String presentExpected(String expected) { @@ -86,7 +86,7 @@ public class CompareUtilities extends BaseTestingUtilities { return result; } - private static String getDiffTool() throws IOException { + private static String getDiffTool() throws IOException { if (FhirSettings.hasDiffToolPath()) { return FhirSettings.getDiffToolPath(); } else if (System.getenv("ProgramFiles") != null) { @@ -185,21 +185,21 @@ public class CompareUtilities extends BaseTestingUtilities { return true; } - private byte[] unBase64(String text) { + private byte[] unBase64(String text) { return Base64.decodeBase64(text); } - private Node skipBlankText(Node node) { + private Node skipBlankText(Node node) { while (node != null && (((node.getNodeType() == Node.TEXT_NODE) && StringUtils.isWhitespace(node.getTextContent())) || (node.getNodeType() == Node.COMMENT_NODE))) node = node.getNextSibling(); return node; } - private Document loadXml(String fn) throws Exception { + private Document loadXml(String fn) throws Exception { return loadXml(new FileInputStream(fn)); } - private Document loadXml(InputStream fn) throws Exception { + private Document loadXml(InputStream fn) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); factory.setFeature("http://xml.org/sax/features/external-general-entities", false); @@ -361,7 +361,7 @@ public class CompareUtilities extends BaseTestingUtilities { } else if (actualJsonElement instanceof JsonArray) { JsonArray actualArray = (JsonArray) actualJsonElement; JsonArray expectedArray = (JsonArray) expectedJsonElement; - + int as = actualArray.size(); int es = expectedArray.size(); if (countOnly) { @@ -369,38 +369,38 @@ public class CompareUtilities extends BaseTestingUtilities { return createNotEqualMessage("array item count differs at " + path, Integer.toString(es), Integer.toString(as)); } } else { - int expectedMin = countExpectedMin(expectedArray); - int oc = optionalCount(expectedArray); - - if (as > es || as < expectedMin) - return createNotEqualMessage("array item count differs at " + path, Integer.toString(es), Integer.toString(as)); - int c = 0; - for (int i = 0; i < es; i++) { - if (c >= as) { - if (i >= es - oc && isOptional(expectedArray.get(i))) { - return null; // this is OK - } else { - return "One or more array items did not match at "+path+" starting at index "+i; + int expectedMin = countExpectedMin(expectedArray); + int oc = optionalCount(expectedArray); + + if (as > es || as < expectedMin) + return createNotEqualMessage("array item count differs at " + path, Integer.toString(es), Integer.toString(as)); + int c = 0; + for (int i = 0; i < es; i++) { + if (c >= as) { + if (i >= es - oc && isOptional(expectedArray.get(i))) { + return null; // this is OK + } else { + return "One or more array items did not match at "+path+" starting at index "+i; + } + } + String s = compareNodes(path + "[" + Integer.toString(i) + "]", expectedArray.get(i), actualArray.get(c), false); + if (!Utilities.noString(s) && !isOptional(expectedArray.get(i))) { + return s; + } + if (Utilities.noString(s)) { + c++; } } - String s = compareNodes(path + "[" + Integer.toString(i) + "]", expectedArray.get(i), actualArray.get(c), false); - if (!Utilities.noString(s) && !isOptional(expectedArray.get(i))) { - return s; + if (c < as) { + return "Unexpected Node found in array at '"+path+"' at index "+c; } - if (Utilities.noString(s)) { - c++; - } - } - if (c < as) { - return "Unexpected Node found in array at index "+c; - } } } else return "unhandled property " + actualJsonElement.getClass().getName(); return null; } - private int optionalCount(JsonArray arr) { + private int optionalCount(JsonArray arr) { int c = 0; for (JsonElement e : arr) { if (e.isJsonObject()) { @@ -413,11 +413,11 @@ public class CompareUtilities extends BaseTestingUtilities { return c; } -private boolean isOptional(JsonElement e) { + private boolean isOptional(JsonElement e) { return e.isJsonObject() && e.asJsonObject().has("$optional$"); } - private int countExpectedMin(JsonArray array) { + private int countExpectedMin(JsonArray array) { int count = array.size(); for (JsonElement e : array) { if (isOptional(e)) { @@ -470,7 +470,7 @@ private boolean isOptional(JsonElement e) { } } - private List readChoices(String s) { + private List readChoices(String s) { List list = new ArrayList<>(); for (String p : s.split("\\|")) { list.add(p); @@ -518,7 +518,7 @@ private boolean isOptional(JsonElement e) { } - private String compareText(String expectedString, String actualString) { + private String compareText(String expectedString, String actualString) { for (int i = 0; i < Integer.min(expectedString.length(), actualString.length()); i++) { if (expectedString.charAt(i) != actualString.charAt(i)) return createNotEqualMessage("Strings differ at character " + Integer.toString(i), charWithContext(expectedString, i), charWithContext(actualString, i)); @@ -528,19 +528,19 @@ private boolean isOptional(JsonElement e) { return null; } -private String charWithContext(String s, int i) { - String result = s.substring(i, i+1); - if (i > 7) { - i = i - 7; + private String charWithContext(String s, int i) { + String result = s.substring(i, i+1); + if (i > 7) { + i = i - 7; + } + int e = i + 20; + if (e > s.length()) { + e = s.length(); + } + if (e > i+1) { + result = result + " with context '"+s.substring(i, e)+"'"; + } + return result; } - int e = i + 20; - if (e > s.length()) { - e = s.length(); - } - if (e > i+1) { - result = result + " with context '"+s.substring(i, e)+"'"; - } - return result; -} } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NPMPackageGenerator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NPMPackageGenerator.java index 4322de1ba..3e1892ba1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NPMPackageGenerator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NPMPackageGenerator.java @@ -52,6 +52,7 @@ import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.ContactDetail; import org.hl7.fhir.r5.model.ContactPoint; import org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem; @@ -263,7 +264,10 @@ public class NPMPackageGenerator { packageManifest.add("fhirVersion", fv); packageManifest.add("date", dt); packageManifest.add("name", ig.getPackageId()); - + if (ig.hasJurisdiction() && ig.getJurisdiction().size() == 1 && ig.getJurisdictionFirstRep().getCoding().size() == 1) { + Coding c = ig.getJurisdictionFirstRep().getCodingFirstRep(); + packageManifest.add("jurisdiction", c.getSystem()+"#"+c.getCode()); + } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceUtilities.java index 030ee34a9..ddfe1d674 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceUtilities.java @@ -79,13 +79,13 @@ public class ResourceUtilities { StringBuilder b = new StringBuilder(); for (OperationOutcomeIssueComponent t : error.getIssue()) { if (t.getSeverity() == IssueSeverity.ERROR) { - b.append("Error:" +gen(t.getDetails())+"\r\n"); + b.append("Error: " +gen(t.getDetails())+"\r\n"); } else if (t.getSeverity() == IssueSeverity.FATAL) { - b.append("Fatal:" +gen(t.getDetails())+"\r\n"); + b.append("Fatal: " +gen(t.getDetails())+"\r\n"); } else if (t.getSeverity() == IssueSeverity.WARNING) { - b.append("Warning:" +gen(t.getDetails())+"\r\n"); + b.append("Warning: " +gen(t.getDetails())+"\r\n"); } else if (t.getSeverity() == IssueSeverity.INFORMATION) { - b.append("Information:" +gen(t.getDetails())+"\r\n"); + b.append("Information: " +gen(t.getDetails())+"\r\n"); } } return b.toString(); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java index 714cf68e3..6b35dc6a7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java @@ -269,6 +269,8 @@ public class ToolingExtensions { public static final String EXT_ISSUE_SLICE_INFO = "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-slicetext"; public static final String EXT_ISSUE_SERVER = "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server"; public static final String EXT_WEB_SOURCE = "http://hl7.org/fhir/tools/StructureDefinition/web-source"; + public static final String EXT_APPLICABLE_VERSION = "http://hl7.org/fhir/StructureDefinition/version-specific-use"; + public static final String EXT_APPLICABLE_VERSION_VALUE = "http://hl7.org/fhir/StructureDefinition/version-specific-value"; // specific extension helpers diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/TranslatingUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/TranslatingUtilities.java deleted file mode 100644 index 093862a20..000000000 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/TranslatingUtilities.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.hl7.fhir.r5.utils; - -/* - 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. - - */ - - - - -import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.r5.model.PrimitiveType; - -public class TranslatingUtilities extends org.hl7.fhir.utilities.TranslatingUtilities { - - public interface TranslationServices extends org.hl7.fhir.utilities.TranslationServices { - String gt(@SuppressWarnings("rawtypes") PrimitiveType value); - String egt(@SuppressWarnings("rawtypes") Enumeration value); - } - - public String gt(@SuppressWarnings("rawtypes") PrimitiveType value) { - if (value == null || !value.hasPrimitiveValue()) { - return null; - } else { - return hasTranslator() ? ((TranslationServices) getTranslator()).gt(value) : value.asStringValue(); - } - } - - public String egt(@SuppressWarnings("rawtypes") Enumeration value) { - if (value == null || !value.hasPrimitiveValue()) { - return null; - } else { - return (value == null || !value.hasPrimitiveValue()) ? null : hasTranslator() ? ((TranslationServices) getTranslator()).egt(value) : value.asStringValue(); - } - } - - -} \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/XVerExtensionManager.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/XVerExtensionManager.java index db91c4f2d..f20ec8d91 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/XVerExtensionManager.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/XVerExtensionManager.java @@ -31,6 +31,8 @@ public class XVerExtensionManager { public static final String XVER_EXT_MARKER = "XVER_EXT_MARKER"; + public static final String XVER_VER_MARKER = "XVER_VER_MARKER"; + private Map lists = new HashMap<>(); private IWorkerContext context; @@ -92,6 +94,7 @@ public class XVerExtensionManager { StructureDefinition sd = new StructureDefinition(); sd.setUserData(XVER_EXT_MARKER, "true"); + sd.setUserData(XVER_VER_MARKER, verSource); if (context.getResourceNamesAsSet().contains(r)) { sd.setWebPath(Utilities.pathURL(context.getSpecUrl(), r.toLowerCase()+"-definitions.html#"+e)); } else { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/ResourceAddress.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/ResourceAddress.java index 6c9032bcc..2b0f59efd 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/ResourceAddress.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/ResourceAddress.java @@ -101,7 +101,7 @@ public class ResourceAddress { } public URI resolveOperationUri(Class resourceClass, String opName) { - return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) +"/"+opName); + return baseServiceUri.resolve(nameForClassWithSlash(resourceClass) +"$"+opName); } public URI resolveOperationUri(Class resourceClass, String opName, Map parameters) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/structuremap/StructureMapUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/structuremap/StructureMapUtilities.java index a9e67a7ed..12e5b7eef 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/structuremap/StructureMapUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/structuremap/StructureMapUtilities.java @@ -143,11 +143,11 @@ public class StructureMapUtilities { public static String render(StructureMap map) { StringBuilder b = new StringBuilder(); - b.append("map \""); - b.append(map.getUrl()); - b.append("\" = \""); - b.append(Utilities.escapeJson(map.getName())); - b.append("\"\r\n\r\n"); + b.append("/// url = \""+map.getUrl()+"\"\r\n"); + b.append("/// name = \""+map.getName()+"\"\r\n"); + b.append("/// title = \""+map.getTitle()+"\"\r\n"); + b.append("/// status = \""+map.getStatus().toCode()+"\"\r\n"); + b.append("\r\n"); if (map.getDescription() != null) { renderMultilineDoco(b, map.getDescription(), 0); b.append("\r\n"); @@ -385,7 +385,7 @@ public class StructureMapUtilities { for (int i = 0; i < indent; i++) b.append(' '); b.append("}"); - } else { + } else if (!canBeAbbreviated) { if (r.hasDependent()) { b.append(" then "); boolean first = true; @@ -450,7 +450,7 @@ public class StructureMapUtilities { return (r.getSource().size() == 1 && r.getSourceFirstRep().hasElement() && r.getSourceFirstRep().hasVariable()) && (r.getTarget().size() == 1 && r.getTargetFirstRep().hasVariable() && (r.getTargetFirstRep().getTransform() == null || r.getTargetFirstRep().getTransform() == StructureMapTransform.CREATE) && r.getTargetFirstRep().getParameter().size() == 0) && - (r.getDependent().size() == 0) && (r.getRule().size() == 0); + (r.getDependent().size() == 0 || (r.getDependent().size() == 1 && StructureMapUtilities.DEF_GROUP_NAME.equals(r.getDependentFirstRep().getName()))) && (r.getRule().size() == 0); } public static String sourceToString(StructureMapGroupRuleSourceComponent r) { @@ -655,6 +655,9 @@ public class StructureMapUtilities { case "title" : result.setTitle(lexer.readConstant("title")); break; + case "description" : + result.setTitle(lexer.readConstant("description")); + break; case "status" : result.setStatus(PublicationStatus.fromCode(lexer.readConstant("status"))); break; @@ -1101,7 +1104,7 @@ public class StructureMapUtilities { start = null; lexer.token("."); target.setElement(lexer.take()); - } + } String name; boolean isConstant = false; if (lexer.hasToken("=")) { @@ -1138,15 +1141,19 @@ public class StructureMapUtilities { } lexer.token(")"); } else if (name != null) { - target.setTransform(StructureMapTransform.COPY); - if (!isConstant) { - String id = name; - while (lexer.hasToken(".")) { - id = id + lexer.take() + lexer.take(); - } - target.addParameter().setValue(new IdType(id)); - } else - target.addParameter().setValue(readConstant(name, lexer)); + if (target.getContext() != null) { + target.setTransform(StructureMapTransform.COPY); + if (!isConstant) { + String id = name; + while (lexer.hasToken(".")) { + id = id + lexer.take() + lexer.take(); + } + target.addParameter().setValue(new IdType(id)); + } else + target.addParameter().setValue(readConstant(name, lexer)); + } else { + target.setContext(name); + } } if (lexer.hasToken("as")) { lexer.take(); @@ -1713,10 +1720,9 @@ public class StructureMapUtilities { Base dest = null; if (tgt.hasContext()) { dest = vars.get(VariableMode.OUTPUT, tgt.getContext()); - if (dest == null) - throw new FHIRException("Rule \"" + rulePath + "\": target context not known: " + tgt.getContext()); - if (!tgt.hasElement()) - throw new FHIRException("Rule \"" + rulePath + "\": Not supported yet"); + if (dest == null) { + throw new FHIRException("Rul \"" + rulePath + "\": target context not known: " + tgt.getContext()); + } } Base v = null; if (tgt.hasTransform()) { @@ -1735,8 +1741,10 @@ public class StructureMapUtilities { v = dest.makeProperty(tgt.getElement().hashCode(), tgt.getElement()); sharedVars.add(VariableMode.SHARED, tgt.getListRuleId(), v); } - } else { + } else if (tgt.hasElement()) { v = dest.makeProperty(tgt.getElement().hashCode(), tgt.getElement()); + } else { + v = dest; } } if (tgt.hasVariable() && v != null) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/validation/IResourceValidator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/validation/IResourceValidator.java index 837945ebb..aa465b531 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/validation/IResourceValidator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/validation/IResourceValidator.java @@ -34,6 +34,7 @@ import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat; import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.StructureDefinition; +import org.hl7.fhir.r5.model.UsageContext; import org.hl7.fhir.r5.utils.validation.constants.BestPracticeWarningLevel; import org.hl7.fhir.r5.utils.validation.constants.CheckDisplayOption; import org.hl7.fhir.r5.utils.validation.constants.IdStatus; @@ -105,6 +106,9 @@ public interface IResourceValidator { boolean isExample(); IResourceValidator setExample(boolean example); + // used to decide whether additional bindings, constraints etc apply + public List getUsageContexts(); + public boolean isWarnOnDraftOrExperimental(); public IResourceValidator setWarnOnDraftOrExperimental(boolean warnOnDraftOrExperimental); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/validation/IValidatorResourceFetcher.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/validation/IValidatorResourceFetcher.java index 51f2cc965..3f77597e6 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/validation/IValidatorResourceFetcher.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/validation/IValidatorResourceFetcher.java @@ -6,7 +6,9 @@ import org.hl7.fhir.r5.model.CanonicalResource; import java.io.IOException; import java.net.URISyntaxException; +import java.util.List; import java.util.Locale; +import java.util.Set; public interface IValidatorResourceFetcher { @@ -27,7 +29,7 @@ public interface IValidatorResourceFetcher { * @return an R5 version of the resource * @throws URISyntaxException */ - CanonicalResource fetchCanonicalResource(IResourceValidator validator, String url) throws URISyntaxException; + CanonicalResource fetchCanonicalResource(IResourceValidator validator, Object appContext, String url) throws URISyntaxException; /** * Whether to try calling fetchCanonicalResource for this reference (not whether it will succeed - just throw an exception from fetchCanonicalResource if it doesn't resolve. This is a policy thing. @@ -38,4 +40,6 @@ public interface IValidatorResourceFetcher { * @return */ boolean fetchesCanonicalResource(IResourceValidator validator, String url); + + Set fetchCanonicalResourceVersions(IResourceValidator validator, Object appContext, String url); } diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/BaseWorkerContextTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/BaseWorkerContextTests.java index 2fdd73e3e..da99ea473 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/BaseWorkerContextTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/BaseWorkerContextTests.java @@ -1,6 +1,7 @@ package org.hl7.fhir.r5.context; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CanonicalResource; import org.hl7.fhir.r5.model.PackageInformation; import org.hl7.fhir.r5.model.Parameters; import org.hl7.fhir.r5.model.Resource; @@ -16,6 +17,8 @@ import net.sourceforge.plantuml.tim.stdlib.GetVariableValue; import java.io.FileNotFoundException; import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -85,6 +88,11 @@ public class BaseWorkerContextTests { return null; } + @Override + public List fetchResourcesByUrl(Class class_, String url) { + return new ArrayList<>(); + } + }; baseWorkerContext.expParameters = new Parameters(); return baseWorkerContext; diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/SimpleWorkerContextTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/SimpleWorkerContextTests.java index 1170718e0..8e4523ea2 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/SimpleWorkerContextTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/context/SimpleWorkerContextTests.java @@ -123,6 +123,16 @@ public class SimpleWorkerContextTests { } } + public class CodingMatcher implements ArgumentMatcher { + final private Coding left; + + CodingMatcher(Coding left) { this.left = left; } + + public boolean matches(Coding right) { + return left.equalsShallow(right); + } + } + public class ParametersMatcher implements ArgumentMatcher { final private Parameters left; @@ -187,7 +197,7 @@ public class SimpleWorkerContextTests { assertEquals(expectedValidationResult, actualValidationResult); - Mockito.verify(valueSetCheckerSimple).validateCode("Coding", coding); + Mockito.verify(valueSetCheckerSimple).validateCode(eq("Coding"), argThat(new CodingMatcher(coding))); Mockito.verify(terminologyCache).getValidation(cacheToken); Mockito.verify(terminologyCache).cacheValidation(cacheToken, expectedValidationResult,false); } @@ -325,7 +335,7 @@ public class SimpleWorkerContextTests { ValueSetExpansionOutcome actualExpansionResult = context.expandVS(inc, true, false); - // assertEquals(expectedValueSet, actualExpansionResult.getValueset()); + assertEquals(expectedValueSet, actualExpansionResult.getValueset()); Mockito.verify(terminologyCache).getExpansion(cacheToken); Mockito.verify(terminologyCache).cacheExpansion(cacheToken, actualExpansionResult,true); @@ -412,7 +422,7 @@ public class SimpleWorkerContextTests { ValueSetExpansionOutcome actualExpansionResult = context.expandVS(vs, true, true, true, pIn, false); - // assertEquals(expectedValueSet, actualExpansionResult.getValueset()); + assertEquals(expectedValueSet, actualExpansionResult.getValueset()); Mockito.verify(terminologyCache).getExpansion(cacheToken); Mockito.verify(terminologyCache).cacheExpansion(cacheToken, actualExpansionResult, true); @@ -421,40 +431,37 @@ public class SimpleWorkerContextTests { @Test public void testInitializationWithCache() { -// String address = "/..."; -// -// Mockito.doReturn(true).when(terminologyCache).hasTerminologyCapabilities(address); -//// Mockito.doReturn(true).when(terminologyCache).hasCapabilityStatement(); -// -// Mockito.doReturn(terminologyCapabilities).when(terminologyCache).getTerminologyCapabilities(address); -//// Mockito.doReturn(capabilitiesStatement).when(terminologyCache).getCapabilityStatement(); -// -// context.connectToTSServer(new TerminologyClientR5Factory(), terminologyClient); -// -// Mockito.verify(terminologyCache).getTerminologyCapabilities(address); -// Mockito.verify(terminologyClient).getCapabilitiesStatementQuick(); -// -// Mockito.verify(terminologyCache, times(0)).getCapabilityStatement(address); -// Mockito.verify(terminologyClient, times(0)).getTerminologyCapabilities(); + String address = "dummyUrl"; + + Mockito.doReturn(true).when(terminologyCache).hasTerminologyCapabilities(address); + + Mockito.doReturn(terminologyCapabilities).when(terminologyCache).getTerminologyCapabilities(address); + + context.connectToTSServer(new TerminologyClientR5Factory(), terminologyClient); + + Mockito.verify(terminologyCache).getTerminologyCapabilities(address); + Mockito.verify(terminologyClient).getCapabilitiesStatementQuick(); + + Mockito.verify(terminologyCache, times(0)).getCapabilityStatement(address); + Mockito.verify(terminologyClient, times(0)).getTerminologyCapabilities(); } @Test public void testInitializationWithClient() { -// String address = "/..."; -// -// Mockito.doReturn(false).when(terminologyCache).hasTerminologyCapabilities(address); -//// Mockito.doReturn(false).when(terminologyCache).hasCapabilityStatement(); -// -// Mockito.doReturn(terminologyCapabilities).when(terminologyClient).getTerminologyCapabilities(); -// Mockito.doReturn(capabilitiesStatement).when(terminologyClient).getCapabilitiesStatementQuick(); -// -// context.connectToTSServer(new TerminologyClientR5Factory(), terminologyClient); -// -// Mockito.verify(terminologyCache, times(0)).getTerminologyCapabilities(address); -// Mockito.verify(terminologyCache, times(0)).getCapabilityStatement(address); -// -// Mockito.verify(terminologyClient).getTerminologyCapabilities(); -// Mockito.verify(terminologyClient).getCapabilitiesStatementQuick(); + String address = "dummyUrl"; + + Mockito.doReturn(false).when(terminologyCache).hasTerminologyCapabilities(address); + + Mockito.doReturn(terminologyCapabilities).when(terminologyClient).getTerminologyCapabilities(); + Mockito.doReturn(capabilitiesStatement).when(terminologyClient).getCapabilitiesStatementQuick(); + + context.connectToTSServer(new TerminologyClientR5Factory(), terminologyClient); + + Mockito.verify(terminologyCache, times(0)).getTerminologyCapabilities(address); + Mockito.verify(terminologyCache, times(0)).getCapabilityStatement(address); + + Mockito.verify(terminologyClient).getTerminologyCapabilities(); + Mockito.verify(terminologyClient).getCapabilitiesStatementQuick(); } diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/r5/test/GeneralTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/GeneralTests.java similarity index 100% rename from org.hl7.fhir.validation/src/test/java/org/hl7/fhir/r5/test/GeneralTests.java rename to org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/GeneralTests.java diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/StructureMapUtilitiesTest.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/StructureMapUtilitiesTest.java index 3b49fbe32..bec404a62 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/StructureMapUtilitiesTest.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/StructureMapUtilitiesTest.java @@ -59,7 +59,7 @@ public class StructureMapUtilitiesTest implements ITransformerServices { private void assertSerializeDeserialize(StructureMap structureMap) { Assertions.assertEquals("syntax", structureMap.getName()); - Assertions.assertEquals("Title of this map\r\nAuthor", structureMap.getDescription()); + Assertions.assertEquals("description", structureMap.getDescription()); Assertions.assertEquals("http://github.com/FHIR/fhir-test-cases/r5/fml/syntax", structureMap.getUrl()); Assertions.assertEquals("Patient", structureMap.getStructure().get(0).getAlias()); Assertions.assertEquals("http://hl7.org/fhir/StructureDefinition/Patient", structureMap.getStructure().get(0).getUrl()); diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/TurtleGeneratorTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/TurtleGeneratorTests.java new file mode 100644 index 000000000..7ac92346e --- /dev/null +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/TurtleGeneratorTests.java @@ -0,0 +1,199 @@ +package org.hl7.fhir.r5.test; + +import java.io.InputStream; +import java.io.OutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.FileSystems; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Properties; + +import org.fhir.ucum.UcumException; +import org.hl7.fhir.r5.conformance.profile.ProfileUtilities; +import org.hl7.fhir.r5.context.IWorkerContext; +import org.hl7.fhir.r5.elementmodel.Element; +import org.hl7.fhir.r5.elementmodel.Manager; +import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat; +import org.hl7.fhir.r5.elementmodel.ResourceParser; +import org.hl7.fhir.r5.elementmodel.TurtleParser; +import org.hl7.fhir.r5.elementmodel.XmlParser; +import org.hl7.fhir.r5.formats.IParser.OutputStyle; +import org.hl7.fhir.r5.model.Resource; +import org.hl7.fhir.r5.test.utils.TestingUtilities; +import org.hl7.fhir.utilities.validation.ValidationMessage; + +import org.hl7.fhir.utilities.turtle.Turtle; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * TurtleGeneratorTests + * Generates turtle files from specified resources, including example "instances" + * Unit tests for the generated turtle files + * For generic RDF parsing tests, see `TurtleTests.java` + * For ShEx validation tests, see `ShExGeneratorTests.java` + * Author: Tim Prudhomme + */ +public class TurtleGeneratorTests { + + private static IWorkerContext workerContext; + private static ResourceParser resourceParser; + private static XmlParser xmlParser; + private static TurtleParser turtleParser; + + private static Path inputXmlDirectory; + private static Path outputTurtleDirectory; + + @BeforeAll + public static void setup() throws IOException { + workerContext = TestingUtilities.getSharedWorkerContext(); + resourceParser = new org.hl7.fhir.r5.elementmodel.ResourceParser(workerContext); + xmlParser = (XmlParser) Manager.makeParser(workerContext, FhirFormat.XML); + turtleParser = (TurtleParser) Manager.makeParser(workerContext, FhirFormat.TURTLE); + + // Temporary directory of files that should be discarded after testing + outputTurtleDirectory = FileSystems.getDefault().getPath(System.getProperty("java.io.tmpdir")); + + // Directory of XML files used for generating Turtle files + String currentDirectory = System.getProperty("user.dir"); + inputXmlDirectory = FileSystems.getDefault().getPath(currentDirectory, "src", "test", "resources", "testUtilities", "xml", "examples"); + } + + @Test + public void testExamples() throws IOException, UcumException { + var exampleInstanceName = "codesystem-contact-point-use"; + testInstanceGeneration(exampleInstanceName); + } + + @Disabled("TODO this doesn't pass due to existing issues in R5 RDF") + @Test + public void testProfiles() throws IOException, UcumException { + var profileName = "Encounter"; + testClassGeneration(profileName); + } + + @Disabled("Run manually for testing with XML resources generated from FHIR specification publishing library") + @Test + public void testPublishedExamples() throws IOException, UcumException { + inputXmlDirectory = getPublishedXmlDirectory(); + var exampleInstanceName = "codesystem-contact-point-use"; + testInstanceGeneration(exampleInstanceName); + } + + /* + * Generate a Turtle file from the name of an XML resource, then parse it + */ + private void testInstanceGeneration(String resourceName) throws IOException, UcumException { + // Generate Turtle + var generatedTurtleFilePath = generateTurtleFromResourceName(resourceName, inputXmlDirectory, outputTurtleDirectory); + // Try parsing again ("round-trip test") -- this only tests for valid RDF + parseGeneratedTurtle(generatedTurtleFilePath); + } + + /* + * Generate a Turtle file from the name of a profile, then parse it + */ + private void testClassGeneration(String profileName) throws IOException, UcumException { + var generatedTurtleFilePath = generateTurtleClassFromProfileName(profileName); + // Try parsing again ("round-trip test") -- this only tests for valid RDF + parseGeneratedTurtle(generatedTurtleFilePath); + } + + private void parseGeneratedTurtle(String generatedTurtleFilePath) throws IOException { + try ( + InputStream turtleStream = new FileInputStream(generatedTurtleFilePath); + ) { + var generatedTurtleString = new String(turtleStream.readAllBytes()); + Turtle ttl = new Turtle(); + ttl.parse(generatedTurtleString); + } + } + + /** + * Generate a Turtle version of a resource, given its name, input directory of its XML source, and output directory of the Turtle file + * @return the path of the generated Turtle file + */ + private String generateTurtleFromResourceName(String resourceName, Path inputXmlDirectory, Path outputTurtleDirectory) throws IOException, UcumException { + // Specify source xml path and destination turtle path + var xmlFilePath = inputXmlDirectory.resolve(resourceName + ".xml").toString(); + var turtleFilePath = outputTurtleDirectory.resolve(resourceName + ".ttl").toString(); + try ( + InputStream inputXmlStream = new FileInputStream(xmlFilePath); + OutputStream outputTurtleStream = new FileOutputStream(turtleFilePath); + ) { + // print out file names using string interpolation + System.out.println("Generating " + turtleFilePath); + generateTurtleFromXmlStream(inputXmlStream, outputTurtleStream); + return turtleFilePath; + } + } + + /** + * Generate a Turtle file from an XML resource + */ + private void generateTurtleFromXmlStream(InputStream xmlStream, OutputStream turtleStream) throws IOException, UcumException { + var errorList = new ArrayList(); + Element resourceElement = xmlParser.parseSingle(xmlStream, errorList); + turtleParser.compose(resourceElement, turtleStream, OutputStyle.PRETTY, null); + // Check errors + for (ValidationMessage m : errorList) { + System.out.println(m.getDisplay()); + } + } + + /** + * Generate a Turtle file from an org.hl7.fhir.r5.model.Resource profile + * @return the path of the generated Turtle file + */ + private String generateTurtleClassFromProfileName(String profileName) throws IOException, UcumException { + String resourceUri = ProfileUtilities.sdNs(profileName, null); + Resource resource = workerContext.fetchResource(Resource.class, resourceUri); + Element resourceElement = resourceParser.parse(resource); + var turtleFilePath = outputTurtleDirectory.resolve(profileName + ".ttl").toString(); + try (OutputStream outputStream = new FileOutputStream(turtleFilePath)) { + turtleParser.compose(resourceElement, outputStream, OutputStyle.PRETTY, null); + return turtleFilePath; + } + } + + /** + * Generate a Turtle file from a "test case" resource -- those only available on https://github.com/FHIR/fhir-test-cases/ + * @return the path of the generated Turtle file + */ + private String generateTurtleFromTestCaseResource(String resourceName) throws IOException, UcumException { + var turtleFilePath = outputTurtleDirectory.resolve(resourceName + ".ttl").toString(); + try ( + // Follows pattern in `TestingUtilities.java` + InputStream inputXmlStream = TestingUtilities.loadTestResourceStream("r5", resourceName + ".xml"); + OutputStream outputTurtleStream = new FileOutputStream(turtleFilePath); + ) { + generateTurtleFromXmlStream(inputXmlStream, outputTurtleStream); + return turtleFilePath; + } + } + + + /** + * This could be the "publish" directory of XML resources built using the FHIR specification publishing library. + * Use this for testing with other generated XML resources + */ + private static Path getPublishedXmlDirectory() throws IOException { + Properties properties = new Properties(); + String currentDirectory = System.getProperty("user.dir"); + // Add your directory path to "org.hl7.fhir.r5/src/test/resources/local.properties" + String localPropertiesPath = FileSystems.getDefault().getPath(currentDirectory, "src", "test", "resources", "local.properties").toString(); + try (FileInputStream input = new FileInputStream(localPropertiesPath)) { + properties.load(input); + } catch (IOException e) { + // You should create this local.properties file if it doesn't exist. It should already be listed in .gitignore. + e.printStackTrace(); + throw e; + } + var filePath = properties.getProperty("xmlResourceDirectory"); + return FileSystems.getDefault().getPath(filePath); + } +} diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/utils/ResourceLanguageFileBuilderTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/utils/ResourceLanguageFileBuilderTests.java index e1f1cfa40..2f4b7e0ca 100644 --- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/utils/ResourceLanguageFileBuilderTests.java +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/utils/ResourceLanguageFileBuilderTests.java @@ -24,7 +24,7 @@ public class ResourceLanguageFileBuilderTests { ctxt.cacheResource(new JsonParser().parse(TestingUtilities.loadTestResourceStream("r5", "languages", "StructureDefinition-ed-translatable.json"))); ctxt.cacheResource(new JsonParser().parse(TestingUtilities.loadTestResourceStream("r5", "languages", "StructureDefinition-sd-translatable.json"))); lang.setProfile(ctxt.fetchResource(StructureDefinition.class, "http://hl7.org/tests/fhir/StructureDefinition/sd-translatable")); - lang.prepare(new XLIFFProducer(Utilities.path("[tmp]", "language")), ctxt, "en", "fr"); + lang.prepare(new XLIFFProducer("[tmp]", "language", false), ctxt, "en", "fr"); lang.build(res); } diff --git a/org.hl7.fhir.r5/src/test/resources/testUtilities/xml/examples/codesystem-contact-point-use.xml b/org.hl7.fhir.r5/src/test/resources/testUtilities/xml/examples/codesystem-contact-point-use.xml new file mode 100644 index 000000000..f21d99431 --- /dev/null +++ b/org.hl7.fhir.r5/src/test/resources/testUtilities/xml/examples/codesystem-contact-point-use.xml @@ -0,0 +1,134 @@ + + + + + + + + + +
+

This case-sensitive code system + http://hl7.org/fhir/contact-point-use defines the following codes: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Code + + Display + + Definition +
home + + HomeA communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available.
work + + WorkAn office contact point. First choice for business related contacts during business hours.
temp + + TempA temporary contact point. The period can provide more detailed information.
old + + OldThis contact point is no longer in use (or was never correct, but retained for records).
mobile + + MobileA telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business.
+
+
+ + + + + + + + + + + + + + + + + + + + + <status value="active"/> + <experimental value="false"/> + <date value="2023-10-03T22:51:29-04:00"/> + <publisher value="HL7 (FHIR Project)"/> + <contact> + <telecom> + <system value="url"/> + <value value="http://hl7.org/fhir"/> + </telecom> + <telecom> + <system value="email"/> + <value value="fhir@lists.hl7.org"/> + </telecom> + </contact> + <description value="Use of contact point."/> + <jurisdiction> + <coding> + <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/> + <code value="001"/> + <display value="World"/> + </coding> + </jurisdiction> + <caseSensitive value="true"/> + <valueSet value="http://hl7.org/fhir/ValueSet/contact-point-use"/> + <content value="complete"/> + <concept> + <code value="home"/> + <display value="Home"/> + <definition value="A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available."/> + </concept> + <concept> + <code value="work"/> + <display value="Work"/> + <definition value="An office contact point. First choice for business related contacts during business hours."/> + </concept> + <concept> + <code value="temp"/> + <display value="Temp"/> + <definition value="A temporary contact point. The period can provide more detailed information."/> + </concept> + <concept> + <code value="old"/> + <display value="Old"/> + <definition value="This contact point is no longer in use (or was never correct, but retained for records)."/> + </concept> + <concept> + <code value="mobile"/> + <display value="Mobile"/> + <definition value="A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business."/> + </concept> +</CodeSystem> \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/version.ctl b/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/version.ctl index e440e5c84..bf0d87ab1 100644 --- a/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/version.ctl +++ b/org.hl7.fhir.r5/src/test/resources/txCache/org.hl7.fhir.r5/version.ctl @@ -1 +1 @@ -3 \ No newline at end of file +4 \ No newline at end of file diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index ecb53a8fc..60f586530 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>org.hl7.fhir.core</artifactId> - <version>6.2.14-SNAPSHOT</version> + <version>6.3.4-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index cf41d0b15..130d83b88 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>org.hl7.fhir.core</artifactId> - <version>6.2.14-SNAPSHOT</version> + <version>6.3.4-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/CommaSeparatedStringBuilder.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/CommaSeparatedStringBuilder.java index 7cdc295b7..f07277d0e 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/CommaSeparatedStringBuilder.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/CommaSeparatedStringBuilder.java @@ -1,8 +1,11 @@ package org.hl7.fhir.utilities; import java.util.Collection; +import java.util.EnumSet; import java.util.List; import java.util.Set; + + import java.util.ArrayList; import java.util.HashSet; @@ -161,4 +164,22 @@ public class CommaSeparatedStringBuilder { } return res; } + + public static String joinWrapped(String sep, String leftWrap, String rightWrap, Collection<String> list) { + CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(sep); + for (String s : list) { + if (s != null) { + b.append(leftWrap+s+rightWrap); + } + } + return b.toString(); + } + + public static String join(String sep, EnumSet<? extends Enum> set) { + CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(sep); + for (Enum e : set) { + b.append(e.toString()); + } + return b.toString(); + } } \ No newline at end of file diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/FhirPublication.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/FhirPublication.java index 33fc9e451..751fead07 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/FhirPublication.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/FhirPublication.java @@ -39,7 +39,7 @@ public enum FhirPublication { case DSTU1: return "0.01"; case DSTU2: return "1.0.2"; case DSTU2016May: return "1.4.0"; - case STU3: return "3.0.1"; + case STU3: return "3.0.2"; case R4: return "4.0.1"; case R4B: return "4.3.0"; case R5: return "5.0.0"; diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java index 61ce5147b..74ce1b74f 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java @@ -932,6 +932,15 @@ public class Utilities { return true; return false; } + + public static boolean existsInListTrimmed(String value, String... array) { + if (value == null) + return false; + for (String s : array) + if (value.equals(s.trim())) + return true; + return false; + } public static boolean existsInList(int value, int... array) { for (int i : array) @@ -2226,4 +2235,11 @@ public class Utilities { return true; } + public static String stripEoln(String text) { + if (text == null) { + return ""; + } + return text.replace("\r\n", " ").replace("\n", " ").replace("\r", " "); + } + } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java index 1a6521155..905d56c25 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java @@ -284,8 +284,15 @@ public class VersionUtilities { } public static String getMajMin(String version) { - if (version == null) + if (version == null) { return null; + } + if (version.startsWith("http://hl7.org/fhir/")) { + version = version.substring(20); + if (version.contains("/")) { + version = version.substring(0, version.indexOf("/")); + } + } if (Utilities.charCount(version, '.') == 1) { String[] p = version.split("\\."); @@ -293,8 +300,8 @@ public class VersionUtilities { } else if (Utilities.charCount(version, '.') == 2) { String[] p = version.split("\\."); return p[0]+"."+p[1]; - } else if (Utilities.existsInList(version, "R2", "R2B", "R3", "R4", "R4B", "R5", "R6")) { - switch (version) { + } else if (Utilities.existsInList(version.toUpperCase(), "R2", "R2B", "R3", "R4", "R4B", "R5", "R6")) { + switch (version.toUpperCase()) { case "R2": return "1.0"; case "R2B": return "1.4"; case "R3": return "3.0"; @@ -696,7 +703,11 @@ public class VersionUtilities { } public static String getNameForVersion(String v) { - switch (getMajMin(v)) { + String mm = getMajMin(v); + if (mm == null) { + throw new Error("Unable to determine version for '"+v+"'"); + } + switch (mm) { case "1.0" : return "R2"; case "1.4" : return "R2B"; case "3.0" : return "R3"; @@ -729,5 +740,15 @@ public class VersionUtilities { } } + public static boolean includedInRange(String startVer, String stopVer, String ver) { + if (ver.equals(startVer)) { + return true; + } + if (ver.equals(stopVer)) { + return true; + } + return startVer.compareTo(ver) < 0 && stopVer.compareTo(ver) > 0; + } + } \ No newline at end of file diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/ZipGenerator.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/ZipGenerator.java index ce63c59be..592597947 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/ZipGenerator.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/ZipGenerator.java @@ -94,52 +94,59 @@ public class ZipGenerator { } public void addFolder(String actualDir, String statedDir, boolean omitIfExists) throws IOException { - File fd = new CSFile(actualDir); - String files[] = fd.list(); - for (String f : files) { - if (new CSFile(Utilities.path(actualDir, f)).isDirectory()) - addFolder(Utilities.path(actualDir, f), Utilities.pathURL(statedDir, f), omitIfExists); - else - addFileName(Utilities.pathURL(statedDir, f), Utilities.path(actualDir, f), omitIfExists); - } + File fd = new CSFile(actualDir); + String files[] = fd.list(); + for (String f : files) { + if (!".DS_Store".equals(f)) { + if (new CSFile(Utilities.path(actualDir, f)).isDirectory()) + addFolder(Utilities.path(actualDir, f), Utilities.pathURL(statedDir, f), omitIfExists); + else + addFileName(Utilities.pathURL(statedDir, f), Utilities.path(actualDir, f), omitIfExists); + } + } } public void addFolder(String actualDir, String statedDir, boolean omitIfExists, String noExt) throws IOException { File fd = new CSFile(actualDir); String files[] = fd.list(); for (String f : files) { - if (new CSFile(Utilities.path(actualDir, f)).isDirectory()) - addFolder(Utilities.path(actualDir, f), Utilities.pathURL(statedDir, f), omitIfExists, noExt); - else if (noExt == null || !f.endsWith(noExt)) - addFileName(Utilities.pathURL(statedDir, f), Utilities.path(actualDir, f), omitIfExists); + if (!".DS_Store".equals(f)) { + if (new CSFile(Utilities.path(actualDir, f)).isDirectory()) + addFolder(Utilities.path(actualDir, f), Utilities.pathURL(statedDir, f), omitIfExists, noExt); + else if (noExt == null || !f.endsWith(noExt)) + addFileName(Utilities.pathURL(statedDir, f), Utilities.path(actualDir, f), omitIfExists); + } } } - public void addFiles(String actualDir, String statedDir, String ext, String noExt) throws FileNotFoundException, IOException { - byte data[] = new byte[BUFFER]; - statedDir = statedDir.replace("\\", "/"); - File f = new CSFile(actualDir); + public void addFiles(String actualDir, String statedDir, String ext, String noExt) throws FileNotFoundException, IOException { + byte data[] = new byte[BUFFER]; + statedDir = statedDir.replace("\\", "/"); + File f = new CSFile(actualDir); - String files[] = f.list(); - if (files == null) { + String files[] = f.list(); + if (files == null) { System.out.println("no files found in "+f.getName()); - } else { - for (int i = 0; i < files.length; i++) { - if ( new CSFile(actualDir + files[i]).isFile() && ((ext == null || files[i].endsWith(ext)) && (noExt == null || !files[i].endsWith(noExt)))) { - FileInputStream fi = new FileInputStream(actualDir + files[i]); - BufferedInputStream origin = new BufferedInputStream(fi, BUFFER); - ZipEntry entry = new ZipEntry(statedDir + files[i]); - names.add(statedDir + files[i]); - out.putNextEntry(entry); - int count; - while ((count = origin.read(data, 0, BUFFER)) != -1) { - out.write(data, 0, count); - } - origin.close(); - } - } - } - } + } else { + for (int i = 0; i < files.length; i++) { + if (!".DS_Store".equals(files[i])) { + String fn = Utilities.path(actualDir, files[i]); + if ( new CSFile(fn).isFile() && ((ext == null || files[i].endsWith(ext)) && (noExt == null || !files[i].endsWith(noExt)))) { + FileInputStream fi = new FileInputStream(fn); + BufferedInputStream origin = new BufferedInputStream(fi, BUFFER); + ZipEntry entry = new ZipEntry(statedDir + files[i]); + names.add(statedDir + files[i]); + out.putNextEntry(entry); + int count; + while ((count = origin.read(data, 0, BUFFER)) != -1) { + out.write(data, 0, count); + } + origin.close(); + } + } + } + } + } public void addFilesFiltered(String actualDir, String statedDir, String ext, String[] noExt) throws FileNotFoundException, IOException { byte data[] = new byte[BUFFER]; @@ -148,28 +155,30 @@ public class ZipGenerator { String files[] = f.list(); for (int i = 0; i < files.length; i++) { - if ( new CSFile(actualDir + files[i]).isFile() && ((ext == null || files[i].endsWith(ext)))) { - boolean ok = true; - for (String n : noExt) { - ok = ok && !files[i].endsWith(n); - } - if (ok) { - FileInputStream fi = new FileInputStream(actualDir + files[i]); - BufferedInputStream origin = new BufferedInputStream(fi, BUFFER); - ZipEntry entry = new ZipEntry(statedDir + files[i]); - names.add(statedDir + files[i]); - out.putNextEntry(entry); - int count; - while ((count = origin.read(data, 0, BUFFER)) != -1) { - out.write(data, 0, count); + if (!".DS_Store".equals(files[i])) { + if ( new CSFile(actualDir + files[i]).isFile() && ((ext == null || files[i].endsWith(ext)))) { + boolean ok = true; + for (String n : noExt) { + ok = ok && !files[i].endsWith(n); + } + if (ok) { + FileInputStream fi = new FileInputStream(actualDir + files[i]); + BufferedInputStream origin = new BufferedInputStream(fi, BUFFER); + ZipEntry entry = new ZipEntry(statedDir + files[i]); + names.add(statedDir + files[i]); + out.putNextEntry(entry); + int count; + while ((count = origin.read(data, 0, BUFFER)) != -1) { + out.write(data, 0, count); + } + origin.close(); } - origin.close(); } } } } - public void addFileSource(String path, String cnt, boolean omitIfExists) throws IOException { + public void addFileSource(String path, String cnt, boolean omitIfExists) throws IOException { File tmp = Utilities.createTempFile("tmp", ".tmp"); TextFile.stringToFile(cnt, tmp.getAbsolutePath()); addFileName(path, tmp.getAbsolutePath(), omitIfExists); diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java index 246ea1f91..592723666 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java @@ -21,7 +21,7 @@ public abstract class I18nBase { public static final String PLURAL_SUFFIX = "PLURAL"; public static final String KEY_DELIMITER = "_"; private Locale locale; - private ResourceBundle i18nMessages; + private ResourceBundle messages; private PluralRules pluralRules; private boolean warnAboutMissingMessages = true; @@ -42,7 +42,7 @@ public abstract class I18nBase { * Verifies if a {@link ResourceBundle} has been loaded for the current {@link Locale}. If not, it triggers a load. */ private void checkResourceBundleIsLoaded() { - if (i18nMessages == null) { + if (messages == null) { setValidationMessageLanguage(getLocale()); } } @@ -74,7 +74,7 @@ public abstract class I18nBase { } protected boolean messageKeyExistsForLocale(String message) { - return i18nMessages.containsKey(message); + return messages.containsKey(message); } @@ -113,9 +113,9 @@ public abstract class I18nBase { String message = theMessage; if (messageExistsForLocale(theMessage, (theMessageArguments != null && theMessageArguments.length > 0))) { if (Objects.nonNull(theMessageArguments) && theMessageArguments.length > 0) { - message = MessageFormat.format(i18nMessages.getString(theMessage).trim(), theMessageArguments); + message = MessageFormat.format(messages.getString(theMessage).trim(), theMessageArguments); } else { - message = i18nMessages.getString(theMessage).trim(); + message = messages.getString(theMessage).trim(); } } return message; @@ -152,7 +152,11 @@ public abstract class I18nBase { * @param locale {@link Locale} to load resources for. */ public void setValidationMessageLanguage(Locale locale) { - i18nMessages = ResourceBundle.getBundle("Messages", locale); + messages = ResourceBundle.getBundle(getMessagesSourceFileName(), locale); + } + + protected String getMessagesSourceFileName() { + return "Messages"; } public void setPluralRules(Locale locale) { diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java index 661b7fb71..2364dce33 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java @@ -551,6 +551,8 @@ public class I18nConstants { public static final String TYPE_SPECIFIC_CHECKS_DT_URI_UUID = "Type_Specific_Checks_DT_URI_UUID"; public static final String TYPE_SPECIFIC_CHECKS_DT_URI_WS = "Type_Specific_Checks_DT_URI_WS"; public static final String TYPE_SPECIFIC_CHECKS_DT_URL_RESOLVE = "Type_Specific_Checks_DT_URL_Resolve"; + public static final String TYPE_SPECIFIC_CHECKS_DT_XHTML_RESOLVE = "Type_Specific_Checks_DT_XHTML_Resolve"; + public static final String TYPE_SPECIFIC_CHECKS_DT_XHTML_RESOLVE_IMG = "Type_Specific_Checks_DT_XHTML_Resolve_Img"; public static final String TYPE_SPECIFIC_CHECKS_DT_URL_EXAMPLE = "TYPE_SPECIFIC_CHECKS_DT_URL_EXAMPLE"; public static final String TYPE_SPECIFIC_CHECKS_DT_CANONICAL_TYPE = "TYPE_SPECIFIC_CHECKS_DT_CANONICAL_TYPE"; public static final String TYPE_SPECIFIC_CHECKS_DT_CANONICAL_RESOLVE = "TYPE_SPECIFIC_CHECKS_DT_CANONICAL_RESOLVE"; @@ -1048,6 +1050,58 @@ public class I18nConstants { public static final String SD_CONTEXT_SHOULD_NOT_BE_FHIRPATH = "SD_CONTEXT_SHOULD_NOT_BE_FHIRPATH"; public static final String TX_GENERAL_CC_ERROR_MESSAGE = "TX_GENERAL_CC_ERROR_MESSAGE"; public static final String FHIRPATH_UNKNOWN_EXTENSION = "FHIRPATH_UNKNOWN_EXTENSION"; + public static final String TYPE_SPECIFIC_CHECKS_DT_XHTML_MULTIPLE_MATCHES = "TYPE_SPECIFIC_CHECKS_DT_XHTML_MULTIPLE_MATCHES"; + public static final String CONTAINED_ORPHAN_DOM3 = "CONTAINED_ORPHAN_DOM3"; + public static final String VALUESET_INCLUDE_CS_NOT_CS = "VALUESET_INCLUDE_CS_NOT_CS"; + public static final String VALUESET_INCLUDE_CS_NOT_FOUND = "VALUESET_INCLUDE_CS_NOT_FOUND"; + public static final String VALUESET_INCLUDE_CSVER_NOT_FOUND = "VALUESET_INCLUDE_CSVER_NOT_FOUND"; + public static final String VALUESET_INCLUDE_CS_MULTI_FOUND = "VALUESET_INCLUDE_CS_MULTI_FOUND"; + public static final String VALUESET_INCLUDE_CSVER_MULTI_FOUND = "VALUESET_INCLUDE_CSVER_MULTI_FOUND"; + public static final String UNABLE_TO_INFER_CODESYSTEM = "UNABLE_TO_INFER_CODESYSTEM"; + public static final String CODE_CASE_DIFFERENCE = "CODE_CASE_DIFFERENCE"; + public static final String ILLEGAL_PROPERTY = "ILLEGAL_PROPERTY"; + public static final String VALUESET_INCLUDE_SYSTEM_ABSOLUTE = "VALUESET_INCLUDE_SYSTEM_ABSOLUTE"; + public static final String VALUESET_INCLUDE_SYSTEM_ABSOLUTE_FRAG = "VALUESET_INCLUDE_SYSTEM_ABSOLUTE_FRAG"; + public static final String CODESYSTEM_CS_NO_VS_SUPPLEMENT1 = "CODESYSTEM_CS_NO_VS_SUPPLEMENT1"; + public static final String CODESYSTEM_CS_NO_VS_SUPPLEMENT2 = "CODESYSTEM_CS_NO_VS_SUPPLEMENT2"; + public static final String CODESYSTEM_CS_SUPP_NO_SUPP = "CODESYSTEM_CS_SUPP_NO_SUPP"; + public static final String VALUESET_INCLUDE_CS_CONTENT = "VALUESET_INCLUDE_CS_CONTENT"; + public static final String VALUESET_INCLUDE_CSVER_CONTENT = "VALUESET_INCLUDE_CSVER_CONTENT"; + public static final String VALUESET_INCLUDE_CS_SUPPLEMENT = "VALUESET_INCLUDE_CS_SUPPLEMENT"; + public static final String VALUESET_INCLUDE_CSVER_SUPPLEMENT = "VALUESET_INCLUDE_CSVER_SUPPLEMENT"; + public static final String CODESYSTEM_SUPP_NO_DISPLAY = "CODESYSTEM_SUPP_NO_DISPLAY"; + public static final String CODESYSTEM_NOT_CONTAINED = "CODESYSTEM_NOT_CONTAINED"; + public static final String CODESYSTEM_THO_CHECK = "CODESYSTEM_THO_CHECK"; + public static final String TYPE_SPECIFIC_CHECKS_DT_CANONICAL_MULTIPLE_POSSIBLE_VERSIONS = "TYPE_SPECIFIC_CHECKS_DT_CANONICAL_MULTIPLE_POSSIBLE_VERSIONS"; + public static final String CODESYSTEM_PROPERTY_DUPLICATE_URI = "CODESYSTEM_PROPERTY_DUPLICATE_URI"; + public static final String CODESYSTEM_PROPERTY_BAD_HL7_URI = "CODESYSTEM_PROPERTY_BAD_HL7_URI"; + public static final String CODESYSTEM_PROPERTY_SYNONYM_CHECK = "CODESYSTEM_PROPERTY_SYNONYM_CHECK"; + public static final String CODESYSTEM_PROPERTY_DUPLICATE_CODE = "CODESYSTEM_PROPERTY_DUPLICATE_CODE"; + public static final String CODESYSTEM_PROPERTY_URI_CODE_MISMATCH = "CODESYSTEM_PROPERTY_URI_CODE_MISMATCH"; + public static final String CODESYSTEM_PROPERTY_URI_TYPE_MISMATCH = "CODESYSTEM_PROPERTY_URI_TYPE_MISMATCH"; + public static final String CODESYSTEM_PROPERTY_UNKNOWN_CODE = "CODESYSTEM_PROPERTY_UNKNOWN_CODE"; + public static final String CODESYSTEM_PROPERTY_KNOWN_CODE_SUGGESTIVE = "CODESYSTEM_PROPERTY_KNOWN_CODE_SUGGESTIVE"; + public static final String CODESYSTEM_PROPERTY_CODE_TYPE_MISMATCH = "CODESYSTEM_PROPERTY_CODE_TYPE_MISMATCH"; + public static final String CODESYSTEM_PROPERTY_UNDEFINED = "CODESYSTEM_PROPERTY_UNDEFINED"; + public static final String CODESYSTEM_PROPERTY_NO_VALUE = "CODESYSTEM_PROPERTY_NO_VALUE"; + public static final String CODESYSTEM_PROPERTY_WRONG_TYPE = "CODESYSTEM_PROPERTY_WRONG_TYPE"; + public static final String CODESYSTEM_DESIGNATION_DISP_CLASH_NO_LANG = "CODESYSTEM_DESIGNATION_DISP_CLASH_NO_LANG"; + public static final String CODESYSTEM_DESIGNATION_DISP_CLASH_LANG = "CODESYSTEM_DESIGNATION_DISP_CLASH_LANG"; + public static final String VALUESET_UNKNOWN_FILTER_PROPERTY_NO_CS = "VALUESET_UNKNOWN_FILTER_PROPERTY_NO_CS"; + public static final String VALUESET_UNKNOWN_FILTER_PROPERTY = "VALUESET_UNKNOWN_FILTER_PROPERTY"; + public static final String VALUESET_BAD_FILTER_VALUE_BOOLEAN = "VALUESET_BAD_FILTER_VALUE_BOOLEAN"; + public static final String VALUESET_BAD_FILTER_VALUE_CODE = "VALUESET_BAD_FILTER_VALUE_CODE"; + public static final String VALUESET_BAD_FILTER_VALUE_DATETIME = "VALUESET_BAD_FILTER_VALUE_DATETIME"; + public static final String VALUESET_BAD_FILTER_VALUE_DECIMAL = "VALUESET_BAD_FILTER_VALUE_DECIMAL"; + public static final String VALUESET_BAD_FILTER_VALUE_INTEGER = "VALUESET_BAD_FILTER_VALUE_INTEGER"; + public static final String VALUESET_BAD_FILTER_VALUE_VALID_CODE = "VALUESET_BAD_FILTER_VALUE_VALID_CODE"; + public static final String VALUESET_BAD_FILTER_VALUE_CODED = "VALUESET_BAD_FILTER_VALUE_CODED"; + public static final String VALUESET_BAD_FILTER_VALUE_CODED_INVALID = "VALUESET_BAD_FILTER_VALUE_CODED_INVALID"; + public static final String VALUESET_BAD_FILTER_OP = "VALUESET_BAD_FILTER_OP"; + public static final String VALUESET_BAD_FILTER_VALUE_HAS_COMMA = "VALUESET_BAD_FILTER_VALUE_HAS_COMMA"; + public static final String VALUESET_BAD_FILTER_VALUE_VALID_REGEX = "VALUESET_BAD_FILTER_VALUE_VALID_REGEX"; + public static final String VALUESET_BAD_PROPERTY_NO_REGEX = "VALUESET_BAD_PROPERTY_NO_REGEX"; + public static final String CODESYSTEM_PROPERTY_CODE_WARNING = "CODESYSTEM_PROPERTY_CODE_WARNING"; } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/JsonLangFileProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/JsonLangFileProducer.java index 0dcac92d0..84a98163c 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/JsonLangFileProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/JsonLangFileProducer.java @@ -13,8 +13,8 @@ import org.hl7.fhir.utilities.json.parser.JsonParser; public class JsonLangFileProducer extends LanguageFileProducer { - public JsonLangFileProducer(String folder) { - super(folder); + public JsonLangFileProducer(String rootFolder, String folderName, boolean useLangFolder) { + super(rootFolder, folderName, useLangFolder); } public JsonLangFileProducer() { @@ -102,7 +102,7 @@ public class JsonLangFileProducer extends LanguageFileProducer { } private String getFileName(String id, String baseLang) throws IOException { - return Utilities.path(getFolder(), id+"-"+baseLang+".json"); + return Utilities.path(getRootFolder(), getFolderName(), id+"-"+baseLang+".json"); } @Override @@ -132,7 +132,7 @@ public class JsonLangFileProducer extends LanguageFileProducer { entry.add("source", tu.getSrcText()); entry.add("target", tu.getTgtText()); } - TextFile.stringToFile(JsonParser.compose(json, true), Utilities.path(getFolder(), filename)); + TextFile.stringToFile(JsonParser.compose(json, true), getTargetFileName(targetLang, filename)); } } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/LanguageFileProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/LanguageFileProducer.java index 3d9ac32ec..4af92f8ae 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/LanguageFileProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/LanguageFileProducer.java @@ -8,6 +8,7 @@ import java.util.Map; import javax.xml.parsers.ParserConfigurationException; +import org.hl7.fhir.utilities.Utilities; import org.xml.sax.SAXException; @@ -143,21 +144,41 @@ public abstract class LanguageFileProducer { public abstract void finish() throws IOException; } - private String folder; + private String rootFolder; + private String folderName; + private boolean useLangFolder; - public LanguageFileProducer(String folder) { + public LanguageFileProducer(String rootFolder, String folderName, boolean useLangFolder) { super(); - this.folder = folder; + this.rootFolder = rootFolder; + this.folderName = folderName; + this.useLangFolder = useLangFolder; } public LanguageFileProducer() { super(); } - public String getFolder() { - return folder; + + public String getRootFolder() { + return rootFolder; } + public String getFolderName() { + return folderName; + } + + public boolean isUseLangFolder() { + return useLangFolder; + } + + + protected String getTargetFileName(String targetLang, String filename) throws IOException { + return Utilities.path(getRootFolder(), isUseLangFolder() ? targetLang : ".", getFolderName(), filename); + } + + + public abstract LanguageProducerSession startSession(String id, String baseLang) throws IOException; public abstract void finish(); diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java index 902e4d9a6..266417d9e 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/PoGetTextProducer.java @@ -15,8 +15,8 @@ public class PoGetTextProducer extends LanguageFileProducer { private int filecount; private boolean incLangInFilename; - public PoGetTextProducer(String folder) { - super(folder); + public PoGetTextProducer(String rootFolder, String folderName, boolean useLangFolder) { + super(rootFolder, folderName, useLangFolder); } public PoGetTextProducer() { @@ -142,7 +142,7 @@ public class PoGetTextProducer extends LanguageFileProducer { } private String getFileName(String id, String baseLang, String targetLang) throws IOException { - return Utilities.path(getFolder(), id+(incLangInFilename ? "-"+baseLang+"-"+targetLang+".po" : "")); + return Utilities.path(getRootFolder(), getFolderName(), id+(incLangInFilename ? "-"+baseLang+"-"+targetLang+".po" : "")); } public boolean isIncLangInFilename() { @@ -167,11 +167,20 @@ public class PoGetTextProducer extends LanguageFileProducer { if (tu.getContext1() != null) { ln(po, "#. "+tu.getContext1()); } - ln(po, "msgid \""+tu.getSrcText()+"\""); - ln(po, "msgstr \""+(tu.getTgtText() == null ? "" : tu.getTgtText())+"\""); + ln(po, "msgid \""+stripEoln(tu.getSrcText())+"\""); + ln(po, "msgstr \""+(tu.getTgtText() == null ? "" : stripEoln(tu.getTgtText()))+"\""); ln(po, ""); } - TextFile.stringToFile(po.toString(), Utilities.path(getFolder(), filename)); + TextFile.stringToFile(po.toString(), getTargetFileName(targetLang, filename)); + } + + private String stripEoln(String s) { + s = s.replace("\r\n\r\n", " ").replace("\n\n", " ").replace("\r\r", " "); + s = s.replace("\r\n", " ").replace("\n", " ").replace("\r", " "); +// // yes, the double escaping is intentional here - it appears necessary +// s = s.replace("\\r\\n\\r\\n", " ").replace("\\n\\n", " ").replace("\\r\\r", " "); +// s = s.replace("\\r\\n", " ").replace("\\n", " ").replace("\\r", " "); + return s; } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/RenderingI18nContext.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/RenderingI18nContext.java new file mode 100644 index 000000000..ec09832cf --- /dev/null +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/RenderingI18nContext.java @@ -0,0 +1,100 @@ +package org.hl7.fhir.utilities.i18n; + +public class RenderingI18nContext extends I18nBase { + + public static final String RENDER_BUNDLE_HEADER_ROOT = "RENDER_BUNDLE_HEADER_ROOT"; + public static final String RENDER_BUNDLE_HEADER_ENTRY = "RENDER_BUNDLE_HEADER_ENTRY"; + public static final String RENDER_BUNDLE_HEADER_ENTRY_URL = "RENDER_BUNDLE_HEADER_ENTRY_URL"; + public static final String RENDER_BUNDLE_RESOURCE = "RENDER_BUNDLE_RESOURCE"; + public static final String RENDER_BUNDLE_SEARCH = "RENDER_BUNDLE_SEARCH"; + public static final String RENDER_BUNDLE_SEARCH_MODE = "RENDER_BUNDLE_SEARCH_MODE"; + public static final String RENDER_BUNDLE_SEARCH_SCORE = "RENDER_BUNDLE_SEARCH_SCORE"; + public static final String RENDER_BUNDLE_RESPONSE = "RENDER_BUNDLE_RESPONSE"; + public static final String RENDER_BUNDLE_LOCATION = "RENDER_BUNDLE_LOCATION"; + public static final String RENDER_BUNDLE_ETAG = "RENDER_BUNDLE_ETAG"; + public static final String RENDER_BUNDLE_LAST_MOD = "RENDER_BUNDLE_LAST_MOD"; + public static final String RENDER_BUNDLE_REQUEST = "RENDER_BUNDLE_REQUEST"; + public static final String RENDER_BUNDLE_IF_NON_MATCH = "RENDER_BUNDLE_IF_NON_MATCH"; + public static final String RENDER_BUNDLE_IF_MOD = "RENDER_BUNDLE_IF_MOD"; + public static final String RENDER_BUNDLE_IF_MATCH = "RENDER_BUNDLE_IF_MATCH"; + public static final String RENDER_BUNDLE_IF_NONE = "RENDER_BUNDLE_IF_NONE"; + public static final String RENDER_BUNDLE_DOCUMENT_CONTENT = "RENDER_BUNDLE_DOCUMENT_CONTENT"; + public static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_URD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_URD"; + public static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_U = "RENDER_BUNDLE_HEADER_DOC_ENTRY_U"; + public static final String RENDER_BUNDLE_HEADER_DOC_ENTRY_RD = "RENDER_BUNDLE_HEADER_DOC_ENTRY_RD"; + + public static final String SD_HEAD_NAME = "SD_HEAD_NAME"; + public static final String SD_HEAD_NAME_DESC = "SD_HEAD_NAME_DESC"; + public static final String SD_HEAD_FLAGS = "SD_HEAD_FLAGS"; + public static final String SD_HEAD_FLAGS_DESC = "SD_HEAD_FLAGS_DESC"; + public static final String SD_HEAD_CARD = "SD_HEAD_CARD"; + public static final String SD_HEAD_CARD_DESC = "SD_HEAD_CARD_DESC"; + public static final String SD_HEAD_TYPE = "SD_HEAD_TYPE"; + public static final String SD_HEAD_TYPE_DESC = "SD_HEAD_TYPE_DESC"; + public static final String SD_HEAD_DESC = "SD_HEAD_DESC"; + public static final String SD_HEAD_DESC_DESC = "SD_HEAD_DESC_DESC"; + + public static final String SD_COMP_HEAD_NAME = "SD_COMP_HEAD_NAME"; + public static final String SD_COMP_HEAD_NAME_DESC = "SD_COMP_HEAD_NAME_DESC"; + public static final String SD_COMP_HEAD_FLAGS_L = "SD_COMP_HEAD_FLAGS_L"; + public static final String SD_COMP_HEAD_FLAGS_L_DESC ="SD_COMP_HEAD_FLAGS_L_DESC"; + public static final String SD_COMP_HEAD_CARD_L = "SD_COMP_HEAD_CARD_L"; + public static final String SD_COMP_HEAD_CARD_L_DESC ="SD_COMP_HEAD_CARD_L_DESC"; + public static final String SD_COMP_HEAD_TYPE_L = "SD_COMP_HEAD_TYPE_L"; + public static final String SD_COMP_HEAD_TYPE_L_DESC ="SD_COMP_HEAD_TYPE_L_DESC"; + public static final String SD_COMP_HEAD_DESC_L = "SD_COMP_HEAD_DESC_L"; + public static final String SD_COMP_HEAD_DESC_L_DESC ="SD_COMP_HEAD_DESC_L_DESC"; + public static final String SD_COMP_HEAD_FLAGS_R = "SD_COMP_HEAD_FLAGS_R"; + public static final String SD_COMP_HEAD_FLAGS_R_DESC ="SD_COMP_HEAD_FLAGS_R_DESC"; + public static final String SD_COMP_HEAD_CARD_R = "SD_COMP_HEAD_CARD_R"; + public static final String SD_COMP_HEAD_CARD_R_DESC ="SD_COMP_HEAD_CARD_R_DESC"; + public static final String SD_COMP_HEAD_TYPE_R = "SD_COMP_HEAD_TYPE_R"; + public static final String SD_COMP_HEAD_TYPE_R_DESC ="SD_COMP_HEAD_TYPE_R_DESC"; + public static final String SD_COMP_HEAD_DESC_R = "SD_COMP_HEAD_DESC_R"; + public static final String SD_COMP_HEAD_DESC_R_DESC ="SD_COMP_HEAD_DESC_R_DESC"; + public static final String SD_COMP_HEAD_COMP = "SD_COMP_HEAD_COMP"; + public static final String SD_COMP_HEAD_COMP_DESC = "SD_COMP_HEAD_COMP_DESC"; + + public static final String SD_GRID_HEAD_NAME = "SD_GRID_HEAD_NAME"; + public static final String SD_GRID_HEAD_NAME_DESC = "SD_GRID_HEAD_NAME_DESC"; + public static final String SD_GRID_HEAD_CARD = "SD_GRID_HEAD_CARD"; + public static final String SD_GRID_HEAD_CARD_DESC = "SD_GRID_HEAD_CARD_DESC"; + public static final String SD_GRID_HEAD_TYPE = "SD_GRID_HEAD_TYPE"; + public static final String SD_GRID_HEAD_TYPE_DESC = "SD_GRID_HEAD_TYPE_DESC"; + public static final String SD_GRID_HEAD_DESC = "SD_GRID_HEAD_DESC"; + public static final String SD_GRID_HEAD_DESC_DESC = "SD_GRID_HEAD_DESC_DESC"; + + public static final String SD_LEGEND = "SD_LEGEND"; + public static final String SD_DOCO = "SD_DOCO"; + public static final String SD_SLICING_INFO = "SD_SLICING_INFO"; + + public static final String RENDER_RESOURCE_COPYRIGHT = "RENDER_RESOURCE_COPYRIGHT"; + + public static final String RENDER_CODESYSTEM_FILTERS = "RENDER_CODESYSTEM_FILTERS"; + public static final String RENDER_CODESYSTEM_FILTER_CODE = "RENDER_CODESYSTEM_FILTER_CODE"; + public static final String RENDER_CODESYSTEM_FILTER_DESC = "RENDER_CODESYSTEM_FILTER_DESC"; + public static final String RENDER_CODESYSTEM_FILTER_OP = "RENDER_CODESYSTEM_FILTER_OP"; + public static final String RENDER_CODESYSTEM_FILTER_VALUE = "RENDER_CODESYSTEM_FILTER_VALUE"; + + public static final String RENDER_CODESYSTEM_PROPS = "RENDER_CODESYSTEM_PROPS"; + public static final String RENDER_CODESYSTEM_PROPS_DESC = "RENDER_CODESYSTEM_PROPS_DESC"; + public static final String RENDER_CODESYSTEM_PROP_NAME = "RENDER_CODESYSTEM_PROP_NAME"; + public static final String RENDER_CODESYSTEM_PROP_CODE = "RENDER_CODESYSTEM_PROP_CODE"; + public static final String RENDER_CODESYSTEM_PROP_URI = "RENDER_CODESYSTEM_PROP_URI"; + public static final String RENDER_CODESYSTEM_PROP_TYPE = "RENDER_CODESYSTEM_PROP_TYPE"; + public static final String RENDER_CODESYSTEM_PROP_DESC = "RENDER_CODESYSTEM_PROP_DESC"; + public static final String RENDER_CODESYSTEM_CONCEPTS = "RENDER_CODESYSTEM_CONCEPTS"; + public static final String RENDER_CODESYSTEM_DEPRECATED = "RENDER_CODESYSTEM_DEPRECATED"; + + + public static final String RENDER_TX_CODE = "RENDER_TX_CODE"; + public static final String RENDER_TX_DISPLAY = "RENDER_TX_DISPLAY"; + public static final String RENDER_TX_DEFINITION = "RENDER_TX_DEFINITION"; + public static final String RENDER_TX_DEPRECATED = "RENDER_TX_DEPRECATED"; + public static final String RENDER_TX_COMMENTS = "RENDER_TX_COMMENTS"; + public static final String RENDER_TX_VERSION = "RENDER_TX_VERSION"; + + protected String getMessagesSourceFileName() { + return "rendering-phrases"; + } +} diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java index 63de24767..6847a85b6 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/XLIFFProducer.java @@ -39,7 +39,7 @@ public class XLIFFProducer extends LanguageFileProducer { ln(" </body>"); ln(" </file>"); ln("</xliff>"); - TextFile.stringToFile(xml.toString(), Utilities.path(getFolder(), id+".xliff")); + TextFile.stringToFile(xml.toString(), Utilities.path(getRootFolder(), getFolderName(), id+".xliff")); filecount++; } @@ -80,8 +80,8 @@ public class XLIFFProducer extends LanguageFileProducer { private int filecount; - public XLIFFProducer(String folder) { - super(folder); + public XLIFFProducer(String rootFolder, String folderName, boolean useLangFolder) { + super(rootFolder, folderName, useLangFolder); } public XLIFFProducer() { @@ -163,7 +163,7 @@ public class XLIFFProducer extends LanguageFileProducer { ln(xml, " </body>"); ln(xml, " </file>"); ln(xml, "</xliff>"); - TextFile.stringToFile(xml.toString(), Utilities.path(getFolder(), filename)); + TextFile.stringToFile(xml.toString(), getTargetFileName(targetLang, filename)); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/model/JsonObject.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/model/JsonObject.java index ecf9593f5..c64b6d0e2 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/model/JsonObject.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/model/JsonObject.java @@ -68,6 +68,16 @@ public class JsonObject extends JsonElement { return add(name, value == null ? new JsonNull() : new JsonString(value)); } + public JsonObject add(String name, List<String> values) throws JsonException { + check(name != null, "Name is null"); + JsonArray arr = new JsonArray(); + add(name, arr); + for (String v : values) { + arr.add(v); + } + return this; + } + public JsonObject addIfNotNull(String name, String value) throws JsonException { check(name != null, "Name is null"); if (value == null) { diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/validation/ValidationOptions.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/validation/ValidationOptions.java index 9ad84013c..47a32d217 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/validation/ValidationOptions.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/validation/ValidationOptions.java @@ -22,6 +22,7 @@ public class ValidationOptions { private boolean useValueSetDisplays; private boolean englishOk = true; private boolean activeOnly = false; + private boolean exampleOK = false; private FhirPublication fhirVersion; public ValidationOptions(FhirPublication fhirVersion) { @@ -158,6 +159,13 @@ public class ValidationOptions { return n; } + + public ValidationOptions withGuessSystem(boolean value) { + ValidationOptions n = this.copy(); + n.guessSystem = value; + return n; + } + public ValidationOptions withActiveOnly() { ValidationOptions n = this.copy(); n.activeOnly = true; @@ -263,6 +271,19 @@ public class ValidationOptions { return this; } + public boolean isExampleOK() { + return exampleOK; + } + + public ValidationOptions setExampleOK(boolean exampleOK) { + this.exampleOK = exampleOK; + return this; + } + + public ValidationOptions withExampleOK() { + return setExampleOK(true); + } + public ValidationOptions copy() { ValidationOptions n = new ValidationOptions(fhirVersion); n.langs = langs == null ? null : langs.copy(); @@ -275,13 +296,14 @@ public class ValidationOptions { n.membershipOnly = membershipOnly; n.useValueSetDisplays = useValueSetDisplays; n.displayWarningMode = displayWarningMode; + n.exampleOK = exampleOK; return n; } public String toJson() { return "\"langs\":\""+( langs == null ? "" : langs.toString())+"\", \"useServer\":\""+Boolean.toString(useServer)+"\", \"useClient\":\""+Boolean.toString(useClient)+"\", "+ - "\"guessSystem\":\""+Boolean.toString(guessSystem)+"\", \"activeOnly\":\""+Boolean.toString(activeOnly)+"\", \"membershipOnly\":\""+Boolean.toString(membershipOnly)+"\", \"displayWarningMode\":\""+Boolean.toString(displayWarningMode)+"\", \"versionFlexible\":\""+Boolean.toString(versionFlexible)+"\""; + "\"guessSystem\":\""+Boolean.toString(guessSystem)+"\", \"activeOnly\":\""+Boolean.toString(activeOnly)+(exampleOK ? "\", \"exampleOK\":\""+Boolean.toString(exampleOK) : "")+"\", \"membershipOnly\":\""+Boolean.toString(membershipOnly)+"\", \"displayWarningMode\":\""+Boolean.toString(displayWarningMode)+"\", \"versionFlexible\":\""+Boolean.toString(versionFlexible)+"\""; } public String langSummary() { @@ -299,5 +321,6 @@ public class ValidationOptions { public FhirPublication getFhirVersion() { return fhirVersion; } + } \ No newline at end of file diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java index f098002cf..b4dd81e58 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java @@ -85,31 +85,31 @@ import org.commonmark.renderer.html.HtmlRenderer; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.TextFile; -import org.hl7.fhir.utilities.TranslatingUtilities; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.i18n.RenderingI18nContext; -public class HierarchicalTableGenerator extends TranslatingUtilities { +public class HierarchicalTableGenerator { public enum TableGenerationMode { XML, XHTML } - public static final String TEXT_ICON_REFERENCE = "Reference to another Resource"; - public static final String TEXT_ICON_PRIMITIVE = "Primitive Data Type"; - public static final String TEXT_ICON_KEY = "JSON Key Value"; - public static final String TEXT_ICON_DATATYPE = "Data Type"; - public static final String TEXT_ICON_RESOURCE = "Resource"; - public static final String TEXT_ICON_ELEMENT = "Element"; - public static final String TEXT_ICON_OBJECT_BOX = "Object"; - public static final String TEXT_ICON_REUSE = "Reference to another Element"; - public static final String TEXT_ICON_EXTENSION = "Extension"; - public static final String TEXT_ICON_CHOICE = "Choice of Types"; - public static final String TEXT_ICON_SLICE = "Slice Definition"; - public static final String TEXT_ICON_SLICE_ITEM = "Slice Item"; - public static final String TEXT_ICON_FIXED = "Fixed Value"; - public static final String TEXT_ICON_EXTENSION_SIMPLE = "Simple Extension"; - public static final String TEXT_ICON_PROFILE = "Profile"; - public static final String TEXT_ICON_EXTENSION_COMPLEX = "Complex Extension"; + /*!#*/public static final String TEXT_ICON_REFERENCE = "Reference to another Resource"; + /*!#*/public static final String TEXT_ICON_PRIMITIVE = "Primitive Data Type"; + /*!#*/public static final String TEXT_ICON_KEY = "JSON Key Value"; + /*!#*/public static final String TEXT_ICON_DATATYPE = "Data Type"; + /*!#*/public static final String TEXT_ICON_RESOURCE = "Resource"; + /*!#*/public static final String TEXT_ICON_ELEMENT = "Element"; + /*!#*/public static final String TEXT_ICON_OBJECT_BOX = "Object"; + /*!#*/public static final String TEXT_ICON_REUSE = "Reference to another Element"; + /*!#*/public static final String TEXT_ICON_EXTENSION = "Extension"; + /*!#*/public static final String TEXT_ICON_CHOICE = "Choice of Types"; + /*!#*/public static final String TEXT_ICON_SLICE = "Slice Definition"; + /*!#*/public static final String TEXT_ICON_SLICE_ITEM = "Slice Item"; + /*!#*/public static final String TEXT_ICON_FIXED = "Fixed Value"; + /*!#*/public static final String TEXT_ICON_EXTENSION_SIMPLE = "Simple Extension"; + /*!#*/public static final String TEXT_ICON_PROFILE = "Profile"; + /*!#*/public static final String TEXT_ICON_EXTENSION_COMPLEX = "Complex Extension"; public static final int NEW_REGULAR = 0; public static final int CONTINUE_REGULAR = 1; @@ -626,13 +626,16 @@ public class HierarchicalTableGenerator extends TranslatingUtilities { private boolean inLineGraphics; private TableGenerationMode mode; + private RenderingI18nContext i18n; - public HierarchicalTableGenerator() { + public HierarchicalTableGenerator(RenderingI18nContext i18n) { super(); + this.i18n = i18n; } - public HierarchicalTableGenerator(String dest, boolean inlineGraphics) { + public HierarchicalTableGenerator(RenderingI18nContext i18n, String dest, boolean inlineGraphics) { super(); + this.i18n = i18n; this.dest = dest; this.inLineGraphics = inlineGraphics; this.makeTargets = true; @@ -646,8 +649,9 @@ public class HierarchicalTableGenerator extends TranslatingUtilities { } - public HierarchicalTableGenerator(String dest, boolean inlineGraphics, boolean makeTargets) { + public HierarchicalTableGenerator(RenderingI18nContext i18n, String dest, boolean inlineGraphics, boolean makeTargets) { super(); + this.i18n = i18n; this.dest = dest; this.inLineGraphics = inlineGraphics; this.makeTargets = makeTargets; @@ -666,11 +670,11 @@ public class HierarchicalTableGenerator extends TranslatingUtilities { model.setDocoImg(Utilities.pathURL(prefix, "help16.png")); } model.setDocoRef(Utilities.pathURL("https://build.fhir.org/ig/FHIR/ig-guidance", "readingIgs.html#table-views")); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Name"), translate("sd.hint", "The logical name of the element"), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Flags"), translate("sd.hint", "Information about the use of the element"), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Card."), translate("sd.hint", "Minimum and Maximum # of times the the element can appear in the instance"), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Type"), translate("sd.hint", "Reference to the type of the element"), null, 100)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Description & Constraints"), translate("sd.hint", "Additional information about the element"), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_NAME), i18n.formatMessage(RenderingI18nContext.SD_HEAD_NAME_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_FLAGS), i18n.formatMessage(RenderingI18nContext.SD_HEAD_FLAGS_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_CARD), i18n.formatMessage(RenderingI18nContext.SD_HEAD_CARD_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_TYPE), i18n.formatMessage(RenderingI18nContext.SD_HEAD_TYPE_DESC), null, 100)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_HEAD_DESC), i18n.formatMessage(RenderingI18nContext.SD_HEAD_DESC_DESC), null, 0)); if (isLogical) { model.getTitles().add(new Title(null, prefix+"structuredefinition.html#logical", "Implemented As", "How this logical data item is implemented in a concrete resource", null, 0)); } @@ -687,16 +691,16 @@ public class HierarchicalTableGenerator extends TranslatingUtilities { model.setDocoImg(Utilities.pathURL(prefix, "help16.png")); } model.setDocoRef(Utilities.pathURL(prefix, "formats.html#table")); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Name"), translate("sd.hint", "The logical name of the element"), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Flags"), translate("sd.hint", "Information about the use of the element - Left Structure"), null, 0).setStyle("border-left: 1px grey solid")); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Card."), translate("sd.hint", "Minimum and Maximum # of times the the element can appear in the instance - Left Structure"), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Type"), translate("sd.hint", "Reference to the type of the element - Left Structure"), null, 100)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Description & Constraints"), translate("sd.hint", "Additional information about the element - Left Structure"), null, 0).setStyle("border-right: 1px grey solid")); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "R Flags"), translate("sd.hint", "Information about the use of the element - Left Structure"), null, 0).setStyle("border-left: 1px grey solid")); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "R Card."), translate("sd.hint", "Minimum and Maximum # of times the the element can appear in the instance - Left Structure"), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Type"), translate("sd.hint", "Reference to the type of the element - Left Structure"), null, 100)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "L Description & Constraints"), translate("sd.hint", "Additional information about the element - Left Structure"), null, 0).setStyle("border-right: 1px grey solid")); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Comments"), translate("sd.hint", "Comments about the comparison"), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_NAME), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_NAME_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_FLAGS_L), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_FLAGS_L_DESC), null, 0).setStyle("border-left: 1px grey solid")); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_CARD_L), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_CARD_L_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_TYPE_L), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_TYPE_L_DESC), null, 100)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_DESC_L), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_DESC_L_DESC), null, 0).setStyle("border-right: 1px grey solid")); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_FLAGS_R), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_FLAGS_R_DESC), null, 0).setStyle("border-left: 1px grey solid")); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_CARD_R), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_CARD_R_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_TYPE_R), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_TYPE_R_DESC), null, 100)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_DESC_R), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_DESC_R_DESC), null, 0).setStyle("border-right: 1px grey solid")); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_COMP), i18n.formatMessage(RenderingI18nContext.SD_COMP_HEAD_COMP_DESC), null, 0)); return model; } @@ -704,11 +708,11 @@ public class HierarchicalTableGenerator extends TranslatingUtilities { public TableModel initGridTable(String prefix, String id) { TableModel model = new TableModel(id, false); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_NAME), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_NAME_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_CARD), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_CARD_DESC), null, 0)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_TYPE), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_TYPE_DESC), null, 100)); + model.getTitles().add(new Title(null, model.getDocoRef(), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_DESC), i18n.formatMessage(RenderingI18nContext.SD_GRID_HEAD_DESC_DESC), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Name"), translate("sd.hint", "The name of the element (Slice name in brackets). Mouse-over provides definition"), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Card."), translate("sd.hint", "Minimum and Maximum # of times the the element can appear in the instance. Super-scripts indicate additional constraints on appearance"), null, 0)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Type"), translate("sd.hint", "Reference to the type of the element"), null, 100)); - model.getTitles().add(new Title(null, model.getDocoRef(), translate("sd.head", "Constraints and Usage"), translate("sd.hint", "Fixed values, length limits, vocabulary bindings and other usage notes"), null, 0)); return model; } @@ -750,10 +754,10 @@ public class HierarchicalTableGenerator extends TranslatingUtilities { tc.setAttribute("class", "hierarchy"); tc.setAttribute("colspan", Integer.toString(model.getTitles().size())); tc.addTag("br"); - XhtmlNode a = tc.addTag("a").setAttribute("title", translate("sd.doco", "Legend for this format")).setAttribute("href", model.getDocoRef()); + XhtmlNode a = tc.addTag("a").setAttribute("title", i18n.formatMessage(RenderingI18nContext.SD_LEGEND)).setAttribute("href", model.getDocoRef()); if (model.getDocoImg() != null) a.addTag("img").setAttribute("alt", "doco").setAttribute("style", "background-color: inherit").setAttribute("src", model.getDocoImg()); - a.addText(" "+translate("sd.doco", "Documentation for this format")); + a.addText(" "+i18n.formatMessage(RenderingI18nContext.SD_DOCO)); } return table; } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java index 4dc2bf00d..874f2c2ed 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java @@ -1,33 +1,33 @@ package org.hl7.fhir.utilities.xhtml; -/* - 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. - - */ +/* + 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. + + */ @@ -39,6 +39,7 @@ import java.io.StringWriter; import java.io.Writer; import java.util.List; + import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.xml.IXMLWriter; import org.w3c.dom.Element; @@ -236,15 +237,18 @@ public class XhtmlComposer { if (!pretty || noPrettyOverride) indent = ""; - // html self closing tags: http://xahlee.info/js/html5_non-closing_tag.html - boolean concise = node.getChildNodes().size() == 0; - if (node.hasEmptyExpanded() && node.getEmptyExpanded()) { - concise = false; + boolean concise = false; + if (!node.hasChildren()) { + if (this.xml) { + concise = true; + } else if (!(node.hasEmptyExpanded() && node.getEmptyExpanded()) && + Utilities.existsInList(node.getName(), "area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr")) { + // In HTML5, only these elements can self-close + // https://developer.mozilla.org/en-US/docs/Glossary/Void_element + concise = true; + } } - if (!xml && Utilities.existsInList(node.getName(), "area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr")) { - concise = true; - } - + if (concise) dst.append(indent + "<" + node.getName() + attributes(node) + "/>" + (pretty && !noPrettyOverride ? "\r\n" : "")); else { diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlFluent.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlFluent.java index 52411a1d3..79a90d5fa 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlFluent.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlFluent.java @@ -11,8 +11,10 @@ import org.hl7.fhir.utilities.Utilities; public abstract class XhtmlFluent { protected abstract XhtmlNode addTag(String string); + protected abstract XhtmlNode addTag(int index, String string); protected abstract XhtmlNode addText(String cnt); protected abstract void addChildren(XhtmlNodeList childNodes); + protected abstract int indexOfNode(XhtmlNode node); public XhtmlNode h1() { return addTag("h1"); @@ -61,6 +63,14 @@ public abstract class XhtmlFluent { return addTag("tr"); } + public XhtmlNode tr(XhtmlNode tr) { + return addTag(indexOfNode(tr)+1, "tr"); + } + + public XhtmlNode th(int index) { + return addTag(index, "th"); + } + public XhtmlNode th() { return addTag("th"); } @@ -182,12 +192,20 @@ public abstract class XhtmlFluent { public XhtmlNode img(String src, String alt) { if (alt == null) { - return addTag("img").attribute("src", src); + return addTag("img").attribute("src", src).attribute("alt", "."); } else { return addTag("img").attribute("src", src).attribute("alt", alt); } } + public XhtmlNode imgT(String src, String alt) { + if (alt == null) { + return addTag("img").attribute("src", src).attribute("alt", "."); + } else { + return addTag("img").attribute("src", src).attribute("alt", alt).attribute("title", alt); + } + } + public XhtmlNode img(String src, String alt, String title) { return addTag("img").attribute("src", src).attribute("alt", alt).attribute("title", title); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java index 755d087c2..4363eb7bd 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java @@ -203,19 +203,16 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { } } - public XhtmlNode addTag(String name) - { - + private XhtmlNode makeTag(String name) { if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) { throw new Error("Wrong node type - node is "+nodeType.toString()+" ('"+getName()+"/"+getContent()+"')"); } - -// if (inPara && name.equals("p")) { -// throw new FHIRException("nested Para"); -// } -// if (inLink && name.equals("a")) { -// throw new FHIRException("Nested Link"); -// } +// if (inPara && name.equals("p")) { +// throw new FHIRException("nested Para"); +//} +//if (inLink && name.equals("a")) { +// throw new FHIRException("Nested Link"); +//} XhtmlNode node = new XhtmlNode(NodeType.Element); node.setName(name); if (getChildNodes().isInPara() || name.equals("p")) { @@ -224,35 +221,26 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { if (getChildNodes().isInLink() || name.equals("a")) { node.getChildNodes().setInLink(true); } - getChildNodes().add(node); if (Utilities.existsInList(name, "b", "big", "i", "small", "tt", "abbr", "acronym", "cite", "code", "dfn", "em", "kbd", "strong", "samp", "var", "a", "bdo", "br", "img", "map", "object", "q", "script", "span", "sub", "sup", " button", "input", "label", "select", "textarea")) { node.notPretty(); - } + } + return node; + } + + public XhtmlNode addTag(String name) { + XhtmlNode node = makeTag(name); + getChildNodes().add(node); return node; } - - - public XhtmlNode addTag(int index, String name) - { - - if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) - throw new Error("Wrong node type. is "+nodeType.toString()); - XhtmlNode node = new XhtmlNode(NodeType.Element); - if (getChildNodes().isInPara() || name.equals("p")) { - node.getChildNodes().setInPara(true); - } - if (getChildNodes().isInLink() || name.equals("a")) { - node.getChildNodes().setInLink(true); - } - node.setName(name); + public XhtmlNode addTag(int index, String name) { + XhtmlNode node = makeTag(name); getChildNodes().add(index, node); return node; } - public XhtmlNode addComment(String content) - { + public XhtmlNode addComment(String content) { if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) throw new Error("Wrong node type"); XhtmlNode node = new XhtmlNode(NodeType.Comment); @@ -261,8 +249,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { return node; } - public XhtmlNode addDocType(String content) - { + public XhtmlNode addDocType(String content) { if (!(nodeType == NodeType.Document)) throw new Error("Wrong node type"); XhtmlNode node = new XhtmlNode(NodeType.DocType); @@ -271,8 +258,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { return node; } - public XhtmlNode addInstruction(String content) - { + public XhtmlNode addInstruction(String content) { if (!(nodeType == NodeType.Document)) throw new Error("Wrong node type"); XhtmlNode node = new XhtmlNode(NodeType.Instruction); @@ -280,8 +266,8 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { getChildNodes().add(node); return node; } - public XhtmlNode addText(String content) - { + + public XhtmlNode addText(String content) { if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) throw new Error("Wrong node type"); if (content != null) { @@ -293,8 +279,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { return null; } - public XhtmlNode addText(int index, String content) - { + public XhtmlNode addText(int index, String content) { if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) throw new Error("Wrong node type"); if (content == null) @@ -306,8 +291,7 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { return node; } - public boolean allChildrenAreText() - { + public boolean allChildrenAreText() { boolean res = true; if (hasChildren()) { for (XhtmlNode n : childNodes) @@ -376,6 +360,17 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { return this; } + public XhtmlNode attributeNN(String name, String value) { + if (!(nodeType == NodeType.Element || nodeType == NodeType.Document)) + throw new Error("Wrong node type"); + if (name == null) + throw new Error("name is null"); + if (value != null) { + getAttributes().put(name, value); + } + return this; + } + public boolean hasAttribute(String name) { return hasAttributes() && getAttributes().containsKey(name); } @@ -781,12 +776,18 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { public XhtmlNode colspan(String n) { return setAttribute("colspan", n); } - + public XhtmlNode colspan(int n) { return setAttribute("colspan", Integer.toString(n)); } - + public XhtmlNode rowspan(int n) { + if (n > 1) { + return setAttribute("rowspan", Integer.toString(n)); + } else { + return this; + } + } @Override protected void addChildren(XhtmlNodeList childNodes) { @@ -928,6 +929,15 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { } + public XhtmlNode td(int index) { + XhtmlNode x = addTag(index, "td"); + XhtmlNode t = (XhtmlNode) getUserData("cells"); + if (t != null) { + x.copyAllContent(t); + } + return x; + } + public XhtmlNode td() { XhtmlNode x = addTag("td"); XhtmlNode t = (XhtmlNode) getUserData("cells"); @@ -937,6 +947,27 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { return x; } + public XhtmlNode td(int index, String width) { + XhtmlNode x = addTag(index, "td"); + x.attribute("width", width); + XhtmlNode t = (XhtmlNode) getUserData("cells"); + if (t != null) { + x.copyAllContent(t); + } + return x; + } + + public XhtmlNode tdW(int width) { + XhtmlNode x = addTag("td"); + x.attribute("width", Integer.toString(width)); + XhtmlNode t = (XhtmlNode) getUserData("cells"); + if (t != null) { + x.copyAllContent(t); + } + return x; + } + + // differs from tx because it returns the owner node, not the created text public XhtmlNode txN(String cnt) { @@ -976,5 +1007,87 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml { } return btn; } + + + public XhtmlNode head() { + return addTag("head"); + } + public XhtmlNode body() { + return addTag("body"); + } + public XhtmlNode title(String title) { + return addTag("title").tx(title); + } + + public XhtmlNode link(String rel, String href) { + return addTag("link").attribute("rel", rel).attribute("href", href); + } + + public XhtmlNode ahOrNot(String href) { + if (href == null) { + return this; + } + XhtmlNode x = addTag("a").attribute("href", href); + return x; + } + + + public void wbr() { + addTag("wbr"); + + } + + protected int indexOfNode(XhtmlNode node) { + return getChildNodes().indexOf(node); + } + + + + public int compareTo(XhtmlNode other) { + return compare(this, other); + } + + private static int compare(XhtmlNode base, XhtmlNode other) { + if (base == null || other == null) { + return 0; + } else if (base.getNodeType() != other.getNodeType()) { + return base.getNodeType().ordinal() - other.getNodeType().ordinal(); + } else switch (base.getNodeType()) { + case Comment: return base.getContent().compareTo(other.getContent()); + case DocType: return 0; + case Element: + int r = base.getName().compareTo(other.getName()); + if (r != 0) { + return r; + } + case Document: + if (base.getAttributes().size() != other.getAttributes().size()) { + return base.getAttributes().size() - other.getAttributes().size(); + } else { + for (String n : base.getAttributes().keySet()) { + String vb = base.getAttributes().get(n); + String vo = other.getAttributes().get(n); + r = vo == null ? -1 : vb.compareTo(vo); + if (r != 0) { + return r; + } + } + } + if (base.getChildNodes().size() != other.getChildNodes().size()) { + return base.getChildNodes().size() - other.getChildNodes().size(); + } else { + for (int i = 0; i < base.getChildNodes().size(); i++) { + r = compare(base, other); + if (r != 0) { + return r; + } + } + } + return 0; + case Instruction: return 0; + case Text: return base.getContent().compareTo(other.getContent()); + default: return 0; + } + } } \ No newline at end of file diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNodeList.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNodeList.java index 30ba2f1c3..fbf802f9e 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNodeList.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNodeList.java @@ -6,6 +6,8 @@ import java.util.Iterator; import java.util.List; import java.util.ListIterator; +import org.hl7.fhir.utilities.Utilities; + public class XhtmlNodeList extends XhtmlFluent implements List<XhtmlNode>, java.io.Serializable { private static final long serialVersionUID = 1L; @@ -31,15 +33,13 @@ public class XhtmlNodeList extends XhtmlFluent implements List<XhtmlNode>, java. } - public XhtmlNode addTag(String name) - { - -// if (inPara && name.equals("p")) { -// throw new FHIRException("nested Para"); -// } -// if (inLink && name.equals("a")) { -// throw new FHIRException("Nested Link"); -// } + private XhtmlNode makeTag(String name) { +// if (inPara && name.equals("p")) { +// throw new FHIRException("nested Para"); +//} +//if (inLink && name.equals("a")) { +// throw new FHIRException("Nested Link"); +//} XhtmlNode node = new XhtmlNode(NodeType.Element); node.setName(name); if (isInPara() || name.equals("p")) { @@ -48,10 +48,24 @@ public class XhtmlNodeList extends XhtmlFluent implements List<XhtmlNode>, java. if (isInLink() || name.equals("a")) { node.getChildNodes().setInLink(true); } + if (Utilities.existsInList(name, "b", "big", "i", "small", "tt", "abbr", "acronym", "cite", "code", "dfn", "em", "kbd", "strong", "samp", "var", "a", "bdo", "br", "img", "map", "object", "q", "script", "span", "sub", "sup", " button", "input", "label", "select", "textarea")) { + node.notPretty(); + } + return node; + } + + public XhtmlNode addTag(String name) { + XhtmlNode node = makeTag(name); add(node); return node; } - + + public XhtmlNode addTag(int index, String name) { + XhtmlNode node = makeTag(name); + add(index, node); + return node; + } + public XhtmlNode addText(String content) { if (content != null) { XhtmlNode node = new XhtmlNode(NodeType.Text); @@ -183,4 +197,9 @@ public class XhtmlNodeList extends XhtmlFluent implements List<XhtmlNode>, java. protected void addChildren(XhtmlNodeList childNodes) { this.addAll(childNodes); } + + protected int indexOfNode(XhtmlNode node) { + return indexOf(node); + } + } \ No newline at end of file diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index ae97c7812..b2d3b9bc0 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -54,7 +54,7 @@ Extension_EXT_Type = The Extension ''{0}'' definition allows for the types {1} b Extension_EXT_URL_Absolute = Extension.url must be an absolute URL Extension_EXT_Unknown = Unknown extension {0} Extension_EXT_Unknown_NotHere = The extension {0} could not be found so is not allowed here -Extension_EXT_Url_NotFound = Extension.url is required +Extension_EXT_Url_NotFound = Extension.url is required in order to identify, use and validate the extension Extension_EXT_Version_Internal = Extension url ''{0}'' evaluation state invalid Extension_EXT_Version_Invalid = Extension url ''{0}'' is not valid (invalid Version ''{1}'') Extension_EXT_Version_InvalidId = Extension url ''{0}'' is not valid (invalid Element id ''{1}'') @@ -488,14 +488,14 @@ UNABLE_TO_HANDLE_SYSTEM__PROPERTY_FILTER_WITH_OP__ = Unable to handle system {0} Unable_to_handle_system__filter_with_property__ = Unable to handle system {0} filter with property = {1}, op = {2} Unable_to_resolve_system__value_set_has_include_with_no_system = Unable to resolve system - value set {0} include #{1} has no system UNABLE_TO_RESOLVE_SYSTEM_SYSTEM_IS_INDETERMINATE = The code system {1} referred to from value set {0} has a grammar, and the code might be valid in it -Unable_to_resolve_system__value_set_has_include_with_unknown_system = Unable to resolve system - value set {0} include #{1} has system {2} which icould not be found, and the server returned error {3} -Unable_to_resolve_system__value_set_has_include_with_filter = Unable to resolve system - value set {0} include #{1} has a filter on system {2} -Unable_to_resolve_system__value_set_has_imports = Unable to resolve system - value set has imports -Unable_to_resolve_system__value_set_has_multiple_matches = Unable to resolve system - value set expansion has multiple matches: {0} -Unable_to_resolve_system__value_set_expansion_has_multiple_systems = Unable to resolve system - value set expansion has multiple systems -Unable_to_resolve_system__value_set_has_no_includes_or_expansion = Unable to resolve system - value set {0} has no includes or expansion +Unable_to_resolve_system__value_set_has_include_with_unknown_system = The System URI could not be determined for the code ''{0}'' in the ValueSet ''{1}'': include #{2} has system {3} which could not be found, and the server returned error {4} +Unable_to_resolve_system__value_set_has_include_with_filter = The System URI could not be determined for the code ''{0}'' in the ValueSet ''{1}'': include #{2} has a filter on system {3} +Unable_to_resolve_system__value_set_has_imports = The System URI could not be determined for the code ''{0}'' in the ValueSet ''{1}'': value set has imports +Unable_to_resolve_system__value_set_has_multiple_matches = The System URI could not be determined for the code ''{0}'' in the ValueSet ''{1}'': value set expansion has multiple matches: {2} +Unable_to_resolve_system__value_set_expansion_has_multiple_systems = The System URI could not be determined for the code ''{0}'' in the ValueSet ''{1}'': value set expansion has multiple systems +Unable_to_resolve_system__value_set_has_no_includes_or_expansion = The System URI could not be determined for the code ''{0}'' in the ValueSet ''{1}'': value set has no includes or expansion Unable_to_resolve_system__no_value_set = Unable to resolve system - no value set -Unable_to_resolve_system__value_set_has_no_matches = Unable to determine system - value set has no matches for code ''{0}'' +Unable_to_resolve_system__value_set_has_no_matches = The System URI could not be determined for the code ''{0}'' in the ValueSet ''{1}'' This_base_property_must_be_an_Array_not_ = This base property must be an Array, not {0} documentmsg = (document) xml_attr_value_invalid = The XML Attribute {0} has an invalid character @@ -551,6 +551,8 @@ XHTML_URL_INVALID_CHARS_one = URL contains Invalid Character ({1}) XHTML_URL_INVALID_CHARS_other = URL contains {0} Invalid Characters ({1}) TERMINOLOGY_TX_SYSTEM_HTTPS = The system URL ''{0}'' wrongly starts with https: not http: CODESYSTEM_CS_NO_VS_NOTCOMPLETE = Review the All Codes Value Set - incomplete CodeSystems generally should not have an all codes value set specified +CODESYSTEM_CS_NO_VS_SUPPLEMENT1 = CodeSystems supplements should not have an all codes value set specified, and if they do, it must match the base code system +CODESYSTEM_CS_NO_VS_SUPPLEMENT2 = CodeSystems supplements should not have an all codes value set specified, and if they do, it must match the base code system, and this one does not (''{0}'') TYPE_SPECIFIC_CHECKS_DT_IDENTIFIER_IETF_SYSTEM_VALUE = if identifier.system is ''urn:ietf:rfc:3986'', then the identifier.value must be a full URI (e.g. start with a scheme), not ''{0}'' TYPE_SPECIFIC_CHECKS_DT_ATT_SIZE_INVALID = Stated Attachment Size {0} is not valid TYPE_SPECIFIC_CHECKS_DT_ATT_SIZE_CORRECT = Stated Attachment Size {0} does not match actual attachment size {1} @@ -575,8 +577,8 @@ SEARCHPARAMETER_TYPE_WRONG = The type {1} is different to the type {0} in the de SEARCHPARAMETER_EXP_WRONG = The expression ''{2}'' is not compatible with the expression ''{1}'' in the derivedFrom SearchParameter {0}, and this likely indicates that the derivation relationship is not valid SEARCHPARAMETER_MISSING_COMPONENTS = When the SearchParameter has a type of 'composite', then the SearchParameter must define two or more components VALUESET_NO_SYSTEM_WARNING = No System specified, so Concepts and Filters can't be checked -VALUESET_INCLUDE_INVALID_CONCEPT_CODE = The code ''{1}'' is not valid in the system {0} -VALUESET_INCLUDE_INVALID_CONCEPT_CODE_VER = The code ''{2}'' is not valid in the system {0} version {1} +VALUESET_INCLUDE_INVALID_CONCEPT_CODE = The code ''{1}'' is not valid in the system {0} ({2}) +VALUESET_INCLUDE_INVALID_CONCEPT_CODE_VER = The code ''{2}'' is not valid in the system {0} version {1} ({2}) VALUESET_EXAMPLE_SYSTEM_HINT = Example System ''{0}'' specified, so Concepts and Filters can''t be checked VALUESET_EXAMPLE_SYSTEM_ERROR = Example System ''{0}'' specified, which is illegal. Concepts and Filters can''t be checked VALUESET_UNC_SYSTEM_WARNING = Unknown System ''{0}'' specified, so Concepts and Filters can''t be checked (Details: {1}) @@ -661,22 +663,6 @@ SD_MUST_HAVE_DERIVATION = StructureDefinition {0} must have a derivation, since VALIDATION_VAL_PROFILE_OTHER_VERSION = Profile is for a different version of FHIR ({0}) so has been ignored VALIDATION_VAL_PROFILE_THIS_VERSION_OK = Profile for this version of FHIR - all OK VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = Profile is for this version of FHIR, but is an invalid type {0} -RENDER_BUNDLE_HEADER_ROOT = Bundle {0} of type {1} -RENDER_BUNDLE_HEADER_ENTRY = Entry {0} -RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - fullUrl = {1} -RENDER_BUNDLE_RESOURCE = Resource {0}: -RENDER_BUNDLE_SEARCH = Search: -RENDER_BUNDLE_SEARCH_MODE = Mode = {0} -RENDER_BUNDLE_SEARCH_SCORE = Score = {0} -RENDER_BUNDLE_RESPONSE = Response: -RENDER_BUNDLE_LOCATION = Location = {0} -RENDER_BUNDLE_ETAG = ETag = {0} -RENDER_BUNDLE_LAST_MOD = LastModified = {0} -RENDER_BUNDLE_REQUEST = Request: -RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0} -RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0} -RENDER_BUNDLE_IF_MATCH = If-Match = {0} -RENDER_BUNDLE_IF_NONE = If-None-Exist = {0} 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}) @@ -917,10 +903,10 @@ CONCEPTMAP_GROUP_TARGET_MISSING = No Target Code System, so the target codes can CONCEPTMAP_GROUP_TARGET_UNKNOWN = The Target Code System {0} is not fully defined and populated, and no targetScope is specified, so the target code checking will not be performed CONCEPTMAP_GROUP_SOURCE_CODE_INVALID = The source code ''{0}'' is not valid in the code system {1} CONCEPTMAP_GROUP_SOURCE_CODE_INVALID_VS = The source code ''{0}'' is not valid in the value set {1} -CONCEPTMAP_GROUP_SOURCE_DISPLAY_INVALID = The source display ''{0}'' is not valid. Possible codes {1} +CONCEPTMAP_GROUP_SOURCE_DISPLAY_INVALID = The source display ''{0}'' for the code ''{2}'' is not valid. Possible displays: {1} CONCEPTMAP_GROUP_TARGET_CODE_INVALID = The target code ''{0}'' is not valid in the code system {1} CONCEPTMAP_GROUP_TARGET_CODE_INVALID_VS = The target code ''{0}'' is not valid in the value set {1} -CONCEPTMAP_GROUP_TARGET_DISPLAY_INVALID = The target display ''{0}'' is not valid. Possible displays {1} +CONCEPTMAP_GROUP_TARGET_DISPLAY_INVALID = The target display ''{0}'' for the code ''{2}'' is not valid. Possible displays: {1} CONCEPTMAP_GROUP_TARGET_PROPERTY_INVALID = The property code ''{0}'' is not known CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_MISMATCH = The type of this property should be {1} not {0} CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_NO_SYSTEM = Since no system has been provided, a plain code cannot be used @@ -932,7 +918,7 @@ CONCEPTMAP_GROUP_TARGET_INCOMPLETE = Target Code System {0} doesn''t have all co SD_NO_TYPE_CODE_ON_CODE = Snapshot for {1} element {0} has type.code without a value UNKNOWN_CODESYSTEM = A definition for CodeSystem ''{0}'' could not be found, so the code cannot be validated UNKNOWN_CODESYSTEM_VERSION = A definition for CodeSystem ''{0}'' version ''{1}'' could not be found, so the code cannot be validated. Valid versions: {2} -UNABLE_TO_INFER_CODESYSTEM = The System URI could not be determined for the code {0} in the ValueSet {1} +UNABLE_TO_INFER_CODESYSTEM = The System URI could not be determined for the code ''{0}'' in the ValueSet ''{1}'' VALUESET_TOO_COSTLY = The value set ''{0}'' expansion has too many codes to display ({1}) VALUESET_TOO_COSTLY_COUNT = The value set ''{0}'' expansion has {2} codes, which is too many to display ({1}) VALUESET_TOO_COSTLY_TIME = The value set ''{0}'' expansion took too long to process (>{1}sec) @@ -959,11 +945,6 @@ SD_OBGLIGATION_INHERITS_PROFILE_NO_TARGET = Unable to read a value from this ext SD_OBGLIGATION_INHERITS_PROFILE_TARGET_NOT_FOUND = The profile ''{0}'' could not be found SD_OBGLIGATION_INHERITS_PROFILE_NOT_RIGHT_TYPE = The profile ''{0}'' is not marked as an obligation profile SD_OBGLIGATION_INHERITS_PROFILE_NOT_RIGHT_BASE = The profile ''{0}'' has a different base ''{1}'' from that expected ''{2}'' -RND_CS_CONTENT_COMPLETE = This <param name="cased"/> code system <param name="cs"/> defines the following code<if test="code-count != 1">s</if><param name="h"/>: -RND_CS_CONTENT_EXAMPLE = This <param name="cased"/> code system <param name="cs"/> provides some code<if test="code-count != 1">s</if><param name="h"/> <b>that are example only</b>: -RND_CS_CONTENT_FRAGMENT = This <param name="cased"/> code system <param name="cs"/> provides <b>a fragment</b> that includes following code<if test="code-count != 1">s</if><param name="h"/>: -RND_CS_CONTENT_NOTPRESENT = This <param name="cased"/> code system <param name="cs"/> defines codes<param name="h"/>, but no codes are represented here -RND_CS_CONTENT_SUPPLEMENT = This code system <param name="cs"/> defines {0} on the following code<if test="code-count != 1">s</if>: QUESTIONNAIRE_Q_UNKNOWN_DERIVATION = The questionnaire ''{0}'' referred to in the derivation could not be found QUESTIONNAIRE_Q_NO_DERIVATION_TYPE = The questionnaire ''{0}'' has no derivation type specified using the ''http://hl7.org/fhir/StructureDefinition/questionnaire-derivationType'' extension, so derivation has not been checked QUESTIONNAIRE_Q_NO_DERIVATION_TYPE_VALUE = The derivation extension has no value @@ -1056,10 +1037,9 @@ VALUESET_CIRCULAR_REFERENCE = Found a circularity pointing to {0} processing Val VALUESET_SUPPLEMENT_MISSING_one = Required supplement not found: {1} VALUESET_SUPPLEMENT_MISSING_other = Required supplements not found: {1} CONCEPTMAP_VS_TOO_MANY_CODES = The concept map has too many codes to validate ({0}) -CONCEPTMAP_VS_CONCEPT_CODE_UNKNOWN_SYSTEM = The code ''{1}'' comes from the system {0} which could not be found, so it''s not known whether it''s valid in the value set ''{2}'' CONCEPTMAP_VS_INVALID_CONCEPT_CODE = The code ''{1}'' in the system {0} is not valid in the value set ''{2}'' CONCEPTMAP_VS_INVALID_CONCEPT_CODE_VER = The code ''{2}'' in the system {0} version {1} is not valid in the value set ''{3}'' -VALUESET_INC_TOO_MANY_CODES = The value set include has too many codes to validate ({0}) +VALUESET_INC_TOO_MANY_CODES = The value set include has too many codes to validate ({0}), so each individual code has not been checked BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_NO_MATCH = The {1} resource did not match any of the allowed profiles (Type {2}: {3}) BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_MULTIPLE_MATCHES = The {1} resource matched more than one of the allowed profiles ({3}) BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_NO_MATCH_REASON = The {1} resource did not math the profile {2} because: {3} @@ -1106,3 +1086,57 @@ TX_GENERAL_CC_ERROR_MESSAGE = No valid coding was found for the value set ''{0}' Validation_VAL_Profile_Minimum_SLICE_one = Slice ''{3}'': a matching slice is required, but not found (from {1}). Note that other slices are allowed in addition to this required slice Validation_VAL_Profile_Minimum_SLICE_other = Slice ''{3}'': minimum required = {0}, but only found {7} (from {1}) FHIRPATH_UNKNOWN_EXTENSION = Reference to an unknown extension - double check that the URL ''{0}'' is correct +Type_Specific_Checks_DT_XHTML_Resolve = Hyperlink ''{0}'' at ''{1}'' for ''{2}''' does not resolve +Type_Specific_Checks_DT_XHTML_Resolve_Img = Image source ''{0}'' at ''{1}'' does not resolve +TYPE_SPECIFIC_CHECKS_DT_XHTML_MULTIPLE_MATCHES = Hyperlink ''{0}'' at ''{1}'' for ''{2}'' resolves to multiple targets ({3}) +CONTAINED_ORPHAN_DOM3 = The contained resource ''{0}'' is not referenced to from elsewhere in the containing resource nor does it refer to the containing resource (dom-3) +VALUESET_INCLUDE_CS_NOT_CS = The include system ''{0}'' is a reference to a contained resource, but the contained resource with that id is not a CodeSystem, it's a {1} +VALUESET_INCLUDE_CS_NOT_FOUND = No matching contained code system found for system ''{0}'' +VALUESET_INCLUDE_CSVER_NOT_FOUND = No matching contained code system found for system ''{0}'' version ''{1}'' +VALUESET_INCLUDE_CS_MULTI_FOUND = Multiple matching contained code systems found for system ''{0}'' +VALUESET_INCLUDE_CSVER_MULTI_FOUND = Multiple matching contained code systems found for system ''{0}'' version ''{1}'' +CODE_CASE_DIFFERENCE = The code ''{0}'' differs from the correct code ''{1}'' by case. Although the code system ''{2}'' is case insensitive, implementers are strongly encouraged to use the correct case anyway +SCT_NO_MRCM = Not validated against the Machine Readable Concept Model (MRCM) +ILLEGAL_PROPERTY = The property ''{0}'' is invalid +VALUESET_INCLUDE_SYSTEM_ABSOLUTE = URI values in ValueSet.compose.include.system must be absolute +VALUESET_INCLUDE_SYSTEM_ABSOLUTE_FRAG = URI values in ValueSet.compose.include.system must be absolute. To reference a contained code system, use the full CodeSystem URL and reference it using the http://hl7.org/fhir/StructureDefinition/valueset-system extension +CODESYSTEM_CS_SUPP_NO_SUPP = The code system is marked as a supplement, but it does not define what code system it supplements +VALUESET_INCLUDE_CS_CONTENT = The value set references CodeSystem ''{0}'' which has status ''{1}'' +VALUESET_INCLUDE_CSVER_CONTENT = The value set references CodeSystem ''{0}'' version ''{2}'' which has status ''{1}'' +VALUESET_INCLUDE_CS_SUPPLEMENT = The value set references CodeSystem ''{0}'' which is a supplement. It must reference the underlying CodeSystem ''{1}'' and use the http://hl7.org/fhir/StructureDefinition/valueset-supplement extension for the supplement +VALUESET_INCLUDE_CSVER_SUPPLEMENT = The value set references CodeSystem ''{0}'' version ''{2}'' which is a supplement. It must reference the underlying CodeSystem ''{1}'' and use the http://hl7.org/fhir/StructureDefinition/valueset-supplement extension for the supplement +CODESYSTEM_SUPP_NO_DISPLAY = This display (''{0}'') differs from that defined by the base code system (''{1}''). Both displays claim to be 'the "primary designation" for the same language (''{2}''), and the correct interpretation of this is undefined +CODESYSTEM_NOT_CONTAINED = CodeSystems are referred to directly from Coding.system, so it's generally best for them not to be contained resources +CODESYSTEM_THO_CHECK = Most code systems defined in HL7 IGs will need to move to THO later during the process. Consider giving this code system a THO URL now (See https://confluence.hl7.org/display/TSMG/Terminology+Play+Book, and/or talk to TSMG) +TYPE_SPECIFIC_CHECKS_DT_CANONICAL_MULTIPLE_POSSIBLE_VERSIONS = There are multiple different potential matches for the url ''{0}''. It might be a good idea to fix to the correct version to reduce the likelihood of a wrong version being selected by an implementation/implementer. Using version ''{1}'', found versions: {2} +ABSTRACT_CODE_NOT_ALLOWED = Code ''{0}#{1}'' is abstract, and not allowed in this context +CODESYSTEM_PROPERTY_DUPLICATE_URI = A property is already defined with the URI ''{0}'' +CODESYSTEM_PROPERTY_BAD_HL7_URI = Unknown CodeSystem Property ''{0}''. If you are creating your own property, do not create it in the HL7 namespace +CODESYSTEM_PROPERTY_SYNONYM_CHECK = The synonym ''{0}'' is not also defined in the code system. The Synonym property should only used to declare equivalence to other existing codes +CODESYSTEM_PROPERTY_DUPLICATE_CODE = A property is already defined with the code ''{0}'' +CODESYSTEM_PROPERTY_URI_CODE_MISMATCH = The URI ''{0}'' is normally assigned the code ''{1}''. Using the code ''{2}'' will usually create confusion in ValueSet filters etc +CODESYSTEM_PROPERTY_URI_TYPE_MISMATCH = Wrong type ''{2}'': The URI ''{0}'' identifies a property that has the type ''{1}'' +CODESYSTEM_PROPERTY_UNKNOWN_CODE = This property has only a code (''{0}'') and not a URI, so it has no clearly defined meaning in the terminology ecosystem +CODESYSTEM_PROPERTY_KNOWN_CODE_SUGGESTIVE = This property has only the standard code (''{0}'') but not the standard URI ''{1}'', so it has no clearly defined meaning in the terminology ecosystem +CODESYSTEM_PROPERTY_CODE_TYPE_MISMATCH = Wrong type ''{2}'': The code ''{0}'' identifies a property that has the type ''{1}'' +CODESYSTEM_PROPERTY_UNDEFINED = The property ''{0}'' has no definition in CodeSystem.property. Many terminology tools won''t know what to do with it +CODESYSTEM_PROPERTY_NO_VALUE = The property ''{0}'' has no value, and cannot be understoof +CODESYSTEM_PROPERTY_WRONG_TYPE = The property ''{0}'' has the invalid type ''{1}'', when it is defined to have the type ''{2}'' +CODESYSTEM_DESIGNATION_DISP_CLASH_NO_LANG = The designation ''{0}'' has no use and no language, so is not differentiated from the base display (''{1}'') +CODESYSTEM_DESIGNATION_DISP_CLASH_LANG = The designation ''{0}'' has no use and is in the same language (''{2}''), so is not differentiated from the base display (''{1}'') +VALUESET_UNKNOWN_FILTER_PROPERTY = The property ''{0}'' is not known for the system ''{1}'', so may not be understood by the terminology ecosystem. Known properties for this system: {2} +VALUESET_UNKNOWN_FILTER_PROPERTY_NO_CS = No definition can be found for the system {1}, and the property ''{0}'' is not a generally known property, so the property might not be valid, or understood by the terminology ecosystem. In case it's useful, the list of generally known properties for all systems is {2} +VALUESET_BAD_FILTER_VALUE_BOOLEAN = The value for a filter based on property ''{0}'' must be either ''true'' or ''false'', not ''{1}'' +VALUESET_BAD_FILTER_VALUE_CODE = The value for a filter based on property ''{0}'' must be a valid code, not ''{1}'' +VALUESET_BAD_FILTER_VALUE_DATETIME = The value for a filter based on property ''{0}'' must be a valid date(/time), not ''{1}'' +VALUESET_BAD_FILTER_VALUE_DECIMAL = The value for a filter based on property ''{0}'' must be a decimal value, not ''{1}'' +VALUESET_BAD_FILTER_VALUE_INTEGER = The value for a filter based on property ''{0}'' must be integer value, not ''{1}'' +VALUESET_BAD_FILTER_VALUE_VALID_CODE = The value for a filter based on property ''{0}'' must be a valid code from the system ''{2}'', and ''{1}'' is not ({3}) +VALUESET_BAD_FILTER_VALUE_CODED = The value for a filter based on property ''{0}'' must be in the format system(|version)#code, not ''{1}'' +VALUESET_BAD_FILTER_VALUE_CODED_INVALID = The value for a filter based on property ''{0}'' is ''{1}'' which is not a valid code ({2}) +VALUESET_BAD_FILTER_OP = The operation ''{0}'' is not allowed for property ''{1}''. Allowed ops: {2} +VALUESET_BAD_FILTER_VALUE_HAS_COMMA = The filter value has a comma, but the operation is different to 'in' and 'not-in', so the comma will be interpreted as part of the {0} value +VALUESET_BAD_FILTER_VALUE_VALID_REGEX = The value for a filter based on property ''{0}'' should be a valid regex, not ''{1}'' (err = ''{2}'') +VALUESET_BAD_PROPERTY_NO_REGEX = Cannot apply a regex filter to the property ''{0}'' (usually regex filters are applied to the codes, or a named property of the code system) +CODESYSTEM_PROPERTY_CODE_WARNING = If the type is ''code'', then the valueSet property should be provided to clarify what kind of code will be found in the element + diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages_de.properties b/org.hl7.fhir.utilities/src/main/resources/Messages_de.properties index 8e07ca70b..48e455e0a 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages_de.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages_de.properties @@ -702,22 +702,6 @@ SD_MUST_HAVE_DERIVATION=StructureDefinition {0} muss eine Ableitung haben, da si VALIDATION_VAL_PROFILE_OTHER_VERSION=Profil ist f\u00fcr eine andere Version von FHIR ({0}) und wurde daher ignoriert VALIDATION_VAL_PROFILE_THIS_VERSION_OK=Profil f\u00fcr diese Version von FHIR - alles OK VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER=Profil ist f\u00fcr diese Version von FHIR, aber ist ein ung\u00fcltiger Typ {0} -RENDER_BUNDLE_HEADER_ROOT=Bundle {0} vom Typ {1} -RENDER_BUNDLE_HEADER_ENTRY=Entry {0} -RENDER_BUNDLE_HEADER_ENTRY_URL=Entry {0} - fullUrl = {1} -RENDER_BUNDLE_RESOURCE=Ressource {0}: -RENDER_BUNDLE_SEARCH=Suche: -RENDER_BUNDLE_SEARCH_MODE=Mode = {0} -RENDER_BUNDLE_SEARCH_SCORE=Score = {0} -RENDER_BUNDLE_RESPONSE=Response: -RENDER_BUNDLE_LOCATION=Location = {0} -RENDER_BUNDLE_ETAG=ETag = {0} -RENDER_BUNDLE_LAST_MOD=LastModified = {0} -RENDER_BUNDLE_REQUEST=Request: -RENDER_BUNDLE_IF_NON_MATCH=If-None-Match = {0} -RENDER_BUNDLE_IF_MOD=If-Modified-Since = {0} -RENDER_BUNDLE_IF_MATCH=If-Match = {0} -RENDER_BUNDLE_IF_NONE=If-None-Exist = {0} BUNDLE_RULE_NONE=Keine Regel BUNDLE_RULE_UNKNOWN=Bundle Rule verweist auf ung\u00fcltige Ressource {0} BUNDLE_RULE_INVALID_INDEX=Bundle Rules Index ist ung\u00fcltig ({0}) diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages_es.properties b/org.hl7.fhir.utilities/src/main/resources/Messages_es.properties index a38e01313..46caaeb83 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages_es.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages_es.properties @@ -654,22 +654,6 @@ SD_MUST_HAVE_DERIVATION = El recurso StructureDefinition {0} debe tener una deri VALIDATION_VAL_PROFILE_OTHER_VERSION = El perfil es para una versión diferente de FHIR ({0}) así que fue ignorado VALIDATION_VAL_PROFILE_THIS_VERSION_OK = El perfil es para esta versión de FHIR- Todo OK VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = El perfil es para esta versión de FHIR, pero es de tipo inválido {0} -RENDER_BUNDLE_HEADER_ROOT = Bundle {0} De tipo {1} -RENDER_BUNDLE_HEADER_ENTRY = Entry {0} -RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - FullURL = {1} -RENDER_BUNDLE_RESOURCE = Recurso {0}: -RENDER_BUNDLE_SEARCH = Búsqueda: -RENDER_BUNDLE_SEARCH_MODE = mode = {0} -RENDER_BUNDLE_SEARCH_SCORE = score = {0} -RENDER_BUNDLE_RESPONSE = Respuesta: -RENDER_BUNDLE_LOCATION = Location = {0} -RENDER_BUNDLE_ETAG = ETag = {0} -RENDER_BUNDLE_LAST_MOD = LastModified = {0} -RENDER_BUNDLE_REQUEST = Request: -RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0} -RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0} -RENDER_BUNDLE_IF_MATCH = If-Match = {0} -RENDER_BUNDLE_IF_NONE = If-None-Exist = {0} BUNDLE_RULE_NONE = Sin reglas BUNDLE_RULE_UNKNOWN = LA regla del Bundle refiere a un recurso inválido {0} BUNDLE_RULE_INVALID_INDEX = El indice de la regla de Bundle no es válido ({0}) diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages_ja.properties b/org.hl7.fhir.utilities/src/main/resources/Messages_ja.properties index d728c5483..84e4fe9b0 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages_ja.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages_ja.properties @@ -644,22 +644,6 @@ VALIDATION_VAL_PROFILE_THIS_VERSION_OK = このバージョンのFHIRのプロ VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = プロファイルはこのバージョンのFHIRのためのものですが、無効な型{0}です BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_one = BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_other = {0}個のプロファイルが{1}リソースに対して見つかりました。現時点では一つ以上はサポートされていません。(タイプ{2}: {3}) -RENDER_BUNDLE_HEADER_ROOT = タイプ {1} のバンドル {0} -RENDER_BUNDLE_HEADER_ENTRY = エントリ {0} -RENDER_BUNDLE_HEADER_ENTRY_URL = エントリ {0} - fullUrl = {1} -RENDER_BUNDLE_RESOURCE = Resource {0}: -RENDER_BUNDLE_SEARCH = Search: -RENDER_BUNDLE_SEARCH_MODE = Mode = {0} -RENDER_BUNDLE_SEARCH_SCORE = Score = {0} -RENDER_BUNDLE_RESPONSE = Response: -RENDER_BUNDLE_LOCATION = Location = {0} -RENDER_BUNDLE_ETAG = ETag = {0} -RENDER_BUNDLE_LAST_MOD = LastModified = {0} -RENDER_BUNDLE_REQUEST = Request: -RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0} -RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0} -RENDER_BUNDLE_IF_MATCH = If-Match = {0} -RENDER_BUNDLE_IF_NONE = If-None-Exist = {0} BUNDLE_RULE_NONE = No Rule BUNDLE_RULE_UNKNOWN = Bundle Ruleは無効なリソース {0} を参照しています BUNDLE_RULE_INVALID_INDEX = Bundle Rulesのインデックスが無効です ({0}) @@ -936,11 +920,6 @@ SD_OBGLIGATION_INHERITS_PROFILE_NO_TARGET = このextensionから値を読み SD_OBGLIGATION_INHERITS_PROFILE_TARGET_NOT_FOUND = プロファイル ''{0}'' が見つかりませんでした SD_OBGLIGATION_INHERITS_PROFILE_NOT_RIGHT_TYPE = プロファイル ''{0}'' はobligationプロファイルとしてマークされていません SD_OBGLIGATION_INHERITS_PROFILE_NOT_RIGHT_BASE = プロファイル ''{0}'' は予期された ''{2}'' ではなく、異なるベース''{1}'' を持っています -RND_CS_CONTENT_COMPLETE = この<param name="cased"/>コードシステム <param name="cs"/> は次のコード<if test="code-count != 1">たち</if><param name="h"/>を定義します: -RND_CS_CONTENT_EXAMPLE = この<param name="cased"/>コードシステム <param name="cs"/> はいくつかの例コード<if test="code-count != 1">たち</if><param name="h"/>を提供します: -RND_CS_CONTENT_FRAGMENT = この<param name="cased"/>コードシステム <param name="cs"/> は以下のコード<param name="h"/>を含むフラグメントを提供します: -RND_CS_CONTENT_NOTPRESENT = このコードシステム <param name="cs"/> はコード<param name="h"/>を定義しますが、ここではコードは表現されていません -RND_CS_CONTENT_SUPPLEMENT = このコードシステム <param name="cs"/> は次のコードに {0} を定義します: QUESTIONNAIRE_Q_UNKNOWN_DERIVATION = 派生に参照されるQuestionnaire ''{0}'' が見つかりませんでした QUESTIONNAIRE_Q_NO_DERIVATION_TYPE = Questionnaire ''{0}'' は ''http://hl7.org/fhir/StructureDefinition/questionnaire-derivationType'' 拡張を使用して派生タイプが指定されていないため、派生がチェックされていません QUESTIONNAIRE_Q_NO_DERIVATION_TYPE_VALUE = 派生extensionには値がありません diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages_nl.properties b/org.hl7.fhir.utilities/src/main/resources/Messages_nl.properties index ec0c21b30..9364b35d4 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages_nl.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages_nl.properties @@ -644,22 +644,6 @@ SD_MUST_HAVE_DERIVATION = StructureDefinition {0} moet een derivation bevatten, VALIDATION_VAL_PROFILE_OTHER_VERSION = Profiel is voor een andere versie van FHIR ({0}) dus wordt genegeerd VALIDATION_VAL_PROFILE_THIS_VERSION_OK = Profiel voor deze versie van FHIR - alles in orde VALIDATION_VAL_PROFILE_THIS_VERSION_OTHER = Profiel is voor deze versie van FHIR, maar heeft een onjuist type {0} -RENDER_BUNDLE_HEADER_ROOT = Bundle {0} van type {1} -RENDER_BUNDLE_HEADER_ENTRY = Entry {0} -RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - Full URL = {1} -RENDER_BUNDLE_RESOURCE = Resource {0}: -RENDER_BUNDLE_SEARCH = Zoeken: -RENDER_BUNDLE_SEARCH_MODE = mode = {0} -RENDER_BUNDLE_SEARCH_SCORE = score = {0} -RENDER_BUNDLE_RESPONSE = Response: -RENDER_BUNDLE_LOCATION = Location = {0} -RENDER_BUNDLE_ETAG = ETag = {0} -RENDER_BUNDLE_LAST_MOD = LastModified = {0} -RENDER_BUNDLE_REQUEST = Request: -RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0} -RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0} -RENDER_BUNDLE_IF_MATCH = If-Match = {0} -RENDER_BUNDLE_IF_NONE = If-None-Exist = {0} BUNDLE_RULE_NONE = Geen regel BUNDLE_RULE_UNKNOWN = Bundle-regel wijst naar ongeldige resource {0} BUNDLE_RULE_INVALID_INDEX = Index van Bundle-regels is ongeldig ({0}) diff --git a/org.hl7.fhir.utilities/src/main/resources/rendering-phrases.properties b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases.properties new file mode 100644 index 000000000..856b8a843 --- /dev/null +++ b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases.properties @@ -0,0 +1,84 @@ +# Rendering +RENDER_BUNDLE_HEADER_ROOT = Bundle {0} of type {1} +RENDER_BUNDLE_HEADER_ENTRY = Entry {0} +RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - fullUrl = {1} +RENDER_BUNDLE_RESOURCE = Resource {0}: +RENDER_BUNDLE_SEARCH = Search: +RENDER_BUNDLE_SEARCH_MODE = Mode = {0} +RENDER_BUNDLE_SEARCH_SCORE = Score = {0} +RENDER_BUNDLE_RESPONSE = Response: +RENDER_BUNDLE_LOCATION = Location = {0} +RENDER_BUNDLE_ETAG = ETag = {0} +RENDER_BUNDLE_LAST_MOD = LastModified = {0} +RENDER_BUNDLE_REQUEST = Request: +RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0} +RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0} +RENDER_BUNDLE_IF_MATCH = If-Match = {0} +RENDER_BUNDLE_IF_NONE = If-None-Exist = {0} +SD_HEAD_NAME = Name +SD_HEAD_NAME_DESC = The logical name of the element +SD_HEAD_FLAGS = Flags +SD_HEAD_FLAGS_DESC = Information about the use of the element +SD_HEAD_CARD = Card. +SD_HEAD_CARD_DESC = Minimum and Maximum # of times the the element can appear in the instance +SD_HEAD_TYPE = Type +SD_HEAD_TYPE_DESC = Reference to the type of the element +SD_HEAD_DESC = Description & Constraints +SD_HEAD_DESC_DESC = Additional information about the element +SD_COMP_HEAD_NAME = Name +SD_COMP_HEAD_NAME_DESC = The logical name of the element +SD_COMP_HEAD_FLAGS_L = L Flags +SD_COMP_HEAD_FLAGS_L_DESC = Information about the use of the element - Left Structure +SD_COMP_HEAD_CARD_L = L Card. +SD_COMP_HEAD_CARD_L_DESC = Minimum and Maximum # of times the the element can appear in the instance - Left Structure +SD_COMP_HEAD_TYPE_L = L Type +SD_COMP_HEAD_TYPE_L_DESC = Reference to the type of the element - Left Structure +SD_COMP_HEAD_DESC_L = L Description & Constraints +SD_COMP_HEAD_DESC_L_DESC = Additional information about the element - Left Structure +SD_COMP_HEAD_FLAGS_R = R Flags +SD_COMP_HEAD_FLAGS_R_DESC = Information about the use of the element - Right Structure +SD_COMP_HEAD_CARD_R = R Card. +SD_COMP_HEAD_CARD_R_DESC = Minimum and Maximum # of times the the element can appear in the instance - Right Structure +SD_COMP_HEAD_TYPE_R = R Type +SD_COMP_HEAD_TYPE_R_DESC = Reference to the type of the element - Right Structure +SD_COMP_HEAD_DESC_R = R Description & Constraints +SD_COMP_HEAD_DESC_R_DESC = Additional information about the element - Right Structure +SD_COMP_HEAD_COMP = Comments +SD_COMP_HEAD_COMP_DESC = Comments about the comparison +SD_GRID_HEAD_NAME = Name +SD_GRID_HEAD_NAME_DESC = The name of the element (Slice name in brackets). Mouse-over provides definition +SD_GRID_HEAD_CARD = Card. +SD_GRID_HEAD_CARD_DESC = Minimum and Maximum # of times the the element can appear in the instance. Super-scripts indicate additional constraints on appearance +SD_GRID_HEAD_TYPE = Type +SD_GRID_HEAD_TYPE_DESC = Reference to the type of the element +SD_GRID_HEAD_DESC = Constraints and Usage +SD_GRID_HEAD_DESC_DESC = Fixed values, length limits, vocabulary bindings and other usage notes +SD_LEGEND = Legend for this format +SD_DOCO = Documentation for this format +RENDER_RESOURCE_COPYRIGHT = Copyright Statement: +RENDER_CODESYSTEM_FILTERS = Filters +RENDER_CODESYSTEM_FILTER_CODE = Code +RENDER_CODESYSTEM_FILTER_DESC = Description +RENDER_CODESYSTEM_FILTER_OP = Operator +RENDER_CODESYSTEM_FILTER_VALUE = Value +RENDER_CODESYSTEM_PROPS = Properties +RENDER_CODESYSTEM_PROPS_DESC = This code system defines the following properties for its concepts +RENDER_CODESYSTEM_PROP_NAME = Name +RENDER_CODESYSTEM_PROP_CODE = Code +RENDER_CODESYSTEM_PROP_URI = URI +RENDER_CODESYSTEM_PROP_TYPE = Type +RENDER_CODESYSTEM_PROP_DESC = Description +RND_CS_CONTENT_COMPLETE = This <param name="cased"/> code system <param name="cs"/> defines the following code<if test="code-count != 1">s</if><param name="h"/>: +RND_CS_CONTENT_EXAMPLE = This <param name="cased"/> code system <param name="cs"/> provides some code<if test="code-count != 1">s</if><param name="h"/> <b>that are example only</b>: +RND_CS_CONTENT_FRAGMENT = This <param name="cased"/> code system <param name="cs"/> provides <b>a fragment</b> that includes following code<if test="code-count != 1">s</if><param name="h"/>: +RND_CS_CONTENT_NOTPRESENT = This <param name="cased"/> code system <param name="cs"/> defines codes<param name="h"/>, but no codes are represented here +RND_CS_CONTENT_SUPPLEMENT = This code system <param name="cs"/> defines {0} on the following code<if test="code-count != 1">s</if>: +RENDER_CODESYSTEM_CONCEPTS = Concepts +RENDER_CODESYSTEM_DEPRECATED = Deprecated +RENDER_TX_CODE = Code +RENDER_TX_DISPLAY = Display +RENDER_TX_DEFINITION = Definition +RENDER_TX_DEPRECATED = Deprecated +RENDER_TX_COMMENTS = Comments +RENDER_TX_VERSION = Version +SD_SLICING_INFO = {0}, {1} by {2} \ No newline at end of file diff --git a/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_de.properties b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_de.properties new file mode 100644 index 000000000..ff1da5ec5 --- /dev/null +++ b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_de.properties @@ -0,0 +1,17 @@ +# Rendering +RENDER_BUNDLE_HEADER_ROOT=Bundle {0} vom Typ {1} +RENDER_BUNDLE_HEADER_ENTRY=Entry {0} +RENDER_BUNDLE_HEADER_ENTRY_URL=Entry {0} - fullUrl = {1} +RENDER_BUNDLE_RESOURCE=Ressource {0}: +RENDER_BUNDLE_SEARCH=Suche: +RENDER_BUNDLE_SEARCH_MODE=Mode = {0} +RENDER_BUNDLE_SEARCH_SCORE=Score = {0} +RENDER_BUNDLE_RESPONSE=Response: +RENDER_BUNDLE_LOCATION=Location = {0} +RENDER_BUNDLE_ETAG=ETag = {0} +RENDER_BUNDLE_LAST_MOD=LastModified = {0} +RENDER_BUNDLE_REQUEST=Request: +RENDER_BUNDLE_IF_NON_MATCH=If-None-Match = {0} +RENDER_BUNDLE_IF_MOD=If-Modified-Since = {0} +RENDER_BUNDLE_IF_MATCH=If-Match = {0} +RENDER_BUNDLE_IF_NONE=If-None-Exist = {0} diff --git a/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_es.properties b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_es.properties new file mode 100644 index 000000000..8990e718f --- /dev/null +++ b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_es.properties @@ -0,0 +1,17 @@ +# Rendering +RENDER_BUNDLE_HEADER_ROOT = Bundle {0} De tipo {1} +RENDER_BUNDLE_HEADER_ENTRY = Entry {0} +RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - FullURL = {1} +RENDER_BUNDLE_RESOURCE = Recurso {0}: +RENDER_BUNDLE_SEARCH = Búsqueda: +RENDER_BUNDLE_SEARCH_MODE = mode = {0} +RENDER_BUNDLE_SEARCH_SCORE = score = {0} +RENDER_BUNDLE_RESPONSE = Respuesta: +RENDER_BUNDLE_LOCATION = Location = {0} +RENDER_BUNDLE_ETAG = ETag = {0} +RENDER_BUNDLE_LAST_MOD = LastModified = {0} +RENDER_BUNDLE_REQUEST = Request: +RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0} +RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0} +RENDER_BUNDLE_IF_MATCH = If-Match = {0} +RENDER_BUNDLE_IF_NONE = If-None-Exist = {0} diff --git a/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_ja.properties b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_ja.properties new file mode 100644 index 000000000..36fd58921 --- /dev/null +++ b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_ja.properties @@ -0,0 +1,22 @@ +# Rendering +RENDER_BUNDLE_HEADER_ROOT = タイプ {1} のバンドル {0} +RENDER_BUNDLE_HEADER_ENTRY = エントリ {0} +RENDER_BUNDLE_HEADER_ENTRY_URL = エントリ {0} - fullUrl = {1} +RENDER_BUNDLE_RESOURCE = Resource {0}: +RENDER_BUNDLE_SEARCH = Search: +RENDER_BUNDLE_SEARCH_MODE = Mode = {0} +RENDER_BUNDLE_SEARCH_SCORE = Score = {0} +RENDER_BUNDLE_RESPONSE = Response: +RENDER_BUNDLE_LOCATION = Location = {0} +RENDER_BUNDLE_ETAG = ETag = {0} +RENDER_BUNDLE_LAST_MOD = LastModified = {0} +RENDER_BUNDLE_REQUEST = Request: +RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0} +RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0} +RENDER_BUNDLE_IF_MATCH = If-Match = {0} +RENDER_BUNDLE_IF_NONE = If-None-Exist = {0} +RND_CS_CONTENT_COMPLETE = この<param name="cased"/>コードシステム <param name="cs"/> は次のコード<if test="code-count != 1">たち</if><param name="h"/>を定義します: +RND_CS_CONTENT_EXAMPLE = この<param name="cased"/>コードシステム <param name="cs"/> はいくつかの例コード<if test="code-count != 1">たち</if><param name="h"/>を提供します: +RND_CS_CONTENT_FRAGMENT = この<param name="cased"/>コードシステム <param name="cs"/> は以下のコード<param name="h"/>を含むフラグメントを提供します: +RND_CS_CONTENT_NOTPRESENT = このコードシステム <param name="cs"/> はコード<param name="h"/>を定義しますが、ここではコードは表現されていません +RND_CS_CONTENT_SUPPLEMENT = このコードシステム <param name="cs"/> は次のコードに {0} を定義します: diff --git a/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_nl.properties b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_nl.properties new file mode 100644 index 000000000..c219a1de4 --- /dev/null +++ b/org.hl7.fhir.utilities/src/main/resources/rendering-phrases_nl.properties @@ -0,0 +1,17 @@ +# Rendering +RENDER_BUNDLE_HEADER_ROOT = Bundle {0} van type {1} +RENDER_BUNDLE_HEADER_ENTRY = Entry {0} +RENDER_BUNDLE_HEADER_ENTRY_URL = Entry {0} - Full URL = {1} +RENDER_BUNDLE_RESOURCE = Resource {0}: +RENDER_BUNDLE_SEARCH = Zoeken: +RENDER_BUNDLE_SEARCH_MODE = mode = {0} +RENDER_BUNDLE_SEARCH_SCORE = score = {0} +RENDER_BUNDLE_RESPONSE = Response: +RENDER_BUNDLE_LOCATION = Location = {0} +RENDER_BUNDLE_ETAG = ETag = {0} +RENDER_BUNDLE_LAST_MOD = LastModified = {0} +RENDER_BUNDLE_REQUEST = Request: +RENDER_BUNDLE_IF_NON_MATCH = If-None-Match = {0} +RENDER_BUNDLE_IF_MOD = If-Modified-Since = {0} +RENDER_BUNDLE_IF_MATCH = If-Match = {0} +RENDER_BUNDLE_IF_NONE = If-None-Exist = {0} diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/xhtml/XhtmlNodeTest.java similarity index 97% rename from org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java rename to org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/xhtml/XhtmlNodeTest.java index 06e0fec73..5dd09e3e2 100644 --- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/xhtml/XhtmlNodeTest.java @@ -1,4 +1,4 @@ -package org.hl7.fhir.utilities.tests; +package org.hl7.fhir.utilities.xhtml; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -6,6 +6,7 @@ import java.io.ObjectOutputStream; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRFormatError; +import org.hl7.fhir.utilities.tests.BaseTestingUtilities; import org.hl7.fhir.utilities.xhtml.NodeType; import org.hl7.fhir.utilities.xhtml.XhtmlComposer; import org.hl7.fhir.utilities.xhtml.XhtmlNode; @@ -145,9 +146,8 @@ public class XhtmlNodeTest { String src = BaseTestingUtilities.loadTestResource("xhtml", "xhtml-empty-elements.xml"); XhtmlNode x = new XhtmlParser().parse(src, "xml"); - - String xml = new XhtmlComposer(false, false).compose(x); - Assertions.assertEquals(src.trim(), xml.trim()); + String xml = new XhtmlComposer(true, false).compose(x); + Assertions.assertEquals("<xml xmlns=\"http://something\"><empty attr=\"1\"/><empty attr=\"2\"/></xml>", xml.trim()); } @Test diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 2b5c71af0..af24d82e7 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>org.hl7.fhir.core</artifactId> - <version>6.2.14-SNAPSHOT</version> + <version>6.3.4-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 049ac38c4..35580642e 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>org.hl7.fhir.core</artifactId> - <version>6.2.14-SNAPSHOT</version> + <version>6.3.4-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java index 1c25d9281..69aa3548c 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java @@ -59,6 +59,7 @@ import org.hl7.fhir.r5.model.Constants; import org.hl7.fhir.r5.model.DomainResource; import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.StructureDefinition; +import org.hl7.fhir.r5.model.UsageContext; import org.hl7.fhir.r5.model.ValueSet; import org.hl7.fhir.r5.model.Enumerations.PublicationStatus; import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent; @@ -66,6 +67,8 @@ import org.hl7.fhir.r5.terminologies.ValueSetUtilities; import org.hl7.fhir.r5.utils.ToolingExtensions; import org.hl7.fhir.r5.utils.XVerExtensionManager; import org.hl7.fhir.r5.utils.XVerExtensionManager.XVerExtensionStatus; +import org.hl7.fhir.r5.utils.validation.IResourceValidator; +import org.hl7.fhir.r5.utils.validation.IValidatorResourceFetcher; import org.hl7.fhir.r5.utils.validation.ValidationContextCarrier.IValidationContextResourceLoader; import org.hl7.fhir.r5.utils.validation.constants.BestPracticeWarningLevel; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; @@ -75,6 +78,7 @@ import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.i18n.I18nConstants; import org.hl7.fhir.utilities.validation.ValidationMessage; +import org.hl7.fhir.utilities.validation.ValidationOptions; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; import org.hl7.fhir.utilities.validation.ValidationMessage.Source; @@ -85,7 +89,7 @@ import org.hl7.fhir.validation.instance.utils.NodeStack; public class BaseValidator implements IValidationContextResourceLoader { - public class BooleanHolder { + public static class BooleanHolder { private boolean value = true; public BooleanHolder() { @@ -173,7 +177,9 @@ public class BaseValidator implements IValidationContextResourceLoader { protected Set<String> statusWarnings = new HashSet<>(); protected BestPracticeWarningLevel bpWarnings = BestPracticeWarningLevel.Warning; protected String sessionId = Utilities.makeUuidLC(); - + protected List<UsageContext> usageContexts = new ArrayList<UsageContext>(); + protected ValidationOptions baseOptions = new ValidationOptions(FhirPublication.R5); + protected IValidatorResourceFetcher fetcher; public BaseValidator(IWorkerContext context, XVerExtensionManager xverManager, boolean debug) { super(); @@ -204,6 +210,9 @@ public class BaseValidator implements IValidationContextResourceLoader { this.statusWarnings = parent.statusWarnings; this.bpWarnings = parent.bpWarnings; this.urlRegex = parent.urlRegex; + this.usageContexts.addAll(parent.usageContexts); + this.baseOptions = parent.baseOptions; + this.fetcher = parent.fetcher; } private boolean doingLevel(IssueSeverity error) { @@ -1256,13 +1265,15 @@ public class BaseValidator implements IValidationContextResourceLoader { String[] refBaseParts = ref.substring(0, ref.indexOf("/_history/")).split("/"); resourceType = refBaseParts[0]; id = refBaseParts[1]; + targetUrl = base + resourceType+"/"+ id; } else if (base.startsWith("urn")) { resourceType = ref.split("/")[0]; id = ref.split("/")[1]; - } else + targetUrl = base + id; + } else { id = ref; - - targetUrl = base + id; + targetUrl = base + id; + } } List<Element> entries = new ArrayList<Element>(); @@ -1599,4 +1610,22 @@ public class BaseValidator implements IValidationContextResourceLoader { return true; } + public List<UsageContext> getUsageContexts() { + return usageContexts; + } + + protected boolean hasUseContext(Coding use, Coding value) { + for (UsageContext usage : usageContexts) { + if (isContext(use, value, usage)) { + return true; + } + } + return false; + } + + private boolean isContext(Coding use, Coding value, UsageContext usage) { + return usage.getValue() instanceof Coding && context.subsumes(baseOptions, usage.getCode(), use) && context.subsumes(baseOptions, (Coding) usage.getValue(), value); + } + + } \ No newline at end of file diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java index 7df6e0025..97d695064 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java @@ -668,29 +668,21 @@ public class IgLoader implements IValidationEngineLoader { InputStream stream = null; if (explore) { stream = fetchFromUrlSpecific(Utilities.pathURL(src, "package.tgz"), true); - if (stream != null) - return loadPackage(stream, Utilities.pathURL(src, "package.tgz"), false); - // todo: these options are deprecated - remove once all IGs have been rebuilt post R4 technical correction - stream = fetchFromUrlSpecific(Utilities.pathURL(src, "igpack.zip"), true); - if (stream != null) - return readZip(stream); - stream = fetchFromUrlSpecific(Utilities.pathURL(src, "validator.pack"), true); - if (stream != null) - return readZip(stream); - stream = fetchFromUrlSpecific(Utilities.pathURL(src, "validator.pack"), true); - //// ----- + if (stream != null) { + try { + return loadPackage(stream, Utilities.pathURL(src, "package.tgz"), false); + } catch (Exception e) { + // nothing + } + } } // ok, having tried all that... now we'll just try to access it directly byte[] cnt; List<String> errors = new ArrayList<>(); - if (stream != null) { - cnt = TextFile.streamToBytes(stream); - } else { - cnt = fetchFromUrlSpecific(src, "application/json", true, errors); - if (cnt == null) { - cnt = fetchFromUrlSpecific(src, "application/xml", true, errors); - } + cnt = fetchFromUrlSpecific(src, "application/json", true, errors); + if (cnt == null) { + cnt = fetchFromUrlSpecific(src, "application/xml", true, errors); } if (cnt == null) { throw new FHIRException("Unable to fetch content from " + src + " (" + errors.toString() + ")"); @@ -740,7 +732,8 @@ public class IgLoader implements IValidationEngineLoader { return b.toString(); } - private Manager.FhirFormat checkFormat(byte[] cnt, String filename) { + private Manager.FhirFormat checkFormat(byte[] cnt, String filename) throws IOException { + String text = TextFile.bytesToString(cnt); System.out.println(" ..Detect format for " + filename); try { org.hl7.fhir.utilities.json.parser.JsonParser.parseObject(cnt); diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java index 3e5e7bf6e..9cfa43dae 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java @@ -14,9 +14,11 @@ import java.util.Arrays; import java.util.Date; import java.util.EnumSet; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; import java.util.UUID; import org.fhir.ucum.UcumEssenceService; @@ -45,6 +47,7 @@ import org.hl7.fhir.r5.model.Base; import org.hl7.fhir.r5.model.Bundle; import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r5.model.CanonicalResource; +import org.hl7.fhir.r5.model.CanonicalType; import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.DomainResource; import org.hl7.fhir.r5.model.ElementDefinition; @@ -1052,7 +1055,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP } public ValidationEngine setSnomedExtension(String sct) { - getContext().getExpansionParameters().addParameter("system-version", "http://snomed.info/sct|http://snomed.info/sct/" + sct); + getContext().getExpansionParameters().addParameter("system-version", new CanonicalType("http://snomed.info/sct|http://snomed.info/sct/" + sct)); return this; } @@ -1193,7 +1196,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP @Override - public CanonicalResource fetchCanonicalResource(IResourceValidator validator, String url) throws URISyntaxException { + public CanonicalResource fetchCanonicalResource(IResourceValidator validator, Object appContext, String url) throws URISyntaxException { Resource res = context.fetchResource(Resource.class, url); if (res != null) { if (res instanceof CanonicalResource) { @@ -1202,7 +1205,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP return null; } } - return fetcher != null ? fetcher.fetchCanonicalResource(validator, url) : null; + return fetcher != null ? fetcher.fetchCanonicalResource(validator, appContext, url) : null; } @Override @@ -1233,4 +1236,19 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP return EnumSet.allOf(ElementValidationAction.class); } + @Override + public Set<String> fetchCanonicalResourceVersions(IResourceValidator validator, Object appContext, String url) { + Set<String> res = new HashSet<>(); + for (Resource r : context.fetchResourcesByUrl(Resource.class, url)) { + if (r instanceof CanonicalResource) { + CanonicalResource cr = (CanonicalResource) r; + res.add(cr.hasVersion() ? cr.getVersion() : "{{unversioned}}"); + } + } + if (fetcher != null) { + res.addAll(fetcher.fetchCanonicalResourceVersions(validator, appContext, url)); + } + return res; + } + } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java index 1b6ffd0a3..1d9ab26d6 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java @@ -327,12 +327,12 @@ public class ValidatorCli { res.add("-version"); res.add("5.0"); res.add("-ig"); - res.add("hl7.cda.uv.core#2.0.0-sd-ballot"); + res.add("hl7.cda.uv.core#2.0.0-sd-snapshot1"); } else if (a.equals("-ccda")) { res.add("-version"); res.add("5.0"); res.add("-ig"); - res.add("hl7.cda.us.ccda#current"); + res.add("hl7.cda.us.ccda#3.0.0-ballot"); } else if (a.equals("-view-definition")) { res.add("-version"); res.add("5.0"); diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java index 445e8a59b..8b987f826 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java @@ -56,6 +56,8 @@ public class CliContext { private HtmlInMarkdownCheck htmlInMarkdownCheck = HtmlInMarkdownCheck.WARNING; @JsonProperty("allowDoubleQuotesInFHIRPath") private boolean allowDoubleQuotesInFHIRPath = false; + @JsonProperty("disableDefaultResourceFetcher") + private boolean disableDefaultResourceFetcher = false; @JsonProperty("checkIPSCodes") private boolean checkIPSCodes; @JsonProperty("langTransform") @@ -328,6 +330,17 @@ public class CliContext { this.allowDoubleQuotesInFHIRPath = allowDoubleQuotesInFHIRPath; } + @JsonProperty("disableDefaultResourceFetcher") + public boolean isDisableDefaultResourceFetcher() { + return disableDefaultResourceFetcher; + } + + @JsonProperty("disableDefaultResourceFetcher") + public CliContext setDisableDefaultResourceFetcher(boolean disableDefaultResourceFetcher) { + this.disableDefaultResourceFetcher = disableDefaultResourceFetcher; + return this; + } + @JsonProperty("checkIPSCodes") public boolean isCheckIPSCodes() { return checkIPSCodes; diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/StandAloneValidatorFetcher.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/StandAloneValidatorFetcher.java index d4fc89e41..c25ddbe95 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/StandAloneValidatorFetcher.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/StandAloneValidatorFetcher.java @@ -6,9 +6,11 @@ import java.net.URISyntaxException; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; import org.hl7.fhir.convertors.txClient.TerminologyClientFactory; import org.hl7.fhir.exceptions.FHIRException; @@ -272,7 +274,7 @@ public class StandAloneValidatorFetcher implements IValidatorResourceFetcher, IV } @Override - public CanonicalResource fetchCanonicalResource(IResourceValidator validator, String url) throws URISyntaxException { + public CanonicalResource fetchCanonicalResource(IResourceValidator validator, Object appContext, String url) throws URISyntaxException { if (url.contains("|")) { url = url.substring(0, url.indexOf("|")); } @@ -327,4 +329,9 @@ public class StandAloneValidatorFetcher implements IValidatorResourceFetcher, IV return EnumSet.allOf(CodedContentValidationAction.class); } + @Override + public Set<String> fetchCanonicalResourceVersions(IResourceValidator validator, Object appContext, String url) { + return new HashSet<>(); + } + } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java index 1b38b541f..524c04bf5 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java @@ -110,39 +110,29 @@ public class ValidationService { fileToValidate.getFileContent().getBytes(), fileToValidate.getFileName(), false); - fileToValidate.setFileType(format.getExtension()); + if (format != null) { + fileToValidate.setFileType(format.getExtension()); + } } List<ValidationMessage> messages = new ArrayList<>(); - ValidatedFragments validatedFragments = validator.validateAsFragments(fileToValidate.getFileContent().getBytes(), Manager.FhirFormat.getFhirFormat(fileToValidate.getFileType()), - request.getCliContext().getProfiles(), messages); - - if (validatedFragments.getValidatedFragments().size() == 1 && !validatedFragments.getValidatedFragments().get(0).isDerivedContent()) { - ValidatedFragment validatedFragment = validatedFragments.getValidatedFragments().get(0); - ValidationOutcome outcome = new ValidationOutcome(); - FileInfo fileInfo = new FileInfo( - fileToValidate.getFileName(), - new String(validatedFragment.getContent()), - validatedFragment.getExtension()); - outcome.setMessages(validatedFragment.getErrors()); - outcome.setFileInfo(fileInfo); - response.addOutcome(outcome); - } else { - for (ValidatedFragment validatedFragment : validatedFragments.getValidatedFragments()) { - ValidationOutcome outcome = new ValidationOutcome(); - FileInfo fileInfo = new FileInfo( - validatedFragment.getFilename(), - new String(validatedFragment.getContent()), - validatedFragment.getExtension()); - outcome.setMessages(validatedFragment.getErrors()); - outcome.setFileInfo(fileInfo); + if (fileToValidate.getFileType() == null) { + ValidationOutcome outcome = getValidationOutcomeForUnknownFileFormat( + new FileInfo(fileToValidate.getFileName(), fileToValidate.getFileContent(), null)); response.addOutcome(outcome); - } - } + } else { + ValidatedFragments validatedFragments = validator.validateAsFragments(fileToValidate.getFileContent().getBytes(), Manager.FhirFormat.getFhirFormat(fileToValidate.getFileType()), + request.getCliContext().getProfiles(), messages); - if (request.getCliContext().isShowTimes()) { - response.getValidationTimes().put(fileToValidate.getFileName(), validatedFragments.getValidationTime()); + List<ValidationOutcome> validationOutcomes = getValidationOutcomesFromValidatedFragments(fileToValidate, validatedFragments); + for (ValidationOutcome validationOutcome : validationOutcomes) { + response.addOutcome(validationOutcome); + } + + if (request.getCliContext().isShowTimes()) { + response.getValidationTimes().put(fileToValidate.getFileName(), validatedFragments.getValidationTime()); + } } } @@ -150,6 +140,45 @@ public class ValidationService { return response; } + private List<ValidationOutcome> getValidationOutcomesFromValidatedFragments(FileInfo fileToValidate, ValidatedFragments validatedFragments) { + List<ValidationOutcome> outcomes = new LinkedList<>(); + if (validatedFragments.getValidatedFragments().size() == 1 && !validatedFragments.getValidatedFragments().get(0).isDerivedContent()) { + ValidatedFragment validatedFragment = validatedFragments.getValidatedFragments().get(0); + ValidationOutcome outcome = new ValidationOutcome(); + FileInfo fileInfo = new FileInfo( + fileToValidate.getFileName(), + new String(validatedFragment.getContent()), + validatedFragment.getExtension()); + outcome.setMessages(validatedFragment.getErrors()); + outcome.setFileInfo(fileInfo); + outcomes.add(outcome); + } else { + for (ValidatedFragment validatedFragment : validatedFragments.getValidatedFragments()) { + ValidationOutcome outcome = new ValidationOutcome(); + FileInfo fileInfo = new FileInfo( + validatedFragment.getFilename(), + new String(validatedFragment.getContent()), + validatedFragment.getExtension()); + outcome.setMessages(validatedFragment.getErrors()); + outcome.setFileInfo(fileInfo); + outcomes.add(outcome); + } + } + return outcomes; + } + + private ValidationOutcome getValidationOutcomeForUnknownFileFormat(FileInfo fileInfo) { + ValidationOutcome outcome = new ValidationOutcome(); + + List<ValidationMessage> errorList = new ArrayList<>() {{ + add(new ValidationMessage().setType(ValidationMessage.IssueType.EXCEPTION).setLevel(ValidationMessage.IssueSeverity.FATAL).setMessage("Unable to infer format from file. Please check that your file is in a valid FHIR format.")); + + } }; + outcome.setMessages(errorList); + outcome.setFileInfo(fileInfo); + return outcome; + } + public VersionSourceInformation scanForVersions(CliContext cliContext) throws Exception { VersionSourceInformation versions = new VersionSourceInformation(); IgLoader igLoader = new IgLoader( @@ -495,9 +524,11 @@ public class ValidationService { validationEngine.setForPublication(cliContext.isForPublication()); validationEngine.setShowTimes(cliContext.isShowTimes()); validationEngine.setAllowExampleUrls(cliContext.isAllowExampleUrls()); - StandAloneValidatorFetcher fetcher = new StandAloneValidatorFetcher(validationEngine.getPcm(), validationEngine.getContext(), validationEngine); - validationEngine.setFetcher(fetcher); - validationEngine.getContext().setLocator(fetcher); + if (!cliContext.isDisableDefaultResourceFetcher()) { + StandAloneValidatorFetcher fetcher = new StandAloneValidatorFetcher(validationEngine.getPcm(), validationEngine.getContext(), validationEngine); + validationEngine.setFetcher(fetcher); + validationEngine.getContext().setLocator(fetcher); + } validationEngine.getBundleValidationRules().addAll(cliContext.getBundleValidationRules()); validationEngine.setJurisdiction(CodeSystemUtilities.readCoding(cliContext.getJurisdiction())); TerminologyCache.setNoCaching(cliContext.isNoInternalCaching()); @@ -588,9 +619,9 @@ public class ValidationService { private void transformLangExtract(CliContext cliContext, ValidationEngine validator) throws IOException { String dst = cliContext.getOutput(); Utilities.createDirectory(dst); - PoGetTextProducer po = new PoGetTextProducer(Utilities.path(dst)); - XLIFFProducer xliff = new XLIFFProducer(Utilities.path(dst)); - JsonLangFileProducer jl = new JsonLangFileProducer(Utilities.path(dst)); + PoGetTextProducer po = new PoGetTextProducer(dst, ".", false); + XLIFFProducer xliff = new XLIFFProducer(dst, ".", false); + JsonLangFileProducer jl = new JsonLangFileProducer(dst, ".", false); List<SourceFile> refs = new ArrayList<>(); ValidatorUtils.parseSources(cliContext.getSources(), refs, validator.getContext()); @@ -621,7 +652,7 @@ public class ValidationService { String dst = cliContext.getOutput(); Utilities.createDirectory(dst); - Set<TranslationUnit> translations = new HashSet<>(); + List<TranslationUnit> translations = new ArrayList<>(); for (String input : cliContext.getInputs()) { loadTranslationSource(translations, input); } @@ -640,7 +671,7 @@ public class ValidationService { System.out.println("Done - imported "+t+" translations into "+refs.size()+ " in "+dst); } - private void loadTranslationSource(Set<TranslationUnit> translations, String input) { + private void loadTranslationSource(List<TranslationUnit> translations, String input) { File f = new File(input); if (f.exists()) { if (f.isDirectory()) { diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Params.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Params.java index cd70055f4..52edd4542 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Params.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Params.java @@ -89,6 +89,7 @@ public class Params { public static final String SRC_LANG = "-src-lang"; public static final String TGT_LANG = "-tgt-lang"; public static final String ALLOW_DOUBLE_QUOTES = "-allow-double-quotes-in-fhirpath"; + public static final String DISABLE_DEFAULT_RESOURCE_FETCHER = "-disable-default-resource-fetcher"; public static final String CHECK_IPS_CODES = "-check-ips-codes"; public static final String BEST_PRACTICE = "-best-practice"; @@ -270,6 +271,8 @@ public class Params { cliContext.setNoExtensibleBindingMessages(true); } else if (args[i].equals(ALLOW_DOUBLE_QUOTES)) { cliContext.setAllowDoubleQuotesInFHIRPath(true); + } else if (args[i].equals(DISABLE_DEFAULT_RESOURCE_FETCHER)) { + cliContext.setDisableDefaultResourceFetcher(true); } else if (args[i].equals(CHECK_IPS_CODES)) { cliContext.setCheckIPSCodes(true); } else if (args[i].equals(NO_UNICODE_BIDI_CONTROL_CHARS)) { diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/generator/InstanceGenerator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/generator/InstanceGenerator.java new file mode 100644 index 000000000..08b273489 --- /dev/null +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/generator/InstanceGenerator.java @@ -0,0 +1,57 @@ +package org.hl7.fhir.validation.generator; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.convertors.loaders.loaderR5.R4BToR5Loader; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.context.IWorkerContext; +import org.hl7.fhir.r5.context.SimpleWorkerContext; +import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat; +import org.hl7.fhir.r5.model.StructureDefinition; +import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager; +import org.hl7.fhir.utilities.npm.NpmPackage; + +public class InstanceGenerator { + + public static void main(String[] args) throws FHIRException, IOException { + FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager.Builder().build(); + NpmPackage npm = pcm.loadPackage("hl7.fhir.r4.core"); + SimpleWorkerContext context = new SimpleWorkerContext.SimpleWorkerContextBuilder().withAllowLoadingDuplicates(true).fromPackage(npm); + context.loadFromPackage(pcm.loadPackage("hl7.fhir.us.core#6.0.0"), new R4BToR5Loader(null, null, null)); + var gen = new InstanceGenerator(context); + StructureDefinition sd = context.fetchResource(StructureDefinition.class, args[0]); + FhirFormat fmt = FhirFormat.valueOf(args[1].toUpperCase()); + FileOutputStream f = new FileOutputStream(args[2]); + List<String> messages = gen.generateInstance(sd, fmt, f); + if (messages.isEmpty()) { + System.out.println("Generated OK"); + } else { + System.out.println("Generation failed:"); + for (String msg : messages) { + System.out.println(" - "+msg); + } + } + } + + private IWorkerContext context; + + protected InstanceGenerator(IWorkerContext context) { + super(); + this.context = context; + } + + /** + * main public entry point. populates the outputstream, or produces at least one error message in the output + * + */ + public List<String> generateInstance(StructureDefinition profile, FhirFormat format, OutputStream destination) { + List<String> res = new ArrayList<>(); + res.add("Not done yet"); + return res; + + } +} 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 f6cafbbda..bbf2bd058 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 @@ -156,6 +156,7 @@ import org.hl7.fhir.r5.model.TimeType; import org.hl7.fhir.r5.model.Timing; import org.hl7.fhir.r5.model.UriType; import org.hl7.fhir.r5.model.UrlType; +import org.hl7.fhir.r5.model.UsageContext; import org.hl7.fhir.r5.model.ValueSet; import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent; import org.hl7.fhir.r5.renderers.DataRenderer; @@ -494,18 +495,18 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat Element e = new ObjectConverter(context).convert((Resource) item); setParents(e); self.validateResource(new ValidationContext(ctxt.getAppContext(), e), valerrors, e, e, sd, IdStatus.OPTIONAL, new NodeStack(context, null, e, validationLanguage), null, - mode); + mode, false, false); } catch (IOException e1) { throw new FHIRException(e1); } } else if (item instanceof Element) { Element e = (Element) item; if (e.getSpecial() == SpecialElement.CONTAINED) { - self.validateResource(new ValidationContext(ctxt.getAppContext(), e, ctxt.getRootResource(), ctxt.getGroupingResource()), valerrors, e, e, sd, IdStatus.OPTIONAL, new NodeStack(context, null, e, validationLanguage), null, mode); + self.validateResource(new ValidationContext(ctxt.getAppContext(), e, ctxt.getRootResource(), ctxt.getGroupingResource()), valerrors, e, e, sd, IdStatus.OPTIONAL, new NodeStack(context, null, e, validationLanguage), null, mode, false, false); } else if (e.getSpecial() != null) { - self.validateResource(new ValidationContext(ctxt.getAppContext(), e, e, ctxt.getRootResource()), valerrors, e, e, sd, IdStatus.OPTIONAL, new NodeStack(context, null, e, validationLanguage), null, mode); + self.validateResource(new ValidationContext(ctxt.getAppContext(), e, e, ctxt.getRootResource()), valerrors, e, e, sd, IdStatus.OPTIONAL, new NodeStack(context, null, e, validationLanguage), null, mode, false, false); } else { - self.validateResource(new ValidationContext(ctxt.getAppContext(), e), valerrors, e, e, sd, IdStatus.OPTIONAL, new NodeStack(context, null, e, validationLanguage), null, mode); + self.validateResource(new ValidationContext(ctxt.getAppContext(), e), valerrors, e, e, sd, IdStatus.OPTIONAL, new NodeStack(context, null, e, validationLanguage), null, mode, false, false); } } else throw new NotImplementedException(context.formatMessage(I18nConstants.NOT_DONE_YET_VALIDATORHOSTSERVICESCONFORMSTOPROFILE_WHEN_ITEM_IS_NOT_AN_ELEMENT)); @@ -583,7 +584,6 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat private boolean noBindingMsgSuppressed; private Map<String, Element> fetchCache = new HashMap<>(); private HashMap<Element, ResourceValidationTracker> resourceTracker = new HashMap<>(); - private IValidatorResourceFetcher fetcher; private IValidationPolicyAdvisor policyAdvisor; long time = 0; long start = 0; @@ -603,7 +603,6 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat private List<BundleValidationRule> bundleValidationRules = new ArrayList<>(); private boolean validateValueSetCodesOnTxServer = true; private QuestionnaireMode questionnaireMode; - private ValidationOptions baseOptions = new ValidationOptions(FhirPublication.R5); private Map<String, CanonicalResourceLookupResult> crLookups = new HashMap<>(); private boolean logProgress; private CodingsObserver codingObserver; @@ -673,14 +672,6 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat return this; } - public IValidatorResourceFetcher getFetcher() { - return this.fetcher; - } - - public IResourceValidator setFetcher(IValidatorResourceFetcher value) { - this.fetcher = value; - return this; - } @Override public IValidationPolicyAdvisor getPolicyAdvisor() { @@ -1002,7 +993,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat long t = System.nanoTime(); NodeStack stack = new NodeStack(context, path, element, validationLanguage); if (profiles == null || profiles.isEmpty()) { - validateResource(new ValidationContext(appContext, element), errors, element, element, null, resourceIdRule, stack.resetIds(), null, new ValidationMode(ValidationReason.Validation, ProfileSource.BaseDefinition)); + validateResource(new ValidationContext(appContext, element), errors, element, element, null, resourceIdRule, stack.resetIds(), null, new ValidationMode(ValidationReason.Validation, ProfileSource.BaseDefinition), false, false); } else { int i = 0; while (i < profiles.size()) { @@ -1020,7 +1011,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat i++; } for (StructureDefinition defn : profiles) { - validateResource(new ValidationContext(appContext, element), errors, element, element, defn, resourceIdRule, stack.resetIds(), null, new ValidationMode(ValidationReason.Validation, ProfileSource.ConfigProfile)); + validateResource(new ValidationContext(appContext, element), errors, element, element, defn, resourceIdRule, stack.resetIds(), null, new ValidationMode(ValidationReason.Validation, ProfileSource.ConfigProfile), false, false); } } if (hintAboutNonMustSupport) { @@ -2319,10 +2310,10 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (!ok) { if (definition.hasUserData(XVerExtensionManager.XVER_EXT_MARKER)) { warning(errors, NO_RULE_DATE, IssueType.STRUCTURE, container.line(), container.col(), stack.getLiteralPath(), false, - modifier ? I18nConstants.EXTENSION_EXTM_CONTEXT_WRONG_XVER : I18nConstants.EXTENSION_EXTP_CONTEXT_WRONG_XVER, extUrl, contexts.toString(), plist.toString()); + modifier ? I18nConstants.EXTENSION_EXTM_CONTEXT_WRONG_XVER : I18nConstants.EXTENSION_EXTP_CONTEXT_WRONG_XVER, extUrl, contexts.toString(), plist.toString(), definition.getUserString(XVerExtensionManager.XVER_VER_MARKER)); } else { rule(errors, NO_RULE_DATE, IssueType.STRUCTURE, container.line(), container.col(), stack.getLiteralPath(), false, - modifier ? I18nConstants.EXTENSION_EXTM_CONTEXT_WRONG : I18nConstants.EXTENSION_EXTP_CONTEXT_WRONG, extUrl, contexts.toString(), plist.toString()); + modifier ? I18nConstants.EXTENSION_EXTM_CONTEXT_WRONG : I18nConstants.EXTENSION_EXTP_CONTEXT_WRONG, extUrl, contexts.toString(), plist.toString(), definition.getUserString(XVerExtensionManager.XVER_VER_MARKER)); } return false; } else { @@ -2399,7 +2390,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } else if (sd.getType().equals(resource.fhirType())) { List<ValidationMessage> valerrors = new ArrayList<ValidationMessage>(); ValidationMode mode = new ValidationMode(ValidationReason.Expression, ProfileSource.FromExpression); - validateResource(new ValidationContext(appContext, resource), valerrors, resource, resource, sd, IdStatus.OPTIONAL, new NodeStack(context, null, resource, validationLanguage), null, mode); + validateResource(new ValidationContext(appContext, resource), valerrors, resource, resource, sd, IdStatus.OPTIONAL, new NodeStack(context, null, resource, validationLanguage), null, mode, false, false); boolean ok = true; List<ValidationMessage> record = new ArrayList<>(); for (ValidationMessage v : valerrors) { @@ -2627,6 +2618,12 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat private boolean checkPrimitive(ValidationContext valContext, List<ValidationMessage> errors, String path, String type, ElementDefinition context, Element e, StructureDefinition profile, NodeStack node, NodeStack parentNode, Element resource) throws FHIRException { boolean ok = true; + + // sanity check. The only children allowed are id and extension, but value might slip through in some circumstances. + for (Element child : e.getChildren()) { + ok = rule(errors, "2024-02-28", IssueType.INVALID, child.line(), child.col(), path, !"value".equals(child.getName()), I18nConstants.ILLEGAL_PROPERTY, "value") && ok; + } + if (isBlank(e.primitiveValue())) { if (e.primitiveValue() == null) ok = rule(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, e.hasChildren(), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_VALUEEXT) && ok; @@ -2951,6 +2948,12 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat ok = checkInnerNames(errors, e, path, xhtml.getChildNodes(), false) && ok; ok = checkUrls(errors, e, path, xhtml.getChildNodes()) && ok; ok = checkIdRefs(errors, e, path, xhtml, resource) && ok; + if (true) { + ok = checkReferences(valContext, errors, e, path, "div", xhtml, resource) && ok; + } + if (true) { + ok = checkImageSources(valContext, errors, e, path, "div", xhtml, resource) && ok; + } } } @@ -3064,6 +3067,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat public boolean validateReference(ValidationContext valContext, List<ValidationMessage> errors, String path, String type, ElementDefinition context, Element e, String url) { boolean ok = true; + if (url.startsWith("#")) { + valContext.getInternalRefs().add(url.substring(1)); + } // now, do we check the URI target? if (fetcher != null && !type.equals("uuid")) { boolean found; @@ -3103,7 +3109,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat r = loadContainedResource(errors, path, valContext.getRootResource(), url.substring(1), Resource.class); } if (r == null) { - r = fetcher.fetchCanonicalResource(this, url); + r = fetcher.fetchCanonicalResource(this, valContext.getAppContext(), url); } if (r == null) { r = this.context.fetchResource(Resource.class, url); @@ -3114,6 +3120,15 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (rp == ReferenceValidationPolicy.CHECK_VALID) { // todo.... } + // we resolved one, but if there's no version, check if the reference is potentially ambiguous + if (!url.contains("|") && r instanceof CanonicalResource) { + if (!Utilities.existsInList(context.getBase().getPath(), "ImplementationGuide.dependsOn.uri", "ConceptMap.group.source", "ConceptMap.group.target")) { + // ImplementationGuide.dependsOn.version is mandatory, and ConceptMap is checked in the ConceptMap validator + Set<String> possibleVersions = fetcher.fetchCanonicalResourceVersions(this, valContext.getAppContext(), url); + warning(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, possibleVersions.size() <= 1, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_CANONICAL_MULTIPLE_POSSIBLE_VERSIONS, + url, ((CanonicalResource) r).getVersion(), CommaSeparatedStringBuilder.join(", ", Utilities.sorted(possibleVersions))); + } + } } else { ok = false; } @@ -3319,6 +3334,103 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat return ok; } + private boolean checkReferences(ValidationContext valContext, List<ValidationMessage> errors, Element e, String path, String xpath, XhtmlNode node, Element resource) { + boolean ok = true; + if (node.getNodeType() == NodeType.Element & "a".equals(node.getName()) && node.getAttribute("href") != null) { + String href = node.getAttribute("href"); + if (!Utilities.noString(href) && href.startsWith("#") && !href.equals("#")) { + String ref = href.substring(1); + valContext.getInternalRefs().add(ref); + Set<String> refs = new HashSet<>(); + int count = countTargetMatches(resource, ref, true, "$", refs); + if (count == 0) { + rule(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, false, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_RESOLVE, href, xpath, Utilities.stripEoln(node.allText())); + } else if (count > 1) { + warning(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, false, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_MULTIPLE_MATCHES, href, xpath, node.allText(), CommaSeparatedStringBuilder.join(", ", refs)); + } + } else { + // we can't validate at this point. Come back and revisit this some time in the future + } + } + if (node.hasChildren()) { + for (XhtmlNode child : node.getChildNodes()) { + checkReferences(valContext, errors, e, path, xpath+"/"+child.getName(), child, resource); + } + } + return ok; + } + + + protected int countTargetMatches(Element element, String fragment, boolean checkBundle, String path,Set<String> refs) { + int count = 0; + if (fragment.equals(element.getIdBase())) { + count++; + refs.add(path+"/id"); + } + if (element.getXhtml() != null) { + count = count + countTargetMatches(element.getXhtml(), fragment, path, refs); + } + if (element.hasChildren()) { + for (Element child : element.getChildren()) { + count = count + countTargetMatches(child, fragment, false, path+"/"+child.getName(), refs); + } + } + if (count == 0 && checkBundle) { + Element e = element.getParentForValidator(); + while (e != null) { + if (e.fhirType().equals("Bundle")) { + return countTargetMatches(e, fragment, false, path+"/..", refs); + } + e = e.getParentForValidator(); + } + } + return count; + } + + private int countTargetMatches(XhtmlNode node, String fragment, String path,Set<String> refs) { + int count = 0; + if (fragment.equals(node.getAttribute("id"))) { + count++; + refs.add(path+"/@id"); + } + if ("a".equals(node.getName()) && fragment.equals(node.getAttribute("name"))) { + count++; + refs.add(path+"/@name"); + } + if (node.hasChildren()) { + for (XhtmlNode child : node.getChildNodes()) { + count = count + countTargetMatches(child, fragment, path+"/"+child.getName(), refs); + } + } + return count; + } + + + private boolean checkImageSources(ValidationContext valContext, List<ValidationMessage> errors, Element e, String path, String xpath, XhtmlNode node, Element resource) { + boolean ok = true; + if (node.getNodeType() == NodeType.Element & "img".equals(node.getName()) && node.getAttribute("src") != null) { + String src = node.getAttribute("src"); + if (src.startsWith("#")) { + String ref = src.substring(1); + valContext.getInternalRefs().add(ref); + int count = countFragmentMatches(resource, ref); + if (count == 0) { + rule(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, false, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_RESOLVE_IMG, src, xpath); + } else if (count > 1) { + rule(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, false, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_XHTML_MULTIPLE_MATCHES, src, xpath); + } + } else { + // we can't validate at this point. Come back and revisit this some time in the future + } + } + if (node.hasChildren()) { + for (XhtmlNode child : node.getChildNodes()) { + checkImageSources(valContext, errors, e, path, path+"/"+child.getName(), child, resource); + } + } + return ok; + } + private boolean checkIdRefs(List<ValidationMessage> errors, Element e, String path, XhtmlNode node, Element resource) { boolean ok = true; if (node.getNodeType() == NodeType.Element && node.getAttribute("idref") != null) { @@ -3431,6 +3543,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat // firstly, resolve the value set ElementDefinitionBindingComponent binding = elementContext.getBinding(); + if (binding.hasValueSet()) { ValueSet vs = resolveBindingReference(profile, binding.getValueSet(), profile.getUrl(), profile); if (vs == null) { @@ -3454,7 +3567,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } vr = checkCodeOnServer(stack, vs, value, options); } - ok = processTxIssues(errors, vr, element, path, notFoundSeverityForBinding(binding), binding.getStrength() == BindingStrength.EXTENSIBLE, binding.getValueSet()) && ok; + ok = processTxIssues(errors, vr, element, path, notFoundSeverityForBinding(binding), binding.getStrength() != BindingStrength.REQUIRED, binding.getValueSet()) && ok; timeTracker.tx(t, "vc "+value+""); if (binding.getStrength() == BindingStrength.REQUIRED) { @@ -3764,6 +3877,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat ok = bh.ok() && ok; String refType; if (ref.startsWith("#")) { + valContext.getInternalRefs().add(ref.substring(1)); refType = "contained"; } else { if (we == null) { @@ -3889,7 +4003,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat for (StructureDefinition pr : profiles) { List<ValidationMessage> profileErrors = new ArrayList<ValidationMessage>(); validateResource(we.valContext(valContext, pr), profileErrors, we.getResource(), we.getFocus(), pr, - IdStatus.OPTIONAL, we.getStack().resetIds(), pct, vmode.withReason(ValidationReason.MatchingSlice)); + IdStatus.OPTIONAL, we.getStack().resetIds(), pct, vmode.withReason(ValidationReason.MatchingSlice), true, false); if (!hasErrors(profileErrors)) { goodCount++; goodProfiles.put(pr, profileErrors); @@ -5275,7 +5389,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } // checkSpecials = we're only going to run these tests if we are actually validating this content (as opposed to we looked it up) - private boolean start(ValidationContext valContext, List<ValidationMessage> errors, Element resource, Element element, StructureDefinition defn, NodeStack stack, PercentageTracker pct, ValidationMode mode) throws FHIRException { + private boolean start(ValidationContext valContext, List<ValidationMessage> errors, Element resource, Element element, StructureDefinition defn, NodeStack stack, PercentageTracker pct, ValidationMode mode, boolean fromContained) throws FHIRException { boolean ok = !hasErrors(errors); checkLang(resource, stack); @@ -5295,7 +5409,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } resolveBundleReferences(element, new ArrayList<Element>()); } - ok = startInner(valContext, errors, resource, element, defn, stack, valContext.isCheckSpecials(), pct, mode) && ok; + ok = startInner(valContext, errors, resource, element, defn, stack, valContext.isCheckSpecials(), pct, mode, fromContained) && ok; if (pctOwned) { pct.done(); } @@ -5314,7 +5428,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (pctOwned) { pct = new PercentageTracker(resource.countDescendents(), resource.fhirType(), sdi.getUrl(), logProgress); } - ok = startInner(valContext, errors, resource, element, sdi, stack, false, pct, mode.withSource(ProfileSource.ProfileDependency)) && ok; + ok = startInner(valContext, errors, resource, element, sdi, stack, false, pct, mode.withSource(ProfileSource.ProfileDependency), fromContained) && ok; if (pctOwned) { pct.done(); } @@ -5351,7 +5465,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } else if (!fetcher.fetchesCanonicalResource(this, profile.primitiveValue())) { warning(errors, NO_RULE_DATE, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath() + ".meta.profile[" + i + "]", false, I18nConstants.VALIDATION_VAL_PROFILE_UNKNOWN_NOT_POLICY, profile.primitiveValue()); } else { - sd = lookupProfileReference(errors, element, stack, i, profile, sd); + sd = lookupProfileReference(valContext, errors, element, stack, i, profile, sd); } } if (sd != null) { @@ -5362,7 +5476,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (pctOwned) { pct = new PercentageTracker(resource.countDescendents(), resource.fhirType(), sd.getUrl(), logProgress); } - ok = startInner(valContext, errors, resource, element, sd, stack, false, pct, mode.withSource(ProfileSource.MetaProfile)) && ok; + ok = startInner(valContext, errors, resource, element, sd, stack, false, pct, mode.withSource(ProfileSource.MetaProfile), fromContained) && ok; if (pctOwned) { pct.done(); } @@ -5379,7 +5493,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (pctOwned) { pct = new PercentageTracker(resource.countDescendents(), resource.fhirType(), sdi.getUrl(), logProgress); } - ok = startInner(valContext, errors, resource, element, sdi, stack, false, pct, mode.withSource(ProfileSource.ProfileDependency)) && ok; + ok = startInner(valContext, errors, resource, element, sdi, stack, false, pct, mode.withSource(ProfileSource.ProfileDependency), fromContained) && ok; if (pctOwned) { pct.done(); } @@ -5406,7 +5520,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (pctOwned) { pct = new PercentageTracker(resource.countDescendents(), resource.fhirType(), sd.getVersionedUrl(), logProgress); } - ok = startInner(valContext, errors, resource, element, sd, stack, false, pct, mode.withSource(ProfileSource.GlobalProfile)) && ok; + ok = startInner(valContext, errors, resource, element, sd, stack, false, pct, mode.withSource(ProfileSource.GlobalProfile), fromContained) && ok; if (pctOwned) { pct.done(); } @@ -5418,7 +5532,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat return ok; } - private StructureDefinition lookupProfileReference(List<ValidationMessage> errors, Element element, NodeStack stack, + private StructureDefinition lookupProfileReference(ValidationContext valContext, List<ValidationMessage> errors, Element element, NodeStack stack, int i, Element profile, StructureDefinition sd) { String url = profile.primitiveValue(); CanonicalResourceLookupResult cr = crLookups.get(url); @@ -5430,7 +5544,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } else { try { - sd = (StructureDefinition) fetcher.fetchCanonicalResource(this, url); + sd = (StructureDefinition) fetcher.fetchCanonicalResource(this, valContext.getAppContext(), url); crLookups.put(url, new CanonicalResourceLookupResult(sd)); } catch (Exception e) { if (STACK_TRACE) { e.printStackTrace(); } @@ -5507,7 +5621,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } - public boolean startInner(ValidationContext valContext, List<ValidationMessage> errors, Element resource, Element element, StructureDefinition defn, NodeStack stack, boolean checkSpecials, PercentageTracker pct, ValidationMode mode) { + public boolean startInner(ValidationContext valContext, List<ValidationMessage> errors, Element resource, Element element, StructureDefinition defn, NodeStack stack, boolean checkSpecials, PercentageTracker pct, ValidationMode mode, boolean fromContained) { // the first piece of business is to see if we've validated this resource against this profile before. // if we have (*or if we still are*), then we'll just return our existing errors boolean ok = true; @@ -5537,13 +5651,13 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat ok = false; } if (checkSpecials) { - ok = checkSpecials(valContext, errors, element, stack, checkSpecials, pct, mode) && ok; + ok = checkSpecials(valContext, errors, element, stack, checkSpecials, pct, mode, fromContained) && ok; ok = validateResourceRules(errors, element, stack) && ok; } return ok; } - public boolean checkSpecials(ValidationContext valContext, List<ValidationMessage> errors, Element element, NodeStack stack, boolean checkSpecials, PercentageTracker pct, ValidationMode mode) { + public boolean checkSpecials(ValidationContext valContext, List<ValidationMessage> errors, Element element, NodeStack stack, boolean checkSpecials, PercentageTracker pct, ValidationMode mode, boolean contained) { boolean ok = true; long t = System.nanoTime(); @@ -5559,7 +5673,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } if (isHL7Core(element) && !isExample()) { - ok = checkPublisherConsistency(errors, element, stack) && ok; + ok = checkPublisherConsistency(valContext, errors, element, stack, contained) && ok; } } if (element.getType().equals(BUNDLE)) { @@ -5577,9 +5691,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } else if (element.getType().equals("CapabilityStatement")) { return validateCapabilityStatement(errors, element, stack) && ok; } else if (element.getType().equals("CodeSystem")) { - return new CodeSystemValidator(this).validateCodeSystem(errors, element, stack, baseOptions.withLanguage(stack.getWorkingLang())) && ok; + return new CodeSystemValidator(this).validateCodeSystem(valContext, errors, element, stack, baseOptions.withLanguage(stack.getWorkingLang())) && ok; } else if (element.getType().equals("ConceptMap")) { - return new ConceptMapValidator(this).validateConceptMap(errors, element, stack, baseOptions.withLanguage(stack.getWorkingLang())) && ok; + return new ConceptMapValidator(this).validateConceptMap(valContext, errors, element, stack, baseOptions.withLanguage(stack.getWorkingLang())) && ok; } else if (element.getType().equals("SearchParameter")) { return new SearchParameterValidator(this, fpe).validateSearchParameter(errors, element, stack) && ok; } else if (element.getType().equals("StructureDefinition")) { @@ -5587,7 +5701,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } else if (element.getType().equals("StructureMap")) { return new StructureMapValidator(this, fpe, profileUtilities).validateStructureMap(errors, element, stack) && ok; } else if (element.getType().equals("ValueSet")) { - return new ValueSetValidator(this).validateValueSet(errors, element, stack) && ok; + return new ValueSetValidator(this).validateValueSet(valContext, errors, element, stack) && ok; } else if ("http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition".equals(element.getProperty().getStructure().getUrl())) { if (element.getNativeObject() != null && element.getNativeObject() instanceof JsonObject) { JsonObject json = (JsonObject) element.getNativeObject(); @@ -5605,11 +5719,38 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } - private boolean checkPublisherConsistency(List<ValidationMessage> errors, Element element, NodeStack stack) { + private boolean checkPublisherConsistency(ValidationContext valContext, List<ValidationMessage> errors, Element element, NodeStack stack, boolean contained) { String pub = element.getNamedChildValue("publisher", false); Base wgT = element.getExtensionValue(ToolingExtensions.EXT_WORKGROUP); String wg = wgT == null ? null : wgT.primitiveValue(); + String url = element.getNamedChildValue("url"); + + if (contained && wg == null) { + boolean ok = true; + Element container = valContext.getRootResource(); + if (element.hasExtension(ToolingExtensions.EXT_WORKGROUP)) { + // container already specified the HL7 WG, so we don't need to test + // but we're still going to test pub if it exists + if (pub != null) { + wgT = container.getExtensionValue(ToolingExtensions.EXT_WORKGROUP); + wg = wgT == null ? null : wgT.primitiveValue(); + HL7WorkGroup wgd = HL7WorkGroups.find(wg); + if (wgd != null) { + String rpub = "HL7 International / "+wgd.getName(); + ok = rpub.equals(pub); + if (!ok && wgd.getName2() != null) { + ok = ("HL7 International / "+wgd.getName2()).equals(pub); + warningOrError(pub.contains("/"), errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), ok, I18nConstants.VALIDATION_HL7_PUBLISHER_MISMATCH2, wg, rpub, "HL7 International / "+wgd.getName2(), pub); + } else { + warningOrError(pub.contains("/"), errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), ok, I18nConstants.VALIDATION_HL7_PUBLISHER_MISMATCH, wg, rpub, pub); + } + } + } + return ok; + } + } + List<String> urls = new ArrayList<>(); for (Element c : element.getChildren("contact")) { for (Element t : c.getChildren("telecom")) { @@ -5618,24 +5759,30 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } } - if (rule(errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), wg != null, I18nConstants.VALIDATION_HL7_WG_NEEDED, ToolingExtensions.EXT_WORKGROUP)) { - HL7WorkGroup wgd = HL7WorkGroups.find(wg); - if (rule(errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), wgd != null, I18nConstants.VALIDATION_HL7_WG_UNKNOWN, wg)) { - String rpub = "HL7 International / "+wgd.getName(); - if (warning(errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), pub != null, I18nConstants.VALIDATION_HL7_PUBLISHER_MISSING, wg, rpub)) { - boolean ok = rpub.equals(pub); - if (!ok && wgd.getName2() != null) { - ok = ("HL7 International / "+wgd.getName2()).equals(pub); - warningOrError(pub.contains("/"), errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), ok, I18nConstants.VALIDATION_HL7_PUBLISHER_MISMATCH2, wg, rpub, "HL7 International / "+wgd.getName2(), pub); - } else { - warningOrError(pub.contains("/"), errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), ok, I18nConstants.VALIDATION_HL7_PUBLISHER_MISMATCH, wg, rpub, pub); + + if (rule(errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), wg != null || url.contains("http://hl7.org/fhir/sid"), I18nConstants.VALIDATION_HL7_WG_NEEDED, ToolingExtensions.EXT_WORKGROUP)) { + if (wg != null) { + HL7WorkGroup wgd = HL7WorkGroups.find(wg); + if (rule(errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), wgd != null, I18nConstants.VALIDATION_HL7_WG_UNKNOWN, wg)) { + String rpub = "HL7 International / "+wgd.getName(); + if (warning(errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), pub != null, I18nConstants.VALIDATION_HL7_PUBLISHER_MISSING, wg, rpub)) { + boolean ok = rpub.equals(pub); + if (!ok && wgd.getName2() != null) { + ok = ("HL7 International / "+wgd.getName2()).equals(pub); + warningOrError(pub.contains("/"), errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), ok, I18nConstants.VALIDATION_HL7_PUBLISHER_MISMATCH2, wg, rpub, "HL7 International / "+wgd.getName2(), pub); + } else { + warningOrError(pub.contains("/"), errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), ok, I18nConstants.VALIDATION_HL7_PUBLISHER_MISMATCH, wg, rpub, pub); + } } - } - warning(errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), - Utilities.startsWithInList( wgd.getLink(), urls), I18nConstants.VALIDATION_HL7_WG_URL, wg, wgd.getLink()); - return true; - } - } + warning(errors, "2023-09-15", IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), + Utilities.startsWithInList( wgd.getLink(), urls), I18nConstants.VALIDATION_HL7_WG_URL, wg, wgd.getLink()); + return true; + } + } else { + return true; // HL7 sid. + } + } + return false; } @@ -5820,7 +5967,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } - checkSpecials(valContext, errors, element, stack, ok, pct, mode); + checkSpecials(valContext, errors, element, stack, ok, pct, mode, true); if (typeForResource.getProfile().size() == 1) { long t = System.nanoTime(); @@ -5829,7 +5976,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (rule(errors, NO_RULE_DATE, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), profile != null, I18nConstants.BUNDLE_BUNDLE_ENTRY_NOPROFILE_EXPL, special == null ? "??" : special.toHuman(), resourceName, typeForResource.getProfile().get(0).asStringValue())) { trackUsage(profile, valContext, element); - ok = validateResource(hc, errors, resource, element, profile, idstatus, stack, pct, mode) && ok; + ok = validateResource(hc, errors, resource, element, profile, idstatus, stack, pct, mode, false, special == SpecialElement.CONTAINED) && ok; } else { ok = false; } @@ -5841,7 +5988,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat trackUsage(profile, valContext, element); if (rule(errors, NO_RULE_DATE, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), profile != null, I18nConstants.BUNDLE_BUNDLE_ENTRY_NOPROFILE_TYPE, special == null ? "??" : special.toHuman(), resourceName)) { - ok = validateResource(hc, errors, resource, element, profile, idstatus, stack, pct, mode) && ok; + ok = validateResource(hc, errors, resource, element, profile, idstatus, stack, pct, mode, false, special == SpecialElement.CONTAINED) && ok; } else { ok = false; } @@ -5862,7 +6009,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat trackUsage(profile, valContext, element); List<ValidationMessage> perrors = new ArrayList<>(); errorsList.add(perrors); - if (validateResource(hc, perrors, resource, element, profile, idstatus, stack, pct, mode)) { + if (validateResource(hc, perrors, resource, element, profile, idstatus, stack, pct, mode, false, special == SpecialElement.CONTAINED)) { bm.append(u.asStringValue()); matched++; } @@ -5983,7 +6130,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } childDefinitions = getActualTypeChildren(valContext, element, actualType); } else if (definition.getType().size() > 1) { - // this only happens when the profile constrains the abstract children but leaves th choice open. + // this only happens when the profile constrains the abstract children but leaves the choice open. if (actualType == null) { vi.setValid(false); return false; // there'll be an error elsewhere in this case, and we're going to stop. @@ -6124,7 +6271,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } String stype = ei.getElement().fhirType(); - if (!stype.equals(type)) { + if (stype == null || !stype.equals(type)) { if (checkDefn.isChoice()) { if (extensionUrl != null && !isAbsolute(extensionUrl)) { ok = rule(errors, NO_RULE_DATE, IssueType.STRUCTURE, element.line(), element.col(), ei.getPath(), false, I18nConstants.EXTENSION_PROF_TYPE, profile.getVersionedUrl(), type, stype) && ok; @@ -6551,7 +6698,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat boolean ok = true; // 3. report any definitions that have a cardinality problem for (ElementDefinition ed : childDefinitions.getList()) { - if (ed.getRepresentation().isEmpty()) { // ignore xml attributes + if (!ed.hasRepresentation(PropertyRepresentation.XHTML) && !ed.hasRepresentation(PropertyRepresentation.XMLTEXT)) { // xhtml.value is XMLText in <R3 int count = 0; List<ElementDefinition> slices = null; if (ed.hasSlicing()) { @@ -6939,8 +7086,10 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat return true; } boolean ok = true; - if (debug) { - System.out.println("inv "+inv.getKey()+" on "+path+" in "+resource.fhirType()+" {{ "+inv.getExpression()+" }}"+time()); + // we don't allow dom-3 to execute - it takes too long (and is wrong). + // instead, we enforce it in code + if ("dom-3".equals(inv.getKey())) { + return true; } ExpressionNode n = (ExpressionNode) inv.getUserData("validator.expression.cache"); if (n == null) { @@ -7014,7 +7163,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat * The actual base entry point for internal use (re-entrant) */ private boolean validateResource(ValidationContext valContext, List<ValidationMessage> errors, Element resource, - Element element, StructureDefinition defn, IdStatus idstatus, NodeStack stack, PercentageTracker pct, ValidationMode mode) throws FHIRException { + Element element, StructureDefinition defn, IdStatus idstatus, NodeStack stack, PercentageTracker pct, ValidationMode mode, boolean forReference, boolean fromContained) throws FHIRException { boolean ok = true; // check here if we call validation policy here, and then change it to the new interface @@ -7066,10 +7215,14 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat // validate if (rule(errors, NO_RULE_DATE, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), checkResourceName(defn, resourceName, element.getFormat()), I18nConstants.VALIDATION_VAL_PROFILE_WRONGTYPE, defn.getType(), resourceName, defn.getVersionedUrl())) { - ok = start(valContext, errors, element, element, defn, stack, pct, mode) && ok; // root is both definition and type + ok = start(valContext, errors, element, element, defn, stack, pct, mode, fromContained) && ok; // root is both definition and type } else { ok = false; } + if (!forReference) { + // last step: check that all contained resources are referenced or reference # + ok = checkContainedReferences(valContext, errors, element, stack) && ok; + } } if (testMode && ok == hasErrors(errors)) { throw new Error("ok is wrong. ok = "+ok+", errors = "+errorIds(stack.getLiteralPath(), ok, errors)); @@ -7077,6 +7230,59 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat return ok; } + private boolean checkContainedReferences(ValidationContext valContext, List<ValidationMessage> errors, Element element, NodeStack stack) { + boolean ok = true; + Set<String> baseRefs = (Set<String>) element.getUserData(ValidationContext.INTERNAL_REFERENCES_NAME); + List<Element> containedList = element.getChildrenByName("contained"); + if (!containedList.isEmpty()) { + boolean allDone = true; + for (Element contained : containedList) { + allDone = allDone && contained.hasUserData(ValidationContext.INTERNAL_REFERENCES_NAME); + } + if (allDone) { + // We collected all the internal references in sets on the resource and the contained resources + int i = 0; + for (Element contained : containedList) { + ok = checkContainedReferences(errors, stack, ok, baseRefs, containedList, i, contained); + i++; + } + } + } + return ok; + } + + private boolean checkContainedReferences(List<ValidationMessage> errors, NodeStack stack, boolean ok, + Set<String> baseRefs, List<Element> containedList, int i, Element contained) { + NodeStack n = stack.push(contained, i, null, null); + boolean found = isReferencedFromBase(contained, baseRefs, containedList, new ArrayList<>()); + + ok = rule(errors, NO_RULE_DATE, IssueType.INVALID, n, found, I18nConstants.CONTAINED_ORPHAN_DOM3, contained.getIdBase()) && ok; + return ok; + } + + private boolean isReferencedFromBase(Element contained, Set<String> baseRefs, List<Element> containedList, List<Element> ignoreList) { + String id = contained.getIdBase(); + if (baseRefs.contains(id)) { + return true; + } + Set<String> irefs = (Set<String>) contained.getUserData(ValidationContext.INTERNAL_REFERENCES_NAME); + if (irefs.contains("")) { + return true; + } + for (Element c : containedList) { + if (c != contained && !ignoreList.contains(c)) { // ignore list is to prevent getting into an unterminated loop + Set<String> refs = (Set<String>) c.getUserData(ValidationContext.INTERNAL_REFERENCES_NAME); + List<Element> ignoreList2 = new ArrayList<Element>(); + ignoreList2.addAll(ignoreList); + ignoreList2.add(c); + if (refs != null && refs.contains(id) && isReferencedFromBase(c, baseRefs, containedList, ignoreList2)) { + return true; + } + } + } + return false; + } + private boolean checkResourceName(StructureDefinition defn, String resourceName, FhirFormat format) { if (resourceName.equals(defn.getType())) { return true; @@ -7101,11 +7307,11 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } String s = b.toString(); - if (debug) { - System.out.println("OK = "+ok+" for "+path); - System.out.println("Errs = "+errors.toString()); - System.out.println("Ids = "+s); - } +// if (debug) { +// System.out.println("OK = "+ok+" for "+path); +// System.out.println("Errs = "+errors.toString()); +// System.out.println("Ids = "+s); +// } return s; } @@ -7527,4 +7733,13 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } return this; } + + public IValidatorResourceFetcher getFetcher() { + return this.fetcher; + } + + public IResourceValidator setFetcher(IValidatorResourceFetcher value) { + this.fetcher = value; + return this; + } } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/BundleValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/BundleValidator.java index 0c7b1732d..64fba121f 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/BundleValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/BundleValidator.java @@ -176,12 +176,12 @@ public class BundleValidator extends BaseValidator { res.addMessage(signpost(errors, NO_RULE_DATE, IssueType.INFORMATIONAL, res.line(), res.col(), stack.getLiteralPath(), I18nConstants.VALIDATION_VAL_PROFILE_SIGNPOST_BUNDLE_PARAM, defn.getUrl())); } stack.resetIds(); - ok = validator().startInner(hostContext, errors, res, res, defn, rstack, false, pct, mode) && ok; + ok = validator().startInner(hostContext, errors, res, res, defn, rstack, false, pct, mode, false) && ok; } } } // also, while we're here, check the specials, since this doesn't happen anywhere else - ((InstanceValidator) parent).checkSpecials(hostContext, errors, res, rstack, true, pct, mode); + ((InstanceValidator) parent).checkSpecials(hostContext, errors, res, rstack, true, pct, mode, true); } // todo: check specials @@ -851,7 +851,10 @@ public class BundleValidator extends BaseValidator { if (ref != null && !ref.startsWith("#") && !hasReference(ref, references)) references.add(new StringWithSource(ref, child, true, isNLLink(start))); } - findReferences(child, references); + // don't walk into a sub-bundle + if (!"Bundle".equals(child.fhirType())) { + findReferences(child, references); + } } } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/CodeSystemValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/CodeSystemValidator.java index dee8a1a26..e153b3f30 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/CodeSystemValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/CodeSystemValidator.java @@ -1,26 +1,109 @@ package org.hl7.fhir.validation.instance.type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; +import java.util.Set; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.elementmodel.Element; import org.hl7.fhir.r5.model.CodeSystem; +import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent; import org.hl7.fhir.r5.model.ValueSet; +import org.hl7.fhir.r5.terminologies.CodeSystemUtilities; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.i18n.I18nConstants; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; import org.hl7.fhir.utilities.validation.ValidationOptions; import org.hl7.fhir.validation.BaseValidator; +import org.hl7.fhir.validation.instance.type.CodeSystemValidator.KnownProperty; +import org.hl7.fhir.validation.instance.type.CodeSystemValidator.PropertyDef; import org.hl7.fhir.validation.instance.utils.NodeStack; +import org.hl7.fhir.validation.instance.utils.ValidationContext; public class CodeSystemValidator extends BaseValidator { + public enum KnownProperty { + Status, Inactive, EffectiveDate, DeprecationDate, RetirementDate, NotSelectable, Parent, Child, PartOf, Synonym, Comment, ItemWeight; + + String getType() { + switch (this) { + case Child: return "code"; + case Comment: return "string"; + case DeprecationDate: return "dateTime"; + case EffectiveDate: return "dateTime"; + case Inactive: return "boolean"; + case ItemWeight: return "decimal"; + case NotSelectable: return "boolean"; + case Parent: return "code"; + case PartOf: return "code"; + case RetirementDate: return "dateTime"; + case Status: return "code"; + case Synonym: return "code"; + default: return null; + } + } + + String getCode() { + return Utilities.uncapitalize(this.toString()); + } + + String getUri() { + return "http://hl7.org/fhir/concept-properties#"+ getCode(); + } + + } + + public enum CodeValidationRule { + NO_VALIDATION, INTERNAL_CODE, VS_ERROR, VS_WARNING + } + + public class PropertyDef { + private String uri; + private String code; + private String type; + + private CodeValidationRule rule; + private String valueset; + + protected PropertyDef(String uri, String code, String type) { + super(); + this.uri = uri; + this.code = code; + this.type = type; + } + + public void setCodeValidationRules(CodeValidationRule rule, String valueset) { + this.rule = rule; + this.valueset = valueset; + } + + public String getUri() { + return uri; + } + public String getCode() { + return code; + } + public String getType() { + return type; + } + public String getValueset() { + return valueset; + } + + } + + private static final String VS_PROP_STATUS = null; + public CodeSystemValidator(BaseValidator parent) { super(parent); } - public boolean validateCodeSystem(List<ValidationMessage> errors, Element cs, NodeStack stack, ValidationOptions options) { + public boolean validateCodeSystem(ValidationContext valContext, List<ValidationMessage> errors, Element cs, NodeStack stack, ValidationOptions options) { boolean ok = true; String url = cs.getNamedChildValue("url", false); String content = cs.getNamedChildValue("content", false); @@ -28,12 +111,26 @@ public class CodeSystemValidator extends BaseValidator { String hierarchyMeaning = cs.getNamedChildValue("hierarchyMeaning", false); String supp = cs.getNamedChildValue("supplements", false); int count = countConcepts(cs); + CodeSystem csB = null; metaChecks(errors, cs, stack, url, content, caseSensitive, hierarchyMeaning, !Utilities.noString(supp), count, supp); String vsu = cs.getNamedChildValue("valueSet", false); if (!Utilities.noString(vsu)) { - hint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), "complete".equals(content), I18nConstants.CODESYSTEM_CS_NO_VS_NOTCOMPLETE); + if ("supplement".equals(content)) { + csB = context.fetchCodeSystem(supp); + if (csB != null) { + if (csB.hasValueSet()) { + warning(errors, "2024-03-06", IssueType.BUSINESSRULE, stack.getLiteralPath(), vsu.equals(vsu), I18nConstants.CODESYSTEM_CS_NO_VS_SUPPLEMENT2, csB.getValueSet()); + } else { + warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), false, I18nConstants.CODESYSTEM_CS_NO_VS_SUPPLEMENT1); + } + } else { + warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), "complete".equals(content), I18nConstants.CODESYSTEM_CS_NO_VS_NOTCOMPLETE); + } + } else { + hint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), "complete".equals(content), I18nConstants.CODESYSTEM_CS_NO_VS_NOTCOMPLETE); + } ValueSet vs; try { vs = context.fetchResourceWithException(ValueSet.class, vsu); @@ -61,31 +158,319 @@ public class CodeSystemValidator extends BaseValidator { } } // todo... try getting the value set the other way... - if (supp != null) { - if (context.supportsSystem(supp, options.getFhirVersion())) { - List<Element> concepts = cs.getChildrenByName("concept"); - int ce = 0; - for (Element concept : concepts) { - NodeStack nstack = stack.push(concept, ce, null, null); - if (ce == 0) { - rule(errors, "2023-08-15", IssueType.INVALID, nstack, !"not-present".equals(content), I18nConstants.CODESYSTEM_CS_COUNT_NO_CONTENT_ALLOWED); + if ("supplement".equals(content) || supp != null) { + if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, stack.getLiteralPath(), !Utilities.noString(supp), I18nConstants.CODESYSTEM_CS_SUPP_NO_SUPP)) { + if (context.supportsSystem(supp, options.getFhirVersion())) { + List<Element> concepts = cs.getChildrenByName("concept"); + int ce = 0; + for (Element concept : concepts) { + NodeStack nstack = stack.push(concept, ce, null, null); + if (ce == 0) { + rule(errors, "2023-08-15", IssueType.INVALID, nstack, !"not-present".equals(content), I18nConstants.CODESYSTEM_CS_COUNT_NO_CONTENT_ALLOWED); + } + ok = validateSupplementConcept(errors, concept, nstack, supp, options) && ok; + ce++; + } + } else { + if (cs.hasChildren("concept")) { + warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), false, I18nConstants.CODESYSTEM_CS_SUPP_CANT_CHECK, supp); } - ok = validateSupplementConcept(errors, concept, nstack, supp, options) && ok; - ce++; - } - } else { - if (cs.hasChildren("concept")) { - warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), false, I18nConstants.CODESYSTEM_CS_SUPP_CANT_CHECK, supp); } + } else { + ok = false; } } if (!stack.isContained()) { ok = checkShareableCodeSystem(errors, cs, stack) && ok; + } else { + // we approve of contained code systems in two circumstances: + // * inside a questionnaire for a code system only used by that questionnaire + // * inside a supplement, for creating properties in the supplement// otherwise, we put a hint on it that this is probably a bad idea + boolean isInQ = valContext.getRootResource() != null && valContext.getRootResource().fhirType().equals("Questionnaire"); + boolean isSuppProp = valContext.getRootResource() != null && valContext.getRootResource().fhirType().equals("CodeSystem"); // todo add more checks + hint(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), !isInQ && !isSuppProp, I18nConstants.CODESYSTEM_NOT_CONTAINED); + } + + Map<String, PropertyDef> properties = new HashMap<>(); + List<Element> propertyElements = cs.getChildrenByName("property"); + int i = 0; + for (Element propertyElement : propertyElements) { + ok = checkPropertyDefinition(errors, cs, stack.push(propertyElement, i, null, null), "true".equals(caseSensitive), hierarchyMeaning, csB, propertyElement, properties) && ok; + i++; + } + + Set<String> codes = new HashSet<>(); + + List<Element> concepts = cs.getChildrenByName("concept"); + i = 0; + for (Element concept : concepts) { + ok = checkConcept(errors, cs, stack.push(concept, i, null, null), "true".equals(caseSensitive), hierarchyMeaning, csB, concept, codes, properties) && ok; + i++; + } + i = 0; + for (Element concept : concepts) { + ok = checkConceptProps(errors, cs, stack.push(concept, i, null, null), "true".equals(caseSensitive), hierarchyMeaning, csB, concept, codes, properties) && ok; + i++; + } + + return ok; + } + + + private boolean checkPropertyDefinition(List<ValidationMessage> errors, Element cs, NodeStack stack, boolean equals, String hierarchyMeaning, CodeSystem csB, Element property, Map<String, PropertyDef> properties) { + boolean ok = true; + String uri = property.getNamedChildValue("uri"); + String code = property.getNamedChildValue("code"); + String type = property.getNamedChildValue("type"); + PropertyDef pd = new PropertyDef(uri, code, type); + KnownProperty ukp = null; + KnownProperty ckp = null; + + if (uri != null) { + if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), !properties.containsKey(uri), I18nConstants.CODESYSTEM_PROPERTY_DUPLICATE_URI, uri)) { + properties.put(uri, pd); + } else { + ok = false; + } + if (uri.contains("hl7.org/fhir")) { + switch (uri) { + case "http://hl7.org/fhir/concept-properties#status" : + ukp = KnownProperty.Status; + break; + case "http://hl7.org/fhir/concept-properties#inactive" : + ukp = KnownProperty.Inactive; + break; + case "http://hl7.org/fhir/concept-properties#effectiveDate" : + ukp = KnownProperty.EffectiveDate; + break; + case "http://hl7.org/fhir/concept-properties#deprecationDate" : + ukp = KnownProperty.DeprecationDate; + break; + case "http://hl7.org/fhir/concept-properties#retirementDate" : + ukp = KnownProperty.RetirementDate; + break; + case "http://hl7.org/fhir/concept-properties#notSelectable" : + ukp = KnownProperty.NotSelectable; + break; + case "http://hl7.org/fhir/concept-properties#parent" : + ukp = KnownProperty.Parent; + break; + case "http://hl7.org/fhir/concept-properties#child" : + ukp = KnownProperty.Child; + break; + case "http://hl7.org/fhir/concept-properties#partOf" : + ukp = KnownProperty.PartOf; + break; + case "http://hl7.org/fhir/concept-properties#synonym" : + ukp = KnownProperty.Synonym; + break; + case "http://hl7.org/fhir/concept-properties#comment" : + ukp = KnownProperty.Comment; + break; + case "http://hl7.org/fhir/concept-properties#itemWeight" : + ukp = KnownProperty.ItemWeight; + break; + default: + ok = rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), isBaseSpec(cs.getNamedChildValue("url")), I18nConstants.CODESYSTEM_PROPERTY_BAD_HL7_URI, uri); + } + } + } + if (code != null) { + if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), !properties.containsKey(code), I18nConstants.CODESYSTEM_PROPERTY_DUPLICATE_CODE, code)) { + properties.put(code, pd); + } else { + ok = false; + } + switch (code) { + case "status" : + ckp = KnownProperty.Status; + break; + case "inactive" : + ckp = KnownProperty.Inactive; + break; + case "effectiveDate" : + ckp = KnownProperty.EffectiveDate; + break; + case "deprecationDate" : + ckp = KnownProperty.DeprecationDate; + break; + case "retirementDate" : + ckp = KnownProperty.RetirementDate; + break; + case "notSelectable" : + ckp = KnownProperty.NotSelectable; + break; + case "parent" : + ckp = KnownProperty.Parent; + break; + case "child" : + ckp = KnownProperty.Child; + break; + case "partOf" : + ckp = KnownProperty.PartOf; + break; + case "synonym" : + ckp = KnownProperty.Synonym; + break; + case "comment" : + ckp = KnownProperty.Comment; + break; + case "itemWeight" : + ckp = KnownProperty.ItemWeight; + break; + default: + // no rules around codes... + } + } + if (ukp != null) { + ok = rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), ckp == null || ckp == ukp, I18nConstants.CODESYSTEM_PROPERTY_URI_CODE_MISMATCH, uri, ukp.getCode(), code) && ok; + if (type != null) { + ok = rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), type.equals(ukp.getType()), I18nConstants.CODESYSTEM_PROPERTY_URI_TYPE_MISMATCH, uri, ukp.getType(),type) && ok; + } + switch (ukp) { + case Child: + case Parent: + case PartOf: + case Synonym: + pd.setCodeValidationRules(CodeValidationRule.INTERNAL_CODE, null); + break; + case Status: + pd.setCodeValidationRules(CodeValidationRule.VS_WARNING, VS_PROP_STATUS); + break; + default: + break; + } + } else if ("code".equals(pd.getType())) { + if (property.hasExtension("http://hl7.org/fhir/6.0/StructureDefinition/extension-CodeSystem.property.valueSet")) { + pd.setCodeValidationRules(CodeValidationRule.VS_ERROR, property.getExtensionValue("http://hl7.org/fhir/6.0/StructureDefinition/extension-CodeSystem.property.valueSet").primitiveValue()); + } else if (VersionUtilities.isR6Plus(context.getVersion())) { + hint(errors, "2024-03-18", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), ukp != null && type.equals(ukp.getType()), I18nConstants.CODESYSTEM_PROPERTY_CODE_WARNING); + } else { + + } + } else if ("Coding".equals(pd.getType()) && property.hasExtension("http://hl7.org/fhir/6.0/StructureDefinition/extension-CodeSystem.property.valueSet")) { + pd.setCodeValidationRules(CodeValidationRule.VS_ERROR, property.getExtensionValue("http://hl7.org/fhir/6.0/StructureDefinition/extension-CodeSystem.property.valueSet").primitiveValue()); + } + + if (uri == null) { + if (ckp == null) { + hint(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), false, I18nConstants.CODESYSTEM_PROPERTY_UNKNOWN_CODE, code); + } else { + warning(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), false, I18nConstants.CODESYSTEM_PROPERTY_KNOWN_CODE_SUGGESTIVE, code, ckp.getUri()); + if (type != null) { + warning(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), type.equals(ckp.getType()), I18nConstants.CODESYSTEM_PROPERTY_CODE_TYPE_MISMATCH, code, ckp.getType(), type); + } + } } return ok; } + private boolean isBaseSpec(String url) { + return url.startsWith("http://hl7.org/fhir/") && !url.substring(20).contains("/"); + } + + private boolean checkConcept(List<ValidationMessage> errors, Element cs, NodeStack stack, boolean caseSensitive, String hierarchyMeaning, CodeSystem csB, Element concept, Set<String> codes, Map<String, PropertyDef> properties) { + boolean ok = true; + String code = concept.getNamedChildValue("code"); + String display = concept.getNamedChildValue("display"); + + if (csB != null && !Utilities.noString(display)) { + ConceptDefinitionComponent b = CodeSystemUtilities.findCode(csB.getConcept(), code); + if (b != null && !b.getDisplay().equalsIgnoreCase(display)) { + String lang = cs.getNamedChildValue("language"); + if ((lang == null && !csB.hasLanguage()) || + csB.getLanguage().equals(lang)) { + // nothing new language wise, and the display doesn't match + hint(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), false, I18nConstants.CODESYSTEM_SUPP_NO_DISPLAY, display, b.getDisplay(), lang == null? "undefined" : lang); + } + } + } + + List<Element> designations = concept.getChildrenByName("designation"); + int i = 0; + for (Element designation : designations) { + ok = checkDesignation(errors, cs, stack.push(designation, i, null, null), concept, designation) && ok; + i++; + } + + List<Element> concepts = concept.getChildrenByName("concept"); + i = 0; + for (Element child : concepts) { + ok = checkConcept(errors, cs, stack.push(concept, i, null, null), caseSensitive, hierarchyMeaning, csB, child, codes, properties) && ok; + i++; + } + return ok; + } + + private boolean checkConceptProps(List<ValidationMessage> errors, Element cs, NodeStack stack, boolean caseSensitive, String hierarchyMeaning, CodeSystem csB, Element concept, Set<String> codes, Map<String, PropertyDef> properties) { + boolean ok = true; + + List<Element> propertyElements = concept.getChildrenByName("property"); + int i = 0; + for (Element propertyElement : propertyElements) { + ok = checkPropertyValue(errors, cs, stack.push(propertyElement, i, null, null), propertyElement, properties, codes) && ok; + i++; + } + + List<Element> concepts = concept.getChildrenByName("concept"); + i = 0; + for (Element child : concepts) { + ok = checkConceptProps(errors, cs, stack.push(concept, i, null, null), caseSensitive, hierarchyMeaning, csB, child, codes, properties) && ok; + i++; + } + return ok; + } + + private boolean checkDesignation(List<ValidationMessage> errors, Element cs, NodeStack stack, Element concept, Element designation) { + boolean ok = true; + + String rlang = cs.getNamedChildValue("language"); + String display = concept.getNamedChildValue("display"); + String lang = designation.getNamedChildValue("language"); + List<Element> uses = new ArrayList<Element>(); + designation.getNamedChildren("additionalUse", uses); + Element use = designation.getNamedChild("use"); + if (use != null) { + uses.add(0, use); + } + String value = designation.getNamedChildValue("value"); + + if (uses.isEmpty()) { + // if we have no uses, we're kind of implying that it's the base display, so it should be the same + if (rlang == null && lang == null) { + warning(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), display == null || display.equals(value), I18nConstants.CODESYSTEM_DESIGNATION_DISP_CLASH_NO_LANG, value, display); + } else if (rlang != null && ((lang == null) || rlang.equals(lang))) { + warning(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), display == null || display.equals(value), I18nConstants.CODESYSTEM_DESIGNATION_DISP_CLASH_LANG, value, display, rlang); + } + } else { + // .... do we care? + } + + return ok; + } + + private boolean checkPropertyValue(List<ValidationMessage> errors, Element cs, NodeStack stack, Element property, Map<String, PropertyDef> properties, Set<String> codes) { + boolean ok = true; + + String code = property.getNamedChildValue("code"); + Element value = property.getNamedChild("value"); + if (code != null) { + PropertyDef defn = properties.get(code); + if (rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), defn != null, I18nConstants.CODESYSTEM_PROPERTY_UNDEFINED, code) && + rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), value != null, I18nConstants.CODESYSTEM_PROPERTY_NO_VALUE, code) && + rule(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), value.fhirType().equals(defn.type), I18nConstants.CODESYSTEM_PROPERTY_WRONG_TYPE, code, value.fhirType(), defn.type)) { + // nothing? + } else { + ok = false; + } + if ("synonym".equals(code)) { + String vcode = value.isPrimitive() ? value.primitiveValue() : null; + warning(errors, "2024-03-06", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), codes.contains(vcode), I18nConstants.CODESYSTEM_PROPERTY_SYNONYM_CHECK, vcode); + } + } + return ok; + } private boolean checkShareableCodeSystem(List<ValidationMessage> errors, Element cs, NodeStack stack) { if (parent.isForPublication()) { @@ -121,6 +506,9 @@ public class CodeSystemValidator extends BaseValidator { } private void metaChecks(List<ValidationMessage> errors, Element cs, NodeStack stack, String url, String content, String caseSensitive, String hierarchyMeaning, boolean isSupplement, int count, String supp) { + if (forPublication && (url.contains("hl7.org"))) { + hint(errors, "2024-03-07", IssueType.BUSINESSRULE, cs.line(), cs.col(), stack.getLiteralPath(), url.contains("terminology.hl7.org") || url.contains("hl7.org/cda/stds/core"), I18nConstants.CODESYSTEM_THO_CHECK); + } if (isSupplement) { if (!"supplement".equals(content)) { NodeStack s = stack.push(cs.getNamedChild("content", false), -1, null, null); diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ConceptMapValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ConceptMapValidator.java index 23a7f9ff3..d50ca3686 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ConceptMapValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ConceptMapValidator.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import org.hl7.fhir.r5.elementmodel.Element; import org.hl7.fhir.r5.model.CodeSystem; @@ -11,10 +12,13 @@ import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent; import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.Enumerations.CodeSystemContentMode; import org.hl7.fhir.r5.model.ValueSet; +import org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent; import org.hl7.fhir.r5.terminologies.CodeSystemUtilities; import org.hl7.fhir.r5.terminologies.utilities.CodingValidationRequest; import org.hl7.fhir.r5.terminologies.utilities.TerminologyServiceErrorClass; import org.hl7.fhir.r5.terminologies.utilities.ValidationResult; +import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; +import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.i18n.I18nConstants; import org.hl7.fhir.utilities.validation.ValidationMessage; @@ -22,6 +26,7 @@ import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; import org.hl7.fhir.utilities.validation.ValidationOptions; import org.hl7.fhir.validation.BaseValidator; import org.hl7.fhir.validation.instance.utils.NodeStack; +import org.hl7.fhir.validation.instance.utils.ValidationContext; public class ConceptMapValidator extends BaseValidator { @@ -78,7 +83,12 @@ public class ConceptMapValidator extends BaseValidator { public boolean hasTargetVS() { return targetScope != null && targetScope.vs != null; } - + public ValueSet getSourceVS() { + return hasSourceVS() ? sourceScope.vs : null; + } + public ValueSet getTargetVS() { + return hasTargetVS() ? targetScope.vs : null; + } } @@ -102,7 +112,7 @@ public class ConceptMapValidator extends BaseValidator { super(parent); } - public boolean validateConceptMap(List<ValidationMessage> errors, Element cm, NodeStack stack, ValidationOptions options) { + public boolean validateConceptMap(ValidationContext valContext, List<ValidationMessage> errors, Element cm, NodeStack stack, ValidationOptions options) { boolean ok = true; Map<String, PropertyDefinition> props = new HashMap<>(); Map<String, String> attribs = new HashMap<>(); @@ -140,7 +150,7 @@ public class ConceptMapValidator extends BaseValidator { List<Element> groups = cm.getChildrenByName("group"); int ci = 0; for (Element group : groups) { - ok = validateGroup(errors, group, stack.push(group, ci, null, null), props, attribs, options, sourceScope, targetScope) && ok; + ok = validateGroup(valContext, errors, group, stack.push(group, ci, null, null), props, attribs, options, sourceScope, targetScope) && ok; ci++; } @@ -206,7 +216,7 @@ public class ConceptMapValidator extends BaseValidator { return null; } - private boolean validateGroup(List<ValidationMessage> errors, Element grp, NodeStack stack, Map<String, PropertyDefinition> props, Map<String, String> attribs, ValidationOptions options, VSReference sourceScope, VSReference targetScope) { + private boolean validateGroup(ValidationContext valContext, List<ValidationMessage> errors, Element grp, NodeStack stack, Map<String, PropertyDefinition> props, Map<String, String> attribs, ValidationOptions options, VSReference sourceScope, VSReference targetScope) { boolean ok = true; GroupContext ctxt = new GroupContext(); ctxt.sourceScope = sourceScope; @@ -214,30 +224,36 @@ public class ConceptMapValidator extends BaseValidator { Element e = grp.getNamedChild("source", false); if (warning(errors, "2023-03-05", IssueType.REQUIRED, grp.line(), grp.col(), stack.getLiteralPath(), e != null, I18nConstants.CONCEPTMAP_GROUP_SOURCE_MISSING)) { - ctxt.source = readCSReference(e, grp.getNamedChild("sourceVersion", false)); + ctxt.source = readCSReference(e, grp.getNamedChild("sourceVersion", false), ctxt.getSourceVS()); if (ctxt.source.cs != null) { - if (ctxt.source.cs.getContent() == CodeSystemContentMode.NOTPRESENT) { - ctxt.source.cs = null; - } else if (!warning(errors, "2023-03-05", IssueType.NOTFOUND, grp.line(), grp.col(), stack.push(e, -1, null, null).getLiteralPath(), isOkCodeSystem(ctxt.source.cs), I18nConstants.CONCEPTMAP_GROUP_SOURCE_INCOMPLETE, e.getValue(), ctxt.source.cs.getContent().toCode())) { + if (!warning(errors, "2023-03-05", IssueType.NOTFOUND, grp.line(), grp.col(), stack.push(e, -1, null, null).getLiteralPath(), isOkCodeSystem(ctxt.source.cs), I18nConstants.CONCEPTMAP_GROUP_SOURCE_INCOMPLETE, e.getValue(), ctxt.source.cs.getContent().toCode())) { ctxt.source.cs = null; } } else { warning(errors, "2023-03-05", IssueType.NOTFOUND, grp.line(), grp.col(), stack.push(e, -1, null, null).getLiteralPath(), sourceScope != null, I18nConstants.CONCEPTMAP_GROUP_SOURCE_UNKNOWN, e.getValue()); } + if (ctxt.source.version == null && ctxt.source.cs != null && !CodeSystemUtilities.isExemptFromMultipleVersionChecking(ctxt.source.url)) { + Set<String> possibleVersions = fetcher.fetchCanonicalResourceVersions(null, valContext.getAppContext(), ctxt.source.url); + warning(errors, NO_RULE_DATE, IssueType.INVALID, grp.line(), grp.col(), stack.getLiteralPath(), possibleVersions.size() <= 1, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_CANONICAL_MULTIPLE_POSSIBLE_VERSIONS, + ctxt.source.url, ctxt.source.cs.getVersion(), CommaSeparatedStringBuilder.join(", ", Utilities.sorted(possibleVersions))); + } } e = grp.getNamedChild("target", false); if (warning(errors, "2023-03-05", IssueType.REQUIRED, grp.line(), grp.col(), stack.getLiteralPath(), e != null, I18nConstants.CONCEPTMAP_GROUP_TARGET_MISSING)) { - ctxt.target = readCSReference(e, grp.getNamedChild("targetVersion", false)); + ctxt.target = readCSReference(e, grp.getNamedChild("targetVersion", false), ctxt.getTargetVS()); if (ctxt.target.cs != null) { - if (ctxt.target.cs.getContent() == CodeSystemContentMode.NOTPRESENT) { - ctxt.target.cs = null; - } else if (!warning(errors, "2023-03-05", IssueType.NOTFOUND, grp.line(), grp.col(), stack.push(e, -1, null, null).getLiteralPath(), isOkCodeSystem(ctxt.target.cs), I18nConstants.CONCEPTMAP_GROUP_TARGET_INCOMPLETE, e.getValue(), ctxt.target.cs.getContent().toCode())) { + if (!warning(errors, "2023-03-05", IssueType.NOTFOUND, grp.line(), grp.col(), stack.push(e, -1, null, null).getLiteralPath(), isOkCodeSystem(ctxt.target.cs), I18nConstants.CONCEPTMAP_GROUP_TARGET_INCOMPLETE, e.getValue(), ctxt.target.cs.getContent().toCode())) { ctxt.target.cs = null; } } else { warning(errors, "2023-03-05", IssueType.NOTFOUND, grp.line(), grp.col(), stack.push(e, -1, null, null).getLiteralPath(), targetScope != null, I18nConstants.CONCEPTMAP_GROUP_TARGET_UNKNOWN, e.getValue()); } + if (ctxt.target.version == null && ctxt.target.cs != null && !CodeSystemUtilities.isExemptFromMultipleVersionChecking(ctxt.target.url)) { + Set<String> possibleVersions = fetcher.fetchCanonicalResourceVersions(null, valContext.getAppContext(), ctxt.target.url); + warning(errors, NO_RULE_DATE, IssueType.INVALID, grp.line(), grp.col(), stack.getLiteralPath(), possibleVersions.size() <= 1, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_CANONICAL_MULTIPLE_POSSIBLE_VERSIONS, + ctxt.target.url, ctxt.target.cs.getVersion(), CommaSeparatedStringBuilder.join(", ", Utilities.sorted(possibleVersions))); + } } List<Element> elements = grp.getChildrenByName("element"); int ci = 0; @@ -248,7 +264,7 @@ public class ConceptMapValidator extends BaseValidator { return ok; } - private CSReference readCSReference(Element ref, Element version) { + private CSReference readCSReference(Element ref, Element version, ValueSet vs) { CSReference res = new CSReference(); res.url = ref.primitiveValue(); if (version != null) { @@ -256,13 +272,19 @@ public class ConceptMapValidator extends BaseValidator { } else if (res.url.contains("|")) { res.version = res.url.substring(res.url.indexOf("|")+1); res.url = res.url.substring(0, res.url.indexOf("|")); + } else if (vs != null && res.url != null) { + for (ConceptSetComponent vsi : vs.getCompose().getInclude()) { + if (res.url.equals(vsi.getSystem()) && vsi.hasVersion() ) { + res.version = vsi.getVersion(); + } + } } res.cs = context.fetchCodeSystem(res.url, res.version); return res; } private boolean isOkCodeSystem(CodeSystem tgtCS) { - return tgtCS.getContent() != CodeSystemContentMode.EXAMPLE && tgtCS.getContent() != CodeSystemContentMode.FRAGMENT; + return tgtCS.getContent() != CodeSystemContentMode.NOTPRESENT && tgtCS.getContent() != CodeSystemContentMode.EXAMPLE && tgtCS.getContent() != CodeSystemContentMode.FRAGMENT; } private boolean validateGroupElement(List<ValidationMessage> errors, Element src, NodeStack stack, Map<String, PropertyDefinition> props, Map<String, String> attribs, ValidationOptions options, GroupContext ctxt) { @@ -277,7 +299,7 @@ public class ConceptMapValidator extends BaseValidator { if (warningOrError(ctxt.source.cs.getContent() == CodeSystemContentMode.COMPLETE, errors, "2023-03-05", IssueType.REQUIRED, code.line(), code.col(), cstack.getLiteralPath(), cd != null, I18nConstants.CONCEPTMAP_GROUP_SOURCE_CODE_INVALID, c, ctxt.source.cs.getVersionedUrl())) { Element display = src.getNamedChild("display", false); if (display != null) { - warning(errors, "2023-03-05", IssueType.REQUIRED, code.line(), code.col(), cstack.getLiteralPath(), CodeSystemUtilities.checkDisplay(ctxt.source.cs, cd, display.getValue()), I18nConstants.CONCEPTMAP_GROUP_SOURCE_DISPLAY_INVALID, display.getValue(), CodeSystemUtilities.getDisplays(ctxt.source.cs, cd)); + warning(errors, "2023-03-05", IssueType.REQUIRED, code.line(), code.col(), cstack.getLiteralPath(), CodeSystemUtilities.checkDisplay(ctxt.source.cs, cd, display.getValue()), I18nConstants.CONCEPTMAP_GROUP_SOURCE_DISPLAY_INVALID, display.getValue(), CommaSeparatedStringBuilder.joinWrapped(", ", "'", "'", CodeSystemUtilities.getDisplays(ctxt.source.cs, cd)), ctxt.source.cs.getVersionedUrl()+"#"+cd.getCode()); } if (ctxt.hasSourceVS() && ctxt.source != null) { ValidationResult vr = context.validateCode(options.withCheckValueSetOnly().withNoServer(), ctxt.source.url, ctxt.source.version, c, null, ctxt.sourceScope.vs); @@ -314,11 +336,11 @@ public class ConceptMapValidator extends BaseValidator { if (warningOrError(ctxt.target.cs.getContent() == CodeSystemContentMode.COMPLETE, errors, "2023-03-05", IssueType.REQUIRED, code.line(), code.col(), cstack.getLiteralPath(), cd != null, I18nConstants.CONCEPTMAP_GROUP_TARGET_CODE_INVALID, c, ctxt.target.cs.getVersionedUrl())) { Element display = tgt.getNamedChild("display", false); if (display != null) { - warning(errors, "2023-03-05", IssueType.REQUIRED, code.line(), code.col(), cstack.getLiteralPath(), CodeSystemUtilities.checkDisplay(ctxt.target.cs, cd, display.getValue()), I18nConstants.CONCEPTMAP_GROUP_TARGET_DISPLAY_INVALID, display.getValue(), CodeSystemUtilities.getDisplays(ctxt.target.cs, cd)); + warning(errors, "2023-03-05", IssueType.REQUIRED, code.line(), code.col(), cstack.getLiteralPath(), CodeSystemUtilities.checkDisplay(ctxt.target.cs, cd, display.getValue()), I18nConstants.CONCEPTMAP_GROUP_TARGET_DISPLAY_INVALID, display.getValue(), CommaSeparatedStringBuilder.joinWrapped(", ", "'", "'", CodeSystemUtilities.getDisplays(ctxt.target.cs, cd)), ctxt.target.cs.getVersionedUrl()+"#"+cd.getCode()); } if (ctxt.hasTargetVS() && ctxt.target != null) { ValidationResult vr = context.validateCode(options.withCheckValueSetOnly().withNoServer(), ctxt.target.url, ctxt.target.version, c, null, ctxt.targetScope.vs); - if (!warningOrError(ctxt.target.cs.getContent() == CodeSystemContentMode.COMPLETE, errors, "2023-09-06", IssueType.REQUIRED, code.line(), code.col(), cstack.getLiteralPath(), vr.isOk(), I18nConstants.CONCEPTMAP_GROUP_SOURCE_CODE_INVALID_VS, c, ctxt.targetScope.vs.getVersionedUrl())) { + if (!warningOrError(ctxt.target.cs.getContent() == CodeSystemContentMode.COMPLETE, errors, "2023-09-06", IssueType.REQUIRED, code.line(), code.col(), cstack.getLiteralPath(), vr.isOk(), I18nConstants.CONCEPTMAP_GROUP_TARGET_CODE_INVALID_VS, c, ctxt.targetScope.vs.getVersionedUrl())) { ok = (ctxt.target.cs.getContent() != CodeSystemContentMode.COMPLETE) && ok; } } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ObservationValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ObservationValidator.java index 3f82f0652..a1c6b30ef 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ObservationValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ObservationValidator.java @@ -60,7 +60,7 @@ public class ObservationValidator extends BaseValidator { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/bodyweight", "Body weight", "LOINC", codes, pct, mode) && ok; } else if (hasLoincCode(code, codes, "39156-5", "39156-5", "59574-4", "89270-3")) { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/bmi", "Body mass index", "LOINC", codes, pct, mode) && ok; - } else if (hasLoincCode(code, codes, "85354-9", "96607-7", "35094-2", "8459-0", "85354-9", "76534-7", "96607-7", "55284-4", "8480-6")) { + } else if (hasLoincCode(code, codes, "85354-9", "35094-2", "8459-0", "85354-9", "76534-7", "55284-4", "8480-6")) { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/bp", "Blood pressure systolic and diastolic", "LOINC", codes, pct, mode) && ok; } else if (hasSctCode(code, codes, "46680005")) { @@ -81,7 +81,7 @@ public class ObservationValidator extends BaseValidator { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/bodyweight", "Body weight", "SNOMED CT", codes, pct, mode) && ok; } else if (hasSctCode(code, codes, "60621009")) { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/bmi", "Body mass index", "SNOMED CT", codes, pct, mode) && ok; - } else if (hasSctCode(code, codes, "75367002", "251076008", "6797001", "163033001", "123820005", "163035008", "723232008", "386534000", "386536003", "271649006", "271649006", "271650006", "407556006", "407554009", "716579001", "399304008")) { + } else if (hasSctCode(code, codes, "75367002", "251076008", "163033001", "163035008", "386534000", "386536003", "271649006", "271649006", "271650006", "407556006", "407554009", "716579001", "399304008")) { ok = checkObservationAgainstProfile(valContext,errors, element, stack, "http://hl7.org/fhir/StructureDefinition/bp", "Blood pressure systolic and diastolic", "SNOMED CT", codes, pct, mode) && ok; } } @@ -94,7 +94,7 @@ public class ObservationValidator extends BaseValidator { if (sd == null) { return false; } else { - return ((InstanceValidator) parent).startInner(valContext, errors, element, element, sd, stack, false, pct, mode); + return ((InstanceValidator) parent).startInner(valContext, errors, element, element, sd, stack, false, pct, mode, false); } } 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 f33baa616..f82b128ad 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 @@ -910,7 +910,7 @@ public class StructureDefinitionValidator extends BaseValidator { } private boolean serverSupportsValueSet(String ref) { - ValidationResult vr = context.validateCode(new ValidationOptions(FhirPublication.R5).withCheckValueSetOnly().withVsAsUrl().withNoClient(), new Coding("http://loinc.org", "5792-7", null), new ValueSet().setUrl(ref)); + ValidationResult vr = context.validateCode(new ValidationOptions(FhirPublication.R5).withCheckValueSetOnly().withNoClient(), new Coding("http://loinc.org", "5792-7", null), new ValueSet().setUrl(ref)); return vr.getErrorClass() == null || vr.getErrorClass() == TerminologyServiceErrorClass.UNKNOWN; } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ValueSetValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ValueSetValidator.java index fe0f93e40..ef3065184 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ValueSetValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ValueSetValidator.java @@ -1,15 +1,27 @@ package org.hl7.fhir.validation.instance.type; import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; import java.util.List; +import java.util.Set; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; +import org.hl7.fhir.r5.model.CodeSystem; +import org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent; +import org.hl7.fhir.r5.model.CodeSystem.PropertyComponent; import org.hl7.fhir.r5.elementmodel.Element; import org.hl7.fhir.r5.model.Coding; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.r5.model.Enumerations.FilterOperator; import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.ValueSet; +import org.hl7.fhir.r5.terminologies.CodeSystemUtilities; import org.hl7.fhir.r5.terminologies.utilities.CodingValidationRequest; import org.hl7.fhir.r5.terminologies.utilities.TerminologyServiceErrorClass; import org.hl7.fhir.r5.terminologies.utilities.ValidationResult; +import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.i18n.I18nConstants; @@ -21,12 +33,78 @@ import org.hl7.fhir.validation.codesystem.CodeSystemChecker; import org.hl7.fhir.validation.codesystem.GeneralCodeSystemChecker; import org.hl7.fhir.validation.codesystem.SnomedCTChecker; import org.hl7.fhir.validation.instance.InstanceValidator; +import org.hl7.fhir.validation.instance.type.ValueSetValidator.PropertyOperation; +import org.hl7.fhir.validation.instance.type.ValueSetValidator.PropertyValidationRules; import org.hl7.fhir.validation.instance.utils.NodeStack; +import org.hl7.fhir.validation.instance.utils.ValidationContext; public class ValueSetValidator extends BaseValidator { + public enum PropertyOperation { + Equals, IsA, DescendentOf, IsNotA, RegEx, In, NotIn, Generalizes, ChildOf, DescendentLeaf, Exists; + + public String toString() { + switch (this) { + case ChildOf: return "child-of"; + case DescendentLeaf: return "descendent-leaf"; + case DescendentOf: return "descendent-of"; + case Equals: return "="; + case Exists: return "exists"; + case Generalizes: return "generalizes"; + case In: return "in"; + case IsA: return "is-a"; + case IsNotA: return "is-not-a"; + case NotIn: return "not-in"; + case RegEx: return "regex"; + default: return "?"; + } + } + + } + + public enum CodeValidationRule { + Warning, Error, None + + } + + public class PropertyValidationRules { + private PropertyFilterType type; + private CodeValidationRule codeValidation; + private EnumSet<PropertyOperation> ops; + + protected PropertyValidationRules(PropertyFilterType type, CodeValidationRule codeValidation, PropertyOperation... ops) { + super(); + this.type = type; + this.codeValidation = codeValidation; + this.ops = EnumSet.noneOf(PropertyOperation.class); + for (PropertyOperation op : ops) { + this.ops.add(op); + } + } + public PropertyValidationRules(PropertyFilterType type, CodeValidationRule codeValidation, EnumSet<PropertyOperation> ops) { + super(); + this.type = type; + this.codeValidation = codeValidation; + this.ops = ops; + } + + public PropertyFilterType getType() { + return type; + } + public EnumSet<PropertyOperation> getOps() { + return ops; + } + public CodeValidationRule getCodeValidation() { + return codeValidation; + } + + } + + public enum PropertyFilterType { + Boolean, Integer, Decimal, Code, DateTime, Coding + } private static final int TOO_MANY_CODES_TO_VALIDATE = 1000; - + private CodeSystemChecker getSystemValidator(String system, List<ValidationMessage> errors) { if (system == null) { return new GeneralCodeSystemChecker(context, xverManager, debug, errors); @@ -36,7 +114,7 @@ public class ValueSetValidator extends BaseValidator { default: return new GeneralCodeSystemChecker(context, xverManager, debug, errors); } } - + public class VSCodingValidationRequest extends CodingValidationRequest { private NodeStack stack; @@ -49,20 +127,20 @@ public class ValueSetValidator extends BaseValidator { public NodeStack getStack() { return stack; } - + } public ValueSetValidator(InstanceValidator parent) { super(parent); } - - public boolean validateValueSet(List<ValidationMessage> errors, Element vs, NodeStack stack) { + + public boolean validateValueSet(ValidationContext valContext, List<ValidationMessage> errors, Element vs, NodeStack stack) { boolean ok = true; if (!VersionUtilities.isR2Ver(context.getVersion())) { List<Element> composes = vs.getChildrenByName("compose"); int cc = 0; for (Element compose : composes) { - ok = validateValueSetCompose(errors, compose, stack.push(compose, composes.size() > 1 ? cc : -1, null, null), vs.getNamedChildValue("url", false), "retired".equals(vs.getNamedChildValue("url", false))) & ok; + ok = validateValueSetCompose(valContext, errors, compose, stack.push(compose, composes.size() > 1 ? cc : -1, null, null), vs.getNamedChildValue("url", false), "retired".equals(vs.getNamedChildValue("url", false)), vs) & ok; cc++; } } @@ -76,46 +154,46 @@ public class ValueSetValidator extends BaseValidator { if (parent.isForPublication()) { if (isHL7(vs)) { boolean ok = true; - ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("url", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "url") && ok; - ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("version", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "version") && ok; - ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("title", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "title") && ok; - warning(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("name", false), I18nConstants.VALUESET_SHAREABLE_EXTRA_MISSING_HL7, "name"); - ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("status", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "status") && ok; - ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("experimental", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "experimental") && ok; - ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("description", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "description") && ok; + ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("url", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "url") && ok; + ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("version", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "version") && ok; + ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("title", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "title") && ok; + warning(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("name", false), I18nConstants.VALUESET_SHAREABLE_EXTRA_MISSING_HL7, "name"); + ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("status", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "status") && ok; + ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("experimental", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "experimental") && ok; + ok = rule(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("description", false), I18nConstants.VALUESET_SHAREABLE_MISSING_HL7, "description") && ok; return ok; } else { - warning(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("url", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "url"); - warning(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("version", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "version"); - warning(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("title", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "title"); - warning(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("name", false), I18nConstants.VALUESET_SHAREABLE_EXTRA_MISSING, "name"); - warning(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("status", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "status"); - warning(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("experimental", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "experimental"); - warning(errors, NO_RULE_DATE, IssueType.REQUIRED, vs.line(), vs.col(), stack.getLiteralPath(), vs.hasChild("description", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "description"); + warning(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("url", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "url"); + warning(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("version", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "version"); + warning(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("title", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "title"); + warning(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("name", false), I18nConstants.VALUESET_SHAREABLE_EXTRA_MISSING, "name"); + warning(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("status", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "status"); + warning(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("experimental", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "experimental"); + warning(errors, NO_RULE_DATE, IssueType.REQUIRED, stack, vs.hasChild("description", false), I18nConstants.VALUESET_SHAREABLE_MISSING, "description"); } } return true; } - private boolean validateValueSetCompose(List<ValidationMessage> errors, Element compose, NodeStack stack, String vsid, boolean retired) { + private boolean validateValueSetCompose(ValidationContext valContext, List<ValidationMessage> errors, Element compose, NodeStack stack, String vsid, boolean retired, Element vsSrc) { boolean ok = true; List<Element> includes = compose.getChildrenByName("include"); int ci = 0; for (Element include : includes) { - ok = validateValueSetInclude(errors, include, stack.push(include, ci, null, null), vsid, retired) && ok; + ok = validateValueSetInclude(valContext, errors, include, stack.push(include, ci, null, null), vsid, retired, vsSrc) && ok; ci++; } List<Element> excludes = compose.getChildrenByName("exclude"); int ce = 0; for (Element exclude : excludes) { - ok = validateValueSetInclude(errors, exclude, stack.push(exclude, ce, null, null), vsid, retired) && ok; + ok = validateValueSetInclude(valContext, errors, exclude, stack.push(exclude, ce, null, null), vsid, retired, vsSrc) && ok; ce++; } return ok; } - - private boolean validateValueSetInclude(List<ValidationMessage> errors, Element include, NodeStack stack, String vsid, boolean retired) { + + private boolean validateValueSetInclude(ValidationContext valContext, List<ValidationMessage> errors, Element include, NodeStack stack, String vsid, boolean retired, Element vsSrc) { boolean ok = true; String system = include.getChildValue("system"); String version = include.getChildValue("version"); @@ -139,13 +217,61 @@ public class ValueSetValidator extends BaseValidator { i++; } if (valuesets.size() > 1) { - warning(errors, NO_RULE_DATE, IssueType.INFORMATIONAL, stack.getLiteralPath(), false, I18nConstants.VALUESET_IMPORT_UNION_INTERSECTION); + warning(errors, NO_RULE_DATE, IssueType.INFORMATIONAL, stack, false, I18nConstants.VALUESET_IMPORT_UNION_INTERSECTION); + } + if (system != null) { + rule(errors, "2024-03-06", IssueType.INVALID, stack, Utilities.isAbsoluteUrl(system), system.startsWith("#") ? I18nConstants.VALUESET_INCLUDE_SYSTEM_ABSOLUTE_FRAG : I18nConstants.VALUESET_INCLUDE_SYSTEM_ABSOLUTE, system); + if (system.startsWith("#")) { + List<Element> cs = new ArrayList<>(); + for (Element contained : vsSrc.getChildrenByName("contained")) { + if (("#"+contained.getIdBase()).equals(system)) { + ok = false; // see absolute check above. + + if (rule(errors, "2024-02-10", IssueType.INVALID, stack, "CodeSystem".equals(contained.fhirType()), I18nConstants.VALUESET_INCLUDE_CS_NOT_CS, system, contained.fhirType())) { + if (version == null || version.equals(contained.getChildValue("version"))) { + cs.add(contained); + } + } + } + } + if (cs.isEmpty()) { + ok = rule(errors, "2024-02-10", IssueType.INVALID, stack, false, version == null ? I18nConstants.VALUESET_INCLUDE_CS_NOT_FOUND : I18nConstants.VALUESET_INCLUDE_CSVER_NOT_FOUND, system, version) && ok; + } else { + ok = rule(errors, "2024-02-10", IssueType.INVALID, stack, cs.size() == 1, version == null ? I18nConstants.VALUESET_INCLUDE_CS_MULTI_FOUND : I18nConstants.VALUESET_INCLUDE_CSVER_MULTI_FOUND, system, version) && ok; + } + } + if (version == null) { + CodeSystem cs = context.fetchCodeSystem(system); + if (cs != null && !CodeSystemUtilities.isExemptFromMultipleVersionChecking(system)) { + Set<String> possibleVersions = fetcher.fetchCanonicalResourceVersions(null, valContext.getAppContext(), system); + warning(errors, NO_RULE_DATE, IssueType.INVALID, stack, possibleVersions.size() <= 1, I18nConstants.TYPE_SPECIFIC_CHECKS_DT_CANONICAL_MULTIPLE_POSSIBLE_VERSIONS, + system, cs.getVersion(), CommaSeparatedStringBuilder.join(", ", Utilities.sorted(possibleVersions))); + } + } } List<Element> concepts = include.getChildrenByName("concept"); List<Element> filters = include.getChildrenByName("filter"); CodeSystemChecker slv = getSystemValidator(system, errors); + CodeSystem cs = null; if (!Utilities.noString(system)) { + cs = context.fetchCodeSystem(system, version); + if (cs != null) { // if it's null, we can't analyse this + switch (cs.getContent()) { + case EXAMPLE: + warning(errors, "2024-03-06", IssueType.INVALID, stack, false, version == null ? I18nConstants.VALUESET_INCLUDE_CS_CONTENT : I18nConstants.VALUESET_INCLUDE_CSVER_CONTENT, system, cs.getContent().toCode(), version); + break; + case FRAGMENT: + hint(errors, "2024-03-06", IssueType.INVALID, stack, false, version == null ? I18nConstants.VALUESET_INCLUDE_CS_CONTENT : I18nConstants.VALUESET_INCLUDE_CSVER_CONTENT, system, cs.getContent().toCode(), version); + break; + case SUPPLEMENT: + ok = rule(errors, "2024-03-06", IssueType.INVALID, stack, false, version == null ? I18nConstants.VALUESET_INCLUDE_CS_SUPPLEMENT : I18nConstants.VALUESET_INCLUDE_CSVER_SUPPLEMENT, system, cs.getSupplements(), version) && ok; + break; + default: + break; + } + } + boolean systemOk = true; int cc = 0; List<VSCodingValidationRequest> batch = new ArrayList<>(); @@ -162,22 +288,22 @@ public class ValueSetValidator extends BaseValidator { } if (((InstanceValidator) parent).isValidateValueSetCodesOnTxServer() && batch.size() > 0 & !context.isNoTerminologyServer()) { if (batch.size() > TOO_MANY_CODES_TO_VALIDATE) { - ok = hint(errors, "2023-09-06", IssueType.BUSINESSRULE, stack.getLiteralPath(), false, I18nConstants.VALUESET_INC_TOO_MANY_CODES, batch.size()) && ok; + ok = hint(errors, "2023-09-06", IssueType.BUSINESSRULE, stack, false, I18nConstants.VALUESET_INC_TOO_MANY_CODES, batch.size()) && ok; } else { long t = System.currentTimeMillis(); if (parent.isDebug()) { System.out.println(" : Validate "+batch.size()+" codes from "+system+" for "+vsid); } try { - context.validateCodeBatch(ValidationOptions.defaults(), batch, null); + context.validateCodeBatch(ValidationOptions.defaults().withExampleOK(), batch, null); if (parent.isDebug()) { System.out.println(" : .. "+(System.currentTimeMillis()-t)+"ms"); } for (VSCodingValidationRequest cv : batch) { if (version == null) { - warningOrHint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, cv.getStack().getLiteralPath(), cv.getResult().isOk(), !retired, I18nConstants.VALUESET_INCLUDE_INVALID_CONCEPT_CODE, system, cv.getCoding().getCode()); + warningOrHint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, cv.getStack().getLiteralPath(), cv.getResult().isOk(), !retired, I18nConstants.VALUESET_INCLUDE_INVALID_CONCEPT_CODE, system, cv.getCoding().getCode(), cv.getResult().getMessage()); } else { - warningOrHint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, cv.getStack().getLiteralPath(), cv.getResult().isOk(), !retired, I18nConstants.VALUESET_INCLUDE_INVALID_CONCEPT_CODE_VER, system, version, cv.getCoding().getCode()); + warningOrHint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, cv.getStack().getLiteralPath(), cv.getResult().isOk(), !retired, I18nConstants.VALUESET_INCLUDE_INVALID_CONCEPT_CODE_VER, system, version, cv.getCoding().getCode(), cv.getResult().getMessage()); } } } catch (Exception e) { @@ -190,14 +316,12 @@ public class ValueSetValidator extends BaseValidator { int cf = 0; for (Element filter : filters) { - if (systemOk && !validateValueSetIncludeFilter(errors, include, stack.push(filter, cf, null, null), system, version, slv)) { - systemOk = false; - } + ok = validateValueSetIncludeFilter(errors, filter, stack.push(filter, cf, null, null), system, version, cs, slv) & ok; cf++; } slv.finish(include, stack); } else { - warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), filters.size() == 0 && concepts.size() == 0, I18nConstants.VALUESET_NO_SYSTEM_WARNING); + warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack, filters.size() == 0 && concepts.size() == 0, I18nConstants.VALUESET_NO_SYSTEM_WARNING); } return ok; } @@ -207,9 +331,9 @@ public class ValueSetValidator extends BaseValidator { String code = concept.getChildValue("code"); String display = concept.getChildValue("display"); slv.checkConcept(code, display); - + if (version == null) { - ValidationResult vv = context.validateCode(ValidationOptions.defaults(), new Coding(system, code, null), null); + ValidationResult vv = context.validateCode(ValidationOptions.defaults().withExampleOK(), new Coding(system, code, null), null); if (vv.getErrorClass() == TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED) { if (isExampleUrl(system)) { if (isAllowExamples()) { @@ -223,21 +347,21 @@ public class ValueSetValidator extends BaseValidator { return false; } else { boolean ok = vv.isOk(); - warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), ok, I18nConstants.VALUESET_INCLUDE_INVALID_CONCEPT_CODE, system, code); + warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack, ok, I18nConstants.VALUESET_INCLUDE_INVALID_CONCEPT_CODE, system, code, vv.getMessage()); if (vv.getMessage() != null) { - hint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), false, vv.getMessage()); + hint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack, false, vv.getMessage()); } } } else { - ValidationResult vv = context.validateCode(ValidationOptions.defaults(), new Coding(system, code, null).setVersion(version), null); + ValidationResult vv = context.validateCode(ValidationOptions.defaults().withExampleOK(), new Coding(system, code, null).setVersion(version), null); if (vv.getErrorClass() == TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED) { warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stackInc.getLiteralPath(), false, I18nConstants.VALUESET_UNC_SYSTEM_WARNING_VER, system+"#"+version, vv.getMessage()); return false; } else { boolean ok = vv.isOk(); - warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), ok, I18nConstants.VALUESET_INCLUDE_INVALID_CONCEPT_CODE_VER, system, version, code); + warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack, ok, I18nConstants.VALUESET_INCLUDE_INVALID_CONCEPT_CODE_VER, system, version, code, vv.getMessage()); if (vv.getMessage() != null) { - hint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), false, vv.getMessage()); + hint(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack, false, vv.getMessage()); } } } @@ -248,19 +372,300 @@ public class ValueSetValidator extends BaseValidator { String code = concept.getChildValue("code"); String display = concept.getChildValue("display"); slv.checkConcept(code, display); - + Coding c = new Coding(system, code, null); if (version != null) { - c.setVersion(version); + c.setVersion(version); } return new VSCodingValidationRequest(stack, c); } - private boolean validateValueSetIncludeFilter(List<ValidationMessage> errors, Element filter, NodeStack push, String system, String version, CodeSystemChecker slv) { -// -// String display = concept.getChildValue("display"); -// slv.checkConcept(code, display); + private boolean validateValueSetIncludeFilter(List<ValidationMessage> errors, Element filter, NodeStack stack, String system, String version, CodeSystem cs, CodeSystemChecker slv) { + boolean ok = true; + String property = filter.getChildValue("property"); + String op = filter.getChildValue("op"); + String value = filter.getChildValue("value"); + + if (property != null) { + List<String> knownNames = new ArrayList<>(); + knownNames.add("concept"); + knownNames.add("code"); + knownNames.add("status"); + knownNames.add("inactive"); + knownNames.add("effectiveDate"); + knownNames.add("deprecationDate"); + knownNames.add("retirementDate"); + knownNames.add("notSelectable"); + if (cs == null || cs.hasHierarchyMeaning()) { + knownNames.add("parent"); + knownNames.add("child"); + knownNames.add("partOf"); + } + knownNames.add("synonym"); + knownNames.add("comment"); + knownNames.add("itemWeight"); + if (cs != null) { + for (CodeSystemFilterComponent f : cs.getFilter()) { + addName(knownNames, f.getCode()); + } + for (PropertyComponent p : cs.getProperty()) { + addName(knownNames, p.getCode()); + } + } + for (String s : getSystemKnownNames(system)) { + addName(knownNames, s); + } + boolean pok = false; + if (cs == null) { + pok = hint(errors, "2024-03-09", IssueType.INVALID, stack, knownNames.contains(property), I18nConstants.VALUESET_UNKNOWN_FILTER_PROPERTY_NO_CS, property, system, CommaSeparatedStringBuilder.join(",", knownNames)); + } else { + pok = warning(errors, "2024-03-09", IssueType.INVALID, stack, knownNames.contains(property), I18nConstants.VALUESET_UNKNOWN_FILTER_PROPERTY, property, system, CommaSeparatedStringBuilder.join(",", knownNames)); + } + if (pok) { + PropertyValidationRules rules = rulesForFilter(system, cs, property); + if (rules != null) { + if (!rules.getOps().isEmpty()) { + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack, opInSet(op, rules.getOps()), I18nConstants.VALUESET_BAD_FILTER_OP, op, property, CommaSeparatedStringBuilder.join(",", rules.getOps())) && ok; + } + + if ("exists".equals(op)) { + ok = checkFilterValue(errors, stack, system, version, ok, property, op, value, PropertyFilterType.Boolean, null) && ok; + } else if ("regex".equals(op)) { + String err = null; + try { + Pattern.compile(value); + } catch (PatternSyntaxException e) { + err = e.getMessage(); + } + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack, err == null, I18nConstants.VALUESET_BAD_FILTER_VALUE_VALID_REGEX, property, value, err) && ok; + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack, !"concept".equals(property), I18nConstants.VALUESET_BAD_PROPERTY_NO_REGEX, property) && ok; + } else if (Utilities.existsInList(op, "in", "not-in")) { + for (String v : value.split("\\,")) { + ok = checkFilterValue(errors, stack, system, version, ok, property, op, v, rules.getType(), rules.getCodeValidation()) && ok; + } + } else { + ok = checkFilterValue(errors, stack, system, version, ok, property, op, value, rules.getType(), rules.getCodeValidation()) && ok; + } + } + } + } + + return ok; + } + + private boolean opInSet(String op, EnumSet<PropertyOperation> ops) { + switch (op) { + case "=": return ops.contains(PropertyOperation.Equals); + case "is-a": return ops.contains(PropertyOperation.IsA); + case "descendent-of": return ops.contains(PropertyOperation.DescendentOf); + case "is-not-a": return ops.contains(PropertyOperation.IsNotA); + case "regex": return ops.contains(PropertyOperation.RegEx); + case "in": return ops.contains(PropertyOperation.In); + case "not-in": return ops.contains(PropertyOperation.NotIn); + case "generalizes": return ops.contains(PropertyOperation.Generalizes); + case "child-of": return ops.contains(PropertyOperation.ChildOf); + case "descendent-leaf": return ops.contains(PropertyOperation.DescendentLeaf); + case "exists": return ops.contains(PropertyOperation.Exists); + } + return false; + } + + private boolean checkFilterValue(List<ValidationMessage> errors, NodeStack stack, String system, String version,boolean ok, String property, String op, String value, PropertyFilterType type, CodeValidationRule cr) { + if (type != null) { + if (!Utilities.existsInList(op, "in", "not-in")) { + hint(errors, "2024-03-09", IssueType.INVALID, stack.getLiteralPath(), !value.contains(","), I18nConstants.VALUESET_BAD_FILTER_VALUE_HAS_COMMA, type.toString()); + } + switch (type) { + case Boolean: + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack, + Utilities.existsInList(value, "true", "false"), + I18nConstants.VALUESET_BAD_FILTER_VALUE_BOOLEAN, property, value) && ok; + break; + case Code: + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack, + value.trim().equals(value), + I18nConstants.VALUESET_BAD_FILTER_VALUE_CODE, property, value) && ok; + if (cr == CodeValidationRule.Error || cr == CodeValidationRule.Warning) { + ValidationResult vr = context.validateCode(baseOptions, system, version, value, null); + if (cr == CodeValidationRule.Error) { + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack.getLiteralPath(), vr.isOk(), I18nConstants.VALUESET_BAD_FILTER_VALUE_VALID_CODE, property, value, system, vr.getMessage()) && ok; + } else { + warning(errors, "2024-03-09", IssueType.INVALID, stack.getLiteralPath(), vr.isOk(), I18nConstants.VALUESET_BAD_FILTER_VALUE_VALID_CODE, property, value, system, vr.getMessage()); + } + } + break; + case DateTime: + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack.getLiteralPath(), + value.matches("([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)?)?)?"), + I18nConstants.VALUESET_BAD_FILTER_VALUE_DATETIME, property, value) && ok; + break; + case Decimal: + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack.getLiteralPath(), + Utilities.isDecimal(value, true), + I18nConstants.VALUESET_BAD_FILTER_VALUE_DECIMAL, property, value) && ok; + break; + case Integer: + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack.getLiteralPath(), + Utilities.isInteger(value), + I18nConstants.VALUESET_BAD_FILTER_VALUE_INTEGER, property, value) && ok; + break; + case Coding : + Coding code = Coding.fromLiteral(value); + if (code == null) { + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack, false, I18nConstants.VALUESET_BAD_FILTER_VALUE_CODED, property, value) && ok; + } else { + ValidationResult vr = context.validateCode(baseOptions, code, null); + ok = rule(errors, "2024-03-09", IssueType.INVALID, stack, vr.isOk(), I18nConstants.VALUESET_BAD_FILTER_VALUE_CODED_INVALID, property, value, vr.getMessage()) && ok; + } + break; + default: + break; + } + } + return ok; + } + + private PropertyValidationRules rulesForFilter(String system, CodeSystem cs, String property) { + var ops = EnumSet.noneOf(PropertyOperation.class); - return true; + if (cs != null) { + + for (CodeSystemFilterComponent f : cs.getFilter()) { + if (property.equals(f.getCode())) { + for (Enumeration<FilterOperator> op : f.getOperator()) { + ops.add(toOp(op)); + } + } + } + + for (PropertyComponent p : cs.getProperty()) { + if (property.equals(p.getCode())) { + if (p.getType() != null) { + switch (p.getType()) { + case BOOLEAN: return new PropertyValidationRules(PropertyFilterType.Boolean, null, ops); + case CODE: + // the definitions say " a code that identifies a concept defined in the code system" -> ValidCode. + // but many people have ignored that and defined a property as 'code' because it's from a list of values that are otherwise undefined + boolean external = !forPublication || cs.getWebPath() == null || Utilities.isAbsoluteUrl(cs.getWebPath()); + return new PropertyValidationRules(PropertyFilterType.Code, external ? CodeValidationRule.Warning : CodeValidationRule.Error, ops); // valid code... the definitions say that, but people were missing that in the pastm + case CODING: return new PropertyValidationRules(PropertyFilterType.Coding, null, ops); + case DATETIME: return new PropertyValidationRules(PropertyFilterType.DateTime, null, ops); + case DECIMAL: return new PropertyValidationRules(PropertyFilterType.Decimal, null, ops); + case INTEGER: return new PropertyValidationRules(PropertyFilterType.Integer, null, ops); + case STRING: return null; + } + } + } + } + } + + switch (property) { + case "concept" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.Error, addToOps(ops, PropertyOperation.Equals, PropertyOperation.In, PropertyOperation.IsA, PropertyOperation.DescendentOf, PropertyOperation.DescendentLeaf, PropertyOperation.IsNotA, PropertyOperation.NotIn)); + case "code" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.Error, addToOps(ops, PropertyOperation.Equals, PropertyOperation.RegEx)); + case "status" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.None, ops); + case "inactive" : return new PropertyValidationRules(PropertyFilterType.Boolean,null, ops); + case "effectiveDate" : return new PropertyValidationRules(PropertyFilterType.DateTime, null, ops); + case "deprecationDate" : return new PropertyValidationRules(PropertyFilterType.DateTime, null, ops); + case "retirementDate" : return new PropertyValidationRules(PropertyFilterType.DateTime, null, ops); + case "notSelectable" : return new PropertyValidationRules(PropertyFilterType.Boolean, null, ops); + case "parent" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.Error, ops); + case "child" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.Error, ops); + case "partOf" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.Error, ops); + case "synonym" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.None, ops); // ? none? + case "comment" : return null; + case "itemWeight" : return new PropertyValidationRules(PropertyFilterType.Decimal, null, ops); + } + switch (system) { + case "http://loinc.org" : + if (Utilities.existsInList(property, "copyright", "STATUS", "CLASS", "CONSUMER_NAME", "ORDER_OBS", "DOCUMENT_SECTION", "SCALE_TYP")) { + return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.None); + } else if ("CLASSTYPE".equals(property)) { + return new PropertyValidationRules(PropertyFilterType.Integer, null, addToOps(ops, PropertyOperation.Equals, PropertyOperation.In)); + } else { + return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.Error, addToOps(ops, PropertyOperation.Equals, PropertyOperation.In)); + } + case "http://snomed.info/sct": + switch (property) { + case "constraint": return null; // for now + case "expressions": return new PropertyValidationRules(PropertyFilterType.Boolean, null, addToOps(ops, PropertyOperation.Equals, PropertyOperation.In)); + default: + return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.Error, addToOps(ops, PropertyOperation.Equals, PropertyOperation.In)); + } + case "http://www.nlm.nih.gov/research/umls/rxnorm" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.None, ops); + case "http://unitsofmeasure.org" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.None, ops); + case "http://www.ama-assn.org/go/cpt" : + switch (property) { + case "modifier": return new PropertyValidationRules(PropertyFilterType.Boolean, null, ops); + case "kind" : return new PropertyValidationRules(PropertyFilterType.Code, CodeValidationRule.None, ops); // for now + case "modified": return new PropertyValidationRules(PropertyFilterType.Boolean, null, ops); + case "code" : return null; + case "telemedicine": return new PropertyValidationRules(PropertyFilterType.Boolean, null, ops); + case "orthopox" : return new PropertyValidationRules(PropertyFilterType.Boolean,null, ops); + } + } + if (ops != null) { + return new PropertyValidationRules(null, null, ops); + } else { + return null; + } + + } + + + private EnumSet<PropertyOperation> addToOps(EnumSet<PropertyOperation> set, PropertyOperation... ops) { + for (PropertyOperation op : ops) { + set.add(op); + } + return set; + } + + private PropertyOperation toOp(Enumeration<FilterOperator> op) { + switch (op.getValue()) { + case CHILDOF: return PropertyOperation.ChildOf; + case DESCENDENTLEAF: return PropertyOperation.DescendentLeaf; + case DESCENDENTOF: return PropertyOperation.DescendentOf; + case EQUAL: return PropertyOperation.Equals; + case EXISTS: return PropertyOperation.Exists; + case GENERALIZES: return PropertyOperation.Generalizes; + case IN: return PropertyOperation.In; + case ISA: return PropertyOperation.IsA; + case ISNOTA: return PropertyOperation.IsNotA; + case NOTIN: return PropertyOperation.NotIn; + case REGEX: return PropertyOperation.RegEx; + default: return null; + } + } + + private void addName(List<String> knownNames, String code) { + if (code != null && !knownNames.contains(code)) { + knownNames.add(code); + } + } + + private String[] getSystemKnownNames(String system) { + switch (system) { + case "http://loinc.org" : return new String[] {"parent", "ancestor", "copyright", "STATUS", "COMPONENT", "PROPERTY", "TIME_ASPCT", "SYSTEM", "SCALE_TYP", "METHOD_TYP", "CLASS", "CONSUMER_NAME", "CLASSTYPE", "ORDER_OBS", "DOCUMENT_SECTION"}; + + case "http://snomed.info/sct": return new String[] { "constraint", "expressions", "410662002", "42752001", "47429007", "116676008", "116686009", "118168003", "118169006", "118170007", "118171006", "127489000", "131195008", + "246075003", "246090004", "246093002", "246112005", "246454002", "246456000", "246501002", "246513007", "246514001", "255234002", "260507000", + "260686004", "260870009", "263502005", "272741003", "288556008", "363589002", "363698007", "363699004", "363700003", "363701004", "363702006", + "363703001", "363704007", "363705008", "363709002", "363710007", "363713009", "363714003", "370129005", "370130000", "370131001", "370132008", + "370133003", "370134009", "370135005", "371881003", "405813007", "405814001", "405815000", "405816004", "408729009", "408730004", "408731000", + "408732007", "410675002", "411116001", "418775008", "419066007", "424226004", "424244007", "424361007", "424876005", "425391005", "609096000", + "704319004", "704320005", "704321009", "704322002", "704323007", "704324001", "704325000", "704326004", "704327008", "704346009", "704347000", + "704647008", "718497002", "719715003", "719722006", "726542003", "726633004", "732943007", "732945000", "732947008", "733722007", "733725009", + "733928003", "733930001", "733931002", "733932009", "733933004", "734136001", "734137005", "736472000", "736473005", "736474004", "736475003", + "736476002", "736518005", "738774007", "762705008", "762706009", "762949000", "762951001", "763032000", "766939001", "774081006", "774158006", + "774159003", "774160008", "774163005", "827081001", "836358009", "840560000", "860779006", "860781008", "1003703000", "1003735000", "1142135004", + "1142136003", "1142137007", "1142138002", "1142139005", "1142140007", "1142141006", "1142142004", "1142143009", "1148793005", "1148965004", + "1148967007", "1148968002", "1148969005", "1149366004", "1149367008", "1230370004", "320091000221107" }; + // list from http://tx.fhir.org/r4/ValueSet/$expand?url=http://snomed.info/sct?fhir_vs=isa/410662002 + + case "http://www.nlm.nih.gov/research/umls/rxnorm" : return new String[] { "STY", "SAB", "TTY", "SY", "SIB", "RN", "PAR", "CHD", "RB", "RO", "IN", "PIN", "MIN", "BN", "SCD", "SBD", "GPCK", "BPCK", "SCDC", "SCDF", "SCDFP", "SCDG", "SCDGP", "SBDC", "SBDF", "SBDFP", "SBDG", "DF", "DFG" }; + case "http://unitsofmeasure.org" : return new String[] { "property", "canonical" }; + case "http://www.ama-assn.org/go/cpt" : return new String[] { "modifier", "kind", "modified", "code", "telemedicine", "orthopox" }; + case "urn:ietf:bcp:47" : return new String[] {"language", "region", "script", "variant", "extension", "ext-lang", "private-use" }; + default: return new String[] { }; + } } } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/FHIRPathExpressionFixer.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/FHIRPathExpressionFixer.java index 40d531d8f..c4437511c 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/FHIRPathExpressionFixer.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/FHIRPathExpressionFixer.java @@ -9,10 +9,16 @@ public class FHIRPathExpressionFixer { // this is a hack work around for past publication of wrong FHIRPath expressions boolean r5 = VersionUtilities.isR5Ver(version); -// if (r5) { -// return expr; -// } + boolean r4 = VersionUtilities.isR4Ver(version) || VersionUtilities.isR4BVer(version); + // see https://chat.fhir.org/#narrow/stream/196008-ig-publishing-requirements/topic/Operation.20Definition.20Parameters.20table + if (r5 && "opd-3".equals(key)) { + return "targetProfile.exists() implies (type = 'Reference' or type = 'canonical' or type.memberOf('http://hl7.org/fhir/ValueSet/all-resource-types'))"; + } + if (r4 && "opd-3".equals(key)) { + return "targetProfile.exists() implies (type = 'Reference' or type = 'canonical' or type.memberOf('http://hl7.org/fhir/ValueSet/resource-types'))"; + } + if ("probability is decimal implies (probability as decimal) <= 100".equals(expr)) { return "(probability.exists() and (probability is decimal)) implies ((probability as decimal) <= 100)"; } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/ValidationContext.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/ValidationContext.java index b2acb49e8..c2eec6ada 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/ValidationContext.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/ValidationContext.java @@ -1,8 +1,10 @@ package org.hl7.fhir.validation.instance.utils; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import org.hl7.fhir.r5.elementmodel.Element; import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat; @@ -11,6 +13,8 @@ import org.hl7.fhir.utilities.validation.ValidationMessage; public class ValidationContext { + public static final String INTERNAL_REFERENCES_NAME = "internal.references"; + private Object appContext; // the version we are currently validating for right now @@ -27,6 +31,7 @@ public class ValidationContext { private boolean checkSpecials = true; private Map<String, List<ValidationMessage>> sliceRecords; + private Set<String> internalRefs; public ValidationContext(Object appContext) { this.appContext = appContext; @@ -36,12 +41,22 @@ public class ValidationContext { this.appContext = appContext; this.resource = element; this.rootResource = element; + this.internalRefs = setupInternalRefs(element); check(); // no groupingResource (Bundle or Parameters) dump("creating"); } + private Set<String> setupInternalRefs(Element element) { + Set<String> res = (Set<String>) element.getUserData(INTERNAL_REFERENCES_NAME); + if (res == null) { + res = new HashSet<String>(); + element.setUserData(INTERNAL_REFERENCES_NAME, res); + } + return res; + } + private void check() { if (!rootResource.hasParentForValidator()) { throw new Error("No parent on root resource"); @@ -52,6 +67,7 @@ public class ValidationContext { this.appContext = appContext; this.resource = element; this.rootResource = root; + this.internalRefs = setupInternalRefs(element); check(); // no groupingResource (Bundle or Parameters) dump("creating"); @@ -62,6 +78,7 @@ public class ValidationContext { this.resource = element; this.rootResource = root; this.groupingResource = groupingResource; + this.internalRefs = setupInternalRefs(element); check(); dump("creating"); } @@ -137,6 +154,7 @@ public class ValidationContext { res.profile = profile; res.groupingResource = groupingResource; res.version = version; + res.internalRefs = setupInternalRefs(element); res.dump("forContained"); return res; } @@ -148,6 +166,7 @@ public class ValidationContext { res.profile = profile; res.groupingResource = groupingResource; res.version = version; + res.internalRefs = setupInternalRefs(element); res.dump("forEntry"); return res; } @@ -159,6 +178,7 @@ public class ValidationContext { res.profile = profile; res.version = version; res.groupingResource = groupingResource; + res.internalRefs = internalRefs; res.sliceRecords = sliceRecords != null ? sliceRecords : new HashMap<String, List<ValidationMessage>>(); res.dump("forProfile "+profile.getUrl()); return res; @@ -171,6 +191,7 @@ public class ValidationContext { res.profile = profile; res.groupingResource = groupingResource; res.checkSpecials = false; + res.internalRefs = setupInternalRefs(resource); res.dump("forLocalReference "+profile.getUrl()); res.version = version; return res; @@ -191,6 +212,7 @@ public class ValidationContext { res.groupingResource = null; res.checkSpecials = false; res.version = version; + res.internalRefs = setupInternalRefs(resource); res.dump("forRemoteReference "+profile.getUrl()); return res; } @@ -203,6 +225,7 @@ public class ValidationContext { res.profile = profile; res.checkSpecials = false; res.version = version; + res.internalRefs = internalRefs; res.sliceRecords = new HashMap<String, List<ValidationMessage>>(); res.dump("forSlicing"); return res; @@ -217,5 +240,9 @@ public class ValidationContext { return this; } + public Set<String> getInternalRefs() { + return internalRefs; + } + } \ No newline at end of file diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/R4R5MapTester.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/R4R5MapTester.java index dfecae980..3f029654f 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/R4R5MapTester.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/special/R4R5MapTester.java @@ -449,7 +449,7 @@ public class R4R5MapTester implements IValidatorResourceFetcher { } @Override - public CanonicalResource fetchCanonicalResource(IResourceValidator validator, String url) throws URISyntaxException { + public CanonicalResource fetchCanonicalResource(IResourceValidator validator, Object appContext, String url) throws URISyntaxException { return null; } @@ -458,4 +458,9 @@ public class R4R5MapTester implements IValidatorResourceFetcher { return false; } + @Override + public Set<String> fetchCanonicalResourceVersions(IResourceValidator validator, Object appContext, String url) { + return new HashSet<>(); + } + } diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/TerminologyServiceTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/TerminologyServiceTests.java index 957dab3a2..a278efd85 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/TerminologyServiceTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/TerminologyServiceTests.java @@ -37,6 +37,7 @@ import org.hl7.fhir.r5.model.UriType; import org.hl7.fhir.r5.model.ValueSet; import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent; import org.hl7.fhir.r5.terminologies.expansion.ValueSetExpansionOutcome; +import org.hl7.fhir.r5.terminologies.utilities.TerminologyServiceErrorClass; import org.hl7.fhir.r5.terminologies.utilities.ValidationResult; import org.hl7.fhir.r5.test.utils.CompareUtilities; import org.hl7.fhir.r5.test.utils.TestingUtilities; @@ -339,7 +340,12 @@ public class TerminologyServiceTests { res.addParameter("system", new UriType(system)); } if (vm.getCode() != null) { - res.addParameter("code", new CodeType(vm.getCode())); + if (code != null && !code.equals(vm.getCode())) { + res.addParameter("code", new CodeType(code)); + res.addParameter("normalized-code", new CodeType(vm.getCode())); + } else { + res.addParameter("code", new CodeType(vm.getCode())); + } } else if (code != null) { res.addParameter("code", new CodeType(code)); } @@ -375,7 +381,7 @@ public class TerminologyServiceTests { } if (vm.getUnknownSystems() != null) { for (String s : vm.getUnknownSystems()) { - res.addParameter("x-caused-by-unknown-system", new CanonicalType(s)); + res.addParameter(vm.getErrorClass() == TerminologyServiceErrorClass.CODESYSTEM_UNSUPPORTED ? "x-caused-by-unknown-system" : "x-unknown-system", new CanonicalType(s)); } } if (vm.getIssues().size() > 0) { diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/ValidationServiceTest.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/ValidationServiceTest.java index 945c9b537..5346d78e8 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/ValidationServiceTest.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/ValidationServiceTest.java @@ -10,8 +10,10 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.endsWith; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.ArgumentMatchers.notNull; import static org.mockito.ArgumentMatchers.startsWith; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -236,17 +238,43 @@ class ValidationServiceTest { */ @Test public void buildValidationEngineTest() throws IOException, URISyntaxException { - - final org.hl7.fhir.utilities.TimeTracker timeTracker = mock(org.hl7.fhir.utilities.TimeTracker.class); - + final TimeTracker timeTracker = mock(TimeTracker.class); final SimpleWorkerContext workerContext = mock(SimpleWorkerContext.class); - final ValidationEngine validationEngine = mock(ValidationEngine.class); - when(validationEngine.getContext()).thenReturn(workerContext); + final ValidationEngine mockValidationEngine = mock(ValidationEngine.class); + when(mockValidationEngine.getContext()).thenReturn(workerContext); - final ValidationEngine.ValidationEngineBuilder validationEngineBuilder = mock(ValidationEngine.ValidationEngineBuilder.class);; + final ValidationEngine.ValidationEngineBuilder mockValidationEngineBuilder = mock(ValidationEngine.ValidationEngineBuilder.class);; + final ValidationService validationService = createFakeValidationService(mockValidationEngineBuilder, mockValidationEngine); - final ValidationService validationService = new ValidationService() { + CliContext cliContext = new CliContext(); + validationService.buildValidationEngine(cliContext, null, timeTracker); + + verify(mockValidationEngine).setFetcher(notNull()); + verify(mockValidationEngineBuilder).withUserAgent(eq("fhir/validator/" + VersionUtil.getVersion())); + } + + @Test + public void buildValidationEngineDisableDefaultResourceFetcherTest() throws IOException, URISyntaxException { + final TimeTracker timeTracker = mock(TimeTracker.class); + final SimpleWorkerContext workerContext = mock(SimpleWorkerContext.class); + + final ValidationEngine mockValidationEngine = mock(ValidationEngine.class); + when(mockValidationEngine.getContext()).thenReturn(workerContext); + + final ValidationEngine.ValidationEngineBuilder mockValidationEngineBuilder = mock(ValidationEngine.ValidationEngineBuilder.class);; + final ValidationService validationService = createFakeValidationService(mockValidationEngineBuilder, mockValidationEngine); + + CliContext cliContext = new CliContext(); + cliContext.setDisableDefaultResourceFetcher(true); + validationService.buildValidationEngine(cliContext, null, timeTracker); + + verify(mockValidationEngine, never()).setFetcher(any()); + verify(mockValidationEngineBuilder).withUserAgent(eq("fhir/validator/" + VersionUtil.getVersion())); + } + + private static ValidationService createFakeValidationService(ValidationEngine.ValidationEngineBuilder validationEngineBuilder, ValidationEngine validationEngine) { + return new ValidationService() { @Override protected ValidationEngine.ValidationEngineBuilder getValidationEngineBuilder() { when(validationEngineBuilder.withTHO(anyBoolean())).thenReturn(validationEngineBuilder); @@ -268,11 +296,5 @@ class ValidationServiceTest { //Don't care. Do nothing. } }; - - CliContext cliContext = new CliContext(); - - validationService.buildValidationEngine(cliContext, null, timeTracker); - - verify(validationEngineBuilder).withUserAgent(eq("fhir/validator/" + VersionUtil.getVersion())); } } \ No newline at end of file diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/r5/test/StructureMappingTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/StructureMappingTests.java similarity index 99% rename from org.hl7.fhir.validation/src/test/java/org/hl7/fhir/r5/test/StructureMappingTests.java rename to org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/StructureMappingTests.java index d7993f563..6eff3a1bd 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/r5/test/StructureMappingTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/StructureMappingTests.java @@ -1,4 +1,4 @@ -package org.hl7.fhir.r5.test; +package org.hl7.fhir.validation.tests; import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationEngineTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationEngineTests.java index 2a5c50930..71168be55 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationEngineTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationEngineTests.java @@ -10,6 +10,7 @@ import org.hl7.fhir.r5.model.OperationOutcome; import org.hl7.fhir.r5.model.OperationOutcome.IssueSeverity; import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent; import org.hl7.fhir.r5.test.utils.TestingUtilities; +import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.FhirPublication; import org.hl7.fhir.utilities.settings.FhirSettings; import org.hl7.fhir.utilities.tests.CacheVerificationLogger; @@ -34,18 +35,7 @@ public class ValidationEngineTests { CacheVerificationLogger logger = new CacheVerificationLogger(); ve.getContext().getTxClientManager().getMasterClient().setLogger(logger); OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient-example.xml"), null); - int e = errors(op); - int w = warnings(op); - int h = hints(op); - if (!TestUtilities.silent) { - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); - for (OperationOutcomeIssueComponent iss : op.getIssue()) { - System.out.println(" " + iss.getDetails().getText()); - } - } - Assertions.assertEquals(0, e); - Assertions.assertEquals(0, w); - Assertions.assertEquals(1, h); + Assertions.assertTrue(checkOutcomes("test401Xml", op, "[] null information/informational: All OK")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); } @@ -57,15 +47,26 @@ public class ValidationEngineTests { CacheVerificationLogger logger = new CacheVerificationLogger(); ve.getContext().getTxClientManager().getMasterClient().setLogger(logger); OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "patient-example.json"), null); - int e = errors(op); - int w = warnings(op); - int h = hints(op); - Assertions.assertEquals(0, e); - Assertions.assertEquals(0, w); - Assertions.assertEquals(1, h); + Assertions.assertTrue(checkOutcomes("test401Json", op, "[] null information/informational: All OK")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); - if (!TestUtilities.silent) - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); + } + + private boolean checkOutcomes(String id, OperationOutcome op, String text) { + CommaSeparatedStringBuilder lines = new CommaSeparatedStringBuilder("\n"); + for (OperationOutcomeIssueComponent iss : op.getIssue()) { + lines.append(iss.toString()); + } + String outcome = lines.toString(); + if (lines.toString().equals(text)) { + return true; + } else { + System.out.println("-- "+id+" -------"); + System.out.println("Expected:"); + System.out.println(text); + System.out.println("Outcome:"); + System.out.println(outcome); + return false; + } } @Test @@ -76,18 +77,7 @@ public class ValidationEngineTests { CacheVerificationLogger logger = new CacheVerificationLogger(); ve.getContext().getTxClientManager().getMasterClient().setLogger(logger); OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient-example.xml"), null); - int e = errors(op); - int w = warnings(op); - int h = hints(op); - if (!TestUtilities.silent) { - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); - for (OperationOutcomeIssueComponent iss : op.getIssue()) { - System.out.println(" " + iss.getDetails().getText()); - } - } - Assertions.assertEquals(0, e); - Assertions.assertEquals(0, w); - Assertions.assertEquals(1, h); + Assertions.assertTrue(checkOutcomes("test430Xml", op, "[] null information/informational: All OK")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); } @@ -99,21 +89,8 @@ public class ValidationEngineTests { CacheVerificationLogger logger = new CacheVerificationLogger(); ve.getContext().getTxClientManager().getMasterClient().setLogger(logger); OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "patient-example.json"), null); - int e = errors(op); - int w = warnings(op); - int h = hints(op); - if (!TestUtilities.silent) { - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); - for (OperationOutcomeIssueComponent iss : op.getIssue()) { - System.out.println(" " + iss.getDetails().getText()); - } - } - Assertions.assertEquals(0, e); - Assertions.assertEquals(0, w); - Assertions.assertEquals(1, h); + Assertions.assertTrue(checkOutcomes("test430Json", op, "[] null information/informational: All OK")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); - if (!TestUtilities.silent) - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); } @Test @@ -128,19 +105,8 @@ public class ValidationEngineTests { CacheVerificationLogger logger = new CacheVerificationLogger(); ve.getContext().getTxClientManager().getMasterClient().setLogger(logger); OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient140.xml"), null); - if (!TestUtilities.silent) - for (OperationOutcomeIssueComponent iss : op.getIssue()) { - System.out.println(" " + iss.getDetails().getText()); - } - int e = errors(op); - int w = warnings(op); - int h = hints(op); - Assertions.assertEquals(2, e); - Assertions.assertEquals(0, w); - Assertions.assertEquals(0, h); + Assertions.assertTrue(checkOutcomes("test140", op, "Patient.contact[0].name.family[0].extension[0].value.ofType(code) null error/code-invalid: The value provided ('VV') was not found in the value set 'EntityNamePartQualifier' (http://hl7.org/fhir/ValueSet/name-part-qualifier|1.4.0), and a code is required from this value set (error message = The System URI could not be determined for the code 'VV' in the ValueSet 'http://hl7.org/fhir/ValueSet/name-part-qualifier|1.4.0'; The provided code '#VV' was not found in the value set 'http://hl7.org/fhir/ValueSet/name-part-qualifier|1.4.0')")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); - if (!TestUtilities.silent) - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); } @Test @@ -156,19 +122,9 @@ public class ValidationEngineTests { CacheVerificationLogger logger = new CacheVerificationLogger(); ve.getContext().getTxClientManager().getMasterClient().setLogger(logger); OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient102.xml"), null); - if (!TestUtilities.silent) - for (OperationOutcomeIssueComponent iss : op.getIssue()) { - System.out.println(" " + iss.getSeverity().toCode() + ": " + iss.getDetails().getText()); - } - int e = errors(op); - int w = warnings(op); - int h = hints(op); - Assertions.assertEquals(2, e); - Assertions.assertEquals(0, w); - Assertions.assertEquals(0, h); + Assertions.assertTrue(checkOutcomes("test102", op, + "Patient.contact[0].name.family[0].extension[0].value.ofType(code) null error/code-invalid: The value provided ('VV') was not found in the value set 'EntityNamePartQualifier' (http://hl7.org/fhir/ValueSet/name-part-qualifier|1.0.2), and a code is required from this value set (error message = The System URI could not be determined for the code 'VV' in the ValueSet 'http://hl7.org/fhir/ValueSet/name-part-qualifier|1.0.2'; The provided code '#VV' was not found in the value set 'http://hl7.org/fhir/ValueSet/name-part-qualifier|1.0.2')")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); - if (!TestUtilities.silent) - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); } @Test @@ -184,19 +140,13 @@ public class ValidationEngineTests { CacheVerificationLogger logger = new CacheVerificationLogger(); ve.getContext().getTxClientManager().getMasterClient().setLogger(logger); OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "observation102.json"), null); - if (!TestUtilities.silent) - for (OperationOutcomeIssueComponent iss : op.getIssue()) { - System.out.println(" "+iss.getSeverity().toCode()+": "+ iss.getDetails().getText()); - } - int e = errors(op); - int w = warnings(op); - int h = hints(op); - Assertions.assertEquals(1, e); - Assertions.assertEquals(2, w); - Assertions.assertEquals(2, h); + Assertions.assertTrue(checkOutcomes("testObs102", op, + "Observation.text.div null error/invalid: Wrong namespace on the XHTML ('null', should be 'http://www.w3.org/1999/xhtml')\n"+ + "Observation.category null information/business-rule: Reference to experimental CodeSystem http://hl7.org/fhir/observation-category\n"+ + "Observation.code.coding[2].system null information/not-found: A definition for CodeSystem 'http://acme.org/devices/clinical-codes' could not be found, so the code cannot be validated\n"+ + "Observation null warning/invalid: Best Practice Recommendation: In general, all observations should have a performer\n"+ + "Observation null warning/invalid: Best Practice Recommendation: In general, all observations should have an effective[x] ()")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); - if (!TestUtilities.silent) - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); } @@ -210,16 +160,10 @@ public class ValidationEngineTests { if (!TestUtilities.silent) System.out.println(" .. load USCore"); OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "observation301.xml"), null); - if (!TestUtilities.silent) - for (OperationOutcomeIssueComponent issue : op.getIssue()) - System.out.println(" - " + issue.getDetails().getText()+" ("+issue.getSeverity().toCode()+")"); - int e = errors(op); - int w = warnings(op); - int h = hints(op); - Assertions.assertEquals(0, e); + Assertions.assertTrue(checkOutcomes("test301", op, + "Observation.code.coding[3].system null information/not-found: A definition for CodeSystem 'http://acme.org/devices/clinical-codes' could not be found, so the code cannot be validated\n"+ + "Observation null warning/invalid: Best Practice Recommendation: In general, all observations should have a performer")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); - if (!TestUtilities.silent) - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); } @Test @@ -236,18 +180,8 @@ public class ValidationEngineTests { List<String> profiles = new ArrayList<>(); profiles.add("http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"); OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient301.xml"), profiles); - if (!TestUtilities.silent) - for (OperationOutcomeIssueComponent issue : op.getIssue()) - System.out.println(" - " + issue.getDetails().getText()); - int e = errors(op); - int w = warnings(op); - int h = hints(op); - Assertions.assertEquals(1, e); - Assertions.assertEquals(0, w); - Assertions.assertEquals(0, h); + Assertions.assertTrue(checkOutcomes("test301USCore", op, "Patient.name[1] null error/structure: Patient.name.family: minimum required = 1, but only found 0 (from http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient|1.0.1)")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); - if (!TestUtilities.silent) - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); } @@ -263,47 +197,18 @@ public class ValidationEngineTests { igLoader.loadIg(ve.getIgs(), ve.getBinaries(), "hl7.fhir.us.core#3.1.1", false); List<String> profiles = new ArrayList<>(); OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "observation401_ucum.json"), profiles); - if (!TestUtilities.silent) - for (OperationOutcomeIssueComponent issue : op.getIssue()) - System.out.println(" - "+issue.getSeverity().toCode()+": " + issue.getDetails().getText()); - int e = errors(op); - int w = warnings(op); - int h = hints(op); - Assertions.assertEquals(0, e); - Assertions.assertEquals(6, w); - Assertions.assertEquals(2, h); + Assertions.assertTrue(checkOutcomes("test401USCore", op, + "Observation null information/informational: Validate Observation against the Body weight profile (http://hl7.org/fhir/StructureDefinition/bodyweight) which is required by the FHIR specification because the LOINC code 29463-7 was found\n"+ + "Observation.code.coding[0].system null information/not-found: A definition for CodeSystem 'http://loinc.org' could not be found, so the code cannot be validated\n"+ + "Observation.value.ofType(Quantity) null warning/business-rule: Unable to validate code 'kg' in system 'http://unitsofmeasure.org' because the validator is running without terminology services\n"+ + "Observation.value.ofType(Quantity).code null warning/informational: Unable to validate code without using server because: Resolved system http://unitsofmeasure.org (v3.0.1), but the definition doesn't include any codes, so the code has not been validated\n"+ + "Observation.code null warning/code-invalid: None of the codings provided are in the value set 'Vital Signs' (http://hl7.org/fhir/ValueSet/observation-vitalsignresult|4.0.1), and a coding should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable) (codes = http://loinc.org#29463-7)\n"+ + "Observation null warning/invalid: Best Practice Recommendation: In general, all observations should have a performer\n"+ + "Observation.code null warning/not-found: Unable to check whether the code is in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult|4.0.1' because the code system http://loinc.org was not found\n"+ + "Observation null warning/invariant: Constraint failed: dom-6: 'A resource should have narrative for robust management' (defined in http://hl7.org/fhir/StructureDefinition/DomainResource) (Best Practice Recommendation)")); assertTrue(logger.verifyHasNoRequests(), "Unexpected request to TX server"); - if (!TestUtilities.silent) - System.out.println(" .. done: " + Integer.toString(e) + " errors, " + Integer.toString(w) + " warnings, " + Integer.toString(h) + " information messages"); } - - private int errors(OperationOutcome op) { - int i = 0; - for (OperationOutcomeIssueComponent vm : op.getIssue()) { - if (vm.getSeverity() == IssueSeverity.ERROR || vm.getSeverity() == IssueSeverity.FATAL) - i++; - } - return i; - } - - private int warnings(OperationOutcome op) { - int i = 0; - for (OperationOutcomeIssueComponent vm : op.getIssue()) { - if (vm.getSeverity() == IssueSeverity.WARNING) - i++; - } - return i; - } - - private int hints(OperationOutcome op) { - int i = 0; - for (OperationOutcomeIssueComponent vm : op.getIssue()) { - if (vm.getSeverity() == IssueSeverity.INFORMATION || vm.getSeverity() == IssueSeverity.SUCCESS) - i++; - } - return i; - } public static void execute() throws Exception { ValidationEngineTests self = new ValidationEngineTests(); diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java index 4c9b4272c..8ef8eb0de 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java @@ -13,9 +13,11 @@ import java.util.Collections; import java.util.Comparator; import java.util.EnumSet; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.NotImplementedException; @@ -832,7 +834,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe } @Override - public CanonicalResource fetchCanonicalResource(IResourceValidator validator, String url) { + public CanonicalResource fetchCanonicalResource(IResourceValidator validator, Object appContext, String url) { return null; } @@ -867,4 +869,9 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe StructureDefinition structure, ElementDefinition element, String path) { return EnumSet.allOf(ElementValidationAction.class); } + + @Override + public Set<String> fetchCanonicalResourceVersions(IResourceValidator validator, Object appContext, String url) { + return new HashSet<>(); + } } \ No newline at end of file diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.r5/vs-externals.json b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.r5/vs-externals.json index d01076756..aa736244c 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.r5/vs-externals.json +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.r5/vs-externals.json @@ -1,6 +1,4 @@ { - "http://somewhere/something-else" : null, - "http://loinc.org/vs/LL715-4" : null, - "http://hl7.org/fhir/us/vrdr/ValueSet/vrdr-PlaceOfDeath" : null, - "http://somewhere/something" : null + "https://fhir.infoway-inforoute.ca/ValueSet/issuetype|20190415" : null, + "https://fhir.infoway-inforoute.ca/ValueSet/issueseverity|20190415" : null } diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/loinc.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/loinc.cache index b02afed15..aeef6fc1f 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/loinc.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/loinc.cache @@ -3,7 +3,7 @@ "system" : "http://loinc.org", "code" : "3141-9", "display" : "Weight Measured" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { "resourceType" : "Parameters", "parameter" : [{ "name" : "profile-url", @@ -15,7 +15,7 @@ v: { "code" : "3141-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r2", + "server" : "http://local.fhir.org/r2", "issues" : { "resourceType" : "OperationOutcome" } @@ -26,7 +26,7 @@ v: { "system" : "http://loinc.org", "code" : "3141-9", "display" : "Weight Measured" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { "resourceType" : "Parameters", "parameter" : [{ "name" : "profile-url", diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/snomed.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/snomed.cache index 8ee7b39de..1e224fb2c 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/snomed.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/snomed.cache @@ -14,7 +14,7 @@ v: { "display" : "Body weight", "code" : "27113001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r2", "issues" : { "resourceType" : "OperationOutcome" @@ -37,7 +37,7 @@ v: { "display" : "Body weight", "code" : "27113001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r2", "unknown-systems" : "", "issues" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/system-map.json b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/system-map.json index 0c492b56a..ee2290ea6 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/system-map.json +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.0.2/system-map.json @@ -2,19 +2,23 @@ "systems" : [ { "system" : "http://acme.org/devices/clinical-codes", - "server" : "http://tx-dev.fhir.org/r2" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://loinc.org", - "server" : "http://tx-dev.fhir.org/r2" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://snomed.info/sct", - "server" : "http://tx-dev.fhir.org/r2" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://unitsofmeasure.org", - "server" : "http://tx-dev.fhir.org/r2" + "authoritative" : [], + "candidates" : [] } ] } diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.4.0/.terminologyCapabilities.tx-dev.fhir.org.r3.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.4.0/.terminologyCapabilities.tx-dev.fhir.org.r3.cache index 8d40a8897..5bdb2b40d 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.4.0/.terminologyCapabilities.tx-dev.fhir.org.r3.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.4.0/.terminologyCapabilities.tx-dev.fhir.org.r3.cache @@ -1083,6 +1083,9 @@ { "uri" : "http://hl7.org/fhir/slotstatus" }, + { + "uri" : "http://hl7.org/fhir/spdx-license" + }, { "uri" : "http://hl7.org/fhir/special-values" }, @@ -3231,6 +3234,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/hl7-work-group" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/icd-o-3" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status" }, diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.4.0/all-systems.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.4.0/all-systems.cache deleted file mode 100644 index d7f1eecc9..000000000 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/1.4.0/all-systems.cache +++ /dev/null @@ -1,20 +0,0 @@ -------------------------------------------------------------------------------------- -{"code" : { - "code" : "Foo" -}, "url": "https://fhir.infoway-inforoute.ca/ValueSet/canadianjurisdiction", "version": "20170626", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "severity" : "error", - "error" : "The code provided (Foo) is not in the expansion in the value set https://fhir.infoway-inforoute.ca/ValueSet/canadianjurisdiction, and a code is required from this value set. The system http://canadapost.ca/CodeSystem/ProvinceCodes could not be found.", - "class" : "CODESYSTEM_UNSUPPORTED", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/.terminologyCapabilities.tx-dev.fhir.org.r3.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/.terminologyCapabilities.tx-dev.fhir.org.r3.cache index 8d40a8897..5bdb2b40d 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/.terminologyCapabilities.tx-dev.fhir.org.r3.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/.terminologyCapabilities.tx-dev.fhir.org.r3.cache @@ -1083,6 +1083,9 @@ { "uri" : "http://hl7.org/fhir/slotstatus" }, + { + "uri" : "http://hl7.org/fhir/spdx-license" + }, { "uri" : "http://hl7.org/fhir/special-values" }, @@ -3231,6 +3234,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/hl7-work-group" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/icd-o-3" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status" }, diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/all-systems.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/all-systems.cache index 68477f23c..bc1c48b37 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/all-systems.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/all-systems.cache @@ -40,6 +40,34 @@ v: { "resourceType" : "OperationOutcome" } +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "image/jpg" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "image/jpg", + "code" : "image/jpg", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r3", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + } ------------------------------------------------------------------------------------- {"code" : { @@ -68,6 +96,34 @@ v: { "resourceType" : "OperationOutcome" } +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "application/pdf" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "application/pdf", + "code" : "application/pdf", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r3", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + } ------------------------------------------------------------------------------------- {"code" : { @@ -134,7 +190,7 @@ v: { "code" : "urn:ihe:iti:xds:2017:mimeTypeSufficient", "severity" : "error", "error" : "A definition for CodeSystem 'http://ihe.net/fhir/ihe.formatcode.fhir/CodeSystem/formatcode' could not be found, so the code cannot be validated; The provided code 'http://ihe.net/fhir/ihe.formatcode.fhir/CodeSystem/formatcode#urn:ihe:iti:xds:2017:mimeTypeSufficient ('MimeType sufficient')' was not found in the value set 'http://hl7.org/fhir/ValueSet/formatcodes|20150326'", - "class" : "CODESYSTEM_UNSUPPORTED", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "http://ihe.net/fhir/ihe.formatcode.fhir/CodeSystem/formatcode", "issues" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/loinc.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/loinc.cache index 0ecbdeac9..1324be420 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/loinc.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/loinc.cache @@ -1,50 +1,4 @@ ------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "29463-7", - "display" : "Body Weight" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Body weight", - "code" : "29463-7", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "3141-9", - "display" : "Body weight Measured" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Body weight Measured", - "code" : "3141-9", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- {"code" : { "system" : "http://loinc.org", "code" : "19935-6", @@ -61,8 +15,7 @@ v: { "code" : "19935-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -84,8 +37,7 @@ v: { "code" : "19935-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -108,8 +60,7 @@ v: { "code" : "19935-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -131,8 +82,7 @@ v: { "code" : "28655-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -154,8 +104,7 @@ v: { "code" : "28655-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -177,8 +126,7 @@ v: { "code" : "28655-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -201,8 +149,7 @@ v: { "code" : "29299-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -225,8 +172,7 @@ v: { "code" : "10183-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -249,8 +195,7 @@ v: { "code" : "48765-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -272,8 +217,7 @@ v: { "code" : "46241-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -296,8 +240,7 @@ v: { "code" : "18842-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -319,8 +262,7 @@ v: { "code" : "18842-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -343,8 +285,7 @@ v: { "code" : "18842-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -366,16 +307,15 @@ v: { "display" : "Allergies and adverse reactions Document", "code" : "48765-2", "severity" : "error", - "error" : "Wrong Display Name 'Allergies' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", + "error" : "Wrong Display Name 'Allergies' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r3" + "valueUrl" : "http://local.fhir.org/r3" }], "severity" : "error", "code" : "invalid", @@ -384,7 +324,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name 'Allergies' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" + "text" : "Wrong Display Name 'Allergies' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -409,8 +349,7 @@ v: { "code" : "8648-8", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -433,8 +372,7 @@ v: { "code" : "78375-3", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -457,8 +395,7 @@ v: { "code" : "75311-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -481,8 +418,7 @@ v: { "code" : "42347-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -505,8 +441,7 @@ v: { "code" : "42346-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -529,8 +464,7 @@ v: { "code" : "42344-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -553,8 +487,7 @@ v: { "code" : "10164-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -576,16 +509,15 @@ v: { "display" : "Plan of care note", "code" : "18776-5", "severity" : "error", - "error" : "Wrong Display Name 'Plan of care' for http://loinc.org#18776-5. Valid display is one of 30 choices: 'Plan of care note', 'Plan of care note', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 事件发生的地方' (zh-CN), '场景' (zh-CN), '环境' (zh-CN), '背景 医疗服务(照护服务、护理服务、护理、照护、医疗照护、诊疗、诊疗服务、照顾、看护)计划(方案)记录 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 文档本体' (zh-CN), '临床文档本体' (zh-CN), '文档本体' (zh-CN), '文书本体' (zh-CN), '医疗文书本体' (zh-CN), '临床医疗文书本体 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 未加明确说明的角色 笔记' (zh-CN), '按语' (zh-CN), '注释' (zh-CN), '说明' (zh-CN), '票据' (zh-CN), '单据' (zh-CN), '证明书' (zh-CN) or 'Documentazione dell'ontologia Osservazione Piano di cura Punto nel tempo (episodio) Ruolo non specificato' (it-IT) (for the language(s) '--')", + "error" : "Wrong Display Name 'Plan of care' for http://loinc.org#18776-5. Valid display is one of 30 choices: 'Plan of care note', 'Plan of care note' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 事件发生的地方' (zh-CN), '场景' (zh-CN), '环境' (zh-CN), '背景 医疗服务(照护服务、护理服务、护理、照护、医疗照护、诊疗、诊疗服务、照顾、看护)计划(方案)记录 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 文档本体' (zh-CN), '临床文档本体' (zh-CN), '文档本体' (zh-CN), '文书本体' (zh-CN), '医疗文书本体' (zh-CN), '临床医疗文书本体 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 未加明确说明的角色 笔记' (zh-CN), '按语' (zh-CN), '注释' (zh-CN), '说明' (zh-CN), '票据' (zh-CN), '单据' (zh-CN), '证明书' (zh-CN) or 'Documentazione dell'ontologia Osservazione Piano di cura Punto nel tempo (episodio) Ruolo non specificato' (it-IT) (for the language(s) '--')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r3" + "valueUrl" : "http://local.fhir.org/r3" }], "severity" : "error", "code" : "invalid", @@ -594,7 +526,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name 'Plan of care' for http://loinc.org#18776-5. Valid display is one of 30 choices: 'Plan of care note', 'Plan of care note', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 事件发生的地方' (zh-CN), '场景' (zh-CN), '环境' (zh-CN), '背景 医疗服务(照护服务、护理服务、护理、照护、医疗照护、诊疗、诊疗服务、照顾、看护)计划(方案)记录 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 文档本体' (zh-CN), '临床文档本体' (zh-CN), '文档本体' (zh-CN), '文书本体' (zh-CN), '医疗文书本体' (zh-CN), '临床医疗文书本体 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 未加明确说明的角色 笔记' (zh-CN), '按语' (zh-CN), '注释' (zh-CN), '说明' (zh-CN), '票据' (zh-CN), '单据' (zh-CN), '证明书' (zh-CN) or 'Documentazione dell'ontologia Osservazione Piano di cura Punto nel tempo (episodio) Ruolo non specificato' (it-IT) (for the language(s) '--')" + "text" : "Wrong Display Name 'Plan of care' for http://loinc.org#18776-5. Valid display is one of 30 choices: 'Plan of care note', 'Plan of care note' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 事件发生的地方' (zh-CN), '场景' (zh-CN), '环境' (zh-CN), '背景 医疗服务(照护服务、护理服务、护理、照护、医疗照护、诊疗、诊疗服务、照顾、看护)计划(方案)记录 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 文档本体' (zh-CN), '临床文档本体' (zh-CN), '文档本体' (zh-CN), '文书本体' (zh-CN), '医疗文书本体' (zh-CN), '临床医疗文书本体 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 未加明确说明的角色 笔记' (zh-CN), '按语' (zh-CN), '注释' (zh-CN), '说明' (zh-CN), '票据' (zh-CN), '单据' (zh-CN), '证明书' (zh-CN) or 'Documentazione dell'ontologia Osservazione Piano di cura Punto nel tempo (episodio) Ruolo non specificato' (it-IT) (for the language(s) '--')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -619,8 +551,7 @@ v: { "code" : "47420-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -643,8 +574,7 @@ v: { "code" : "47519-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" } @@ -666,16 +596,15 @@ v: { "display" : "Review of systems Narrative - Reported", "code" : "10187-3", "severity" : "error", - "error" : "Wrong Display Name 'Review of systems Narrative Reporte' for http://loinc.org#10187-3. Valid display is one of 41 choices: 'Review of systems Narrative - Reported', 'Review of systems', '医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 历史纪录与体格检查 历史纪录与体格检查.历史记录' (zh-CN), '历史纪录与体格检查.历史记录类' (zh-CN), '历史纪录与体格检查.历史记录类别' (zh-CN), '历史纪录与体格检查.病史' (zh-CN), '历史纪录与体格检查.病史类' (zh-CN), '历史纪录与体格检查.病史类别' (zh-CN), '历史纪录与体格检查.病史记录' (zh-CN), '历史纪录与体格检查.病史记录类' (zh-CN), '历史纪录与体格检查.病史记录类别' (zh-CN), '历史纪录与体格检查小节.历史记录' (zh-CN), '历史纪录与体格检查小节.历史记录类' (zh-CN), '历史纪录与体格检查小节.历史记录类别' (zh-CN), '历史纪录与体格检查小节.病史' (zh-CN), '历史纪录与体格检查小节.病史类' (zh-CN), '历史纪录与体格检查小节.病史类别 历史纪录与体格检查小节 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 叙述' (zh-CN), '叙述性文字' (zh-CN), '报告' (zh-CN), '报告型' (zh-CN), '文字叙述' (zh-CN), '文本叙述型' (zh-CN), '文本描述' (zh-CN), '文本描述型 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 病史与体格检查 系统回顾' (zh-CN), '系统审核' (zh-CN), 'Anamnesi Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Анамнестические сведения' (ru-RU), 'Сообщенная третьим лицом информация Описательный Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", + "error" : "Wrong Display Name 'Review of systems Narrative Reporte' for http://loinc.org#10187-3. Valid display is one of 41 choices: 'Review of systems Narrative - Reported', 'Review of systems' (en-US), '医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 历史纪录与体格检查 历史纪录与体格检查.历史记录' (zh-CN), '历史纪录与体格检查.历史记录类' (zh-CN), '历史纪录与体格检查.历史记录类别' (zh-CN), '历史纪录与体格检查.病史' (zh-CN), '历史纪录与体格检查.病史类' (zh-CN), '历史纪录与体格检查.病史类别' (zh-CN), '历史纪录与体格检查.病史记录' (zh-CN), '历史纪录与体格检查.病史记录类' (zh-CN), '历史纪录与体格检查.病史记录类别' (zh-CN), '历史纪录与体格检查小节.历史记录' (zh-CN), '历史纪录与体格检查小节.历史记录类' (zh-CN), '历史纪录与体格检查小节.历史记录类别' (zh-CN), '历史纪录与体格检查小节.病史' (zh-CN), '历史纪录与体格检查小节.病史类' (zh-CN), '历史纪录与体格检查小节.病史类别 历史纪录与体格检查小节 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 叙述' (zh-CN), '叙述性文字' (zh-CN), '报告' (zh-CN), '报告型' (zh-CN), '文字叙述' (zh-CN), '文本叙述型' (zh-CN), '文本描述' (zh-CN), '文本描述型 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 病史与体格检查 系统回顾' (zh-CN), '系统审核' (zh-CN), 'Anamnesi Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Анамнестические сведения' (ru-RU), 'Сообщенная третьим лицом информация Описательный Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r3" + "valueUrl" : "http://local.fhir.org/r3" }], "severity" : "error", "code" : "invalid", @@ -684,7 +613,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name 'Review of systems Narrative Reporte' for http://loinc.org#10187-3. Valid display is one of 41 choices: 'Review of systems Narrative - Reported', 'Review of systems', '医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 历史纪录与体格检查 历史纪录与体格检查.历史记录' (zh-CN), '历史纪录与体格检查.历史记录类' (zh-CN), '历史纪录与体格检查.历史记录类别' (zh-CN), '历史纪录与体格检查.病史' (zh-CN), '历史纪录与体格检查.病史类' (zh-CN), '历史纪录与体格检查.病史类别' (zh-CN), '历史纪录与体格检查.病史记录' (zh-CN), '历史纪录与体格检查.病史记录类' (zh-CN), '历史纪录与体格检查.病史记录类别' (zh-CN), '历史纪录与体格检查小节.历史记录' (zh-CN), '历史纪录与体格检查小节.历史记录类' (zh-CN), '历史纪录与体格检查小节.历史记录类别' (zh-CN), '历史纪录与体格检查小节.病史' (zh-CN), '历史纪录与体格检查小节.病史类' (zh-CN), '历史纪录与体格检查小节.病史类别 历史纪录与体格检查小节 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 叙述' (zh-CN), '叙述性文字' (zh-CN), '报告' (zh-CN), '报告型' (zh-CN), '文字叙述' (zh-CN), '文本叙述型' (zh-CN), '文本描述' (zh-CN), '文本描述型 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 病史与体格检查 系统回顾' (zh-CN), '系统审核' (zh-CN), 'Anamnesi Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Анамнестические сведения' (ru-RU), 'Сообщенная третьим лицом информация Описательный Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" + "text" : "Wrong Display Name 'Review of systems Narrative Reporte' for http://loinc.org#10187-3. Valid display is one of 41 choices: 'Review of systems Narrative - Reported', 'Review of systems' (en-US), '医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 历史纪录与体格检查 历史纪录与体格检查.历史记录' (zh-CN), '历史纪录与体格检查.历史记录类' (zh-CN), '历史纪录与体格检查.历史记录类别' (zh-CN), '历史纪录与体格检查.病史' (zh-CN), '历史纪录与体格检查.病史类' (zh-CN), '历史纪录与体格检查.病史类别' (zh-CN), '历史纪录与体格检查.病史记录' (zh-CN), '历史纪录与体格检查.病史记录类' (zh-CN), '历史纪录与体格检查.病史记录类别' (zh-CN), '历史纪录与体格检查小节.历史记录' (zh-CN), '历史纪录与体格检查小节.历史记录类' (zh-CN), '历史纪录与体格检查小节.历史记录类别' (zh-CN), '历史纪录与体格检查小节.病史' (zh-CN), '历史纪录与体格检查小节.病史类' (zh-CN), '历史纪录与体格检查小节.病史类别 历史纪录与体格检查小节 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 叙述' (zh-CN), '叙述性文字' (zh-CN), '报告' (zh-CN), '报告型' (zh-CN), '文字叙述' (zh-CN), '文本叙述型' (zh-CN), '文本描述' (zh-CN), '文本描述型 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 病史与体格检查 系统回顾' (zh-CN), '系统审核' (zh-CN), 'Anamnesi Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Анамнестические сведения' (ru-RU), 'Сообщенная третьим лицом информация Описательный Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -710,14 +639,13 @@ v: { "severity" : "error", "error" : "Wrong Display Name 'Administrative information' for http://loinc.org#87504-7. Valid display is 'LCDS v4.00 - Administrative information - discharge [CMS Assessment]' (for the language(s) '--')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r3", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r3" + "valueUrl" : "http://local.fhir.org/r3" }], "severity" : "error", "code" : "invalid", @@ -751,6 +679,53 @@ v: { "code" : "2069-3", "system" : "http://loinc.org", "version" : "2.74", + "server" : "http://local.fhir.org/r3", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "29463-7", + "display" : "Body Weight" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Body weight", + "code" : "29463-7", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://tx-dev.fhir.org/r3", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "3141-9", + "display" : "Body weight Measured" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Body weight Measured", + "code" : "3141-9", + "system" : "http://loinc.org", + "version" : "2.74", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/snomed.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/snomed.cache index 0d40580b6..ae04571f9 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/snomed.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/snomed.cache @@ -14,7 +14,7 @@ v: { "display" : "Body weight", "code" : "27113001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "issues" : { "resourceType" : "OperationOutcome" @@ -36,7 +36,7 @@ v: { "display" : "Product containing theophylline (medicinal product)", "code" : "66493003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -60,7 +60,7 @@ v: { "display" : "Oral administration of treatment", "code" : "394899003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -168,7 +168,7 @@ v: { "display" : "Above reference range", "code" : "281302008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -192,7 +192,7 @@ v: { "display" : "Record artifact (record artifact)", "code" : "419891008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -216,7 +216,7 @@ v: { "display" : "Clinical procedure report", "code" : "371525003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -240,7 +240,7 @@ v: { "display" : "Normal", "code" : "17621005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -264,7 +264,7 @@ v: { "display" : "Military health institution (environment)", "code" : "722172003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -288,7 +288,7 @@ v: { "display" : "General surgery (qualifier value)", "code" : "394609007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -312,7 +312,7 @@ v: { "display" : "Procedure", "code" : "71388002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -335,7 +335,7 @@ v: { v: { "code" : "823681000000100", "severity" : "error", - "error" : "Unknown code '823681000000100' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '823681000000100' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -353,7 +353,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '823681000000100' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '823681000000100' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -376,7 +376,7 @@ v: { v: { "code" : "886921000000105", "severity" : "error", - "error" : "Unknown code '886921000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '886921000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -394,7 +394,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '886921000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '886921000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -417,7 +417,7 @@ v: { v: { "code" : "1077881000000105", "severity" : "error", - "error" : "Unknown code '1077881000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '1077881000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -435,7 +435,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '1077881000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '1077881000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -458,7 +458,7 @@ v: { v: { "code" : "887181000000106", "severity" : "error", - "error" : "Unknown code '887181000000106' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '887181000000106' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -476,7 +476,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '887181000000106' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '887181000000106' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -499,7 +499,7 @@ v: { v: { "code" : "887161000000102", "severity" : "error", - "error" : "Unknown code '887161000000102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '887161000000102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -517,7 +517,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '887161000000102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '887161000000102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -540,7 +540,7 @@ v: { v: { "code" : "1052891000000108", "severity" : "error", - "error" : "Unknown code '1052891000000108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '1052891000000108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -558,7 +558,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '1052891000000108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '1052891000000108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -581,7 +581,7 @@ v: { v: { "code" : "715851000000102", "severity" : "error", - "error" : "Unknown code '715851000000102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '715851000000102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -599,7 +599,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '715851000000102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '715851000000102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -622,7 +622,7 @@ v: { v: { "code" : "717121000000105", "severity" : "error", - "error" : "Unknown code '717121000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '717121000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -640,7 +640,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '717121000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '717121000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -663,7 +663,7 @@ v: { v: { "code" : "933361000000108", "severity" : "error", - "error" : "Unknown code '933361000000108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '933361000000108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -681,7 +681,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '933361000000108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '933361000000108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -704,7 +704,7 @@ v: { v: { "code" : "887171000000109", "severity" : "error", - "error" : "Unknown code '887171000000109' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '887171000000109' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -722,7 +722,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '887171000000109' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '887171000000109' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -745,7 +745,7 @@ v: { v: { "code" : "887201000000105", "severity" : "error", - "error" : "Unknown code '887201000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '887201000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -763,7 +763,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '887201000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '887201000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -786,7 +786,7 @@ v: { v: { "code" : "1052951000000105", "severity" : "error", - "error" : "Unknown code '1052951000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '1052951000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -804,7 +804,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '1052951000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '1052951000000105' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -827,7 +827,7 @@ v: { v: { "code" : "886731000000109", "severity" : "error", - "error" : "Unknown code '886731000000109' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '886731000000109' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -845,7 +845,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '886731000000109' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '886731000000109' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -868,7 +868,7 @@ v: { v: { "code" : "887231000000104", "severity" : "error", - "error" : "Unknown code '887231000000104' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '887231000000104' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -886,7 +886,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '887231000000104' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '887231000000104' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -909,7 +909,7 @@ v: { v: { "code" : "9290701000001101", "severity" : "error", - "error" : "Unknown code '9290701000001101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '9290701000001101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -927,7 +927,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '9290701000001101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '9290701000001101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -951,7 +951,7 @@ v: { "display" : "Procedure carried out on subject (situation)", "code" : "443938003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -975,7 +975,7 @@ v: { "display" : "Normal", "code" : "17621005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -998,7 +998,7 @@ v: { "display" : "Urinalysis", "code" : "27171005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -1021,7 +1021,7 @@ v: { "display" : "Steady", "code" : "55011004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -1052,7 +1052,7 @@ v: { "display" : "Steady", "code" : "55011004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", "issues" : { @@ -1074,7 +1074,7 @@ v: { v: { "code" : "11181000146103", "severity" : "error", - "error" : "Unknown code '11181000146103' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '11181000146103' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r3", "unknown-systems" : "", @@ -1092,7 +1092,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '11181000146103' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '11181000146103' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["Coding.code"], "expression" : ["Coding.code"] diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/system-map.json b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/system-map.json index 45da643b4..33d6b479e 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/system-map.json +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/3.0.2/system-map.json @@ -2,19 +2,23 @@ "systems" : [ { "system" : "http://acme.org/devices/clinical-codes", - "server" : "http://tx-dev.fhir.org/r3" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://loinc.org", - "server" : "http://tx-dev.fhir.org/r3" + "authoritative" : [], + "candidates" : ["http://tx-dev.fhir.org/r3"] }, { "system" : "http://snomed.info/sct", - "server" : "http://tx-dev.fhir.org/r3" + "authoritative" : [], + "candidates" : ["http://tx-dev.fhir.org/r3"] }, { "system" : "http://unitsofmeasure.org", - "server" : "http://tx-dev.fhir.org/r3" + "authoritative" : [], + "candidates" : ["http://tx-dev.fhir.org/r3"] } ] } diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/.terminologyCapabilities.tx-dev.fhir.org.r4.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/.terminologyCapabilities.tx-dev.fhir.org.r4.cache index ab5790f21..c96bb76b6 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/.terminologyCapabilities.tx-dev.fhir.org.r4.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/.terminologyCapabilities.tx-dev.fhir.org.r4.cache @@ -5,7 +5,7 @@ "version" : "2.0.0", "name" : "FHIR Reference Server Teminology Capability Statement", "status" : "active", - "date" : "2024-01-19T08:46:55.766Z", + "date" : "2024-03-06T00:57:50.217Z", "contact" : [{ "telecom" : [{ "system" : "other", @@ -14,6 +14,9 @@ }], "description" : "Standard Teminology Capability Statement for the open source Reference FHIR Server provided by Health Intersections", "codeSystem" : [{ + "uri" : "http://cap.org/eCP" + }, + { "uri" : "http://cds-hooks.hl7.org/CodeSystem/indicator" }, { @@ -841,9 +844,6 @@ { "uri" : "http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type" }, - { - "uri" : "http://hl7.org/fhir/us/core/CodeSystem/us-core-sex-for-clinical-use" - }, { "uri" : "http://hl7.org/fhir/uv/sdc/CodeSystem/assemble-expectation" }, @@ -889,6 +889,9 @@ { "uri" : "http://loinc.org" }, + { + "uri" : "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl" + }, { "uri" : "http://nucc.org/provider-taxonomy" }, @@ -988,6 +991,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/catalogType" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/cdshooks-indicator" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/certainty-rating" }, @@ -1300,6 +1306,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/hl7-work-group" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/icd-o-3" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status" }, @@ -1348,6 +1357,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/match-grade" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/measure-aggregate-method" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/measure-data-usage" }, @@ -1360,6 +1372,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/measure-scoring" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/measure-supplemental-data" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/measure-type" }, @@ -1567,6 +1582,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/service-type" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/sex-parameter-for-clinical-use" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/smart-capabilities" }, @@ -3562,12 +3580,24 @@ { "uri" : "http://www.ama-assn.org/go/cpt" }, + { + "uri" : "http://www.cms.gov/Medicare/Coding/ICD10" + }, { "uri" : "http://www.nlm.nih.gov/research/umls/rxnorm" }, { "uri" : "http://www.whocc.no/atc" }, + { + "uri" : "https://nahdo.org/sopt" + }, + { + "uri" : "https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/cdcnhsn.html" + }, + { + "uri" : "https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/hsloc.html" + }, { "uri" : "https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding" }, @@ -3615,6 +3645,9 @@ }, { "uri" : "urn:oid:2.16.840.1.113883.3.1937.98.5.8" + }, + { + "uri" : "urn:oid:2.16.840.1.113883.6.238" }], "expansion" : { "parameter" : [{ diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/11073.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/11073.cache index 7f57fade2..9431d5c55 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/11073.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/11073.cache @@ -14,7 +14,7 @@ v: { "display" : "MDC_PULS_OXIM_SAT_O2", "code" : "150456", "system" : "urn:iso:std:iso:11073:10101", - "version" : "2022-02-04", + "version" : "2023-04-26", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -31,7 +31,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "status-check" }], - "text" : "Reference to draft CodeSystem urn:iso:std:iso:11073:10101|2022-02-04" + "text" : "Reference to draft CodeSystem urn:iso:std:iso:11073:10101|2023-04-26" } }] } diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/all-systems.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/all-systems.cache index f7f0e1275..37911fde6 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/all-systems.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/all-systems.cache @@ -1,4 +1,31 @@ ------------------------------------------------------------------------------------- +{"code" : { + "code" : "application/octet-stream" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "application/octet-stream", + "code" : "application/octet-stream", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- {"code" : { "code" : "application/octet-stream" }, "url": "http://hl7.org/fhir/ValueSet/mimetypes", "version": "4.0.1", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { @@ -13,7 +40,6 @@ v: { "code" : "application/octet-stream", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -30,11 +56,37 @@ v: { }] }}#### v: { - "display" : "German (Switzerland)", + "display" : "German (Region=Switzerland)", "code" : "de-CH", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "application/pdf" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "application/pdf", + "code" : "application/pdf", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -55,7 +107,6 @@ v: { "code" : "application/pdf", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -77,7 +128,6 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -99,7 +149,33 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "image/*" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "image/*", + "code" : "image/*", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -120,7 +196,6 @@ v: { "code" : "image/*", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -137,12 +212,11 @@ v: { }] }}#### v: { - "display" : "day", + "display" : "d", "code" : "d", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -159,11 +233,37 @@ v: { }] }}#### v: { - "display" : "English (India)", + "display" : "English (Region=India)", "code" : "en-IN", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "image/jpg" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "image/jpg", + "code" : "image/jpg", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -184,7 +284,6 @@ v: { "code" : "image/jpg", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -201,11 +300,10 @@ v: { }] }}#### v: { - "display" : "German (Switzerland)", + "display" : "German (Region=Switzerland)", "code" : "de-CH", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -226,7 +324,34 @@ v: { "code" : "de-CH", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "min" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "http://unitsofmeasure.org" + }] + } +}, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "min", + "code" : "min", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -248,7 +373,34 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "mmol/L" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "http://unitsofmeasure.org" + }] + } +}, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "mmol/L", + "code" : "mmol/L", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -270,7 +422,34 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "%" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "http://unitsofmeasure.org" + }] + } +}, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "%", + "code" : "%", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -292,7 +471,6 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -314,51 +492,10 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "cm" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodyweight", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "cm", - "code" : "cm", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#cm' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#cm' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - } ------------------------------------------------------------------------------------- {"code" : { @@ -376,51 +513,10 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "kg/m2" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodyweight", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "kg/m2", - "code" : "kg/m2", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#kg/m2' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#kg/m2' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - } ------------------------------------------------------------------------------------- {"code" : { @@ -438,93 +534,12 @@ v: { "display" : "Blood group A (finding)", "code" : "112144000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "kg" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodylength", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "kg", - "code" : "kg", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#kg' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#kg' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "kg/m2" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodylength", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "kg/m2", - "code" : "kg/m2", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#kg/m2' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#kg/m2' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - } ------------------------------------------------------------------------------------- {"code" : { @@ -542,7 +557,6 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -564,9 +578,8 @@ v: { "display" : "Allergy record", "code" : "722446000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -588,9 +601,35 @@ v: { "display" : "Report of clinical encounter", "code" : "371531000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "application/pdf" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "application/pdf", + "code" : "application/pdf", + "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -611,7 +650,6 @@ v: { "code" : "application/pdf", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -633,9 +671,8 @@ v: { "display" : "Laboratory report", "code" : "4241000179101", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -657,458 +694,24 @@ v: { "display" : "Summary clinical document", "code" : "422735006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "min" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodyweight", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "min", - "code" : "min", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#min' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#min' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "min" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodylength", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "min", - "code" : "min", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#min' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#min' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "min" -}, "url": "https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation", "version": "0.5.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "min", - "code" : "min", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#min' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#min' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "mmol/L" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodyweight", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "mmol/L", - "code" : "mmol/L", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#mmol/L' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#mmol/L' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "mmol/L" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodylength", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "mmol/L", - "code" : "mmol/L", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#mmol/L' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#mmol/L' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "mmol/L" -}, "url": "https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation", "version": "0.5.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "mmol/L", - "code" : "mmol/L", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#mmol/L' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#mmol/L' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "%" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodyweight", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "%", - "code" : "%", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#%' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#%' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "%" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodylength", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "%", - "code" : "%", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#%' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#%' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "%" -}, "url": "https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation", "version": "0.5.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "%", - "code" : "%", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#%' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#%' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "wk" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodyweight", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "wk", - "code" : "wk", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#wk' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#wk' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodyweight|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "code" : "wk" -}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodylength", "version": "4.0.1", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "wk", - "code" : "wk", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#wk' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#wk' was not found in the value set 'http://hl7.org/fhir/ValueSet/ucum-bodylength|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - } ------------------------------------------------------------------------------------- {"code" : { "code" : "kg" -}, "url": "https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation", "version": "0.5.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "http://unitsofmeasure.org" + }] + } +}, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { "resourceType" : "Parameters", "parameter" : [{ "name" : "profile-url", @@ -1118,30 +721,11 @@ v: { v: { "display" : "kg", "code" : "kg", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#kg' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'", - "class" : "UNKNOWN", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#kg' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] + "resourceType" : "OperationOutcome" } } @@ -1161,7 +745,6 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1170,7 +753,14 @@ v: { ------------------------------------------------------------------------------------- {"code" : { "code" : "cm" -}, "url": "https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation", "version": "0.5.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "http://unitsofmeasure.org" + }] + } +}, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { "resourceType" : "Parameters", "parameter" : [{ "name" : "profile-url", @@ -1180,30 +770,11 @@ v: { v: { "display" : "cm", "code" : "cm", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#cm' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'", - "class" : "UNKNOWN", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#cm' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] + "resourceType" : "OperationOutcome" } } @@ -1223,7 +794,6 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1232,7 +802,14 @@ v: { ------------------------------------------------------------------------------------- {"code" : { "code" : "kg/m2" -}, "url": "https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation", "version": "0.5.0", "langs":"en", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "http://unitsofmeasure.org" + }] + } +}, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { "resourceType" : "Parameters", "parameter" : [{ "name" : "profile-url", @@ -1242,30 +819,11 @@ v: { v: { "display" : "kg/m2", "code" : "kg/m2", - "severity" : "error", - "error" : "The provided code 'http://unitsofmeasure.org#kg/m2' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'", - "class" : "UNKNOWN", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://unitsofmeasure.org#kg/m2' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-timeOfGestation|0.5.0'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] + "resourceType" : "OperationOutcome" } } @@ -1285,7 +843,34 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "wk" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "http://unitsofmeasure.org" + }] + } +}, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"true", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "wk", + "code" : "wk", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1307,7 +892,33 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "json" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "json", + "code" : "json", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1328,7 +939,33 @@ v: { "code" : "json", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "xml" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "xml", + "code" : "xml", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1349,7 +986,33 @@ v: { "code" : "xml", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "application/fhir+json" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "application/fhir+json", + "code" : "application/fhir+json", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1370,7 +1033,33 @@ v: { "code" : "application/fhir+json", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "en-US" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:47" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "English (Region=United States)", + "code" : "en-US", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1391,7 +1080,33 @@ v: { "code" : "en-US", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "en" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:47" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "English", + "code" : "en", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1412,7 +1127,33 @@ v: { "code" : "en", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "text/plain" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "text/plain", + "code" : "text/plain", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1433,7 +1174,6 @@ v: { "code" : "text/plain", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1455,9 +1195,8 @@ v: { "display" : "Clinical procedure report (record artifact)", "code" : "371525003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1480,7 +1219,33 @@ v: { "system" : "urn:iso:std:iso:3166", "version" : "2018", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "text/css" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "text/css", + "code" : "text/css", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1501,7 +1266,6 @@ v: { "code" : "text/css", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1518,11 +1282,10 @@ v: { }] }}#### v: { - "display" : "German (Switzerland)", + "display" : "German (Region=Switzerland)", "code" : "de-CH", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1547,7 +1310,6 @@ v: { "error" : "The provided code 'http://ihe.net/fhir/ihe.formatcode.fhir/CodeSystem/formatcode#urn:ihe:iti:xds:2017:mimeTypeSufficient ('MimeType sufficient')' was not found in the value set 'http://hl7.org/fhir/ValueSet/formatcodes|4.0.1'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -1586,7 +1348,7 @@ v: { "code" : "urn:hl7-org:sdwg:ccda-structuredBody:2.1", "severity" : "error", "error" : "A definition for CodeSystem 'urn:oid:1.3.6.1.4.1.19376.1.2.3' could not be found, so the code cannot be validated; The provided code 'urn:oid:1.3.6.1.4.1.19376.1.2.3#urn:hl7-org:sdwg:ccda-structuredBody:2.1 ('Documents following C-CDA constraints using a structured body')' was not found in the value set 'http://hl7.org/fhir/ValueSet/formatcodes|4.0.1'", - "class" : "CODESYSTEM_UNSUPPORTED", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "urn:oid:1.3.6.1.4.1.19376.1.2.3", "issues" : { @@ -1644,9 +1406,8 @@ v: { "display" : "Summary of episode note", "code" : "34133-9", "system" : "http://loinc.org", - "version" : "2.74", + "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1663,11 +1424,10 @@ v: { }] }}#### v: { - "display" : "English (United States)", + "display" : "English (Region=United States)", "code" : "en-US", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1686,48 +1446,11 @@ v: { }] }}#### v: { - "code" : "1", "severity" : "error", - "error" : "A definition for CodeSystem 'urn:oid:1.2.840.114350.1.72.1.7.7.10.696784.13260' could not be found, so the code cannot be validated; The provided code 'urn:oid:1.2.840.114350.1.72.1.7.7.10.696784.13260#1 ('Surgery Case')' was not found in the value set 'http://terminology.hl7.org/ValueSet/v3-ActEncounterCode|2.0.0'", - "class" : "CODESYSTEM_UNSUPPORTED", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "urn:oid:1.2.840.114350.1.72.1.7.7.10.696784.13260", + "error" : "Error from http://tx-dev.fhir.org/r4: Element name mismatch (start: \"tr\"/ end: \"td\") at Line 168, Column 86", + "class" : "SERVER_ERROR", "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "not-found", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-found" - }], - "text" : "A definition for CodeSystem 'urn:oid:1.2.840.114350.1.72.1.7.7.10.696784.13260' could not be found, so the code cannot be validated" - }, - "location" : ["Coding.system"], - "expression" : ["Coding.system"] - }, - { - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'urn:oid:1.2.840.114350.1.72.1.7.7.10.696784.13260#1 ('Surgery Case')' was not found in the value set 'http://terminology.hl7.org/ValueSet/v3-ActEncounterCode|2.0.0'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] + "resourceType" : "OperationOutcome" } } @@ -1742,11 +1465,10 @@ v: { }] }}#### v: { - "display" : "English (New Zeland)", + "display" : "English (Region=New Zealand)", "code" : "en-NZ", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1763,12 +1485,11 @@ v: { }] }}#### v: { - "display" : "day", + "display" : "d", "code" : "d", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1790,7 +1511,6 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1812,7 +1532,6 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1834,7 +1553,6 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1856,7 +1574,6 @@ v: { "system" : "urn:iso:std:iso:3166", "version" : "2018", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1880,7 +1597,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#26643006' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -1921,7 +1637,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#767525000' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -1961,7 +1676,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1979,12 +1693,11 @@ v: { }] }}#### v: { - "display" : "Benign essential hypertension (disorder)", + "display" : "Benign essential hypertension", "code" : "1201005", "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2008,7 +1721,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#109081006' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2043,12 +1755,11 @@ v: { }] }}#### v: { - "display" : "Fracture of neck of femur (disorder)", + "display" : "Fracture of neck of femur", "code" : "5913000", "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2072,7 +1783,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#292954005' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2107,12 +1817,11 @@ v: { }] }}#### v: { - "display" : "Anxiety disorder due to a general medical condition (disorder)", + "display" : "Anxiety disorder due to a general medical condition", "code" : "52910006", "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2136,7 +1845,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#428673006' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2171,12 +1879,11 @@ v: { }] }}#### v: { - "display" : "Primary open reduction and internal fixation of proximal femoral fracture with screw/nail and plate device (procedure)", + "display" : "Primary open reduction and internal fixation of proximal femoral fracture with screw/nail and plate device", "code" : "265132005", "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2200,7 +1907,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#7947003' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2241,7 +1947,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#81464008' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2282,7 +1987,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#48546005' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2317,12 +2021,11 @@ v: { }] }}#### v: { - "display" : "Postconcussion syndrome (disorder)", + "display" : "Postconcussion syndrome", "code" : "40425004", "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2346,7 +2049,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#158965000' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2387,7 +2089,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#96309000' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2428,7 +2129,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#714081009' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2469,7 +2169,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#25246002' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2510,7 +2209,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#96067005' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2545,12 +2243,11 @@ v: { }] }}#### v: { - "display" : "Inflammatory disorder due to increased blood urate level (disorder)", + "display" : "Gout", "code" : "90560007", "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2574,7 +2271,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#34206005' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2615,7 +2311,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#108537001' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2656,7 +2351,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#126212009' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2697,7 +2391,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#292360004' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2738,7 +2431,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#16217701000119102' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2779,7 +2471,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#287903004' was not found in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2801,6 +2492,33 @@ v: { }] } +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "application/xml" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "application/xml", + "code" : "application/xml", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + } ------------------------------------------------------------------------------------- {"code" : { @@ -2817,7 +2535,33 @@ v: { "code" : "application/xml", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "text/xml" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "text/xml", + "code" : "text/xml", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2838,7 +2582,6 @@ v: { "code" : "text/xml", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2859,7 +2602,7 @@ v: { "code" : "URGENT", "severity" : "error", "error" : "A definition for CodeSystem 'http://fhir.mimic.mit.edu/CodeSystem/admission-class' could not be found, so the code cannot be validated; The provided code 'http://fhir.mimic.mit.edu/CodeSystem/admission-class#URGENT' was not found in the value set 'http://terminology.hl7.org/ValueSet/v3-ActEncounterCode|2.0.0'", - "class" : "CODESYSTEM_UNSUPPORTED", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://fhir.mimic.mit.edu/CodeSystem/admission-class", "issues" : { @@ -2900,6 +2643,63 @@ v: { }] } +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://fhir.mimic.mit.edu/CodeSystem/admission-class", + "code" : "URGENT" +}, "url": "http://mimic.fhir.mit.edu/ValueSet/admission-class", "version": "0.1.2", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "URGENT", + "severity" : "error", + "error" : "A definition for CodeSystem 'http://fhir.mimic.mit.edu/CodeSystem/admission-class' could not be found, so the code cannot be validated; The provided code 'http://fhir.mimic.mit.edu/CodeSystem/admission-class#URGENT' was not found in the value set 'http://mimic.fhir.mit.edu/ValueSet/admission-class|0.1.2'", + "class" : "UNKNOWN", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "http://fhir.mimic.mit.edu/CodeSystem/admission-class", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "not-found", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "not-found" + }], + "text" : "A definition for CodeSystem 'http://fhir.mimic.mit.edu/CodeSystem/admission-class' could not be found, so the code cannot be validated" + }, + "location" : ["Coding.system"], + "expression" : ["Coding.system"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "not-in-vs" + }], + "text" : "The provided code 'http://fhir.mimic.mit.edu/CodeSystem/admission-class#URGENT' was not found in the value set 'http://mimic.fhir.mit.edu/ValueSet/admission-class|0.1.2'" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }] +} + } ------------------------------------------------------------------------------------- {"code" : { @@ -2919,7 +2719,33 @@ v: { "system" : "urn:iso:std:iso:3166", "version" : "2018", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "text/cql.identifier" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "text/cql.identifier", + "code" : "text/cql.identifier", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2940,7 +2766,6 @@ v: { "code" : "text/cql.identifier", "system" : "urn:ietf:bcp:13", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2962,8 +2787,8 @@ v: { v: { "code" : "27113001", "severity" : "error", - "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]; The provided code 'http://snomed.info/sct|http://snomed.info/sct/900000000000207008/version/20210731#27113001 ('Body weight (observable entity)')' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult|4.0.1'", - "class" : "CODESYSTEM_UNSUPPORTED", + "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]; The provided code 'http://snomed.info/sct|http://snomed.info/sct/900000000000207008/version/20210731#27113001 ('Body weight (observable entity)')' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult|4.0.1'", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://snomed.info/sct|http://snomed.info/sct/900000000000207008/version/20210731", "issues" : { @@ -2980,7 +2805,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-found" }], - "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]" + "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]" }, "location" : ["Coding.system"], "expression" : ["Coding.system"] @@ -3016,12 +2841,11 @@ v: { }] }}#### v: { - "display" : "kilogram", + "display" : "kg", "code" : "kg", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3046,7 +2870,6 @@ v: { "error" : "The provided code 'urn:iso:std:iso:11073:10101#150456 ('MDC_PULS_OXIM_SAT_O2')' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult|4.0.1'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -3061,7 +2884,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "status-check" }], - "text" : "Reference to draft CodeSystem urn:iso:std:iso:11073:10101|2022-02-04" + "text" : "Reference to draft CodeSystem urn:iso:std:iso:11073:10101|2023-04-26" } }, { @@ -3102,7 +2925,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#276885007' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult|4.0.1'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -3141,7 +2963,6 @@ v: { "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3158,11 +2979,10 @@ v: { }] }}#### v: { - "display" : "English (Australia)", + "display" : "English (Region=Australia)", "code" : "en-AU", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3183,7 +3003,6 @@ v: { "code" : "en", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3200,11 +3019,10 @@ v: { }] }}#### v: { - "display" : "English (United States)", + "display" : "English (Region=United States)", "code" : "en-US", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3227,7 +3045,6 @@ v: { "system" : "urn:iso:std:iso:3166", "version" : "2018", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3244,12 +3061,11 @@ v: { }] }}#### v: { - "display" : "week", + "display" : "wk", "code" : "wk", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3258,7 +3074,14 @@ v: { ------------------------------------------------------------------------------------- {"code" : { "code" : "[%payloadFormat%]" -}, "url": "http://hl7.org/fhir/ValueSet/mimetypes", "version": "4.0.1", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { "resourceType" : "Parameters", "parameter" : [{ "name" : "profile-url", @@ -3268,10 +3091,9 @@ v: { v: { "code" : "[%payloadFormat%]", "severity" : "error", - "error" : "The provided code 'urn:ietf:bcp:13#[%payloadFormat%]' was not found in the value set 'http://hl7.org/fhir/ValueSet/mimetypes|4.0.1'; Unknown code '[%payloadFormat%]' in the CodeSystem 'urn:ietf:bcp:13' version ''", + "error" : "The provided code '#[%payloadFormat%]' was not found in the value set 'urn:uuid:59e7a4c4-15f2-452a-b860-d065d134c740'; The System URI could not be determined for the code '[%payloadFormat%]' in the ValueSet 'urn:uuid:59e7a4c4-15f2-452a-b860-d065d134c740'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -3280,16 +3102,16 @@ v: { "valueUrl" : "http://tx-dev.fhir.org/r4" }], "severity" : "error", - "code" : "code-invalid", + "code" : "not-found", "details" : { "coding" : [{ "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "invalid-code" + "code" : "cannot-infer" }], - "text" : "Unknown code '[%payloadFormat%]' in the CodeSystem 'urn:ietf:bcp:13' version ''" + "text" : "The System URI could not be determined for the code '[%payloadFormat%]' in the ValueSet 'urn:uuid:59e7a4c4-15f2-452a-b860-d065d134c740'" }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] + "location" : ["code"], + "expression" : ["code"] }, { "extension" : [{ @@ -3303,7 +3125,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-in-vs" }], - "text" : "The provided code 'urn:ietf:bcp:13#[%payloadFormat%]' was not found in the value set 'http://hl7.org/fhir/ValueSet/mimetypes|4.0.1'" + "text" : "The provided code '#[%payloadFormat%]' was not found in the value set 'urn:uuid:59e7a4c4-15f2-452a-b860-d065d134c740'" }, "location" : ["Coding.code"], "expression" : ["Coding.code"] @@ -3312,3 +3134,24 @@ v: { } ------------------------------------------------------------------------------------- +{"code" : { + "code" : "en-AU" +}, "url": "http://hl7.org/fhir/ValueSet/languages", "version": "4.0.1", "langs":"en-US", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "English (Region=Australia)", + "code" : "en-AU", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/cvx.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/cvx.cache index bce7c26d3..b491aef37 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/cvx.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/cvx.cache @@ -11,34 +11,10 @@ }] }}#### v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose", - "code" : "207", - "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://hl7.org/fhir/sid/cvx", - "code" : "207", - "display" : "X SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose", + "display" : "COVID-19, mRNA, LNP-S, PF, 100 mcg/0.5mL dose or 50 mcg/0.25mL dose", "code" : "207", "severity" : "error", - "error" : "Wrong Display Name 'X SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose' for http://hl7.org/fhir/sid/cvx#207. Valid display is 'SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose' (for the language(s) '--')", + "error" : "Wrong Display Name 'SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose' for http://hl7.org/fhir/sid/cvx#207. Valid display is 'COVID-19, mRNA, LNP-S, PF, 100 mcg/0.5mL dose or 50 mcg/0.25mL dose' (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", @@ -56,7 +32,49 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name 'X SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose' for http://hl7.org/fhir/sid/cvx#207. Valid display is 'SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose' (for the language(s) '--')" + "text" : "Wrong Display Name 'SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose' for http://hl7.org/fhir/sid/cvx#207. Valid display is 'COVID-19, mRNA, LNP-S, PF, 100 mcg/0.5mL dose or 50 mcg/0.25mL dose' (for the language(s) '--')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "207", + "display" : "X SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "COVID-19, mRNA, LNP-S, PF, 100 mcg/0.5mL dose or 50 mcg/0.25mL dose", + "code" : "207", + "severity" : "error", + "error" : "Wrong Display Name 'X SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose' for http://hl7.org/fhir/sid/cvx#207. Valid display is 'COVID-19, mRNA, LNP-S, PF, 100 mcg/0.5mL dose or 50 mcg/0.25mL dose' (for the language(s) '--')", + "class" : "UNKNOWN", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'X SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose' for http://hl7.org/fhir/sid/cvx#207. Valid display is 'COVID-19, mRNA, LNP-S, PF, 100 mcg/0.5mL dose or 50 mcg/0.25mL dose' (for the language(s) '--')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -77,14 +95,32 @@ v: { }] }}#### v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose", + "display" : "COVID-19, mRNA, LNP-S, PF, 30 mcg/0.3 mL dose", "code" : "208", - "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "severity" : "error", + "error" : "Wrong Display Name 'SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose' for http://hl7.org/fhir/sid/cvx#208. Valid display is 'COVID-19, mRNA, LNP-S, PF, 30 mcg/0.3 mL dose' (for the language(s) 'en-NZ')", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome" + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose' for http://hl7.org/fhir/sid/cvx#208. Valid display is 'COVID-19, mRNA, LNP-S, PF, 30 mcg/0.3 mL dose' (for the language(s) 'en-NZ')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] } } @@ -104,7 +140,7 @@ v: { "display" : "Influenza, seasonal, injectable", "code" : "141", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -125,14 +161,32 @@ v: { }] }}#### v: { - "display" : "diphtheria, tetanus toxoids and acellular pertussis vaccine", + "display" : "DTaP", "code" : "20", - "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "severity" : "error", + "error" : "Wrong Display Name 'diphtheria, tetanus toxoids and acellular pertussis vaccine' for http://hl7.org/fhir/sid/cvx#20. Valid display is 'DTaP' (for the language(s) 'en-NZ')", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome" + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'diphtheria, tetanus toxoids and acellular pertussis vaccine' for http://hl7.org/fhir/sid/cvx#20. Valid display is 'DTaP' (for the language(s) 'en-NZ')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] } } @@ -149,14 +203,32 @@ v: { }] }}#### v: { - "display" : "tetanus and diphtheria toxoids, not adsorbed, for adult use", + "display" : "Td (adult)", "code" : "138", - "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "severity" : "error", + "error" : "Wrong Display Name 'tetanus and diphtheria toxoids, not adsorbed, for adult use' for http://hl7.org/fhir/sid/cvx#138. Valid display is 'Td (adult)' (for the language(s) 'en-NZ')", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome" + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'tetanus and diphtheria toxoids, not adsorbed, for adult use' for http://hl7.org/fhir/sid/cvx#138. Valid display is 'Td (adult)' (for the language(s) 'en-NZ')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] } } @@ -173,14 +245,32 @@ v: { }] }}#### v: { - "display" : "pneumococcal conjugate vaccine, 13 valent", + "display" : "Pneumococcal conjugate PCV 13", "code" : "133", - "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "severity" : "error", + "error" : "Wrong Display Name 'pneumococcal conjugate vaccine, 13 valent' for http://hl7.org/fhir/sid/cvx#133. Valid display is 'Pneumococcal conjugate PCV 13' (for the language(s) 'en-NZ')", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome" + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'pneumococcal conjugate vaccine, 13 valent' for http://hl7.org/fhir/sid/cvx#133. Valid display is 'Pneumococcal conjugate PCV 13' (for the language(s) 'en-NZ')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] } } @@ -197,10 +287,10 @@ v: { }] }}#### v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose", + "display" : "COVID-19, mRNA, LNP-S, PF, 30 mcg/0.3 mL dose", "code" : "208", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -224,7 +314,7 @@ v: { "display" : "Influenza, seasonal, injectable", "code" : "141", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -245,10 +335,10 @@ v: { }] }}#### v: { - "display" : "diphtheria, tetanus toxoids and acellular pertussis vaccine", + "display" : "DTaP", "code" : "20", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -269,10 +359,10 @@ v: { }] }}#### v: { - "display" : "tetanus and diphtheria toxoids, not adsorbed, for adult use", + "display" : "Td (adult)", "code" : "138", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -293,10 +383,10 @@ v: { }] }}#### v: { - "display" : "pneumococcal conjugate vaccine, 13 valent", + "display" : "Pneumococcal conjugate PCV 13", "code" : "133", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -316,10 +406,10 @@ v: { }] }}#### v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose", + "display" : "COVID-19, mRNA, LNP-S, PF, 30 mcg/0.3 mL dose", "code" : "208", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -339,10 +429,10 @@ v: { }] }}#### v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose", + "display" : "COVID-19, mRNA, LNP-S, PF, 30 mcg/0.3 mL dose", "code" : "208", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -364,7 +454,7 @@ v: { v: { "code" : "209", "severity" : "error", - "error" : "Unknown code '209' in the CodeSystem 'http://hl7.org/fhir/sid/cvx' version '20210406'", + "error" : "Unknown code '209' in the CodeSystem 'http://hl7.org/fhir/sid/cvx' version '20231214'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", @@ -382,7 +472,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '209' in the CodeSystem 'http://hl7.org/fhir/sid/cvx' version '20210406'" + "text" : "Unknown code '209' in the CodeSystem 'http://hl7.org/fhir/sid/cvx' version '20231214'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -404,7 +494,7 @@ v: { v: { "code" : "209", "severity" : "error", - "error" : "The provided code 'http://hl7.org/fhir/sid/cvx#209' was not found in the value set 'http://hl7.org/fhir/uv/shc-vaccination/ValueSet/vaccine-cvx|0.6.2'; Unknown code '209' in the CodeSystem 'http://hl7.org/fhir/sid/cvx' version '20210406'", + "error" : "The provided code 'http://hl7.org/fhir/sid/cvx#209' was not found in the value set 'http://hl7.org/fhir/uv/shc-vaccination/ValueSet/vaccine-cvx|0.6.2'; Unknown code '209' in the CodeSystem 'http://hl7.org/fhir/sid/cvx' version '20231214'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", @@ -422,7 +512,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '209' in the CodeSystem 'http://hl7.org/fhir/sid/cvx' version '20210406'" + "text" : "Unknown code '209' in the CodeSystem 'http://hl7.org/fhir/sid/cvx' version '20231214'" }, "location" : ["Coding.code"], "expression" : ["Coding.code"] @@ -459,10 +549,10 @@ v: { }] }}#### v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, vector non-replicating, recombinant spike protein-ChAdOx1, preservative free, 0.5 mL", + "display" : "COVID-19 vaccine, vector-nr, rS-ChAdOx1, PF, 0.5 mL", "code" : "210", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -482,10 +572,10 @@ v: { }] }}#### v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose", + "display" : "COVID-19, mRNA, LNP-S, PF, 100 mcg/0.5mL dose or 50 mcg/0.25mL dose", "code" : "207", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -505,10 +595,10 @@ v: { }] }}#### v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, vector non-replicating, recombinant spike protein-ChAdOx1, preservative free, 0.5 mL", + "display" : "COVID-19 vaccine, vector-nr, rS-ChAdOx1, PF, 0.5 mL", "code" : "210", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { @@ -528,10 +618,10 @@ v: { }] }}#### v: { - "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 100 mcg/0.5mL dose", + "display" : "COVID-19, mRNA, LNP-S, PF, 100 mcg/0.5mL dose or 50 mcg/0.25mL dose", "code" : "207", "system" : "http://hl7.org/fhir/sid/cvx", - "version" : "20210406", + "version" : "20231214", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___ncicb.nci.nih.gov_xml_owl_EVS_Thesaurus.owl.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___ncicb.nci.nih.gov_xml_owl_EVS_Thesaurus.owl.cache index 8b6ac9cad..b9d1b5792 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___ncicb.nci.nih.gov_xml_owl_EVS_Thesaurus.owl.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___ncicb.nci.nih.gov_xml_owl_EVS_Thesaurus.owl.cache @@ -11,12 +11,13 @@ }] }}#### v: { + "display" : "UNITED STATES AGENT", "code" : "C73330", - "severity" : "warning", - "error" : "A definition for CodeSystem 'http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl' could not be found, so the code cannot be validated", - "class" : "CODESYSTEM_UNSUPPORTED", + "severity" : "error", + "error" : "Wrong Display Name 'Foreign Facility's United States Agent' for http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C73330. Valid display is 'UNITED STATES AGENT' (for the language(s) '--')", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl", + "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -24,17 +25,17 @@ v: { "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", "valueUrl" : "http://tx-dev.fhir.org/r4" }], - "severity" : "warning", - "code" : "not-found", + "severity" : "error", + "code" : "invalid", "details" : { "coding" : [{ "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-found" + "code" : "invalid-display" }], - "text" : "A definition for CodeSystem 'http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl' could not be found, so the code cannot be validated" + "text" : "Wrong Display Name 'Foreign Facility's United States Agent' for http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C73330. Valid display is 'UNITED STATES AGENT' (for the language(s) '--')" }, - "location" : ["CodeableConcept.coding[0].system"], - "expression" : ["CodeableConcept.coding[0].system"] + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] }] } @@ -52,31 +53,13 @@ v: { }] }}#### v: { + "display" : "MANUFACTURE", "code" : "C43360", - "severity" : "warning", - "error" : "A definition for CodeSystem 'http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl' could not be found, so the code cannot be validated", - "class" : "CODESYSTEM_UNSUPPORTED", + "system" : "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl", + "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "warning", - "code" : "not-found", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-found" - }], - "text" : "A definition for CodeSystem 'http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl' could not be found, so the code cannot be validated" - }, - "location" : ["CodeableConcept.coding[0].system"], - "expression" : ["CodeableConcept.coding[0].system"] - }] + "resourceType" : "OperationOutcome" } } @@ -93,31 +76,13 @@ v: { }] }}#### v: { + "display" : "Manufactures human prescription drug products", "code" : "C106643", - "severity" : "error", - "error" : "A definition for CodeSystem 'http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl' could not be found, so the code cannot be validated", - "class" : "CODESYSTEM_UNSUPPORTED", + "system" : "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl", + "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "not-found", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-found" - }], - "text" : "A definition for CodeSystem 'http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl' could not be found, so the code cannot be validated" - }, - "location" : ["Coding.system"], - "expression" : ["Coding.system"] - }] + "resourceType" : "OperationOutcome" } } diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___nucc.org_provider-taxonomy.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___nucc.org_provider-taxonomy.cache index 2a43b7fad..ee84e1ca1 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___nucc.org_provider-taxonomy.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___nucc.org_provider-taxonomy.cache @@ -55,7 +55,7 @@ v: { "display" : "General Practice Physician", "code" : "208D00000X", "system" : "http://nucc.org/provider-taxonomy", - "version" : "22.0", + "version" : "22.1", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___something_something.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___something_something.cache index ef48db5e6..06ee89d54 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___something_something.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/http___something_something.cache @@ -19,3 +19,23 @@ v: { } ------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://something/something", + "code" : "something" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "severity" : "error", + "error" : "A definition for CodeSystem 'http://something/something' could not be found, so the code cannot be validated", + "class" : "CODESYSTEM_UNSUPPORTED", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/https___hl7.fi_fhir_finnish-base-profiles_CodeSystem_SecurityLabelCS.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/https___hl7.fi_fhir_finnish-base-profiles_CodeSystem_SecurityLabelCS.cache index 1880b5ba8..fa27afc62 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/https___hl7.fi_fhir_finnish-base-profiles_CodeSystem_SecurityLabelCS.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/https___hl7.fi_fhir_finnish-base-profiles_CodeSystem_SecurityLabelCS.cache @@ -13,7 +13,7 @@ v: { "code" : "TURVAKIELTO", "severity" : "error", "error" : "A definition for CodeSystem 'https://hl7.fi/fhir/finnish-base-profiles/CodeSystem/SecurityLabelCS' could not be found, so the code cannot be validated; The provided code 'https://hl7.fi/fhir/finnish-base-profiles/CodeSystem/SecurityLabelCS#TURVAKIELTO' was not found in the value set 'http://hl7.org/fhir/ValueSet/security-labels|4.0.1'", - "class" : "CODESYSTEM_UNSUPPORTED", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "https://hl7.fi/fhir/finnish-base-profiles/CodeSystem/SecurityLabelCS", "issues" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/https___www.cdc.gov_nhsn_cdaportal_terminology_codesystem_hsloc.html.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/https___www.cdc.gov_nhsn_cdaportal_terminology_codesystem_hsloc.html.cache new file mode 100644 index 000000000..b3a804622 --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/https___www.cdc.gov_nhsn_cdaportal_terminology_codesystem_hsloc.html.cache @@ -0,0 +1,25 @@ +------------------------------------------------------------------------------------- +{"code" : { + "system" : "https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/hsloc.html", + "code" : "1258-3", + "display" : "Long Term Care Facility General Nursing Unit" +}, "valueSet" :null, "langs":"en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Long Term Care Facility General Nursing Unit", + "code" : "1258-3", + "system" : "https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/hsloc.html", + "version" : "2022", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/icd-10-cm.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/icd-10-cm.cache index 426e8ba38..477ff0f9e 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/icd-10-cm.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/icd-10-cm.cache @@ -12,7 +12,7 @@ v: { "code" : "E10.3211+TT1.2", "severity" : "error", - "error" : "Unknown code 'E10.3211+TT1.2' in the CodeSystem 'http://hl7.org/fhir/sid/icd-10-cm' version '2021'", + "error" : "Unknown code 'E10.3211+TT1.2' in the CodeSystem 'http://hl7.org/fhir/sid/icd-10-cm' version '2024'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", @@ -30,7 +30,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code 'E10.3211+TT1.2' in the CodeSystem 'http://hl7.org/fhir/sid/icd-10-cm' version '2021'" + "text" : "Unknown code 'E10.3211+TT1.2' in the CodeSystem 'http://hl7.org/fhir/sid/icd-10-cm' version '2024'" }, "location" : ["Coding.code"], "expression" : ["Coding.code"] diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/lang.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/lang.cache index 73274b716..4f0dbd28f 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/lang.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/lang.cache @@ -33,7 +33,7 @@ v: { }] }}#### v: { - "display" : "German (Switzerland)", + "display" : "German (Region=Switzerland)", "code" : "de-CH", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", @@ -56,32 +56,13 @@ v: { }] }}#### v: { - "display" : "German (Switzerland)", + "display" : "German (Region=Switzerland)", "code" : "de-CH", - "severity" : "error", - "error" : "Wrong Display Name 'German (Region=Switzerland)' for urn:ietf:bcp:47#de-CH. Valid display is one of 7 choices: 'German (Switzerland)', 'German (Switzerland)' (en), 'Duits (Zwitserland)' (nl), 'Немецкий (Швейцария)' (ru), '德语 (瑞士)' (zh), 'Deutsch (Schweiz)' (de) or 'Tysk (Schweiz)' (da) (for the language(s) '--')", - "class" : "UNKNOWN", + "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "invalid-display" - }], - "text" : "Wrong Display Name 'German (Region=Switzerland)' for urn:ietf:bcp:47#de-CH. Valid display is one of 7 choices: 'German (Switzerland)', 'German (Switzerland)' (en), 'Duits (Zwitserland)' (nl), 'Немецкий (Швейцария)' (ru), '德语 (瑞士)' (zh), 'Deutsch (Schweiz)' (de) or 'Tysk (Schweiz)' (da) (for the language(s) '--')" - }, - "location" : ["Coding.display"], - "expression" : ["Coding.display"] - }] + "resourceType" : "OperationOutcome" } } @@ -256,7 +237,7 @@ v: { }] }}#### v: { - "display" : "German (Switzerland)", + "display" : "German (Region=Switzerland)", "code" : "de-CH", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", @@ -279,32 +260,13 @@ v: { }] }}#### v: { - "display" : "German (Switzerland)", + "display" : "German (Region=Switzerland)", "code" : "de-CH", "system" : "urn:ietf:bcp:47", - "severity" : "warning", - "error" : "Wrong Display Name 'German (Region=Switzerland)' for urn:ietf:bcp:47#de-CH. Valid display is one of 7 choices: 'German (Switzerland)', 'German (Switzerland)' (en), 'Duits (Zwitserland)' (nl), 'Немецкий (Швейцария)' (ru), '德语 (瑞士)' (zh), 'Deutsch (Schweiz)' (de) or 'Tysk (Schweiz)' (da) (for the language(s) '--')", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "warning", - "code" : "invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "invalid-display" - }], - "text" : "Wrong Display Name 'German (Region=Switzerland)' for urn:ietf:bcp:47#de-CH. Valid display is one of 7 choices: 'German (Switzerland)', 'German (Switzerland)' (en), 'Duits (Zwitserland)' (nl), 'Немецкий (Швейцария)' (ru), '德语 (瑞士)' (zh), 'Deutsch (Schweiz)' (de) or 'Tysk (Schweiz)' (da) (for the language(s) '--')" - }, - "location" : ["Coding.display"], - "expression" : ["Coding.display"] - }] + "resourceType" : "OperationOutcome" } } @@ -437,29 +399,10 @@ v: { "display" : "German (Switzerland)", "code" : "de-CH", "system" : "urn:ietf:bcp:47", - "severity" : "warning", - "error" : "Wrong Display Name 'German (Region=Switzerland)' for urn:ietf:bcp:47#de-CH. Valid display is one of 2 choices: 'German (Switzerland)' or 'German (Switzerland)' (en) (for the language(s) 'en')", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "warning", - "code" : "invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "invalid-display" - }], - "text" : "Wrong Display Name 'German (Region=Switzerland)' for urn:ietf:bcp:47#de-CH. Valid display is one of 2 choices: 'German (Switzerland)' or 'German (Switzerland)' (en) (for the language(s) 'en')" - }, - "location" : ["Coding.display"], - "expression" : ["Coding.display"] - }] + "resourceType" : "OperationOutcome" } } diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache index 078f9d78d..6046a905b 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache @@ -14,16 +14,15 @@ v: { "display" : "Oxygen saturation in Arterial blood by Pulse oximetry", "code" : "59408-5", "severity" : "error", - "error" : "Wrong Display Name 'O2 % BldC Oximetry' for http://loinc.org#59408-5. Valid display is one of 26 choices: 'Oxygen saturation in Arterial blood by Pulse oximetry', 'SaO2 % BldA PulseOx', 'O2 SaO2' (pl-PL), 'saturacja krwi tlenem' (pl-PL), 'MFr O2' (zh-CN), 'tO2' (zh-CN), '总氧' (zh-CN), '氧气 SaO2 动脉血 动脉血O2饱和度 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 肺部测量指标与呼吸机管理 脉搏血氧测定法' (zh-CN), '脉搏血氧定量' (zh-CN), '脉搏血氧测定' (zh-CN), '脉搏血氧仪 血氧测定法 饱和 饱和状态 饱和程度' (zh-CN), 'O2-Sättigung' (de-DE), 'Frazione di massa Gestione ventilazione polmonare Punto nel tempo (episodio) Sangue arterioso' (it-IT), 'Oksijen doymuşluğu' (tr-TR), 'Количественный Кровь артериальная Массовая доля Насыщение кислородом Оксигемометрия' (ru-RU), 'Гемоксиметрия Точка во времени' (ru-RU), 'Момент' (ru-RU), 'zuurstofsaturatiemeting' (nl-NL) or 'O2 SatO2' (fr-BE) (for the language(s) '--')", + "error" : "Wrong Display Name 'O2 % BldC Oximetry' for http://loinc.org#59408-5. Valid display is one of 26 choices: 'Oxygen saturation in Arterial blood by Pulse oximetry', 'SaO2 % BldA PulseOx' (en-US), 'O2 SaO2' (pl-PL), 'saturacja krwi tlenem' (pl-PL), 'MFr O2' (zh-CN), 'tO2' (zh-CN), '总氧' (zh-CN), '氧气 SaO2 动脉血 动脉血O2饱和度 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 肺部测量指标与呼吸机管理 脉搏血氧测定法' (zh-CN), '脉搏血氧定量' (zh-CN), '脉搏血氧测定' (zh-CN), '脉搏血氧仪 血氧测定法 饱和 饱和状态 饱和程度' (zh-CN), 'O2-Sättigung' (de-DE), 'Frazione di massa Gestione ventilazione polmonare Punto nel tempo (episodio) Sangue arterioso' (it-IT), 'Oksijen doymuşluğu' (tr-TR), 'Количественный Кровь артериальная Массовая доля Насыщение кислородом Оксигемометрия' (ru-RU), 'Гемоксиметрия Точка во времени' (ru-RU), 'Момент' (ru-RU), 'zuurstofsaturatiemeting' (nl-NL) or 'O2 SatO2' (fr-BE) (for the language(s) '--')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "invalid", @@ -32,7 +31,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name 'O2 % BldC Oximetry' for http://loinc.org#59408-5. Valid display is one of 26 choices: 'Oxygen saturation in Arterial blood by Pulse oximetry', 'SaO2 % BldA PulseOx', 'O2 SaO2' (pl-PL), 'saturacja krwi tlenem' (pl-PL), 'MFr O2' (zh-CN), 'tO2' (zh-CN), '总氧' (zh-CN), '氧气 SaO2 动脉血 动脉血O2饱和度 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 肺部测量指标与呼吸机管理 脉搏血氧测定法' (zh-CN), '脉搏血氧定量' (zh-CN), '脉搏血氧测定' (zh-CN), '脉搏血氧仪 血氧测定法 饱和 饱和状态 饱和程度' (zh-CN), 'O2-Sättigung' (de-DE), 'Frazione di massa Gestione ventilazione polmonare Punto nel tempo (episodio) Sangue arterioso' (it-IT), 'Oksijen doymuşluğu' (tr-TR), 'Количественный Кровь артериальная Массовая доля Насыщение кислородом Оксигемометрия' (ru-RU), 'Гемоксиметрия Точка во времени' (ru-RU), 'Момент' (ru-RU), 'zuurstofsaturatiemeting' (nl-NL) or 'O2 SatO2' (fr-BE) (for the language(s) '--')" + "text" : "Wrong Display Name 'O2 % BldC Oximetry' for http://loinc.org#59408-5. Valid display is one of 26 choices: 'Oxygen saturation in Arterial blood by Pulse oximetry', 'SaO2 % BldA PulseOx' (en-US), 'O2 SaO2' (pl-PL), 'saturacja krwi tlenem' (pl-PL), 'MFr O2' (zh-CN), 'tO2' (zh-CN), '总氧' (zh-CN), '氧气 SaO2 动脉血 动脉血O2饱和度 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 肺部测量指标与呼吸机管理 脉搏血氧测定法' (zh-CN), '脉搏血氧定量' (zh-CN), '脉搏血氧测定' (zh-CN), '脉搏血氧仪 血氧测定法 饱和 饱和状态 饱和程度' (zh-CN), 'O2-Sättigung' (de-DE), 'Frazione di massa Gestione ventilazione polmonare Punto nel tempo (episodio) Sangue arterioso' (it-IT), 'Oksijen doymuşluğu' (tr-TR), 'Количественный Кровь артериальная Массовая доля Насыщение кислородом Оксигемометрия' (ru-RU), 'Гемоксиметрия Точка во времени' (ru-RU), 'Момент' (ru-RU), 'zuurstofsaturatiemeting' (nl-NL) or 'O2 SatO2' (fr-BE) (for the language(s) '--')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -57,8 +56,7 @@ v: { "code" : "2708-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -81,14 +79,13 @@ v: { "severity" : "error", "error" : "The provided code 'http://loinc.org#59408-5' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -121,8 +118,7 @@ v: { "code" : "2708-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -145,8 +141,7 @@ v: { "code" : "3150-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -169,14 +164,13 @@ v: { "severity" : "error", "error" : "The provided code 'http://loinc.org#3150-0' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -209,16 +203,15 @@ v: { "display" : "Inhaled oxygen flow rate", "code" : "3151-8", "severity" : "error", - "error" : "Wrong Display Name 'Flow Rate' for http://loinc.org#3151-8. Valid display is one of 37 choices: 'Inhaled oxygen flow rate', 'Inhaled O2 flow rate', 'O2' (zh-CN), 'tO2' (zh-CN), '总氧' (zh-CN), '氧气 体积速率(单位时间)' (zh-CN), '单位时间内体积的变化速率' (zh-CN), '流量 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 吸入气' (zh-CN), '吸入气体' (zh-CN), '吸入的空气 所吸入的氧' (zh-CN), '已吸入的氧气 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 气 气体类 空气' (zh-CN), 'Inhaled O2' (pt-BR), 'vRate' (pt-BR), 'Volume rate' (pt-BR), 'Flow' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'IhG' (pt-BR), 'Inhaled Gas' (pt-BR), 'Inspired' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Gases' (pt-BR), 'Clinico Gas inalati Punto nel tempo (episodio) Tasso di Volume' (it-IT), 'Количественный Объемная скорость Точка во времени' (ru-RU), 'Момент' (ru-RU), 'ingeademde O2' (nl-NL) or 'O2-Zufuhr' (de-AT) (for the language(s) '--')", + "error" : "Wrong Display Name 'Flow Rate' for http://loinc.org#3151-8. Valid display is one of 37 choices: 'Inhaled oxygen flow rate', 'Inhaled O2 flow rate' (en-US), 'O2' (zh-CN), 'tO2' (zh-CN), '总氧' (zh-CN), '氧气 体积速率(单位时间)' (zh-CN), '单位时间内体积的变化速率' (zh-CN), '流量 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 吸入气' (zh-CN), '吸入气体' (zh-CN), '吸入的空气 所吸入的氧' (zh-CN), '已吸入的氧气 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 气 气体类 空气' (zh-CN), 'Inhaled O2' (pt-BR), 'vRate' (pt-BR), 'Volume rate' (pt-BR), 'Flow' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'IhG' (pt-BR), 'Inhaled Gas' (pt-BR), 'Inspired' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Gases' (pt-BR), 'Clinico Gas inalati Punto nel tempo (episodio) Tasso di Volume' (it-IT), 'Количественный Объемная скорость Точка во времени' (ru-RU), 'Момент' (ru-RU), 'ingeademde O2' (nl-NL) or 'O2-Zufuhr' (de-AT) (for the language(s) '--')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "invalid", @@ -227,7 +220,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name 'Flow Rate' for http://loinc.org#3151-8. Valid display is one of 37 choices: 'Inhaled oxygen flow rate', 'Inhaled O2 flow rate', 'O2' (zh-CN), 'tO2' (zh-CN), '总氧' (zh-CN), '氧气 体积速率(单位时间)' (zh-CN), '单位时间内体积的变化速率' (zh-CN), '流量 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 吸入气' (zh-CN), '吸入气体' (zh-CN), '吸入的空气 所吸入的氧' (zh-CN), '已吸入的氧气 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 气 气体类 空气' (zh-CN), 'Inhaled O2' (pt-BR), 'vRate' (pt-BR), 'Volume rate' (pt-BR), 'Flow' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'IhG' (pt-BR), 'Inhaled Gas' (pt-BR), 'Inspired' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Gases' (pt-BR), 'Clinico Gas inalati Punto nel tempo (episodio) Tasso di Volume' (it-IT), 'Количественный Объемная скорость Точка во времени' (ru-RU), 'Момент' (ru-RU), 'ingeademde O2' (nl-NL) or 'O2-Zufuhr' (de-AT) (for the language(s) '--')" + "text" : "Wrong Display Name 'Flow Rate' for http://loinc.org#3151-8. Valid display is one of 37 choices: 'Inhaled oxygen flow rate', 'Inhaled O2 flow rate' (en-US), 'O2' (zh-CN), 'tO2' (zh-CN), '总氧' (zh-CN), '氧气 体积速率(单位时间)' (zh-CN), '单位时间内体积的变化速率' (zh-CN), '流量 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 吸入气' (zh-CN), '吸入气体' (zh-CN), '吸入的空气 所吸入的氧' (zh-CN), '已吸入的氧气 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 气 气体类 空气' (zh-CN), 'Inhaled O2' (pt-BR), 'vRate' (pt-BR), 'Volume rate' (pt-BR), 'Flow' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'IhG' (pt-BR), 'Inhaled Gas' (pt-BR), 'Inspired' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Gases' (pt-BR), 'Clinico Gas inalati Punto nel tempo (episodio) Tasso di Volume' (it-IT), 'Количественный Объемная скорость Точка во времени' (ru-RU), 'Момент' (ru-RU), 'ingeademde O2' (nl-NL) or 'O2-Zufuhr' (de-AT) (for the language(s) '--')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -252,14 +245,13 @@ v: { "severity" : "error", "error" : "The provided code 'http://loinc.org#3151-8' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -292,8 +284,7 @@ v: { "code" : "59408-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -316,14 +307,13 @@ v: { "severity" : "error", "error" : "The provided code 'http://loinc.org#2708-6' was not found in the value set 'http://hl7.org/fhir/us/core/ValueSet/us-core-vital-signs--0|4.0.0'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -356,8 +346,7 @@ v: { "code" : "3150-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -380,8 +369,7 @@ v: { "code" : "3150-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -403,8 +391,7 @@ v: { "code" : "3151-8", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -415,8 +402,7 @@ v: { "system" : "http://loinc.org", "code" : "5792-7" }, "valueSet" :{ - "resourceType" : "ValueSet", - "url" : "http://hl7.org/fhir/ValueSet/birthDate" + "resourceType" : "ValueSet" }, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"true", "displayWarningMode":"false", "versionFlexible":"true", "profile": { "resourceType" : "Parameters", "parameter" : [{ @@ -425,11 +411,30 @@ v: { }] }}#### v: { + "code" : "5792-7", "severity" : "error", - "error" : "Error from http://tx-dev.fhir.org/r4: Error:A definition for the value Set 'http://hl7.org/fhir/ValueSet/birthDate' could not be found", - "class" : "SERVER_ERROR", + "error" : "The provided code 'http://loinc.org#5792-7' was not found in the value set 'http://hl7.org/fhir/ValueSet/birthDate'", + "class" : "UNKNOWN", + "server" : "http://local.fhir.org/r4", "issues" : { - "resourceType" : "OperationOutcome" + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://local.fhir.org/r4" + }], + "severity" : "error", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "not-in-vs" + }], + "text" : "The provided code 'http://loinc.org#5792-7' was not found in the value set 'http://hl7.org/fhir/ValueSet/birthDate'" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }] } } @@ -449,8 +454,7 @@ v: { "code" : "5792-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -472,8 +476,7 @@ v: { "code" : "11502-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -495,8 +498,7 @@ v: { "code" : "11502-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -518,8 +520,7 @@ v: { "code" : "11502-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -542,8 +543,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -565,8 +565,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -589,8 +588,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -613,8 +611,7 @@ v: { "code" : "76437-3", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -637,8 +634,7 @@ v: { "code" : "10160-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -661,8 +657,7 @@ v: { "code" : "48765-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -685,8 +680,7 @@ v: { "code" : "11450-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -709,8 +703,7 @@ v: { "code" : "47519-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -733,8 +726,7 @@ v: { "code" : "30954-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -757,8 +749,7 @@ v: { "code" : "8716-3", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -781,8 +772,7 @@ v: { "code" : "29762-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -805,8 +795,7 @@ v: { "code" : "10162-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -829,8 +818,7 @@ v: { "code" : "51899-3", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -853,8 +841,7 @@ v: { "code" : "46418-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -877,8 +864,7 @@ v: { "code" : "77140-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -901,8 +887,7 @@ v: { "code" : "4535-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -925,8 +910,7 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -948,8 +932,7 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -972,8 +955,7 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -996,8 +978,7 @@ v: { "code" : "8302-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1019,8 +1000,7 @@ v: { "code" : "8302-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1043,8 +1023,7 @@ v: { "code" : "8302-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1067,8 +1046,7 @@ v: { "code" : "39156-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1090,8 +1068,7 @@ v: { "code" : "39156-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1114,8 +1091,7 @@ v: { "code" : "39156-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1138,8 +1114,7 @@ v: { "code" : "85354-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1161,8 +1136,7 @@ v: { "code" : "85354-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1185,8 +1159,7 @@ v: { "code" : "85354-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1209,8 +1182,7 @@ v: { "code" : "8480-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1232,8 +1204,7 @@ v: { "code" : "8480-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1256,8 +1227,7 @@ v: { "code" : "8480-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1280,8 +1250,7 @@ v: { "code" : "8462-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1303,8 +1272,7 @@ v: { "code" : "8462-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1327,8 +1295,7 @@ v: { "code" : "8462-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1351,8 +1318,7 @@ v: { "code" : "883-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1375,8 +1341,7 @@ v: { "code" : "57024-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1398,16 +1363,15 @@ v: { "display" : "Consent Document", "code" : "59284-0", "severity" : "error", - "error" : "Wrong Display Name 'Patient Authorization Signature' for http://loinc.org#59284-0. Valid display is one of 29 choices: 'Consent Document', 'Consent', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 事件发生的地方' (zh-CN), '场景' (zh-CN), '环境' (zh-CN), '背景 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 同意书' (zh-CN), '知情同意' (zh-CN), '知情同意书 文档本体' (zh-CN), '临床文档本体' (zh-CN), '文档本体' (zh-CN), '文书本体' (zh-CN), '医疗文书本体' (zh-CN), '临床医疗文书本体 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间' (zh-CN) or 'Documentazione dell'ontologia Osservazione Punto nel tempo (episodio)' (it-IT) (for the language(s) '--')", + "error" : "Wrong Display Name 'Patient Authorization Signature' for http://loinc.org#59284-0. Valid display is one of 29 choices: 'Consent Document', 'Consent' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 事件发生的地方' (zh-CN), '场景' (zh-CN), '环境' (zh-CN), '背景 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 同意书' (zh-CN), '知情同意' (zh-CN), '知情同意书 文档本体' (zh-CN), '临床文档本体' (zh-CN), '文档本体' (zh-CN), '文书本体' (zh-CN), '医疗文书本体' (zh-CN), '临床医疗文书本体 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间' (zh-CN) or 'Documentazione dell'ontologia Osservazione Punto nel tempo (episodio)' (it-IT) (for the language(s) '--')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "invalid", @@ -1416,7 +1380,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name 'Patient Authorization Signature' for http://loinc.org#59284-0. Valid display is one of 29 choices: 'Consent Document', 'Consent', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 事件发生的地方' (zh-CN), '场景' (zh-CN), '环境' (zh-CN), '背景 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 同意书' (zh-CN), '知情同意' (zh-CN), '知情同意书 文档本体' (zh-CN), '临床文档本体' (zh-CN), '文档本体' (zh-CN), '文书本体' (zh-CN), '医疗文书本体' (zh-CN), '临床医疗文书本体 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间' (zh-CN) or 'Documentazione dell'ontologia Osservazione Punto nel tempo (episodio)' (it-IT) (for the language(s) '--')" + "text" : "Wrong Display Name 'Patient Authorization Signature' for http://loinc.org#59284-0. Valid display is one of 29 choices: 'Consent Document', 'Consent' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 事件发生的地方' (zh-CN), '场景' (zh-CN), '环境' (zh-CN), '背景 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 同意书' (zh-CN), '知情同意' (zh-CN), '知情同意书 文档本体' (zh-CN), '临床文档本体' (zh-CN), '文档本体' (zh-CN), '文书本体' (zh-CN), '医疗文书本体' (zh-CN), '临床医疗文书本体 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间' (zh-CN) or 'Documentazione dell'ontologia Osservazione Punto nel tempo (episodio)' (it-IT) (for the language(s) '--')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -1436,12 +1400,11 @@ v: { }] }}#### v: { - "display" : "Patient Consent", + "display" : "Consent Document", "code" : "59284-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1464,8 +1427,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1487,8 +1449,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1511,8 +1472,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1535,8 +1495,7 @@ v: { "code" : "76437-3", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1555,12 +1514,11 @@ v: { }] }}#### v: { - "display" : "History of Medication use Narrative", + "display" : "Hx of Medication use", "code" : "10160-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1579,12 +1537,11 @@ v: { }] }}#### v: { - "display" : "Allergies and adverse reactions Document", + "display" : "Allergies &or adverse reactions Doc", "code" : "48765-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1603,12 +1560,11 @@ v: { }] }}#### v: { - "display" : "Problem list - Reported", + "display" : "Problem list Reported", "code" : "11450-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1627,12 +1583,11 @@ v: { }] }}#### v: { - "display" : "History of Procedures Document", + "display" : "Procedures Hx Doc", "code" : "47519-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1651,12 +1606,11 @@ v: { }] }}#### v: { - "display" : "Relevant diagnostic tests/laboratory data Narrative", + "display" : "Relevant Dx tests/lab data", "code" : "30954-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1679,8 +1633,7 @@ v: { "code" : "8716-3", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1699,12 +1652,11 @@ v: { }] }}#### v: { - "display" : "Social history Narrative", + "display" : "Social Hx", "code" : "29762-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1723,12 +1675,11 @@ v: { }] }}#### v: { - "display" : "History of pregnancies Narrative", + "display" : "Pregnancies Hx", "code" : "10162-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1747,12 +1698,11 @@ v: { }] }}#### v: { - "display" : "Details Document", + "display" : "Details Doc", "code" : "51899-3", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1771,12 +1721,11 @@ v: { }] }}#### v: { - "display" : "Patient summary Document", + "display" : "Patient summary Doc", "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1794,12 +1743,11 @@ v: { }] }}#### v: { - "display" : "Patient summary Document", + "display" : "Patient summary Doc", "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1818,12 +1766,11 @@ v: { }] }}#### v: { - "display" : "Patient summary Document", + "display" : "Patient summary Doc", "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1842,12 +1789,11 @@ v: { }] }}#### v: { - "display" : "INR in Capillary blood by Coagulation assay", + "display" : "INR BldC", "code" : "46418-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1865,12 +1811,11 @@ v: { }] }}#### v: { - "display" : "INR in Capillary blood by Coagulation assay", + "display" : "INR BldC", "code" : "46418-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1889,12 +1834,11 @@ v: { }] }}#### v: { - "display" : "INR in Capillary blood by Coagulation assay", + "display" : "INR BldC", "code" : "46418-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1913,12 +1857,11 @@ v: { }] }}#### v: { - "display" : "Creatinine [Moles/volume] in Serum, Plasma or Blood", + "display" : "Creat SerPlBld-sCnc", "code" : "77140-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1936,12 +1879,11 @@ v: { }] }}#### v: { - "display" : "Creatinine [Moles/volume] in Serum, Plasma or Blood", + "display" : "Creat SerPlBld-sCnc", "code" : "77140-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1960,12 +1902,11 @@ v: { }] }}#### v: { - "display" : "Creatinine [Moles/volume] in Serum, Plasma or Blood", + "display" : "Creat SerPlBld-sCnc", "code" : "77140-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -1984,12 +1925,11 @@ v: { }] }}#### v: { - "display" : "Cytotoxic percent reactive Ab [Presence] in Serum by Quick method", + "display" : "Ctox Pct React Ab Ser Ql Qck", "code" : "4535-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2007,12 +1947,11 @@ v: { }] }}#### v: { - "display" : "Cytotoxic percent reactive Ab [Presence] in Serum by Quick method", + "display" : "Ctox Pct React Ab Ser Ql Qck", "code" : "4535-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2031,12 +1970,11 @@ v: { }] }}#### v: { - "display" : "Cytotoxic percent reactive Ab [Presence] in Serum by Quick method", + "display" : "Ctox Pct React Ab Ser Ql Qck", "code" : "4535-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2055,12 +1993,11 @@ v: { }] }}#### v: { - "display" : "Body weight", + "display" : "Weight", "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2078,12 +2015,11 @@ v: { }] }}#### v: { - "display" : "Body weight", + "display" : "Weight", "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2102,12 +2038,11 @@ v: { }] }}#### v: { - "display" : "Body weight", + "display" : "Weight", "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2130,8 +2065,7 @@ v: { "code" : "8302-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2153,8 +2087,7 @@ v: { "code" : "8302-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2177,8 +2110,7 @@ v: { "code" : "8302-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2197,12 +2129,11 @@ v: { }] }}#### v: { - "display" : "Body mass index (BMI) [Ratio]", + "display" : "BMI", "code" : "39156-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2220,12 +2151,11 @@ v: { }] }}#### v: { - "display" : "Body mass index (BMI) [Ratio]", + "display" : "BMI", "code" : "39156-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2244,12 +2174,11 @@ v: { }] }}#### v: { - "display" : "Body mass index (BMI) [Ratio]", + "display" : "BMI", "code" : "39156-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2268,12 +2197,11 @@ v: { }] }}#### v: { - "display" : "Blood pressure panel with all children optional", + "display" : "BP pnl w all optional", "code" : "85354-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2291,12 +2219,11 @@ v: { }] }}#### v: { - "display" : "Blood pressure panel with all children optional", + "display" : "BP pnl w all optional", "code" : "85354-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2315,12 +2242,11 @@ v: { }] }}#### v: { - "display" : "Blood pressure panel with all children optional", + "display" : "BP pnl w all optional", "code" : "85354-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2339,12 +2265,11 @@ v: { }] }}#### v: { - "display" : "Systolic blood pressure", + "display" : "BP sys", "code" : "8480-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2362,12 +2287,11 @@ v: { }] }}#### v: { - "display" : "Systolic blood pressure", + "display" : "BP sys", "code" : "8480-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2386,12 +2310,11 @@ v: { }] }}#### v: { - "display" : "Systolic blood pressure", + "display" : "BP sys", "code" : "8480-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2410,12 +2333,11 @@ v: { }] }}#### v: { - "display" : "Diastolic blood pressure", + "display" : "BP dias", "code" : "8462-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2433,12 +2355,11 @@ v: { }] }}#### v: { - "display" : "Diastolic blood pressure", + "display" : "BP dias", "code" : "8462-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2457,12 +2378,11 @@ v: { }] }}#### v: { - "display" : "Diastolic blood pressure", + "display" : "BP dias", "code" : "8462-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2481,12 +2401,11 @@ v: { }] }}#### v: { - "display" : "ABO group [Type] in Blood", + "display" : "ABO Group Bld", "code" : "883-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2504,19 +2423,18 @@ v: { }] }}#### v: { - "display" : "ABO group [Type] in Blood", + "display" : "ABO Group Bld", "code" : "883-9", "severity" : "error", "error" : "The provided code 'http://loinc.org#883-9' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -2545,19 +2463,18 @@ v: { }] }}#### v: { - "display" : "INR in Capillary blood by Coagulation assay", + "display" : "INR BldC", "code" : "46418-0", "severity" : "error", "error" : "The provided code 'http://loinc.org#46418-0' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -2586,19 +2503,18 @@ v: { }] }}#### v: { - "display" : "Creatinine [Moles/volume] in Serum, Plasma or Blood", + "display" : "Creat SerPlBld-sCnc", "code" : "77140-2", "severity" : "error", "error" : "The provided code 'http://loinc.org#77140-2' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -2627,19 +2543,18 @@ v: { }] }}#### v: { - "display" : "Cytotoxic percent reactive Ab [Presence] in Serum by Quick method", + "display" : "Ctox Pct React Ab Ser Ql Qck", "code" : "4535-1", "severity" : "error", "error" : "The provided code 'http://loinc.org#4535-1' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -2668,19 +2583,18 @@ v: { }] }}#### v: { - "display" : "Body weight", + "display" : "Weight", "code" : "29463-7", "severity" : "error", "error" : "The provided code 'http://loinc.org#29463-7' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-obs-laboratory--0|0.5.0'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -2714,14 +2628,13 @@ v: { "severity" : "error", "error" : "The provided code 'http://loinc.org#8302-2' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-obs-laboratory--0|0.5.0'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -2750,19 +2663,18 @@ v: { }] }}#### v: { - "display" : "Body mass index (BMI) [Ratio]", + "display" : "BMI", "code" : "39156-5", "severity" : "error", "error" : "The provided code 'http://loinc.org#39156-5' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-obs-laboratory--0|0.5.0'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -2791,19 +2703,18 @@ v: { }] }}#### v: { - "display" : "Blood pressure panel with all children optional", + "display" : "BP pnl w all optional", "code" : "85354-9", "severity" : "error", "error" : "The provided code 'http://loinc.org#85354-9' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-obs-laboratory--0|0.5.0'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -2832,19 +2743,18 @@ v: { }] }}#### v: { - "display" : "ABO group [Type] in Blood", + "display" : "ABO Group Bld", "code" : "883-9", "severity" : "error", "error" : "The provided code 'http://loinc.org#883-9' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-obs-laboratory--0|0.5.0'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -2878,8 +2788,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2901,8 +2810,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2925,8 +2833,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2949,8 +2856,7 @@ v: { "code" : "48765-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2973,8 +2879,7 @@ v: { "code" : "10160-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -2997,8 +2902,7 @@ v: { "code" : "11450-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3020,16 +2924,15 @@ v: { "display" : "FDA product label NDC labeler code request", "code" : "51726-8", "severity" : "error", - "error" : "Wrong Display Name 'NDC labeler code request' for http://loinc.org#51726-8. Valid display is one of 22 choices: 'FDA product label NDC labeler code request', 'FDA label NDC labeler code request', 'FDA 药品标签 National Drug Code' (zh-CN), 'NDC' (zh-CN), '国家药品验证号' (zh-CN), '国家药品代码' (zh-CN), '美国国家药品代码' (zh-CN), '全国药品代码' (zh-CN), 'NDC labeler code' (zh-CN), 'NDC 标识者识别代码' (zh-CN), 'NDC 厂家号' (zh-CN), 'NDC 贴签厂商代码请求' (zh-CN), 'NDC 标签号申请 叙述' (zh-CN), '叙述性文字' (zh-CN), '报告' (zh-CN), '报告型' (zh-CN), '文字叙述' (zh-CN), '文本叙述型' (zh-CN), '文本描述' (zh-CN), '文本描述型 监管类文档' (zh-CN), 'Documentazione normativa Etichetta di prodotto della Food and Drug Administ' (it-IT) or 'Описательный' (ru-RU) (for the language(s) '--')", + "error" : "Wrong Display Name 'NDC labeler code request' for http://loinc.org#51726-8. Valid display is one of 22 choices: 'FDA product label NDC labeler code request', 'FDA label NDC labeler code request' (en-US), 'FDA 药品标签 National Drug Code' (zh-CN), 'NDC' (zh-CN), '国家药品验证号' (zh-CN), '国家药品代码' (zh-CN), '美国国家药品代码' (zh-CN), '全国药品代码' (zh-CN), 'NDC labeler code' (zh-CN), 'NDC 标识者识别代码' (zh-CN), 'NDC 厂家号' (zh-CN), 'NDC 贴签厂商代码请求' (zh-CN), 'NDC 标签号申请 叙述' (zh-CN), '叙述性文字' (zh-CN), '报告' (zh-CN), '报告型' (zh-CN), '文字叙述' (zh-CN), '文本叙述型' (zh-CN), '文本描述' (zh-CN), '文本描述型 监管类文档' (zh-CN), 'Documentazione normativa Etichetta di prodotto della Food and Drug Administ' (it-IT) or 'Описательный' (ru-RU) (for the language(s) '--')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "invalid", @@ -3038,7 +2941,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name 'NDC labeler code request' for http://loinc.org#51726-8. Valid display is one of 22 choices: 'FDA product label NDC labeler code request', 'FDA label NDC labeler code request', 'FDA 药品标签 National Drug Code' (zh-CN), 'NDC' (zh-CN), '国家药品验证号' (zh-CN), '国家药品代码' (zh-CN), '美国国家药品代码' (zh-CN), '全国药品代码' (zh-CN), 'NDC labeler code' (zh-CN), 'NDC 标识者识别代码' (zh-CN), 'NDC 厂家号' (zh-CN), 'NDC 贴签厂商代码请求' (zh-CN), 'NDC 标签号申请 叙述' (zh-CN), '叙述性文字' (zh-CN), '报告' (zh-CN), '报告型' (zh-CN), '文字叙述' (zh-CN), '文本叙述型' (zh-CN), '文本描述' (zh-CN), '文本描述型 监管类文档' (zh-CN), 'Documentazione normativa Etichetta di prodotto della Food and Drug Administ' (it-IT) or 'Описательный' (ru-RU) (for the language(s) '--')" + "text" : "Wrong Display Name 'NDC labeler code request' for http://loinc.org#51726-8. Valid display is one of 22 choices: 'FDA product label NDC labeler code request', 'FDA label NDC labeler code request' (en-US), 'FDA 药品标签 National Drug Code' (zh-CN), 'NDC' (zh-CN), '国家药品验证号' (zh-CN), '国家药品代码' (zh-CN), '美国国家药品代码' (zh-CN), '全国药品代码' (zh-CN), 'NDC labeler code' (zh-CN), 'NDC 标识者识别代码' (zh-CN), 'NDC 厂家号' (zh-CN), 'NDC 贴签厂商代码请求' (zh-CN), 'NDC 标签号申请 叙述' (zh-CN), '叙述性文字' (zh-CN), '报告' (zh-CN), '报告型' (zh-CN), '文字叙述' (zh-CN), '文本叙述型' (zh-CN), '文本描述' (zh-CN), '文本描述型 监管类文档' (zh-CN), 'Documentazione normativa Etichetta di prodotto della Food and Drug Administ' (it-IT) or 'Описательный' (ru-RU) (for the language(s) '--')" }, "location" : ["Coding.display"], "expression" : ["Coding.display"] @@ -3063,8 +2966,7 @@ v: { "code" : "80764-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3088,8 +2990,7 @@ v: { "code" : "56445-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3111,8 +3012,7 @@ v: { "code" : "56445-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3136,8 +3036,7 @@ v: { "code" : "56445-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3160,16 +3059,15 @@ v: { "display" : "Allergies and adverse reactions Document", "code" : "48765-2", "severity" : "error", - "error" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", + "error" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "invalid", @@ -3178,7 +3076,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" + "text" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -3203,8 +3101,7 @@ v: { "code" : "34133-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3226,8 +3123,7 @@ v: { "code" : "34133-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3250,8 +3146,7 @@ v: { "code" : "34133-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3273,8 +3168,7 @@ v: { "code" : "34133-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3298,8 +3192,7 @@ v: { "code" : "57852-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3322,8 +3215,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3345,8 +3237,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3369,8 +3260,7 @@ v: { "code" : "60591-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3393,8 +3283,7 @@ v: { "code" : "48765-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3417,8 +3306,7 @@ v: { "code" : "11450-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3441,8 +3329,7 @@ v: { "code" : "10160-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3465,8 +3352,7 @@ v: { "code" : "11369-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3489,8 +3375,7 @@ v: { "code" : "47519-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3513,8 +3398,7 @@ v: { "code" : "30954-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3537,8 +3421,7 @@ v: { "code" : "8716-3", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3561,8 +3444,7 @@ v: { "code" : "29762-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3585,8 +3467,7 @@ v: { "code" : "47420-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3609,8 +3490,7 @@ v: { "code" : "8310-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3632,8 +3512,7 @@ v: { "code" : "8310-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3656,8 +3535,7 @@ v: { "code" : "8310-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3680,8 +3558,7 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3703,8 +3580,7 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3727,8 +3603,7 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3751,8 +3626,7 @@ v: { "code" : "9279-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3774,8 +3648,7 @@ v: { "code" : "9279-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3798,8 +3671,7 @@ v: { "code" : "9279-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3822,8 +3694,7 @@ v: { "code" : "85354-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3845,8 +3716,7 @@ v: { "code" : "85354-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3869,8 +3739,7 @@ v: { "code" : "85354-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3893,8 +3762,7 @@ v: { "code" : "8480-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3916,8 +3784,7 @@ v: { "code" : "8480-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3940,8 +3807,7 @@ v: { "code" : "8480-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3964,8 +3830,7 @@ v: { "code" : "8462-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -3987,8 +3852,7 @@ v: { "code" : "8462-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4011,8 +3875,7 @@ v: { "code" : "8462-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4035,8 +3898,7 @@ v: { "code" : "8302-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4058,8 +3920,7 @@ v: { "code" : "8302-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4082,8 +3943,7 @@ v: { "code" : "8302-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4106,8 +3966,7 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4129,8 +3988,7 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4153,8 +4011,7 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4177,8 +4034,7 @@ v: { "code" : "72166-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4201,10 +4057,28 @@ v: { "code" : "LA15920-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "severity" : "warning", + "error" : "Wrong Display Name 'Former smoker' for http://loinc.org#LA15920-4. Valid display is 'Former smoker' (en-US) (for the language(s) 'en-NZ')", + "server" : "http://local.fhir.org/r4", "issues" : { - "resourceType" : "OperationOutcome" + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://local.fhir.org/r4" + }], + "severity" : "warning", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'Former smoker' for http://loinc.org#LA15920-4. Valid display is 'Former smoker' (en-US) (for the language(s) 'en-NZ')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] } } @@ -4225,8 +4099,7 @@ v: { "code" : "8310-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4248,8 +4121,7 @@ v: { "code" : "8310-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4272,8 +4144,7 @@ v: { "code" : "8310-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4296,8 +4167,7 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4319,8 +4189,7 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4343,8 +4212,7 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4367,8 +4235,7 @@ v: { "code" : "9279-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4390,8 +4257,7 @@ v: { "code" : "9279-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4414,8 +4280,7 @@ v: { "code" : "9279-1", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4438,8 +4303,7 @@ v: { "code" : "72166-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4462,8 +4326,7 @@ v: { "code" : "LA15920-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4485,8 +4348,7 @@ v: { "code" : "LA15920-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4509,8 +4371,7 @@ v: { "code" : "LA15920-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4533,8 +4394,7 @@ v: { "code" : "18842-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4556,8 +4416,7 @@ v: { "code" : "18842-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4580,8 +4439,7 @@ v: { "code" : "18842-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4603,8 +4461,7 @@ v: { "code" : "29299-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4627,14 +4484,13 @@ v: { "severity" : "error", "error" : "Unknown code '�g��' in the CodeSystem 'http://loinc.org' version '2.74'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -4668,8 +4524,7 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4691,8 +4546,7 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4715,8 +4569,7 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4735,12 +4588,11 @@ v: { }] }}#### v: { - "display" : "ABO group [Type] in Blood", + "display" : "ABO Group Bld", "code" : "883-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4759,12 +4611,11 @@ v: { }] }}#### v: { - "display" : "Rh [Type] in Blood", + "display" : "Rh Bld", "code" : "10331-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4788,14 +4639,13 @@ v: { "severity" : "error", "error" : "Wrong Display Name '����' for http://loinc.org#18684-1. Valid display is 'First Blood pressure Set' (for the language(s) 'en')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "invalid", @@ -4825,19 +4675,18 @@ v: { }] }}#### v: { - "display" : "Systolic blood pressure", + "display" : "BP sys", "code" : "8480-6", "severity" : "error", - "error" : "Wrong Display Name '���k������' for http://loinc.org#8480-6. Valid display is one of 2 choices: 'Systolic blood pressure' or 'BP sys' (for the language(s) 'en')", + "error" : "Wrong Display Name '���k������' for http://loinc.org#8480-6. Valid display is one of 2 choices: 'Systolic blood pressure' or 'BP sys' (en-US) (for the language(s) 'en')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "invalid", @@ -4846,7 +4695,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name '���k������' for http://loinc.org#8480-6. Valid display is one of 2 choices: 'Systolic blood pressure' or 'BP sys' (for the language(s) 'en')" + "text" : "Wrong Display Name '���k������' for http://loinc.org#8480-6. Valid display is one of 2 choices: 'Systolic blood pressure' or 'BP sys' (en-US) (for the language(s) 'en')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -4867,19 +4716,18 @@ v: { }] }}#### v: { - "display" : "Diastolic blood pressure", + "display" : "BP dias", "code" : "8462-4", "severity" : "error", - "error" : "Wrong Display Name '�g��������' for http://loinc.org#8462-4. Valid display is one of 2 choices: 'Diastolic blood pressure' or 'BP dias' (for the language(s) 'en')", + "error" : "Wrong Display Name '�g��������' for http://loinc.org#8462-4. Valid display is one of 2 choices: 'Diastolic blood pressure' or 'BP dias' (en-US) (for the language(s) 'en')", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "invalid", @@ -4888,7 +4736,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong Display Name '�g��������' for http://loinc.org#8462-4. Valid display is one of 2 choices: 'Diastolic blood pressure' or 'BP dias' (for the language(s) 'en')" + "text" : "Wrong Display Name '�g��������' for http://loinc.org#8462-4. Valid display is one of 2 choices: 'Diastolic blood pressure' or 'BP dias' (en-US) (for the language(s) 'en')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -4909,12 +4757,11 @@ v: { }] }}#### v: { - "display" : "Hemoglobin [Mass/volume] in Blood", + "display" : "Hgb Bld-mCnc", "code" : "718-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4933,12 +4780,11 @@ v: { }] }}#### v: { - "display" : "Creatinine [Mass/volume] in Blood", + "display" : "Creat Bld-mCnc", "code" : "38483-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4957,12 +4803,11 @@ v: { }] }}#### v: { - "display" : "Cholesterol [Mass/volume] in Serum or Plasma", + "display" : "Cholest SerPl-mCnc", "code" : "2093-3", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -4985,8 +4830,7 @@ v: { "code" : "44261-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5010,8 +4854,7 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5035,8 +4878,7 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5060,8 +4902,7 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5084,8 +4925,7 @@ v: { "code" : "59408-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5108,8 +4948,7 @@ v: { "code" : "3151-8", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5132,8 +4971,7 @@ v: { "code" : "2708-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5157,14 +4995,13 @@ v: { "severity" : "error", "error" : "The provided code 'http://loinc.org#59408-5 ('Oxygen saturation in Arterial blood by Pulse oximetry')' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult|4.0.1'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -5197,8 +5034,7 @@ v: { "code" : "69548-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5220,8 +5056,7 @@ v: { "code" : "LA9633-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5243,8 +5078,7 @@ v: { "code" : "LA26398-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5266,8 +5100,7 @@ v: { "code" : "48018-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5289,8 +5122,7 @@ v: { "code" : "81252-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5312,8 +5144,7 @@ v: { "code" : "81290-9", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5335,8 +5166,7 @@ v: { "code" : "48002-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5358,8 +5188,7 @@ v: { "code" : "LA6684-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5381,8 +5210,7 @@ v: { "code" : "69548-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5404,8 +5232,7 @@ v: { "code" : "69548-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5439,8 +5266,7 @@ v: { "code" : "LA9633-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5474,8 +5300,7 @@ v: { "code" : "LA9633-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5509,8 +5334,7 @@ v: { "code" : "LA26398-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5544,8 +5368,7 @@ v: { "code" : "LA26398-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5579,8 +5402,7 @@ v: { "code" : "LA6684-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5614,8 +5436,7 @@ v: { "code" : "LA6684-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5637,8 +5458,7 @@ v: { "code" : "8310-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5660,8 +5480,7 @@ v: { "code" : "8310-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5670,8 +5489,8 @@ v: { ------------------------------------------------------------------------------------- {"code" : { "system" : "http://loinc.org", - "code" : "96607-7", - "display" : "Blood pressure panel mean systolic and mean diastolic" + "code" : "76534-7", + "display" : "Systolic blood pressure by Noninvasive" }, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { "resourceType" : "Parameters", "parameter" : [{ @@ -5680,12 +5499,11 @@ v: { }] }}#### v: { - "display" : "Blood pressure panel mean systolic and mean diastolic", - "code" : "96607-7", + "display" : "Systolic blood pressure by Noninvasive", + "code" : "76534-7", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5694,55 +5512,7 @@ v: { ------------------------------------------------------------------------------------- {"code" : { "system" : "http://loinc.org", - "code" : "96608-5", - "display" : "Systolic blood pressure mean" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Systolic blood pressure mean", - "code" : "96608-5", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "96609-3", - "display" : "Diastolic blood pressure mean" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Diastolic blood pressure mean", - "code" : "96609-3", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "96607-7" + "code" : "76534-7" }, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { "resourceType" : "Parameters", "parameter" : [{ @@ -5751,19 +5521,18 @@ v: { }] }}#### v: { - "display" : "Blood pressure panel mean systolic and mean diastolic", - "code" : "96607-7", + "display" : "Systolic blood pressure by Noninvasive", + "code" : "76534-7", "severity" : "error", - "error" : "The provided code 'http://loinc.org#96607-7' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", + "error" : "The provided code 'http://loinc.org#76534-7' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -5772,89 +5541,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-in-vs" }], - "text" : "The provided code 'http://loinc.org#96607-7' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "96608-5" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Systolic blood pressure mean", - "code" : "96608-5", - "severity" : "error", - "error" : "The provided code 'http://loinc.org#96608-5' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://loinc.org#96608-5' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'" - }, - "location" : ["Coding.code"], - "expression" : ["Coding.code"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "96609-3" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Diastolic blood pressure mean", - "code" : "96609-3", - "severity" : "error", - "error" : "The provided code 'http://loinc.org#96609-3' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "code-invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "not-in-vs" - }], - "text" : "The provided code 'http://loinc.org#96609-3' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'" + "text" : "The provided code 'http://loinc.org#76534-7' was not found in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1'" }, "location" : ["Coding.code"], "expression" : ["Coding.code"] @@ -5879,8 +5566,7 @@ v: { "code" : "LA20271-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5903,8 +5589,7 @@ v: { "code" : "LA20278-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5927,8 +5612,7 @@ v: { "code" : "LA20275-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5951,8 +5635,7 @@ v: { "code" : "LA20276-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5975,8 +5658,7 @@ v: { "code" : "LA20296-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -5999,8 +5681,7 @@ v: { "code" : "LA32-8", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6023,8 +5704,7 @@ v: { "code" : "LA33-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6174,8 +5854,7 @@ v: { "code" : "LA20271-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6253,8 +5932,7 @@ v: { "code" : "LA20278-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6312,8 +5990,7 @@ v: { "code" : "LA20275-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6403,8 +6080,7 @@ v: { "code" : "LA20276-4", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6474,8 +6150,7 @@ v: { "code" : "LA20296-2", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6513,8 +6188,7 @@ v: { "code" : "LA32-8", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6552,8 +6226,7 @@ v: { "code" : "LA33-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6575,8 +6248,7 @@ v: { "code" : "LA33-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6598,8 +6270,7 @@ v: { "code" : "LA32-8", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6634,8 +6305,7 @@ v: { "code" : "LA33-6", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6670,8 +6340,7 @@ v: { "code" : "LA32-8", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6694,8 +6363,7 @@ v: { "code" : "88123-5", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6718,8 +6386,7 @@ v: { "code" : "LA28397-0", "system" : "http://loinc.org", "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" } @@ -6742,14 +6409,13 @@ v: { "severity" : "error", "error" : "Unknown code 'test' in the CodeSystem 'http://loinc.org' version '2.74'", "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", + "server" : "http://local.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" + "valueUrl" : "http://local.fhir.org/r4" }], "severity" : "error", "code" : "code-invalid", @@ -6782,6 +6448,29 @@ v: { "code" : "10155-0", "system" : "http://loinc.org", "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "72514-3", + "display" : "Pain severity - 0-10 verbal numeric rating [Score] - Reported" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Pain severity - 0-10 verbal numeric rating [Score] - Reported", + "code" : "72514-3", + "system" : "http://loinc.org", + "version" : "2.74", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/mimetypes.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/mimetypes.cache new file mode 100644 index 000000000..055682d8e --- /dev/null +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/mimetypes.cache @@ -0,0 +1,15 @@ +------------------------------------------------------------------------------------- +{"hierarchical" : false, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "inactive" : true, + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}}#### +e: { + "from-server" : true, + "error" : "Error from http://tx-dev.fhir.org/r4: The code System \"urn:ietf:bcp:13\" has a grammar, and cannot be enumerated directly" +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/snomed.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/snomed.cache index 24357cc2d..de9dda12b 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/snomed.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/snomed.cache @@ -14,9 +14,8 @@ v: { "display" : "Medication summary document (record artifact)", "code" : "721912009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -38,9 +37,8 @@ v: { "display" : "Allergy to peanuts", "code" : "91935009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -62,9 +60,8 @@ v: { "display" : "Cow's milk", "code" : "3718001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -86,9 +83,8 @@ v: { "display" : "Mild", "code" : "255604002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -109,9 +105,8 @@ v: { "display" : "Mild", "code" : "255604002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -133,9 +128,8 @@ v: { "display" : "Mild", "code" : "255604002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -157,9 +151,8 @@ v: { "display" : "Food allergy diet", "code" : "409002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -184,7 +177,6 @@ v: { "error" : "Wrong Display Name 'Moderate' for http://snomed.info/sct#6736007. Valid display is one of 4 choices: 'Midgrade', 'Moderate (severity modifier) (qualifier value)', 'Moderate (severity modifier)' or 'Moderate severity' (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -222,9 +214,8 @@ v: { "display" : "Midgrade", "code" : "6736007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -246,9 +237,8 @@ v: { "display" : "Abnormal composition of urine", "code" : "437009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -270,9 +260,8 @@ v: { "display" : "Right kidney", "code" : "9846003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -294,9 +283,8 @@ v: { "display" : "Excision of lesion of artery", "code" : "189009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -318,9 +306,8 @@ v: { "display" : "Removal of subarachnoid-ureteral shunt", "code" : "911003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -342,9 +329,8 @@ v: { "display" : "Blood group A", "code" : "112144000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -366,9 +352,8 @@ v: { "display" : "Risk factor", "code" : "80943009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -390,9 +375,8 @@ v: { "display" : "Smoker", "code" : "77176002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -414,9 +398,8 @@ v: { "display" : "High blood pressure", "code" : "38341003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -438,10 +421,9 @@ v: { "display" : "Injury of prostate without open wound into abdominal cavity", "code" : "1419004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "inactive" : true, - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -460,6 +442,40 @@ v: { }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '1419004' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '1419004' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] }] } @@ -480,9 +496,8 @@ v: { "display" : "Primary malignant neoplasm of lung", "code" : "93880001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -504,9 +519,8 @@ v: { "display" : "Estimated date of conception", "code" : "248986005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -528,9 +542,8 @@ v: { "display" : "Estimated date of delivery", "code" : "161714006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -552,9 +565,8 @@ v: { "display" : "Last menstrual period -1st day", "code" : "161713000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -576,9 +588,8 @@ v: { "display" : "Length of gestation at time of procedure (observable entity)", "code" : "445872007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -600,9 +611,8 @@ v: { "display" : "Allergy record (record artifact)", "code" : "722446000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -624,9 +634,8 @@ v: { "display" : "Encounter report", "code" : "371531000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -648,9 +657,8 @@ v: { "display" : "Laboratory report (record artifact)", "code" : "4241000179101", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -672,9 +680,8 @@ v: { "display" : "Summary clinical document (record artifact)", "code" : "422735006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -696,9 +703,8 @@ v: { "display" : "Prescription record (record artifact)", "code" : "440545006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -720,10 +726,9 @@ v: { "display" : "Azithromycin (as azithromycin dihydrate) 250 mg oral capsule", "code" : "324252006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "inactive" : true, - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -742,6 +747,40 @@ v: { }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '324252006' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '324252006' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] }] } @@ -765,7 +804,6 @@ v: { "error" : "Wrong Display Name 'Traveller's Diarrhea (disorder)' for http://snomed.info/sct#11840006. Valid display is one of 4 choices: 'Traveler's diarrhea', 'Turista', 'Traveler's diarrhoea' or 'Traveler's diarrhea (disorder)' (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -804,9 +842,8 @@ v: { "display" : "Abdominal pain", "code" : "21522001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -828,9 +865,8 @@ v: { "display" : "With or after food", "code" : "311504000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -852,9 +888,8 @@ v: { "display" : "Oral route", "code" : "26643006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -876,9 +911,8 @@ v: { "display" : "Swallow - dosing instruction imperative (qualifier value)", "code" : "421521009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -900,10 +934,9 @@ v: { "display" : "Ross river fever", "code" : "602001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "inactive" : true, - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -922,6 +955,40 @@ v: { }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '602001' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '602001' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] }] } @@ -942,9 +1009,8 @@ v: { "display" : "Allergy to peanuts", "code" : "91935009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -966,9 +1032,8 @@ v: { "display" : "Cow's milk", "code" : "3718001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -990,9 +1055,8 @@ v: { "display" : "Mild", "code" : "255604002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1013,9 +1077,8 @@ v: { "display" : "Mild", "code" : "255604002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1037,9 +1100,8 @@ v: { "display" : "Mild", "code" : "255604002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1061,9 +1123,8 @@ v: { "display" : "Food allergy diet", "code" : "409002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1085,11 +1146,10 @@ v: { "display" : "Midgrade", "code" : "6736007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "severity" : "warning", "error" : "Wrong Display Name 'Moderate' for http://snomed.info/sct#6736007. Valid display is one of 4 choices: 'Midgrade', 'Moderate (severity modifier) (qualifier value)', 'Moderate (severity modifier)' or 'Moderate severity' (for the language(s) 'en')", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -1127,9 +1187,8 @@ v: { "display" : "Midgrade", "code" : "6736007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1151,11 +1210,10 @@ v: { "display" : "Midgrade", "code" : "6736007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "severity" : "warning", "error" : "Wrong Display Name 'Moderate' for http://snomed.info/sct#6736007. Valid display is one of 4 choices: 'Midgrade', 'Moderate (severity modifier) (qualifier value)', 'Moderate (severity modifier)' or 'Moderate severity' (for the language(s) 'en')", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -1194,9 +1252,8 @@ v: { "display" : "Abnormal composition of urine", "code" : "437009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1218,9 +1275,8 @@ v: { "display" : "Right kidney", "code" : "9846003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1242,9 +1298,8 @@ v: { "display" : "Excision of lesion of artery", "code" : "189009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1266,9 +1321,8 @@ v: { "display" : "Peroneal artery", "code" : "8821006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1290,9 +1344,8 @@ v: { "display" : "Removal of subarachnoid-ureteral shunt", "code" : "911003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1314,9 +1367,8 @@ v: { "display" : "Blood group A", "code" : "112144000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1337,9 +1389,8 @@ v: { "display" : "Blood group A (finding)", "code" : "112144000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1361,9 +1412,8 @@ v: { "display" : "Risk factor", "code" : "80943009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1385,9 +1435,8 @@ v: { "display" : "Smoker", "code" : "77176002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1409,9 +1458,8 @@ v: { "display" : "High blood pressure", "code" : "38341003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1433,10 +1481,9 @@ v: { "display" : "Injury of prostate without open wound into abdominal cavity", "code" : "1419004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "inactive" : true, - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -1455,6 +1502,40 @@ v: { }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '1419004' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '1419004' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] }] } @@ -1475,9 +1556,8 @@ v: { "display" : "Primary malignant neoplasm of lung", "code" : "93880001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1499,9 +1579,8 @@ v: { "display" : "Estimated date of conception", "code" : "248986005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1523,9 +1602,8 @@ v: { "display" : "Estimated date of delivery", "code" : "161714006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1547,9 +1625,8 @@ v: { "display" : "Last menstrual period -1st day", "code" : "161713000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1571,9 +1648,8 @@ v: { "display" : "Length of gestation at time of procedure (observable entity)", "code" : "445872007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1595,9 +1671,8 @@ v: { "display" : "Allergy record (record artifact)", "code" : "722446000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1618,9 +1693,8 @@ v: { "display" : "Allergy record", "code" : "722446000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1642,9 +1716,8 @@ v: { "display" : "Encounter report", "code" : "371531000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1665,9 +1738,8 @@ v: { "display" : "Report of clinical encounter", "code" : "371531000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1689,9 +1761,8 @@ v: { "display" : "Laboratory report (record artifact)", "code" : "4241000179101", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1712,9 +1783,8 @@ v: { "display" : "Laboratory report", "code" : "4241000179101", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1736,9 +1806,8 @@ v: { "display" : "Summary clinical document (record artifact)", "code" : "422735006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1759,9 +1828,8 @@ v: { "display" : "Summary clinical document", "code" : "422735006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1785,7 +1853,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#77176002' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-obs-bloodGroup--0|0.5.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -1826,7 +1893,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#38341003' was not found in the value set 'https://mednet.swiss/fhir/ValueSet/mni-obs-bloodGroup--0|0.5.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -1865,10 +1931,9 @@ v: { "display" : "With laterality", "code" : "78615007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "inactive" : true, - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -1903,9 +1968,8 @@ v: { "display" : "Causative agent", "code" : "246075003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1927,9 +1991,8 @@ v: { "display" : "Has focus", "code" : "363702006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1954,7 +2017,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/731000124108/version/20230901", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1979,7 +2041,6 @@ v: { "error" : "Wrong Display Name 'Progress note' for http://snomed.info/sct#371532007. Valid display is one of 3 choices: 'Progress report', 'Report of subsequent visit' or 'Progress report (record artifact)' (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2018,9 +2079,8 @@ v: { "display" : "Clinical procedure report", "code" : "371525003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2041,9 +2101,8 @@ v: { "display" : "Progress report (record artifact)", "code" : "371532007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2064,9 +2123,8 @@ v: { "display" : "Clinical procedure report (record artifact)", "code" : "371525003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2091,7 +2149,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct|http://snomed.info/sct/2011000195101#264358009' was not found in the value set 'http://fhir.ch/ig/ch-ig/ValueSet/OrganizationType|0.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2133,7 +2190,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct|http://snomed.info/sct/2011000195101#46224007' was not found in the value set 'http://fhir.ch/ig/ch-ig/ValueSet/OrganizationType|0.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2169,12 +2225,11 @@ v: { }] }}#### v: { - "display" : "Pharmacy (environment)", + "display" : "Pharmacy", "code" : "264372000", "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/2011000195101/version/20230607", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2196,9 +2251,8 @@ v: { "display" : "Record artifact (record artifact)", "code" : "419891008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2220,9 +2274,8 @@ v: { "display" : "Clinical procedure report", "code" : "371525003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2244,9 +2297,8 @@ v: { "display" : "Normal", "code" : "17621005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2268,9 +2320,8 @@ v: { "display" : "Military health institution (environment)", "code" : "722172003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2292,9 +2343,8 @@ v: { "display" : "General surgery (qualifier value)", "code" : "394609007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2316,9 +2366,8 @@ v: { "display" : "Procedure", "code" : "71388002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2340,7 +2389,7 @@ v: { v: { "code" : "271872005", "severity" : "warning", - "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000146104/version/20220930' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]", + "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000146104/version/20220930' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]", "class" : "CODESYSTEM_UNSUPPORTED", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://snomed.info/sct|http://snomed.info/sct/11000146104/version/20220930", @@ -2358,7 +2407,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-found" }], - "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000146104/version/20220930' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]" + "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000146104/version/20220930' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]" }, "location" : ["CodeableConcept.coding[0].system"], "expression" : ["CodeableConcept.coding[0].system"] @@ -2380,13 +2429,12 @@ v: { }] }}#### v: { - "display" : "Old age (qualifier value)", + "display" : "Old age", "code" : "271872005", "severity" : "error", "error" : "No Message returned", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -2425,9 +2473,8 @@ v: { "display" : "Not indicated (qualifier value)", "code" : "410534003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2449,9 +2496,8 @@ v: { "display" : "Medical practitioner", "code" : "158965000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2473,9 +2519,8 @@ v: { "display" : "Product containing flucloxacillin (medicinal product)", "code" : "96067005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2497,9 +2542,8 @@ v: { "display" : "Penicillin adverse reaction", "code" : "292954005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2521,9 +2565,8 @@ v: { "display" : "Product containing diazepam (medicinal product)", "code" : "48546005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2545,9 +2588,8 @@ v: { "display" : "Diazepam adverse reaction", "code" : "292360004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2569,9 +2611,8 @@ v: { "display" : "Postconcussion syndrome", "code" : "40425004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2593,9 +2634,8 @@ v: { "display" : "Insulin treated Type II diabetes mellitus", "code" : "237599002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2617,9 +2657,8 @@ v: { "display" : "Gout", "code" : "90560007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2641,9 +2680,8 @@ v: { "display" : "Benign essential hypertension", "code" : "1201005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2665,9 +2703,8 @@ v: { "display" : "Anxiety disorder due to a general medical condition", "code" : "52910006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2689,9 +2726,8 @@ v: { "display" : "Fracture of neck of femur", "code" : "5913000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2713,9 +2749,8 @@ v: { "display" : "Product containing insulin glargine (medicinal product)", "code" : "126212009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2737,9 +2772,8 @@ v: { "display" : "Subcutaneous route", "code" : "34206005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2760,9 +2794,8 @@ v: { "display" : "Unit", "code" : "767525000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2784,9 +2817,8 @@ v: { "display" : "Product containing dulaglutide (medicinal product)", "code" : "714081009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2808,9 +2840,8 @@ v: { "display" : "Product containing metformin (medicinal product)", "code" : "109081006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2832,9 +2863,8 @@ v: { "display" : "Oral route", "code" : "26643006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2855,9 +2885,8 @@ v: { "display" : "Tablet - unit of product usage (qualifier value)", "code" : "428673006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2879,9 +2908,8 @@ v: { "display" : "Product containing amlodipine (medicinal product)", "code" : "108537001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2903,9 +2931,8 @@ v: { "display" : "Product containing losartan (medicinal product)", "code" : "96309000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2927,9 +2954,8 @@ v: { "display" : "Product containing aspirin (medicinal product)", "code" : "7947003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2951,9 +2977,8 @@ v: { "display" : "Product containing allopurinol (medicinal product)", "code" : "25246002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2975,9 +3000,8 @@ v: { "display" : "Structure of left deltoid muscle", "code" : "16217701000119102", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -2999,9 +3023,8 @@ v: { "display" : "Primary open reduction and internal fixation of proximal femoral fracture with screw/nail and plate device", "code" : "265132005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3023,9 +3046,8 @@ v: { "display" : "Suturing of hand", "code" : "287903004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3047,9 +3069,8 @@ v: { "display" : "Clinical pathologist", "code" : "81464008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3071,9 +3092,8 @@ v: { "display" : "Product containing flucloxacillin (medicinal product)", "code" : "96067005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3097,7 +3117,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#96067005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-uv-ips--0|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -3137,7 +3156,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3161,7 +3179,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3183,9 +3200,8 @@ v: { "display" : "Penicillin adverse reaction", "code" : "292954005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3209,7 +3225,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#292954005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/allergy-reaction-snomed-ct-ips-free-set--0|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -3248,9 +3263,8 @@ v: { "display" : "Product containing diazepam (medicinal product)", "code" : "48546005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3274,7 +3288,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#48546005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-uv-ips--0|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -3314,7 +3327,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3338,7 +3350,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3360,9 +3371,8 @@ v: { "display" : "Diazepam adverse reaction", "code" : "292360004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3386,7 +3396,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#292360004' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/allergy-reaction-snomed-ct-ips-free-set--0|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -3425,9 +3434,8 @@ v: { "display" : "Postconcussion syndrome", "code" : "40425004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3450,7 +3458,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3474,7 +3481,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3496,9 +3502,8 @@ v: { "display" : "Insulin treated Type II diabetes mellitus", "code" : "237599002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3521,7 +3526,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3545,7 +3549,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3567,9 +3570,8 @@ v: { "display" : "Gout", "code" : "90560007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3592,7 +3594,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3616,7 +3617,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3638,9 +3638,8 @@ v: { "display" : "Benign essential hypertension", "code" : "1201005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3663,7 +3662,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3687,7 +3685,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3709,9 +3706,8 @@ v: { "display" : "Anxiety disorder due to a general medical condition", "code" : "52910006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3734,7 +3730,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3758,7 +3753,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3780,9 +3774,8 @@ v: { "display" : "Fracture of neck of femur", "code" : "5913000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3805,7 +3798,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3829,7 +3821,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3851,9 +3842,8 @@ v: { "display" : "Product containing insulin glargine (medicinal product)", "code" : "126212009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3876,7 +3866,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3900,7 +3889,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#126212009' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -3941,7 +3929,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3963,9 +3950,8 @@ v: { "display" : "Subcutaneous route", "code" : "34206005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -3986,9 +3972,8 @@ v: { "display" : "Unit", "code" : "767525000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4010,9 +3995,8 @@ v: { "display" : "Product containing dulaglutide (medicinal product)", "code" : "714081009", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4035,7 +4019,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4059,7 +4042,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#714081009' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -4100,7 +4082,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4122,9 +4103,8 @@ v: { "display" : "Product containing metformin (medicinal product)", "code" : "109081006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4147,7 +4127,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4171,7 +4150,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#109081006' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -4212,7 +4190,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4234,9 +4211,8 @@ v: { "display" : "Oral route", "code" : "26643006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4257,9 +4233,8 @@ v: { "display" : "Tablet - unit of product usage (qualifier value)", "code" : "428673006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4281,9 +4256,8 @@ v: { "display" : "Product containing amlodipine (medicinal product)", "code" : "108537001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4306,7 +4280,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4330,7 +4303,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#108537001' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -4371,7 +4343,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4393,9 +4364,8 @@ v: { "display" : "Product containing losartan (medicinal product)", "code" : "96309000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4418,7 +4388,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4442,7 +4411,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#96309000' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -4483,7 +4451,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4505,9 +4472,8 @@ v: { "display" : "Product containing aspirin (medicinal product)", "code" : "7947003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4530,7 +4496,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4554,7 +4519,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#7947003' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -4595,7 +4559,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4617,9 +4580,8 @@ v: { "display" : "Product containing allopurinol (medicinal product)", "code" : "25246002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4642,7 +4604,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4666,7 +4627,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#25246002' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -4707,7 +4667,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4729,9 +4688,8 @@ v: { "display" : "Structure of left deltoid muscle", "code" : "16217701000119102", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4752,9 +4710,8 @@ v: { "display" : "Structure of left deltoid muscle", "code" : "16217701000119102", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4776,9 +4733,8 @@ v: { "display" : "Structure of left deltoid muscle", "code" : "16217701000119102", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4800,9 +4756,8 @@ v: { "display" : "Primary open reduction and internal fixation of proximal femoral fracture with screw/nail and plate device", "code" : "265132005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4825,7 +4780,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -4849,7 +4803,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#265132005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--1|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -4890,7 +4843,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#265132005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--2|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -4931,7 +4883,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#265132005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--3|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -4972,7 +4923,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#265132005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--4|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5013,7 +4963,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#265132005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--5|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5054,7 +5003,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#265132005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--6|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5095,7 +5043,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#265132005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--7|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5136,7 +5083,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#265132005' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--8|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5177,7 +5123,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5199,9 +5144,8 @@ v: { "display" : "Suturing of hand", "code" : "287903004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5224,7 +5168,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5248,7 +5191,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#287903004' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--1|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5289,7 +5231,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#287903004' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--2|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5330,7 +5271,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#287903004' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--3|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5371,7 +5311,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#287903004' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--4|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5412,7 +5351,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#287903004' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--5|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5453,7 +5391,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#287903004' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--6|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5494,7 +5431,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#287903004' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--7|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5535,7 +5471,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#287903004' was not found in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--8|1.1.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5576,7 +5511,6 @@ v: { "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230131", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5598,9 +5532,8 @@ v: { "display" : "Clinical pathologist", "code" : "81464008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5622,9 +5555,8 @@ v: { "display" : "Blood group A", "code" : "112144000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5646,9 +5578,8 @@ v: { "display" : "Positive", "code" : "10828004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5670,9 +5601,8 @@ v: { "display" : "Continuous haemodiafiltration", "code" : "233588003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5694,9 +5624,8 @@ v: { "display" : "Product containing precisely nystatin 100000 unit/1 milliliter conventional release oral suspension (clinical drug)", "code" : "324689003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5718,9 +5647,8 @@ v: { "display" : "Liveborn born in hospital", "code" : "442311008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5742,9 +5670,8 @@ v: { "display" : "Disease caused by 2019 novel coronavirus", "code" : "840539006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5769,7 +5696,6 @@ v: { "error" : "Wrong Display Name 'COVID-19' for http://snomed.info/sct#840535000. Valid display is one of 7 choices: 'Antibody to 2019 novel coronavirus', 'Antibody to 2019-nCoV', 'Antibody to severe acute respiratory syndrome coronavirus 2 (substance)', 'Antibody to severe acute respiratory syndrome coronavirus 2', 'Antibody to SARS-CoV-2', 'Severe acute respiratory syndrome coronavirus 2 Ab' or 'Severe acute respiratory syndrome coronavirus 2 antibody' (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5808,9 +5734,8 @@ v: { "display" : "Antibody to 2019 novel coronavirus", "code" : "840535000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5832,9 +5757,8 @@ v: { "display" : "Hospital admission", "code" : "32485007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5856,9 +5780,8 @@ v: { "display" : "Cecum", "code" : "32713005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5879,10 +5802,9 @@ v: { v: { "code" : "10821000202101", "severity" : "error", - "error" : "Unknown code '10821000202101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '10821000202101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5897,7 +5819,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '10821000202101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '10821000202101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -5924,7 +5846,6 @@ v: { "error" : "Wrong Display Name 'Diagnostisk med biopsi' for http://snomed.info/sct#446745002. Valid display is one of 2 choices: 'Colonoscopy and biopsy of colon (procedure)' or 'Colonoscopy and biopsy of colon' (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -5963,9 +5884,8 @@ v: { "display" : "Colonoscopy", "code" : "73761001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5986,10 +5906,9 @@ v: { v: { "code" : "8921000202108", "severity" : "error", - "error" : "Unknown code '8921000202108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '8921000202108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6004,7 +5923,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '8921000202108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '8921000202108' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -6027,10 +5946,9 @@ v: { v: { "code" : "8951000202101", "severity" : "error", - "error" : "Unknown code '8951000202101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '8951000202101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6045,7 +5963,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '8951000202101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '8951000202101' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -6069,9 +5987,8 @@ v: { "display" : "Finding of lesion", "code" : "300577008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6092,10 +6009,9 @@ v: { v: { "code" : "10291000202102", "severity" : "error", - "error" : "Unknown code '10291000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '10291000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6110,7 +6026,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '10291000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '10291000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -6134,9 +6050,8 @@ v: { "display" : "Boston bowel preparation scale", "code" : "722818007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6157,10 +6072,9 @@ v: { v: { "code" : "8901000202102", "severity" : "error", - "error" : "Unknown code '8901000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '8901000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6175,7 +6089,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '8901000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '8901000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -6199,9 +6113,8 @@ v: { "display" : "Portion of mucosa of the colon segment seen, but other areas of the colon segment are not well seen because of staining, residual stool, or opaque liquid, 1", "code" : "10291000132101", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6222,10 +6135,9 @@ v: { v: { "code" : "8911000202100", "severity" : "error", - "error" : "Unknown code '8911000202100' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '8911000202100' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6240,7 +6152,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '8911000202100' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '8911000202100' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -6264,9 +6176,8 @@ v: { "display" : "Minor amount of residual staining, small fragments of stool and/or opaque liquid, but mucosa of colon segment seen well (finding)", "code" : "10301000132102", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6287,10 +6198,9 @@ v: { v: { "code" : "8891000202103", "severity" : "error", - "error" : "Unknown code '8891000202103' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '8891000202103' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6305,7 +6215,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '8891000202103' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '8891000202103' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -6329,9 +6239,8 @@ v: { "display" : "Entire mucosa of colon segment seen well with no residual staining, small fragments of stool or opaque liquid (finding)", "code" : "10311000132100", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6352,9 +6261,8 @@ v: { "display" : "Number of lesions", "code" : "246206008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6375,10 +6283,9 @@ v: { v: { "code" : "15991000202102", "severity" : "error", - "error" : "Unknown code '15991000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '15991000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6393,7 +6300,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '15991000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '15991000202102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -6417,9 +6324,8 @@ v: { "display" : "Intestinal hemorrhage (disorder)", "code" : "712510007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6441,9 +6347,8 @@ v: { "display" : "Warfarin (substance)", "code" : "372756006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6465,9 +6370,8 @@ v: { "display" : "Aspirin (substance)", "code" : "387458008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6489,7 +6393,7 @@ v: { v: { "code" : "27113001", "severity" : "warning", - "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]", + "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]", "class" : "CODESYSTEM_UNSUPPORTED", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://snomed.info/sct|http://snomed.info/sct/900000000000207008/version/20210731", @@ -6507,7 +6411,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-found" }], - "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]" + "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]" }, "location" : ["CodeableConcept.coding[0].system"], "expression" : ["CodeableConcept.coding[0].system"] @@ -6531,7 +6435,7 @@ v: { v: { "code" : "38266002", "severity" : "warning", - "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]", + "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]", "class" : "CODESYSTEM_UNSUPPORTED", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://snomed.info/sct|http://snomed.info/sct/900000000000207008/version/20210731", @@ -6549,7 +6453,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-found" }], - "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]" + "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]" }, "location" : ["CodeableConcept.coding[0].system"], "expression" : ["CodeableConcept.coding[0].system"] @@ -6573,7 +6477,7 @@ v: { v: { "code" : "27113001", "severity" : "error", - "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]; Unable to check whether the code is in the value set 'https://fhir.kbv.de/ValueSet/KBV_VS_Base_Body_Weight_Snomed|1.2.1' because the code system http://snomed.info/sct|http://snomed.info/sct/900000000000207008/version/20210731 was not found", + "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]; Unable to check whether the code is in the value set 'https://fhir.kbv.de/ValueSet/KBV_VS_Base_Body_Weight_Snomed|1.2.1' because the code system http://snomed.info/sct|http://snomed.info/sct/900000000000207008/version/20210731 was not found", "class" : "CODESYSTEM_UNSUPPORTED", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://snomed.info/sct|http://snomed.info/sct/900000000000207008/version/20210731", @@ -6591,7 +6495,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-found" }], - "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]" + "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210731' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]" }, "location" : ["Coding.system"], "expression" : ["Coding.system"] @@ -6629,9 +6533,8 @@ v: { "display" : "Core body temperature", "code" : "276885007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6651,10 +6554,9 @@ v: { v: { "code" : "276885007x", "severity" : "error", - "error" : "Unknown code '276885007x' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '276885007x' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6669,7 +6571,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '276885007x' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '276885007x' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[1].code"], "expression" : ["CodeableConcept.coding[1].code"] @@ -6710,9 +6612,8 @@ v: { "display" : "Structure of left brachial artery (body structure)", "code" : "723961002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6734,10 +6635,9 @@ v: { "display" : "Golden retriever", "code" : "58108001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "inactive" : true, - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6756,6 +6656,40 @@ v: { }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '58108001' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '58108001' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] }] } @@ -6776,9 +6710,8 @@ v: { "display" : "Stool specimen", "code" : "119339001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6800,9 +6733,8 @@ v: { "display" : "Clostridium difficile", "code" : "5933001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6824,7 +6756,7 @@ v: { v: { "code" : "459231000124102", "severity" : "warning", - "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210331' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]", + "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210331' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]", "class" : "CODESYSTEM_UNSUPPORTED", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://snomed.info/sct|http://snomed.info/sct/900000000000207008/version/20210331", @@ -6842,7 +6774,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-found" }], - "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210331' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]" + "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20210331' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]" }, "location" : ["CodeableConcept.coding[0].system"], "expression" : ["CodeableConcept.coding[0].system"] @@ -6866,7 +6798,7 @@ v: { v: { "code" : "36989005", "severity" : "warning", - "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000146104/version/20220930' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]", + "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000146104/version/20220930' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]", "class" : "CODESYSTEM_UNSUPPORTED", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://snomed.info/sct|http://snomed.info/sct/11000146104/version/20220930", @@ -6884,7 +6816,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-found" }], - "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000146104/version/20220930' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]" + "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000146104/version/20220930' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]" }, "location" : ["CodeableConcept.coding[0].system"], "expression" : ["CodeableConcept.coding[0].system"] @@ -6911,7 +6843,6 @@ v: { "error" : "Wrong Display Name 'Paracetamol 500mg tablets' for http://snomed.info/sct#322236009. Valid display is one of 3 choices: 'Acetaminophen 500 mg oral tablet', 'Paracetamol 500 mg oral tablet' or 'Product containing precisely paracetamol 500 milligram/1 each conventional release oral tablet (clinical drug)' (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6949,10 +6880,9 @@ v: { v: { "code" : "35901911000001104", "severity" : "error", - "error" : "Unknown code '35901911000001104' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '35901911000001104' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -6967,7 +6897,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '35901911000001104' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '35901911000001104' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -6990,9 +6920,8 @@ v: { "display" : "cm3", "code" : "258773002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -7017,7 +6946,6 @@ v: { "error" : "Wrong Display Name 'Ibuprofen 200mg tablets' for http://snomed.info/sct#329652003. Valid display is one of 2 choices: 'Ibuprofen 200 mg oral tablet' or 'Product containing precisely ibuprofen 200 milligram/1 each conventional release oral tablet (clinical drug)' (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -7055,10 +6983,9 @@ v: { v: { "code" : "39695211000001102", "severity" : "error", - "error" : "Unknown code '39695211000001102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '39695211000001102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -7073,7 +7000,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '39695211000001102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '39695211000001102' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -7096,10 +7023,9 @@ v: { v: { "code" : "56248011000036107", "severity" : "error", - "error" : "Unknown code '56248011000036107' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '56248011000036107' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -7114,7 +7040,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '56248011000036107' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '56248011000036107' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] @@ -7136,10 +7062,9 @@ v: { v: { "code" : "1", "severity" : "error", - "error" : "Unknown code '1' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '1' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -7154,7 +7079,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '1' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '1' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["Coding.code"], "expression" : ["Coding.code"] @@ -7176,7 +7101,202 @@ v: { v: { "code" : "2", "severity" : "error", - "error" : "Unknown code '2' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'", + "error" : "Unknown code '2' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", + "class" : "UNKNOWN", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-code" + }], + "text" : "Unknown code '2' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "concept" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "concept", + "severity" : "error", + "error" : "Unknown code 'concept' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", + "class" : "UNKNOWN", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-code" + }], + "text" : "Unknown code 'concept' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-code" + }], + "text" : "Code concept is not a valid SNOMED CT Term, and neither could it be parsed as an expression (Concept not found (next char = \"c\", in \"concept\") at character 1)" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "1142143009" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Count of clinical drug type (attribute)", + "code" : "1142143009", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "something" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "something", + "severity" : "error", + "error" : "Unknown code 'something' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", + "class" : "UNKNOWN", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-code" + }], + "text" : "Unknown code 'something' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-code" + }], + "text" : "Code something is not a valid SNOMED CT Term, and neither could it be parsed as an expression (Concept not found (next char = \"s\", in \"something\") at character 1)" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "734137005" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Tributary of (attribute)", + "code" : "734137005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "1" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "1", + "severity" : "error", + "error" : "Unknown code '1' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", @@ -7194,7 +7314,47 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-code" }], - "text" : "Unknown code '2' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20230901'" + "text" : "Unknown code '1' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "2" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "2", + "severity" : "error", + "error" : "Unknown code '2' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'", + "class" : "UNKNOWN", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-code" + }], + "text" : "Unknown code '2' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, "location" : ["Coding.code"], "expression" : ["Coding.code"] diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/ucum.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/ucum.cache index 8a6894fe8..cb224f21c 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/ucum.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/ucum.cache @@ -33,7 +33,7 @@ v: { }] }}#### v: { - "display" : "percent", + "display" : "%", "code" : "%", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", @@ -276,7 +276,7 @@ v: { }] }}#### v: { - "display" : "millimeter of mercury", + "display" : "mm[Hg]", "code" : "mm[Hg]", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", @@ -483,7 +483,7 @@ v: { }] }}#### v: { - "display" : "millimeter of mercury", + "display" : "mm[Hg]", "code" : "mm[Hg]", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", @@ -823,7 +823,7 @@ v: { }] }}#### v: { - "display" : "millimeter of mercury", + "display" : "mm[Hg]", "code" : "mm[Hg]", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", @@ -1053,7 +1053,7 @@ v: { }] }}#### v: { - "display" : "kilogram", + "display" : "kg", "code" : "kg", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/uvsdcCodeSystemCSPHQ9.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/uvsdcCodeSystemCSPHQ9.cache index 736a96ff2..5e4ab1134 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/uvsdcCodeSystemCSPHQ9.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/uvsdcCodeSystemCSPHQ9.cache @@ -15,7 +15,6 @@ v: { "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", "version" : "3.0.0", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -53,7 +52,6 @@ v: { "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", "version" : "3.0.0", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -91,7 +89,6 @@ v: { "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", "version" : "3.0.0", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -123,6 +120,157 @@ v: { "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" }] }}#### +v: { + "display" : "Nearly every day", + "code" : "Nearly every day", + "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", + "version" : "3.0.0", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "business-rule", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "status-check" + }], + "text" : "Reference to draft CodeSystem http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9|3.0.0" + } + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", + "code" : "Not-at-all" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Not at all", + "code" : "Not-at-all", + "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", + "version" : "3.0.0", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "business-rule", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "status-check" + }], + "text" : "Reference to draft CodeSystem http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9|3.0.0" + } + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", + "code" : "Several-days" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Several days", + "code" : "Several-days", + "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", + "version" : "3.0.0", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "business-rule", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "status-check" + }], + "text" : "Reference to draft CodeSystem http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9|3.0.0" + } + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", + "code" : "More than half the days" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "More than half the days", + "code" : "More than half the days", + "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", + "version" : "3.0.0", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "business-rule", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "status-check" + }], + "text" : "Reference to draft CodeSystem http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9|3.0.0" + } + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/uv/sdc/CodeSystem/CSPHQ9", + "code" : "Nearly every day" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### v: { "display" : "Nearly every day", "code" : "Nearly every day", diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/vs-2a3253d9-d12e-45f3-877e-0dc2654b3904.json b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/vs-0ce1569f-f985-44cb-a5a0-9d205efd76b4.json similarity index 100% rename from org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/vs-2a3253d9-d12e-45f3-877e-0dc2654b3904.json rename to org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/vs-0ce1569f-f985-44cb-a5a0-9d205efd76b4.json diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/vs-externals.json b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/vs-externals.json index 09e1bcb13..d59141121 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/vs-externals.json +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/vs-externals.json @@ -1,12 +1,14 @@ { + "http://fhir.abda.de/eRezeptAbgabedaten/ValueSet/DAV-VS-ERP-DEUEV-Anlage-8" : null, "http://loinc.org/vs/LL378-1" : null, "http://www.rfc-editor.org/bcp/bcp13.txt" : null, "http://loinc.org/vs/LL1971-2" : null, "http://fhir.ch/ig/ch-ig/ValueSet/ch-ig-example" : null, "http://hl7.org/fhir/us/qicore/ValueSet/qicore-negation-reason" : null, + "http://hl7.org/fhir/smart-app-launch/ValueSet/user-access-category" : null, "https://healthterminologies.gov.au/fhir/ValueSet/australian-immunisation-register-vaccine-1" : { "server" : "https://tx.ontoserver.csiro.au/fhir", - "filename" : "vs-2a3253d9-d12e-45f3-877e-0dc2654b3904.json" + "filename" : "vs-0ce1569f-f985-44cb-a5a0-9d205efd76b4.json" }, "http://fhir.ch/ig/ch-ig/ValueSet/OrganizationType" : null, "http://loinc.org/vs/LL4048-6" : null, diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.3.0/.terminologyCapabilities.tx-dev.fhir.org.r4.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.3.0/.terminologyCapabilities.tx-dev.fhir.org.r4.cache index 73b61681a..fadf43147 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.3.0/.terminologyCapabilities.tx-dev.fhir.org.r4.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.3.0/.terminologyCapabilities.tx-dev.fhir.org.r4.cache @@ -5,7 +5,7 @@ "version" : "2.0.0", "name" : "FHIR Reference Server Teminology Capability Statement", "status" : "active", - "date" : "2024-01-19T08:47:00.781Z", + "date" : "2024-03-06T00:57:55.202Z", "contact" : [{ "telecom" : [{ "system" : "other", @@ -14,6 +14,9 @@ }], "description" : "Standard Teminology Capability Statement for the open source Reference FHIR Server provided by Health Intersections", "codeSystem" : [{ + "uri" : "http://cap.org/eCP" + }, + { "uri" : "http://cds-hooks.hl7.org/CodeSystem/indicator" }, { @@ -841,9 +844,6 @@ { "uri" : "http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type" }, - { - "uri" : "http://hl7.org/fhir/us/core/CodeSystem/us-core-sex-for-clinical-use" - }, { "uri" : "http://hl7.org/fhir/uv/sdc/CodeSystem/assemble-expectation" }, @@ -889,6 +889,9 @@ { "uri" : "http://loinc.org" }, + { + "uri" : "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl" + }, { "uri" : "http://nucc.org/provider-taxonomy" }, @@ -988,6 +991,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/catalogType" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/cdshooks-indicator" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/certainty-rating" }, @@ -1300,6 +1306,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/hl7-work-group" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/icd-o-3" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status" }, @@ -1348,6 +1357,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/match-grade" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/measure-aggregate-method" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/measure-data-usage" }, @@ -1360,6 +1372,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/measure-scoring" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/measure-supplemental-data" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/measure-type" }, @@ -1567,6 +1582,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/service-type" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/sex-parameter-for-clinical-use" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/smart-capabilities" }, @@ -3562,12 +3580,24 @@ { "uri" : "http://www.ama-assn.org/go/cpt" }, + { + "uri" : "http://www.cms.gov/Medicare/Coding/ICD10" + }, { "uri" : "http://www.nlm.nih.gov/research/umls/rxnorm" }, { "uri" : "http://www.whocc.no/atc" }, + { + "uri" : "https://nahdo.org/sopt" + }, + { + "uri" : "https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/cdcnhsn.html" + }, + { + "uri" : "https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/hsloc.html" + }, { "uri" : "https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding" }, @@ -3615,6 +3645,9 @@ }, { "uri" : "urn:oid:2.16.840.1.113883.3.1937.98.5.8" + }, + { + "uri" : "urn:oid:2.16.840.1.113883.6.238" }], "expansion" : { "parameter" : [{ diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/.terminologyCapabilities.tx-dev.fhir.org.r4.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/.terminologyCapabilities.tx-dev.fhir.org.r4.cache index 94cf2c448..0ec80c1ed 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/.terminologyCapabilities.tx-dev.fhir.org.r4.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/.terminologyCapabilities.tx-dev.fhir.org.r4.cache @@ -5,7 +5,7 @@ "version" : "2.0.0", "name" : "FHIR Reference Server Teminology Capability Statement", "status" : "active", - "date" : "2024-01-19T08:46:30.969Z", + "date" : "2024-03-06T00:57:18.452Z", "contact" : [{ "telecom" : [{ "system" : "other", @@ -14,6 +14,9 @@ }], "description" : "Standard Teminology Capability Statement for the open source Reference FHIR Server provided by Health Intersections", "codeSystem" : [{ + "uri" : "http://cap.org/eCP" + }, + { "uri" : "http://cds-hooks.hl7.org/CodeSystem/indicator" }, { @@ -841,9 +844,6 @@ { "uri" : "http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type" }, - { - "uri" : "http://hl7.org/fhir/us/core/CodeSystem/us-core-sex-for-clinical-use" - }, { "uri" : "http://hl7.org/fhir/uv/sdc/CodeSystem/assemble-expectation" }, @@ -889,6 +889,9 @@ { "uri" : "http://loinc.org" }, + { + "uri" : "http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl" + }, { "uri" : "http://nucc.org/provider-taxonomy" }, @@ -988,6 +991,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/catalogType" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/cdshooks-indicator" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/certainty-rating" }, @@ -1300,6 +1306,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/hl7-work-group" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/icd-o-3" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status" }, @@ -1348,6 +1357,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/match-grade" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/measure-aggregate-method" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/measure-data-usage" }, @@ -1360,6 +1372,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/measure-scoring" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/measure-supplemental-data" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/measure-type" }, @@ -1567,6 +1582,9 @@ { "uri" : "http://terminology.hl7.org/CodeSystem/service-type" }, + { + "uri" : "http://terminology.hl7.org/CodeSystem/sex-parameter-for-clinical-use" + }, { "uri" : "http://terminology.hl7.org/CodeSystem/smart-capabilities" }, @@ -3562,12 +3580,24 @@ { "uri" : "http://www.ama-assn.org/go/cpt" }, + { + "uri" : "http://www.cms.gov/Medicare/Coding/ICD10" + }, { "uri" : "http://www.nlm.nih.gov/research/umls/rxnorm" }, { "uri" : "http://www.whocc.no/atc" }, + { + "uri" : "https://nahdo.org/sopt" + }, + { + "uri" : "https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/cdcnhsn.html" + }, + { + "uri" : "https://www.cdc.gov/nhsn/cdaportal/terminology/codesystem/hsloc.html" + }, { "uri" : "https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/HospitalAcqCond/Coding" }, @@ -3615,6 +3645,9 @@ }, { "uri" : "urn:oid:2.16.840.1.113883.3.1937.98.5.8" + }, + { + "uri" : "urn:oid:2.16.840.1.113883.6.238" }], "expansion" : { "parameter" : [{ diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/all-systems.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/all-systems.cache index ffcf94bf3..bb3fcd4f1 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/all-systems.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/all-systems.cache @@ -13,7 +13,7 @@ v: { "code" : "internal-label", "severity" : "error", "error" : "A definition for CodeSystem 'http://acme.com/config/fhir/codesystems/internal' could not be found, so the code cannot be validated; The provided code 'http://acme.com/config/fhir/codesystems/internal#internal-label' was not found in the value set 'http://hl7.org/fhir/ValueSet/designation-use|5.0.0'", - "class" : "CODESYSTEM_UNSUPPORTED", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://acme.com/config/fhir/codesystems/internal", "issues" : { @@ -128,7 +128,7 @@ v: { }] }}#### v: { - "display" : "French (Canada)", + "display" : "French (Region=Canada)", "code" : "fr-CA", "system" : "urn:ietf:bcp:47", "server" : "http://tx-dev.fhir.org/r4", @@ -189,7 +189,7 @@ v: { }] }}#### v: { - "display" : "day", + "display" : "d", "code" : "d", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", @@ -198,6 +198,34 @@ v: { "resourceType" : "OperationOutcome" } +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "text/plain" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "text/plain", + "code" : "text/plain", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + } ------------------------------------------------------------------------------------- {"code" : { @@ -261,6 +289,34 @@ v: { }] } +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "json" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "json", + "code" : "json", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + } ------------------------------------------------------------------------------------- {"code" : { @@ -282,6 +338,55 @@ v: { "resourceType" : "OperationOutcome" } +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "en-US" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:47" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "English (Region=United States)", + "code" : "en-US", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "en-US" +}, "url": "http://hl7.org/fhir/ValueSet/all-languages", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "English (Region=United States)", + "code" : "en-US", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + } ------------------------------------------------------------------------------------- {"code" : { @@ -319,6 +424,34 @@ v: { }] } +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "nl-NL" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:47" + }] + } +}, "langs":"nl-NL", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Dutch (Region=Netherlands)", + "code" : "nl-NL", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + } ------------------------------------------------------------------------------------- {"code" : { @@ -340,6 +473,83 @@ v: { "resourceType" : "OperationOutcome" } +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "image/gif" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:13" + }] + } +}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "image/gif", + "code" : "image/gif", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "image/gif" +}, "url": "http://hl7.org/fhir/ValueSet/mimetypes", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "image/gif", + "code" : "image/gif", + "system" : "urn:ietf:bcp:13", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "en-AU" +}, "valueSet" :{ + "resourceType" : "ValueSet", + "compose" : { + "include" : [{ + "system" : "urn:ietf:bcp:47" + }] + } +}, "langs":"en-AU", "useServer":"true", "useClient":"false", "guessSystem":"true", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "English (Region=Australia)", + "code" : "en-AU", + "system" : "urn:ietf:bcp:47", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + } ------------------------------------------------------------------------------------- {"code" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/dicom.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/dicom.cache index d336e0052..28c58a9fa 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/dicom.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/dicom.cache @@ -14,7 +14,7 @@ v: { "display" : "Login", "code" : "110122", "system" : "http://dicom.nema.org/resources/ontology/DCM", - "version" : "2023.1.20230123", + "version" : "2024.1.20240120", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/http___test.org.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/http___test.org.cache index 84d1e99d9..3272f0e81 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/http___test.org.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/http___test.org.cache @@ -13,7 +13,7 @@ v: { "code" : "x", "severity" : "error", "error" : "A definition for CodeSystem 'http://test.org' could not be found, so the code cannot be validated; The provided code 'http://test.org#x' was not found in the value set 'http://hl7.org/fhir/ValueSet/security-labels|5.0.0'", - "class" : "CODESYSTEM_UNSUPPORTED", + "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://test.org", "issues" : { @@ -71,3 +71,75 @@ v: { } ------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://test.org", + "code" : "y" +}, "url": "http://hl7.org/fhir/ValueSet/security-labels", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "y", + "severity" : "error", + "error" : "A definition for CodeSystem 'http://test.org' could not be found, so the code cannot be validated; The provided code 'http://test.org#y' was not found in the value set 'http://hl7.org/fhir/ValueSet/security-labels|5.0.0'", + "class" : "UNKNOWN", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "http://test.org", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "business-rule", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "status-check" + }], + "text" : "Reference to retired ValueSet http://terminology.hl7.org/ValueSet/v3-ActUSPrivacyLaw|2.0.0" + } + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "not-found", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "not-found" + }], + "text" : "A definition for CodeSystem 'http://test.org' could not be found, so the code cannot be validated" + }, + "location" : ["Coding.system"], + "expression" : ["Coding.system"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "error", + "code" : "code-invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "not-in-vs" + }], + "text" : "The provided code 'http://test.org#y' was not found in the value set 'http://hl7.org/fhir/ValueSet/security-labels|5.0.0'" + }, + "location" : ["Coding.code"], + "expression" : ["Coding.code"] + }] +} + +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/loinc.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/loinc.cache index 8efdcbfad..614b640cb 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/loinc.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/loinc.cache @@ -1,4 +1,692 @@ ------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "85354-9", + "display" : "Blood pressure panel with all children optional" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Blood pressure panel with all children optional", + "code" : "85354-9", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8480-6", + "display" : "Systolic blood pressure" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Systolic blood pressure", + "code" : "8480-6", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8462-4", + "display" : "Diastolic blood pressure" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Diastolic blood pressure", + "code" : "8462-4", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "85354-9" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Blood pressure panel with all children optional", + "code" : "85354-9", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "85354-9", + "display" : "Blood pressure panel with all children optional" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Blood pressure panel with all children optional", + "code" : "85354-9", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8480-6" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Systolic blood pressure", + "code" : "8480-6", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8480-6", + "display" : "Systolic blood pressure" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Systolic blood pressure", + "code" : "8480-6", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8462-4" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Diastolic blood pressure", + "code" : "8462-4", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8462-4", + "display" : "Diastolic blood pressure" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Diastolic blood pressure", + "code" : "8462-4", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "version" : "2.74", + "code" : "56445-0", + "display" : "Medication summary Doc" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Medication summary Document", + "code" : "56445-0", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "56445-0" +}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Medication summary Document", + "code" : "56445-0", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "version" : "2.74", + "code" : "56445-0", + "display" : "Medication summary Doc" +}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Medication summary Document", + "code" : "56445-0", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "version" : "2.74", + "code" : "48765-2", + "display" : "Allergies and adverse reactions" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Allergies and adverse reactions Document", + "code" : "48765-2", + "severity" : "error", + "error" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", + "class" : "UNKNOWN", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://local.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "version" : "current", + "code" : "56445-0", + "display" : "Medication summary Doc" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Medication summary Document", + "code" : "56445-0", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "56445-0" +}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Medication summary Document", + "code" : "56445-0", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "version" : "current", + "code" : "56445-0", + "display" : "Medication summary Doc" +}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Medication summary Document", + "code" : "56445-0", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "version" : "current", + "code" : "48765-2", + "display" : "Allergies and adverse reactions" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Allergies and adverse reactions Document", + "code" : "48765-2", + "severity" : "error", + "error" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", + "class" : "UNKNOWN", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://local.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc' (en-US), '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "3151-8", + "display" : "ingeademde O2" +}, "valueSet" :null, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Inhaled O2 flow rate", + "code" : "3151-8", + "severity" : "error", + "error" : "Wrong Display Name 'ingeademde O2' for http://loinc.org#3151-8. Valid display is one of 2 choices: 'Inhaled oxygen flow rate' or 'Inhaled O2 flow rate' (en-US) (for the language(s) 'en')", + "class" : "UNKNOWN", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://local.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'ingeademde O2' for http://loinc.org#3151-8. Valid display is one of 2 choices: 'Inhaled oxygen flow rate' or 'Inhaled O2 flow rate' (en-US) (for the language(s) 'en')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "3151-8", + "display" : "ingeademde O2" +}, "valueSet" :null, "langs":"nl-NL", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "ingeademde O2", + "code" : "3151-8", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "35200-5", + "display" : "Cholesterol [Moles/​volume] in Serum or Plasma" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Cholesterol [Mass or Moles/volume] in Serum or Plasma", + "code" : "35200-5", + "severity" : "error", + "error" : "Wrong Display Name 'Cholesterol [Moles/​volume] in Serum or Plasma' for http://loinc.org#35200-5. Valid display is one of 50 choices: 'Cholesterol [Mass or Moles/volume] in Serum or Plasma', 'Cholest SerPl-msCnc' (en-US), '化学' (zh-CN), '化学检验项目' (zh-CN), '化学检验项目类' (zh-CN), '化学类' (zh-CN), '化学试验' (zh-CN), '非刺激耐受型化学检验项目' (zh-CN), '非刺激耐受型化学检验项目类' (zh-CN), '非刺激耐受型化学试验' (zh-CN), '非刺激耐受型化学试验类 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 总胆固醇' (zh-CN), '胆固醇总计' (zh-CN), '胆甾醇' (zh-CN), '脂类' (zh-CN), '脂质 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 血清或血浆 质量或摩尔浓度' (zh-CN), '质量或摩尔浓度(单位体积)' (zh-CN), '质量或物质的量浓度(单位体积)' (zh-CN), 'Juhuslik Kvantitatiivne Plasma Seerum Seerum või plasma' (et-EE), 'Cholest' (pt-BR), 'Chol' (pt-BR), 'Choles' (pt-BR), 'Lipid' (pt-BR), 'Cholesterol total' (pt-BR), 'Cholesterols' (pt-BR), 'Level' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'SerPl' (pt-BR), 'SerPlas' (pt-BR), 'SerP' (pt-BR), 'Serum' (pt-BR), 'SR' (pt-BR), 'Plasma' (pt-BR), 'Pl' (pt-BR), 'Plsm' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Chemistry' (pt-BR), 'Chimica Concentrazione Sostanza o Massa Plasma Punto nel tempo (episodio) Siero Siero o Plasma' (it-IT), 'Количественный Массовая или Молярная Концентрация Плазма Сыворотка Сыворотка или Плазма Точка во времени' (ru-RU) or 'Момент Холестерин' (ru-RU) (for the language(s) '--')", + "class" : "UNKNOWN", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://local.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'Cholesterol [Moles/​volume] in Serum or Plasma' for http://loinc.org#35200-5. Valid display is one of 50 choices: 'Cholesterol [Mass or Moles/volume] in Serum or Plasma', 'Cholest SerPl-msCnc' (en-US), '化学' (zh-CN), '化学检验项目' (zh-CN), '化学检验项目类' (zh-CN), '化学类' (zh-CN), '化学试验' (zh-CN), '非刺激耐受型化学检验项目' (zh-CN), '非刺激耐受型化学检验项目类' (zh-CN), '非刺激耐受型化学试验' (zh-CN), '非刺激耐受型化学试验类 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 总胆固醇' (zh-CN), '胆固醇总计' (zh-CN), '胆甾醇' (zh-CN), '脂类' (zh-CN), '脂质 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 血清或血浆 质量或摩尔浓度' (zh-CN), '质量或摩尔浓度(单位体积)' (zh-CN), '质量或物质的量浓度(单位体积)' (zh-CN), 'Juhuslik Kvantitatiivne Plasma Seerum Seerum või plasma' (et-EE), 'Cholest' (pt-BR), 'Chol' (pt-BR), 'Choles' (pt-BR), 'Lipid' (pt-BR), 'Cholesterol total' (pt-BR), 'Cholesterols' (pt-BR), 'Level' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'SerPl' (pt-BR), 'SerPlas' (pt-BR), 'SerP' (pt-BR), 'Serum' (pt-BR), 'SR' (pt-BR), 'Plasma' (pt-BR), 'Pl' (pt-BR), 'Plsm' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Chemistry' (pt-BR), 'Chimica Concentrazione Sostanza o Massa Plasma Punto nel tempo (episodio) Siero Siero o Plasma' (it-IT), 'Количественный Массовая или Молярная Концентрация Плазма Сыворотка Сыворотка или Плазма Точка во времени' (ru-RU) or 'Момент Холестерин' (ru-RU) (for the language(s) '--')" + }, + "location" : ["CodeableConcept.coding[0].display"], + "expression" : ["CodeableConcept.coding[0].display"] + }] +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "13457-7", + "display" : "Cholesterol in LDL [Mass/volume] in Serum or Plasma by calculation" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Cholesterol in LDL [Mass/volume] in Serum or Plasma by calculation", + "code" : "13457-7", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "29463-7", + "display" : "Body Weight" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Body weight", + "code" : "29463-7", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "29463-7" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Body weight", + "code" : "29463-7", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "29463-7", + "display" : "Body Weight" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Body weight", + "code" : "29463-7", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "35200-5", + "display" : "Cholest SerPl-msCnc" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Cholesterol [Mass or Moles/volume] in Serum or Plasma", + "code" : "35200-5", + "system" : "http://loinc.org", + "version" : "2.74", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "35217-9", + "display" : "Triglyceride [Moles/​volume] in Serum or Plasma" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Triglyceride [Mass or Moles/volume] in Serum or Plasma", + "code" : "35217-9", + "severity" : "error", + "error" : "Wrong Display Name 'Triglyceride [Moles/​volume] in Serum or Plasma' for http://loinc.org#35217-9. Valid display is one of 50 choices: 'Triglyceride [Mass or Moles/volume] in Serum or Plasma', 'Trigl SerPl-msCnc' (en-US), 'TG' (zh-CN), 'Trigly' (zh-CN), '甘油三脂' (zh-CN), '甘油三酸酯' (zh-CN), '三酸甘油酯' (zh-CN), '甘油三酸脂' (zh-CN), '三酸甘油脂 化学' (zh-CN), '化学检验项目' (zh-CN), '化学检验项目类' (zh-CN), '化学类' (zh-CN), '化学试验' (zh-CN), '非刺激耐受型化学检验项目' (zh-CN), '非刺激耐受型化学检验项目类' (zh-CN), '非刺激耐受型化学试验' (zh-CN), '非刺激耐受型化学试验类 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 血清或血浆 质量或摩尔浓度' (zh-CN), '质量或摩尔浓度(单位体积)' (zh-CN), '质量或物质的量浓度(单位体积)' (zh-CN), 'Juhuslik Kvantitatiivne Plasma Seerum Seerum või plasma' (et-EE), 'Trigl' (pt-BR), 'Triglycrides' (pt-BR), 'Trig' (pt-BR), 'Triglycerides' (pt-BR), 'Level' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'SerPl' (pt-BR), 'SerPlas' (pt-BR), 'SerP' (pt-BR), 'Serum' (pt-BR), 'SR' (pt-BR), 'Plasma' (pt-BR), 'Pl' (pt-BR), 'Plsm' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Chemistry' (pt-BR), 'Chimica Concentrazione Sostanza o Massa Plasma Punto nel tempo (episodio) Siero Siero o Plasma' (it-IT), 'Количественный Массовая или Молярная Концентрация Плазма Сыворотка Сыворотка или Плазма Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", + "class" : "UNKNOWN", + "server" : "http://local.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome", + "issue" : [{ + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://local.fhir.org/r4" + }], + "severity" : "error", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "invalid-display" + }], + "text" : "Wrong Display Name 'Triglyceride [Moles/​volume] in Serum or Plasma' for http://loinc.org#35217-9. Valid display is one of 50 choices: 'Triglyceride [Mass or Moles/volume] in Serum or Plasma', 'Trigl SerPl-msCnc' (en-US), 'TG' (zh-CN), 'Trigly' (zh-CN), '甘油三脂' (zh-CN), '甘油三酸酯' (zh-CN), '三酸甘油酯' (zh-CN), '甘油三酸脂' (zh-CN), '三酸甘油脂 化学' (zh-CN), '化学检验项目' (zh-CN), '化学检验项目类' (zh-CN), '化学类' (zh-CN), '化学试验' (zh-CN), '非刺激耐受型化学检验项目' (zh-CN), '非刺激耐受型化学检验项目类' (zh-CN), '非刺激耐受型化学试验' (zh-CN), '非刺激耐受型化学试验类 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 血清或血浆 质量或摩尔浓度' (zh-CN), '质量或摩尔浓度(单位体积)' (zh-CN), '质量或物质的量浓度(单位体积)' (zh-CN), 'Juhuslik Kvantitatiivne Plasma Seerum Seerum või plasma' (et-EE), 'Trigl' (pt-BR), 'Triglycrides' (pt-BR), 'Trig' (pt-BR), 'Triglycerides' (pt-BR), 'Level' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'SerPl' (pt-BR), 'SerPlas' (pt-BR), 'SerP' (pt-BR), 'Serum' (pt-BR), 'SR' (pt-BR), 'Plasma' (pt-BR), 'Pl' (pt-BR), 'Plsm' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Chemistry' (pt-BR), 'Chimica Concentrazione Sostanza o Massa Plasma Punto nel tempo (episodio) Siero Siero o Plasma' (it-IT), 'Количественный Массовая или Молярная Концентрация Плазма Сыворотка Сыворотка или Плазма Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" + }, + "location" : ["Coding.display"], + "expression" : ["Coding.display"] + }] +} + +} +------------------------------------------------------------------------------------- {"code" : { "system" : "http://loinc.org", "code" : "29463-7", @@ -255,7 +943,7 @@ v: { "display" : "Active motion", "code" : "LA6715-2", "severity" : "error", - "error" : "Wrong whitespace in Display Name 'Active motion ' for http://loinc.org#LA6715-2. Valid display is 'Active motion' (for the language(s) '--')", + "error" : "Wrong whitespace in Display Name 'Active motion ' for http://loinc.org#LA6715-2. Valid display is 'Active motion' (en-US) (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "issues" : { @@ -272,7 +960,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong whitespace in Display Name 'Active motion ' for http://loinc.org#LA6715-2. Valid display is 'Active motion' (for the language(s) '--')" + "text" : "Wrong whitespace in Display Name 'Active motion ' for http://loinc.org#LA6715-2. Valid display is 'Active motion' (en-US) (for the language(s) '--')" }, "location" : ["CodeableConcept.coding[0].display"], "expression" : ["CodeableConcept.coding[0].display"] @@ -296,7 +984,7 @@ v: { "display" : "Good, strong cry; normal rate and effort of breathing", "code" : "LA6727-7", "severity" : "error", - "error" : "Wrong whitespace in Display Name 'Good, strong cry; normal rate and effort of breathing ' for http://loinc.org#LA6727-7. Valid display is 'Good, strong cry; normal rate and effort of breathing' (for the language(s) '--')", + "error" : "Wrong whitespace in Display Name 'Good, strong cry; normal rate and effort of breathing ' for http://loinc.org#LA6727-7. Valid display is 'Good, strong cry; normal rate and effort of breathing' (en-US) (for the language(s) '--')", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "issues" : { @@ -313,7 +1001,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "invalid-display" }], - "text" : "Wrong whitespace in Display Name 'Good, strong cry; normal rate and effort of breathing ' for http://loinc.org#LA6727-7. Valid display is 'Good, strong cry; normal rate and effort of breathing' (for the language(s) '--')" + "text" : "Wrong whitespace in Display Name 'Good, strong cry; normal rate and effort of breathing ' for http://loinc.org#LA6727-7. Valid display is 'Good, strong cry; normal rate and effort of breathing' (en-US) (for the language(s) '--')" }, "location" : ["Coding.display"], "expression" : ["Coding.display"] @@ -324,9 +1012,8 @@ v: { ------------------------------------------------------------------------------------- {"code" : { "system" : "http://loinc.org", - "code" : "85354-9", - "display" : "Blood pressure panel with all children optional" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "code" : "LP43571-6" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { "resourceType" : "Parameters", "parameter" : [{ "name" : "profile-url", @@ -334,297 +1021,9 @@ v: { }] }}#### v: { - "display" : "Blood pressure panel with all children optional", - "code" : "85354-9", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "8480-6", - "display" : "Systolic blood pressure" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Systolic blood pressure", - "code" : "8480-6", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "8462-4", - "display" : "Diastolic blood pressure" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Diastolic blood pressure", - "code" : "8462-4", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "85354-9" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Blood pressure panel with all children optional", - "code" : "85354-9", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "85354-9", - "display" : "Blood pressure panel with all children optional" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Blood pressure panel with all children optional", - "code" : "85354-9", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "8480-6" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Systolic blood pressure", - "code" : "8480-6", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "8480-6", - "display" : "Systolic blood pressure" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Systolic blood pressure", - "code" : "8480-6", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "8462-4" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Diastolic blood pressure", - "code" : "8462-4", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "8462-4", - "display" : "Diastolic blood pressure" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Diastolic blood pressure", - "code" : "8462-4", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "version" : "2.74", - "code" : "56445-0", - "display" : "Medication summary Doc" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Medication summary Document", - "code" : "56445-0", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "56445-0" -}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Medication summary Document", - "code" : "56445-0", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "version" : "2.74", - "code" : "56445-0", - "display" : "Medication summary Doc" -}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Medication summary Document", - "code" : "56445-0", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "version" : "2.74", - "code" : "48765-2", - "display" : "Allergies and adverse reactions" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Allergies and adverse reactions Document", - "code" : "48765-2", + "code" : "LP43571-6", "severity" : "error", - "error" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", + "error" : "Unknown code 'LP43571-6' in the CodeSystem 'http://loinc.org' version '2.77'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", @@ -636,401 +1035,16 @@ v: { "valueUrl" : "http://tx-dev.fhir.org/r4" }], "severity" : "error", - "code" : "invalid", + "code" : "code-invalid", "details" : { "coding" : [{ "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "invalid-display" + "code" : "invalid-code" }], - "text" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" + "text" : "Unknown code 'LP43571-6' in the CodeSystem 'http://loinc.org' version '2.77'" }, - "location" : ["CodeableConcept.coding[0].display"], - "expression" : ["CodeableConcept.coding[0].display"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "version" : "current", - "code" : "56445-0", - "display" : "Medication summary Doc" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Medication summary Document", - "code" : "56445-0", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "56445-0" -}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Medication summary Document", - "code" : "56445-0", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "version" : "current", - "code" : "56445-0", - "display" : "Medication summary Doc" -}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Medication summary Document", - "code" : "56445-0", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "version" : "current", - "code" : "48765-2", - "display" : "Allergies and adverse reactions" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Allergies and adverse reactions Document", - "code" : "48765-2", - "severity" : "error", - "error" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "invalid-display" - }], - "text" : "Wrong Display Name 'Allergies and adverse reactions' for http://loinc.org#48765-2. Valid display is one of 28 choices: 'Allergies and adverse reactions Document', 'Allergies &or adverse reactions Doc', '临床文档型' (zh-CN), '临床文档' (zh-CN), '文档' (zh-CN), '文书' (zh-CN), '医疗文书' (zh-CN), '临床医疗文书 医疗服务对象' (zh-CN), '客户' (zh-CN), '病人' (zh-CN), '病患' (zh-CN), '病号' (zh-CN), '超系统 - 病人 发现是一个原子型临床观察指标,并不是作为印象的概括陈述。体格检查、病史、系统检查及其他此类观察指标的属性均为发现。它们的标尺对于编码型发现可能是名义型,而对于叙述型文本之中所报告的发现,则可能是叙述型。' (zh-CN), '发现物' (zh-CN), '所见' (zh-CN), '结果' (zh-CN), '结论 变态反应与不良反应 文档.其他' (zh-CN), '杂项类文档' (zh-CN), '其他文档 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 杂项' (zh-CN), '杂项类' (zh-CN), '杂项试验 过敏反应' (zh-CN), '过敏' (zh-CN), 'Allergie e reazioni avverse Documentazione miscellanea Miscellanea Osservazione paziente Punto nel tempo (episodio)' (it-IT), 'Документ Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" - }, - "location" : ["CodeableConcept.coding[0].display"], - "expression" : ["CodeableConcept.coding[0].display"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "3151-8", - "display" : "ingeademde O2" -}, "valueSet" :null, "langs":"en", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Inhaled oxygen flow rate", - "code" : "3151-8", - "severity" : "error", - "error" : "Wrong Display Name 'ingeademde O2' for http://loinc.org#3151-8. Valid display is one of 2 choices: 'Inhaled oxygen flow rate' or 'Inhaled O2 flow rate' (for the language(s) 'en')", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "invalid-display" - }], - "text" : "Wrong Display Name 'ingeademde O2' for http://loinc.org#3151-8. Valid display is one of 2 choices: 'Inhaled oxygen flow rate' or 'Inhaled O2 flow rate' (for the language(s) 'en')" - }, - "location" : ["CodeableConcept.coding[0].display"], - "expression" : ["CodeableConcept.coding[0].display"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "3151-8", - "display" : "ingeademde O2" -}, "valueSet" :null, "langs":"nl-NL", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "ingeademde O2", - "code" : "3151-8", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "35200-5", - "display" : "Cholesterol [Moles/​volume] in Serum or Plasma" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Cholesterol [Mass or Moles/volume] in Serum or Plasma", - "code" : "35200-5", - "severity" : "error", - "error" : "Wrong Display Name 'Cholesterol [Moles/​volume] in Serum or Plasma' for http://loinc.org#35200-5. Valid display is one of 50 choices: 'Cholesterol [Mass or Moles/volume] in Serum or Plasma', 'Cholest SerPl-msCnc', '化学' (zh-CN), '化学检验项目' (zh-CN), '化学检验项目类' (zh-CN), '化学类' (zh-CN), '化学试验' (zh-CN), '非刺激耐受型化学检验项目' (zh-CN), '非刺激耐受型化学检验项目类' (zh-CN), '非刺激耐受型化学试验' (zh-CN), '非刺激耐受型化学试验类 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 总胆固醇' (zh-CN), '胆固醇总计' (zh-CN), '胆甾醇' (zh-CN), '脂类' (zh-CN), '脂质 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 血清或血浆 质量或摩尔浓度' (zh-CN), '质量或摩尔浓度(单位体积)' (zh-CN), '质量或物质的量浓度(单位体积)' (zh-CN), 'Juhuslik Kvantitatiivne Plasma Seerum Seerum või plasma' (et-EE), 'Cholest' (pt-BR), 'Chol' (pt-BR), 'Choles' (pt-BR), 'Lipid' (pt-BR), 'Cholesterol total' (pt-BR), 'Cholesterols' (pt-BR), 'Level' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'SerPl' (pt-BR), 'SerPlas' (pt-BR), 'SerP' (pt-BR), 'Serum' (pt-BR), 'SR' (pt-BR), 'Plasma' (pt-BR), 'Pl' (pt-BR), 'Plsm' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Chemistry' (pt-BR), 'Chimica Concentrazione Sostanza o Massa Plasma Punto nel tempo (episodio) Siero Siero o Plasma' (it-IT), 'Количественный Массовая или Молярная Концентрация Плазма Сыворотка Сыворотка или Плазма Точка во времени' (ru-RU) or 'Момент Холестерин' (ru-RU) (for the language(s) '--')", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "invalid-display" - }], - "text" : "Wrong Display Name 'Cholesterol [Moles/​volume] in Serum or Plasma' for http://loinc.org#35200-5. Valid display is one of 50 choices: 'Cholesterol [Mass or Moles/volume] in Serum or Plasma', 'Cholest SerPl-msCnc', '化学' (zh-CN), '化学检验项目' (zh-CN), '化学检验项目类' (zh-CN), '化学类' (zh-CN), '化学试验' (zh-CN), '非刺激耐受型化学检验项目' (zh-CN), '非刺激耐受型化学检验项目类' (zh-CN), '非刺激耐受型化学试验' (zh-CN), '非刺激耐受型化学试验类 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 总胆固醇' (zh-CN), '胆固醇总计' (zh-CN), '胆甾醇' (zh-CN), '脂类' (zh-CN), '脂质 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 血清或血浆 质量或摩尔浓度' (zh-CN), '质量或摩尔浓度(单位体积)' (zh-CN), '质量或物质的量浓度(单位体积)' (zh-CN), 'Juhuslik Kvantitatiivne Plasma Seerum Seerum või plasma' (et-EE), 'Cholest' (pt-BR), 'Chol' (pt-BR), 'Choles' (pt-BR), 'Lipid' (pt-BR), 'Cholesterol total' (pt-BR), 'Cholesterols' (pt-BR), 'Level' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'SerPl' (pt-BR), 'SerPlas' (pt-BR), 'SerP' (pt-BR), 'Serum' (pt-BR), 'SR' (pt-BR), 'Plasma' (pt-BR), 'Pl' (pt-BR), 'Plsm' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Chemistry' (pt-BR), 'Chimica Concentrazione Sostanza o Massa Plasma Punto nel tempo (episodio) Siero Siero o Plasma' (it-IT), 'Количественный Массовая или Молярная Концентрация Плазма Сыворотка Сыворотка или Плазма Точка во времени' (ru-RU) or 'Момент Холестерин' (ru-RU) (for the language(s) '--')" - }, - "location" : ["CodeableConcept.coding[0].display"], - "expression" : ["CodeableConcept.coding[0].display"] - }] -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "13457-7", - "display" : "Cholesterol in LDL [Mass/volume] in Serum or Plasma by calculation" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Cholesterol in LDL [Mass/volume] in Serum or Plasma by calculation", - "code" : "13457-7", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "29463-7", - "display" : "Body Weight" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Body weight", - "code" : "29463-7", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "29463-7" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Body weight", - "code" : "29463-7", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "29463-7", - "display" : "Body Weight" -}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "5.0.0", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Body weight", - "code" : "29463-7", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "35200-5", - "display" : "Cholest SerPl-msCnc" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Cholesterol [Mass or Moles/volume] in Serum or Plasma", - "code" : "35200-5", - "system" : "http://loinc.org", - "version" : "2.74", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome" -} - -} -------------------------------------------------------------------------------------- -{"code" : { - "system" : "http://loinc.org", - "code" : "35217-9", - "display" : "Triglyceride [Moles/​volume] in Serum or Plasma" -}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { - "resourceType" : "Parameters", - "parameter" : [{ - "name" : "profile-url", - "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" - }] -}}#### -v: { - "display" : "Triglyceride [Mass or Moles/volume] in Serum or Plasma", - "code" : "35217-9", - "severity" : "error", - "error" : "Wrong Display Name 'Triglyceride [Moles/​volume] in Serum or Plasma' for http://loinc.org#35217-9. Valid display is one of 50 choices: 'Triglyceride [Mass or Moles/volume] in Serum or Plasma', 'Trigl SerPl-msCnc', 'TG' (zh-CN), 'Trigly' (zh-CN), '甘油三脂' (zh-CN), '甘油三酸酯' (zh-CN), '三酸甘油酯' (zh-CN), '甘油三酸脂' (zh-CN), '三酸甘油脂 化学' (zh-CN), '化学检验项目' (zh-CN), '化学检验项目类' (zh-CN), '化学类' (zh-CN), '化学试验' (zh-CN), '非刺激耐受型化学检验项目' (zh-CN), '非刺激耐受型化学检验项目类' (zh-CN), '非刺激耐受型化学试验' (zh-CN), '非刺激耐受型化学试验类 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 血清或血浆 质量或摩尔浓度' (zh-CN), '质量或摩尔浓度(单位体积)' (zh-CN), '质量或物质的量浓度(单位体积)' (zh-CN), 'Juhuslik Kvantitatiivne Plasma Seerum Seerum või plasma' (et-EE), 'Trigl' (pt-BR), 'Triglycrides' (pt-BR), 'Trig' (pt-BR), 'Triglycerides' (pt-BR), 'Level' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'SerPl' (pt-BR), 'SerPlas' (pt-BR), 'SerP' (pt-BR), 'Serum' (pt-BR), 'SR' (pt-BR), 'Plasma' (pt-BR), 'Pl' (pt-BR), 'Plsm' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Chemistry' (pt-BR), 'Chimica Concentrazione Sostanza o Massa Plasma Punto nel tempo (episodio) Siero Siero o Plasma' (it-IT), 'Количественный Массовая или Молярная Концентрация Плазма Сыворотка Сыворотка или Плазма Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')", - "class" : "UNKNOWN", - "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", - "issues" : { - "resourceType" : "OperationOutcome", - "issue" : [{ - "extension" : [{ - "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", - "valueUrl" : "http://tx-dev.fhir.org/r4" - }], - "severity" : "error", - "code" : "invalid", - "details" : { - "coding" : [{ - "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", - "code" : "invalid-display" - }], - "text" : "Wrong Display Name 'Triglyceride [Moles/​volume] in Serum or Plasma' for http://loinc.org#35217-9. Valid display is one of 50 choices: 'Triglyceride [Mass or Moles/volume] in Serum or Plasma', 'Trigl SerPl-msCnc', 'TG' (zh-CN), 'Trigly' (zh-CN), '甘油三脂' (zh-CN), '甘油三酸酯' (zh-CN), '三酸甘油酯' (zh-CN), '甘油三酸脂' (zh-CN), '三酸甘油脂 化学' (zh-CN), '化学检验项目' (zh-CN), '化学检验项目类' (zh-CN), '化学类' (zh-CN), '化学试验' (zh-CN), '非刺激耐受型化学检验项目' (zh-CN), '非刺激耐受型化学检验项目类' (zh-CN), '非刺激耐受型化学试验' (zh-CN), '非刺激耐受型化学试验类 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 血清或血浆 质量或摩尔浓度' (zh-CN), '质量或摩尔浓度(单位体积)' (zh-CN), '质量或物质的量浓度(单位体积)' (zh-CN), 'Juhuslik Kvantitatiivne Plasma Seerum Seerum või plasma' (et-EE), 'Trigl' (pt-BR), 'Triglycrides' (pt-BR), 'Trig' (pt-BR), 'Triglycerides' (pt-BR), 'Level' (pt-BR), 'Point in time' (pt-BR), 'Random' (pt-BR), 'SerPl' (pt-BR), 'SerPlas' (pt-BR), 'SerP' (pt-BR), 'Serum' (pt-BR), 'SR' (pt-BR), 'Plasma' (pt-BR), 'Pl' (pt-BR), 'Plsm' (pt-BR), 'Quantitative' (pt-BR), 'QNT' (pt-BR), 'Quant' (pt-BR), 'Quan' (pt-BR), 'Chemistry' (pt-BR), 'Chimica Concentrazione Sostanza o Massa Plasma Punto nel tempo (episodio) Siero Siero o Plasma' (it-IT), 'Количественный Массовая или Молярная Концентрация Плазма Сыворотка Сыворотка или Плазма Точка во времени' (ru-RU) or 'Момент' (ru-RU) (for the language(s) '--')" - }, - "location" : ["Coding.display"], - "expression" : ["Coding.display"] + "location" : ["Coding.code"], + "expression" : ["Coding.code"] }] } diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/snomed.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/snomed.cache index 12f617a02..813f6c4b5 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/snomed.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/snomed.cache @@ -14,7 +14,7 @@ v: { "display" : "Body weight", "code" : "27113001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -37,7 +37,7 @@ v: { "display" : "Geriatrics specialist", "code" : "90655003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -100,7 +100,7 @@ v: { "display" : "Diagnosis (observable entity)", "code" : "439401001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -123,7 +123,7 @@ v: { "display" : "Severe", "code" : "24484000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -145,7 +145,7 @@ v: { "display" : "Severe", "code" : "24484000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -168,7 +168,7 @@ v: { "display" : "Severe", "code" : "24484000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -191,7 +191,7 @@ v: { "display" : "Burn of ear", "code" : "39065001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -214,7 +214,7 @@ v: { "display" : "Left external ear", "code" : "49521004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -237,7 +237,7 @@ v: { "display" : "Apgar score at 20 minutes (observable entity)", "code" : "443849008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -260,7 +260,7 @@ v: { "display" : "Apgar color score", "code" : "249227004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -283,7 +283,7 @@ v: { "display" : "Apgar heart rate score", "code" : "249223000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -306,7 +306,7 @@ v: { "display" : "Apgar response to stimulus score", "code" : "249226008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -329,7 +329,7 @@ v: { "display" : "Apgar muscle tone score", "code" : "249225007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -352,7 +352,7 @@ v: { "display" : "Apgar respiratory effort score", "code" : "249224006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -375,7 +375,7 @@ v: { "display" : "Angina", "code" : "194828000", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -398,7 +398,7 @@ v: { "display" : "Myocardial infarction", "code" : "22298006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -421,7 +421,7 @@ v: { "display" : "Ophthalmic route", "code" : "54485002", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -444,7 +444,7 @@ v: { "display" : "Instill - dosing instruction imperative (qualifier value)", "code" : "421538008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "issues" : { "resourceType" : "OperationOutcome" @@ -467,9 +467,8 @@ v: { "display" : "Right upper arm", "code" : "368209003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -491,9 +490,8 @@ v: { "display" : "Systolic blood pressure", "code" : "271649006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -515,7 +513,7 @@ v: { v: { "code" : "132037003", "severity" : "warning", - "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/731000124108/version/20210201' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]", + "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/731000124108/version/20210201' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]", "class" : "CODESYSTEM_UNSUPPORTED", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://snomed.info/sct|http://snomed.info/sct/731000124108/version/20210201", @@ -533,7 +531,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-found" }], - "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/731000124108/version/20210201' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]" + "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/731000124108/version/20210201' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]" }, "location" : ["CodeableConcept.coding[0].system"], "expression" : ["CodeableConcept.coding[0].system"] @@ -561,7 +559,6 @@ v: { "version" : "http://snomed.info/sct/731000124108/version/20230901", "server" : "http://tx-dev.fhir.org/r4", "inactive" : true, - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -580,6 +577,23 @@ v: { }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '132037003' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] }] } @@ -600,7 +614,7 @@ v: { v: { "code" : "132037003", "severity" : "warning", - "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000172109/version/20221115' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]", + "error" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000172109/version/20221115' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]", "class" : "CODESYSTEM_UNSUPPORTED", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "http://snomed.info/sct|http://snomed.info/sct/11000172109/version/20221115", @@ -618,7 +632,7 @@ v: { "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", "code" : "not-found" }], - "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000172109/version/20221115' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20210531,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20230901]" + "text" : "A definition for CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/11000172109/version/20221115' could not be found, so the code cannot be validated. Valid versions: [http://snomed.info/sct/11000146104/version/20230331,http://snomed.info/sct/11000172109/version/20231115,http://snomed.info/sct/2011000195101/version/20230607,http://snomed.info/sct/20611000087101/version/20220930,http://snomed.info/sct/32506021000036107/version/20230731,http://snomed.info/sct/45991000052106/version/20220531,http://snomed.info/sct/45991000052106/version/20231130,http://snomed.info/sct/554471000005108/version/20210930,http://snomed.info/sct/731000124108/version/20230901,http://snomed.info/sct/827022005/version/20221130,http://snomed.info/sct/83821000000107/version/20230412,http://snomed.info/sct/900000000000207008/version/20230131,http://snomed.info/sct/900000000000207008/version/20230731,http://snomed.info/sct/900000000000207008/version/20240201]" }, "location" : ["CodeableConcept.coding[0].system"], "expression" : ["CodeableConcept.coding[0].system"] @@ -642,9 +656,8 @@ v: { "display" : "Anxiety disorder of childhood OR adolescence", "code" : "109006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -665,9 +678,8 @@ v: { "display" : "Anxiety disorder of childhood OR adolescence", "code" : "109006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -689,9 +701,8 @@ v: { "display" : "Anxiety disorder of childhood OR adolescence", "code" : "109006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -713,9 +724,8 @@ v: { "display" : "Posterior carpal region", "code" : "106004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -739,7 +749,6 @@ v: { "error" : "The provided code 'http://snomed.info/sct#106004' was not found in the value set 'http://hl7.org/fhir/ValueSet/clinical-findings--0|5.0.0'", "class" : "UNKNOWN", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -784,9 +793,8 @@ v: { "display" : "Posterior carpal region", "code" : "106004", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -808,9 +816,8 @@ v: { "display" : "Triacylglycerol", "code" : "85600001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -832,10 +839,9 @@ v: { "display" : "Golden retriever", "code" : "58108001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "inactive" : true, - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -854,6 +860,23 @@ v: { }, "location" : ["CodeableConcept.coding[0].code"], "expression" : ["CodeableConcept.coding[0].code"] + }, + { + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", + "valueUrl" : "http://tx-dev.fhir.org/r4" + }], + "severity" : "information", + "code" : "invalid", + "details" : { + "coding" : [{ + "system" : "http://hl7.org/fhir/tools/CodeSystem/tx-issue-type", + "code" : "code-rule" + }], + "text" : "The code '58108001' is valid but is not active" + }, + "location" : ["CodeableConcept.coding[0].code"], + "expression" : ["CodeableConcept.coding[0].code"] }] } @@ -874,9 +897,8 @@ v: { "display" : "Venous blood specimen", "code" : "122555007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -898,9 +920,8 @@ v: { "display" : "At rest", "code" : "263678003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -922,9 +943,8 @@ v: { "display" : "Serum specimen", "code" : "119364003", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -946,9 +966,8 @@ v: { "display" : "Plastic", "code" : "61088005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -970,9 +989,8 @@ v: { "display" : "Evacuated blood collection tube, thrombin/clot activator/gel separator", "code" : "702281005", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -994,9 +1012,8 @@ v: { "display" : "Plasma specimen", "code" : "119361006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1018,9 +1035,8 @@ v: { "display" : "Glass", "code" : "32039001", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1041,9 +1057,8 @@ v: { "display" : "Worsening", "code" : "230993007", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1064,9 +1079,8 @@ v: { "display" : "Improving (qualifier value)", "code" : "385633008", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1087,7 +1101,75 @@ v: { "display" : "No status change", "code" : "260388006", "system" : "http://snomed.info/sct", - "version" : "http://snomed.info/sct/900000000000207008/version/20230901", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", + "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "230993007" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Worsening", + "code" : "230993007", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "385633008" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Improving (qualifier value)", + "code" : "385633008", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "260388006" +}, "valueSet" :null, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "activeOnly":"false", "exampleOK":"true", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "No status change", + "code" : "260388006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20240201", "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/system-map.json b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/system-map.json index e19a27abf..a6a411509 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/system-map.json +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/system-map.json @@ -2,63 +2,78 @@ "systems" : [ { "system" : "http://acme.com/config/fhir/codesystems/internal", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://acme.org/devices/clinical-codes", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://acme.ped/apgarcolor", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://acme.ped/apgarheartrate", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://acme.ped/apgarmuscletone", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://acme.ped/apgarreflexirritability", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://acme.ped/apgarrespiratoryeffort", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://hl7.org/fhir/sid/ndc", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://loinc.org", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://snomed.info/sct", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://terminology.hl7.org/CodeSystem/condition-category", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://terminology.hl7.org/CodeSystem/v2-0136", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://terminology.hl7.org/CodeSystem/v2-0360|2.7", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "http://unitsofmeasure.org", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] }, { "system" : "urn:ietf:bcp:47", - "server" : "http://tx-dev.fhir.org/r4" + "authoritative" : [], + "candidates" : [] } ] } diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/ucum.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/ucum.cache index 7197a4794..790c223c0 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/ucum.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/ucum.cache @@ -121,7 +121,7 @@ v: { }] }}#### v: { - "display" : "millimeter of mercury", + "display" : "mm[Hg]", "code" : "mm[Hg]", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", diff --git a/pom.xml b/pom.xml index 0dd17f120..fdca82807 100644 --- a/pom.xml +++ b/pom.xml @@ -14,13 +14,14 @@ HAPI FHIR --> <artifactId>org.hl7.fhir.core</artifactId> - <version>6.2.14-SNAPSHOT</version> + <version>6.3.4-SNAPSHOT</version> <packaging>pom</packaging> <properties> + <commons_compress_version>1.26.0</commons_compress_version> <guava_version>32.0.1-jre</guava_version> <hapi_fhir_version>6.4.1</hapi_fhir_version> - <validator_test_case_version>1.4.26</validator_test_case_version> + <validator_test_case_version>1.5.4-SNAPSHOT</validator_test_case_version> <jackson_version>2.16.0</jackson_version> <junit_jupiter_version>5.9.2</junit_jupiter_version> <junit_platform_launcher_version>1.8.2</junit_platform_launcher_version> @@ -134,6 +135,11 @@ <artifactId>commonmark-ext-gfm-tables</artifactId> <version>0.21.0</version> </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-compress</artifactId> + <version>${commons_compress_version}</version> + </dependency> <dependency> <groupId>com.github.rjeschke</groupId> <artifactId>txtmark</artifactId> @@ -294,7 +300,7 @@ <dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId> - <version>3.43.0.0</version> + <version>3.45.1.0</version> </dependency> <dependency>