From 536e9f01b1f14398100225139283ce375e267969 Mon Sep 17 00:00:00 2001 From: JP Date: Thu, 16 May 2024 12:03:41 -0600 Subject: [PATCH] Aphl mergeback (#770) * Fhir Implementations * Fhir Implementations * APHL-303 Updated JPA and Repository logic * Updated logic for JPA code to connect to APHL UI * Updated to cqframework version 1.5.11-SNAPSHOT; added cqf-fhir dependency in cql plugin * APHL-303-Fhir-Implementation-Updates * Added the RepositoryService to the CqlConfig * APHL-303 Updated logic for configuring operation * APHL-303 FHIR implementation updates for operation * APHL-303 FHIR Implementation for operation addition * Changed RepositoryService to use r4 resources * APHL-303 Fhir Implementation code for repository service updated logic * APHL-305 Updated logic for release operation * KnowledgeArtifact infrastructure and newVersion implementation to use it * APHL-303 Updates for backend for release and publish operations * APHL-303 Updates for backend for draft operation and canonical logic * Updates for test classes and java 11 * Added operation and injections to config ... added psuedo code for basic operation pattern ... cleaned up operation definitions * Added logic for release and publish operations and tests * Reinstating evaluator FhirDal factory ... updating measure evaluation ... making repository service and associated beans R4 conditional * Updated draftOperation test * Fixed FhirDal search and draft test * Renamed 'newVersion' method to 'draft' * Removed unused imports in JpaFhirDal * Fhir-Implementation-Duplicate-Fix * Updated $draft operation signature and added some validation * Update RepositoryService.java * Fhir Implementation changes for revise * $revise operation changes * Updated $publish operation * Updated draft and revise operation tests * Fhir-Implemenmtation updates for tests * Fhir_Implementation logic updates for test code * Fixed $draft status constraint exception message * Fhir-Implementations-draft-operation-defect * Updates to $draft operation to strip versions on references and on resource drafts * Updated resources * updated $draft test resource and removed unused imports * Updated the Cql FhirDal to implement Translator FhirDal and introduce JpaCRFhirDal for CR plugin * updated fhirContext used by JpaFhirDal * Updated revise operation * Updates to use evaluator utils * Fixed KnowledgeArtifactTest parameters imports * Removed revise and publish operations from this branch * Remove Publish and Revise operations; Draft now throws if a draft already exists. * updated draft bundle so that resources are different from those of that active test bundle to avoid collisions. * Update KnowledgeArtifactProcessor.java * Restored $revise operation * Fhir-Implementations-Updates * Reverted previous commit's changes to RepositoryServiceTest * Refactor of $release operation * Fhir-Implementation-Updates * KnowledgeArtifactAdapter components and dependencies refactor * Adapter getComponents, getDependencies; reviseOperation test * Fhir-Implementations-Updates * Move BooleanType to boolean conversion up a layer; commented out Release operation test. * Aphl 475 approve operation (#691) * [aphl-475] implementation of $approve operation in KnowledgeArtifactProcessor --------- Co-authored-by: Adam Stevenson Co-authored-by: taha.attari@smilecdr.com * $release operation updates for version pinning * Removed unused import. * Fhir-Implementations-Updates * Fixed a couple of bugs in version validation * $release updates - param names match spec * Updated text cases for $release name changes * Release operation updates (#698) * Update KnowledgeArtifactProcessor.java * [APHL-546] Implementation of artifactAssessment and updating $approve to create Artifact Comments as ArtifactAssessment resources (#697) * [APHL-546] WIP implementation of artifactAssessment * [APHL-546] updated knowledgeArtifactProcessor to use artifactAssessment * [APHL-546] Approve operation and tests updated, ArtifactAssessment implementation still incomplete * [APHL-546] approve operation working and tests final, ArtifactAssessment still WIP * [APHL-546] NPE * [APHL-546] cleanup style errors and match ArtifactAssessment implementation to StructureDefinition * [APHL-549] updated $approve to create a reference instead of using canonical * [APHL-546] minor changes, update to test method * Fixed date filter test cases in DataOperationProviderIT --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * Fix bad $approve tests (#702) tests couldn't fail Co-authored-by: taha.attari@smilecdr.com * Aphl 535 rebase to vsm operations (#704) * [APHL-535][APHL-481] Made $draft transactional and updated to allow multiple drafts * Add null check on version argument of $draft; updated $draft test cases to avoid ValueSet collisions --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * [APHL-546] fix bad target canonical handling in $approve (#710) Co-authored-by: taha.attari@smilecdr.com * Fixed release operation validation messages - made parameter names consistent with actual param names * Update RepositoryServiceTest.java * Updated $release operation parameter names to camelCase * [APHL-584] update backend to remove endorser (#714) * [APHL-584] update backend to remove endorser * [APHL-584] remove $release tests until we update the operation --------- Co-authored-by: taha.attari@smilecdr.com * $approve fixed and new test added to ensure it won't block $release (#716) Co-authored-by: taha.attari@smilecdr.com * Aphl 305 release operation (#720) * [APHL-305] release operation with limited tests * [APHL-305] release operation tests * [APHL-305] added dependency and component test * [APHL-305] $release tests completed --------- Co-authored-by: taha.attari@smilecdr.com * Aphl 608 is owned and effective period (#727) * [APHL-305] release operation tests * [APHL-305] added dependency and component test * [APHL-608] isOwned checking and effectivePeriod propagation * [APHL-608] added some notOwned relatedArtifact Components for testing and updated draft to use isOwned * [APHL-608] updated tests and handling of relatedArtifacts * [APHL-608] remove deprecated methods --------- Co-authored-by: taha.attari@smilecdr.com * simplify version update logic in $release (#732) * [APHL-608] style edit * [APHL-608] simplified version checking logic for relatedArtifacts * removed unused method --------- Co-authored-by: taha.attari@smilecdr.com * [APHL-630] update to ci cd (#731) * [APHL-630] Additional CI job to generate and publish Docker image based on vsm-operations branch --------- Co-authored-by: taha.attari@smilecdr.com * Aphl 630 ci cd update - version fix (#733) * [APHL-630] update to ci cd * [APHL-630] different jobs for master and vsm-operations branches --------- Co-authored-by: taha.attari@smilecdr.com * Aphl 630 ci cd update (#734) * [APHL-630] update to ci cd * [APHL-630] different jobs for master and vsm ops * [APHL-630] names * [APHL-630] remove wildcards * [APHL-630] more changes --------- Co-authored-by: taha.attari@smilecdr.com * Aphl 630 ci cd update (#735) * [APHL-630] update to ci cd * [APHL-630] different jobs for master and vsm ops * [APHL-630] names * [APHL-630] remove wildcards * [APHL-630] more changes * [APHL-630] add maven install --------- Co-authored-by: taha.attari@smilecdr.com * Aphl 469 transactional package operation (#737) * MVP Implementation of the $crmi.package operation --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * Aphl 655 clear approval date, releaseLabel, releaseDescription (#738) * [APHL-469] minimal package (just search and add to bundle) * [APHL-469] check if entry exists before adding * [APHL-469] get components and dependencies * [APHL-469] added capability support * [APHL-469] move to own function * [APHL-469] everything except packageOnly is in a WIP state * [APHL-469] basic testable implementation * [APHL-469] added test and nicer error messages for Capability * [APHL-469] canonicalVersion, checkCanonicalVersion, forceCanonicalVersion tests complete * [APHL-469] test for `include` * [APHL-469] tests for count, offset * [APHL-469] transactional package tests * [APHL-469] better wording * [APHL-469] pending TODO * [APHL-469] simplified error types * [APHL-655] clear approvalDate * [APHL-655] removed releaseLabel and releaseDescription * Merge branch 'vsm_operations' into aphl-655-clear-approval-date --------- Co-authored-by: taha.attari@smilecdr.com * (manual) merge of master * updated submodule reference * Dockerfile ruler-server version update * Update hapi-fhir-jpaserver-starter * Updated the backend CRMI operation names with "crmi." prefix * Aphl 656 propogate new version to artifact assessment (#742) * [APHL-656] WIP update the derived-from relatedArtifact link in ArtifactAssessment * [APHL-659] updated the backend names * [APHL-656] copying extensions instead of casting Basic to ArtifactAssessment * [APHL-656] test complete --------- Co-authored-by: taha.attari@smilecdr.com * [Aphl 647] new semver and releaseLabel (#743) * [APHL-647] release label and new versioning scheme Co-authored-by: taha.attari@smilecdr.com * Release operation experimentalBehavior parameter and handling (#744) added experimentalBehavior parameter to $release operation --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * Aphl 731 release operation priority indication (#745) * preserve priority extensions when releasing --------- Co-authored-by: taha.attari@smilecdr.com * Aphl 732 package priority (#746) * Release operation preserves priorities indicated via extension in the root artifact --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * Update package operation output to distinguish collection and transaction (#749) * [APHL-778] update package output to distinguish collection and transaction * [APHL-778] Updated tests * [APHL-778] no total for transactions --------- Co-authored-by: taha.attari@smilecdr.com * Whitespace and convention/style updates * Whitespace and convention updates --------- Co-authored-by: taha.attari@smilecdr.com * $validate Operation implementation * [APHL-752] getting NoSuchMethod * Fixing HAPI dependencies; added test for validate operation * [APHL-752] basic validate implementation * [APHL-752] added common codesystems to validation chain * [APHL-752] make validation failures more obvious * [APHL-752] update external dep to use the correct version of r5 * [APHL-752] validate simple implementation * [APHL-752] throw NotImplemented for mode and profile * [APHL-752] add fullUrls to bundles * [APHL-752] update active transaction bundle to pass validation * [APHL-752] update tests * $validate test case for unsatisfied PlanDef slice * [APHL-752] updated test for plandefslice * [APHL-752] validate each entry alone * [APHL-752] add resource fetcher * [APHL-778] update package output to distinguish collection and transaction * [APHL-778] Updated tests * [APHL-752] validate whole bundle * [APHL-778] no total for transactions * [APHL-752] expect extension validation error --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: c-schuler Co-authored-by: Adam Stevenson * v2 -> v1 plugin (#748) Added new eCR module with eRSD V2 to V1 conversion operation --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * targetversion parameter for ersd v1 transform * [APHL-788] add targetversion parameter * rename transform module to ecr --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * [APHL-798][APHL-799] Condition useContext management (#752) * [APHL-300] valueset interceptor initial implementation * [APHL-300] preserve useContext extensions when releasing * [APHL-300] package is aware of useContext * [APHL-300] updated to use vsm-specific extension * [APHL-300] fix test * [APHL-300][APHL-798][APHL-799] updates to package and release * [APHL-799] update package validation test for depends-on relatedArtifact * remove interceptor * [APHL-799] update package test data * [APHL-798] preserve all RelatedArtifact extensions to keep it generic * [APHL-799] replace existing useContexts for condition and priority * comments * cleanup * fix bad assignment * simplify * cleanup * [APHL-300] forgot to update reference --------- Co-authored-by: taha.attari@smilecdr.com * update jpa * update external * Remove "crmi" operation code prefix (#755) Removed "crmi" operation code prefix; fixed transform provider test case data * updating to latest hapi * compiled ruler with updates, wip * operation migration table in readMe * RepositoryService $draft operation not clears out effectiveperiod (#758) * [APHL-784] update test * [APHL-784] remove effective period as part of draft operation * [APHL-784] update test to account for all owned resources * update version --------- Co-authored-by: taha.attari@smilecdr.com * [APHL-780] initial implementation (#751) * [APHL-750] initial implementation * [APHL-750] draft implementation with Parameters tree * [APHL-750] cache and remove duplicates * [APHL-750] fix draft bug where dependencies pointing at owned resources were not updated * [APHL-750] fix draft issues * [APHL-780] fix tests * [APHL-780] updated test and test data, now handling gaps in reference lists * [APHL-780] updated addition deletion logic * [APHL-780] temporarily expand ValueSets as part of diff * [APHL-780] refactoring * [APHL-780] fix array indices on output * [APHL-780] update test data and tests * [APHL-780] fix tests and test cases * [APHL-780] remove extra file * [APHL-780] cleanup * [APHL-780] cleanup * [APHL-780] implement cloneable * [APHL-780] remove namespace * [APHL-780] remove crmi namespace * Updated test case to use new forEachMetadataResource method introduced by previous merge. --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * [APHL-798][APHL-799] release and package should throw an error if a ValueSet doesn't have a condition (#756) * [APHL-798][APHL-799] updated tests * [APHL-798][APHL-799] updating tests * [APHL-798][APHL-799] updating tests * [APHL-798][APHL-799] updating tests * [APHL-798][APHL-799] update test data * update test data versions --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * Aphl 796 update package parameters (#759) * [APHL-796] match package operation to specification * [APHL-796] update names --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * Aphl 582 move to hapifhirrepository (#760) * [APHL-582] initial implementation * [APHL-582] fix tests * [APHL-582] Cleanup * [APHL-582] cleanup * [APHL-582] cleanup * merge conflicts * [APHL-582] Cleanup * Address spotbugs error * Fixed a few issues related to the update of the $package operation parameters * [APHL-582] fix NPE --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * Aphl 830 test data (#761) * [APHL-830] update test data * [APHL-830] active program needs active groupers * [APHL-830] add condition text * Updated versions in test bundles (#765) --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * [APHL-551] update cqf-ruler to use clinical-reasoning * [APHL-551] update tests to get rid of weird concurrency issue * [APHL-551] cleanup * [APHL-551] undo changes to ifNoneExist * [APHL-551] update pom * Add common getExpansion() function (#763) * Add common getExpansion() function * Mock out server calls * Specify charset * Add TerminologyServerClient Bean to config * Refactor - make client non VSAC specific & add statuc variables * getExpansion changes * Refactor - take credentials from properties, cleanup, add IT * Fix issue with authoritative source url and system-version parameter Update test file to reflect actual value set * Remove addition of ValueSet level system-version param & update test to reflect. Privatise getters/setters. --------- Co-authored-by: Adam Stevenson * [APHL-551] update pom * Aphl 300 valueset interceptor (#757) * ValueSet update interceptor for updating code synonyms --------- Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson * Update dependency versions * Delete unused code * Update to br-cs-merged code * More dependency cleanup * Update to use MR cache * Whoops, didn't mean to override * More dependency fixes * Update github actions * jacoco * Fix integration tests * Fixing tests * Various test fixes and updates * WIP, fixing tests * Disable extract provider and fix extract tests * Fixing tests * Update to latest jpaserver-starter branch * Remove extract provider * wip ra * Update the Readme with migration status of operations * Fix cds hooks test * Update eCR plugin * removing RA plugin due to spec changes that are not implemented * removing failing tests, re-adding RA module * Fix up ecr poms * Remove unused transform provider * Merge ecr plugin into case reporting * remove broken submodule * Update to latest br-cs-merged branch * Move RepositoryService and KnowledgeArtifactProcessor to case-reporting plugin (#775) * move knowledge artifact processor * - use clinical reasoning utilities - WIP changelog updates * add terminology client * update pom * Move Repository Service and Test * update tests * initial getChangelog test * update changelog to make operations match groupers better * [APHL-309] update changelog tests and fix relatedArtifact extensions diff --------- Co-authored-by: taha.attari@smilecdr.com * Aphl 300 move valueset interceptor to plugin (#777) * [APHL-300] move the interceptor to case-reporting * cleanup --------- Co-authored-by: taha.attari@smilecdr.com * Replace RepositoryService with CaseReportingOperationProvider * update transform provider (#780) Co-authored-by: taha.attari@smilecdr.com * [APHL-551] fix test failures (#781) Co-authored-by: taha.attari@smilecdr.com * APHL-913-add_grouper_type_use_context (#782) * add group type to groupers that do not have them while importing --------- Co-authored-by: Ivan Baisi * Fix ExampleServerDstu3IT * Update to latest br-cs-merged branch * Update Launch_Server__Live_Reload_.xml * Test disabling batch jobs and indexing on the DSTU3 tests * Add @DirtiesContext annotation * Throwing more at the wall * Huh, threading be tough * Use the maven wrapper * update to clinical-reasoning snapshot and fix approve variable names * flaky async test is fixed downstream * remove case-reporting now that it's migrated to aphl-vsm * Adding test ordering to prevent singleton list error stemming from repository including patient from bundle and server --------- Co-authored-by: Hayes Murdock Co-authored-by: Hayes Murdock Co-authored-by: Adam Stevenson Co-authored-by: c-schuler Co-authored-by: Hayes Murdock Co-authored-by: Taha Co-authored-by: taha.attari@smilecdr.com Co-authored-by: Adam Stevenson Co-authored-by: Justin McKelvy <60718638+Capt-Mac@users.noreply.github.com> Co-authored-by: Adam Stevenson Co-authored-by: Chris0296 <38321098+Chris0296@users.noreply.github.com> Co-authored-by: Brenin Rhodes Co-authored-by: Ivan Baisi Co-authored-by: Ivan Baisi --- .github/workflows/check-pr.yaml | 2 +- .../publish-snapshot-vsm-operations.yml | 40 + .github/workflows/publish-snapshot.yml | 2 +- .../Launch_Server__Live_Reload_.xml | 22 +- Dockerfile | 4 +- .../cqf/ruler/utility/SemanticVersion.java | 42 + .../cqf/ruler/ExampleServerDstu2IT.java | 3 +- .../cqf/ruler/ExampleServerDstu3IT.java | 42 +- .../opencds/cqf/ruler/ExampleServerR4IT.java | 3 +- .../opencds/cqf/ruler/ExampleServerR5IT.java | 3 +- example/README.md | 4 + external/hapi-fhir-jpaserver-starter | 2 +- external/pom.xml | 1 + plugin/case-reporting/pom.xml | 11 - .../casereporting/CaseReportingConfig.java | 46 - .../CaseReportingProperties.java | 19 - .../CaseReportingProviderFactory.java | 38 - .../CaseReportingProviderLoader.java | 40 - .../r4/MeasureDataProcessProvider.java | 163 -- .../r4/ProcessMessageProvider.java | 209 -- .../main/resources/META-INF/spring-properties | 2 - .../src/main/resources/application.yaml | 4 - .../r4/MeasureDataProcessProviderIT.java | 48 - .../r4/ProcessMessageProviderIT.java | 35 - .../src/test/resources/Group-ra-group00.json | 18 - .../src/test/resources/Group-ra-group01.json | 18 - .../src/test/resources/Group-ra-group02.json | 23 - .../MeasureReport-ra-measurereport01.json | 555 ------ .../resources/Observation-ra-obs21pat01.json | 79 - .../test/resources/Patient-ra-patient01.json | 113 -- .../test/resources/Patient-ra-patient02.json | 113 -- .../test/resources/Patient-ra-patient03.json | 113 -- .../Practitioner-ra-prac01pat01.json | 63 - .../src/test/resources/example-eicr.json | 1728 ----------------- plugin/cds-hooks/pom.xml | 4 +- .../cdshooks/r4/OpioidRecommendation08IT.java | 6 + plugin/dev-tools/pom.xml | 3 - .../cqf/ruler/devtools/DevToolsConfig.java | 2 - plugin/pom.xml | 7 +- plugin/ra/pom.xml | 4 +- .../ruler/ra/r4/RiskAdjustmentProvider.java | 42 +- .../ruler/ra/r4/RiskAdjustmentProviderIT.java | 3 - plugin/sdc/pom.xml | 4 - .../org/opencds/cqf/ruler/sdc/SDCConfig.java | 44 - .../opencds/cqf/ruler/sdc/SDCProperties.java | 108 -- .../cqf/ruler/sdc/SDCProviderFactory.java | 29 - .../cqf/ruler/sdc/SDCProviderLoader.java | 43 - .../ruler/sdc/dstu3/TransformProvider.java | 92 - .../cqf/ruler/sdc/r4/TransformProvider.java | 92 - .../sdc/src/main/resources/application.yaml | 10 - .../cqf/ruler/sdc/r4/ExtractProviderIT.java | 15 +- pom.xml | 9 +- scripts/setversion.sh | 3 +- server/pom.xml | 23 +- 54 files changed, 191 insertions(+), 3960 deletions(-) create mode 100644 .github/workflows/publish-snapshot-vsm-operations.yml create mode 100644 core/src/main/java/org/opencds/cqf/ruler/utility/SemanticVersion.java delete mode 100644 plugin/case-reporting/pom.xml delete mode 100644 plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingConfig.java delete mode 100644 plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProperties.java delete mode 100644 plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProviderFactory.java delete mode 100644 plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProviderLoader.java delete mode 100644 plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/r4/MeasureDataProcessProvider.java delete mode 100644 plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/r4/ProcessMessageProvider.java delete mode 100644 plugin/case-reporting/src/main/resources/META-INF/spring-properties delete mode 100644 plugin/case-reporting/src/main/resources/application.yaml delete mode 100644 plugin/case-reporting/src/test/java/org/opencds/cqf/ruler/casereporting/r4/MeasureDataProcessProviderIT.java delete mode 100644 plugin/case-reporting/src/test/java/org/opencds/cqf/ruler/casereporting/r4/ProcessMessageProviderIT.java delete mode 100644 plugin/case-reporting/src/test/resources/Group-ra-group00.json delete mode 100644 plugin/case-reporting/src/test/resources/Group-ra-group01.json delete mode 100644 plugin/case-reporting/src/test/resources/Group-ra-group02.json delete mode 100644 plugin/case-reporting/src/test/resources/MeasureReport-ra-measurereport01.json delete mode 100644 plugin/case-reporting/src/test/resources/Observation-ra-obs21pat01.json delete mode 100644 plugin/case-reporting/src/test/resources/Patient-ra-patient01.json delete mode 100644 plugin/case-reporting/src/test/resources/Patient-ra-patient02.json delete mode 100644 plugin/case-reporting/src/test/resources/Patient-ra-patient03.json delete mode 100644 plugin/case-reporting/src/test/resources/Practitioner-ra-prac01pat01.json delete mode 100644 plugin/case-reporting/src/test/resources/example-eicr.json delete mode 100644 plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCConfig.java delete mode 100644 plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProperties.java delete mode 100644 plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProviderFactory.java delete mode 100644 plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProviderLoader.java delete mode 100644 plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/dstu3/TransformProvider.java delete mode 100644 plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/r4/TransformProvider.java delete mode 100644 plugin/sdc/src/main/resources/application.yaml diff --git a/.github/workflows/check-pr.yaml b/.github/workflows/check-pr.yaml index 50e2198b6..5222bf3f0 100644 --- a/.github/workflows/check-pr.yaml +++ b/.github/workflows/check-pr.yaml @@ -13,4 +13,4 @@ jobs: distribution: temurin java-version: 21 - name: Run Checks - run: mvn --batch-mode --no-transfer-progress --update-snapshots verify + run: ./mvnw -T 4 --batch-mode --no-transfer-progress --update-snapshots verify diff --git a/.github/workflows/publish-snapshot-vsm-operations.yml b/.github/workflows/publish-snapshot-vsm-operations.yml new file mode 100644 index 000000000..bd407fee0 --- /dev/null +++ b/.github/workflows/publish-snapshot-vsm-operations.yml @@ -0,0 +1,40 @@ +name: Publish Snapshot VSM Operations +on: + push: + branches: + - vsm_operations +jobs: + maven: + runs-on: ubuntu-latest + steps: + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV + - uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Install + run: ./scripts/install.sh + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: alphora/cqf-ruler:cqf-ruler-vsm + build-args: COMMIT_HASH=${{ env.SHORT_SHA }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index d3645226f..6f923de73 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -21,7 +21,7 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Publish snapshot - run: mvn --batch-mode -no-transfer-progress --update-snapshots deploy + run: ./mvnw -T 4 --batch-mode -no-transfer-progress --update-snapshots deploy env: MAVEN_USERNAME: ${{ vars.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} diff --git a/.idea/runConfigurations/Launch_Server__Live_Reload_.xml b/.idea/runConfigurations/Launch_Server__Live_Reload_.xml index 28528bc2d..2de483041 100644 --- a/.idea/runConfigurations/Launch_Server__Live_Reload_.xml +++ b/.idea/runConfigurations/Launch_Server__Live_Reload_.xml @@ -1,13 +1,13 @@ - - + + diff --git a/Dockerfile b/Dockerfile index b0828f730..433bf99ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ ARG COMMIT_HASH LABEL COMMIT_HASH ${COMMIT_HASH} ENV COMMIT_HASH ${COMMIT_HASH} +ENV VERSION=0.15.0-SNAPSHOT RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* RUN groupadd -r cqfruler && useradd -r -g cqfruler cqfruler USER cqfruler @@ -11,6 +12,7 @@ WORKDIR /home/cqfruler RUN mkdir server RUN mkdir plugin -COPY ./server/target/cqf-ruler-server-*.war server/ROOT.war +COPY /server/target/cqf-ruler-server-${VERSION}.war server/ROOT.war + EXPOSE 8080 CMD ["java", "-cp", "server/ROOT.war", "-Dloader.path=WEB-INF/classes,WEB-INF/lib,WEB-INF/lib-provided,plugin", "org.springframework.boot.loader.PropertiesLauncher"] diff --git a/core/src/main/java/org/opencds/cqf/ruler/utility/SemanticVersion.java b/core/src/main/java/org/opencds/cqf/ruler/utility/SemanticVersion.java new file mode 100644 index 000000000..6ca0f4442 --- /dev/null +++ b/core/src/main/java/org/opencds/cqf/ruler/utility/SemanticVersion.java @@ -0,0 +1,42 @@ +package org.opencds.cqf.ruler.utility; + +import java.util.List; +import java.util.Comparator; + +public class SemanticVersion { + public static Comparator getVersionComparator() { + return new VersionComparator(); + } + + public static String findHighestVersion(List versions) { + String highestVersion = null; + Comparator versionComparator = new VersionComparator(); + + for (String version : versions) { + if (highestVersion == null || versionComparator.compare(version, highestVersion) > 0) { + highestVersion = version; + } + } + + return highestVersion; + } + + public static class VersionComparator implements Comparator { + @Override + public int compare(String v1, String v2) { + String[] v1Parts = v1.split("\\."); + String[] v2Parts = v2.split("\\."); + + for (int i = 0; i < Math.max(v1Parts.length, v2Parts.length); i++) { + int num1 = i < v1Parts.length ? Integer.parseInt(v1Parts[i]) : 0; + int num2 = i < v2Parts.length ? Integer.parseInt(v2Parts[i]) : 0; + + if (num1 != num2) { + return num1 - num2; + } + } + + return 0; + } + } +} \ No newline at end of file diff --git a/core/src/test/java/org/opencds/cqf/ruler/ExampleServerDstu2IT.java b/core/src/test/java/org/opencds/cqf/ruler/ExampleServerDstu2IT.java index 7301df51a..25f384615 100644 --- a/core/src/test/java/org/opencds/cqf/ruler/ExampleServerDstu2IT.java +++ b/core/src/test/java/org/opencds/cqf/ruler/ExampleServerDstu2IT.java @@ -23,7 +23,8 @@ "hapi.fhir.fhir_version=dstu2", "spring.datasource.url=jdbc:h2:mem:dbr2", "hapi.fhir.cr.enabled=false", - "spring.main.allow-bean-definition-overriding=true" + "spring.main.allow-bean-definition-overriding=true", + "spring.jpa.properties.hibernate.search.backend.directory.root=target/lucenefiles-dstu2", }) public class ExampleServerDstu2IT { diff --git a/core/src/test/java/org/opencds/cqf/ruler/ExampleServerDstu3IT.java b/core/src/test/java/org/opencds/cqf/ruler/ExampleServerDstu3IT.java index dd699ab43..1624edd1d 100644 --- a/core/src/test/java/org/opencds/cqf/ruler/ExampleServerDstu3IT.java +++ b/core/src/test/java/org/opencds/cqf/ruler/ExampleServerDstu3IT.java @@ -1,8 +1,18 @@ package org.opencds.cqf.ruler; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import ca.uhn.fhir.cr.config.RepositoryConfig; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.api.CacheControlDirective; +import org.apache.commons.io.FileUtils; +import org.hl7.fhir.dstu3.model.Bundle; +import org.hl7.fhir.dstu3.model.MeasureReport; +import org.hl7.fhir.dstu3.model.Parameters; import org.hl7.fhir.dstu3.model.Patient; +import org.hl7.fhir.dstu3.model.StringType; import org.hl7.fhir.instance.model.api.IIdType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -15,21 +25,41 @@ import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum; import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; +import org.springframework.core.io.ClassPathResource; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit.jupiter.SpringExtension; +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + @ExtendWith(SpringExtension.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class, JpaStarterWebsocketDispatcherConfig.class}, properties = { +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, + classes = { + Application.class, + JpaStarterWebsocketDispatcherConfig.class + }, properties = + { + "spring.profiles.include=storageSettingsTest", "spring.datasource.url=jdbc:h2:mem:dbr3", "hapi.fhir.fhir_version=dstu3", + "hapi.fhir.cr_enabled=true", + "hapi.fhir.mdm_enabled=false", + "spring.batch.enabled=false", "hapi.fhir.subscription.websocket_enabled=true", "hapi.fhir.allow_external_references=true", "hapi.fhir.allow_placeholder_references=true", - "spring.main.allow-bean-definition-overriding=true"}) -class ExampleServerDstu3IT { - private IGenericClient ourClient; + "hapi.fhir.enable_repository_validating_interceptor=true", + "spring.main.allow-bean-definition-overriding=true", + "spring.jpa.properties.hibernate.search.backend.directory.root=target/lucenefiles-dstu3", + }) - @Autowired + +class ExampleServerDstu3IT implements IServerSupport { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExampleServerDstu3IT.class); + private IGenericClient ourClient; private FhirContext ourCtx; @Autowired @@ -38,7 +68,6 @@ class ExampleServerDstu3IT { @LocalServerPort private int port; - @BeforeEach void beforeEach() { ourCtx = FhirContext.forDstu3(); @@ -52,6 +81,7 @@ void beforeEach() { @Test @DirtiesContext void testCreateAndRead() { + String methodName = "testCreateResourceConditional"; Patient pt = new Patient(); diff --git a/core/src/test/java/org/opencds/cqf/ruler/ExampleServerR4IT.java b/core/src/test/java/org/opencds/cqf/ruler/ExampleServerR4IT.java index 754e76546..1b52d774a 100644 --- a/core/src/test/java/org/opencds/cqf/ruler/ExampleServerR4IT.java +++ b/core/src/test/java/org/opencds/cqf/ruler/ExampleServerR4IT.java @@ -40,7 +40,8 @@ // Override is currently required when using MDM as the construction of the MDM // beans are ambiguous as they are constructed multiple places. This is evident // when running in a spring boot environment - "spring.main.allow-bean-definition-overriding=true" + "spring.main.allow-bean-definition-overriding=true", + "spring.jpa.properties.hibernate.search.backend.directory.root=target/lucenefiles-r4", }) public class ExampleServerR4IT implements IServerSupport { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExampleServerR4IT.class); diff --git a/core/src/test/java/org/opencds/cqf/ruler/ExampleServerR5IT.java b/core/src/test/java/org/opencds/cqf/ruler/ExampleServerR5IT.java index 2606b3fd2..a5d6ccab6 100644 --- a/core/src/test/java/org/opencds/cqf/ruler/ExampleServerR5IT.java +++ b/core/src/test/java/org/opencds/cqf/ruler/ExampleServerR5IT.java @@ -23,7 +23,8 @@ "hapi.fhir.fhir_version=r5", "hapi.fhir.subscription.websocket_enabled=true", "hapi.fhir.mdm_enabled=false", - "spring.main.allow-bean-definition-overriding=true" + "spring.main.allow-bean-definition-overriding=true", + "spring.jpa.properties.hibernate.search.backend.directory.root=target/lucenefiles-dstu2", }) public class ExampleServerR5IT { diff --git a/example/README.md b/example/README.md index 89a5877c0..75e47da60 100644 --- a/example/README.md +++ b/example/README.md @@ -19,6 +19,10 @@ This system is very basic. It does not support runtime addition or removal of pl NOTE: This plugin is for demonstration purposes only. It's never intended to be published +## Build + +Use `mvn package` to build the jar files + ## Docker The Dockerfile builds on top of the base cqf-ruler image and simply copies the jar into the `plugin` directory of the image. diff --git a/external/hapi-fhir-jpaserver-starter b/external/hapi-fhir-jpaserver-starter index 4eedff7ab..da03ef96a 160000 --- a/external/hapi-fhir-jpaserver-starter +++ b/external/hapi-fhir-jpaserver-starter @@ -1 +1 @@ -Subproject commit 4eedff7ab5e1237fe19ae79688d33b8dd74a8ffb +Subproject commit da03ef96a77f3fe11993db0febfdc42435aa73f0 diff --git a/external/pom.xml b/external/pom.xml index 309fb6026..049310c4f 100644 --- a/external/pom.xml +++ b/external/pom.xml @@ -15,6 +15,7 @@ ca.uhn.hapi.fhir hapi-fhir-base + ca.uhn.hapi.fhir hapi-fhir-storage diff --git a/plugin/case-reporting/pom.xml b/plugin/case-reporting/pom.xml deleted file mode 100644 index e49575199..000000000 --- a/plugin/case-reporting/pom.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - 4.0.0 - - org.opencds.cqf.ruler - cqf-ruler-plugin - 0.15.0-SNAPSHOT - - - cqf-ruler-case-reporting - diff --git a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingConfig.java b/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingConfig.java deleted file mode 100644 index 61736a8e3..000000000 --- a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.opencds.cqf.ruler.casereporting; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory; -import org.opencds.cqf.external.annotations.OnR4Condition; -import org.opencds.cqf.external.cr.PostInitProviderRegisterer; -import org.opencds.cqf.ruler.api.OperationProvider; -import org.opencds.cqf.ruler.casereporting.r4.MeasureDataProcessProvider; -import org.opencds.cqf.ruler.casereporting.r4.ProcessMessageProvider; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Conditional; -import org.springframework.context.annotation.Configuration; - -@Configuration -@ConditionalOnProperty(prefix = "hapi.fhir.casereporting", name = "enabled", havingValue = "true", matchIfMissing = true) -public class CaseReportingConfig { - @Bean - public CaseReportingProperties caseReportingProperties() { - return new CaseReportingProperties(); - } - - @Bean - @Conditional(OnR4Condition.class) - public OperationProvider r4MeasureDataProcessor() { - return new MeasureDataProcessProvider(); - } - - @Bean - @Conditional(OnR4Condition.class) - public ProcessMessageProvider r4ProcessMessageProvider() { - return new ProcessMessageProvider(); - } - - @Bean - CaseReportingProviderFactory cpgOperationFactory() { - return new CaseReportingProviderFactory(); - } - - @Bean - CaseReportingProviderLoader cpgProviderLoader(FhirContext theFhirContext, ResourceProviderFactory theResourceProviderFactory, - CaseReportingProviderFactory theCaseReportingProviderFactory, PostInitProviderRegisterer thePostInitProviderRegisterer) { - return new CaseReportingProviderLoader(theFhirContext, theResourceProviderFactory, theCaseReportingProviderFactory, - thePostInitProviderRegisterer); - } -} diff --git a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProperties.java b/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProperties.java deleted file mode 100644 index 5450dfeb6..000000000 --- a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProperties.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.opencds.cqf.ruler.casereporting; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; - -@ConfigurationProperties(prefix = "hapi.fhir.casereporting") -@EnableConfigurationProperties -public class CaseReportingProperties { - - private boolean enabled = true; - - public boolean isEnabled() { - return this.enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } -} diff --git a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProviderFactory.java b/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProviderFactory.java deleted file mode 100644 index 54ce06369..000000000 --- a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProviderFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.opencds.cqf.ruler.casereporting; - - -import ca.uhn.fhir.context.ConfigurationException; -import ca.uhn.fhir.context.FhirContext; -import org.opencds.cqf.ruler.casereporting.r4.MeasureDataProcessProvider; -import org.opencds.cqf.ruler.casereporting.r4.ProcessMessageProvider; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; - -public class CaseReportingProviderFactory { - @Autowired - private FhirContext myFhirContext; - - @Autowired - private ApplicationContext myApplicationContext; - - public Object getMeasureDataProcessProvider() { - switch (myFhirContext.getVersion().getVersion()) { - case R4: - return myApplicationContext.getBean(MeasureDataProcessProvider.class); - default: - throw new ConfigurationException("MeasureDataProcessProvider not supported for FHIR version " - + myFhirContext.getVersion().getVersion()); - } - } - - public Object getProcessMessageProvider() { - switch (myFhirContext.getVersion().getVersion()) { - case R4: - return myApplicationContext - .getBean(ProcessMessageProvider.class); - default: - throw new ConfigurationException("ProcessMessageProvider not supported for FHIR version " - + myFhirContext.getVersion().getVersion()); - } - } -} diff --git a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProviderLoader.java b/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProviderLoader.java deleted file mode 100644 index 93a7a6ed3..000000000 --- a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/CaseReportingProviderLoader.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.opencds.cqf.ruler.casereporting; - -import ca.uhn.fhir.context.ConfigurationException; -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory; -import org.opencds.cqf.external.cr.PostInitProviderRegisterer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class CaseReportingProviderLoader { - private static final Logger myLogger = LoggerFactory.getLogger(CaseReportingProviderLoader.class); - private final FhirContext myFhirContext; - private final ResourceProviderFactory myResourceProviderFactory; - private final CaseReportingProviderFactory myCaseReportingProviderFactory; - - // This is just here to force the observer to register - private final PostInitProviderRegisterer myPostInitProviderRegisterer; - - public CaseReportingProviderLoader(FhirContext theFhirContext, ResourceProviderFactory theResourceProviderFactory, - CaseReportingProviderFactory theCaseReportingProviderFactory, PostInitProviderRegisterer thePostInitProviderRegisterer) { - myFhirContext = theFhirContext; - myResourceProviderFactory = theResourceProviderFactory; - myCaseReportingProviderFactory = theCaseReportingProviderFactory; - this.myPostInitProviderRegisterer = thePostInitProviderRegisterer; - loadProvider(); - } - - public void loadProvider() { - switch (myFhirContext.getVersion().getVersion()) { - case R4: - myLogger.info("Registering R4 Ruler CaseReporting Providers"); - myResourceProviderFactory.addSupplier(myCaseReportingProviderFactory::getMeasureDataProcessProvider); - myResourceProviderFactory.addSupplier(myCaseReportingProviderFactory::getProcessMessageProvider); - break; - default: - throw new ConfigurationException("CaseReporting not supported for FHIR version " - + myFhirContext.getVersion().getVersion()); - } - } -} diff --git a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/r4/MeasureDataProcessProvider.java b/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/r4/MeasureDataProcessProvider.java deleted file mode 100644 index c0625be21..000000000 --- a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/r4/MeasureDataProcessProvider.java +++ /dev/null @@ -1,163 +0,0 @@ -package org.opencds.cqf.ruler.casereporting.r4; - -import static ca.uhn.fhir.model.valueset.BundleTypeEnum.COLLECTION; -import static org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Composition; -import org.hl7.fhir.r4.model.Group; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.ListResource; -import org.hl7.fhir.r4.model.MeasureReport; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResourceType; -import org.opencds.cqf.ruler.provider.DaoRegistryOperationProvider; -import org.opencds.cqf.ruler.utility.Searches; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ca.uhn.fhir.rest.annotation.Operation; -import ca.uhn.fhir.rest.annotation.OperationParam; -import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; -import ca.uhn.fhir.rest.api.server.RequestDetails; - -/** - * This class attempts to collect line list data for given MeasureReport - */ -public class MeasureDataProcessProvider extends DaoRegistryOperationProvider { - - private static final Logger logger = LoggerFactory.getLogger(MeasureDataProcessProvider.class); - - @Operation(name = "$extract-line-list-data", idempotent = true, type = MeasureReport.class) - public Bundle extractLineListData(RequestDetails details, - @OperationParam(name = "measureReport", min = 0, max = 1, type = MeasureReport.class) MeasureReport measureReport, - @OperationParam(name = "subjectList") List subjectList) { - - var bundleFactory = this.getFhirContext().newBundleFactory(); - - Map populationSubjectListReferenceMap = new HashMap<>(); - gatherSubjectList(measureReport, subjectList, populationSubjectListReferenceMap); - gatherEicrs(bundleFactory, populationSubjectListReferenceMap); - Bundle bundle = (Bundle) bundleFactory.getResourceBundle(); - - if (bundle != null && bundle.hasEntry() && bundle.getEntryFirstRep().getResource() instanceof Bundle) { - return (Bundle) bundle.getEntryFirstRep().getResource(); - } - - return bundle; - } - - private void gatherEicrs(IVersionSpecificBundleFactory bundleFactory, - Map populationSubjectListReferenceMap) { - Map eicrs = new HashMap<>(); - List documentBundles = search(Bundle.class, Searches.all()) - .getAllResourcesTyped().stream() - .filter(x -> x.hasEntry() && DOCUMENT.equals(x.getType())).collect(Collectors.toList()); - - for (Bundle bundle : documentBundles) { - IBaseResource firstResource = bundle.getEntryFirstRep().getResource(); - if (!(firstResource instanceof Composition)) { - logger.debug("Any bundle of type document must have the first entry of type Composition, but found: {}", - firstResource); - continue; - } - - Composition composition = (Composition) firstResource; - Reference compositionSubject = composition.getSubject(); - String[] referenceSplit = compositionSubject.getReference().split("/"); - - for (Map.Entry entry : populationSubjectListReferenceMap.entrySet()) { - if (compositionSubject.equals(entry.getValue()) - || compositionSubject.getReference().equals(entry.getKey()) - || (referenceSplit.length > 1 && referenceSplit[1].equals(entry.getKey()))) { - eicrs.putIfAbsent(entry.getKey(), bundle); - } - } - } - - bundleFactory.addResourcesToBundle(eicrs.values().stream().collect(Collectors.toList()), COLLECTION, null, null, - null); - } - - private void gatherSubjectList(MeasureReport report, List subjectList, - Map populationSubjectListReferenceMap) { - if (subjectList == null && report == null) { - throw new IllegalArgumentException("Must have either a measureReport or a subjectList or both."); - } - if (report != null) { - gatherPatientsFromReport(report, populationSubjectListReferenceMap); - } else { - for (String subject : subjectList) { - populationSubjectListReferenceMap.putIfAbsent(subject, new Reference(subject)); - } - } - } - - private void gatherPatientsFromReport(MeasureReport report, - Map populationSubjectListReferenceMap) { - if (report.getSubject() != null) { - populationSubjectListReferenceMap.putIfAbsent(report.getSubject().getReference(), report.getSubject()); - } - for (MeasureReport.MeasureReportGroupComponent group : report.getGroup()) { - for (MeasureReport.MeasureReportGroupPopulationComponent population : group.getPopulation()) { - for (Reference subject : getSubjectResultsFromList(population.getSubjectResults())) { - if (subject.fhirType().equals("Patient")) { - populationSubjectListReferenceMap.putIfAbsent(subject.getReference(), subject); - } - if (subject.fhirType().equals("Group")) { - getPatientListFromGroup(subject.getReference()) - .forEach(patient -> populationSubjectListReferenceMap - .putIfAbsent(patient.getReference(), patient)); - } - } - } - } - } - - private List getPatientListFromGroup(String subjectGroupRef) { - List patientList = new ArrayList<>(); - Group group = read(new IdType(subjectGroupRef)); - group.getMember().forEach(member -> { - Reference reference = member.getEntity(); - if (reference.getReferenceElement().getResourceType().equals("Patient")) { - patientList.add(reference); - } else if (reference.getReferenceElement().getResourceType().equals("Group")) { - patientList.addAll(getPatientListFromGroup(reference.getReference())); - } else { - logger.info("Group member was not a Patient or a Group, so skipping. \n{}", reference.getReference()); - } - }); - return patientList; - } - - private List getSubjectResultsFromList(Reference subjectResults) { - List results = new ArrayList<>(); - if (subjectResults.getReference() == null) { - logger.debug("No subject results found."); - return results; - } - - IBaseResource baseList = read(subjectResults.getReferenceElement()); - - if (!(baseList instanceof ListResource)) { - throw new IllegalArgumentException( - String.format("Population subject reference was not a List, found: %s", baseList.fhirType())); - } - - ListResource list = (ListResource) baseList; - list.getEntry().forEach(entry -> { - if (entry.getItemTarget().getResourceType() == ResourceType.Patient - || entry.getItemTarget().getResourceType() == ResourceType.Group) { - results.add(entry.getItem()); - } - }); - - return results; - } -} diff --git a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/r4/ProcessMessageProvider.java b/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/r4/ProcessMessageProvider.java deleted file mode 100644 index b80c607df..000000000 --- a/plugin/case-reporting/src/main/java/org/opencds/cqf/ruler/casereporting/r4/ProcessMessageProvider.java +++ /dev/null @@ -1,209 +0,0 @@ -package org.opencds.cqf.ruler.casereporting.r4; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.UUID; - -import jakarta.servlet.http.HttpServletRequest; -import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; -import org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent; -import org.hl7.fhir.r4.model.Bundle.HTTPVerb; -import org.hl7.fhir.r4.model.Bundle.HTTPVerbEnumFactory; -import org.hl7.fhir.r4.model.Communication; -import org.hl7.fhir.r4.model.Enumeration; -import org.hl7.fhir.r4.model.MessageHeader; -import org.hl7.fhir.r4.model.Meta; -import org.hl7.fhir.r4.model.OperationOutcome; -import org.hl7.fhir.r4.model.Patient; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Resource; -import org.hl7.fhir.r4.model.UriType; -import org.opencds.cqf.ruler.provider.DaoRegistryOperationProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.valueset.BundleTypeEnum; -import ca.uhn.fhir.rest.annotation.Operation; -import ca.uhn.fhir.rest.annotation.OperationParam; -import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory; -import ca.uhn.fhir.rest.api.server.RequestDetails; -import ca.uhn.fhir.util.BundleUtil; - -public class ProcessMessageProvider extends DaoRegistryOperationProvider { - private static final Logger logger = LoggerFactory.getLogger(ProcessMessageProvider.class); - - @Operation(name = "$process-message-bundle", idempotent = false) - public Bundle processMessageBundle(HttpServletRequest theServletRequest, RequestDetails theRequestDetails, - @OperationParam(name = "content", min = 1, max = 1) @Description(formalDefinition = "The message to process (or, if using asynchronous messaging, it may be a response message to accept)") Bundle theMessageToProcess) { - logger.info("Validating the Bundle"); - Bundle bundle = theMessageToProcess; - Boolean errorExists = false; - OperationOutcome outcome = validateBundle(errorExists, bundle); - if (!errorExists) { - IVersionSpecificBundleFactory bundleFactory = this.getFhirContext().newBundleFactory(); - bundle.setId(getUUID()); - bundleFactory.initializeWithBundleResource(bundle); - Bundle dafBundle = (Bundle) bundleFactory.getResourceBundle(); - dafBundle.setTimestamp(new Date()); - this.getDaoRegistry().getResourceDao(Bundle.class).create(dafBundle); - - MessageHeader messageHeader = null; - String patientId = null; - String commId = null; - List headers = BundleUtil.toListOfResourcesOfType(this.getFhirContext(), bundle, - MessageHeader.class); - for (MessageHeader mh : headers) { - messageHeader = mh; - messageHeader.setId(getUUID()); - Meta meta = messageHeader.getMeta(); - meta.setLastUpdated(new Date()); - messageHeader.setMeta(meta); - } - - List resources = new ArrayList<>(); - - List patients = BundleUtil.toListOfResourcesOfType(this.getFhirContext(), bundle, Patient.class); - for (Patient p : patients) { - patientId = p.getId(); - p.setId(p.getIdElement().toVersionless()); - resources.add(p); - } - - List bundles = BundleUtil.toListOfResourcesOfType(this.getFhirContext(), bundle, Bundle.class); - for (Bundle b : bundles) { - patientId = this.processBundle(b, theRequestDetails); - b.setId(b.getIdElement().toVersionless()); - resources.add(b); - } - - for (BundleEntryComponent e : bundle.getEntry()) { - Resource r = e.getResource(); - if (r == null) { - continue; - } - - if (r.fhirType().equals("Bundle") || r.fhirType().equals("MessageHeader") - || r.fhirType().equals("Patient")) { - continue; - } - - r.setId(r.getIdElement().toVersionless()); - resources.add(r); - } - - if (patientId != null) { - commId = constructAndSaveCommunication(patientId); - } - if (messageHeader == null) { - messageHeader = constructMessageHeaderResource(); - BundleEntryComponent entryComp = new BundleEntryComponent(); - entryComp.setResource(messageHeader); - dafBundle.addEntry(entryComp); - } - if (commId != null) { - List referenceList = new ArrayList<>(); - Reference commRef = new Reference(); - commRef.setReference("Communication/" + commId); - referenceList.add(commRef); - messageHeader.setFocus(referenceList); - } - IVersionSpecificBundleFactory newBundleFactory = this.getFhirContext().newBundleFactory(); - newBundleFactory.addResourcesToBundle(resources, BundleTypeEnum.TRANSACTION, - theRequestDetails.getFhirServerBase(), null, null); - Bundle transactionBundle = (Bundle) newBundleFactory.getResourceBundle(); - for (BundleEntryComponent entry : transactionBundle.getEntry()) { - UriType uri = new UriType(entry.getResource().fhirType() - + "/" + entry.getResource().getIdElement().getIdPart()); - Enumeration method = new Enumeration<>(new HTTPVerbEnumFactory()); - method.setValue(HTTPVerb.PUT); - entry.setRequest(new BundleEntryRequestComponent(method, uri)); - } - - @SuppressWarnings("unchecked") - IFhirSystemDao fhirSystemDao = this.getDaoRegistry().getSystemDao(); - fhirSystemDao.transaction(theRequestDetails, transactionBundle); - return dafBundle; - } else { - BundleEntryComponent entryComp = new BundleEntryComponent(); - entryComp.setResource(outcome); - bundle.addEntry(entryComp); - return bundle; - } - } - - private String processBundle(Bundle bundle, RequestDetails requestDetails) { - String patientId = null; - List patients = BundleUtil.toListOfResourcesOfType(this.getFhirContext(), bundle, Patient.class); - for (Patient p : patients) { - patientId = p.getId(); - p.setId(p.getIdElement().toVersionless()); - this.update(p, requestDetails); - } - - for (BundleEntryComponent e : bundle.getEntry()) { - Resource r = e.getResource(); - if (r == null) { - continue; - } - - if (r.fhirType().equals("Patient")) { - continue; - } - - r.setId(r.getIdElement().toVersionless()); - this.update(r, requestDetails); - } - - return patientId; - } - - private OperationOutcome validateBundle(Boolean errorExists, Bundle bundle) { - // FhirValidator validator = this.getFhirContext().newValidator(); - OperationOutcome outcome = new OperationOutcome(); - // // Create a validation module and register it - // IValidatorModule module = new FhirInstanceValidator(this.getFhirContext()); - // validator.registerValidatorModule(module); - // ValidationResult result = validator.validateWithResult(bundle); - // outcome = (OperationOutcome) result.toOperationOutcome(); - // if (outcome.hasIssue()) { - // List issueCompList = outcome.getIssue(); - // for (OperationOutcomeIssueComponent issueComp : issueCompList) { - // if (issueComp.getSeverity().equals(IssueSeverity.ERROR)) { - // errorExists = true; - // } - // } - // } - return outcome; - } - - private MessageHeader constructMessageHeaderResource() { - String message = "{\"resourceType\": \"MessageHeader\",\"id\": \"messageheader-example-reportheader\",\"meta\": {\"versionId\": \"1\",\"lastUpdated\": \"2020-11-29T02:03:28.045+00:00\",\"profile\": [\"http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-messageheader\"]},\"extension\": [{\"url\": \"http://hl7.org/fhir/us/medmorph/StructureDefinition/ext-dataEncrypted\",\"valueBoolean\": false},{\"url\":\"http://hl7.org/fhir/us/medmorph/StructureDefinition/ext-messageProcessingCategory\",\"valueCode\": \"consequence\"}],\"eventCoding\": {\"system\": \"http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-messageheader-message-types\",\"code\": \"cancer-report-message\"},\"destination\": [{\"name\": \"PHA endpoint\",\"endpoint\": \"http://example.pha.org/fhir\"}],\"source\": {\"name\": \"Healthcare Organization\",\"software\": \"Backend Service App\",\"version\": \"3.1.45.AABB\",\"contact\": {\"system\": \"phone\",\"value\": \"+1 (917) 123 4567\"},\"endpoint\": \"http://example.healthcare.org/fhir\"},\"reason\": {\"coding\": [{\"system\": \"http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-triggerdefinition-namedevents\",\"code\": \"encounter-close\"}]}}"; - MessageHeader messageHeader = (MessageHeader) this.getFhirContext().newJsonParser().parseResource(message); - messageHeader.setId(getUUID()); - return messageHeader; - } - - private String constructAndSaveCommunication(String patientId) { - String communication = "{\"resourceType\" : \"Communication\",\"meta\" : {\"versionId\" : \"1\",\"profile\" : [\"http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-communication\"]},\"extension\" : [{\"url\" : \"http://hl7.org/fhir/us/medmorph/StructureDefinition/ext-responseMessageStatus\",\"valueCodeableConcept\" : {\"coding\" : [{\"system\" :\"http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-response-message-processing-status\",\"code\" : \"RRVS1\"}]}}],\"identifier\" : [{\"system\" : \"http://example.pha.org/\",\"value\" : \"12345\"}],\"status\" : \"completed\",\"category\" : [{\"coding\" : [{\"system\" : \"http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-messageheader-message-types\",\"code\" : \"cancer-response-message\"}]}],\"reasonCode\" : [{\"coding\" : [{\"system\" : \"http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-messageheader-message-types\",\"code\" : \"cancer-report-message\"}]}]}"; - Communication comm = (Communication) this.getFhirContext().newJsonParser().parseResource(communication); - String commId = getUUID(); - comm.setId(commId); - Meta meta = comm.getMeta(); - meta.setLastUpdated(new Date()); - comm.setMeta(meta); - comm.setSubject(new Reference(patientId)); - comm.setReceived(new Date()); - this.getDaoRegistry().getResourceDao(Communication.class).create(comm); - return commId; - } - - public String getUUID() { - UUID uuid = UUID.randomUUID(); - return uuid.toString(); - } -} diff --git a/plugin/case-reporting/src/main/resources/META-INF/spring-properties b/plugin/case-reporting/src/main/resources/META-INF/spring-properties deleted file mode 100644 index e41dcd936..000000000 --- a/plugin/case-reporting/src/main/resources/META-INF/spring-properties +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.opencds.cqf.ruler.casereporting.CaseReportingConfig diff --git a/plugin/case-reporting/src/main/resources/application.yaml b/plugin/case-reporting/src/main/resources/application.yaml deleted file mode 100644 index 7e2e10763..000000000 --- a/plugin/case-reporting/src/main/resources/application.yaml +++ /dev/null @@ -1,4 +0,0 @@ -hapi: - fhir: - casereporting: - enabled: true diff --git a/plugin/case-reporting/src/test/java/org/opencds/cqf/ruler/casereporting/r4/MeasureDataProcessProviderIT.java b/plugin/case-reporting/src/test/java/org/opencds/cqf/ruler/casereporting/r4/MeasureDataProcessProviderIT.java deleted file mode 100644 index dac4759c2..000000000 --- a/plugin/case-reporting/src/test/java/org/opencds/cqf/ruler/casereporting/r4/MeasureDataProcessProviderIT.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.opencds.cqf.ruler.casereporting.r4; - -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.opencds.cqf.fhir.utility.r4.Parameters.parameters; -import static org.opencds.cqf.fhir.utility.r4.Parameters.part; - -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.MeasureReport; -import org.hl7.fhir.r4.model.Parameters; -import org.junit.jupiter.api.Test; -import org.opencds.cqf.ruler.casereporting.CaseReportingConfig; -import org.opencds.cqf.ruler.test.RestIntegrationTest; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.annotation.DirtiesContext; - -@DirtiesContext -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = { - CaseReportingConfig.class }, properties = { - "hapi.fhir.fhir_version=r4", - "hapi.fhir.cr.enabled=true", - }) -class MeasureDataProcessProviderIT extends RestIntegrationTest { - @Test - void testMeasureReportExtractLineListData() { - loadResource("Patient-ra-patient01.json"); - loadResource("Patient-ra-patient02.json"); - loadResource("Patient-ra-patient03.json"); - loadResource("Group-ra-group00.json"); - loadResource("Group-ra-group01.json"); - loadResource("Group-ra-group02.json"); - loadResource("MeasureReport-ra-measurereport01.json"); - - MeasureReport measureReport = getClient().read().resource(MeasureReport.class) - .withId("ra-measurereport01").execute(); - - assertNotNull(measureReport); - - Parameters params = parameters(part("measureReport", measureReport)); - - Bundle returnBundle = getClient().operation().onType(MeasureReport.class) - .named("$extract-line-list-data") - .withParameters(params) - .returnResourceType(Bundle.class) - .execute(); - - assertNotNull(returnBundle); - } -} diff --git a/plugin/case-reporting/src/test/java/org/opencds/cqf/ruler/casereporting/r4/ProcessMessageProviderIT.java b/plugin/case-reporting/src/test/java/org/opencds/cqf/ruler/casereporting/r4/ProcessMessageProviderIT.java deleted file mode 100644 index 9d83a7c6e..000000000 --- a/plugin/case-reporting/src/test/java/org/opencds/cqf/ruler/casereporting/r4/ProcessMessageProviderIT.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.opencds.cqf.ruler.casereporting.r4; - -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Encounter; -import org.hl7.fhir.r4.model.MeasureReport; -import org.hl7.fhir.r4.model.Parameters; -import org.hl7.fhir.r4.model.Patient; -import org.junit.jupiter.api.Test; -import org.opencds.cqf.ruler.casereporting.CaseReportingConfig; -import org.opencds.cqf.ruler.test.RestIntegrationTest; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.annotation.DirtiesContext; - -@DirtiesContext -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = { - CaseReportingConfig.class }, properties = { "hapi.fhir.fhir_version=r4", "hapi.fhir.cr.enabled=true", }) -class ProcessMessageProviderIT extends RestIntegrationTest { - @Test - void testProcessMessage() { - Bundle bundle = (Bundle) loadResource("example-eicr.json"); - - Bundle returnBundle = getClient().operation().onServer() - .named("$process-message-bundle") - .withParameter(Parameters.class, "content", bundle) - .returnResourceType(Bundle.class) - .execute(); - - assertNotNull(returnBundle); - assertNotNull(getClient().read().resource(Patient.class).withId("patient-12742542").execute()); - assertNotNull(getClient().read().resource(Encounter.class).withId("encounter-97953898").execute()); - assertNotNull(getClient().read().resource(MeasureReport.class).withId("diabetes-mp").execute()); - } -} diff --git a/plugin/case-reporting/src/test/resources/Group-ra-group00.json b/plugin/case-reporting/src/test/resources/Group-ra-group00.json deleted file mode 100644 index 9ae55af8f..000000000 --- a/plugin/case-reporting/src/test/resources/Group-ra-group00.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "resourceType": "Group", - "id": "ra-group00", - "meta": { - "profile": [ - "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-patient-group" - ] - }, - "type": "person", - "actual": true, - "member": [ - { - "entity": { - "reference": "Patient/ra-patient01" - } - } - ] -} diff --git a/plugin/case-reporting/src/test/resources/Group-ra-group01.json b/plugin/case-reporting/src/test/resources/Group-ra-group01.json deleted file mode 100644 index a3be24ae9..000000000 --- a/plugin/case-reporting/src/test/resources/Group-ra-group01.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "resourceType": "Group", - "id": "ra-group01", - "meta": { - "profile": [ - "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-patient-group" - ] - }, - "type": "person", - "actual": true, - "member": [ - { - "entity": { - "reference": "Patient/ra-patient02" - } - } - ] -} diff --git a/plugin/case-reporting/src/test/resources/Group-ra-group02.json b/plugin/case-reporting/src/test/resources/Group-ra-group02.json deleted file mode 100644 index a386565f6..000000000 --- a/plugin/case-reporting/src/test/resources/Group-ra-group02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "resourceType": "Group", - "id": "ra-group02", - "meta": { - "profile": [ - "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-patient-group" - ] - }, - "type": "person", - "actual": true, - "member": [ - { - "entity": { - "reference": "Patient/ra-patient02" - } - }, - { - "entity": { - "reference": "Patient/ra-patient03" - } - } - ] -} \ No newline at end of file diff --git a/plugin/case-reporting/src/test/resources/MeasureReport-ra-measurereport01.json b/plugin/case-reporting/src/test/resources/MeasureReport-ra-measurereport01.json deleted file mode 100644 index 68e56b26f..000000000 --- a/plugin/case-reporting/src/test/resources/MeasureReport-ra-measurereport01.json +++ /dev/null @@ -1,555 +0,0 @@ -{ - "resourceType": "MeasureReport", - "id": "ra-measurereport01", - "meta": { - "profile": [ - "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-measurereport" - ] - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-clinicalDataCollectionDeadline", - "valueDate": "2022-03-31" - } - ], - "status": "complete", - "type": "individual", - "measure": "https://build.fhir.org/ig/HL7/davinci-ra/Measure-RAModelExample01", - "date": "2021-10-18", - "period": { - "start": "2021-01-01", - "end": "2021-09-30" - }, - "group": [ - { - "id": "group-001", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "18", - "display": "Diabetes with Chronic Complications" - } - ], - "text": "HCC 18: Diabetes with Chronic Complications" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "historic", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "closed-gap", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2021-04-01" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-not-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - }, - { - "id": "group-002", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "111", - "display": "Chronic Obstructive Pulmonary Disease" - } - ], - "text": "HCC 111: Chronic Obstructive Pulmonary Disease" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "historic", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "pending", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2021-09-29" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-not-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - }, - { - "id": "group-003", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "53", - "display": "Major Depressive, Bipolar, and Paranoid Disorders" - } - ], - "text": "HCC 59: Major Depressive, Bipolar, and Paranoid Disorders" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "historic", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "open-gap", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2020-07-15" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-not-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - }, - { - "id": "group-004", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "112", - "display": "Fibrosis of lung and other chronic lung disorders" - } - ], - "text": "HCC 112: Fibrosis of lung and other chronic lung disorders" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "historic", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "closed-gap", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2021-04-27" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - }, - { - "id": "group-005", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "19", - "display": "Diabetes without Complications" - } - ], - "text": "HCC 19: Diabetes without Complications" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "historic", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "pending", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2021-09-27" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - }, - { - "id": "group-006", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "84", - "display": "Cardio-Respiratory Failure and Shock" - } - ], - "text": "HCC 84: Cardio-Respiratory Failure and Shock" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "historic", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "open-gap", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2020-12-15" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - }, - { - "id": "group-007", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "22", - "display": "Morbid Obesity" - } - ], - "text": "HCC 22: Morbid Obesity" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "suspected", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "closed-gap", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2021-03-15" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-not-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - }, - { - "id": "group-008", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "96", - "display": "Specified Heart Arrhythmias" - } - ], - "text": "HCC 96: Specified Heart Arrhythmias" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "suspected", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "pending", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2021-09-27" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-not-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - }, - { - "id": "group-009", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "110", - "display": "Cystic Fibrosis" - } - ], - "text": "HCC 110: Cystic Fibrosis" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "suspected", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "open-gap", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2020-07-15" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-not-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - }, - { - "id": "group-010", - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/cmshcc", - "version": "24", - "code": "83", - "display": "Respiratory Arrest" - } - ], - "text": "HCC 110: Cystic Fibrosis" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-suspectType", - "valueCodeableConcept": { - "coding": [ - { - "code": "net-new", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/suspect-type" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "pending", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/evidence-status" - } - ] - } - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-evidenceStatusDate", - "valueDate": "2021-09-28" - }, - { - "url": "http://hl7.org/fhir/us/davinci-ra/StructureDefinition/ra-hierarchicalStatus", - "valueCodeableConcept": { - "coding": [ - { - "code": "applied-not-superseded", - "system": "http://hl7.org/fhir/us/davinci-ra/CodeSystem/hierarchical-status" - } - ] - } - } - ] - } - ] -} diff --git a/plugin/case-reporting/src/test/resources/Observation-ra-obs21pat01.json b/plugin/case-reporting/src/test/resources/Observation-ra-obs21pat01.json deleted file mode 100644 index fc7053f0d..000000000 --- a/plugin/case-reporting/src/test/resources/Observation-ra-obs21pat01.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "resourceType" : "Observation", - "id" : "ra-obs21pat01", - "meta" : { - "extension" : [ - { - "url" : "http://hl7.org/fhir/StructureDefinition/instance-name", - "valueString" : "Trypsin [Mass/volume] in Serum or Plasma for Pat01" - }, - { - "url" : "http://hl7.org/fhir/StructureDefinition/instance-description", - "valueMarkdown" : "Trypsin [Mass/volume] in Serum or Plasma for Pat01*." - } - ], - "profile" : [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab" - ] - }, - "status" : "final", - "category" : [ - { - "coding" : [ - { - "system" : "http://terminology.hl7.org/CodeSystem/observation-category", - "code" : "laboratory", - "display" : "Laboratory" - } - ], - "text" : "Laboratory" - } - ], - "code" : { - "coding" : [ - { - "system" : "http://loinc.org", - "code" : "33325-2", - "display" : "Trypsin [Mass/volume] in Serum or Plasma" - } - ], - "text" : "Trypsin [Mass/volume] in Serum or Plasma" - }, - "subject" : { - "reference" : "Patient/ra-patient01", - "display" : "Eve Everywoman" - }, - "effectiveDateTime" : "2019-06-17", - "valueQuantity" : { - "value" : 770, - "unit" : "ng/mL", - "system" : "http://unitsofmeasure.org" - }, - "referenceRange" : [ - { - "low" : { - "value" : 169, - "unit" : "ng/mL", - "system" : "http://unitsofmeasure.org", - "code" : "ng/mL" - }, - "high" : { - "value" : 773, - "unit" : "ng/mL", - "system" : "http://unitsofmeasure.org", - "code" : "mg/dL" - }, - "type" : - { - "coding" : [ - { - "system" : "http://terminology.hl7.org/CodeSystem/referencerange-meaning", - "code" : "normal", - "display" : "Normal Range" - } - ], - "text" : "Normal Range" - } - } - ] -} diff --git a/plugin/case-reporting/src/test/resources/Patient-ra-patient01.json b/plugin/case-reporting/src/test/resources/Patient-ra-patient01.json deleted file mode 100644 index f1a1b86b8..000000000 --- a/plugin/case-reporting/src/test/resources/Patient-ra-patient01.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "resourceType": "Patient", - "id": "ra-patient01", - "meta": { - "profile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient" - ] - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", - "valueCode": "F" - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", - "extension": [ - { - "url": "ombCategory", - "valueCoding": { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2106-3", - "display": "White" - } - }, - { - "url": "text", - "valueString": "White" - } - ] - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", - "extension": [ - { - "url": "ombCategory", - "valueCoding": { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2186-5", - "display": "Not Hispanic or Latino" - } - }, - { - "url": "text", - "valueString": "Not Hispanic or Latino" - } - ] - } - ], - "identifier": [ - { - "use": "usual", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "MR", - "display": "Medical record number" - } - ] - }, - "system": "http://hospital.davinci.org", - "value": "12345" - } - ], - "active": true, - "name": [ - { - "use": "official", - "family": "Everywoman", - "given": [ - "Eve" - ] - } - ], - "gender": "female", - "birthDate": "1975-01-16", - "deceasedBoolean": false, - "address": [ - { - "use": "home", - "line": [ - "2222 Home Street" - ], - "city": "Ann Arbor", - "state": "MI", - "postalCode": "99999", - "country": "USA" - } - ], - "maritalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", - "code": "M", - "display": "Married" - } - ] - }, - "communication": [ - { - "language": { - "coding": [ - { - "system": "urn:ietf:bcp:47", - "code": "en-US", - "display": "English (Region=United States)" - } - ] - }, - "preferred": true - } - ] -} diff --git a/plugin/case-reporting/src/test/resources/Patient-ra-patient02.json b/plugin/case-reporting/src/test/resources/Patient-ra-patient02.json deleted file mode 100644 index 5256799b2..000000000 --- a/plugin/case-reporting/src/test/resources/Patient-ra-patient02.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "resourceType": "Patient", - "id": "ra-patient02", - "meta": { - "profile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient" - ] - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", - "valueCode": "M" - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", - "extension": [ - { - "url": "ombCategory", - "valueCoding": { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2106-3", - "display": "White" - } - }, - { - "url": "text", - "valueString": "White" - } - ] - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", - "extension": [ - { - "url": "ombCategory", - "valueCoding": { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2186-5", - "display": "Not Hispanic or Latino" - } - }, - { - "url": "text", - "valueString": "Not Hispanic or Latino" - } - ] - } - ], - "identifier": [ - { - "use": "usual", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "MR", - "display": "Medical record number" - } - ] - }, - "system": "http://hospital.davinci.org", - "value": "23456" - } - ], - "active": true, - "name": [ - { - "use": "official", - "family": "Everyman", - "given": [ - "Adam" - ] - } - ], - "gender": "female", - "birthDate": "1950-12-16", - "deceasedBoolean": false, - "address": [ - { - "use": "home", - "line": [ - "2222 Home Street" - ], - "city": "Ann Arbor", - "state": "MI", - "postalCode": "99999", - "country": "USA" - } - ], - "maritalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", - "code": "M", - "display": "Married" - } - ] - }, - "communication": [ - { - "language": { - "coding": [ - { - "system": "urn:ietf:bcp:47", - "code": "en-US", - "display": "English (Region=United States)" - } - ] - }, - "preferred": true - } - ] -} diff --git a/plugin/case-reporting/src/test/resources/Patient-ra-patient03.json b/plugin/case-reporting/src/test/resources/Patient-ra-patient03.json deleted file mode 100644 index 1b45ef856..000000000 --- a/plugin/case-reporting/src/test/resources/Patient-ra-patient03.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "resourceType": "Patient", - "id": "ra-patient03", - "meta": { - "profile": [ - "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient" - ] - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", - "valueCode": "F" - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", - "extension": [ - { - "url": "ombCategory", - "valueCoding": { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2054-5", - "display": "Black or African American" - } - }, - { - "url": "text", - "valueString": "Black or African American" - } - ] - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", - "extension": [ - { - "url": "ombCategory", - "valueCoding": { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2186-5", - "display": "Not Hispanic or Latino" - } - }, - { - "url": "text", - "valueString": "Not Hispanic or Latino" - } - ] - } - ], - "identifier": [ - { - "use": "usual", - "type": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "MR", - "display": "Medical record number" - } - ] - }, - "system": "http://hospital.davinci.org", - "value": "34567" - } - ], - "active": true, - "name": [ - { - "use": "official", - "family": "Nuclear", - "given": [ - "Nelda" - ] - } - ], - "gender": "female", - "birthDate": "1965-07-26", - "deceasedBoolean": false, - "address": [ - { - "use": "home", - "line": [ - "6666 Home Street" - ], - "city": "Ann Arbor", - "state": "MI", - "postalCode": "99999", - "country": "USA" - } - ], - "maritalStatus": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", - "code": "M", - "display": "Married" - } - ] - }, - "communication": [ - { - "language": { - "coding": [ - { - "system": "urn:ietf:bcp:47", - "code": "en-US", - "display": "English (Region=United States)" - } - ] - }, - "preferred": true - } - ] -} diff --git a/plugin/case-reporting/src/test/resources/Practitioner-ra-prac01pat01.json b/plugin/case-reporting/src/test/resources/Practitioner-ra-prac01pat01.json deleted file mode 100644 index 57bffb704..000000000 --- a/plugin/case-reporting/src/test/resources/Practitioner-ra-prac01pat01.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "resourceType": "Practitioner", - "id": "ra-prac01pat01", - "text": { - "status": "generated", - "div": "
\n

Dr Adam Careful is a Referring Practitioner for Acme Hospital from 1-Jan 2012 to 31-Mar\n 2012

\n
" - }, - "identifier": [ - { - "system": "http://www.acme.org/practitioners", - "value": "23" - } - ], - "active": true, - "name": [ - { - "family": "Careful", - "given": [ - "Adam" - ], - "prefix": [ - "Dr" - ] - } - ], - "address": [ - { - "use": "home", - "line": [ - "534 Erewhon St" - ], - "city": "PleasantVille", - "state": "Vic", - "postalCode": "3999" - } - ], - "qualification": [ - { - "identifier": [ - { - "system": "http://example.org/UniversityIdentifier", - "value": "12345" - } - ], - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0360/2.7", - "code": "BS", - "display": "Bachelor of Science" - } - ], - "text": "Bachelor of Science" - }, - "period": { - "start": "1995" - }, - "issuer": { - "display": "Example University" - } - } - ] -} diff --git a/plugin/case-reporting/src/test/resources/example-eicr.json b/plugin/case-reporting/src/test/resources/example-eicr.json deleted file mode 100644 index d8dd42ff0..000000000 --- a/plugin/case-reporting/src/test/resources/example-eicr.json +++ /dev/null @@ -1,1728 +0,0 @@ -{ - "resourceType": "Bundle", - "id": "eicr-report", - "meta": { - "versionId": "1", - "lastUpdated": "2021-07-29T16:44:18.217+00:00", - "profile": [ - "http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-measurereport-bundle" - ] - }, - "type": "document", - "timestamp": "2021-07-29T16:44:18.218+00:00", - "entry": [ - { - "resource": { - "resourceType": "Composition", - "id": "4975e926-7ca2-49ba-ac12-175213a7fcc5", - "contained": [ - { - "resourceType": "Device", - "id": "1", - "deviceName": [ - { - "name": "eCRNow/Backend Service App" - } - ] - } - ], - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-versionNumber", - "valueString": "1" - } - ], - "identifier": { - "value": "4975e926-7ca2-49ba-ac12-175213a7fcc5" - }, - "type": { - "coding": [ - { - "system": "http://loinc.org", - "code": "55751-2", - "display": "Public Health Case Report" - } - ], - "text": "Public Health Case Report" - }, - "subject": { - "reference": "Patient/patient-12742542" - }, - "encounter": { - "reference": "https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/Encounter/encounter-97953898" - }, - "date": "2021-07-29T16:44:18+00:00", - "author": [ - { - "reference": "#1" - } - ], - "section": [ - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "46239-0", - "display": "Chief complaint+Reason for visit Narrative" - } - ], - "text": "Chief complaint+Reason for visit Narrative" - }, - "text": { - "div": "
No Information
" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "10164-2", - "display": "History of Present illness Narrative" - } - ], - "text": "History of Present illness Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "10187-3", - "display": "Review of Systems narrative" - } - ], - "text": "Review of Systems narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "11450-4", - "display": "Problem Section Narrative" - } - ], - "text": "Problem Section Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "11348-0", - "display": "Past Medical History Narrative" - } - ], - "text": "Past Medical History Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "29549-3", - "display": "Medications Administered Narrative" - } - ], - "text": "Medications Administered Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "30954-2", - "display": "Results Section Narrative" - } - ], - "text": "Results Section Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "18776-5", - "display": "Plan of Treatment Narrative" - } - ], - "text": "Plan of Treatment Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "11369-6", - "display": "Immunizations Narrative" - } - ], - "text": "Immunizations Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "47519-4", - "display": "Procedure Section Narrative" - } - ], - "text": "Procedure Section Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8716-3", - "display": "Vital Signs Narrative" - } - ], - "text": "Vital Signs Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "29762-2", - "display": "Social History Narrative" - } - ], - "text": "Social History Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "90767-5", - "display": "Pregnancy Section Narrative" - } - ], - "text": "Pregnancy Section Narrative" - } - }, - { - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "83910-0", - "display": "Emergency Outbreak Section Narrative" - } - ], - "text": "Emergency Outbreak Section Narrative" - } - } - ] - } - }, - { - "resource": { - "resourceType": "Patient", - "id": "patient-12742542", - "meta": { - "versionId": "10", - "lastUpdated": "2021-05-14T17:38:03.000Z" - }, - "text": { - "status": "extensions", - "div": "

Patient

Name: GILBERT, ALICE S

Status: Active

DOB: Nov 16, 1970

Birth Sex: Female

Administrative Gender: Female

Marital Status: Married

" - }, - "extension": [ - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", - "valueCode": "F" - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", - "extension": [ - { - "url": "detailed", - "valueCoding": { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2131-1", - "display": "Other Race", - "userSelected": false - } - }, - { - "url": "text", - "valueString": "Other Race" - } - ] - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", - "extension": [ - { - "url": "ombCategory", - "valueCoding": { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2135-2", - "display": "Hispanic or Latino", - "userSelected": false - } - }, - { - "url": "text", - "valueString": "Hispanic, Latino, or Spanish Origin" - } - ] - } - ], - "identifier": [ - { - "id": "CI-490117359-0", - "use": "usual", - "type": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/4", - "code": "2", - "display": "Community Medical Record Number", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "MR", - "display": "Medical record number", - "userSelected": false - } - ], - "text": "Community Medical Record Number" - }, - "system": "urn:oid:2.16.840.1.113883.3.787.0.0", - "value": "9002472173", - "_value": { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/rendered-value", - "valueString": "9002472173" - } - ] - } - }, - { - "id": "CI-490056475-1", - "use": "usual", - "type": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/4", - "code": "10", - "display": "MRN", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "MR", - "display": "Medical record number", - "userSelected": false - } - ], - "text": "MRN" - }, - "system": "urn:oid:2.16.840.1.113883.6.1000", - "value": "6967", - "_value": { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/rendered-value", - "valueString": "00000006967" - } - ] - } - }, - { - "id": "CI-490261455-3", - "use": "usual", - "type": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/4", - "code": "670843", - "display": "Messaging", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "U", - "display": "Unspecified identifier", - "userSelected": false - } - ], - "text": "Messaging" - }, - "system": "urn:oid:2.16.840.1.113883.3.13.8", - "value": "64D6F66CC7F74DC6A7B0CCB486DD61D1", - "_value": { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/rendered-value", - "valueString": "64D6F66CC7F74DC6A7B0CCB486DD61D1" - } - ] - }, - "period": { - "start": "2021-05-14T17:38:03.000Z" - } - }, - { - "id": "CI-490261452-4", - "use": "usual", - "type": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/4", - "code": "2553236771", - "display": "Federated Person Principal", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "AN", - "display": "Account number", - "userSelected": false - } - ], - "text": "Federated Person Principal" - }, - "system": "urn:oid:2.16.840.1.113883.3.13.6", - "value": "URN:CERNER:IDENTITY-FEDERATION:REALM:EC2458F2-1E24-41C8-B71B-0E701AF7583D-CH:PRINCIPAL:YK2IQ7QH6JE3KR4E", - "_value": { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/rendered-value", - "valueString": "URN:CERNER:IDENTITY-FEDERATION:REALM:EC2458F2-1E24-41C8-B71B-0E701AF7583D-CH:PRINCIPAL:YK2IQ7QH6JE3KR4E" - } - ] - }, - "period": { - "start": "2021-05-14T17:38:02.000Z" - } - }, - { - "id": "CI-490155187-5", - "use": "usual", - "type": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/4", - "code": "2553236785", - "display": "MIllennium Person Identifier", - "userSelected": true - } - ], - "text": "MIllennium Person Identifier" - }, - "value": "13520", - "_value": { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/rendered-value", - "valueString": "13520" - } - ] - }, - "period": { - "start": "2020-12-18T19:15:15.000Z" - } - } - ], - "active": true, - "name": [ - { - "id": "CI-patient-12742542-0", - "use": "official", - "text": "GILBERT, ALICE S", - "family": "GILBERT", - "given": [ - "ALICE", - "S" - ] - } - ], - "telecom": [ - { - "id": "CI-PH-29822737-0", - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/iso21090-TEL-address", - "valueUrl": "(212)555-5557" - } - ], - "system": "phone", - "value": "2125555557", - "use": "home", - "rank": 1, - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - }, - { - "id": "CI-EM-29864766-0", - "system": "email", - "value": "zwhptupssiogslisnh@twzhhq.com", - "use": "home", - "rank": 1, - "period": { - "start": "2021-05-14T17:36:14.000Z" - } - } - ], - "gender": "female", - "birthDate": "1970-11-16", - "address": [ - { - "id": "CI-24326610-0", - "use": "home", - "text": "2802 ROCK CREEK PKWY\nKANSAS CITY, MO 64117\nUS", - "line": [ - "2802 ROCK CREEK PKWY" - ], - "city": "KANSAS CITY", - "state": "MO", - "postalCode": "64117", - "country": "US", - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - } - ], - "maritalStatus": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/38", - "code": "309237", - "display": "Married", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus", - "code": "M", - "display": "Married", - "userSelected": false - } - ], - "text": "Married" - }, - "contact": [ - { - "relationship": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/351", - "code": "2553243305", - "display": "Authorized Representative", - "userSelected": true - } - ], - "text": "Authorized Representative" - } - ], - "name": { - "id": "CI-12742543-0", - "use": "official", - "text": "GILBERT, ROY", - "family": "GILBERT", - "given": [ - "ROY" - ] - }, - "telecom": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/iso21090-TEL-address", - "valueUrl": "(212)555-5557" - } - ], - "system": "phone", - "value": "2125555557", - "use": "home", - "rank": 1, - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - }, - { - "system": "email", - "value": "RoyGbiv@yahoo.com", - "use": "home", - "rank": 1, - "period": { - "start": "2020-04-27T16:52:16.000Z" - } - } - ], - "address": { - "use": "home", - "text": "2802 ROCK CREEK PKWY\nKANSAS CITY, MO 64117\nUS", - "line": [ - "2802 ROCK CREEK PKWY" - ], - "city": "KANSAS CITY", - "state": "MO", - "postalCode": "64117", - "country": "US", - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - }, - "gender": "male" - }, - { - "relationship": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/351", - "code": "1152", - "display": "Emergency Contact", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0131", - "code": "C", - "display": "Emergency Contact", - "userSelected": false - } - ], - "text": "Emergency Contact" - } - ], - "name": { - "id": "CI-12747697-1", - "use": "official", - "text": "GILBERT, ROY", - "family": "GILBERT", - "given": [ - "ROY" - ], - "period": { - "start": "2020-12-23T19:00:37.000Z" - } - }, - "telecom": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/iso21090-TEL-address", - "valueUrl": "(212)555-5557" - } - ], - "system": "phone", - "value": "2125555557", - "use": "home", - "rank": 1, - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - }, - { - "system": "email", - "value": "RoyGbiv@yahoo.com", - "use": "home", - "rank": 1, - "period": { - "start": "2020-04-27T16:52:16.000Z" - } - } - ], - "address": { - "use": "home", - "text": "2802 ROCK CREEK PKWY\nKANSAS CITY, MO 64117\nUS", - "line": [ - "2802 ROCK CREEK PKWY" - ], - "city": "KANSAS CITY", - "state": "MO", - "postalCode": "64117", - "country": "US", - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - }, - "gender": "male", - "period": { - "start": "2020-12-23T19:00:36.000Z" - } - }, - { - "relationship": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/351", - "code": "1152", - "display": "Emergency Contact", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0131", - "code": "C", - "display": "Emergency Contact", - "userSelected": false - } - ], - "text": "Emergency Contact" - } - ], - "name": { - "id": "CI-12742543-2", - "use": "official", - "text": "GILBERT, ROY", - "family": "GILBERT", - "given": [ - "ROY" - ] - }, - "telecom": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/iso21090-TEL-address", - "valueUrl": "(212)555-5557" - } - ], - "system": "phone", - "value": "2125555557", - "use": "home", - "rank": 1, - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - }, - { - "system": "email", - "value": "RoyGbiv@yahoo.com", - "use": "home", - "rank": 1, - "period": { - "start": "2020-04-27T16:52:16.000Z" - } - } - ], - "address": { - "use": "home", - "text": "2802 ROCK CREEK PKWY\nKANSAS CITY, MO 64117\nUS", - "line": [ - "2802 ROCK CREEK PKWY" - ], - "city": "KANSAS CITY", - "state": "MO", - "postalCode": "64117", - "country": "US", - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - }, - "gender": "male", - "period": { - "end": "2020-12-23T19:00:37.000Z" - } - }, - { - "relationship": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/351", - "code": "1153", - "display": "Family Member", - "userSelected": true - } - ], - "text": "Family Member" - } - ], - "name": { - "id": "CI-12742543-3", - "use": "official", - "text": "GILBERT, ROY", - "family": "GILBERT", - "given": [ - "ROY" - ] - }, - "telecom": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/iso21090-TEL-address", - "valueUrl": "(212)555-5557" - } - ], - "system": "phone", - "value": "2125555557", - "use": "home", - "rank": 1, - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - }, - { - "system": "email", - "value": "RoyGbiv@yahoo.com", - "use": "home", - "rank": 1, - "period": { - "start": "2020-04-27T16:52:16.000Z" - } - } - ], - "address": { - "use": "home", - "text": "2802 ROCK CREEK PKWY\nKANSAS CITY, MO 64117\nUS", - "line": [ - "2802 ROCK CREEK PKWY" - ], - "city": "KANSAS CITY", - "state": "MO", - "postalCode": "64117", - "country": "US", - "period": { - "start": "2020-04-27T16:50:28.000Z" - } - }, - "gender": "male" - } - ], - "communication": [ - { - "language": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/36", - "code": "2553237401", - "display": "Spanish", - "userSelected": true - }, - { - "system": "urn:ietf:bcp:47", - "code": "es", - "display": "Spanish", - "userSelected": false - } - ], - "text": "Spanish" - }, - "preferred": true - } - ], - "generalPractitioner": [ - { - "id": "CI-490056499-0", - "reference": "Practitioner/11938004", - "display": "Bradford, MD, Michael Cerner" - } - ] - } - }, - { - "resource": { - "resourceType": "Encounter", - "id": "encounter-97953898", - "meta": { - "versionId": "2", - "lastUpdated": "2020-12-23T19:04:25.000Z" - }, - "text": { - "status": "generated", - "div": "

Encounter

Patient: GILBERT, ALICE S

Location: Model Hospital, MX Hospital, ICU, 101, A

Type: Inpatient

Service Type: Pulmonology

Class: inpatient encounter

Status: In Progress

Period Start Date: Dec 23, 2020 7:02 P.M. UTC

Reason For Visit: Covid-19 rule out

Attending Physician: Carter, Kristin Cerner

Service Provider: Model Hospital

" - }, - "extension": [ - { - "url": "https://fhir-ehr.cerner.com/r4/StructureDefinition/custom-attribute", - "extension": [ - { - "id": "ENCNTR:3339151", - "url": "custom-attribute-name", - "valueString": "Previous Patient Type" - }, - { - "url": "custom-attribute-value", - "valueCodeableConcept": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/71", - "code": "309308", - "display": "Inpatient", - "userSelected": true - } - ], - "text": "Inpatient" - } - } - ] - }, - { - "url": "https://fhir-ehr.cerner.com/r4/StructureDefinition/custom-attribute", - "extension": [ - { - "id": "ENCNTR:204298207", - "url": "custom-attribute-name", - "valueString": "Full Reg User ID" - }, - { - "url": "custom-attribute-value", - "valueString": "REGSUPER" - } - ] - }, - { - "url": "https://fhir-ehr.cerner.com/r4/StructureDefinition/custom-attribute", - "extension": [ - { - "id": "ENCNTR:17368048", - "url": "custom-attribute-name", - "valueString": "Full Reg Date/Time" - }, - { - "url": "custom-attribute-value", - "valueDateTime": "2020-12-23T19:04:24.000Z" - } - ] - }, - { - "url": "https://fhir-ehr.cerner.com/r4/StructureDefinition/custom-attribute", - "extension": [ - { - "id": "ENCNTR:34310433", - "url": "custom-attribute-name", - "valueString": "Complete Reg?" - }, - { - "url": "custom-attribute-value", - "valueCodeableConcept": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/20322", - "code": "3542949", - "display": "Yes", - "userSelected": true - } - ], - "text": "Yes" - } - } - ] - }, - { - "url": "https://fhir-ehr.cerner.com/r4/StructureDefinition/custom-attribute", - "extension": [ - { - "id": "ENCNTR:684109", - "url": "custom-attribute-name", - "valueString": "Accident Related Visit" - }, - { - "url": "custom-attribute-value", - "valueCodeableConcept": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/100700", - "code": "684155", - "display": "No", - "userSelected": true - } - ], - "text": "No" - } - } - ] - }, - { - "url": "https://fhir-ehr.cerner.com/r4/StructureDefinition/custom-attribute", - "extension": [ - { - "id": "ENCNTR:4047481", - "url": "custom-attribute-name", - "valueString": "Conversation" - }, - { - "url": "custom-attribute-value", - "valueCodeableConcept": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/100040", - "code": "4630114", - "display": "Register Patient", - "userSelected": true - } - ], - "text": "Register Patient" - } - } - ] - }, - { - "url": "https://fhir-ehr.cerner.com/r4/StructureDefinition/estimated-financial-responsibility-amount", - "valueMoney": { - "value": 0.0, - "currency": "USD" - } - } - ], - "identifier": [ - { - "use": "usual", - "type": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/319", - "code": "1077", - "display": "FIN NBR", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0203", - "code": "AN", - "display": "Account number", - "userSelected": false - } - ], - "text": "FIN NBR" - }, - "system": "urn:oid:5.5.5.5.5.5.", - "value": "16048" - } - ], - "status": "in-progress", - "class": { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", - "code": "IMP", - "display": "inpatient encounter", - "userSelected": false - }, - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/71", - "code": "309308", - "display": "Inpatient", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v2-0004", - "code": "I", - "display": "Inpatient", - "userSelected": false - } - ], - "text": "Inpatient" - } - ], - "serviceType": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/34", - "code": "313017", - "display": "Pulmonology", - "userSelected": true - }, - { - "system": "http://snomed.info/sct", - "code": "722174002", - "display": "Pulmonary medicine service (qualifier value)", - "userSelected": false - } - ], - "text": "Pulmonology" - }, - "priority": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/3", - "code": "309203", - "display": "Emergency", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ActPriority", - "code": "EM", - "display": "emergency", - "userSelected": false - } - ], - "text": "Emergency" - }, - "subject": { - "reference": "Patient/patient-12742542", - "display": "GILBERT, ALICE S" - }, - "participant": [ - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1116", - "display": "Admitting Physician", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "ADM", - "display": "admitter", - "userSelected": false - } - ], - "text": "Admitting Physician" - } - ], - "period": { - "start": "2020-04-24T05:00:00.000Z" - }, - "individual": { - "reference": "Practitioner/11817978", - "display": "Carter, Kristin Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1119", - "display": "Attending Physician", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "ATND", - "display": "attender", - "userSelected": false - } - ], - "text": "Attending Physician" - } - ], - "period": { - "start": "2020-04-24T05:00:00.000Z" - }, - "individual": { - "reference": "Practitioner/11817978", - "display": "Carter, Kristin Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1121", - "display": "Consulting Physician", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "CON", - "display": "consultant", - "userSelected": false - } - ], - "text": "Consulting Physician" - } - ], - "period": { - "start": "2020-04-30T21:32:00.000Z" - }, - "individual": { - "reference": "Practitioner/4122625", - "display": "Cerner Test, Physician - Cardiovascular Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1121", - "display": "Consulting Physician", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "CON", - "display": "consultant", - "userSelected": false - } - ], - "text": "Consulting Physician" - } - ], - "period": { - "start": "2020-04-28T19:47:00.000Z" - }, - "individual": { - "reference": "Practitioner/4122622", - "display": "Cerner Test, Physician - Hospitalist Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1123", - "display": "Ordering Physician", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "PPRF", - "display": "primary performer", - "userSelected": false - } - ], - "text": "Ordering Physician" - } - ], - "period": { - "start": "2021-01-12T19:33:08.000Z" - }, - "individual": { - "reference": "Practitioner/11817978", - "display": "Carter, Kristin Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1125", - "display": "Registered Nurse", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "SPRF", - "display": "secondary performer", - "userSelected": false - } - ], - "text": "Registered Nurse" - } - ], - "period": { - "start": "2021-04-22T20:43:00.000Z" - }, - "individual": { - "reference": "Practitioner/607928", - "display": "Cerner Test, Nurse Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1125", - "display": "Registered Nurse", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "SPRF", - "display": "secondary performer", - "userSelected": false - } - ], - "text": "Registered Nurse" - } - ], - "period": { - "start": "2021-03-18T16:10:52.000Z" - }, - "individual": { - "reference": "Practitioner/607928", - "display": "Cerner Test, Nurse Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1125", - "display": "Registered Nurse", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "SPRF", - "display": "secondary performer", - "userSelected": false - } - ], - "text": "Registered Nurse" - } - ], - "period": { - "start": "2021-01-11T16:32:00.000Z" - }, - "individual": { - "reference": "Practitioner/607928", - "display": "Cerner Test, Nurse Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1125", - "display": "Registered Nurse", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "SPRF", - "display": "secondary performer", - "userSelected": false - } - ], - "text": "Registered Nurse" - } - ], - "period": { - "start": "2020-04-29T13:56:00.000Z", - "end": "2020-04-30T06:01:53.000Z" - }, - "individual": { - "reference": "Practitioner/607928", - "display": "Cerner Test, Nurse Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1125", - "display": "Registered Nurse", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "SPRF", - "display": "secondary performer", - "userSelected": false - } - ], - "text": "Registered Nurse" - } - ], - "period": { - "start": "2020-04-28T18:11:50.000Z", - "end": "2020-04-29T11:01:38.000Z" - }, - "individual": { - "reference": "Practitioner/607928", - "display": "Cerner Test, Nurse Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "1126", - "display": "Referring Physician", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "REF", - "display": "referrer", - "userSelected": false - } - ], - "text": "Referring Physician" - } - ], - "period": { - "start": "2020-04-24T05:00:00.000Z" - }, - "individual": { - "reference": "Practitioner/11938004", - "display": "Bradford, MD, Michael Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "681274", - "display": "Database Coordinator", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "PART", - "display": "Participation", - "userSelected": false - } - ], - "text": "Database Coordinator" - } - ], - "period": { - "start": "2021-06-14T18:11:30.000Z" - }, - "individual": { - "reference": "Practitioner/1", - "display": "SYSTEM, SYSTEM Cerner" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "18883355", - "display": "Covering Physician", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "PPRF", - "display": "primary performer", - "userSelected": false - } - ], - "text": "Covering Physician" - } - ], - "period": { - "start": "2020-12-23T16:43:00.000Z" - }, - "individual": { - "reference": "Practitioner/12743848", - "display": "Doctor, Test" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "681274", - "display": "Database Coordinator", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "PART", - "display": "Participation", - "userSelected": false - } - ], - "text": "Database Coordinator" - } - ], - "period": { - "start": "2020-11-06T18:11:35.000Z" - }, - "individual": { - "reference": "Practitioner/12742554", - "display": "Pickering, Kathy" - } - }, - { - "type": [ - { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/333", - "code": "18883355", - "display": "Covering Physician", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", - "code": "PPRF", - "display": "primary performer", - "userSelected": false - } - ], - "text": "Covering Physician" - } - ], - "period": { - "start": "2020-05-14T18:08:42.000Z" - }, - "individual": { - "reference": "Practitioner/12742575", - "display": "Torres, Drew" - } - } - ], - "period": { - "start": "2020-12-23T19:02:26.000Z" - }, - "reasonCode": [ - { - "text": "Covid-19 rule out" - } - ], - "hospitalization": { - "admitSource": { - "coding": [ - { - "system": "https://fhir.cerner.com/ec2458f2-1e24-41c8-b71b-0e701af7583d/codeSet/2", - "code": "18625664", - "display": "Transfer from SNF", - "userSelected": true - }, - { - "system": "http://terminology.hl7.org/CodeSystem/admit-source", - "code": "nursing", - "display": "From nursing home", - "userSelected": false - } - ], - "text": "Transfer from SNF" - } - }, - "location": [ - { - "location": { - "reference": "Location/33488145", - "display": "Model Hospital, MX Hospital, ICU, 101, A" - }, - "status": "active" - } - ], - "serviceProvider": { - "reference": "Organization/675844", - "display": "Model Hospital" - } - } - }, - { - "resource": { - "resourceType": "MeasureReport", - "id": "diabetes-mp", - "contained": [ - { - "resourceType": "Observation", - "id": "78a5067f-5468-46ba-aaa5-429561e26acc", - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/cqf-measureInfo", - "extension": [ - { - "url": "measure", - "valueCanonical": "http://hl7.org/fhir/us/cqfmeasures/DiabetesHemoglobinA1cHbA1cPoorControl9FHIR" - }, - { - "url": "populationId", - "valueString": "sde-race" - } - ] - } - ], - "status": "final", - "code": { - "text": "sde-race" - }, - "valueCodeableConcept": { - "coding": [ - { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2131-1", - "display": "Other Race" - } - ] - } - }, - { - "resourceType": "Observation", - "id": "87f51021-9a31-44fc-a79b-d3339af7c749", - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/cqf-measureInfo", - "extension": [ - { - "url": "measure", - "valueCanonical": "http://hl7.org/fhir/us/cqfmeasures/DiabetesHemoglobinA1cHbA1cPoorControl9FHIR" - }, - { - "url": "populationId", - "valueString": "sde-ethnicity" - } - ] - } - ], - "status": "final", - "code": { - "text": "sde-ethnicity" - }, - "valueCodeableConcept": { - "coding": [ - { - "system": "urn:oid:2.16.840.1.113883.6.238", - "code": "2135-2", - "display": "Hispanic or Latino" - } - ] - } - }, - { - "resourceType": "Observation", - "id": "6deb9431-4fe1-41ae-9452-01a338d6da37", - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/cqf-measureInfo", - "extension": [ - { - "url": "measure", - "valueCanonical": "http://hl7.org/fhir/us/cqfmeasures/DiabetesHemoglobinA1cHbA1cPoorControl9FHIR" - }, - { - "url": "populationId", - "valueString": "sde-sex" - } - ] - } - ], - "status": "final", - "code": { - "text": "sde-sex" - }, - "valueCodeableConcept": { - "coding": [ - { - "code": "F" - } - ] - } - } - ], - "status": "complete", - "type": "individual", - "measure": "DiabetesHemoglobinA1cHbA1cPoorControl9FHIR", - "subject": { - "reference": "Patient/patient-12742542" - }, - "period": { - "start": "2019-01-01T00:00:00+00:00", - "end": "2020-01-01T00:00:00+00:00" - }, - "group": [ - { - "population": [ - { - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/measure-population", - "code": "initial-population", - "display": "Initial Population" - } - ] - }, - "count": 0 - }, - { - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/measure-population", - "code": "numerator", - "display": "Numerator" - } - ] - }, - "count": 0 - }, - { - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/measure-population", - "code": "denominator", - "display": "Denominator" - } - ] - }, - "count": 0 - }, - { - "code": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/measure-population", - "code": "denominator-exclusion", - "display": "Denominator Exclusion" - } - ] - }, - "count": 0 - } - ] - } - ], - "evaluatedResource": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/us/davinci-deqm/StructureDefinition/extension-populationReference", - "valueCoding": { - "system": "http://teminology.hl7.org/CodeSystem/measure-population", - "code": "initial-population" - } - } - ], - "reference": "Patient/patient-12742542" - }, - { - "reference": "#78a5067f-5468-46ba-aaa5-429561e26acc" - }, - { - "reference": "#87f51021-9a31-44fc-a79b-d3339af7c749" - }, - { - "reference": "#6deb9431-4fe1-41ae-9452-01a338d6da37" - } - ] - } - } - ] -} diff --git a/plugin/cds-hooks/pom.xml b/plugin/cds-hooks/pom.xml index f734a8c3d..cd8eb269e 100644 --- a/plugin/cds-hooks/pom.xml +++ b/plugin/cds-hooks/pom.xml @@ -1,7 +1,5 @@ - + 4.0.0 org.opencds.cqf.ruler diff --git a/plugin/cds-hooks/src/test/java/org/opencds/cqf/ruler/plugin/cdshooks/r4/OpioidRecommendation08IT.java b/plugin/cds-hooks/src/test/java/org/opencds/cqf/ruler/plugin/cdshooks/r4/OpioidRecommendation08IT.java index 6a47807f0..d3b3e562c 100644 --- a/plugin/cds-hooks/src/test/java/org/opencds/cqf/ruler/plugin/cdshooks/r4/OpioidRecommendation08IT.java +++ b/plugin/cds-hooks/src/test/java/org/opencds/cqf/ruler/plugin/cdshooks/r4/OpioidRecommendation08IT.java @@ -16,7 +16,10 @@ import org.apache.http.util.EntityUtils; import org.hl7.fhir.r4.model.IdType; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.api.extension.ExtendWith; import org.opencds.cqf.ruler.cdshooks.CdsHooksConfig; import org.opencds.cqf.ruler.cdshooks.CdsServicesCache; @@ -35,6 +38,7 @@ @ExtendWith(SpringExtension.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = { CdsHooksConfig.class }, properties = { "hapi.fhir.fhir_version=r4", "hapi.fhir.cr.enabled=true" }) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) class OpioidRecommendation08IT extends RestIntegrationTest { @Autowired @@ -47,6 +51,7 @@ void beforeEach() { } @Test + @Order(2) void testOpioidRecommendation08OrderSignWithoutPrefetch() { loadTransaction("opioidcds-08-order-sign-bundle.json"); loadResource("opioidcds-08-patient.json"); @@ -75,6 +80,7 @@ void testOpioidRecommendation08OrderSignWithoutPrefetch() { } @Test + @Order(1) void testOpioidRecommendation08OrderSignWithPrefetch() { loadTransaction("opioidcds-08-order-sign-bundle.json"); loadResource("opioidcds-08-medication.json"); diff --git a/plugin/dev-tools/pom.xml b/plugin/dev-tools/pom.xml index ab64ec0df..2d8c6de77 100644 --- a/plugin/dev-tools/pom.xml +++ b/plugin/dev-tools/pom.xml @@ -8,7 +8,4 @@ cqf-ruler-dev-tools - - - diff --git a/plugin/dev-tools/src/main/java/org/opencds/cqf/ruler/devtools/DevToolsConfig.java b/plugin/dev-tools/src/main/java/org/opencds/cqf/ruler/devtools/DevToolsConfig.java index b6c89052c..7f45513b7 100644 --- a/plugin/dev-tools/src/main/java/org/opencds/cqf/ruler/devtools/DevToolsConfig.java +++ b/plugin/dev-tools/src/main/java/org/opencds/cqf/ruler/devtools/DevToolsConfig.java @@ -2,7 +2,6 @@ import org.opencds.cqf.external.annotations.OnDSTU3Condition; import org.opencds.cqf.external.annotations.OnR4Condition; -import org.opencds.cqf.external.cr.CrCommonConfig; import org.opencds.cqf.external.cr.PostInitProviderRegisterer; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; @@ -30,7 +29,6 @@ */ @Configuration @ConditionalOnProperty(prefix = "hapi.fhir.devtools", name = "enabled", havingValue = "true", matchIfMissing = true) -@Import({ CrCommonConfig.class }) public class DevToolsConfig { @Bean diff --git a/plugin/pom.xml b/plugin/pom.xml index 83b198468..a370a738a 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -1,7 +1,5 @@ - + 4.0.0 org.opencds.cqf.ruler @@ -13,12 +11,11 @@ pom - case-reporting cds-hooks dev-tools - ra sdc security + ra diff --git a/plugin/ra/pom.xml b/plugin/ra/pom.xml index 7e7c27242..2c0bde665 100644 --- a/plugin/ra/pom.xml +++ b/plugin/ra/pom.xml @@ -1,7 +1,5 @@ - + 4.0.0 org.opencds.cqf.ruler diff --git a/plugin/ra/src/main/java/org/opencds/cqf/ruler/ra/r4/RiskAdjustmentProvider.java b/plugin/ra/src/main/java/org/opencds/cqf/ruler/ra/r4/RiskAdjustmentProvider.java index aeb5287bb..9ca6911a4 100644 --- a/plugin/ra/src/main/java/org/opencds/cqf/ruler/ra/r4/RiskAdjustmentProvider.java +++ b/plugin/ra/src/main/java/org/opencds/cqf/ruler/ra/r4/RiskAdjustmentProvider.java @@ -60,7 +60,7 @@ public Parameters evaluateRiskConditionCategory( } ensureSupplementalDataElementSearchParameter(requestDetails); - + // measure report MeasureReport unprocessedReport = measureEvaluateProvider.evaluateMeasure( theId, periodStart.getValueAsString(), periodEnd.getValueAsString(), null, subject, null, null, null, null, null, null, requestDetails); @@ -68,8 +68,11 @@ public Parameters evaluateRiskConditionCategory( Parameters riskAdjustmentParameters = new Parameters(); RiskAdjustmentReturnElement riskAdjustmentReturnElement = new RiskAdjustmentReturnElement( - unprocessedReport.getSubject().getReference(), unprocessedReport); + unprocessedReport.getSubject().getReference(), + unprocessedReport); + resolveRiskAdjustmentReport(riskAdjustmentReturnElement); + riskAdjustmentParameters.addParameter() .setName(riskAdjustmentReturnElement.reference) .setResource(riskAdjustmentReturnElement.getRiskAdjustmentOutcome()); @@ -78,30 +81,29 @@ public Parameters evaluateRiskConditionCategory( } private void resolveRiskAdjustmentReport(RiskAdjustmentReturnElement riskAdjustmentReturnElement) { - for (MeasureReport.MeasureReportGroupComponent group : riskAdjustmentReturnElement.unprocessedReport - .getGroup()) { + + + for (MeasureReport.MeasureReportGroupComponent group : riskAdjustmentReturnElement.unprocessedReport.getGroup()) { CodeableConcept hccCode = group.getCode(); visited = null; for (MeasureReport.MeasureReportGroupStratifierComponent stratifier : group.getStratifier()) { CodeableConcept stratifierPopCode = stratifier.getCodeFirstRep(); + for (MeasureReport.StratifierGroupComponent stratum : stratifier.getStratum()) { CodeableConcept value = stratum.getValue(); Quantity score = stratum.getMeasureScore(); - if (stratifierPopCode.hasCoding() - && stratifierPopCode.getCodingFirstRep().getCode().equals(RAConstants.HISTORIC_CODE)) { - resolveGroup(riskAdjustmentReturnElement, - new Historic(hccCode, value, score, - resolveEvidenceStatusDate(riskAdjustmentReturnElement))); - } else if (stratifierPopCode.hasCoding() - && stratifierPopCode.getCodingFirstRep().getCode().equals(RAConstants.SUSPECTED_CODE)) { - resolveGroup(riskAdjustmentReturnElement, - new Suspected(hccCode, value, score, - resolveEvidenceStatusDate(riskAdjustmentReturnElement))); - } else if (stratifierPopCode.hasCoding() - && stratifierPopCode.getCodingFirstRep().getCode().equals(RAConstants.NET_NEW_CODE)) { - resolveGroup(riskAdjustmentReturnElement, - new NetNew(hccCode, value, score, - resolveEvidenceStatusDate(riskAdjustmentReturnElement))); + + if (stratifierPopCode.hasCoding() && stratifierPopCode.getCodingFirstRep().getCode().equals(RAConstants.HISTORIC_CODE)) { + + resolveGroup(riskAdjustmentReturnElement, new Historic(hccCode, value, score, resolveEvidenceStatusDate(riskAdjustmentReturnElement))); + + } else if (stratifierPopCode.hasCoding() && stratifierPopCode.getCodingFirstRep().getCode().equals(RAConstants.SUSPECTED_CODE)) { + + resolveGroup(riskAdjustmentReturnElement, new Suspected(hccCode, value, score, resolveEvidenceStatusDate(riskAdjustmentReturnElement))); + + } else if (stratifierPopCode.hasCoding() && stratifierPopCode.getCodingFirstRep().getCode().equals(RAConstants.NET_NEW_CODE)) { + + resolveGroup(riskAdjustmentReturnElement, new NetNew(hccCode, value, score, resolveEvidenceStatusDate(riskAdjustmentReturnElement))); } } } @@ -218,7 +220,7 @@ private class RiskAdjustmentReturnElement { this.unprocessedReport = unprocessedReport; this.processedReport = new MeasureReport(); this.unprocessedReport.copyValues(this.processedReport); - this.processedReport.getGroup().clear(); + //this.processedReport.getGroup().clear(); this.processedReport.setMeta( new Meta().addProfile(RAConstants.PATIENT_REPORT_URL)); } diff --git a/plugin/ra/src/test/java/org/opencds/cqf/ruler/ra/r4/RiskAdjustmentProviderIT.java b/plugin/ra/src/test/java/org/opencds/cqf/ruler/ra/r4/RiskAdjustmentProviderIT.java index 2a2dbfce8..7dbc42744 100644 --- a/plugin/ra/src/test/java/org/opencds/cqf/ruler/ra/r4/RiskAdjustmentProviderIT.java +++ b/plugin/ra/src/test/java/org/opencds/cqf/ruler/ra/r4/RiskAdjustmentProviderIT.java @@ -44,7 +44,6 @@ void beforeEach() { loadTransaction("ConditionCategoryPOC-bundle.json"); } - @Test void riskAssessmentHistoricOpen() { loadTransaction("tests-hist-open-HCC189-bundle.json"); @@ -58,7 +57,6 @@ void riskAssessmentHistoricOpen() { validateMeasureReport(response, "historic", "open-gap", new DateType("2020-01-31")); } - @Test void riskAssessmentHistoricClosed() { loadTransaction("tests-hist-closed-HCC189-bundle.json"); @@ -72,7 +70,6 @@ void riskAssessmentHistoricClosed() { validateMeasureReport(response, "historic", "closed-gap", new DateType("2022-01-31")); } - @Test void riskAssessmentHistoricNetNew() { loadTransaction("tests-netnew-HCC189-bundle.json"); diff --git a/plugin/sdc/pom.xml b/plugin/sdc/pom.xml index ecaf322f7..ef9c097f3 100644 --- a/plugin/sdc/pom.xml +++ b/plugin/sdc/pom.xml @@ -6,9 +6,5 @@ cqf-ruler-plugin 0.15.0-SNAPSHOT - cqf-ruler-sdc - - - diff --git a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCConfig.java b/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCConfig.java deleted file mode 100644 index c2dd1c4bc..000000000 --- a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCConfig.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.opencds.cqf.ruler.sdc; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory; -import org.opencds.cqf.external.annotations.OnDSTU3Condition; -import org.opencds.cqf.external.annotations.OnR4Condition; -import org.opencds.cqf.external.cr.PostInitProviderRegisterer; -import org.opencds.cqf.ruler.api.OperationProvider; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Conditional; -import org.springframework.context.annotation.Configuration; - -@Configuration -@ConditionalOnProperty(prefix = "hapi.fhir.sdc", name = "enabled", havingValue = "true", matchIfMissing = true) -public class SDCConfig { - - @Bean - public SDCProperties SDCProperties() { - return new SDCProperties(); - } - - @Bean - @Conditional(OnR4Condition.class) - public OperationProvider r4TransformProvider() { - return new org.opencds.cqf.ruler.sdc.r4.TransformProvider(); - } - - @Bean - @Conditional(OnDSTU3Condition.class) - public OperationProvider dstu3TransformProvider() { - return new org.opencds.cqf.ruler.sdc.dstu3.TransformProvider(); - } - @Bean - SDCProviderFactory sdcOperationFactory() { - return new SDCProviderFactory(); - } - - @Bean - SDCProviderLoader sdcProviderLoader(FhirContext theFhirContext, ResourceProviderFactory theResourceProviderFactory, - SDCProviderFactory theSDCProviderFactory, PostInitProviderRegisterer thePostInitProviderRegisterer) { - return new SDCProviderLoader(theFhirContext, theResourceProviderFactory, theSDCProviderFactory, thePostInitProviderRegisterer); - } -} diff --git a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProperties.java b/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProperties.java deleted file mode 100644 index d028b9685..000000000 --- a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProperties.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.opencds.cqf.ruler.sdc; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -@ConfigurationProperties(prefix = "hapi.fhir.sdc") -public class SDCProperties { - - private boolean enabled = true; - - public boolean isEnabled() { - return this.enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - private Extract extract = new Extract(); - - public Extract getExtract() { - return extract; - } - - public void setExtract(Extract extract) { - this.extract = extract; - } - - public static class Extract { - - private String endpoint; - private String username; - private String password; - - public String getEndpoint() { - return endpoint; - } - - public void setEndpoint(String endpoint) { - this.endpoint = endpoint; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - } - - private Transform transform = new Transform(); - - public Transform getTransform() { - return transform; - } - - public void setTransform(Transform newTransform) { - transform = newTransform; - } - - public static class Transform { - - private String replaceCode; - private String username; - private String password; - private String endpoint; - - public String getReplaceCode() { - return replaceCode; - } - - public void setReplaceCode(String newReplaceCode) { - replaceCode = newReplaceCode; - } - - public String getUsername() { - return username; - } - - public void setUsername(String newUsername) { - username = newUsername; - } - - public String getPassword() { - return password; - } - - public void setPassword(String newPassword) { - password = newPassword; - } - - public String getEndpoint() { - return endpoint; - } - - public void setEndpoint(String newEndpoint) { - endpoint = newEndpoint; - } - } -} diff --git a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProviderFactory.java b/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProviderFactory.java deleted file mode 100644 index 944fae35b..000000000 --- a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProviderFactory.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.opencds.cqf.ruler.sdc; - -import org.opencds.cqf.ruler.sdc.dstu3.TransformProvider; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; - -import ca.uhn.fhir.context.ConfigurationException; -import ca.uhn.fhir.context.FhirContext; - -public class SDCProviderFactory { - @Autowired - private FhirContext myFhirContext; - - @Autowired - private ApplicationContext myApplicationContext; - - public Object getTransformProvider() { - switch (myFhirContext.getVersion().getVersion()) { - case DSTU3: - return myApplicationContext.getBean(TransformProvider.class); - case R4: - return myApplicationContext - .getBean(org.opencds.cqf.ruler.sdc.r4.TransformProvider.class); - default: - throw new ConfigurationException("TransformProvider not supported for FHIR version " - + myFhirContext.getVersion().getVersion()); - } - } -} diff --git a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProviderLoader.java b/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProviderLoader.java deleted file mode 100644 index 7c905decc..000000000 --- a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/SDCProviderLoader.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.opencds.cqf.ruler.sdc; - -import org.opencds.cqf.external.cr.PostInitProviderRegisterer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import ca.uhn.fhir.context.ConfigurationException; -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory; - -public class SDCProviderLoader { - private static final Logger myLogger = LoggerFactory.getLogger(SDCProviderLoader.class); - private final FhirContext myFhirContext; - private final ResourceProviderFactory myResourceProviderFactory; - private final SDCProviderFactory mySDCProviderFactory; - - // This is just here to force the observer to register - private final PostInitProviderRegisterer myPostInitProviderRegisterer; - public SDCProviderLoader(FhirContext theFhirContext, ResourceProviderFactory theResourceProviderFactory, - SDCProviderFactory theCrProviderFactory, PostInitProviderRegisterer thePostInitProviderRegisterer) { - myFhirContext = theFhirContext; - myResourceProviderFactory = theResourceProviderFactory; - mySDCProviderFactory = theCrProviderFactory; - this.myPostInitProviderRegisterer = thePostInitProviderRegisterer; - loadProvider(); - } - - public void loadProvider() { - switch (myFhirContext.getVersion().getVersion()) { - case DSTU3: - myLogger.info("Registering DSTU3 Ruler SDC Providers"); - myResourceProviderFactory.addSupplier(mySDCProviderFactory::getTransformProvider); - break; - case R4: - myLogger.info("Registering R4 Ruler SDC Providers"); - myResourceProviderFactory.addSupplier(mySDCProviderFactory::getTransformProvider); - break; - default: - throw new ConfigurationException("SDC not supported for FHIR version " - + myFhirContext.getVersion().getVersion()); - } - } -} diff --git a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/dstu3/TransformProvider.java b/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/dstu3/TransformProvider.java deleted file mode 100644 index 69c3a2ba9..000000000 --- a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/dstu3/TransformProvider.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.opencds.cqf.ruler.sdc.dstu3; - -import java.util.HashMap; -import java.util.List; -import java.util.stream.Collectors; - -import org.hl7.fhir.dstu3.model.Bundle; -import org.hl7.fhir.dstu3.model.Coding; -import org.hl7.fhir.dstu3.model.ConceptMap; -import org.hl7.fhir.dstu3.model.Observation; -import org.opencds.cqf.fhir.utility.client.Clients; -import org.opencds.cqf.ruler.api.OperationProvider; -import org.opencds.cqf.ruler.sdc.SDCProperties; -import org.springframework.beans.factory.annotation.Autowired; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.rest.annotation.Operation; -import ca.uhn.fhir.rest.annotation.OperationParam; -import ca.uhn.fhir.rest.client.api.IGenericClient; -import ca.uhn.fhir.util.BundleUtil; - -public class TransformProvider implements OperationProvider { - - @Autowired - private FhirContext fhirContext; - - @Autowired - private SDCProperties mySdcProperties; - - @Operation(name = "$transform", idempotent = false, type = Observation.class) - public Bundle transformObservations( - @OperationParam(name = "observations") Bundle observationsBundle, - @OperationParam(name = "conceptMapURL") String conceptMapURL) { - if (null == observationsBundle) { - throw new IllegalArgumentException( - "Unable to perform operation Observation$transform. No Observation bundle passed in."); - } - if (null == conceptMapURL) { - throw new IllegalArgumentException( - "Unable to perform operation Observation$transform. No concept map url specified."); - } - - String replaceCode = mySdcProperties.getTransform().getReplaceCode(); - // String username = mySdcProperties.getTransform().getUsername(); - // String password = mySdcProperties.getTransform().getPassword(); - String endpoint = mySdcProperties.getTransform().getEndpoint(); - - IGenericClient client = Clients.forUrl(fhirContext, endpoint); - ConceptMap transformConceptMap = client.read().resource(ConceptMap.class).withUrl(conceptMapURL).execute(); - if (null == transformConceptMap) { - throw new IllegalArgumentException( - "Unable to perform operation Observation$transform. Unable to get concept map."); - } - List observations = BundleUtil.toListOfResources(fhirContext, observationsBundle).stream() - .filter(resource -> resource instanceof Observation) - .map(Observation.class::cast) - .collect(Collectors.toList()); - /** - * TODO - There must be a more efficient way to loop through this, but so far I - * have not come up with it. - */ - transformConceptMap.getGroup().forEach(group -> { - HashMap codeMappings = new HashMap<>(); - String targetSystem = group.getTarget(); - group.getElement().forEach(codeElement -> { - codeMappings.put(codeElement.getCode(), codeElement.getTarget().get(0)); - }); - observations.forEach(observation -> { - if (observation.getValue().fhirType().equalsIgnoreCase("codeableconcept")) { - String obsValueCode = observation.getValueCodeableConcept().getCoding().get(0).getCode(); - if (obsValueCode != null && codeMappings - .get(observation.getValueCodeableConcept().getCoding().get(0).getCode()) != null) { - if (replaceCode != null) { - observation.getValueCodeableConcept().getCoding().get(0) - .setCode(codeMappings.get(obsValueCode).getCode()); - observation.getValueCodeableConcept().getCoding().get(0) - .setDisplay(codeMappings.get(obsValueCode).getDisplay()); - observation.getValueCodeableConcept().getCoding().get(0).setSystem(targetSystem); - } else { - Coding newCoding = new Coding(); - newCoding.setSystem(targetSystem); - newCoding.setCode(codeMappings.get(obsValueCode).getCode()); - newCoding.setDisplay(codeMappings.get(obsValueCode).getDisplay()); - observation.getValueCodeableConcept().getCoding().add(newCoding); - } - } - } - }); - }); - return observationsBundle; - } -} diff --git a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/r4/TransformProvider.java b/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/r4/TransformProvider.java deleted file mode 100644 index 7dea103d9..000000000 --- a/plugin/sdc/src/main/java/org/opencds/cqf/ruler/sdc/r4/TransformProvider.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.opencds.cqf.ruler.sdc.r4; - -import java.util.HashMap; -import java.util.List; -import java.util.stream.Collectors; - -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Coding; -import org.hl7.fhir.r4.model.ConceptMap; -import org.hl7.fhir.r4.model.Observation; -import org.opencds.cqf.fhir.utility.client.Clients; -import org.opencds.cqf.ruler.api.OperationProvider; -import org.opencds.cqf.ruler.sdc.SDCProperties; -import org.springframework.beans.factory.annotation.Autowired; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.rest.annotation.Operation; -import ca.uhn.fhir.rest.annotation.OperationParam; -import ca.uhn.fhir.rest.client.api.IGenericClient; -import ca.uhn.fhir.util.BundleUtil; - -public class TransformProvider implements OperationProvider { - - @Autowired - private FhirContext fhirContext; - - @Autowired - private SDCProperties mySdcProperties; - - @Operation(name = "$transform", idempotent = false, type = Observation.class) - public Bundle transformObservations( - @OperationParam(name = "observations") Bundle observationsBundle, - @OperationParam(name = "conceptMapURL") String conceptMapURL) { - if (null == observationsBundle) { - throw new IllegalArgumentException( - "Unable to perform operation Observation$transform. No Observation bundle passed in."); - } - if (null == conceptMapURL) { - throw new IllegalArgumentException( - "Unable to perform operation Observation$transform. No concept map url specified."); - } - - String replaceCode = mySdcProperties.getTransform().getReplaceCode(); - // String username = mySdcProperties.getTransform().getUsername(); - // String password = mySdcProperties.getTransform().getPassword(); - String endpoint = mySdcProperties.getTransform().getEndpoint(); - - IGenericClient client = Clients.forUrl(fhirContext, endpoint); - ConceptMap transformConceptMap = client.read().resource(ConceptMap.class).withUrl(conceptMapURL).execute(); - if (null == transformConceptMap) { - throw new IllegalArgumentException( - "Unable to perform operation Observation$transform. Unable to get concept map."); - } - List observations = BundleUtil.toListOfResources(fhirContext, observationsBundle).stream() - .filter(resource -> resource instanceof Observation) - .map(Observation.class::cast) - .collect(Collectors.toList()); - /** - * TODO - There must be a more efficient way to loop through this, but so far I - * have not come up with it. - */ - transformConceptMap.getGroup().forEach(group -> { - HashMap codeMappings = new HashMap<>(); - String targetSystem = group.getTarget(); - group.getElement().forEach(codeElement -> { - codeMappings.put(codeElement.getCode(), codeElement.getTarget().get(0)); - }); - observations.forEach(observation -> { - if (observation.getValue().fhirType().equalsIgnoreCase("codeableconcept")) { - String obsValueCode = observation.getValueCodeableConcept().getCoding().get(0).getCode(); - if (obsValueCode != null && codeMappings - .get(observation.getValueCodeableConcept().getCoding().get(0).getCode()) != null) { - if (replaceCode != null) { - observation.getValueCodeableConcept().getCoding().get(0) - .setCode(codeMappings.get(obsValueCode).getCode()); - observation.getValueCodeableConcept().getCoding().get(0) - .setDisplay(codeMappings.get(obsValueCode).getDisplay()); - observation.getValueCodeableConcept().getCoding().get(0).setSystem(targetSystem); - } else { - Coding newCoding = new Coding(); - newCoding.setSystem(targetSystem); - newCoding.setCode(codeMappings.get(obsValueCode).getCode()); - newCoding.setDisplay(codeMappings.get(obsValueCode).getDisplay()); - observation.getValueCodeableConcept().getCoding().add(newCoding); - } - } - } - }); - }); - return observationsBundle; - } -} diff --git a/plugin/sdc/src/main/resources/application.yaml b/plugin/sdc/src/main/resources/application.yaml deleted file mode 100644 index 50245ab25..000000000 --- a/plugin/sdc/src/main/resources/application.yaml +++ /dev/null @@ -1,10 +0,0 @@ -hapi: - fhir: - sdc: - enabled: true - extract: - endpoint: 'http://localhost:8080/fhir/' - username: '' - password: '' - - \ No newline at end of file diff --git a/plugin/sdc/src/test/java/org/opencds/cqf/ruler/sdc/r4/ExtractProviderIT.java b/plugin/sdc/src/test/java/org/opencds/cqf/ruler/sdc/r4/ExtractProviderIT.java index f8c95e2f2..e7d128c55 100644 --- a/plugin/sdc/src/test/java/org/opencds/cqf/ruler/sdc/r4/ExtractProviderIT.java +++ b/plugin/sdc/src/test/java/org/opencds/cqf/ruler/sdc/r4/ExtractProviderIT.java @@ -9,12 +9,9 @@ import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Parameters; import org.hl7.fhir.r4.model.QuestionnaireResponse; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.opencds.cqf.ruler.sdc.SDCConfig; -import org.opencds.cqf.ruler.sdc.SDCProperties; +import org.opencds.cqf.external.cr.StarterCrR4Config; import org.opencds.cqf.ruler.test.RestIntegrationTest; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; @@ -22,16 +19,8 @@ @ActiveProfiles("test") @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = { - SDCConfig.class }, properties = { "hapi.fhir.fhir_version=r4", "hapi.fhir.cr.enabled=true" }) + StarterCrR4Config.class }, properties = { "hapi.fhir.fhir_version=r4", "hapi.fhir.cr.enabled=true" }) class ExtractProviderIT extends RestIntegrationTest { - @Autowired - private SDCProperties mySdcProperties; - - @BeforeEach - void beforeEach() { - String ourServerBase = "http://localhost:" + getPort() + "/fhir/"; - mySdcProperties.getExtract().setEndpoint(ourServerBase); - } @Test void testExtract() { diff --git a/pom.xml b/pom.xml index 4af31fd8a..e66756d91 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,6 @@ - example external test core @@ -87,11 +86,11 @@ - 3.2.0 + 3.4.0 0.62.2 - 7.1.7-SNAPSHOT + 7.1.11-SNAPSHOT 12.0.0.alpha3 5.8.2 UTF-8 @@ -142,7 +141,6 @@ pom import - org.simplejavamail simple-java-mail @@ -518,11 +516,10 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.6.3 11 false - true -missing true diff --git a/scripts/setversion.sh b/scripts/setversion.sh index 4c4e81298..0334e651c 100755 --- a/scripts/setversion.sh +++ b/scripts/setversion.sh @@ -1,4 +1,5 @@ #!/usr/bin/env sh # usage ./scripts/setversion.sh N.N.N (or N.N.N-SNAPSHOT) -mvn versions:set -DnewVersion=$1 \ No newline at end of file +mvn versions:set -DnewVersion=$1 +sed -i '' "s/ENV VERSION=.*$/ENV VERSION=${1}/g" Dockerfile diff --git a/server/pom.xml b/server/pom.xml index 50ffea73d..4a5101b6b 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -1,7 +1,5 @@ - + 4.0.0 org.opencds.cqf.ruler @@ -242,6 +240,11 @@ jakarta.interceptor jakarta.interceptor-api + + org.opencds.cqf.ruler + cqf-ruler-cds-hooks + 0.15.0-SNAPSHOT + @@ -255,26 +258,12 @@ jakarta.servlet-api provided - - - org.opencds.cqf.ruler - cqf-ruler-case-reporting - 0.15.0-SNAPSHOT - runtime - - - org.opencds.cqf.ruler - cqf-ruler-cds-hooks - 0.15.0-SNAPSHOT - org.opencds.cqf.ruler cqf-ruler-dev-tools 0.15.0-SNAPSHOT runtime - - org.opencds.cqf.ruler cqf-ruler-ra