From 183052fe9ddbd40e7b074eb745b4ff622168a5ec Mon Sep 17 00:00:00 2001 From: arodidev <51090527+arodidev@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:46:41 +0300 Subject: [PATCH] OHRI-2053 Cacx form names added to config --- packages/esm-cervical-cancer-app/src/config-schema.ts | 8 ++++++++ .../cacx-visits/tabs/cacx-registration.component.tsx | 8 +++++--- .../views/cacx-visits/tabs/cacx-treatment.component.tsx | 8 +++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/esm-cervical-cancer-app/src/config-schema.ts b/packages/esm-cervical-cancer-app/src/config-schema.ts index 853664b9f..25c47f938 100644 --- a/packages/esm-cervical-cancer-app/src/config-schema.ts +++ b/packages/esm-cervical-cancer-app/src/config-schema.ts @@ -25,6 +25,14 @@ export const configSchema = { VIAProcedureResultsConcept: 'cc647244-0826-4d8e-8c5a-d7a371267bf4', }, }, + formNames: { + _type: Type.Object, + _description: 'List of forms related to Cacx.', + _default: { + screeningAndCancerTreatmentForm: 'Screening and Cancer Treatment Form', + cervicalCancerRegistrationForm: 'Cervical Cancer Registration Form', + }, + }, }; export interface ConfigObject { 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 223677012..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 @@ -18,6 +18,8 @@ export const CacxRegistration: React.FC = ({ patientUuid const { cacxRegistrationEncounterType_UUID } = config.encounterTypes; + const { cervicalCancerRegistrationForm } = config.formNames; + const columnsLab: EncounterListColumn[] = useMemo( () => [ { @@ -48,14 +50,14 @@ export const CacxRegistration: React.FC = ({ patientUuid getValue: (encounter) => { const baseActions = [ { - form: { name: 'Cervical Cancer Registration Form', package: 'cacx' }, + form: { name: cervicalCancerRegistrationForm, package: 'cacx' }, encounterUuid: encounter.uuid, intent: '*', label: t('viewDetails', 'View Details'), mode: 'view', }, { - form: { name: 'Cervical Cancer Registration Form', package: 'cacx' }, + form: { name: cervicalCancerRegistrationForm, package: 'cacx' }, encounterUuid: encounter.uuid, intent: '*', label: t('editForm', 'Edit Form'), @@ -75,7 +77,7 @@ export const CacxRegistration: React.FC = ({ patientUuid = ({ patientUuid }) => const { cacxTreatmentEncounterType_UUID } = config.encounterTypes; + const { screeningAndCancerTreatmentForm } = config.formNames; + const columnsLab: EncounterListColumn[] = useMemo( () => [ { @@ -71,14 +73,14 @@ export const CacxTreatment: React.FC = ({ patientUuid }) => getValue: (encounter) => { const baseActions = [ { - form: { name: 'Screening and Cancer Treatment Form', package: 'cacx' }, + form: { name: screeningAndCancerTreatmentForm, package: 'cacx' }, encounterUuid: encounter.uuid, intent: '*', label: t('viewDetails', 'View Details'), mode: 'view', }, { - form: { name: 'Screening and Cancer Treatment Form', package: 'cacx' }, + form: { name: screeningAndCancerTreatmentForm, package: 'cacx' }, encounterUuid: encounter.uuid, intent: '*', label: t('editForm', 'Edit Form'), @@ -98,7 +100,7 @@ export const CacxTreatment: React.FC = ({ patientUuid }) =>