From 26aef432785059de5ec7b839e6d1b965cd236c25 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 18 Jan 2024 11:40:12 +1100 Subject: [PATCH 1/8] fix up cvx importer --- .../main/java/org/hl7/fhir/convertors/misc/CVXImporter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/CVXImporter.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/CVXImporter.java index fa0753e89..cb434224d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/CVXImporter.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/CVXImporter.java @@ -66,7 +66,7 @@ public class CVXImporter { Element cvxCodes = xml.getDocumentElement(); for (Element cvsInfo : XMLUtil.getNamedChildren(cvxCodes, "CVXInfo")) { String desc = XMLUtil.getNamedChildText(cvsInfo, "ShortDescription").trim(); - String name = XMLUtil.getNamedChildText(cvsInfo, "FullVaccinename").trim(); + String fullName = XMLUtil.getNamedChildText(cvsInfo, "FullVaccinename").trim(); String code = XMLUtil.getNamedChildText(cvsInfo, "CVXCode").trim(); String notes = XMLUtil.getNamedChildText(cvsInfo, "Notes"); String status = XMLUtil.getNamedChildText(cvsInfo, "Status").trim(); @@ -78,8 +78,8 @@ public class CVXImporter { } else { def.getDesignation().clear(); } - def.setDisplay(name); - def.addDesignation().setValue(desc).setLanguage("en").setUse(new Coding().setSystem("http://snomed.info/sct").setCode("900000000000013009").setDisplay("Synonym")); + def.setDisplay(desc); + def.addDesignation().setValue(fullName).setLanguage("en").setUse(new Coding().setSystem("http://snomed.info/sct").setCode("900000000000013009").setDisplay("Synonym")); if (!Utilities.noString(notes)) { def.forceProperty("notes").setValue(new StringType(notes.trim())); } From 210ad10b2f5568278898cd8ef1094fb76289de3d Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 18 Jan 2024 11:40:20 +1100 Subject: [PATCH 2/8] remove debugging code --- .../org/hl7/fhir/r4/utils/client/network/FhirRequestBuilder.java | 1 - 1 file changed, 1 deletion(-) diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/network/FhirRequestBuilder.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/network/FhirRequestBuilder.java index 80697982c..41dedf9df 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/network/FhirRequestBuilder.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/network/FhirRequestBuilder.java @@ -295,7 +295,6 @@ public class FhirRequestBuilder { OperationOutcome error = null; try { byte[] body = response.body().bytes(); - TextFile.bytesToFile(body, "/Users/grahamegrieve/temp/http-body.txt"); String contentType = response.header("Content-Type"); if (body != null) { if (contentType.contains(ResourceFormat.RESOURCE_XML.getHeader()) From da5e389fd34f3a9e8ac1d78b1bdd92020c1ff058 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 18 Jan 2024 11:40:46 +1100 Subject: [PATCH 3/8] render target profiles on operation definition parameters --- .../fhir/r5/conformance/profile/ProfileUtilities.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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 4e89a9ec2..24005ce10 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 @@ -3449,10 +3449,12 @@ public class ProfileUtilities extends TranslatingUtilities { @Override public int compare(ElementDefinitionHolder o1, ElementDefinitionHolder o2) { - if (o1.getBaseIndex() == 0) + if (o1.getBaseIndex() == 0) { o1.setBaseIndex(find(o1.getSelf().getPath(), true)); - if (o2.getBaseIndex() == 0) + } + if (o2.getBaseIndex() == 0) { o2.setBaseIndex(find(o2.getSelf().getPath(), true)); + } return o1.getBaseIndex() - o2.getBaseIndex(); } @@ -3545,11 +3547,6 @@ public class ProfileUtilities extends TranslatingUtilities { } paths.add(elt.getPath()); } - if(!hasSlicing) { - // if Differential does not have slicing then safe to pre-sort the list - // so elements and subcomponents are together - Collections.sort(diffList, new ElementNameCompare()); - } processElementsIntoTree(edh, i, diff.getDifferential().getElement()); From 0502234ba33cef16f9575f5672b73bd315df40e9 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 18 Jan 2024 11:41:56 +1100 Subject: [PATCH 4/8] render target profiles on operation definition parameters --- .../r5/renderers/OperationDefinitionRenderer.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java index 8532156bc..3d9fdbda7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r5.model.CanonicalType; import org.hl7.fhir.r5.model.CodeType; import org.hl7.fhir.r5.model.Enumeration; import org.hl7.fhir.r5.model.Enumerations.FHIRTypes; @@ -141,6 +142,20 @@ public class OperationDefinitionRenderer extends TerminologyRenderer { } } else td.ah(sd.getWebPath()).tx(actualType); + if (p.hasTargetProfile()) { + td.tx(" ("); + boolean first = true; + for (CanonicalType tp : p.getTargetProfile()) { + if (first) { first = false;} else {td.tx(", ");}; + StructureDefinition sdt = context.getWorker().fetchTypeDefinition(tp.asStringValue()); + if (sdt == null || !sdt.hasWebPath()) { + td.code().tx(tp.asStringValue()); + } else { + td.ah(sdt.getWebPath(), tp.asStringValue()).tx(sdt.present()); + } + } + td.tx(")"); + } if (p.hasSearchType()) { td.br(); td.tx("("); From 6838576d9ef573ead902cd8274fb7332f2f3aeb5 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 18 Jan 2024 11:42:07 +1100 Subject: [PATCH 5/8] fix broken links rendering questionnaires --- .../java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java | 4 ++-- .../hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java index 0e2245c5e..58dc01eb1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java @@ -282,7 +282,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { if (i.hasExtension(ToolingExtensions.EXT_Q_DISPLAY_CAT)) { CodeableConcept cc = i.getExtensionByUrl(ToolingExtensions.EXT_Q_DISPLAY_CAT).getValueCodeableConcept(); String code = cc.getCode("http://hl7.org/fhir/questionnaire-display-category"); - flags.addPiece(gen.new Piece(getSDCLink("StructureDefinition-sdc-questionnaire-displayCategory.html"), null, "Category: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); + flags.addPiece(gen.new Piece("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", null, "Category: "+code).addHtml(new XhtmlNode(NodeType.Element, "img").attribute("alt", "icon").attribute("src", getImgPath("icon-qi-" + code + ".png")))); } } Cell defn = gen.new Cell(); @@ -731,7 +731,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { CodeableConcept cc = i.getExtensionByUrl(ToolingExtensions.EXT_Q_DISPLAY_CAT).getValueCodeableConcept(); String code = cc.getCode("http://hl7.org/fhir/questionnaire-display-category"); hasFlag = true; - flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-displayCategory"), "Category: "+code).img(getImgPath("icon-qi-" + code + ".png"), "icon"); + flags.ah("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", "Category: "+code).img(getImgPath("icon-qi-" + code + ".png"), "icon"); } if (i.hasMaxLength()) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java index f3f5df19e..4078d8063 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireResponseRenderer.java @@ -470,7 +470,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // CodeableConcept cc = i.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory").getValueCodeableConcept(); // String code = cc.getCode("http://hl7.org/fhir/QuestionnaireResponse-display-category"); // hasFlag = true; -// flags.ah(getSDCLink("http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-displayCategory", "Category: "+code).img(Utilities.path(context.getLocalPrefix(), "icon-qi-"+code+".png")); +// flags.ah("https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", "Category: "+code).img(Utilities.path(context.getLocalPrefix(), "icon-qi-"+code+".png")); // } // // if (i.hasMaxLength()) { @@ -742,7 +742,7 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer { // render(tr.td(), qi.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory").getValue()); // } // if (ToolingExtensions.readBoolExtension(qi, "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-hidden")) { -// defn(tbl, "Hidden Item", "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse-displayCategory", "This item is a hidden question", null); +// defn(tbl, "Hidden Item", "https://hl7.org/fhir/R4/extension-questionnaire-displayCategory.html", "This item is a hidden question", null); // } // if (ToolingExtensions.readBoolExtension(qi, "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-optionalDisplay")) { // defn(tbl, "Hidden Item", "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-QuestionnaireResponse-optionalDisplay", "This item is optional to display", null); From b581e36cb5ec1b19b319c3511e088d92b6f9c70f Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 18 Jan 2024 11:42:27 +1100 Subject: [PATCH 6/8] add error message for tx.fhir.org --- .../main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java | 1 + org.hl7.fhir.utilities/src/main/resources/Messages.properties | 1 + .../test/resources/txCache/org.hl7.fhir.r5/vs-externals.json | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) 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 7e3526de1..08a496853 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 @@ -65,6 +65,7 @@ public class I18nConstants { public static final String CODESYSTEM_CS_UNK_EXPANSION = "CODESYSTEM_CS_UNK_EXPANSION"; public static final String CODE_FOUND_IN_EXPANSION_HOWEVER_ = "Code_found_in_expansion_however_"; public static final String CODING_HAS_NO_SYSTEM__CANNOT_VALIDATE = "Coding_has_no_system__cannot_validate"; + public static final String Coding_has_no_system__cannot_validate_NO_INFER = "Coding_has_no_system__cannot_validate_NO_INFER"; public static final String CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_ = "Contained_resource_does_not_appear_to_be_a_FHIR_resource_unknown_name_"; public static final String Could_not_match_discriminator_for_slice_in_profile = "Could_not_match_discriminator_for_slice_in_profile"; public static final String DEFINED_IN_THE_PROFILE = "defined_in_the_profile"; diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index 585faaafa..eaaa56314 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -482,6 +482,7 @@ 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 {2} was not found 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. A code with no system has no defined meaning, and it cannot be validated. A system should be provided +Coding_has_no_system__cannot_validate_NO_INFER = Coding has no system, and inferring the code system is not possible in this context. A code with no system has no defined meaning, and it cannot be validated. A system should be provided Unable_to_handle_system__concept_filter_with_op__ = Unable to handle system {0} concept filter with op = {1} UNABLE_TO_HANDLE_SYSTEM__PROPERTY_FILTER_WITH_OP__ = Unable to handle system {0} property filter with op = {1} Unable_to_handle_system__filter_with_property__ = Unable to handle system {0} filter with property = {1}, op = {2} diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.r5/vs-externals.json b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.r5/vs-externals.json index d01076756..524134a31 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.r5/vs-externals.json +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.r5/vs-externals.json @@ -2,5 +2,7 @@ "http://somewhere/something-else" : null, "http://loinc.org/vs/LL715-4" : null, "http://hl7.org/fhir/us/vrdr/ValueSet/vrdr-PlaceOfDeath" : null, - "http://somewhere/something" : null + "http://somewhere/something" : null, + "https://fhir.infoway-inforoute.ca/ValueSet/issuetype|20190415" : null, + "https://fhir.infoway-inforoute.ca/ValueSet/issueseverity|20190415" : null } From 1c0e332d0561f492b837820b57cd1d04a65a0065 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 18 Jan 2024 11:47:07 +1100 Subject: [PATCH 7/8] update test case dependency --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1e2619dba..bd02779d4 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 32.0.1-jre 6.4.1 - 1.4.24 + 1.4.25 2.16.0 5.9.2 1.8.2 From 5833c13b91b5ce739271829e59b914bef2acf247 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 18 Jan 2024 11:48:27 +1100 Subject: [PATCH 8/8] release notes --- RELEASE_NOTES.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7b06c6ab5..5c5c39fef 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,9 @@ ## Validator Changes -* no changes +* Remove debugging code hiding error from server ## Other code changes -* no changes \ No newline at end of file +* fix broken links rendering questionnaires +* render target profiles on operation definition parameters +* fix up cvx importer