From 2c87e00034fd6520d3bb498aae243f4898800cbb Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 15 Nov 2023 20:33:37 +1100 Subject: [PATCH 01/32] Add release notes --- RELEASE_NOTES.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7b06c6ab5..636c6ee91 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,18 @@ ## Validator Changes -* no changes +* Rework bundle references validation for R4+ - this is a *significant* change - many existing bundles that were previously erroneously passing will now fail +* #1488 - don't fail on erroneously repeating elements +* Fix problem creating CDA type discriminators +* Fix problem with R3 expansion +* Add support for CCDA .hasTemplateIdOf(canonical) +* Add support for NZ IPS + ## Other code changes -* no changes \ No newline at end of file +* Start work on making IWorkerContext a versioned API + * Add fhirVersion to R5 Base and IWorkerContext methods + * move IContextResourceLoader, ValidationResult and CodingValidationRequest out of IWorkerContext to their own clasess +* Fix up VSAC import for large value sets +* fix FHIRPath cda tests for empty package cache +* Fix issue where markdown with multiple characters was being cut off sometimes when rendering profiles From e009734d85bb12506e27b23f1a9b6b45fd6759ad Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 17 Nov 2023 07:10:02 +1100 Subject: [PATCH 02/32] fix committee URLs --- .../src/test/resources/extension_r3_dt_base.json | 2 +- .../src/test/resources/extension_r3_dt_path.json | 2 +- .../src/test/resources/extension_r3_res_base.json | 2 +- .../src/test/resources/extension_r3_res_path.json | 2 +- .../fhir/dstu3/model/codesystems/Hl7WorkGroup.java | 12 ++++++------ .../hl7/fhir/r4/model/codesystems/Hl7WorkGroup.java | 12 ++++++------ .../java/org/hl7/fhir/utilities/HL7WorkGroups.java | 6 +++--- .../fhir/validation/instance/SpecialExtensions.java | 10 +++++----- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/org.hl7.fhir.convertors/src/test/resources/extension_r3_dt_base.json b/org.hl7.fhir.convertors/src/test/resources/extension_r3_dt_base.json index 34036a2ef..0ce48ea18 100644 --- a/org.hl7.fhir.convertors/src/test/resources/extension_r3_dt_base.json +++ b/org.hl7.fhir.convertors/src/test/resources/extension_r3_dt_base.json @@ -21,7 +21,7 @@ "telecom": [ { "system": "url", - "value": "http://hl7.org/special/committees/FHIR" + "value": "http://www.hl7.org/Special/committees/FHIR" } ] } diff --git a/org.hl7.fhir.convertors/src/test/resources/extension_r3_dt_path.json b/org.hl7.fhir.convertors/src/test/resources/extension_r3_dt_path.json index 774edf042..ce5145c3d 100644 --- a/org.hl7.fhir.convertors/src/test/resources/extension_r3_dt_path.json +++ b/org.hl7.fhir.convertors/src/test/resources/extension_r3_dt_path.json @@ -21,7 +21,7 @@ "telecom": [ { "system": "url", - "value": "http://hl7.org/special/committees/FHIR" + "value": "http://www.hl7.org/Special/committees/FHIR" } ] } diff --git a/org.hl7.fhir.convertors/src/test/resources/extension_r3_res_base.json b/org.hl7.fhir.convertors/src/test/resources/extension_r3_res_base.json index 915bcddb2..45bf304b5 100644 --- a/org.hl7.fhir.convertors/src/test/resources/extension_r3_res_base.json +++ b/org.hl7.fhir.convertors/src/test/resources/extension_r3_res_base.json @@ -22,7 +22,7 @@ "telecom": [ { "system": "url", - "value": "http://hl7.org/special/committees/fhir.htm" + "value": "http://www.hl7.org/Special/committees/fhir.htm" } ] } diff --git a/org.hl7.fhir.convertors/src/test/resources/extension_r3_res_path.json b/org.hl7.fhir.convertors/src/test/resources/extension_r3_res_path.json index 5cd949a66..22a7a7851 100644 --- a/org.hl7.fhir.convertors/src/test/resources/extension_r3_res_path.json +++ b/org.hl7.fhir.convertors/src/test/resources/extension_r3_res_path.json @@ -22,7 +22,7 @@ "telecom": [ { "system": "url", - "value": "http://hl7.org/special/committees/fhir.htm" + "value": "http://www.hl7.org/Special/committees/fhir.htm" } ] } diff --git a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroup.java b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroup.java index 3998e31c1..a4ac32012 100644 --- a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroup.java +++ b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/Hl7WorkGroup.java @@ -60,7 +60,7 @@ public enum Hl7WorkGroup { */ DEV, /** - * Electronic Health Records (http://www.hl7.org/special/committees/ehr/index.cfm) + * Electronic Health Records (http://www.hl7.org/Special/committees/ehr/index.cfm) */ EHR, /** @@ -80,11 +80,11 @@ public enum Hl7WorkGroup { */ II, /** - * Infrastructure And Messaging (http://www.hl7.org/special/committees/inm/index.cfm) + * Infrastructure And Messaging (http://www.hl7.org/Special/committees/inm/index.cfm) */ INM, /** - * Implementable Technology Specifications (http://www.hl7.org/special/committees/xml/index.cfm) + * Implementable Technology Specifications (http://www.hl7.org/Special/committees/xml/index.cfm) */ ITS, /** @@ -225,13 +225,13 @@ public enum Hl7WorkGroup { case CQI: return "Clinical Quality Information (http://www.hl7.org/Special/committees/cqi/index.cfm)"; case CG: return "Clinical Genomics (http://www.hl7.org/Special/committees/clingenomics/index.cfm)"; case DEV: return "Health Care Devices (http://www.hl7.org/Special/committees/healthcaredevices/index.cfm)"; - case EHR: return "Electronic Health Records (http://www.hl7.org/special/committees/ehr/index.cfm)"; + case EHR: return "Electronic Health Records (http://www.hl7.org/Special/committees/ehr/index.cfm)"; case FHIR: return "FHIR Infrastructure (http://www.hl7.org/Special/committees/fiwg/index.cfm)"; case FM: return "Financial Management (http://www.hl7.org/Special/committees/fm/index.cfm)"; case HSI: return "Health Standards Integration (http://www.hl7.org/Special/committees/hsi/index.cfm)"; case II: return "Imaging Integration (http://www.hl7.org/Special/committees/imagemgt/index.cfm)"; - case INM: return "Infrastructure And Messaging (http://www.hl7.org/special/committees/inm/index.cfm)"; - case ITS: return "Implementable Technology Specifications (http://www.hl7.org/special/committees/xml/index.cfm)"; + case INM: return "Infrastructure And Messaging (http://www.hl7.org/Special/committees/inm/index.cfm)"; + case ITS: return "Implementable Technology Specifications (http://www.hl7.org/Special/committees/xml/index.cfm)"; case OO: return "Orders and Observations (http://www.hl7.org/Special/committees/orders/index.cfm)"; case PA: return "Patient Administration (http://www.hl7.org/Special/committees/pafm/index.cfm)"; case PC: return "Patient Care (http://www.hl7.org/Special/committees/patientcare/index.cfm)"; diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/codesystems/Hl7WorkGroup.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/codesystems/Hl7WorkGroup.java index d4d94e6b4..0e580ae36 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/codesystems/Hl7WorkGroup.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/codesystems/Hl7WorkGroup.java @@ -62,7 +62,7 @@ public enum Hl7WorkGroup { DEV, /** * Electronic Health Records - * (http://www.hl7.org/special/committees/ehr/index.cfm). + * (http://www.hl7.org/Special/committees/ehr/index.cfm). */ EHR, /** @@ -85,12 +85,12 @@ public enum Hl7WorkGroup { II, /** * Infrastructure And Messaging - * (http://www.hl7.org/special/committees/inm/index.cfm). + * (http://www.hl7.org/Special/committees/inm/index.cfm). */ INM, /** * Implementable Technology Specifications - * (http://www.hl7.org/special/committees/xml/index.cfm). + * (http://www.hl7.org/Special/committees/xml/index.cfm). */ ITS, /** @@ -281,7 +281,7 @@ public enum Hl7WorkGroup { case DEV: return "Health Care Devices (http://www.hl7.org/Special/committees/healthcaredevices/index.cfm)."; case EHR: - return "Electronic Health Records (http://www.hl7.org/special/committees/ehr/index.cfm)."; + return "Electronic Health Records (http://www.hl7.org/Special/committees/ehr/index.cfm)."; case FHIR: return "FHIR Infrastructure (http://www.hl7.org/Special/committees/fiwg/index.cfm)."; case FM: @@ -291,9 +291,9 @@ public enum Hl7WorkGroup { case II: return "Imaging Integration (http://www.hl7.org/Special/committees/imagemgt/index.cfm)."; case INM: - return "Infrastructure And Messaging (http://www.hl7.org/special/committees/inm/index.cfm)."; + return "Infrastructure And Messaging (http://www.hl7.org/Special/committees/inm/index.cfm)."; case ITS: - return "Implementable Technology Specifications (http://www.hl7.org/special/committees/xml/index.cfm)."; + return "Implementable Technology Specifications (http://www.hl7.org/Special/committees/xml/index.cfm)."; case MNM: return "Modeling and Methodology (http://www.hl7.org/Special/committees/mnm/index.cfm)."; case OO: diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/HL7WorkGroups.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/HL7WorkGroups.java index 24994497e..0a22b27eb 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/HL7WorkGroups.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/HL7WorkGroups.java @@ -52,7 +52,7 @@ public class HL7WorkGroups { case "claims": return "http://www.hl7.org/Special/committees/claims"; case "cqi": return "http://www.hl7.org/Special/committees/cqi"; case "dev": return "http://www.hl7.org/Special/committees/healthcaredevices"; - case "ehr": return "http://www.hl7.org/special/committees/ehr"; + case "ehr": return "http://www.hl7.org/Special/committees/ehr"; case "ec": return "http://www.hl7.org/Special/committees/emergencycare"; case "fhir": return "http://www.hl7.org/Special/committees/fiwg"; case "fmg": return "http://www.hl7.org/Special/committees/fhirmg"; @@ -62,8 +62,8 @@ public class HL7WorkGroups { case "hta": return "http://www.hl7.org/Special/committees/termauth"; case "ictc": return "http://www.hl7.org/Special/committees/ictc"; case "ii": return "http://www.hl7.org/Special/committees/imagemgt"; - case "inm": return "http://www.hl7.org/special/committees/inm"; - case "its": return "http://www.hl7.org/special/committees/xml"; + case "inm": return "http://www.hl7.org/Special/committees/inm"; + case "its": return "http://www.hl7.org/Special/committees/xml"; case "lhs": return "http://www.hl7.org/Special/committees/lhs"; case "mnm": return "http://www.hl7.org/Special/committees/mnm"; case "mobile": return "http://www.hl7.org/Special/committees/mobile"; diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/SpecialExtensions.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/SpecialExtensions.java index a355f870d..81cd30b72 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/SpecialExtensions.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/SpecialExtensions.java @@ -11,13 +11,13 @@ import org.hl7.fhir.r5.model.StructureDefinition; public class SpecialExtensions { // copied from R5 spec - private static final String MUST_SUPPORT_SOURCE = "{\"resourceType\" : \"StructureDefinition\",\"id\" : \"elementdefinition-type-must-support\",\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\",\"valueCode\" : \"fhir\"},{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\",\"valueInteger\" : 1}],\"url\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support\",\"version\" : \"4.5.0\",\"name\" : \"type-must-support\",\"status\" : \"draft\",\"date\" : \"2015-02-28\",\"publisher\" : \"Health Level Seven, Inc. - FHIR Core WG\",\"contact\" : [{\"telecom\" : [{\"system\" : \"url\",\"value\" : \"http://hl7.org/special/committees/FHIR\"}]}],\"description\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"fhirVersion\" : \"4.5.0\",\"mapping\" : [{\"identity\" : \"rim\",\"uri\" : \"http://hl7.org/v3\",\"name\" : \"RIM Mapping\"}],\"kind\" : \"complex-type\",\"abstract\" : false,\"context\" : [{\"type\" : \"element\",\"expression\" : \"ElementDefinition.type\"},{\"type\" : \"element\",\"expression\" : \"ElementDefinition.type.profile\"},{\"type\" : \"element\",\"expression\" : \"ElementDefinition.type.targetProfile\"}],\"type\" : \"Extension\",\"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\",\"derivation\" : \"constraint\",\"snapshot\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"An element may be labelled as must support. This extension clarifies which types/profiles/targetProfiles are must-support. It has no meaning if the element itself is not must-support. If the element is labelled must-support, and none of the options are labelled as must support, then an application must support at least one of the possible options, but is not required to support all of them.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension\",\"min\" : 0,\"max\" : \"*\"},\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false},{\"id\" : \"Extension.id\",\"path\" : \"Extension.id\",\"representation\" : [\"xmlAttr\"],\"short\" : \"Unique id for inter-element referencing\",\"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Element.id\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"string\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"n/a\"}]},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"slicing\" : {\"discriminator\" : [{\"type\" : \"value\",\"path\" : \"url\"}],\"description\" : \"Extensions are always sliced by (at least) url\",\"rules\" : \"open\"},\"short\" : \"Extension\",\"definition\" : \"An Extension\",\"min\" : 0,\"max\" : \"0\",\"base\" : {\"path\" : \"Element.extension\",\"min\" : 0,\"max\" : \"*\"},\"type\" : [{\"code\" : \"Extension\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false,\"isSummary\" : false},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"representation\" : [\"xmlAttr\"],\"short\" : \"identifies the meaning of the extension\",\"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\",\"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.url\",\"min\" : 1,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"uri\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support\",\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"short\" : \"Value of extension\",\"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.value[x]\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"code\" : \"boolean\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]}]},\"differential\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"An element may be labelled as must support. This extension clarifies which types/profiles/targetProfiles are must-support. It has no meaning if the element itself is not must-support. If the element is labelled must-support, and none of the options are labelled as must support, then an application must support at least one of the possible options, but is not required to support all of them.\",\"min\" : 0,\"max\" : \"1\"},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"max\" : \"0\"},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support\"},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"min\" : 1,\"type\" : [{\"code\" : \"boolean\"}]}]}}"; - private static final String INSTANCE_NAME_SOURCE = "{\"resourceType\" : \"StructureDefinition\",\"id\" : \"instance-name\",\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\",\"valueCode\" : \"fhir\"},{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\",\"valueInteger\" : 1}],\"url\" : \"http://hl7.org/fhir/StructureDefinition/instance-name\",\"version\" : \"4.5.0\",\"name\" : \"instance-name\",\"status\" : \"draft\",\"date\" : \"2015-02-28\",\"publisher\" : \"Health Level Seven, Inc. - FHIR Core WG\",\"contact\" : [{\"telecom\" : [{\"system\" : \"url\",\"value\" : \"http://hl7.org/special/committees/FHIR\"}]}],\"description\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"fhirVersion\" : \"4.5.0\",\"mapping\" : [{\"identity\" : \"rim\",\"uri\" : \"http://hl7.org/v3\",\"name\" : \"RIM Mapping\"}],\"kind\" : \"complex-type\",\"abstract\" : false,\"context\" : [{\"type\" : \"element\",\"expression\" : \"Resource.meta\"}],\"type\" : \"Extension\",\"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\",\"derivation\" : \"constraint\",\"snapshot\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"todo.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension\",\"min\" : 0,\"max\" : \"*\"},\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false},{\"id\" : \"Extension.id\",\"path\" : \"Extension.id\",\"representation\" : [\"xmlAttr\"],\"short\" : \"Unique id for inter-element referencing\",\"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Element.id\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"string\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"n/a\"}]},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"slicing\" : {\"discriminator\" : [{\"type\" : \"value\",\"path\" : \"url\"}],\"description\" : \"Extensions are always sliced by (at least) url\",\"rules\" : \"open\"},\"short\" : \"Extension\",\"definition\" : \"An Extension\",\"min\" : 0,\"max\" : \"0\",\"base\" : {\"path\" : \"Element.extension\",\"min\" : 0,\"max\" : \"*\"},\"type\" : [{\"code\" : \"Extension\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false,\"isSummary\" : false},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"representation\" : [\"xmlAttr\"],\"short\" : \"identifies the meaning of the extension\",\"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\",\"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.url\",\"min\" : 1,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"uri\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/instance-name\",\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"short\" : \"Value of extension\",\"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.value[x]\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"code\" : \"string\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]}]},\"differential\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"todo.\",\"min\" : 0,\"max\" : \"1\"},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"max\" : \"0\"},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/instance-name\"},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"min\" : 1,\"type\" : [{\"code\" : \"string\"}]}]}}"; - private static final String INSTANCE_DESC_SOURCE = "{\"resourceType\" : \"StructureDefinition\",\"id\" : \"instance-description\",\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\",\"valueCode\" : \"fhir\"},{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\",\"valueInteger\" : 1}],\"url\" : \"http://hl7.org/fhir/StructureDefinition/instance-description\",\"version\" : \"4.5.0\",\"name\" : \"instance-description\",\"status\" : \"draft\",\"date\" : \"2015-02-28\",\"publisher\" : \"Health Level Seven, Inc. - FHIR Core WG\",\"contact\" : [{\"telecom\" : [{\"system\" : \"url\",\"value\" : \"http://hl7.org/special/committees/FHIR\"}]}],\"description\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"fhirVersion\" : \"4.5.0\",\"mapping\" : [{\"identity\" : \"rim\",\"uri\" : \"http://hl7.org/v3\",\"name\" : \"RIM Mapping\"}],\"kind\" : \"complex-type\",\"abstract\" : false,\"context\" : [{\"type\" : \"element\",\"expression\" : \"Resource.meta\"}],\"type\" : \"Extension\",\"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\",\"derivation\" : \"constraint\",\"snapshot\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"todo.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension\",\"min\" : 0,\"max\" : \"*\"},\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false},{\"id\" : \"Extension.id\",\"path\" : \"Extension.id\",\"representation\" : [\"xmlAttr\"],\"short\" : \"Unique id for inter-element referencing\",\"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Element.id\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"markdown\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"n/a\"}]},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"slicing\" : {\"discriminator\" : [{\"type\" : \"value\",\"path\" : \"url\"}],\"description\" : \"Extensions are always sliced by (at least) url\",\"rules\" : \"open\"},\"short\" : \"Extension\",\"definition\" : \"An Extension\",\"min\" : 0,\"max\" : \"0\",\"base\" : {\"path\" : \"Element.extension\",\"min\" : 0,\"max\" : \"*\"},\"type\" : [{\"code\" : \"Extension\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false,\"isSummary\" : false},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"representation\" : [\"xmlAttr\"],\"short\" : \"identifies the meaning of the extension\",\"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\",\"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.url\",\"min\" : 1,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"uri\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/instance-description\",\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"short\" : \"Value of extension\",\"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.value[x]\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"code\" : \"markdown\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]}]},\"differential\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"todo.\",\"min\" : 0,\"max\" : \"1\"},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"max\" : \"0\"},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/instance-description\"},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"min\" : 1,\"type\" : [{\"code\" : \"markdown\"}]}]}}"; + private static final String MUST_SUPPORT_SOURCE = "{\"resourceType\" : \"StructureDefinition\",\"id\" : \"elementdefinition-type-must-support\",\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\",\"valueCode\" : \"fhir\"},{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\",\"valueInteger\" : 1}],\"url\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support\",\"version\" : \"4.5.0\",\"name\" : \"type-must-support\",\"status\" : \"draft\",\"date\" : \"2015-02-28\",\"publisher\" : \"Health Level Seven, Inc. - FHIR Core WG\",\"contact\" : [{\"telecom\" : [{\"system\" : \"url\",\"value\" : \"http://www.hl7.org/Special/committees/FHIR\"}]}],\"description\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"fhirVersion\" : \"4.5.0\",\"mapping\" : [{\"identity\" : \"rim\",\"uri\" : \"http://hl7.org/v3\",\"name\" : \"RIM Mapping\"}],\"kind\" : \"complex-type\",\"abstract\" : false,\"context\" : [{\"type\" : \"element\",\"expression\" : \"ElementDefinition.type\"},{\"type\" : \"element\",\"expression\" : \"ElementDefinition.type.profile\"},{\"type\" : \"element\",\"expression\" : \"ElementDefinition.type.targetProfile\"}],\"type\" : \"Extension\",\"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\",\"derivation\" : \"constraint\",\"snapshot\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"An element may be labelled as must support. This extension clarifies which types/profiles/targetProfiles are must-support. It has no meaning if the element itself is not must-support. If the element is labelled must-support, and none of the options are labelled as must support, then an application must support at least one of the possible options, but is not required to support all of them.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension\",\"min\" : 0,\"max\" : \"*\"},\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false},{\"id\" : \"Extension.id\",\"path\" : \"Extension.id\",\"representation\" : [\"xmlAttr\"],\"short\" : \"Unique id for inter-element referencing\",\"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Element.id\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"string\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"n/a\"}]},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"slicing\" : {\"discriminator\" : [{\"type\" : \"value\",\"path\" : \"url\"}],\"description\" : \"Extensions are always sliced by (at least) url\",\"rules\" : \"open\"},\"short\" : \"Extension\",\"definition\" : \"An Extension\",\"min\" : 0,\"max\" : \"0\",\"base\" : {\"path\" : \"Element.extension\",\"min\" : 0,\"max\" : \"*\"},\"type\" : [{\"code\" : \"Extension\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false,\"isSummary\" : false},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"representation\" : [\"xmlAttr\"],\"short\" : \"identifies the meaning of the extension\",\"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\",\"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.url\",\"min\" : 1,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"uri\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support\",\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"short\" : \"Value of extension\",\"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.value[x]\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"code\" : \"boolean\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]}]},\"differential\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"An element may be labelled as must support. This extension clarifies which types/profiles/targetProfiles are must-support. It has no meaning if the element itself is not must-support. If the element is labelled must-support, and none of the options are labelled as must support, then an application must support at least one of the possible options, but is not required to support all of them.\",\"min\" : 0,\"max\" : \"1\"},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"max\" : \"0\"},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support\"},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"min\" : 1,\"type\" : [{\"code\" : \"boolean\"}]}]}}"; + private static final String INSTANCE_NAME_SOURCE = "{\"resourceType\" : \"StructureDefinition\",\"id\" : \"instance-name\",\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\",\"valueCode\" : \"fhir\"},{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\",\"valueInteger\" : 1}],\"url\" : \"http://hl7.org/fhir/StructureDefinition/instance-name\",\"version\" : \"4.5.0\",\"name\" : \"instance-name\",\"status\" : \"draft\",\"date\" : \"2015-02-28\",\"publisher\" : \"Health Level Seven, Inc. - FHIR Core WG\",\"contact\" : [{\"telecom\" : [{\"system\" : \"url\",\"value\" : \"http://www.hl7.org/Special/committees/FHIR\"}]}],\"description\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"fhirVersion\" : \"4.5.0\",\"mapping\" : [{\"identity\" : \"rim\",\"uri\" : \"http://hl7.org/v3\",\"name\" : \"RIM Mapping\"}],\"kind\" : \"complex-type\",\"abstract\" : false,\"context\" : [{\"type\" : \"element\",\"expression\" : \"Resource.meta\"}],\"type\" : \"Extension\",\"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\",\"derivation\" : \"constraint\",\"snapshot\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"todo.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension\",\"min\" : 0,\"max\" : \"*\"},\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false},{\"id\" : \"Extension.id\",\"path\" : \"Extension.id\",\"representation\" : [\"xmlAttr\"],\"short\" : \"Unique id for inter-element referencing\",\"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Element.id\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"string\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"n/a\"}]},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"slicing\" : {\"discriminator\" : [{\"type\" : \"value\",\"path\" : \"url\"}],\"description\" : \"Extensions are always sliced by (at least) url\",\"rules\" : \"open\"},\"short\" : \"Extension\",\"definition\" : \"An Extension\",\"min\" : 0,\"max\" : \"0\",\"base\" : {\"path\" : \"Element.extension\",\"min\" : 0,\"max\" : \"*\"},\"type\" : [{\"code\" : \"Extension\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false,\"isSummary\" : false},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"representation\" : [\"xmlAttr\"],\"short\" : \"identifies the meaning of the extension\",\"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\",\"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.url\",\"min\" : 1,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"uri\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/instance-name\",\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"short\" : \"Value of extension\",\"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.value[x]\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"code\" : \"string\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]}]},\"differential\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"todo.\",\"min\" : 0,\"max\" : \"1\"},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"max\" : \"0\"},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/instance-name\"},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"min\" : 1,\"type\" : [{\"code\" : \"string\"}]}]}}"; + private static final String INSTANCE_DESC_SOURCE = "{\"resourceType\" : \"StructureDefinition\",\"id\" : \"instance-description\",\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\",\"valueCode\" : \"fhir\"},{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\",\"valueInteger\" : 1}],\"url\" : \"http://hl7.org/fhir/StructureDefinition/instance-description\",\"version\" : \"4.5.0\",\"name\" : \"instance-description\",\"status\" : \"draft\",\"date\" : \"2015-02-28\",\"publisher\" : \"Health Level Seven, Inc. - FHIR Core WG\",\"contact\" : [{\"telecom\" : [{\"system\" : \"url\",\"value\" : \"http://www.hl7.org/Special/committees/FHIR\"}]}],\"description\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"fhirVersion\" : \"4.5.0\",\"mapping\" : [{\"identity\" : \"rim\",\"uri\" : \"http://hl7.org/v3\",\"name\" : \"RIM Mapping\"}],\"kind\" : \"complex-type\",\"abstract\" : false,\"context\" : [{\"type\" : \"element\",\"expression\" : \"Resource.meta\"}],\"type\" : \"Extension\",\"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\",\"derivation\" : \"constraint\",\"snapshot\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"todo.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension\",\"min\" : 0,\"max\" : \"*\"},\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false},{\"id\" : \"Extension.id\",\"path\" : \"Extension.id\",\"representation\" : [\"xmlAttr\"],\"short\" : \"Unique id for inter-element referencing\",\"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Element.id\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"markdown\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"n/a\"}]},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"slicing\" : {\"discriminator\" : [{\"type\" : \"value\",\"path\" : \"url\"}],\"description\" : \"Extensions are always sliced by (at least) url\",\"rules\" : \"open\"},\"short\" : \"Extension\",\"definition\" : \"An Extension\",\"min\" : 0,\"max\" : \"0\",\"base\" : {\"path\" : \"Element.extension\",\"min\" : 0,\"max\" : \"*\"},\"type\" : [{\"code\" : \"Extension\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false,\"isSummary\" : false},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"representation\" : [\"xmlAttr\"],\"short\" : \"identifies the meaning of the extension\",\"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\",\"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.url\",\"min\" : 1,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"uri\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/instance-description\",\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"short\" : \"Value of extension\",\"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.value[x]\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"code\" : \"markdown\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]}]},\"differential\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"The specified type/profile/target must be supported by implementations\",\"definition\" : \"If true indicates that the specified type, profile or targetProfile must be supported by implementations.\",\"comment\" : \"todo.\",\"min\" : 0,\"max\" : \"1\"},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"max\" : \"0\"},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/instance-description\"},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"min\" : 1,\"type\" : [{\"code\" : \"markdown\"}]}]}}"; private static final String CODE_SYSTEM_PROPS_EXT = "{\"resourceType\" : \"StructureDefinition\",\"id\" : \"codesystem-properties-mode\",\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\",\"valueCode\" : \"vocab\"},{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\",\"valueInteger\" : 1}],\"url\" : \"http://hl7.org/fhir/StructureDefinition/codesystem-properties-mode\",\"version\" : \"4.6.0\",\"name\" : \"properties-mode\",\"status\" : \"draft\",\"date\" : \"2021-01-02T08:58:31+11:00\",\"publisher\" : \"HL7\",\"description\" : \"The extent to which the properties of the code system (including the filters) are represented in this resource instance.\",\"fhirVersion\" : \"4.6.0\",\"mapping\" : [{\"identity\" : \"rim\",\"uri\" : \"http://hl7.org/v3\",\"name\" : \"RIM Mapping\"}],\"kind\" : \"complex-type\",\"abstract\" : false,\"context\" : [{\"type\" : \"element\",\"expression\" : \"CodeSystem\"}],\"type\" : \"Extension\",\"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\",\"derivation\" : \"constraint\",\"snapshot\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"not-present | partial | complete\",\"definition\" : \"The extent to which the properties of the code system (including the filters) are represented in this resource instance.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension\",\"min\" : 0,\"max\" : \"*\"},\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false},{\"id\" : \"Extension.id\",\"path\" : \"Extension.id\",\"representation\" : [\"xmlAttr\"],\"short\" : \"Unique id for inter-element referencing\",\"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Element.id\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"string\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"n/a\"}]},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"slicing\" : {\"discriminator\" : [{\"type\" : \"value\",\"path\" : \"url\"}],\"description\" : \"Extensions are always sliced by (at least) url\",\"rules\" : \"open\"},\"short\" : \"Extension\",\"definition\" : \"An Extension\",\"min\" : 0,\"max\" : \"0\",\"base\" : {\"path\" : \"Element.extension\",\"min\" : 0,\"max\" : \"*\"},\"type\" : [{\"code\" : \"Extension\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false,\"isSummary\" : false},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"representation\" : [\"xmlAttr\"],\"short\" : \"identifies the meaning of the extension\",\"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\",\"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.url\",\"min\" : 1,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"uri\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/codesystem-properties-mode\",\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"short\" : \"Value of extension\",\"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.value[x]\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"code\" : \"code\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"}],\"isModifier\" : false,\"isSummary\" : false,\"binding\" : {\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName\",\"valueString\" : \"CodeSystemPropertiesMode\"}],\"strength\" : \"required\",\"description\" : \"The extent to which the properties of the code system (including the filters) are represented in a code system resource.\",\"valueSet\" : \"http://hl7.org/fhir/ValueSet/codesystem-properties-mode\"},\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]}]},\"differential\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"not-present | partial | complete\",\"definition\" : \"The extent to which the properties of the code system (including the filters) are represented in this resource instance.\",\"min\" : 0,\"max\" : \"1\",\"isModifier\" : false},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"max\" : \"0\"},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/codesystem-properties-mode\"},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"min\" : 1,\"type\" : [{\"code\" : \"code\"}],\"binding\" : {\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName\",\"valueString\" : \"CodeSystemPropertiesMode\"}],\"strength\" : \"required\",\"description\" : \"The extent to which the properties of the code system (including the filters) are represented in a code system resource.\",\"valueSet\" : \"http://hl7.org/fhir/ValueSet/codesystem-properties-mode\"}}]}}"; private static final String INSTANCE_DEFN = "{\"resourceType\" : \"StructureDefinition\",\"id\" : \"definition\",\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\",\"valueCode\" : \"fhir\"},{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\",\"valueInteger\" : 1}],\"url\" : \"http://hl7.org/fhir/StructureDefinition/definition\",\"version\" : \"4.6.0\",\"name\" : \"properties-mode\",\"status\" : \"draft\",\"date\" : \"2021-01-02T08:58:31+11:00\",\"publisher\" : \"HL7\",\"description\" : \"BindingDefinition\",\"fhirVersion\" : \"4.6.0\",\"mapping\" : [{\"identity\" : \"rim\",\"uri\" : \"http://hl7.org/v3\",\"name\" : \"RIM Mapping\"}],\"kind\" : \"complex-type\",\"abstract\" : false,\"context\" : [{\"type\" : \"element\",\"expression\" : \"CodeSystem\"}],\"type\" : \"Extension\",\"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\",\"derivation\" : \"constraint\",\"snapshot\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"not-present | partial | complete\",\"definition\" : \"The extent to which the properties of the code system (including the filters) are represented in this resource instance.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension\",\"min\" : 0,\"max\" : \"*\"},\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false},{\"id\" : \"Extension.id\",\"path\" : \"Extension.id\",\"representation\" : [\"xmlAttr\"],\"short\" : \"Unique id for inter-element referencing\",\"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\",\"min\" : 0,\"max\" : \"1\",\"base\" : {\"path\" : \"Element.id\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"string\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"n/a\"}]},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"slicing\" : {\"discriminator\" : [{\"type\" : \"value\",\"path\" : \"url\"}],\"description\" : \"Extensions are always sliced by (at least) url\",\"rules\" : \"open\"},\"short\" : \"Extension\",\"definition\" : \"An Extension\",\"min\" : 0,\"max\" : \"0\",\"base\" : {\"path\" : \"Element.extension\",\"min\" : 0,\"max\" : \"*\"},\"type\" : [{\"code\" : \"Extension\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"},{\"key\" : \"ext-1\",\"severity\" : \"error\",\"human\" : \"Must have either extensions or value[x], not both\",\"expression\" : \"extension.exists() != value.exists()\",\"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\"}],\"isModifier\" : false,\"isSummary\" : false},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"representation\" : [\"xmlAttr\"],\"short\" : \"identifies the meaning of the extension\",\"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\",\"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.url\",\"min\" : 1,\"max\" : \"1\"},\"type\" : [{\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\",\"valueUrl\" : \"uri\"}],\"code\" : \"http://hl7.org/fhirpath/System.String\"}],\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/definition\",\"isModifier\" : false,\"isSummary\" : false,\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"short\" : \"Value of extension\",\"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\",\"min\" : 1,\"max\" : \"1\",\"base\" : {\"path\" : \"Extension.value[x]\",\"min\" : 0,\"max\" : \"1\"},\"type\" : [{\"code\" : \"string\"}],\"constraint\" : [{\"key\" : \"ele-1\",\"severity\" : \"error\",\"human\" : \"All FHIR elements must have a @value or children\",\"expression\" : \"hasValue() or (children().count() > id.count())\",\"xpath\" : \"@value|f:*|h:div\",\"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\"}],\"isModifier\" : false,\"isSummary\" : false,\"binding\" : {\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName\",\"valueString\" : \"CodeSystemPropertiesMode\"}],\"strength\" : \"required\",\"description\" : \"The extent to which the properties of the code system (including the filters) are represented in a code system resource.\",\"valueSet\" : \"http://hl7.org/fhir/ValueSet/codesystem-properties-mode\"},\"mapping\" : [{\"identity\" : \"rim\",\"map\" : \"N/A\"}]}]},\"differential\" : {\"element\" : [{\"id\" : \"Extension\",\"path\" : \"Extension\",\"short\" : \"not-present | partial | complete\",\"definition\" : \"The extent to which the properties of the code system (including the filters) are represented in this resource instance.\",\"min\" : 0,\"max\" : \"1\",\"isModifier\" : false},{\"id\" : \"Extension.extension\",\"path\" : \"Extension.extension\",\"max\" : \"0\"},{\"id\" : \"Extension.url\",\"path\" : \"Extension.url\",\"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/codesystem-properties-mode\"},{\"id\" : \"Extension.value[x]\",\"path\" : \"Extension.value[x]\",\"min\" : 1,\"type\" : [{\"code\" : \"code\"}],\"binding\" : {\"extension\" : [{\"url\" : \"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName\",\"valueString\" : \"CodeSystemPropertiesMode\"}],\"strength\" : \"required\",\"description\" : \"The extent to which the properties of the code system (including the filters) are represented in a code system resource.\",\"valueSet\" : \"http://hl7.org/fhir/ValueSet/codesystem-properties-mode\"}}]}}"; - private static final String CONFORMANCE_DERIVED = "{ \"resourceType\" : \"StructureDefinition\", \"id\" : \"structuredefinition-conformance-derivedFrom\", \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\", \"valueCode\" : \"fhir\" }, { \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\", \"valueInteger\" : 1 }], \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom\", \"version\" : \"4.6.0\", \"name\" : \"fmm\", \"status\" : \"draft\", \"date\" : \"2014-01-31\", \"publisher\" : \"Health Level Seven, Inc. - [WG Name] WG\", \"contact\" : [{ \"telecom\" : [{ \"system\" : \"url\", \"value\" : \"http://hl7.org/special/committees/FHIR\" }] }], \"description\" : \"Indicates one of the resources that was used to infer the specified maturity or standards status\", \"fhirVersion\" : \"4.6.0\", \"mapping\" : [{ \"identity\" : \"rim\", \"uri\" : \"http://hl7.org/v3\", \"name\" : \"RIM Mapping\" }], \"kind\" : \"complex-type\", \"abstract\" : false, \"context\" : [{ \"type\" : \"fhirpath\", \"expression\" : \"extension('http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm').value\" }, { \"type\" : \"fhirpath\", \"expression\" : \"extension('http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status').value\" }], \"type\" : \"Extension\", \"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\", \"derivation\" : \"constraint\", \"snapshot\" : { \"element\" : [{ \"id\" : \"Extension\", \"path\" : \"Extension\", \"short\" : \"FMM Level\", \"definition\" : \"Indicates one of the resources that was used to infer the specified maturity or standards status\", \"min\" : 0, \"max\" : \"*\", \"base\" : { \"path\" : \"Extension\", \"min\" : 0, \"max\" : \"*\" }, \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }, { \"key\" : \"ext-1\", \"severity\" : \"error\", \"human\" : \"Must have either extensions or value[x], not both\", \"expression\" : \"extension.exists() != value.exists()\", \"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\" }], \"isModifier\" : false }, { \"id\" : \"Extension.id\", \"path\" : \"Extension.id\", \"representation\" : [\"xmlAttr\"], \"short\" : \"Unique id for inter-element referencing\", \"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\", \"min\" : 0, \"max\" : \"1\", \"base\" : { \"path\" : \"Element.id\", \"min\" : 0, \"max\" : \"1\" }, \"type\" : [{ \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\", \"valueUrl\" : \"string\" }], \"code\" : \"http://hl7.org/fhirpath/System.String\" }], \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"n/a\" }] }, { \"id\" : \"Extension.extension\", \"path\" : \"Extension.extension\", \"slicing\" : { \"discriminator\" : [{ \"type\" : \"value\", \"path\" : \"url\" }], \"description\" : \"Extensions are always sliced by (at least) url\", \"rules\" : \"open\" }, \"short\" : \"Extension\", \"definition\" : \"An Extension\", \"min\" : 0, \"max\" : \"0\", \"base\" : { \"path\" : \"Element.extension\", \"min\" : 0, \"max\" : \"*\" }, \"type\" : [{ \"code\" : \"Extension\" }], \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }, { \"key\" : \"ext-1\", \"severity\" : \"error\", \"human\" : \"Must have either extensions or value[x], not both\", \"expression\" : \"extension.exists() != value.exists()\", \"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\" }], \"isModifier\" : false, \"isSummary\" : false }, { \"id\" : \"Extension.url\", \"path\" : \"Extension.url\", \"representation\" : [\"xmlAttr\"], \"short\" : \"identifies the meaning of the extension\", \"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\", \"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\", \"min\" : 1, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension.url\", \"min\" : 1, \"max\" : \"1\" }, \"type\" : [{ \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\", \"valueUrl\" : \"uri\" }], \"code\" : \"http://hl7.org/fhirpath/System.String\" }], \"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom\", \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"N/A\" }] }, { \"id\" : \"Extension.value[x]\", \"path\" : \"Extension.value[x]\", \"short\" : \"Value of extension\", \"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\", \"min\" : 1, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension.value[x]\", \"min\" : 0, \"max\" : \"1\" }, \"type\" : [{ \"code\" : \"canonical\" }], \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }], \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"N/A\" }] }] }, \"differential\" : { \"element\" : [{ \"id\" : \"Extension\", \"path\" : \"Extension\", \"short\" : \"FMM Level\", \"definition\" : \"Indicates one of the resources that was used to infer the specified maturity or standards status\", \"min\" : 0, \"max\" : \"*\" }, { \"id\" : \"Extension.extension\", \"path\" : \"Extension.extension\", \"max\" : \"0\" }, { \"id\" : \"Extension.url\", \"path\" : \"Extension.url\", \"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom\" }, { \"id\" : \"Extension.value[x]\", \"path\" : \"Extension.value[x]\", \"min\" : 1, \"type\" : [{ \"code\" : \"canonical\" }] }] } }"; - private static final String FMM_SUPPORT = "{ \"resourceType\" : \"StructureDefinition\", \"id\" : \"structuredefinition-fmm-support\", \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\", \"valueCode\" : \"fhir\" }, { \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\", \"valueInteger\" : 1 }], \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-support\", \"version\" : \"4.6.0\", \"name\" : \"fmm\", \"status\" : \"draft\", \"date\" : \"2014-01-31\", \"publisher\" : \"Health Level Seven, Inc. - [WG Name] WG\", \"contact\" : [{ \"telecom\" : [{ \"system\" : \"url\", \"value\" : \"http://hl7.org/special/committees/FHIR\" }] }], \"description\" : \"The documentation supporting the FMM level assigned to the artifact.\", \"fhirVersion\" : \"4.6.0\", \"mapping\" : [{ \"identity\" : \"rim\", \"uri\" : \"http://hl7.org/v3\", \"name\" : \"RIM Mapping\" }], \"kind\" : \"complex-type\", \"abstract\" : false, \"context\" : [{ \"type\" : \"element\", \"expression\" : \"Element\" }], \"type\" : \"Extension\", \"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\", \"derivation\" : \"constraint\", \"snapshot\" : { \"element\" : [{ \"id\" : \"Extension\", \"path\" : \"Extension\", \"short\" : \"FMM Level\", \"definition\" : \"The documentation supporting the FMM level assigned to the artifact.\", \"comment\" : \"Though this is defined for resources, it can be used for any artifact.\", \"min\" : 0, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension\", \"min\" : 0, \"max\" : \"*\" }, \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }, { \"key\" : \"ext-1\", \"severity\" : \"error\", \"human\" : \"Must have either extensions or value[x], not both\", \"expression\" : \"extension.exists() != value.exists()\", \"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\" }], \"isModifier\" : false }, { \"id\" : \"Extension.id\", \"path\" : \"Extension.id\", \"representation\" : [\"xmlAttr\"], \"short\" : \"Unique id for inter-element referencing\", \"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\", \"min\" : 0, \"max\" : \"1\", \"base\" : { \"path\" : \"Element.id\", \"min\" : 0, \"max\" : \"1\" }, \"type\" : [{ \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\", \"valueUrl\" : \"string\" }], \"code\" : \"http://hl7.org/fhirpath/System.String\" }], \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"n/a\" }] }, { \"id\" : \"Extension.extension\", \"path\" : \"Extension.extension\", \"slicing\" : { \"discriminator\" : [{ \"type\" : \"value\", \"path\" : \"url\" }], \"description\" : \"Extensions are always sliced by (at least) url\", \"rules\" : \"open\" }, \"short\" : \"Extension\", \"definition\" : \"An Extension\", \"min\" : 0, \"max\" : \"0\", \"base\" : { \"path\" : \"Element.extension\", \"min\" : 0, \"max\" : \"*\" }, \"type\" : [{ \"code\" : \"Extension\" }], \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }, { \"key\" : \"ext-1\", \"severity\" : \"error\", \"human\" : \"Must have either extensions or value[x], not both\", \"expression\" : \"extension.exists() != value.exists()\", \"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\" }], \"isModifier\" : false, \"isSummary\" : false }, { \"id\" : \"Extension.url\", \"path\" : \"Extension.url\", \"representation\" : [\"xmlAttr\"], \"short\" : \"identifies the meaning of the extension\", \"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\", \"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\", \"min\" : 1, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension.url\", \"min\" : 1, \"max\" : \"1\" }, \"type\" : [{ \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\", \"valueUrl\" : \"uri\" }], \"code\" : \"http://hl7.org/fhirpath/System.String\" }], \"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-support\", \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"N/A\" }] }, { \"id\" : \"Extension.value[x]\", \"path\" : \"Extension.value[x]\", \"short\" : \"Value of extension\", \"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\", \"min\" : 1, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension.value[x]\", \"min\" : 0, \"max\" : \"1\" }, \"type\" : [{ \"code\" : \"markdown\" }], \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }], \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"N/A\" }] }] }, \"differential\" : { \"element\" : [{ \"id\" : \"Extension\", \"path\" : \"Extension\", \"short\" : \"FMM Level\", \"definition\" : \"The documentation supporting the FMM level assigned to the artifact.\", \"comment\" : \"Though this is defined for resources, it can be used for any artifact.\", \"min\" : 0, \"max\" : \"1\" }, { \"id\" : \"Extension.extension\", \"path\" : \"Extension.extension\", \"max\" : \"0\" }, { \"id\" : \"Extension.url\", \"path\" : \"Extension.url\", \"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-support\" }, { \"id\" : \"Extension.value[x]\", \"path\" : \"Extension.value[x]\", \"min\" : 1, \"type\" : [{ \"code\" : \"markdown\" }] }] } }"; + private static final String CONFORMANCE_DERIVED = "{ \"resourceType\" : \"StructureDefinition\", \"id\" : \"structuredefinition-conformance-derivedFrom\", \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\", \"valueCode\" : \"fhir\" }, { \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\", \"valueInteger\" : 1 }], \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom\", \"version\" : \"4.6.0\", \"name\" : \"fmm\", \"status\" : \"draft\", \"date\" : \"2014-01-31\", \"publisher\" : \"Health Level Seven, Inc. - [WG Name] WG\", \"contact\" : [{ \"telecom\" : [{ \"system\" : \"url\", \"value\" : \"http://www.hl7.org/Special/committees/FHIR\" }] }], \"description\" : \"Indicates one of the resources that was used to infer the specified maturity or standards status\", \"fhirVersion\" : \"4.6.0\", \"mapping\" : [{ \"identity\" : \"rim\", \"uri\" : \"http://hl7.org/v3\", \"name\" : \"RIM Mapping\" }], \"kind\" : \"complex-type\", \"abstract\" : false, \"context\" : [{ \"type\" : \"fhirpath\", \"expression\" : \"extension('http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm').value\" }, { \"type\" : \"fhirpath\", \"expression\" : \"extension('http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status').value\" }], \"type\" : \"Extension\", \"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\", \"derivation\" : \"constraint\", \"snapshot\" : { \"element\" : [{ \"id\" : \"Extension\", \"path\" : \"Extension\", \"short\" : \"FMM Level\", \"definition\" : \"Indicates one of the resources that was used to infer the specified maturity or standards status\", \"min\" : 0, \"max\" : \"*\", \"base\" : { \"path\" : \"Extension\", \"min\" : 0, \"max\" : \"*\" }, \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }, { \"key\" : \"ext-1\", \"severity\" : \"error\", \"human\" : \"Must have either extensions or value[x], not both\", \"expression\" : \"extension.exists() != value.exists()\", \"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\" }], \"isModifier\" : false }, { \"id\" : \"Extension.id\", \"path\" : \"Extension.id\", \"representation\" : [\"xmlAttr\"], \"short\" : \"Unique id for inter-element referencing\", \"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\", \"min\" : 0, \"max\" : \"1\", \"base\" : { \"path\" : \"Element.id\", \"min\" : 0, \"max\" : \"1\" }, \"type\" : [{ \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\", \"valueUrl\" : \"string\" }], \"code\" : \"http://hl7.org/fhirpath/System.String\" }], \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"n/a\" }] }, { \"id\" : \"Extension.extension\", \"path\" : \"Extension.extension\", \"slicing\" : { \"discriminator\" : [{ \"type\" : \"value\", \"path\" : \"url\" }], \"description\" : \"Extensions are always sliced by (at least) url\", \"rules\" : \"open\" }, \"short\" : \"Extension\", \"definition\" : \"An Extension\", \"min\" : 0, \"max\" : \"0\", \"base\" : { \"path\" : \"Element.extension\", \"min\" : 0, \"max\" : \"*\" }, \"type\" : [{ \"code\" : \"Extension\" }], \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }, { \"key\" : \"ext-1\", \"severity\" : \"error\", \"human\" : \"Must have either extensions or value[x], not both\", \"expression\" : \"extension.exists() != value.exists()\", \"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\" }], \"isModifier\" : false, \"isSummary\" : false }, { \"id\" : \"Extension.url\", \"path\" : \"Extension.url\", \"representation\" : [\"xmlAttr\"], \"short\" : \"identifies the meaning of the extension\", \"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\", \"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\", \"min\" : 1, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension.url\", \"min\" : 1, \"max\" : \"1\" }, \"type\" : [{ \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\", \"valueUrl\" : \"uri\" }], \"code\" : \"http://hl7.org/fhirpath/System.String\" }], \"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom\", \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"N/A\" }] }, { \"id\" : \"Extension.value[x]\", \"path\" : \"Extension.value[x]\", \"short\" : \"Value of extension\", \"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\", \"min\" : 1, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension.value[x]\", \"min\" : 0, \"max\" : \"1\" }, \"type\" : [{ \"code\" : \"canonical\" }], \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }], \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"N/A\" }] }] }, \"differential\" : { \"element\" : [{ \"id\" : \"Extension\", \"path\" : \"Extension\", \"short\" : \"FMM Level\", \"definition\" : \"Indicates one of the resources that was used to infer the specified maturity or standards status\", \"min\" : 0, \"max\" : \"*\" }, { \"id\" : \"Extension.extension\", \"path\" : \"Extension.extension\", \"max\" : \"0\" }, { \"id\" : \"Extension.url\", \"path\" : \"Extension.url\", \"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom\" }, { \"id\" : \"Extension.value[x]\", \"path\" : \"Extension.value[x]\", \"min\" : 1, \"type\" : [{ \"code\" : \"canonical\" }] }] } }"; + private static final String FMM_SUPPORT = "{ \"resourceType\" : \"StructureDefinition\", \"id\" : \"structuredefinition-fmm-support\", \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\", \"valueCode\" : \"fhir\" }, { \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\", \"valueInteger\" : 1 }], \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-support\", \"version\" : \"4.6.0\", \"name\" : \"fmm\", \"status\" : \"draft\", \"date\" : \"2014-01-31\", \"publisher\" : \"Health Level Seven, Inc. - [WG Name] WG\", \"contact\" : [{ \"telecom\" : [{ \"system\" : \"url\", \"value\" : \"http://www.hl7.org/Special/committees/FHIR\" }] }], \"description\" : \"The documentation supporting the FMM level assigned to the artifact.\", \"fhirVersion\" : \"4.6.0\", \"mapping\" : [{ \"identity\" : \"rim\", \"uri\" : \"http://hl7.org/v3\", \"name\" : \"RIM Mapping\" }], \"kind\" : \"complex-type\", \"abstract\" : false, \"context\" : [{ \"type\" : \"element\", \"expression\" : \"Element\" }], \"type\" : \"Extension\", \"baseDefinition\" : \"http://hl7.org/fhir/StructureDefinition/Extension\", \"derivation\" : \"constraint\", \"snapshot\" : { \"element\" : [{ \"id\" : \"Extension\", \"path\" : \"Extension\", \"short\" : \"FMM Level\", \"definition\" : \"The documentation supporting the FMM level assigned to the artifact.\", \"comment\" : \"Though this is defined for resources, it can be used for any artifact.\", \"min\" : 0, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension\", \"min\" : 0, \"max\" : \"*\" }, \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }, { \"key\" : \"ext-1\", \"severity\" : \"error\", \"human\" : \"Must have either extensions or value[x], not both\", \"expression\" : \"extension.exists() != value.exists()\", \"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\" }], \"isModifier\" : false }, { \"id\" : \"Extension.id\", \"path\" : \"Extension.id\", \"representation\" : [\"xmlAttr\"], \"short\" : \"Unique id for inter-element referencing\", \"definition\" : \"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.\", \"min\" : 0, \"max\" : \"1\", \"base\" : { \"path\" : \"Element.id\", \"min\" : 0, \"max\" : \"1\" }, \"type\" : [{ \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\", \"valueUrl\" : \"string\" }], \"code\" : \"http://hl7.org/fhirpath/System.String\" }], \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"n/a\" }] }, { \"id\" : \"Extension.extension\", \"path\" : \"Extension.extension\", \"slicing\" : { \"discriminator\" : [{ \"type\" : \"value\", \"path\" : \"url\" }], \"description\" : \"Extensions are always sliced by (at least) url\", \"rules\" : \"open\" }, \"short\" : \"Extension\", \"definition\" : \"An Extension\", \"min\" : 0, \"max\" : \"0\", \"base\" : { \"path\" : \"Element.extension\", \"min\" : 0, \"max\" : \"*\" }, \"type\" : [{ \"code\" : \"Extension\" }], \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }, { \"key\" : \"ext-1\", \"severity\" : \"error\", \"human\" : \"Must have either extensions or value[x], not both\", \"expression\" : \"extension.exists() != value.exists()\", \"xpath\" : \"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \\\"value\\\")])\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Extension\" }], \"isModifier\" : false, \"isSummary\" : false }, { \"id\" : \"Extension.url\", \"path\" : \"Extension.url\", \"representation\" : [\"xmlAttr\"], \"short\" : \"identifies the meaning of the extension\", \"definition\" : \"Source of the definition for the extension code - a logical name or a URL.\", \"comment\" : \"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.\", \"min\" : 1, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension.url\", \"min\" : 1, \"max\" : \"1\" }, \"type\" : [{ \"extension\" : [{ \"url\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type\", \"valueUrl\" : \"uri\" }], \"code\" : \"http://hl7.org/fhirpath/System.String\" }], \"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-support\", \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"N/A\" }] }, { \"id\" : \"Extension.value[x]\", \"path\" : \"Extension.value[x]\", \"short\" : \"Value of extension\", \"definition\" : \"Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).\", \"min\" : 1, \"max\" : \"1\", \"base\" : { \"path\" : \"Extension.value[x]\", \"min\" : 0, \"max\" : \"1\" }, \"type\" : [{ \"code\" : \"markdown\" }], \"constraint\" : [{ \"key\" : \"ele-1\", \"severity\" : \"error\", \"human\" : \"All FHIR elements must have a @value or children\", \"expression\" : \"hasValue() or (children().count() > id.count())\", \"xpath\" : \"@value|f:*|h:div\", \"source\" : \"http://hl7.org/fhir/StructureDefinition/Element\" }], \"isModifier\" : false, \"isSummary\" : false, \"mapping\" : [{ \"identity\" : \"rim\", \"map\" : \"N/A\" }] }] }, \"differential\" : { \"element\" : [{ \"id\" : \"Extension\", \"path\" : \"Extension\", \"short\" : \"FMM Level\", \"definition\" : \"The documentation supporting the FMM level assigned to the artifact.\", \"comment\" : \"Though this is defined for resources, it can be used for any artifact.\", \"min\" : 0, \"max\" : \"1\" }, { \"id\" : \"Extension.extension\", \"path\" : \"Extension.extension\", \"max\" : \"0\" }, { \"id\" : \"Extension.url\", \"path\" : \"Extension.url\", \"fixedUri\" : \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-support\" }, { \"id\" : \"Extension.value[x]\", \"path\" : \"Extension.value[x]\", \"min\" : 1, \"type\" : [{ \"code\" : \"markdown\" }] }] } }"; private static final HashSet KNOWN_EXTENSIONS = new HashSet<>(Arrays.asList( "http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support", From ee02e21710a6b7eb448510190da56747768e259b Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 17 Nov 2023 07:10:24 +1100 Subject: [PATCH 03/32] fix identifier rendering --- .../hl7/fhir/r5/renderers/DataRenderer.java | 50 ++++++++++++++++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index ef6b6dd3d..7c4caf251 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -1202,11 +1202,7 @@ public class DataRenderer extends Renderer implements CodeResolver { String s = Utilities.noString(ii.getValue()) ? "?ngen-9?" : ii.getValue(); NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem()); if (ns != null) { - if (ns.hasWebPath()) { - s = ""+ns.present()+"#"+s; - } else { - s = ns.present()+"#"+s; - } + s = ns.present()+"#"+s; } if (ii.hasType()) { if (ii.getType().hasText()) @@ -1235,8 +1231,48 @@ public class DataRenderer extends Renderer implements CodeResolver { return s; } - protected void renderIdentifier(XhtmlNode x, Identifier ii) { - x.addText(displayIdentifier(ii)); + protected void renderIdentifier(XhtmlNode x, Identifier ii) { + if (ii.hasType()) { + if (ii.getType().hasText()) + x.tx(ii.getType().getText()); + else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasDisplay()) + x.tx(ii.getType().getCoding().get(0).getDisplay()+":"); + else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasCode()) + x.tx(lookupCode(ii.getType().getCoding().get(0).getSystem(), ii.getType().getCoding().get(0).getVersion(), ii.getType().getCoding().get(0).getCode())+":"); + } else { + x.tx("id:"); + } + x.nbsp(); + + NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem()); + if (ns != null) { + if (ns.hasWebPath()) { + x.ah(ns.getWebPath()).tx("#"); + } else { + x.tx(ns.present()+"#"); + } + } + x.tx(Utilities.noString(ii.getValue()) ? "?ngen-9?" : ii.getValue()); + + if (ii.hasUse() || ii.hasPeriod()) { + x.nbsp(); + x.tx("("); + if (ii.hasUse()) { + x.tx("use:"); + x.nbsp(); + x.tx(ii.getUse().toString()); + } + if (ii.hasUse() && ii.hasPeriod()) { + x.tx(","); + x.nbsp(); + } + if (ii.hasPeriod()) { + x.tx("period:"); + x.nbsp(); + x.tx(displayPeriod(ii.getPeriod())); + } + x.tx(")"); + } } public static String displayHumanName(HumanName name) { From aa20c450d2bab642d019e87e70bfe7a7eabfb33d Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 17 Nov 2023 07:10:57 +1100 Subject: [PATCH 04/32] fix for broken markdown re-processing --- .../fhir/utilities/xhtml/XhtmlComposer.java | 131 +++++++++++------- .../hl7/fhir/utilities/xhtml/XhtmlParser.java | 9 ++ 2 files changed, 91 insertions(+), 49 deletions(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java index e1a035280..c10222925 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlComposer.java @@ -3,19 +3,19 @@ package org.hl7.fhir.utilities.xhtml; /* Copyright (c) 2011+, HL7, Inc. All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to + * Neither the name of HL7 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -26,7 +26,7 @@ package org.hl7.fhir.utilities.xhtml; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - + */ @@ -48,10 +48,11 @@ public class XhtmlComposer { public static final String XHTML_NS = "http://www.w3.org/1999/xhtml"; private boolean pretty; private boolean xml; - + private boolean autoLinks; + public static final boolean XML = true; public static final boolean HTML = false; - + public XhtmlComposer(boolean xml, boolean pretty) { super(); this.pretty = pretty; @@ -99,11 +100,11 @@ public class XhtmlComposer { private void composeDoc(XhtmlDocument doc) throws IOException { // headers.... -// dst.append("" + (pretty ? "\r\n" : "")); + // dst.append("" + (pretty ? "\r\n" : "")); for (XhtmlNode c : doc.getChildNodes()) { writeNode(" ", c, false); } -// dst.append("" + (pretty ? "\r\n" : "")); + // dst.append("" + (pretty ? "\r\n" : "")); } private void writeNode(String indent, XhtmlNode node, boolean noPrettyOverride) throws IOException { @@ -126,50 +127,73 @@ public class XhtmlComposer { } } + + + private boolean isValidUrlChar(char c) { + return Character.isAlphabetic(c) || Character.isDigit(c) || Utilities.existsInList(c, ';', ',', '/', '?', ':', '@', '&', '=', '+', '$', '-', '_', '.', '!', '~', '*', '\'', '(', ')'); + } + private void writeText(XhtmlNode node) throws IOException { - for (char c : node.getContent().toCharArray()) - { - if (c == '&') { - dst.append("&"); - } else if (c == '<') { - dst.append("<"); - } else if (c == '>') { - dst.append(">"); - } else if (xml) { - if (c == '"') - dst.append("""); - else - dst.append(c); + String src = node.getContent(); + int i = 0; + while (i < src.length()) { + char c = src.charAt(i); + if (autoLinks && c == 'h' && Utilities.startsWithInList(src.substring(i), "http://", "https://")) { + int j = i; + while (i < src.length() && isValidUrlChar(src.charAt(i))) { + i++; + } + String url = src.substring(j, i); + if (url.endsWith(".") || url.endsWith(",")) { + i--; + url = url.substring(0, url.length()-1); + } + url = Utilities.escapeXml(url); + dst.append(""+ url +""); } else { - if (c == XhtmlNode.NBSP.charAt(0)) - dst.append(" "); - else if (c == (char) 0xA7) - dst.append("§"); - else if (c == (char) 169) - dst.append("©"); - else if (c == (char) 8482) - dst.append("™"); - else if (c == (char) 956) - dst.append("μ"); - else if (c == (char) 174) - dst.append("®"); - else - dst.append(c); + i++; + if (c == '&') { + dst.append("&"); + } else if (c == '<') { + dst.append("<"); + } else if (c == '>') { + dst.append(">"); + } else if (xml) { + if (c == '"') + dst.append("""); + else + dst.append(c); + } else { + if (c == XhtmlNode.NBSP.charAt(0)) + dst.append(" "); + else if (c == (char) 0xA7) + dst.append("§"); + else if (c == (char) 169) + dst.append("©"); + else if (c == (char) 8482) + dst.append("™"); + else if (c == (char) 956) + dst.append("μ"); + else if (c == (char) 174) + dst.append("®"); + else + dst.append(c); + } } } } private void writeComment(String indent, XhtmlNode node, boolean noPrettyOverride) throws IOException { dst.append(indent + "" + (pretty && !noPrettyOverride ? "\r\n" : "")); -} + } private void writeDocType(XhtmlNode node) throws IOException { dst.append("\r\n"); -} + } private void writeInstruction(XhtmlNode node) throws IOException { dst.append("\r\n"); -} + } private String escapeHtml(String s) { if (s == null || s.equals("")) @@ -188,14 +212,14 @@ public class XhtmlComposer { b.append(c); return b.toString(); } - + private String attributes(XhtmlNode node) { StringBuilder s = new StringBuilder(); for (String n : node.getAttributes().keySet()) s.append(" " + n + "=\"" + escapeHtml(node.getAttributes().get(n)) + "\""); return s.toString(); } - + private void writeElement(String indent, XhtmlNode node, boolean noPrettyOverride) throws IOException { if (!pretty || noPrettyOverride) indent = ""; @@ -242,7 +266,7 @@ public class XhtmlComposer { public void compose(IXMLWriter xml, XhtmlNode node) throws IOException { compose(xml, node, false); } - + public void compose(IXMLWriter xml, XhtmlNode node, boolean noPrettyOverride) throws IOException { if (node.getNodeType() == NodeType.Comment) xml.comment(node.getContent(), pretty && !noPrettyOverride); @@ -257,11 +281,11 @@ public class XhtmlComposer { private void composeElement(IXMLWriter xml, XhtmlNode node, boolean noPrettyOverride) throws IOException { for (String n : node.getAttributes().keySet()) { if (n.equals("xmlns")) - xml.setDefaultNamespace(node.getAttributes().get(n)); + xml.setDefaultNamespace(node.getAttributes().get(n)); else if (n.startsWith("xmlns:")) - xml.namespace(n.substring(6), node.getAttributes().get(n)); + xml.namespace(n.substring(6), node.getAttributes().get(n)); else - xml.attribute(n, node.getAttributes().get(n)); + xml.attribute(n, node.getAttributes().get(n)); } xml.enter(XHTML_NS, node.getName()); for (XhtmlNode n : node.getChildNodes()) @@ -299,7 +323,7 @@ public class XhtmlComposer { b.append("* "); lastWS = true; } - + for (XhtmlNode n : x.getChildNodes()) { lastWS = composePlainText(n, b, lastWS); } @@ -379,5 +403,14 @@ public class XhtmlComposer { } return sdst.toString(); } - + + public boolean isAutoLinks() { + return autoLinks; + } + + public XhtmlComposer setAutoLinks(boolean autoLinks) { + this.autoLinks = autoLinks; + return this; + } + } \ No newline at end of file diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java index 9ac5f47ad..fa6e02545 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java @@ -1290,6 +1290,15 @@ public class XhtmlParser { return div.getChildNodes(); } + public List parseMDFragmentStripParas(String source) throws IOException, FHIRException { + XhtmlNode div = parseFragment( "
"+source+"
"); + List res = new ArrayList<>(); + for (XhtmlNode x : div.getChildNodes()) { + res.addAll(x.getChildNodes()); + } + return res; + } + public XhtmlNode parseFragment(String source) throws IOException, FHIRException { rdr = new StringReader(source); try { From a4fa21a868d144a38a2d3d7af7b22e794305d9fa Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 17 Nov 2023 07:11:13 +1100 Subject: [PATCH 05/32] Add support for IPS validation in test cases --- .../validation/tests/ValidationTests.java | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java index c14e6d1d9..555b13849 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java @@ -22,6 +22,7 @@ import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_14_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50; +import org.hl7.fhir.convertors.loaders.loaderR5.R4ToR5Loader; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRFormatError; @@ -73,6 +74,7 @@ import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.json.JsonException; import org.hl7.fhir.utilities.json.JsonTrackingParser; import org.hl7.fhir.utilities.json.JsonUtilities; +import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager; import org.hl7.fhir.utilities.npm.NpmPackage; import org.hl7.fhir.utilities.settings.FhirSettings; import org.hl7.fhir.utilities.tests.CacheVerificationLogger; @@ -80,6 +82,7 @@ import org.hl7.fhir.utilities.validation.IDigitalSignatureServices; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.validation.IgLoader; import org.hl7.fhir.validation.ValidationEngine; +import org.hl7.fhir.validation.ValidatorUtils; import org.hl7.fhir.validation.cli.model.HtmlInMarkdownCheck; import org.hl7.fhir.validation.cli.services.StandAloneValidatorFetcher; import org.hl7.fhir.validation.instance.InstanceValidator; @@ -304,6 +307,26 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe } else { val.setDebug(false); } + + StructureDefinition sd = null; + if (content.has("ips")) { + val.setCheckIPSCodes(true); + if (content.get("ips").getAsString().equals("uv")) { + val.getContext().loadFromPackage(loadPackage("hl7.fhir.uv.ips#1.1.0"), ValidatorUtils.loaderForVersion("4.0.1")); + sd = val.getContext().fetchResource(StructureDefinition.class, "http://hl7.org/fhir/uv/ips/StructureDefinition/Bundle-uv-ips"); + val.getBundleValidationRules().add(new BundleValidationRule().setRule("Composition:0").setProfile("http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips")); + } else if (content.get("ips").getAsString().equals("au")) { + val.getContext().loadFromPackage(loadPackage("hl7.fhir.au.ips#current"), ValidatorUtils.loaderForVersion("4.0.1")); + sd = val.getContext().fetchResource(StructureDefinition.class, "http://hl7.org.au/fhir/ips/StructureDefinition/Bundle-au-ips"); + val.getBundleValidationRules().add(new BundleValidationRule().setRule("Composition:0").setProfile("http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips")); + } else if (content.get("ips").getAsString().equals("nz")) { + val.getContext().loadFromPackage(loadPackage("tewhatuora.fhir.nzps#current"), ValidatorUtils.loaderForVersion("4.0.1")); + sd = val.getContext().fetchResource(StructureDefinition.class, "https://standards.digital.health.nz/fhir/StructureDefinition/nzps-bundle"); + val.getBundleValidationRules().add(new BundleValidationRule().setRule("Composition:0").setProfile("http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips")); + } else { + throw new Error("Unknown IPS "+content.get("ips").getAsString()); + } + } if (content.has("best-practice")) { val.setBestPracticeWarningLevel(BestPracticeWarningLevel.valueOf(content.get("best-practice").getAsString())); } @@ -356,7 +379,6 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe } } } - StructureDefinition sd = null; String filename = profile.get("source").getAsString(); if (Utilities.isAbsoluteUrl(filename)) { sd = val.getContext().fetchResource(StructureDefinition.class, filename); @@ -398,7 +420,7 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe } List profiles = new ArrayList<>(); if (logical.has("format")) { - StructureDefinition sd = val.getContext().fetchResource(StructureDefinition.class, JsonUtilities.str(logical, "format")); + sd = val.getContext().fetchResource(StructureDefinition.class, JsonUtilities.str(logical, "format")); if (sd != null) { profiles.add(sd); } else { @@ -420,6 +442,11 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe } + private NpmPackage loadPackage(String idAndVer) throws IOException { + var pcm = new FilesystemPackageCacheManager(true); + return pcm.loadPackage(idAndVer); + } + private ValidationEngine buildVersionEngine(String ver, String txLog) throws Exception { String server = FhirSettings.getTxFhirDevelopment(); switch (ver) { From f2f10bf27b503192271aca8a992837661986b9c5 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 17 Nov 2023 07:11:24 +1100 Subject: [PATCH 06/32] update test cases --- .../4.0.1/all-systems.cache | 661 ++++- .../org.hl7.fhir.validation/4.0.1/cvx.cache | 220 +- .../org.hl7.fhir.validation/4.0.1/loinc.cache | 1115 +++++++- .../4.0.1/snomed.cache | 2454 +++++++++++++++++ .../org.hl7.fhir.validation/4.0.1/ucum.cache | 181 ++ pom.xml | 2 +- 6 files changed, 4619 insertions(+), 14 deletions(-) diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/all-systems.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/all-systems.cache index 6a01d89ec..6da013907 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/all-systems.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/all-systems.cache @@ -1509,7 +1509,6 @@ v: { "code" : "276885007", "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/900000000000207008/version/20230731", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -1530,6 +1529,666 @@ v: { "code" : "Cel", "system" : "http://unitsofmeasure.org", "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "en-NZ" +}, "url": "http://hl7.org/fhir/ValueSet/languages", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "en-NZ", + "system" : "urn:ietf:bcp:47", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "d" +}, "url": "http://hl7.org/fhir/ValueSet/units-of-time", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "d", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "Cel" +}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodytemp", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "Cel", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "cm" +}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodylength", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "cm", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "kg" +}, "url": "http://hl7.org/fhir/ValueSet/ucum-bodyweight", "version": "4.0.1", "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "kg", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "code" : "NZ" +}, "url": "http://hl7.org/fhir/ValueSet/iso3166-1-2", "version": "4.0.1", "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "New Zealand", + "code" : "NZ", + "system" : "urn:iso:std:iso:3166", + "version" : "2018", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "26643006" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#26643006' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "767525000" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#767525000' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "237599002" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "237599002", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "1201005" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "1201005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "109081006" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#109081006' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "5913000" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "5913000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "292954005" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#292954005' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "52910006" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "52910006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "428673006" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#428673006' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "265132005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "7947003" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#7947003' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "81464008" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#81464008' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "48546005" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#48546005' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "40425004" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "40425004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "158965000" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#158965000' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96309000" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#96309000' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "714081009" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#714081009' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "25246002" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#25246002' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96067005" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#96067005' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "90560007" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"true", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "90560007", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "34206005" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#34206005' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "108537001" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#108537001' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "126212009" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#126212009' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "292360004" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#292360004' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "16217701000119102" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#16217701000119102' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "valueSet" :http://terminology.hl7.org/ValueSet/snomed-intl-ips, "langs":"en, en-US", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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" : "The provided code 'http://snomed.info/sct#287903004' is not in the value set 'http://terminology.hl7.org/ValueSet/snomed-intl-ips|20211027' (from Tx-Server)", + "class" : "UNKNOWN", "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/cvx.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/cvx.cache index b1d6e1ffc..29e664562 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/cvx.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/cvx.cache @@ -350,7 +350,6 @@ v: { "code" : "210", "system" : "http://hl7.org/fhir/sid/cvx", "version" : "20210406", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -372,6 +371,225 @@ v: { "code" : "207", "system" : "http://hl7.org/fhir/sid/cvx", "version" : "20210406", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "208", + "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "208", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "141", + "display" : "Influenza, seasonal, injectable" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "141", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "20", + "display" : "diphtheria, tetanus toxoids and acellular pertussis vaccine" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "20", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "138", + "display" : "tetanus and diphtheria toxoids, not adsorbed, for adult use" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "138", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "133", + "display" : "pneumococcal conjugate vaccine, 13 valent" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "133", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "208", + "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "SARS-COV-2 (COVID-19) vaccine, mRNA, spike protein, LNP, preservative free, 30 mcg/0.3mL dose", + "code" : "208", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "141", + "display" : "Influenza, seasonal, injectable" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Influenza, seasonal, injectable", + "code" : "141", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "20", + "display" : "diphtheria, tetanus toxoids and acellular pertussis vaccine" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "diphtheria, tetanus toxoids and acellular pertussis vaccine", + "code" : "20", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "138", + "display" : "tetanus and diphtheria toxoids, not adsorbed, for adult use" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "tetanus and diphtheria toxoids, not adsorbed, for adult use", + "code" : "138", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://hl7.org/fhir/sid/cvx", + "code" : "133", + "display" : "pneumococcal conjugate vaccine, 13 valent" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "pneumococcal conjugate vaccine, 13 valent", + "code" : "133", + "system" : "http://hl7.org/fhir/sid/cvx", + "version" : "20210406", "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache index 4f5d6015c..7aeb61c69 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache @@ -5905,7 +5905,6 @@ v: { "severity" : "error", "error" : "The provided code 'http://loinc.org#59408-5' is not in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1' (from Tx-Server)", "class" : "UNKNOWN", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5927,7 +5926,6 @@ v: { "severity" : "error", "error" : "Wrong Display Name 'O2 % BldC Oximetry' for http://loinc.org#59408-5 - should be one of 26 choices: 'Oxygen saturation in Arterial blood by Pulse oximetry', 'SaO2 % BldA PulseOx', 'O2 SaO2' (pl-PL), 'saturacja krwi tlenem' (pl-PL), 'MFr O2' (zh-CN), 'tO2' (zh-CN), '总氧' (zh-CN), '氧气 SaO2 动脉血 动脉血O2饱和度 可用数量表示的' (zh-CN), '定量性' (zh-CN), '数值型' (zh-CN), '数量型' (zh-CN), '连续数值型标尺 时刻' (zh-CN), '随机' (zh-CN), '随意' (zh-CN), '瞬间 肺部测量指标与呼吸机管理 脉搏血氧测定法' (zh-CN), '脉搏血氧定量' (zh-CN), '脉搏血氧测定' (zh-CN), '脉搏血氧仪 血氧测定法 饱和 饱和状态 饱和程度' (zh-CN), 'O2-Sättigung' (de-DE), 'Frazione di massa Gestione ventilazione polmonare Punto nel tempo (episodio) Sangue arterioso' (it-IT), 'Oksijen doymuşluğu' (tr-TR), 'Количественный Кровь артериальная Массовая доля Насыщение кислородом Оксигемометрия' (ru-RU), 'Гемоксиметрия Точка во времени' (ru-RU), 'Момент' (ru-RU), 'zuurstofsaturatiemeting' (nl-NL) or 'O2 SatO2' (fr-BE) (for the language(s) '--') (from Tx-Server)", "class" : "UNKNOWN", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5950,7 +5948,6 @@ v: { "code" : "2708-6", "system" : "http://loinc.org", "version" : "2.74", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5971,7 +5968,6 @@ v: { "severity" : "error", "error" : "The provided code 'http://loinc.org#3150-0' is not in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1' (from Tx-Server)", "class" : "UNKNOWN", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -5992,7 +5988,6 @@ v: { "severity" : "error", "error" : "The provided code 'http://loinc.org#3151-8' is not in the value set 'http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0|4.0.1' (from Tx-Server)", "class" : "UNKNOWN", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6014,7 +6009,6 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6037,7 +6031,6 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6059,7 +6052,6 @@ v: { "code" : "8867-4", "system" : "http://loinc.org", "version" : "2.74", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6083,7 +6075,6 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6106,7 +6097,6 @@ v: { "code" : "29463-7", "system" : "http://loinc.org", "version" : "2.74", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6128,7 +6118,6 @@ v: { "code" : "8310-5", "system" : "http://loinc.org", "version" : "2.74", - "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" } @@ -6145,6 +6134,976 @@ v: { "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" }] }}#### +v: { + "display" : "Body temperature", + "code" : "8310-5", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "60591-5" +}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "60591-5", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "60591-5", + "display" : "Patient summary Document" +}, "url": "http://hl7.org/fhir/ValueSet/doc-typecodes", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "60591-5", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "60591-5" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "60591-5", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "48765-2", + "display" : "Allergies and adverse reactions Document" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "48765-2", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "11450-4", + "display" : "Problem list - Reported" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "11450-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "10160-0", + "display" : "History of Medication use Narrative" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "10160-0", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "11369-6", + "display" : "History of Immunization Narrative" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "11369-6", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "47519-4", + "display" : "History of Procedures Document" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "47519-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "30954-2", + "display" : "Relevant diagnostic tests/laboratory data Narrative" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "30954-2", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8716-3", + "display" : "Vital signs" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8716-3", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "29762-2", + "display" : "Social history Narrative" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "29762-2", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "47420-5", + "display" : "Functional status assessment note" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "47420-5", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8310-5" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8310-5", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8310-5", + "display" : "Body temperature" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8310-5", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8310-5" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8310-5", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8310-5", + "display" : "Body temperature" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8310-5", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8867-4" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8867-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8867-4", + "display" : "Heart rate" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8867-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8867-4" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8867-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8867-4", + "display" : "Heart rate" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8867-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "9279-1" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "9279-1", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "9279-1", + "display" : "Respiratory rate" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "9279-1", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "9279-1" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "9279-1", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "9279-1", + "display" : "Respiratory rate" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "9279-1", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "85354-9" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "85354-9", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "85354-9", + "display" : "Blood pressure panel with all children optional" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "85354-9", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "85354-9" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "85354-9", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8480-6" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8480-6", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8480-6", + "display" : "Systolic blood pressure" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8480-6", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8480-6" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8480-6", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8462-4" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8462-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8462-4", + "display" : "Diastolic blood pressure" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8462-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8462-4" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8462-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "85354-9", + "display" : "Blood pressure panel with all children optional" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "85354-9", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8480-6", + "display" : "Systolic blood pressure" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8480-6", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8462-4", + "display" : "Diastolic blood pressure" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8462-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8302-2" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8302-2", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8302-2", + "display" : "Body height" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "8302-2", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8302-2" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8302-2", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8302-2", + "display" : "Body height" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "8302-2", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "29463-7" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "29463-7", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "29463-7", + "display" : "Body weight" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "29463-7", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "29463-7" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "29463-7", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "29463-7", + "display" : "Body weight" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "29463-7", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "72166-2", + "display" : "Tobacco smoking status" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "72166-2", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "LA15920-4", + "display" : "Former smoker" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "LA15920-4", + "system" : "http://loinc.org", + "version" : "2.74", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "8310-5", + "display" : "Body temperature" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"", "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" : "Body temperature", "code" : "8310-5", @@ -6157,3 +7116,137 @@ v: { } ------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "9279-1" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult--0", "version": "4.0.1", "langs":"", "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" : "Respiratory rate", + "code" : "9279-1", + "system" : "http://loinc.org", + "version" : "2.74", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "9279-1", + "display" : "Respiratory rate" +}, "url": "http://hl7.org/fhir/ValueSet/observation-vitalsignresult", "version": "4.0.1", "langs":"", "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" : "Respiratory rate", + "code" : "9279-1", + "system" : "http://loinc.org", + "version" : "2.74", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "9279-1" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Respiratory rate", + "code" : "9279-1", + "system" : "http://loinc.org", + "version" : "2.74", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "LA15920-4" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/current-smoking-status-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Former smoker", + "code" : "LA15920-4", + "system" : "http://loinc.org", + "version" : "2.74", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "LA15920-4", + "display" : "Former smoker" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/current-smoking-status-uv-ips", "version": "1.1.0", "langs":"", "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" : "Former smoker", + "code" : "LA15920-4", + "system" : "http://loinc.org", + "version" : "2.74", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "LA15920-4" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Former smoker", + "code" : "LA15920-4", + "system" : "http://loinc.org", + "version" : "2.74", + "unknown-systems" : "", + "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 e3e7c6929..b4cf977ed 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 @@ -4364,3 +4364,2457 @@ v: { } ------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "158965000", + "display" : "Doctor" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "158965000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96067005", + "display" : "Flucloxacillin-containing product" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "96067005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "292954005", + "display" : "Penicillin adverse reaction" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "292954005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "48546005", + "display" : "Diazepam-containing product" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "48546005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "292360004", + "display" : "Diazepam adverse reaction" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "292360004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "40425004", + "display" : "Postconcussion syndrome" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "40425004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "237599002", + "display" : "Diabetes type 2 on insulin" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "237599002", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "90560007", + "display" : "Gout" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "90560007", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "1201005", + "display" : "Benign essential hypertension" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "1201005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "52910006", + "display" : "Anxiety disorder due to a general medical condition" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "52910006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "5913000", + "display" : "Fracture of neck of femur" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "5913000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "126212009", + "display" : "Product containing insulin glargine (medicinal product)" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "126212009", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "34206005", + "display" : "subcutaneous route" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "34206005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "767525000" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "767525000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "714081009", + "display" : "Product containing dulaglutide (medicinal product)" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "714081009", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "109081006", + "display" : "Product containing metformin (medicinal product)" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "109081006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "26643006", + "display" : "Oral route" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "26643006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "428673006" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "428673006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "108537001", + "display" : "Product containing amlodipine (medicinal product)" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "108537001", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96309000", + "display" : "Product containing losartan (medicinal product)" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "96309000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "7947003", + "display" : "Product containing aspirin (medicinal product)" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "7947003", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "25246002", + "display" : "Product containing allopurinol (medicinal product)" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "25246002", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "16217701000119102", + "display" : "Structure of left deltoid muscle" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "16217701000119102", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005", + "display" : "Primary open reduction and internal fixation of proximal femoral fracture with screw/nail and plate device" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "265132005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004", + "display" : "Suturing of hand" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "287903004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "81464008", + "display" : "Clinical pathologist" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "81464008", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96067005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-uv-ips--0", "version": "1.1.0", "langs":"", "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#96067005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-uv-ips--0|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96067005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-uv-ips--1", "version": "1.1.0", "langs":"", "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" : "Product containing flucloxacillin (medicinal product)", + "code" : "96067005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96067005", + "display" : "Flucloxacillin-containing product" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-uv-ips", "version": "1.1.0", "langs":"", "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" : "Product containing flucloxacillin (medicinal product)", + "code" : "96067005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96067005" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Product containing flucloxacillin (medicinal product)", + "code" : "96067005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "292954005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/allergy-reaction-snomed-ct-ips-free-set--0", "version": "1.1.0", "langs":"", "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#292954005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/allergy-reaction-snomed-ct-ips-free-set--0|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "292954005", + "display" : "Penicillin adverse reaction" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Penicillin adverse reaction", + "code" : "292954005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "48546005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-uv-ips--0", "version": "1.1.0", "langs":"", "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#48546005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-uv-ips--0|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "48546005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-substance-condition-uv-ips--1", "version": "1.1.0", "langs":"", "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" : "Product containing diazepam (medicinal product)", + "code" : "48546005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "48546005", + "display" : "Diazepam-containing product" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/allergy-intolerance-uv-ips", "version": "1.1.0", "langs":"", "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" : "Product containing diazepam (medicinal product)", + "code" : "48546005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "48546005" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Product containing diazepam (medicinal product)", + "code" : "48546005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "292360004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/allergy-reaction-snomed-ct-ips-free-set--0", "version": "1.1.0", "langs":"", "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#292360004' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/allergy-reaction-snomed-ct-ips-free-set--0|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "292360004", + "display" : "Diazepam adverse reaction" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Diazepam adverse reaction", + "code" : "292360004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "40425004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Postconcussion syndrome", + "code" : "40425004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "40425004", + "display" : "Postconcussion syndrome" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Postconcussion syndrome", + "code" : "40425004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "40425004" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Postconcussion syndrome", + "code" : "40425004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "237599002" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Insulin treated Type II diabetes mellitus", + "code" : "237599002", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "237599002", + "display" : "Diabetes type 2 on insulin" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Insulin treated Type II diabetes mellitus", + "code" : "237599002", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "237599002" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Insulin treated Type II diabetes mellitus", + "code" : "237599002", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "90560007" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Gout", + "code" : "90560007", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "90560007", + "display" : "Gout" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Gout", + "code" : "90560007", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "90560007" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Gout", + "code" : "90560007", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "1201005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Benign essential hypertension", + "code" : "1201005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "1201005", + "display" : "Benign essential hypertension" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Benign essential hypertension", + "code" : "1201005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "1201005" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Benign essential hypertension", + "code" : "1201005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "52910006" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Anxiety disorder due to a general medical condition", + "code" : "52910006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "52910006", + "display" : "Anxiety disorder due to a general medical condition" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Anxiety disorder due to a general medical condition", + "code" : "52910006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "52910006" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Anxiety disorder due to a general medical condition", + "code" : "52910006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "5913000" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Fracture of neck of femur", + "code" : "5913000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "5913000", + "display" : "Fracture of neck of femur" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/problems-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Fracture of neck of femur", + "code" : "5913000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "5913000" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Fracture of neck of femur", + "code" : "5913000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "126212009" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Product containing insulin glargine (medicinal product)", + "code" : "126212009", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "126212009" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1", "version": "1.1.0", "langs":"", "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#126212009' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "126212009", + "display" : "Product containing insulin glargine (medicinal product)" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Product containing insulin glargine (medicinal product)", + "code" : "126212009", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "126212009" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Product containing insulin glargine (medicinal product)", + "code" : "126212009", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "34206005", + "display" : "subcutaneous route" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Subcutaneous route", + "code" : "34206005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "767525000" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Unit", + "code" : "767525000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "714081009" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Product containing dulaglutide (medicinal product)", + "code" : "714081009", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "714081009" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1", "version": "1.1.0", "langs":"", "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#714081009' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "714081009", + "display" : "Product containing dulaglutide (medicinal product)" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Product containing dulaglutide (medicinal product)", + "code" : "714081009", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "714081009" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Product containing dulaglutide (medicinal product)", + "code" : "714081009", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "109081006" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Product containing metformin (medicinal product)", + "code" : "109081006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "109081006" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1", "version": "1.1.0", "langs":"", "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#109081006' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "109081006", + "display" : "Product containing metformin (medicinal product)" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Product containing metformin (medicinal product)", + "code" : "109081006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "109081006" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Product containing metformin (medicinal product)", + "code" : "109081006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "26643006", + "display" : "Oral route" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Oral route", + "code" : "26643006", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "108537001" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Product containing amlodipine (medicinal product)", + "code" : "108537001", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "108537001" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1", "version": "1.1.0", "langs":"", "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#108537001' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "108537001", + "display" : "Product containing amlodipine (medicinal product)" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Product containing amlodipine (medicinal product)", + "code" : "108537001", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "108537001" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Product containing amlodipine (medicinal product)", + "code" : "108537001", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96309000" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Product containing losartan (medicinal product)", + "code" : "96309000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96309000" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1", "version": "1.1.0", "langs":"", "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#96309000' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96309000", + "display" : "Product containing losartan (medicinal product)" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Product containing losartan (medicinal product)", + "code" : "96309000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "96309000" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Product containing losartan (medicinal product)", + "code" : "96309000", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "7947003" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Product containing aspirin (medicinal product)", + "code" : "7947003", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "7947003" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1", "version": "1.1.0", "langs":"", "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#7947003' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "7947003", + "display" : "Product containing aspirin (medicinal product)" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Product containing aspirin (medicinal product)", + "code" : "7947003", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "7947003" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Product containing aspirin (medicinal product)", + "code" : "7947003", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "25246002" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Product containing allopurinol (medicinal product)", + "code" : "25246002", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "25246002" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1", "version": "1.1.0", "langs":"", "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#25246002' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-uv-ips--1|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "25246002", + "display" : "Product containing allopurinol (medicinal product)" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/medication-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Product containing allopurinol (medicinal product)", + "code" : "25246002", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "25246002" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Product containing allopurinol (medicinal product)", + "code" : "25246002", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "16217701000119102" +}, "url": "http://hl7.org/fhir/ValueSet/body-site--0", "version": "4.0.1", "langs":"", "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" : "Structure of left deltoid muscle", + "code" : "16217701000119102", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "16217701000119102", + "display" : "Structure of left deltoid muscle" +}, "url": "http://hl7.org/fhir/ValueSet/body-site", "version": "4.0.1", "langs":"", "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" : "Structure of left deltoid muscle", + "code" : "16217701000119102", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "16217701000119102" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Structure of left deltoid muscle", + "code" : "16217701000119102", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Primary open reduction and internal fixation of proximal femoral fracture with screw/nail and plate device", + "code" : "265132005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--1", "version": "1.1.0", "langs":"", "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#265132005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--1|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--2", "version": "1.1.0", "langs":"", "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#265132005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--2|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--3", "version": "1.1.0", "langs":"", "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#265132005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--3|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--4", "version": "1.1.0", "langs":"", "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#265132005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--4|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--5", "version": "1.1.0", "langs":"", "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#265132005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--5|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--6", "version": "1.1.0", "langs":"", "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#265132005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--6|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--7", "version": "1.1.0", "langs":"", "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#265132005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--7|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--8", "version": "1.1.0", "langs":"", "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#265132005' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--8|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005", + "display" : "Primary open reduction and internal fixation of proximal femoral fracture with screw/nail and plate device" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Primary open reduction and internal fixation of proximal femoral fracture with screw/nail and plate device", + "code" : "265132005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "265132005" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Primary open reduction and internal fixation of proximal femoral fracture with screw/nail and plate device", + "code" : "265132005", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--0", "version": "1.1.0", "langs":"", "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" : "Suturing of hand", + "code" : "287903004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230131", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--1", "version": "1.1.0", "langs":"", "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#287903004' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--1|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--2", "version": "1.1.0", "langs":"", "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#287903004' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--2|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--3", "version": "1.1.0", "langs":"", "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#287903004' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--3|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--4", "version": "1.1.0", "langs":"", "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#287903004' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--4|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--5", "version": "1.1.0", "langs":"", "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#287903004' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--5|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--6", "version": "1.1.0", "langs":"", "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#287903004' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--6|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--7", "version": "1.1.0", "langs":"", "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#287903004' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--7|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--8", "version": "1.1.0", "langs":"", "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#287903004' is not in the value set 'http://hl7.org/fhir/uv/ips/ValueSet/procedures-uv-ips--8|1.1.0' (from Tx-Server)", + "class" : "UNKNOWN", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004", + "display" : "Suturing of hand" +}, "url": "http://hl7.org/fhir/uv/ips/ValueSet/procedures-snomed-absent-unknown-uv-ips", "version": "1.1.0", "langs":"", "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" : "Suturing of hand", + "code" : "287903004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "287903004" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "Suturing of hand", + "code" : "287903004", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://snomed.info/sct", + "code" : "81464008", + "display" : "Clinical pathologist" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "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 pathologist", + "code" : "81464008", + "system" : "http://snomed.info/sct", + "version" : "http://snomed.info/sct/900000000000207008/version/20230731", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/ucum.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/ucum.cache index 7bb071a09..3447510c3 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/ucum.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/ucum.cache @@ -618,6 +618,187 @@ v: { "severity" : "error", "error" : "The provided code 'http://unitsofmeasure.org#mm[Hg]{hg}' is not in the value set 'http://hl7.org/fhir/ValueSet/ucum-vitals-common--0|4.0.1' (from Tx-Server)", "class" : "UNKNOWN", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://unitsofmeasure.org", + "code" : "mmol/L" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "mmol/L", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://unitsofmeasure.org", + "code" : "mmol/mol" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "mmol/mol", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://unitsofmeasure.org", + "code" : "Cel" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "Cel", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://unitsofmeasure.org", + "code" : "/min" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "/min", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://unitsofmeasure.org", + "code" : "mm[Hg]" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "mm[Hg]", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://unitsofmeasure.org", + "code" : "mm[Hg]" +}, "url": "http://hl7.org/fhir/ValueSet/ucum-vitals-common--0", "version": "4.0.1", "langs":"en-NZ", "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: { + "code" : "mm[Hg]", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://unitsofmeasure.org", + "code" : "cm" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "cm", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://unitsofmeasure.org", + "code" : "kg" +}, "valueSet" :null, "langs":"en-NZ", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "code" : "kg", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://unitsofmeasure.org", + "code" : "mmol/mol" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "mmol/mol", + "code" : "mmol/mol", + "system" : "http://unitsofmeasure.org", + "version" : "2.0.1", "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome" diff --git a/pom.xml b/pom.xml index 60f1e95b5..7374d8c95 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 32.0.1-jre 6.4.1 - 1.4.17 + 1.4.18-SNAPSHOT 2.15.2 5.9.2 1.8.2 From 2f105d85ab324688e91e8a66cc7396c5fbd57deb Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 22 Nov 2023 07:51:26 +1100 Subject: [PATCH 07/32] Add first take on IPS builder --- .../java/org/hl7/fhir/r4/ips/IPSBuilder.java | 430 ++++++++++++++++++ 1 file changed, 430 insertions(+) create mode 100644 org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/ips/IPSBuilder.java diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/ips/IPSBuilder.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/ips/IPSBuilder.java new file mode 100644 index 000000000..02dcf5bca --- /dev/null +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/ips/IPSBuilder.java @@ -0,0 +1,430 @@ +package org.hl7.fhir.r4.ips; + +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.r4.ips.IPSBuilder.TypeAndId; +import org.hl7.fhir.r4.model.Age; +import org.hl7.fhir.r4.model.Annotation; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.r4.model.Bundle.BundleType; +import org.hl7.fhir.r4.model.CodeableConcept; +import org.hl7.fhir.r4.model.Coding; +import org.hl7.fhir.r4.model.Composition; +import org.hl7.fhir.r4.model.Patient; +import org.hl7.fhir.r4.model.Period; +import org.hl7.fhir.r4.model.Quantity; +import org.hl7.fhir.r4.model.Range; +import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.Type; +import org.hl7.fhir.r4.model.Composition.CompositionStatus; +import org.hl7.fhir.r4.model.Composition.SectionComponent; +import org.hl7.fhir.r4.model.Condition; +import org.hl7.fhir.r4.model.Device; +import org.hl7.fhir.r4.model.DomainResource; +import org.hl7.fhir.r4.model.Dosage; +import org.hl7.fhir.r4.model.Identifier; +import org.hl7.fhir.r4.model.Medication; +import org.hl7.fhir.r4.model.MedicationStatement; +import org.hl7.fhir.r4.model.Narrative.NarrativeStatus; +import org.hl7.fhir.r4.utils.client.FHIRToolingClient; +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.VersionUtil; +import org.hl7.fhir.utilities.xhtml.XhtmlNode; + +public class IPSBuilder { + + public static class TypeAndId { + private String type; + private String id; + protected TypeAndId(String type, String id) { + super(); + this.type = type; + this.id = id; + } + public String getType() { + return type; + } + public String getId() { + return id; + } + } + + public static Bundle generateIPS(FHIRToolingClient server, String patientId) { + Patient pat = server.fetchResource(Patient.class, patientId); + Bundle bnd = initBundle(); + Composition cmp = initComposition(bnd, server.getAddress(), pat); + pat = processPatient(bnd, server.getAddress(), pat); +// addMedications(bnd, cmp, server, patientId); + addConditions(bnd, cmp, server, patientId); + return bnd; + } + + private static Bundle initBundle() { + Bundle bnd = new Bundle(); + bnd.getIdentifier().setSystem("urn:ietf:rfc:3986"); + bnd.getIdentifier().setValue(Utilities.makeUuidUrn()); + bnd.setType(BundleType.DOCUMENT); + bnd.setTimestamp(new Date()); + return bnd; + } + + private static Composition initComposition(Bundle bnd, String url, Patient pat) { + Composition cmp = new Composition(); + cmp.setIdBase(Utilities.makeUuidLC()); + cmp.setStatus(CompositionStatus.FINAL); + cmp.getType().addCoding().setSystem("http://loinc.org").setCode("60591-5"); + cmp.setDate(new Date()); + cmp.setTitle("International Patient Summary"); + cmp.getSubject().setReference("Patient/"+pat.getIdBase()); + cmp.addAuthor().setReference("Device/java"); + bnd.addEntry().setResource(cmp).setFullUrl(Utilities.pathURL(url, "Composition", cmp.getIdBase())); + Device dev = new Device(); + dev.setId("java"); + dev.addDeviceName().setName("Java Core Library"); + dev.addVersion().setValue(VersionUtil.getVersion()); + return cmp; + } + + private static Patient processPatient(Bundle bnd, String url, Patient pat) { + bnd.addEntry().setResource(pat).setFullUrl(Utilities.pathURL(url, "Patient", pat.getIdBase())); + return pat; + } + + private static void addMedications(Bundle bnd, Composition cmp, FHIRToolingClient server, String patientId) { + Bundle sb = server.search("MedicationStatement", "?patient="+patientId+"&_include=MedicationStatement:medication&_include=MedicationStatement:source"); + SectionComponent sct = cmp.addSection(); + sct.setTitle("Medications"); + sct.getCode().addCoding().setSystem("http://loinc.org").setCode("10160-0"); + sct.getText().setStatus(NarrativeStatus.GENERATED); + var x = sct.getText().getDiv(); + var tbl = x.table("grid"); + var tr = tbl.tr(); + tr.th().tx("Medication"); + tr.th().tx("Category"); + tr.th().tx("Status"); + tr.th().tx("When"); + tr.th().tx("Dosage"); + tr.th().tx("Reason"); + tr.th().tx("Source"); + tr.th().tx("Notes"); + + boolean ok = false; + for (BundleEntryComponent be : sb.getEntry()) { + if (be.hasResource() && be.getResource() instanceof MedicationStatement) { + MedicationStatement mdstmt = (MedicationStatement) be.getResource(); + ok = true; + bnd.addEntry().setResource(mdstmt).setFullUrl(Utilities.pathURL(server.getAddress(), "MedicationStatement", mdstmt.getIdBase())); + sct.addEntry().setReference("MedicationStatement/"+mdstmt.getIdBase()); + tr = tbl.tr(); + if (mdstmt.hasMedicationReference()) { + Medication med = findMedication(sb, server, mdstmt, mdstmt.getMedicationReference()); + if (med == null) { + tr.td().b().tx("Unknown?"); + } else { + tr.td().tx(summarise(med)); + bnd.addEntry().setResource(med).setFullUrl(Utilities.pathURL(server.getAddress(), "Medication", med.getIdBase())); + } + } else { + tr.td().tx(genCC(mdstmt.getMedicationCodeableConcept())); + } + tr.td().tx(genCC(mdstmt.getCategory())); + var td = tr.td(); + td.tx(mdstmt.getStatus().getDisplay()); + if (mdstmt.hasStatusReason()) { + td.tx(" ("); + td.tx(genCC(mdstmt.getStatusReason())); + td.tx(")"); + } + tr.td().tx(genDT(mdstmt.getEffective())); + genDosages(tr.td(), mdstmt.getDosage()); + tr.td().tx(genReference(mdstmt, mdstmt.getInformationSource(), bnd, sb, server)); + genNotes(tr.td(), mdstmt.getNote()); + } + } + if (!ok) { + Condition cnd = new Condition(); + cnd.setId(Utilities.makeUuidLC()); + + cnd.getText().setStatus(NarrativeStatus.GENERATED); + var rx = cnd.getText().getDiv(); + rx.tx("No information is provided about the patient's medical problems"); + tr = tbl.tr(); + tr.td().colspan(7).tx("No information is provided about the patient's medical problems"); + cnd.getClinicalStatus().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/condition-clinical").setCode("active").setDisplay("Active"); + cnd.getCode().addCoding().setSystem("http://hl7.org/fhir/uv/ips/CodeSystem/absent-unknown-uv-ips").setCode("no-problem-info").setDisplay("No information about current problems"); + cnd.getSubject().setReference("Patient/"+patientId); + } + } + + + private static void genDosages(XhtmlNode x, List dosages) { + if (dosages == null || dosages.size() == 0) { + + } else if (dosages.size() == 1) { + genDosage(x, dosages.get(0)); + } else { + var ul = x.ul(); + for (Dosage d : dosages) { + genDosage(ul.li(), d); + } + } + } + + private static void genDosage(XhtmlNode x, Dosage dosage) { + x.tx(dosage.getText()); + if (dosage.hasAsNeeded()) { + x.nbsp(); + if (dosage.hasAsNeededBooleanType()) { + if (dosage.getAsNeededBooleanType().booleanValue()) { + x.tx(" (as needed)"); + } + } else { + x.tx(genDT(dosage.getAsNeeded())); + } + } else if (dosage.hasTiming()) { + x.nbsp(); + x.tx(genDT(dosage.getTiming())); + } + if (dosage.hasSite()) { + x.tx(". "); + x.tx(genDT(dosage.getSite())); + } + if (dosage.hasRoute()) { + x.tx(". "); + x.tx(genDT(dosage.getRoute())); + } + } + + private static Medication findMedication(Bundle sb, FHIRToolingClient server, MedicationStatement mdstmt, Reference ref) { + if (ref == null || !ref.hasReference()) { + return null; + } + if (ref.getReference().startsWith("#")) { + + } else { + + } + return null; + } + + private static void addConditions(Bundle bnd, Composition cmp, FHIRToolingClient server, String patientId) { + Bundle sb = server.search("Condition", "?patient="+patientId); //+"&_include=MedicationStatement:asserter"); + SectionComponent sct = cmp.addSection(); + sct.setTitle("Problems"); + sct.getCode().addCoding().setSystem("http://loinc.org").setCode("11450-4"); + sct.getText().setStatus(NarrativeStatus.GENERATED); + var x = sct.getText().getDiv(); + var tbl = x.table("grid"); + var tr = tbl.tr(); + tr.th().tx("Code"); + tr.th().tx("Category"); + tr.th().tx("Severity"); + tr.th().tx("Status"); + tr.th().tx("Onset"); + tr.th().tx("Abatement"); + tr.th().tx("Source"); + tr.th().tx("Notes"); + + boolean ok = false; + for (BundleEntryComponent be : sb.getEntry()) { + if (be.hasResource() && be.getResource() instanceof Condition) { + Condition cnd = (Condition) be.getResource(); + ok = true; + bnd.addEntry().setResource(cnd).setFullUrl(Utilities.pathURL(server.getAddress(), "Condition", cnd.getIdBase())); + sct.addEntry().setReference("Condition/"+cnd.getIdBase()); + tr = tbl.tr(); + tr.td().tx(genCC(cnd.getCode())); + tr.td().tx(genCC(cnd.getCategory())); + tr.td().tx(genCC(cnd.getSeverity())); + tr.td().tx(genStatus(cnd)); + tr.td().tx(genDT(cnd.getOnset())); + tr.td().tx(genDT(cnd.getAbatement())); + tr.td().tx(genSource(cnd, bnd, sb, server)); + genNotes(tr.td(), cnd.getNote()); + + } + } + if (!ok) { + Condition cnd = new Condition(); + cnd.setId(Utilities.makeUuidLC()); + + cnd.getText().setStatus(NarrativeStatus.GENERATED); + var rx = cnd.getText().getDiv(); + rx.tx("No information is provided about the patient's medical problems"); + tr = tbl.tr(); + tr.td().colspan(7).tx("No information is provided about the patient's medical problems"); + cnd.getClinicalStatus().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/condition-clinical").setCode("active").setDisplay("Active"); + cnd.getCode().addCoding().setSystem("http://hl7.org/fhir/uv/ips/CodeSystem/absent-unknown-uv-ips").setCode("no-problem-info").setDisplay("No information about current problems"); + cnd.getSubject().setReference("Patient/"+patientId); + } + } + + + private static String genReference(DomainResource src, Reference ref, Bundle bnd, Bundle search, FHIRToolingClient server) { + if (ref == null || ref.isEmpty()) { + return null; + } + boolean contained = false; + DomainResource tgt = null; + if (ref.hasReference()) { + if (ref.getReference().startsWith("#")) { + tgt = (DomainResource) src.getContained(ref.getReference()); + contained = true; + } else { + TypeAndId tid = getTypeAndId(server.getAddress(), ref.getReference()); + if (tid != null) { + tgt = findInBundle(bnd, Utilities.pathURL(server.getAddress(), tid.getType(), tid.getId())); + if (tgt == null) { + tgt = findInBundle(search, Utilities.pathURL(server.getAddress(), tid.getType(), tid.getId())); + if (tgt == null) { + tgt = (DomainResource) server.read(tid.getType(), tid.getId()); + } + } else { + contained = true; + } + } + } + } + if (tgt != null) { + if (!contained) { + bnd.addEntry().setResource(tgt).setFullUrl(Utilities.pathURL(server.getAddress(), tgt.fhirType(), tgt.getIdBase())); + } + return summarise(tgt); + } else if (ref.hasDisplay()) { + return ref.getDisplay(); + } else if (ref.hasReference()) { + return ref.getReference(); + } else if (ref.hasIdentifier()) { + return genIdentifier(ref.getIdentifier()); + } else { + return "unknown"; + } + } + + + private static TypeAndId getTypeAndId(String baseUrl, String url) { + if (Utilities.noString(url)) { + return null; + } + if (url.startsWith(baseUrl+"/")) { + url = url.substring(baseUrl.length()+1); + } + String[] p = url.split("\\/"); + if (p.length > 1) { + if ("_history".equals(p[p.length-2]) && p.length > 3) { + return new TypeAndId(p[p.length-4], p[p.length-3]); + } else { + return new TypeAndId(p[p.length-2], p[p.length-1]); + } + } + return null; + } + + private static DomainResource findInBundle(Bundle bnd, String url) { + for (BundleEntryComponent be : bnd.getEntry()) { + if (url.equals(be.getFullUrl()) && be.hasResource() && be.getResource() instanceof DomainResource) { + return (DomainResource) be.getResource(); + } + } + return null; + } + + private static String summarise(DomainResource tgt) { + // TODO Auto-generated method stub + return null; + } + + private static String genIdentifier(Identifier id) { + return id.getValue(); + } + + private static void genNotes(XhtmlNode td, List notes) { + if (notes.size() > 0) { + if (notes.size() == 1) { + genNote(td, notes.get(0)); + } else { + var ul = td.ul(); + for (Annotation a : notes) { + genNote(ul.li(), a); + } + } + } + } + + private static void genNote(XhtmlNode td, Annotation annotation) { + td.tx(annotation.getText()); + } + + private static String genSource(Condition cnd, Bundle bnd, Bundle sb, FHIRToolingClient server) { + if (cnd.hasAsserter()) { + return genReference(cnd, cnd.getAsserter(), bnd, sb, server); + } else if (cnd.hasRecorder()) { + return genReference(cnd, cnd.getRecorder(), bnd, sb, server); + } else { + return null; + } + } + + private static String genDT(Type v) { + if (v == null) { + return null; + } + if (v.isPrimitive()) { + return v.primitiveValue(); + } + if (v instanceof Age) { + return genQty((Age) v); + } + if (v instanceof Period) { + Period p = (Period) v; + return genDT(p.getStartElement())+" - "+genDT(p.getStartElement()); + } + if (v instanceof Range) { + Range p = (Range) v; + return genDT(p.getLow())+" - "+genDT(p.getHigh()); + } + return "not done: "+v.fhirType(); + } + + private static String genQty(Quantity v) { + return v.getValue().toPlainString()+v.getUnit(); + } + + private static String genStatus(Condition cnd) { + if (cnd.hasClinicalStatus() && cnd.hasVerificationStatus()) { + return genCC(cnd.getClinicalStatus()) +"/"+genCC(cnd.getVerificationStatus()); + } else if (cnd.hasClinicalStatus()) { + return genCC(cnd.getClinicalStatus()); + } else if (cnd.hasVerificationStatus()) { + return genCC(cnd.getVerificationStatus()); + } else { + return null; + } + } + + private static String genCC(List list) { + if (list != null && list.size() == 1) { + return genCC(list.get(0)); + } else { + return null; + } + } + + private static String genCC(CodeableConcept code) { + if (code.hasText()) { + return code.getText(); + } else if (code.hasCoding()) { + Coding c = code.getCodingFirstRep(); + if (c.hasDisplay()) { + return c.getDisplay(); + } else { + return c.getCode(); + } + } else { + return null; + } + } + +} From ea9a4987307c77c26eae59d7db7001ef4dbdf8ce Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 22 Nov 2023 07:51:51 +1100 Subject: [PATCH 08/32] Infrastructure changes for IPS builder --- .../org/hl7/fhir/r4/model/DomainResource.java | 9 +++++++++ .../fhir/r4/utils/client/FHIRToolingClient.java | 16 ++++++++++++++++ .../fhir/r4/utils/client/ResourceAddress.java | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DomainResource.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DomainResource.java index 17f34dd86..848890777 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DomainResource.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DomainResource.java @@ -579,6 +579,15 @@ public abstract class DomainResource extends Resource } } + public Resource getContained(String reference) { + for (Resource c : getContained()) { + if (reference.equals("#"+c.getId())) { + return c; + } + } + return null; + } + // end addition } \ No newline at end of file diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java index 168400b2a..24236affb 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java @@ -165,6 +165,22 @@ public class FHIRToolingClient { return capabilities; } + public Resource read(String resourceClass, String id) {// TODO Change this to AddressableResource + ResourceRequest result = null; + try { + result = client.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), + getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass + "/" + id, + TIMEOUT_NORMAL); + if (result.isUnsuccessfulRequest()) { + throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), + (OperationOutcome) result.getPayload()); + } + } catch (Exception e) { + throw new FHIRException(e); + } + return result.getPayload(); + } + public T read(Class resourceClass, String id) {// TODO Change this to AddressableResource ResourceRequest result = null; try { diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/ResourceAddress.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/ResourceAddress.java index bffaa5900..16df4f0cb 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/ResourceAddress.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/ResourceAddress.java @@ -113,6 +113,10 @@ public class ResourceAddress { return baseServiceUri.resolve(nameForClass(resourceClass) + "/" + id); } + public URI resolveGetUriFromResourceClassAndId(String resourceClass, String id) { + return baseServiceUri.resolve(resourceClass + "/" + id); + } + public URI resolveGetUriFromResourceClassAndIdAndVersion(Class resourceClass, String id, String version) { return baseServiceUri.resolve(nameForClass(resourceClass) + "/" + id + "/_history/" + version); From 2e19e6bbc1f76767a92738e21fe27157566f4f82 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 22 Nov 2023 07:51:59 +1100 Subject: [PATCH 09/32] IPS builder test case --- .../org/hl7/fhir/r4/ips/IpsBuilderTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/ips/IpsBuilderTest.java diff --git a/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/ips/IpsBuilderTest.java b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/ips/IpsBuilderTest.java new file mode 100644 index 000000000..6d96d88da --- /dev/null +++ b/org.hl7.fhir.r4/src/test/java/org/hl7/fhir/r4/ips/IpsBuilderTest.java @@ -0,0 +1,30 @@ +package org.hl7.fhir.r4.ips; + +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URISyntaxException; + +import org.hl7.fhir.r4.formats.IParser.OutputStyle; +import org.hl7.fhir.r4.formats.JsonParser; +import org.hl7.fhir.r4.model.Base64BinaryType; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.utils.client.FHIRToolingClient; +import org.hl7.fhir.utilities.Utilities; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +public class IpsBuilderTest { + + @Test + @DisplayName("Test IPS Generation") + void testIpsGeneration() throws URISyntaxException, FileNotFoundException, IOException { + FHIRToolingClient server = new FHIRToolingClient("https://hl7auconnectathon.salessbx.smiledigitalhealth.com/fhir-request", "FHIR-Validator"); + server.setUsername("HL7AU"); + server.setPassword("Connectathon123"); + Bundle bnd = IPSBuilder.generateIPS(server, "wang-li"); + new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path("[tmp]", "ips-gen.json")), bnd); + + } + +} From 6aaff354953079d7201f77d1a61c95aec2b86529 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 22 Nov 2023 07:52:47 +1100 Subject: [PATCH 10/32] fhirpath iif() test case fixes --- .../org/hl7/fhir/r4/utils/FHIRPathEngine.java | 25 +++++++++++++------ .../hl7/fhir/r4b/utils/FHIRPathEngine.java | 23 ++++++++++++----- .../org/hl7/fhir/r5/utils/FHIRPathEngine.java | 24 ++++++++++++++---- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java index f8af9449e..1c90a5082 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java @@ -3338,9 +3338,11 @@ public class FHIRPathEngine { } case Iif: { TypeDetails types = new TypeDetails(null); - types.update(paramTypes.get(0)); - if (paramTypes.size() > 1) { - types.update(paramTypes.get(1)); + checkSingleton(focus, "iif", exp); + checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean)); + types.update(paramTypes.get(1)); + if (paramTypes.size() > 2) { + types.update(paramTypes.get(2)); } return types; } @@ -3646,6 +3648,12 @@ public class FHIRPathEngine { } } + private void checkSingleton(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException { + if (focus.getCollectionStatus() != CollectionStatus.SINGLETON) { +// typeWarnings.add(new IssueMessage(worker.formatMessage(I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT, name, expr.toString()), I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT)); + } + } + private void checkOrdered(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException { if (focus.getCollectionStatus() == CollectionStatus.UNORDERED) { throw makeException(expr, I18nConstants.FHIRPATH_ORDERED_ONLY, name); @@ -4806,9 +4814,12 @@ public class FHIRPathEngine { } private List funcIif(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List n1 = execute(context, focus, exp.getParameters().get(0), true); + if (focus.size() > 1) { + throw makeException(exp, I18nConstants.FHIRPATH_NO_COLLECTION, "iif", focus.size()); + } + + List n1 = execute(focus.isEmpty() ? context : changeThis(context, focus.get(0)), focus, exp.getParameters().get(0), true); Equality v = asBool(n1, exp); - if (v == Equality.True) { return execute(context, focus, exp.getParameters().get(1), true); } else if (exp.getParameters().size() < 3) { @@ -4817,7 +4828,7 @@ public class FHIRPathEngine { return execute(context, focus, exp.getParameters().get(2), true); } } - + private List funcTake(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { List n1 = execute(context, focus, exp.getParameters().get(0), true); int i1 = Integer.parseInt(n1.get(0).primitiveValue()); @@ -4849,7 +4860,7 @@ public class FHIRPathEngine { for (Base item : focus) { result.add(item); } - for (Base item : execute(context, focus, exp.getParameters().get(0), true)) { + for (Base item : execute(context, baseToList(context.thisItem), exp.getParameters().get(0), true)) { result.add(item); } return result; diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/FHIRPathEngine.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/FHIRPathEngine.java index e61127b70..a48b4fea5 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/FHIRPathEngine.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/FHIRPathEngine.java @@ -3340,9 +3340,11 @@ public class FHIRPathEngine { } case Iif: { TypeDetails types = new TypeDetails(null); - types.update(paramTypes.get(0)); - if (paramTypes.size() > 1) { - types.update(paramTypes.get(1)); + checkSingleton(focus, "iif", exp); + checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean)); + types.update(paramTypes.get(1)); + if (paramTypes.size() > 2) { + types.update(paramTypes.get(2)); } return types; } @@ -3647,6 +3649,12 @@ public class FHIRPathEngine { } } } + + private void checkSingleton(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException { + if (focus.getCollectionStatus() != CollectionStatus.SINGLETON) { +// typeWarnings.add(new IssueMessage(worker.formatMessage(I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT, name, expr.toString()), I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT)); + } + } private void checkOrdered(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException { if (focus.getCollectionStatus() == CollectionStatus.UNORDERED) { @@ -4809,9 +4817,12 @@ public class FHIRPathEngine { } private List funcIif(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List n1 = execute(context, focus, exp.getParameters().get(0), true); + if (focus.size() > 1) { + throw makeException(exp, I18nConstants.FHIRPATH_NO_COLLECTION, "iif", focus.size()); + } + + List n1 = execute(focus.isEmpty() ? context : changeThis(context, focus.get(0)), focus, exp.getParameters().get(0), true); Equality v = asBool(n1, exp); - if (v == Equality.True) { return execute(context, focus, exp.getParameters().get(1), true); } else if (exp.getParameters().size() < 3) { @@ -4852,7 +4863,7 @@ public class FHIRPathEngine { for (Base item : focus) { result.add(item); } - for (Base item : execute(context, focus, exp.getParameters().get(0), true)) { + for (Base item : execute(context, baseToList(context.thisItem), exp.getParameters().get(0), true)) { result.add(item); } return result; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java index 43141fee3..dea5b4b99 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java @@ -3383,9 +3383,11 @@ public class FHIRPathEngine { } case Iif : { TypeDetails types = new TypeDetails(null); - types.update(paramTypes.get(0)); - if (paramTypes.size() > 1) { - types.update(paramTypes.get(1)); + checkSingleton(focus, "iif", exp); + checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean)); + types.update(paramTypes.get(1)); + if (paramTypes.size() > 2) { + types.update(paramTypes.get(2)); } return types; } @@ -3692,6 +3694,15 @@ public class FHIRPathEngine { throw makeException(expr, I18nConstants.FHIRPATH_WRONG_PARAM_TYPE, funcName, i, a, pt.toString()); } } + if (actual.getCollectionStatus() != CollectionStatus.SINGLETON && pt.getCollectionStatus() == CollectionStatus.SINGLETON) { + typeWarnings.add(new IssueMessage(worker.formatMessage(I18nConstants.FHIRPATH_COLLECTION_STATUS_PARAMETER, funcName, i, expr.toString()), I18nConstants.FHIRPATH_COLLECTION_STATUS_PARAMETER)); + } + } + } + + private void checkSingleton(TypeDetails focus, String name, ExpressionNode expr) throws PathEngineException { + if (focus.getCollectionStatus() != CollectionStatus.SINGLETON) { + typeWarnings.add(new IssueMessage(worker.formatMessage(I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT, name, expr.toString()), I18nConstants.FHIRPATH_COLLECTION_STATUS_CONTEXT)); } } @@ -4811,9 +4822,12 @@ public class FHIRPathEngine { private List funcIif(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List n1 = execute(context, focus, exp.getParameters().get(0), true); + if (focus.size() > 1) { + throw makeException(exp, I18nConstants.FHIRPATH_NO_COLLECTION, "iif", focus.size()); + } + + List n1 = execute(focus.isEmpty() ? context : changeThis(context, focus.get(0)), focus, exp.getParameters().get(0), true); Equality v = asBool(n1, exp); - if (v == Equality.True) { return execute(context, focus, exp.getParameters().get(1), true); } else if (exp.getParameters().size() < 3) { From 97a778302c3108de9b4650e0807040c9e4c8bd39 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 22 Nov 2023 07:55:16 +1100 Subject: [PATCH 11/32] Add support for rendering union and intersections of profiles in profile comparison --- .../comparison/CanonicalResourceComparer.java | 2 + .../CapabilityStatementComparer.java | 60 ++++++++++--------- .../r5/comparison/ComparisonRenderer.java | 18 +++++- .../StructureDefinitionComparer.java | 15 ++++- 4 files changed, 64 insertions(+), 31 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CanonicalResourceComparer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CanonicalResourceComparer.java index 97c0a5d5d..2d7e14654 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CanonicalResourceComparer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CanonicalResourceComparer.java @@ -177,6 +177,8 @@ public abstract class CanonicalResourceComparer extends ResourceComparer { s = s + refCell(left); s = s + refCell(right); s = s + "Comparison"; + s = s + "Union"; + s = s + "Intersection"; s = s + ""+outcomeSummary()+""; return ""+s+"\r\n"; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CapabilityStatementComparer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CapabilityStatementComparer.java index 5edf45867..8a3594345 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CapabilityStatementComparer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/CapabilityStatementComparer.java @@ -183,20 +183,22 @@ public class CapabilityStatementComparer extends CanonicalResourceComparer { private void compareRestSecurityService(CapabilityStatementRestSecurityComponent left, CapabilityStatementRestSecurityComponent right, StructuralMatch combined, CapabilityStatementRestSecurityComponent union, CapabilityStatementRestSecurityComponent intersection, CapabilityStatement csU, CapabilityStatement csI, CapabilityStatementComparison res, String path) { List matchR = new ArrayList<>(); - for (CodeableConcept l : left.getService()) { - CodeableConcept r = findInList(right.getService(), l); - if (r == null) { - union.getService().add(l); - combined.getChildren().add(new StructuralMatch(l, vmI(IssueSeverity.INFORMATION, "Removed this item", path))); - } else { - matchR.add(r); - CodeableConcept cdM = CodeableConcept.merge(l, r); - CodeableConcept cdI = CodeableConcept.intersect(l, r); - union.getService().add(cdM); - intersection.getService().add(cdI); - StructuralMatch sm = new StructuralMatch(l, r); - compare(sm, l, r, path, res); - combined.getChildren().add(sm); + if (left != null) { + for (CodeableConcept l : left.getService()) { + CodeableConcept r = findInList(right.getService(), l); + if (r == null) { + union.getService().add(l); + combined.getChildren().add(new StructuralMatch(l, vmI(IssueSeverity.INFORMATION, "Removed this item", path))); + } else { + matchR.add(r); + CodeableConcept cdM = CodeableConcept.merge(l, r); + CodeableConcept cdI = CodeableConcept.intersect(l, r); + union.getService().add(cdM); + intersection.getService().add(cdI); + StructuralMatch sm = new StructuralMatch(l, r); + compare(sm, l, r, path, res); + combined.getChildren().add(sm); + } } } if (right != null) { @@ -257,23 +259,23 @@ public class CapabilityStatementComparer extends CanonicalResourceComparer { } private void compareExpectations(StructuralMatch combined, Element left, Element right, String path, CapabilityStatementComparison res, Element union, Element intersection) { - Extension l = left.getExtensionByUrl(ToolingExtensions.EXT_CAP_STMT_EXPECT); - Extension r = right.getExtensionByUrl(ToolingExtensions.EXT_CAP_STMT_EXPECT); - if (l != null || r != null) { - if (l == null) { - union.addExtension(r.copy()); - combined.getChildren().add(new StructuralMatch(vmI(IssueSeverity.INFORMATION, "Added this expectation", path), r)); - } else if (r == null) { - union.addExtension(l.copy()); - combined.getChildren().add(new StructuralMatch(l, vmI(IssueSeverity.INFORMATION, "Removed this expectation", path))); - } else { - StructuralMatch sm = new StructuralMatch(l, r); + List l = left.getExtensionsByUrl(ToolingExtensions.EXT_CAP_STMT_EXPECT); + List r = right.getExtensionsByUrl(ToolingExtensions.EXT_CAP_STMT_EXPECT); + if (l.size() == 1 || r.size() == 1) { + if (l.size() == 0) { + union.addExtension(r.get(0).copy()); + combined.getChildren().add(new StructuralMatch(vmI(IssueSeverity.INFORMATION, "Added this expectation", path), r.get(0))); + } else if (r.size() == 0) { + union.addExtension(l.get(0).copy()); + combined.getChildren().add(new StructuralMatch(l.get(0), vmI(IssueSeverity.INFORMATION, "Removed this expectation", path))); + } else if (l.size() == 1 && r.size() == 1) { + StructuralMatch sm = new StructuralMatch(l.get(0), r.get(0)); combined.getChildren().add(sm); - String ls = l.getValue().primitiveValue(); - String rs = r.getValue().primitiveValue(); + String ls = l.get(0).getValue().primitiveValue(); + String rs = r.get(0).getValue().primitiveValue(); if (ls.equals(rs)) { - union.addExtension(l.copy()); - intersection.addExtension(l.copy()); + union.addExtension(l.get(0).copy()); + intersection.addExtension(l.get(0).copy()); } else { sm.getMessages().add(new ValidationMessage(Source.ProfileComparer, IssueType.INFORMATIONAL, path+".extension('http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation')", "Changed value for expectation: '"+ls+"' vs '"+rs+"'", IssueSeverity.WARNING)); String lowest = lower(ls, rs) ? ls : rs; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ComparisonRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ComparisonRenderer.java index 9ba77c38a..d94d5a3e0 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ComparisonRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/ComparisonRenderer.java @@ -79,6 +79,8 @@ public class ComparisonRenderer implements IEvaluationContext { b.append(" "+Utilities.escapeXml(leftName)+"\r\n"); b.append(" "+Utilities.escapeXml(rightName)+"\r\n"); b.append(" Difference\r\n"); + b.append(" Union\r\n"); + b.append(" Intersection\r\n"); b.append(" Notes\r\n"); b.append(" \r\n"); @@ -225,8 +227,22 @@ public class ComparisonRenderer implements IEvaluationContext { vars.put("errors", new StringType(new XhtmlComposer(true).compose(cs.renderErrors(comp)))); vars.put("metadata", new StringType(new XhtmlComposer(true).compose(cs.renderMetadata(comp, "", "")))); vars.put("structure", new StringType(new XhtmlComposer(true).compose(cs.renderStructure(comp, "", "", "http://hl7.org/fhir")))); - String cnt = processTemplate(template, "CodeSystem", vars); + String union = new XhtmlComposer(true).compose(cs.renderUnion(comp, "", folder, "http://hl7.org/fhir")); + String intersection = new XhtmlComposer(true).compose(cs.renderIntersection(comp, "", folder, "http://hl7.org/fhir")); + vars.put("union", new StringType(union)); + vars.put("intersection", new StringType(intersection)); + + String cnt = processTemplate(template, "Profile", vars); TextFile.stringToFile(cnt, file(comp.getId()+".html")); + + template = templates.get("Profile-Union"); + cnt = processTemplate(template, "Profile-Union", vars); + TextFile.stringToFile(cnt, file(comp.getId()+"-union.html")); + + template = templates.get("Profile-Intersection"); + cnt = processTemplate(template, "Profile-Intersection", vars); + TextFile.stringToFile(cnt, file(comp.getId()+"-intersection.html")); + new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(folder, comp.getId() + "-union.json")), comp.getUnion()); new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(folder, comp.getId() + "-intersection.json")), comp.getIntersection()); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java index a4874833e..c67870811 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/comparison/StructureDefinitionComparer.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.List; +import java.util.Set; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; @@ -46,6 +47,7 @@ import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row; +import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableGenerationMode; import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel; import org.hl7.fhir.utilities.xhtml.XhtmlNode; @@ -1252,10 +1254,21 @@ public class StructureDefinitionComparer extends CanonicalResourceComparer imple HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false, true); gen.setTranslator(session.getContextRight().translator()); TableModel model = gen.initComparisonTable(corePath, id); - genElementComp(null /* oome back to this later */, gen, model.getRows(), comp.combined, corePath, prefix, null, true); + genElementComp(null /* come back to this later */, gen, model.getRows(), comp.combined, corePath, prefix, null, true); return gen.generate(model, prefix, 0, null); } + public XhtmlNode renderUnion(ProfileComparison comp, String id, String prefix, String corePath) throws FHIRException, IOException { + StructureDefinitionRenderer sdr = new StructureDefinitionRenderer(new RenderingContext(utilsLeft.getContext(), null, utilsLeft.getTerminologyServiceOptions(), corePath, prefix, null, ResourceRendererMode.TECHNICAL, GenerationRules.IG_PUBLISHER).setPkp(this)); + return sdr.generateTable(corePath, comp.union, false, prefix, false, id, true, corePath, prefix, false, true, null, false, sdr.getContext(), "u"); + } + + + public XhtmlNode renderIntersection(ProfileComparison comp, String id, String prefix, String corePath) throws FHIRException, IOException { + StructureDefinitionRenderer sdr = new StructureDefinitionRenderer(new RenderingContext(utilsLeft.getContext(), null, utilsLeft.getTerminologyServiceOptions(), corePath, prefix, null, ResourceRendererMode.TECHNICAL, GenerationRules.IG_PUBLISHER).setPkp(this)); + return sdr.generateTable(corePath, comp.intersection, false, prefix, false, id, true, corePath, prefix, false, true, null, false, sdr.getContext(), "i"); + } + private void genElementComp(String defPath, HierarchicalTableGenerator gen, List rows, StructuralMatch combined, String corePath, String prefix, Row slicingRow, boolean root) throws IOException { Row originalRow = slicingRow; Row typesRow = null; From e8520b19073422dbe847541568aecc6756b3928e Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 22 Nov 2023 07:58:50 +1100 Subject: [PATCH 12/32] Move json and xml extensions from extensions pack to tooling ig --- .../r5/conformance/XmlSchemaGenerator.java | 4 +- .../conformance/profile/ProfileUtilities.java | 2 +- .../hl7/fhir/r5/context/ContextUtilities.java | 4 +- .../hl7/fhir/r5/elementmodel/ParserBase.java | 6 +-- .../hl7/fhir/r5/elementmodel/Property.java | 16 +++--- .../java/org/hl7/fhir/r5/model/Element.java | 33 +++++++----- .../StructureDefinitionRenderer.java | 53 ++++++++----------- .../hl7/fhir/r5/utils/ToolingExtensions.java | 43 +++++++++++---- 8 files changed, 94 insertions(+), 67 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/XmlSchemaGenerator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/XmlSchemaGenerator.java index bef045cb9..01577fc3c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/XmlSchemaGenerator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/XmlSchemaGenerator.java @@ -239,8 +239,8 @@ public class XmlSchemaGenerator { private String getNs(StructureDefinition sd) { String ns = "http://hl7.org/fhir"; - if (sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE)) - ns = ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_XML_NAMESPACE); + if (sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) + ns = ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); return ns; } 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 9b1fd17be..a70b62cce 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 @@ -262,7 +262,7 @@ public class ProfileUtilities extends TranslatingUtilities { "http://hl7.org/fhir/tools/StructureDefinition/json-property-key", "http://hl7.org/fhir/tools/StructureDefinition/type-specifier", "http://hl7.org/fhir/tools/StructureDefinition/xml-choice-group", - "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace", + ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED, "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype" ); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java index 58fcd84db..af32ead2f 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ContextUtilities.java @@ -362,8 +362,8 @@ public class ContextUtilities implements ProfileKnowledgeProvider { public StructureDefinition fetchByJsonName(String key) { for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) { ElementDefinition ed = sd.getSnapshot().getElementFirstRep(); - if (sd.getKind() == StructureDefinitionKind.LOGICAL && ed != null && ed.hasExtension(ToolingExtensions.EXT_JSON_NAME) && - key.equals(ToolingExtensions.readStringExtension(ed, ToolingExtensions.EXT_JSON_NAME))) { + if (sd.getKind() == StructureDefinitionKind.LOGICAL && ed != null && ed.hasExtension(ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED) && + key.equals(ToolingExtensions.readStringExtension(ed, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED))) { return sd; } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java index e78fb104f..9b91cee0d 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/ParserBase.java @@ -152,7 +152,7 @@ public abstract class ParserBase { expectedName = expectedName.substring(expectedName.lastIndexOf("/")+1); } } - String expectedNamespace = ToolingExtensions.readStringExtension(logical, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"); + String expectedNamespace = ToolingExtensions.readStringExtension(logical, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); if (matchesNamespace(expectedNamespace, ns) && matchesName(expectedName, name)) { return logical; } else { @@ -175,9 +175,9 @@ public abstract class ParserBase { for (StructureDefinition sd : context.fetchResourcesByType(StructureDefinition.class)) { if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && !sd.getUrl().startsWith("http://hl7.org/fhir/StructureDefinition/de-")) { String type = urlTail(sd.getType()); - if(name.equals(type) && (ns == null || ns.equals(FormatUtilities.FHIR_NS)) && !ToolingExtensions.hasExtension(sd, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) + if(name.equals(type) && (ns == null || ns.equals(FormatUtilities.FHIR_NS)) && !ToolingExtensions.hasAnyOfExtensions(sd, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) return sd; - String sns = ToolingExtensions.readStringExtension(sd, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"); + String sns = ToolingExtensions.readStringExtension(sd, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); if ((name.equals(type) || name.equals(sd.getName())) && ns != null && ns.equals(sns)) return sd; } 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 df04e0785..9b52be0ec 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 @@ -90,8 +90,8 @@ public class Property { } public String getJsonName() { - if (definition.hasExtension(ToolingExtensions.EXT_JSON_NAME)) { - return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME); + if (definition.hasExtension(ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED)) { + return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED); } else { return getName(); } @@ -100,16 +100,18 @@ public class Property { public String getXmlName() { if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME)) { return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAME); + } else if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME_DEPRECATED)) { + return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAME_DEPRECATED); } else { return getName(); } } public String getXmlNamespace() { - if (ToolingExtensions.hasExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) { - return ToolingExtensions.readStringExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"); - } else if (ToolingExtensions.hasExtension(structure, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) { - return ToolingExtensions.readStringExtension(structure, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"); + if (ToolingExtensions.hasAnyOfExtensions(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { + return ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); + } else if (ToolingExtensions.hasAnyOfExtensions(structure, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { + return ToolingExtensions.readStringExtension(structure, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); } else { return FormatUtilities.FHIR_NS; } @@ -596,7 +598,7 @@ public class Property { public boolean hasJsonName() { - return definition.hasExtension(ToolingExtensions.EXT_JSON_NAME); + return definition.hasExtension(ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Element.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Element.java index 4ce465bad..d6376ffa8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Element.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Element.java @@ -469,18 +469,27 @@ public abstract class Element extends Base implements IBaseHasExtensions, IBaseE * * @param theUrl The URL. Must not be blank or null. */ - public String getExtensionString(String theUrl) throws FHIRException { - List ext = getExtensionsByUrl(theUrl); - if (ext.isEmpty()) - return null; - if (ext.size() > 1) - throw new FHIRException("Multiple matching extensions found for extension '"+theUrl+"'"); - if (!ext.get(0).hasValue()) - return null; - if (!ext.get(0).getValue().isPrimitive()) - throw new FHIRException("Extension '"+theUrl+"' could not be converted to a string"); - return ext.get(0).getValue().primitiveValue(); - } + public String getExtensionString(String theUrl) throws FHIRException { + List ext = getExtensionsByUrl(theUrl); + if (ext.isEmpty()) + return null; + if (ext.size() > 1) + throw new FHIRException("Multiple matching extensions found for extension '"+theUrl+"'"); + if (!ext.get(0).hasValue()) + return null; + if (!ext.get(0).getValue().isPrimitive()) + throw new FHIRException("Extension '"+theUrl+"' could not be converted to a string"); + return ext.get(0).getValue().primitiveValue(); + } + + public String getExtensionString(String... theUrls) throws FHIRException { + for (String url : theUrls) { + if (hasExtension(url)) { + return getExtensionString(url); + } + } + return null; + } public StandardsStatus getStandardsStatus() { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java index 5fbb97b00..4c1e93141 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java @@ -537,6 +537,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } } + public XhtmlNode generateTable(String defFile, StructureDefinition profile, boolean diff, String imageFolder, boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, String imagePath, boolean logicalModel, boolean allInvariants, Set outputTracker, boolean mustSupport, RenderingContext rc, String anchorPrefix) throws IOException, FHIRException { assert(diff != snapshot);// check it's ok to get rid of one of these @@ -1256,14 +1257,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer { row.getCells().add(c); if (used) { - if (logicalModel && ToolingExtensions.hasExtension(profile, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) { + if (logicalModel && ToolingExtensions.hasAnyOfExtensions(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { if (root) { c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"), null)); - } else if (!root && ToolingExtensions.hasExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace") && - !ToolingExtensions.readStringExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace").equals(ToolingExtensions.readStringExtension(profile, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))) { + c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); + } else if (!root && ToolingExtensions.hasAnyOfExtensions(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) && + !ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED).equals(ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED))) { c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"), null)); + c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); } } if (root) { @@ -1416,27 +1417,22 @@ public class StructureDefinitionRenderer extends ResourceRenderer { c.getPieces().add(gen.new Piece(null, translate("sd.table", "Choice Group")+": ", null).addStyle("font-weight:bold")); c.getPieces().add(gen.new Piece(null, "This is a repeating choice group that does not appear directly in the instance", null)); } - if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME)) { + if (definition.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE)) { + if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME), null)); + c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED), null)); c.getPieces().add(gen.new Piece(null, " (", null)); - c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE), null)); + c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); c.getPieces().add(gen.new Piece(null, ")", null)); } else { c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Element Name")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME), null)); + c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED), null)); } - } else if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE)) { + } else if (definition.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Namespace")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE), null)); - } - if (root && ToolingExtensions.readBoolExtension(profile, ToolingExtensions.EXT_XML_NO_ORDER)) { - if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } - c.getPieces().add(gen.new Piece(null, translate("sd.table", "XML Order")+": ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, "The properties of this type can appear in any order in the XML", null)); + c.getPieces().add(gen.new Piece(null, definition.getExtensionString(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED), null)); } if (definition.hasExtension(ToolingExtensions.EXT_JSON_EMPTY)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } @@ -1447,7 +1443,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { c.getPieces().add(gen.new Piece(null, "JSON: This element may be present as a JSON Array even when there are no items in the instance", null)); } } - String jn = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME); + String jn = ToolingExtensions.readStringExtension(definition, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED); if (!Utilities.noString(jn)) { if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); } if (definition.getPath().contains(".")) { @@ -3642,11 +3638,12 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } // tooling extensions for formats - if (ToolingExtensions.hasExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE, - ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { + if (ToolingExtensions.hasAnyOfExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE, + ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED, ToolingExtensions.EXT_JSON_PRIMITIVE_CHOICE)) { tableRow(tbl, "JSON Format", null, strikethrough, describeJson(d)); } - if (d.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE) || sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE) || d.hasExtension(ToolingExtensions.EXT_XML_NAME) || (root && sd.hasExtension(ToolingExtensions.EXT_XML_NO_ORDER)) || + if (d.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) || sd.hasExtension(ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED) || + d.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED) || sd.hasExtension(ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED) || d.hasRepresentation()) { tableRow(tbl, "XML Format", null, strikethrough, describeXml(sd, d, root)); } @@ -3733,28 +3730,24 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } } } - String name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAMESPACE); + String name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); if (name == null && root) { - name = ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE); + name = ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_XML_NAMESPACE, ToolingExtensions.EXT_XML_NAMESPACE_DEPRECATED); } if (name != null) { ret.codeWithText("In the XML format, this property has the namespace ", name, "."); } - name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAME); + name = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_XML_NAME, ToolingExtensions.EXT_XML_NAME_DEPRECATED); if (name != null) { ret.codeWithText("In the XML format, this property has the actual name", name, "."); } - boolean no = root && ToolingExtensions.readBoolExtension(profile, ToolingExtensions.EXT_XML_NO_ORDER); - if (no) { - ret.tx("The children of this type can appear in any order in the XML."); - } return ret; } private XhtmlNode describeJson(ElementDefinition d) { XhtmlNode ret = new XhtmlNode(NodeType.Element, "div"); var ul = ret.ul(); - boolean list = ToolingExtensions.countExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE, ToolingExtensions.EXT_JSON_NAME) > 1; + boolean list = ToolingExtensions.countExtensions(d, ToolingExtensions.EXT_JSON_EMPTY, ToolingExtensions.EXT_JSON_PROP_KEY, ToolingExtensions.EXT_JSON_NULLABLE, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED) > 1; String code = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_EMPTY); if (code != null) { @@ -3770,7 +3763,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { break; } } - String jn = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_NAME); + String jn = ToolingExtensions.readStringExtension(d, ToolingExtensions.EXT_JSON_NAME, ToolingExtensions.EXT_JSON_NAME_DEPRECATED); if (jn != null) { if (d.getPath().contains(".")) { ul.li().codeWithText("This property appears in JSON with the property name ", jn, null); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java index ced70d2a3..7767725e1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java @@ -117,8 +117,9 @@ public class ToolingExtensions { public static final String EXT_ISSUE_COL = "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-col"; public static final String EXT_OO_FILE = "http://hl7.org/fhir/StructureDefinition/operationoutcome-file"; public static final String EXT_RESOURCE_IMPLEMENTS = "http://hl7.org/fhir/StructureDefinition/structuredefinition-implements"; - public static final String EXT_XML_TYPE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type"; - public static final String EXT_XML_NAME = "http://hl7.org/fhir/StructureDefinition/elementdefinition-xml-name"; + public static final String EXT_XML_TYPE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type"; // r2 - r3 + public static final String EXT_XML_NAME_DEPRECATED = "http://hl7.org/fhir/StructureDefinition/elementdefinition-xml-name"; + public static final String EXT_XML_NAME = "http://hl7.org/fhir/tools/StructureDefinition/xml-name"; public static final String EXT_EXPLICIT_TYPE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"; public static final String EXT_IGP_RESOURCES = "http://hl7.org/fhir/StructureDefinition/igpublisher-folder-resource"; @@ -137,7 +138,8 @@ public class ToolingExtensions { public static final String EXT_IGP_RESOURCE_INFO = "http://hl7.org/fhir/tools/StructureDefinition/resource-information"; public static final String EXT_IGP_LOADVERSION = "http://hl7.org/fhir/StructureDefinition/igpublisher-loadversion"; public static final String EXT_LIST_PACKAGE = "http://hl7.org/fhir/StructureDefinition/list-packageId"; - public static final String EXT_JSON_NAME = "http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-json-name"; + public static final String EXT_JSON_NAME_DEPRECATED = "http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-json-name"; + public static final String EXT_JSON_NAME = "http://hl7.org/fhir/tools/StructureDefinition/json-name"; public static final String EXT_BINDING_STYLE = "http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-binding-style"; public static final String EXT_EXTENSION_STYLE = "http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-extension-style"; public static final String EXT_LOGICAL_TARGET = "http://hl7.org/fhir/tools/StructureDefinition/logical-target"; @@ -151,10 +153,6 @@ public class ToolingExtensions { public static final String EXT_OT = "http://hl7.org/fhir/StructureDefinition/originalText"; public static final String EXT_CQF_EXP = "http://hl7.org/fhir/StructureDefinition/cqf-expression"; - - // validated - // private static final String EXT_OID = "http://hl7.org/fhir/StructureDefinition/valueset-oid"; - // public static final String EXT_DEPRECATED = "http://hl7.org/fhir/StructureDefinition/codesystem-deprecated"; public static final String EXT_PATTERN = "http://hl7.org/fhir/StructureDefinition/elementdefinition-pattern"; public static final String EXT_ALLOWEDRESOURCE = "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"; private static final String EXT_ALLOWABLE_UNITS = "http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits"; @@ -208,7 +206,8 @@ public class ToolingExtensions { public static final String EXT_VS_COMMENT = "http://hl7.org/fhir/StructureDefinition/valueset-concept-comments"; public static final String EXT_VS_KEYWORD = "http://hl7.org/fhir/StructureDefinition/valueset-keyWord"; public static final String EXT_WORKGROUP = "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg"; - public static final String EXT_XML_NAMESPACE = "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"; + public static final String EXT_XML_NAMESPACE_DEPRECATED = "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"; + public static final String EXT_XML_NAMESPACE = "http://hl7.org/fhir/tools/StructureDefinition/xml-namespace"; public static final String EXT_OLD_CONCEPTMAP_EQUIVALENCE = "http://hl7.org/fhir/1.0/StructureDefinition/extension-ConceptMap.element.target.equivalence"; public static final String EXT_Q_IS_SUBJ = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-isSubject"; public static final String EXT_Q_HIDDEN = "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden"; @@ -221,7 +220,6 @@ public class ToolingExtensions { public static final String EXT_ED_HEIRARCHY = "http://hl7.org/fhir/StructureDefinition/elementdefinition-heirarchy"; public static final String EXT_SD_IMPOSE_PROFILE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-imposeProfile"; public static final String EXT_SD_COMPLIES_WITH_PROFILE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-compliesWithProfile"; - public static final String EXT_XML_NO_ORDER = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-no-order"; public static final String EXT_DEF_TYPE = "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype"; public static final String EXT_TYPE_SPEC = "http://hl7.org/fhir/tools/StructureDefinition/type-specifier"; public static final String EXT_TYPE_CHARACTERISTICS = "http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics"; @@ -413,6 +411,14 @@ public class ToolingExtensions { return readStringExtension(def, EXT_DISPLAY_HINT); } + public static String readStringExtension(Element c, String... uris) { + for (String uri : uris) { + if (hasExtension(c, uri)) { + return readStringExtension(c, uri); + } + } + return null; + } public static String readStringExtension(Element c, String uri) { Extension ex = ExtensionHelper.getExtension(c, uri); if (ex == null) @@ -438,6 +444,14 @@ public class ToolingExtensions { return ((StringType) ex.getValue()).getValue(); } + public static String readStringExtension(DomainResource c, String... uris) { + for (String uri : uris) { + if (hasExtension(c, uri)) { + return readStringExtension(c, uri); + } + } + return null; + } public static String readStringExtension(DomainResource c, String uri) { Extension ex = getExtension(c, uri); if (ex == null) @@ -1099,7 +1113,7 @@ public class ToolingExtensions { return cachedConsts; } - public static boolean hasExtensions(ElementDefinition d, String... urls) { + public static boolean hasAnyOfExtensions(Element d, String... urls) { for (String url : urls) { if (d.hasExtension(url)) { return true; @@ -1108,6 +1122,15 @@ public class ToolingExtensions { return false; } + public static boolean hasAnyOfExtensions(DomainResource dr, String... urls) { + for (String url : urls) { + if (dr.hasExtension(url)) { + return true; + } + } + return false; + } + public static int countExtensions(ElementDefinition d, String... urls) { int res = 0; for (String url : urls) { From bd98afaa090ae9353ab379bdcc2ca7b9238cb939 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 06:10:38 +1100 Subject: [PATCH 13/32] refactor versionutil --- .../java/org/hl7/fhir/utilities}/VersionUtil.java | 12 ++++++------ .../validation/cli/services/HTMLOutputGenerator.java | 2 +- .../org/hl7/fhir/validation/cli/utils/Common.java | 1 + .../org/hl7/fhir/validation/cli/utils/Display.java | 1 + .../services/StandAloneValidatorFetcherTests.java | 2 +- .../cli/services/ValidationServiceTest.java | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) rename {org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils => org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities}/VersionUtil.java (92%) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/VersionUtil.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtil.java similarity index 92% rename from org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/VersionUtil.java rename to org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtil.java index 9df9e75d9..853a77528 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/VersionUtil.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtil.java @@ -1,4 +1,4 @@ -package org.hl7.fhir.validation.cli.utils; +package org.hl7.fhir.utilities; import static org.apache.commons.lang3.StringUtils.defaultIfBlank; import static org.apache.commons.lang3.StringUtils.left; @@ -34,11 +34,11 @@ import static org.apache.commons.lang3.StringUtils.left; import java.io.InputStream; +import java.text.SimpleDateFormat; import java.time.Duration; import java.util.Date; import java.util.Properties; -import org.hl7.fhir.r5.model.InstantType; import org.hl7.fhir.utilities.Utilities; /** @@ -93,12 +93,12 @@ public class VersionUtil { private static String getDurationSinceBuild() { try { - InstantType dt = new InstantType(ourBuildTime); - return Utilities.describeDuration(Duration.ofMillis(new Date().getTime() - dt.getValue().getTime()))+" old"; +// InstantType dt = new InstantType(ourBuildTime); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); + Date dt = sdf.parse(ourBuildTime.substring(0, 19)); + return Utilities.describeDuration(Duration.ofMillis(new Date().getTime() - dt.getTime()))+" old"; } catch (Exception e) { return "??"; } } - - } \ No newline at end of file diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/HTMLOutputGenerator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/HTMLOutputGenerator.java index 5137a0a2d..997d948cd 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/HTMLOutputGenerator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/HTMLOutputGenerator.java @@ -5,10 +5,10 @@ import java.util.Date; import java.util.List; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.VersionUtil; import org.hl7.fhir.utilities.validation.ValidationMessage; import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; import org.hl7.fhir.validation.ValidationRecord; -import org.hl7.fhir.validation.cli.utils.VersionUtil; public class HTMLOutputGenerator { diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Common.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Common.java index 5372c757f..9640584e0 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Common.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Common.java @@ -2,6 +2,7 @@ package org.hl7.fhir.validation.cli.utils; import org.hl7.fhir.utilities.FhirPublication; import org.hl7.fhir.utilities.TimeTracker; +import org.hl7.fhir.utilities.VersionUtil; import org.hl7.fhir.utilities.VersionUtilities; import org.hl7.fhir.utilities.settings.FhirSettings; import org.hl7.fhir.validation.ValidationEngine; diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Display.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Display.java index f9603519c..fc093f556 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Display.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Display.java @@ -5,6 +5,7 @@ import java.io.InputStream; import java.io.PrintStream; import org.apache.commons.io.IOUtils; +import org.hl7.fhir.utilities.VersionUtil; import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager; /** diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/StandAloneValidatorFetcherTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/StandAloneValidatorFetcherTests.java index d08eb79fe..dd01462b5 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/StandAloneValidatorFetcherTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/StandAloneValidatorFetcherTests.java @@ -2,8 +2,8 @@ package org.hl7.fhir.validation.cli.services; import org.hl7.fhir.r5.context.IWorkerContext; import org.hl7.fhir.r5.terminologies.client.ITerminologyClient; +import org.hl7.fhir.utilities.VersionUtil; import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager; -import org.hl7.fhir.validation.cli.utils.VersionUtil; import org.junit.Test; import java.net.URISyntaxException; diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/ValidationServiceTest.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/ValidationServiceTest.java index a11da2c80..2047144d1 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/ValidationServiceTest.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/cli/services/ValidationServiceTest.java @@ -30,12 +30,12 @@ import org.hl7.fhir.r5.elementmodel.Manager; import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.test.utils.TestingUtilities; import org.hl7.fhir.utilities.TimeTracker; +import org.hl7.fhir.utilities.VersionUtil; import org.hl7.fhir.utilities.settings.FhirSettings; import org.hl7.fhir.validation.ValidationEngine; import org.hl7.fhir.validation.cli.model.CliContext; import org.hl7.fhir.validation.cli.model.FileInfo; import org.hl7.fhir.validation.cli.model.ValidationRequest; -import org.hl7.fhir.validation.cli.utils.VersionUtil; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; From cdebad43d028c745291c5e49be85638a18da07f1 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 06:10:58 +1100 Subject: [PATCH 14/32] more work on VSAC --- .../fhir/convertors/misc/VSACImporter.java | 205 ++++++++++++++---- 1 file changed, 165 insertions(+), 40 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/VSACImporter.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/VSACImporter.java index 2842218c4..97fc3350d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/VSACImporter.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/VSACImporter.java @@ -2,11 +2,15 @@ package org.hl7.fhir.convertors.misc; import java.io.File; import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.net.URISyntaxException; import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.hl7.fhir.exceptions.FHIRException; @@ -24,9 +28,66 @@ import org.hl7.fhir.r4.utils.client.FHIRToolingClient; import org.hl7.fhir.r4.terminologies.JurisdictionUtilities; import org.hl7.fhir.utilities.CSVReader; import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.json.model.JsonArray; +import org.hl7.fhir.utilities.json.model.JsonObject; +import org.hl7.fhir.utilities.json.model.JsonProperty; public class VSACImporter extends OIDBasedValueSetImporter { + private static class StatsTracker { + private String runNumber; + private JsonObject stats; + private File file; + + protected StatsTracker() throws IOException { + super(); + file = new File(Utilities.path("[tmp]", "vsac.stats.json")); + if (file.exists() ) { + stats = org.hl7.fhir.utilities.json.parser.JsonParser.parseObject(file); + runNumber = ""+(stats.asInteger("last-run")+1); + } else { + stats = new JsonObject(); + runNumber = "1"; + } + stats.set("last-run", runNumber); + } + + public void recordTime(String oid, boolean expand, int offset, long time) { + JsonArray arr = stats.forceObject(oid).forceObject(runNumber).forceArray(expand ? "e"+offset : "r"); + arr.add(Long.toString(time)); + } + + public void recordError(String oid, boolean expand, int offset, String error) { + JsonArray arr = stats.forceObject(oid).forceObject(runNumber).forceArray(expand ? "e"+offset : "r"); + arr.add(error.contains("time") ? "t" : error); + } + + public boolean hasFailed(String oid) { + JsonObject obj = stats.forceObject(oid); + for (JsonProperty p : obj.getProperties()) { + if (p.getValue().isJsonObject()) { + JsonObject o = p.getValue().asJsonObject(); + for (JsonProperty p1 : o.getProperties()) { + if (p1.getValue().isJsonArray()) { + JsonArray a = p1.getValue().asJsonArray(); + for (String s : a.asStrings()) { + if ("t".equals(s)) { + return true; + } + } + } + } + + } + } + return false; + } + + public void save() throws IOException { + org.hl7.fhir.utilities.json.parser.JsonParser.compose(stats, file); + } + } + public VSACImporter() throws FHIRException, IOException { super(); init(); @@ -41,6 +102,7 @@ public class VSACImporter extends OIDBasedValueSetImporter { CSVReader csv = new CSVReader(new FileInputStream(source)); csv.readHeaders(); Map errs = new HashMap<>(); + StatsTracker st = new StatsTracker(); FHIRToolingClient fhirToolingClient = new FHIRToolingClient("https://cts.nlm.nih.gov/fhir", "fhir/vsac"); fhirToolingClient.setUsername("apikey"); @@ -50,58 +112,34 @@ public class VSACImporter extends OIDBasedValueSetImporter { CapabilityStatement cs = fhirToolingClient.getCapabilitiesStatement(); JsonParser json = new JsonParser(); json.setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path("[tmp]", "vsac-capability-statmenet.json")), cs); - - int i = 0; - int j = 0; + + System.out.println("Loading"); + List oids = new ArrayList<>(); while (csv.line()) { String oid = csv.cell("OID"); + if (st.hasFailed(oid)) { + oid = " "+oid; // do these first + } + oids.add(oid); + } + Collections.sort(oids); + System.out.println("Go: "+oids.size()+" oids"); + int i = 0; + int j = 0; + for (String oid : oids) { try { - if (!onlyNew || !(new File(Utilities.path(dest, "ValueSet-" + oid + ".json")).exists())) { - ValueSet vs = fhirToolingClient.read(ValueSet.class, oid); - try { - ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), null); - vs.setExpansion(vse.getExpansion()); - j++; - } catch (Exception e) { - errs.put(oid, "Expansion: " +e.getMessage()); - System.out.println(e.getMessage()); - } - while (isIncomplete(vs.getExpansion())) { - Parameters p = new Parameters(); - p.addParameter("offset", vs.getExpansion().getParameter("offset").getValueIntegerType().getValue() + vs.getExpansion().getParameter("count").getValueIntegerType().getValue()); - ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), p); - vs.getExpansion().getContains().addAll(vse.getExpansion().getContains()); - vs.getExpansion().setParameter(vse.getExpansion().getParameter()); - } - vs.getExpansion().setOffsetElement(null); - vs.getExpansion().getParameter().clear(); - - - if (vs.hasTitle()) { - if (vs.getTitle().equals(vs.getDescription())) { - vs.setTitle(vs.getName()); - } else { -// System.out.println(oid); -// System.out.println(" name: "+vs.getName()); -// System.out.println(" title: "+vs.getTitle()); -// System.out.println(" desc: "+vs.getDescription()); - } - } else { - vs.setTitle(vs.getName()); - } - vs.setName(makeValidName(vs.getName())); - JurisdictionUtilities.setJurisdictionCountry(vs.getJurisdiction(), "US"); - new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(dest, "ValueSet-" + oid + ".json")), vs); - } + j = processOid(dest, onlyNew, errs, st, fhirToolingClient, j, oid.trim()); i++; if (i % 100 == 0) { System.out.println(":"+i+" ("+j+")"); + st.save(); } } catch (Exception e) { System.out.println("Unable to fetch OID " + oid + ": " + e.getMessage()); errs.put(oid, e.getMessage()); } } + st.save(); OperationOutcome oo = new OperationOutcome(); for (String oid : errs.keySet()) { oo.addIssue().setSeverity(IssueSeverity.ERROR).setCode(IssueType.EXCEPTION).setDiagnostics(errs.get(oid)).addLocation(oid); @@ -110,6 +148,93 @@ public class VSACImporter extends OIDBasedValueSetImporter { System.out.println("Done. " + i + " ValueSets"); } + private int processOid(String dest, boolean onlyNew, Map errs, StatsTracker st, + FHIRToolingClient fhirToolingClient, int j, String oid) + throws IOException, InterruptedException, FileNotFoundException { + if (!onlyNew || !(new File(Utilities.path(dest, "ValueSet-" + oid + ".json")).exists())) { + ValueSet vs = null; + try { + long t = System.currentTimeMillis(); + vs = fhirToolingClient.read(ValueSet.class, oid); + st.recordTime(oid, false, 0, System.currentTimeMillis()-t); + } catch (Exception e) { + st.recordError(oid, false, 0, e.getMessage()); + errs.put(oid, "Read: " +e.getMessage()+". Try again"); + System.out.println("Read "+oid+" failed: "+e.getMessage()+". Try again after 10sec"); + Thread.sleep(10000); + try { + long t = System.currentTimeMillis(); + vs = fhirToolingClient.read(ValueSet.class, oid); + st.recordTime(oid, false, 0, System.currentTimeMillis()-t); + } catch (Exception e2) { + st.recordError(oid, false, 0, e2.getMessage()); + errs.put(oid, "Read: " +e2.getMessage()+". Give up"); + System.out.println("Read "+oid+" failed: "+e2.getMessage()+". Give up"); + } + } + if (vs != null) { + try { + long t = System.currentTimeMillis(); + ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), null); + st.recordTime(oid, true, 0, System.currentTimeMillis()-t); + vs.setExpansion(vse.getExpansion()); + j++; + } catch (Exception e) { + st.recordError(oid, true, 0, e.getMessage()); + errs.put(oid, "Expansion: " +e.getMessage()+". Try again"); + System.out.println("Expand "+oid+" failed: "+e.getMessage()+". Try again"); + try { + long t = System.currentTimeMillis(); + ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), null); + st.recordTime(oid, true, 0, System.currentTimeMillis()-t); + vs.setExpansion(vse.getExpansion()); + j++; + } catch (Exception e2) { + st.recordError(oid, true, 0, e2.getMessage()); + errs.put(oid, "Expansion: " +e2.getMessage()+". Give up"); + System.out.println("Expand "+oid+" failed: "+e2.getMessage()+". Give up"); + } + } + while (isIncomplete(vs.getExpansion())) { + Parameters p = new Parameters(); + int offset = vs.getExpansion().getParameter("offset").getValueIntegerType().getValue() + vs.getExpansion().getParameter("count").getValueIntegerType().getValue(); + p.addParameter("offset", offset); + try { + long t = System.currentTimeMillis(); + ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), p); + st.recordTime(oid, true, offset, System.currentTimeMillis()-t); + vs.getExpansion().getContains().addAll(vse.getExpansion().getContains()); + vs.getExpansion().setParameter(vse.getExpansion().getParameter()); + } catch (Exception e2) { + st.recordError(oid, true, 0, e2.getMessage()); + errs.put(oid, "Expansion: " +e2.getMessage()+" @ "+offset+". Give up"); + System.out.println("Expand "+oid+" @ "+offset+" failed: "+e2.getMessage()+". Give up"); + } + } + vs.getExpansion().setOffsetElement(null); + vs.getExpansion().getParameter().clear(); + + + if (vs.hasTitle()) { + if (vs.getTitle().equals(vs.getDescription())) { + vs.setTitle(vs.getName()); + } else { + // System.out.println(oid); + // System.out.println(" name: "+vs.getName()); + // System.out.println(" title: "+vs.getTitle()); + // System.out.println(" desc: "+vs.getDescription()); + } + } else { + vs.setTitle(vs.getName()); + } + vs.setName(makeValidName(vs.getName())); + JurisdictionUtilities.setJurisdictionCountry(vs.getJurisdiction(), "US"); + new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(dest, "ValueSet-" + oid + ".json")), vs); + } + } + return j; + } + private boolean isIncomplete(ValueSetExpansionComponent expansion) { IntegerType c = expansion.getParameter("count").getValueIntegerType(); IntegerType offset = expansion.getParameter("offset").getValueIntegerType(); From a86e3d2bdc0a304148074529edfe38638650dfb2 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 07:05:50 +1100 Subject: [PATCH 15/32] ips builder fix --- .../src/main/java/org/hl7/fhir/r4/ips/IPSBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/ips/IPSBuilder.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/ips/IPSBuilder.java index 02dcf5bca..69e6a72cd 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/ips/IPSBuilder.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/ips/IPSBuilder.java @@ -84,6 +84,7 @@ public class IPSBuilder { dev.setId("java"); dev.addDeviceName().setName("Java Core Library"); dev.addVersion().setValue(VersionUtil.getVersion()); + bnd.addEntry().setResource(dev).setFullUrl(Utilities.pathURL(url, "Device", dev.getIdBase())); return cmp; } @@ -210,7 +211,7 @@ public class IPSBuilder { } private static void addConditions(Bundle bnd, Composition cmp, FHIRToolingClient server, String patientId) { - Bundle sb = server.search("Condition", "?patient="+patientId); //+"&_include=MedicationStatement:asserter"); + Bundle sb = server.search("Condition", "?patient="+patientId+"&_include=Condition:asserter"); SectionComponent sct = cmp.addSection(); sct.setTitle("Problems"); sct.getCode().addCoding().setSystem("http://loinc.org").setCode("11450-4"); From 1814a69826abe89fbde3265736aa4780c00dd64a Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:46:23 +1100 Subject: [PATCH 16/32] Fix timeout issue in vsac --- .../fhir/convertors/misc/VSACImporter.java | 109 ++---------------- .../txClient/TerminologyClientR4.java | 4 +- .../r4/terminologies/TerminologyClientR4.java | 2 +- .../r4/utils/client/FHIRToolingClient.java | 109 ++++++++++++------ .../fhir/r4/utils/client/network/Client.java | 18 +-- 5 files changed, 91 insertions(+), 151 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/VSACImporter.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/VSACImporter.java index 97fc3350d..c3474418f 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/VSACImporter.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/VSACImporter.java @@ -33,60 +33,6 @@ import org.hl7.fhir.utilities.json.model.JsonObject; import org.hl7.fhir.utilities.json.model.JsonProperty; public class VSACImporter extends OIDBasedValueSetImporter { - - private static class StatsTracker { - private String runNumber; - private JsonObject stats; - private File file; - - protected StatsTracker() throws IOException { - super(); - file = new File(Utilities.path("[tmp]", "vsac.stats.json")); - if (file.exists() ) { - stats = org.hl7.fhir.utilities.json.parser.JsonParser.parseObject(file); - runNumber = ""+(stats.asInteger("last-run")+1); - } else { - stats = new JsonObject(); - runNumber = "1"; - } - stats.set("last-run", runNumber); - } - - public void recordTime(String oid, boolean expand, int offset, long time) { - JsonArray arr = stats.forceObject(oid).forceObject(runNumber).forceArray(expand ? "e"+offset : "r"); - arr.add(Long.toString(time)); - } - - public void recordError(String oid, boolean expand, int offset, String error) { - JsonArray arr = stats.forceObject(oid).forceObject(runNumber).forceArray(expand ? "e"+offset : "r"); - arr.add(error.contains("time") ? "t" : error); - } - - public boolean hasFailed(String oid) { - JsonObject obj = stats.forceObject(oid); - for (JsonProperty p : obj.getProperties()) { - if (p.getValue().isJsonObject()) { - JsonObject o = p.getValue().asJsonObject(); - for (JsonProperty p1 : o.getProperties()) { - if (p1.getValue().isJsonArray()) { - JsonArray a = p1.getValue().asJsonArray(); - for (String s : a.asStrings()) { - if ("t".equals(s)) { - return true; - } - } - } - } - - } - } - return false; - } - - public void save() throws IOException { - org.hl7.fhir.utilities.json.parser.JsonParser.compose(stats, file); - } - } public VSACImporter() throws FHIRException, IOException { super(); @@ -102,12 +48,11 @@ public class VSACImporter extends OIDBasedValueSetImporter { CSVReader csv = new CSVReader(new FileInputStream(source)); csv.readHeaders(); Map errs = new HashMap<>(); - StatsTracker st = new StatsTracker(); FHIRToolingClient fhirToolingClient = new FHIRToolingClient("https://cts.nlm.nih.gov/fhir", "fhir/vsac"); fhirToolingClient.setUsername("apikey"); fhirToolingClient.setPassword(apiKey); - fhirToolingClient.setTimeout(120000); + fhirToolingClient.setTimeoutNormal(6000); CapabilityStatement cs = fhirToolingClient.getCapabilitiesStatement(); JsonParser json = new JsonParser(); @@ -117,9 +62,6 @@ public class VSACImporter extends OIDBasedValueSetImporter { List oids = new ArrayList<>(); while (csv.line()) { String oid = csv.cell("OID"); - if (st.hasFailed(oid)) { - oid = " "+oid; // do these first - } oids.add(oid); } Collections.sort(oids); @@ -128,18 +70,16 @@ public class VSACImporter extends OIDBasedValueSetImporter { int j = 0; for (String oid : oids) { try { - j = processOid(dest, onlyNew, errs, st, fhirToolingClient, j, oid.trim()); + j = processOid(dest, onlyNew, errs, fhirToolingClient, j, oid.trim()); i++; if (i % 100 == 0) { System.out.println(":"+i+" ("+j+")"); - st.save(); } } catch (Exception e) { System.out.println("Unable to fetch OID " + oid + ": " + e.getMessage()); errs.put(oid, e.getMessage()); } } - st.save(); OperationOutcome oo = new OperationOutcome(); for (String oid : errs.keySet()) { oo.addIssue().setSeverity(IssueSeverity.ERROR).setCode(IssueType.EXCEPTION).setDiagnostics(errs.get(oid)).addLocation(oid); @@ -148,67 +88,36 @@ public class VSACImporter extends OIDBasedValueSetImporter { System.out.println("Done. " + i + " ValueSets"); } - private int processOid(String dest, boolean onlyNew, Map errs, StatsTracker st, - FHIRToolingClient fhirToolingClient, int j, String oid) + private int processOid(String dest, boolean onlyNew, Map errs, FHIRToolingClient fhirToolingClient, int j, String oid) throws IOException, InterruptedException, FileNotFoundException { if (!onlyNew || !(new File(Utilities.path(dest, "ValueSet-" + oid + ".json")).exists())) { ValueSet vs = null; try { - long t = System.currentTimeMillis(); vs = fhirToolingClient.read(ValueSet.class, oid); - st.recordTime(oid, false, 0, System.currentTimeMillis()-t); } catch (Exception e) { - st.recordError(oid, false, 0, e.getMessage()); - errs.put(oid, "Read: " +e.getMessage()+". Try again"); - System.out.println("Read "+oid+" failed: "+e.getMessage()+". Try again after 10sec"); - Thread.sleep(10000); - try { - long t = System.currentTimeMillis(); - vs = fhirToolingClient.read(ValueSet.class, oid); - st.recordTime(oid, false, 0, System.currentTimeMillis()-t); - } catch (Exception e2) { - st.recordError(oid, false, 0, e2.getMessage()); - errs.put(oid, "Read: " +e2.getMessage()+". Give up"); - System.out.println("Read "+oid+" failed: "+e2.getMessage()+". Give up"); - } + errs.put(oid, "Read: " +e.getMessage()); + System.out.println("Read "+oid+" failed: "+e.getMessage()); } if (vs != null) { try { - long t = System.currentTimeMillis(); ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), null); - st.recordTime(oid, true, 0, System.currentTimeMillis()-t); vs.setExpansion(vse.getExpansion()); j++; } catch (Exception e) { - st.recordError(oid, true, 0, e.getMessage()); - errs.put(oid, "Expansion: " +e.getMessage()+". Try again"); - System.out.println("Expand "+oid+" failed: "+e.getMessage()+". Try again"); - try { - long t = System.currentTimeMillis(); - ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), null); - st.recordTime(oid, true, 0, System.currentTimeMillis()-t); - vs.setExpansion(vse.getExpansion()); - j++; - } catch (Exception e2) { - st.recordError(oid, true, 0, e2.getMessage()); - errs.put(oid, "Expansion: " +e2.getMessage()+". Give up"); - System.out.println("Expand "+oid+" failed: "+e2.getMessage()+". Give up"); - } + errs.put(oid, "Expansion: " +e.getMessage()); + System.out.println("Expand "+oid+" failed: "+e.getMessage()); } while (isIncomplete(vs.getExpansion())) { Parameters p = new Parameters(); int offset = vs.getExpansion().getParameter("offset").getValueIntegerType().getValue() + vs.getExpansion().getParameter("count").getValueIntegerType().getValue(); p.addParameter("offset", offset); try { - long t = System.currentTimeMillis(); ValueSet vse = fhirToolingClient.expandValueset(vs.getUrl(), p); - st.recordTime(oid, true, offset, System.currentTimeMillis()-t); vs.getExpansion().getContains().addAll(vse.getExpansion().getContains()); vs.getExpansion().setParameter(vse.getExpansion().getParameter()); } catch (Exception e2) { - st.recordError(oid, true, 0, e2.getMessage()); - errs.put(oid, "Expansion: " +e2.getMessage()+" @ "+offset+". Give up"); - System.out.println("Expand "+oid+" @ "+offset+" failed: "+e2.getMessage()+". Give up"); + errs.put(oid, "Expansion: " +e2.getMessage()+" @ "+offset); + System.out.println("Expand "+oid+" @ "+offset+" failed: "+e2.getMessage()); } } vs.getExpansion().setOffsetElement(null); diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java index d498a6526..a67fd3fba 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java @@ -133,8 +133,8 @@ public class TerminologyClientR4 implements ITerminologyClient { } @Override - public ITerminologyClient setTimeout(int i) { - client.setTimeout(i); + public ITerminologyClient setTimeout(int i) { // #FIXME + client.setTimeoutNormal(i); return this; } diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/terminologies/TerminologyClientR4.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/terminologies/TerminologyClientR4.java index b9068fb7b..cca26d477 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/terminologies/TerminologyClientR4.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/terminologies/TerminologyClientR4.java @@ -87,7 +87,7 @@ public class TerminologyClientR4 implements TerminologyClient { @Override public void setTimeout(int i) { - client.setTimeout(i); + client.setTimeoutNormal(i); // #FIXME } @Override diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java index 24236affb..543921341 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java @@ -67,12 +67,12 @@ public class FHIRToolingClient { public static final String hostKey = "http.proxyHost"; public static final String portKey = "http.proxyPort"; - private static final int TIMEOUT_NORMAL = 1500; - private static final int TIMEOUT_OPERATION = 30000; - private static final int TIMEOUT_ENTRY = 500; - private static final int TIMEOUT_OPERATION_LONG = 60000; - private static final int TIMEOUT_OPERATION_EXPAND = 120000; - + private static final int DEFAULT_TIMEOUT_NORMAL = 1500; + private static final int DEFAULT_TIMEOUT_OPERATION = 30000; + private static final int DEFAULT_TIMEOUT_ENTRY = 500; + private static final int DEFAULT_TIMEOUT_OPERATION_LONG = 60000; + private static final int DEFAULT_TIMEOUT_OPERATION_EXPAND = 120000; + private String base; private ResourceAddress resourceAddress; private ResourceFormat preferredResourceFormat; @@ -84,6 +84,11 @@ public class FHIRToolingClient { private String password; private String userAgent; private String acceptLang; + private int timeoutNormal = DEFAULT_TIMEOUT_NORMAL; + private int timeoutOperation = DEFAULT_TIMEOUT_OPERATION; + private int timeoutEntry = DEFAULT_TIMEOUT_ENTRY; + private int timeoutLong = DEFAULT_TIMEOUT_OPERATION_LONG; + private int timeoutExpand = DEFAULT_TIMEOUT_OPERATION_EXPAND; // Pass endpoint for client - URI public FHIRToolingClient(String baseServiceUrl, String userAgent) throws URISyntaxException { @@ -134,7 +139,7 @@ public class FHIRToolingClient { TerminologyCapabilities capabilities = null; try { capabilities = (TerminologyCapabilities) client.issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), - getPreferredResourceFormat(), generateHeaders(), "TerminologyCapabilities", TIMEOUT_NORMAL).getReference(); + getPreferredResourceFormat(), generateHeaders(), "TerminologyCapabilities", timeoutNormal).getReference(); } catch (Exception e) { throw new FHIRException("Error fetching the server's terminology capabilities", e); } @@ -145,7 +150,7 @@ public class FHIRToolingClient { CapabilityStatement conformance = null; try { conformance = (CapabilityStatement) client.issueGetResourceRequest(resourceAddress.resolveMetadataUri(false), - getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement", TIMEOUT_NORMAL).getReference(); + getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement", timeoutNormal).getReference(); } catch (Exception e) { throw new FHIRException("Error fetching the server's conformance statement", e); } @@ -157,7 +162,7 @@ public class FHIRToolingClient { return capabilities; try { capabilities = (CapabilityStatement) client.issueGetResourceRequest(resourceAddress.resolveMetadataUri(true), - getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement-Quick", TIMEOUT_NORMAL) + getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement-Quick", timeoutNormal) .getReference(); } catch (Exception e) { throw new FHIRException("Error fetching the server's capability statement: " + e.getMessage(), e); @@ -170,7 +175,7 @@ public class FHIRToolingClient { try { result = client.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass + "/" + id, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -186,7 +191,7 @@ public class FHIRToolingClient { try { result = client.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "/" + id, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -203,7 +208,7 @@ public class FHIRToolingClient { result = client.issueGetResourceRequest( resourceAddress.resolveGetUriFromResourceClassAndIdAndVersion(resourceClass, id, version), getPreferredResourceFormat(), generateHeaders(), - "VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, TIMEOUT_NORMAL); + "VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -220,7 +225,7 @@ public class FHIRToolingClient { result = client.issueGetResourceRequest( resourceAddress.resolveGetUriFromResourceClassAndCanonical(resourceClass, canonicalURL), getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "?url=" + canonicalURL, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -243,7 +248,7 @@ public class FHIRToolingClient { resourceAddress.resolveGetUriFromResourceClassAndId(resource.getClass(), resource.getId()), ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + resource.getId(), - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -272,7 +277,7 @@ public class FHIRToolingClient { result = client.issuePutRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + id, - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -309,10 +314,10 @@ public class FHIRToolingClient { if (complex) { byte[] body = ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())); result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(), - "POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG); + "POST " + resourceClass.getName() + "/$" + name, timeoutLong); } else { result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), - "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG); + "GET " + resourceClass.getName() + "/$" + name, timeoutLong); } if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), @@ -332,7 +337,7 @@ public class FHIRToolingClient { try { transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), "transaction", TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size())); + getPreferredResourceFormat(), "transaction", timeoutOperation + (timeoutEntry * batch.getEntry().size())); } catch (Exception e) { handleException("An error occurred trying to process this transaction request", e); } @@ -346,7 +351,7 @@ public class FHIRToolingClient { result = client.issuePostRequest(resourceAddress.resolveValidateUri(resourceClass, id), ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), - "POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", TIMEOUT_OPERATION_LONG); + "POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", timeoutLong); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -389,7 +394,7 @@ public class FHIRToolingClient { public Bundle fetchFeed(String url) { Bundle feed = null; try { - feed = client.issueGetFeedRequest(new URI(url), getPreferredResourceFormat()); + feed = client.issueGetFeedRequest(new URI(url), getPreferredResourceFormat(), timeoutLong); } catch (Exception e) { handleException("An error has occurred while trying to retrieve history since last update", e); } @@ -414,7 +419,7 @@ public class FHIRToolingClient { org.hl7.fhir.r4.utils.client.network.ResourceRequest result = null; try { result = client.issueGetResourceRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand", parameters), - getPreferredResourceFormat(), generateHeaders(), "ValueSet/$expand?url=" + vsUrl, TIMEOUT_OPERATION_EXPAND); + getPreferredResourceFormat(), generateHeaders(), "ValueSet/$expand?url=" + vsUrl, timeoutExpand); } catch (IOException e) { throw new FHIRException(e); } @@ -432,7 +437,7 @@ public class FHIRToolingClient { try { result = client.issuePostRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand"), ByteUtils.resourceToByteArray(p, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), TIMEOUT_OPERATION_EXPAND); + generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), timeoutExpand); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -447,7 +452,7 @@ public class FHIRToolingClient { org.hl7.fhir.r4.utils.client.network.ResourceRequest result = null; try { result = client.issueGetResourceRequest(resourceAddress.resolveOperationUri(CodeSystem.class, "lookup", params), - getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", TIMEOUT_NORMAL); + getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", timeoutNormal); } catch (IOException e) { throw new FHIRException(e); } @@ -471,7 +476,7 @@ public class FHIRToolingClient { result = client.issuePostRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand", params), ByteUtils.resourceToByteArray(p, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), source == null ? "ValueSet/$expand" : "ValueSet/$expand?url=" + source.getUrl(), - TIMEOUT_OPERATION_EXPAND); + timeoutExpand); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -500,7 +505,7 @@ public class FHIRToolingClient { result = client.issuePostRequest( resourceAddress.resolveOperationUri(null, "closure", new HashMap()), ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, TIMEOUT_NORMAL); + getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -520,7 +525,7 @@ public class FHIRToolingClient { result = client.issuePostRequest( resourceAddress.resolveOperationUri(null, "closure", new HashMap()), ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, TIMEOUT_OPERATION); + getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -547,14 +552,6 @@ public class FHIRToolingClient { this.password = password; } - public long getTimeout() { - return client.getTimeout(); - } - - public void setTimeout(long timeout) { - client.setTimeout(timeout); - } - public ToolingClientLogger getLogger() { return client.getLogger(); } @@ -631,7 +628,7 @@ public class FHIRToolingClient { org.hl7.fhir.r4.utils.client.network.ResourceRequest result = null; try { result = client.issueGetResourceRequest(resourceAddress.resolveGetResource(resourceClass, id), - getPreferredResourceFormat(), generateHeaders(), resourceClass.getName()+"/"+id, TIMEOUT_NORMAL); + getPreferredResourceFormat(), generateHeaders(), resourceClass.getName()+"/"+id, timeoutNormal); } catch (IOException e) { throw new FHIRException(e); } @@ -641,4 +638,46 @@ public class FHIRToolingClient { } return (T) result.getPayload(); } + + + public long getTimeoutNormal() { + return timeoutNormal; + } + + public void setTimeoutNormal(int timeoutNormal) { + this.timeoutNormal = timeoutNormal; + } + + public long getTimeoutOperation() { + return timeoutOperation; + } + + public void setTimeoutOperation(int timeoutOperation) { + this.timeoutOperation = timeoutOperation; + } + + public long getTimeoutEntry() { + return timeoutEntry; + } + + public void setTimeoutEntry(int timeoutEntry) { + this.timeoutEntry = timeoutEntry; + } + + public long getTimeoutLong() { + return timeoutLong; + } + + public void setTimeoutLong(int timeoutLong) { + this.timeoutLong = timeoutLong; + } + + public long getTimeoutExpand() { + return timeoutExpand; + } + + public void setTimeoutExpand(int timeoutExpand) { + this.timeoutExpand = timeoutExpand; + } + } diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/network/Client.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/network/Client.java index 1b750c796..37918812b 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/network/Client.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/network/Client.java @@ -16,13 +16,13 @@ import okhttp3.Request; import okhttp3.RequestBody; public class Client { + + public static final String DEFAULT_CHARSET = "UTF-8"; - private static final long DEFAULT_TIMEOUT = 5000; private ToolingClientLogger logger; private FhirLoggingInterceptor fhirLoggingInterceptor; private int retryCount; - private long timeout = DEFAULT_TIMEOUT; private String base; public String getBase() { @@ -51,14 +51,6 @@ public class Client { this.retryCount = retryCount; } - public long getTimeout() { - return timeout; - } - - public void setTimeout(long timeout) { - this.timeout = timeout; - } - public ResourceRequest issueOptionsRequest(URI optionsUri, String resourceFormat, String message, long timeout) throws IOException { Request.Builder request = new Request.Builder().method("OPTIONS", null).url(optionsUri.toURL()); @@ -107,20 +99,20 @@ public class Client { return executeFhirRequest(request, resourceFormat, headers, message, retryCount, timeout); } - public boolean issueDeleteRequest(URI resourceUri) throws IOException { + public boolean issueDeleteRequest(URI resourceUri, int timeout) throws IOException { Request.Builder request = new Request.Builder().url(resourceUri.toURL()).delete(); return executeFhirRequest(request, null, new Headers.Builder().build(), null, retryCount, timeout) .isSuccessfulRequest(); } - public Bundle issueGetFeedRequest(URI resourceUri, String resourceFormat) throws IOException { + public Bundle issueGetFeedRequest(URI resourceUri, String resourceFormat, int timeout) throws IOException { Request.Builder request = new Request.Builder().url(resourceUri.toURL()); return executeBundleRequest(request, resourceFormat, new Headers.Builder().build(), null, retryCount, timeout); } public Bundle issuePostFeedRequest(URI resourceUri, Map parameters, String resourceName, - Resource resource, String resourceFormat) throws IOException { + Resource resource, String resourceFormat, int timeout) throws IOException { String boundary = "----WebKitFormBoundarykbMUo6H8QaUnYtRy"; byte[] payload = ByteUtils.encodeFormSubmission(parameters, resourceName, resource, boundary); RequestBody body = RequestBody.create(MediaType.parse(resourceFormat + ";charset=" + DEFAULT_CHARSET), payload); From d1bec7bdba15662fc8402500a27f4ea8266be263 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:47:52 +1100 Subject: [PATCH 17/32] move ILoggingService --- .../fhir/r5/context/BaseWorkerContext.java | 28 ++++++++++++++++++- .../hl7/fhir/r5/context/ILoggingService.java | 15 ++++++++++ .../hl7/fhir/r5/context/IWorkerContext.java | 13 --------- .../fhir/r5/context/SimpleWorkerContext.java | 5 ++-- .../r5/context/SystemOutLoggingService.java | 2 +- 5 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ILoggingService.java diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java index bd349e4d0..99e6e0117 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java @@ -60,7 +60,7 @@ import org.hl7.fhir.exceptions.NoTerminologyServiceException; import org.hl7.fhir.exceptions.TerminologyServiceException; import org.hl7.fhir.r5.conformance.profile.ProfileUtilities; import org.hl7.fhir.r5.context.CanonicalResourceManager.CanonicalResourceProxy; -import org.hl7.fhir.r5.context.IWorkerContext.ILoggingService.LogCategory; +import org.hl7.fhir.r5.context.ILoggingService.LogCategory; import org.hl7.fhir.r5.model.ActorDefinition; import org.hl7.fhir.r5.model.BooleanType; import org.hl7.fhir.r5.model.Bundle; @@ -3024,4 +3024,30 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte } } + + public void unload() { + + codeSystems.unload(); + valueSets.unload(); + maps.unload(); + transforms.unload(); + structures.unload(); + typeManager.unload(); + measures.unload(); + libraries.unload(); + guides.unload(); + capstmts.unload(); + searchParameters.unload(); + questionnaires.unload(); + operations.unload(); + plans.unload(); + actors.unload(); + requirements.unload(); + systems.unload(); + + binaries.clear(); + validationCache.clear(); + txCache.clear(); +} + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ILoggingService.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ILoggingService.java new file mode 100644 index 000000000..2796c8ec5 --- /dev/null +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/ILoggingService.java @@ -0,0 +1,15 @@ +package org.hl7.fhir.r5.context; + +public interface ILoggingService { + public enum LogCategory { + INIT, + PROGRESS, + TX, + CONTEXT, + GENERATE, + HTML + } + public void logMessage(String message); // status messages, always display + public void logDebugMessage(ILoggingService.LogCategory category, String message); // verbose; only when debugging + public boolean isDebugLogging(); // whether to log debug information +} \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java index 61e903a4a..04c666fb9 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/IWorkerContext.java @@ -499,19 +499,6 @@ public interface IWorkerContext { public Map getNSUrlMap(); public TranslationServices translator(); - public interface ILoggingService { - public enum LogCategory { - INIT, - PROGRESS, - TX, - CONTEXT, - GENERATE, - HTML - } - public void logMessage(String message); // status messages, always display - public void logDebugMessage(LogCategory category, String message); // verbose; only when debugging - public boolean isDebugLogging(); // whether to log debug information - } public void setLogger(@Nonnull ILoggingService logger); public ILoggingService getLogger(); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java index f8f194ddb..700037a3c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java @@ -53,7 +53,7 @@ import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRFormatError; import org.hl7.fhir.r5.context.CanonicalResourceManager.CanonicalResourceProxy; -import org.hl7.fhir.r5.context.IWorkerContext.ILoggingService.LogCategory; +import org.hl7.fhir.r5.context.ILoggingService.LogCategory; import org.hl7.fhir.r5.formats.IParser; import org.hl7.fhir.r5.formats.JsonParser; import org.hl7.fhir.r5.formats.XmlParser; @@ -211,7 +211,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon private final boolean allowLoadingDuplicates; @With - private final IWorkerContext.ILoggingService loggingService; + private final ILoggingService loggingService; public SimpleWorkerContextBuilder() { cacheTerminologyClientErrors = false; @@ -809,5 +809,6 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon } + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SystemOutLoggingService.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SystemOutLoggingService.java index d1c46adcf..a1b24b372 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SystemOutLoggingService.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SystemOutLoggingService.java @@ -3,7 +3,7 @@ package org.hl7.fhir.r5.context; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor -public class SystemOutLoggingService implements IWorkerContext.ILoggingService { +public class SystemOutLoggingService implements ILoggingService { private final boolean debug; From 51ae6a596b1bf6d50e21e7471c3994865ea7ccca Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:48:54 +1100 Subject: [PATCH 18/32] More memory work in IGpublisher --- .../fhir/r5/context/CanonicalResourceManager.java | 15 ++++++++++++++- .../java/org/hl7/fhir/r5/context/TypeManager.java | 9 +++++++++ .../org/hl7/fhir/validation/ValidationEngine.java | 7 ++++--- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/CanonicalResourceManager.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/CanonicalResourceManager.java index f9fe41938..980e22ea1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/CanonicalResourceManager.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/CanonicalResourceManager.java @@ -195,8 +195,13 @@ public class CanonicalResourceManager { } else { return resource instanceof StructureDefinition ? ((StructureDefinition) resource).getDerivationElement().primitiveValue() : null; } - } + } + public void unload() { + if (proxy != null) { + resource = null; + } + } } public class MetadataResourceVersionComparator> implements Comparator { @@ -659,4 +664,12 @@ public class CanonicalResourceManager { } + public void unload() { + for (CachedCanonicalResource t : list) { + t.unload(); + } + + } + + } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TypeManager.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TypeManager.java index 8450989cd..ed1909ea9 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TypeManager.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TypeManager.java @@ -126,5 +126,14 @@ public class TypeManager { return sd != null && sd.getKind() == StructureDefinitionKind.COMPLEXTYPE; } } + + public void unload() { + + structures.unload(); + typeDefinitions.clear(); + fhirTypeDefinitions.clear(); + primitiveNames.clear(); + dataTypeNames.clear(); + } } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java index cd7cf08f9..b7de224ae 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java @@ -28,6 +28,7 @@ import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.r5.conformance.profile.ProfileUtilities; import org.hl7.fhir.r5.context.ContextUtilities; +import org.hl7.fhir.r5.context.ILoggingService; import org.hl7.fhir.r5.context.IWorkerContext; import org.hl7.fhir.r5.context.IWorkerContextManager; import org.hl7.fhir.r5.context.SimpleWorkerContext; @@ -324,7 +325,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP private final boolean canRunWithoutTerminologyServer; @With - private final IWorkerContext.ILoggingService loggingService; + private final ILoggingService loggingService; @With private boolean THO = true; @@ -342,7 +343,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP loggingService = new SystemOutLoggingService(); } - public ValidationEngineBuilder(String terminologyCachePath, String userAgent, String version, String txServer, String txLog, FhirPublication txVersion, TimeTracker timeTracker, boolean canRunWithoutTerminologyServer, IWorkerContext.ILoggingService loggingService, boolean THO) { + public ValidationEngineBuilder(String terminologyCachePath, String userAgent, String version, String txServer, String txLog, FhirPublication txVersion, TimeTracker timeTracker, boolean canRunWithoutTerminologyServer, ILoggingService loggingService, boolean THO) { this.terminologyCachePath = terminologyCachePath; this.userAgent = userAgent; this.version = version; @@ -431,7 +432,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IValidationP * * @see IgLoader#loadIgSource(String, boolean, boolean) loadIgSource for detailed description of the src parameter */ - private void loadCoreDefinitions(String src, boolean recursive, String terminologyCachePath, String userAgent, TimeTracker tt, IWorkerContext.ILoggingService loggingService) throws FHIRException, IOException { + private void loadCoreDefinitions(String src, boolean recursive, String terminologyCachePath, String userAgent, TimeTracker tt, ILoggingService loggingService) throws FHIRException, IOException { NpmPackage npm = getPcm().loadPackage(src, null); if (npm != null) { version = npm.fhirVersion(); From 289ab6b29c267d97919f67cbf1e28dffce9fe8ad Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:49:24 +1100 Subject: [PATCH 19/32] Support parsing ad-hoc json data type fragments --- .../hl7/fhir/r5/elementmodel/JsonParser.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java index 3f4d992a9..5c30f8647 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java @@ -59,6 +59,7 @@ import org.hl7.fhir.r5.formats.JsonCreator; import org.hl7.fhir.r5.formats.JsonCreatorCanonical; import org.hl7.fhir.r5.formats.JsonCreatorDirect; import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent; +import org.hl7.fhir.r5.model.ElementDefinition; import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.utils.FHIRPathEngine; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; @@ -104,18 +105,34 @@ public class JsonParser extends ParserBase { } public Element parse(String source, String type) throws Exception { + return parse(source, type, false); + } + + public Element parse(String source, String type, boolean inner) throws Exception { ValidatedFragment focusFragment = new ValidatedFragment(ValidatedFragment.FOCUS_NAME, "json", source.getBytes(StandardCharsets.UTF_8), false); JsonObject obj = org.hl7.fhir.utilities.json.parser.JsonParser.parseObject(source, true, true); String path = "/"+type; StructureDefinition sd = getDefinition(focusFragment.getErrors(), -1, -1, type); - if (sd == null) + if (sd == null) { return null; + } + if (inner) { + // we have an anonymous wrapper that has an arbitrarily named property with the specified type. We're going to invent a snapshot for that + sd = new StructureDefinition(); + sd.setType("Wrapper"); + ElementDefinition bEd = sd.getSnapshot().addElement(); + ElementDefinition nEd = sd.getSnapshot().addElement(); + bEd.setPath("Wrapper"); + nEd.setPath("Wrapper."+obj.getProperties().get(0).getName()); + nEd.addType().setCode(type); + nEd.setMax(obj.getProperties().get(0).getValue().isJsonArray() ? "*" : "1"); + } Element result = new Element(type, new Property(context, sd.getSnapshot().getElement().get(0), sd, this.profileUtilities)).setFormat(FhirFormat.JSON); result.setPath(type); checkObject(focusFragment.getErrors(), obj, result, path); result.setType(type); - parseChildren(focusFragment.getErrors(), path, obj, result, true, new ArrayList<>()); + parseChildren(focusFragment.getErrors(), path, obj, result, true, null); result.numberChildren(); return result; } From 31ffd846672bc5347decb9765151a1896f073fa3 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:49:59 +1100 Subject: [PATCH 20/32] Checking parameter type for where() and all() --- .../src/main/java/org/hl7/fhir/r5/model/TypeDetails.java | 9 +++++++++ .../main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/TypeDetails.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/TypeDetails.java index 6905e9ef4..fb918f501 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/TypeDetails.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/TypeDetails.java @@ -44,6 +44,7 @@ import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.r5.context.IWorkerContext; import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent; import org.hl7.fhir.r5.model.ExpressionNode.CollectionStatus; +import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r5.model.TypeDetails.ProfiledTypeSorter; import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; import org.hl7.fhir.utilities.Utilities; @@ -253,6 +254,14 @@ public class TypeDetails { return true; } } + t = ProfiledType.ns(n); + StructureDefinition sd = context.fetchTypeDefinition(t); + if (sd != null && sd.getKind() != StructureDefinitionKind.LOGICAL && Utilities.existsInList(sd.getType(), "boolean", "string", "integer", "decimal", "Quantity", "dateTime", "time")) { + t = FP_NS+"System."+Utilities.capitalize(sd.getType()); + if (typesContains(t)) { + return true; + } + } } for (String n: tn) { String id = n.contains("#") ? n.substring(0, n.indexOf("#")) : n; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java index dea5b4b99..940383481 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java @@ -3272,6 +3272,7 @@ public class FHIRPathEngine { case Count : return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Integer); case Where : + checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean)); // special case: where the focus is Reference, and the parameter to where is resolve() "is", we will suck up the target types if (focus.hasType("Reference")) { boolean canRestrictTargets = !exp.getParameters().isEmpty(); @@ -3298,6 +3299,7 @@ public class FHIRPathEngine { case Select : return paramTypes.get(0); case All : + checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean)); return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean); case Repeat : return paramTypes.get(0); @@ -3681,7 +3683,7 @@ public class FHIRPathEngine { } - private void checkParamTypes(ExpressionNode expr, String funcName, List paramTypes, TypeDetails... typeSet) throws PathEngineException { + private void checkParamTypes(ExpressionNode expr, String funcName,List paramTypes, TypeDetails... typeSet) throws PathEngineException { int i = 0; for (TypeDetails pt : typeSet) { if (i == paramTypes.size()) { From 96b7d159a707216022e4c28f7bb82298080a1a17 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:50:21 +1100 Subject: [PATCH 21/32] Fix rendering of TriggerDefinition --- .../java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java index 83d2f9ba9..0fc35a82b 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java @@ -61,6 +61,7 @@ import org.hl7.fhir.r5.model.StringType; import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind; import org.hl7.fhir.r5.model.Timing; +import org.hl7.fhir.r5.model.TriggerDefinition; import org.hl7.fhir.r5.model.UriType; import org.hl7.fhir.r5.model.UsageContext; import org.hl7.fhir.r5.renderers.utils.BaseWrappers.BaseWrapper; @@ -512,6 +513,9 @@ public class ProfileDrivenRenderer extends ResourceRenderer { } else if (e instanceof DataRequirement) { DataRequirement p = (DataRequirement) e; renderDataRequirement(x, p); + } else if (e instanceof TriggerDefinition) { + TriggerDefinition p = (TriggerDefinition) e; + renderTriggerDefinition(x, p); } else if (e instanceof UsageContext) { UsageContext p = (UsageContext) e; renderUsageContext(x, p); From bb9064a8cc94fd08d13730e25a47fa5507da535b Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:50:46 +1100 Subject: [PATCH 22/32] fix NPE on some resources --- .../hl7/fhir/r5/renderers/DataRenderer.java | 33 ++++++++++++++++++- .../r5/renderers/utils/DirectWrappers.java | 10 ++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index 7c4caf251..8c47310b7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -67,6 +67,7 @@ import org.hl7.fhir.r5.model.Timing; import org.hl7.fhir.r5.model.Timing.EventTiming; import org.hl7.fhir.r5.model.Timing.TimingRepeatComponent; import org.hl7.fhir.r5.model.Timing.UnitsOfTime; +import org.hl7.fhir.r5.model.TriggerDefinition; import org.hl7.fhir.r5.model.UriType; import org.hl7.fhir.r5.model.UsageContext; import org.hl7.fhir.r5.model.ValueSet; @@ -1234,7 +1235,7 @@ public class DataRenderer extends Renderer implements CodeResolver { protected void renderIdentifier(XhtmlNode x, Identifier ii) { if (ii.hasType()) { if (ii.getType().hasText()) - x.tx(ii.getType().getText()); + x.tx(ii.getType().getText()+":"); else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasDisplay()) x.tx(ii.getType().getCoding().get(0).getDisplay()+":"); else if (ii.getType().hasCoding() && ii.getType().getCoding().get(0).hasCode()) @@ -1577,6 +1578,36 @@ public class DataRenderer extends Renderer implements CodeResolver { render(x, u.getValue()); } + + public void renderTriggerDefinition(XhtmlNode x, TriggerDefinition td) throws FHIRFormatError, DefinitionException, IOException { + XhtmlNode tbl = x.table("grid"); + + XhtmlNode tr = tbl.tr(); + tr.td().b().tx("Type"); + tr.td().tx(td.getType().getDisplay()); + + if (td.hasName()) { + tr = tbl.tr(); + tr.td().b().tx("Name"); + tr.td().tx(td.getType().getDisplay()); + } + if (td.hasCode()) { + tr = tbl.tr(); + tr.td().b().tx("Code"); + renderCodeableConcept(tr.td(), td.getCode()); + } + if (td.hasTiming()) { + tr = tbl.tr(); + tr.td().b().tx("Timing"); + render(tr.td(), td.getTiming()); + } + if (td.hasCondition()) { + tr = tbl.tr(); + tr.td().b().tx("Condition"); + renderExpression(tr.td(), td.getCondition()); + } + } + public void renderDataRequirement(XhtmlNode x, DataRequirement dr) throws FHIRFormatError, DefinitionException, IOException { XhtmlNode tbl = x.table("grid"); XhtmlNode tr = tbl.tr(); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DirectWrappers.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DirectWrappers.java index 6401d5bfe..37304c3a9 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DirectWrappers.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/DirectWrappers.java @@ -219,8 +219,14 @@ public class DirectWrappers { Property family = b.getChildByName("family"); Property given = wrapped.getChildByName("given"); String s = given != null && given.hasValues() ? given.getValues().get(0).primitiveValue() : ""; - if (family != null && family.hasValues()) - s = s + " " + family.getValues().get(0).primitiveValue().toUpperCase(); + if (family != null && family.hasValues()) { + String v = family.getValues().get(0).primitiveValue(); + if (v == null) { + s = s + " " + "??"; + } else { + s = s + " " + v.toUpperCase(); + } + } return s; } else { Property p = b.getChildByName("name"); From 3cd75ef89e4a933593c12ef99cf69799d1421490 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:51:02 +1100 Subject: [PATCH 23/32] adjust value set rendering for fragment code systems --- .../hl7/fhir/r5/renderers/ValueSetRenderer.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java index 21d19d477..91a530483 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java @@ -187,6 +187,9 @@ public class ValueSetRenderer extends TerminologyRenderer { if (vs.hasCopyright()) generateCopyright(x, vs); } + boolean hasFragment = generateContentModeNotices(x, vs.getExpansion(), vs); + generateVersionNotice(x, vs.getExpansion(), vs); + if (ToolingExtensions.hasExtension(vs.getExpansion(), ToolingExtensions.EXT_EXP_TOOCOSTLY)) { List exl = vs.getExpansion().getExtensionsByUrl(ToolingExtensions.EXT_EXP_TOOCOSTLY); boolean other = false; @@ -203,11 +206,9 @@ public class ValueSetRenderer extends TerminologyRenderer { if (count == null) x.para().tx("This value set does not contain a fixed number of concepts"); else - x.para().tx("This value set contains "+count.toString()+" concepts"); + x.para().tx("This value set contains "+(hasFragment ? "at least " : "")+count.toString()+" concepts"); } - generateContentModeNotices(x, vs.getExpansion(), vs); - generateVersionNotice(x, vs.getExpansion(), vs); boolean doLevel = false; for (ValueSetExpansionContainsComponent cc : vs.getExpansion().getContains()) { @@ -319,12 +320,13 @@ public class ValueSetRenderer extends TerminologyRenderer { return false; } - private void generateContentModeNotices(XhtmlNode x, ValueSetExpansionComponent expansion, Resource vs) { + private boolean generateContentModeNotices(XhtmlNode x, ValueSetExpansionComponent expansion, Resource vs) { generateContentModeNotice(x, expansion, "example", "Expansion based on example code system", vs); - generateContentModeNotice(x, expansion, "fragment", "Expansion based on code system fragment", vs); + return generateContentModeNotice(x, expansion, "fragment", "Expansion based on code system fragment", vs); } - private void generateContentModeNotice(XhtmlNode x, ValueSetExpansionComponent expansion, String mode, String text, Resource vs) { + private boolean generateContentModeNotice(XhtmlNode x, ValueSetExpansionComponent expansion, String mode, String text, Resource vs) { + boolean res = false; Multimap versions = HashMultimap.create(); for (ValueSetExpansionParameterComponent p : expansion.getParameter()) { if (p.getName().equals(mode)) { @@ -343,6 +345,7 @@ public class ValueSetRenderer extends TerminologyRenderer { XhtmlNode p = x.para().style("border: black 1px dotted; background-color: #ffcccc; padding: 8px; margin-bottom: 8px"); p.tx(text+" "); expRef(p, s, v, vs); + res = true; } } else { for (String v : versions.get(s)) { @@ -351,12 +354,14 @@ public class ValueSetRenderer extends TerminologyRenderer { div.para().tx(text+"s: "); ul = div.ul(); first = false; + res = true; } expRef(ul.li(), s, v, vs); } } } } + return res; } private boolean checkDoSystem(ValueSet vs, ValueSet src) { From 5ee11cb3a8f9e296771e2c5496e7d45e0d707ade Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:51:20 +1100 Subject: [PATCH 24/32] Fix expansion language - don't set for displayName parameter --- .../hl7/fhir/r5/terminologies/expansion/ValueSetExpander.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/ValueSetExpander.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/ValueSetExpander.java index 03ae6290e..47012dc90 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/ValueSetExpander.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/expansion/ValueSetExpander.java @@ -668,8 +668,6 @@ public class ValueSetExpander extends ValueSetProcessBase { } if (langs == null && focus.hasLanguage()) { langs = new AcceptLanguageHeader(focus.getLanguage(), true); - } else if (langs != null && langs.hasChosen()) { - focus.setLanguage(langs.getChosen()); } try { From 623760d8872ef52824ad95a011f18ae960f2a543 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:51:47 +1100 Subject: [PATCH 25/32] Improve expansion error messages --- .../org/hl7/fhir/utilities/i18n/I18nBase.java | 8 +-- .../fhir/utilities/i18n/I18nConstants.java | 3 ++ .../src/main/resources/Messages.properties | 51 ++++++++++--------- 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java index 2891b8e47..246ea1f91 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nBase.java @@ -63,9 +63,11 @@ public abstract class I18nBase { private boolean messageExistsForLocale(String message, boolean hasArgs) { checkResourceBundleIsLoaded(); if (!messageKeyExistsForLocale(message)) { - if (warnAboutMissingMessages && (hasArgs || !message.contains(" "))) { - System.out.println("Attempting to localize message " + message + ", but no such equivalent message exists for" + - " the locale " + getLocale()); + if (!message.contains(" ")) { + if (warnAboutMissingMessages && (hasArgs || !message.contains(" "))) { + System.out.println("Attempting to localize message " + message + ", but no such equivalent message exists for" + + " the locale " + getLocale()); + } } } return messageKeyExistsForLocale(message); 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 704824180..42b523e2d 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 @@ -1027,6 +1027,9 @@ public class I18nConstants { public static final String BUNDLE_ENTRY_URL_MATCHES_NO_ID = "BUNDLE_ENTRY_URL_MATCHES_NO_ID"; public static final String BUNDLE_ENTRY_URL_ABSOLUTE = "BUNDLE_ENTRY_URL_ABSOLUTE"; public static final String BUNDLE_BUNDLE_ENTRY_FOUND_MULTIPLE = "BUNDLE_BUNDLE_ENTRY_FOUND_MULTIPLE"; + public static final String FHIRPATH_COLLECTION_STATUS_PARAMETER = "FHIRPATH_COLLECTION_STATUS_PARAMETER"; + public static final String FHIRPATH_COLLECTION_STATUS_CONTEXT = "FHIRPATH_COLLECTION_STATUS_CONTEXT"; + public static final String SEARCHPARAMETER_MISSING_COMPONENTS = "SEARCHPARAMETER_MISSING_COMPONENTS"; } diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index 6a84bccec..3494514c6 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -53,7 +53,7 @@ Extension_EXT_SubExtension_Invalid = Sub-extension url ''{0}'' is not defined by Extension_EXT_Type = The Extension ''{0}'' definition allows for the types {1} but found type {2} Extension_EXT_URL_Absolute = Extension.url must be an absolute URL Extension_EXT_Unknown = Unknown extension {0} -Extension_EXT_Unknown_NotHere = The extension {0} is unknown, and not allowed here +Extension_EXT_Unknown_NotHere = The extension {0} could not be found so is not allowed here Extension_EXT_Url_NotFound = Extension.url is required Extension_EXT_Version_Internal = Extension url ''{0}'' evaluation state invalid Extension_EXT_Version_Invalid = Extension url ''{0}'' is not valid (invalid Version ''{1}'') @@ -78,7 +78,7 @@ Profile_VAL_NotAllowed = The element {0} is present in the instance but not allo Measure_MR_M_None = No Measure is identified, so no validation can be performed against the Measure Measure_MR_M_NotFound = The Measure ''{0}'' could not be resolved, so no validation can be performed against the Measure Questionnaire_QR_Item_BadOption = The code provided {1} in the system {0}) is not in the options value set ({2}) in the questionnaire: {3} -QUESTIONNAIRE_QR_ITEM_BADOPTION_CS = The code provided {1} cannot be validated in the options value set ({2}) in the questionnaire because the system {0} is unknown +QUESTIONNAIRE_QR_ITEM_BADOPTION_CS = The code provided {1} cannot be validated in the options value set ({2}) in the questionnaire because the system {0} could not be found Questionnaire_QR_Item_Coding = Error {0} validating Coding against Questionnaire Options Questionnaire_QR_Item_CodingNoOptions = Cannot validate Coding option because no option list is provided Questionnaire_QR_Item_DateNoOptions = Cannot validate date answer option because no option list is provided @@ -157,7 +157,7 @@ Terminology_TX_Coding_Count = Expected {0} but found {1} coding elements Terminology_TX_Confirm_1_CC = Could not confirm that the codings provided are in the value set {0} and a coding from this value set is required (class = {1}) Terminology_TX_Confirm_2_CC = Could not confirm that the codings provided are in the value set {0} and a coding should come from this value set unless it has no suitable code (the validator cannot judge what is suitable) (class = {1}) Terminology_TX_Confirm_3_CC = Could not confirm that the codings provided are in the value set {0} and a coding is recommended to come from this value set (class = {1}) -Terminology_TX_Confirm_4a = The code provided ({2}) is not in the value set {0}, and a code from this value set is required: {1} +Terminology_TX_Confirm_4a = The code provided ({2}) was not found in the value set {0}, and a code from this value set is required: {1} Terminology_TX_Confirm_4b = The codes provided ({2}) are not in the value set {0}, and a code from this value set is required: {1} Terminology_TX_Confirm_5 = Could not confirm that the codes provided are in the value set {0}, and a code should come from this value set unless it has no suitable code (the validator cannot judge what is suitable) Terminology_TX_Confirm_6 = Could not confirm that the codes provided are in the value set {0}, and a code is recommended to come from this value set @@ -169,24 +169,24 @@ Terminology_TX_Error_Coding2 = Error {0} validating Coding: {1} Terminology_TX_NoValid_1_CC = None of the codings provided are in the value set {0}, and a coding from this value set is required) (codes = {1}) Terminology_TX_NoValid_10 = The code provided is not in the maximum value set {0}, and a code from this value set is required) (code = {1}#{2}) Terminology_TX_NoValid_11 = The code provided is not in the maximum value set {0}, and a code from this value set is required) (code = {1}#{2}), error = {3}) -Terminology_TX_NoValid_12 = The Coding provided ({2}) is not in the value set {0}, and a code is required from this value set. {1} -Terminology_TX_NoValid_13 = The Coding provided ({2}) is not in the value set {0}, and a code should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable). {1} -Terminology_TX_NoValid_14 = The Coding provided ({2}) is not in the value set {0}, and a code is recommended to come from this value set. {1} +Terminology_TX_NoValid_12 = The Coding provided ({2}) was not found in the value set {0}, and a code is required from this value set. {1} +Terminology_TX_NoValid_13 = The Coding provided ({2}) was not found in the value set {0}, and a code should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable). {1} +Terminology_TX_NoValid_14 = The Coding provided ({2}) was not found in the value set {0}, and a code is recommended to come from this value set. {1} Terminology_TX_NoValid_15 = The value provided (''{0}'') could not be validated in the absence of a terminology server Terminology_TX_NoValid_15A = The value provided (''{0}'') could not be validated because the code system {1} is not known -Terminology_TX_NoValid_16 = The value provided (''{0}'') is not in the value set {1}, and a code is required from this value set {2} -Terminology_TX_NoValid_17 = The value provided (''{0}'') is not in the value set {1}, and a code should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable) {2} -Terminology_TX_NoValid_18 = The value provided (''{0}'') is not in the value set {1}, and a code is recommended to come from this value set){2} +Terminology_TX_NoValid_16 = The value provided (''{0}'') was not found in the value set {1}, and a code is required from this value set {2} +Terminology_TX_NoValid_17 = The value provided (''{0}'') was not found in the value set {1}, and a code should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable) {2} +Terminology_TX_NoValid_18 = The value provided (''{0}'') was not found in the value set {1}, and a code is recommended to come from this value set){2} Terminology_TX_NoValid_2_CC = None of the codings provided are in the value set {0}, and a coding should come from this value set unless it has no suitable code (note that the validator cannot judge what is suitable) (codes = {1}) Terminology_TX_NoValid_3_CC = None of the codings provided are in the value set {0}, and a coding is recommended to come from this value set) (codes = {1}) -Terminology_TX_NoValid_4 = The Coding provided ({2}) is not in the value set {0}, and a code is required from this value set {1} -Terminology_TX_NoValid_5 = The Coding provided ({2}) is not in the value set {0}, and a code should come from this value set unless it has no suitable code (the validator cannot judge what is suitable) {1} -Terminology_TX_NoValid_6 = The Coding provided ({2}) is not in the value set {0}, and a code is recommended to come from this value set {1} +Terminology_TX_NoValid_4 = The Coding provided ({2}) was not found in the value set {0}, and a code is required from this value set {1} +Terminology_TX_NoValid_5 = The Coding provided ({2}) was not found in the value set {0}, and a code should come from this value set unless it has no suitable code (the validator cannot judge what is suitable) {1} +Terminology_TX_NoValid_6 = The Coding provided ({2}) was not found in the value set {0}, and a code is recommended to come from this value set {1} Terminology_TX_NoValid_7 = None of the codes provided could be validated against the maximum value set {0}, (error = {2}) Terminology_TX_NoValid_8 = None of the codes provided are in the maximum value set {0}, and a code from this value set is required) (codes = {1}) Terminology_TX_NoValid_9 = The code provided ({2}) could not be validated against the maximum value set {0}, (error = {1}) Terminology_TX_System_Invalid = Invalid System URI: {0} -Terminology_TX_System_NotKnown = Code System URI ''{0}'' is unknown so the code cannot be validated +Terminology_TX_System_NotKnown = Code System URI ''{0}'' could not be found so the code cannot be validated TERMINOLOGY_TX_SYSTEM_NOT_USABLE = The definition for the Code System with URI ''{0}'' doesn't provide any codes so the code cannot be validated Terminology_TX_System_Relative = Coding.system must be an absolute reference, not a local reference Terminology_TX_System_Unknown = Unknown Code System ''{0}'' @@ -257,10 +257,10 @@ Validation_VAL_Profile_NotAllowed = This element is not allowed by the profile { Validation_VAL_Profile_NotSlice = This element does not match any known slice {0} and slicing is CLOSED: {1} Validation_VAL_Profile_OutOfOrder = As specified by profile {0}, Element ''{1}'' is out of order (found after {2}) Validation_VAL_Profile_SliceOrder = As specified by profile {0}, Element ''{1}'' is out of order in ordered slice -Validation_VAL_Profile_Unknown = Profile reference ''{0}'' has not been checked because it is unknown -VALIDATION_VAL_PROFILE_UNKNOWN_NOT_POLICY = Profile reference ''{0}'' has not been checked because it is unknown, and the validator is set to not fetch unknown profiles -VALIDATION_VAL_PROFILE_UNKNOWN_ERROR = Profile reference ''{0}'' has not been checked because it is unknown, and fetching it resulted in the error {1} -VALIDATION_VAL_PROFILE_UNKNOWN_ERROR_NETWORK = Profile reference ''{0}'' has not been checked because it is unknown, and the host {1} cannot be found +Validation_VAL_Profile_Unknown = Profile reference ''{0}'' has not been checked because it could not be found +VALIDATION_VAL_PROFILE_UNKNOWN_NOT_POLICY = Profile reference ''{0}'' has not been checked because it could not be found, and the validator is set to not fetch unknown profiles +VALIDATION_VAL_PROFILE_UNKNOWN_ERROR = Profile reference ''{0}'' has not been checked because it could not be found, and fetching it resulted in the error {1} +VALIDATION_VAL_PROFILE_UNKNOWN_ERROR_NETWORK = Profile reference ''{0}'' has not been checked because it could not be found, and the host {1} cannot be found Validation_VAL_Unknown_Profile = Unknown profile {0} VALIDATION_VAL_PROFILE_DEPENDS_NOT_RESOLVED = Profile {1} identifies {2} as a dependency (using the extension http://hl7.org/fhir/StructureDefinition/structuredefinition-dependencies), but this profile could not be found XHTML_XHTML_Attribute_Illegal = Invalid attribute name in the XHTML (''{0}'' on ''{1}'') @@ -476,7 +476,7 @@ Display_Name_WS_for__should_be_one_of__instead_of_other = Wrong whitespace in Di 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 {2} is not in the value set ''{1}'' +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 - cannot validate Unable_to_handle_system__concept_filter_with_op__ = Unable to handle system {0} concept filter with op = {1} @@ -484,7 +484,7 @@ UNABLE_TO_HANDLE_SYSTEM__PROPERTY_FILTER_WITH_OP__ = Unable to handle system {0} Unable_to_handle_system__filter_with_property__ = Unable to handle system {0} filter with property = {1}, op = {2} Unable_to_resolve_system__value_set_has_include_with_no_system = Unable to resolve system - value set {0} include #{1} has no system UNABLE_TO_RESOLVE_SYSTEM_SYSTEM_IS_INDETERMINATE = The code system {1} referred to from value set {0} has a grammar, and the code might be valid in it -Unable_to_resolve_system__value_set_has_include_with_unknown_system = Unable to resolve system - value set {0} include #{1} has system {2} which is unknown, and the server return error {3} +Unable_to_resolve_system__value_set_has_include_with_unknown_system = Unable to resolve system - value set {0} include #{1} has system {2} which icould not be found, and the server returned error {3} Unable_to_resolve_system__value_set_has_include_with_filter = Unable to resolve system - value set {0} include #{1} has a filter on system {2} Unable_to_resolve_system__value_set_has_imports = Unable to resolve system - value set has imports Unable_to_resolve_system__value_set_has_multiple_matches = Unable to resolve system - value set expansion has multiple matches: {0} @@ -568,6 +568,7 @@ SEARCHPARAMETER_NOTFOUND = Unable to find the base Search Parameter {0} so can'' SEARCHPARAMETER_BASE_WRONG = The resource type {1} is not listed as a base in the SearchParameter this is derived from ({0}) SEARCHPARAMETER_TYPE_WRONG = The type {1} is different to the type {0} in the derivedFrom SearchParameter 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} @@ -728,7 +729,7 @@ SD_VALUE_TYPE_IILEGAL = The element {0} has a {1} of type {2}, which is not in t SD_VALUE_TYPE_REPEAT_HINT = The repeating element has a {1}. The {1} will apply to all the repeats (this has not been clear to all users) SD_VALUE_TYPE_REPEAT_WARNING_DOTNET = The repeating element has a {1} value for a primitive type. The DotNet validator will not apply this to all the repeats - this is an error SD_NO_TYPES_OR_CONTENTREF = The element {0} has no assigned types, and no content reference -CODESYSTEM_CS_UNK_EXPANSION = The code provided ({2}) is not in the expansion in the value set {0}, and a code is required from this value set. The system {1} is unknown. +CODESYSTEM_CS_UNK_EXPANSION = The code provided ({2}) is not in the expansion in the value set {0}, and a code is required from this value set. The system {1} could not be found. BUNDLE_SEARCH_NOSELF = SearchSet Bundles should have a self link that specifies what the search was BUNDLE_SEARCH_SELF_NOT_UNDERSTOOD = No types could be determined from the search string, so the types can''t be checked BUNDLE_SEARCH_ENTRY_NO_RESOURCE = SearchSet Bundle Entries must have resources @@ -917,13 +918,13 @@ CONCEPTMAP_GROUP_TARGET_PROPERTY_INVALID = The property code ''{0}'' is not know CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_MISMATCH = The type of this property should be {1} not {0} CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_NO_SYSTEM = Since no system has been provided, a plain code cannot be used CONCEPTMAP_GROUP_TARGET_PROPERTY_CODE_INVALID = The code {0} is invalid in the system {1} -CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_UNKNOWN_SYSTEM = The system {0} is unknown, so code values can''t be checked +CONCEPTMAP_GROUP_TARGET_PROPERTY_TYPE_UNKNOWN_SYSTEM = The code system {0} could not be found, so code values can''t be checked SM_DEPENDENT_PARAM_TYPE_MISMATCH_DUPLICATE = The group {0} has already been used with different parameters, so the type checking may be incorrect (other = [{1}]; this = [{2}]) CONCEPTMAP_GROUP_SOURCE_INCOMPLETE = Source Code System {0} doesn''t have all content (content = {1}), so the source codes cannot be checked CONCEPTMAP_GROUP_TARGET_INCOMPLETE = Target Code System {0} doesn''t have all content (content = {1}), so the target codes cannot be checked SD_NO_TYPE_CODE_ON_CODE = Snapshot for {1} element {0} has type.code without a value -UNKNOWN_CODESYSTEM = The CodeSystem {0} is unknown -UNKNOWN_CODESYSTEM_VERSION = The CodeSystem {0} version {1} is unknown. Valid versions: {2} +UNKNOWN_CODESYSTEM = The code system {0} could not be found +UNKNOWN_CODESYSTEM_VERSION = The code system {0} version {1} could not be found. Valid versions: {2} UNABLE_TO_INFER_CODESYSTEM = The System URI could not be determined for the code {0} in the ValueSet {1} VALUESET_TOO_COSTLY = The value set {0} has too many codes to display ({1}) VALUESET_TOO_COSTLY_TIME = The value set {0} took too long to process (>{1}sec) @@ -1046,7 +1047,7 @@ VALUESET_CIRCULAR_REFERENCE = Found a circularity pointing to {0} processing Val VALUESET_SUPPLEMENT_MISSING_one = Required supplement not found: {1} VALUESET_SUPPLEMENT_MISSING_other = Required supplements not found: {1} CONCEPTMAP_VS_TOO_MANY_CODES = The concept map has too many codes to validate ({0}) -CONCEPTMAP_VS_CONCEPT_CODE_UNKNOWN_SYSTEM = The code ''{1}'' comes from the system {0} which is unknown, so it''s not known whether it''s valid in the value set ''{2}'' +CONCEPTMAP_VS_CONCEPT_CODE_UNKNOWN_SYSTEM = The code ''{1}'' comes from the system {0} which could not be found, so it''s not known whether it''s valid in the value set ''{2}'' CONCEPTMAP_VS_INVALID_CONCEPT_CODE = The code ''{1}'' in the system {0} is not valid in the value set ''{2}'' CONCEPTMAP_VS_INVALID_CONCEPT_CODE_VER = The code ''{2}'' in the system {0} version {1} is not valid in the value set ''{3}'' VALUESET_INC_TOO_MANY_CODES = The value set include has too many codes to validate ({0}) @@ -1085,3 +1086,5 @@ FHIRPATH_ARITHMETIC_MINUS = Error in date arithmetic: Unable to subtract type {0 BUNDLE_ENTRY_URL_MATCHES_NO_ID = The fullUrl ''{0}'' looks like a RESTful server URL, but the resource has no id BUNDLE_ENTRY_URL_MATCHES_TYPE_ID = The fullUrl ''{0}'' looks like a RESTful server URL, so it must end with the correct type and id (/{1}/{2}) BUNDLE_ENTRY_URL_ABSOLUTE = The fullUrl must be an absolute URL (not ''{0}'') +FHIRPATH_COLLECTION_STATUS_PARAMETER = Parameter {1} is inherently a collection, and so the expression ''{0}'' may fail, create an error, or return false if there is more than one item in the parameter value ({2}) +FHIRPATH_COLLECTION_STATUS_CONTEXT = The context is inherently a collection, and so the expression ''{0}'' may fail, create an error, or return false if there is more than one item in the context ({2}) From 3b3ddd28b2eb76d550286ee956e49ba640273a55 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:52:18 +1100 Subject: [PATCH 26/32] Fix validator not allowing canonical resource extensions in bundles --- .../fhir/validation/instance/InstanceValidator.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 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 a0faa5000..3ce82c756 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 @@ -2219,7 +2219,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat ok = true; } else if (en.equals("Resource") && container.isResource()) { ok = true; - } else if (en.equals("CanonicalResource") && VersionUtilities.getExtendedCanonicalResourceNames(context.getVersion()).contains(stack.getLiteralPath())) { + } else if (en.equals("CanonicalResource") && containsAny(VersionUtilities.getExtendedCanonicalResourceNames(context.getVersion()), plist)) { ok = true; } else if (hasElementName(plist, en) && pu == null) { ok = true; @@ -2310,6 +2310,15 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } + private boolean containsAny(Set set, List list) { + for (String p : list) { + if (set.contains(p)) { + return true; + } + } + return false; + } + private boolean hasElementName(List plist, String en) { String[] ep = en.split("\\."); for (String s : plist) { @@ -2726,7 +2735,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat if (dok) { try { DateTimeType dt = new DateTimeType(e.primitiveValue()); - if (isCoreDefinition(profile) || (context.hasExtension(ToolingExtensions.EXT_DATE_RULES) && ToolingExtensions.readStringExtension(context, ToolingExtensions.EXT_DATE_RULES).contains("year-valid"))) { + if (isCoreDefinition(profile) || !context.hasExtension(ToolingExtensions.EXT_DATE_RULES) || ToolingExtensions.readStringExtension(context, ToolingExtensions.EXT_DATE_RULES).contains("year-valid")) { warning(errors, NO_RULE_DATE, IssueType.INVALID, e.line(), e.col(), path, yearIsValid(e.primitiveValue()), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_DATETIME_REASONABLE, e.primitiveValue()); } } catch (Exception ex) { From 3252fb12b0e07f320f1206c6be1e5de77c3c377f Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:52:36 +1100 Subject: [PATCH 27/32] fix bundle validation error on intneral link checking --- .../org/hl7/fhir/validation/instance/type/BundleValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/BundleValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/BundleValidator.java index 28af98ece..ef835cde3 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/BundleValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/BundleValidator.java @@ -633,7 +633,7 @@ public class BundleValidator extends BaseValidator { for (EntrySummary e : entryList) { List references = findReferences(e.getEntry()); for (StringWithSource ref : references) { - Element tgt = resolveInBundle(bundle, entries, ref.getReference(), e.getEntry().getChildValue(FULL_URL), e.getResource().fhirType(), e.getResource().getIdBase(), stack, errors, ref.getSource().getPath(), ref.getSource(), ref.isWarning()); + Element tgt = resolveInBundle(bundle, entries, ref.getReference(), e.getEntry().getChildValue(FULL_URL), e.getResource().fhirType(), e.getResource().getIdBase(), stack, errors, ref.getSource().getPath(), ref.getSource(), ref.isWarning() || true); if (tgt != null) { EntrySummary t = entryForTarget(entryList, tgt); if (t != null ) { From c913190d7a9fc925b6dc96449b5f0faa047a21b6 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:53:09 +1100 Subject: [PATCH 28/32] validate that composite search parameters have components --- .../instance/type/SearchParameterValidator.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/SearchParameterValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/SearchParameterValidator.java index bbe2a9f7d..c7cb3a69e 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/SearchParameterValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/SearchParameterValidator.java @@ -67,11 +67,18 @@ public class SearchParameterValidator extends BaseValidator { String expThis = canonicalise(cs.getNamedChildValue("expression", false), bases); String expOther = canonicalise(sp.getExpression(), bases); warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE,stack.getLiteralPath(), expThis.equals(expOther), I18nConstants.SEARCHPARAMETER_EXP_WRONG, master, sp.getExpression(), cs.getNamedChildValue("expression", false)); - } - - // todo: check compositions + } } } + if ("composite".equals(cs.getNamedChildValue("type", false))) { + List components = cs.getChildren("component"); + if (rule(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, stack.getLiteralPath(), components.size() > 1, I18nConstants.SEARCHPARAMETER_MISSING_COMPONENTS)) { + // todo: check compositions + } else { + ok = false; + } + + } return ok; } From 0e69f6ad890d8e113f16a1e5a5aebea90c3ca294 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:53:32 +1100 Subject: [PATCH 29/32] Support IPS in validation tests --- .../fhir/terminology/tests/LocalTerminologyServiceTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/LocalTerminologyServiceTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/LocalTerminologyServiceTests.java index 23e6c263c..a402fb653 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/LocalTerminologyServiceTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/terminology/tests/LocalTerminologyServiceTests.java @@ -50,7 +50,7 @@ public class LocalTerminologyServiceTests implements ITxTesterLoader { private static boolean localTxRunning() { - return new File("/Users/grahamegrieve/work/server/serverx").exists(); + return new File("/Users/grahamegrieve/work/server/server").exists(); } From d78efdad8fedc9d4726cf490709f76ba2e7a3490 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 08:53:42 +1100 Subject: [PATCH 30/32] missed code --- .../java/org/hl7/fhir/validation/tests/ValidationTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java index 555b13849..f52ac2129 100644 --- a/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java +++ b/org.hl7.fhir.validation/src/test/java/org/hl7/fhir/validation/tests/ValidationTests.java @@ -311,11 +311,13 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe StructureDefinition sd = null; if (content.has("ips")) { val.setCheckIPSCodes(true); + val.getContext().loadFromPackage(loadPackage("hl7.fhir.uv.ips#1.1.0"), ValidatorUtils.loaderForVersion("4.0.1")); if (content.get("ips").getAsString().equals("uv")) { - val.getContext().loadFromPackage(loadPackage("hl7.fhir.uv.ips#1.1.0"), ValidatorUtils.loaderForVersion("4.0.1")); sd = val.getContext().fetchResource(StructureDefinition.class, "http://hl7.org/fhir/uv/ips/StructureDefinition/Bundle-uv-ips"); val.getBundleValidationRules().add(new BundleValidationRule().setRule("Composition:0").setProfile("http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips")); } else if (content.get("ips").getAsString().equals("au")) { + val.getContext().loadFromPackage(loadPackage("hl7.fhir.au.base#current"), ValidatorUtils.loaderForVersion("4.0.1")); + val.getContext().loadFromPackage(loadPackage("hl7.fhir.au.core#current"), ValidatorUtils.loaderForVersion("4.0.1")); val.getContext().loadFromPackage(loadPackage("hl7.fhir.au.ips#current"), ValidatorUtils.loaderForVersion("4.0.1")); sd = val.getContext().fetchResource(StructureDefinition.class, "http://hl7.org.au/fhir/ips/StructureDefinition/Bundle-au-ips"); val.getBundleValidationRules().add(new BundleValidationRule().setRule("Composition:0").setProfile("http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips")); From 36361eaa1d8cb97ae7133eae3ee7937566b8101f Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 12:06:18 +1100 Subject: [PATCH 31/32] refactor timeout control on client --- .../txClient/TerminologyClientR2.java | 4 +- .../txClient/TerminologyClientR3.java | 4 +- .../txClient/TerminologyClientR4.java | 4 +- .../txClient/TerminologyClientR5.java | 4 +- .../dstu2/utils/client/FHIRToolingClient.java | 41 ++++++----- .../utils/client/FHIRToolingClient.java | 38 +++++------ .../dstu3/utils/client/FHIRToolingClient.java | 45 ++++++------ .../r4/utils/client/FHIRToolingClient.java | 54 +-------------- .../r4b/utils/client/FHIRToolingClient.java | 43 ++++++------ .../client/ITerminologyClient.java | 2 +- .../r5/utils/client/FHIRToolingClient.java | 39 +++++------ .../fhir/utilities/FHIRBaseToolingClient.java | 68 +++++++++++++++++++ 12 files changed, 173 insertions(+), 173 deletions(-) create mode 100644 org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/FHIRBaseToolingClient.java diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR2.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR2.java index bd34dd4fe..47a1d8134 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR2.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR2.java @@ -125,8 +125,8 @@ public class TerminologyClientR2 implements ITerminologyClient { } @Override - public ITerminologyClient setTimeout(int i) { - client.setTimeout(i); + public ITerminologyClient setTimeoutFactor(int i) { + client.setTimeoutFactor(i); return this; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR3.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR3.java index d88ace719..3e26ec6af 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR3.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR3.java @@ -123,8 +123,8 @@ public class TerminologyClientR3 implements ITerminologyClient { } @Override - public ITerminologyClient setTimeout(int i) { - client.setTimeout(i); + public ITerminologyClient setTimeoutFactor(int i) { + client.setTimeoutFactor(i); return this; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java index a67fd3fba..f2aac799a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR4.java @@ -133,8 +133,8 @@ public class TerminologyClientR4 implements ITerminologyClient { } @Override - public ITerminologyClient setTimeout(int i) { // #FIXME - client.setTimeoutNormal(i); + public ITerminologyClient setTimeoutFactor(int i) { + client.setTimeoutFactor(i); return this; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR5.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR5.java index 0c835bbab..472cf898b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR5.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/txClient/TerminologyClientR5.java @@ -117,8 +117,8 @@ public class TerminologyClientR5 implements ITerminologyClient { } @Override - public ITerminologyClient setTimeout(int i) { - client.setTimeout(i); + public ITerminologyClient setTimeoutFactor(int i) { + client.setTimeoutFactor(i); return this; } diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/client/FHIRToolingClient.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/client/FHIRToolingClient.java index 5337d3e74..c7cf07706 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/client/FHIRToolingClient.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/client/FHIRToolingClient.java @@ -48,6 +48,7 @@ import org.hl7.fhir.dstu2.model.PrimitiveType; import org.hl7.fhir.dstu2.model.Resource; import org.hl7.fhir.dstu2.model.StringType; import org.hl7.fhir.dstu2.model.ValueSet; +import org.hl7.fhir.utilities.FHIRBaseToolingClient; import org.hl7.fhir.utilities.ToolingClientLogger; import org.hl7.fhir.utilities.Utilities; @@ -81,15 +82,12 @@ import org.hl7.fhir.utilities.Utilities; * @author Claude Nanjo * */ -public class FHIRToolingClient { +public class FHIRToolingClient extends FHIRBaseToolingClient { public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK"; public static final String DATE_FORMAT = "yyyy-MM-dd"; public static final String hostKey = "http.proxyHost"; public static final String portKey = "http.proxyPort"; - private static final int TIMEOUT_NORMAL = 1; - private static final int TIMEOUT_OPERATION = 2; - private static final int TIMEOUT_OPERATION_LONG = 3; private String base; private ResourceAddress resourceAddress; @@ -179,11 +177,11 @@ public class FHIRToolingClient { try { if (useOptionsVerb) { conformance = (Conformance) utils - .issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), TIMEOUT_NORMAL) + .issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), timeoutNormal) .getReference();// TODO fix this } else { conformance = (Conformance) utils.issueGetResourceRequest(resourceAddress.resolveMetadataUri(false), - getPreferredResourceFormat(), TIMEOUT_NORMAL).getReference(); + getPreferredResourceFormat(), timeoutNormal).getReference(); } } catch (Exception e) { handleException("An error has occurred while trying to fetch the server's conformance statement", e); @@ -202,11 +200,11 @@ public class FHIRToolingClient { try { if (useOptionsVerb) { conformance = (Conformance) utils - .issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), TIMEOUT_NORMAL) + .issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), timeoutNormal) .getReference();// TODO fix this } else { conformance = (Conformance) utils.issueGetResourceRequest(resourceAddress.resolveMetadataUri(true), - getPreferredResourceFormat(), TIMEOUT_NORMAL).getReference(); + getPreferredResourceFormat(), timeoutNormal).getReference(); } } catch (Exception e) { handleException("An error has occurred while trying to fetch the server's conformance statement", e); @@ -218,7 +216,7 @@ public class FHIRToolingClient { ResourceRequest result = null; try { result = utils.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), - getPreferredResourceFormat(), TIMEOUT_NORMAL); + getPreferredResourceFormat(), timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addSuccessStatus(200);// Only one for now @@ -237,7 +235,7 @@ public class FHIRToolingClient { try { result = utils.issueGetResourceRequest( resourceAddress.resolveGetUriFromResourceClassAndIdAndVersion(resourceClass, id, version), - getPreferredResourceFormat(), TIMEOUT_NORMAL); + getPreferredResourceFormat(), timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405);// unknown @@ -260,7 +258,7 @@ public class FHIRToolingClient { try { result = utils.issueGetResourceRequest( resourceAddress.resolveGetUriFromResourceClassAndCanonical(resourceClass, canonicalURL), - getPreferredResourceFormat(), TIMEOUT_NORMAL); + getPreferredResourceFormat(), timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405);// unknown @@ -287,7 +285,7 @@ public class FHIRToolingClient { result = utils.issuePutRequest( resourceAddress.resolveGetUriFromResourceClassAndId(resource.getClass(), resource.getId()), utils.getResourceAsByteArray(resource, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), headers, TIMEOUT_OPERATION); + getPreferredResourceFormat(), headers, timeoutOperation); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -322,7 +320,7 @@ public class FHIRToolingClient { List
headers = null; result = utils.issuePutRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), utils.getResourceAsByteArray(resource, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), headers, TIMEOUT_OPERATION); + getPreferredResourceFormat(), headers, timeoutOperation); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -530,10 +528,10 @@ public class FHIRToolingClient { if (complex) result = utils.issuePostRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), TIMEOUT_OPERATION_LONG); + getPreferredResourceFormat(), timeoutLong); else result = utils.issueGetResourceRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), - getPreferredResourceFormat(), TIMEOUT_OPERATION_LONG); + getPreferredResourceFormat(), timeoutLong); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addSuccessStatus(200);// Only one for now @@ -554,7 +552,7 @@ public class FHIRToolingClient { try { transactionResult = utils.postBatchRequest(resourceAddress.getBaseServiceUri(), utils.getFeedAsByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - TIMEOUT_NORMAL + batch.getEntry().size()); + timeoutNormal + batch.getEntry().size()); } catch (Exception e) { handleException("An error occurred trying to process this transaction request", e); } @@ -721,7 +719,7 @@ public class FHIRToolingClient { ResourceRequest result = utils.issuePostRequest( resourceAddress.resolveOperationUri(ValueSet.class, "expand"), utils.getResourceAsByteArray(source, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - headers, TIMEOUT_OPERATION_LONG); + headers, timeoutLong); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -738,7 +736,7 @@ public class FHIRToolingClient { public Parameters lookupCode(Map params) { ResourceRequest result = utils.issueGetResourceRequest( resourceAddress.resolveOperationUri(ValueSet.class, "lookup", params), getPreferredResourceFormat(), - TIMEOUT_NORMAL); + timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -802,7 +800,7 @@ public class FHIRToolingClient { ResourceRequest result = utils.issuePostRequest( resourceAddress.resolveOperationUri(null, "closure", new HashMap()), utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - headers, TIMEOUT_NORMAL); + headers, timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -824,7 +822,7 @@ public class FHIRToolingClient { ResourceRequest result = utils.issuePostRequest( resourceAddress.resolveOperationUri(null, "closure", new HashMap()), utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - headers, TIMEOUT_OPERATION); + headers, timeoutOperation); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -864,7 +862,7 @@ public class FHIRToolingClient { public Parameters getTerminologyCapabilities() { return (Parameters) utils - .issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), getPreferredResourceFormat(), TIMEOUT_NORMAL) + .issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), getPreferredResourceFormat(), timeoutNormal) .getReference(); } @@ -899,4 +897,5 @@ public class FHIRToolingClient { public void setLanguage(String lang) { utils.setLanguage(lang); } + } \ No newline at end of file diff --git a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/FHIRToolingClient.java b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/FHIRToolingClient.java index 23e49a79b..a70da6859 100644 --- a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/FHIRToolingClient.java +++ b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/client/FHIRToolingClient.java @@ -49,6 +49,7 @@ import org.hl7.fhir.dstu2016may.model.PrimitiveType; import org.hl7.fhir.dstu2016may.model.Resource; import org.hl7.fhir.dstu2016may.model.StringType; import org.hl7.fhir.dstu2016may.model.ValueSet; +import org.hl7.fhir.utilities.FHIRBaseToolingClient; import org.hl7.fhir.utilities.ToolingClientLogger; import org.hl7.fhir.utilities.Utilities; @@ -82,15 +83,12 @@ import org.hl7.fhir.utilities.Utilities; * @author Claude Nanjo * */ -public class FHIRToolingClient { +public class FHIRToolingClient extends FHIRBaseToolingClient { public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK"; public static final String DATE_FORMAT = "yyyy-MM-dd"; public static final String hostKey = "http.proxyHost"; public static final String portKey = "http.proxyPort"; - private static final int TIMEOUT_NORMAL = 1; - private static final int TIMEOUT_OPERATION = 2; - private static final int TIMEOUT_OPERATION_LONG = 3; private String base; private ResourceAddress resourceAddress; @@ -177,11 +175,11 @@ public class FHIRToolingClient { try { if (useOptionsVerb) { conformance = (Conformance) utils - .issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), TIMEOUT_NORMAL) + .issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), timeoutNormal) .getReference();// TODO fix this } else { conformance = (Conformance) utils.issueGetResourceRequest(resourceAddress.resolveMetadataUri(false), - getPreferredResourceFormat(), TIMEOUT_NORMAL).getReference(); + getPreferredResourceFormat(), timeoutNormal).getReference(); } } catch (Exception e) { handleException("An error has occurred while trying to fetch the server's conformance statement", e); @@ -200,11 +198,11 @@ public class FHIRToolingClient { try { if (useOptionsVerb) { conformance = (Conformance) utils - .issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), TIMEOUT_NORMAL) + .issueOptionsRequest(resourceAddress.getBaseServiceUri(), getPreferredResourceFormat(), timeoutNormal) .getReference();// TODO fix this } else { conformance = (Conformance) utils.issueGetResourceRequest(resourceAddress.resolveMetadataUri(true), - getPreferredResourceFormat(), TIMEOUT_NORMAL).getReference(); + getPreferredResourceFormat(), timeoutNormal).getReference(); } } catch (Exception e) { handleException("An error has occurred while trying to fetch the server's conformance statement", e); @@ -216,7 +214,7 @@ public class FHIRToolingClient { ResourceRequest result = null; try { result = utils.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), - getPreferredResourceFormat(), TIMEOUT_NORMAL); + getPreferredResourceFormat(), timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addSuccessStatus(200);// Only one for now @@ -235,7 +233,7 @@ public class FHIRToolingClient { try { result = utils.issueGetResourceRequest( resourceAddress.resolveGetUriFromResourceClassAndIdAndVersion(resourceClass, id, version), - getPreferredResourceFormat(), TIMEOUT_NORMAL); + getPreferredResourceFormat(), timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405);// unknown @@ -258,7 +256,7 @@ public class FHIRToolingClient { try { result = utils.issueGetResourceRequest( resourceAddress.resolveGetUriFromResourceClassAndCanonical(resourceClass, canonicalURL), - getPreferredResourceFormat(), TIMEOUT_NORMAL); + getPreferredResourceFormat(), timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405);// unknown @@ -285,7 +283,7 @@ public class FHIRToolingClient { result = utils.issuePutRequest( resourceAddress.resolveGetUriFromResourceClassAndId(resource.getClass(), resource.getId()), utils.getResourceAsByteArray(resource, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), headers, TIMEOUT_OPERATION); + getPreferredResourceFormat(), headers, timeoutOperation); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -320,7 +318,7 @@ public class FHIRToolingClient { List
headers = null; result = utils.issuePutRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), utils.getResourceAsByteArray(resource, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), headers, TIMEOUT_OPERATION); + getPreferredResourceFormat(), headers, timeoutOperation); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -529,10 +527,10 @@ public class FHIRToolingClient { if (complex) result = utils.issuePostRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), TIMEOUT_OPERATION_LONG); + getPreferredResourceFormat(), timeoutLong); else result = utils.issueGetResourceRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), - getPreferredResourceFormat(), TIMEOUT_OPERATION_LONG); + getPreferredResourceFormat(), timeoutLong); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addSuccessStatus(200);// Only one for now @@ -558,7 +556,7 @@ public class FHIRToolingClient { try { transactionResult = utils.postBatchRequest(resourceAddress.getBaseServiceUri(), utils.getFeedAsByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - TIMEOUT_NORMAL + batch.getEntry().size()); + timeoutNormal + batch.getEntry().size()); } catch (Exception e) { handleException("An error occurred trying to process this transaction request", e); } @@ -745,7 +743,7 @@ public class FHIRToolingClient { public Parameters lookupCode(Map params) { ResourceRequest result = utils.issueGetResourceRequest( resourceAddress.resolveOperationUri(CodeSystem.class, "lookup", params), getPreferredResourceFormat(), - TIMEOUT_NORMAL); + timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -809,7 +807,7 @@ public class FHIRToolingClient { ResourceRequest result = utils.issuePostRequest( resourceAddress.resolveOperationUri(null, "closure", new HashMap()), utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - headers, TIMEOUT_NORMAL); + headers, timeoutNormal); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -831,7 +829,7 @@ public class FHIRToolingClient { ResourceRequest result = utils.issuePostRequest( resourceAddress.resolveOperationUri(null, "closure", new HashMap()), utils.getResourceAsByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - headers, TIMEOUT_OPERATION); + headers, timeoutOperation); result.addErrorStatus(410);// gone result.addErrorStatus(404);// unknown result.addErrorStatus(405); @@ -871,7 +869,7 @@ public class FHIRToolingClient { public Parameters getTerminologyCapabilities() { return (Parameters) utils - .issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), getPreferredResourceFormat(), TIMEOUT_NORMAL) + .issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), getPreferredResourceFormat(), timeoutNormal) .getReference(); } diff --git a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/client/FHIRToolingClient.java b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/client/FHIRToolingClient.java index 0c549bdc1..de19a3706 100644 --- a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/client/FHIRToolingClient.java +++ b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/client/FHIRToolingClient.java @@ -26,6 +26,7 @@ import org.hl7.fhir.dstu3.utils.client.network.ByteUtils; import org.hl7.fhir.dstu3.utils.client.network.Client; import org.hl7.fhir.dstu3.utils.client.network.ResourceRequest; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.utilities.FHIRBaseToolingClient; import org.hl7.fhir.utilities.FhirPublication; import org.hl7.fhir.utilities.ToolingClientLogger; import org.hl7.fhir.utilities.Utilities; @@ -58,19 +59,13 @@ import okhttp3.internal.http2.Header; * * @author Claude Nanjo */ -public class FHIRToolingClient { +public class FHIRToolingClient extends FHIRBaseToolingClient { public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK"; public static final String DATE_FORMAT = "yyyy-MM-dd"; public static final String hostKey = "http.proxyHost"; public static final String portKey = "http.proxyPort"; - private static final int TIMEOUT_NORMAL = 1500; - private static final int TIMEOUT_OPERATION = 30000; - private static final int TIMEOUT_ENTRY = 500; - private static final int TIMEOUT_OPERATION_LONG = 60000; - private static final int TIMEOUT_OPERATION_EXPAND = 120000; - private String base; private ResourceAddress resourceAddress; private ResourceFormat preferredResourceFormat; @@ -155,7 +150,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "TerminologyCapabilities", - TIMEOUT_NORMAL).getReference(); + timeoutNormal).getReference(); } catch (Exception e) { throw new FHIRException("Error fetching the server's terminology capabilities", e); } @@ -169,7 +164,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement", - TIMEOUT_NORMAL).getReference(); + timeoutNormal).getReference(); } catch (Exception e) { throw new FHIRException("Error fetching the server's conformance statement", e); } @@ -183,7 +178,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement-Quick", - TIMEOUT_NORMAL).getReference(); + timeoutNormal).getReference(); } catch (Exception e) { throw new FHIRException("Error fetching the server's capability statement: "+e.getMessage(), e); } @@ -197,7 +192,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "/" + id, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -214,7 +209,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -231,7 +226,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "?url=" + canonicalURL, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -254,7 +249,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + resource.getId(), - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -281,7 +276,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + id, - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -318,12 +313,12 @@ public class FHIRToolingClient { client.getLogger().logRequest("POST", url.toString(), null, body); } result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(), - "POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG); + "POST " + resourceClass.getName() + "/$" + name, timeoutLong); } else { if (client.getLogger() != null) { client.getLogger().logRequest("GET", url.toString(), null, null); } - result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG); + result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), "GET " + resourceClass.getName() + "/$" + name, timeoutLong); } if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -345,7 +340,7 @@ public class FHIRToolingClient { public Bundle transaction(Bundle batch) { Bundle transactionResult = null; try { - transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), "transaction", TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size())); + transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), "transaction", timeoutOperation + (timeoutEntry * batch.getEntry().size())); } catch (Exception e) { handleException("An error occurred trying to process this transaction request", e); } @@ -359,7 +354,7 @@ public class FHIRToolingClient { result = client.issuePostRequest(resourceAddress.resolveValidateUri(resourceClass, id), ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), - "POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", TIMEOUT_OPERATION_LONG); + "POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", timeoutLong); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -418,7 +413,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), - TIMEOUT_OPERATION_EXPAND); + timeoutExpand); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -436,7 +431,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", - TIMEOUT_NORMAL); + timeoutNormal); } catch (IOException e) { e.printStackTrace(); } @@ -459,7 +454,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), - TIMEOUT_OPERATION_EXPAND); + timeoutExpand); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -483,7 +478,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), - TIMEOUT_OPERATION_EXPAND); + timeoutExpand); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -507,7 +502,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -528,7 +523,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java index 543921341..a5a707bf0 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/client/FHIRToolingClient.java @@ -25,6 +25,7 @@ import org.hl7.fhir.r4.model.ValueSet; import org.hl7.fhir.r4.utils.client.network.ByteUtils; import org.hl7.fhir.r4.utils.client.network.Client; import org.hl7.fhir.r4.utils.client.network.ResourceRequest; +import org.hl7.fhir.utilities.FHIRBaseToolingClient; import org.hl7.fhir.utilities.ToolingClientLogger; import org.hl7.fhir.utilities.Utilities; @@ -60,19 +61,13 @@ import okhttp3.internal.http2.Header; * * @author Claude Nanjo */ -public class FHIRToolingClient { +public class FHIRToolingClient extends FHIRBaseToolingClient { public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK"; public static final String DATE_FORMAT = "yyyy-MM-dd"; public static final String hostKey = "http.proxyHost"; public static final String portKey = "http.proxyPort"; - private static final int DEFAULT_TIMEOUT_NORMAL = 1500; - private static final int DEFAULT_TIMEOUT_OPERATION = 30000; - private static final int DEFAULT_TIMEOUT_ENTRY = 500; - private static final int DEFAULT_TIMEOUT_OPERATION_LONG = 60000; - private static final int DEFAULT_TIMEOUT_OPERATION_EXPAND = 120000; - private String base; private ResourceAddress resourceAddress; private ResourceFormat preferredResourceFormat; @@ -84,11 +79,6 @@ public class FHIRToolingClient { private String password; private String userAgent; private String acceptLang; - private int timeoutNormal = DEFAULT_TIMEOUT_NORMAL; - private int timeoutOperation = DEFAULT_TIMEOUT_OPERATION; - private int timeoutEntry = DEFAULT_TIMEOUT_ENTRY; - private int timeoutLong = DEFAULT_TIMEOUT_OPERATION_LONG; - private int timeoutExpand = DEFAULT_TIMEOUT_OPERATION_EXPAND; // Pass endpoint for client - URI public FHIRToolingClient(String baseServiceUrl, String userAgent) throws URISyntaxException { @@ -640,44 +630,4 @@ public class FHIRToolingClient { } - public long getTimeoutNormal() { - return timeoutNormal; - } - - public void setTimeoutNormal(int timeoutNormal) { - this.timeoutNormal = timeoutNormal; - } - - public long getTimeoutOperation() { - return timeoutOperation; - } - - public void setTimeoutOperation(int timeoutOperation) { - this.timeoutOperation = timeoutOperation; - } - - public long getTimeoutEntry() { - return timeoutEntry; - } - - public void setTimeoutEntry(int timeoutEntry) { - this.timeoutEntry = timeoutEntry; - } - - public long getTimeoutLong() { - return timeoutLong; - } - - public void setTimeoutLong(int timeoutLong) { - this.timeoutLong = timeoutLong; - } - - public long getTimeoutExpand() { - return timeoutExpand; - } - - public void setTimeoutExpand(int timeoutExpand) { - this.timeoutExpand = timeoutExpand; - } - } diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/client/FHIRToolingClient.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/client/FHIRToolingClient.java index 3bb65d634..965918354 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/client/FHIRToolingClient.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/utils/client/FHIRToolingClient.java @@ -39,6 +39,7 @@ import org.hl7.fhir.r4b.utils.client.network.ByteUtils; import org.hl7.fhir.r4b.utils.client.network.Client; import org.hl7.fhir.r4b.utils.client.network.ClientHeaders; import org.hl7.fhir.r4b.utils.client.network.ResourceRequest; +import org.hl7.fhir.utilities.FHIRBaseToolingClient; import org.hl7.fhir.utilities.ToolingClientLogger; import org.hl7.fhir.utilities.Utilities; @@ -77,19 +78,13 @@ import java.util.*; * * @author Claude Nanjo */ -public class FHIRToolingClient { +public class FHIRToolingClient extends FHIRBaseToolingClient{ public static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssK"; public static final String DATE_FORMAT = "yyyy-MM-dd"; public static final String hostKey = "http.proxyHost"; public static final String portKey = "http.proxyPort"; - private static final int TIMEOUT_NORMAL = 1500; - private static final int TIMEOUT_OPERATION = 30000; - private static final int TIMEOUT_ENTRY = 500; - private static final int TIMEOUT_OPERATION_LONG = 60000; - private static final int TIMEOUT_OPERATION_EXPAND = 120000; - private String base; private ResourceAddress resourceAddress; private ResourceFormat preferredResourceFormat; @@ -151,7 +146,7 @@ public class FHIRToolingClient { TerminologyCapabilities capabilities = null; try { capabilities = (TerminologyCapabilities) client.issueGetResourceRequest(resourceAddress.resolveMetadataTxCaps(), - getPreferredResourceFormat(), generateHeaders(), "TerminologyCapabilities", TIMEOUT_NORMAL).getReference(); + getPreferredResourceFormat(), generateHeaders(), "TerminologyCapabilities", timeoutNormal).getReference(); } catch (Exception e) { throw new FHIRException("Error fetching the server's terminology capabilities", e); } @@ -162,7 +157,7 @@ public class FHIRToolingClient { CapabilityStatement conformance = null; try { conformance = (CapabilityStatement) client.issueGetResourceRequest(resourceAddress.resolveMetadataUri(false), - getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement", TIMEOUT_NORMAL).getReference(); + getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement", timeoutNormal).getReference(); } catch (Exception e) { throw new FHIRException("Error fetching the server's conformance statement", e); } @@ -174,7 +169,7 @@ public class FHIRToolingClient { return capabilities; try { capabilities = (CapabilityStatement) client.issueGetResourceRequest(resourceAddress.resolveMetadataUri(true), - getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement-Quick", TIMEOUT_NORMAL) + getPreferredResourceFormat(), generateHeaders(), "CapabilitiesStatement-Quick", timeoutNormal) .getReference(); } catch (Exception e) { throw new FHIRException("Error fetching the server's capability statement: " + e.getMessage(), e); @@ -187,7 +182,7 @@ public class FHIRToolingClient { try { result = client.issueGetResourceRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "/" + id, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -204,7 +199,7 @@ public class FHIRToolingClient { result = client.issueGetResourceRequest( resourceAddress.resolveGetUriFromResourceClassAndIdAndVersion(resourceClass, id, version), getPreferredResourceFormat(), generateHeaders(), - "VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, TIMEOUT_NORMAL); + "VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -221,7 +216,7 @@ public class FHIRToolingClient { result = client.issueGetResourceRequest( resourceAddress.resolveGetUriFromResourceClassAndCanonical(resourceClass, canonicalURL), getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "?url=" + canonicalURL, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -244,7 +239,7 @@ public class FHIRToolingClient { resourceAddress.resolveGetUriFromResourceClassAndId(resource.getClass(), resource.getId()), ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + resource.getId(), - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -273,7 +268,7 @@ public class FHIRToolingClient { result = client.issuePutRequest(resourceAddress.resolveGetUriFromResourceClassAndId(resourceClass, id), ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + id, - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -311,10 +306,10 @@ public class FHIRToolingClient { if (complex) { byte[] body = ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())); result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(), - "POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG); + "POST " + resourceClass.getName() + "/$" + name, timeoutLong); } else { result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), - "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG); + "GET " + resourceClass.getName() + "/$" + name, timeoutLong); } if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), @@ -340,7 +335,7 @@ public class FHIRToolingClient { transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), "transaction", - TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size())); + timeoutOperation + (timeoutEntry * batch.getEntry().size())); } catch (Exception e) { handleException("An error occurred trying to process this transaction request", e); } @@ -354,7 +349,7 @@ public class FHIRToolingClient { result = client.issuePostRequest(resourceAddress.resolveValidateUri(resourceClass, id), ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), - "POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", TIMEOUT_OPERATION_LONG); + "POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", timeoutLong); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -411,7 +406,7 @@ public class FHIRToolingClient { try { result = client.issuePostRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand"), ByteUtils.resourceToByteArray(p, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), TIMEOUT_OPERATION_EXPAND); + generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), timeoutExpand); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -426,7 +421,7 @@ public class FHIRToolingClient { org.hl7.fhir.r4b.utils.client.network.ResourceRequest result = null; try { result = client.issueGetResourceRequest(resourceAddress.resolveOperationUri(CodeSystem.class, "lookup", params), - getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", TIMEOUT_NORMAL); + getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", timeoutNormal); } catch (IOException e) { e.printStackTrace(); } @@ -448,7 +443,7 @@ public class FHIRToolingClient { result = client.issuePostRequest(resourceAddress.resolveOperationUri(ValueSet.class, "expand", params), ByteUtils.resourceToByteArray(p, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), - generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), TIMEOUT_OPERATION_EXPAND); + generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), timeoutExpand); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -471,7 +466,7 @@ public class FHIRToolingClient { result = client.issuePostRequest( resourceAddress.resolveOperationUri(null, "closure", new HashMap()), ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, TIMEOUT_NORMAL); + getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -491,7 +486,7 @@ public class FHIRToolingClient { result = client.issuePostRequest( resourceAddress.resolveOperationUri(null, "closure", new HashMap()), ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())), - getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, TIMEOUT_OPERATION); + getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/ITerminologyClient.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/ITerminologyClient.java index 156b1cb00..2e0f5edf2 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/ITerminologyClient.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/client/ITerminologyClient.java @@ -54,7 +54,7 @@ public interface ITerminologyClient { ValueSet expandValueset(ValueSet vs, Parameters p, Map params) throws FHIRException; Parameters validateCS(Parameters pin) throws FHIRException; Parameters validateVS(Parameters pin) throws FHIRException; - ITerminologyClient setTimeout(int i) throws FHIRException; + ITerminologyClient setTimeoutFactor(int i) throws FHIRException; ITerminologyClient setLogger(ToolingClientLogger txLog) throws FHIRException; int getRetryCount() throws FHIRException; ITerminologyClient setRetryCount(int retryCount) throws FHIRException; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/FHIRToolingClient.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/FHIRToolingClient.java index 5cf6d9fa8..290581b31 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/FHIRToolingClient.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/FHIRToolingClient.java @@ -38,6 +38,7 @@ import org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent; import org.hl7.fhir.r5.utils.client.network.ByteUtils; import org.hl7.fhir.r5.utils.client.network.Client; import org.hl7.fhir.r5.utils.client.network.ResourceRequest; +import org.hl7.fhir.utilities.FHIRBaseToolingClient; import org.hl7.fhir.utilities.ToolingClientLogger; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager; @@ -76,7 +77,7 @@ import java.util.stream.Stream; * * @author Claude Nanjo */ -public class FHIRToolingClient { +public class FHIRToolingClient extends FHIRBaseToolingClient { private static final Logger logger = LoggerFactory.getLogger(FHIRToolingClient.class); @@ -86,12 +87,6 @@ public class FHIRToolingClient { public static final String hostKey = "http.proxyHost"; public static final String portKey = "http.proxyPort"; - private static final int TIMEOUT_NORMAL = 1500; - private static final int TIMEOUT_OPERATION = 30000; - private static final int TIMEOUT_ENTRY = 500; - private static final int TIMEOUT_OPERATION_LONG = 60000; - private static final int TIMEOUT_OPERATION_EXPAND = 120000; - private String base; private ResourceAddress resourceAddress; private ResourceFormat preferredResourceFormat; @@ -160,7 +155,7 @@ public class FHIRToolingClient { preferredResourceFormat.getHeader(), generateHeaders(), message, - TIMEOUT_NORMAL).getReference(); + timeoutNormal).getReference(); if (attemptedResourceFormat != preferredResourceFormat) { setPreferredResourceFormat(attemptedResourceFormat); } @@ -212,7 +207,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "/" + id, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -229,7 +224,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "VRead " + resourceClass.getName() + "/" + id + "/?_history/" + version, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -246,7 +241,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Read " + resourceClass.getName() + "?url=" + canonicalURL, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -269,7 +264,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + resource.getId(), - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -296,7 +291,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Update " + resource.fhirType() + "/" + id, - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -330,9 +325,9 @@ public class FHIRToolingClient { if (complex) { byte[] body = ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())); result = client.issuePostRequest(url, body, getPreferredResourceFormat(), generateHeaders(), - "POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG); + "POST " + resourceClass.getName() + "/$" + name, timeoutLong); } else { - result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG); + result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), generateHeaders(), "GET " + resourceClass.getName() + "/$" + name, timeoutLong); } if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); @@ -355,7 +350,7 @@ public class FHIRToolingClient { try { transactionResult = client.postBatchRequest(resourceAddress.getBaseServiceUri(), ByteUtils.resourceToByteArray(batch, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), - "transaction", TIMEOUT_OPERATION + (TIMEOUT_ENTRY * batch.getEntry().size())); + "transaction", timeoutOperation + (timeoutEntry * batch.getEntry().size())); } catch (Exception e) { handleException("An error occurred trying to process this transaction request", e); } @@ -369,7 +364,7 @@ public class FHIRToolingClient { result = client.issuePostRequest(resourceAddress.resolveValidateUri(resourceClass, id), ByteUtils.resourceToByteArray(resource, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(), generateHeaders(), - "POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", TIMEOUT_OPERATION_LONG); + "POST " + resourceClass.getName() + (id != null ? "/" + id : "") + "/$validate", timeoutLong); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -428,7 +423,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "ValueSet/$expand?url=" + source.getUrl(), - TIMEOUT_OPERATION_EXPAND); + timeoutExpand); } catch (IOException e) { throw new FHIRException(e); } @@ -446,7 +441,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "CodeSystem/$lookup", - TIMEOUT_NORMAL); + timeoutNormal); } catch (IOException e) { e.printStackTrace(); } @@ -475,7 +470,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), source == null ? "ValueSet/$expand" : "ValueSet/$expand?url=" + source.getUrl(), - TIMEOUT_OPERATION_EXPAND); + timeoutExpand); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -499,7 +494,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "Closure?name=" + name, - TIMEOUT_NORMAL); + timeoutNormal); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } @@ -520,7 +515,7 @@ public class FHIRToolingClient { getPreferredResourceFormat(), generateHeaders(), "UpdateClosure?name=" + name, - TIMEOUT_OPERATION); + timeoutOperation); if (result.isUnsuccessfulRequest()) { throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload()); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/FHIRBaseToolingClient.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/FHIRBaseToolingClient.java new file mode 100644 index 000000000..bc9d5e83f --- /dev/null +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/FHIRBaseToolingClient.java @@ -0,0 +1,68 @@ +package org.hl7.fhir.utilities; + + +public class FHIRBaseToolingClient { + + private static final int DEFAULT_TIMEOUT_NORMAL = 1500; + private static final int DEFAULT_TIMEOUT_OPERATION = 30000; + private static final int DEFAULT_TIMEOUT_ENTRY = 500; + private static final int DEFAULT_TIMEOUT_OPERATION_LONG = 60000; + private static final int DEFAULT_TIMEOUT_OPERATION_EXPAND = 120000; + + protected int timeoutNormal = DEFAULT_TIMEOUT_NORMAL; + protected int timeoutOperation = DEFAULT_TIMEOUT_OPERATION; + protected int timeoutEntry = DEFAULT_TIMEOUT_ENTRY; + protected int timeoutLong = DEFAULT_TIMEOUT_OPERATION_LONG; + protected int timeoutExpand = DEFAULT_TIMEOUT_OPERATION_EXPAND; + + + public long getTimeoutNormal() { + return timeoutNormal; + } + + public void setTimeoutNormal(int timeoutNormal) { + this.timeoutNormal = timeoutNormal; + } + + public long getTimeoutOperation() { + return timeoutOperation; + } + + public void setTimeoutOperation(int timeoutOperation) { + this.timeoutOperation = timeoutOperation; + } + + public long getTimeoutEntry() { + return timeoutEntry; + } + + public void setTimeoutEntry(int timeoutEntry) { + this.timeoutEntry = timeoutEntry; + } + + public long getTimeoutLong() { + return timeoutLong; + } + + public void setTimeoutLong(int timeoutLong) { + this.timeoutLong = timeoutLong; + } + + public long getTimeoutExpand() { + return timeoutExpand; + } + + public void setTimeoutExpand(int timeoutExpand) { + this.timeoutExpand = timeoutExpand; + } + + + public void setTimeoutFactor(int i) { + timeoutNormal = i * DEFAULT_TIMEOUT_NORMAL; + timeoutOperation = i * DEFAULT_TIMEOUT_OPERATION; + timeoutEntry = i * DEFAULT_TIMEOUT_ENTRY; + timeoutLong = i * DEFAULT_TIMEOUT_OPERATION_LONG; + timeoutExpand = i * DEFAULT_TIMEOUT_OPERATION_EXPAND; + } + +} From 82f0fc953ac1fced1c00c30a4d2b21690eca19da Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 24 Nov 2023 12:06:29 +1100 Subject: [PATCH 32/32] remove orphan R4B test --- .../org/hl7/fhir/r4b/test/XmlParserTests.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/XmlParserTests.java b/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/XmlParserTests.java index 00a0e51b1..53282878c 100644 --- a/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/XmlParserTests.java +++ b/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/XmlParserTests.java @@ -44,22 +44,4 @@ public class XmlParserTests { } } - @Test - /** - * Deserializes a simplified CDA example into the logical model and checks that - * xml deserialization works for the xsi:type - * - * @throws IOException - */ - public void testXsiDeserialiserXmlParser() throws IOException { - Element cda = Manager.parseSingle(context, - TestingUtilities.loadTestResourceStream("validator", "cda", "example-xsi.xml"), FhirFormat.XML); - - ByteArrayOutputStream baosXml = new ByteArrayOutputStream(); - Manager.compose(context, cda, baosXml, FhirFormat.XML, OutputStyle.PRETTY, null); - - String cdaSerialised = baosXml.toString(); - Assertions.assertTrue(cdaSerialised.indexOf("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"") > 0); - Assertions.assertTrue(cdaSerialised.indexOf("xsi:type=\"CD\"") > 0); - } } \ No newline at end of file