diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/context/BaseWorkerContext.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/context/BaseWorkerContext.java index eeb318f38..ad296998d 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/context/BaseWorkerContext.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/context/BaseWorkerContext.java @@ -1165,13 +1165,13 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte if (p.getName().equals("result")) { ok = ((BooleanType) p.getValue()).getValue().booleanValue(); } else if (p.getName().equals("message")) { - message = ((StringType) p.getValue()).getValue(); + message = p.getValue().primitiveValue(); } else if (p.getName().equals("display")) { - display = ((StringType) p.getValue()).getValue(); + display = p.getValue().primitiveValue(); } else if (p.getName().equals("system")) { - system = ((StringType) p.getValue()).getValue(); + system = p.getValue().primitiveValue(); } else if (p.getName().equals("code")) { - code = ((StringType) p.getValue()).getValue(); + code = p.getValue().primitiveValue(); } else if (p.getName().equals("cause")) { try { IssueType it = IssueType.fromCode(((StringType) p.getValue()).getValue()); diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/ValueSetCheckerSimple.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/ValueSetCheckerSimple.java index 45ca9c2e5..adc3c47c6 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/ValueSetCheckerSimple.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/ValueSetCheckerSimple.java @@ -144,7 +144,9 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe } if (valueset != null && options.getValueSetMode() != ValueSetMode.NO_MEMBERSHIP_CHECK) { Boolean result = false; + CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(",", " and "); for (Coding c : code.getCoding()) { + b.append(c.toString()); Boolean ok = codeInValueSet(c.getSystem(), c.getCode(), warnings); if (ok == null && result == false) { result = null; @@ -153,9 +155,9 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe } } if (result == null) { - warnings.add(0, context.formatMessage(I18nConstants.UNABLE_TO_CHECK_IF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl())); + warnings.add(0, context.formatMessage(I18nConstants.UNABLE_TO_CHECK_IF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl(), b.toString())); } else if (!result) { - errors.add(0, context.formatMessagePlural(code.getCoding().size(), I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl())); + errors.add(0, context.formatMessagePlural(code.getCoding().size(), I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl(), b.toString())); } } if (errors.size() > 0) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Enumerations.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Enumerations.java index 9f9f9fc3d..3e0b5c753 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Enumerations.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Enumerations.java @@ -12025,6 +12025,10 @@ The primary difference between a medicationstatement and a medicationadministrat * R6 Rolling ci-build. */ _6_0_0CIBUILD, + /** + * R6 Formal version (does not exist yet) + */ + _6_0_0, /** * added to help the parsers */ @@ -12148,6 +12152,8 @@ The primary difference between a medicationstatement and a medicationadministrat return _5_0_0DRAFTFINAL; if ("6.0.0-cibuild".equals(codeString)) return _6_0_0CIBUILD; + if ("6.0.0".equals(codeString)) + return _6_0_0; throw new FHIRException("Unknown FHIRVersion code '"+codeString+"'"); } public static boolean isValidCode(String codeString) { @@ -12215,6 +12221,7 @@ The primary difference between a medicationstatement and a medicationadministrat case _5_0_0SNAPSHOT3: return "5.0.0-snapshot3"; case _5_0_0DRAFTFINAL: return "5.0.0-draft-final"; case _6_0_0CIBUILD: return "6.0.0-cibuild"; + case _6_0_0: return "6.0.0"; case NULL: return null; default: return "?"; } @@ -12279,6 +12286,7 @@ The primary difference between a medicationstatement and a medicationadministrat case _5_0_0SNAPSHOT3: return "http://hl7.org/fhir/FHIR-version"; case _5_0_0DRAFTFINAL: return "http://hl7.org/fhir/FHIR-version"; case _6_0_0CIBUILD: return "http://hl7.org/fhir/FHIR-version"; + case _6_0_0: return "http://hl7.org/fhir/FHIR-version"; case NULL: return null; default: return "?"; } @@ -12343,6 +12351,7 @@ The primary difference between a medicationstatement and a medicationadministrat case _5_0_0SNAPSHOT3: return "R5 January 2023 Staging Release + Connectathon 32."; case _5_0_0DRAFTFINAL: return "R5 Final QA."; case _6_0_0CIBUILD: return "R6 Rolling ci-build."; + case _6_0_0: return "R6 Final Version."; case NULL: return null; default: return "?"; } @@ -12407,6 +12416,7 @@ The primary difference between a medicationstatement and a medicationadministrat case _5_0_0SNAPSHOT3: return "5.0.0-snapshot3"; case _5_0_0DRAFTFINAL: return "5.0.0-draft-final"; case _6_0_0CIBUILD: return "6.0.0-cibuild"; + case _6_0_0: return "6.0.0"; case NULL: return null; default: return "?"; } @@ -12551,6 +12561,8 @@ The primary difference between a medicationstatement and a medicationadministrat return FHIRVersion._5_0_0DRAFTFINAL; if ("6.0.0-cibuild".equals(codeString)) return FHIRVersion._6_0_0CIBUILD; + if ("6.0.0".equals(codeString)) + return FHIRVersion._6_0_0; throw new IllegalArgumentException("Unknown FHIRVersion code '"+codeString+"'"); } @@ -12678,6 +12690,8 @@ The primary difference between a medicationstatement and a medicationadministrat return new Enumeration(this, FHIRVersion._5_0_0DRAFTFINAL, code); if ("6.0.0-cibuild".equals(codeString)) return new Enumeration(this, FHIRVersion._6_0_0CIBUILD, code); + if ("6.0.0".equals(codeString)) + return new Enumeration(this, FHIRVersion._6_0_0, code); throw new FHIRException("Unknown FHIRVersion code '"+codeString+"'"); } public String toCode(FHIRVersion code) { @@ -12797,6 +12811,8 @@ The primary difference between a medicationstatement and a medicationadministrat return "5.0.0-draft-final"; if (code == FHIRVersion._6_0_0CIBUILD) return "6.0.0-cibuild"; + if (code == FHIRVersion._6_0_0) + return "6.0.0"; return "?"; } public String toSystem(FHIRVersion code) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java index 4394866f5..73272baab 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java @@ -208,7 +208,10 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe Coding foundCoding = null; if (valueset != null && options.getValueSetMode() != ValueSetMode.NO_MEMBERSHIP_CHECK) { Boolean result = false; + CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(", "); + for (Coding c : code.getCoding()) { + b.append(c.getSystem()+(c.hasVersion() ? "|"+c.getVersion() : "")+"#"+c.getCode()); Boolean ok = codeInValueSet(c.getSystem(), c.getVersion(), c.getCode(), info); if (ok == null && result == false) { result = null; @@ -218,10 +221,10 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe } } if (result == null) { - String msg = context.formatMessage(I18nConstants.UNABLE_TO_CHECK_IF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl()); + String msg = context.formatMessage(I18nConstants.UNABLE_TO_CHECK_IF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl(), b.toString()); info.getIssues().addAll(makeIssue(IssueSeverity.WARNING, IssueType.INVALID, path, msg)); } else if (!result) { - String msg = context.formatMessagePlural(code.getCoding().size(), I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl()); + String msg = context.formatMessagePlural(code.getCoding().size(), I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl(), b.toString()); info.getIssues().addAll(makeIssue(IssueSeverity.ERROR, IssueType.INVALID, path, msg)); } } @@ -372,7 +375,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe if (valueset == null) { throw new VSCheckerException(warningMessage, issues); } else { - String msg = context.formatMessagePlural(1, I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl()); + String msg = context.formatMessagePlural(1, I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl(), code.toString()); issues.addAll(makeIssue(IssueSeverity.ERROR, IssueType.INVALID, path, msg)); throw new VSCheckerException(warningMessage+"; "+msg, issues); } @@ -440,7 +443,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe res.setMessage("Not in value set "+valueset.getUrl()+": "+info.summary()).setSeverity(IssueSeverity.ERROR); res.getIssues().addAll(makeIssue(IssueSeverity.ERROR, IssueType.INVALID, path, res.getMessage())); } else { - String msg = context.formatMessagePlural(1, I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl()); + String msg = context.formatMessagePlural(1, I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl(), code.toString()); res.setMessage(msg).setSeverity(IssueSeverity.ERROR); res.getIssues().addAll(makeIssue(IssueSeverity.ERROR, IssueType.INVALID, path, msg)); res.setDefinition(null); @@ -459,7 +462,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe } } } else if ((res != null && !res.isOk())) { - String msg = context.formatMessagePlural(1, I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl()); + String msg = context.formatMessagePlural(1, I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl(), code.toString()); res.setMessage(res.getMessage()+"; "+msg); res.getIssues().addAll(makeIssue(IssueSeverity.ERROR, IssueType.INVALID, path, msg)); } diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index 373932134..3f8b8e3dd 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -467,8 +467,8 @@ Display_Name_for__should_be_one_of__instead_of_other = Wrong Display Name ''{4}' Unknown_Code__in_ = Unknown Code ''{0}'' in the system ''{1}'' UNKNOWN_CODE__IN_FRAGMENT = Unknown Code ''{0}'' in the system ''{1}'' - note that the code system is labeled as a fragment, so the code may be valid in some other fragment Code_found_in_expansion_however_ = Code found in expansion, however: {0} -None_of_the_provided_codes_are_in_the_value_set_one = The provided code is not in the value set ''{1}'' -None_of_the_provided_codes_are_in_the_value_set_other = None of the provided codes are in the value set ''{1}'' +None_of_the_provided_codes_are_in_the_value_set_one = The provided code {2} is not in the value set ''{1}'' +None_of_the_provided_codes_are_in_the_value_set_other = None of the provided codes [{2}] are in the value set ''{1}'' Coding_has_no_system__cannot_validate = Coding has no system - cannot validate Unable_to_handle_system__concept_filter_with_op__ = Unable to handle system {0} concept filter with op = {1} Unable_to_handle_system__filter_with_property__ = Unable to handle system {0} filter with property = {1}, op = {2} @@ -670,7 +670,7 @@ RENDER_BUNDLE_DOCUMENT_CONTENT = Additional Document Content RENDER_BUNDLE_HEADER_DOC_ENTRY_URD = {0}. {1} ({2}/{3}) RENDER_BUNDLE_HEADER_DOC_ENTRY_U = {0}. {1} RENDER_BUNDLE_HEADER_DOC_ENTRY_RD = {0}. {2}/{3} -UNABLE_TO_CHECK_IF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_ = Unable to determine whether the provided codes are in the value set {0} because the value set or a code system it depends on is not known to the validator +UNABLE_TO_CHECK_IF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_ = Unable to determine whether the provided codes {1} are in the value set {0} because the value set or a code system it depends on is not known to the validator TERMINOLOGY_TX_SYSTEM_WRONG_HTML = The code system reference {0} is wrong - the code system reference cannot be to an HTML page. This may be the correct reference: {1} TERMINOLOGY_TX_SYSTEM_WRONG_BUILD = The code system reference {0} is wrong - the code system reference cannot be a reference to build.fhir.org. This may be the correct reference: {1} FHIRPATH_BAD_DATE = Unable to parse Date {0} diff --git a/pom.xml b/pom.xml index 109b4359c..d08ecb191 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 6.4.1 - 1.3.0 + 1.3.1-SNAPSHOT 2.14.0 5.9.2 1.8.2