@peopl-health/nexus 5.45.0-dev.7118 → 5.45.0-dev.7119

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.
@@ -247,7 +247,11 @@ const getPatientEscalationContextController = async (req, res) => {
247
247
  const context = await getEscalationContext({ code: req.params.code });
248
248
  res.status(200).json({ success: true, context });
249
249
  } catch (error) {
250
- logger.error('Error fetching patient escalation context:', { error: error.message, code: req.params?.code });
250
+ logger.error('Error fetching patient escalation context:', {
251
+ error: redactDirectIdentifiers(String(error.message || '')),
252
+ stack: redactDirectIdentifiers(String(error.stack || '')),
253
+ code: redactDirectIdentifiers(String(req.params?.code || '')),
254
+ });
251
255
  res.status(error.statusCode || 500).json({ success: false, error: error.message });
252
256
  }
253
257
  };
@@ -69,9 +69,10 @@ async function getEscalationContext({ code, now = Date.now(), timeoutMs = SECTIO
69
69
  context.triages = context.triages.records;
70
70
  }
71
71
  if (context.carePlan) {
72
- const { records, currentState = null } = context.carePlan;
73
- context.carePlan = { records, currentState };
74
- for (const section of currentState?.degradedSections || []) context.degradedSections.push(`carePlan.${section}`);
72
+ const { records, pagination = null, currentState = null } = context.carePlan;
73
+ const { degradedSections: carePlanDegraded = [], ...state } = currentState || {};
74
+ context.carePlan = { records, pagination, currentState: currentState ? state : null };
75
+ for (const section of carePlanDegraded) context.degradedSections.push(`carePlan.${section}`);
75
76
  }
76
77
 
77
78
  return context;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "5.45.0-dev.7118",
3
+ "version": "5.45.0-dev.7119",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",