From 094cd76fd8bc625c988613a7170a38f005871d26 Mon Sep 17 00:00:00 2001 From: Amos Laboso Date: Wed, 15 May 2024 15:17:46 +0300 Subject: [PATCH] Revert "Updating demo to display ANC Visits Count. (#1841)" This reverts commit 02c935111ddf208bd17345f7ed1e7f436c6525d0. --- .env | 6 - .github/workflows/e2e.yml | 63 - .github/workflows/node.dev.js.yml | 23 +- .github/workflows/node.master.js.yml | 2 +- .gitignore | 7 - __mocks__/encounter-list.mock.tsx | 1252 ----------------- e2e/README.md | 117 -- e2e/commands/index.ts | 2 - e2e/commands/patient-operations.ts | 105 -- e2e/commands/visit-operations.ts | 31 - e2e/core/global-setup.ts | 32 - e2e/core/index.ts | 1 - e2e/core/test.ts | 20 - e2e/fixtures/api.ts | 26 - e2e/fixtures/index.ts | 1 - e2e/pages/chart-page.ts | 11 - e2e/pages/home-page.ts | 11 - e2e/pages/index.ts | 3 - e2e/pages/visits-page.ts | 9 - e2e/specs/registration-test.spec.ts | 40 - frontend/spa-build-config.json | 57 +- jest.config.js | 4 - package.json | 6 +- .../src/config-schema.ts | 9 - .../tabs/cacx-registration.component.tsx | 4 +- .../tabs/cacx-treatment.component.tsx | 4 +- packages/esm-commons-lib/package.json | 2 +- .../cohort-patient-list.component.tsx | 3 - .../cohort-patient-list/helpers.tsx | 49 - .../data-table/o-table.component.tsx | 1 + .../encounter-list.component.tsx | 146 +- .../encounter-list/encounter-list.test.tsx | 107 -- .../src/components/encounter-list/helpers.ts | 50 +- .../encounter-tile.component.tsx | 2 +- .../ohri-form-empty-launcher.component.tsx | 2 +- .../ohri-form-launcher.component.tsx | 2 +- .../welcome-section/ohri-welcome-section.scss | 1 - .../ohri-patient-list-tabs.component.tsx | 1 - .../tile/ohri-programme-summary-tiles.scss | 1 - .../src/hooks/useEncounterRows.ts | 5 +- .../esm-commons-lib/src/hooks/useFormsJson.ts | 2 +- .../src/hooks/useLastEncounter.tsx | 2 +- .../src/hooks/usePatientDeathStatus.ts | 18 +- packages/esm-commons-lib/src/index.ts | 2 - packages/esm-commons-lib/src/root.scss | 17 - .../src/utils/createNewOHRIDashboardLink.tsx | 44 - .../src/utils/createOHRIGroupedLink.tsx | 78 - .../src/utils/ohri-forms-commons.ts | 4 +- .../src/utils/sidenav-links.scss | 2 +- .../src/workspace/ohri-workspace-utils.ts | 6 +- packages/esm-covid-app/src/config-schema.ts | 16 - packages/esm-covid-app/src/dashboard.meta.tsx | 5 +- packages/esm-covid-app/src/home.component.tsx | 16 - packages/esm-covid-app/src/index.ts | 16 +- packages/esm-covid-app/src/root.component.tsx | 27 - packages/esm-covid-app/src/routes.json | 48 +- ...sx => case-assessment.encounter-lists.tsx} | 16 +- ....tsx => covid-outcomes.encounter-list.tsx} | 4 +- ... => covid-vaccinations.encounter-list.tsx} | 4 +- .../covid-summary-tiles.component.tsx | 2 +- ...ent.tsx => lab-results.encounter-list.tsx} | 36 +- packages/esm-form-render-app/package.json | 2 +- .../render/forms-render-test.component.tsx | 8 +- packages/esm-hiv-app/src/config-schema.ts | 24 - packages/esm-hiv-app/src/dashboard.meta.tsx | 10 +- .../src/hiv-treatment-home.component.tsx | 16 - .../src/hiv-treatment-root.component.tsx | 27 - .../esm-hiv-app/src/hts-home.component.tsx | 16 - .../esm-hiv-app/src/hts-root.component.tsx | 27 - packages/esm-hiv-app/src/index.ts | 20 +- packages/esm-hiv-app/src/routes.json | 51 +- ...linical-visit-encounter-list.component.tsx | 4 +- .../tabs/disclosure.component.tsx | 4 +- .../intimate-partner-violence.component.tsx | 4 +- .../mental-health-assessment.component.tsx | 4 +- .../tab-list/hts-overview-list.component.tsx | 3 +- .../ct-summary-tiles.component.tsx | 2 +- .../hts/home/summary-tiles/summary-tile.scss | 1 - .../tabs/cd4-results.component.tsx | 5 +- .../tabs/viral-load-results.component.tsx | 15 +- .../cd4/cd4-encounter-list.component.tsx | 4 +- .../lab-results-encounter-list.component.tsx | 4 +- .../partner-notification.component.tsx | 4 +- .../tabs/contact-tracing.component.tsx | 4 +- .../tabs/patient-tracing.component.tsx | 4 +- .../tabs/art-therapy-tab.component.tsx | 4 +- .../tabs/death-tab.component.tsx | 4 +- .../tabs/hiv-enrolment-tab.component.tsx | 4 +- .../tabs/service-delivery-tab.component.tsx | 4 +- .../tabs/transfer-out-tab.component.tsx | 12 +- ...ice-enrolment-encounter-list.component.tsx | 4 +- .../tabs/clinical-visit-tab.component.tsx | 4 +- packages/esm-ohri-core-app/README.md | 4 +- .../esm-ohri-core-app/src/dashboard.meta.tsx | 35 +- .../src/dashboard.meta.utils.ts | 2 +- packages/esm-ohri-core-app/src/index.ts | 51 +- .../appointments-dashboard.component.tsx | 8 + .../dispensing-dashboard.component.tsx | 13 + .../programs-home.component.tsx | 7 - .../service-queues-dashboard.component.tsx | 13 + packages/esm-ohri-core-app/src/root.tsx | 15 + packages/esm-ohri-core-app/src/routes.json | 74 +- .../esm-ohri-pmtct-app/src/config-schema.ts | 22 +- .../esm-ohri-pmtct-app/src/dashboard.meta.tsx | 9 +- .../esm-ohri-pmtct-app/src/home.component.tsx | 16 - packages/esm-ohri-pmtct-app/src/index.ts | 22 +- .../art-linkage-action.ts | 9 +- .../current-ptracker-action.ts | 10 +- .../esm-ohri-pmtct-app/src/root.component.tsx | 27 - packages/esm-ohri-pmtct-app/src/routes.json | 66 +- .../tabs/infant-postnatal-care.component.tsx | 6 +- .../tabs/antenatal-care.component.tsx | 12 +- .../tabs/labour-delivery.component.tsx | 12 +- .../tabs/postnatal-care.component.tsx | 8 +- .../tabs/current-pregnancy.component.tsx | 62 +- .../tabs/hiv-exposed-infant.component.tsx | 40 +- ...maternal-child-summary-tiles.component.tsx | 2 +- .../mother-child-summary-tabs.component.tsx | 6 +- .../esm-ohri-pmtct-app/translations/en.json | 1 - packages/esm-opd-app/package.json | 55 - packages/esm-opd-app/src/config-schema.ts | 1 - packages/esm-opd-app/src/dashboard.meta.tsx | 12 - packages/esm-opd-app/src/dashboard.scss | 21 - packages/esm-opd-app/src/declarations.d.tsx | 2 - packages/esm-opd-app/src/index.ts | 29 - packages/esm-opd-app/src/root.scss | 116 -- packages/esm-opd-app/src/routes.json | 38 - packages/esm-opd-app/src/setupTests.ts | 15 - packages/esm-opd-app/translations/en.json | 1 - packages/esm-opd-app/tsconfig.json | 28 - packages/esm-opd-app/webpack.config.js | 17 - packages/esm-tb-app/src/config-schema.ts | 39 - packages/esm-tb-app/src/dashboard.meta.tsx | 45 +- packages/esm-tb-app/src/home.component.tsx | 16 - packages/esm-tb-app/src/index.ts | 61 +- packages/esm-tb-app/src/root.component.tsx | 27 - packages/esm-tb-app/src/routes.json | 129 +- packages/esm-tb-app/src/tb-helper.ts | 42 +- .../esm-tb-app/src/tpt-home.component.tsx | 16 - .../esm-tb-app/src/tpt-root.component.tsx | 27 - .../tpt-patient-list-tabs.component.tsx | 58 - .../tb-summary-tiles.component.tsx | 4 +- .../tpt-summary-tiles.component.tsx | 22 - .../tb-patient-summary.component.tsx | 66 +- .../tabs/mdr-tb.component.tsx | 24 +- .../tabs/tb-patient-tracing.component.tsx | 10 +- .../tb-contact-list.component.tsx | 10 +- .../patient-summary.component.tsx | 223 --- .../tabs/tpt-enrolment.component.tsx | 118 -- .../tabs/tpt-treatment.component.tsx | 85 -- .../tpt-program-management.tsx | 31 - .../tb-treatment-follow-up.component.tsx | 16 +- packages/esm-tb-app/translations/en.json | 15 +- playwright.config.ts | 33 - yarn.lock | 432 ++---- 155 files changed, 878 insertions(+), 4440 deletions(-) delete mode 100644 .env delete mode 100644 .github/workflows/e2e.yml delete mode 100644 __mocks__/encounter-list.mock.tsx delete mode 100644 e2e/README.md delete mode 100644 e2e/commands/index.ts delete mode 100644 e2e/commands/patient-operations.ts delete mode 100644 e2e/commands/visit-operations.ts delete mode 100644 e2e/core/global-setup.ts delete mode 100644 e2e/core/index.ts delete mode 100644 e2e/core/test.ts delete mode 100644 e2e/fixtures/api.ts delete mode 100644 e2e/fixtures/index.ts delete mode 100644 e2e/pages/chart-page.ts delete mode 100644 e2e/pages/home-page.ts delete mode 100644 e2e/pages/index.ts delete mode 100644 e2e/pages/visits-page.ts delete mode 100644 e2e/specs/registration-test.spec.ts delete mode 100644 packages/esm-commons-lib/src/components/encounter-list/encounter-list.test.tsx delete mode 100644 packages/esm-commons-lib/src/utils/createNewOHRIDashboardLink.tsx delete mode 100644 packages/esm-commons-lib/src/utils/createOHRIGroupedLink.tsx delete mode 100644 packages/esm-covid-app/src/home.component.tsx delete mode 100644 packages/esm-covid-app/src/root.component.tsx rename packages/esm-covid-app/src/views/{case-assessment.component.tsx => case-assessment.encounter-lists.tsx} (88%) rename packages/esm-covid-app/src/views/{covid-outcomes.component.tsx => covid-outcomes.encounter-list.tsx} (94%) rename packages/esm-covid-app/src/views/{covid-vaccinations.component.tsx => covid-vaccinations.encounter-list.tsx} (97%) rename packages/esm-covid-app/src/views/{lab-results.component.tsx => lab-results.encounter-list.tsx} (89%) delete mode 100644 packages/esm-hiv-app/src/hiv-treatment-home.component.tsx delete mode 100644 packages/esm-hiv-app/src/hiv-treatment-root.component.tsx delete mode 100644 packages/esm-hiv-app/src/hts-home.component.tsx delete mode 100644 packages/esm-hiv-app/src/hts-root.component.tsx create mode 100644 packages/esm-ohri-core-app/src/ohri-dashboard/appointments/appointments-dashboard.component.tsx create mode 100644 packages/esm-ohri-core-app/src/ohri-dashboard/dispensing/dispensing-dashboard.component.tsx delete mode 100644 packages/esm-ohri-core-app/src/ohri-dashboard/programs-home.component.tsx create mode 100644 packages/esm-ohri-core-app/src/ohri-dashboard/service-queues/service-queues-dashboard.component.tsx create mode 100644 packages/esm-ohri-core-app/src/root.tsx delete mode 100644 packages/esm-ohri-pmtct-app/src/home.component.tsx delete mode 100644 packages/esm-ohri-pmtct-app/src/root.component.tsx delete mode 100644 packages/esm-opd-app/package.json delete mode 100644 packages/esm-opd-app/src/config-schema.ts delete mode 100644 packages/esm-opd-app/src/dashboard.meta.tsx delete mode 100644 packages/esm-opd-app/src/dashboard.scss delete mode 100644 packages/esm-opd-app/src/declarations.d.tsx delete mode 100644 packages/esm-opd-app/src/index.ts delete mode 100644 packages/esm-opd-app/src/root.scss delete mode 100644 packages/esm-opd-app/src/routes.json delete mode 100644 packages/esm-opd-app/src/setupTests.ts delete mode 100644 packages/esm-opd-app/translations/en.json delete mode 100644 packages/esm-opd-app/tsconfig.json delete mode 100644 packages/esm-opd-app/webpack.config.js delete mode 100644 packages/esm-tb-app/src/home.component.tsx delete mode 100644 packages/esm-tb-app/src/root.component.tsx delete mode 100644 packages/esm-tb-app/src/tpt-home.component.tsx delete mode 100644 packages/esm-tb-app/src/tpt-root.component.tsx delete mode 100644 packages/esm-tb-app/src/views/dashboard/patient-list-tabs/tpt-patient-list-tabs.component.tsx delete mode 100644 packages/esm-tb-app/src/views/dashboard/summary-tiles/tpt-summary-tiles.component.tsx delete mode 100644 packages/esm-tb-app/src/views/tpt/patient-summary/patient-summary.component.tsx delete mode 100644 packages/esm-tb-app/src/views/tpt/program-management/tabs/tpt-enrolment.component.tsx delete mode 100644 packages/esm-tb-app/src/views/tpt/program-management/tabs/tpt-treatment.component.tsx delete mode 100644 packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management.tsx delete mode 100644 playwright.config.ts diff --git a/.env b/.env deleted file mode 100644 index 666a53f01..000000000 --- a/.env +++ /dev/null @@ -1,6 +0,0 @@ -# This is an environment file for configuring dynamic values. -E2E_BASE_URL=https://ohri-dev.globalhealthapp.net/openmrs -E2E_USER_ADMIN_USERNAME=admin -E2E_USER_ADMIN_PASSWORD=Admin123 -E2E_LOGIN_DEFAULT_LOCATION_UUID=44c3efb0-2583-4c80-a79e-1f756a03c0a1 -# The above location UUID is for the "Outpatient Clinic" location in the reference application diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index 26ebd77d9..000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: E2E Tests - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Copy test environment variables - run: | - cp example.env .env - sed -i 's/8080/8180/g' .env - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Cache dependencies - id: cache - uses: actions/cache@v3 - with: - path: '**/node_modules' - key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: yarn install --immutable - - - name: Install Playwright Browsers - run: npx playwright install chromium --with-deps - - - name: Run dev server - run: yarn start --sources 'packages/esm-*-app/' --port 8180 & # Refer to O3-1994 - - - name: Run E2E tests - run: yarn playwright test - - - name: Upload Report - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 - - github-action: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Run Playwright tests with GitHub Action - run: yarn playwright test \ No newline at end of file diff --git a/.github/workflows/node.dev.js.yml b/.github/workflows/node.dev.js.yml index 8559a8f23..d04b86994 100644 --- a/.github/workflows/node.dev.js.yml +++ b/.github/workflows/node.dev.js.yml @@ -27,7 +27,7 @@ jobs: uses: actions/cache@v3 with: path: '**/node_modules' - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' @@ -50,22 +50,6 @@ jobs: path: | packages/**/dist - run_e2e_tests: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: '18' - - name: Install dependencies - run: yarn install --immutable - - name: Install Playwright Browsers - run: npx playwright install chromium --with-deps - - name: Run Playwright tests - run: yarn test-e2e - pre_release: runs-on: ubuntu-latest @@ -85,7 +69,10 @@ jobs: id: cache uses: actions/cache@v3 with: - path: '**/node_modules' + path: | + **/node_modules + **/yarn.lock + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- diff --git a/.github/workflows/node.master.js.yml b/.github/workflows/node.master.js.yml index d2a2a9181..0671686b6 100644 --- a/.github/workflows/node.master.js.yml +++ b/.github/workflows/node.master.js.yml @@ -57,7 +57,7 @@ jobs: needs: build - if: ${{ github.event_name == 'release' }} + if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' }} steps: - uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index 5f4e45d03..110fa84c7 100644 --- a/.gitignore +++ b/.gitignore @@ -77,10 +77,3 @@ build/** # vscode .vscode - -# Playwright and e2e tests -/test-results/ -/playwright-report/ -/playwright/.cache/ -e2e/storageState.json -.env \ No newline at end of file diff --git a/__mocks__/encounter-list.mock.tsx b/__mocks__/encounter-list.mock.tsx deleted file mode 100644 index b7d9a2215..000000000 --- a/__mocks__/encounter-list.mock.tsx +++ /dev/null @@ -1,1252 +0,0 @@ -import { getEncounterValues } from '@ohri/openmrs-esm-ohri-commons-lib'; - -export const mockEncounterType = '15272be5-ae9c-4278-a303-4b8907eae73b'; - -export const mockPatientUuid = '1b2278d5-c9ea-4f00-bfb1-60af48dc838a'; - -export const mockColumns = [ - { - key: 'deathDate', - header: 'Death Date', - getValue: () => '2024-01-01', - link: { - handleNavigate: (encounter) => { - encounter.launchFormActions?.viewEncounter(); - }, - }, - }, - { - key: 'deathCause', - header: 'Cause of Death', - getValue: () => '2024-01-01', - link: { - handleNavigate: (encounter) => { - encounter.launchFormActions?.viewEncounter(); - }, - }, - }, - { - key: 'specificDeathCause', - header: 'Specific cause of Death', - getValue: () => '2024-01-01', - link: { - handleNavigate: (encounter) => { - encounter.launchFormActions?.viewEncounter(); - }, - }, - }, - { - key: 'actions', - header: 'Actions', - getValue: () => '2024-01-01', - link: { - handleNavigate: (encounter) => { - encounter.launchFormActions?.viewEncounter(); - }, - }, - }, -]; - -export const mockForms = [ - { - name: 'Death Form', - uuid: 'some-uuid', - }, -]; - -export const mockEncounter = [ - { - uuid: 'ee106966-4cd9-4465-8ac2-dfac9e3751d3', - encounterDatetime: '2024-01-05T07:01:53.000+0000', - encounterType: { - uuid: '70d2b2f6-860b-438c-994b-c28e863dca34', - display: 'TB Contact Listing', - name: 'TB Contact Listing', - description: 'Use to list contact of a TB patient for testing', - retired: false, - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/encountertype/70d2b2f6-860b-438c-994b-c28e863dca34', - resourceAlias: 'encountertype', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/encountertype/70d2b2f6-860b-438c-994b-c28e863dca34?v=full', - resourceAlias: 'encountertype', - }, - ], - resourceVersion: '1.8', - }, - location: { - uuid: '44c3efb0-2583-4c80-a79e-1f756a03c0a1', - name: 'Outpatient Clinic', - }, - patient: { - uuid: '1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - display: '100002U - Clark Bob Robert', - }, - encounterProviders: [ - { - uuid: 'bc4ef577-ee0a-4288-85a7-77c753b3421e', - provider: { - uuid: 'bc450226-4138-40b7-ad88-9c98df687738', - name: 'Super User', - }, - }, - ], - obs: [ - { - uuid: '711b26c8-a91a-48e3-919c-c4888919d76d', - obsDatetime: '2024-01-05T07:01:53.000+0000', - voided: false, - groupMembers: null, - concept: { - uuid: '160753AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - name: { - uuid: 'f415bf25-2008-3ac2-8f0e-46e75648e30d', - name: 'Date of event', - }, - }, - value: '2024-01-05T00:00:00.000+0000', - }, - { - uuid: '37094756-1d74-420c-a63c-fe8418ea3b7d', - obsDatetime: '2024-02-13T13:04:39.000+0000', - voided: false, - groupMembers: [ - { - uuid: '71abc700-a69a-40c2-8a0b-90e76abe3da2', - display: 'Address (text): test', - concept: { - uuid: '162725AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Address (text)', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/162725AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - person: { - uuid: '1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - display: '100002U - Clark Bob Robert', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/patient/1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - resourceAlias: 'patient', - }, - ], - }, - obsDatetime: '2024-01-05T07:01:53.000+0000', - accessionNumber: null, - obsGroup: { - uuid: '37094756-1d74-420c-a63c-fe8418ea3b7d', - display: 'Contact details: test, 0789000000, Yes, Family member, Test', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/37094756-1d74-420c-a63c-fe8418ea3b7d', - resourceAlias: 'obs', - }, - ], - }, - valueCodedName: null, - groupMembers: null, - comment: null, - location: { - uuid: '44c3efb0-2583-4c80-a79e-1f756a03c0a1', - display: 'Outpatient Clinic', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/location/44c3efb0-2583-4c80-a79e-1f756a03c0a1', - resourceAlias: 'location', - }, - ], - }, - order: null, - encounter: { - uuid: 'ee106966-4cd9-4465-8ac2-dfac9e3751d3', - display: 'TB Contact Listing 05/01/2024', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/encounter/ee106966-4cd9-4465-8ac2-dfac9e3751d3', - resourceAlias: 'encounter', - }, - ], - }, - voided: false, - value: 'test', - valueModifier: null, - formFieldPath: 'ohri-forms-contactAddress', - formFieldNamespace: 'ohri-forms', - status: 'FINAL', - interpretation: null, - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/71abc700-a69a-40c2-8a0b-90e76abe3da2', - resourceAlias: 'obs', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/71abc700-a69a-40c2-8a0b-90e76abe3da2?v=full', - resourceAlias: 'obs', - }, - ], - resourceVersion: '2.1', - }, - { - uuid: '35293a4d-039e-4d49-b192-c0864beac1df', - display: 'Contact phone number: 0789000000', - concept: { - uuid: '159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Contact phone number', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - person: { - uuid: '1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - display: '100002U - Clark Bob Robert', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/patient/1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - resourceAlias: 'patient', - }, - ], - }, - obsDatetime: '2024-01-05T07:01:53.000+0000', - accessionNumber: null, - obsGroup: { - uuid: '37094756-1d74-420c-a63c-fe8418ea3b7d', - display: 'Contact details: test, 0789000000, Yes, Family member, Test', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/37094756-1d74-420c-a63c-fe8418ea3b7d', - resourceAlias: 'obs', - }, - ], - }, - valueCodedName: null, - groupMembers: null, - comment: null, - location: { - uuid: '44c3efb0-2583-4c80-a79e-1f756a03c0a1', - display: 'Outpatient Clinic', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/location/44c3efb0-2583-4c80-a79e-1f756a03c0a1', - resourceAlias: 'location', - }, - ], - }, - order: null, - encounter: { - uuid: 'ee106966-4cd9-4465-8ac2-dfac9e3751d3', - display: 'TB Contact Listing 05/01/2024', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/encounter/ee106966-4cd9-4465-8ac2-dfac9e3751d3', - resourceAlias: 'encounter', - }, - ], - }, - voided: false, - value: '0789000000', - valueModifier: null, - formFieldPath: 'ohri-forms-contactPhoneNumber', - formFieldNamespace: 'ohri-forms', - status: 'FINAL', - interpretation: null, - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/35293a4d-039e-4d49-b192-c0864beac1df', - resourceAlias: 'obs', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/35293a4d-039e-4d49-b192-c0864beac1df?v=full', - resourceAlias: 'obs', - }, - ], - resourceVersion: '2.1', - }, - { - uuid: 'a5cef1b1-9f44-4fa5-9cc8-07ba2e8a3fc4', - display: 'Contacts invited: Yes', - concept: { - uuid: '164072AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Contacts invited', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/164072AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - person: { - uuid: '1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - display: '100002U - Clark Bob Robert', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/patient/1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - resourceAlias: 'patient', - }, - ], - }, - obsDatetime: '2024-01-05T07:01:53.000+0000', - accessionNumber: null, - obsGroup: { - uuid: '37094756-1d74-420c-a63c-fe8418ea3b7d', - display: 'Contact details: test, 0789000000, Yes, Family member, Test', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/37094756-1d74-420c-a63c-fe8418ea3b7d', - resourceAlias: 'obs', - }, - ], - }, - valueCodedName: null, - groupMembers: null, - comment: null, - location: { - uuid: '44c3efb0-2583-4c80-a79e-1f756a03c0a1', - display: 'Outpatient Clinic', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/location/44c3efb0-2583-4c80-a79e-1f756a03c0a1', - resourceAlias: 'location', - }, - ], - }, - order: null, - encounter: { - uuid: 'ee106966-4cd9-4465-8ac2-dfac9e3751d3', - display: 'TB Contact Listing 05/01/2024', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/encounter/ee106966-4cd9-4465-8ac2-dfac9e3751d3', - resourceAlias: 'encounter', - }, - ], - }, - voided: false, - value: { - uuid: '1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Yes', - name: { - display: 'Yes', - uuid: 'd8c3337b-a1cb-3519-af40-7a016eedb72f', - name: 'Yes', - locale: 'en', - localePreferred: true, - conceptNameType: 'FULLY_SPECIFIED', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/name/d8c3337b-a1cb-3519-af40-7a016eedb72f', - resourceAlias: 'name', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/name/d8c3337b-a1cb-3519-af40-7a016eedb72f?v=full', - resourceAlias: 'name', - }, - ], - resourceVersion: '1.9', - }, - datatype: { - uuid: '8d4a4c94-c2cc-11de-8d13-0010c6dffd0f', - display: 'N/A', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/conceptdatatype/8d4a4c94-c2cc-11de-8d13-0010c6dffd0f', - resourceAlias: 'conceptdatatype', - }, - ], - }, - conceptClass: { - uuid: '8d492774-c2cc-11de-8d13-0010c6dffd0f', - display: 'Misc', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/conceptclass/8d492774-c2cc-11de-8d13-0010c6dffd0f', - resourceAlias: 'conceptclass', - }, - ], - }, - set: false, - version: null, - retired: false, - names: [ - { - uuid: 'd8c3337b-a1cb-3519-af40-7a016eedb72f', - display: 'Yes', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/name/d8c3337b-a1cb-3519-af40-7a016eedb72f', - resourceAlias: 'name', - }, - ], - }, - ], - descriptions: [ - { - uuid: '24f4ab95-c95b-42cc-8839-7014b00987ce', - display: 'Generic answer to a question.', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/description/24f4ab95-c95b-42cc-8839-7014b00987ce', - resourceAlias: 'description', - }, - ], - }, - ], - mappings: [ - { - uuid: '564715f3-ea35-4e17-b3a7-c6212db334c1', - display: 'PIH: 1065', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/mapping/564715f3-ea35-4e17-b3a7-c6212db334c1', - resourceAlias: 'mapping', - }, - ], - }, - { - uuid: 'd7e61750-ff8a-4a57-aa99-a78f0d803ce6', - display: 'CIEL: 1065', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/mapping/d7e61750-ff8a-4a57-aa99-a78f0d803ce6', - resourceAlias: 'mapping', - }, - ], - }, - { - uuid: 'a574243a-154e-40d9-825a-7c3e51c0ca6f', - display: 'SNOMED CT: 373066001', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/mapping/a574243a-154e-40d9-825a-7c3e51c0ca6f', - resourceAlias: 'mapping', - }, - ], - }, - { - uuid: '6757c68b-2aa9-4080-a4ae-40b946081177', - display: 'AMPATH: 1065', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/mapping/6757c68b-2aa9-4080-a4ae-40b946081177', - resourceAlias: 'mapping', - }, - ], - }, - ], - answers: [], - setMembers: [], - attributes: [], - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA?v=full', - resourceAlias: 'concept', - }, - ], - resourceVersion: '2.0', - }, - valueModifier: null, - formFieldPath: 'ohri-forms-contactsInvited', - formFieldNamespace: 'ohri-forms', - status: 'FINAL', - interpretation: null, - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/a5cef1b1-9f44-4fa5-9cc8-07ba2e8a3fc4', - resourceAlias: 'obs', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/a5cef1b1-9f44-4fa5-9cc8-07ba2e8a3fc4?v=full', - resourceAlias: 'obs', - }, - ], - resourceVersion: '2.1', - }, - { - uuid: 'd93d637a-f5ae-40f0-981b-7705e96ec833', - display: 'Relationship to Tuberculosis contact: Family member', - concept: { - uuid: '160239AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Relationship to Tuberculosis contact', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160239AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - person: { - uuid: '1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - display: '100002U - Clark Bob Robert', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/patient/1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - resourceAlias: 'patient', - }, - ], - }, - obsDatetime: '2024-01-05T07:01:53.000+0000', - accessionNumber: null, - obsGroup: { - uuid: '37094756-1d74-420c-a63c-fe8418ea3b7d', - display: 'Contact details: test, 0789000000, Yes, Family member, Test', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/37094756-1d74-420c-a63c-fe8418ea3b7d', - resourceAlias: 'obs', - }, - ], - }, - valueCodedName: null, - groupMembers: null, - comment: null, - location: { - uuid: '44c3efb0-2583-4c80-a79e-1f756a03c0a1', - display: 'Outpatient Clinic', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/location/44c3efb0-2583-4c80-a79e-1f756a03c0a1', - resourceAlias: 'location', - }, - ], - }, - order: null, - encounter: { - uuid: 'ee106966-4cd9-4465-8ac2-dfac9e3751d3', - display: 'TB Contact Listing 05/01/2024', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/encounter/ee106966-4cd9-4465-8ac2-dfac9e3751d3', - resourceAlias: 'encounter', - }, - ], - }, - voided: false, - value: { - uuid: '1560AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Family member', - name: { - display: 'Family member', - uuid: '634a1aa6-73dc-3ab7-a067-293ff62ca1e7', - name: 'Family member', - locale: 'en', - localePreferred: true, - conceptNameType: 'FULLY_SPECIFIED', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1560AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/name/634a1aa6-73dc-3ab7-a067-293ff62ca1e7', - resourceAlias: 'name', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1560AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/name/634a1aa6-73dc-3ab7-a067-293ff62ca1e7?v=full', - resourceAlias: 'name', - }, - ], - resourceVersion: '1.9', - }, - datatype: { - uuid: '8d4a48b6-c2cc-11de-8d13-0010c6dffd0f', - display: 'Coded', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/conceptdatatype/8d4a48b6-c2cc-11de-8d13-0010c6dffd0f', - resourceAlias: 'conceptdatatype', - }, - ], - }, - conceptClass: { - uuid: '8d491e50-c2cc-11de-8d13-0010c6dffd0f', - display: 'Question', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/conceptclass/8d491e50-c2cc-11de-8d13-0010c6dffd0f', - resourceAlias: 'conceptclass', - }, - ], - }, - set: false, - version: null, - retired: false, - names: [ - { - uuid: '634a1aa6-73dc-3ab7-a067-293ff62ca1e7', - display: 'Family member', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1560AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/name/634a1aa6-73dc-3ab7-a067-293ff62ca1e7', - resourceAlias: 'name', - }, - ], - }, - ], - descriptions: [], - mappings: [ - { - uuid: '20f1cf1f-c948-4fd7-8123-bebe110beb9a', - display: 'CIEL: 1560', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1560AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/mapping/20f1cf1f-c948-4fd7-8123-bebe110beb9a', - resourceAlias: 'mapping', - }, - ], - }, - { - uuid: '58c0fe00-b0e8-4bea-8ed0-86bab365642f', - display: 'PIH: 6441', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1560AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/mapping/58c0fe00-b0e8-4bea-8ed0-86bab365642f', - resourceAlias: 'mapping', - }, - ], - }, - { - uuid: 'fbd918f2-3e31-45ee-8de2-30663bb545b4', - display: 'SNOMED CT: 303071001', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1560AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/mapping/fbd918f2-3e31-45ee-8de2-30663bb545b4', - resourceAlias: 'mapping', - }, - ], - }, - ], - answers: [ - { - uuid: '975AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Aunt', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/975AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160729AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Brother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160729AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '1528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Child', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160728AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Daughter', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160728AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '971AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Father', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/971AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160273AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Grandfather', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160273AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '159772AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Grandmother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/159772AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '973AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Grandparent', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/973AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Maternal grandfather', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160723AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Maternal grandmother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160723AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '970AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Mother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/970AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '5620AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Other family member', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/5620AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '1527AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Parent', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1527AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '5617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Partner or spouse', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/5617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160725AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Paternal grandfather', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160725AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160726AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Paternal grandmother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160726AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '972AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Sibling', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/972AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Sister', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Son', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '974AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Uncle', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/974AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '970AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Mother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/970AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '971AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Father', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/971AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '159772AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Grandmother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/159772AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160273AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Grandfather', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160273AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '972AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Sibling', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/972AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '1528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Child', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '975AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Aunt', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/975AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '974AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Uncle', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/974AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '5620AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Other family member', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/5620AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160726AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Paternal grandmother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160726AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160723AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Maternal grandmother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160723AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160725AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Paternal grandfather', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160725AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Maternal grandfather', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Son', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160728AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Daughter', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160728AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160729AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Brother', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160729AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '160730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Sister', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/160730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '5617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Partner or spouse', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/5617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '973AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Grandparent', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/973AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - { - uuid: '1527AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Parent', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1527AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - ], - setMembers: [], - attributes: [], - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1560AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/1560AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA?v=full', - resourceAlias: 'concept', - }, - ], - resourceVersion: '2.0', - }, - valueModifier: null, - formFieldPath: 'ohri-forms-tbRelationship', - formFieldNamespace: 'ohri-forms', - status: 'FINAL', - interpretation: null, - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/d93d637a-f5ae-40f0-981b-7705e96ec833', - resourceAlias: 'obs', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/d93d637a-f5ae-40f0-981b-7705e96ec833?v=full', - resourceAlias: 'obs', - }, - ], - resourceVersion: '2.1', - }, - { - uuid: 'a8f75b70-2102-4d91-b946-d075477e153e', - display: 'Name of contact person: Test', - concept: { - uuid: '163258AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - display: 'Name of contact person', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/concept/163258AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - resourceAlias: 'concept', - }, - ], - }, - person: { - uuid: '1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - display: '100002U - Clark Bob Robert', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/patient/1b2278d5-c9ea-4f00-bfb1-60af48dc838a', - resourceAlias: 'patient', - }, - ], - }, - obsDatetime: '2024-01-05T07:01:53.000+0000', - accessionNumber: null, - obsGroup: { - uuid: '37094756-1d74-420c-a63c-fe8418ea3b7d', - display: 'Contact details: test, 0789000000, Yes, Family member, Test', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/37094756-1d74-420c-a63c-fe8418ea3b7d', - resourceAlias: 'obs', - }, - ], - }, - valueCodedName: null, - groupMembers: null, - comment: null, - location: { - uuid: '44c3efb0-2583-4c80-a79e-1f756a03c0a1', - display: 'Outpatient Clinic', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/location/44c3efb0-2583-4c80-a79e-1f756a03c0a1', - resourceAlias: 'location', - }, - ], - }, - order: null, - encounter: { - uuid: 'ee106966-4cd9-4465-8ac2-dfac9e3751d3', - display: 'TB Contact Listing 05/01/2024', - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/encounter/ee106966-4cd9-4465-8ac2-dfac9e3751d3', - resourceAlias: 'encounter', - }, - ], - }, - voided: false, - value: 'Test', - valueModifier: null, - formFieldPath: 'ohri-forms-nameofContactPerson', - formFieldNamespace: 'ohri-forms', - status: 'FINAL', - interpretation: null, - links: [ - { - rel: 'self', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/a8f75b70-2102-4d91-b946-d075477e153e', - resourceAlias: 'obs', - }, - { - rel: 'full', - uri: 'https://ohri-dev.globalhealthapp.net/openmrs/ws/rest/v1/obs/a8f75b70-2102-4d91-b946-d075477e153e?v=full', - resourceAlias: 'obs', - }, - ], - resourceVersion: '2.1', - }, - ], - concept: { - uuid: '164351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - name: { - uuid: 'd878b58c-51e1-3987-a3d7-96d7af4fba58', - name: 'Contact details', - }, - }, - value: null, - }, - ], - form: { - uuid: 'cb16d920-62f1-3696-b781-e6a4f5e80de1', - name: 'TB Contact Listing', - }, - launchFormActions: {}, - }, -]; diff --git a/e2e/README.md b/e2e/README.md deleted file mode 100644 index 32a0d90c3..000000000 --- a/e2e/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# E2E Tests - -This directory contains an E2E test suite using the [Playwright](https://playwright.dev) -framework. - -## Getting Started - -Please ensure that you have followed the basic installation guide in the [root README](../README.md). Once everything is set up, make sure the dev server is running by using: - -```sh -yarn start -``` - -Then, in a separate terminal, run: - -```sh -yarn test-e2e --headed -``` - -By default, the test suite will run against the http://localhost:8080. You can override this by exporting `E2E_BASE_URL` environment variables beforehand: - -```sh -# Ex: Set the server URL to dev3: -export E2E_BASE_URL=https://dev3.openmrs.org/openmrs - -# Run all e2e tests: - -```sh -yarn test-e2e --headed -``` - -To run a specific test by title: - -```sh -yarn test-e2e --headed -g "title of the test" -``` - -Check [this documentation](https://playwright.dev/docs/running-tests#command-line) for more running options. - -It is also highly recommended to install the companion VS Code extension: -https://playwright.dev/docs/getting-started-vscode - -## Writing New Tests - -In general, it is recommended to read through the official [Playwright docs](https://playwright.dev/docs/intro) -before writing new test cases. The project uses the official Playwright test runner and, -generally, follows a very simple project structure: - -``` -e2e -|__ commands -| ^ Contains "commands" (simple reusable functions) that can be used in test cases/specs, -| e.g. generate a random patient. -|__ core -| ^ Contains code related to the test runner itself, e.g. setting up the custom fixtures. -| You probably need to touch this infrequently. -|__ fixtures -| ^ Contains fixtures (https://playwright.dev/docs/test-fixtures) which are used -| to run reusable setup/teardown tasks -|__ pages -| ^ Contains page object model classes for interacting with the frontend. -| See https://playwright.dev/docs/test-pom for details. -|__ specs -| ^ Contains the actual test cases/specs. New tests should be placed in this folder. -|__ support - ^ Contains support files that requires to run e2e tests, e.g. docker compose files. -``` - -When you want to write a new test case, start by creating a new spec in `./specs`. -Depending on what you want to achieve, you might want to create new fixtures and/or -page object models. To see examples, have a look at the existing code to see how these -different concepts play together. - -## Open reports from GitHub Actions / Bamboo - -To download the report from the GitHub action/Bamboo plan, follow these steps: - -1. Go to the artifact section of the action/plan and locate the report file. -2. Download the report file and unzip it using a tool of your choice. -3. Open the index.html file in a web browser to view the report. - -The report will show you a full summary of your tests, including information on which -tests passed, failed, were skipped, or were flaky. You can filter the report by browser -and explore the details of individual tests, including any errors or failures, video -recordings, and the steps involved in each test. Simply click on a test to view its details. - -## Debugging Tests - -Refer to [this documentation](https://playwright.dev/docs/debug) on how to debug a test. - -## Configuration - -This is very much underdeveloped/WIP. At the moment, there exists a (git-shared) `.env` -file which can be used for configuring certain test attributes. This is most likely -about to change in the future. Stay tuned for updates! - -## Github Actions integration - -The e2e.yml workflow is made up of two jobs: one for running on pull requests (PRs) and -one for running on commits. - -1. When running on PRs, the workflow will start the dev server, use dev3.openmrs.org as the backend, -and run tests only on chromium. This is done in order to quickly provide feedback to the developer. -The tests are designed to generate their own data and clean up after themselves once they are finished. -This ensures that the tests will have minimum effect from changes made to dev3 by other developers. -In the future, we plan to use a docker container to run the tests in an isolated environment once we -figure out a way to spin up the container within a small amount of time. -2. When running on commits, the workflow will spin up a docker container and run the dev server against -it in order to provide a known and isolated environment. In addition, tests will be run on multiple -browsers (chromium, firefox, and WebKit) to ensure compatibility. - -## Troubleshooting tips - -On MacOS, you might run into the following error: -```browserType.launch: Executable doesn't exist at /Users//Library/Caches/ms-playwright/chromium-1015/chrome-mac/Chromium.app/Contents/MacOS/Chromium``` -In order to fix this, you can attempt to force the browser reinstallation by running: -```PLAYWRIGHT_BROWSERS_PATH=/Users/$USER/Library/Caches/ms-playwright npx playwright install``` diff --git a/e2e/commands/index.ts b/e2e/commands/index.ts deleted file mode 100644 index a3640e32c..000000000 --- a/e2e/commands/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './patient-operations'; -export * from './visit-operations'; diff --git a/e2e/commands/patient-operations.ts b/e2e/commands/patient-operations.ts deleted file mode 100644 index f04171b57..000000000 --- a/e2e/commands/patient-operations.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { APIRequestContext, expect } from '@playwright/test'; - -export interface Patient { - uuid: string; - identifiers: Identifier[]; - display: string; - person: { - uuid: string; - display: string; - gender: string; - age: number; - birthdate: string; - birthdateEstimated: boolean; - dead: boolean; - deathDate?: string; - causeOfDeath?: string; - preferredAddress: { - address1: string; - cityVillage: string; - country: string; - postalCode: string; - stateProvince: string; - countyDistrict: string; - }; - attributes: Array>; - voided: boolean; - birthtime?: string; - deathdateEstimated: boolean; - resourceVersion: string; - }; - attributes: { value: string; attributeType: { uuid: string; display: string } }[]; - voided: boolean; -} - -export interface Address { - preferred: boolean; - address1: string; - cityVillage: string; - country: string; - postalCode: string; - stateProvince: string; -} - -export interface Identifier { - uuid: string; - display: string; -} - -export const generateRandomPatient = async (api: APIRequestContext): Promise => { - const identifierRes = await api.post('idgen/identifiersource/8549f706-7e85-4c1d-9424-217d50a2988b/identifier', { - data: {}, - }); - await expect(identifierRes.ok()).toBeTruthy(); - const { identifier } = await identifierRes.json(); - - const patientRes = await api.post('patient', { - // TODO: This is not configurable right now. It probably should be. - data: { - identifiers: [ - { - identifier, - identifierType: '05a29f94-c0ed-11e2-94be-8c13b969e334', - location: '44c3efb0-2583-4c80-a79e-1f756a03c0a1', - preferred: true, - }, - ], - person: { - addresses: [ - { - address1: 'Bom Jesus Street', - address2: '', - cityVillage: 'Recife', - country: 'Brazil', - postalCode: '50030-310', - stateProvince: 'Pernambuco', - }, - ], - attributes: [], - birthdate: '2020-2-1', - birthdateEstimated: true, - dead: false, - gender: 'M', - names: [ - { - familyName: `Smith${Math.floor(Math.random() * 10000)}`, - givenName: `John${Math.floor(Math.random() * 10000)}`, - middleName: '', - preferred: true, - }, - ], - }, - }, - }); - await expect(patientRes.ok()).toBeTruthy(); - return await patientRes.json(); -}; - -export const getPatient = async (api: APIRequestContext, uuid: string): Promise => { - const patientRes = await api.get(`patient/${uuid}?v=full`); - return await patientRes.json(); -}; - -export const deletePatient = async (api: APIRequestContext, uuid: string) => { - await api.delete(`patient/${uuid}`, { data: {} }); -}; diff --git a/e2e/commands/visit-operations.ts b/e2e/commands/visit-operations.ts deleted file mode 100644 index 5aff42094..000000000 --- a/e2e/commands/visit-operations.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { APIRequestContext, expect } from '@playwright/test'; -import { Visit } from '@openmrs/esm-framework'; -import dayjs from 'dayjs'; - -export const startVisit = async (api: APIRequestContext, patientId: string): Promise => { - const visitRes = await api.post('visit', { - data: { - startDatetime: dayjs().subtract(1, 'D').format('YYYY-MM-DDTHH:mm:ss.SSSZZ'), - patient: patientId, - location: process.env.E2E_LOGIN_DEFAULT_LOCATION_UUID, - visitType: '7b0f5697-27e3-40c4-8bae-f4049abfb4ed', - attributes: [], - }, - }); - - await expect(visitRes.ok()).toBeTruthy(); - return await visitRes.json(); -}; - -export const endVisit = async (api: APIRequestContext, uuid: string) => { - const visitRes = await api.post(`visit/${uuid}`, { - data: { - location: process.env.E2E_LOGIN_DEFAULT_LOCATION_UUID, - startDatetime: dayjs().subtract(1, 'D').format('YYYY-MM-DDTHH:mm:ss.SSSZZ'), - visitType: '7b0f5697-27e3-40c4-8bae-f4049abfb4ed', - stopDatetime: dayjs().format('YYYY-MM-DDTHH:mm:ss.SSSZZ'), - }, - }); - - return await visitRes.json(); -}; diff --git a/e2e/core/global-setup.ts b/e2e/core/global-setup.ts deleted file mode 100644 index 8d8bae0af..000000000 --- a/e2e/core/global-setup.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { request } from '@playwright/test'; -import * as dotenv from 'dotenv'; - -dotenv.config(); - -/** - * This configuration is to reuse the signed-in state in the tests - * by log in only once using the API and then skip the log in step for all the tests. - * - * https://playwright.dev/docs/auth#reuse-signed-in-state - */ - -async function globalSetup() { - const requestContext = await request.newContext(); - const token = Buffer.from(`${process.env.E2E_USER_ADMIN_USERNAME}:${process.env.E2E_USER_ADMIN_PASSWORD}`).toString( - 'base64', - ); - await requestContext.post(`${process.env.E2E_BASE_URL}/ws/rest/v1/session`, { - data: { - sessionLocation: process.env.E2E_LOGIN_DEFAULT_LOCATION_UUID, - locale: 'en', - }, - headers: { - Accept: 'application/json', - Authorization: `Basic ${token}`, - }, - }); - await requestContext.storageState({ path: 'e2e/storageState.json' }); - await requestContext.dispose(); -} - -export default globalSetup; \ No newline at end of file diff --git a/e2e/core/index.ts b/e2e/core/index.ts deleted file mode 100644 index 607718c2a..000000000 --- a/e2e/core/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './test'; diff --git a/e2e/core/test.ts b/e2e/core/test.ts deleted file mode 100644 index dd3e40bb4..000000000 --- a/e2e/core/test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { APIRequestContext, Page, test as base } from '@playwright/test'; -import { api } from '../fixtures'; - -// This file sets up our custom test harness using the custom fixtures. -// See https://playwright.dev/docs/test-fixtures#creating-a-fixture for details. -// If a spec intends to use one of the custom fixtures, the special `test` function -// exported from this file must be used instead of the default `test` function -// provided by playwright. - -export interface CustomTestFixtures { - loginAsAdmin: Page; -} - -export interface CustomWorkerFixtures { - api: APIRequestContext; -} - -export const test = base.extend({ - api: [api, { scope: 'worker' }], -}); diff --git a/e2e/fixtures/api.ts b/e2e/fixtures/api.ts deleted file mode 100644 index 6afd8d59e..000000000 --- a/e2e/fixtures/api.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { APIRequestContext, PlaywrightWorkerArgs, WorkerFixture } from '@playwright/test'; - -/** - * A fixture which initializes an [`APIRequestContext`](https://playwright.dev/docs/api/class-apirequestcontext) - * that is bound to the configured OpenMRS API server. The context is automatically authenticated - * using the configured admin account. - * - * Use the request context like this: - * ```ts - * test('your test', async ({ api }) => { - * const res = await api.get('patient/1234'); - * await expect(res.ok()).toBeTruthy(); - * }); - * ``` - */ -export const api: WorkerFixture = async ({ playwright }, use) => { - const ctx = await playwright.request.newContext({ - baseURL: `${process.env.E2E_BASE_URL}/ws/rest/v1/`, - httpCredentials: { - username: process.env.E2E_USER_ADMIN_USERNAME, - password: process.env.E2E_USER_ADMIN_PASSWORD, - }, - }); - - await use(ctx); -}; diff --git a/e2e/fixtures/index.ts b/e2e/fixtures/index.ts deleted file mode 100644 index b1c13e734..000000000 --- a/e2e/fixtures/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './api'; diff --git a/e2e/pages/chart-page.ts b/e2e/pages/chart-page.ts deleted file mode 100644 index cd5191a41..000000000 --- a/e2e/pages/chart-page.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { type Page } from '@playwright/test'; - -export class ChartPage { - constructor(readonly page: Page) {} - - readonly formsTable = () => this.page.getByRole('table', { name: /forms/i }); - - async goTo(patientUuid: string) { - await this.page.goto('/openmrs/spa/patient/' + patientUuid + '/chart'); - } -} diff --git a/e2e/pages/home-page.ts b/e2e/pages/home-page.ts deleted file mode 100644 index c38ae88f2..000000000 --- a/e2e/pages/home-page.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Page } from '@playwright/test'; - -export class HomePage { - constructor(readonly page: Page) {} - - async gotoHome() { - await this.page.goto('/openmrs/spa/home'); - - } -} - diff --git a/e2e/pages/index.ts b/e2e/pages/index.ts deleted file mode 100644 index d591c5ed3..000000000 --- a/e2e/pages/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './home-page'; -export * from './chart-page'; -export * from './visits-page'; diff --git a/e2e/pages/visits-page.ts b/e2e/pages/visits-page.ts deleted file mode 100644 index 91b36bf65..000000000 --- a/e2e/pages/visits-page.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { type Page } from '@playwright/test'; - -export class VisitsPage { - constructor(readonly page: Page) {} - - async goTo(patientUuid: string) { - await this.page.goto(`patient/${patientUuid}/chart/Visits`); - } -} diff --git a/e2e/specs/registration-test.spec.ts b/e2e/specs/registration-test.spec.ts deleted file mode 100644 index 4834fb5da..000000000 --- a/e2e/specs/registration-test.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test } from '../core'; -import { expect } from '@playwright/test'; -import { HomePage, ChartPage } from '../pages'; -import { type Patient, generateRandomPatient, startVisit } from '../commands'; -import { Visit } from '@openmrs/esm-framework'; - -let patient: Patient; -let visit: Visit; - -test.beforeEach(async ({ api }) => { - patient = await generateRandomPatient(api); - visit = await startVisit(api, patient.uuid); -}); - -test('Go to homepage and register patient', async ({ page }) => { - const homePage = new HomePage(page); - - await test.step('When I visit the home page', async () => { - await homePage.gotoHome(); - }); - - await test.step('Then should be at the home page', async () => { - await expect(page).toHaveURL(`${process.env.E2E_BASE_URL}/spa/home`); - }); - - await page.getByLabel('Add Patient').click(); - await page.getByLabel('First Name').click(); - await page.getByLabel('First Name').fill('daisy'); - await page.getByLabel('Family Name').click(); - await page.getByLabel('Family Name').fill('daisy'); - await page.getByText('Female').click(); - await page.getByRole('tab', { name: 'No' }).nth(1).click(); - await page.getByLabel('Estimated age in years').click(); - await page.getByLabel('Estimated age in years').fill('20'); - - // Click on register patient button - - await page.getByRole('button', { name: 'Register Patient' }).click(); - -}); diff --git a/frontend/spa-build-config.json b/frontend/spa-build-config.json index b0855ea8d..52b5d9405 100644 --- a/frontend/spa-build-config.json +++ b/frontend/spa-build-config.json @@ -1,47 +1,48 @@ { "frontendModules": { - "@openmrs/esm-devtools-app": "next", + "@ohri/openmrs-esm-ohri-core-app": "next", + "@ohri/openmrs-esm-ohri-form-render-app": "next", + "@ohri/openmrs-esm-ohri-hiv-app": "next", + "@ohri/openmrs-esm-ohri-covid-app": "next", + "@ohri/openmrs-esm-ohri-pmtct": "next", + "@ohri/openmrs-esm-ohri-tb-app": "next", + "@ohri/openmrs-esm-ohri-cervical-cancer-app": "next", + "@openmrs/esm-appointments-app": "next", + "@openmrs/esm-dispensing-app": "next", + "@openmrs/esm-form-builder-app": "next", + "@openmrs/esm-home-app": "next", "@openmrs/esm-implementer-tools-app": "next", "@openmrs/esm-login-app": "next", - "@openmrs/esm-primary-navigation-app": "next", - "@openmrs/esm-home-app": "next", - "@openmrs/esm-form-engine-app": "next", - "@openmrs/esm-generic-patient-widgets-app": "next", + "@openmrs/esm-outpatient-app": "next", "@openmrs/esm-patient-allergies-app": "next", + "@openmrs/esm-patient-appointments-app": "next", "@openmrs/esm-patient-attachments-app": "next", "@openmrs/esm-patient-banner-app": "next", - "@ohri/esm-patient-chart-app": "next", + "@openmrs/esm-patient-chart-app": "next", "@openmrs/esm-patient-conditions-app": "next", "@openmrs/esm-patient-forms-app": "next", - "@openmrs/esm-patient-flags-app": "next", - "@openmrs/esm-patient-labs-app": "next", - "@openmrs/esm-patient-lists-app": "next", + "@openmrs/esm-patient-immunizations-app": "next", + "@openmrs/esm-patient-list-app": "next", "@openmrs/esm-patient-medications-app": "next", "@openmrs/esm-patient-notes-app": "next", - "@openmrs/esm-patient-orders-app": "next", "@openmrs/esm-patient-programs-app": "next", + "@openmrs/esm-patient-search-app": "next", + "@openmrs/esm-patient-test-results-app": "next", "@openmrs/esm-patient-vitals-app": "next", - "@openmrs/esm-active-visits-app": "next", - "@openmrs/esm-appointments-app": "next", - "@openmrs/esm-service-queues-app": "next", - "@openmrs/esm-patient-list-management-app": "next", + "@openmrs/esm-primary-navigation-app": "next", "@openmrs/esm-patient-registration-app": "next", - "@openmrs/esm-patient-search-app": "next", + "@openmrs/esm-devtools-app": "next", "@openmrs/esm-openconceptlab-app": "next", - "@openmrs/esm-system-admin-app": "next", - "@openmrs/esm-dispensing-app": "next", - "@openmrs/esm-fast-data-entry-app": "next", + "@openmrs/esm-generic-patient-widgets-app": "next", + "@openmrs/esm-patient-lists-app": "next", "@openmrs/esm-cohort-builder-app": "next", - "@ohri/openmrs-esm-ohri-core-app": "next", - "@ohri/openmrs-esm-ohri-hiv-app": "next", - "@ohri/openmrs-esm-ohri-covid-app": "next", - "@ohri/openmrs-esm-ohri-pmtct": "next", - "@ohri/openmrs-esm-ohri-tb-app": "next", - "@ohri/openmrs-esm-ohri-cervical-cancer-app": "next", - "@ohri/openmrs-esm-ohri-form-render-app": "next", - "@openmrs/esm-stock-management-app": "next", - "@openmrs/esm-billing-app": "next", - "@ohri/openmrs-esm-ohri-opd-app": "next" + "@openmrs/esm-patient-list-management-app": "next", + "@openmrs/esm-service-queues-app": "next", + "@openmrs/esm-form-entry-app": "next", + "@openmrs/esm-patient-labs-app": "next", + "@openmrs/esm-fast-data-entry-app": "next", + "@openmrs/esm-patient-orders-app": "next", + "@openmrs/esm-system-admin-app": "next" }, "spaPath": "$SPA_PATH", "apiUrl": "$API_URL", diff --git a/jest.config.js b/jest.config.js index 82b65f646..d87388e8c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -35,10 +35,6 @@ const config = { '^react-i18next$': path.resolve(__dirname, '__mocks__', 'react-i18next.js'), }, testEnvironment: 'jsdom', - testPathIgnorePatterns: [ - "/node_modules/", - "/e2e/" // Ignore the e2e directory containing Playwright tests - ] }; module.exports = config; diff --git a/package.json b/package.json index f375ef569..9f3a39da4 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "start:pmtct": "openmrs develop --backend https://ohri-namibia-dev.globalhealthapp.net --sources 'packages/esm-ohri-pmtct-app/'", "start:form-render": "openmrs develop --backend https://ohri-dev.globalhealthapp.net --sources packages/esm-form-render-app", "start:tb": "openmrs develop --backend https://ohri-dev.globalhealthapp.net --sources packages/esm-tb-app", - "start:opd": "openmrs develop --backend https://ohri-dev.globalhealthapp.net --sources packages/esm-opd-app", "prettier": "prettier --fix --config prettier.config.js --write \"packages/**/*.{ts,tsx}\"", "prepare": "husky install", "test": "jest --config jest.config.js --verbose false --passWithNoTests", @@ -33,13 +32,11 @@ "coverage": "yarn test --coverage", "badges": "yarn coverage && yarn jest-coverage-badges --output './badges' ", "extract-translations": "turbo extract-translations -- --config ../../tools/i18next-parser.config.js", - "ci:bump-form-engine-lib": "yarn up @openmrs/openmrs-form-engine-lib@next", - "test-e2e": "playwright test" + "ci:bump-form-engine-lib": "yarn up @openmrs/openmrs-form-engine-lib@next" }, "devDependencies": { "@openmrs/esm-framework": "next", "@openmrs/esm-patient-common-lib": "next", - "@playwright/test": "^1.30.0", "@swc/cli": "^0.1.57", "@swc/core": "^1.2.189", "@swc/jest": "^0.2.29", @@ -63,7 +60,6 @@ "cross-env": "^7.0.3", "css-loader": "^6.8.1", "dayjs": "^1.11.10", - "dotenv": "^16.0.3", "eslint": "^8.55.0", "eslint-config-prettier": "^9.1.0", "eslint-config-ts-react-important-stuff": "^3.0.0", diff --git a/packages/esm-cervical-cancer-app/src/config-schema.ts b/packages/esm-cervical-cancer-app/src/config-schema.ts index 8160ac0a7..c4a3612b7 100644 --- a/packages/esm-cervical-cancer-app/src/config-schema.ts +++ b/packages/esm-cervical-cancer-app/src/config-schema.ts @@ -33,14 +33,6 @@ export const configSchema = { cervicalCancerRegistrationForm: 'Cervical Cancer Registration Form', }, }, - formUuids: { - _type: Type.Object, - _description: 'List of uuids of forms related to Cacx.', - _default: { - screeningAndCancerTreatmentFormUuid: '9e3ec2a7-ad26-3f43-9677-82e318996eec', - cervicalCancerRegistrationFormUuid: '12f41bfe-6430-3d8c-9edf-2d1b7c904f0f', - }, - }, }; export interface ConfigObject { @@ -48,5 +40,4 @@ export interface ConfigObject { encounterTypes: Object; obsConcepts: Object; formNames: Object; - formUuids: Object; } diff --git a/packages/esm-cervical-cancer-app/src/views/cacx-visits/tabs/cacx-registration.component.tsx b/packages/esm-cervical-cancer-app/src/views/cacx-visits/tabs/cacx-registration.component.tsx index db64f392c..a471915c0 100644 --- a/packages/esm-cervical-cancer-app/src/views/cacx-visits/tabs/cacx-registration.component.tsx +++ b/packages/esm-cervical-cancer-app/src/views/cacx-visits/tabs/cacx-registration.component.tsx @@ -20,8 +20,6 @@ export const CacxRegistration: React.FC = ({ patientUuid const { cervicalCancerRegistrationForm } = config.formNames; - const { cervicalCancerRegistrationFormUuid } = config.formUuids; - const columnsLab: EncounterListColumn[] = useMemo( () => [ { @@ -79,7 +77,7 @@ export const CacxRegistration: React.FC = ({ patientUuid = ({ patientUuid }) => const { screeningAndCancerTreatmentForm } = config.formNames; - const { screeningAndCancerTreatmentFormUuid } = config.formUuids; - const columnsLab: EncounterListColumn[] = useMemo( () => [ { @@ -102,7 +100,7 @@ export const CacxTreatment: React.FC = ({ patientUuid }) => ; associatedEncounterType?: string; viewPatientProgramSummary?: boolean; - viewTptPatientProgramSummary?: boolean; addPatientToListOptions?: { isEnabled: boolean; excludeCohorts?: Array }; launchableForm?: { name: string; @@ -55,7 +54,6 @@ export const CohortPatientList: React.FC = ({ extraAssociatedEncounterTypes, moduleName, viewPatientProgramSummary, - viewTptPatientProgramSummary, }) => { const [isLoading, setIsLoading] = useState(true); const [hasLoadedPatients, setHasLoadedPatients] = useState(false); @@ -149,7 +147,6 @@ export const CohortPatientList: React.FC = ({ ...addPatientToListOptions, displayText: t('moveToListSideNav', 'Move to list'), }, - viewTptPatientProgramSummary, viewPatientProgramSummary, }), }; diff --git a/packages/esm-commons-lib/src/components/cohort-patient-list/helpers.tsx b/packages/esm-commons-lib/src/components/cohort-patient-list/helpers.tsx index 4d30c467e..5119f74df 100644 --- a/packages/esm-commons-lib/src/components/cohort-patient-list/helpers.tsx +++ b/packages/esm-commons-lib/src/components/cohort-patient-list/helpers.tsx @@ -18,7 +18,6 @@ interface PatientMetaConfig { moduleName: string; addPatientToListOptions: { isEnabled: boolean; excludeCohorts?: Array; displayText: string }; viewPatientProgramSummary?: boolean; - viewTptPatientProgramSummary?: boolean; } export interface PatientListColumn { @@ -113,44 +112,7 @@ export const ViewSummaryMenuItem = ({ patientUuid, ViewSummary, encounterType }) ); }; -export const ViewTptSummaryMenuItem = ({ patientUuid, ViewTptSummary, encounterType }) => { - const [actionText, setActionText] = useState(ViewTptSummary.actionText); - const [encounterUuid, setEncounterUuid] = useState(null); - const [isLoading, setIsLoading] = useState(false); - const viewTptSummaryActionText = ViewTptSummary.actionText || 'View Summary '; - useEffect(() => { - if (ViewTptSummary.editLatestEncounter && encounterType && !encounterUuid) { - setIsLoading(true); - fetchPatientLastEncounter(patientUuid, encounterType).then((latestEncounter) => { - if (latestEncounter) { - setActionText(viewTptSummaryActionText); - setEncounterUuid(latestEncounter.uuid); - } - setIsLoading(false); - }); - } else { - setIsLoading(false); - } - }, []); - - return ( - <> - {isLoading ? ( - - ) : ( - { - navigate({ - to: `/openmrs/spa/patient/${patientUuid}/chart/tpt-patient-summary`, - }); - }} - /> - )} - - ); -}; export function consolidatatePatientMeta(rawPatientMeta, form, config: PatientMetaConfig) { const { isDynamicCohort, @@ -160,7 +122,6 @@ export function consolidatatePatientMeta(rawPatientMeta, form, config: PatientMe moduleName, addPatientToListOptions, viewPatientProgramSummary, - viewTptPatientProgramSummary, } = config; const patientUuid = !isDynamicCohort ? rawPatientMeta.patient.uuid : rawPatientMeta.person.uuid; dayjs.extend(localizedFormat); @@ -194,16 +155,6 @@ export function consolidatatePatientMeta(rawPatientMeta, form, config: PatientMe excludeCohorts={addPatientToListOptions?.excludeCohorts || []} /> )} - {viewTptPatientProgramSummary ? ( - - ) : ( - <> - )} {viewPatientProgramSummary ? ( = ({ tableHeaders, tableRows }) => { + return ( diff --git a/packages/esm-commons-lib/src/components/encounter-list/encounter-list.component.tsx b/packages/esm-commons-lib/src/components/encounter-list/encounter-list.component.tsx index a849aa717..ab3050434 100644 --- a/packages/esm-commons-lib/src/components/encounter-list/encounter-list.component.tsx +++ b/packages/esm-commons-lib/src/components/encounter-list/encounter-list.component.tsx @@ -1,19 +1,18 @@ -import { navigate, showModal, showSnackbar } from '@openmrs/esm-framework'; +import { navigate } from '@openmrs/esm-framework'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { EmptyState } from '../empty-state/empty-state.component'; -import { FormLauncherWithIntent } from '../ohri-form-launcher/ohri-form-launcher.component'; +import { OHRIFormLauncherWithIntent } from '../ohri-form-launcher/ohri-form-launcher.component'; import styles from './encounter-list.scss'; import { OTable } from '../data-table/o-table.component'; import { Button, Link, OverflowMenu, OverflowMenuItem, Pagination, DataTableSkeleton } from '@carbon/react'; import { Add } from '@carbon/react/icons'; -import { FormSchema } from '@openmrs/openmrs-form-engine-lib'; -import { deleteEncounter, launchEncounterForm } from './helpers'; +import { OHRIFormSchema } from '@openmrs/openmrs-form-engine-lib'; +import { launchEncounterForm } from './helpers'; import { useEncounterRows } from '../../hooks/useEncounterRows'; import { OpenmrsEncounter } from '../../api/types'; import { useFormsJson } from '../../hooks/useFormsJson'; import { usePatientDeathStatus } from '../../hooks/usePatientDeathStatus'; -import { mutate } from 'swr'; export interface EncounterListColumn { key: string; @@ -30,7 +29,6 @@ export interface EncounterListProps { description: string; formList?: Array<{ name: string; - uuid?: string; excludedIntents?: Array; fixedIntent?: string; isDefault?: boolean; @@ -56,14 +54,18 @@ export const EncounterList: React.FC = ({ }) => { const { t } = useTranslation(); const [paginatedRows, setPaginatedRows] = useState([]); - const [forms, setForms] = useState([]); + const [forms, setForms] = useState([]); const [currentPage, setCurrentPage] = useState(1); const [pageSize, setPageSize] = useState(10); const [isLoadingForms, setIsLoadingForms] = useState(true); const { isDead } = usePatientDeathStatus(patientUuid); const formNames = useMemo(() => formList.map((form) => form.name), []); const { formsJson, isLoading: isLoadingFormsJson } = useFormsJson(formNames); - const { encounters, isLoading, onFormSave } = useEncounterRows(patientUuid, encounterType, filter); + const { + encounters, + isLoading: isLoadingEncounters, + onFormSave, + } = useEncounterRows(patientUuid, encounterType, filter); const { moduleName, workspaceWindowSize, displayText, hideFormLauncher } = launchOptions; const defaultActions = useMemo( @@ -81,55 +83,13 @@ export const EncounterList: React.FC = ({ form: { name: forms[0]?.name, }, - mode: 'edit', - intent: '*', - }, - { - label: t('deleteEncounter', 'Delete'), - form: { - name: forms[0]?.name, - }, - mode: 'delete', + mode: 'view', intent: '*', }, ], [forms, t], ); - const handleDeleteEncounter = useCallback((encounterUuid, encounterTypeName) => { - const close = showModal('delete-encounter-modal', { - close: () => close(), - encounterTypeName: encounterTypeName || '', - onConfirmation: () => { - const abortController = new AbortController(); - deleteEncounter(encounterUuid, abortController) - .then(() => { - mutate( - (key) => - typeof key === "string" && key.startsWith("/ws/rest/v1/encounter"), - undefined, - { revalidate: true } - ); - showSnackbar({ - isLowContrast: true, - title: t('encounterDeleted', 'Encounter deleted'), - subtitle: `Encounter ${t('successfullyDeleted', 'successfully deleted')}`, - kind: 'success', - }); - }) - .catch(() => { - showSnackbar({ - isLowContrast: false, - title: t('error', 'Error'), - subtitle: `Encounter ${t('failedDeleting', "couldn't be deleted")}`, - kind: 'error', - }); - }); - close(); - }, - }); - }, []) - useEffect(() => { if (!isLoadingFormsJson) { const formsWithFilteredIntents = formsJson.map((form) => { @@ -185,7 +145,6 @@ export const EncounterList: React.FC = ({ encounter.uuid, null, workspaceWindowSize, - patientUuid, ), viewEncounter: () => launchEncounterForm( @@ -197,12 +156,11 @@ export const EncounterList: React.FC = ({ encounter.uuid, null, workspaceWindowSize, - patientUuid, ), }; // process columns columns.forEach((column) => { - let val = column?.getValue(encounter); + let val = column.getValue(encounter); if (column.link) { val = ( = ({ // If custom config is available, generate actions accordingly; otherwise, fallback to the default actions. const actions = tableRow.actions?.length ? tableRow.actions : defaultActions; tableRow['actions'] = ( - + {actions.map((actionItem, index) => ( { e.preventDefault(); - actionItem.mode == 'delete' ? - handleDeleteEncounter(encounter.uuid, encounter.encounterType.name) - : launchEncounterForm( - forms.find((form) => form.name == actionItem?.form?.name), - moduleName, - actionItem.mode == 'enter' ? 'add' : actionItem.mode, - onFormSave, - null, - encounter.uuid, - actionItem.intent, - workspaceWindowSize, - patientUuid, - ); + launchEncounterForm( + forms.find((form) => form.name == actionItem?.form?.name), + moduleName, + actionItem.mode == 'enter' ? 'add' : actionItem.mode, + onFormSave, + null, + encounter.uuid, + actionItem.intent, + workspaceWindowSize, + ); }} /> ))} @@ -252,7 +206,7 @@ export const EncounterList: React.FC = ({ }); setPaginatedRows(rows); }, - [columns, defaultActions, forms, moduleName, workspaceWindowSize, patientUuid, onFormSave], + [columns, defaultActions, forms, moduleName, workspaceWindowSize], ); useEffect(() => { @@ -265,64 +219,40 @@ export const EncounterList: React.FC = ({ if (forms.length == 1 && !forms[0]['availableIntents']?.length) { // we only have one form with no intents // just return the "Add" button - return ( + return ( ); } else if (forms.length && !(hideFormLauncher ?? isDead)) { return ( - - launchEncounterForm( - formJson, - moduleName, - 'add', - onFormSave, - null, - '', - intent, - workspaceWindowSize, - patientUuid, - ) + launchEncounterForm(formJson, moduleName, 'add', onFormSave, null, null, intent, workspaceWindowSize) } title={displayText} /> ); } - return null; - }, [forms, hideFormLauncher, isDead, displayText, moduleName, workspaceWindowSize, onFormSave, patientUuid]); - - if (isLoading === true || isLoadingForms === true || isLoadingFormsJson === true) { - return ; - } + }, [forms, hideFormLauncher, isDead, displayText, moduleName, workspaceWindowSize]); return ( <> - {paginatedRows?.length > 0 || encounters.length > 0 ? ( + {isLoadingEncounters || isLoadingForms ? ( + + ) : encounters.length > 0 ? ( <>

{headerTitle}

- {/* @ts-ignore */} {!(hideFormLauncher ?? isDead) &&
{formLauncher}
}
@@ -343,17 +273,7 @@ export const EncounterList: React.FC = ({ displayText={description} headerTitle={headerTitle} launchForm={() => - launchEncounterForm( - forms[0], - moduleName, - 'add', - onFormSave, - null, - '', - '*', - workspaceWindowSize, - patientUuid, - ) + launchEncounterForm(forms[0], moduleName, 'add', onFormSave, null, null, '*', workspaceWindowSize) } launchFormComponent={formLauncher} hideFormLauncher={hideFormLauncher ?? isDead} diff --git a/packages/esm-commons-lib/src/components/encounter-list/encounter-list.test.tsx b/packages/esm-commons-lib/src/components/encounter-list/encounter-list.test.tsx deleted file mode 100644 index 6c776c1c7..000000000 --- a/packages/esm-commons-lib/src/components/encounter-list/encounter-list.test.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import '@testing-library/jest-dom'; -import React from 'react'; -import { act, render, screen } from '@testing-library/react'; -import { EncounterList } from './encounter-list.component'; -import { openmrsFetch, usePagination } from '@openmrs/esm-framework'; -import { mockColumns, mockEncounter, mockEncounterType, mockForms } from '../../../../../__mocks__/encounter-list.mock'; -import { launchPatientWorkspace } from '@openmrs/esm-patient-common-lib'; -import * as encounterRowsHook from '../../hooks/useEncounterRows'; -import * as formsJsonHook from '../../hooks/useFormsJson'; - -const emptyTestProps = { - formConceptMap: {}, - patientUuid: 'some-uuid', - encounterType: mockEncounterType, - columns: [], - headerTitle: 'Sample header title encounter list', - description: 'Sample description encounter list', - formList: [], - filter: jest.fn(), - launchOptions: { - moduleName: '', - hideFormLauncher: false, - displayText: '', - }, -}; - -const testProps = { - formConceptMap: {}, - patientUuid: 'some-uuid', - encounterType: mockEncounterType, - columns: mockColumns, - headerTitle: 'Sample header title encounter list', - description: 'Sample description encounter list', - formList: mockForms, - filter: jest.fn(), - launchOptions: { - moduleName: '', - hideFormLauncher: false, - displayText: '', - }, -}; - -jest.mock('../../hooks/useEncounterRows'); -jest.mock('../../hooks/useFormsJson'); - -jest.mock('@openmrs/esm-patient-common-lib', () => ({ - launchPatientWorkspace: jest.fn(), -})); - -jest.mock('@openmrs/openmrs-form-engine-lib', () => ({ - FormEngine: jest - .fn() - .mockImplementation(() => React.createElement('div', { 'data-testid': 'openmrs form' }, 'FORM ENGINE LIB')), -})); - -describe('EncounterList', () => { - afterEach(() => { - jest.clearAllMocks(); - }); - - test('renders an loading state if data is loading', () => { - jest - .spyOn(encounterRowsHook, 'useEncounterRows') - .mockReturnValue({ encounters: [], isLoading: true, error: null, onFormSave: () => {} }); - - jest.spyOn(formsJsonHook, 'useFormsJson').mockReturnValue({ formsJson: [], isLoading: true }); - - act(() => { - render(); - }); - const element = document.querySelector('.cds--skeleton.cds--data-table-container'); - expect(element).not.toBeNull(); - }); - - test('renders an empty state if data is null', () => { - jest - .spyOn(encounterRowsHook, 'useEncounterRows') - .mockReturnValue({ encounters: [], isLoading: false, error: null, onFormSave: () => {} }); - - jest.spyOn(formsJsonHook, 'useFormsJson').mockReturnValue({ formsJson: [], isLoading: false }); - - act(() => { - render(); - }); - expect( - screen.getByText('There are no sample description encounter list to display for this patient'), - ).toBeInTheDocument(); - }); - - test('should render the encounter list component', () => { - jest.spyOn(encounterRowsHook, 'useEncounterRows').mockReturnValue({ - encounters: mockEncounter, - isLoading: false, - error: null, - onFormSave: () => {}, - }); - jest.spyOn(formsJsonHook, 'useFormsJson').mockReturnValue({ formsJson: [], isLoading: false }); - - act(() => { - render(); - }); - expect(screen.getByText('Sample header title encounter list')).toBeInTheDocument(); - expect(screen.getByText('Death Date')).toBeInTheDocument(); - expect(screen.getByText('Click to sort rows by Cause of Death header in ascending order')).toBeInTheDocument(); - expect(screen.getByText('Cause of Death')).toBeInTheDocument(); - }); -}); diff --git a/packages/esm-commons-lib/src/components/encounter-list/helpers.ts b/packages/esm-commons-lib/src/components/encounter-list/helpers.ts index 9fa7aafc1..04730dd31 100644 --- a/packages/esm-commons-lib/src/components/encounter-list/helpers.ts +++ b/packages/esm-commons-lib/src/components/encounter-list/helpers.ts @@ -1,11 +1,11 @@ -import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework'; -import { launchPatientWorkspace } from '@openmrs/esm-patient-common-lib'; -import { FormSchema } from '@openmrs/openmrs-form-engine-lib'; +import { OHRIFormSchema, SessionMode } from '@openmrs/openmrs-form-engine-lib'; +import { launchForm } from '../../utils/ohri-forms-commons'; +import { capitalize } from 'lodash-es'; -type LaunchAction = 'add' | 'view' | 'edit' | 'embedded-view'; +type LaunchAction = 'add' | 'view' | 'edit'; export function launchEncounterForm( - form: FormSchema, + form: OHRIFormSchema, moduleName: string, action: LaunchAction = 'add', onFormSave: () => void, @@ -13,34 +13,16 @@ export function launchEncounterForm( encounterUuid?: string, intent: string = '*', workspaceWindowSize?: 'minimized' | 'maximized', - patientUuid?: string, - mutateform?: () => void, ) { - launchPatientWorkspace('patient-form-entry-workspace', { - workspaceTitle: form.name, - mutateform: mutateform, - formInfo: { - encounterUuid, - formUuid: form.name, - patientUuid: patientUuid, - visitTypeUuid: '', - visitUuid: '', - visitStartDatetime: '', - visitStopDatetime: '', - additionalProps: { - mode: action === 'add' ? 'enter' : action, - formSessionIntent: intent, - }, - }, - }); + const defaultTitle = capitalize(action) + ' ' + form.name; + launchForm( + form, + action === 'add' ? 'enter' : action, + moduleName, + title || defaultTitle, + encounterUuid, + intent, + onFormSave, + workspaceWindowSize, + ); } - -export function deleteEncounter(encounterUuid: string, abortController: AbortController) { - return openmrsFetch(`${restBaseUrl}/encounter/${encounterUuid}`, { - method: 'DELETE', - headers: { - 'Content-Type': 'application/json', - }, - signal: abortController.signal, - }); -} diff --git a/packages/esm-commons-lib/src/components/encounter-tile/encounter-tile.component.tsx b/packages/esm-commons-lib/src/components/encounter-tile/encounter-tile.component.tsx index ac1f84686..d8b3e2b27 100644 --- a/packages/esm-commons-lib/src/components/encounter-tile/encounter-tile.component.tsx +++ b/packages/esm-commons-lib/src/components/encounter-tile/encounter-tile.component.tsx @@ -56,7 +56,7 @@ export const EncounterValuesTile: React.FC = ({ patien --
- ); + ) } return ( diff --git a/packages/esm-commons-lib/src/components/ohri-form-launcher/ohri-form-empty-launcher.component.tsx b/packages/esm-commons-lib/src/components/ohri-form-launcher/ohri-form-empty-launcher.component.tsx index 1ac693f2c..185f5def3 100644 --- a/packages/esm-commons-lib/src/components/ohri-form-launcher/ohri-form-empty-launcher.component.tsx +++ b/packages/esm-commons-lib/src/components/ohri-form-launcher/ohri-form-empty-launcher.component.tsx @@ -3,7 +3,7 @@ import { Button } from '@carbon/react'; import { Add } from '@carbon/react/icons'; import { useTranslation } from 'react-i18next'; -export const FormLauncherEmpty: React.FC<{ +export const OHRIFormLauncherEmpty: React.FC<{ launchForm: (formJson?: any) => void; }> = ({ launchForm }) => { const { t } = useTranslation(); diff --git a/packages/esm-commons-lib/src/components/ohri-form-launcher/ohri-form-launcher.component.tsx b/packages/esm-commons-lib/src/components/ohri-form-launcher/ohri-form-launcher.component.tsx index 0bb844250..29208a2f0 100644 --- a/packages/esm-commons-lib/src/components/ohri-form-launcher/ohri-form-launcher.component.tsx +++ b/packages/esm-commons-lib/src/components/ohri-form-launcher/ohri-form-launcher.component.tsx @@ -4,7 +4,7 @@ import styles from './launcher-with-intent.scss'; import { useTranslation } from 'react-i18next'; import { OHRIOverflowMenu } from '../overflow-menu-button/ohri-overflow-menu.component'; -export const FormLauncherWithIntent: React.FC<{ +export const OHRIFormLauncherWithIntent: React.FC<{ launchForm: (formJson?: any, intent?: string) => void; title?: string; formJsonList?: Array; diff --git a/packages/esm-commons-lib/src/components/ohri-home/welcome-section/ohri-welcome-section.scss b/packages/esm-commons-lib/src/components/ohri-home/welcome-section/ohri-welcome-section.scss index ccefc064b..d93a73e6c 100644 --- a/packages/esm-commons-lib/src/components/ohri-home/welcome-section/ohri-welcome-section.scss +++ b/packages/esm-commons-lib/src/components/ohri-home/welcome-section/ohri-welcome-section.scss @@ -1,7 +1,6 @@ .welcomeContainer { display: flex; flex-direction: column; - margin: 1rem; } .location { diff --git a/packages/esm-commons-lib/src/components/patient-list-tabs/ohri-patient-list-tabs.component.tsx b/packages/esm-commons-lib/src/components/patient-list-tabs/ohri-patient-list-tabs.component.tsx index 926adc4e0..3e3e59849 100644 --- a/packages/esm-commons-lib/src/components/patient-list-tabs/ohri-patient-list-tabs.component.tsx +++ b/packages/esm-commons-lib/src/components/patient-list-tabs/ohri-patient-list-tabs.component.tsx @@ -27,7 +27,6 @@ export function OHRIPatientListTabs({ patientListConfigs, moduleName }) { extraAssociatedEncounterTypes={config.extraAssociatedEncounterTypes} moduleName={moduleName} viewPatientProgramSummary={config.viewPatientProgramSummary} - viewTptPatientProgramSummary={config.viewTptPatientProgramSummary} /> ); diff --git a/packages/esm-commons-lib/src/components/tile/ohri-programme-summary-tiles.scss b/packages/esm-commons-lib/src/components/tile/ohri-programme-summary-tiles.scss index 042124f96..e9845e821 100644 --- a/packages/esm-commons-lib/src/components/tile/ohri-programme-summary-tiles.scss +++ b/packages/esm-commons-lib/src/components/tile/ohri-programme-summary-tiles.scss @@ -1,7 +1,6 @@ .desktopView { display: flex; gap: 8px; - margin: 1rem; } .tileView { diff --git a/packages/esm-commons-lib/src/hooks/useEncounterRows.ts b/packages/esm-commons-lib/src/hooks/useEncounterRows.ts index 508a13e80..dc99bb2c9 100644 --- a/packages/esm-commons-lib/src/hooks/useEncounterRows.ts +++ b/packages/esm-commons-lib/src/hooks/useEncounterRows.ts @@ -6,7 +6,10 @@ import { encounterRepresentation } from '../constants'; export function useEncounterRows(patientUuid: string, encounterType: string, encounterFilter: (encounter) => boolean) { const [encounters, setEncounters] = useState([]); - const url = `/ws/rest/v1/encounter?encounterType=${encounterType}&patient=${patientUuid}&v=${encounterRepresentation}`; + const url = useMemo( + () => `/ws/rest/v1/encounter?encounterType=${encounterType}&patient=${patientUuid}&v=${encounterRepresentation}`, + [encounterType, patientUuid], + ); const { data: response, diff --git a/packages/esm-commons-lib/src/hooks/useFormsJson.ts b/packages/esm-commons-lib/src/hooks/useFormsJson.ts index c4057b463..09984ea28 100644 --- a/packages/esm-commons-lib/src/hooks/useFormsJson.ts +++ b/packages/esm-commons-lib/src/hooks/useFormsJson.ts @@ -17,7 +17,7 @@ export function useFormsJson(formNames: string[]) { setOpenmrsForms( responses .map((response, index) => { - const match = response?.data?.results.find((result) => !result.retired && result.name === formNames[index]); + const match = response.data.results.find((result) => !result.retired && result.name === formNames[index]); if (!match) { console.error('Form not found: ' + formNames[index]); return null; diff --git a/packages/esm-commons-lib/src/hooks/useLastEncounter.tsx b/packages/esm-commons-lib/src/hooks/useLastEncounter.tsx index ea177c183..4ffce9a65 100644 --- a/packages/esm-commons-lib/src/hooks/useLastEncounter.tsx +++ b/packages/esm-commons-lib/src/hooks/useLastEncounter.tsx @@ -5,7 +5,7 @@ import useSWR from 'swr'; export function useLastEncounter(patientUuid: string, encounterType: string) { const query = `encounterType=${encounterType}&patient=${patientUuid}&limit=1&order=desc&startIndex=0`; - const endpointUrl = `/ws/rest/v1/encounter?${query}&v=${encounterRepresentation}`; + const endpointUrl = `/ws/rest/v1/encounter?${query}&v=${encounterRepresentation}`; const { data, error, isValidating } = useSWR<{ data: { results: Array } }, Error>( endpointUrl, diff --git a/packages/esm-commons-lib/src/hooks/usePatientDeathStatus.ts b/packages/esm-commons-lib/src/hooks/usePatientDeathStatus.ts index f51385c48..36a6e3726 100644 --- a/packages/esm-commons-lib/src/hooks/usePatientDeathStatus.ts +++ b/packages/esm-commons-lib/src/hooks/usePatientDeathStatus.ts @@ -1,14 +1,20 @@ import { openmrsFetch } from '@openmrs/esm-framework'; +import { useEffect, useState } from 'react'; import useSWRImmutable from 'swr'; export function usePatientDeathStatus(patientUuid: string) { - const { - data: response, - isLoading, - error, - } = useSWRImmutable(`/ws/rest/v1/person/${patientUuid}?v=custom:(dead)`, openmrsFetch); + const [isDead, setIsDead] = useState(false); + const { data: response } = useSWRImmutable( + `/ws/rest/v1/person/${patientUuid}?v=custom:(dead)`, + openmrsFetch, + ); + useEffect(() => { + if (response) { + setIsDead(response.data.dead); + } + }, [response]); return { - isDead: !isLoading && !error && response ? response?.data?.dead : false, + isDead, }; } diff --git a/packages/esm-commons-lib/src/index.ts b/packages/esm-commons-lib/src/index.ts index 7c87c1f6f..becd0da5d 100644 --- a/packages/esm-commons-lib/src/index.ts +++ b/packages/esm-commons-lib/src/index.ts @@ -29,8 +29,6 @@ export * from './components/tile/ohri-summary-tile-tablet.component'; export * from './components/tile/ohri-summary-tile.component'; export * from './utils/compare'; export * from './utils/createOHRIDashboardLink'; -export * from './utils/createNewOHRIDashboardLink'; -export * from './utils/createOHRIGroupedLink'; export * from './utils/events'; export * from './utils/get-dosage'; export * from './utils/helpers'; diff --git a/packages/esm-commons-lib/src/root.scss b/packages/esm-commons-lib/src/root.scss index a3f7b89ff..62b18e4f5 100644 --- a/packages/esm-commons-lib/src/root.scss +++ b/packages/esm-commons-lib/src/root.scss @@ -97,20 +97,3 @@ div[class*='-esm-login__styles__center'] > img { :global(.cds--overflow-menu) > div { width: 15rem !important; } - -:global(.cds--tab-content) { - background-color: #F4F4F4; -} - -:global(.cds--side-nav--expanded .cds--side-nav__items) { - padding: 0.125rem !important; -} - -:global(.cds--side-nav__submenu) { - height: 1.5rem; - - &:focus, - &:hover { - background-color: #e0e0e0; - } -} \ No newline at end of file diff --git a/packages/esm-commons-lib/src/utils/createNewOHRIDashboardLink.tsx b/packages/esm-commons-lib/src/utils/createNewOHRIDashboardLink.tsx deleted file mode 100644 index 08316ba86..000000000 --- a/packages/esm-commons-lib/src/utils/createNewOHRIDashboardLink.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import React, { useEffect, useMemo, useState } from 'react'; -import classNames from 'classnames'; -import { BrowserRouter, useLocation } from 'react-router-dom'; -import { useTranslation } from 'react-i18next'; -import { ConfigurableLink, navigate } from '@openmrs/esm-framework'; -import { SideNavLink, SideNavMenu, SideNavMenuItem, Button } from '@carbon/react'; -import styles from './sidenav-links.scss'; - -interface DashboardLinkConfig { - name: string; - title: string; - icon: React.ComponentType; -} - -function NewDashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) { - const { name, title, icon } = dashboardLinkConfig; - const location = useLocation(); - const spaBasePath = `${window.spaBase}/home`; - - const navLink = useMemo(() => { - const pathArray = location.pathname.split('/home'); - const lastElement = pathArray[pathArray.length - 1]; - return decodeURIComponent(lastElement); - }, [location.pathname]); - - return ( - { - e.preventDefault(); - navigate({ to: `${spaBasePath}/${name}` }); - }} - className={navLink.match(name) ? styles.currentNavItem : ''}> - {title} - - ); -} - -export const createNewOHRIDashboardLink = (dashboardLinkConfig: DashboardLinkConfig) => () => ( - - - -); diff --git a/packages/esm-commons-lib/src/utils/createOHRIGroupedLink.tsx b/packages/esm-commons-lib/src/utils/createOHRIGroupedLink.tsx deleted file mode 100644 index c802ba29c..000000000 --- a/packages/esm-commons-lib/src/utils/createOHRIGroupedLink.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import React, { useMemo } from 'react'; -import classNames from 'classnames'; -import { BrowserRouter, useLocation } from 'react-router-dom'; -import { useTranslation } from 'react-i18next'; -import { ConfigurableLink } from '@openmrs/esm-framework'; -import { SideNavMenu, SideNavItems } from '@carbon/react'; - -interface DashboardLinkConfig { - name: string; - title: string; - isFolder: boolean; - folderTitle: string; - folderIcon: React.ComponentType; - childLinks?: Array; - isHidden?: boolean; -} - -function DashboardExtension({ dashboardLinkConfig }: { dashboardLinkConfig: DashboardLinkConfig }) { - const { t } = useTranslation(); - const { name, title, isFolder, folderTitle, folderIcon, childLinks, isHidden } = dashboardLinkConfig; - const location = useLocation(); - const spaBasePath = `${window.spaBase}/home`; - - const navLink = useMemo(() => { - const pathArray = location.pathname.split('/home'); - const lastElement = pathArray[pathArray.length - 1]; - return decodeURIComponent(lastElement); - }, [location.pathname]); - - if (isHidden) { - return; - } - - if (isFolder) { - return ( - - - - {t(title)} - - {Array.isArray(childLinks) && - childLinks.map((childLink, childIndex) => ( - - {t(childLink.title)} - - ))} - - - ); - } else { - return ( - - - {t(title)} - - - ); - } -} - -export const createOHRIGroupedLink = (dashboardLinkConfig: DashboardLinkConfig) => () => ( - - - -); diff --git a/packages/esm-commons-lib/src/utils/ohri-forms-commons.ts b/packages/esm-commons-lib/src/utils/ohri-forms-commons.ts index c407722c0..33efde274 100644 --- a/packages/esm-commons-lib/src/utils/ohri-forms-commons.ts +++ b/packages/esm-commons-lib/src/utils/ohri-forms-commons.ts @@ -1,8 +1,8 @@ -import { FormSchema, SessionMode } from '@openmrs/openmrs-form-engine-lib'; +import { OHRIFormSchema, SessionMode } from '@openmrs/openmrs-form-engine-lib'; import { launchOHRIWorkSpace } from '../workspace/ohri-workspace-utils'; export const launchForm = ( - form: FormSchema, + form: OHRIFormSchema, mode: SessionMode = 'enter', moduleName: string, title?: string, diff --git a/packages/esm-commons-lib/src/utils/sidenav-links.scss b/packages/esm-commons-lib/src/utils/sidenav-links.scss index d1a06f8e3..76c3df410 100644 --- a/packages/esm-commons-lib/src/utils/sidenav-links.scss +++ b/packages/esm-commons-lib/src/utils/sidenav-links.scss @@ -8,4 +8,4 @@ background-color: #e0e0e0 !important; color: #161616 !important; border-left-color: var(--brand-01) !important; -} \ No newline at end of file +} diff --git a/packages/esm-commons-lib/src/workspace/ohri-workspace-utils.ts b/packages/esm-commons-lib/src/workspace/ohri-workspace-utils.ts index 53bd3f150..9c797dc52 100644 --- a/packages/esm-commons-lib/src/workspace/ohri-workspace-utils.ts +++ b/packages/esm-commons-lib/src/workspace/ohri-workspace-utils.ts @@ -1,7 +1,7 @@ import { getSyncLifecycle } from '@openmrs/esm-framework'; import { BehaviorSubject } from 'rxjs'; import { closeWorkspace, launchPatientWorkspace, registerWorkspace } from '@openmrs/esm-patient-common-lib'; -import { FormEngine, SessionMode } from '@openmrs/openmrs-form-engine-lib'; +import { OHRIForm, SessionMode } from '@openmrs/openmrs-form-engine-lib'; export interface WorkspaceContextProps { title: string; encounterUuid?: string; @@ -20,7 +20,7 @@ export const launchOHRIWorkSpace = (props: WorkspaceContextProps) => { const workspaceName = props.workspaceName || 'ohri-forms-' + counter++; const close = () => { - return closeWorkspace(workspaceName, { ignoreChanges: true }); + return closeWorkspace(workspaceName, true); }; const onFormSubmit = () => { props.state?.updateParent?.(); @@ -30,7 +30,7 @@ export const launchOHRIWorkSpace = (props: WorkspaceContextProps) => { name: workspaceName, title: props.title, preferredWindowSize: props.screenSize, - load: getSyncLifecycle(FormEngine, { + load: getSyncLifecycle(OHRIForm, { featureName: 'ohri-forms-workspace-item', moduleName: props.moduleName, }), diff --git a/packages/esm-covid-app/src/config-schema.ts b/packages/esm-covid-app/src/config-schema.ts index 853afe612..69f38ff8b 100644 --- a/packages/esm-covid-app/src/config-schema.ts +++ b/packages/esm-covid-app/src/config-schema.ts @@ -97,21 +97,6 @@ export const configSchema = { CovidLabOrderFormName: 'COVID Lab Order Form', }, }, - formUuids: { - _type: Type.Object, - _description: 'Covid Form Uuids.', - _default: { - covidCaseFormUuid: 'c0fd71bd-37bc-3c8d-b2ff-149c0ff4d6f0', - covidAssessmentFormUuid: 'f5fb6bc4-6fc3-3462-a191-2fff0896bab3', - covidOutcomeFormUuid: '6515d898-439c-11ec-9103-238295f2dfd7', - covidVaccinationFormUuid: '3ae3a031-2e24-357d-81b3-205d5187090a', - covidLabTestFormUuid: 'e92fe922-4863-11ec-99cc-1fdd2d4e9d88', - covidLabResultFormUuid: 'cf8cd756-baef-38df-b84d-92968b42c113', - covidLabCancellationFormUuid: 'd38bc949-c95b-39eb-a2c5-08b82a36409c', - covidSampleCollectionFormUuid: '371d19b6-485f-11ec-99cc-1fdd2d4e9d88', - covidLabOrderFormUuid: 'f5fb6bc4-6fc3-3462-a191-2fff0896bab3', - }, - }, }; export interface ConfigObject { @@ -119,5 +104,4 @@ export interface ConfigObject { obsConcepts: Object; formNames: object; cohorts: object; - formUuids: Object; } diff --git a/packages/esm-covid-app/src/dashboard.meta.tsx b/packages/esm-covid-app/src/dashboard.meta.tsx index d88764052..f382a6547 100644 --- a/packages/esm-covid-app/src/dashboard.meta.tsx +++ b/packages/esm-covid-app/src/dashboard.meta.tsx @@ -42,8 +42,7 @@ export const covidClinicalViewDashboardMeta = { export const covid19CasesDashboardMeta = { name: 'covid-cases', slot: 'covid-cases-dashboard-slot', + config: { columns: 1, type: 'grid', programme: 'covid', dashboardTitle: 'COVID-19 Cases', icon: Coronavirus }, title: 'COVID-19 Cases', - isFolder: true, - folderTitle: 'COVID', - folderIcon: Coronavirus, + dashboardIcon: Coronavirus, }; diff --git a/packages/esm-covid-app/src/home.component.tsx b/packages/esm-covid-app/src/home.component.tsx deleted file mode 100644 index 24580fe77..000000000 --- a/packages/esm-covid-app/src/home.component.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib'; -import React from 'react'; -import CovidHomePatientTabs from './views/dashboard/patient-list-tabs/covid-patient-list-tabs.component'; -import CovidSummaryTiles from './views/dashboard/summary-tiles/covid-summary-tiles.component'; - -const Homecomponent = () => { - return ( -
- - - -
- ); -}; - -export default Homecomponent; diff --git a/packages/esm-covid-app/src/index.ts b/packages/esm-covid-app/src/index.ts index 1e3795dba..af05108d3 100644 --- a/packages/esm-covid-app/src/index.ts +++ b/packages/esm-covid-app/src/index.ts @@ -1,7 +1,7 @@ import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework'; -import CovidVaccinations from './views/covid-vaccinations.component'; -import CovidLabResults from './views/lab-results.component'; -import CovidAssessment from './views/case-assessment.component'; +import CovidVaccinations from './views/covid-vaccinations.encounter-list'; +import CovidLabResults from './views/lab-results.encounter-list'; +import CovidAssessment from './views/case-assessment.encounter-lists'; import CovidHomePatientTabs from './views/dashboard/patient-list-tabs/covid-patient-list-tabs.component'; import CovidSummaryTiles from './views/dashboard/summary-tiles/covid-summary-tiles.component'; import { @@ -12,10 +12,9 @@ import { covid19CasesDashboardMeta, covidPatientChartMeta, } from './dashboard.meta'; -import { createOHRIDashboardLink, createOHRIGroupedLink, OHRIHome, OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib'; +import { createOHRIDashboardLink, OHRIHome, OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib'; import { createDashboardGroup, createDashboardLink } from '@openmrs/esm-patient-common-lib'; import { configSchema } from './config-schema'; -import rootComponent from './root.component'; export const importTranslation = require.context('../translations', false, /.json$/, 'lazy'); @@ -81,5 +80,8 @@ export const covidClinicalViewDashboardLink = getSyncLifecycle( createOHRIDashboardLink(covidClinicalViewDashboardMeta), options, ); -export const covidCasesDashboardLink = getSyncLifecycle(createOHRIGroupedLink(covid19CasesDashboardMeta), options); -export const covidCasesDashboard = getSyncLifecycle(rootComponent, options); +export const covidCasesDashboardLink = getSyncLifecycle(createOHRIDashboardLink(covid19CasesDashboardMeta), options); +export const covidCasesDashboard = getSyncLifecycle(OHRIHome, { + featureName: 'covid cases dashboard', + moduleName, +}); diff --git a/packages/esm-covid-app/src/root.component.tsx b/packages/esm-covid-app/src/root.component.tsx deleted file mode 100644 index 74d2066b4..000000000 --- a/packages/esm-covid-app/src/root.component.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { SWRConfig } from 'swr'; -import { BrowserRouter, Route, Routes } from 'react-router-dom'; -import Home from './home.component'; - -const swrConfiguration = { - // Maximum number of retries when the backend returns an error - errorRetryCount: 3, -}; - -const Root: React.FC = () => { - const covidBasename = window.getOpenmrsSpaBase() + 'home/covid-cases'; - - return ( -
- - - - } /> - - - -
- ); -}; - -export default Root; diff --git a/packages/esm-covid-app/src/routes.json b/packages/esm-covid-app/src/routes.json index e6dbba5f7..9e423c8dd 100644 --- a/packages/esm-covid-app/src/routes.json +++ b/packages/esm-covid-app/src/routes.json @@ -16,6 +16,38 @@ "title": "COVID" } }, + { + "name": "covid-cases-dashboard-ext", + "slot": "ohri-covid-dashboard-slot", + "component": "covidCasesDashboardLink", + "meta": { + "name": "covid-cases", + "slot": "covid-cases-dashboard-slot", + "config": { + "columns": 1, + "type": "grid", + "programme": "covid", + "dashboardTitle": "COVID-19 Cases" + }, + "path": "COVID-19", + "title": "COVID-19 Cases" + } + }, + { + "name": "covid-cases-dashboard", + "slot": "covid-cases-dashboard-slot", + "component": "covidCasesDashboard", + "meta": { + "name": "covid-cases", + "slot": "covid-cases-dashboard-slot", + "config": { + "columns": 1, + "programme": "covid", + "dashboardTitle": "COVID-19 Home Page" + }, + "title": "COVID-19 Cases" + } + }, { "name": "covid-home-header-ext", "slot": "covid-home-header-slot", @@ -83,22 +115,6 @@ "name": "covid-vaccinations-ext", "slot": "covid-vaccinations-dashboard-slot", "component": "covidVaccinationsDashboard" - }, - { - "name": "covid-cases-dashboard-ext", - "slot": "homepage-dashboard-slot", - "component": "covidCasesDashboardLink", - "meta": { - "name": "covid-cases", - "slot": "covid-cases-dashboard-slot", - "title": "TB Treatment" - }, - "order": 5 - }, - { - "name": "covid-cases-dashboard", - "slot": "covid-cases-dashboard-slot", - "component": "covidCasesDashboard" } ] } diff --git a/packages/esm-covid-app/src/views/case-assessment.component.tsx b/packages/esm-covid-app/src/views/case-assessment.encounter-lists.tsx similarity index 88% rename from packages/esm-covid-app/src/views/case-assessment.component.tsx rename to packages/esm-covid-app/src/views/case-assessment.encounter-lists.tsx index e2be890ba..2ad5d718e 100644 --- a/packages/esm-covid-app/src/views/case-assessment.component.tsx +++ b/packages/esm-covid-app/src/views/case-assessment.encounter-lists.tsx @@ -17,8 +17,6 @@ const CovidAssessment: React.FC = ({ patientUuid }) const { t } = useTranslation(); const config = useConfig(); - const { covidAssessmentFormUuid, covidCaseFormUuid, covidOutcomeFormUuid } = config.formUuids; - const columns: EncounterListColumn[] = useMemo( () => [ { @@ -106,17 +104,9 @@ const CovidAssessment: React.FC = ({ patientUuid }) patientUuid={patientUuid} encounterType={config.encounterTypes.covid_Assessment_EncounterUUID} formList={[ - { - name: config.formNames.CovidAssessmentFormName, - excludedIntents: ['COVID_LAB_ASSESSMENT_EMBED'], - uuid: covidAssessmentFormUuid, - }, - { name: config.formNames.CovidCaseFormName, uuid: covidCaseFormUuid }, - { - name: config.formNames.CovidOutcomeFormName, - excludedIntents: ['COVID_OUTCOME_EMBED', '*'], - uuid: covidOutcomeFormUuid, - }, + { name: config.formNames.CovidAssessmentFormName, excludedIntents: ['COVID_LAB_ASSESSMENT_EMBED'] }, + { name: config.formNames.CovidCaseFormName }, + { name: config.formNames.CovidOutcomeFormName, excludedIntents: ['COVID_OUTCOME_EMBED', '*'] }, ]} columns={columns} description={displayText} diff --git a/packages/esm-covid-app/src/views/covid-outcomes.component.tsx b/packages/esm-covid-app/src/views/covid-outcomes.encounter-list.tsx similarity index 94% rename from packages/esm-covid-app/src/views/covid-outcomes.component.tsx rename to packages/esm-covid-app/src/views/covid-outcomes.encounter-list.tsx index 1a48cbe90..bc3f7d38a 100644 --- a/packages/esm-covid-app/src/views/covid-outcomes.component.tsx +++ b/packages/esm-covid-app/src/views/covid-outcomes.encounter-list.tsx @@ -19,8 +19,6 @@ const CovidOutcomes: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); const config = useConfig(); - const { covidCaseFormUuid } = config.formUuids; - const columns: EncounterListColumn[] = useMemo( () => [ { @@ -71,7 +69,7 @@ const CovidOutcomes: React.FC = ({ patientUuid }) => { = ({ patientUuid const { t } = useTranslation(); const config = useConfig(); - const { covidVaccinationFormUuid } = config.formUuids; - const columns: EncounterListColumn[] = useMemo( () => [ //TODO: Add Vaccination Status concept @@ -100,7 +98,7 @@ const CovidVaccinations: React.FC = ({ patientUuid = ({ patientUuid }) => { const { t } = useTranslation(); const config = useConfig(); - const { - covidLabOrderFormUuid, - covidLabResultFormUuid, - covidLabTestFormUuid, - covidSampleCollectionFormUuid, - covidLabCancellationFormUuid, - } = config.formUuids; - const columnsLab: EncounterListColumn[] = useMemo( () => [ { @@ -231,26 +223,16 @@ const CovidLabResults: React.FC = ({ patientUuid }) => { patientUuid={patientUuid} encounterType={config.encounterTypes.covidLabOrderEncounterType_UUID} formList={[ - { - name: config.formNames.CovidLabOrderFormName, - excludedIntents: ['COVID_LAB_ORDER_EMBED'], - uuid: covidLabOrderFormUuid, - }, - { - name: config.formNames.CovidLabResultFormName, - excludedIntents: ['COVID_LAB_RESULT_EMBED'], - uuid: covidLabResultFormUuid, - }, - { name: config.formNames.CovidLabTestFormName, excludedIntents: ['*'], uuid: covidLabTestFormUuid }, + { name: config.formNames.CovidLabOrderFormName, excludedIntents: ['COVID_LAB_ORDER_EMBED'] }, + { name: config.formNames.CovidLabResultFormName, excludedIntents: ['COVID_LAB_RESULT_EMBED'] }, + { name: config.formNames.CovidLabTestFormName, excludedIntents: ['*'] }, { name: config.formNames.CovidLabCancellationFormName, excludedIntents: ['*', 'COVID_LAB_CANCELLATION_EMBED'], - uuid: covidLabCancellationFormUuid, }, { name: config.formNames.CovidSampleCollectionFormName, excludedIntents: ['*', 'COVID_SAMPLE_COLLECTION_EMBED'], - uuid: covidSampleCollectionFormUuid, }, ]} columns={columnsLab} @@ -267,12 +249,12 @@ const CovidLabResults: React.FC = ({ patientUuid }) => { patientUuid={patientUuid} encounterType={config.encounterTypes.covidLabOrderEncounterType_UUID} formList={[ - { name: config.formNames.CovidLabTestFormName, uuid: covidLabTestFormUuid }, - { name: config.formNames.CovidLabTestFormName, uuid: covidLabTestFormUuid }, - { name: config.formNames.CovidLabResultFormName, uuid: covidLabResultFormUuid }, - { name: config.formNames.CovidLabCancellationFormName, uuid: covidLabCancellationFormUuid }, - { name: config.formNames.CovidSampleCollectionFormName, uuid: covidSampleCollectionFormUuid }, - { name: config.formNames.CovidLabOrderFormName, uuid: covidLabOrderFormUuid }, + { name: config.formNames.CovidLabTestFormName }, + { name: config.formNames.CovidLabTestFormName }, + { name: config.formNames.CovidLabResultFormName }, + { name: config.formNames.CovidLabCancellationFormName }, + { name: config.formNames.CovidSampleCollectionFormName }, + { name: config.formNames.CovidLabOrderFormName }, ]} columns={columnsPending} description={headerTitlePending} diff --git a/packages/esm-form-render-app/package.json b/packages/esm-form-render-app/package.json index 1b2ba25f5..e9db3380f 100644 --- a/packages/esm-form-render-app/package.json +++ b/packages/esm-form-render-app/package.json @@ -39,7 +39,7 @@ }, "dependencies": { "@carbon/react": "^1.13.0", - "@openmrs/openmrs-form-engine-lib": "1.1.0-pre.723", + "@openmrs/openmrs-form-engine-lib": "next", "ace-builds": "^1.4.12", "react-ace": "^9.4.4" }, diff --git a/packages/esm-form-render-app/src/render/forms-render-test.component.tsx b/packages/esm-form-render-app/src/render/forms-render-test.component.tsx index 1fc3442ba..efe4ed91e 100644 --- a/packages/esm-form-render-app/src/render/forms-render-test.component.tsx +++ b/packages/esm-form-render-app/src/render/forms-render-test.component.tsx @@ -4,7 +4,7 @@ import styles from './form-render.scss'; import { Run, Maximize, UserData } from '@carbon/react/icons'; import AceEditor from 'react-ace'; import 'ace-builds/webpack-resolver'; -import { applyFormIntent, loadSubforms, FormEngine, FormSchema } from '@openmrs/openmrs-form-engine-lib'; +import { applyFormIntent, loadSubforms, OHRIForm, OHRIFormSchema } from '@openmrs/openmrs-form-engine-lib'; import { useTranslation } from 'react-i18next'; import { ConfigObject, useConfig, openmrsFetch } from '@openmrs/esm-framework'; import { handleFormValidation } from '../form-validator'; @@ -13,7 +13,7 @@ function FormRenderTest() { const { t } = useTranslation(); const headerTitle = t('formRenderTestTitle', 'Form Render Test'); const { patientUuid, dataTypeToRenderingMap } = useConfig() as ConfigObject; - const [formInput, setFormInput] = useState(); + const [formInput, setFormInput] = useState(); const [formIntents, setFormIntents] = useState([]); const [isIntentsDropdownDisabled, setIsIntentsDropdownDisabled] = useState(true); const [selectedFormIntent, setSelectedFormIntent] = useState(''); @@ -76,7 +76,7 @@ function FormRenderTest() { }; const formValidation = () => { - handleFormValidation(schemaInput, dataTypeToRenderingMap); + handleFormValidation(schemaInput, dataTypeToRenderingMap).then((response) => console.log(response)); }; const handleFormSubmission = (e) => { @@ -267,7 +267,7 @@ function FormRenderTest() { {isSchemaLoaded ? (
- { - return ( -
- - - -
- ); -}; - -export default Homecomponent; diff --git a/packages/esm-hiv-app/src/hiv-treatment-root.component.tsx b/packages/esm-hiv-app/src/hiv-treatment-root.component.tsx deleted file mode 100644 index 481100308..000000000 --- a/packages/esm-hiv-app/src/hiv-treatment-root.component.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { SWRConfig } from 'swr'; -import { BrowserRouter, Route, Routes } from 'react-router-dom'; -import Home from './hiv-treatment-home.component'; - -const swrConfiguration = { - // Maximum number of retries when the backend returns an error - errorRetryCount: 3, -}; - -const Root: React.FC = () => { - const hivTreatmentBasename = window.getOpenmrsSpaBase() + 'home/care-and-treatment'; - - return ( -
- - - - } /> - - - -
- ); -}; - -export default Root; diff --git a/packages/esm-hiv-app/src/hts-home.component.tsx b/packages/esm-hiv-app/src/hts-home.component.tsx deleted file mode 100644 index 9390fc97a..000000000 --- a/packages/esm-hiv-app/src/hts-home.component.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib'; -import React from 'react'; -import OHRIPatientTabs from './views/hts/home/patient-tabs/ohri-patient-tabs.component'; -import HTSSummaryTiles from './views/hts/home/summary-tiles/hts-summary-tiles.component'; - -const Homecomponent = () => { - return ( -
- - {}} /> - -
- ); -}; - -export default Homecomponent; diff --git a/packages/esm-hiv-app/src/hts-root.component.tsx b/packages/esm-hiv-app/src/hts-root.component.tsx deleted file mode 100644 index f709f26bb..000000000 --- a/packages/esm-hiv-app/src/hts-root.component.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { SWRConfig } from 'swr'; -import { BrowserRouter, Route, Routes } from 'react-router-dom'; -import Home from './hts-home.component'; - -const swrConfiguration = { - // Maximum number of retries when the backend returns an error - errorRetryCount: 3, -}; - -const Root: React.FC = () => { - const htsBasename = window.getOpenmrsSpaBase() + 'home/hts'; - - return ( -
- - - - } /> - - - -
- ); -}; - -export default Root; diff --git a/packages/esm-hiv-app/src/index.ts b/packages/esm-hiv-app/src/index.ts index 68bc900ea..884eff4ee 100644 --- a/packages/esm-hiv-app/src/index.ts +++ b/packages/esm-hiv-app/src/index.ts @@ -16,7 +16,6 @@ import { PatientStatusBannerTag, OHRIHome, OHRIWelcomeSection, - createOHRIGroupedLink, } from '@ohri/openmrs-esm-ohri-commons-lib'; import { createDashboardGroup, createDashboardLink } from '@openmrs/esm-patient-common-lib'; @@ -34,8 +33,6 @@ import { partnerNotificationServicesDashboardMeta, hivPreventionFolderDashboardMeta, } from './dashboard.meta'; -import htsRootComponent from './hts-root.component'; -import careAndTreatmentRootComponent from './hiv-treatment-root.component'; import { configSchema } from './config-schema'; @@ -96,20 +93,23 @@ export const hivCareAndTreatmentFolderLink = getSyncLifecycle( options, ); export const hivCareAndTreatmentDashboardLink = getSyncLifecycle( - createOHRIGroupedLink(hivCareAndTreatmentFolderDashboardMeta), + createOHRIDashboardLink(careAndTreatmentDashboardMeta), options, ); -export const hivCareAndTreatmentDashboard = getSyncLifecycle(careAndTreatmentRootComponent, options); +export const hivCareAndTreatmentDashboard = getSyncLifecycle(OHRIHome, { + featureName: 'care and treatment dashboard', + moduleName, +}); export const hivPreventionFolderLink = getSyncLifecycle( createOHRIDashboardLink(hivPreventionFolderDashboardMeta), options, ); -export const hivPreventionDashboardLink = getSyncLifecycle( - createOHRIGroupedLink(hivPreventionFolderDashboardMeta), - options, -); -export const hivPreventionDashboard = getSyncLifecycle(htsRootComponent, options); +export const hivPreventionDashboardLink = getSyncLifecycle(createOHRIDashboardLink(htsDashboardMeta), options); +export const hivPreventionDashboard = getSyncLifecycle(OHRIHome, { + featureName: 'hts dashboard', + moduleName, +}); // Lab Results export const labResultsHomeHeader = getSyncLifecycle(OHRIWelcomeSection, { diff --git a/packages/esm-hiv-app/src/routes.json b/packages/esm-hiv-app/src/routes.json index 98a109545..de547b7ed 100644 --- a/packages/esm-hiv-app/src/routes.json +++ b/packages/esm-hiv-app/src/routes.json @@ -23,19 +23,35 @@ }, { "name": "ohri-hiv-prevention-dashboard-ext", - "slot": "homepage-dashboard-slot", + "slot": "ohri-hiv-prevention-dashboard-slot", "component": "hivPreventionDashboardLink", "meta": { "name": "hts", "slot": "hts-dashboard-slot", + "config": { + "columns": 1, + "type": "grid", + "programme": "hts", + "dashboardTitle": "HTS Home Page" + }, "title": "HIV Testing Services" - }, - "order": 8 + } }, { "name": "ohri-hiv-prevention-dashboard", "slot": "hts-dashboard-slot", - "component": "hivPreventionDashboard" + "component": "hivPreventionDashboard", + "meta": { + "name": "hts", + "slot": "hts-dashboard-slot", + "config": { + "columns": 1, + "type": "grid", + "programme": "hts", + "dashboardTitle": "HTS Home Page" + }, + "title": "HIV Testing Services" + } }, { "name": "hts-home-header-ext", @@ -64,19 +80,36 @@ }, { "name": "care-and-treatment-dashboard-ext", - "slot": "homepage-dashboard-slot", + "slot": "ohri-hiv-care-and-treatment-dashboard-slot", "component": "hivCareAndTreatmentDashboardLink", "meta": { "name": "care-and-treatment", "slot": "ct-dashboard-slot", - "title": "Care and Treatment" - }, - "order": 9 + "config": { + "columns": 1, + "type": "grid", + "programme": "ct", + "dashboardTitle": "C&T Home Page" + }, + "title": "Care and Treatment", + "path": "Care and Treatment" + } }, { "name": "ohri-care-and-treatment-dashboard", "slot": "ct-dashboard-slot", - "component": "hivCareAndTreatmentDashboard" + "component": "hivCareAndTreatmentDashboard", + "meta": { + "name": "care-and-treatment", + "slot": "ct-dashboard-slot", + "config": { + "columns": 1, + "type": "grid", + "programme": "ct", + "dashboardTitle": "C&T Home Page" + }, + "title": "Care and Treatment" + } }, { "name": "ct-home-header-ext", diff --git a/packages/esm-hiv-app/src/views/clinical-visit/encounter-list/clinical-visit-encounter-list.component.tsx b/packages/esm-hiv-app/src/views/clinical-visit/encounter-list/clinical-visit-encounter-list.component.tsx index 3b3aaa6a0..25e26dac2 100644 --- a/packages/esm-hiv-app/src/views/clinical-visit/encounter-list/clinical-visit-encounter-list.component.tsx +++ b/packages/esm-hiv-app/src/views/clinical-visit/encounter-list/clinical-visit-encounter-list.component.tsx @@ -11,7 +11,7 @@ interface ClinicalVisitWidgetProps { const ClinicalVisitWidget: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -70,7 +70,7 @@ const ClinicalVisitWidget: React.FC = ({ patientUuid } = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -67,7 +67,7 @@ const DisclosureList: React.FC = ({ patientUuid }) => { patientUuid={patientUuid} filter={disclosureFilter} encounterType={encounterTypes.PeadsDisclosureEncounterType_UUID} - formList={[{ name: formNames.DisclosureFormName, uuid: formUuids.disclosureFormUuid }]} + formList={[{ name: formNames.DisclosureFormName }]} columns={columns} description={headerTitle} headerTitle={headerTitle} diff --git a/packages/esm-hiv-app/src/views/general-counselling/tabs/intimate-partner-violence.component.tsx b/packages/esm-hiv-app/src/views/general-counselling/tabs/intimate-partner-violence.component.tsx index 53d06b8a2..27c494b11 100644 --- a/packages/esm-hiv-app/src/views/general-counselling/tabs/intimate-partner-violence.component.tsx +++ b/packages/esm-hiv-app/src/views/general-counselling/tabs/intimate-partner-violence.component.tsx @@ -10,7 +10,7 @@ interface IntimatePartnerViolenceListProps { const IntimatePartnerViolenceList: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -76,7 +76,7 @@ const IntimatePartnerViolenceList: React.FC = patientUuid={patientUuid} filter={intimatePartnerFilter} encounterType={encounterTypes.IntimatePartnerEncounterType_UUID} - formList={[{ name: formNames.IntimatePartnerFormName, uuid: formUuids.intimatePartnerFormUuid }]} + formList={[{ name: formNames.IntimatePartnerFormName }]} columns={columns} description={displayText} headerTitle={headerTitle} diff --git a/packages/esm-hiv-app/src/views/general-counselling/tabs/mental-health-assessment.component.tsx b/packages/esm-hiv-app/src/views/general-counselling/tabs/mental-health-assessment.component.tsx index c9afe0d35..f2bfbc214 100644 --- a/packages/esm-hiv-app/src/views/general-counselling/tabs/mental-health-assessment.component.tsx +++ b/packages/esm-hiv-app/src/views/general-counselling/tabs/mental-health-assessment.component.tsx @@ -11,7 +11,7 @@ interface MentalHealthAssessmentListProps { const MentalHealthAssessmentList: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -86,7 +86,7 @@ const MentalHealthAssessmentList: React.FC = ({ patientUuid={patientUuid} filter={mentalHealthFilter} encounterType={encounterTypes.MentalHealthAssessmentEncounter_UUID} - formList={[{ name: formNames.MentalHealthFormName, uuid: formUuids.mentalHealthFormUuid }]} + formList={[{ name: formNames.MentalHealthFormName }]} columns={columns} description={displayText} headerTitle={headerTitle} diff --git a/packages/esm-hiv-app/src/views/hiv-testing-services/tab-list/hts-overview-list.component.tsx b/packages/esm-hiv-app/src/views/hiv-testing-services/tab-list/hts-overview-list.component.tsx index f093916fe..c3dac3dac 100644 --- a/packages/esm-hiv-app/src/views/hiv-testing-services/tab-list/hts-overview-list.component.tsx +++ b/packages/esm-hiv-app/src/views/hiv-testing-services/tab-list/hts-overview-list.component.tsx @@ -14,7 +14,7 @@ const HtsOverviewList: React.FC = ({ patientUuid }) => { const htsRetrospectiveTypeUUID = '79c1f50f-f77d-42e2-ad2a-d29304dde2fe'; // HTS Retrospective const forceComponentUpdate = () => setCounter(counter + 1); const headerTitle = t('hivTesting', 'HIV Testing'); - const { obsConcepts, formNames, formUuids } = useConfig(); + const { obsConcepts, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -83,7 +83,6 @@ const HtsOverviewList: React.FC = ({ patientUuid }) => { name: formNames.HIVTestingFormName, fixedIntent: '*', excludedIntents: ['HTS_PRE_TEST', 'HTS_TEST', 'HTS_POST_TEST'], - uuid: formUuids.hivTestingFormUuid, }, ]} columns={columns} diff --git a/packages/esm-hiv-app/src/views/hts/care-and-treatment/summary-tiles/ct-summary-tiles.component.tsx b/packages/esm-hiv-app/src/views/hts/care-and-treatment/summary-tiles/ct-summary-tiles.component.tsx index 6d180737e..bb5cfbd83 100644 --- a/packages/esm-hiv-app/src/views/hts/care-and-treatment/summary-tiles/ct-summary-tiles.component.tsx +++ b/packages/esm-hiv-app/src/views/hts/care-and-treatment/summary-tiles/ct-summary-tiles.component.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'; import { OHRIProgrammeSummaryTiles, getReportingCohort } from '@ohri/openmrs-esm-ohri-commons-lib'; import { useConfig } from '@openmrs/esm-framework'; -function CTSummaryTiles() { +function CTSummaryTiles({ launchWorkSpace }) { const { t } = useTranslation(); const [activeClientsCount, setActiveClientsCount] = useState(0); const { cohorts } = useConfig(); diff --git a/packages/esm-hiv-app/src/views/hts/home/summary-tiles/summary-tile.scss b/packages/esm-hiv-app/src/views/hts/home/summary-tiles/summary-tile.scss index b1e41454d..46fc47ab8 100644 --- a/packages/esm-hiv-app/src/views/hts/home/summary-tiles/summary-tile.scss +++ b/packages/esm-hiv-app/src/views/hts/home/summary-tiles/summary-tile.scss @@ -1,6 +1,5 @@ .desktopView{ display: flex; - margin: 1rem; } .tileView { display: none; diff --git a/packages/esm-hiv-app/src/views/hts/lab-results/tabs/cd4-results.component.tsx b/packages/esm-hiv-app/src/views/hts/lab-results/tabs/cd4-results.component.tsx index 8bf769660..0745de60d 100644 --- a/packages/esm-hiv-app/src/views/hts/lab-results/tabs/cd4-results.component.tsx +++ b/packages/esm-hiv-app/src/views/hts/lab-results/tabs/cd4-results.component.tsx @@ -61,8 +61,9 @@ const CD4ResultsList: React.FC = ({ patientUuid }) => { for (let patient of patients) { const lastCd4Result = patientToCd4Map.find((entry) => entry.patientId === patient.resource.id)?.cd4Result; const lastCd4ResultDate = patientToCd4Map.find((entry) => entry.patientId === patient.resource.id)?.cd4ResultDate; - const lastCd4EncounterUuid = patientToCd4Map.find((entry) => entry.patientId === patient.resource.id) - ?.cd4EncounterUuid; + const lastCd4EncounterUuid = patientToCd4Map.find( + (entry) => entry.patientId === patient.resource.id, + )?.cd4EncounterUuid; const patientActions = ( = () => { useEffect(() => { let rows = []; for (let patient of patients) { - const lastviralLoadResult = patientToViralLoadMap.find((entry) => entry.patientId === patient.resource.id) - ?.viralLoadResult; - const lastviralLoadResultDate = patientToViralLoadMap.find((entry) => entry.patientId === patient.resource.id) - ?.viralLoadResultDate; - const lastViralLoadEncounterUuid = patientToViralLoadMap.find((entry) => entry.patientId === patient.resource.id) - ?.viralEncounterUuid; + const lastviralLoadResult = patientToViralLoadMap.find( + (entry) => entry.patientId === patient.resource.id, + )?.viralLoadResult; + const lastviralLoadResultDate = patientToViralLoadMap.find( + (entry) => entry.patientId === patient.resource.id, + )?.viralLoadResultDate; + const lastViralLoadEncounterUuid = patientToViralLoadMap.find( + (entry) => entry.patientId === patient.resource.id, + )?.viralEncounterUuid; const patientActions = ( = ({ patientUuid }) => { const { t } = useTranslation(); const headerTitle = t('cd4', 'CD4'); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -72,7 +72,7 @@ const CD4OverviewList: React.FC = ({ patientUuid }) => { patientUuid={patientUuid} filter={cd4LabResultsFilter} encounterType={encounterTypes.CD4LabResultsEncounter_UUID} - formList={[{ name: formNames.CD4LabResultsFormName, uuid: formUuids.cd4LabResultsFormUuid }]} + formList={[{ name: formNames.CD4LabResultsFormName }]} columns={columns} description={headerTitle} headerTitle={headerTitle} diff --git a/packages/esm-hiv-app/src/views/lab-results/encounter-list/lab-results-encounter-list.component.tsx b/packages/esm-hiv-app/src/views/lab-results/encounter-list/lab-results-encounter-list.component.tsx index ad0f4a410..7d18fdeb0 100644 --- a/packages/esm-hiv-app/src/views/lab-results/encounter-list/lab-results-encounter-list.component.tsx +++ b/packages/esm-hiv-app/src/views/lab-results/encounter-list/lab-results-encounter-list.component.tsx @@ -15,7 +15,7 @@ interface LabResultsOverviewListProps { const LabResultsOverviewList: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -86,7 +86,7 @@ const LabResultsOverviewList: React.FC = ({ patient patientUuid={patientUuid} filter={viralLoadRequestFilter} encounterType={encounterTypes.ViralLoadResultsEncounter_UUID} - formList={[{ name: formNames.ViralLoadRequestFormName, uuid: formUuids.viralLoadRequestFormUuid }]} + formList={[{ name: formNames.ViralLoadRequestFormName }]} columns={columns} description={displayText} headerTitle={headerTitle} diff --git a/packages/esm-hiv-app/src/views/partner-notification-services/partner-notification.component.tsx b/packages/esm-hiv-app/src/views/partner-notification-services/partner-notification.component.tsx index b330551e3..09dad0ccb 100644 --- a/packages/esm-hiv-app/src/views/partner-notification-services/partner-notification.component.tsx +++ b/packages/esm-hiv-app/src/views/partner-notification-services/partner-notification.component.tsx @@ -17,7 +17,7 @@ interface PartnerNotificationListProps { const PartnerNotificationList: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -97,7 +97,7 @@ const PartnerNotificationList: React.FC = ({ patie patientUuid={patientUuid} filter={partnerNotificationFilter} encounterType={encounterTypes.PatnerNotificationEncounterType_UUID} - formList={[{ name: formNames.PartnerNotificationFormName, uuid: formUuids.partnerNotificationFormUuid }]} + formList={[{ name: formNames.PartnerNotificationFormName }]} columns={columns} description={headerTitle} headerTitle={headerTitle} diff --git a/packages/esm-hiv-app/src/views/partner-notification-services/tabs/contact-tracing.component.tsx b/packages/esm-hiv-app/src/views/partner-notification-services/tabs/contact-tracing.component.tsx index 2bdf7df75..7f9b383ac 100644 --- a/packages/esm-hiv-app/src/views/partner-notification-services/tabs/contact-tracing.component.tsx +++ b/packages/esm-hiv-app/src/views/partner-notification-services/tabs/contact-tracing.component.tsx @@ -11,7 +11,7 @@ interface ContactTracingListProps { const ContactTracingList: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columnsLab: EncounterListColumn[] = useMemo( () => [ @@ -70,7 +70,7 @@ const ContactTracingList: React.FC = ({ patientUuid }) = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columnsLab: EncounterListColumn[] = useMemo( () => [ @@ -70,7 +70,7 @@ const PatientTracingList: React.FC = ({ patientUuid }) = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const artConcepts = useMemo( () => @@ -189,7 +189,7 @@ const ArtTherapyTabList: React.FC = ({ patientUuid }) => = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columnsLab: EncounterListColumn[] = useMemo( () => [ @@ -67,7 +67,7 @@ const DeathTabList: React.FC = ({ patientUuid }) => { = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -95,7 +95,7 @@ const HIVEnrolmentTabList: React.FC = ({ patientUuid } = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -70,7 +70,7 @@ const ServiceDeliveryTabList: React.FC = ({ patient = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columnsLab: EncounterListColumn[] = useMemo( () => [ @@ -25,11 +25,7 @@ const TransferOutTabList: React.FC = ({ patientUuid }) key: 'visitDate', header: t('visitDate', 'Visit Date'), getValue: (encounter) => { - const obsVisitDate = getObsFromEncounter(encounter, obsConcepts.dateOfEncounterConcept, true); - const encounterDate = encounter.encounterDatetime; - return obsVisitDate === '--' && encounterDate - ? formatDate(parseDate(encounterDate), { mode: 'wide' }) - : obsVisitDate; + return getObsFromEncounter(encounter, obsConcepts.dateOfEncounterConcept, true); }, }, { @@ -89,7 +85,7 @@ const TransferOutTabList: React.FC = ({ patientUuid }) = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const columns: EncounterListColumn[] = useMemo( () => [ @@ -75,7 +75,7 @@ const ServiceEnrolmentWidget: React.FC = ({ patientUuid } = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const { obsConcepts, encounterTypes, formNames } = useConfig(); const headerTitle = t('clinicalVisit', 'Clinical Visit'); const displayText = t('clinicalVisit', 'Clinical Visit'); @@ -82,7 +82,7 @@ const ClinicalVisitList: React.FC = ({ patientUuid }) => { return htsPages.map((htsPage) => ({ diff --git a/packages/esm-ohri-core-app/src/index.ts b/packages/esm-ohri-core-app/src/index.ts index 01062df9e..3a22766ec 100644 --- a/packages/esm-ohri-core-app/src/index.ts +++ b/packages/esm-ohri-core-app/src/index.ts @@ -2,10 +2,16 @@ import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle, provide } from import { createOHRIPatientChartSideNavLink, patientChartDivider_dashboardMeta, + createOHRIDashboardLink, PatientList, PatientTable, } from '@ohri/openmrs-esm-ohri-commons-lib'; -import ProgramsHome from './ohri-dashboard/programs-home.component'; +import { + appointmentsDashboardMeta, + homeDashboardMeta, + dispensingDashboardMeta, + serviceQueuesDashboardMeta, +} from './dashboard.meta'; export const importTranslation = require.context('../translations', false, /.json$/, 'lazy'); @@ -20,6 +26,42 @@ export function startupApp() { defineConfigSchema(moduleName, {}); } +export const dashboard = getAsyncLifecycle(() => import('./root'), options); + +export const homeDashboard = getSyncLifecycle(createOHRIDashboardLink(homeDashboardMeta), options); + +export const patientList = getSyncLifecycle(PatientList, { + featureName: 'home', + moduleName, +}); + +export const appointmentsLink = getSyncLifecycle(createOHRIDashboardLink(appointmentsDashboardMeta), options); +export const appointmentsDashboard = getAsyncLifecycle( + () => import('./ohri-dashboard/appointments/appointments-dashboard.component'), + { + featureName: 'appointments-dashboard', + moduleName, + }, +); + +export const dispensingLink = getSyncLifecycle(createOHRIDashboardLink(dispensingDashboardMeta), options); +export const dispensingDashboard = getAsyncLifecycle( + () => import('./ohri-dashboard/dispensing/dispensing-dashboard.component'), + { + featureName: 'dispensing-dashboard', + moduleName, + }, +); + +export const serviceQueuesLink = getSyncLifecycle(createOHRIDashboardLink(serviceQueuesDashboardMeta), options); +export const serviceQueuesDashboard = getAsyncLifecycle( + () => import('./ohri-dashboard/service-queues/service-queues-dashboard.component'), + { + featureName: 'service-queues-dashboard', + moduleName, + }, +); + export const ohriNavItems = getAsyncLifecycle( () => import('./ohri-dashboard/side-menu/ohri-dashboard-side-nav.component'), { @@ -34,10 +76,3 @@ export const ohriClinicalViewsDivider = getSyncLifecycle( ); export const patientTable = getSyncLifecycle(PatientTable, options); - -export const patientList = getSyncLifecycle(PatientList, { - featureName: 'home', - moduleName, -}); - -export const programsText = getSyncLifecycle(ProgramsHome ,options); diff --git a/packages/esm-ohri-core-app/src/ohri-dashboard/appointments/appointments-dashboard.component.tsx b/packages/esm-ohri-core-app/src/ohri-dashboard/appointments/appointments-dashboard.component.tsx new file mode 100644 index 000000000..7b4197a9e --- /dev/null +++ b/packages/esm-ohri-core-app/src/ohri-dashboard/appointments/appointments-dashboard.component.tsx @@ -0,0 +1,8 @@ +import React, { useEffect } from 'react'; +import { attach, detach, ExtensionSlot } from '@openmrs/esm-framework'; + +const AppointmentsDashboard = () => { + return ; +}; + +export default AppointmentsDashboard; diff --git a/packages/esm-ohri-core-app/src/ohri-dashboard/dispensing/dispensing-dashboard.component.tsx b/packages/esm-ohri-core-app/src/ohri-dashboard/dispensing/dispensing-dashboard.component.tsx new file mode 100644 index 000000000..32f2bae7e --- /dev/null +++ b/packages/esm-ohri-core-app/src/ohri-dashboard/dispensing/dispensing-dashboard.component.tsx @@ -0,0 +1,13 @@ +import React, { useEffect } from 'react'; +import { attach, detach, ExtensionSlot } from '@openmrs/esm-framework'; + +const DispensingDashboard = () => { + useEffect(() => { + attach('ohri-dashboard-dispensing-slot', 'dispensing-dashboard'); + return () => detach('ohri-dashboard-dispensing-slot', 'dispensing-dashboard'); + }, []); + + return ; +}; + +export default DispensingDashboard; diff --git a/packages/esm-ohri-core-app/src/ohri-dashboard/programs-home.component.tsx b/packages/esm-ohri-core-app/src/ohri-dashboard/programs-home.component.tsx deleted file mode 100644 index a3257208d..000000000 --- a/packages/esm-ohri-core-app/src/ohri-dashboard/programs-home.component.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; - -const ProgramsHome = () => { - return
Programmes
; -}; - -export default ProgramsHome; diff --git a/packages/esm-ohri-core-app/src/ohri-dashboard/service-queues/service-queues-dashboard.component.tsx b/packages/esm-ohri-core-app/src/ohri-dashboard/service-queues/service-queues-dashboard.component.tsx new file mode 100644 index 000000000..9ab87c647 --- /dev/null +++ b/packages/esm-ohri-core-app/src/ohri-dashboard/service-queues/service-queues-dashboard.component.tsx @@ -0,0 +1,13 @@ +import React, { useEffect } from 'react'; +import { attach, detach, ExtensionSlot } from '@openmrs/esm-framework'; + +const ServiceQueuesDashboard = () => { + useEffect(() => { + attach('ohri-dashboard-service-queues-slot', 'service-queues-dashboard'); + return () => detach('ohri-dashboard-service-queues-slot', 'service-queues-dashboard'); + }, []); + + return ; +}; + +export default ServiceQueuesDashboard; diff --git a/packages/esm-ohri-core-app/src/root.tsx b/packages/esm-ohri-core-app/src/root.tsx new file mode 100644 index 000000000..6c7d6ac3b --- /dev/null +++ b/packages/esm-ohri-core-app/src/root.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'; +import OHRIDashboard from './ohri-dashboard/ohri-dashboard.component'; + +export default function Root() { + return ( + + + } /> + } /> + } /> + + + ); +} diff --git a/packages/esm-ohri-core-app/src/routes.json b/packages/esm-ohri-core-app/src/routes.json index 0831c732f..30d19b17b 100644 --- a/packages/esm-ohri-core-app/src/routes.json +++ b/packages/esm-ohri-core-app/src/routes.json @@ -3,8 +3,69 @@ "backendDependencies": { "webservices.rest": "^2.24.0" }, - "pages": [], + "pages": [ + { + "component": "dashboard", + "route": "dashboard" + }, + { + "component": "dashboard", + "route": "home" + } + ], "extensions": [ + { + "name": "home-dashboard-ext", + "slot": "dashboard-links-slot", + "component": "homeDashboard", + "meta": { + "title": "Home", + "name": "home", + "slot": "ohri-home-dashboard-slot", + "isLink": true + } + }, + { + "name": "ohri-patient-list", + "slot": "ohri-home-dashboard-slot", + "component": "patientList" + }, + { + "name": "appointments-ohri-dashboard-ext", + "slot": "dashboard-links-slot", + "component": "appointmentsLink" + }, + { + "name": "ohri-appointments-dashboard", + "slot": "ohri-appointments-dashboard-slot", + "component": "appointmentsDashboard" + }, + { + "name": "dispensing-ohri-dashboard-ext", + "slot": "dashboard-links-slot", + "component": "dispensingLink", + "meta": { + "title": "Dispensing", + "name": "dispensing", + "slot": "ohri-dispensing-dashboard-slot", + "isLink": true + } + }, + { + "name": "ohri-dispensing-dashboard", + "slot": "ohri-dispensing-dashboard-slot", + "component": "dispensingDashboard" + }, + { + "name": "service-queues-ohri-dashboard-ext", + "slot": "dashboard-links-slot", + "component": "serviceQueuesLink" + }, + { + "name": "ohri-service-queues-dashboard", + "slot": "ohri-service-queues-dashboard-slot", + "component": "serviceQueuesDashboard" + }, { "name": "ohri-nav-items-ext", "slot": "ohri-nav-items-slot", @@ -19,17 +80,6 @@ { "name": "patient-table", "component": "patientTable" - }, - { - "name": "ohri-patient-list", - "slot": "ohri-home-dashboard-slot", - "component": "patientList" - }, - { - "component": "programsText", - "name": "ohri-home-programs-text", - "slot": "homepage-dashboard-slot" , - "order": 4 } ] } diff --git a/packages/esm-ohri-pmtct-app/src/config-schema.ts b/packages/esm-ohri-pmtct-app/src/config-schema.ts index 3c7e055af..621ed759a 100644 --- a/packages/esm-ohri-pmtct-app/src/config-schema.ts +++ b/packages/esm-ohri-pmtct-app/src/config-schema.ts @@ -8,14 +8,6 @@ export const configSchema = { preferredIdentifierSource: '8549f706-7e85-4c1d-9424-217d50a2988b', }, }, - identifiersTypes: { - _type: Type.Object, - _description: 'Identifier types for PMTCT.', - _default: { - ptrackerIdentifierType: '4da0a3fe-e546-463f-81fa-084f098ff06c', - artUniqueNumberType: '9d6d1eec-2cd6-4637-a981-4a46b4b8b41f', - }, - }, formNames: { _type: Type.Object, _description: 'List of forms for PMTCT.', @@ -23,17 +15,6 @@ export const configSchema = { antenatal: 'Antenatal Form', labourAndDelivery: 'Labour & Delivery Form', motherPostnatal: 'Mother - Postnatal Form', - infantPostnatal: 'Infant - Postanal Form', - }, - }, - formUuids: { - _type: Type.Object, - _description: 'List of uuids for PMTCT forms.', - _default: { - antenatal: '5255a535-2acb-3f44-bd0a-3f80595dece1', - labourAndDelivery: '1e5614d6-5306-11e6-beb8-9e71128cae77', - motherPostnatal: 'e6b67aa4-6c59-4470-8ad5-b994efeda553', - infantPostnatal: '5022c5d7-ea45-47ce-bd65-1ba1d8ad2467', }, }, encounterTypes: { @@ -44,6 +25,8 @@ export const configSchema = { laborAndDelivery: '6dc5308d-27c9-4d49-b16f-2c5e3c759757', infantPostnatal: 'af1f1b24-d2e8-4282-b308-0bf79b365584', motherPostnatal: '269bcc7f-04f8-4ddc-883d-7a3a0d569aad', + PTrackerIdentifierType: '4da0a3fe-e546-463f-81fa-084f098ff06c', + artUniqueNumberType: '9d6d1eec-2cd6-4637-a981-4a46b4b8b41f', mchEncounterType: '12de5bc5-352e-4faf-9961-a2125085a75c', }, }, @@ -106,7 +89,6 @@ export const configSchema = { export interface ConfigObject { identifiers: Object; - identifiersTypes: Object; encounterTypes: Object; obsConcepts: Object; formNames: Object; diff --git a/packages/esm-ohri-pmtct-app/src/dashboard.meta.tsx b/packages/esm-ohri-pmtct-app/src/dashboard.meta.tsx index 622ff5445..9b24fad76 100644 --- a/packages/esm-ohri-pmtct-app/src/dashboard.meta.tsx +++ b/packages/esm-ohri-pmtct-app/src/dashboard.meta.tsx @@ -38,6 +38,13 @@ export const childVisitsDashboardMeta = { export const motherChildDashboardMeta = { name: 'mother-child-health', slot: 'mother-child-health-dashboard-slot', + config: { + columns: 1, + type: 'grid', + programme: 'pmtct', + dashboardTitle: 'Mother Child Health Home Page', + icon: PedestrianChild, + }, + isLink: true, title: 'Maternal & Child Health', - icon: PedestrianChild, }; diff --git a/packages/esm-ohri-pmtct-app/src/home.component.tsx b/packages/esm-ohri-pmtct-app/src/home.component.tsx deleted file mode 100644 index 7eb3a0666..000000000 --- a/packages/esm-ohri-pmtct-app/src/home.component.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import { OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib'; -import MaternalChildSummaryTiles from './views/summary-tabs/maternal-child-summary-tiles.component'; -import LabResultsSummary from './views/summary-tabs/mother-child-summary-tabs.component'; - -const Home: React.FC = () => { - return ( -
- - - -
- ); -}; - -export default Home; diff --git a/packages/esm-ohri-pmtct-app/src/index.ts b/packages/esm-ohri-pmtct-app/src/index.ts index 7097e1e25..3b2300081 100644 --- a/packages/esm-ohri-pmtct-app/src/index.ts +++ b/packages/esm-ohri-pmtct-app/src/index.ts @@ -1,4 +1,4 @@ -import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework'; +import { defineConfigSchema, getSyncLifecycle } from '@openmrs/esm-framework'; import MaternalSummary from './views/mch-summary/mch-summary.component'; import MaternalHealthList from './views/maternal-health/maternal-health.component'; import ChildHealthList from './views/child-health/child-health.component'; @@ -11,18 +11,17 @@ import { motherChildDashboardMeta, mchFolderMeta, } from './dashboard.meta'; +import { createDashboardGroup, createDashboardLink } from '@openmrs/esm-patient-common-lib'; import { registerPostSubmissionAction, registerExpressionHelper } from '@openmrs/openmrs-form-engine-lib'; import { createConditionalDashboardLink, - createNewOHRIDashboardLink, + createOHRIDashboardLink, OHRIHome, OHRIWelcomeSection, createConditionalDashboardGroup, } from '@ohri/openmrs-esm-ohri-commons-lib'; import { generateInfantPTrackerId } from './utils/pmtct-helpers'; import { configSchema } from './config-schema'; -import rootComponent from './root.component'; -import { createDashboardLink } from '@openmrs/esm-patient-common-lib'; export const importTranslation = require.context('../translations', false, /.json$/, 'lazy'); @@ -50,26 +49,16 @@ export function startupApp() { name: 'ArtSubmissionAction', load: () => import('./post-submission-actions/art-linkage-action'), }); - - import('./utils/pmtct-helpers').then(({ generateInfantPTrackerId }) => { - registerExpressionHelper('customGenerateInfantPTrackerId', generateInfantPTrackerId); - }); + registerExpressionHelper('customGenerateInfantPTrackerId', generateInfantPTrackerId); } -export const root = getSyncLifecycle(rootComponent, options); - -export const maternalChildDashboardLink = getSyncLifecycle( - createNewOHRIDashboardLink(motherChildDashboardMeta), - options, -); - export const mchDashboard = getSyncLifecycle(createConditionalDashboardGroup(mchFolderMeta), options); export const mchSummaryDashboardLink = getSyncLifecycle( createDashboardLink({ ...mchSummaryDashboardMeta, moduleName }), options, ); -export const mchSummaryDashboard = getAsyncLifecycle(() => import('./views/mch-summary/mch-summary.component'), { +export const mchSummaryDashboard = getSyncLifecycle(MaternalSummary, { featureName: 'mch-summary', moduleName, }); @@ -93,6 +82,7 @@ export const childVisitsDashboard = getSyncLifecycle(ChildHealthList, { featureName: 'maternal-visits', moduleName, }); +export const maternalChildDashboardLink = getSyncLifecycle(createOHRIDashboardLink(motherChildDashboardMeta), options); export const maternalChildDashboard = getSyncLifecycle(OHRIHome, { featureName: 'mother child health results dashboard', moduleName, diff --git a/packages/esm-ohri-pmtct-app/src/post-submission-actions/art-linkage-action.ts b/packages/esm-ohri-pmtct-app/src/post-submission-actions/art-linkage-action.ts index fa2062bfb..6e20c5a72 100644 --- a/packages/esm-ohri-pmtct-app/src/post-submission-actions/art-linkage-action.ts +++ b/packages/esm-ohri-pmtct-app/src/post-submission-actions/art-linkage-action.ts @@ -13,8 +13,9 @@ const ArtSubmissionAction: PostSubmissionAction = { return; } - let artNumber = encounter.obs.find((observation) => observation.concept.uuid === config.obsConcepts.artNoConcept) - ?.value; + let artNumber = encounter.obs.find( + (observation) => observation.concept.uuid === config.obsConcepts.artNoConcept, + )?.value; if (!artNumber) { return; } @@ -25,7 +26,7 @@ const ArtSubmissionAction: PostSubmissionAction = { //Patient can only have one ART No. const patientIdentifiers = await fetchPatientIdentifiers(patient.id); const existingArtNumbers = patientIdentifiers.filter( - (id) => id.identifierType.uuid === config.identifiersTypes.artUniqueNumberType, + (id) => id.identifierType.uuid === config.encounterTypes.artUniqueNumberType, ); if (existingArtNumbers.length > 0) { return; @@ -34,7 +35,7 @@ const ArtSubmissionAction: PostSubmissionAction = { //add current art number to identities const currentArtNumberObject: PatientIdentifier = { identifier: artNumber, - identifierType: config.identifiersTypes.artUniqueNumberType, + identifierType: config.encounterTypes.artUniqueNumberType, location: encounterLocation, preferred: false, }; diff --git a/packages/esm-ohri-pmtct-app/src/post-submission-actions/current-ptracker-action.ts b/packages/esm-ohri-pmtct-app/src/post-submission-actions/current-ptracker-action.ts index 214d4ecde..de7a54fd0 100644 --- a/packages/esm-ohri-pmtct-app/src/post-submission-actions/current-ptracker-action.ts +++ b/packages/esm-ohri-pmtct-app/src/post-submission-actions/current-ptracker-action.ts @@ -18,16 +18,12 @@ export const PTrackerSubmissionAction: PostSubmissionAction = { export async function updatePatientPtracker(encounter, encounterLocation, patientUuid) { const config = await getConfig('@ohri/openmrs-esm-ohri-pmtct'); - const inComingPTrackerID = encounter.obs.find( - (observation) => observation.concept.uuid === config.obsConcepts.pTrackerIdConcept, - )?.value; + const inComingPTrackerID = encounter.obs.find((observation) => observation.concept.uuid === config.obsConcepts.pTrackerIdConcept)?.value; if (!inComingPTrackerID) { return; } const patientIdentifiers = await fetchPatientIdentifiers(patientUuid); - const existingPTrackers = patientIdentifiers.filter( - (id) => id.identifierType.uuid === config.identifiersTypes.ptrackerIdentifierType, - ); + const existingPTrackers = patientIdentifiers.filter((id) => id.identifierType.uuid === config.encounterTypes.PTrackerIdentifierType); if (existingPTrackers.some((ptracker) => ptracker.identifier === inComingPTrackerID)) { return; } @@ -35,7 +31,7 @@ export async function updatePatientPtracker(encounter, encounterLocation, patien //add current ptracker to identities const currentPTrackerObject: PatientIdentifier = { identifier: inComingPTrackerID, - identifierType: config.identifiersTypes.ptrackerIdentifierType, + identifierType: config.encounterTypes.PTrackerIdentifierType, location: encounterLocation, preferred: false, }; diff --git a/packages/esm-ohri-pmtct-app/src/root.component.tsx b/packages/esm-ohri-pmtct-app/src/root.component.tsx deleted file mode 100644 index 5136ae080..000000000 --- a/packages/esm-ohri-pmtct-app/src/root.component.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { SWRConfig } from 'swr'; -import { BrowserRouter, Route, Routes } from 'react-router-dom'; -import Home from './home.component'; - -const swrConfiguration = { - // Maximum number of retries when the backend returns an error - errorRetryCount: 3, -}; - -const RootComponent: React.FC = () => { - const mchBasename = window.getOpenmrsSpaBase() + 'home/mother-child-health'; - - return ( -
- - - - } /> - - - -
- ); -}; - -export default RootComponent; diff --git a/packages/esm-ohri-pmtct-app/src/routes.json b/packages/esm-ohri-pmtct-app/src/routes.json index a5021cac3..6597cc222 100644 --- a/packages/esm-ohri-pmtct-app/src/routes.json +++ b/packages/esm-ohri-pmtct-app/src/routes.json @@ -3,24 +3,9 @@ "backendDependencies": { "webservices.rest": "^2.24.0" }, - "pages": [], + "pages": [ + ], "extensions": [ - { - "name": "maternal-child-health-results-summary", - "slot": "homepage-dashboard-slot", - "component": "maternalChildDashboardLink", - "meta": { - "title": "Maternal & Child Health", - "name": "mother-child-health", - "slot": "mother-child-health-dashboard-slot" - }, - "order": 6 - }, - { - "name": "mother-child-health-dashboard", - "slot": "mother-child-health-dashboard-slot", - "component": "root" - }, { "name": "mch", "slot": "patient-chart-dashboard-slot", @@ -77,6 +62,53 @@ "name": "child-visits-summary-ext", "slot": "child-visits-summary-slot", "component": "childVisitsDashboard" + }, + { + "name": "maternal-child-health-results-summary", + "slot": "dashboard-slot", + "component": "maternalChildDashboardLink", + "meta": { + "title": "Maternal & Child Health", + "path": "Maternal & Child Health", + "slot": "mother-child-health-dashboard-slot", + "config": { + "columns": 1, + "type": "grid", + "programme": "pmtct", + "dashboardTitle": "Mother and Child Health" + }, + "isLink": true + } + }, + { + "name": "mother-child-health-results-dashboard", + "slot": "mother-child-health-dashboard-slot", + "component": "maternalChildDashboard", + "meta": { + "name": "mother-child-health", + "slot": "mother-child-health-dashboard-slot", + "config": { + "columns": 1, + "programme": "pmtct", + "dashboardTitle": "Mother Child Health Home Page" + }, + "title": "Maternal & Child Health" + } + }, + { + "name": "pmtct-home-header-slot", + "slot": "pmtct-home-header-slot", + "component": "pmtctDashboardHeader" + }, + { + "name": "pmtct-home-tiles-ext", + "slot": "pmtct-home-tiles-slot", + "component": "pmtctDashboardTiles" + }, + { + "name": "pmtct-home-tabs-ext", + "slot": "pmtct-home-tabs-slot", + "component": "pmtctDashboardTabs" } ] } diff --git a/packages/esm-ohri-pmtct-app/src/views/child-health/tabs/infant-postnatal-care.component.tsx b/packages/esm-ohri-pmtct-app/src/views/child-health/tabs/infant-postnatal-care.component.tsx index 922cc67fd..4c4f7b9a4 100644 --- a/packages/esm-ohri-pmtct-app/src/views/child-health/tabs/infant-postnatal-care.component.tsx +++ b/packages/esm-ohri-pmtct-app/src/views/child-health/tabs/infant-postnatal-care.component.tsx @@ -17,7 +17,7 @@ const InfantPostnatalList: React.FC = ({ patientUuid } const { t } = useTranslation(); const config = useConfig(); const headerTitle = t('hivExposedInfant', 'HIV Exposed Infant'); - const { encounterTypes, formNames, formUuids } = useConfig(); + const InfantPNCEncounterTypeUUID = config.encounterTypes.infantPostnatal; async function fetchMotherName() { let motherName = '--'; @@ -105,8 +105,8 @@ const InfantPostnatalList: React.FC = ({ patientUuid } return ( = ({ patientUuid }) => const { t } = useTranslation(); const config = useConfig(); const headerTitle = t('antenatalCare', 'Antenatal Care'); - const { encounterTypes, formNames, formUuids } = useConfig(); + const ANCEncounterTypeUUID = config.encounterTypes.antenatal; const columns: EncounterListColumn[] = useMemo( () => [ @@ -31,10 +31,10 @@ const AntenatalCareList: React.FC = ({ patientUuid }) => }, }, { - key: 'hivTestStatus', - header: t('hivTestStatus', 'HIV Test Status'), + key: 'hivTestResults', + header: t('hivTestResults', 'HIV Test Results'), getValue: (encounter) => { - return getObsFromEncounter(encounter, config.obsConcepts.hivTestStatus); + return getObsFromEncounter(encounter, config.obsConcepts.hivTestResultConcept); }, }, { @@ -99,8 +99,8 @@ const AntenatalCareList: React.FC = ({ patientUuid }) => return ( = ({ patientUuid }) const { t } = useTranslation(); const config = useConfig(); const headerTitle = t('labourAndDelivery', 'Labour and Delivery'); - const { encounterTypes, formNames, formUuids } = useConfig(); + const LNDEncounterTypeUUID = config.encounterTypes.laborAndDelivery; const columns: EncounterListColumn[] = useMemo( () => [ @@ -38,10 +38,10 @@ const LabourDeliveryList: React.FC = ({ patientUuid }) }, }, { - key: 'hivTestStatus', - header: t('hivTestStatus', 'HIV Test Status'), + key: 'hivTestResults', + header: t('hivTestResults', 'HIV Test Results'), getValue: (encounter) => { - return getObsFromEncounter(encounter, config.obsConcepts.hivTestStatus); + return getObsFromEncounter(encounter, config.obsConcepts.ancHivResultConcept); }, }, { @@ -85,8 +85,8 @@ const LabourDeliveryList: React.FC = ({ patientUuid }) return ( = ({ patientUuid }) => const { t } = useTranslation(); const config = useConfig(); const headerTitle = t('postnatalCare', 'Postnatal Care'); - const { encounterTypes, formNames, formUuids } = useConfig(); + const MotherPNCEncounterTypeUUID = config.encounterTypes.motherPostnatal; const columns: EncounterListColumn[] = useMemo( () => [ @@ -34,7 +34,7 @@ const PostnatalCareList: React.FC = ({ patientUuid }) => key: 'currentHivStatus', header: t('currentHivStatus', 'Current HIV Status'), getValue: (encounter) => { - return getObsFromEncounter(encounter, config.obsConcepts.hivTestStatus); + return getObsFromEncounter(encounter, config.obsConcepts.MotherHivStatus); }, }, { @@ -85,8 +85,8 @@ const PostnatalCareList: React.FC = ({ patientUuid }) => return ( = ({ patientUuid }) => { const [relativeToIdentifierMap, setRelativeToIdentifierMap] = useState([]); const [pregnancyOutcomes, setPregnancyOutcomes] = useState([]); const [infantOutcomes, setInfantOutcomes] = useState([]); - const { formNames, encounterTypes, obsConcepts, formUuids } = useConfig(); - const [totalAncCount, setTotalAncCount] = useState(null); - - useEffect(() => { - const fetchData = async () => { - try { - const [totalAncCount] = await Promise.all([fetchMambaReportData('no_of_anc_visits')]); - - setTotalAncCount(totalAncCount); - } catch (error) { - console.error('Error fetching data:', error); - throw new Error('Error fetching data. Please try again.'); - } - }; - - fetchData(); - }, []); + const { formNames, encounterTypes, obsConcepts } = useConfig(); const headersFamily = [ { @@ -237,32 +220,12 @@ const CurrentPregnancy: React.FC = ({ patientUuid }) => { { key: 'motherHIVStatus', header: t('motherHIVStatus', 'Mother HIV Status'), - encounterTypes: [encounterTypes.motherPostnatal, encounterTypes.labourAndDelivery, encounterTypes.antenatal], - getObsValue: (encounters) => { - const pncArtData = { - artInitiation: getObsFromEncounter(encounters[0], obsConcepts.artInitiationConcept), - motherHIVStatus: getObsFromEncounter(encounters[0], obsConcepts.hivTestResultConcept), - pTrackerId: getObsFromEncounter(encounters[0], obsConcepts.pTrackerIdConcept), - }; - const lndArtData = { - artInitiation: getObsFromEncounter(encounters[1], obsConcepts.artInitiationConcept), - motherHIVStatus: getObsFromEncounter(encounters[1], obsConcepts.hivTestResultConcept), - pTrackerId: getObsFromEncounter(encounters[1], obsConcepts.pTrackerIdConcept), - }; - const ancArtData = { - artInitiation: getObsFromEncounter(encounters[2], obsConcepts.artInitiationConcept), - motherHIVStatus: getObsFromEncounter(encounters[2], obsConcepts.hivTestResultConcept), - pTrackerId: getObsFromEncounter(encounters[2], obsConcepts.pTrackerIdConcept), - }; - const latestArtData = getLatestArtDetails(pncArtData, lndArtData, ancArtData); - if (!latestArtData['motherHIVStatus']) { - return '--'; - } - - return latestArtData['motherHIVStatus']; + encounterTypes: [encounterTypes.labourAndDelivery], + getObsValue: async ([encounter]) => { + const currentPTrackerId = getObsFromEncounter(encounter, obsConcepts.pTrackerIdConcept); + return '--'; }, }, - { key: 'expectedDeliveryDate', header: t('expectedDeliveryDate', 'Expected Delivery Date'), @@ -283,7 +246,7 @@ const CurrentPregnancy: React.FC = ({ patientUuid }) => { key: 'motherStatus', header: t('motherStatus', 'Mother Status'), encounterTypes: [encounterTypes.labourAndDelivery], - getObsValue: async ([encounter]) => { + getObsValue: (encounter) => { return getObsFromEncounter(encounter, obsConcepts.motherStatusConcept); }, }, @@ -368,11 +331,14 @@ const CurrentPregnancy: React.FC = ({ patientUuid }) => { header: t('ancVisitsAttended', 'ANC visits attended'), encounterTypes: [encounterTypes.antenatal], getObsValue: async ([encounter]) => { - return totalAncCount; + const currentPTrackerId = getObsFromEncounter(encounter, obsConcepts.pTrackerIdConcept); + // const totalVisits = await getAncVisitCount(currentPTrackerId, patientUuid); + // return totalVisits.rows.length ? totalVisits.rows[0].total : '0'; + return '--'; }, }, ], - [totalAncCount], + [], ); const columnsMotherPreviousVisit: EncounterListColumn[] = useMemo( @@ -500,9 +466,9 @@ const CurrentPregnancy: React.FC = ({ patientUuid }) => { description={previousVisitsTitle} headerTitle={previousVisitsTitle} formList={[ - { name: formNames.antenatal, uuid: '' }, - { name: formNames.labourAndDelivery, uuid: formUuids.labourAndDelivery }, - { name: formNames.motherPostnatal, uuid: formUuids.motherPostnatal }, + { name: formNames.antenatal }, + { name: formNames.labourAndDelivery }, + { name: formNames.motherPostnatal }, ]} launchOptions={{ hideFormLauncher: true, diff --git a/packages/esm-ohri-pmtct-app/src/views/mch-summary/tabs/hiv-exposed-infant.component.tsx b/packages/esm-ohri-pmtct-app/src/views/mch-summary/tabs/hiv-exposed-infant.component.tsx index 5d10e26ff..369f9f550 100644 --- a/packages/esm-ohri-pmtct-app/src/views/mch-summary/tabs/hiv-exposed-infant.component.tsx +++ b/packages/esm-ohri-pmtct-app/src/views/mch-summary/tabs/hiv-exposed-infant.component.tsx @@ -22,9 +22,9 @@ const HivExposedInfant: React.FC<{ dateOfBirth: string; }> = ({ patientUuid, dateOfBirth }) => { const { t } = useTranslation(); + const config = useConfig(); const [relatives, setRelatives] = useState([]); const [relativeToIdentifierMap, setRelativeToIdentifierMap] = useState([]); - const { formNames, formUuids, encounterTypes, obsConcepts } = useConfig(); useEffect(() => { getParentRelationships(); @@ -35,33 +35,33 @@ const HivExposedInfant: React.FC<{ { key: 'artProphylaxisStatus', header: t('artProphylaxisStatus', 'ART Prophylaxis Status'), - encounterTypes: [encounterTypes.infantPostnatal], + encounterTypes: [config.encounterTypes.infantPostnatal], getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.artProphylaxisStatus); + return getObsFromEncounter(encounter, config.obsConcepts.artProphylaxisStatus); }, }, { key: 'breastfeeding', header: t('breastfeeding', 'Breastfeeding'), - encounterTypes: [encounterTypes.infantPostnatal], + encounterTypes: [config.encounterTypes.infantPostnatal], getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.breastfeedingStatus); + return getObsFromEncounter(encounter, config.obsConcepts.breastfeedingStatus); }, }, { key: 'hivStatus', header: t('hivStatus', 'HIV Status'), - encounterTypes: [encounterTypes.infantPostnatal], + encounterTypes: [config.encounterTypes.infantPostnatal], getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.finalTestResults); + return getObsFromEncounter(encounter, config.obsConcepts.finalTestResults); }, }, { key: 'finalOutcome', header: t('finalOutcome', 'Final Outcome'), - encounterTypes: [encounterTypes.infantPostnatal], + encounterTypes: [config.encounterTypes.infantPostnatal], getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.outcomeStatus); + return getObsFromEncounter(encounter, config.obsConcepts.outcomeStatus); }, }, ], @@ -74,21 +74,21 @@ const HivExposedInfant: React.FC<{ key: 'date', header: t('date', 'Date'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.artStartDate, true); + return getObsFromEncounter(encounter, config.obsConcepts.artStartDate, true); }, }, { key: 'testType', header: t('testType', 'Test Type'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.testTypeConcept); + return getObsFromEncounter(encounter, config.obsConcepts.testTypeConcept); }, }, { key: 'ageAtTimeOfTest', header: t('ageAtTimeOfTest', 'Age at time of test'), getValue: (encounter) => { - const artDate = getObsFromEncounter(encounter, obsConcepts.artStartDate); + const artDate = getObsFromEncounter(encounter, config.obsConcepts.artStartDate); return artDate ? dayjs().diff(dayjs(artDate), 'day') : '--'; }, }, @@ -96,7 +96,7 @@ const HivExposedInfant: React.FC<{ key: 'hivStatus', header: t('hivStatus', 'HIV Status'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.finalTestResults); + return getObsFromEncounter(encounter, config.obsConcepts.finalTestResults); }, }, ]; @@ -148,7 +148,7 @@ const HivExposedInfant: React.FC<{ const identifiers = await fetchPatientIdentifiers(patientUuid); if (identifiers) { pTrackerMap.pTrackerId = identifiers.find( - (id) => id.identifierType.uuid === encounterTypes.PTrackerIdentifierType, + (id) => id.identifierType.uuid === config.encounterTypes.PTrackerIdentifierType, ).identifier; pTrackerMap.patientId = patientUuid; } @@ -193,7 +193,7 @@ const HivExposedInfant: React.FC<{ key: 'visitDate', header: t('visitDate', 'Visit date'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.infantVisitDate, true); + return getObsFromEncounter(encounter, config.obsConcepts.infantVisitDate, true); }, }, { @@ -207,7 +207,7 @@ const HivExposedInfant: React.FC<{ key: 'nextFollowUpDate', header: t('nextFollowUpDate', 'Next Follow-up date'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.followUpDateConcept, true); + return getObsFromEncounter(encounter, config.obsConcepts.followUpDateConcept, true); }, }, { @@ -239,8 +239,8 @@ const HivExposedInfant: React.FC<{ { +interface OverviewListProps { + patientUuid: string; +} + +const LabResultsSummary: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); return ( diff --git a/packages/esm-ohri-pmtct-app/translations/en.json b/packages/esm-ohri-pmtct-app/translations/en.json index ed118c825..ddcf1dc3a 100644 --- a/packages/esm-ohri-pmtct-app/translations/en.json +++ b/packages/esm-ohri-pmtct-app/translations/en.json @@ -39,7 +39,6 @@ "hivMonitoring": "HIV Monitoring", "hivStatus": "HIV Status", "hivTestResults": "HIV Test Results", - "hivTestStatus": "HIV Test Status", "infantPostnatalCare": "Infant Postnatal Care", "infantPostnatalVisit": "Infant Postnatal Visit", "infantStatus": "Infant Status at Birth", diff --git a/packages/esm-opd-app/package.json b/packages/esm-opd-app/package.json deleted file mode 100644 index 878c7a19d..000000000 --- a/packages/esm-opd-app/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "@ohri/openmrs-esm-ohri-opd-app", - "version": "2.2.0", - "description": "opd active visits", - "browser": "dist/openmrs-esm-ohri-opd-app.js", - "main": "src/index.ts", - "license": "MIT", - "homepage": "https://github.com/UCSF-IGHS/openmrs-esm-ohri#readme", - "scripts": { - "start": "openmrs develop", - "serve": "webpack serve --mode=development", - "debug": "npm run serve", - "build": "webpack --mode production", - "analyze": "webpack --mode=production --env.analyze=true", - "lint": "eslint src --ext tsx", - "typescript": "tsc", - "prepublishOnly": "npm run build", - "extract-translations": "i18next 'src/**/*.component.tsx'" - }, - "browserslist": [ - "extends browserslist-config-openmrs" - ], - "keywords": [ - "openmrs", - "ohri", - "opd" - ], - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/UCSF-IGHS/openmrs-esm-ohri.git" - }, - "bugs": { - "url": "https://github.com/UCSF-IGHS/openmrs-esm-ohri/issues" - }, - "dependencies": { - "@carbon/react": "^1.13.0", - "@ohri/esm-patient-chart-app": "7.1.0-5" - }, - "peerDependencies": { - "@ohri/esm-patient-chart-app": "7.1.0-5", - "@openmrs/esm-framework": "5.x", - "@openmrs/esm-patient-common-lib": "6.x", - "dayjs": "1.x", - "react": "18.x", - "react-i18next": "11.x", - "swr": "2.x" - }, - "devDependencies": { - "@ohri/esm-patient-chart-app": "7.1.0-5", - "webpack": "^5.88.2" - } -} diff --git a/packages/esm-opd-app/src/config-schema.ts b/packages/esm-opd-app/src/config-schema.ts deleted file mode 100644 index 11f523bd0..000000000 --- a/packages/esm-opd-app/src/config-schema.ts +++ /dev/null @@ -1 +0,0 @@ -export const configSchema = {}; diff --git a/packages/esm-opd-app/src/dashboard.meta.tsx b/packages/esm-opd-app/src/dashboard.meta.tsx deleted file mode 100644 index 29c682181..000000000 --- a/packages/esm-opd-app/src/dashboard.meta.tsx +++ /dev/null @@ -1,12 +0,0 @@ -export const opdFolderMeta = { - title: 'OPD', - slotName: 'opd-slot', - isExpanded: false, -}; - -export const activeVisitDashboardMeta = { - slot: 'patient-chart-active-visit-dashboard-slot', - columns: 1, - path: 'Active Visits', - title: 'Active Visits', -}; diff --git a/packages/esm-opd-app/src/dashboard.scss b/packages/esm-opd-app/src/dashboard.scss deleted file mode 100644 index 009007b57..000000000 --- a/packages/esm-opd-app/src/dashboard.scss +++ /dev/null @@ -1,21 +0,0 @@ -@import "./root.scss"; - -.noMarker { - list-style-type: none; -} - -.noMarker ul li a { - padding-left: 40px !important; - font: lighter; -} - -.currentNavItem > a { - background-color: #cecece !important; - color: #161616 !important; - border-left-color: var(--brand-01) !important; - font: bolder; -} - -.hide { - display: none; -} diff --git a/packages/esm-opd-app/src/declarations.d.tsx b/packages/esm-opd-app/src/declarations.d.tsx deleted file mode 100644 index 875203d56..000000000 --- a/packages/esm-opd-app/src/declarations.d.tsx +++ /dev/null @@ -1,2 +0,0 @@ -declare module '*.css'; -declare module '*.scss'; diff --git a/packages/esm-opd-app/src/index.ts b/packages/esm-opd-app/src/index.ts deleted file mode 100644 index 14733e5e2..000000000 --- a/packages/esm-opd-app/src/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle, registerFeatureFlag } from '@openmrs/esm-framework'; -import { opdFolderMeta, activeVisitDashboardMeta } from './dashboard.meta'; -import { createDashboardGroup, createDashboardLink } from '@openmrs/esm-patient-common-lib'; -import { configSchema } from './config-schema'; - -export const importTranslation = require.context('../translations', false, /.json$/, 'lazy'); - -require('./root.scss'); - -export const moduleName = '@ohri/openmrs-esm-ohri-opd-app'; - -const options = { - featureName: 'ohri-opd', - moduleName, -}; - -export function startupApp() { - defineConfigSchema(moduleName, configSchema); -} - -export const opdPatientChartDashboard = getSyncLifecycle(createDashboardGroup(opdFolderMeta), options); - -export const activeVisitDashboardLink = getSyncLifecycle( - createDashboardLink({ - ...activeVisitDashboardMeta, - moduleName, - }), - { featureName: 'active-visit', moduleName }, -); diff --git a/packages/esm-opd-app/src/root.scss b/packages/esm-opd-app/src/root.scss deleted file mode 100644 index c504fa3d9..000000000 --- a/packages/esm-opd-app/src/root.scss +++ /dev/null @@ -1,116 +0,0 @@ -@use '@carbon/styles/scss/spacing'; -@use '@carbon/styles/scss/type'; -@import '~@openmrs/esm-styleguide/src/vars'; - -$ui-01: #f4f4f4; -$ui-02: #ffffff; -$ui-03: #e0e0e0; -$ui-05: #161616; -$ui-background: #ffffff; -$color-gray-70: #525252; -$color-blue-60-2: #0f62fe; -$color-yellow-50: #feecae; -$inverse-support-03: #f1c21b; -$warning-background: #fff8e1; -$openmrs-background-grey: #f4f4f4; -$danger: #da1e28; -$interactive-01: #0f62fe; -$brand-teal-01: #3197D9; -$ohri-input-width: 22.313rem; -$ohri-home-background: #ededed; -$button-primary: #0078A6; - -.productiveHeading01 { - @include type.type-style("heading-compact-01"); -} - -.productiveHeading02 { - @include type.type-style("heading-compact-02"); -} - -.productiveHeading03 { - @include type.type-style("heading-03"); -} - -.productiveHeading04 { - @include type.type-style("heading-04"); -} - -.productiveHeading05 { - @include type.type-style("heading-05"); -} - -.productiveHeading06 { - @include type.type-style("heading-06"); -} - -.bodyShort01 { - @include type.type-style("body-compact-01"); -} - -.helperText01 { - @include type.type-style("helper-text-01"); -} - -.bodyShort02 { - @include type.type-style("body-compact-02"); -} - -.bodyLong01 { - @include type.type-style("body-01"); -} - -.bodyLong02 { - @include type.type-style("body-02"); -} - -.label01 { - @include type.type-style("label-01"); -} - -.text02 { - color: $text-02; -} - -aside { - background-color: $ui-02 !important; -} - -// Login Overrides - -div[class*='-esm-login__styles__center'] > img { - width: 140px; // design has 120px -} - -:global(.tab-12rem) > button { - width: 12rem !important; -} - -:global(.tab-14rem) > button { - width: 14rem !important; -} - -:global(.tab-16rem) > button { - width: 16rem !important; -} - -:global(.cds--overflow-menu) > div { - width: 15rem !important; -} - -nav :global(.cds--accordion__title) { - color: #525252; - font-weight: 600 !important; -} - -nav :global(.cds--accordion__content) { - padding-bottom: 0 !important; - padding-top: 0 !important; -} - -nav :global(.cds--accordion__content) > a { - background-color: #cecece !important; - color: #161616 !important; - border-left-color: var(--brand-01) !important; - font: bolder; -} diff --git a/packages/esm-opd-app/src/routes.json b/packages/esm-opd-app/src/routes.json deleted file mode 100644 index a2c331b41..000000000 --- a/packages/esm-opd-app/src/routes.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "https://json.openmrs.org/routes.schema.json", - "backendDependencies": { - "webservices.rest": "^2.24.0" - }, - "pages": [ - ], - "extensions": [ - { - "name": "opd", - "slot": "patient-chart-dashboard-slot", - "component": "opdPatientChartDashboard", - "order": 25, - "meta": { - "path": "OPD", - "slot": "opd-slot", - "isExpanded": false - } - }, - { - "name": "active-visit-summary-dashboard", - "component": "activeVisitDashboardLink", - "slot": "opd-slot", - "meta": { - "slot": "patient-chart-active-visit-dashboard-slot", - "columns": 1, - "path": "Active Visits" - } - }, - { - "name": "opd-summary-ext", - "slot": "opd-summary-slot", - "component": "opdSummaryDashboard" - } - - - ] -} diff --git a/packages/esm-opd-app/src/setupTests.ts b/packages/esm-opd-app/src/setupTests.ts deleted file mode 100644 index 3abed9870..000000000 --- a/packages/esm-opd-app/src/setupTests.ts +++ /dev/null @@ -1,15 +0,0 @@ -import '@testing-library/jest-dom'; - -declare global { - interface Window { - openmrsBase: string; - spaBase: string; - } -} - -const { getComputedStyle } = window; -window.getComputedStyle = (element) => getComputedStyle(element); -window.openmrsBase = '/openmrs'; -window.spaBase = '/spa'; -window.getOpenmrsSpaBase = () => '/openmrs/spa/'; -window.HTMLElement.prototype.scrollIntoView = jest.fn(); diff --git a/packages/esm-opd-app/translations/en.json b/packages/esm-opd-app/translations/en.json deleted file mode 100644 index 0967ef424..000000000 --- a/packages/esm-opd-app/translations/en.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/packages/esm-opd-app/tsconfig.json b/packages/esm-opd-app/tsconfig.json deleted file mode 100644 index db240ff83..000000000 --- a/packages/esm-opd-app/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true, - "module": "esnext", - "allowSyntheticDefaultImports": true, - "jsx": "react", - "skipLibCheck": true, - "moduleResolution": "node", - "lib": [ - "dom", - "es5", - "scripthost", - "es2015", - "es2015.promise", - "es2016.array.include", - "es2018", - "es2020" - ], - "resolveJsonModule": true, - "noEmit": true, - "target": "esnext", - "paths": { - "@openmrs/*": [ - "./node_modules/@openmrs/*" - ] - } - } -} diff --git a/packages/esm-opd-app/webpack.config.js b/packages/esm-opd-app/webpack.config.js deleted file mode 100644 index b15408968..000000000 --- a/packages/esm-opd-app/webpack.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const path = require('path'); -const config = (module.exports = require('openmrs/default-webpack-config')); -config.scriptRuleConfig.exclude = - path.sep == '/' - ? /(node_modules[^\/@openmrs\/esm\-patient\-common\-lib])/ - : /(node_modules[^\\@openmrs\/esm\-patient\-common\-lib])/; - -// Temporary fix to resolve webpack issues with imports from the commons library -config.overrides.resolve = { - extensions: ['.tsx', '.ts', '.jsx', '.js', '.scss'], - alias: { - '@openmrs/esm-framework': '@openmrs/esm-framework/src/internal', - '@ohri/openmrs-esm-ohri-commons-lib': path.resolve(__dirname, '../esm-commons-lib/src/index'), - '@openmrs/openmrs-form-engine-lib': '@openmrs/openmrs-form-engine-lib/src/index', - }, -}; -module.exports = config; diff --git a/packages/esm-tb-app/src/config-schema.ts b/packages/esm-tb-app/src/config-schema.ts index b0c9fc217..f3a3121c0 100644 --- a/packages/esm-tb-app/src/config-schema.ts +++ b/packages/esm-tb-app/src/config-schema.ts @@ -16,8 +16,6 @@ export const configSchema = { tbPatientTracing: '98c938e9-fb3e-4982-ae22-0305cbd12f8c', tbProgramEnrollment: '9a199b59-b185-485b-b9b3-a9754e65ae57', tbTreatmentAndFollowUp: '1881304a-4854-4927-b0b1-a6231d61e43c', - tptCaseEnrollment: 'dc6ce80c-83f8-4ace-a638-21df78542551', - tptTreatmentAndFollowUp: '1ac3de3f-8fc2-43a7-addb-e805c393ecae', }, }, obsConcepts: { @@ -49,17 +47,6 @@ export const configSchema = { tBEnrollmentType: '163775AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', dsTBEnrollment: '160541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', dRTBEnrollment: '160052AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptTreatmentId: '162727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptEnrollmentDate: '164852AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptIndication: '162276AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptRegimen: '1264AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptAppointmentDate: '5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptAdherence: '164075AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptTreatmentStartDate: '162320AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptOutcome: '1266AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptOutcomeDate: '163284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - tptDateOutcome: '163284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', - treatmentPlan: '1265AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', }, }, cohorts: { @@ -67,31 +54,6 @@ export const configSchema = { _description: 'TB Cohort uuid.', _default: { clientsEnrolledForTb: '98fd11ba-cb4d-46f7-9b82-40d49949c7ef', - clientsEnrolledForTpt: '5f28254f-0a80-4d15-ad91-68c6cf5ea715', - }, - }, - formNames: { - _type: Type.Object, - _description: 'TPT Form Names.', - _default: { - TptOutcomeFormName: 'TPT outcome form', - TptCaseEnrolmentFormName: 'TPT Case Enrolment form', - TptTreatmentFormName: 'TPT Followup & Treatment form', - tbfollowUpForm: 'TB Follow-up Form', - tbPatientTracingForm: 'TB Patient Tracing Form', - tbContactListingForm: 'TB Contact Listing', - }, - }, - formUuids: { - _type: Type.Object, - _description: 'TPT Form Uuids.', - _default: { - tptOutcomeFormUuid: '97fa657f-7627-3f81-829d-826b0d4c7d28', - tptCaseEnrolmentFormUuid: '71080512-07e6-345f-864f-93e892420258', - tptTreatmentFormUuid: '6212bb87-766e-33d0-b37b-79f019008492', - tbFollowUpFormUuid: '79b05c37-0def-4482-a345-c63b99fbd565', - tbPatientTracingFormUuid: 'ac3cbd10-1939-3797-9de6-2a39dfb68441', - tbContactListingFormUuid: 'cb16d920-62f1-3696-b781-e6a4f5e80de1', }, }, }; @@ -100,5 +62,4 @@ export interface ConfigObject { identifiers: Object; encounterTypes: Object; obsConcepts: Object; - formNames: Object; } diff --git a/packages/esm-tb-app/src/dashboard.meta.tsx b/packages/esm-tb-app/src/dashboard.meta.tsx index e387cbc50..0be3c3498 100644 --- a/packages/esm-tb-app/src/dashboard.meta.tsx +++ b/packages/esm-tb-app/src/dashboard.meta.tsx @@ -45,49 +45,10 @@ export const tbClinicalViewDashboardMeta = { title: 'Tuberculosis', }; -export const tbPreventionDashboardMeta = { - name: 'tb-prevention', - slot: 'tb-prevention-dashboard-slot', - title: 'TB Prevention', - isFolder: true, - folderTitle: 'Tuberculosis', - folderIcon: PillsAdd, - isHidden: true, -}; - export const tbCasesDashboardMeta = { name: 'tb-cases', slot: 'tb-cases-dashboard-slot', + config: { columns: 1, type: 'grid', programme: 'tb', dashboardTitle: 'TB Treatment', icon: PillsAdd }, title: 'TB Treatment', - isFolder: true, - childLinks: [ - { - name: 'tb-prevention', - title: 'TB Prevention', - }, - ], - folderTitle: 'Tuberculosis', - folderIcon: PillsAdd, -}; - -export const tptPatientChartMeta = { - title: 'TPT Program', - slotName: 'ohri-tpt-slot', - isExpanded: false, -}; - -export const tptPatientSummaryMeta = { - slot: 'tpt-patient-summary-slot', - columns: 1, - title: 'Patient Summary', - path: 'tpt-patient-summary', - layoutMode: 'anchored', -}; - -export const tptProgramManagementDashboardMeta = { - slot: 'tpt-program-management-summary-slot', - columns: 1, - title: 'Program Management', - path: 'tpt-program-management', - layoutMode: 'anchored', -}; + dashboardIcon: PillsAdd, +}; \ No newline at end of file diff --git a/packages/esm-tb-app/src/home.component.tsx b/packages/esm-tb-app/src/home.component.tsx deleted file mode 100644 index b91b37c7d..000000000 --- a/packages/esm-tb-app/src/home.component.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib'; -import React from 'react'; -import TbHomePatientTabs from './views/dashboard/patient-list-tabs/tb-patient-list-tabs.component'; -import TbSummaryTiles from './views/dashboard/summary-tiles/tb-summary-tiles.component'; - -const Homecomponent = () => { - return ( -
- - - -
- ); -}; - -export default Homecomponent; diff --git a/packages/esm-tb-app/src/index.ts b/packages/esm-tb-app/src/index.ts index b187b5b60..a41ab50ad 100644 --- a/packages/esm-tb-app/src/index.ts +++ b/packages/esm-tb-app/src/index.ts @@ -1,10 +1,5 @@ -import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework'; -import { - createOHRIDashboardLink, - OHRIHome, - OHRIWelcomeSection, - createOHRIGroupedLink, -} from '@ohri/openmrs-esm-ohri-commons-lib'; +import { defineConfigSchema, getSyncLifecycle } from '@openmrs/esm-framework'; +import { createOHRIDashboardLink, OHRIHome, OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib'; import { createDashboardGroup, createDashboardLink } from '@openmrs/esm-patient-common-lib'; import { tbPatientChartMeta, @@ -14,10 +9,6 @@ import { tbTreatmentFollowUpDashboardMeta, tbClinicalViewDashboardMeta, tbCasesDashboardMeta, - tptProgramManagementDashboardMeta, - tptPatientChartMeta, - tptPatientSummaryMeta, - tbPreventionDashboardMeta, } from './dashboard.meta'; import { configSchema } from './config-schema'; import TBSummaryOverviewList from './views/patient-summary/tb-patient-summary.component'; @@ -26,12 +17,6 @@ import TbTreatmentFollowUpList from './views/treatment-and-follow-up/tb-treatmen import TbContactTracingList from './views/tb-contact-listing/tb-contact-list.component'; import TbSummaryTiles from './views/dashboard/summary-tiles/tb-summary-tiles.component'; import TbHomePatientTabs from './views/dashboard/patient-list-tabs/tb-patient-list-tabs.component'; -import tptProgramManagementSummary from './views/tpt/program-management/tpt-program-management'; -import tptPatientSummary from './views/tpt/patient-summary/patient-summary.component'; -import TptPreventionSummaryTiles from './views/dashboard/summary-tiles/tpt-summary-tiles.component'; -import TptPatientListTabs from './views/dashboard/patient-list-tabs/tpt-patient-list-tabs.component'; -import rootComponent from './root.component'; -import TptHomeComponent from './tpt-home.component'; export const importTranslation = require.context('../translations', false, /.json$/, 'lazy'); @@ -50,8 +35,6 @@ export function startupApp() { export const patientChartTbDashboard = getSyncLifecycle(createDashboardGroup(tbPatientChartMeta), options); -export const patientChartTptDashboard = getSyncLifecycle(createDashboardGroup(tptPatientChartMeta), options); - export const tbPatientSummaryDashboardLink = getSyncLifecycle( createDashboardLink({ ...tbPatientSummaryDashboardMeta, moduleName }), options, @@ -100,44 +83,14 @@ export const tbDashboardTabs = getSyncLifecycle(TbHomePatientTabs, { featureName: 'tb-home-tabs', moduleName, }); -export const tptDashboardHeader = getSyncLifecycle(OHRIWelcomeSection, { - featureName: 'tpt-home-header', - moduleName, -}); -export const tptDashboardTiles = getSyncLifecycle(TptPreventionSummaryTiles, { - featureName: 'tpt-home-tiles', - moduleName, -}); -export const tptDashboardTabs = getSyncLifecycle(TptPatientListTabs, { - featureName: 'tpt-home-tabs', - moduleName, -}); - -export const tptPatientSummaryDashboardLink = getSyncLifecycle( - createDashboardLink({ ...tptPatientSummaryMeta, moduleName }), - options, -); -export const tptPatientSummaryDashboard = getSyncLifecycle(tptPatientSummary, { - featureName: 'tpt-patient-summary', - moduleName, -}); - -export const tptProgramManagementDashboardLink = getSyncLifecycle( - createDashboardLink({ ...tptProgramManagementDashboardMeta, moduleName }), - options, -); -export const tptProgramManagementDashboard = getSyncLifecycle(tptProgramManagementSummary, { - featureName: 'tpt-program-management-summary', - moduleName, -}); // OHRI HOME export const tbClinicalViewDashboardLink = getSyncLifecycle( createOHRIDashboardLink(tbClinicalViewDashboardMeta), options, ); -export const tbCasesDashboardLink = getSyncLifecycle(createOHRIGroupedLink(tbCasesDashboardMeta), options); -export const tbCasesDashboard = getSyncLifecycle(rootComponent, options); - -export const tbPreventionDashboardLink = getSyncLifecycle(createOHRIGroupedLink(tbPreventionDashboardMeta), options); -export const tbPreventionDashboard = getSyncLifecycle(TptHomeComponent, options); +export const tbCasesDashboardLink = getSyncLifecycle(createOHRIDashboardLink(tbCasesDashboardMeta), options); +export const tbCasesDashboard = getSyncLifecycle(OHRIHome, { + featureName: 'tb cases dashboard', + moduleName, +}); diff --git a/packages/esm-tb-app/src/root.component.tsx b/packages/esm-tb-app/src/root.component.tsx deleted file mode 100644 index 58c623831..000000000 --- a/packages/esm-tb-app/src/root.component.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { SWRConfig } from 'swr'; -import { BrowserRouter, Route, Routes } from 'react-router-dom'; -import Home from './home.component'; - -const swrConfiguration = { - // Maximum number of retries when the backend returns an error - errorRetryCount: 3, -}; - -const Root: React.FC = () => { - const tbBasename = window.getOpenmrsSpaBase() + 'home/tb-cases'; - - return ( -
- - - - } /> - - - -
- ); -}; - -export default Root; diff --git a/packages/esm-tb-app/src/routes.json b/packages/esm-tb-app/src/routes.json index 741077094..2fd34a6b9 100644 --- a/packages/esm-tb-app/src/routes.json +++ b/packages/esm-tb-app/src/routes.json @@ -22,24 +22,7 @@ "component": "patientChartTbDashboard", "order": 24 }, - - { - "name": "tpt-dashboard-link", - "slot": "dashboard-slot", - "component": "tptFolderLink", - "meta": { - "slot": "ohri-tpt-dashboard-slot", - "isFolder": true, - "title": "TPT Program" - } - }, - { - "name": "ohri-tpt", - "slot": "patient-chart-dashboard-slot", - "component": "patientChartTptDashboard", - "order": 24 - }, - + { "name": "tb-summary-dashboard", "slot": "ohri-tb-slot", @@ -73,39 +56,6 @@ "slot": "tb-program-management-summary-slot", "component": "tbProgramManagementDashboard" }, - { - "name": "tpt-patient-summary", - "slot": "ohri-tpt-slot", - "component": "tptPatientSummaryDashboardLink", - "meta": { - "slot": "tpt-patient-summary-slot", - "columns": 1, - "path": "tpt-patient-summary", - "layoutMode": "anchored" - } - }, - { - "name": "tpt-patient-summary-ext", - "slot": "tpt-patient-summary-slot", - "component": "tptPatientSummaryDashboard" - }, - - { - "name": "tpt-program-management-summary", - "slot": "ohri-tpt-slot", - "component": "tptProgramManagementDashboardLink", - "meta": { - "slot": "tpt-program-management-summary-slot", - "columns": 1, - "path": "tpt-program-management", - "layoutMode": "anchored" - } - }, - { - "name": "tpt-program-management-summary-ext", - "slot": "tpt-program-management-summary-slot", - "component": "tptProgramManagementDashboard" - }, { "name": "tb-treatment-follow-up-summary", @@ -150,66 +100,51 @@ "title": "Tuberculosis" } }, - - { - "name": "tb-home-header-ext", - "slot": "tb-home-header-slot", - "component": "tbDashboardHeader" - }, - { - "name": "tb-home-tiles-ext", - "slot": "tb-home-tiles-slot", - "component": "tbDashboardTiles" - }, - { - "name": "tb-home-tabs-ext", - "slot": "tb-home-tabs-slot", - "component": "tbDashboardTabs" - }, - { - "name": "tpt-home-header-ext", - "slot": "tpt-home-header-slot", - "component": "tptDashboardHeader" - }, - { - "name": "tpt-home-tiles-ext", - "slot": "tpt-home-tiles-slot", - "component": "tptDashboardTiles" - }, - { - "name": "tpt-home-tabs-ext", - "slot": "tpt-home-tabs-slot", - "component": "tptDashboardTabs" - }, { "name": "tb-cases-dashboard-ext", - "slot": "homepage-dashboard-slot", + "slot": "tb-clinical-dashboard-slot", "component": "tbCasesDashboardLink", "meta": { "name": "tb-cases", "slot": "tb-cases-dashboard-slot", + "config": { + "columns": 1, + "type": "grid", + "programme": "tb", + "dashboardTitle": "TB Treatment" + }, "title": "TB Treatment" } }, { "name": "tb-cases-dashboard", "slot": "tb-cases-dashboard-slot", - "component": "tbCasesDashboard" - }, - { - "name": "tb-prevention-dashboard-ext", - "slot": "homepage-dashboard-slot", - "component": "tbPreventionDashboardLink", + "component": "tbCasesDashboard", "meta": { - "name": "tb-prevention", - "slot": "tb-prevention-dashboard-slot", - "title": "TB Prevention" + "name": "tb-cases", + "slot": "tb-cases-dashboard-slot", + "config": { + "columns": 1, + "programme": "tb", + "dashboardTitle": "TB Treatment" + }, + "title": "TB Treatment" } }, { - "name": "tb-prevention-dashboard", - "slot": "tb-prevention-dashboard-slot", - "component": "tbPreventionDashboard" - } + "name": "tb-home-header-ext", + "slot": "tb-home-header-slot", + "component": "tbDashboardHeader" + }, + { + "name": "tb-home-tiles-ext", + "slot": "tb-home-tiles-slot", + "component": "tbDashboardTiles" + }, + { + "name": "tb-home-tabs-ext", + "slot": "tb-home-tabs-slot", + "component": "tbDashboardTabs" + } ] -} \ No newline at end of file +} diff --git a/packages/esm-tb-app/src/tb-helper.ts b/packages/esm-tb-app/src/tb-helper.ts index 52901e00e..edb424557 100644 --- a/packages/esm-tb-app/src/tb-helper.ts +++ b/packages/esm-tb-app/src/tb-helper.ts @@ -3,30 +3,30 @@ import { getConfig } from '@openmrs/esm-framework'; import { moduleName } from '.'; export async function getTbRegimen(encounter: any, tBEnrollmentType: string) { - const config = await getConfig(moduleName); - const regimen = - tBEnrollmentType === config.obsConcepts.dsTBEnrollment - ? config.obsConcepts.dSregimen - : config.obsConcepts.dRregimen; + const config = await getConfig(moduleName); + const regimen = + tBEnrollmentType === config.obsConcepts.dsTBEnrollment + ? config.obsConcepts.dSregimen + : config.obsConcepts.dRregimen; - return getObsFromEncounter(encounter, regimen); + return getObsFromEncounter(encounter, regimen); } -export async function getTbTreatmentStartDate(encounter: any, tBEnrollmentType: string) { - const config = await getConfig(moduleName); - const tBTreatmentStartDateConcept = - tBEnrollmentType === config.obsConcepts.dsTBEnrollment - ? config.obsConcepts.dSTreatmentStartDate - : config.obsConcepts.dRTreatmentStartDate; +export async function getTbTreatmentStartDate(encounter: any, tBEnrollmentType: string){ + const config = await getConfig(moduleName); + const tBTreatmentStartDateConcept = + tBEnrollmentType === config.obsConcepts.dsTBEnrollment + ? config.obsConcepts.dSTreatmentStartDate + : config.obsConcepts.dRTreatmentStartDate; - return getObsFromEncounter(encounter, tBTreatmentStartDateConcept, true); + return getObsFromEncounter(encounter, tBTreatmentStartDateConcept, true); } -export async function getTbTreatmentId(encounter: any, tBEnrollmentType: string) { - const config = await getConfig(moduleName); - const treatmentId = - tBEnrollmentType === config.obsConcepts.dsTBEnrollment - ? config.obsConcepts.dSTreatmentId - : config.obsConcepts.dRTreatmentId; - return getObsFromEncounter(encounter, treatmentId); -} +export async function getTbTreatmentId(encounter: any, tBEnrollmentType: string){ + const config = await getConfig(moduleName); + const treatmentId = + tBEnrollmentType === config.obsConcepts.dsTBEnrollment + ? config.obsConcepts.dSTreatmentId + : config.obsConcepts.dRTreatmentId; + return getObsFromEncounter(encounter, treatmentId); +} \ No newline at end of file diff --git a/packages/esm-tb-app/src/tpt-home.component.tsx b/packages/esm-tb-app/src/tpt-home.component.tsx deleted file mode 100644 index 83e6a5a4a..000000000 --- a/packages/esm-tb-app/src/tpt-home.component.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { OHRIWelcomeSection } from '@ohri/openmrs-esm-ohri-commons-lib'; -import React from 'react'; -import TbSummaryTiles from './views/dashboard/summary-tiles/tb-summary-tiles.component'; -import TptPatientListTabs from './views/dashboard/patient-list-tabs/tpt-patient-list-tabs.component'; - -const TptHomeComponent = () => { - return ( -
- - - -
- ); -}; - -export default TptHomeComponent; diff --git a/packages/esm-tb-app/src/tpt-root.component.tsx b/packages/esm-tb-app/src/tpt-root.component.tsx deleted file mode 100644 index 98379012d..000000000 --- a/packages/esm-tb-app/src/tpt-root.component.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { SWRConfig } from 'swr'; -import { BrowserRouter, Route, Routes } from 'react-router-dom'; -import TptHome from './tpt-home.component'; - -const swrConfiguration = { - // Maximum number of retries when the backend returns an error - errorRetryCount: 3, -}; - -const TptRoot: React.FC = () => { - const tbBasename = window.getOpenmrsSpaBase() + 'home/tpt-cases'; - - return ( -
- - - - } /> - - - -
- ); -}; - -export default TptRoot; diff --git a/packages/esm-tb-app/src/views/dashboard/patient-list-tabs/tpt-patient-list-tabs.component.tsx b/packages/esm-tb-app/src/views/dashboard/patient-list-tabs/tpt-patient-list-tabs.component.tsx deleted file mode 100644 index 15f20b8bb..000000000 --- a/packages/esm-tb-app/src/views/dashboard/patient-list-tabs/tpt-patient-list-tabs.component.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import React, { useMemo } from 'react'; -import { useTranslation } from 'react-i18next'; -import { getObsFromEncounter, OHRIPatientListTabs } from '@ohri/openmrs-esm-ohri-commons-lib'; -import { moduleName } from '../../../index'; -import { useConfig } from '@openmrs/esm-framework'; - -function TptPatientListTabs() { - const { t } = useTranslation(); - const { obsConcepts, encounterTypes, cohorts } = useConfig(); - - const tabsConfigs = useMemo( - () => [ - { - label: t('allTptClients', 'All TPT Clients'), - cohortId: cohorts.clientsEnrolledForTpt, - isReportingCohort: true, - cohortSlotName: 'clients-assessed-for-tpt', - launchableForm: { - editActionText: t('editTptFollowUpForm', 'Edit TPT Follow-up form'), - editLatestEncounter: true, - targetDashboard: 'tb-assessments', - name: 'TPT Followup & Treatment form', - }, - associatedEncounterType: encounterTypes.tptCaseEnrollment, - excludeColumns: ['timeAddedToList', 'waitingTime', 'location', 'phoneNumber', 'hivResult'], - otherColumns: [ - { - key: 'tptTreatmentId', - header: t('tptTreatmentId', 'TPT Treatment ID'), - getValue: ({ latestEncounter }) => { - return getObsFromEncounter(latestEncounter, obsConcepts.tptTreatmentId); - }, - index: 1, - }, - { - key: 'EnrolmentDate', - header: t('EnrolmentDate', 'Enrolment Date'), - getValue: ({ latestEncounter }) => { - return getObsFromEncounter(latestEncounter, obsConcepts.tptEnrollmentDate, true); - }, - }, - { - key: 'indication', - header: t('indication', 'Indication'), - getValue: ({ latestEncounter }) => { - return getObsFromEncounter(latestEncounter, obsConcepts.tptIndication); - }, - }, - ], - viewTptPatientProgramSummary: true, - }, - ], - [], - ); - return ; -} - -export default TptPatientListTabs; diff --git a/packages/esm-tb-app/src/views/dashboard/summary-tiles/tb-summary-tiles.component.tsx b/packages/esm-tb-app/src/views/dashboard/summary-tiles/tb-summary-tiles.component.tsx index e309f4970..e86b6c99d 100644 --- a/packages/esm-tb-app/src/views/dashboard/summary-tiles/tb-summary-tiles.component.tsx +++ b/packages/esm-tb-app/src/views/dashboard/summary-tiles/tb-summary-tiles.component.tsx @@ -2,7 +2,7 @@ import { OHRIProgrammeSummaryTiles, fetchMambaReportData } from '@ohri/openmrs-e import React, { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; -function TbSummaryTiles() { +function TbSummaryTiles({ launchWorkSpace }) { const { t } = useTranslation(); const [activeDSClientsCount, setActiveDSClientsCount] = useState(null); const [activeDRClientsCount, setActiveDRClientsCount] = useState(null); @@ -39,7 +39,7 @@ function TbSummaryTiles() { linkAddress: '#', subTitle: t('drugResistant', 'Cases with drug resistant TB'), value: activeDRClientsCount, - }, + } ], [activeDSClientsCount, activeDRClientsCount], ); diff --git a/packages/esm-tb-app/src/views/dashboard/summary-tiles/tpt-summary-tiles.component.tsx b/packages/esm-tb-app/src/views/dashboard/summary-tiles/tpt-summary-tiles.component.tsx deleted file mode 100644 index 2f2c367bb..000000000 --- a/packages/esm-tb-app/src/views/dashboard/summary-tiles/tpt-summary-tiles.component.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { OHRIProgrammeSummaryTiles } from '@ohri/openmrs-esm-ohri-commons-lib'; -import React, { useMemo, useState } from 'react'; -import { useTranslation } from 'react-i18next'; - -function TptPreventionSummaryTiles() { - const { t } = useTranslation(); - const [activeTptClientsCount] = useState(78); - const tiles = useMemo( - () => [ - { - title: t('allTptClients', 'All TPT Clients'), - linkAddress: '#', - subTitle: t('currentTptClients', 'Clients Currently on TPT'), - value: activeTptClientsCount, - }, - ], - [], - ); - return ; -} - -export default TptPreventionSummaryTiles; diff --git a/packages/esm-tb-app/src/views/patient-summary/tb-patient-summary.component.tsx b/packages/esm-tb-app/src/views/patient-summary/tb-patient-summary.component.tsx index b9f14b966..14806bfe1 100644 --- a/packages/esm-tb-app/src/views/patient-summary/tb-patient-summary.component.tsx +++ b/packages/esm-tb-app/src/views/patient-summary/tb-patient-summary.component.tsx @@ -16,77 +16,77 @@ import { getTbRegimen } from '../../tb-helper'; const TBSummaryOverviewList: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); + const config = useConfig(); const headerRecentTB = t('recentTuberculosis', 'Recent Tuberculosis'); const headerPreviousCases = t('previousCases', 'Previous Cases'); const headerVisit = t('visits', 'Visits'); - const { formNames, formUuids, encounterTypes, obsConcepts } = useConfig(); const recentTuberclosisColumns: SummaryCardColumn[] = useMemo( () => [ { key: 'caseID', header: t('caseID', 'Case ID'), - encounterTypes: [encounterTypes.tbProgramEnrollment], + encounterTypes: [config.encounterTypes.tbProgramEnrollment], getObsValue: async ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.caseID); + return getObsFromEncounter(encounter, config.obsConcepts.caseID); }, }, { key: 'enrollmentDate', header: t('enrollmentDate', 'Enrollment Date'), - encounterTypes: [encounterTypes.tbProgramEnrollment], + encounterTypes: [config.encounterTypes.tbProgramEnrollment], getObsValue: async ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.enrollmentDate, true); + return getObsFromEncounter(encounter, config.obsConcepts.enrollmentDate, true); }, }, { key: 'type', header: t('type', 'Type'), - encounterTypes: [encounterTypes.tbProgramEnrollment], + encounterTypes: [config.encounterTypes.tbProgramEnrollment], getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.type); + return getObsFromEncounter(encounter, config.obsConcepts.type); }, }, { key: 'site', header: t('site', 'Site'), - encounterTypes: [encounterTypes.tbProgramEnrollment], + encounterTypes: [config.encounterTypes.tbProgramEnrollment], getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.site); + return getObsFromEncounter(encounter, config.obsConcepts.site); }, }, { key: 'drugSensitivity', header: t('drugSensitivity', 'Drug Sensitivity'), - encounterTypes: [encounterTypes.tbProgramEnrollment], + encounterTypes: [config.encounterTypes.tbProgramEnrollment], getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.drugSensitivity); + return getObsFromEncounter(encounter, config.obsConcepts.drugSensitivity); }, }, { key: 'regimen', header: t('regimen', 'Regimen'), - encounterTypes: [encounterTypes.tbProgramEnrollment], + encounterTypes: [config.encounterTypes.tbProgramEnrollment], getObsValue: ([encounter]) => { - const tBEnrollmentType = findObs(encounter, obsConcepts.tBEnrollmentType)?.value?.uuid; + const tBEnrollmentType = findObs(encounter, config.obsConcepts.tBEnrollmentType)?.value?.uuid; return getTbRegimen(encounter, tBEnrollmentType); }, }, { key: 'hivStatus', header: t('hivStatus', 'HIV Status'), - encounterTypes: [encounterTypes.tbProgramEnrollment], + encounterTypes: [config.encounterTypes.tbProgramEnrollment], getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.hivStatus); + return getObsFromEncounter(encounter, config.obsConcepts.hivStatus); }, }, { key: 'outcome', header: t('outcome', 'Outcome'), - encounterTypes: [encounterTypes.tbProgramEnrollment], + encounterTypes: [config.encounterTypes.tbProgramEnrollment], getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.outcome); + return getObsFromEncounter(encounter, config.obsConcepts.outcome); }, }, ], @@ -99,35 +99,35 @@ const TBSummaryOverviewList: React.FC = ({ patientUuid }) => key: 'caseID', header: t('caseID', 'Case ID'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.caseID); + return getObsFromEncounter(encounter, config.obsConcepts.caseID); }, }, { key: 'enrollmentDate', header: t('enrollmentDate', 'Enrollment Date'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.enrollmentDate, true); + return getObsFromEncounter(encounter, config.obsConcepts.enrollmentDate, true); }, }, { key: 'type', header: t('type', 'Type'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.type); + return getObsFromEncounter(encounter, config.obsConcepts.type); }, }, { key: 'site', header: t('site', 'Site'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.site); + return getObsFromEncounter(encounter, config.obsConcepts.site); }, }, { key: 'regimen', header: t('regimen', 'Regimen'), getValue: (encounter) => { - const tBEnrollmentType = findObs(encounter, obsConcepts.tBEnrollmentType)?.value?.uuid; + const tBEnrollmentType = findObs(encounter, config.obsConcepts.tBEnrollmentType)?.value?.uuid; return getTbRegimen(encounter, tBEnrollmentType); }, }, @@ -135,7 +135,7 @@ const TBSummaryOverviewList: React.FC = ({ patientUuid }) => key: 'outcome', header: t('outcome', 'Outcome'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.outcome); + return getObsFromEncounter(encounter, config.obsConcepts.outcome); }, }, ], @@ -148,42 +148,42 @@ const TBSummaryOverviewList: React.FC = ({ patientUuid }) => key: 'caseID', header: t('caseID', 'Case ID'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.caseID); + return getObsFromEncounter(encounter, config.obsConcepts.caseID); }, }, { key: 'dateOfVisit', header: t('dateOfVisit', 'Date of Visit'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.visitDate, true); + return getObsFromEncounter(encounter, config.obsConcepts.visitDate, true); }, }, { key: 'monthOfVisit', header: t('monthOfVisit', 'Month of Visit'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.monthOfTreatment); + return getObsFromEncounter(encounter, config.obsConcepts.monthOfTreatment); }, }, { key: 'adherence', header: t('adherence', 'Adherence'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.adherenceAssessment); + return getObsFromEncounter(encounter, config.obsConcepts.adherenceAssessment); }, }, { key: 'adverseDrugReaction', header: t('adverseDrugReaction', 'Adverse Drug Reaction'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.ADR); + return getObsFromEncounter(encounter, config.obsConcepts.ADR); }, }, { key: 'nextAppointment', header: t('nextAppointment', 'Next Appointment'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.nextAppointmentDate, true); + return getObsFromEncounter(encounter, config.obsConcepts.nextAppointmentDate, true); }, }, ], @@ -201,11 +201,11 @@ const TBSummaryOverviewList: React.FC = ({ patientUuid }) => = ({ patientUuid }) => = ({ patientUuid }) => { const { t } = useTranslation(); + const config = useConfig(); const headerTitle = t('MdrTbEnrolment', 'TB/MDR TB Enrolment'); const [isEmptyOutcome, setIsEmptyOutcome] = useState(false); - const { formNames, formUuids, encounterTypes, obsConcepts } = useConfig(); useEffect(() => { - fetchPatientLastEncounter(patientUuid, encounterTypes.tbProgramEnrollment).then((encounter) => { - const result = encounter?.obs?.filter((ob) => ob?.concept?.uuid === obsConcepts.outcome); + fetchPatientLastEncounter(patientUuid, config.encounterTypes.tbProgramEnrollment).then((encounter) => { + const result = encounter?.obs?.filter((ob) => ob?.concept?.uuid === config.obsConcepts.outcome); if (result?.length === 0) { setIsEmptyOutcome(true); } @@ -33,21 +33,21 @@ const MdrTbList: React.FC = ({ patientUuid }) => { key: 'enrollmentDate', header: t('enrollmentDate', 'Enrollment Date'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.enrollmentDate, true); + return getObsFromEncounter(encounter, config.obsConcepts.enrollmentDate, true); }, }, { key: 'caseID', header: t('caseID', 'Case ID'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.caseID); + return getObsFromEncounter(encounter, config.obsConcepts.caseID); }, }, { key: 'tbTreatmentId', header: t('tbTreatmentId', 'TB Treatement ID'), getValue: (encounter) => { - const tBEnrollmentType = findObs(encounter, obsConcepts.tBEnrollmentType)?.value?.uuid; + const tBEnrollmentType = findObs(encounter, config.obsConcepts.tBEnrollmentType)?.value?.uuid; return getTbTreatmentId(encounter, tBEnrollmentType); }, }, @@ -55,7 +55,7 @@ const MdrTbList: React.FC = ({ patientUuid }) => { key: 'treatmentStartDate', header: t('treatmentStartDate', 'Treatment Start Date'), getValue: (encounter) => { - const tBEnrollmentType = findObs(encounter, obsConcepts.tBEnrollmentType)?.value?.uuid; + const tBEnrollmentType = findObs(encounter, config.obsConcepts.tBEnrollmentType)?.value?.uuid; return getTbTreatmentStartDate(encounter, tBEnrollmentType); }, }, @@ -63,7 +63,7 @@ const MdrTbList: React.FC = ({ patientUuid }) => { key: 'regimen', header: t('regimen', 'Regimen'), getValue: (encounter) => { - const tBEnrollmentType = findObs(encounter, obsConcepts.tBEnrollmentType)?.value?.uuid; + const tBEnrollmentType = findObs(encounter, config.obsConcepts.tBEnrollmentType)?.value?.uuid; return getTbRegimen(encounter, tBEnrollmentType); }, }, @@ -71,14 +71,14 @@ const MdrTbList: React.FC = ({ patientUuid }) => { key: 'treatmentOutcome', header: t('treatmentOutcome', 'Treatment outcome'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.outcome); + return getObsFromEncounter(encounter, config.obsConcepts.outcome); }, }, { key: 'dateOfTreatmentOutcome', header: t('dateOfTreatmentOutcome', 'Date of Treatment Outcome'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.DateOfTreatmentOutcome, true); + return getObsFromEncounter(encounter, config.obsConcepts.DateOfTreatmentOutcome, true); }, }, { @@ -108,8 +108,8 @@ const MdrTbList: React.FC = ({ patientUuid }) => { return ( = ({ patientUuid }) => { const { t } = useTranslation(); - const { formNames, formUuids, encounterTypes, obsConcepts } = useConfig(); + const config = useConfig(); const headerTitle = t('PatientTracing', 'Patient Tracing'); const columns: EncounterListColumn[] = useMemo( () => [ @@ -19,14 +19,14 @@ const TbPatientTracing: React.FC = ({ patientUuid }) => { key: 'contactDate', header: t('contactDate', 'Contact Date'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.dateContacted, true); + return getObsFromEncounter(encounter, config.obsConcepts.dateContacted, true); }, }, { key: 'contactMethod', header: t('contactMethod', 'Contact Method'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.modeOfContact); + return getObsFromEncounter(encounter, config.obsConcepts.modeOfContact); }, }, { @@ -56,8 +56,8 @@ const TbPatientTracing: React.FC = ({ patientUuid }) => { return ( = ({ patientUuid }) => { const { t } = useTranslation(); - const { formNames, formUuids, encounterTypes, obsConcepts } = useConfig(); + const config = useConfig(); const headerTitle = t('TbContactListing', 'TB Contact Listing'); const columns: EncounterListColumn[] = useMemo( @@ -20,14 +20,14 @@ const TbContactTracingList: React.FC = ({ patientUuid }) => { key: 'caseID', header: t('caseId', 'TB Case ID'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.caseID); + return getObsFromEncounter(encounter, config.obsConcepts.caseID); }, }, { key: 'dateContactListed', header: t('dateContactListed', 'Date Contact Listed'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.dateContacted, true); + return getObsFromEncounter(encounter, config.obsConcepts.dateContacted, true); }, }, { @@ -64,8 +64,8 @@ const TbContactTracingList: React.FC = ({ patientUuid }) => { return ( = ({ patientUuid }) => { - const { t } = useTranslation(); - const { formNames, formUuids, encounterTypes, obsConcepts } = useConfig(); - - const headerRecentTPT = t('recentTptCases', 'Recent TPT Cases'); - const headerPreviousTptCases = t('previousTptCases', 'Previous TPT Cases'); - const headerVisit = t('visits', 'Visits'); - - const recentTbPreventionColumns: SummaryCardColumn[] = useMemo( - () => [ - { - key: 'tptTreatmentId', - header: t('tptTreatmentId', 'TPT Treatment ID'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getObsValue: async ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.tptTreatmentId); - }, - }, - { - key: 'tptEnrollmentDate', - header: t('enrollmentDate', 'Enrollment Date'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getObsValue: async ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.tptEnrollmentDate, true); - }, - }, - { - key: 'tptIndication', - header: t('indication', 'Indication'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.tptIndication); - }, - }, - { - key: 'tptRegimen', - header: t('regimen', 'Regimen'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.tptRegimen); - }, - }, - { - key: 'tptAdherence', - header: t('tptAdherence', 'Adherence'), - encounterTypes: [encounterTypes.tptTreatmentAndFollowUp], - getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.tptAdherence); - }, - }, - { - key: 'tptAppointmentDate', - header: t('nextAppointmentDate', 'Next Appointment Date'), - encounterTypes: [encounterTypes.tptTreatmentAndFollowUp], - getObsValue: ([encounter]) => { - return getObsFromEncounter(encounter, obsConcepts.tptAppointmentDate, true); - }, - }, - ], - [], - ); - - const previousTptCasesColumns: EncounterListColumn[] = useMemo( - () => [ - { - key: 'tptTreatmentId', - header: t('tptTreatmentId', 'TPT Treatment ID'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptTreatmentId); - }, - }, - { - key: 'tptEnrollmentDate', - header: t('enrollmentDate', 'Enrollment Date'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptEnrollmentDate, true); - }, - }, - { - key: 'indication', - header: t('indication', 'Indication'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptIndication); - }, - }, - { - key: 'tptRegimen', - header: t('regimen', 'Regimen'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptRegimen); - }, - }, - { - key: 'tptOutcome', - header: t('outcome', 'Outcome'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptOutcome); - }, - }, - { - key: 'tptDateOutcome', - header: t('dateOutcome', 'Date of Outcome'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptDateOutcome, true); - }, - }, - ], - [], - ); - - const TptVisitsColumns: EncounterListColumn[] = useMemo( - () => [ - { - key: 'caseID', - header: t('caseID', 'Case ID'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptTreatmentId); - }, - }, - { - key: 'visitDate', - header: t('visitDate', 'Visit Date'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptEnrollmentDate, true); - }, - }, - { - key: 'tptIndication', - header: t('indication', 'Indication'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptIndication); - }, - }, - { - key: 'regimen', - header: t('regimen', 'Regimen'), - encounterTypes: [encounterTypes.tptCaseEnrollment], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptRegimen); - }, - }, - { - key: 'adherence', - header: t('adherence', 'Adherence'), - encounterTypes: [encounterTypes.tptTreatmentAndFollowUp], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptAdherence); - }, - }, - { - key: 'nextAppointmentDate', - header: t('nextAppointmentDate', 'Next Appointment Date'), - encounterTypes: [encounterTypes.tptTreatmentAndFollowUp], - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptAppointmentDate, true); - }, - }, - ], - [], - ); - - return ( - <> - - - - - ); -}; - -export default TptPatientSummary; diff --git a/packages/esm-tb-app/src/views/tpt/program-management/tabs/tpt-enrolment.component.tsx b/packages/esm-tb-app/src/views/tpt/program-management/tabs/tpt-enrolment.component.tsx deleted file mode 100644 index 74fe248db..000000000 --- a/packages/esm-tb-app/src/views/tpt/program-management/tabs/tpt-enrolment.component.tsx +++ /dev/null @@ -1,118 +0,0 @@ -import React, { useMemo } from 'react'; -import { useTranslation } from 'react-i18next'; -import { EncounterList, EncounterListColumn, getObsFromEncounter } from '@ohri/openmrs-esm-ohri-commons-lib'; -import { moduleName } from '../../../..'; -import { useConfig } from '@openmrs/esm-framework'; - -interface TptEnrolmentListProps { - patientUuid: string; -} - -const TptEnrolmentList: React.FC = ({ patientUuid }) => { - const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); - - const headerTitle = t('tptEnrolment', 'TPT Enrolment'); - - const columns: EncounterListColumn[] = useMemo( - () => [ - { - key: 'enrollmentDate', - header: t('enrollmentDate', 'Enrollment Date'), - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptEnrollmentDate, true); - }, - }, - { - key: 'tptTreatmentID', - header: t('tptTreatmentID', 'TPT Treatment ID'), - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptTreatmentId); - }, - }, - { - key: 'indication', - header: t('indication', 'Indication'), - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptIndication); - }, - }, - { - key: 'treatmentStartDate', - header: t('treatmentStartDate', 'Treatment start date'), - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptTreatmentStartDate, true); - }, - }, - { - key: 'regimen', - header: t('regimen', 'Regimen'), - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptRegimen); - }, - }, - { - key: 'tptOutcome', - header: t('tptOutcome', 'Outcome'), - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptOutcome); - }, - }, - { - key: 'dateOfOutcome', - header: t('dateOfOutcome', 'Date of Outcome'), - getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.tptOutcomeDate, true); - }, - }, - { - key: 'actions', - header: t('actions', 'Actions'), - getValue: (encounter) => [ - { - form: { name: formNames.TptCaseEnrolmentFormName }, - encounterUuid: encounter.uuid, - intent: '*', - label: t('viewDetails', 'View Details'), - mode: 'view', - }, - { - form: { name: formNames.TptCaseEnrolmentFormName }, - encounterUuid: encounter.uuid, - intent: '*', - label: t('editForm', 'Edit Form'), - mode: 'edit', - }, - { - form: { name: formNames.TptOutcomeFormName }, - encounterUuid: encounter.uuid, - intent: '*', - label: t('editForm', 'Add/Edit Outcome'), - mode: 'edit', - }, - ], - }, - ], - [], - ); - - return ( - - ); -}; - -export default TptEnrolmentList; diff --git a/packages/esm-tb-app/src/views/tpt/program-management/tabs/tpt-treatment.component.tsx b/packages/esm-tb-app/src/views/tpt/program-management/tabs/tpt-treatment.component.tsx deleted file mode 100644 index 2e8888e3b..000000000 --- a/packages/esm-tb-app/src/views/tpt/program-management/tabs/tpt-treatment.component.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import React, { useMemo } from 'react'; -import { useTranslation } from 'react-i18next'; -import { useConfig } from '@openmrs/esm-framework'; -import { EncounterList, EncounterListColumn, getObsFromEncounter } from '@ohri/openmrs-esm-ohri-commons-lib'; -import { moduleName } from '../../../..'; - -interface TptTreatmentListProps { - patientUuid: string; -} - -const TptTreatmentList: React.FC = ({ patientUuid }) => { - const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); - const headerTitle = t('tptTreatment', 'TPT Treatment'); - const columns: EncounterListColumn[] = useMemo( - () => [ - { - key: 'caseId', - header: t('caseId', 'Case Id'), - getValue: (encounter: any) => { - return getObsFromEncounter(encounter, obsConcepts.caseID); - }, - }, - { - key: 'Adherence', - header: t('Adherence', 'Adherence'), - getValue: (encounter: any) => { - return getObsFromEncounter(encounter, obsConcepts.tptAdherence); - }, - }, - { - key: 'treatmentPlan', - header: t('treatmentPlan', 'Treatment Plan'), - getValue: (encounter: any) => { - return getObsFromEncounter(encounter, obsConcepts.treatmentPlan); - }, - }, - { - key: 'nextAppointment', - header: t('nextAppointment', 'Next Appointment'), - getValue: (encounter: any) => { - return getObsFromEncounter(encounter, obsConcepts.tptAppointmentDate, true); - }, - }, - { - key: 'actions', - header: t('actions', 'Actions'), - getValue: (encounter) => [ - { - form: { name: formNames.TptTreatmentFormName }, - encounterUuid: encounter.uuid, - intent: '*', - label: t('viewDetails', 'View Details'), - mode: 'view', - }, - { - form: { name: formNames.TptTreatmentFormName }, - encounterUuid: encounter.uuid, - intent: '*', - label: t('editForm', 'Edit Form'), - mode: 'edit', - }, - ], - }, - ], - [], - ); - - return ( - - ); -}; - -export default TptTreatmentList; diff --git a/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management.tsx b/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management.tsx deleted file mode 100644 index 8e391916c..000000000 --- a/packages/esm-tb-app/src/views/tpt/program-management/tpt-program-management.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; -import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react'; -import styles from '../../common.scss'; -import { useTranslation } from 'react-i18next'; -import TptTreatmentList from './tabs/tpt-treatment.component'; -import TptEnrolmentList from './tabs/tpt-enrolment.component'; -import { PatientChartProps } from '@ohri/openmrs-esm-ohri-commons-lib'; - -const TptProgramManagementSummary: React.FC = ({ patientUuid }) => { - const { t } = useTranslation(); - return ( -
- - - {t('tptEnrolment', 'TPT Enrolment')} - {t('tptTreatment', 'TPT Treatment')} - - - - - - - - - - -
- ); -}; - -export default TptProgramManagementSummary; diff --git a/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-follow-up.component.tsx b/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-follow-up.component.tsx index d3b7d7900..099615a5c 100644 --- a/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-follow-up.component.tsx +++ b/packages/esm-tb-app/src/views/treatment-and-follow-up/tb-treatment-follow-up.component.tsx @@ -11,7 +11,7 @@ import { useConfig } from '@openmrs/esm-framework'; const TbTreatmentFollowUpList: React.FC = ({ patientUuid }) => { const { t } = useTranslation(); - const { obsConcepts, encounterTypes, formNames, formUuids } = useConfig(); + const config = useConfig(); const headerTitle = t('TbTreatmentFollowUp', 'TB Follow-up'); const columns: EncounterListColumn[] = useMemo( @@ -20,35 +20,35 @@ const TbTreatmentFollowUpList: React.FC = ({ patientUuid }) = key: 'visitDate', header: t('visitDate', 'Visit Date'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.visitDate, true); + return getObsFromEncounter(encounter, config.obsConcepts.visitDate, true); }, }, { key: 'caseId', header: t('caseId', 'Case ID'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.followUpCaseId); + return getObsFromEncounter(encounter, config.obsConcepts.followUpCaseId); }, }, { key: 'monthOfTreatment', header: t('monthOfTreatment', 'Month of Rx'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.monthOfTreatment); + return getObsFromEncounter(encounter, config.obsConcepts.monthOfTreatment); }, }, { key: 'adherenceAssessment', header: t('adherenceAssessment', 'Adherence'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.adherenceAssessment); + return getObsFromEncounter(encounter, config.obsConcepts.adherenceAssessment); }, }, { key: 'nextAppointment', header: t('nextAppointment', 'Next Appointment'), getValue: (encounter) => { - return getObsFromEncounter(encounter, obsConcepts.nextAppointmentDate, true); + return getObsFromEncounter(encounter, config.obsConcepts.nextAppointmentDate, true); }, }, { @@ -78,8 +78,8 @@ const TbTreatmentFollowUpList: React.FC = ({ patientUuid }) = return ( , fsevents@patch:fsevents@npm%3A^2.3.2#optional!builtin, fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": +"fsevents@patch:fsevents@npm%3A^2.3.2#optional!builtin, fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": version: 2.3.2 resolution: "fsevents@patch:fsevents@npm%3A2.3.2#optional!builtin::version=2.3.2&hash=df0bf1" dependencies: @@ -11342,7 +11266,7 @@ __metadata: languageName: node linkType: hard -"jest-coverage-badges@npm:1.1.2": +"jest-coverage-badges@npm:1.1.2, jest-coverage-badges@npm:^1.0.0": version: 1.1.2 resolution: "jest-coverage-badges@npm:1.1.2" dependencies: @@ -12052,16 +11976,6 @@ __metadata: languageName: node linkType: hard -"launch-editor@npm:^2.6.0": - version: 2.6.1 - resolution: "launch-editor@npm:2.6.1" - dependencies: - picocolors: "npm:^1.0.0" - shell-quote: "npm:^1.8.1" - checksum: e06d193075ac09f7f8109f10cabe464a211bf7ed4cbe75f83348d6f67bf4d9f162f06e7a1ab3e1cd7fc250b5342c3b57080618aff2e646dc34248fe499227601 - languageName: node - linkType: hard - "lazystream@npm:^1.0.0": version: 1.0.1 resolution: "lazystream@npm:1.0.1" @@ -13537,12 +13451,12 @@ __metadata: linkType: hard "openmrs@npm:next": - version: 5.4.1-pre.1592 - resolution: "openmrs@npm:5.4.1-pre.1592" + version: 5.3.3-pre.1395 + resolution: "openmrs@npm:5.3.3-pre.1395" dependencies: "@carbon/icons-react": "npm:11.26.0" - "@openmrs/esm-app-shell": "npm:5.4.1-pre.1592" - "@openmrs/webpack-config": "npm:5.4.1-pre.1592" + "@openmrs/esm-app-shell": "npm:5.3.3-pre.1395" + "@openmrs/webpack-config": "npm:5.3.3-pre.1395" "@pnpm/npm-conf": "npm:^2.1.0" "@swc/core": "npm:^1.3.58" autoprefixer: "npm:^10.4.2" @@ -13573,7 +13487,7 @@ __metadata: yargs: "npm:^17.6.2" bin: openmrs: ./dist/cli.js - checksum: 6a02311734010b6695d58a21785528b3ec168145cdd935c6949e93540e243b02ba6bb062927e1a99250643a7638fbc8eef620fd7ca6b0abf81473716f63bfcfe + checksum: 79e2b78bae6d5022f3656ab2f58b9f402a8d5429199267f7c526f73e3485a4ce27e00acc3c0376cf93e07608a64a5126afdfa2c7ad228eeb90f2d44ee24528b5 languageName: node linkType: hard @@ -13977,30 +13891,6 @@ __metadata: languageName: node linkType: hard -"playwright-core@npm:1.41.2": - version: 1.41.2 - resolution: "playwright-core@npm:1.41.2" - bin: - playwright-core: cli.js - checksum: 77ff881ebb9cc0654edd00c5ff202f5f61aee7a5318e1f12a82e30a3636de21e8b5982fae6138e5bb90115ae509c15a640cf85b10b3e2daebb2bb286da54fd4c - languageName: node - linkType: hard - -"playwright@npm:1.41.2": - version: 1.41.2 - resolution: "playwright@npm:1.41.2" - dependencies: - fsevents: "npm:2.3.2" - playwright-core: "npm:1.41.2" - dependenciesMeta: - fsevents: - optional: true - bin: - playwright: cli.js - checksum: 272399f622dc2df90fbef147b9b1cfab5d7a78cc364bdfa98d2bf08faa9894346f58629fe4fef41b108ca2cb203b3970d7886b7f392cb0399c75b521478e2920 - languageName: node - linkType: hard - "pngjs@npm:^3.0.0, pngjs@npm:^3.3.3": version: 3.4.0 resolution: "pngjs@npm:3.4.0" @@ -14812,6 +14702,13 @@ __metadata: languageName: node linkType: hard +"react-anchor-link-smooth-scroll@npm:^1.0.12": + version: 1.0.12 + resolution: "react-anchor-link-smooth-scroll@npm:1.0.12" + checksum: ca4f4a12eca0d657b5d1a96980b7b27fd94b8a896dc426d425364069f001d92c4c596936ba7b526aa26535623216e823792dee86470d5e798ef54110d5a0e0b8 + languageName: node + linkType: hard + "react-dom@npm:^18.1.0, react-dom@npm:^18.2.0": version: 18.2.0 resolution: "react-dom@npm:18.2.0" @@ -14930,7 +14827,20 @@ __metadata: languageName: node linkType: hard -"react-test-renderer@npm:^16.0.0-0": +"react-scroll@npm:^1.8.2": + version: 1.8.8 + resolution: "react-scroll@npm:1.8.8" + dependencies: + lodash.throttle: "npm:^4.1.1" + prop-types: "npm:^15.7.2" + peerDependencies: + react: ^15.5.4 || ^16.0.0 || ^17.0.0 || ^18.0.0 + react-dom: ^15.5.4 || ^16.0.0 || ^17.0.0 || ^18.0.0 + checksum: e15900dfaef77aa186e58a427e8128167c6293a06e2fe2fc06d230f6767c8e4b463d72211773de14fde91ae1402aa457e2b80fb4b4dd915330fb2bbc7d14ddb6 + languageName: node + linkType: hard + +"react-test-renderer@npm:^16.0.0-0, react-test-renderer@npm:^16.9.0": version: 16.14.0 resolution: "react-test-renderer@npm:16.14.0" dependencies: @@ -15869,13 +15779,6 @@ __metadata: languageName: node linkType: hard -"shell-quote@npm:^1.8.1": - version: 1.8.1 - resolution: "shell-quote@npm:1.8.1" - checksum: af19ab5a1ec30cb4b2f91fd6df49a7442d5c4825a2e269b3712eded10eedd7f9efeaab96d57829880733fc55bcdd8e9b1d8589b4befb06667c731d08145e274d - languageName: node - linkType: hard - "side-channel@npm:^1.0.4": version: 1.0.4 resolution: "side-channel@npm:1.0.4" @@ -17683,7 +17586,7 @@ __metadata: languageName: node linkType: hard -"webpack-dev-server@npm:^4.10.1": +"webpack-dev-server@npm:^4.10.1, webpack-dev-server@npm:^4.8.1": version: 4.11.1 resolution: "webpack-dev-server@npm:4.11.1" dependencies: @@ -17727,53 +17630,6 @@ __metadata: languageName: node linkType: hard -"webpack-dev-server@npm:^4.8.1": - version: 4.15.1 - resolution: "webpack-dev-server@npm:4.15.1" - dependencies: - "@types/bonjour": "npm:^3.5.9" - "@types/connect-history-api-fallback": "npm:^1.3.5" - "@types/express": "npm:^4.17.13" - "@types/serve-index": "npm:^1.9.1" - "@types/serve-static": "npm:^1.13.10" - "@types/sockjs": "npm:^0.3.33" - "@types/ws": "npm:^8.5.5" - ansi-html-community: "npm:^0.0.8" - bonjour-service: "npm:^1.0.11" - chokidar: "npm:^3.5.3" - colorette: "npm:^2.0.10" - compression: "npm:^1.7.4" - connect-history-api-fallback: "npm:^2.0.0" - default-gateway: "npm:^6.0.3" - express: "npm:^4.17.3" - graceful-fs: "npm:^4.2.6" - html-entities: "npm:^2.3.2" - http-proxy-middleware: "npm:^2.0.3" - ipaddr.js: "npm:^2.0.1" - launch-editor: "npm:^2.6.0" - open: "npm:^8.0.9" - p-retry: "npm:^4.5.0" - rimraf: "npm:^3.0.2" - schema-utils: "npm:^4.0.0" - selfsigned: "npm:^2.1.1" - serve-index: "npm:^1.9.1" - sockjs: "npm:^0.3.24" - spdy: "npm:^4.0.2" - webpack-dev-middleware: "npm:^5.3.1" - ws: "npm:^8.13.0" - peerDependencies: - webpack: ^4.37.0 || ^5.0.0 - peerDependenciesMeta: - webpack: - optional: true - webpack-cli: - optional: true - bin: - webpack-dev-server: bin/webpack-dev-server.js - checksum: fd6dfb6c71eb94696b21930ea4c2f25e95ba85fac1bbc15aa5d03af0a90712eba057901fa9131ed3e901665c95b2379208279aca61e9c48e7cda276c3caa95dd - languageName: node - linkType: hard - "webpack-merge@npm:^5.7.3": version: 5.8.0 resolution: "webpack-merge@npm:5.8.0" @@ -18499,7 +18355,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.11.0, ws@npm:^8.13.0": +"ws@npm:^8.11.0": version: 8.16.0 resolution: "ws@npm:8.16.0" peerDependencies: