From 7680123d4f9a13fd38a83416c76147acd7a8cfe1 Mon Sep 17 00:00:00 2001 From: mozzy11 Date: Tue, 13 Aug 2024 00:12:28 +0300 Subject: [PATCH] add cql module --- .github/workflows/build-test.yml | 2 +- .github/workflows/e2e-on-release.yml | 2 +- .github/workflows/e2e-tests-on-commit.yml | 4 +- .github/workflows/publish.yml | 55 +++++++++ .../libraries/Library-HIVDTTestLogic.json | 65 +++++++++++ .../PlanDefinition-HIVTestLogicDT.json | 109 ++++++++++++++++++ dak/terminology/ValueSet-HIV.A.DE5.json | 52 +++++++++ .../globalproperties-core_demo.xml | 2 +- distro/distro.properties | 1 + distro/pom.xml | 9 +- docker-compose.yml | 10 +- pom.xml | 5 + 12 files changed, 307 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 dak/content/libraries/Library-HIVDTTestLogic.json create mode 100644 dak/content/plandefinitions/PlanDefinition-HIVTestLogicDT.json create mode 100644 dak/terminology/ValueSet-HIV.A.DE5.json diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 6484f9052..de03f86a9 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -2,7 +2,7 @@ name: Build and Validate Configuration on: pull_request: - branches: [main] + branches: [none] jobs: build: diff --git a/.github/workflows/e2e-on-release.yml b/.github/workflows/e2e-on-release.yml index dd21ec912..f89f89702 100644 --- a/.github/workflows/e2e-on-release.yml +++ b/.github/workflows/e2e-on-release.yml @@ -2,7 +2,7 @@ name: Run E2E Tests on Release PRs on: pull_request: - branches: [main] + branches: [none] jobs: build: diff --git a/.github/workflows/e2e-tests-on-commit.yml b/.github/workflows/e2e-tests-on-commit.yml index fb4b57ac8..a7f08ba7f 100644 --- a/.github/workflows/e2e-tests-on-commit.yml +++ b/.github/workflows/e2e-tests-on-commit.yml @@ -2,9 +2,9 @@ name: Run E2E Tests on PRs and Commits on: push: - branches: [main] + branches: [none] pull_request: - branches: [main] + branches: [none] jobs: build: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..ac466d3db --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,55 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Publish Docker Images + +on: + push: + branches: [main] + workflow_dispatch: + +env: + REGISTRY: docker.io + IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/openmrs-distro-who-hiv-dak + +jobs: + build-and-push-image-backend-dev: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + + # Add support for more platforms with QEMU (optional) + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_NAME}} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/dak/content/libraries/Library-HIVDTTestLogic.json b/dak/content/libraries/Library-HIVDTTestLogic.json new file mode 100644 index 000000000..2b854b257 --- /dev/null +++ b/dak/content/libraries/Library-HIVDTTestLogic.json @@ -0,0 +1,65 @@ +{ + "resourceType" : "Library", + "id" : "HIVDTTestLogic", + "meta" : { + "profile" : ["http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary", + "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary", + "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library", + "http://hl7.org/fhir/uv/cql/StructureDefinition/cql-module"] + }, + "text" : { + "status" : "generated", + "div" : "

Generated Narrative: Library HIVDTTestLogic

Parameters

True conditionout01boolean
False conditionout01boolean
Output textout01string

Contents

text/cql

define "True condition":\n  true\n\ndefine "False condition":\n  false\n\ndefine "Output text":\n  'Spam! Spam! Spam! Spam! Lovely spam! Wonderful spam! Spam spa-a-a-a-a-am spam spa-a-a-a-a-am spam! Lovely spam! Lovely spam! Lovely spam! Lovely spam! Spam spam spam spam!'\n

Content not shown - (application/elm+xml, size = 2Kb )

" + }, + "extension" : [{ + "url" : "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability", + "valueCode" : "computable" + }], + "url" : "http://smart.who.int/HIV/Library/HIVDTTestLogic", + "version" : "0.2.0", + "name" : "HIVDTTestLogic", + "title" : "HIV.DT Test Logic", + "status" : "draft", + "experimental" : true, + "type" : { + "coding" : [{ + "system" : "http://terminology.hl7.org/CodeSystem/library-type", + "code" : "logic-library" + }] + }, + "date" : "2024-08-08T06:57:34+00:00", + "publisher" : "WHO", + "contact" : [{ + "name" : "WHO", + "telecom" : [{ + "system" : "url", + "value" : "http://who.int" + }] + }], + "description" : "HIV.DT Test Logic", + "parameter" : [{ + "name" : "True condition", + "use" : "out", + "min" : 0, + "max" : "1", + "type" : "boolean" + }, + { + "name" : "False condition", + "use" : "out", + "min" : 0, + "max" : "1", + "type" : "boolean" + }, + { + "name" : "Output text", + "use" : "out", + "min" : 0, + "max" : "1", + "type" : "string" + }], + "content" : [{ + "contentType" : "text/cql", + "data" : "ZGVmaW5lICJUcnVlIGNvbmRpdGlvbiI6CiAgdHJ1ZQoKZGVmaW5lICJGYWxzZSBjb25kaXRpb24iOgogIGZhbHNlCgpkZWZpbmUgIk91dHB1dCB0ZXh0IjoKICAnU3BhbSEgU3BhbSEgU3BhbSEgU3BhbSEgTG92ZWx5IHNwYW0hIFdvbmRlcmZ1bCBzcGFtISBTcGFtIHNwYS1hLWEtYS1hLWFtIHNwYW0gc3BhLWEtYS1hLWEtYW0gc3BhbSEgTG92ZWx5IHNwYW0hIExvdmVseSBzcGFtISBMb3ZlbHkgc3BhbSEgTG92ZWx5IHNwYW0hIFNwYW0gc3BhbSBzcGFtIHNwYW0hJwo=" + }] + } \ No newline at end of file diff --git a/dak/content/plandefinitions/PlanDefinition-HIVTestLogicDT.json b/dak/content/plandefinitions/PlanDefinition-HIVTestLogicDT.json new file mode 100644 index 000000000..9593260ba --- /dev/null +++ b/dak/content/plandefinitions/PlanDefinition-HIVTestLogicDT.json @@ -0,0 +1,109 @@ +{ + "resourceType": "PlanDefinition", + "id": "HIVTestLogicDT", + "meta": { + "profile": [ + "http://hl7.org/fhir/uv/cpg/StructureDefinition/cpg-recommendationdefinition", + "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareableplandefinition", + "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishableplandefinition" + ] + }, + "text": { + "status": "generated", + "div": "

Generated Narrative: PlanDefinition HIVTestLogicDT

url: PlanDefinition HIV.DT Test Logic Process

version: 0.2.0

name: HIVTestLogicDT

title: HIV.DT Test Logic Process

type: ECA Rule

status: Draft

experimental: true

date: 2024-08-08 06:57:34+0000

publisher: WHO

contact: WHO: http://who.int

description:

Test Logic Process

\n

RelatedArtifacts

-TypeCitation
*Citation

Consolidated Guidelines on HIV Testing Services (2019)

\n

library: HIV.DT Test Logic

action

textEquivalent: Spammy action

condition

kind: Applicability

Expressions

-LanguageExpression
*text/cql-identifierTrue condition

dynamicValue

path: description

Expressions

-LanguageExpression
*text/cql-identifierOutput text

action

textEquivalent: Non-spammy action

condition

kind: Applicability

Expressions

-LanguageExpression
*text/cql-identifierFalse condition

dynamicValue

path: description

Expressions

-LanguageExpression
*text/cql-identifierOutput text
" + }, + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability", + "valueCode": "computable" + } + ], + "url": "http://smart.who.int/hiv/PlanDefinition/HIVB2DT", + "version": "0.2.0", + "name": "HIVTestLogicDT", + "title": "HIV.DT Test Logic Process", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/plan-definition-type", + "code": "eca-rule" + } + ] + }, + "status": "draft", + "experimental": true, + "date": "2024-08-08T06:57:34+00:00", + "publisher": "WHO", + "contact": [ + { + "name": "WHO", + "telecom": [ + { + "system": "url", + "value": "http://who.int" + } + ] + } + ], + "description": "Test Logic Process", + "relatedArtifact": [ + { + "type": "citation", + "citation": "Consolidated Guidelines on HIV Testing Services (2019)" + } + ], + "library": [ + "http://smart.who.int/HIV/Library/HIVDTTestLogic" + ], + "action": [ + { + "title": "Test Action Gruop", + "action": [ + { + "title": "Spammy action", + "textEquivalent": "Spammy action", + "condition": [ + { + "kind": "applicability", + "expression": { + "language": "text/cql-identifier", + "expression": "True condition" + } + } + ], + "dynamicValue": [ + { + "path": "description", + "expression": { + "language": "text/cql-identifier", + "expression": "Output text" + } + } + ] + }, + { + "title": "Non-spammy action", + "textEquivalent": "Non-spammy action", + "condition": [ + { + "kind": "applicability", + "expression": { + "language": "text/cql-identifier", + "expression": "True condition" + } + } + ], + "dynamicValue": [ + { + "path": "description", + "expression": { + "language": "text/cql-identifier", + "expression": "Output text" + } + } + ] + } + ] + } + ] + } \ No newline at end of file diff --git a/dak/terminology/ValueSet-HIV.A.DE5.json b/dak/terminology/ValueSet-HIV.A.DE5.json new file mode 100644 index 000000000..ffcc5faa3 --- /dev/null +++ b/dak/terminology/ValueSet-HIV.A.DE5.json @@ -0,0 +1,52 @@ +{ + "resourceType": "ValueSet", + "id": "HIV.A.DE5", + "meta": { + "profile": [ + "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablevalueset", + "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablevalueset", + "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablevalueset" + ] + }, + "text": { + "status": "extensions", + "div": "

Generated Narrative: ValueSet HIV.A.DE5

" + }, + "url": "http://smart.who.int/hiv/ValueSet/HIV.A.DE5", + "version": "0.2.0", + "name": "HIVADE5", + "title": "Referred by ValueSet", + "status": "active", + "experimental": true, + "date": "2024-08-02T14:11:44+00:00", + "publisher": "WHO", + "contact": [ + { + "name": "WHO", + "telecom": [ + { + "system": "url", + "value": "http://who.int" + } + ] + } + ], + "description": "Value set of how the client was referred", + "compose": { + "include": [ + { + "system": "http://smart.who.int/hiv/CodeSystem/HIVConcepts", + "concept": [ + { + "code": "HIV.A.DE6", + "display": "Community" + }, + { + "code": "HIV.A.DE7", + "display": "Facility" + } + ] + } + ] + } + } \ No newline at end of file diff --git a/distro/configuration/globalproperties/globalproperties-core_demo.xml b/distro/configuration/globalproperties/globalproperties-core_demo.xml index 08c8d638f..ea85bfb51 100644 --- a/distro/configuration/globalproperties/globalproperties-core_demo.xml +++ b/distro/configuration/globalproperties/globalproperties-core_demo.xml @@ -2,7 +2,7 @@ referencedemodata.createDemoPatientsOnNextStartup - 50 + 1 diff --git a/distro/distro.properties b/distro/distro.properties index 7a7dd86b4..8aeff55bd 100644 --- a/distro/distro.properties +++ b/distro/distro.properties @@ -28,4 +28,5 @@ omod.ordertemplates=${ordertemplates.version} omod.patientflags=${patientflags.version} omod.o3forms=${o3forms.version} omod.authentication=${authentication.version} +omod.cql=${cql.version} diff --git a/distro/pom.xml b/distro/pom.xml index 7de3a8dd1..536443aa8 100644 --- a/distro/pom.xml +++ b/distro/pom.xml @@ -47,8 +47,9 @@ 1.11.0 0.2.16 1.0.2 - 3.0.7 + 3.0.8-cql-SNAPSHOT 2.3.0-SNAPSHOT + 1.0.0-SNAPSHOT @@ -199,6 +200,12 @@ ${o3forms.version} provided + + org.openmrs.module + cql-omod + ${cql.version} + provided + diff --git a/docker-compose.yml b/docker-compose.yml index 670e20ac5..cbe62b437 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,8 @@ version: "3.7" services: gateway: - image: openmrs/openmrs-reference-application-3-gateway:${TAG:-qa} + image: openmrs/openmrs-reference-application-3-gateway:dev3 + container_name: gateway restart: "unless-stopped" depends_on: - frontend @@ -11,7 +12,8 @@ services: - "80:80" frontend: - image: openmrs/openmrs-reference-application-3-frontend:${TAG:-qa} + image: openmrs/openmrs-reference-application-3-frontend:dev3 + container_name: frontend restart: "unless-stopped" environment: SPA_PATH: /openmrs/spa @@ -25,7 +27,8 @@ services: - backend backend: - image: openmrs/openmrs-reference-application-3-backend:${TAG:-qa} + image: itechuw/openmrs-distro-who-hiv-dak:main + container_name: backend restart: "unless-stopped" depends_on: - db @@ -41,6 +44,7 @@ services: test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"] timeout: 5s volumes: + - ./dak/:/openmrs/dak/ - openmrs-data:/openmrs/data # MariaDB diff --git a/pom.xml b/pom.xml index d92e42263..41ab38ae0 100644 --- a/pom.xml +++ b/pom.xml @@ -168,6 +168,11 @@ interval:10080 + + uwdigi-repo-central + DIGI Public Repository + https://packages.uwdigi.org/artifactory/public +