From a2c9b6631f1f50a8182a4bb7df6bf8b193011830 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 29 Jun 2023 13:13:51 +1000 Subject: [PATCH 1/7] Fix issue loading SPDX value set --- .../org/hl7/fhir/convertors/loaders/loaderR5/BaseLoaderR5.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/loaders/loaderR5/BaseLoaderR5.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/loaders/loaderR5/BaseLoaderR5.java index d8efb279a..f598af8bc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/loaders/loaderR5/BaseLoaderR5.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/loaders/loaderR5/BaseLoaderR5.java @@ -200,7 +200,7 @@ public abstract class BaseLoaderR5 implements IContextResourceLoader { } else { return pi.isCore() && Utilities.tail(pri.getUrl()).equals(pri.getStatedType()); } - } else if (pi.isCore() && "spdx-license".equals(pri.getId())) { + } else if (pi.isCore() && "CodeSystem".equals(pri.getResourceType()) && "spdx-license".equals(pri.getId())) { return false; } else { return true; From 2cdd92868b250795e9eff6ce9c49c6463bb25978 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 29 Jun 2023 13:14:28 +1000 Subject: [PATCH 2/7] SPDX: Fix missing code for 'not-open-source' --- .../java/org/hl7/fhir/convertors/misc/SPDXImporter.java | 6 +++++- org.hl7.fhir.utilities/src/main/resources/spdx.json | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/SPDXImporter.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/SPDXImporter.java index 035c4d80a..a7258e44a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/SPDXImporter.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/SPDXImporter.java @@ -37,8 +37,12 @@ public class SPDXImporter { cs.addProperty().setCode("status").setType(PropertyType.CODE).setUri("http://hl7.org/fhir/concept-properties#status"); cs.addProperty().setCode("seeAlso").setType(PropertyType.STRING); cs.setVersion(json.asString("licenseListVersion")); + ConceptDefinitionComponent cc = cs.addConcept(); + cc.setCode("not-open-source"); + cc.setDisplay("Not open source"); + cc.setDefinition("Not an open source license."); for (JsonObject l : json.getJsonObjects("licenses")) { - ConceptDefinitionComponent cc = cs.addConcept(); + cc = cs.addConcept(); cc.setCode(l.asString("licenseId")); cc.setDisplay(l.asString("name")); cc.setDefinition(l.asString("name")); diff --git a/org.hl7.fhir.utilities/src/main/resources/spdx.json b/org.hl7.fhir.utilities/src/main/resources/spdx.json index 2209474ec..bd8460c21 100644 --- a/org.hl7.fhir.utilities/src/main/resources/spdx.json +++ b/org.hl7.fhir.utilities/src/main/resources/spdx.json @@ -60,6 +60,10 @@ "type" : "string" }], "concept" : [{ + "code": "not-open-source", + "display": "Not open source", + "definition": "Not an open source license." + }, { "code" : "0BSD", "display" : "BSD Zero Clause License", "property" : [{ From 236cf0694670e865bab74e9c4cac8b743285ea7f Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 29 Jun 2023 13:17:15 +1000 Subject: [PATCH 3/7] Handle case where base hasn't got a snapshot generating snapshots --- .../conformance/profile/ProfilePathProcessor.java | 11 ++++++++--- .../r5/conformance/profile/ProfileUtilities.java | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) 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 ac0c54a6c..62029741d 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 @@ -134,7 +134,7 @@ public class ProfilePathProcessor { null); - getInstance(profileUtilities) + getInstance(profileUtilities) .withResult(derived.getSnapshot()) .withDifferential(differential) .withBaseLimit(baseSnapshot.getElement().size() - 1) @@ -607,8 +607,13 @@ public class ProfilePathProcessor { } if (src == null) throw new DefinitionException(profileUtilities.getContext().formatMessage(I18nConstants.UNABLE_TO_FIND_ELEMENT__IN_, eid, firstTypeProfile.getValue())); - } else - src = firstTypeStructureDefinition.getSnapshot().getElement().get(0); + } else { + 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); + } + } template = src.copy().setPath(currentBase.getPath()); template.setSliceName(null); // temporary work around 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 de9cb3882..a03030508 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 @@ -621,7 +621,14 @@ public class ProfileUtilities extends TranslatingUtilities { if (!base.getType().equals(derived.getType()) && derived.getDerivation() == TypeDerivationRule.CONSTRAINT) { throw new DefinitionException(context.formatMessage(I18nConstants.BASE__DERIVED_PROFILES_HAVE_DIFFERENT_TYPES____VS___, base.getUrl(), base.getType(), derived.getUrl(), derived.getType())); } + if (!base.hasSnapshot()) { + StructureDefinition sdb = context.fetchResource(StructureDefinition.class, base.getBaseDefinition()); + if (sdb == null) + throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_FIND_BASE__FOR_, base.getBaseDefinition(), base.getUrl())); + checkNotGenerating(sdb, "an extension base"); + generateSnapshot(sdb, base, base.getUrl(), (sdb.hasWebPath()) ? Utilities.extractBaseUrl(sdb.getWebPath()) : webUrl, base.getName()); + } fixTypeOfResourceId(base); if (snapshotStack.contains(derived.getUrl())) { @@ -810,7 +817,7 @@ public class ProfileUtilities extends TranslatingUtilities { } if (!slice.checkMinMax()) { String msg = "The slice definition for "+slice.getFocus().getId()+" has a maximum of "+slice.getFocus().getMax()+" which is less than the minimum of "+slice.getFocus().getMin(); - messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.VALUE, url+"#"+slice.getFocus().getId(), msg, ValidationMessage.IssueSeverity.WARNING)); + messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.VALUE, url+"#"+"#"+slice.getFocus().getId(), msg, ValidationMessage.IssueSeverity.WARNING)); } slices.remove(s); } @@ -2289,7 +2296,7 @@ public class ProfileUtilities extends TranslatingUtilities { } if (profile==null) { profile = source.getType().size() == 1 && source.getTypeFirstRep().hasProfile() ? context.fetchResource(StructureDefinition.class, source.getTypeFirstRep().getProfile().get(0).getValue(), derivedSrc) : null; - if (profile != null && !"Extension".equals(profile.getType()) && profile.getKind() != StructureDefinitionKind.RESOURCE) { + if (profile != null && !"Extension".equals(profile.getType()) && profile.getKind() != StructureDefinitionKind.RESOURCE && profile.getKind() != StructureDefinitionKind.LOGICAL) { profile = null; } } @@ -4379,4 +4386,8 @@ public class ProfileUtilities extends TranslatingUtilities { return messages; } + public static boolean isResourceBoundary(ElementDefinition ed) { + return ed.getType().size() == 1 && "Resource".equals(ed.getTypeFirstRep().getCode()); + } + } From bb66eccf45447feac015ed54ef05b365d5a391f1 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 29 Jun 2023 13:18:01 +1000 Subject: [PATCH 4/7] Allow target to be treated as source when validating FML --- .../fhir/utilities/i18n/I18nConstants.java | 2 + .../src/main/resources/Messages.properties | 9 ++-- .../instance/type/StructureMapValidator.java | 30 +++++++++-- .../4.0.1/snomed.cache | 51 +++++++++++++++++++ 4 files changed, 83 insertions(+), 9 deletions(-) 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 a1c5504f7..b9e03ddf8 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 @@ -821,6 +821,7 @@ public class I18nConstants { public static final String SM_TARGET_TRANSFORM_EXPRESSION_ERROR = "SM_TARGET_TRANSFORM_EXPRESSION_ERROR"; public static final String SM_IMPORT_NOT_FOUND = "SM_IMPORT_NOT_FOUND"; public static final String SM_TARGET_TYPE_MULTIPLE_POSSIBLE = "SM_TARGET_TYPE_MULTIPLE_POSSIBLE"; + public static final String SM_TARGET_TRANSFORM_TYPE_UNKNOWN = "SM_TARGET_TRANSFORM_TYPE_UNKNOWN"; public static final String SM_DEPENDENT_PARAM_NOT_FOUND = "SM_DEPENDENT_PARAM_NOT_FOUND"; public static final String SM_DEPENDENT_PARAM_MODE_MISMATCH = "SM_DEPENDENT_PARAM_MODE_MISMATCH"; public static final String SM_DEPENDENT_PARAM_TYPE_MISMATCH = "SM_DEPENDENT_PARAM_TYPE_MISMATCH"; @@ -915,6 +916,7 @@ public class I18nConstants { public static final String ED_INVARIANT_NO_EXPRESSION = "ED_INVARIANT_NO_EXPRESSION"; public static final String ED_INVARIANT_EXPRESSION_CONFLICT = "ED_INVARIANT_EXPRESSION_CONFLICT"; public static final String ED_INVARIANT_EXPRESSION_ERROR = "ED_INVARIANT_EXPRESSION_ERROR"; + public static final String SNAPSHOT_IS_EMPTY = "SNAPSHOT_IS_EMPTY"; } diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index 2be409752..12f74e440 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -186,7 +186,7 @@ Terminology_TX_System_Relative = Coding.system must be an absolute reference, no Terminology_TX_System_Unknown = Unknown Code System ''{0}'' Terminology_TX_System_ValueSet = Invalid System URI: {0} - cannot use a value set URI as a system Terminology_TX_System_ValueSet2 = The Coding references a value set, not a code system (''{0}'') -Terminology_TX_ValueSet_NotFound = ValueSet {0} not found by validator +Terminology_TX_ValueSet_NotFound = ValueSet {0} not found Terminology_TX_ValueSet_NotFound_CS = Found a reference to a CodeSystem ({0}) where a ValueSet belongs Type_Specific_Checks_DT_Base64_Valid = The value ''{0}'' is not a valid Base64 value Type_Specific_Checks_DT_Boolean_Value = Boolean values must be ''true'' or ''false'' @@ -848,9 +848,9 @@ SM_NAME_INVALID = The name {0} is not valid SM_GROUP_NAME_DUPLICATE = The Group name ''{0}'' is already used SM_GROUP_INPUT_DUPLICATE = The name {0} is already used SM_GROUP_INPUT_MODE_INVALID = The group parameter {0} mode {1} isn''t valid -SM_GROUP_INPUT_NO_TYPE = The group parameter {0} has no type, so the paths cannot be validated +SM_GROUP_INPUT_NO_TYPE = Group {1} parameter {0} has no type, so the paths cannot be validated SM_GROUP_INPUT_TYPE_NOT_DECLARED = The type {0} is not declared and is unknown -SM_GROUP_INPUT_MODE_MISMATCH = The type {0} has mode {1} which doesn''t match the structure definition {2} +SM_GROUP_INPUT_MODE_MISMATCH = The type ''{0}'' has mode ''{1}'' which doesn''t match the structure definition mode of ''{2}'' SM_GROUP_INPUT_TYPE_UNKNOWN_STRUCTURE = The type {0} which maps to the canonical URL {1} is not known, so the paths cannot be validated SM_GROUP_INPUT_TYPE_UNKNOWN_TYPE = The type {0} is not known, so the paths cannot be validated SM_SOURCE_CONTEXT_UNKNOWN = The source context {0} is not known at this point @@ -875,6 +875,7 @@ SM_TARGET_TRANSFORM_PARAM_UNPROCESSIBLE = The parameter at index {0} could not b SM_TARGET_TRANSFORM_EXPRESSION_ERROR = The FHIRPath expression passed as the evaluate parameter is invalid: {0} SM_IMPORT_NOT_FOUND = No maps were found to match {0} - validation may be wrong SM_TARGET_TYPE_MULTIPLE_POSSIBLE = Multiple types are possible here ({0}) so further type checking is not possible +SM_TARGET_TRANSFORM_TYPE_UNKNOWN = The type ''{0}'' is not known SM_DEPENDENT_PARAM_MODE_MISMATCH = The parameter {0} refers to the variable {1} but it''s mode is {2} which is not the same as the mode required for the group {3} SM_DEPENDENT_PARAM_NOT_FOUND = The {1} parameter ''{0}'' was not found SM_DEPENDENT_PARAM_TYPE_MISMATCH = The parameter ''{0}'' refers to the variable ''{1}'' but it''s type is ''{2}'' which is not compatible with the type required for the group ''{3}'', which is ''{4}'' (from map ''{5}'') @@ -969,4 +970,4 @@ ED_INVARIANT_NO_KEY = The invariant has no key, so the content cannot be validat ED_INVARIANT_NO_EXPRESSION = The invariant ''{0}'' has no computable expression, so validators will not be able to check it ED_INVARIANT_EXPRESSION_CONFLICT = The invariant ''{0}'' has an expression ''{1}'', which differs from the earlier expression provided of ''{2}'' (invariants are allowed to repeat, but cannot differ) ED_INVARIANT_EXPRESSION_ERROR = Error in invariant ''{0}'' with expression ''{1}'': {2} - +SNAPSHOT_IS_EMPTY = The snapshot for the profile ''{0}'' is empty (which should not happen) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureMapValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureMapValidator.java index 5718fb186..e89b60bd9 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureMapValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureMapValidator.java @@ -470,14 +470,20 @@ public class StructureMapValidator extends BaseValidator { private boolean validateInput(List errors, Element src, Element group, Element input, NodeStack stack, List structures, VariableSet variables, VariableSet pvars) { boolean ok = false; + String gname = group.getChildValue("name"); String name = input.getChildValue("name"); String mode = input.getChildValue("mode"); String type = input.getChildValue("type"); VariableDefn pv = null; if (type == null && pvars != null) { - pv = pvars.getVariable(name, mode.equals("source")); + pv = pvars.getVariable(name, mode.equals("source")); if (pv != null) { type = pv.getWorkingType(); + } else { + pv = pvars.getVariable(name, mode.equals("target")); // target can become source + if (pv != null) { + type = pv.getWorkingType(); + } } } @@ -485,7 +491,7 @@ public class StructureMapValidator extends BaseValidator { rule(errors, "2023-03-01", IssueType.DUPLICATE, input.line(), input.col(), stack.getLiteralPath(), !variables.hasVariable(name), I18nConstants.SM_GROUP_INPUT_DUPLICATE, name)) { // the name {0} is not valid) VariableDefn v = variables.add(name, mode); if (rule(errors, "2023-03-01", IssueType.INVALID, input.line(), input.col(), stack.getLiteralPath(), Utilities.existsInList(mode, "source", "target"), I18nConstants.SM_GROUP_INPUT_MODE_INVALID, name, mode) && // the group parameter {0} mode {1} isn't valid - warning(errors, "2023-03-01", IssueType.NOTSUPPORTED, input.line(), input.col(), stack.getLiteralPath(), type != null, I18nConstants.SM_GROUP_INPUT_NO_TYPE, name)) { // the group parameter {0} has no type, so the paths cannot be validated + warning(errors, "2023-03-01", IssueType.NOTSUPPORTED, input.line(), input.col(), stack.getLiteralPath(), type != null, I18nConstants.SM_GROUP_INPUT_NO_TYPE, name, gname)) { // the group parameter {0} has no type, so the paths cannot be validated String smode = null; StructureDefinition sd = null; ElementDefinition ed = null; @@ -514,7 +520,7 @@ public class StructureMapValidator extends BaseValidator { ed = sd.getSnapshot().getElementFirstRep(); } } - if (rule(errors, "2023-03-01", IssueType.NOTSUPPORTED, input.line(), input.col(), stack.getLiteralPath(), smode == null || mode.equals(smode), I18nConstants.SM_GROUP_INPUT_MODE_MISMATCH, type, mode, smode)) { // the type {0} has mode {1} which doesn't match the structure definition {2} + if (rule(errors, "2023-03-01", IssueType.NOTSUPPORTED, input.line(), input.col(), stack.getLiteralPath(), smode == null || mode.equals(smode) || (smode.equals("target") && mode.equals("source")), I18nConstants.SM_GROUP_INPUT_MODE_MISMATCH, type, mode, smode)) { // the type {0} has mode {1} which doesn't match the structure definition {2} v.setType(1, sd, ed, null); ok = true; } @@ -840,7 +846,16 @@ public class StructureMapValidator extends BaseValidator { // it's just a warning: maybe this'll work out at run time? warning(errors, "2023-03-01", IssueType.INVALID, target.line(), target.col(), stack.getLiteralPath(), type != null, I18nConstants.SM_TARGET_TYPE_MULTIPLE_POSSIBLE, el.getEd().typeSummary()); - vn.setType(ruleInfo.getMaxCount(), el.getSd(), el.getEd(), type); // may overwrite + if (ProfileUtilities.isResourceBoundary(el.getEd()) && type != null) { + StructureDefinition sdt = this.context.fetchTypeDefinition(type); + if (rule(errors, "2023-03-01", IssueType.INVALID, target.line(), target.col(), stack.getLiteralPath(), sdt != null, I18nConstants.SM_TARGET_TRANSFORM_TYPE_UNKNOWN, type)) { + vn.setType(ruleInfo.getMaxCount(), sdt, sdt.getSnapshot().getElementFirstRep(), null); // may overwrite + } else { + vn.setType(ruleInfo.getMaxCount(), el.getSd(), el.getEd(), type); // may overwrite + } + } else { + vn.setType(ruleInfo.getMaxCount(), el.getSd(), el.getEd(), type); // may overwrite + } } } @@ -1143,8 +1158,13 @@ public class StructureMapValidator extends BaseValidator { String iType = resolveType(grp, input, src); String pname = input.getName(); VariableDefn v = getParameter(errors, param, pstack, variables, input.getMode()); + if (v == null && input.getMode() == StructureMapInputMode.SOURCE) { + // target can transition to the source + v = getParameter(errors, param, pstack, variables, StructureMapInputMode.TARGET); + } if (rule(errors, "2023-06-27", IssueType.INVALID, param.line(), param.col(), pstack.getLiteralPath(), v != null, I18nConstants.SM_DEPENDENT_PARAM_NOT_FOUND, pname, input.getMode().toCode())) { - if (rule(errors, "2023-03-01", IssueType.INVALID, param.line(), param.col(), pstack.getLiteralPath(), v.mode.equals(input.getMode().toCode()), I18nConstants.SM_DEPENDENT_PARAM_MODE_MISMATCH, param.getChildValue("name"), v.mode, input.getMode().toCode(), grp.getTargetGroup().getName()) && + if (rule(errors, "2023-03-01", IssueType.INVALID, param.line(), param.col(), pstack.getLiteralPath(), + v.mode.equals(input.getMode().toCode()) || (v.mode.equals("target") && input.getMode() == StructureMapInputMode.SOURCE), I18nConstants.SM_DEPENDENT_PARAM_MODE_MISMATCH, param.getChildValue("name"), v.mode, input.getMode().toCode(), grp.getTargetGroup().getName()) && rule(errors, "2023-03-01", IssueType.INVALID, param.line(), param.col(), pstack.getLiteralPath(), typesMatch(v, iType), I18nConstants.SM_DEPENDENT_PARAM_TYPE_MISMATCH, pname, v.summary(), input.getType(), grp.getTargetGroup().getName(), input.getType(), grp.getTargetMap() == null ? "$this" : grp.getTargetMap().getVersionedUrl())) { lvars.add(pname, v); 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 adf122be6..8c562d542 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 @@ -2221,3 +2221,54 @@ v: { "class" : "UNKNOWN" } ------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "371525003" +}, "url": "http://fhir.ch/ig/ch-epr-term/ValueSet/DocumentEntry.classCode--0", "version": "2.0.10-cibuild", "langs":"[en]", "useServer":"true", "useClient":"false", "guessSystem":"false", "valueSetMode":"CHECK_MEMERSHIP_ONLY", "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 provided code http://snomed.info/sct#371525003 is not in the value set 'http://fhir.ch/ig/ch-epr-term/ValueSet/DocumentEntry.classCode--0|2.0.10-cibuild' (from Tx-Server)", + "class" : "UNKNOWN" +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "371525003" +}, "url": "http://fhir.ch/ig/ch-epr-term/ValueSet/DocumentEntry.classCode--1", "version": "2.0.10-cibuild", "langs":"[en]", "useServer":"true", "useClient":"false", "guessSystem":"false", "valueSetMode":"CHECK_MEMERSHIP_ONLY", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Clinical procedure report (record artifact)", + "code" : "371525003", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/2011000195101/version/20230607" +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "371525003", + "display" : "Clinical procedure report" +}, "url": "http://fhir.ch/ig/ch-epr-term/ValueSet/DocumentEntry.classCode", "version": "2.0.10-cibuild", "langs":"[en]", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"NO_MEMBERSHIP_CHECK", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Clinical procedure report", + "code" : "371525003", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131" +} +------------------------------------------------------------------------------------- From efafc9fb9befccd76d0d6bfa84df0408986b18f7 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 29 Jun 2023 13:18:37 +1000 Subject: [PATCH 5/7] Fix issues validating names and urls for logical models --- .../org/hl7/fhir/validation/instance/InstanceValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0bfab5a4b..b1994c6c0 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 @@ -2648,7 +2648,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat String d = sd.getChildValue("derivation"); String k = sd.getChildValue("kind"); if (Utilities.isAbsoluteUrl(v)) { - warning(errors, "2022-11-02", IssueType.INVALID, e.line(), e.col(), path, ns(v).equals(ns(url)) || ns(v).equals(ns(url).replace("StructureDefinition/", "")), I18nConstants.SD_TYPE_NOT_MATCH_NS, v, url); + warning(errors, "2022-11-02", IssueType.INVALID, e.line(), e.col(), path, d.equals("constraint") || ns(v).equals(ns(url)) || ns(v).equals(ns(url).replace("StructureDefinition/", "")), I18nConstants.SD_TYPE_NOT_MATCH_NS, v, url); return rule(errors, "2022-11-02", IssueType.INVALID, e.line(), e.col(), path, "logical".equals(k), I18nConstants.SD_TYPE_NOT_LOGICAL, v, k); } else { boolean tok = false; From 37e260018699e56ef964485326cabc9fcc49c218 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 29 Jun 2023 13:19:02 +1000 Subject: [PATCH 6/7] Don't duplicate warnings about missing expressions on invariants in R5 --- .../validation/instance/type/StructureDefinitionValidator.java | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 c326cf955..63b978c42 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 @@ -484,7 +484,7 @@ public class StructureDefinitionValidator extends BaseValidator { String expression = invariant.getNamedChildValue("expression"); String source = invariant.getNamedChildValue("source"); if (warning(errors, "2023-06-19", IssueType.INFORMATIONAL, stack, !Utilities.noString(key), I18nConstants.ED_INVARIANT_NO_KEY)) { - if (hint(errors, "2023-06-19", IssueType.INFORMATIONAL, stack, !Utilities.noString(expression), I18nConstants.ED_INVARIANT_NO_EXPRESSION, key)) { + if (hint(errors, "2023-06-19", IssueType.INFORMATIONAL, stack, !Utilities.noString(expression) || VersionUtilities.isR5Plus(context.getVersion()), I18nConstants.ED_INVARIANT_NO_EXPRESSION, key)) { // not for R5 - there's an invariant if (invariantMap.containsKey(key)) { // it's legal - and common - for a list of elemnts to contain the same invariant more than once, but it's not valid if it's not always the same ok = rule(errors, "2023-06-19", IssueType.INVALID, stack, expression.equals(invariantMap.get(key)) || "ele-1".equals(key), I18nConstants.ED_INVARIANT_EXPRESSION_CONFLICT, key, expression, invariantMap.get(key)); diff --git a/pom.xml b/pom.xml index 1b7982223..b3ff07b64 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 32.0.1-jre 6.4.1 - 1.3.12 + 1.3.13-SNAPSHOT 2.14.0 5.9.2 1.8.2 From 9cca4d756aea061db7e7a671071b145c9d56b787 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 29 Jun 2023 13:19:17 +1000 Subject: [PATCH 7/7] release notes --- RELEASE_NOTES.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7b06c6ab5..8c16c39ef 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,10 @@ ## Validator Changes -* no changes +* Fix issue loading SPDX value set + Fix missing code for 'not-open-source' +* Allow target to be treated as source when validating FML +* Fix issues validating names and urls for logical models +* Don't duplicate warnings about missing expressions on invariants in R5 ## Other code changes -* no changes \ No newline at end of file +* Handle case where base hasn't got a snapshot generating snapshots