@peopl-health/nexus 5.51.0-dev.7631 → 5.51.0-dev.7632
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.
|
@@ -104,13 +104,14 @@ async function handler(args = {}, context = {}) {
|
|
|
104
104
|
}
|
|
105
105
|
try {
|
|
106
106
|
const observedAt = runtime.patientInput?.observedAt;
|
|
107
|
+
if (typeof observedAt !== 'string' || Number.isNaN(new Date(observedAt).getTime())) {
|
|
108
|
+
return JSON.stringify({ success: false, error: 'support_routing_source_time_missing', data: {} });
|
|
109
|
+
}
|
|
107
110
|
const recommendation = new SupportRoutingRecommendation({
|
|
108
111
|
patientId: runtime.patientCode,
|
|
109
112
|
origin: 'chat',
|
|
110
113
|
sourceId: runtime.turnId,
|
|
111
|
-
createdAt:
|
|
112
|
-
? new Date(observedAt).toISOString()
|
|
113
|
-
: new Date().toISOString(),
|
|
114
|
+
createdAt: new Date(observedAt).toISOString(),
|
|
114
115
|
decisions: (args.decisions || []).map((decision) => normalizedDecision(decision, runtime.turnId)),
|
|
115
116
|
});
|
|
116
117
|
if (!isRuntimeLive(runtime)) return inactiveTurn();
|