From 5ac027fadbd95c07887ab821964982e743d97fad Mon Sep 17 00:00:00 2001 From: florianschoffke Date: Fri, 18 Oct 2024 14:51:41 +0200 Subject: [PATCH] add script to build pdfs --- .gitignore | 1 + ...-Komplex-MULTI-1-Prescription-Request.json | 2 +- ...-1-Prescription-Request-To-Prescriber.json | 2 +- ...UC1-2-Fullfilled-Prescription-Request.json | 2 +- ...Delivery-Dispense-Request-To-Pharmacy.json | 2 +- ...le-UC1-3-Dispense-Request-To-Pharmacy.json | 2 +- ...ullfilled-DispenseRequest-To-Pharmacy.json | 2 +- ...ullfilled-DispenseRequest-To-Pharmacy.json | 2 +- ...-1-Prescription-Request-To-Prescriber.json | 2 +- ...LTI-2-Response-Prescription-Request-1.json | 2 +- ...LTI-2-Response-Prescription-Request-2.json | 2 +- .../Bundle-UC1-Rejection-Of-Prescriber.json | 2 +- ...ancellation-Of-Prescription-Requester.json | 2 +- ...-1-Prescription-Request-To-Prescriber.json | 2 +- ...UC2-2-Fullfilled-Prescription-Request.json | 2 +- ...escription-Request-To-Prescriber-COPY.json | 4 +- ...-1-Prescription-Request-To-Prescriber.json | 2 +- ...-Fullfilled-Prescription-Request-COPY.json | 4 +- ...UC3-2-Fullfilled-Prescription-Request.json | 2 +- ...on-and-Dispense-Request-To-Prescriber.json | 2 +- ...C4-2-Prescription-Request-To-Pharmacy.json | 2 +- ...Bundle-XSLT-Changed-Medication-Bundle.json | 2 +- ...dle-XSLT-Prior-Prescription-ID-Bundle.json | 2 +- .../Bundle-XSLT-Redeem-By-Patient-Bundle.json | 2 +- .../Bundle-XSLT-Request-MVO-Bundle.json | 2 +- .../resources/Bundle-XSLT-Urgent-Bundle.json | 2 +- ...Service-to-Practitioner-MessageHeader.json | 2 +- ...Service-to-Practitioner-MessageHeader.json | 2 +- ...Service-to-Practitioner-MessageHeader.json | 2 +- ...Service-to-Practitioner-MessageHeader.json | 2 +- .../input/fsh/examples/Misc/MessageHeader.fsh | 16 ++-- Resources/scripts/convert_to_pdf.py | 73 +++++++++++++++++++ ...ndle-XSLT-Prior-Prescription-ID-Bundle.xml | 2 +- .../xslt-stylesheets/rezeptanforderung.xsl | 29 ++++++-- 34 files changed, 138 insertions(+), 45 deletions(-) create mode 100644 Resources/scripts/convert_to_pdf.py diff --git a/.gitignore b/.gitignore index 8798c987..ff51e545 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ out/ project.yaml .simplifier/connection.settings.json .simplifier/project.snapshot.json +Resources/scripts/pdf_files \ No newline at end of file diff --git a/Resources/fsh-generated/resources/Bundle-Komplex-MULTI-1-Prescription-Request.json b/Resources/fsh-generated/resources/Bundle-Komplex-MULTI-1-Prescription-Request.json index bcf49406..83349a46 100644 --- a/Resources/fsh-generated/resources/Bundle-Komplex-MULTI-1-Prescription-Request.json +++ b/Resources/fsh-generated/resources/Bundle-Komplex-MULTI-1-Prescription-Request.json @@ -54,7 +54,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-1-Prescription-Request-To-Prescriber.json b/Resources/fsh-generated/resources/Bundle-UC1-1-Prescription-Request-To-Prescriber.json index ed364160..1fc2e4bd 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-1-Prescription-Request-To-Prescriber.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-1-Prescription-Request-To-Prescriber.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-2-Fullfilled-Prescription-Request.json b/Resources/fsh-generated/resources/Bundle-UC1-2-Fullfilled-Prescription-Request.json index ca32d66e..e3c3f7ae 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-2-Fullfilled-Prescription-Request.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-2-Fullfilled-Prescription-Request.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Pflegeheim Immergrün", - "endpoint": "healthcare-service@test.kim.de" + "endpoint": "mailto:healthcare-service@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-3-Alt-Delivery-Dispense-Request-To-Pharmacy.json b/Resources/fsh-generated/resources/Bundle-UC1-3-Alt-Delivery-Dispense-Request-To-Pharmacy.json index 11f5f921..8ee81fe4 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-3-Alt-Delivery-Dispense-Request-To-Pharmacy.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-3-Alt-Delivery-Dispense-Request-To-Pharmacy.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Test Apotheke", - "endpoint": "pharmacy@test.kim.de" + "endpoint": "mailto:pharmacy@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-3-Dispense-Request-To-Pharmacy.json b/Resources/fsh-generated/resources/Bundle-UC1-3-Dispense-Request-To-Pharmacy.json index e3298d2f..9888c8ba 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-3-Dispense-Request-To-Pharmacy.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-3-Dispense-Request-To-Pharmacy.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Test Apotheke", - "endpoint": "pharmacy@test.kim.de" + "endpoint": "mailto:pharmacy@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-4-Alt-Delivery-Fullfilled-DispenseRequest-To-Pharmacy.json b/Resources/fsh-generated/resources/Bundle-UC1-4-Alt-Delivery-Fullfilled-DispenseRequest-To-Pharmacy.json index 8a2add60..9cfd32ec 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-4-Alt-Delivery-Fullfilled-DispenseRequest-To-Pharmacy.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-4-Alt-Delivery-Fullfilled-DispenseRequest-To-Pharmacy.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Pflegeheim Immergrün", - "endpoint": "healthcare-service@test.kim.de" + "endpoint": "mailto:healthcare-service@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-4-Fullfilled-DispenseRequest-To-Pharmacy.json b/Resources/fsh-generated/resources/Bundle-UC1-4-Fullfilled-DispenseRequest-To-Pharmacy.json index 1cfe5783..feb9294a 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-4-Fullfilled-DispenseRequest-To-Pharmacy.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-4-Fullfilled-DispenseRequest-To-Pharmacy.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Pflegeheim Immergrün", - "endpoint": "healthcare-service@test.kim.de" + "endpoint": "mailto:healthcare-service@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-MULTI-1-Prescription-Request-To-Prescriber.json b/Resources/fsh-generated/resources/Bundle-UC1-MULTI-1-Prescription-Request-To-Prescriber.json index 8ef6cc97..d4d1582a 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-MULTI-1-Prescription-Request-To-Prescriber.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-MULTI-1-Prescription-Request-To-Prescriber.json @@ -51,7 +51,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-MULTI-2-Response-Prescription-Request-1.json b/Resources/fsh-generated/resources/Bundle-UC1-MULTI-2-Response-Prescription-Request-1.json index 69e3799c..194a20c4 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-MULTI-2-Response-Prescription-Request-1.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-MULTI-2-Response-Prescription-Request-1.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Pflegeheim Immergrün", - "endpoint": "healthcare-service@test.kim.de" + "endpoint": "mailto:healthcare-service@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-MULTI-2-Response-Prescription-Request-2.json b/Resources/fsh-generated/resources/Bundle-UC1-MULTI-2-Response-Prescription-Request-2.json index 71c6adb2..555bf018 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-MULTI-2-Response-Prescription-Request-2.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-MULTI-2-Response-Prescription-Request-2.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Pflegeheim Immergrün", - "endpoint": "healthcare-service@test.kim.de" + "endpoint": "mailto:healthcare-service@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-Rejection-Of-Prescriber.json b/Resources/fsh-generated/resources/Bundle-UC1-Rejection-Of-Prescriber.json index 34fc4341..50cf23e1 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-Rejection-Of-Prescriber.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-Rejection-Of-Prescriber.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC1-Storno-1-Cancellation-Of-Prescription-Requester.json b/Resources/fsh-generated/resources/Bundle-UC1-Storno-1-Cancellation-Of-Prescription-Requester.json index 1f0dc75b..3951b7f0 100644 --- a/Resources/fsh-generated/resources/Bundle-UC1-Storno-1-Cancellation-Of-Prescription-Requester.json +++ b/Resources/fsh-generated/resources/Bundle-UC1-Storno-1-Cancellation-Of-Prescription-Requester.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC2-1-Prescription-Request-To-Prescriber.json b/Resources/fsh-generated/resources/Bundle-UC2-1-Prescription-Request-To-Prescriber.json index 6e2ef9c8..b0402fd2 100644 --- a/Resources/fsh-generated/resources/Bundle-UC2-1-Prescription-Request-To-Prescriber.json +++ b/Resources/fsh-generated/resources/Bundle-UC2-1-Prescription-Request-To-Prescriber.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC2-2-Fullfilled-Prescription-Request.json b/Resources/fsh-generated/resources/Bundle-UC2-2-Fullfilled-Prescription-Request.json index 31d9df5a..c8a8be96 100644 --- a/Resources/fsh-generated/resources/Bundle-UC2-2-Fullfilled-Prescription-Request.json +++ b/Resources/fsh-generated/resources/Bundle-UC2-2-Fullfilled-Prescription-Request.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Pflegeheim Immergrün", - "endpoint": "healthcare-service@test.kim.de" + "endpoint": "mailto:healthcare-service@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC3-1-Prescription-Request-To-Prescriber-COPY.json b/Resources/fsh-generated/resources/Bundle-UC3-1-Prescription-Request-To-Prescriber-COPY.json index de110913..6f0ea61a 100644 --- a/Resources/fsh-generated/resources/Bundle-UC3-1-Prescription-Request-To-Prescriber-COPY.json +++ b/Resources/fsh-generated/resources/Bundle-UC3-1-Prescription-Request-To-Prescriber-COPY.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Pflegeheim Immergrün", - "endpoint": "healthcare-service@test.kim.de" + "endpoint": "mailto:healthcare-service@test.kim.de" } ], "eventCoding": { @@ -112,7 +112,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC3-1-Prescription-Request-To-Prescriber.json b/Resources/fsh-generated/resources/Bundle-UC3-1-Prescription-Request-To-Prescriber.json index 787d964c..3b53e0ad 100644 --- a/Resources/fsh-generated/resources/Bundle-UC3-1-Prescription-Request-To-Prescriber.json +++ b/Resources/fsh-generated/resources/Bundle-UC3-1-Prescription-Request-To-Prescriber.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC3-2-Fullfilled-Prescription-Request-COPY.json b/Resources/fsh-generated/resources/Bundle-UC3-2-Fullfilled-Prescription-Request-COPY.json index be12acef..1230f7f6 100644 --- a/Resources/fsh-generated/resources/Bundle-UC3-2-Fullfilled-Prescription-Request-COPY.json +++ b/Resources/fsh-generated/resources/Bundle-UC3-2-Fullfilled-Prescription-Request-COPY.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Pflegeheim Immergrün", - "endpoint": "healthcare-service@test.kim.de" + "endpoint": "mailto:healthcare-service@test.kim.de" } ], "eventCoding": { @@ -112,7 +112,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC3-2-Fullfilled-Prescription-Request.json b/Resources/fsh-generated/resources/Bundle-UC3-2-Fullfilled-Prescription-Request.json index e340f905..cbf8d615 100644 --- a/Resources/fsh-generated/resources/Bundle-UC3-2-Fullfilled-Prescription-Request.json +++ b/Resources/fsh-generated/resources/Bundle-UC3-2-Fullfilled-Prescription-Request.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC4-1-Prescription-and-Dispense-Request-To-Prescriber.json b/Resources/fsh-generated/resources/Bundle-UC4-1-Prescription-and-Dispense-Request-To-Prescriber.json index 38e47a5e..7d2b17f9 100644 --- a/Resources/fsh-generated/resources/Bundle-UC4-1-Prescription-and-Dispense-Request-To-Prescriber.json +++ b/Resources/fsh-generated/resources/Bundle-UC4-1-Prescription-and-Dispense-Request-To-Prescriber.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-UC4-2-Prescription-Request-To-Pharmacy.json b/Resources/fsh-generated/resources/Bundle-UC4-2-Prescription-Request-To-Pharmacy.json index 19334556..a4c33565 100644 --- a/Resources/fsh-generated/resources/Bundle-UC4-2-Prescription-Request-To-Pharmacy.json +++ b/Resources/fsh-generated/resources/Bundle-UC4-2-Prescription-Request-To-Pharmacy.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Test Apotheke", - "endpoint": "pharmacy@test.kim.dee" + "endpoint": "mailto:pharmacy@test.kim.dee" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-XSLT-Changed-Medication-Bundle.json b/Resources/fsh-generated/resources/Bundle-XSLT-Changed-Medication-Bundle.json index 4234b2cb..f2c6ea37 100644 --- a/Resources/fsh-generated/resources/Bundle-XSLT-Changed-Medication-Bundle.json +++ b/Resources/fsh-generated/resources/Bundle-XSLT-Changed-Medication-Bundle.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Pflegeheim Immergrün", - "endpoint": "healthcare-service@test.kim.de" + "endpoint": "mailto:healthcare-service@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-XSLT-Prior-Prescription-ID-Bundle.json b/Resources/fsh-generated/resources/Bundle-XSLT-Prior-Prescription-ID-Bundle.json index d8a608b3..37dea4b9 100644 --- a/Resources/fsh-generated/resources/Bundle-XSLT-Prior-Prescription-ID-Bundle.json +++ b/Resources/fsh-generated/resources/Bundle-XSLT-Prior-Prescription-ID-Bundle.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-XSLT-Redeem-By-Patient-Bundle.json b/Resources/fsh-generated/resources/Bundle-XSLT-Redeem-By-Patient-Bundle.json index 3251d9a4..f214d93b 100644 --- a/Resources/fsh-generated/resources/Bundle-XSLT-Redeem-By-Patient-Bundle.json +++ b/Resources/fsh-generated/resources/Bundle-XSLT-Redeem-By-Patient-Bundle.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-XSLT-Request-MVO-Bundle.json b/Resources/fsh-generated/resources/Bundle-XSLT-Request-MVO-Bundle.json index 466c5ab3..f5250c05 100644 --- a/Resources/fsh-generated/resources/Bundle-XSLT-Request-MVO-Bundle.json +++ b/Resources/fsh-generated/resources/Bundle-XSLT-Request-MVO-Bundle.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/Bundle-XSLT-Urgent-Bundle.json b/Resources/fsh-generated/resources/Bundle-XSLT-Urgent-Bundle.json index 82e5dfe7..21bc43a0 100644 --- a/Resources/fsh-generated/resources/Bundle-XSLT-Urgent-Bundle.json +++ b/Resources/fsh-generated/resources/Bundle-XSLT-Urgent-Bundle.json @@ -48,7 +48,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/MessageHeader-Komplex-MULTI-HealthCareService-to-Practitioner-MessageHeader.json b/Resources/fsh-generated/resources/MessageHeader-Komplex-MULTI-HealthCareService-to-Practitioner-MessageHeader.json index e35c8a0b..e6f23293 100644 --- a/Resources/fsh-generated/resources/MessageHeader-Komplex-MULTI-HealthCareService-to-Practitioner-MessageHeader.json +++ b/Resources/fsh-generated/resources/MessageHeader-Komplex-MULTI-HealthCareService-to-Practitioner-MessageHeader.json @@ -37,7 +37,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/MessageHeader-UC1-HealthCareService-to-Practitioner-MessageHeader.json b/Resources/fsh-generated/resources/MessageHeader-UC1-HealthCareService-to-Practitioner-MessageHeader.json index 91063beb..d81db489 100644 --- a/Resources/fsh-generated/resources/MessageHeader-UC1-HealthCareService-to-Practitioner-MessageHeader.json +++ b/Resources/fsh-generated/resources/MessageHeader-UC1-HealthCareService-to-Practitioner-MessageHeader.json @@ -31,7 +31,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/MessageHeader-UC1-MULTI-HealthCareService-to-Practitioner-MessageHeader.json b/Resources/fsh-generated/resources/MessageHeader-UC1-MULTI-HealthCareService-to-Practitioner-MessageHeader.json index b193087f..3bd0ea88 100644 --- a/Resources/fsh-generated/resources/MessageHeader-UC1-MULTI-HealthCareService-to-Practitioner-MessageHeader.json +++ b/Resources/fsh-generated/resources/MessageHeader-UC1-MULTI-HealthCareService-to-Practitioner-MessageHeader.json @@ -34,7 +34,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/fsh-generated/resources/MessageHeader-UC2-HealthCareService-to-Practitioner-MessageHeader.json b/Resources/fsh-generated/resources/MessageHeader-UC2-HealthCareService-to-Practitioner-MessageHeader.json index ad5b0327..4e02be5d 100644 --- a/Resources/fsh-generated/resources/MessageHeader-UC2-HealthCareService-to-Practitioner-MessageHeader.json +++ b/Resources/fsh-generated/resources/MessageHeader-UC2-HealthCareService-to-Practitioner-MessageHeader.json @@ -31,7 +31,7 @@ "destination": [ { "name": "Praxis Hans Topp-Glücklich", - "endpoint": "practitioner@test.kim.de" + "endpoint": "mailto:practitioner@test.kim.de" } ], "eventCoding": { diff --git a/Resources/input/fsh/examples/Misc/MessageHeader.fsh b/Resources/input/fsh/examples/Misc/MessageHeader.fsh index c816818f..a0de42a9 100644 --- a/Resources/input/fsh/examples/Misc/MessageHeader.fsh +++ b/Resources/input/fsh/examples/Misc/MessageHeader.fsh @@ -4,7 +4,7 @@ RuleSet: HealthCareService-to-Practitioner(SR) * sender.identifier = Pflegeheim-Immergrün-Identifier * sender.display = "Pflegeheim Immergrün" * destination.name = "Praxis Hans Topp-Glücklich" -* destination.endpoint = "practitioner@test.kim.de" +* destination.endpoint = "mailto:practitioner@test.kim.de" * source.name = "HealthCare-Source" * source.software = "HealthCare-Software" * source.version = "1.0.0" @@ -23,7 +23,7 @@ RuleSet: Practitioner-to-HealthCareService(SR) * source.contact.value = "info@pvs_solutions.email" * source.endpoint = "https://pvs_solutions.com/jira_helpdesk" * destination.name = "Pflegeheim Immergrün" -* destination.endpoint = "healthcare-service@test.kim.de" +* destination.endpoint = "mailto:healthcare-service@test.kim.de" RuleSet: HealthCareService-to-Pharmacy(SR) * focus[0] = Reference(ServiceRequest/{SR}) @@ -36,7 +36,7 @@ RuleSet: HealthCareService-to-Pharmacy(SR) * source.contact.value = "info@healthcare_ps_solutions.com" * source.endpoint = "https://healthcare_ps_solutions.com/jira_helpdesk" * destination.name = "Test Apotheke" -* destination.endpoint = "pharmacy@test.kim.de" +* destination.endpoint = "mailto:pharmacy@test.kim.de" RuleSet: Pharmacy-to-HealthCareService(SR) * focus[0] = Reference(ServiceRequest/{SR}) @@ -49,7 +49,7 @@ RuleSet: Pharmacy-to-HealthCareService(SR) * source.contact.value = "info@avs_solutions.com" * source.endpoint = "https://avs_solutions.com/jira_helpdesk" * destination.name = "Pflegeheim Immergrün" -* destination.endpoint = "healthcare-service@test.kim.de" +* destination.endpoint = "mailto:healthcare-service@test.kim.de" RuleSet: Pharmacy-to-Practitioner(SR) * focus[0] = Reference(ServiceRequest/{SR}) @@ -62,7 +62,7 @@ RuleSet: Pharmacy-to-Practitioner(SR) * source.contact.value = "info@avs_solutions.com" * source.endpoint = "https://avs_solutions.com/jira_helpdesk" * destination.name = "Praxis Hans Topp-Glücklich" -* destination.endpoint = "practitioner@test.kim.de" +* destination.endpoint = "mailto:practitioner@test.kim.de" RuleSet: Practitioner-to-Pharmacy(SR) * focus[0] = Reference(ServiceRequest/{SR}) @@ -75,7 +75,7 @@ RuleSet: Practitioner-to-Pharmacy(SR) * source.contact.value = "info@pvs_solutions.email" * source.endpoint = "https://pvs_solutions.com/jira_helpdesk" * destination.name = "Test Apotheke" -* destination.endpoint = "pharmacy@test.kim.dee" +* destination.endpoint = "mailto:pharmacy@test.kim.dee" RuleSet: Pharmacy1-to-Pharmacy2(SR) * focus[0] = Reference(ServiceRequest/{SR}) @@ -88,7 +88,7 @@ RuleSet: Pharmacy1-to-Pharmacy2(SR) * source.contact.value = "info@avs_solutions.com" * source.endpoint = "https://avs_solutions.com/jira_helpdesk" * destination.name = "Test Apotheke 2" -* destination.endpoint = "pharamacy_2@test.kim.de" +* destination.endpoint = "mailto:pharamacy_2@test.kim.de" RuleSet: Pharmacy2-to-Pharmacy1(SR) * focus[0] = Reference(ServiceRequest/{SR}) @@ -102,5 +102,5 @@ RuleSet: Pharmacy2-to-Pharmacy1(SR) * source.contact.value = "info@avs_solutions-2.com" * source.endpoint = "https://avs_solutions-2.com/jira_helpdesk" * destination.name = "Test Apotheke-2" -* destination.endpoint = "pharmacy@test.kim.de" +* destination.endpoint = "mailto:pharmacy@test.kim.de" diff --git a/Resources/scripts/convert_to_pdf.py b/Resources/scripts/convert_to_pdf.py new file mode 100644 index 00000000..9e8fe499 --- /dev/null +++ b/Resources/scripts/convert_to_pdf.py @@ -0,0 +1,73 @@ +import os +import json +from lxml import etree +import pdfkit +from fhir.resources.R4B.bundle import Bundle + +# Set the locations relative to the script +SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) +INPUT_FOLDER = os.path.join(SCRIPT_DIR, '../fsh-generated/resources') +OUTPUT_FOLDER = os.path.join(SCRIPT_DIR, './pdf_files') +XSLT_FILE = os.path.join(SCRIPT_DIR, '../xslt-stylesheets/rezeptanforderung.xsl') + +# Delete the output folder if it exists, then recreate it +if os.path.exists(OUTPUT_FOLDER): + for filename in os.listdir(OUTPUT_FOLDER): + file_path = os.path.join(OUTPUT_FOLDER, filename) + if os.path.isfile(file_path): + os.unlink(file_path) + elif os.path.isdir(file_path): + os.rmdir(file_path) +else: + os.makedirs(OUTPUT_FOLDER) + +# Ensure the output folder exists +os.makedirs(OUTPUT_FOLDER, exist_ok=True) + +# Function to convert JSON to XML using FHIR library +def json_to_xml_fhir(json_content): + bundle = Bundle(**json_content) # Create a Bundle resource from JSON content + xml_content = bundle.xml() # Convert the Bundle to XML + return xml_content + +# Function to apply XSLT to XML +def transform_xml_with_xslt(xml_content, xslt_file): + xslt = etree.parse(xslt_file) + transform = etree.XSLT(xslt) + xml_tree = etree.fromstring(xml_content.encode('utf-8')) + html_tree = transform(xml_tree) + return str(html_tree) + +# Main script to process files +def process_fhir_files(): + for filename in os.listdir(INPUT_FOLDER): + if filename.endswith('.json'): + input_filepath = os.path.join(INPUT_FOLDER, filename) + base_filename = os.path.splitext(filename)[0] + + # Step 1: Convert JSON to XML using FHIR library + with open(input_filepath, 'r') as f: + json_content = json.load(f) + if json_content.get('resourceType') == 'Bundle': + xml_content = json_to_xml_fhir(json_content) + else: + print(f'Skipping {filename}: Not a Bundle resource') + continue + + # Step 2: Transform XML with XSLT to HTML + html_content = transform_xml_with_xslt(xml_content, XSLT_FILE) + html_filepath = os.path.join(OUTPUT_FOLDER, f'{base_filename}.html') + with open(html_filepath, 'w') as f: + f.write(html_content) + + # Step 3: Convert HTML to PDF using xhtml2pdf + pdf_filepath = os.path.join(OUTPUT_FOLDER, f'{base_filename}.pdf') + pdfkit.from_string(html_content, pdf_filepath) + + # Optionally, remove the intermediate HTML file + os.remove(html_filepath) + + print(f'Processed {filename} -> {base_filename}.pdf') + +if __name__ == "__main__": + process_fhir_files() diff --git a/Resources/xslt-stylesheets/TestFiles/1_Rezeptanforderung/Bundle-XSLT-Prior-Prescription-ID-Bundle.xml b/Resources/xslt-stylesheets/TestFiles/1_Rezeptanforderung/Bundle-XSLT-Prior-Prescription-ID-Bundle.xml index 38793b67..ca07ff46 100644 --- a/Resources/xslt-stylesheets/TestFiles/1_Rezeptanforderung/Bundle-XSLT-Prior-Prescription-ID-Bundle.xml +++ b/Resources/xslt-stylesheets/TestFiles/1_Rezeptanforderung/Bundle-XSLT-Prior-Prescription-ID-Bundle.xml @@ -89,7 +89,7 @@ - + diff --git a/Resources/xslt-stylesheets/rezeptanforderung.xsl b/Resources/xslt-stylesheets/rezeptanforderung.xsl index 5a3fc176..b8005b84 100644 --- a/Resources/xslt-stylesheets/rezeptanforderung.xsl +++ b/Resources/xslt-stylesheets/rezeptanforderung.xsl @@ -30,7 +30,7 @@ FHIR Message Bundle -