Skip to content

Commit

Permalink
Aphl mergeback (#770)
Browse files Browse the repository at this point in the history
* 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 <stevenson_adam@yahoo.com>
Co-authored-by: taha.attari@smilecdr.com <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 <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* Fix bad $approve tests (#702)

tests couldn't fail

Co-authored-by: taha.attari@smilecdr.com <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 <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* [APHL-546] fix bad target canonical handling in $approve (#710)

Co-authored-by: taha.attari@smilecdr.com <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 <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 <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 <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 <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 <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 <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 <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 <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 <taha.attari@smilecdr.com>

* Aphl 469 transactional package operation (#737)

* MVP Implementation of the $crmi.package operation

---------

Co-authored-by: taha.attari@smilecdr.com <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* 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 <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 <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 <taha.attari@smilecdr.com>

* Release operation experimentalBehavior parameter and handling (#744)

added experimentalBehavior parameter to $release operation

---------

Co-authored-by: taha.attari@smilecdr.com <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* Aphl 731 release operation priority indication (#745)

* preserve priority extensions when releasing

---------

Co-authored-by: taha.attari@smilecdr.com <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 <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* 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 <taha.attari@smilecdr.com>

* Whitespace and convention/style updates

* Whitespace and convention updates

---------

Co-authored-by: taha.attari@smilecdr.com <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 <taha.attari@smilecdr.com>
Co-authored-by: c-schuler <hoofschu@gmail.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* v2 -> v1 plugin (#748)

Added new eCR module with eRSD V2 to V1 conversion operation

---------

Co-authored-by: taha.attari@smilecdr.com <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* targetversion parameter for ersd v1 transform

*  [APHL-788] add targetversion parameter

* rename transform module to ecr

---------

Co-authored-by: taha.attari@smilecdr.com <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* [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 <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 <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 <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* [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 <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* Aphl 796 update package parameters (#759)

* [APHL-796] match package operation to specification

* [APHL-796] update names

---------

Co-authored-by: taha.attari@smilecdr.com <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* 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 <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* 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 <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <adam.stevenson@smiledigitalhealth.com>

* [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 <stevenson_adam@yahoo.com>

* [APHL-551] update pom

* Aphl 300 valueset interceptor (#757)

* ValueSet update interceptor for updating code synonyms
---------

Co-authored-by: taha.attari@smilecdr.com <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>

* 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 <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 <taha.attari@smilecdr.com>

* Replace RepositoryService with CaseReportingOperationProvider

* update transform provider (#780)

Co-authored-by: taha.attari@smilecdr.com <taha.attari@smilecdr.com>

* [APHL-551] fix test failures (#781)

Co-authored-by: taha.attari@smilecdr.com <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 <ivan.baisi@smiledigitalhealth.com>

* 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 <hayesmurdock@Hayess-MacBook-Pro-Alphora.local>
Co-authored-by: Hayes Murdock <hayes@alphora.com>
Co-authored-by: Adam Stevenson <stevenson_adam@yahoo.com>
Co-authored-by: c-schuler <hoofschu@gmail.com>
Co-authored-by: Hayes Murdock <hayes.murdock@smilecdr.com>
Co-authored-by: Taha <TahaAttari@users.noreply.github.com>
Co-authored-by: taha.attari@smilecdr.com <taha.attari@smilecdr.com>
Co-authored-by: Adam Stevenson <adam.stevenson@smilecdr.com>
Co-authored-by: Justin McKelvy <60718638+Capt-Mac@users.noreply.github.com>
Co-authored-by: Adam Stevenson <adam.stevenson@smiledigitalhealth.com>
Co-authored-by: Chris0296 <38321098+Chris0296@users.noreply.github.com>
Co-authored-by: Brenin Rhodes <brenin@alphora.com>
Co-authored-by: Ivan Baisi <i.baisi@gmail.com>
Co-authored-by: Ivan Baisi <ivan.baisi@smiledigitalhealth.com>
  • Loading branch information
15 people authored May 16, 2024
1 parent fbd7a2f commit 536e9f0
Show file tree
Hide file tree
Showing 54 changed files with 191 additions and 3,960 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
40 changes: 40 additions & 0 deletions .github/workflows/publish-snapshot-vsm-operations.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
22 changes: 11 additions & 11 deletions .idea/runConfigurations/Launch_Server__Live_Reload_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ 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
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"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.opencds.cqf.ruler.utility;

import java.util.List;
import java.util.Comparator;

public class SemanticVersion {
public static Comparator<String> getVersionComparator() {
return new VersionComparator();
}

public static String findHighestVersion(List<String> versions) {
String highestVersion = null;
Comparator<String> 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<String> {
@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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
42 changes: 36 additions & 6 deletions core/src/test/java/org/opencds/cqf/ruler/ExampleServerDstu3IT.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand All @@ -38,7 +68,6 @@ class ExampleServerDstu3IT {
@LocalServerPort
private int port;


@BeforeEach
void beforeEach() {
ourCtx = FhirContext.forDstu3();
Expand All @@ -52,6 +81,7 @@ void beforeEach() {
@Test
@DirtiesContext
void testCreateAndRead() {

String methodName = "testCreateResourceConditional";

Patient pt = new Patient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 4 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions external/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
</dependency>

<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-storage</artifactId>
Expand Down
11 changes: 0 additions & 11 deletions plugin/case-reporting/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 536e9f0

Please sign in to comment.