diff --git a/src/components/encounter/encounter-form.component.tsx b/src/components/encounter/encounter-form.component.tsx index 00fa3132..da4968a8 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 907cf206..2e9b058c 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 8e3b34ed..e9df2e77 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; }, };