-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: added snapshot-testing based validation of generated resources (#8
) * test: remove vendored profile resources * test: added first snapshots tests for the procedure processor * test: added fhir validation infrastructure * test: finalized snapshot testing implementation * chore: ignore snapshots by prettier * test: don't use full input resource name to avoid "filename too long" errors * test: added patient mapper tests * test: use a fixed `app.version` to avoid snapshot invalidations on new releases
- Loading branch information
Showing
92 changed files
with
3,051 additions
and
61,193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: validate-fhir-resources | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
push: | ||
branches: [master] | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
validate-fhir-resource: | ||
name: Validate FHIR resources | ||
runs-on: ubuntu-22.04 | ||
container: ghcr.io/miracum/ig-build-tools:v2.0.12@sha256:f2cca9f26f7bdb9fe238798b6f60b7798553c7d488633ded6f5a90ce6f083deb | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Install Firely.Terminal | ||
run: | | ||
dotnet tool install --global Firely.Terminal --version 3.1.0 | ||
fhir --help | ||
- name: Restore FHIR package dependencies | ||
run: | | ||
fhir restore | ||
- name: Validate generated FHIR resources | ||
# TODO: switch to 'xargs' or for loop so if any validation fails, the entire command fails. | ||
# for fhir_file in src/test/java/snapshots/**/*.fhir.json; do fhir validate --verbose --fail "$fhir_file"; done | ||
run: | | ||
find src/test/java/snapshots -name "*.fhir.json" -exec fhir validate --verbose --fail "{}" \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry=https://packages.simplifier.net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/test/java/snapshots/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "obds-to-fhir", | ||
"version": "0.1.0", | ||
"description": "Creates FHIR resources from oBDS-XML data", | ||
"dependencies": { | ||
"hl7.fhir.r4.core": "4.0.1", | ||
"de.dktk.oncology": "1.3.0", | ||
"de.medizininformatikinitiative.kerndatensatz.person": "2024.0.0-alpha1" | ||
}, | ||
"fhirVersions": [ | ||
"4.0.1" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/test/java/org/miracum/streams/ume/obdstofhir/PackageSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.miracum.streams.ume.obdstofhir; | ||
|
||
public class PackageSettings { | ||
public static String ApprovalBaseDirectory = "./snapshots"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.