@peopl-health/nexus 5.71.29 → 5.71.30

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.
@@ -156,7 +156,13 @@ async function extractClinicalMentions({ text, turnId, code, provider, detectedT
156
156
  const patientMentions = [...clinicalMentions, ...pendingMentions]
157
157
  .filter((mention) => mention.fact.assertion.experiencer === 'patient');
158
158
  if (persist && patientMentions.length) {
159
- await storeClinicalMentions({ patientId: code, mentions: patientMentions });
159
+ // A store failure must not discard what was extracted: the turn still routes on these facts.
160
+ try {
161
+ await storeClinicalMentions({ patientId: code, mentions: patientMentions });
162
+ } catch (err) {
163
+ logger.error('[clinicalExtraction] storing the mentions in FHIR failed (may be partially stored); the turn keeps them', { turnId, mentions: patientMentions.length, error: err?.message });
164
+ trace?.setSignals?.({ clinicalMentionsStoreFailed: true });
165
+ }
160
166
  }
161
167
 
162
168
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "5.71.29",
3
+ "version": "5.71.30",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",