From 3f59e89eb0cbe8a4884150c9936990078e583d70 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Fri, 19 Aug 2022 13:34:02 -0700 Subject: [PATCH 1/2] Update for release/0.2.0 --- .github/.gitversion.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/.gitversion.yml b/.github/.gitversion.yml index f50aeb01f..014925200 100644 --- a/.github/.gitversion.yml +++ b/.github/.gitversion.yml @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +next-version: 0.2.0 assembly-versioning-scheme: MajorMinorPatchTag mode: ContinuousDelivery branches: From 4e0bb21474018afd7bafc49fc083a6e4d1d611b8 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Tue, 13 Sep 2022 16:22:47 -0700 Subject: [PATCH 2/2] Release 0.3.0 (#144) * Implement FHIR server (#118) * Integrate MS Health Check Service (#130) Signed-off-by: Victor Chang --- .github/dependabot.yml | 22 + .github/workflows/ci.yml | 77 +- .licenserc.yaml | 2 + .vscode/launch.json | 8 +- Dockerfile | 11 +- doc/dependency_decisions.yml | 102 +- docs/api/rest/fhir.md | 63 + docs/api/rest/health.md | 78 +- docs/changelog.md | 6 + docs/compliance/third-party-licenses.md | 27938 ++++++---------- ...Monai.Deploy.InformaticsGateway.Api.csproj | 4 +- ....Deploy.InformaticsGateway.Api.Test.csproj | 2 +- src/CLI/Services/DockerRunner.cs | 4 - src/CLI/Test/DockerRunnerTest.cs | 1 - ....Deploy.InformaticsGateway.CLI.Test.csproj | 2 +- ...formaticsGateway.Client.Common.Test.csproj | 2 +- ...ploy.InformaticsGateway.Client.Test.csproj | 2 +- ...ploy.InformaticsGateway.Common.Test.csproj | 2 +- ...oy.InformaticsGateway.Configuration.csproj | 4 +- ...formaticsGateway.Configuration.Test.csproj | 2 +- ...oy.InformaticsGateway.Database.Test.csproj | 2 +- .../Test/StorageMetadataWrapperTest.cs | 4 +- ...rmaticsGateway.DicomWeb.Client.Test.csproj | 2 +- .../Logging/Log.8000.HttpServices.cs | 19 +- .../Monai.Deploy.InformaticsGateway.csproj | 47 +- src/InformaticsGateway/Program.cs | 12 +- .../Services/DicomWeb/IStreamsWriter.cs | 2 +- .../Services/Fhir/ContentTypes.cs | 24 + .../Services/Fhir/FhirFormatters.cs | 40 + .../Services/Fhir/FhirJsonReader.cs | 90 + .../Fhir/FhirResourceTypesRouteConstraint.cs | 37 + .../Services/Fhir/FhirService.cs | 115 + .../Services/Fhir/FhirStoreException.cs | 55 + .../Services/Fhir/FhirStoreResult.cs | 48 + .../Services/Fhir/FhirXmlReader.cs | 112 + .../Services/Fhir/IFHirRequestReader.cs | 28 + .../Services/Fhir/IFhirService.cs | 27 + .../Services/Fhir/OperationOutcome.cs | 110 + .../Services/Fhir/Resources.cs | 33 + .../Services/Http/Fhir/FhirController.cs | 144 + .../Services/Http/HealthController.cs | 27 - .../Services/Http/MonaiHealthCheck.cs | 63 + .../Services/Http/Startup.cs | 55 +- .../Test/DummyMessagingService.cs | 20 +- .../Test/DummyStorageService.cs | 11 +- ...onai.Deploy.InformaticsGateway.Test.csproj | 2 +- .../Test/Services/Fhir/FhirJsonReaderTest.cs | 126 + .../FhirResourceTypesRouteConstraintTest.cs | 71 + .../Test/Services/Fhir/FhirServiceTest.cs | 152 + .../Test/Services/Fhir/FhirXmlReaderTest.cs | 143 + .../Services/Http/Fhir/FhirControllerTest.cs | 171 + .../Services/Http/HealthControllerTest.cs | 44 - src/Monai.Deploy.InformaticsGateway.sln | 19 +- tests/Integration.Test/Features/Fhir.feature | 34 + ...InformaticsGateway.Integration.Test.csproj | 8 +- .../StepDefinitions/FhirDefinitions.cs | 190 + .../HealthLevel7Definitions.cs | 22 +- .../data/fhir/1.0.2 DSTU2/Observation.json | 75 + .../data/fhir/1.0.2 DSTU2/Observation.xml | 67 + .../data/fhir/1.0.2 DSTU2/Patient.json | 60 + .../data/fhir/1.0.2 DSTU2/Patient.xml | 33 + .../data/fhir/3.0.2 STU3/Bundle.json | 37 + .../data/fhir/3.0.2 STU3/Bundle.xml | 242 + .../fhir/3.0.2 STU3/DiagnosticReport.json | 129 + .../data/fhir/3.0.2 STU3/DiagnosticReport.xml | 1723 + .../data/fhir/3.0.2 STU3/NutritionOrder.json | 113 + .../data/fhir/3.0.2 STU3/NutritionOrder.xml | 184 + .../data/fhir/3.0.2 STU3/Questionnaire.json | 166 + .../data/fhir/3.0.2 STU3/Questionnaire.xml | 133 + .../data/fhir/4.0.1 R4/CodeSystem.json | 166 + .../data/fhir/4.0.1 R4/CodeSystem.xml | 53 + .../data/fhir/4.0.1 R4/Observation.json | 120 + .../data/fhir/4.0.1 R4/Observation.xml | 42 + .../data/fhir/4.0.1 R4/OperationOutcome.json | 24 + .../data/fhir/4.0.1 R4/OperationOutcome.xml | 18 + .../data/fhir/4.0.1 R4/Patient.json | 116 + .../data/fhir/4.0.1 R4/Patient.xml | 70 + .../data/fhir/4.3.0 R4B/Bundle.json | 243 + .../data/fhir/4.3.0 R4B/Bundle.xml | 152 + .../data/fhir/4.3.0 R4B/Observation.json | 71 + .../data/fhir/4.3.0 R4B/Observation.xml | 57 + .../data/fhir/4.3.0 R4B/Patient.json | 112 + .../data/fhir/4.3.0 R4B/Patient.xml | 159 + tests/Integration.Test/data/fhir/copyright | 3 + tests/Integration.Test/run.sh | 46 +- 85 files changed, 17209 insertions(+), 17646 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 docs/api/rest/fhir.md create mode 100644 src/InformaticsGateway/Services/Fhir/ContentTypes.cs create mode 100644 src/InformaticsGateway/Services/Fhir/FhirFormatters.cs create mode 100644 src/InformaticsGateway/Services/Fhir/FhirJsonReader.cs create mode 100644 src/InformaticsGateway/Services/Fhir/FhirResourceTypesRouteConstraint.cs create mode 100644 src/InformaticsGateway/Services/Fhir/FhirService.cs create mode 100644 src/InformaticsGateway/Services/Fhir/FhirStoreException.cs create mode 100644 src/InformaticsGateway/Services/Fhir/FhirStoreResult.cs create mode 100644 src/InformaticsGateway/Services/Fhir/FhirXmlReader.cs create mode 100644 src/InformaticsGateway/Services/Fhir/IFHirRequestReader.cs create mode 100644 src/InformaticsGateway/Services/Fhir/IFhirService.cs create mode 100644 src/InformaticsGateway/Services/Fhir/OperationOutcome.cs create mode 100644 src/InformaticsGateway/Services/Fhir/Resources.cs create mode 100644 src/InformaticsGateway/Services/Http/Fhir/FhirController.cs create mode 100644 src/InformaticsGateway/Services/Http/MonaiHealthCheck.cs create mode 100644 src/InformaticsGateway/Test/Services/Fhir/FhirJsonReaderTest.cs create mode 100644 src/InformaticsGateway/Test/Services/Fhir/FhirResourceTypesRouteConstraintTest.cs create mode 100644 src/InformaticsGateway/Test/Services/Fhir/FhirServiceTest.cs create mode 100644 src/InformaticsGateway/Test/Services/Fhir/FhirXmlReaderTest.cs create mode 100644 src/InformaticsGateway/Test/Services/Http/Fhir/FhirControllerTest.cs create mode 100644 tests/Integration.Test/Features/Fhir.feature create mode 100644 tests/Integration.Test/StepDefinitions/FhirDefinitions.cs create mode 100644 tests/Integration.Test/data/fhir/1.0.2 DSTU2/Observation.json create mode 100644 tests/Integration.Test/data/fhir/1.0.2 DSTU2/Observation.xml create mode 100644 tests/Integration.Test/data/fhir/1.0.2 DSTU2/Patient.json create mode 100644 tests/Integration.Test/data/fhir/1.0.2 DSTU2/Patient.xml create mode 100644 tests/Integration.Test/data/fhir/3.0.2 STU3/Bundle.json create mode 100644 tests/Integration.Test/data/fhir/3.0.2 STU3/Bundle.xml create mode 100644 tests/Integration.Test/data/fhir/3.0.2 STU3/DiagnosticReport.json create mode 100644 tests/Integration.Test/data/fhir/3.0.2 STU3/DiagnosticReport.xml create mode 100644 tests/Integration.Test/data/fhir/3.0.2 STU3/NutritionOrder.json create mode 100644 tests/Integration.Test/data/fhir/3.0.2 STU3/NutritionOrder.xml create mode 100644 tests/Integration.Test/data/fhir/3.0.2 STU3/Questionnaire.json create mode 100644 tests/Integration.Test/data/fhir/3.0.2 STU3/Questionnaire.xml create mode 100644 tests/Integration.Test/data/fhir/4.0.1 R4/CodeSystem.json create mode 100644 tests/Integration.Test/data/fhir/4.0.1 R4/CodeSystem.xml create mode 100644 tests/Integration.Test/data/fhir/4.0.1 R4/Observation.json create mode 100644 tests/Integration.Test/data/fhir/4.0.1 R4/Observation.xml create mode 100644 tests/Integration.Test/data/fhir/4.0.1 R4/OperationOutcome.json create mode 100644 tests/Integration.Test/data/fhir/4.0.1 R4/OperationOutcome.xml create mode 100644 tests/Integration.Test/data/fhir/4.0.1 R4/Patient.json create mode 100644 tests/Integration.Test/data/fhir/4.0.1 R4/Patient.xml create mode 100644 tests/Integration.Test/data/fhir/4.3.0 R4B/Bundle.json create mode 100644 tests/Integration.Test/data/fhir/4.3.0 R4B/Bundle.xml create mode 100644 tests/Integration.Test/data/fhir/4.3.0 R4B/Observation.json create mode 100644 tests/Integration.Test/data/fhir/4.3.0 R4B/Observation.xml create mode 100644 tests/Integration.Test/data/fhir/4.3.0 R4B/Patient.json create mode 100644 tests/Integration.Test/data/fhir/4.3.0 R4B/Patient.xml create mode 100644 tests/Integration.Test/data/fhir/copyright diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..d07c72223 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "nuget" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38834c0ff..bcc5e4e17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,11 +41,11 @@ jobs: majorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v1 + - uses: actions/setup-dotnet@v2 with: dotnet-version: "6.0.x" @@ -54,7 +54,7 @@ jobs: - name: Determine Version id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.11 + uses: gittools/actions/gitversion/execute@v0.9.13 with: useConfigFile: true configFilePath: .github/.gitversion.yml @@ -72,11 +72,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v1 + - uses: actions/setup-dotnet@v2 with: dotnet-version: "6.0.x" @@ -86,7 +86,7 @@ jobs: tools: licensefinder - name: Enable NuGet cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.8 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} @@ -132,23 +132,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: - java-version: 1.11 + distribution: zulu + java-version: '11' - - uses: actions/setup-dotnet@v1 + - uses: actions/setup-dotnet@v2 with: dotnet-version: "6.0.x" - name: Enable NuGet cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.8 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} restore-keys: | ${{ runner.os }}-nuget - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -188,7 +189,7 @@ jobs: run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" working-directory: ./src - - uses: codecov/codecov-action@v2 + - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} directory: "src/${{ env.TEST_RESULTS }}" @@ -204,22 +205,22 @@ jobs: needs: [build] strategy: matrix: - feature: [AcrApi, DicomDimseScp, DicomDimseScu, DicomWebExport, DicomWebStow, HealthLevel7] + feature: [AcrApi, DicomDimseScp, DicomDimseScu, DicomWebExport, DicomWebStow, HealthLevel7, Fhir] fail-fast: false env: TAG: ${{ needs.build.outputs.TAG }} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v1 + - uses: actions/setup-dotnet@v2 with: dotnet-version: "6.0.x" - name: Enable NuGet cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.8 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} @@ -241,7 +242,7 @@ jobs: popd - name: Upload Integration Test Results - uses: actions/upload-artifact@v2.3.1 + uses: actions/upload-artifact@v3.1.0 if: always() with: name: integration-${{ matrix.feature }} @@ -275,16 +276,16 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v1 + - uses: actions/setup-dotnet@v2 with: dotnet-version: "6.0.x" - name: Enable NuGet cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.8 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} @@ -320,14 +321,14 @@ jobs: dir -r ~/release - name: Upload CLI - uses: actions/upload-artifact@v2.3.1 + uses: actions/upload-artifact@v3.1.0 with: name: artifacts path: ~/release retention-days: 7 - name: Log in to the Container registry - uses: docker/login-action@v1.12.0 + uses: docker/login-action@v2.0.0 if: ${{ (matrix.os == 'ubuntu-latest') }} with: registry: ${{ env.REGISTRY }} @@ -336,7 +337,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3.6.2 + uses: docker/metadata-action@v4.0.1 if: ${{ (matrix.os == 'ubuntu-latest') }} with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} @@ -345,7 +346,7 @@ jobs: type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} - name: Build and push Docker image - uses: docker/build-push-action@v2.9.0 + uses: docker/build-push-action@v3.1.1 if: ${{ (matrix.os == 'ubuntu-latest') }} with: context: . @@ -363,7 +364,7 @@ jobs: - name: Anchore container scan id: anchore-scan - uses: anchore/scan-action@v3.2.0 + uses: anchore/scan-action@v3.2.5 if: ${{ (matrix.os == 'ubuntu-latest') }} with: image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} @@ -388,16 +389,16 @@ jobs: env: SEMVER: ${{ needs.calc-version.outputs.semVer }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v1 + - uses: actions/setup-dotnet@v2 with: dotnet-version: "6.0.x" - name: Enable NuGet cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.0.8 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} @@ -405,7 +406,7 @@ jobs: ${{ runner.os }}-nuget - name: Setup DocFX - uses: crazy-max/ghaction-chocolatey@v1 + uses: crazy-max/ghaction-chocolatey@v2 with: args: install docfx @@ -434,7 +435,7 @@ jobs: Get-ChildItem ~\release -Recurse - name: Upload docs - uses: actions/upload-artifact@v2.3.1 + uses: actions/upload-artifact@v3.1.0 with: name: artifacts path: ~/release @@ -450,30 +451,30 @@ jobs: MAJORMINORPATCH: ${{ needs.calc-version.outputs.majorMinorPatch }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 id: download - name: List artifacts run: ls -ldR ${{steps.download.outputs.download-path}}/**/* - name: Extract owner and repo - uses: jungwinter/split@v1 + uses: jungwinter/split@v2 id: repo with: - seperator: "/" + separator: "/" msg: ${{ github.repository }} - name: Install GitReleaseManager - uses: gittools/actions/gitreleasemanager/setup@v0.9.11 + uses: gittools/actions/gitreleasemanager/setup@v0.9.13 with: versionSpec: "0.13.x" - name: Create release with GitReleaseManager - uses: gittools/actions/gitreleasemanager/create@v0.9.11 + uses: gittools/actions/gitreleasemanager/create@v0.9.13 with: token: ${{ secrets.GITHUB_TOKEN }} owner: ${{ steps.repo.outputs._0 }} @@ -486,7 +487,7 @@ jobs: artifacts/mig-docs-${{ env.SEMVER }}.zip - name: Publish release with GitReleaseManager - uses: gittools/actions/gitreleasemanager/publish@v0.9.11 + uses: gittools/actions/gitreleasemanager/publish@v0.9.13 if: ${{ contains(github.ref, 'refs/heads/main') }} with: token: ${{ secrets.GITHUB_TOKEN }} @@ -495,7 +496,7 @@ jobs: tagName: ${{ env.MAJORMINORPATCH }} - name: Close release with GitReleaseManager - uses: gittools/actions/gitreleasemanager/close@v0.9.11 + uses: gittools/actions/gitreleasemanager/close@v0.9.13 if: ${{ contains(github.ref, 'refs/heads/main') }} with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.licenserc.yaml b/.licenserc.yaml index 916a8d96b..95673c304 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -20,6 +20,7 @@ header: paths-ignore: - 'LICENSE' - '.github/**/*.md' + - '.github/dependabot.yml' - '**/*.log' - '**/bin/**' - '**/obj/**' @@ -33,6 +34,7 @@ header: - 'demos/**/.env/**' - 'docs/templates/**' - 'tests/Integration.Test/*.dev' + - 'tests/Integration.Test/data/**' comment: on-failure diff --git a/.vscode/launch.json b/.vscode/launch.json index b9b186f4a..f450c8431 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,13 +12,11 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build-cli", - "program": "${workspaceFolder}/src/CLI/bin/Debug/net5.0/linux-x64/mig-cli", + "program": "${workspaceFolder}/src/CLI/bin/Debug/net6.0/linux-x64/mig-cli", "args": [ - "config", - "endpoint", - "http://localhost:4500" + "start" ], - "cwd": "${workspaceFolder}/src/CLI/bin/Debug/net5.0/linux-x64", + "cwd": "${workspaceFolder}/src/CLI/bin/Debug/net6.0/linux-x64", "stopAtEntry": true, "console": "internalConsole" }, diff --git a/Dockerfile b/Dockerfile index 0bd9ad5ac..ffd921c57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM mcr.microsoft.com/dotnet/sdk:6.0-focal as build +FROM mcr.microsoft.com/dotnet/sdk:6.0-jammy as build # Install the tools RUN dotnet tool install --tool-path /tools dotnet-trace @@ -26,16 +26,15 @@ RUN echo "Building MONAI Deploy Informatics Gateway..." RUN dotnet publish -c Release -o out --nologo src/InformaticsGateway/Monai.Deploy.InformaticsGateway.csproj # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal +FROM mcr.microsoft.com/dotnet/aspnet:6.0-jammy ENV DEBIAN_FRONTEND=noninteractive RUN apt-get clean \ && apt-get update \ && apt-get install -y --no-install-recommends \ - libssl1.1 \ - openssl \ sqlite3 \ - && rm -rf /var/lib/apt/lists + curl \ + && rm -rf /var/lib/apt/lists WORKDIR /opt/monai/ig @@ -48,6 +47,8 @@ EXPOSE 104 EXPOSE 2575 EXPOSE 5000 +HEALTHCHECK --interval=10s --retries=10 CMD curl --fail http://localhost:5000/health || exit 1 + RUN ls -lR /opt/monai/ig ENV PATH="/opt/dotnetcore-tools:${PATH}" diff --git a/doc/dependency_decisions.yml b/doc/dependency_decisions.yml index 2c184f0b4..5fd47cc17 100644 --- a/doc/dependency_decisions.yml +++ b/doc/dependency_decisions.yml @@ -18,22 +18,8 @@ - :who: mocsharp :why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt) :versions: - - 3.7.12 - :when: 2022-08-16 23:05:22.203089302 Z -- - :approve - - AWSSDK.Core - - :who: mocsharp - :why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt) - :versions: - - 3.7.12 - :when: 2022-08-16 23:05:27.554306178 Z -- - :approve - - AWSSDK.Core - - :who: mocsharp - :why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt) - :versions: - - 3.7.12.21 - :when: 2022-08-16 23:05:27.995041369 Z + - 3.7.12.26 + :when: 2022-09-01 23:05:22.203089302 Z - - :approve - AWSSDK.S3 - :who: mocsharp @@ -46,15 +32,8 @@ - :who: mocsharp :why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt) :versions: - - 3.7.1.165 - :when: 2022-08-16 23:05:28.920368903 Z -- - :approve - - AWSSDK.SecurityToken - - :who: mocsharp - :why: Apache-2.0 (https://github.com/aws/aws-sdk-net/raw/master/License.txt) - :versions: - - 3.7.1.185 - :when: 2022-08-16 23:05:29.352541363 Z + - 3.7.1.190 + :when: 2022-09-01 23:05:28.920368903 Z - - :approve - BoDi - :who: mocsharp @@ -109,15 +88,15 @@ - :who: mocsharp :why: MIT (https://github.com/dotnet/dotNext/raw/master/LICENSE) :versions: - - 4.7.0 - :when: 2022-08-16 23:05:32.857032968 Z + - 4.7.1 + :when: 2022-09-01 23:05:32.857032968 Z - - :approve - DotNext.Threading - :who: mocsharp :why: MIT (https://github.com/dotnet/dotNext/raw/master/LICENSE) :versions: - - 4.7.0 - :when: 2022-08-16 23:05:33.298402277 Z + - 4.7.1 + :when: 2022-09-01 23:05:33.298402277 Z - - :approve - FluentAssertions - :who: mocsharp @@ -368,8 +347,8 @@ - :who: mocsharp :why: MIT (https://github.com/microsoft/vstest/raw/main/LICENSE) :versions: - - 17.3.0 - :when: 2022-08-16 23:05:49.229587689 Z + - 17.3.1 + :when: 2022-09-01 23:05:49.229587689 Z - - :approve - Microsoft.Data.Sqlite.Core - :who: mocsharp @@ -566,6 +545,27 @@ :versions: - 6.0.0 :when: 2022-08-16 23:06:02.270628975 Z +- - :approve + - Microsoft.Extensions.Diagnostics.HealthChecks + - :who: mocsharp + :why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt) + :versions: + - 6.0.8 + :when: 2022-08-29 18:11:22.090772006 Z +- - :approve + - Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions + - :who: mocsharp + :why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt) + :versions: + - 6.0.8 + :when: 2022-08-29 18:11:22.090772006 Z +- - :approve + - Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore + - :who: mocsharp + :why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt) + :versions: + - 6.0.8 + :when: 2022-08-29 18:11:22.090772006 Z - - :approve - Microsoft.Extensions.FileProviders.Abstractions - :who: mocsharp @@ -732,8 +732,8 @@ - :who: mocsharp :why: MIT ( https://aka.ms/deprecateLicenseUrl) :versions: - - 17.3.0 - :when: 2022-08-16 23:06:13.008314524 Z + - 17.3.1 + :when: 2022-09-01 23:06:13.008314524 Z - - :approve - Microsoft.NETCore.Platforms - :who: mocsharp @@ -793,10 +793,10 @@ - - :approve - Microsoft.TestPlatform.ObjectModel - :who: mocsharp - :why: MIT (https://github.com/microsoft/vstest/raw/v17.3.0/LICENSE) + :why: MIT (https://github.com/microsoft/vstest/raw/v17.3.1/LICENSE) :versions: - - 17.3.0 - :when: 2022-08-16 23:06:17.198633634 Z + - 17.3.1 + :when: 2022-09-01 23:06:17.198633634 Z - - :approve - Microsoft.TestPlatform.TestHost - :who: mocsharp @@ -814,10 +814,10 @@ - - :approve - Microsoft.TestPlatform.TestHost - :who: mocsharp - :why: MIT (https://github.com/microsoft/vstest/raw/v17.3.0/LICENSE) + :why: MIT (https://github.com/microsoft/vstest/raw/v17.3.1/LICENSE) :versions: - - 17.3.0 - :when: 2022-08-16 23:06:18.619013325 Z + - 17.3.1 + :when: 2022-09-01 23:06:18.619013325 Z - - :approve - Microsoft.Win32.Primitives - :who: mocsharp @@ -851,35 +851,35 @@ - :who: mocsharp :why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE) :versions: - - 0.1.3 + - 0.1.4 :when: 2022-08-16 23:06:21.051573547 Z - - :approve - Monai.Deploy.Messaging.RabbitMQ - :who: mocsharp :why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE) :versions: - - 0.1.3 + - 0.1.4 :when: 2022-08-16 23:06:21.511789690 Z - - :approve - Monai.Deploy.Storage - :who: mocsharp :why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-storage/raw/main/LICENSE) :versions: - - 0.2.0 + - 0.2.5 :when: 2022-08-16 23:06:21.988183476 Z - - :approve - Monai.Deploy.Storage.MinIO - :who: mocsharp :why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-storage/raw/main/LICENSE) :versions: - - 0.2.0 + - 0.2.5 :when: 2022-08-16 23:06:22.426838304 Z - - :approve - Monai.Deploy.Storage.S3Policy - :who: mocsharp :why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-storage/raw/main/LICENSE) :versions: - - 0.2.0 + - 0.2.5 :when: 2022-08-16 23:06:22.881956546 Z - - :approve - Moq @@ -1192,7 +1192,7 @@ - - :approve - System.Configuration.ConfigurationManager - :who: mocsharp - :why: MIT ( https://github.com/dotnet/corefx/blob/master/LICENSE.TXT) + :why: MIT ( https://github.com/dotnet/corefx/raw/master/LICENSE.TXT) :versions: - 4.5.0 :when: 2022-08-16 23:06:43.335979768 Z @@ -1493,7 +1493,7 @@ - - :approve - System.Reflection.Metadata - :who: mocsharp - :why: MIT (https://github.com/dotnet/corefx/blob/master/LICENSE.TXT) + :why: MIT (https://github.com/dotnet/corefx/raw/master/LICENSE.TXT) :versions: - 1.6.0 :when: 2022-08-16 23:07:03.120522282 Z @@ -1535,7 +1535,7 @@ - - :approve - System.Runtime.CompilerServices.Unsafe - :who: mocsharp - :why: MIT (https://github.com/dotnet/corefx/blob/master/LICENSE.TXT) + :why: MIT (https://github.com/dotnet/corefx/raw/master/LICENSE.TXT) :versions: - 4.5.1 :when: 2022-08-16 23:07:05.893799510 Z @@ -1612,7 +1612,7 @@ - - :approve - System.Security.AccessControl - :who: mocsharp - :why: MIT (https://github.com/dotnet/corefx/blob/master/LICENSE.TXT) + :why: MIT (https://github.com/dotnet/corefx/raw/master/LICENSE.TXT) :versions: - 4.5.0 :when: 2022-08-16 23:07:11.063425328 Z @@ -1668,7 +1668,7 @@ - - :approve - System.Security.Cryptography.ProtectedData - :who: mocsharp - :why: MIT (https://github.com/dotnet/corefx/blob/master/LICENSE.TXT) + :why: MIT (https://github.com/dotnet/corefx/raw/master/LICENSE.TXT) :versions: - 4.5.0 :when: 2022-08-16 23:07:14.759818552 Z @@ -1682,7 +1682,7 @@ - - :approve - System.Security.Permissions - :who: mocsharp - :why: MIT (https://github.com/dotnet/corefx/blob/master/LICENSE.TXT) + :why: MIT (https://github.com/dotnet/corefx/raw/master/LICENSE.TXT) :versions: - 4.5.0 :when: 2022-08-16 23:07:15.681971110 Z @@ -1717,7 +1717,7 @@ - - :approve - System.Text.Encoding.CodePages - :who: mocsharp - :why: MIT (https://github.com/dotnet/corefx/blob/master/LICENSE.TXT) + :why: MIT (https://github.com/dotnet/corefx/raw/master/LICENSE.TXT) :versions: - 4.6.0 :when: 2022-08-16 23:07:17.991171210 Z diff --git a/docs/api/rest/fhir.md b/docs/api/rest/fhir.md new file mode 100644 index 000000000..f149fa65a --- /dev/null +++ b/docs/api/rest/fhir.md @@ -0,0 +1,63 @@ + + +# DICOMWeb STOW-RS APIs + +The `fhir/` endpoint implements the specifications defined in [section 3.1.0 RESTful API](http://hl7.org/implement/standards/fhir/http.html) +defined by HL7 (Health Level 7 International) to enable triggering new workflows. The FHIR service supports multiple versions of the Fast Healthcare Interoperability Resources (FHIR) specifications published by Health Level 7 International (HL7). + +[!Note] +The service does not support [CapabilityStatement](https://www.hl7.org/fhir/capabilitystatement.html) at this moment and does not group the incoming FHIR resources. Therefore, each incoming FHIR resource will trigger a new workflow request. + +The *FHIR* service provides the following endpoint. + +## POST /fhir/[resource] + +Triggers a new workflow request with the posted FHIR resource. + +> [!IMPORTANT] +> Refer to [section 1.2 Resource Index](http://hl7.org/fhir/resourcelist.html) for a list of HL7 resources. The endpoint is designed to accept any resource and provides only syntax validation either in XML or JSON. + +### Parameters + +#### Query Parameters: + +| Name | Type | Description | +| -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| resource | string | (Optional) resouce type of the FHIR document. The services reject the request if the `Resource` value in the URL differs from the `Resource` value described in the posted document. | + +#### Request Body: + +Supported Content-Types: + +- `application/fhir+json` +- `application/fhir+xml` + +### Responses + +Depending on the `Accept` header or the original document, the response supports the following content types: + +- `application/fhir+json` +- `application/fhir+xml` + +If the `Accept` header is missing or a none supported value exists, the service will return the same type as the posted document. + +| Code | Data Type | Description | +| ---- | ------------------------------------------------------------- | --------------------------------------------------------------------- | +| 201 | Original JSON or XML document. | Resource created & stored successfully. | +| 400 | [OperationOutcome](http://hl7.org/fhir/operationoutcome.html) | Unable to parse the resource or mismatching resource type specified.. | +| 415 | `none` | Unsupported media type | +| 500 | [OperationOutcome](http://hl7.org/fhir/operationoutcome.html) | Server error. | diff --git a/docs/api/rest/health.md b/docs/api/rest/health.md index 9bf068fea..dab88514a 100644 --- a/docs/api/rest/health.md +++ b/docs/api/rest/health.md @@ -18,12 +18,11 @@ The _health_ endpoint provides the following APIs to get the status of the internals of the Informatics Gateway. -## GET /health/status -Returns the MONAI Informatics Gateway service status: -- Active DICOM DIMSE associations -- Internal service status +## GET /health/ + +Returns the MONAI Deploy Informatics Gateway service readiness and liveness. ### Parameters @@ -31,40 +30,61 @@ N/A ### Responses -Response Content Type: JSON - [HealthStatusResponse](xref:Monai.Deploy.InformaticsGateway.Api.Rest.HealthStatusResponse). +Response Content Type: JSON + +- `Healthy`: All services are running. +- `Unhealthy`: One or more services have stopped or crashed. | Code | Description | | ---- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 200 | Status is available. | +| 200 | Service is healthy. | +| 503 | Service is unhealthy. | | 500 | Server error. The response will be a [Problem details](https://datatracker.ietf.org/doc/html/rfc7807) object with server error details. | ### Example Request ```bash -curl --location --request GET 'http://localhost:5000/health/status' +curl --location --request GET 'http://localhost:5000/health' ``` ### Example Response ```json { - "activeDimseConnections": 8, - "services": { - "Space Reclaimer Service": "Running", - "DICOM SCP Service": "Running", - "DICOMweb Export Service": "Running", - "DICOM Export Service": "Running", - "Data Retrieval Service": "Running", - "Workload Manager Notification Service": "Running" - } + "status": "Healthy", + "checks": [ + { + "check": "Informatics Gateway Services", + "result": "Healthy" + }, + { + "check": "InformaticsGatewayContext", + "result": "Healthy" + }, + { + "check": "minio", + "result": "Healthy" + }, + { + "check": "Rabbit MQ Subscriber", + "result": "Healthy" + }, + { + "check": "Rabbit MQ Publisher", + "result": "Healthy" + } + ] } ``` --- -## GET /health/ready & GET /health/live +## GET /health/status + +Returns the MONAI Informatics Gateway service status: -Returns the MONAI Deploy Informatics Gateway service readiness and liveness. +- Active DICOM DIMSE associations +- Internal service status ### Parameters @@ -72,25 +92,31 @@ N/A ### Responses -Response Content Type: JSON - -- `Healthy`: All services are running. -- `Unhealthy`: One or more services have stopped or crashed. +Response Content Type: JSON - [HealthStatusResponse](xref:Monai.Deploy.InformaticsGateway.Api.Rest.HealthStatusResponse). | Code | Description | | ---- | --------------------------------------------------------------------------------------------------------------------------------------- | -| 200 | Service is healthy. | -| 503 | Service is unhealthy. | +| 200 | Status is available. | | 500 | Server error. The response will be a [Problem details](https://datatracker.ietf.org/doc/html/rfc7807) object with server error details. | ### Example Request ```bash -curl --location --request GET 'http://localhost:5000/health/live' +curl --location --request GET 'http://localhost:5000/health/status' ``` ### Example Response ```json -"Healthy" +{ + "activeDimseConnections": 8, + "services": { + "Space Reclaimer Service": "Running", + "DICOM SCP Service": "Running", + "DICOMweb Export Service": "Running", + "DICOM Export Service": "Running", + "Data Retrieval Service": "Running", + "Workload Manager Notification Service": "Running" + } +} ``` diff --git a/docs/changelog.md b/docs/changelog.md index 1cadf7021..bd3dde2a1 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -16,6 +16,12 @@ # Changelog +## 0.3.0 + +[GitHub Milestone 0.3.0](https://github.com/Project-MONAI/monai-deploy-informatics-gateway/milestone/3) + +- Adds a basic [FHIR service](api/rest/config.md) to accept any versions of FHIR. +- Updates [Health Check API](api/rest/health.md) to replace `/health/live` and `/health/ready` APIs with `/health` API. ## 0.2.0 diff --git a/docs/compliance/third-party-licenses.md b/docs/compliance/third-party-licenses.md index 1e8c00d31..2cc30e034 100644 --- a/docs/compliance/third-party-licenses.md +++ b/docs/compliance/third-party-licenses.md @@ -1,5 +1,5 @@ - VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monai.Deploy.InformaticsGateway", "InformaticsGateway\Monai.Deploy.InformaticsGateway.csproj", "{5F7BF552-40CD-4B57-BD26-728BDC207AC6}" @@ -59,7 +42,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monai.Deploy.InformaticsGat EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monai.Deploy.InformaticsGateway.DicomWeb.Client.CLI", "DicomWebClient\CLI\Monai.Deploy.InformaticsGateway.DicomWeb.Client.CLI.csproj", "{689E0066-81DA-4602-B058-D93389DF5DBD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Monai.Deploy.InformaticsGateway.Database.Test", "Database\Test\Monai.Deploy.InformaticsGateway.Database.Test.csproj", "{D5BA6DE3-E861-44D4-BD1B-45FFA57649AC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monai.Deploy.InformaticsGateway.Database.Test", "Database\Test\Monai.Deploy.InformaticsGateway.Database.Test.csproj", "{D5BA6DE3-E861-44D4-BD1B-45FFA57649AC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/tests/Integration.Test/Features/Fhir.feature b/tests/Integration.Test/Features/Fhir.feature new file mode 100644 index 000000000..0f15a5220 --- /dev/null +++ b/tests/Integration.Test/Features/Fhir.feature @@ -0,0 +1,34 @@ +# Copyright 2022 MONAI Consortium +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# @ignored +Feature: FHIR + + @messaging_workflow_request @messaging + Scenario Outline: Ability to store FHIR messages in different formats + Given FHIR message in + When the FHIR messages are sent to Informatics Gateway + Then workflow requests are sent to message broker + And FHIR resources are uploaded to storage service + + Examples: + | version | format | + | 1.0.2 DSTU2 | XML | + | 1.0.2 DSTU2 | JSON | + | 3.0.2 STU3 | XML | + | 3.0.2 STU3 | JSON | + | 4.0.1 R4 | XML | + | 4.0.1 R4 | JSON | + | 4.3.0 R4B | XML | + | 4.3.0 R4B | JSON | diff --git a/tests/Integration.Test/Monai.Deploy.InformaticsGateway.Integration.Test.csproj b/tests/Integration.Test/Monai.Deploy.InformaticsGateway.Integration.Test.csproj index 7fa3a4a77..12af6e326 100644 --- a/tests/Integration.Test/Monai.Deploy.InformaticsGateway.Integration.Test.csproj +++ b/tests/Integration.Test/Monai.Deploy.InformaticsGateway.Integration.Test.csproj @@ -1,4 +1,4 @@ - +

Generated Narrative with Details

id: example

status: final

category: Vital Signs (Details : {http://hl7.org/fhir/observation-category code 'vital-signs' = 'Vital Signs', + given as 'Vital Signs'})

code: Weight Measured (Details : {LOINC code '3141-9' = 'Body weight Measured', given as 'Weight Measured'}; + {SNOMED CT code '27113001' = '27113001', given as 'Body weight'}; {http://acme.org/devices/clinical- + codes code 'body-weight' = '??', given as 'Body Weight'})

subject: Patient/example

encounter: Encounter/example

value: 185 lbs (Details: http://unitsofmeasure.org code [lb_av] = '??')

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/1.0.2 DSTU2/Patient.json b/tests/Integration.Test/data/fhir/1.0.2 DSTU2/Patient.json new file mode 100644 index 000000000..77cf8c7ca --- /dev/null +++ b/tests/Integration.Test/data/fhir/1.0.2 DSTU2/Patient.json @@ -0,0 +1,60 @@ +{ + "resourceType": "Patient", + "id": "Patient", + "text": { + "status": "generated", + "div": "
Patient MINT_TEST, ID = MINT1234. Age = 56y, Size =\n 1.83m, Weight = 72.58kg
" + }, + "extension": [ + { + "url": "http://nema.org/fhir/extensions#0010:1010", + "valueQuantity": { + "value": 56, + "unit": "Y" + } + }, + { + "url": "http://nema.org/fhir/extensions#0010:1020", + "valueQuantity": { + "value": 1.83, + "unit": "m" + } + }, + { + "url": "http://nema.org/fhir/extensions#0010:1030", + "valueQuantity": { + "value": 72.58, + "unit": "kg" + } + } + ], + "identifier": [ + { + "system": "http://nema.org/examples/patients", + "value": "MINT1234" + } + ], + "active": true, + "name": [ + { + "family": [ + "MINT_TEST" + ] + } + ], + "gender": "male", + "_gender": { + "extension": [ + { + "url": "http://nema.org/examples/extensions#gender", + "valueCoding": { + "system": "http://nema.org/examples/gender", + "code": "M" + } + } + ] + }, + "managingOrganization": { + "reference": "Organization/1" + } + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/1.0.2 DSTU2/Patient.xml b/tests/Integration.Test/data/fhir/1.0.2 DSTU2/Patient.xml new file mode 100644 index 000000000..a6a14cb0f --- /dev/null +++ b/tests/Integration.Test/data/fhir/1.0.2 DSTU2/Patient.xml @@ -0,0 +1,33 @@ + + + + +
+ +

Henry Levin the 7th

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/3.0.2 STU3/Bundle.json b/tests/Integration.Test/data/fhir/3.0.2 STU3/Bundle.json new file mode 100644 index 000000000..70287fc6c --- /dev/null +++ b/tests/Integration.Test/data/fhir/3.0.2 STU3/Bundle.json @@ -0,0 +1,37 @@ +{ + "resourceType": "Bundle", + "id": "Bundle", + "type": "batch", + "entry": [ + { + "request": { + "method": "GET", + "url": "/Patient/example" + } + }, + { + "request": { + "method": "GET", + "url": "/MedicationStatement?patient=example&_list=$current-medications" + } + }, + { + "request": { + "method": "GET", + "url": "/AllergyIntolernce?patient=example&_list=$current-allergies" + } + }, + { + "request": { + "method": "GET", + "url": "/Condition?patient=example&_list=$current-problems" + } + }, + { + "request": { + "method": "GET", + "url": "/MedicationStatement?patient=example¬given:not=true" + } + } + ] + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/3.0.2 STU3/Bundle.xml b/tests/Integration.Test/data/fhir/3.0.2 STU3/Bundle.xml new file mode 100644 index 000000000..4df8c5dd7 --- /dev/null +++ b/tests/Integration.Test/data/fhir/3.0.2 STU3/Bundle.xml @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + +
Some narrative
+
+ + + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + + + +
Some narrative
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+ + + + + + + + + + + +
Some narrative
+
+ + + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + + + +
Some narrative
+
+ + + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +
Some narrative
+
+ + + + + + + + + +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/3.0.2 STU3/DiagnosticReport.json b/tests/Integration.Test/data/fhir/3.0.2 STU3/DiagnosticReport.json new file mode 100644 index 000000000..f2f16281e --- /dev/null +++ b/tests/Integration.Test/data/fhir/3.0.2 STU3/DiagnosticReport.json @@ -0,0 +1,129 @@ +{ + "resourceType": "DiagnosticReport", + "id": "DiagnosticReport", + "text": { + "status": "generated", + "div": "

Generated Narrative with Details

id: f001

contained:

identifier: nr1239044 (OFFICIAL)

basedOn: id: req; L2381; status: active; intent: original-order; Complete blood count (hemogram) panel - Blood by Automated count (Details : {LOINC code '58410-2' = 'Complete blood count (hemogram) panel - Blood by Automated count', given as 'Complete blood count (hemogram) panel - Blood by Automated count'}); P. van den Heuvel; ????; Annotation: patient almost fainted during procedure

status: final

category: Haematology test (Details : {SNOMED CT code '252275004' = 'Haematology test', given as 'Haematology test'}; {http://hl7.org/fhir/v2/0074 code 'HM' = 'Hematology)

code: Complete blood count (hemogram) panel - Blood by Automated count (Details : {LOINC code '58410-2' = 'Complete blood count (hemogram) panel - Blood by Automated count', given as 'Complete blood count (hemogram) panel - Blood by Automated count'})

subject: P. van den Heuvel

issued: 15/05/2013 7:32:52 PM

Performers

-Actor
*Burgers University Medical Centre

result:

conclusion: Core lab

" + }, + "contained": [ + { + "resourceType": "ProcedureRequest", + "id": "req", + "extension": [ + { + "url": "http://example.org/bodysitecode", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "14975008", + "display": "Forearm structure" + } + ] + } + } + ], + "identifier": [ + { + "system": "http://www.bmc.nl/zorgportal/identifiers/labresults", + "value": "L2381" + } + ], + "status": "active", + "intent": "original-order", + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "58410-2", + "display": "Complete blood count (hemogram) panel - Blood by Automated count" + } + ] + }, + "subject": { + "reference": "Patient/f001", + "display": "P. van den Heuvel" + }, + "context": { + "reference": "Encounter/f001" + }, + "requester": { + "agent": { + "reference": "Practitioner/f001", + "display": "E.van den Broek" + } + }, + "note": [ + { + "text": "patient almost fainted during procedure" + } + ] + } + ], + "identifier": [ + { + "use": "official", + "system": "http://www.bmc.nl/zorgportal/identifiers/reports", + "value": "nr1239044" + } + ], + "basedOn": [ + { + "reference": "#req" + } + ], + "status": "final", + "category": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "252275004", + "display": "Haematology test" + }, + { + "system": "http://hl7.org/fhir/v2/0074", + "code": "HM" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "58410-2", + "display": "Complete blood count (hemogram) panel - Blood by Automated count" + } + ] + }, + "subject": { + "reference": "Patient/f001", + "display": "P. van den Heuvel" + }, + "issued": "2013-05-15T19:32:52+01:00", + "performer": [ + { + "actor": { + "reference": "Organization/f001", + "display": "Burgers University Medical Centre" + } + } + ], + "result": [ + { + "reference": "Observation/f001" + }, + { + "reference": "Observation/f002" + }, + { + "reference": "Observation/f003" + }, + { + "reference": "Observation/f004" + }, + { + "reference": "Observation/f005" + } + ], + "conclusion": "Core lab" +} \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/3.0.2 STU3/DiagnosticReport.xml b/tests/Integration.Test/data/fhir/3.0.2 STU3/DiagnosticReport.xml new file mode 100644 index 000000000..89d473e9d --- /dev/null +++ b/tests/Integration.Test/data/fhir/3.0.2 STU3/DiagnosticReport.xml @@ -0,0 +1,1723 @@ + + + + + + + + + + + +
+

CBC Report for Wile. E. COYOTE (MRN: 23453) issued 3-Mar 2011 11:45

+
 
+Test                  Units       Value       Reference Range
+Haemoglobin           g/L         176         135 - 180
+Red Cell Count        x10*12/L    5.9         4.2 - 6.0
+Haematocrit                       0.55+       0.38 - 0.52
+Mean Cell Volume      fL          99+         80 - 98
+Mean Cell Haemoglobin pg          36+         27 - 35
+Platelet Count        x10*9/L     444         150 - 450
+White Cell Count      x10*9/L     4.6         4.0 - 11.0
+Neutrophils           %           20
+Neutrophils           x10*9/L     0.9---      2.0 - 7.5
+Lymphocytes           %           20
+Lymphocytes           x10*9/L     0.9-        1.1 - 4.0
+Monocytes             %           20
+Monocytes             x10*9/L     0.9         0.2 - 1.0
+Eosinophils           %           20
+Eosinophils           x10*9/L     0.92++      0.04 - 0.40
+Basophils             %           20
+Basophils             x10*9/L     0.92+++     <0.21
+      
+

Acme Laboratory, Inc signed: Dr Pete Pathologist

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </presentedForm> +</DiagnosticReport> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/3.0.2 STU3/NutritionOrder.json b/tests/Integration.Test/data/fhir/3.0.2 STU3/NutritionOrder.json new file mode 100644 index 000000000..5bd2f19c9 --- /dev/null +++ b/tests/Integration.Test/data/fhir/3.0.2 STU3/NutritionOrder.json @@ -0,0 +1,113 @@ +{ + "resourceType": "NutritionOrder", + "id": "NutritionOrder", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: pureeddiet</p><p><b>identifier</b>: 123</p><p><b>status</b>: active</p><p><b>patient</b>: <a>Peter Chalmers</a></p><p><b>encounter</b>: <a>Inpatient</a></p><p><b>dateTime</b>: 17/09/2014</p><p><b>orderer</b>: <a>Dr Adam Careful</a></p><p><b>allergyIntolerance</b>: <a>Cashew Nuts</a></p><p><b>foodPreferenceModifier</b>: Dairy Free <span>(Details : {http://hl7.org/fhir/diet code 'dairy-free' = 'Dairy Free)</span></p><p><b>excludeFoodModifier</b>: Cashew Nut <span>(Details : {SNOMED CT code '227493005' = 'Cashew nuts', given as 'Cashew Nut'})</span></p><blockquote><p><b>oralDiet</b></p><p><b>type</b>: Pureed diet <span>(Details : {SNOMED CT code '226211001' = 'Pureed diet', given as 'Pureed diet'}; {http://goodhealthhospital.org/diet-type-codes code '1010' = '1010', given as 'Pureed diet'})</span></p><p><b>schedule</b>: Starting 10/02/2015, Do 3 per 1 days</p><h3>Textures</h3><table><tr><td>-</td><td><b>Modifier</b></td></tr><tr><td>*</td><td>Pureed <span>(Details : {SNOMED CT code '228055009' = 'Liquidized food', given as 'Liquidized food'})</span></td></tr></table><p><b>fluidConsistencyType</b>: Nectar thick liquids <span>(Details : {SNOMED CT code '439021000124105' = 'Dietary liquid consistency - nectar thick liquid (regime/therapy)', given as 'Dietary liquid consistency - nectar thick liquid'})</span></p></blockquote></div>" + }, + "identifier": [ + { + "system": "http://goodhealthhospital.org/nutrition-requests", + "value": "123" + } + ], + "status": "active", + "patient": { + "reference": "Patient/example", + "display": "Peter Chalmers" + }, + "encounter": { + "reference": "Encounter/example", + "display": "Inpatient" + }, + "dateTime": "2014-09-17", + "orderer": { + "reference": "Practitioner/example", + "display": "Dr Adam Careful" + }, + "allergyIntolerance": [ + { + "reference": "AllergyIntolerance/example", + "display": "Cashew Nuts" + } + ], + "foodPreferenceModifier": [ + { + "coding": [ + { + "system": "http://hl7.org/fhir/diet", + "code": "dairy-free" + } + ] + } + ], + "excludeFoodModifier": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "version": "20140730", + "code": "227493005", + "display": "Cashew Nut" + } + ] + } + ], + "oralDiet": { + "type": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "226211001", + "display": "Pureed diet" + }, + { + "system": "http://goodhealthhospital.org/diet-type-codes", + "code": "1010", + "display": "Pureed diet" + } + ], + "text": "Pureed diet" + } + ], + "schedule": [ + { + "repeat": { + "boundsPeriod": { + "start": "2015-02-10" + }, + "frequency": 3, + "period": 1, + "periodUnit": "d" + } + } + ], + "texture": [ + { + "modifier": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "228055009", + "display": "Liquidized food" + } + ], + "text": "Pureed" + } + } + ], + "fluidConsistencyType": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "439021000124105", + "display": "Dietary liquid consistency - nectar thick liquid" + } + ], + "text": "Nectar thick liquids" + } + ] + } + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/3.0.2 STU3/NutritionOrder.xml b/tests/Integration.Test/data/fhir/3.0.2 STU3/NutritionOrder.xml new file mode 100644 index 000000000..3913d0c16 --- /dev/null +++ b/tests/Integration.Test/data/fhir/3.0.2 STU3/NutritionOrder.xml @@ -0,0 +1,184 @@ +<NutritionOrder xmlns="http://hl7.org/fhir"> + <!-- Using only instruction element in oralDiet and Supplement minimal other elements id + = pureeddiet-simple file name = nutritionorder-example-pureeddiet-simple.xml Name= Pureed + Diet Simple Description = Nutrition Order Pureed Diet with Energy/Protein Supplement Simple + Example + edited by Eric Haas Health eData Inc + --> + <!-- EH: use oral Diet element --> + <id value="NutritionOrder" /> + <text> + <status value="generated" /> + <div xmlns="http://www.w3.org/1999/xhtml"> + <p> + <b> Generated Narrative with Details</b> + </p> + <p> + <b> id</b> + : pureeddiet-simple + </p> + <p> + <b> identifier</b> + : 123 + </p> + <p> + <b> status</b> + : active + </p> + <p> + <b> patient</b> + : + <a> Peter Chalmers</a> + </p> + <p> + <b> dateTime</b> + : 17/09/2014 + </p> + <p> + <b> orderer</b> + : + <a> Dr Adam Careful</a> + </p> + <blockquote> + <p> + <b> oralDiet</b> + </p> + <p> + <b> type</b> + : Pureed diet + <span> (Details : {SNOMED CT code '226211001' = 'Pureed diet', given as 'Pureed diet'}; {http://goodhealthh + ospital.org/diet-type-codes code '1010' = '1010', given as 'Pureed diet'})</span> + </p> + <p> + <b> schedule</b> + : Starting 10/02/2015, Do 3 per 1 days + </p> + <h3> Textures</h3> + <table> + <tr> + <td> -</td> + <td> + <b> Modifier</b> + </td> + </tr> + <tr> + <td> *</td> + <td> + Pureed + <span> (Details : {SNOMED CT code '228055009' = 'Liquidized food', given as 'Liquidized food'})</span> + </td> + </tr> + </table> + <p> + <b> fluidConsistencyType</b> + : Nectar thick liquids + <span> (Details : {SNOMED CT code '439021000124105' = 'Dietary liquid consistency - nectar thick + liquid (regime/therapy)', given as 'Dietary liquid consistency - nectar thick liquid'})</span> + </p> + </blockquote> + <h3> Supplements</h3> + <table> + <tr> + <td> -</td> + <td> + <b> Type</b> + </td> + <td> + <b> ProductName</b> + </td> + <td> + <b> Instruction</b> + </td> + </tr> + <tr> + <td> *</td> + <td> + Adult high energy pudding + <span> (Details : {SNOMED CT code '442971000124100' = 'Adult high energy formula (product)', + given as 'Adult high energy formula'}; {http://goodhealthhospital.org/supplement-type-codes + code '1040' = '1040', given as 'Adult high energy pudding'})</span> + </td> + <td> Ensure Pudding 4 oz container</td> + <td> Ensure Pudding at breakfast, lunch, supper</td> + </tr> + </table> + </div> + </text> + <identifier> + <system value="http://goodhealthhospital.org/nutrition-requests" /> + <value value="123" /> + </identifier> + <status value="active" /> + <patient> + <reference value="Patient/example" /> + <display value="Peter Chalmers" /> + </patient> + <dateTime value="2014-09-17" /> + <orderer> + <reference value="Practitioner/example" /> + <display value="Dr Adam Careful" /> + </orderer> + <oralDiet> + <!-- EH: list type of diet showing standard code and local codes --> + <type> + <coding> + <system value="http://snomed.info/sct" /> + <code value="226211001" /> + <display value="Pureed diet" /> + </coding> + <coding> + <system value="http://goodhealthhospital.org/diet-type-codes" /> + <code value="1010" /> + <display value="Pureed diet" /> + </coding> + <text value="Pureed diet" /> + </type> + <!-- EH example of three times a day starting on 2/10 --> + <schedule> + <repeat> + <boundsPeriod> + <start value="2015-02-10" /> + </boundsPeriod> + <frequency value="3" /> + <period value="1" /> + <periodUnit value="d" /> + </repeat> + </schedule> + <texture> + <modifier> + <coding> + <system value="http://snomed.info/sct" /> + <code value="228055009" /> + <display value="Liquidized food" /> + </coding> + <text value="Pureed" /> + </modifier> + </texture> + <fluidConsistencyType> + <coding> + <system value="http://snomed.info/sct" /> + <code value="439021000124105" /> + <display value="Dietary liquid consistency - nectar thick liquid" /> + </coding> + <text value="Nectar thick liquids" /> + </fluidConsistencyType> + </oralDiet> + <supplement> + <type> + <coding> + <system value="http://snomed.info/sct" /> + <code value="442971000124100" /> + <display value="Adult high energy formula" /> + </coding> + <coding> + <system value="http://goodhealthhospital.org/supplement-type-codes" /> + <code value="1040" /> + <display value="Adult high energy pudding" /> + </coding> + <text value="Adult high energy pudding" /> + </type> + <productName value="Ensure Pudding 4 oz container" /> + <!-- EH: Instructions to supplement too --> + <instruction value="Ensure Pudding at breakfast, lunch, supper" /> + </supplement> +</NutritionOrder> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/3.0.2 STU3/Questionnaire.json b/tests/Integration.Test/data/fhir/3.0.2 STU3/Questionnaire.json new file mode 100644 index 000000000..547b86232 --- /dev/null +++ b/tests/Integration.Test/data/fhir/3.0.2 STU3/Questionnaire.json @@ -0,0 +1,166 @@ +{ + "resourceType": "Questionnaire", + "id": "Questionnaire", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <pre>\n 1.Comorbidity?\n 1.1 Cardial Comorbidity\n 1.1.1 Angina?\n 1.1.2 MI?\n 1.2 Vascular Comorbidity?\n ...\n Histopathology\n Abdominal\n pT category?\n ...\n </pre>\n </div>" + }, + "url": "http://hl7.org/fhir/Questionnaire/3141", + "title": "Cancer Quality Forum Questionnaire 2012", + "status": "draft", + "date": "2012-01", + "subjectType": [ + "Patient" + ], + "item": [ + { + "linkId": "1", + "code": [ + { + "system": "http://example.org/system/code/sections", + "code": "COMORBIDITY" + } + ], + "type": "group", + "item": [ + { + "linkId": "1.1", + "code": [ + { + "system": "http://example.org/system/code/questions", + "code": "COMORB" + } + ], + "prefix": "1", + "type": "choice", + "options": { + "reference": "http://hl7.org/fhir/ValueSet/yesnodontknow" + }, + "item": [ + { + "linkId": "1.1.1", + "code": [ + { + "system": "http://example.org/system/code/sections", + "code": "CARDIAL" + } + ], + "type": "group", + "enableWhen": [ + { + "question": "1.1", + "answerCoding": { + "system": "http://hl7.org/fhir/v2/0136", + "code": "Y" + } + } + ], + "item": [ + { + "linkId": "1.1.1.1", + "code": [ + { + "system": "http://example.org/system/code/questions", + "code": "COMORBCAR" + } + ], + "prefix": "1.1", + "type": "choice", + "options": { + "reference": "http://hl7.org/fhir/ValueSet/yesnodontknow" + }, + "item": [ + { + "linkId": "1.1.1.1.1", + "code": [ + { + "system": "http://example.org/system/code/questions", + "code": "COMCAR00", + "display": "Angina Pectoris" + }, + { + "system": "http://snomed.info/sct", + "code": "194828000", + "display": "Angina (disorder)" + } + ], + "prefix": "1.1.1", + "type": "choice", + "options": { + "reference": "http://hl7.org/fhir/ValueSet/yesnodontknow" + } + }, + { + "linkId": "1.1.1.1.2", + "code": [ + { + "system": "http://snomed.info/sct", + "code": "22298006", + "display": "Myocardial infarction (disorder)" + } + ], + "prefix": "1.1.2", + "type": "choice", + "options": { + "reference": "http://hl7.org/fhir/ValueSet/yesnodontknow" + } + } + ] + }, + { + "linkId": "1.1.1.2", + "code": [ + { + "system": "http://example.org/system/code/questions", + "code": "COMORBVAS" + } + ], + "prefix": "1.2", + "type": "choice", + "options": { + "reference": "http://hl7.org/fhir/ValueSet/yesnodontknow" + } + } + ] + } + ] + } + ] + }, + { + "linkId": "2", + "code": [ + { + "system": "http://example.org/system/code/sections", + "code": "HISTOPATHOLOGY" + } + ], + "type": "group", + "item": [ + { + "linkId": "2.1", + "code": [ + { + "system": "http://example.org/system/code/sections", + "code": "ABDOMINAL" + } + ], + "type": "group", + "item": [ + { + "linkId": "2.1.2", + "code": [ + { + "system": "http://example.org/system/code/questions", + "code": "STADPT", + "display": "pT category" + } + ], + "type": "choice" + } + ] + } + ] + } + ] + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/3.0.2 STU3/Questionnaire.xml b/tests/Integration.Test/data/fhir/3.0.2 STU3/Questionnaire.xml new file mode 100644 index 000000000..5da84c398 --- /dev/null +++ b/tests/Integration.Test/data/fhir/3.0.2 STU3/Questionnaire.xml @@ -0,0 +1,133 @@ +<Questionnaire xmlns="http://hl7.org/fhir"> + <id value="Questionnaire"/> + <text> + <status value="generated"/> + <div xmlns="http://www.w3.org/1999/xhtml"> + <pre> + <b> Birth details - To be completed by health professional</b> + Name of child: ____________________________________ + Sex: __ + + Neonatal Information + Birth Weight (kg): ___________ + Birth Length (cm): ___________ + Vitamin K given : __ + 1st dose: ___________ + 2nd dose: ___________ + Hep B given : __ + Date given : ___________ + Abnormalities noted at birth: + _______________________________________________ + </pre> + </div> + </text> + <url value="http://hl7.org/fhir/Questionnaire/bb"/> + <title value="NSW Government My Personal Health Record"/> + <status value="draft"/> + <date value="2013-02-19"/> + <publisher value="New South Wales Department of Health"/> + <jurisdiction> + <coding> + <system value="urn:iso:std:iso:3166"/> + <code value="AU"/> + </coding> + </jurisdiction> + <subjectType value="Patient"/> + <item> + <linkId value="birthDetails"/> + <text value="Birth details - To be completed by health professional"/> + <type value="group"/> + <item> + <linkId value="group"/> + <type value="group"/> + <item> + <linkId value="nameOfChild"/> + <text value="Name of child"/> + <type value="string"/> + </item> + <item> + <linkId value="sex"/> + <text value="Sex"/> + <type value="choice"/> + <option> + <valueCoding> + <code value="F"/> + </valueCoding> + </option> + <option> + <valueCoding> + <code value="M"/> + </valueCoding> + </option> + </item> + </item> + <item> + <linkId value="neonatalInformation"/> + <text value="Neonatal Information"/> + <type value="group"/> + <item> + <linkId value="birthWeight"/> + <text value="Birth weight (kg)"/> + <type value="decimal"/> + </item> + <item> + <linkId value="birthLength"/> + <text value="Birth length (cm)"/> + <type value="decimal"/> + </item> + <item> + <linkId value="vitaminKgiven"/> + <text value="Vitamin K given"/> + <type value="choice"/> + <option> + <valueCoding> + <code value="INJECTION"/> + </valueCoding> + </option> + <option> + <valueCoding> + <code value="INTRAVENOUS"/> + </valueCoding> + </option> + <option> + <valueCoding> + <code value="ORAL"/> + </valueCoding> + </option> + <item> + <linkId value="vitaminKgivenDoses"/> + <type value="group"/> + <enableWhen> + <question value="vitaminKgiven"/> + <hasAnswer value="true"/> + </enableWhen> + <item> + <linkId value="vitaminiKDose1"/> + <text value="1st dose"/> + <type value="dateTime"/> + </item> + <item> + <linkId value="vitaminiKDose2"/> + <text value="2nd dose"/> + <type value="dateTime"/> + </item> + </item> + </item> + <item> + <linkId value="hepBgiven"/> + <text value="Hep B given y / n"/> + <type value="boolean"/> + <item> + <linkId value="hepBgivenDate"/> + <text value="Date given"/> + <type value="date"/> + </item> + </item> + <item> + <linkId value="abnormalitiesAtBirth"/> + <text value="Abnormalities noted at birth"/> + <type value="string"/> + </item> + </item> + </item> + </Questionnaire> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.0.1 R4/CodeSystem.json b/tests/Integration.Test/data/fhir/4.0.1 R4/CodeSystem.json new file mode 100644 index 000000000..96f45436d --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.0.1 R4/CodeSystem.json @@ -0,0 +1,166 @@ +{ + "resourceType": "CodeSystem", + "id": "CodeSystem", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <h2>NHIN PurposeOfUse</h2>\n <div>\n <p>This value set is suitable for use with the provenance resource. It is derived from, but not compatible with, the HL7 v3 Purpose of use Code system.</p>\n\n </div>\n <p>This code system http://healthit.gov/nhin/purposeofuse defines the following codes:</p>\n <table class=\"codes\">\n <tr>\n <td style=\"white-space:nowrap\">\n <b>Code</b>\n </td>\n <td>\n <b>Display</b>\n </td>\n <td>\n <b>Definition</b>\n </td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">TREATMENT\n <a name=\"nhin-purposeofuse-TREATMENT\"> </a>\n </td>\n <td>Treatment</td>\n <td>Treatment</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">PAYMENT\n <a name=\"nhin-purposeofuse-PAYMENT\"> </a>\n </td>\n <td>Payment</td>\n <td>Payment</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">OPERATIONS\n <a name=\"nhin-purposeofuse-OPERATIONS\"> </a>\n </td>\n <td>Operations</td>\n <td>Healthcare Operations</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">SYSADMIN\n <a name=\"nhin-purposeofuse-SYSADMIN\"> </a>\n </td>\n <td>Sysadmin</td>\n <td>System Administration</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">FRAUD\n <a name=\"nhin-purposeofuse-FRAUD\"> </a>\n </td>\n <td>Fraud</td>\n <td>Fraud detection</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">PSYCHOTHERAPY\n <a name=\"nhin-purposeofuse-PSYCHOTHERAPY\"> </a>\n </td>\n <td>Psychotherapy</td>\n <td>Use or disclosure of Psychotherapy Notes</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">TRAINING\n <a name=\"nhin-purposeofuse-TRAINING\"> </a>\n </td>\n <td>Training</td>\n <td>Use or disclosure by the covered entity for its own training programs</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">LEGAL\n <a name=\"nhin-purposeofuse-LEGAL\"> </a>\n </td>\n <td>Legal</td>\n <td>Use or disclosure by the covered entity to defend itself in a legal action</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">MARKETING\n <a name=\"nhin-purposeofuse-MARKETING\"> </a>\n </td>\n <td>Marketing</td>\n <td>Marketing</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">DIRECTORY\n <a name=\"nhin-purposeofuse-DIRECTORY\"> </a>\n </td>\n <td>Directory</td>\n <td>Use and disclosure for facility directories</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">FAMILY\n <a name=\"nhin-purposeofuse-FAMILY\"> </a>\n </td>\n <td>Family</td>\n <td>Disclose to a family member, other relative, or a close personal friend of the individual</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">PRESENT\n <a name=\"nhin-purposeofuse-PRESENT\"> </a>\n </td>\n <td>Present</td>\n <td>Uses and disclosures with the individual present.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">EMERGENCY\n <a name=\"nhin-purposeofuse-EMERGENCY\"> </a>\n </td>\n <td>Emergency</td>\n <td>Permission cannot practicably be provided because of the individual's incapacity or an emergency.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">DISASTER\n <a name=\"nhin-purposeofuse-DISASTER\"> </a>\n </td>\n <td>Disaster</td>\n <td>Use and disclosures for disaster relief purposes.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">PUBLICHEALTH\n <a name=\"nhin-purposeofuse-PUBLICHEALTH\"> </a>\n </td>\n <td>Public Health</td>\n <td>Uses and disclosures for public health activities.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">ABUSE\n <a name=\"nhin-purposeofuse-ABUSE\"> </a>\n </td>\n <td>Abuse</td>\n <td>Disclosures about victims of abuse, neglect or domestic violence.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">OVERSIGHT\n <a name=\"nhin-purposeofuse-OVERSIGHT\"> </a>\n </td>\n <td>Oversight</td>\n <td>Uses and disclosures for health oversight activities.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">JUDICIAL\n <a name=\"nhin-purposeofuse-JUDICIAL\"> </a>\n </td>\n <td>Judicial</td>\n <td>Disclosures for judicial and administrative proceedings.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">LAW\n <a name=\"nhin-purposeofuse-LAW\"> </a>\n </td>\n <td>Law Enforcement</td>\n <td>Disclosures for law enforcement purposes.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">DECEASED\n <a name=\"nhin-purposeofuse-DECEASED\"> </a>\n </td>\n <td>Deceased</td>\n <td>Uses and disclosures about decedents.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">DONATION\n <a name=\"nhin-purposeofuse-DONATION\"> </a>\n </td>\n <td>Donation</td>\n <td>Uses and disclosures for cadaveric organ, eye or tissue donation purposes</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">RESEARCH\n <a name=\"nhin-purposeofuse-RESEARCH\"> </a>\n </td>\n <td>Research</td>\n <td>Uses and disclosures for research purposes.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">THREAT\n <a name=\"nhin-purposeofuse-THREAT\"> </a>\n </td>\n <td>Threat</td>\n <td>Uses and disclosures to avert a serious threat to health or safety.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">GOVERNMENT\n <a name=\"nhin-purposeofuse-GOVERNMENT\"> </a>\n </td>\n <td>Government</td>\n <td>Uses and disclosures for specialized government functions.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">WORKERSCOMP\n <a name=\"nhin-purposeofuse-WORKERSCOMP\"> </a>\n </td>\n <td>Worker's Comp</td>\n <td>Disclosures for workers' compensation.</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">COVERAGE\n <a name=\"nhin-purposeofuse-COVERAGE\"> </a>\n </td>\n <td>Coverage</td>\n <td>Disclosures for insurance or disability coverage determination</td>\n </tr>\n <tr>\n <td style=\"white-space:nowrap\">REQUEST\n <a name=\"nhin-purposeofuse-REQUEST\"> </a>\n </td>\n <td>Request</td>\n <td>Request of the Individual</td>\n </tr>\n </table>\n </div>" + }, + "url": "http://healthit.gov/nhin/purposeofuse", + "version": "2.0", + "name": "NHIN PurposeOfUse", + "status": "active", + "experimental": false, + "date": "2010-01-29", + "publisher": "Nationwide Health Information Network (NHIN)", + "contact": [ + { + "telecom": [ + { + "system": "url", + "value": "https://www.healthit.gov/sites/default/files/nhin-authorization-framework-production-specification-v2.0-1.pdf" + } + ] + } + ], + "description": "This value set is suitable for use with the provenance resource. It is derived from, but not compatible with, the HL7 v3 Purpose of use Code system.", + "caseSensitive": true, + "valueSet": "http://hl7.org/fhir/ValueSet/nhin-purposeofuse", + "content": "complete", + "concept": [ + { + "code": "TREATMENT", + "display": "Treatment", + "definition": "Treatment" + }, + { + "code": "PAYMENT", + "display": "Payment", + "definition": "Payment" + }, + { + "code": "OPERATIONS", + "display": "Operations", + "definition": "Healthcare Operations" + }, + { + "code": "SYSADMIN", + "display": "Sysadmin", + "definition": "System Administration" + }, + { + "code": "FRAUD", + "display": "Fraud", + "definition": "Fraud detection" + }, + { + "code": "PSYCHOTHERAPY", + "display": "Psychotherapy", + "definition": "Use or disclosure of Psychotherapy Notes" + }, + { + "code": "TRAINING", + "display": "Training", + "definition": "Use or disclosure by the covered entity for its own training programs" + }, + { + "code": "LEGAL", + "display": "Legal", + "definition": "Use or disclosure by the covered entity to defend itself in a legal action" + }, + { + "code": "MARKETING", + "display": "Marketing", + "definition": "Marketing" + }, + { + "code": "DIRECTORY", + "display": "Directory", + "definition": "Use and disclosure for facility directories" + }, + { + "code": "FAMILY", + "display": "Family", + "definition": "Disclose to a family member, other relative, or a close personal friend of the individual" + }, + { + "code": "PRESENT", + "display": "Present", + "definition": "Uses and disclosures with the individual present." + }, + { + "code": "EMERGENCY", + "display": "Emergency", + "definition": "Permission cannot practicably be provided because of the individual's incapacity or an emergency." + }, + { + "code": "DISASTER", + "display": "Disaster", + "definition": "Use and disclosures for disaster relief purposes." + }, + { + "code": "PUBLICHEALTH", + "display": "Public Health", + "definition": "Uses and disclosures for public health activities." + }, + { + "code": "ABUSE", + "display": "Abuse", + "definition": "Disclosures about victims of abuse, neglect or domestic violence." + }, + { + "code": "OVERSIGHT", + "display": "Oversight", + "definition": "Uses and disclosures for health oversight activities." + }, + { + "code": "JUDICIAL", + "display": "Judicial", + "definition": "Disclosures for judicial and administrative proceedings." + }, + { + "code": "LAW", + "display": "Law Enforcement", + "definition": "Disclosures for law enforcement purposes." + }, + { + "code": "DECEASED", + "display": "Deceased", + "definition": "Uses and disclosures about decedents." + }, + { + "code": "DONATION", + "display": "Donation", + "definition": "Uses and disclosures for cadaveric organ, eye or tissue donation purposes" + }, + { + "code": "RESEARCH", + "display": "Research", + "definition": "Uses and disclosures for research purposes." + }, + { + "code": "THREAT", + "display": "Threat", + "definition": "Uses and disclosures to avert a serious threat to health or safety." + }, + { + "code": "GOVERNMENT", + "display": "Government", + "definition": "Uses and disclosures for specialized government functions." + }, + { + "code": "WORKERSCOMP", + "display": "Worker's Comp", + "definition": "Disclosures for workers' compensation." + }, + { + "code": "COVERAGE", + "display": "Coverage", + "definition": "Disclosures for insurance or disability coverage determination" + }, + { + "code": "REQUEST", + "display": "Request", + "definition": "Request of the Individual" + } + ] + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.0.1 R4/CodeSystem.xml b/tests/Integration.Test/data/fhir/4.0.1 R4/CodeSystem.xml new file mode 100644 index 000000000..adc543450 --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.0.1 R4/CodeSystem.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<CodeSystem xmlns="http://hl7.org/fhir"> + <id value="CodeSystem"/> + <text> + <status value="generated"/> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h2> Code system summary example for ACME body sites</h2> + <div> + <p> This is an example code system summary for the ACME codes for body site.</p> + + </div> + <p> This code system http://hl7.org/fhir/CodeSystem/summary defines many codes, but they are + not represented here</p> + </div> + </text> + <url value="http://hl7.org/fhir/CodeSystem/summary"/> + <version value="4.0.1"/> + <name value="Code system summary example for ACME body sites"/> + <status value="draft"/> + <experimental value="true"/> + <publisher value="HL7 International"/> + <contact> + <name value="FHIR project team"/> + <telecom> + <system value="url"/> + <value value="http://hl7.org/fhir"/> + </telecom> + </contact> + <description value="This is an example code system summary for the ACME codes for body site."/> + <useContext> + <code> + <system value="http://example.org/CodeSystem/contexttype"/> + <code value="species"/> + </code> + <valueCodeableConcept> + <coding> + <system value="http://snomed.info/sct"/> + <code value="337915000"/> + <display value="Homo sapiens (organism)"/> + </coding> + </valueCodeableConcept> + </useContext> + <jurisdiction> + <coding> + <system value="urn:iso:std:iso:3166"/> + <code value="CA"/> + </coding> + </jurisdiction> + <caseSensitive value="true"/> + <content value="not-present"/> + <count value="92"/> +</CodeSystem> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.0.1 R4/Observation.json b/tests/Integration.Test/data/fhir/4.0.1 R4/Observation.json new file mode 100644 index 000000000..ea36425a2 --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.0.1 R4/Observation.json @@ -0,0 +1,120 @@ +{ + "resourceType": "Observation", + "id": "Observation", + "meta": { + "profile": [ + "http://hl7.org/fhir/StructureDefinition/vitalsigns" + ] + }, + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: blood-pressure-dar</p><p><b>meta</b>: </p><p><b>identifier</b>: urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281</p><p><b>status</b>: final</p><p><b>category</b>: Vital Signs <span>(Details : {http://terminology.hl7.org/CodeSystem/observation-category code 'vital-signs' = 'Vital Signs', given as 'Vital Signs'})</span></p><p><b>code</b>: Blood pressure systolic & diastolic <span>(Details : {LOINC code '85354-9' = 'Blood pressure panel with all children optional', given as 'Blood pressure panel with all children optional'})</span></p><p><b>subject</b>: <a>Patient/example</a></p><p><b>effective</b>: 17/09/2012</p><p><b>performer</b>: <a>Practitioner/example</a></p><p><b>interpretation</b>: Below low normal <span>(Details : {http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation code 'L' = 'Low', given as 'low'})</span></p><p><b>bodySite</b>: Right arm <span>(Details : {SNOMED CT code '368209003' = 'Right upper arm', given as 'Right arm'})</span></p><blockquote><p><b>component</b></p><p><b>code</b>: Systolic blood pressure <span>(Details : {LOINC code '8480-6' = 'Systolic blood pressure', given as 'Systolic blood pressure'}; {SNOMED CT code '271649006' = 'Systolic blood pressure', given as 'Systolic blood pressure'}; {http://acme.org/devices/clinical-codes code 'bp-s' = 'bp-s', given as 'Systolic Blood pressure'})</span></p><p><b>value</b>: 107 mmHg<span> (Details: UCUM code mm[Hg] = 'mmHg')</span></p></blockquote><blockquote><p><b>component</b></p><p><b>code</b>: Diastolic blood pressure <span>(Details : {LOINC code '8462-4' = 'Diastolic blood pressure', given as 'Diastolic blood pressure'})</span></p><p><b>dataAbsentReason</b>: Not Performed <span>(Details : {http://terminology.hl7.org/CodeSystem/data-absent-reason code 'not-performed' = 'Not Performed', given as 'Not Performed'})</span></p></blockquote></div>" + }, + "identifier": [ + { + "system": "urn:ietf:rfc:3986", + "value": "urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281" + } + ], + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood pressure panel with all children optional" + } + ], + "text": "Blood pressure systolic & diastolic" + }, + "subject": { + "reference": "Patient/example" + }, + "effectiveDateTime": "2012-09-17", + "performer": [ + { + "reference": "Practitioner/example" + } + ], + "interpretation": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", + "code": "L", + "display": "low" + } + ], + "text": "Below low normal" + } + ], + "bodySite": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "368209003", + "display": "Right arm" + } + ] + }, + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic blood pressure" + }, + { + "system": "http://snomed.info/sct", + "code": "271649006", + "display": "Systolic blood pressure" + }, + { + "system": "http://acme.org/devices/clinical-codes", + "code": "bp-s", + "display": "Systolic Blood pressure" + } + ] + }, + "valueQuantity": { + "value": 107, + "unit": "mmHg", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic blood pressure" + } + ] + }, + "dataAbsentReason": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/data-absent-reason", + "code": "not-performed", + "display": "Not Performed" + } + ] + } + } + ] + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.0.1 R4/Observation.xml b/tests/Integration.Test/data/fhir/4.0.1 R4/Observation.xml new file mode 100644 index 000000000..0622aaf14 --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.0.1 R4/Observation.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<Observation xmlns="http://hl7.org/fhir"> + <id value="Observation"/> + <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative with Details</b> </p> <p> <b> id</b> : 656</p> <p> <b> identifier</b> : patientId-urn:oid:1.2.4~0000000000000000~152584~20170503155426~820</p> <p> <b> status</b> : final</p> <p> <b> code</b> : MDC_FLOW_AWAY_EXP_FORCED_PEAK <span> (Details : {urn:iso:std:iso:11073:10101 code '152584' = '152584', given as 'MDC_FLOW_AWAY_EXP_FORCED + _PEAK'})</span> </p> <p> <b> subject</b> : <a> Patient/PatientId-patientId</a> </p> <p> <b> effective</b> : 03/05/2017 3:54:26 PM</p> <p> <b> performer</b> : <a> Patient/PatientId-patientId</a> </p> <p> <b> value</b> : 820 cL/s<span> (Details: urn:iso:std:iso:11073:10101 code 265201 = '265201')</span> </p> </div> </text> <identifier> + <value value="patientId-urn:oid:1.2.4~0000000000000000~152584~20170503155426~820"/> + </identifier> + <status value="final"/> + <code> + <coding> + <system value="urn:iso:std:iso:11073:10101"/> + <code value="152584"/> + <display value="MDC_FLOW_AWAY_EXP_FORCED_PEAK"/> + </coding> + </code> + <subject> + <reference value="Patient/PatientId-patientId"/> + </subject> + <effectiveDateTime value="2017-05-03T15:54:26-04:00"/> + <performer> + <reference value="Patient/PatientId-patientId"/> + </performer> + <valueQuantity> + <value value="820"/> + <unit value="cL/s"/> + <system value="urn:iso:std:iso:11073:10101"/> + <code value="265201"/> + </valueQuantity> + <!-- - +Removed the .related type qualified-by - if needed would be an extension + + <related> + <type value="qualified-by"/> + <target> + <identifier> + <value value="3.14159.20170619185932"/> + </identifier> + </target> + </related> + --> +</Observation> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.0.1 R4/OperationOutcome.json b/tests/Integration.Test/data/fhir/4.0.1 R4/OperationOutcome.json new file mode 100644 index 000000000..c194bcf0d --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.0.1 R4/OperationOutcome.json @@ -0,0 +1,24 @@ +{ + "resourceType": "OperationOutcome", + "id": "OperationOutcome", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <p>The code "W" is not known and not legal Patient.gender.</p>\n </div>" + }, + "issue": [ + { + "severity": "error", + "code": "code-invalid", + "details": { + "text": "The code \"W\" is not known and not legal in this context" + }, + "diagnostics": "Acme.Interop.FHIRProcessors.Patient.processGender line 2453", + "location": [ + "/f:Patient/f:gender" + ], + "expression": [ + "Patient.gender" + ] + } + ] + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.0.1 R4/OperationOutcome.xml b/tests/Integration.Test/data/fhir/4.0.1 R4/OperationOutcome.xml new file mode 100644 index 000000000..8cce5dad6 --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.0.1 R4/OperationOutcome.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<OperationOutcome xmlns="http://hl7.org/fhir"> + <id value="OperationOutcome"/> + <text> + <status value="generated"/> + <div xmlns="http://www.w3.org/1999/xhtml"> + <p> All OK</p> + </div> + </text> + <issue> + <severity value="information"/> + <code value="informational"/> + <details> + <text value="All OK"/> + </details> + </issue> +</OperationOutcome> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.0.1 R4/Patient.json b/tests/Integration.Test/data/fhir/4.0.1 R4/Patient.json new file mode 100644 index 000000000..de4fc039e --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.0.1 R4/Patient.json @@ -0,0 +1,116 @@ +{ + "resourceType": "Patient", + "id": "Patient", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: f001</p><p><b>identifier</b>: 738472983 (USUAL), ?? (USUAL)</p><p><b>active</b>: true</p><p><b>name</b>: Pieter van de Heuvel </p><p><b>telecom</b>: ph: 0648352638(MOBILE), p.heuvel@gmail.com(HOME)</p><p><b>gender</b>: male</p><p><b>birthDate</b>: 17/11/1944</p><p><b>deceased</b>: false</p><p><b>address</b>: Van Egmondkade 23 Amsterdam 1024 RJ NLD (HOME)</p><p><b>maritalStatus</b>: Getrouwd <span>(Details : {http://terminology.hl7.org/CodeSystem/v3-MaritalStatus code 'M' = 'Married', given as 'Married'})</span></p><p><b>multipleBirth</b>: true</p><h3>Contacts</h3><table><tr><td>-</td><td><b>Relationship</b></td><td><b>Name</b></td><td><b>Telecom</b></td></tr><tr><td>*</td><td>Emergency Contact <span>(Details : {http://terminology.hl7.org/CodeSystem/v2-0131 code 'C' = 'Emergency Contact)</span></td><td>Sarah Abels </td><td>ph: 0690383372(MOBILE)</td></tr></table><h3>Communications</h3><table><tr><td>-</td><td><b>Language</b></td><td><b>Preferred</b></td></tr><tr><td>*</td><td>Nederlands <span>(Details : {urn:ietf:bcp:47 code 'nl' = 'Dutch', given as 'Dutch'})</span></td><td>true</td></tr></table><p><b>managingOrganization</b>: <a>Burgers University Medical Centre</a></p></div>" + }, + "identifier": [ + { + "use": "usual", + "system": "urn:oid:2.16.840.1.113883.2.4.6.3", + "value": "738472983" + }, + { + "use": "usual", + "system": "urn:oid:2.16.840.1.113883.2.4.6.3" + } + ], + "active": true, + "name": [ + { + "use": "usual", + "family": "van de Heuvel", + "given": [ + "Pieter" + ], + "suffix": [ + "MSc" + ] + } + ], + "telecom": [ + { + "system": "phone", + "value": "0648352638", + "use": "mobile" + }, + { + "system": "email", + "value": "p.heuvel@gmail.com", + "use": "home" + } + ], + "gender": "male", + "birthDate": "1944-11-17", + "deceasedBoolean": false, + "address": [ + { + "use": "home", + "line": [ + "Van Egmondkade 23" + ], + "city": "Amsterdam", + "postalCode": "1024 RJ", + "country": "NLD" + } + ], + "maritalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", + "code": "M", + "display": "Married" + } + ], + "text": "Getrouwd" + }, + "multipleBirthBoolean": true, + "contact": [ + { + "relationship": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0131", + "code": "C" + } + ] + } + ], + "name": { + "use": "usual", + "family": "Abels", + "given": [ + "Sarah" + ] + }, + "telecom": [ + { + "system": "phone", + "value": "0690383372", + "use": "mobile" + } + ] + } + ], + "communication": [ + { + "language": { + "coding": [ + { + "system": "urn:ietf:bcp:47", + "code": "nl", + "display": "Dutch" + } + ], + "text": "Nederlands" + }, + "preferred": true + } + ], + "managingOrganization": { + "reference": "Organization/f001", + "display": "Burgers University Medical Centre" + } + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.0.1 R4/Patient.xml b/tests/Integration.Test/data/fhir/4.0.1 R4/Patient.xml new file mode 100644 index 000000000..93f5c6c4a --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.0.1 R4/Patient.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<Patient xmlns="http://hl7.org/fhir"> + <id value="Patient"/> + <text> + <status value="generated"/> + <div xmlns="http://www.w3.org/1999/xhtml"> + + <p> Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321</p> + + </div> + </text> + <identifier> + <use value="usual"/> + <type> + <coding> + <system value="http://terminology.hl7.org/CodeSystem/v2-0203"/> + <code value="MR"/> + </coding> + </type> + <system value="urn:oid:0.1.2.3.4.5.6.7"/> + <value value="654321"/> + </identifier> + <active value="true"/> + <name> + <use value="official"/> + <family value="Donald"/> + <given value="Duck"/> + </name> + <gender value="male"/> + <photo> + <contentType value="image/gif"/> + <data value="R0lGODlhEwARAPcAAAAAAAAA/+9aAO+1AP/WAP/eAP/eCP/eEP/eGP/nAP/nCP/nEP/nIf/nKf/nUv/nWv/vAP/vCP/vEP/vGP/v + If/vKf/vMf/vOf/vWv/vY//va//vjP/3c//3lP/3nP//tf//vf/////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////yH5BAEAAAEALAAAAAATABEAAAi+AAMIDDCgYMGBCBMSvMCQ4QCFCQcwDBGCA4cLDyEGEC + DxAoAQHjxwyKhQAMeGIUOSJJjRpIAGDS5wCDly4AALFlYOgHlBwwOSNydM0AmzwYGjBi8IHWoTgQYORg8QIGDAwAKhESI8HIDgwQa + RDI1WXXAhK9MBBzZ8/XDxQoUFZC9IiCBh6wEHGz6IbNuwQoSpWxEgyLCXL8O/gAnylNlW6AUEBRIL7Og3KwQIiCXb9HsZQoIEUzUj + NEiaNMKAAAA7"/> + </photo> + <contact> + <relationship> + <coding> + <system value="http://terminology.hl7.org/CodeSystem/v2-0131"/> + <code value="E"/> + </coding> + </relationship> + <organization> + <reference value="Organization/1"/> + <display value="Walt Disney Corporation"/> + </organization> + </contact> + <managingOrganization> + <reference value="Organization/1"/> + <display value="ACME Healthcare, Inc"/> + </managingOrganization> + <link> + <other> + <reference value="Patient/pat2"/> + </other> + <type value="seealso"/> + </link> +</Patient> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.3.0 R4B/Bundle.json b/tests/Integration.Test/data/fhir/4.3.0 R4B/Bundle.json new file mode 100644 index 000000000..31cb970ec --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.3.0 R4B/Bundle.json @@ -0,0 +1,243 @@ +{ + "resourceType": "Bundle", + "id": "Bundle", + "type": "collection", + "entry": [ + { + "fullUrl": "http://example.org/fhir/Patient/23", + "resource": { + "resourceType": "Patient", + "id": "23", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Anonymous Patient</b> (no stated gender), DoB Unknown ( id: 1234567)</p></div>" + }, + "identifier": [ + { + "system": "http://example.org/ids", + "value": "1234567" + } + ] + } + }, + { + "fullUrl": "urn:uuid:04121321-4af5-424c-a0e1-ed3aab1c349d", + "resource": { + "resourceType": "Patient", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Anonymous Patient</b> (no stated gender), DoB Unknown</p></div>" + } + } + }, + { + "fullUrl": "http://example.org/fhir/Observation/123", + "resource": { + "resourceType": "Observation", + "id": "123", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource "123" </p></div><p><b>status</b>: final</p><p><b>code</b>: Glucose [Moles/volume] in Blood <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#15074-8)</span></p><p><b>subject</b>: <a href=\"todo.html\">Patient/23</a></p></div>" + }, + "status": "final", + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "15074-8", + "display": "Glucose [Moles/volume] in Blood" + } + ] + }, + "subject": { + "reference": "Patient/23" + } + } + }, + { + "fullUrl": "http://example.org/fhir/Observation/124", + "resource": { + "resourceType": "Observation", + "id": "124", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource "124" </p></div><p><b>status</b>: final</p><p><b>code</b>: Glucose [Moles/volume] in Blood <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#15074-8)</span></p><p><b>subject</b>: <a href=\"todo.html\">http://example.org/fhir/Patient/23</a></p></div>" + }, + "status": "final", + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "15074-8", + "display": "Glucose [Moles/volume] in Blood" + } + ] + }, + "subject": { + "reference": "http://example.org/fhir/Patient/23" + } + } + }, + { + "fullUrl": "http://example.org/fhir/Observation/12", + "resource": { + "resourceType": "Observation", + "id": "12", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource "12" </p></div><p><b>status</b>: final</p><p><b>code</b>: Glucose [Moles/volume] in Blood <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#15074-8)</span></p><p><b>subject</b>: <a href=\"todo.html\">urn:uuid:04121321-4af5-424c-a0e1-ed3aab1c349d</a></p></div>" + }, + "status": "final", + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "15074-8", + "display": "Glucose [Moles/volume] in Blood" + } + ] + }, + "subject": { + "reference": "urn:uuid:04121321-4af5-424c-a0e1-ed3aab1c349d" + } + } + }, + { + "fullUrl": "http://example.org/fhir/Observation/14", + "resource": { + "resourceType": "Observation", + "id": "14", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource "14" </p></div><p><b>status</b>: final</p><p><b>code</b>: Glucose [Moles/volume] in Blood <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#15074-8)</span></p><p><b>subject</b>: <a href=\"todo.html\">http://example.org/fhir-2/Patient/1</a></p></div>" + }, + "status": "final", + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "15074-8", + "display": "Glucose [Moles/volume] in Blood" + } + ] + }, + "subject": { + "reference": "http://example.org/fhir-2/Patient/1" + } + } + }, + { + "fullUrl": "http://example.org/fhir-2/Observation/14", + "resource": { + "resourceType": "Observation", + "id": "14", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource "14" </p></div><p><b>status</b>: final</p><p><b>code</b>: Glucose [Moles/volume] in Blood <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#15074-8)</span></p><p><b>subject</b>: <a href=\"todo.html\">Patient/23</a></p></div>" + }, + "status": "final", + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "15074-8", + "display": "Glucose [Moles/volume] in Blood" + } + ] + }, + "subject": { + "reference": "Patient/23" + } + } + }, + { + "fullUrl": "http://example.org/fhir/Patient/45", + "resource": { + "resourceType": "Patient", + "id": "45", + "meta": { + "versionId": "1" + }, + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Name 1</b> (no stated gender), DoB Unknown</p></div>" + }, + "name": [ + { + "text": "Name 1" + } + ] + } + }, + { + "fullUrl": "http://example.org/fhir/Patient/45", + "resource": { + "resourceType": "Patient", + "id": "45", + "meta": { + "versionId": "2" + }, + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Name 2</b> (no stated gender), DoB Unknown</p></div>" + }, + "name": [ + { + "text": "Name 2" + } + ] + } + }, + { + "fullUrl": "http://example.org/fhir/Observation/47", + "resource": { + "resourceType": "Observation", + "id": "47", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource "47" </p></div><p><b>status</b>: final</p><p><b>code</b>: Glucose [Moles/volume] in Blood <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#15074-8)</span></p><p><b>subject</b>: <a href=\"todo.html\">Patient/45/_history/2</a></p></div>" + }, + "status": "final", + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "15074-8", + "display": "Glucose [Moles/volume] in Blood" + } + ] + }, + "subject": { + "reference": "Patient/45/_history/2" + } + } + }, + { + "fullUrl": "http://example.org/fhir/Observation/48", + "resource": { + "resourceType": "Observation", + "id": "48", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource "48" </p></div><p><b>status</b>: final</p><p><b>code</b>: Glucose [Moles/volume] in Blood <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#15074-8)</span></p><p><b>subject</b>: <span/></p></div>" + }, + "status": "final", + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "15074-8", + "display": "Glucose [Moles/volume] in Blood" + } + ] + }, + "subject": { + "identifier": { + "system": "http://example.org/ids", + "value": "1234567" + } + } + } + } + ] + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.3.0 R4B/Bundle.xml b/tests/Integration.Test/data/fhir/4.3.0 R4B/Bundle.xml new file mode 100644 index 000000000..981f71a27 --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.3.0 R4B/Bundle.xml @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<Bundle xmlns="http://hl7.org/fhir"> + <id value="Bundle"/> +<!-- this example bundle is a transaction response --> + <meta> + <lastUpdated value="2014-08-18T01:43:33Z"/> + <!-- when the transaction response was constructed --> + </meta> + <type value="transaction-response"/> +<!-- + one entry for each entry in the transaction, in order, with a + response + --> + <entry> + <fullUrl value="http://example.org/fhir/Patient/12423"/> + <resource> + <!-- response for the simple create operation --> + <!-- whether to return the result resource depends on client preference --> + <Patient> + <id value="12423"/> + <meta> + <versionId value="1"/> + <lastUpdated value="2014-08-18T01:43:31Z"/> + </meta> + <text> + <status value="generated"/> + <div xmlns="http://www.w3.org/1999/xhtml">Some narrative</div> + </text> + <active value="true"/> + <name> + <use value="official"/> + <family value="Chalmers"/> + <given value="Peter"/> + <given value="James"/> + </name> + <gender value="male"/> + <birthDate value="1974-12-25"/> + </Patient> + </resource> + <!-- now, details about the action to take with the resource --> + <response> + <!-- important responses from the server --> + <status value="201 Created"/> + <location value="Patient/12423/_history/1"/> + <etag value="W/"1""/> + <lastModified value="2014-08-18T01:43:33Z"/> + <outcome> + <OperationOutcome> + <issue> + <severity value="warning"/> + <code value="not-found"/> + <details> + <text value="The Managing organization was not known and was deleted"/> + </details> + <expression value="Patient.managingOrganization"/> + </issue> + </OperationOutcome> + </outcome> + </response> + </entry> + <entry> + <!-- response to the conditional create operation --> + <!-- in this case, there was a match to the If-None-Exist header --> + <response> + <!-- no action taken --> + <status value="200 OK"/> + </response> + </entry> + <entry> + <!-- response to a simple update operation --> + <!-- no return resource for this example, though in a + real transaction, all entries would have a resource or all would not + --> + <response> + <status value="200 OK"/> + <location value="Patient/123/_history/4"/> + <etag value="W/"4""/> + </response> + </entry> + <entry> + <!-- response to the conditional update operation --> + <response> + <!-- created a new resource for this one --> + <status value="201 Created"/> + <location value="Patient/12424/_history/1"/> + <etag value="W/"1""/> + </response> + </entry> + <entry> + <!-- response to the 2nd conditional update operation --> + <response> + <!-- created a new resource for this one --> + <status value="200 ok"/> + <location value="Patient/123a/_history/3"/> + <etag value="W/"3""/> + </response> + </entry> + <entry> + <!-- response to the simple delete operation --> + <response> + <!-- successful deletion --> + <status value="202 Accepted"/> + </response> + </entry> + <entry> + <!-- response to the conditional delete operation --> + <response> + <!-- delete matching resource - but you can't find out what was deleted - an inherent limitation + in a condition delete --> + <status value="DELETE"/> + </response> + </entry> + <entry> + <fullUrl value="urn:uuid:7f9724ed-ef8d-4434-aacb-41869db83233"/> + <resource> + <!-- operation response --> + <Parameters> + <parameter> + <name value="name"/> + <valueString value="LOINC"/> + </parameter> + <!-- etc. --> + </Parameters> + </resource> + <response> + <!-- POST to [base]/ValueSet/$lookup - invoking a lookup operation (see Terminology Service) + --> + <status value="200 ok"/> + </response> + </entry> + <entry> + <fullUrl value="urn:uuid:e7bcef8e-5ef9-4d2b-87d5-b42b1eec9125"/> + <resource> + <!-- response to search --> + <Bundle> + <id value="fb6ed6cb-324e-4588-87cd-0c92c68986ca"/> + <type value="searchset"/> + <!-- etc. --> + </Bundle> + </resource> + <response> + <status value="200 OK"/> + </response> + </entry> + <entry> + <!-- response to conditional read - no changes --> + <response> + <status value="304 Not Modified"/> + </response> + </entry> +</Bundle> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.3.0 R4B/Observation.json b/tests/Integration.Test/data/fhir/4.3.0 R4B/Observation.json new file mode 100644 index 000000000..b5466f5d2 --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.3.0 R4B/Observation.json @@ -0,0 +1,71 @@ +{ + "resourceType": "Observation", + "id": "Observation", + "text": { + "status": "extensions", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource "example-genetics-1" </p></div><p><b>Gene</b>: EGFR <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"http://terminology.hl7.org/3.1.0/CodeSystem-v3-hgnc.html\">HUGO Gene Nomenclature</a>#3236)</span></p><p><b>DNARegionName</b>: Exon 21</p><p><b>GenomicSourceClass</b>: somatic <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#LA6684-0)</span></p><p><b>status</b>: final</p><p><b>code</b>: The material on this page will be removed in a future release. This content is deprecated and SHOULD NOT be used. Implementers are instead directed to the ([Genomics Reporting Implementation Guide](http://hl7.org/fhir/uv/genomics-reporting/index.html)) for guidance. Genetic analysis master panel-- This is the parent OBR for the panel holding all of the associated observations that can be reported with a molecular genetics analysis result. <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#55233-1)</span></p><p><b>subject</b>: <a href=\"patient-example.html\">Patient/example: Molecular Lab Patient ID: HOSP-23456</a> "Peter CHALMERS"</p><p><b>effective</b>: 2013-04-03T15:30:10+01:00</p><p><b>performer</b>: <a href=\"practitioner-example.html\">Practitioner/example: Molecular Diagnostics Laboratory</a> "Adam CAREFUL"</p><p><b>value</b>: Positive <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://browser.ihtsdotools.org/\">SNOMED CT</a>#10828004)</span></p><p><b>device</b>: <a href=\"device-example.html\">Device/example</a></p></div>" + }, + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://www.genenames.org", + "code": "3236", + "display": "EGFR" + } + ] + } + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName", + "valueString": "Exon 21" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://loinc.org", + "code": "LA6684-0", + "display": "somatic" + } + ] + } + } + ], + "status": "final", + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "55233-1", + "display": "The material on this page will be removed in a future release. This content is deprecated and SHOULD NOT be used. Implementers are instead directed to the ([Genomics Reporting Implementation Guide](http://hl7.org/fhir/uv/genomics-reporting/index.html)) for guidance. Genetic analysis master panel-- This is the parent OBR for the panel holding all of the associated observations that can be reported with a molecular genetics analysis result." + } + ] + }, + "subject": { + "reference": "Patient/example", + "display": "Molecular Lab Patient ID: HOSP-23456" + }, + "effectiveDateTime": "2013-04-03T15:30:10+01:00", + "performer": [ + { + "reference": "Practitioner/example", + "display": "Molecular Diagnostics Laboratory" + } + ], + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "10828004", + "display": "Positive" + } + ] + }, + "device": { + "reference": "Device/example" + } +} \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.3.0 R4B/Observation.xml b/tests/Integration.Test/data/fhir/4.3.0 R4B/Observation.xml new file mode 100644 index 000000000..f2d91cb6b --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.3.0 R4B/Observation.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<Observation xmlns="http://hl7.org/fhir"> + <id value="Observation"/> <!-- urn:oid:2.16.840.1.113883.4.642.1.7 --><!-- 2.16.840.1.113883.4.642.1.118 --><text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><p> <b> Generated Narrative</b> </p> <div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px + solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource "f001" </p> </div> <p> <b> identifier</b> : id: 6323 (OFFICIAL)</p> <p> <b> status</b> : final</p> <p> <b> code</b> : Glucose [Moles/volume] in Blood <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="https://loinc.org/">LOINC</a> #15074-8)</span> </p> <p> <b> subject</b> : <a href="patient-f001.html">Patient/f001: P. van de Heuvel</a> "Pieter VAN DE HEUVEL"</p> <p> <b> effective</b> : 2013-04-02T09:30:10+01:00 --> (ongoing)</p> <p> <b> issued</b> : 04/04/2013 1:30:10 AM</p> <p> <b> performer</b> : <a href="practitioner-f005.html">Practitioner/f005: A. Langeveld</a> "Langeveld ANNE"</p> <p> <b> value</b> : 6.3 mmol/l<span style="background: LightGoldenRodYellow"> (Details: UCUM code mmol/L = 'mmol/L')</span> </p> <p> <b> interpretation</b> : High <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="http://terminology.hl7.org/3.1.0/CodeSystem-v3-ObservationInterpretation.html">ObservationInterpretation</a> #H)</span> </p> <h3> ReferenceRanges</h3> <table class="grid"><tr> <td> -</td> <td> <b> Low</b> </td> <td> <b> High</b> </td> </tr> <tr> <td> *</td> <td> 3.1 mmol/l<span style="background: LightGoldenRodYellow"> (Details: UCUM code mmol/L = 'mmol/L')</span> </td> <td> 6.2 mmol/l<span style="background: LightGoldenRodYellow"> (Details: UCUM code mmol/L = 'mmol/L')</span> </td> </tr> </table> </div> </text> <identifier> + <use value="official"/> + <system value="http://www.bmc.nl/zorgportal/identifiers/observations"/> + <value value="6323"/> + </identifier> + <status value="final"/> + <code> + <coding> + <system value="http://loinc.org"/> + <code value="15074-8"/> + <display value="Glucose [Moles/volume] in Blood"/> + </coding> + </code> + <subject> + <reference value="Patient/f001"/> + <display value="P. van de Heuvel"/> + </subject> + <effectivePeriod> + <start value="2013-04-02T09:30:10+01:00"/> + </effectivePeriod> + <issued value="2013-04-03T15:30:10+01:00"/> + <performer> + <reference value="Practitioner/f005"/> + <display value="A. Langeveld"/> + </performer> + <valueQuantity> + <value value="6.3"/> + <unit value="mmol/l"/> + <system value="http://unitsofmeasure.org"/> + <code value="mmol/L"/> + </valueQuantity> + <interpretation> + <coding> + <system value="http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation"/> + <code value="H"/> + <display value="High"/> + </coding> + </interpretation> + <referenceRange> + <low> + <value value="3.1"/> + <unit value="mmol/l"/> + <system value="http://unitsofmeasure.org"/> + <code value="mmol/L"/> + </low> + <high> + <value value="6.2"/> + <unit value="mmol/l"/> + <system value="http://unitsofmeasure.org"/> + <code value="mmol/L"/> + </high> + </referenceRange> +</Observation> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.3.0 R4B/Patient.json b/tests/Integration.Test/data/fhir/4.3.0 R4B/Patient.json new file mode 100644 index 000000000..8d3da9b6c --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.3.0 R4B/Patient.json @@ -0,0 +1,112 @@ +{ + "resourceType": "Patient", + "id": "Patient", + "text": { + "status": "generated", + "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n \n <table>\n \n <tbody>\n \n <tr>\n \n <td>Id</td>\n \n <td>Kenzi (Dog: Golden Retriever)</td>\n \n </tr>\n \n <tr>\n \n <td>Owner</td>\n \n <td>Peter Chalmers, 534 Erewhon, Pleasantville, Vic, 3999</td>\n \n </tr>\n \n <tr>\n \n <td>Contacts</td>\n \n <td>Work: (03) 5555 6473</td>\n \n </tr>\n \n <tr>\n \n <td>Id</td>\n \n <td>Dog Tag: 1234123 (Maroondah City Council)</td>\n \n </tr>\n \n </tbody>\n \n </table>\n \n </div>" + }, + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-animal", + "extension": [ + { + "url": "species", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://hl7.org/fhir/animal-species", + "code": "canislf", + "display": "Dog" + } + ] + } + }, + { + "url": "breed", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "58108001", + "display": "Golden retriever" + }, + { + "system": "http://example.org/fhir/CodeSystem/animal-breed", + "code": "gret", + "display": "Golden Retriever" + } + ] + } + }, + { + "url": "genderStatus", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://hl7.org/fhir/animal-genderstatus", + "code": "neutered" + } + ] + } + } + ] + } + ], + "identifier": [ + { + "type": { + "text": "Dog Tag" + }, + "system": "http://www.maroondah.vic.gov.au/AnimalRegFees.aspx", + "value": "1234123", + "period": { + "start": "2010-05-31" + }, + "assigner": { + "display": "Maroondah City Council" + } + } + ], + "active": true, + "name": [ + { + "use": "usual", + "given": [ + "Kenzi" + ] + } + ], + "gender": "female", + "birthDate": "2010-03-23", + "contact": [ + { + "relationship": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0131", + "code": "C" + } + ] + } + ], + "name": { + "family": "Chalmers", + "given": [ + "Peter", + "James" + ] + }, + "telecom": [ + { + "system": "phone", + "value": "(03) 5555 6473", + "use": "work" + } + ] + } + ], + "managingOrganization": { + "display": "Pete's Vetinary Services" + } + } \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/4.3.0 R4B/Patient.xml b/tests/Integration.Test/data/fhir/4.3.0 R4B/Patient.xml new file mode 100644 index 000000000..5345703fa --- /dev/null +++ b/tests/Integration.Test/data/fhir/4.3.0 R4B/Patient.xml @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<Patient xmlns="http://hl7.org/fhir"> + <id value="Patient"/> + <text> + <status value="generated"/> + <div xmlns="http://www.w3.org/1999/xhtml"> + <table> + <tbody> + <tr> + <td> Name</td> + <td> Peter James + <b> Chalmers</b> ("Jim") + </td> + </tr> + <tr> + <td> Address</td> + <td> 534 Erewhon, Pleasantville, Vic, 3999</td> + </tr> + <tr> + <td> Contacts</td> + <td> Home: unknown. Work: (03) 5555 6473</td> + </tr> + <tr> + <td> Id</td> + <td> MRN: 12345 (Acme Healthcare)</td> + </tr> + </tbody> + </table> + </div> + </text> + <!-- MRN assigned by ACME healthcare on 6-May 2001 --> + <identifier> + <use value="usual"/> + <type> + <coding> + <system value="http://terminology.hl7.org/CodeSystem/v2-0203"/> + <code value="MR"/> + </coding> + </type> + <system value="urn:oid:1.2.36.146.595.217.0.1"/> + <value value="12345"/> + <period> + <start value="2001-05-06"/> + </period> + <assigner> + <display value="Acme Healthcare"/> + </assigner> + </identifier> + <active value="true"/> + <!-- Peter James Chalmers, but called "Jim" --> + <name> + <use value="official"/> + <family value="Chalmers"/> + <given value="Peter"/> + <given value="James"/> + </name> + <name> + <use value="usual"/> + <given value="Jim"/> + </name> + <name> + <!-- Maiden names apply for anyone whose name changes as a result of marriage - irrespective + of gender --> + <use value="maiden"/> + <family value="Windsor"/> + <given value="Peter"/> + <given value="James"/> + <period> + <end value="2002"/> + </period> + </name> + <telecom> + <use value="home"/> + <!-- home communication details aren't known --> + </telecom> + <telecom> + <system value="phone"/> + <value value="(03) 5555 6473"/> + <use value="work"/> + <rank value="1"/> + </telecom> + <telecom> + <system value="phone"/> + <value value="(03) 3410 5613"/> + <use value="mobile"/> + <rank value="2"/> + </telecom> + <telecom> + <system value="phone"/> + <value value="(03) 5555 8834"/> + <use value="old"/> + <period> + <end value="2014"/> + </period> + </telecom> + <!-- use FHIR code system for male / female --> + <gender value="male"/> + <birthDate value="1974-12-25"> + <extension url="http://hl7.org/fhir/StructureDefinition/patient-birthTime"> + <valueDateTime value="1974-12-25T14:35:45-05:00"/> + </extension> + </birthDate> + <deceasedBoolean value="false"/> + <address> + <use value="home"/> + <type value="both"/> + <text value="534 Erewhon St PeasantVille, Rainbow, Vic 3999"/> + <line value="534 Erewhon St"/> + <city value="PleasantVille"/> + <district value="Rainbow"/> + <state value="Vic"/> + <postalCode value="3999"/> + <period> + <start value="1974-12-25"/> + </period> + </address> + <contact> + <relationship> + <coding> + <system value="http://terminology.hl7.org/CodeSystem/v2-0131"/> + <code value="N"/> + </coding> + </relationship> + <name> + <family value="du Marché"> + <!-- the "du" part is a family name prefix (VV in iso 21090) --> + <extension url="http://hl7.org/fhir/StructureDefinition/humanname-own-prefix"> + <valueString value="VV"/> + </extension> + </family> + <given value="Bénédicte"/> + </name> + <telecom> + <system value="phone"/> + <value value="+33 (237) 998327"/> + </telecom> + <address> + <use value="home"/> + <type value="both"/> + <line value="534 Erewhon St"/> + <city value="PleasantVille"/> + <district value="Rainbow"/> + <state value="Vic"/> + <postalCode value="3999"/> + <period> + <start value="1974-12-25"/> + </period> + </address> + <gender value="female"/> + <period> + <!-- The contact relationship started in 2012 --> + <start value="2012"/> + </period> + </contact> + <managingOrganization> + <reference value="Organization/1"/> + </managingOrganization> +</Patient> \ No newline at end of file diff --git a/tests/Integration.Test/data/fhir/copyright b/tests/Integration.Test/data/fhir/copyright new file mode 100644 index 000000000..953a3534b --- /dev/null +++ b/tests/Integration.Test/data/fhir/copyright @@ -0,0 +1,3 @@ +http://hl7.org/fhir/ + +All test/example files sourced from http://hl7.org/fhir/ and are subject to HL7's copyright if any. \ No newline at end of file diff --git a/tests/Integration.Test/run.sh b/tests/Integration.Test/run.sh index a968c1a67..b6c129b43 100755 --- a/tests/Integration.Test/run.sh +++ b/tests/Integration.Test/run.sh @@ -56,22 +56,36 @@ function env_setup() { [ -d $BIN_DIR ] && info "Removing $BIN_DIR..." && sudo rm -r $BIN_DIR - set +u - if [ "$1" = "--dev" ]; then - info "Using .env.dev..." - LOADDEV="--env-file .env.dev" - info "Using study.json.dev..." - STUDYJSON="study.json.dev" - elif [ "$1" = "--feature" ]; then - if [ -z "$2" ]; then - fatal "--feature used without specifying a feature" - fi - FEATURE="--filter $2" - info "Filtering by feature=$FEATURE" - fi - - - set -u + SHORT=f:,d + LONG=feature:,dev + OPTS=$(getopt -a -n weather --options $SHORT --longoptions $LONG -- "$@") + + eval set -- "$OPTS" + + while : + do + case "$1" in + -f | --feature ) + FEATURE="--filter $2" + info "Filtering by feature=$FEATURE" + shift 2 + ;; + -d | --dev ) + info "Using .env.dev..." + LOADDEV="--env-file .env.dev" + info "Using study.json.dev..." + STUDYJSON="study.json.dev" + shift; + ;; + --) + shift; + break + ;; + *) + echo "Unexpected option: $1" + ;; + esac + done if [[ $(docker-compose ps -q | wc -l) -ne 0 ]]; then info "Stopping existing services..."