From 94b240f0f0b2e117cbb8540640b46e1b6e49be8f Mon Sep 17 00:00:00 2001 From: hadijahkyampeire Date: Tue, 21 May 2024 13:31:30 +0300 Subject: [PATCH] tweak the url rep --- src/components/encounter/encounter-form.component.tsx | 4 ++-- src/constants.ts | 2 +- src/submission-handlers/encounterRoleHandler.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/encounter/encounter-form.component.tsx b/src/components/encounter/encounter-form.component.tsx index 00fa3132f..da4968a86 100644 --- a/src/components/encounter/encounter-form.component.tsx +++ b/src/components/encounter/encounter-form.component.tsx @@ -107,7 +107,7 @@ const EncounterForm: React.FC = ({ sessionMode: sessionMode || (form?.encounter ? 'edit' : 'enter'), encounterDate: formSessionDate, encounterProvider: provider, - encounterRole: role, + encounterRole, form: form, visit: visit, setEncounterDate, @@ -728,7 +728,7 @@ const EncounterForm: React.FC = ({ patient={patient} formSessionDate={encounterDate} provider={provider} - role={role} + role={encounterRole} location={location} visit={visit} values={values} diff --git a/src/constants.ts b/src/constants.ts index 907cf2069..2e9b058cd 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,7 +3,7 @@ export const ConceptFalse = '488b58ff-64f5-4f8a-8979-fa79940b1594'; export const UnspecifiedValue = 'VALUE_UNSPECIFIED'; export const encounterRepresentation = 'custom:(uuid,encounterDatetime,encounterType,location:(uuid,name),' + - 'patient:(uuid,display),encounterProviders:(uuid,provider:(uuid,name)),' + + 'patient:(uuid,display),encounterProviders:(uuid,provider:(uuid,name),encounterRole:(uuid,name)),' + 'orders:(uuid,display,concept:(uuid,display),voided),' + 'obs:(uuid,obsDatetime,voided,groupMembers,formFieldNamespace,formFieldPath,concept:(uuid,name:(uuid,name)),value:(uuid,name:(uuid,name),' + 'names:(uuid,conceptNameType,name))))'; diff --git a/src/submission-handlers/encounterRoleHandler.ts b/src/submission-handlers/encounterRoleHandler.ts index 8e3b34edd..e9df2e77f 100644 --- a/src/submission-handlers/encounterRoleHandler.ts +++ b/src/submission-handlers/encounterRoleHandler.ts @@ -12,7 +12,7 @@ export const EncounterRoleHandler: SubmissionHandler = { context: EncounterContext, ) => { if (encounter) { - return encounter.encounterProviders[0]?.encounterRole; + return encounter.encounterProviders[0]?.encounterRole?.uuid; } else { return context.encounterRole; } @@ -22,7 +22,7 @@ export const EncounterRoleHandler: SubmissionHandler = { return value; }, getPreviousValue: (field: FormField, encounter: OpenmrsEncounter, allFormFields: Array) => { - const encounterRole = encounter.encounterProviders[0]?.encounterRole; + const encounterRole = encounter.encounterProviders[0]?.encounterRole?.uuid; return encounterRole || null; }, };