@peopl-health/nexus 5.71.25 → 5.71.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,9 @@ const COMPOSE_AS_PREFIX = 'compose_as: ';
14
14
 
15
15
  const ccText = (concept) => concept?.text || null;
16
16
  const caseReason = (caseId) => [{ reference: reference('Condition', caseId) }];
17
+ // Older rows hold a flat Reference; R5 types finding.item as CodeableReference.
18
+ const findingItemReference = (item) =>
19
+ (typeof item?.reference === 'string' ? item.reference : item?.reference?.reference);
17
20
 
18
21
  function dispositionBase(resourceType, disposition) {
19
22
  return baseResource(resourceType, disposition.dispositionId, ROUTING_DISPOSITION_SLUG, disposition.patientId);
@@ -141,7 +144,7 @@ function assessmentResource(assessment, { decisionId, committedAt, disposition }
141
144
  const entry = {};
142
145
  const extensions = [];
143
146
  if (finding.caseId) {
144
- entry.item = reference('Condition', finding.caseId);
147
+ entry.item = { reference: reference('Condition', finding.caseId) };
145
148
  extensions.push(extension(ROUTING_EXT.FINDING_CASE_ID, { valueString: finding.caseId }));
146
149
  }
147
150
  extensions.push(
@@ -244,7 +247,7 @@ function reconstructAssessment(resource, patientId, turnId) {
244
247
  findings: (resource.finding || []).map((finding) => {
245
248
  const findingExt = extMap(finding);
246
249
  return {
247
- caseId: referencedId(finding, ROUTING_EXT.FINDING_CASE_ID, finding.item?.reference),
250
+ caseId: referencedId(finding, ROUTING_EXT.FINDING_CASE_ID, findingItemReference(finding.item)),
248
251
  clinicalReasoning: findingExt[ROUTING_EXT.FINDING_REASONING] || '',
249
252
  decisionAction: findingExt[ROUTING_EXT.FINDING_ACTION] || '',
250
253
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "5.71.25",
3
+ "version": "5.71.26",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",