node5585
03/20/2024, 11:40 PMstatusReason field using a CodeableConcept.
Value required at path: /statusReason
traceId=d9bd719e-ec37-4703-bffc-9048b8745d2f
I'm also noticing that the Medplum app UI does not support editing the Task.statusReason field as it appears to be entirely ignored.node5585
03/21/2024, 3:39 PMts
const statusReasonValue: CodeableConcept = {
coding: [
{
system: System.CarePathwayAdjustmentStatusReason,
},
],
text: actionReason,
};
return medplum.patchResource('Task', task.id!, [
{ op: 'replace', path: '/status', value: actionIntent === 'approve' ? 'accepted' : 'rejected' },
{ op: 'replace', path: '/statusReason', value: statusReasonValue },
]);rahul1
03/21/2024, 5:14 PMreplace will only work if there is an existing value at that path. You will have to use add to insert a new valuerahul1
03/21/2024, 5:14 PMupsert operationrahul1
03/21/2024, 5:14 PMnode5585
03/21/2024, 5:15 PMhttps://tenor.com/tNzuJFsBWQm.gif▾
rahul1
03/21/2024, 5:54 PM