@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.
Files changed (32) hide show
  1. package/lib/clinical/config/subAgentsConfig.js +1 -7
  2. package/lib/clinical/memory/DefaultMemoryManager.js +1 -1
  3. package/lib/clinical/providers/AnthropicProvider.js +0 -10
  4. package/lib/clinical/tools/{getPatientRiskAssessmentTool.js → getPatientRiskProfileTool.js} +4 -4
  5. package/lib/clinical/tools/getRouterContextBundleTool.js +1 -1
  6. package/lib/clinical/tools/registerClinicalTools.js +1 -1
  7. package/lib/fhir/constants/projectionSlugs.js +0 -12
  8. package/lib/fhir/index.js +1 -9
  9. package/lib/fhir/projections/registerProjectors.js +0 -6
  10. package/lib/fhir/resources/CarePlan.js +1 -23
  11. package/lib/fhir/resources/ClinicalImpression.js +1 -64
  12. package/lib/fhir/resources/Provenance.js +0 -20
  13. package/lib/fhir/resources/RiskAssessment.js +1 -40
  14. package/lib/fhir/resources/Task.js +0 -57
  15. package/lib/fhir/services/riskService.js +0 -19
  16. package/package.json +1 -1
  17. package/lib/clinical/helpers/palliativeAssessmentHelper.js +0 -62
  18. package/lib/clinical/models/patternConsultModel.js +0 -37
  19. package/lib/clinical/services/patternConsultService.js +0 -115
  20. package/lib/clinical/tools/requestPatternConsultTool.js +0 -70
  21. package/lib/clinical/tools/submitPalliativeAssessmentTool.js +0 -75
  22. package/lib/clinical/tools/submitRecommendationPlanTool.js +0 -242
  23. package/lib/clinical/tools/submitSafetyGateTool.js +0 -207
  24. package/lib/clinical/tools/updatePalliativeAssessmentTool.js +0 -74
  25. package/lib/fhir/projections/palliativeProjection.js +0 -37
  26. package/lib/fhir/projections/recommendationPlanProjection.js +0 -25
  27. package/lib/fhir/projections/safetyGateProjection.js +0 -16
  28. package/lib/fhir/services/palliativeService.js +0 -121
  29. package/lib/fhir/services/recommendationService.js +0 -27
  30. package/lib/shared/dtos/PalliativeAssessment.js +0 -62
  31. package/lib/shared/dtos/RecommendationPlan.js +0 -109
  32. 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
- };