@peopl-health/nexus 5.9.2 → 5.10.0-dev.1021
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.
- package/lib/clinical/config/subAgentsConfig.js +1 -7
- package/lib/clinical/memory/DefaultMemoryManager.js +1 -1
- package/lib/clinical/providers/AnthropicProvider.js +0 -10
- package/lib/clinical/tools/{getPatientRiskAssessmentTool.js → getPatientRiskProfileTool.js} +4 -4
- package/lib/clinical/tools/getRouterContextBundleTool.js +1 -1
- package/lib/clinical/tools/registerClinicalTools.js +1 -1
- package/lib/fhir/constants/projectionSlugs.js +0 -12
- package/lib/fhir/index.js +1 -9
- package/lib/fhir/projections/registerProjectors.js +0 -6
- package/lib/fhir/resources/CarePlan.js +1 -23
- package/lib/fhir/resources/ClinicalImpression.js +1 -64
- package/lib/fhir/resources/Provenance.js +0 -20
- package/lib/fhir/resources/RiskAssessment.js +1 -40
- package/lib/fhir/resources/Task.js +0 -57
- package/lib/fhir/services/riskService.js +0 -19
- package/package.json +1 -1
- package/lib/clinical/helpers/palliativeAssessmentHelper.js +0 -62
- package/lib/clinical/models/patternConsultModel.js +0 -37
- package/lib/clinical/services/patternConsultService.js +0 -115
- package/lib/clinical/tools/requestPatternConsultTool.js +0 -70
- package/lib/clinical/tools/submitPalliativeAssessmentTool.js +0 -75
- package/lib/clinical/tools/submitRecommendationPlanTool.js +0 -242
- package/lib/clinical/tools/submitSafetyGateTool.js +0 -207
- package/lib/clinical/tools/updatePalliativeAssessmentTool.js +0 -74
- package/lib/fhir/projections/palliativeProjection.js +0 -37
- package/lib/fhir/projections/recommendationPlanProjection.js +0 -25
- package/lib/fhir/projections/safetyGateProjection.js +0 -16
- package/lib/fhir/services/palliativeService.js +0 -121
- package/lib/fhir/services/recommendationService.js +0 -27
- package/lib/shared/dtos/PalliativeAssessment.js +0 -62
- package/lib/shared/dtos/RecommendationPlan.js +0 -109
- package/lib/shared/dtos/RecommendationSafetyGate.js +0 -64
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const { z } = require('zod');
|
|
2
|
-
|
|
3
|
-
const { BaseDto } = require('./BaseDto');
|
|
4
|
-
|
|
5
|
-
const dateTime = z.iso.datetime({ offset: true });
|
|
6
|
-
|
|
7
|
-
const ESCALATION_ROUTES = ['emergencia', 'urgencias', 'equipo_tratante_hoy'];
|
|
8
|
-
const RED_FLAG_STATUSES = ['confirmed', 'partially_confirmed', 'inconclusive', 'denied'];
|
|
9
|
-
const RISK_PROBABILITIES = ['high', 'medium', 'low'];
|
|
10
|
-
|
|
11
|
-
const relatedAeSchema = z.strictObject({
|
|
12
|
-
ctcaeTerm: z.string(),
|
|
13
|
-
probabilityGivenPatient: z.enum(RISK_PROBABILITIES),
|
|
14
|
-
whyIsRelevant: z.string(),
|
|
15
|
-
groundedIn: z.array(z.string()).default([]),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const redFlagEventSchema = z.strictObject({
|
|
19
|
-
clinicalEvent: z.string(),
|
|
20
|
-
ctcaeGradesReference: z.array(z.number().int()).default([]),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const redFlagSchema = z.strictObject({
|
|
24
|
-
name: z.string(),
|
|
25
|
-
verificationStatus: z.enum(RED_FLAG_STATUSES),
|
|
26
|
-
escalationRoute: z.enum(ESCALATION_ROUTES).nullable().default(null),
|
|
27
|
-
eventsConfirmed: z.array(z.string()).default([]),
|
|
28
|
-
eventsDenied: z.array(z.string()).default([]),
|
|
29
|
-
relatedAes: z.array(relatedAeSchema).default([]),
|
|
30
|
-
definition: z.array(redFlagEventSchema).default([]),
|
|
31
|
-
groundedIn: z.array(z.string()).default([]),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
const schema = z.strictObject({
|
|
35
|
-
schemaVersion: z.string().default('1'),
|
|
36
|
-
runId: z.string(),
|
|
37
|
-
patientId: z.string(),
|
|
38
|
-
origin: z.enum(['chat', 'triage']).default('chat'),
|
|
39
|
-
turnId: z.string(),
|
|
40
|
-
urgentUnder24h: z.boolean(),
|
|
41
|
-
maxActionTimeHours: z.number().int().min(1).max(24).nullable().default(null),
|
|
42
|
-
escalationRoute: z.enum(ESCALATION_ROUTES).nullable().default(null),
|
|
43
|
-
reasonForEscalation: z.string().nullable().default(null),
|
|
44
|
-
summary: z.string(),
|
|
45
|
-
redFlags: z.array(redFlagSchema).default([]),
|
|
46
|
-
createdAt: dateTime,
|
|
47
|
-
})
|
|
48
|
-
.refine((g) => !g.urgentUnder24h || g.maxActionTimeHours !== null, {
|
|
49
|
-
message: 'urgent gate requires maxActionTimeHours',
|
|
50
|
-
})
|
|
51
|
-
.refine((g) => !g.urgentUnder24h || g.escalationRoute !== null, {
|
|
52
|
-
message: 'urgent gate requires escalationRoute',
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
class RecommendationSafetyGate extends BaseDto {}
|
|
56
|
-
|
|
57
|
-
RecommendationSafetyGate.schema = schema;
|
|
58
|
-
|
|
59
|
-
module.exports = {
|
|
60
|
-
RecommendationSafetyGate,
|
|
61
|
-
ESCALATION_ROUTES,
|
|
62
|
-
RED_FLAG_STATUSES,
|
|
63
|
-
RISK_PROBABILITIES,
|
|
64
|
-
};
|