From 99ea673b91c0e20b46ce21a6cef3dff17ebac1de Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 20 Mar 2024 20:39:07 +1100 Subject: [PATCH 01/10] Improved language support for IG development --- .../org/hl7/fhir/r5/elementmodel/Element.java | 17 ++++ .../fhir/r5/elementmodel/LanguageUtils.java | 81 +++++++++++++++++-- .../hl7/fhir/r5/elementmodel/Property.java | 34 +++++++- .../utilities/i18n/PoGetTextProducer.java | 13 ++- 4 files changed, 132 insertions(+), 13 deletions(-) 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 564e0b104..379d229e3 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 @@ -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); 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..ef3997297 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 @@ -24,6 +24,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 +81,6 @@ public class LanguageUtils { } } } - private String contextForElement(Element element) { throw new Error("Not done yet"); @@ -110,7 +113,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 +135,24 @@ 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 = 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 importFromTranslations(Element parent, Element element, List translations, Set usedUnits) { int t = 0; if (element.isPrimitive() && isTranslatable(element)) { String base = element.primitiveValue(); @@ -146,13 +162,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 +210,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())) { @@ -294,7 +311,7 @@ public class LanguageUtils { } public static boolean handlesAsElement(Element element) { - return false; // for now... + return true; // for now... } public static List generateTranslations(Resource res, String lang) { @@ -334,4 +351,52 @@ 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"))) { + lang = subExt.getNamedChildValue("value"); + } + if ("Extension".equals(subExt.fhirType()) && "lang".equals(subExt.getNamedChildValue("content"))) { + 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/Property.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Property.java index 51ff5f447..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 @@ -641,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) { @@ -677,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.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..ac03ae5fe 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 @@ -167,13 +167,22 @@ 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)); } + 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; + } + } From 8f2f414c78727127f5a8991e2a7e04c9f7a38796 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 20 Mar 2024 20:59:41 +1100 Subject: [PATCH 02/10] Fix value set validation to validate codes in example code systems --- .../validation/ValueSetValidator.java | 7 +- .../validation/ValidationOptions.java | 17 +- .../cli/services/ValidationService.java | 4 +- .../instance/type/ValueSetValidator.java | 14 +- .../4.0.1/http___something_something.cache | 20 +++ .../4.0.1/snomed.cache | 167 +++++++++++++++++- .../4.0.1/uvsdcCodeSystemCSPHQ9.cache | 154 +++++++++++++++- .../5.0.0/snomed.cache | 122 ++++++++++--- 8 files changed, 467 insertions(+), 38 deletions(-) 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 959b391c4..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 @@ -590,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) { @@ -608,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); 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 c3b956a56..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) { @@ -270,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(); @@ -282,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() { 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 25cdc889b..85601b0b5 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 @@ -652,7 +652,7 @@ public class ValidationService { String dst = cliContext.getOutput(); Utilities.createDirectory(dst); - Set translations = new HashSet<>(); + List translations = new ArrayList<>(); for (String input : cliContext.getInputs()) { loadTranslationSource(translations, input); } @@ -671,7 +671,7 @@ public class ValidationService { System.out.println("Done - imported "+t+" translations into "+refs.size()+ " in "+dst); } - private void loadTranslationSource(Set translations, String input) { + private void loadTranslationSource(List 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/instance/type/ValueSetValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/ValueSetValidator.java index 7e7684149..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 @@ -295,15 +295,15 @@ public class ValueSetValidator extends BaseValidator { 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) { @@ -333,7 +333,7 @@ public class ValueSetValidator extends BaseValidator { 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()) { @@ -347,19 +347,19 @@ public class ValueSetValidator extends BaseValidator { return false; } else { boolean ok = vv.isOk(); - warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack, 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, 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, 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, false, vv.getMessage()); } 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/snomed.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/snomed.cache index c8b5b092c..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 @@ -443,6 +443,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 '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", @@ -731,6 +748,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 '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", @@ -922,6 +956,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 '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", @@ -1452,6 +1503,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 '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", @@ -6589,6 +6657,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"] + }, { "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-server", @@ -7136,7 +7221,6 @@ v: { "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", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome", "issue" : [{ @@ -7193,10 +7277,89 @@ v: { "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" : "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" : "", + "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 '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/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/5.0.0/snomed.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/5.0.0/snomed.cache index cf702eb27..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 @@ -469,7 +469,6 @@ v: { "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" } @@ -493,7 +492,6 @@ v: { "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" } @@ -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"] }] } @@ -644,7 +658,6 @@ v: { "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" } @@ -667,7 +680,6 @@ v: { "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" } @@ -691,7 +703,6 @@ v: { "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" } @@ -715,7 +726,6 @@ v: { "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" } @@ -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" : [{ @@ -786,7 +795,6 @@ v: { "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" } @@ -810,7 +818,6 @@ v: { "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" } @@ -835,7 +842,6 @@ v: { "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"] }] } @@ -876,7 +899,6 @@ v: { "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" } @@ -900,7 +922,6 @@ v: { "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" } @@ -924,7 +945,6 @@ v: { "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" } @@ -948,7 +968,6 @@ v: { "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" } @@ -972,7 +991,6 @@ v: { "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" } @@ -996,7 +1014,6 @@ v: { "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" } @@ -1020,7 +1037,6 @@ v: { "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" } @@ -1043,7 +1059,6 @@ v: { "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" } @@ -1066,7 +1081,6 @@ v: { "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" } @@ -1083,6 +1097,74 @@ v: { "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", + "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", From 95cd30d1004f3826fe187ff68c65d0616b2b48ed Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 20 Mar 2024 20:59:59 +1100 Subject: [PATCH 03/10] duplicate designations is a warning, not an error --- .../fhir/validation/instance/type/CodeSystemValidator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 91c26bcdc..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 @@ -439,9 +439,9 @@ public class CodeSystemValidator extends BaseValidator { 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) { - ok = rule(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) && ok; + 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))) { - ok = rule(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) && ok; + 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? From 1ecbf365be661961c915f0366f5a732ea127109e Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 20 Mar 2024 21:00:16 +1100 Subject: [PATCH 04/10] fix NPE in validator for SIDs --- .../instance/InstanceValidator.java | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) 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 58331f512..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 @@ -5761,22 +5761,26 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } 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)) { - 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 (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; From 61b018d03391aa22cf937355565da7a1fc1b651e Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 20 Mar 2024 21:00:33 +1100 Subject: [PATCH 05/10] fix grammar in validation messages --- .../src/main/resources/Messages.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index 383fcef75..0c500336f 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -577,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}) @@ -1137,7 +1137,7 @@ CODESYSTEM_PROPERTY_SYNONYM_CHECK = The synonym ''{0}'' is not also defined in t 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 (''{0}'') a code and no URI, so it has no clearly defined meaning in the terminology ecosystem +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 From 4f1269dcff0d8ab3958f51894c10ea3ebd9da96a Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 20 Mar 2024 21:01:18 +1100 Subject: [PATCH 06/10] update test cases dependencies --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ff740d1f..9ff2aa120 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 1.26.0 32.0.1-jre 6.4.1 - 1.5.2 + 1.5.3-SNAPSHOT 2.16.0 5.9.2 1.8.2 From 9a66c1968e3bc10771b098fc006102a8e0700eac Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 20 Mar 2024 22:44:13 +1100 Subject: [PATCH 07/10] more work on language utilities --- .../org/hl7/fhir/r5/elementmodel/Element.java | 2 +- .../fhir/r5/elementmodel/LanguageUtils.java | 4 +-- .../ResourceLanguageFileBuilderTests.java | 2 +- .../utilities/i18n/JsonLangFileProducer.java | 8 ++--- .../utilities/i18n/LanguageFileProducer.java | 31 ++++++++++++++++--- .../utilities/i18n/PoGetTextProducer.java | 8 ++--- .../fhir/utilities/i18n/XLIFFProducer.java | 8 ++--- .../cli/services/ValidationService.java | 6 ++-- 8 files changed, 45 insertions(+), 24 deletions(-) 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 379d229e3..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 @@ -1513,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/LanguageUtils.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/LanguageUtils.java index ef3997297..6bdee88d7 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 @@ -385,9 +385,9 @@ public class LanguageUtils { String v = null; for (Element subExt : ext.getChildren()) { if ("Extension".equals(subExt.fhirType()) && "lang".equals(subExt.getNamedChildValue("url"))) { - lang = subExt.getNamedChildValue("value"); + l = subExt.getNamedChildValue("value"); } - if ("Extension".equals(subExt.fhirType()) && "lang".equals(subExt.getNamedChildValue("content"))) { + if ("Extension".equals(subExt.fhirType()) && "content".equals(subExt.getNamedChildValue("url"))) { v = subExt.getNamedChildValue("value"); } } 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.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 ac03ae5fe..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() { @@ -171,7 +171,7 @@ public class PoGetTextProducer extends LanguageFileProducer { 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) { 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(" "); ln(" "); ln(""); - 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, " "); ln(xml, " "); ln(xml, ""); - TextFile.stringToFile(xml.toString(), Utilities.path(getFolder(), filename)); + TextFile.stringToFile(xml.toString(), getTargetFileName(targetLang, filename)); } 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 85601b0b5..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 @@ -619,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 refs = new ArrayList<>(); ValidatorUtils.parseSources(cliContext.getSources(), refs, validator.getContext()); From b2fefc75e548bd6abd6428971c9d85ad14fe8c0d Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 20 Mar 2024 22:52:09 +1100 Subject: [PATCH 08/10] set up release --- RELEASE_NOTES.md | 7 +++++-- pom.xml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7b06c6ab5..24f938ea1 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,10 @@ ## Validator Changes -* no changes +* Fix grammar in validation messages +* Fix NPE in validator for SIDs +* Duplicate designations in a code system is a warning, not an error +* Fix value set validation to validate codes in example code systems ## Other code changes -* no changes \ No newline at end of file +* Improved multi-language support for IG development (LanguageUtils) diff --git a/pom.xml b/pom.xml index 9ff2aa120..d695856d7 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 1.26.0 32.0.1-jre 6.4.1 - 1.5.3-SNAPSHOT + 1.5.3 2.16.0 5.9.2 1.8.2 From ec513990453433cbecd9098c2b198f3df4cb4572 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Wed, 20 Mar 2024 12:38:29 +0000 Subject: [PATCH 09/10] Release: v6.3.3 ## Validator Changes * Fix grammar in validation messages * Fix NPE in validator for SIDs * Duplicate designations in a code system is a warning, not an error * Fix value set validation to validate codes in example code systems ## Other code changes * Improved multi-language support for IG development (LanguageUtils) ***NO_CI*** --- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index ff9a185f2..660796eda 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.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index 597d67e53..d10e46d16 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.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index 8abe420aa..178521d71 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.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index 31c6df193..c9d6d3c04 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.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 227f729c3..92562480f 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.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index e1892e85e..89f8fc74f 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.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index f386ca35a..9642b2980 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.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index 41e0e80aa..cc24a0e94 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 72df15b75..10acd1fb4 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 6a4cb26a7..49ad499fd 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 0623fbc9b..552ef339d 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.3.3-SNAPSHOT + 6.3.3 ../pom.xml diff --git a/pom.xml b/pom.xml index d695856d7..cdb7768e4 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.3.3-SNAPSHOT + 6.3.3 pom From 0cebf9af9f8b07e8b2b7fc5853e04593f2336d12 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Wed, 20 Mar 2024 13:31:17 +0000 Subject: [PATCH 10/10] Updating version to: 6.3.4-SNAPSHOT and incrementing test cases dependency. --- RELEASE_NOTES.md | 7 ++----- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 14 insertions(+), 17 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 24f938ea1..7b06c6ab5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,10 +1,7 @@ ## Validator Changes -* Fix grammar in validation messages -* Fix NPE in validator for SIDs -* Duplicate designations in a code system is a warning, not an error -* Fix value set validation to validate codes in example code systems +* no changes ## Other code changes -* Improved multi-language support for IG development (LanguageUtils) +* no changes \ No newline at end of file diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index 660796eda..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.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index d10e46d16..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.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index 178521d71..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.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index c9d6d3c04..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.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 92562480f..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.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 89f8fc74f..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.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index 9642b2980..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.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index cc24a0e94..60f586530 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 10acd1fb4..130d83b88 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 49ad499fd..af24d82e7 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index 552ef339d..35580642e 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 6.3.3 + 6.3.4-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index cdb7768e4..d0919a164 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 6.3.3 + 6.3.4-SNAPSHOT pom