diff --git a/.eslintignore b/.eslintignore index 84c29a0d4..adefaa5ca 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ +**/*.d.ts **/node_modules/**/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 549443ba2..d02dc0325 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,38 +104,3 @@ jobs: - run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag latest env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - - bump-form-engine_ohri: - runs-on: ubuntu-latest - - needs: pre_release - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - repository: UCSF-IGHS/openmrs-esm-ohri - ref: dev - - - name: Install dependencies - run: yarn - - - name: Bump form engine - run: yarn ci:bump-form-engine-lib - - - name: Commit changes - run: | - git config user.email "github-actions@github.com" - git config user.name "GitHub Actions" - git add yarn.lock - git commit -m "(chore) bump-form-engine" - - - name: Create PR - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.ACTIONS_OHRI_PAT }} - commit-message: "(chore) Bump `@openmrs/openmrs-form-engine-lib`" - title: "(chore) Bump `@openmrs/openmrs-form-engine-lib`" - body: "This is an automated PR that bumps the [form engine library](https://github.com/openmrs/openmrs-form-engine-lib) to the newest available version tagged `next`." - branch: chore/bump-form-engine - base: dev diff --git a/README.md b/README.md index ea03dcd5f..d02bef1d0 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@
-:wave: *New to O3? Be sure to review the [OpenMRS 3 Frontend Developer Documentation](https://openmrs.github.io/openmrs-esm-core/#/). You may find the [Map of the Project](https://openmrs.github.io/openmrs-esm-core/#/main/map) especially helpful.* :teacher: +:wave: *New to O3? Be sure to review the [OpenMRS 3 Frontend Developer Documentation](https://openmrs.github.io/openmrs-esm-core/#/). You may find the [Map of the Project](https://openmrs.github.io/openmrs-esm-core/#/main/map) especially helpful.* :teacher: -[![Form-engine-CI](https://github.com/UCSF-IGHS/openmrs-ohri-form-engine-lib/actions/workflows/node.js.yml/badge.svg)](https://github.com/UCSF-IGHS/openmrs-ohri-form-engine-lib/actions/workflows/node.js.yml) # OpenMRS Form Engine @@ -48,10 +47,10 @@ yarn add @openmrs/openmrs-form-engine-lib@latest ### Local Development -#### Install Dependencies +#### Install Dependencies ```bash -yarn +yarn ``` #### Build the library diff --git a/__mocks__/forms/omrs-forms/component_art.json b/__mocks__/forms/omrs-forms/component_art.json index 9cf5347f8..a365587cd 100644 --- a/__mocks__/forms/omrs-forms/component_art.json +++ b/__mocks__/forms/omrs-forms/component_art.json @@ -16,7 +16,7 @@ "links": [ { "rel": "self", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", "resourceAlias": "user" } ] diff --git a/__mocks__/forms/omrs-forms/component_preclinic-review.json b/__mocks__/forms/omrs-forms/component_preclinic-review.json index 4baf29ce4..8f61d369f 100644 --- a/__mocks__/forms/omrs-forms/component_preclinic-review.json +++ b/__mocks__/forms/omrs-forms/component_preclinic-review.json @@ -16,7 +16,7 @@ "links": [ { "rel": "self", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", "resourceAlias": "user" } ] diff --git a/__mocks__/forms/omrs-forms/demo_hts-form.json b/__mocks__/forms/omrs-forms/demo_hts-form.json index ffa0dd428..de2a2b473 100644 --- a/__mocks__/forms/omrs-forms/demo_hts-form.json +++ b/__mocks__/forms/omrs-forms/demo_hts-form.json @@ -16,7 +16,7 @@ "links": [ { "rel": "self", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", "resourceAlias": "user" } ] @@ -34,17 +34,17 @@ "links": [ { "rel": "value", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0/value", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0/value", "resourceAlias": "resource" }, { "rel": "self", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0", "resourceAlias": "resource" }, { "rel": "full", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0?v=full", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0?v=full", "resourceAlias": "resource" } ], @@ -54,9 +54,9 @@ "links": [ { "rel": "self", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55", "resourceAlias": "form" } ], "resourceVersion": "1.9" -} \ No newline at end of file +} diff --git a/__mocks__/forms/omrs-forms/form-component.json b/__mocks__/forms/omrs-forms/form-component.json index 0797be7e3..81b53689c 100644 --- a/__mocks__/forms/omrs-forms/form-component.json +++ b/__mocks__/forms/omrs-forms/form-component.json @@ -16,7 +16,7 @@ "links": [ { "rel": "self", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", "resourceAlias": "user" } ] diff --git a/__mocks__/forms/omrs-forms/nested-form1.json b/__mocks__/forms/omrs-forms/nested-form1.json index f5a6eaa5a..0d2a304fb 100644 --- a/__mocks__/forms/omrs-forms/nested-form1.json +++ b/__mocks__/forms/omrs-forms/nested-form1.json @@ -16,7 +16,7 @@ "links": [ { "rel": "self", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", "resourceAlias": "user" } ] @@ -35,4 +35,4 @@ } ], "resourceVersion": "1.9" -} \ No newline at end of file +} diff --git a/__mocks__/forms/omrs-forms/nested-form2.json b/__mocks__/forms/omrs-forms/nested-form2.json index d08a7e639..d4c0b8d22 100644 --- a/__mocks__/forms/omrs-forms/nested-form2.json +++ b/__mocks__/forms/omrs-forms/nested-form2.json @@ -16,7 +16,7 @@ "links": [ { "rel": "self", - "uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", + "uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f", "resourceAlias": "user" } ] @@ -35,4 +35,4 @@ } ], "resourceVersion": "1.9" -} \ No newline at end of file +} diff --git a/__mocks__/forms/ohri-forms/age-validation-form.json b/__mocks__/forms/rfe-forms/age-validation-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/age-validation-form.json rename to __mocks__/forms/rfe-forms/age-validation-form.json diff --git a/__mocks__/forms/ohri-forms/bmi-test-form.json b/__mocks__/forms/rfe-forms/bmi-test-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/bmi-test-form.json rename to __mocks__/forms/rfe-forms/bmi-test-form.json diff --git a/__mocks__/forms/ohri-forms/bsa-test-form.json b/__mocks__/forms/rfe-forms/bsa-test-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/bsa-test-form.json rename to __mocks__/forms/rfe-forms/bsa-test-form.json diff --git a/__mocks__/forms/ohri-forms/component_art.json b/__mocks__/forms/rfe-forms/component_art.json similarity index 100% rename from __mocks__/forms/ohri-forms/component_art.json rename to __mocks__/forms/rfe-forms/component_art.json diff --git a/__mocks__/forms/ohri-forms/component_preclinic-review.json b/__mocks__/forms/rfe-forms/component_preclinic-review.json similarity index 100% rename from __mocks__/forms/ohri-forms/component_preclinic-review.json rename to __mocks__/forms/rfe-forms/component_preclinic-review.json diff --git a/__mocks__/forms/ohri-forms/demo_hts-form.json b/__mocks__/forms/rfe-forms/demo_hts-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/demo_hts-form.json rename to __mocks__/forms/rfe-forms/demo_hts-form.json diff --git a/__mocks__/forms/ohri-forms/edd-test-form.json b/__mocks__/forms/rfe-forms/edd-test-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/edd-test-form.json rename to __mocks__/forms/rfe-forms/edd-test-form.json diff --git a/__mocks__/forms/ohri-forms/external_data_source_form.json b/__mocks__/forms/rfe-forms/external_data_source_form.json similarity index 100% rename from __mocks__/forms/ohri-forms/external_data_source_form.json rename to __mocks__/forms/rfe-forms/external_data_source_form.json diff --git a/__mocks__/forms/ohri-forms/filter-answer-options-test-form.json b/__mocks__/forms/rfe-forms/filter-answer-options-test-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/filter-answer-options-test-form.json rename to __mocks__/forms/rfe-forms/filter-answer-options-test-form.json diff --git a/__mocks__/forms/ohri-forms/form-component.json b/__mocks__/forms/rfe-forms/form-component.json similarity index 100% rename from __mocks__/forms/ohri-forms/form-component.json rename to __mocks__/forms/rfe-forms/form-component.json diff --git a/__mocks__/forms/ohri-forms/forms-loader.test.schema.ts b/__mocks__/forms/rfe-forms/forms-loader.test.schema.ts similarity index 100% rename from __mocks__/forms/ohri-forms/forms-loader.test.schema.ts rename to __mocks__/forms/rfe-forms/forms-loader.test.schema.ts diff --git a/__mocks__/forms/ohri-forms/labour_and_delivery_test_form.json b/__mocks__/forms/rfe-forms/labour_and_delivery_test_form.json similarity index 100% rename from __mocks__/forms/ohri-forms/labour_and_delivery_test_form.json rename to __mocks__/forms/rfe-forms/labour_and_delivery_test_form.json diff --git a/__mocks__/forms/ohri-forms/mini-form.json b/__mocks__/forms/rfe-forms/mini-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/mini-form.json rename to __mocks__/forms/rfe-forms/mini-form.json diff --git a/__mocks__/forms/ohri-forms/months-on-art-form.json b/__mocks__/forms/rfe-forms/months-on-art-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/months-on-art-form.json rename to __mocks__/forms/rfe-forms/months-on-art-form.json diff --git a/__mocks__/forms/ohri-forms/nested-form1.json b/__mocks__/forms/rfe-forms/nested-form1.json similarity index 100% rename from __mocks__/forms/ohri-forms/nested-form1.json rename to __mocks__/forms/rfe-forms/nested-form1.json diff --git a/__mocks__/forms/ohri-forms/nested-form2.json b/__mocks__/forms/rfe-forms/nested-form2.json similarity index 100% rename from __mocks__/forms/ohri-forms/nested-form2.json rename to __mocks__/forms/rfe-forms/nested-form2.json diff --git a/__mocks__/forms/ohri-forms/next-visit-test-form.json b/__mocks__/forms/rfe-forms/next-visit-test-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/next-visit-test-form.json rename to __mocks__/forms/rfe-forms/next-visit-test-form.json diff --git a/__mocks__/forms/ohri-forms/obs-group-test_form.json b/__mocks__/forms/rfe-forms/obs-group-test_form.json similarity index 100% rename from __mocks__/forms/ohri-forms/obs-group-test_form.json rename to __mocks__/forms/rfe-forms/obs-group-test_form.json diff --git a/__mocks__/forms/ohri-forms/post-submission-test-form.json b/__mocks__/forms/rfe-forms/post-submission-test-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/post-submission-test-form.json rename to __mocks__/forms/rfe-forms/post-submission-test-form.json diff --git a/__mocks__/forms/ohri-forms/reference-by-mapping-form.json b/__mocks__/forms/rfe-forms/reference-by-mapping-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/reference-by-mapping-form.json rename to __mocks__/forms/rfe-forms/reference-by-mapping-form.json diff --git a/__mocks__/forms/ohri-forms/sample_fields.json b/__mocks__/forms/rfe-forms/sample_fields.json similarity index 100% rename from __mocks__/forms/ohri-forms/sample_fields.json rename to __mocks__/forms/rfe-forms/sample_fields.json diff --git a/__mocks__/forms/ohri-forms/test-enrolment-form.json b/__mocks__/forms/rfe-forms/test-enrolment-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/test-enrolment-form.json rename to __mocks__/forms/rfe-forms/test-enrolment-form.json diff --git a/__mocks__/forms/ohri-forms/treatment-end-date-test-form.json b/__mocks__/forms/rfe-forms/treatment-end-date-test-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/treatment-end-date-test-form.json rename to __mocks__/forms/rfe-forms/treatment-end-date-test-form.json diff --git a/__mocks__/forms/ohri-forms/viral-load-status-form.json b/__mocks__/forms/rfe-forms/viral-load-status-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/viral-load-status-form.json rename to __mocks__/forms/rfe-forms/viral-load-status-form.json diff --git a/__mocks__/forms/ohri-forms/zscore-bmi-for-age-form.json b/__mocks__/forms/rfe-forms/zscore-bmi-for-age-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/zscore-bmi-for-age-form.json rename to __mocks__/forms/rfe-forms/zscore-bmi-for-age-form.json diff --git a/__mocks__/forms/ohri-forms/zscore-height-for-age-form.json b/__mocks__/forms/rfe-forms/zscore-height-for-age-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/zscore-height-for-age-form.json rename to __mocks__/forms/rfe-forms/zscore-height-for-age-form.json diff --git a/__mocks__/forms/ohri-forms/zscore-weight-height-form.json b/__mocks__/forms/rfe-forms/zscore-weight-height-form.json similarity index 100% rename from __mocks__/forms/ohri-forms/zscore-weight-height-form.json rename to __mocks__/forms/rfe-forms/zscore-weight-height-form.json diff --git a/__mocks__/use-initial-values/encounter.mock.json b/__mocks__/use-initial-values/encounter.mock.json index b476eba95..b8583f5b9 100644 --- a/__mocks__/use-initial-values/encounter.mock.json +++ b/__mocks__/use-initial-values/encounter.mock.json @@ -214,8 +214,8 @@ "voided": false, "value": "Mother is in perfect condition", "valueModifier": null, - "formFieldPath": "ohri-forms-notes", - "formFieldNamespace": "ohri-forms", + "formFieldPath": "rfe-forms-notes", + "formFieldNamespace": "rfe-forms", "status": "FINAL", "interpretation": null, "links": [ @@ -329,8 +329,8 @@ "voided": false, "value": "2023-07-24T00:00:00.000+0000", "valueModifier": null, - "formFieldPath": "ohri-forms-date_of_birth", - "formFieldNamespace": "ohri-forms", + "formFieldPath": "rfe-forms-date_of_birth", + "formFieldNamespace": "rfe-forms", "status": "FINAL", "interpretation": null, "links": [ @@ -414,8 +414,8 @@ "voided": false, "value": "TBD", "valueModifier": null, - "formFieldPath": "ohri-forms-infant_name", - "formFieldNamespace": "ohri-forms", + "formFieldPath": "rfe-forms-infant_name", + "formFieldNamespace": "rfe-forms", "status": "FINAL", "interpretation": null, "links": [ @@ -575,8 +575,8 @@ "voided": false, "value": " TDB II", "valueModifier": null, - "formFieldPath": "ohri-forms-infant_name_2", - "formFieldNamespace": "ohri-forms", + "formFieldPath": "rfe-forms-infant_name_2", + "formFieldNamespace": "rfe-forms", "status": "FINAL", "interpretation": null, "links": [ @@ -660,8 +660,8 @@ "voided": false, "value": "2023-07-24T00:00:00.000+0000", "valueModifier": null, - "formFieldPath": "ohri-forms-date_of_birth_2", - "formFieldNamespace": "ohri-forms", + "formFieldPath": "rfe-forms-date_of_birth_2", + "formFieldNamespace": "rfe-forms", "status": "FINAL", "interpretation": null, "links": [ @@ -781,8 +781,8 @@ "voided": false, "value": 2, "valueModifier": null, - "formFieldPath": "ohri-forms-number_of_babies", - "formFieldNamespace": "ohri-forms", + "formFieldPath": "rfe-forms-number_of_babies", + "formFieldNamespace": "rfe-forms", "status": "FINAL", "interpretation": null, "links": [ @@ -864,4 +864,4 @@ } ], "resourceVersion": "2.2" -} \ No newline at end of file +} diff --git a/src/api/api.ts b/src/api/api.ts index dc28bf1c2..249fe76f2 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -1,8 +1,8 @@ -import { openmrsFetch, openmrsObservableFetch } from '@openmrs/esm-framework'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { openmrsFetch, openmrsObservableFetch } from '@openmrs/esm-framework'; import { encounterRepresentation } from '../constants'; -import { OpenmrsForm, ProgramEnrollmentPayload } from './types'; +import { OpenmrsForm, ProgramEnrollmentPayload } from '../types'; import { isUuid } from '../utils/boolean-utils'; const BASE_WS_API_URL = '/ws/rest/v1/'; @@ -121,7 +121,7 @@ export async function fetchOpenMRSForm(nameOrUUID: string): Promise