From 946f56256f0ac899520f569359a281d64ad66540 Mon Sep 17 00:00:00 2001 From: Jens Kristian Villadsen Date: Sun, 23 Mar 2025 18:09:35 +0100 Subject: [PATCH 01/31] Added DocRef based on IHE with backport extension --- input/fsh/DkCoreDocumentReference.fsh | 4 ++++ sushi-config.yaml | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 input/fsh/DkCoreDocumentReference.fsh diff --git a/input/fsh/DkCoreDocumentReference.fsh b/input/fsh/DkCoreDocumentReference.fsh new file mode 100644 index 000000000..66f3d43e7 --- /dev/null +++ b/input/fsh/DkCoreDocumentReference.fsh @@ -0,0 +1,4 @@ +Profile: DkCoreDocumentReference +Parent: MinimalDocumentReference +Id: dk-core-documentreference +* extension contains http://hl7.org/fhir/5.0/StructureDefinition/extension-DocumentReference.version named version 1..1 \ No newline at end of file diff --git a/sushi-config.yaml b/sushi-config.yaml index fe1bbdbbc..c8a772984 100644 --- a/sushi-config.yaml +++ b/sushi-config.yaml @@ -38,8 +38,10 @@ parameters: path-expansion-params: Parameters-expParam.json dependencies: + hl7.fhir.extensions.r5: 4.0.1 hl7.fhir.uv.phd: 1.1.0 hl7.fhir.uv.ipa: 1.0.0 + ihe.iti.mhd: 4.2.2 # ╭────────────────────────────────────────────releasing───────────────────────────────────────────╮ From accefe1266d8e1f70297774ff023a105e59cc7b5 Mon Sep 17 00:00:00 2001 From: Jens Kristian Villadsen Date: Sun, 23 Mar 2025 19:00:39 +0100 Subject: [PATCH 02/31] Revert "Added DocRef based on IHE with backport extension" This reverts commit 946f56256f0ac899520f569359a281d64ad66540. --- input/fsh/DkCoreDocumentReference.fsh | 4 ---- sushi-config.yaml | 2 -- 2 files changed, 6 deletions(-) delete mode 100644 input/fsh/DkCoreDocumentReference.fsh diff --git a/input/fsh/DkCoreDocumentReference.fsh b/input/fsh/DkCoreDocumentReference.fsh deleted file mode 100644 index 66f3d43e7..000000000 --- a/input/fsh/DkCoreDocumentReference.fsh +++ /dev/null @@ -1,4 +0,0 @@ -Profile: DkCoreDocumentReference -Parent: MinimalDocumentReference -Id: dk-core-documentreference -* extension contains http://hl7.org/fhir/5.0/StructureDefinition/extension-DocumentReference.version named version 1..1 \ No newline at end of file diff --git a/sushi-config.yaml b/sushi-config.yaml index c8a772984..fe1bbdbbc 100644 --- a/sushi-config.yaml +++ b/sushi-config.yaml @@ -38,10 +38,8 @@ parameters: path-expansion-params: Parameters-expParam.json dependencies: - hl7.fhir.extensions.r5: 4.0.1 hl7.fhir.uv.phd: 1.1.0 hl7.fhir.uv.ipa: 1.0.0 - ihe.iti.mhd: 4.2.2 # ╭────────────────────────────────────────────releasing───────────────────────────────────────────╮ From c8413dcfccdaf1ae76afc79f72dcd0c23e95d29f Mon Sep 17 00:00:00 2001 From: Jesper Haffgaard Date: Thu, 1 May 2025 07:14:52 +0200 Subject: [PATCH 03/31] [(150-profiling-of-encounter)] First initial draft profiling of Encounter --- input/fsh/DkCoreEncounter.fsh | 15 +++++++++++++++ input/fsh/aliases.fsh | 1 + input/fsh/extensions.fsh | 29 ++++++++++++++++++++++++++++- input/fsh/valueSets.fsh | 8 ++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 input/fsh/DkCoreEncounter.fsh diff --git a/input/fsh/DkCoreEncounter.fsh b/input/fsh/DkCoreEncounter.fsh new file mode 100644 index 000000000..cace62a49 --- /dev/null +++ b/input/fsh/DkCoreEncounter.fsh @@ -0,0 +1,15 @@ +Profile: DkCoreEncounter +Parent: Encounter +Id: dk-core-encounter +Title: "Danish Core Encounter Profile" +Description: "HL7 Denmark core profile for an encounter" +* extension contains + PlannedStartDate named plannedStartDate 0..1 and + PlannedEndDate named plannedEndDate 0..1 and + CareProvider named careProvider 0..1 +* extension[plannedStartDate] ^short = "The planned start date/time (or admission date) of the encounter" +* extension[plannedEndDate] ^short = "The planned end date/time (or discharge date) of the encounter" +* extension[careProvider] ^short = "The organization (facility) reponsible for the care of the patient during this encounter" +* priority from DkCoreEncounterPriority (required) +* subject only Reference(DkCorePatient) +* serviceProvider only Reference(DkCoreOrganization) \ No newline at end of file diff --git a/input/fsh/aliases.fsh b/input/fsh/aliases.fsh index 1b8cb0837..2e1ca9fe2 100644 --- a/input/fsh/aliases.fsh +++ b/input/fsh/aliases.fsh @@ -27,3 +27,4 @@ Alias: $observation-bp = http://hl7.org/fhir/StructureDefinition/bp Alias: $LOINC-vitalsigns = http://hl7.org/fhir/ValueSet/observation-vitalsignresult Alias: $v3-Confidentiality = http://terminology.hl7.org/CodeSystem/v3-Confidentiality Alias: $v3-RoleCode = http://terminology.hl7.org/CodeSystem/v3-RoleCode +Alias: $v3-ActPriority = http://terminology.hl7.org/CodeSystem/v3-ActPriority \ No newline at end of file diff --git a/input/fsh/extensions.fsh b/input/fsh/extensions.fsh index 4d1d7be6f..7a85a3b7c 100644 --- a/input/fsh/extensions.fsh +++ b/input/fsh/extensions.fsh @@ -42,4 +42,31 @@ Description: "Identifier holding the official identifier for a danish municipali * . ^short = "Danish Core Municipality codes" * ^definition = "Identifier holding the official identifier for a danish municipality" * value[x] only CodeableConcept - * coding from MunicipalityCodes (required) \ No newline at end of file + * coding from MunicipalityCodes (required) + +Extension: PlannedStartDate +Id: dk-core-planned-start-date +Title: "PlannedStartDate" +* . ^short = "PlannedStartDate" + * ^definition = "The planned start date/time (or admission date) of the encounter" +* value[x] only dateTime +* ^context.type = http://hl7.org/fhir/extension-context-type#element +* ^context.expression = "Encounter" + +Extension: PlannedEndDate +Id: dk-core-planned-end-date +Title: "PlannedEndDate" +* . ^short = "PlannedEndDate" + * ^definition = "The planned end date/time (or discharge date) of the encounter" +* value[x] only dateTime +* ^context.type = http://hl7.org/fhir/extension-context-type#element +* ^context.expression = "Encounter" + +Extension: CareProvider +Id: dk-core-care-provider +Title: "CareProvider" +* . ^short = "CareProvider" + * ^definition = "The organization (facility) reponsible for the care of the patient during this encounter" +* value[x] only Reference(DkCoreOrganization) +* ^context.type = http://hl7.org/fhir/extension-context-type#element +* ^context.expression = "Encounter" \ No newline at end of file diff --git a/input/fsh/valueSets.fsh b/input/fsh/valueSets.fsh index ce39f430c..5e76dd6f1 100644 --- a/input/fsh/valueSets.fsh +++ b/input/fsh/valueSets.fsh @@ -841,3 +841,11 @@ Description: "Value set used for indicating the organization type for organizati * $sct#255203001 * $sct#264372000 +ValueSet: DkCoreEncounterPriority +Id: dk-core-encounter-priority +Title: "DK priority codes for encounters" +Description: "Value set used for indicating priority of an encounter" +* ^experimental = false +* ^status = #active +* $v3-ActPriority#A +* $v3-ActPriority#EL \ No newline at end of file From aabac8deffb594ac24bb846243a91681b118dbe1 Mon Sep 17 00:00:00 2001 From: Jesper Haffgaard Date: Thu, 1 May 2025 07:23:24 +0200 Subject: [PATCH 04/31] [(150-profiling-of-encounter)] First initial draft profiling of Encounter --- ...ctureDefinition-dk-core-encounter-intro.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 input/pagecontent/StructureDefinition-dk-core-encounter-intro.md diff --git a/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md b/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md new file mode 100644 index 000000000..2636127ff --- /dev/null +++ b/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md @@ -0,0 +1,26 @@ +### Scope and usage +This profile is intended to encapsulate information about encounters in the Danish health sectors. + +### Responsibilities for treatment and care +In Denmark there is a distinguishment between which organization has the reponsibility for providing treatment to the patient, and which organization +has the responsibility for providing care to the patient. + +* Treatment responsibility: this lies with the service provider organization +* Care responsibility: this lies with the organization where the patient has a stay (is hospitalized) + +The current care responsibility is represented by the extension [CareProvider](./StructureDefinition-dk-core-care-provider.html). + +### Handling future versions +In FHIR R5 and newer, there have been made significant changes to Encounter profile. + +In order to be compatible with the changes to the value set bound to Encounter.class in FHIR R5 and newer, we recommend to restrict to using only the +values from the FHIR R5 value set [Encounter class](https://terminology.hl7.org/5.2.0/ValueSet-encounter-class.html), which is a subset of the +FHIR R4 value set [ActEncounterCode](https://hl7.org/fhir/R4/v3/ActEncounterCode/vs.html): + +{:class="grid"} +| Code | Display | Use in Denmark | +| ---- | ------- | -------------- | + +In order to support the addition of Encounter.plannedStartDate and Encounter.plannedEndDate in FHIR R5, the extensions +[PlannedStartDate](./StructureDefinition-dk-core-planned-start-date.html) and [PlannedEndDate](./StructureDefinition-dk-core-planned-end-date.html) +have been added to DkCore. \ No newline at end of file From 92cc5d3e6868fb4d586f6109156c2fcc81bbf96a Mon Sep 17 00:00:00 2001 From: Jesper Haffgaard Date: Thu, 1 May 2025 07:44:20 +0200 Subject: [PATCH 05/31] [(150-profiling-of-encounter)] First initial draft profiling of Encounter --- .../StructureDefinition-dk-core-encounter-intro.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md b/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md index 2636127ff..169378830 100644 --- a/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md +++ b/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md @@ -18,8 +18,14 @@ values from the FHIR R5 value set [Encounter class](https://terminology.hl7.org/ FHIR R4 value set [ActEncounterCode](https://hl7.org/fhir/R4/v3/ActEncounterCode/vs.html): {:class="grid"} -| Code | Display | Use in Denmark | +| Code | Display | Typical use in Denmark | | ---- | ------- | -------------- | +| IMP | inpatient encounter | Encounters where patients are admitted typically for more than 12 hours. | +| AMB | ambulatory | Encounters where patients are not admitted. | +| OBSENC | observation encounter | Not used. | +| EMER | emergency | Encounters where patients are admitted to an emergency ward typically for up to 72 hours. | +| VR | virtual | Virtual encounters with patients typically using televideo, telephone, or other means of telepresence. | +| HH | home health | Encounters with patients in their own home. | In order to support the addition of Encounter.plannedStartDate and Encounter.plannedEndDate in FHIR R5, the extensions [PlannedStartDate](./StructureDefinition-dk-core-planned-start-date.html) and [PlannedEndDate](./StructureDefinition-dk-core-planned-end-date.html) From 904afb206d2330577d0844e61997bb0901532995 Mon Sep 17 00:00:00 2001 From: Jesper Langfeldt Hagen Haffgaard Date: Fri, 30 May 2025 10:52:39 +0200 Subject: [PATCH 06/31] [(150-profiling-of-encounter)] Ready for draft review. --- input/fsh/DkCoreEncounter.fsh | 6 +++++- input/fsh/codeSystems.fsh | 15 +++++++++++++++ input/fsh/valueSets.fsh | 7 ++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/input/fsh/DkCoreEncounter.fsh b/input/fsh/DkCoreEncounter.fsh index cace62a49..a33acc21f 100644 --- a/input/fsh/DkCoreEncounter.fsh +++ b/input/fsh/DkCoreEncounter.fsh @@ -10,6 +10,10 @@ Description: "HL7 Denmark core profile for an encounter" * extension[plannedStartDate] ^short = "The planned start date/time (or admission date) of the encounter" * extension[plannedEndDate] ^short = "The planned end date/time (or discharge date) of the encounter" * extension[careProvider] ^short = "The organization (facility) reponsible for the care of the patient during this encounter" -* priority from DkCoreEncounterPriority (required) +* priority from DkCoreEncounterPriority (extensible) * subject only Reference(DkCorePatient) +* diagnosis + * condition 1..1 + * condition only Reference(DkCoreCondition) + * use from DkCoreDiagnosisRole * serviceProvider only Reference(DkCoreOrganization) \ No newline at end of file diff --git a/input/fsh/codeSystems.fsh b/input/fsh/codeSystems.fsh index 5f8836d0d..6010d3f60 100644 --- a/input/fsh/codeSystems.fsh +++ b/input/fsh/codeSystems.fsh @@ -1305,3 +1305,18 @@ Description: "DK NPU Subsetted code system used in DK Core. The full version of * ^property[=].valueCode = #active * ^property[+].code = #comment * ^property[=].valueString = "Unit defined" + +CodeSystem: DkCoreDiagnosisRoleCodes +Id: dk-core-diagnosis-role-codes +Title: "DK Diagnosis Role Codes" +Description: "Codes defining the roles a condition can have withing an encounter" +* ^experimental = false +* ^status = #active +* ^caseSensitive = true +* ^content = #complete +* #AKTION + * ^designation.language = #da + * ^designation.value = "Aktionsdiagnose" +* #BI + * ^designation.language = #da + * ^designation.value = "Bidiagnose" \ No newline at end of file diff --git a/input/fsh/valueSets.fsh b/input/fsh/valueSets.fsh index 5e76dd6f1..6cdc6c88d 100644 --- a/input/fsh/valueSets.fsh +++ b/input/fsh/valueSets.fsh @@ -848,4 +848,9 @@ Description: "Value set used for indicating priority of an encounter" * ^experimental = false * ^status = #active * $v3-ActPriority#A -* $v3-ActPriority#EL \ No newline at end of file +* $v3-ActPriority#EL + +ValueSet: DkCoreDiagnosisRole +Id: dk-core-diagnosis-RoleCode +Description: "Value set defining the roles a condition can have withing an encounter" +* include codes from system DkCoreDiagnosisRoleCodes \ No newline at end of file From 17df578c1645a09c93f3b1c3862e4e9722c1cdb0 Mon Sep 17 00:00:00 2001 From: Jesper Langfeldt Hagen Haffgaard Date: Sat, 31 May 2025 00:31:13 +0200 Subject: [PATCH 07/31] [(150-profiling-of-encounter)] Ready for draft review. --- input/fsh/DkCoreEncounter.fsh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/input/fsh/DkCoreEncounter.fsh b/input/fsh/DkCoreEncounter.fsh index a33acc21f..002a3d082 100644 --- a/input/fsh/DkCoreEncounter.fsh +++ b/input/fsh/DkCoreEncounter.fsh @@ -9,11 +9,13 @@ Description: "HL7 Denmark core profile for an encounter" CareProvider named careProvider 0..1 * extension[plannedStartDate] ^short = "The planned start date/time (or admission date) of the encounter" * extension[plannedEndDate] ^short = "The planned end date/time (or discharge date) of the encounter" -* extension[careProvider] ^short = "The organization (facility) reponsible for the care of the patient during this encounter" +* extension[careProvider] ^short = "The organization (facility) responsible for the care of the patient during this encounter" * priority from DkCoreEncounterPriority (extensible) * subject only Reference(DkCorePatient) -* diagnosis - * condition 1..1 - * condition only Reference(DkCoreCondition) - * use from DkCoreDiagnosisRole +* diagnosis 0..* +* diagnosis ^short = "The list of diagnosis relevant to this encounter" +* diagnosis.condition 1..1 +* diagnosis.condition only Reference(DkCoreCondition) +* diagnosis.use 0..1 +* diagnosis.use from DkCoreDiagnosisRole (preferred) * serviceProvider only Reference(DkCoreOrganization) \ No newline at end of file From 3822fd73422aa4e6d51beb33f83a9c2ae0d315e5 Mon Sep 17 00:00:00 2001 From: Jesper Langfeldt Hagen Haffgaard Date: Sun, 1 Jun 2025 08:05:50 +0200 Subject: [PATCH 08/31] [(150-profiling-of-encounter)] Ready for pull request. --- input/fsh/DkCoreEncounter.fsh | 19 +++++++++++++------ input/fsh/codeSystems.fsh | 4 ++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/input/fsh/DkCoreEncounter.fsh b/input/fsh/DkCoreEncounter.fsh index 002a3d082..3c9b81812 100644 --- a/input/fsh/DkCoreEncounter.fsh +++ b/input/fsh/DkCoreEncounter.fsh @@ -12,10 +12,17 @@ Description: "HL7 Denmark core profile for an encounter" * extension[careProvider] ^short = "The organization (facility) responsible for the care of the patient during this encounter" * priority from DkCoreEncounterPriority (extensible) * subject only Reference(DkCorePatient) -* diagnosis 0..* -* diagnosis ^short = "The list of diagnosis relevant to this encounter" -* diagnosis.condition 1..1 -* diagnosis.condition only Reference(DkCoreCondition) -* diagnosis.use 0..1 -* diagnosis.use from DkCoreDiagnosisRole (preferred) +* diagnosis ^slicing.discriminator.type = #value +* diagnosis ^slicing.discriminator.path = "use" +* diagnosis ^slicing.rules = #open +* diagnosis ^slicing.description = "Slicing based on diagnosis use" +* diagnosis contains + primary 0..1 and + secondary 0..* +* diagnosis[primary].condition only Reference(DkCoreCondition) +* diagnosis[primary].use from DkCoreDiagnosisRole (required) +* diagnosis[primary].use = #PRIMARY +* diagnosis[secondary].condition only Reference(DkCoreCondition) +* diagnosis[secondary].use from DkCoreDiagnosisRole (required) +* diagnosis[secondary].use = #SECONDARY * serviceProvider only Reference(DkCoreOrganization) \ No newline at end of file diff --git a/input/fsh/codeSystems.fsh b/input/fsh/codeSystems.fsh index 6010d3f60..58e075f13 100644 --- a/input/fsh/codeSystems.fsh +++ b/input/fsh/codeSystems.fsh @@ -1314,9 +1314,9 @@ Description: "Codes defining the roles a condition can have withing an encounter * ^status = #active * ^caseSensitive = true * ^content = #complete -* #AKTION +* #PD "Primary diagnosis" * ^designation.language = #da * ^designation.value = "Aktionsdiagnose" -* #BI +* #SD "Secondary diagnosis" * ^designation.language = #da * ^designation.value = "Bidiagnose" \ No newline at end of file From 0b482c75383b89f773d38ebe8bbfd7392650588d Mon Sep 17 00:00:00 2001 From: Jesper Langfeldt Hagen Haffgaard Date: Sun, 1 Jun 2025 08:11:48 +0200 Subject: [PATCH 09/31] [(150-profiling-of-encounter)] Ready for draft review. --- .../pagecontent/StructureDefinition-dk-core-encounter-intro.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md b/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md index 169378830..3ef343d89 100644 --- a/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md +++ b/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md @@ -10,6 +10,9 @@ has the responsibility for providing care to the patient. The current care responsibility is represented by the extension [CareProvider](./StructureDefinition-dk-core-care-provider.html). +## Specifying primary and secondary diagnosis +Hospital encounters in Denmark have diagnosis associated that specifies the primary diagnosis beeing treated (Danish: aktionsdiagnose) and secondary diagnosis (Danish: bidiagnose) that might be relevant to the treatment of the primary diagnosis. These can be given in the diagnosis element in the primary and secondary slices. + ### Handling future versions In FHIR R5 and newer, there have been made significant changes to Encounter profile. From 24c2c92a4457c3c2b02a2cf75c1b65166f502c82 Mon Sep 17 00:00:00 2001 From: Jens Kristian Villadsen Date: Sun, 1 Jun 2025 17:23:38 +0200 Subject: [PATCH 10/31] 3.5.0 documentreference (#160) * added DkCoreDocumentReference * Update aliases.fsh * Alternative DocRef approach (#158) * Alternative DocRef approach * Further danish constraints * Removed unused alias * update scripts * Update DkCoreDocumentReference.fsh --------- Co-authored-by: Ole Vilstrup --- _gencontinuous.sh | 4 +- _updatePublisher.bat | 15 ++++- _updatePublisher.sh | 12 +++- ...DkCoreDocumentHomeCommunityidExtension.fsh | 8 +++ input/fsh/DkCoreDocumentReference.fsh | 11 ++++ input/fsh/DkDocumentVersionIDExtension.fsh | 5 ++ input/fsh/aliases.fsh | 2 + input/fsh/valueSets.fsh | 61 +++++++++++++++++++ sushi-config.yaml | 3 + 9 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 input/fsh/DkCoreDocumentHomeCommunityidExtension.fsh create mode 100644 input/fsh/DkCoreDocumentReference.fsh create mode 100644 input/fsh/DkDocumentVersionIDExtension.fsh diff --git a/_gencontinuous.sh b/_gencontinuous.sh index b9ac5933d..970747668 100755 --- a/_gencontinuous.sh +++ b/_gencontinuous.sh @@ -1,2 +1,2 @@ -#!/bin/bash -./_genonce.sh -watch +#!/bin/bash +./_genonce.sh -watch diff --git a/_updatePublisher.bat b/_updatePublisher.bat index 67aebf583..10fee3815 100644 --- a/_updatePublisher.bat +++ b/_updatePublisher.bat @@ -8,6 +8,8 @@ SET input_cache_path=%CD%\input-cache\ SET skipPrompts=false SET scriptdlroot=https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main +SET build_bat_url=%scriptdlroot%/_build.bat +SET build_sh_url=%scriptdlroot%/_build.sh SET update_bat_url=%scriptdlroot%/_updatePublisher.bat SET gen_bat_url=%scriptdlroot%/_genonce.bat SET gencont_bat_url=%scriptdlroot%/_gencontinuous.bat @@ -20,7 +22,7 @@ IF "%~1"=="/f" SET skipPrompts=y ECHO. ECHO Checking internet connection... -PING tx.fhir.org -4 -n 1 -w 1000 | FINDSTR TTL && GOTO isonline +PING tx.fhir.org -4 -n 1 -w 4000 | FINDSTR TTL && GOTO isonline ECHO We're offline, nothing to do... GOTO end @@ -69,6 +71,7 @@ IF DEFINED FORCE ( IF "%skipPrompts%"=="y" ( SET create=Y ) ELSE ( + ECHO Will place publisher jar here: %input_cache_path%%publisher_jar% SET /p create="Ok? (Y/N) " ) IF /I "%create%"=="Y" ( @@ -211,6 +214,16 @@ goto end start copy /y "_updatePublisher.new.bat" "_updatePublisher.bat" ^&^& del "_updatePublisher.new.bat" ^&^& exit +:dl_script_7 +ECHO Updating _build.bat +call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%build_bat_url%\",\"_build.new.bat\") } else { Invoke-WebRequest -Uri "%update_bat_url%" -Outfile "_build.new.bat" } +if %ERRORLEVEL% == 0 goto upd_script_6 +echo "Errors encountered during download: %errorlevel%" +goto end +:upd_script_6 +start copy /y "_build.new.bat" "_build.bat" ^&^& del "_build.new.bat" ^&^& exit + + :end diff --git a/_updatePublisher.sh b/_updatePublisher.sh index 0f9ecbed9..56ec40435 100755 --- a/_updatePublisher.sh +++ b/_updatePublisher.sh @@ -103,6 +103,16 @@ if [[ $skipPrompts != true ]]; then if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then echo "Downloading most recent scripts " + curl -L $build_bat_url -o /tmp/_build.new + cp /tmp/_build.new _build.bat + rm /tmp/_build.new + + + curl -L $build_sh_url -o /tmp/_build.new + cp /tmp/_build.new _build.sh + chmod +x _build.sh + rm /tmp/_build.new + curl -L $update_bat_url -o /tmp/_updatePublisher.new cp /tmp/_updatePublisher.new _updatePublisher.bat rm /tmp/_updatePublisher.new @@ -129,4 +139,4 @@ if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then cp /tmp/_updatePublisher.new _updatePublisher.sh chmod +x _updatePublisher.sh rm /tmp/_updatePublisher.new -fi +fi \ No newline at end of file diff --git a/input/fsh/DkCoreDocumentHomeCommunityidExtension.fsh b/input/fsh/DkCoreDocumentHomeCommunityidExtension.fsh new file mode 100644 index 000000000..6463b0407 --- /dev/null +++ b/input/fsh/DkCoreDocumentHomeCommunityidExtension.fsh @@ -0,0 +1,8 @@ +Extension: DkCoreDocumentHomeCommunityID +Id: dk-core-document-homecommunityid-extension +Title: "HL7 Denmark core Document HomeCommunityID extension" +Description: "Extension containing information about operational and in production home communities (XCA) in Danish Document Sharing" +* valueCoding 1..1 MS +* valueCoding.system 1.. MS +* valueCoding.code 1.. MS + diff --git a/input/fsh/DkCoreDocumentReference.fsh b/input/fsh/DkCoreDocumentReference.fsh new file mode 100644 index 000000000..da89cd2e2 --- /dev/null +++ b/input/fsh/DkCoreDocumentReference.fsh @@ -0,0 +1,11 @@ +Profile: DkCoreDocumentReference +Parent: MinimalDocumentReference +Id: dk-core-documentreference +Title: "Danish Core DocumentReference Profile" +* extension contains http://hl7.org/fhir/5.0/StructureDefinition/extension-DocumentReference.version named version 1..1 +* context.facilityType from SorOrganizationType (extensible) +* context.practiceSetting from SorPracticeSettingCode (extensible) +* author only Reference(DkCorePatient or DkCorePractitioner or DkCorePractitionerRole or DkCoreRelatedPerson or DkCoreOrganization or Device) + +* authenticator only Reference(DkCorePractitioner) +* subject only Reference(DkCorePatient) diff --git a/input/fsh/DkDocumentVersionIDExtension.fsh b/input/fsh/DkDocumentVersionIDExtension.fsh new file mode 100644 index 000000000..c2fef9e4b --- /dev/null +++ b/input/fsh/DkDocumentVersionIDExtension.fsh @@ -0,0 +1,5 @@ +Extension: DkCoreDocumentReferenceVersionID +Id: dk-core-documentreference-version-id-extension +Title: "HL7 Denmark core DocumentReference Version ID extension" +Description: "Extension containing information about the version of the DocumentReference for a specific standard. The version is included in the R5 version of the resource." +* valueString 1..1 MS diff --git a/input/fsh/aliases.fsh b/input/fsh/aliases.fsh index 1b8cb0837..eb36b2459 100644 --- a/input/fsh/aliases.fsh +++ b/input/fsh/aliases.fsh @@ -27,3 +27,5 @@ Alias: $observation-bp = http://hl7.org/fhir/StructureDefinition/bp Alias: $LOINC-vitalsigns = http://hl7.org/fhir/ValueSet/observation-vitalsignresult Alias: $v3-Confidentiality = http://terminology.hl7.org/CodeSystem/v3-Confidentiality Alias: $v3-RoleCode = http://terminology.hl7.org/CodeSystem/v3-RoleCode + + diff --git a/input/fsh/valueSets.fsh b/input/fsh/valueSets.fsh index ce39f430c..555438843 100644 --- a/input/fsh/valueSets.fsh +++ b/input/fsh/valueSets.fsh @@ -841,3 +841,64 @@ Description: "Value set used for indicating the organization type for organizati * $sct#255203001 * $sct#264372000 + +ValueSet: SorPracticeSettingCode +Id: dk-core-practice-setting-code +Title: "DK SOR Practice Setting Code" +Description: "Values used for the document metadata attribute practiceSettingCode, which is an attribute specifying the clinical specialty where the act that resulted in the document was performed (e.g., Family Practice, Laboratory, Radiology). The value set is based on a subset of the code list from the SOR lookup table 'SOR-Kliniske specialer' (https://sor.sum.dsdn.dk/lookupdata/#clinical_speciality, accessable on Sundhedsdatanettet (SDN)), which is based on SNOMED CT codes." +* ^status = #active +* ^experimental = false +* $sct#773568002 +* $sct#408443003 +* $sct#394577000 +* $sct#394821009 +* $sct#394588006 +* $sct#394582007 +* $sct#394914008 +* $sct#394583002 +* $sct#394811001 +* $sct#394585009 +* $sct#408472002 +* $sct#394803006 +* $sct#394807007 +* $sct#419192003 +* $sct#394579002 +* $sct#408463005 +* $sct#394609007 +* $sct#551411000005104 +* $sct#394596001 +* $sct#394600006 +* $sct#394601005 +* $sct#394580004 +* $sct#421661004 +* $sct#408454008 +* $sct#394809005 +* $sct#394592004 +* $sct#418112009 +* $sct#394805004 +* $sct#394584008 +* $sct#394589003 +* $sct#394610002 +* $sct#394591006 +* $sct#394812008 +* $sct#394594003 +* $sct#394608004 +* $sct#394801008 +* $sct#394604002 +* $sct#394915009 +* $sct#394611003 +* $sct#394587001 +* $sct#394537008 +* $sct#394810000 +* $sct#394581000 +* $sct#394605001 +* $sct#394603008 +* $sct#408448007 +* $sct#394612005 +* $sct#658171000005102 +* $sct#658161000005107 +* $sct#658151000005105 +* $sct#658191000005101 +* $sct#658201000005103 +* $sct#658141000005108 +* $sct#658181000005104 \ No newline at end of file diff --git a/sushi-config.yaml b/sushi-config.yaml index fe1bbdbbc..795516d65 100644 --- a/sushi-config.yaml +++ b/sushi-config.yaml @@ -38,8 +38,11 @@ parameters: path-expansion-params: Parameters-expParam.json dependencies: + hl7.fhir.extensions.r5: 4.0.1 hl7.fhir.uv.phd: 1.1.0 hl7.fhir.uv.ipa: 1.0.0 + ihe.iti.mhd: 4.2.2 + # ╭────────────────────────────────────────────releasing───────────────────────────────────────────╮ From eaa537b410a0768288865433d7cfdd54e065a250 Mon Sep 17 00:00:00 2001 From: Jesper Langfeldt Hagen Haffgaard Date: Fri, 13 Jun 2025 14:11:18 +0200 Subject: [PATCH 11/31] [(150-profiling-of-encounter)] Changes after first review --- input/fsh/DkCoreEncounter.fsh | 12 +++-------- input/fsh/codeSystems.fsh | 17 +--------------- input/fsh/valueSets.fsh | 5 ----- ...ctureDefinition-dk-core-encounter-intro.md | 20 ++++++++++++------- input/pagecontent/index.md | 2 +- 5 files changed, 18 insertions(+), 38 deletions(-) diff --git a/input/fsh/DkCoreEncounter.fsh b/input/fsh/DkCoreEncounter.fsh index 3c9b81812..38441da95 100644 --- a/input/fsh/DkCoreEncounter.fsh +++ b/input/fsh/DkCoreEncounter.fsh @@ -16,13 +16,7 @@ Description: "HL7 Denmark core profile for an encounter" * diagnosis ^slicing.discriminator.path = "use" * diagnosis ^slicing.rules = #open * diagnosis ^slicing.description = "Slicing based on diagnosis use" -* diagnosis contains - primary 0..1 and - secondary 0..* -* diagnosis[primary].condition only Reference(DkCoreCondition) -* diagnosis[primary].use from DkCoreDiagnosisRole (required) -* diagnosis[primary].use = #PRIMARY -* diagnosis[secondary].condition only Reference(DkCoreCondition) -* diagnosis[secondary].use from DkCoreDiagnosisRole (required) -* diagnosis[secondary].use = #SECONDARY +* diagnosis contains dk-core-conditions 0..* +* diagnosis[dk-core-conditions].condition only Reference(DkCoreCondition) +* diagnosis[dk-core-conditions].rank 1..1 * serviceProvider only Reference(DkCoreOrganization) \ No newline at end of file diff --git a/input/fsh/codeSystems.fsh b/input/fsh/codeSystems.fsh index 58e075f13..9a6ec59be 100644 --- a/input/fsh/codeSystems.fsh +++ b/input/fsh/codeSystems.fsh @@ -1304,19 +1304,4 @@ Description: "DK NPU Subsetted code system used in DK Core. The full version of * ^property[+].code = #status * ^property[=].valueCode = #active * ^property[+].code = #comment - * ^property[=].valueString = "Unit defined" - -CodeSystem: DkCoreDiagnosisRoleCodes -Id: dk-core-diagnosis-role-codes -Title: "DK Diagnosis Role Codes" -Description: "Codes defining the roles a condition can have withing an encounter" -* ^experimental = false -* ^status = #active -* ^caseSensitive = true -* ^content = #complete -* #PD "Primary diagnosis" - * ^designation.language = #da - * ^designation.value = "Aktionsdiagnose" -* #SD "Secondary diagnosis" - * ^designation.language = #da - * ^designation.value = "Bidiagnose" \ No newline at end of file + * ^property[=].valueString = "Unit defined" \ No newline at end of file diff --git a/input/fsh/valueSets.fsh b/input/fsh/valueSets.fsh index 27ccd5bcd..fc3d7ed04 100644 --- a/input/fsh/valueSets.fsh +++ b/input/fsh/valueSets.fsh @@ -850,11 +850,6 @@ Description: "Value set used for indicating priority of an encounter" * $v3-ActPriority#A * $v3-ActPriority#EL -ValueSet: DkCoreDiagnosisRole -Id: dk-core-diagnosis-RoleCode -Description: "Value set defining the roles a condition can have withing an encounter" -* include codes from system DkCoreDiagnosisRoleCodes - ValueSet: SorPracticeSettingCode Id: dk-core-practice-setting-code Title: "DK SOR Practice Setting Code" diff --git a/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md b/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md index 3ef343d89..9fd57773b 100644 --- a/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md +++ b/input/pagecontent/StructureDefinition-dk-core-encounter-intro.md @@ -5,19 +5,20 @@ This profile is intended to encapsulate information about encounters in the Dani In Denmark there is a distinguishment between which organization has the reponsibility for providing treatment to the patient, and which organization has the responsibility for providing care to the patient. -* Treatment responsibility: this lies with the service provider organization -* Care responsibility: this lies with the organization where the patient has a stay (is hospitalized) +* Treatment responsibility ([DA] behandlingsansvarlig): this lies with the service provider organization +* Care responsibility ([DA] plejeansvarlig): this lies with the organization where the patient has a stay (is hospitalized) -The current care responsibility is represented by the extension [CareProvider](./StructureDefinition-dk-core-care-provider.html). +The treatment responsibility is represented by Encounter.serviceProvider and the current care responsibility is represented by the +extension [CareProvider](./StructureDefinition-dk-core-care-provider.html). ## Specifying primary and secondary diagnosis -Hospital encounters in Denmark have diagnosis associated that specifies the primary diagnosis beeing treated (Danish: aktionsdiagnose) and secondary diagnosis (Danish: bidiagnose) that might be relevant to the treatment of the primary diagnosis. These can be given in the diagnosis element in the primary and secondary slices. +Hospital encounters in Denmark have diagnosis associated that specifies the primary diagnosis beeing treated ([DA] aktionsdiagnose) and secondary diagnosis ([DA] bidiagnose) that might be relevant to the treatment of the primary diagnosis. These can be given in the diagnosis element and it is recommended to use the rank element to distinguish between primary and secondary diagnoses, the primary being given rank 1 and the secondary a rank > 1. ### Handling future versions In FHIR R5 and newer, there have been made significant changes to Encounter profile. -In order to be compatible with the changes to the value set bound to Encounter.class in FHIR R5 and newer, we recommend to restrict to using only the -values from the FHIR R5 value set [Encounter class](https://terminology.hl7.org/5.2.0/ValueSet-encounter-class.html), which is a subset of the +In order to be compatible with the changes to the value set bound to Encounter.class in FHIR R5 and newer, we recommend to restrict to using only +the values from the FHIR R5 value set [Encounter class](https://terminology.hl7.org/5.2.0/ValueSet-encounter-class.html), which is a subset of the FHIR R4 value set [ActEncounterCode](https://hl7.org/fhir/R4/v3/ActEncounterCode/vs.html): {:class="grid"} @@ -30,6 +31,11 @@ FHIR R4 value set [ActEncounterCode](https://hl7.org/fhir/R4/v3/ActEncounterCode | VR | virtual | Virtual encounters with patients typically using televideo, telephone, or other means of telepresence. | | HH | home health | Encounters with patients in their own home. | +Note that Encounter.class has an extensible binding, so if a class coding not part of the bound value set is needed, it is allowed to use an +alternate coding. + In order to support the addition of Encounter.plannedStartDate and Encounter.plannedEndDate in FHIR R5, the extensions [PlannedStartDate](./StructureDefinition-dk-core-planned-start-date.html) and [PlannedEndDate](./StructureDefinition-dk-core-planned-end-date.html) -have been added to DkCore. \ No newline at end of file +have been added to DkCore. However, note that in the R4 documentation it is stated that a planned start date could be given by placing +period.start in the future, and setting the status to ‘planned’. As a consequence, this practice is also acceptable in the dk-core R4 version, +but the use of plannedStart and plannedEnd extensions are encouraged to make transition to future FHIR versions easier. \ No newline at end of file diff --git a/input/pagecontent/index.md b/input/pagecontent/index.md index c8ca094ae..03385f1bf 100644 --- a/input/pagecontent/index.md +++ b/input/pagecontent/index.md @@ -42,7 +42,7 @@ Issues opened in that GitHub repo are very welcome. They help the affiliate pick Pull requests are even better. If you are in a position to suggest how exactly your proposal should be implemented in the specification, do it! It helps the team maintaining the implementation guide a great deal. ### Language -The main language of this implementation guide, and the profiles in it, is English. Content that does not have an official English term uses a Danish term instead. Sometimes terms are explained using both Danish and English. Danish terms and explanations are prefixed with 'Da' +The main language of this implementation guide, and the profiles in it, is English. Content that does not have an official English term uses a Danish term instead. Sometimes terms are explained using both Danish and English. Danish terms and explanations are prefixed with [DA] ### Connection between dk-core and common Danish architectures and standards HL7 Denmark includes common Danish architectures and standards if relevant, when content is added to dk-core. This section provides information about principle decisions as well as more specific ones that require explanations. From fe6447f96c5c74487f36300a71452353ff03e053 Mon Sep 17 00:00:00 2001 From: Jesper Langfeldt Hagen Haffgaard Date: Fri, 13 Jun 2025 14:46:13 +0200 Subject: [PATCH 12/31] [(150-profiling-of-encounter)] Changes after first review --- input/fsh/DkCoreEncounter.fsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/input/fsh/DkCoreEncounter.fsh b/input/fsh/DkCoreEncounter.fsh index 38441da95..2489a4e62 100644 --- a/input/fsh/DkCoreEncounter.fsh +++ b/input/fsh/DkCoreEncounter.fsh @@ -12,10 +12,10 @@ Description: "HL7 Denmark core profile for an encounter" * extension[careProvider] ^short = "The organization (facility) responsible for the care of the patient during this encounter" * priority from DkCoreEncounterPriority (extensible) * subject only Reference(DkCorePatient) -* diagnosis ^slicing.discriminator.type = #value -* diagnosis ^slicing.discriminator.path = "use" +* diagnosis ^slicing.discriminator.type = #type +* diagnosis ^slicing.discriminator.path = condition * diagnosis ^slicing.rules = #open -* diagnosis ^slicing.description = "Slicing based on diagnosis use" +* diagnosis ^slicing.description = "Slicing based on condition type" * diagnosis contains dk-core-conditions 0..* * diagnosis[dk-core-conditions].condition only Reference(DkCoreCondition) * diagnosis[dk-core-conditions].rank 1..1 From 0fd43cce4819563a4bf2a96ab5f89789b8199fb2 Mon Sep 17 00:00:00 2001 From: Ole Vilstrup Date: Mon, 25 Aug 2025 12:16:35 +0200 Subject: [PATCH 13/31] Update DkCoreDocumentReference.fsh Added context.sourcePatientInfo only Reference(DkCorePatient) --- input/fsh/DkCoreDocumentReference.fsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/fsh/DkCoreDocumentReference.fsh b/input/fsh/DkCoreDocumentReference.fsh index da89cd2e2..d6af382ce 100644 --- a/input/fsh/DkCoreDocumentReference.fsh +++ b/input/fsh/DkCoreDocumentReference.fsh @@ -6,6 +6,6 @@ Title: "Danish Core DocumentReference Profile" * context.facilityType from SorOrganizationType (extensible) * context.practiceSetting from SorPracticeSettingCode (extensible) * author only Reference(DkCorePatient or DkCorePractitioner or DkCorePractitionerRole or DkCoreRelatedPerson or DkCoreOrganization or Device) - * authenticator only Reference(DkCorePractitioner) * subject only Reference(DkCorePatient) +* context.sourcePatientInfo only Reference(DkCorePatient) \ No newline at end of file From 9aa27af5a4e82271ffd8baae848a2fa2228344c5 Mon Sep 17 00:00:00 2001 From: Ole Vilstrup Date: Mon, 25 Aug 2025 12:26:59 +0200 Subject: [PATCH 14/31] Update DkCoreDocumentReference.fsh outcommented context.sourcePatientInfo only Reference(DkCorePatient) --- input/fsh/DkCoreDocumentReference.fsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/fsh/DkCoreDocumentReference.fsh b/input/fsh/DkCoreDocumentReference.fsh index d6af382ce..4c4984490 100644 --- a/input/fsh/DkCoreDocumentReference.fsh +++ b/input/fsh/DkCoreDocumentReference.fsh @@ -8,4 +8,4 @@ Title: "Danish Core DocumentReference Profile" * author only Reference(DkCorePatient or DkCorePractitioner or DkCorePractitionerRole or DkCoreRelatedPerson or DkCoreOrganization or Device) * authenticator only Reference(DkCorePractitioner) * subject only Reference(DkCorePatient) -* context.sourcePatientInfo only Reference(DkCorePatient) \ No newline at end of file +//* context.sourcePatientInfo only Reference(DkCorePatient) \ No newline at end of file From c05e410f6707c0913386e569ccf5a3d9d3856f74 Mon Sep 17 00:00:00 2001 From: Ole Vilstrup Date: Mon, 25 Aug 2025 12:32:50 +0200 Subject: [PATCH 15/31] Update DkCoreDocumentReference.fsh --- input/fsh/DkCoreDocumentReference.fsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/input/fsh/DkCoreDocumentReference.fsh b/input/fsh/DkCoreDocumentReference.fsh index 4c4984490..c348f750f 100644 --- a/input/fsh/DkCoreDocumentReference.fsh +++ b/input/fsh/DkCoreDocumentReference.fsh @@ -2,10 +2,11 @@ Profile: DkCoreDocumentReference Parent: MinimalDocumentReference Id: dk-core-documentreference Title: "Danish Core DocumentReference Profile" +Description: "HL7 Denmark core profile for a DocumentReference" * extension contains http://hl7.org/fhir/5.0/StructureDefinition/extension-DocumentReference.version named version 1..1 * context.facilityType from SorOrganizationType (extensible) * context.practiceSetting from SorPracticeSettingCode (extensible) * author only Reference(DkCorePatient or DkCorePractitioner or DkCorePractitionerRole or DkCoreRelatedPerson or DkCoreOrganization or Device) * authenticator only Reference(DkCorePractitioner) * subject only Reference(DkCorePatient) -//* context.sourcePatientInfo only Reference(DkCorePatient) \ No newline at end of file +* context.sourcePatientInfo only Reference(DkCorePatient) \ No newline at end of file From ec3d4e4ad29bc60b8afcc5a68afd50477e2325d8 Mon Sep 17 00:00:00 2001 From: Ole Vilstrup Date: Mon, 8 Sep 2025 09:50:50 +0200 Subject: [PATCH 16/31] Create StructureDefinition-dk-core-documentreference-intro.md Created short intro page for DocumentReference --- .../StructureDefinition-dk-core-documentreference-intro.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 input/pagecontent/StructureDefinition-dk-core-documentreference-intro.md diff --git a/input/pagecontent/StructureDefinition-dk-core-documentreference-intro.md b/input/pagecontent/StructureDefinition-dk-core-documentreference-intro.md new file mode 100644 index 000000000..a2dc303d6 --- /dev/null +++ b/input/pagecontent/StructureDefinition-dk-core-documentreference-intro.md @@ -0,0 +1,4 @@ +### Scope and Usage +The Danish Core DocumentReference profile is intended to encapsulate the data model of a DocumentReference as used in a Danish context of Document sharing, wether it is FHIR or CDA Documents and wether it is native XDS infrastructure or used in an MHD context [IHE MHD DocumentReference Minimal specification](https://profiles.ihe.net/ITI/MHD/4.2.2/StructureDefinition-IHE.MHD.Minimal.DocumentReference.html). + + \ No newline at end of file From 699bbb35b7108ccc2261af4353c3d265b3dcf112 Mon Sep 17 00:00:00 2001 From: Ole Vilstrup Date: Mon, 8 Sep 2025 10:01:59 +0200 Subject: [PATCH 17/31] Update StructureDefinition-dk-core-documentreference-intro.md --- .../StructureDefinition-dk-core-documentreference-intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/pagecontent/StructureDefinition-dk-core-documentreference-intro.md b/input/pagecontent/StructureDefinition-dk-core-documentreference-intro.md index a2dc303d6..372eef083 100644 --- a/input/pagecontent/StructureDefinition-dk-core-documentreference-intro.md +++ b/input/pagecontent/StructureDefinition-dk-core-documentreference-intro.md @@ -1,4 +1,4 @@ ### Scope and Usage -The Danish Core DocumentReference profile is intended to encapsulate the data model of a DocumentReference as used in a Danish context of Document sharing, wether it is FHIR or CDA Documents and wether it is native XDS infrastructure or used in an MHD context [IHE MHD DocumentReference Minimal specification](https://profiles.ihe.net/ITI/MHD/4.2.2/StructureDefinition-IHE.MHD.Minimal.DocumentReference.html). +The Danish Core DocumentReference profile is intended to encapsulate the data model of a DocumentReference as used in a Danish context of Document sharing, whether it is FHIR or CDA Documents and whether it is native XDS infrastructure or used in an MHD context [IHE MHD DocumentReference Minimal specification](https://profiles.ihe.net/ITI/MHD/4.2.2/StructureDefinition-IHE.MHD.Minimal.DocumentReference.html). \ No newline at end of file From fd993ada32ee3e10aff2b0f44a8dd943f1568872 Mon Sep 17 00:00:00 2001 From: Torben Mejlvang Hagensen <132343194+TMHA-Trifork@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:51:26 +0200 Subject: [PATCH 18/31] Issue 155, extra info around IPA use cases --- _build.new.bat | 386 +++++++++++++++++++++++++++++++++++++ _gencontinuous.sh | 4 +- _updatePublisher.sh | 2 + input/pagecontent/index.md | 4 +- 4 files changed, 393 insertions(+), 3 deletions(-) create mode 100644 _build.new.bat diff --git a/_build.new.bat b/_build.new.bat new file mode 100644 index 000000000..99d0e1f97 --- /dev/null +++ b/_build.new.bat @@ -0,0 +1,386 @@ +@ECHO OFF +setlocal enabledelayedexpansion + +SET "dlurl=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar" +SET "publisher_jar=publisher.jar" +SET "input_cache_path=%CD%\input-cache\" +SET "skipPrompts=false" +SET "upper_path=..\" +SET "scriptdlroot=https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main" +SET "build_bat_url=%scriptdlroot%/_build.bat" +SET "build_sh_url=%scriptdlroot%/_build.sh" + + + +:: Debugging statements to check jar file location +ECHO Checking for publisher.jar in %input_cache_path% +IF EXIST "%input_cache_path%%publisher_jar%" ( + SET "jar_location=%input_cache_path%%publisher_jar%" + ECHO Found publisher.jar in input-cache +) ELSE ( + ECHO Checking for publisher.jar in %upper_path% + IF EXIST "%upper_path%%publisher_jar%" ( + SET "jar_location=%upper_path%%publisher_jar%" + ECHO Found publisher.jar in parent folder + ) ELSE ( + SET "jar_location=not_found" + SET "default_choice=1" + ECHO publisher.jar not found in input-cache or parent folder + ) +) + + +:: Handle command-line argument to bypass the menu +IF NOT "%~1"=="" ( + IF /I "%~1"=="update" SET "userChoice=1" + IF /I "%~1"=="build" SET "userChoice=2" + IF /I "%~1"=="nosushi" SET "userChoice=3" + IF /I "%~1"=="notx" SET "userChoice=4" + IF /I "%~1"=="jekyll" SET "userChoice=5" + IF /I "%~1"=="clean" SET "userChoice=6" + IF /I "%~1"=="exit" SET "userChoice=0" + GOTO executeChoice +) + +echo --------------------------------------------------------------- +ECHO Checking internet connection... +PING tx.fhir.org -4 -n 1 -w 4000 >nul 2>&1 && SET "online_status=true" || SET "online_status=false" + +IF "%online_status%"=="true" ( + ECHO We're online and tx.fhir.org is available. + FOR /F "tokens=2 delims=:" %%a IN ('curl -s https://api.github.com/repos/HL7/fhir-ig-publisher/releases/latest ^| findstr "tag_name"') DO SET "latest_version=%%a" + SET "latest_version=!latest_version:"=!" + SET "latest_version=!latest_version: =!" + SET "latest_version=!latest_version:~0,-1!" +) ELSE ( + ECHO We're offline or tx.fhir.org is not available, can only run the publisher without TX... + SET "txoption=-tx n/a" + SET "latest_version=unknown" + SET "default_choice=4" +) + +echo --------------------------------------------------------------- + + +IF NOT "%jar_location%"=="not_found" ( + FOR /F "tokens=*" %%i IN ('java "-Dfile.encoding=UTF-8" -jar "%jar_location%" -v 2^>^&1') DO SET "publisher_version=%%i" + SET "publisher_version=!publisher_version:"=!" + ECHO Detected publisher version: !publisher_version! +) ELSE ( + SET "publisher_version=unknown" + ECHO publisher.jar location is not found +) + +ECHO Publisher version: !publisher_version!; Latest is !latest_version! + +IF NOT "%online_status%"=="true" ( + ECHO We're offline. +) ELSE ( + IF NOT "!publisher_version!"=="!latest_version!" ( + ECHO An update is recommended. + SET "default_choice=1" + ) ELSE ( + ECHO Publisher is up to date. + SET "default_choice=2" + ) +) + +echo --------------------------------------------------------------- +echo. + +echo Please select an option: +echo 1. Download or update publisher +echo 2. Build IG +echo 3. Build IG - no sushi +echo 4. Build IG - force no TX server +echo 5. Jekyll build +echo 6. Clean up temp directories +echo 0. Exit +:: echo [Press Enter for default (%default_choice%) or type an option number:] +echo. + +:: Using CHOICE to handle input with timeout +:: ECHO [Enter=Continue, 1-7=Option, 0=Exit] +choice /C 12345670 /N /CS /D %default_choice% /T 5 /M "Choose an option number or wait 5 seconds for default (%default_choice%):" +SET "userChoice=%ERRORLEVEL%" + + +:executeChoice +echo You selected: %userChoice% + +IF "%userChoice%"=="1" GOTO downloadpublisher +IF "%userChoice%"=="2" GOTO publish_once +IF "%userChoice%"=="3" GOTO publish_nosushi +IF "%userChoice%"=="4" GOTO publish_notx +IF "%userChoice%"=="5" GOTO debugjekyll +IF "%userChoice%"=="6" GOTO clean +IF "%userChoice%"=="0" EXIT /B + +:end + + + +:debugjekyll + echo Running Jekyll build... + jekyll build -s temp/pages -d output +GOTO end + + +:clean + echo Cleaning up directories... + if exist ".\input-cache\publisher.jar" ( + echo Preserving publisher.jar and removing other files in .\input-cache... + move ".\input-cache\publisher.jar" ".\" + rmdir /s /q ".\input-cache" + mkdir ".\input-cache" + move ".\publisher.jar" ".\input-cache" + ) else ( + if exist ".\input-cache\" ( + rmdir /s /q ".\input-cache" + ) + ) + if exist ".\temp\" ( + rmdir /s /q ".\temp" + echo Removed: .\temp + ) + if exist ".\output\" ( + rmdir /s /q ".\output" + echo Removed: .\output + ) + if exist ".\template\" ( + rmdir /s /q ".\template" + echo Removed: .\template + ) + +GOTO end + + + + + +:downloadpublisher +ECHO Downloading Publisher... +:processflags +SET ARG=%1 +IF DEFINED ARG ( + IF "%ARG%"=="-f" SET FORCE=true + IF "%ARG%"=="--force" SET FORCE=true + SHIFT + GOTO processflags +) + +FOR %%x IN ("%CD%") DO SET upper_path=%%~dpx + +ECHO. +IF NOT EXIST "%input_cache_path%%publisher_jar%" ( + IF NOT EXIST "%upper_path%%publisher_jar%" ( + SET jarlocation="%input_cache_path%%publisher_jar%" + SET jarlocationname=Input Cache + ECHO IG Publisher is not yet in input-cache or parent folder. + REM we don't use jarlocation below because it will be empty because we're in a bracketed if statement + GOTO create + ) ELSE ( + ECHO IG Publisher FOUND in parent folder + SET jarlocation="%upper_path%%publisher_jar%" + SET jarlocationname=Parent folder + GOTO upgrade + ) +) ELSE ( + ECHO IG Publisher FOUND in input-cache + SET jarlocation="%input_cache_path%%publisher_jar%" + SET jarlocationname=Input Cache + GOTO upgrade +) + +:create +IF DEFINED FORCE ( + MKDIR "%input_cache_path%" 2> NUL + GOTO download +) + +IF "%skipPrompts%"=="y" ( + SET create=Y +) ELSE ( + SET /p create="Download? (Y/N) " +) +IF /I "%create%"=="Y" ( + ECHO Will place publisher jar here: %input_cache_path%%publisher_jar% + MKDIR "%input_cache_path%" 2> NUL + GOTO download +) +GOTO done + +:upgrade +IF "%skipPrompts%"=="y" ( + SET overwrite=Y +) ELSE ( + SET /p overwrite="Overwrite %jarlocation%? (Y/N) " +) + +IF /I "%overwrite%"=="Y" ( + GOTO download +) +GOTO done + +:download +ECHO Downloading most recent publisher to %jarlocationname% - it's ~200 MB, so this may take a bit + +FOR /f "tokens=4-5 delims=. " %%i IN ('ver') DO SET VERSION=%%i.%%j +IF "%version%" == "10.0" GOTO win10 +IF "%version%" == "6.3" GOTO win8.1 +IF "%version%" == "6.2" GOTO win8 +IF "%version%" == "6.1" GOTO win7 +IF "%version%" == "6.0" GOTO vista + +ECHO Unrecognized version: %version% +GOTO done + +:win10 +CALL POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%dlurl%\",\"%jarlocation%\") } else { Invoke-WebRequest -Uri "%dlurl%" -Outfile "%jarlocation%" } + +GOTO done + +:win7 +rem this may be triggering the antivirus - bitsadmin.exe is a known threat +rem CALL bitsadmin /transfer GetPublisher /download /priority normal "%dlurl%" "%jarlocation%" + +rem this didn't work in win 10 +rem CALL Start-BitsTransfer /priority normal "%dlurl%" "%jarlocation%" + +rem this should work - untested +call (New-Object Net.WebClient).DownloadFile('%dlurl%', '%jarlocation%') +GOTO done + +:win8.1 +:win8 +:vista +GOTO done + + + +:done + + + + +ECHO. +ECHO Updating scripts +IF "%skipPrompts%"=="y" ( + SET updateScripts=Y +) ELSE ( + SET /p updateScripts="Update scripts? (Y/N) " +) +IF /I "%updateScripts%"=="Y" ( + GOTO scripts +) +GOTO end + + +:scripts + +REM Download all batch files (and this one with a new name) + +SETLOCAL DisableDelayedExpansion + + + +:dl_script_1 +ECHO Updating _build.sh +call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%build_sh_url%\",\"_build.new.sh\") } else { Invoke-WebRequest -Uri "%build_sh_url%" -Outfile "_build.new.sh" } +if %ERRORLEVEL% == 0 goto upd_script_1 +echo "Errors encountered during download: %errorlevel%" +goto dl_script_2 +:upd_script_1 +start copy /y "_build.new.sh" "_build.sh" ^&^& del "_build.new.sh" ^&^& exit + + +:dl_script_2 +ECHO Updating _build.bat +call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%build_bat_url%\",\"_build.new.bat\") } else { Invoke-WebRequest -Uri "%build_bat_url%" -Outfile "_build.new.bat" } +if %ERRORLEVEL% == 0 goto upd_script_2 +echo "Errors encountered during download: %errorlevel%" +goto end +:upd_script_2 +start copy /y "_build.new.bat" "_build.bat" ^&^& del "_build.new.bat" ^&^& exit + + +GOTO end + + +:publish_once + +SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 + +:: Debugging statements before running publisher +ECHO 1jar_location is: %jar_location% +IF NOT "%jar_location%"=="not_found" ( + java %JAVA_OPTS% -jar "%jar_location%" -ig . %txoption% %* +) ELSE ( + ECHO IG Publisher NOT FOUND in input-cache or parent folder. Please run _updatePublisher. Aborting... +) + +GOTO end + + + +:publish_nosushi + +SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 + +:: Debugging statements before running publisher +ECHO 3jar_location is: %jar_location% +IF NOT "%jar_location%"=="not_found" ( + java %JAVA_OPTS% -jar "%jar_location%" -ig . %txoption% -no-sushi %* +) ELSE ( + ECHO IG Publisher NOT FOUND in input-cache or parent folder. Please run _updatePublisher. Aborting... +) + +GOTO end + + +:publish_notx +SET txoption=-tx n/a + +SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 + +:: Debugging statements before running publisher +ECHO 2jar_location is: %jar_location% +IF NOT "%jar_location%"=="not_found" ( + java %JAVA_OPTS% -jar "%jar_location%" -ig . %txoption% %* +) ELSE ( + ECHO IG Publisher NOT FOUND in input-cache or parent folder. Please run _updatePublisher. Aborting... +) + +GOTO end + + + + +:publish_continuous + +SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 + +:: Debugging statements before running publisher +ECHO Checking %input_cache_path% for publisher.jar +IF EXIST "%input_cache_path%\%publisher_jar%" ( + java %JAVA_OPTS% -jar "%input_cache_path%\%publisher_jar%" -ig . %txoption% -watch %* +) ELSE ( + ECHO Checking %upper_path% for publisher.jar + IF EXIST "..\%publisher_jar%" ( + java %JAVA_OPTS% -jar "..\%publisher_jar%" -ig . %txoption% -watch %* + ) ELSE ( + ECHO IG Publisher NOT FOUND in input-cache or parent folder. Please run _updatePublisher. Aborting... + ) +) + +GOTO end + + +:end + +:: Pausing at the end + + +IF NOT "%skipPrompts%"=="true" ( + PAUSE +) diff --git a/_gencontinuous.sh b/_gencontinuous.sh index 970747668..b9ac5933d 100755 --- a/_gencontinuous.sh +++ b/_gencontinuous.sh @@ -1,2 +1,2 @@ -#!/bin/bash -./_genonce.sh -watch +#!/bin/bash +./_genonce.sh -watch diff --git a/_updatePublisher.sh b/_updatePublisher.sh index 56ec40435..6a97fe0bd 100755 --- a/_updatePublisher.sh +++ b/_updatePublisher.sh @@ -12,6 +12,8 @@ gencont_bat_url=$scriptdlroot/_gencontinuous.bat gencont_sh_url=$scriptdlroot/_gencontinuous.sh gen_sh_url=$scriptdlroot/_genonce.sh update_sh_url=$scriptdlroot/_updatePublisher.sh +build_sh_url=$scriptdlroot/_build.sh +build_bat_url=$scriptdlroot/_build.bat skipPrompts=false FORCE=false diff --git a/input/pagecontent/index.md b/input/pagecontent/index.md index 03385f1bf..afe9994e5 100644 --- a/input/pagecontent/index.md +++ b/input/pagecontent/index.md @@ -58,7 +58,7 @@ HL7 Denmark includes common Danish architectures and standards if relevant, when * Several basic resources such as Patient and Organization has an address. In dk-core these addresses use the [FHIR datatype](http://hl7.org/fhir/R4/datatypes.html#Address), which is very basic compared to the [Danish Address standard](https://arkitektur.digst.dk/adresse). However, addresses can be referred faithfully using the international standard e.g. Address.text can be mapped directly to the Danish 'adressebetegnelse'. If more details are needed than FHIR instances provide, the [Danish address registry](https://danmarksadresser.dk/om-adresser/danmarks-adresseregister-dar) can be used for look-up. ### International Aspects -This implementation guide is refining the FHIR standard itself as well as using and depending on the FHIR Standard [International Patient Access (IPA) specification](https://hl7.org/fhir/uv/ipa/). IPA aims to "to help patients access their data through patient-facing applications". While this is not the only scope of this implementation guide - it is part of the goal. IPA outlines a few minimum expectations that are required when exchanging data with patient facing apps. +This implementation guide is refining the FHIR standard itself as well as using and depending on the FHIR Standard [International Patient Access (IPA) specification](https://hl7.org/fhir/uv/ipa/). I PA aims "to help patients access their data through patient-facing applications". While this is not the only scope of this implementation guide - it is part of the goal. IPA outlines a few minimum expectations that are required when exchanging data with patient facing apps.