Skip to content

Commit

Permalink
OHRI-2053 Cacx form names added to config
Browse files Browse the repository at this point in the history
  • Loading branch information
arodidev committed Jan 10, 2024
1 parent 61a2fd2 commit 183052f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 8 additions & 0 deletions packages/esm-cervical-cancer-app/src/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const CacxRegistration: React.FC<CacxRegistrationProps> = ({ patientUuid

const { cacxRegistrationEncounterType_UUID } = config.encounterTypes;

const { cervicalCancerRegistrationForm } = config.formNames;

const columnsLab: EncounterListColumn[] = useMemo(
() => [
{
Expand Down Expand Up @@ -48,14 +50,14 @@ export const CacxRegistration: React.FC<CacxRegistrationProps> = ({ 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'),
Expand All @@ -75,7 +77,7 @@ export const CacxRegistration: React.FC<CacxRegistrationProps> = ({ patientUuid
<EncounterList
patientUuid={patientUuid}
encounterType={cacxRegistrationEncounterType_UUID}
formList={[{ name: 'Cervical Cancer Registration Form' }]}
formList={[{ name: cervicalCancerRegistrationForm }]}
columns={columnsLab}
description={headerTitle}
headerTitle={headerTitle}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const CacxTreatment: React.FC<CacxTreatmentProps> = ({ patientUuid }) =>

const { cacxTreatmentEncounterType_UUID } = config.encounterTypes;

const { screeningAndCancerTreatmentForm } = config.formNames;

const columnsLab: EncounterListColumn[] = useMemo(
() => [
{
Expand Down Expand Up @@ -71,14 +73,14 @@ export const CacxTreatment: React.FC<CacxTreatmentProps> = ({ 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'),
Expand All @@ -98,7 +100,7 @@ export const CacxTreatment: React.FC<CacxTreatmentProps> = ({ patientUuid }) =>
<EncounterList
patientUuid={patientUuid}
encounterType={cacxTreatmentEncounterType_UUID}
formList={[{ name: 'Screening and Cancer Treatment Form' }]}
formList={[{ name: screeningAndCancerTreatmentForm }]}
columns={columnsLab}
description={headerTitle}
headerTitle={headerTitle}
Expand Down

0 comments on commit 183052f

Please sign in to comment.