diff --git a/.github/workflows/RenderAllDiagrams.yml b/.github/workflows/RenderAllDiagrams.yml index 7a7cdae..e57a510 100644 --- a/.github/workflows/RenderAllDiagrams.yml +++ b/.github/workflows/RenderAllDiagrams.yml @@ -3,8 +3,8 @@ name: Render All Diagrams on: push: paths: - - '**/Material/imgsrc/**/*.puml' - - '**/Material/imgsrc/**/*.drawio' + - '**/Material/images/src/**/*.puml' + - '**/Material/images/src/**/*.drawio' branches-ignore: - 'main**' @@ -41,36 +41,41 @@ jobs: # Clean Folder - name: Ensure and clean folder run: | - img_dir=ImplementationGuide/images/diagrams + img_dir=Material/images/diagrams mkdir -p $img_dir - rm -rf ImplementationGuide/images/diagrams/*.svg + rm -rf Material/images/diagrams/*.svg # Generate the SVGs from PUML - name: Render PUML to SVG and Move files run: | - FileNamePaths=$(find . -path "*/imgsrc/*/*.puml" -exec dirname {} \; | sort -u) + FileNamePaths=$(find . -path "*/images/src/*/*.puml" -exec dirname {} \; | sort -u) for dir in $FileNamePaths do # Render SVGs from PUMLs find $dir -name "*.puml" -exec java -jar plantuml.jar -tsvg {} \; done + + # Remove plantUML jar + - name: remove plantuml file + run: | + rm -f plantuml.jar # Generate the SVGs from DrawIO - name: Render DrawIO to SVG with predefined action uses: rlespinasse/drawio-export-action@v2 with: - path: ./Material/imgsrc/drawio/ + path: ./Material/images/src/drawio/ remove-page-suffix: true output: . format: svg action-mode: all - # copies the created png & svg files to the images/diagrams folder and deletes the drawio files + # copies the created svg files to the images/diagrams folder and deletes the drawio files - name: Move SVGs to target image folder run: | - img_dir=ImplementationGuide/images/diagrams - # Find all unique directories containing *.svg files under any /imgsrc/ folder - FileNamePaths=$(find . -path "*/imgsrc/*/*.svg" -exec dirname {} \; | sort -u) + img_dir=Material/images/diagrams + # Find all unique directories containing *.SVG files under any /imgsrc/ folder + FileNamePaths=$(find . -path "*/images/src/*/*.svg" -exec dirname {} \; | sort -u) for dir in $FileNamePaths do # Move SVGs to out directory diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a3062be --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode/* diff --git a/ImplementationGuide/images/Interaktionen.png b/ImplementationGuide/images/Interaktionen.png deleted file mode 100644 index 734fd43..0000000 Binary files a/ImplementationGuide/images/Interaktionen.png and /dev/null differ diff --git a/ImplementationGuide/images/Klassendiagramm.png b/ImplementationGuide/images/Klassendiagramm.png deleted file mode 100644 index e061da9..0000000 Binary files a/ImplementationGuide/images/Klassendiagramm.png and /dev/null differ diff --git a/ImplementationGuide/markdown/AkteureUndInteraktionen.md b/ImplementationGuide/markdown/AkteureUndInteraktionen.md index 4dd6cc3..77b8d9c 100644 --- a/ImplementationGuide/markdown/AkteureUndInteraktionen.md +++ b/ImplementationGuide/markdown/AkteureUndInteraktionen.md @@ -15,5 +15,4 @@ Für jeden dieser Bereiche wurden jeweils drei Akteure identifiziert, die in ein * **Consumer:** Liest die Informationen aus dem Repository, beispielsweise um sie dem Benutzer anzuzeigen oder anderweitig zu verarbeiten. Die Interaktionen sind somit in allen drei Bereichen äquivalent: - -{{render:implementationguide-images-interaktionen}} + \ No newline at end of file diff --git a/ImplementationGuide/markdown/Datenobjekte.md b/ImplementationGuide/markdown/Datenobjekte.md index c359862..2e471c5 100644 --- a/ImplementationGuide/markdown/Datenobjekte.md +++ b/ImplementationGuide/markdown/Datenobjekte.md @@ -1,14 +1,17 @@ # Datenobjekte -Folgende Datenobjekte und Interaktionen aus dem Modul [ISiK Basis Stufe 3](https://simplifier.net/guide/Implementierungsleitfaden-ISiK-Basismodul-Stufe-3/ImplementationGuide-markdown-Einfuehrung?version=current) sind in diesem Modul bestätigungsrelevant: +Folgende Datenobjekte aus dem Modul [ISiK Basis Stufe 3](https://simplifier.net/guide/implementierungsleitfaden-isik-basismodul-stufe-3?version=current) werden in diesem Modul verwendet: * [Patient](https://simplifier.net/guide/Implementierungsleitfaden-ISiK-Basismodul-Stufe-3/ImplementationGuide-markdown-Datenobjekte-Datenobjekte-Patient?version=current) * [Kontakt/Fall (Encounter)](https://simplifier.net/guide/Implementierungsleitfaden-ISiK-Basismodul-Stufe-3/ImplementationGuide-markdown-Datenobjekte-Datenobjekte-Kontakt?version=current) * [Person im Gesundheitsberuf](https://simplifier.net/guide/Implementierungsleitfaden-ISiK-Basismodul-Stufe-3/markdown-Datenobjekte-Datenobjekte-PersonImGesundheitsberuf?version=current) +Die Verwendung in diesem Modul bedeutet: +Wenn dieses Modul auf Datenobjekte aus dem Basismodul referenziert, dann MÜSSEN die referenzierten FHIR-Ressourcen konform zu den Vorgaben aus dem Basismodul sein. +Die Referenzierung von im Basismodul spezifizierten Datenobjekten, bedeutet nicht, dass die Interaktionen für die entsprechenden Datenobjekte aus dem Basismodul auch im Modul Medikation bestätigungsrelevant sind. + Darüber hinaus gelten in diesem Modul folgende Datenobjekt-spezifische Festlegungen: {{index:current}} Die Kern-Zusammenhänge der Datenobjekte zeigt das (stark vereinfacht dargestellte) Diagramm: - -{{render:implementationguide-images-klassendiagramm}} + diff --git a/ImplementationGuide/markdown/Datenobjekte_MedikationsVerabreichung.pdf b/ImplementationGuide/markdown/Datenobjekte_MedikationsVerabreichung.pdf deleted file mode 100644 index f948dfa..0000000 Binary files a/ImplementationGuide/markdown/Datenobjekte_MedikationsVerabreichung.pdf and /dev/null differ diff --git a/ImplementationGuide/markdown/Einfuehrung.md b/ImplementationGuide/markdown/Einfuehrung.md index a649d55..3d5d9fc 100644 --- a/ImplementationGuide/markdown/Einfuehrung.md +++ b/ImplementationGuide/markdown/Einfuehrung.md @@ -1,9 +1,9 @@ - + ---- -Version: 3.0.0 +Version: 3.0.1 -Datum: 1.7.2023 +Datum: 12.01.2024 Status: Aktiv diff --git a/ImplementationGuide/markdown/ReleaseNotes.md b/ImplementationGuide/markdown/ReleaseNotes.md index 96ea9ce..1e23ed8 100644 --- a/ImplementationGuide/markdown/ReleaseNotes.md +++ b/ImplementationGuide/markdown/ReleaseNotes.md @@ -4,6 +4,12 @@ Im Rahmen der ISiK-Veröffentlichungen wird das [Semantic Versioning](https://se Die erste Ziffer X bezeichnet ein Major-Release und regelt die Gültigkeit von Releases. Die dritte Ziffer Y (Release x.0.y) bezeichnet eine technische Korrektur und versioniert kleinere Änderungen (Packages) während eines Jahres, z. B. 1.0.1. +Version: 3.0.1 + +Datum: 08.01.2024 + +* Update dependency with Basis: https://github.com/gematik/spec-ISiK-Medikation/pull/102/commits/039654b03d5b159ed258c35b48c37cd2db3e4a81 +* update sentence on ISIKBasis Ressource usage by @f-peverali in https://github.com/gematik/spec-ISiK-Medikation/pull/103 ---- Version: 3.0.0 diff --git a/ImplementationGuide/markdown/UebergreifendeFestlegungen.md b/ImplementationGuide/markdown/UebergreifendeFestlegungen/UebergreifendeFestlegungen.md similarity index 100% rename from ImplementationGuide/markdown/UebergreifendeFestlegungen.md rename to ImplementationGuide/markdown/UebergreifendeFestlegungen/UebergreifendeFestlegungen.md diff --git a/Material/docs/Medikation Abgleich bestehende Spezifikationen.xlsx b/Material/docs/Medikation Abgleich bestehende Spezifikationen.xlsx new file mode 100644 index 0000000..8d7eb95 Binary files /dev/null and b/Material/docs/Medikation Abgleich bestehende Spezifikationen.xlsx differ diff --git a/Material/images/Gematik_Logo_Flag.svg b/Material/images/Gematik_Logo_Flag.svg new file mode 100644 index 0000000..2097670 --- /dev/null +++ b/Material/images/Gematik_Logo_Flag.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Material/images/diagrams/Interaktionen.svg b/Material/images/diagrams/Interaktionen.svg new file mode 100644 index 0000000..51a7321 --- /dev/null +++ b/Material/images/diagrams/Interaktionen.svg @@ -0,0 +1,3 @@ + + +X RepositoryX RepositoryX ProviderX ProviderX ConsumerX ConsumerX ∈{"Medication Summary", "Medication Order", "Administered Medication"}X ∈...Text is not SVG - cannot display \ No newline at end of file diff --git a/Material/images/diagrams/Klassendiagramm.svg b/Material/images/diagrams/Klassendiagramm.svg new file mode 100644 index 0000000..46c555c --- /dev/null +++ b/Material/images/diagrams/Klassendiagramm.svg @@ -0,0 +1,3 @@ + + +Medikations-Liste.........Patient......Medikament.........0..*1..*enthältenthältMedikations-Information......0..*1bezieht sich aufbezieht sich aufMedikations-Verordnung......Medikations-Verabreichung......0..*1bezieht sich aufbezieht sich auf0..*1bezieht sich aufbezieht sich auf0..*1gilt fürgilt für0..*1gilt fürgilt für0..*1gilt fürgilt für0..*1gilt fürgilt fürWeitere Datenobjekte (z.B. Organisationen, Fachpersonen, Aufenthalte) sind hier zur besseren Übersichtlichkeit nicht dargestellt.Weitere Datenobjekte (z.B. Organisationen, Fachpersonen, Aufenthalte) sind hier zur besseren Übersichtlichkeit nicht dargeste...Text is not SVG - cannot display \ No newline at end of file diff --git a/Material/images/src/drawio/Interaktionen.drawio b/Material/images/src/drawio/Interaktionen.drawio new file mode 100644 index 0000000..c222f30 --- /dev/null +++ b/Material/images/src/drawio/Interaktionen.drawio @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Material/imgsrc/drawio/Klassendiagramm.drawio b/Material/images/src/drawio/Klassendiagramm.drawio similarity index 100% rename from Material/imgsrc/drawio/Klassendiagramm.drawio rename to Material/images/src/drawio/Klassendiagramm.drawio diff --git a/README.md b/README.md index dc318d1..9dbb474 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ -# ISiK-Medikation +# Feature AMTS von ISiK-Medikation Stufe 4 -Siehe [Simplifier Projekt-Seite zu Medikation Stufe 3](https://simplifier.net/isik-medikation-v3) +Dies ist ein Branch rund um das Thema Arzneimitteltherapiesicherheit (AMTS). + +Ein Konzept zur Definition des Problems, der Use Cases und des Lösungsraums + (WIP) wird unter [AMTS](ImplementationGuide/markdown/UebergreifendeFestlegungen/AMTS.md) veröffentlicht und weiterentwickelt. diff --git a/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationInformation.json b/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationInformation.json index bb45657..4ef37c4 100644 --- a/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationInformation.json +++ b/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationInformation.json @@ -4,11 +4,11 @@ "url": "https://gematik.de/fhir/isik/v3/Medikation/CapabilityStatement/medikation-server/information", "status": "active", "experimental": false, - "version": "3.0.0", + "version": "3.0.1", "publisher": "gematik GmbH", - "date": "2023-07-01", + "date": "2024-01-12", "implementationGuide": [ - "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.0" + "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.1" ], "name": "ISiKCapabilityStatementMedikationInformation", "title": "ISiK CapabilityStatement Medikation Server - Medikationsinformation", diff --git a/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationVerabreichung.json b/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationVerabreichung.json index 7554561..35a5e74 100644 --- a/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationVerabreichung.json +++ b/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationVerabreichung.json @@ -4,11 +4,11 @@ "url": "https://gematik.de/fhir/isik/v3/Medikation/CapabilityStatement/medikation-server/verabreichung", "status": "active", "experimental": false, - "version": "3.0.0", + "version": "3.0.1", "publisher": "gematik GmbH", - "date": "2023-07-01", + "date": "2024-01-12", "implementationGuide": [ - "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.0" + "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.1" ], "name": "ISiKCapabilityStatementMedikationVerabreichung", "title": "ISiK CapabilityStatement Medikation Server - Medikationsverabreichung", diff --git a/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationVerordnung.json b/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationVerordnung.json index 3cc42b3..2f949c8 100644 --- a/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationVerordnung.json +++ b/Resources/fsh-generated/resources/CapabilityStatement-ISiKCapabilityStatementMedikationVerordnung.json @@ -4,11 +4,11 @@ "url": "https://gematik.de/fhir/isik/v3/Medikation/CapabilityStatement/medikation-server/verordnung", "status": "active", "experimental": false, - "version": "3.0.0", + "version": "3.0.1", "publisher": "gematik GmbH", - "date": "2023-07-01", + "date": "2024-01-12", "implementationGuide": [ - "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.0" + "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.1" ], "name": "ISiKCapabilityStatementMedikationVerordnung", "title": "ISiK CapabilityStatement Medikation Server - Medikationsverordnung", diff --git a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikament.json b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikament.json index 5fbe4e7..87257e6 100644 --- a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikament.json +++ b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikament.json @@ -2,11 +2,11 @@ "resourceType": "StructureDefinition", "id": "ISiKMedikament", "url": "https://gematik.de/fhir/isik/v3/Medikation/StructureDefinition/ISiKMedikament", - "version": "3.0.0", + "version": "3.0.1", "name": "ISiKMedikament", "status": "active", "experimental": false, - "date": "2023-07-01", + "date": "2024-01-12", "publisher": "gematik GmbH", "description": "Dieses Profil ermöglicht die Abbildung von patientenunabhängigen Informationen zu Medikamenten in ISiK Szenarien.", "fhirVersion": "4.0.1", diff --git a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationTransaction.json b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationTransaction.json index df807e0..620a2f2 100644 --- a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationTransaction.json +++ b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationTransaction.json @@ -2,11 +2,11 @@ "resourceType": "StructureDefinition", "id": "ISiKMedikationTransaction", "url": "https://gematik.de/fhir/isik/v3/Medikation/StructureDefinition/ISiKMedikationTransaction", - "version": "3.0.0", + "version": "3.0.1", "name": "ISiKMedikationTransaction", "status": "active", "experimental": false, - "date": "2023-07-01", + "date": "2024-01-12", "publisher": "gematik GmbH", "description": "Dieses Profil definiert die Transaktions-Bundles im Rahmen von ISiK-Medikations-Szenarien.", "fhirVersion": "4.0.1", diff --git a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationTransactionResponse.json b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationTransactionResponse.json index b4d1b8d..37c2aa0 100644 --- a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationTransactionResponse.json +++ b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationTransactionResponse.json @@ -2,11 +2,11 @@ "resourceType": "StructureDefinition", "id": "ISiKMedikationTransactionResponse", "url": "https://gematik.de/fhir/isik/v3/Medikation/StructureDefinition/ISiKMedikationTransactionResponse", - "version": "3.0.0", + "version": "3.0.1", "name": "ISiKMedikationTransactionResponse", "status": "active", "experimental": false, - "date": "2023-07-01", + "date": "2024-01-12", "publisher": "gematik GmbH", "description": "Dieses Profil definiert die Server-Antwort auf Transaktions-Bundles im Rahmen von ISiK-Medikations-Szenarien.", "fhirVersion": "4.0.1", diff --git a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsInformation.json b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsInformation.json index 0614791..ef12822 100644 --- a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsInformation.json +++ b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsInformation.json @@ -2,11 +2,11 @@ "resourceType": "StructureDefinition", "id": "ISiKMedikationsInformation", "url": "https://gematik.de/fhir/isik/v3/Medikation/StructureDefinition/ISiKMedikationsInformation", - "version": "3.0.0", + "version": "3.0.1", "name": "ISiKMedikationsInformation", "status": "active", "experimental": false, - "date": "2023-07-01", + "date": "2024-01-12", "publisher": "gematik GmbH", "description": "Dieses Profil ermöglicht die Abbildung von Informationen zur Medikation eines Patienten in ISiK Szenarien.", "fhirVersion": "4.0.1", diff --git a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsListe.json b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsListe.json index 3875469..b4aa026 100644 --- a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsListe.json +++ b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsListe.json @@ -2,11 +2,11 @@ "resourceType": "StructureDefinition", "id": "ISiKMedikationsListe", "url": "https://gematik.de/fhir/isik/v3/Medikation/StructureDefinition/ISiKMedikationsListe", - "version": "3.0.0", + "version": "3.0.1", "name": "ISiKMedikationsListe", "status": "active", "experimental": false, - "date": "2023-07-01", + "date": "2024-01-12", "publisher": "gematik GmbH", "description": "Dieses Profil ermöglicht die Zusammenführung einzelner MedikationsInformationen eines Patienten in ISiK Szenarien.", "fhirVersion": "4.0.1", diff --git a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsVerabreichung.json b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsVerabreichung.json index 23586b8..9ede882 100644 --- a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsVerabreichung.json +++ b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsVerabreichung.json @@ -2,11 +2,11 @@ "resourceType": "StructureDefinition", "id": "ISiKMedikationsVerabreichung", "url": "https://gematik.de/fhir/isik/v3/Medikation/StructureDefinition/ISiKMedikationsVerabreichung", - "version": "3.0.0", + "version": "3.0.1", "name": "ISiKMedikationsVerabreichung", "status": "active", "experimental": false, - "date": "2023-07-01", + "date": "2024-01-12", "publisher": "gematik GmbH", "description": "Dieses Profil ermöglicht die Abbildung der Verabreichung von Medikamenten für einen Patienten in ISiK Szenarien.", "fhirVersion": "4.0.1", diff --git a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsVerordnung.json b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsVerordnung.json index b4212ed..2560a9e 100644 --- a/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsVerordnung.json +++ b/Resources/fsh-generated/resources/StructureDefinition-ISiKMedikationsVerordnung.json @@ -2,11 +2,11 @@ "resourceType": "StructureDefinition", "id": "ISiKMedikationsVerordnung", "url": "https://gematik.de/fhir/isik/v3/Medikation/StructureDefinition/ISiKMedikationsVerordnung", - "version": "3.0.0", + "version": "3.0.1", "name": "ISiKMedikationsVerordnung", "status": "active", "experimental": false, - "date": "2023-07-01", + "date": "2024-01-12", "publisher": "gematik GmbH", "description": "Dieses Profil ermöglicht die Abbildung von Medikationsverordnungen eines Patienten in ISiK Szenarien.", "fhirVersion": "4.0.1", diff --git a/Resources/fsh-generated/resources/ValueSet-SctRouteOfAdministration.json b/Resources/fsh-generated/resources/ValueSet-SctRouteOfAdministration.json index eb06d80..32f8464 100644 --- a/Resources/fsh-generated/resources/ValueSet-SctRouteOfAdministration.json +++ b/Resources/fsh-generated/resources/ValueSet-SctRouteOfAdministration.json @@ -7,8 +7,8 @@ "url": "https://gematik.de/fhir/isik/v3/Medikation/ValueSet/SctRouteOfAdministration", "experimental": false, "publisher": "gematik GmbH", - "version": "3.0.0", - "date": "2023-07-01", + "version": "3.0.1", + "date": "2024-01-12", "compose": { "include": [ { diff --git a/Resources/input/fsh/ruleset.fsh b/Resources/input/fsh/ruleset.fsh index 0bf956d..ac5c5c7 100644 --- a/Resources/input/fsh/ruleset.fsh +++ b/Resources/input/fsh/ruleset.fsh @@ -2,32 +2,32 @@ RuleSet: Meta * ^status = #active * ^experimental = false * ^publisher = "gematik GmbH" -* ^version = "3.0.0" -* ^date = "2023-07-01" +* ^version = "3.0.1" +* ^date = "2024-01-12" RuleSet: Meta-CapabilityStatementInformation * status = #active * experimental = false -* version = "3.0.0" +* version = "3.0.1" * publisher = "gematik GmbH" -* date = "2023-07-01" -* implementationGuide = "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.0" +* date = "2024-01-12" +* implementationGuide = "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.1" * url = "https://gematik.de/fhir/isik/v3/Medikation/CapabilityStatement/medikation-server/information" RuleSet: Meta-CapabilityStatementVerordnung * status = #active * experimental = false -* version = "3.0.0" +* version = "3.0.1" * publisher = "gematik GmbH" -* date = "2023-07-01" -* implementationGuide = "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.0" +* date = "2024-01-12" +* implementationGuide = "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.1" * url = "https://gematik.de/fhir/isik/v3/Medikation/CapabilityStatement/medikation-server/verordnung" RuleSet: Meta-CapabilityStatementVerabreichung * status = #active * experimental = false -* version = "3.0.0" +* version = "3.0.1" * publisher = "gematik GmbH" -* date = "2023-07-01" -* implementationGuide = "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.0" +* date = "2024-01-12" +* implementationGuide = "https://gematik.de/fhir/isik/v3/Medikation/ImplementationGuide|3.0.1" * url = "https://gematik.de/fhir/isik/v3/Medikation/CapabilityStatement/medikation-server/verabreichung" \ No newline at end of file diff --git a/Resources/sushi-config.yaml b/Resources/sushi-config.yaml index ee417dd..76872f9 100644 --- a/Resources/sushi-config.yaml +++ b/Resources/sushi-config.yaml @@ -2,8 +2,8 @@ canonical: https://gematik.de/fhir/isik/v3/Medikation fhirVersion: 4.0.1 FSHOnly: true applyExtensionMetadataToRoot: false -version: 3.0.0 +version: 3.0.1 dependencies: de.medizininformatikinitiative.kerndatensatz.medikation: 1.0.11 hl7.fhir.r4.core: 4.0.1 - de.gematik.isik-basismodul: 3.0.0 + de.gematik.isik-basismodul: 3.0.1 diff --git a/package.json b/package.json index 4affa90..5ee9a16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "de.gematik.isik-medikation", - "version": "3.0.0", + "version": "3.0.1", "fhirVersions": [ "4.0.1" ], @@ -8,6 +8,6 @@ "hl7.fhir.r4.core": "4.0.1", "de.medizininformatikinitiative.kerndatensatz.medikation": "1.0.11", "hl7.fhir.uv.ips": "1.0.0", - "de.gematik.isik-basismodul": "3.0.0" + "de.gematik.isik-basismodul": "3.0.1" } } diff --git a/scripts/config.yaml b/scripts/config.yaml new file mode 100644 index 0000000..35ac342 --- /dev/null +++ b/scripts/config.yaml @@ -0,0 +1,26 @@ +package.json: + - type: version + regex: '("version":\s*")([\d\.]+.*)(")' +sushi-config.yaml: + - type: version + regex: '(version:\s*)(\d+\.\d+\.\d+.*)()' +ruleset.fsh: + - type: version + regex: + - '(\*\s*version\s*=\s*")([\d\.]+.*)(")' + - '(\*\s*\^version\s*=\s*")([\d\.]+.*)(")' + - '(\*\s*implementationGuide\s*=\s*".*\|)([\d\.]+.*)(")' + - type: date + regex: + - '(\*\s*date\s*=\s*")(\d+\-\d+\-\d+)(")' + - '(\*\s*\^date\s*=\s*")(\d+\-\d+\-\d+)(")' + format: '%Y-%m-%d' +Einfuehrung.md: + - type: version + regex: '(Version: \s*)(\d+\.\d+\.\d+.*)()' + - type: date + regex: '(Datum:\s*)(\d+\.\d+\.\d+.*)()' + format: '%d.%m.%Y' +ImplementierungsleitfadenIsiK_Dokumentenaustausch.json: + - type: version + regex: '("version":\s*")(\d+\.\d+\.\d+.*)(",)' \ No newline at end of file diff --git a/scripts/release_publish.py b/scripts/release_publish.py index 92e9cca..86adfa5 100644 --- a/scripts/release_publish.py +++ b/scripts/release_publish.py @@ -1,128 +1,104 @@ +import datetime import re import subprocess import os import argparse from datetime import date +import yaml -class FileWithVersionToUpdate: - def __init__(self, filename, version_regex) -> None: - self.filename = filename - self.version_regex = version_regex - self.location = None - - def set_file_location(self, location): - self.location = location -class FileWithDateToUpdate: - def __init__(self, filename, date_regex) -> None: +class FileTypeCombinationToUpdate: + def __init__(self, filename, content_type, regex_list, format=None) -> None: self.filename = filename - self.date_regex = date_regex + self.content_type = content_type + self.regex_list = regex_list + self.format = format self.location = None def set_file_location(self, location): self.location = location -# class FileWithDateToUpdate: -# def __init__(self, filename, date_regex, format) -> None: -# self.filename = filename -# self.date_regex = date_regex -# self.location = None -# self.format = format -# def set_file_location(self, location): -# self.location = location - - +def load_config_file(config_file_path): + with open(config_file_path, 'r') as config_file: + return yaml.safe_load(config_file) def get_new_release_version_from_branch_name() -> str: git_branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip().decode() return git_branch -def replace_version_in_files(files : list, new_release_version: str): - if files is None: - print("Error: No Files found!") - return - for file in files: - replace_version_in_file(file,new_release_version) +def create_files_to_update_list(config): + files_to_update = [] + for filename, replacements in config.items(): + for replacement in replacements: + files_to_update.append( + FileTypeCombinationToUpdate( + filename, + replacement["type"], + replacement["regex"] if isinstance(replacement["regex"], list) else [replacement["regex"]], + replacement.get("format", None), + ) + ) + return files_to_update -def replace_version_in_file(file: FileWithVersionToUpdate,new_release_version: str): - with open(file.location, 'r') as input_file: - input_text = input_file.read() - output_text = re.sub(file.version_regex, rf'\g<1>{new_release_version}\g<3>', input_text) - print(f"Info: Replaced version with '{new_release_version}' in file '{file.location}'.") +def locate_files_in_current_project(files: list): + located_files = [] + for current_file in files: + file_location = find_file(current_file.filename, ".") + if file_location is not None: + current_file.set_file_location(file_location) + located_files.append(current_file) + else: + print(f"Warning: File '{current_file.filename}' not found.") + return located_files - with open(file.location, 'w') as output_file: - output_file.write(output_text) -def replace_date_in_files(files : list, new_release_date: str): +def find_file(name, path="."): + for root, dirs, files in os.walk(path): + if name in files: + print(f"Info: Found '{name}' in {root}.") + return os.path.join(root, name) + return None + + +def replace_content_in_files(files: list, new_release_version: str, new_date: datetime): if files is None: - print("Error: No Files found!") + print("Error: No files found!") return - for file in files: - replace_date_in_file(file,new_release_date) + for FileTypeCombination in files: + if FileTypeCombination.content_type == "version": + replace_version_in_file(FileTypeCombination, new_release_version) + elif FileTypeCombination.content_type == "date": + replace_date_in_file(FileTypeCombination, new_date) + -def replace_date_in_file(file: FileWithVersionToUpdate, new_date: str): +def replace_version_in_file(file: FileTypeCombinationToUpdate, new_release_version: str): with open(file.location, 'r') as input_file: input_text = input_file.read() - #output_text = re.sub(file.date_regex, rf'\g<1>{new_date.strftime(file.format)}\g<3>', input_text) #see https://www.programiz.com/python-programming/datetime#:~:text=Python%20format%20datetime&text=It%27s%20more%20common%20to%20use,()%20methods%20to%20handle%20this. - output_text = re.sub(file.date_regex, rf'\g<1>{new_date}\g<3>', input_text) - print(f"Info: Replaced date with '{new_date}' in file '{file.location}'.") + for regex in file.regex_list: + input_text = re.sub(regex, rf'\g<1>{new_release_version}\g<3>', input_text) + + print(f"Info: Replaced version with '{new_release_version}' in file '{file.location}'.") with open(file.location, 'w') as output_file: - output_file.write(output_text) - -def get_file_to_update_version_list(): - file_list = [] - file_list.append(FileWithVersionToUpdate('package.json', r'("version":\s*")([\d\.]+.*)(")')) - file_list.append(FileWithVersionToUpdate('sushi-config.yaml', r'(version:\s*")(\d+\.\d+\.\d+.*)(")')) - file_list.append(FileWithVersionToUpdate('sushi-config.yaml', r'(version:\s*)(\d+\.\d+\.\d+.*)()')) - file_list.append(FileWithVersionToUpdate('ruleset.fsh', r'(\*\s*version\s*=\s*")([\d\.]+.*)(")')) - file_list.append(FileWithVersionToUpdate('ruleset.fsh', r'(\*\s*\^version\s*=\s*")([\d\.]+.*)(")')) - file_list.append(FileWithVersionToUpdate('Einfuehrung.md', r'(Version: \s*)(\d+\.\d+\.\d+.*)()')) - file_list.append(FileWithVersionToUpdate('ImplementierungsleitfadenIsiK_basismodul.json', r'("version":\s*")([\d\.]+.*)(")')) - file_list.append(FileWithVersionToUpdate('ImplementierungsleitfadenIsiK_Terminplanung.json', r'("version":\s*")([\d\.]+.*)(")')) - return file_list - -def get_file_to_update_date_list(): - file_list = [] - #file_list.append(FileWithDateToUpdate('ruleset.fsh', r'(date\s*=\s*")(\d+\-\d+\-\d+)(")'), '%m/%d/%Y' ) - #file_list.append(FileWithDateToUpdate('Einfuehrung.md', r'(Datum: \s*)(\d+\.\d+\.\d+)()') , '%m/%d/%Y') - file_list.append(FileWithDateToUpdate('ruleset.fsh', r'(\*\s*date\s*=\s*")(\d+\-\d+\-\d+)(")')) - file_list.append(FileWithDateToUpdate('ruleset.fsh', r'(\*\s*\^date\s*=\s*")(\d+\-\d+\-\d+)(")')) - file_list.append(FileWithDateToUpdate('Einfuehrung.md', r'(Datum:\s*)(\d+\.\d+\.\d+.*)()')) - return file_list + output_file.write(input_text) -def locate_files_in_current_project(files: list): - return_list = [] - for current_file in files: - file_location = find_file(current_file.filename, ".") - if file_location is not None: - current_file.set_file_location(file_location) - return_list.append(current_file) - else: - print(f"Warning: File '{current_file.filename}' not found.") - return return_list +def replace_date_in_file(file: FileTypeCombinationToUpdate, new_date: datetime): + with open(file.location, 'r') as input_file: + input_text = input_file.read() -def find_file(name, path="."): - for root, dirs, files in os.walk(path): + for regex in file.regex_list: + input_text = re.sub(regex, rf'\g<1>{new_date.strftime(file.format)}\g<3>', input_text) - if name in files: - print(f"Info: Found '{name}' in {root}.") - return os.path.join(root, name) - return None + print(f"Info: Replaced date with '{new_date.strftime(file.format)}' in file '{file.location}'.") -def get_latest_release_tag(): - cmd = 'git describe --abbrev=0 --tags --match "v*.*.*" HEAD' - try: - output = subprocess.check_output(cmd, shell=True) - return output.decode().strip() - except subprocess.CalledProcessError: - return None + with open(file.location, 'w') as output_file: + output_file.write(input_text) def output_commit_messages_since_last_release(): latest_release_tag = get_latest_release_tag() @@ -137,15 +113,22 @@ def output_commit_messages_since_last_release(): except subprocess.CalledProcessError: print("Warning: Failed to get commit messages.") -def main(): - today = date.today() +def get_latest_release_tag(): + cmd = 'git describe --abbrev=0 --tags --match "v*.*.*" HEAD' + try: + output = subprocess.check_output(cmd, shell=True) + return output.decode().strip() + except subprocess.CalledProcessError: + return None - parser = argparse.ArgumentParser(description='Update release version number') + +def main(): + parser = argparse.ArgumentParser(description='Update release version number and date') parser.add_argument('-b', '--branch', action='store_true', help='get new version from branch name') parser.add_argument('-v', '--version', type=str, help='specify new version number') + parser.add_argument('-d', '--date', type=str, help='specify custom date for release') + parser.add_argument('-c', '--config', type=str, default='config.yaml', help='specify config file') parser.add_argument('-o', '--output', action='store_true', help='output commit messages since last release') - # TODO new argument -d if not date_time now - args = parser.parse_args() if args.version: @@ -155,16 +138,19 @@ def main(): else: parser.error('No new release version specified. Please use either -v or -b to specify the new release version.') - if args.output: - output_commit_messages_since_last_release() + if args.date: + custom_date = datetime.datetime.strptime(args.date, '%d.%m.%Y').date() + else: + custom_date = date.today() - file_to_update_version_list = get_file_to_update_version_list() - file_version_list = locate_files_in_current_project(file_to_update_version_list) - replace_version_in_files(file_version_list, new_release_version) + config_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), args.config) + config = load_config_file(config_file_path) + files_to_update = create_files_to_update_list(config) + located_files = locate_files_in_current_project(files_to_update) + replace_content_in_files(located_files, new_release_version, custom_date) - file_to_update_date_list = get_file_to_update_date_list() - file_date_list = locate_files_in_current_project(file_to_update_date_list) - replace_date_in_files(file_date_list, today) + if args.output: + output_commit_messages_since_last_release() if __name__ == "__main__": main() \ No newline at end of file
{"Medication Summary", "Medication Order", "Administered Medication"}