@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:', {
|
|
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
|
-
|
|
74
|
-
|
|
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;
|