@peopl-health/nexus 5.58.0-dev.10249 → 5.58.0-dev.10496
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/helpers/doctorReviewMessageHelper.js +147 -0
- package/lib/clinical/models/triageRecommendationEventModel.js +1 -0
- package/lib/clinical/protocols/treatmentFormulary.js +474 -0
- package/lib/clinical/providers/AnthropicProvider.js +2 -2
- package/lib/clinical/providers/OpenAIResponsesProvider.js +2 -2
- package/lib/clinical/services/escalationDraftService.js +37 -7
- package/lib/clinical/services/triageRecommendationService.js +17 -1
- package/lib/controllers/officeAssistantController.js +4 -2
- package/lib/helpers/sendClaimHelper.js +3 -2
- package/lib/index.d.ts +4 -2
- package/lib/models/escalationReviewModel.js +8 -0
- package/lib/services/escalationReviewService.js +66 -32
- package/lib/services/officeAssistantService.js +62 -11
- package/lib/storage/MongoStorage.js +1 -0
- package/package.json +1 -1
- package/lib/clinical/protocols/symptomReliefProtocol.js +0 -216
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
const PROTOCOL_VERSION = '2026-09-18';
|
|
2
|
-
|
|
3
|
-
const MEDICAL_REVIEW = 'valoración médica';
|
|
4
|
-
|
|
5
|
-
function deepFreeze(value) {
|
|
6
|
-
if (value && typeof value === 'object' && !Object.isFrozen(value)) {
|
|
7
|
-
Object.freeze(value);
|
|
8
|
-
for (const nested of Object.values(value)) deepFreeze(nested);
|
|
9
|
-
}
|
|
10
|
-
return value;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const SYMPTOM_RELIEF_PROTOCOL = deepFreeze([
|
|
14
|
-
{
|
|
15
|
-
key: 'nausea_vomito',
|
|
16
|
-
label: 'Náusea y vómito',
|
|
17
|
-
options: [
|
|
18
|
-
{ grade: 1, brand: 'AMAL', drug: 'Ondansetrón', strength: '8 mg', instructions: '1 tableta cada 24 horas por 5 días' },
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
key: 'reflujo',
|
|
23
|
-
label: 'Reflujo',
|
|
24
|
-
options: [
|
|
25
|
-
{
|
|
26
|
-
grade: 1,
|
|
27
|
-
brand: null,
|
|
28
|
-
drug: 'Esomeprazol',
|
|
29
|
-
strength: '40 mg',
|
|
30
|
-
instructions: '1 cápsula cada 24 horas por 5 días',
|
|
31
|
-
alternative: {
|
|
32
|
-
when: 'la paciente ya está tomando esomeprazol',
|
|
33
|
-
brand: null,
|
|
34
|
-
drug: 'Famotidina',
|
|
35
|
-
strength: '40 mg',
|
|
36
|
-
instructions: '1 tableta cada 24 horas por 5 días',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
key: 'diarrea',
|
|
43
|
-
label: 'Diarrea',
|
|
44
|
-
options: [
|
|
45
|
-
{
|
|
46
|
-
grade: 1,
|
|
47
|
-
brand: null,
|
|
48
|
-
drug: 'Loperamida',
|
|
49
|
-
strength: '4 mg',
|
|
50
|
-
instructions: '4 mg al inicio y después 1 tableta cada 6 horas, máximo 8 tabletas al día',
|
|
51
|
-
consider: true,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
grade: 2,
|
|
55
|
-
brand: null,
|
|
56
|
-
drug: 'Loperamida',
|
|
57
|
-
strength: '4 mg',
|
|
58
|
-
instructions: '4 mg al inicio y después 1 tableta cada 6 horas, máximo 8 tabletas al día',
|
|
59
|
-
ruleOutFirst: ['causa infecciosa', 'causa obstructiva', 'intolerancia'],
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
key: 'dolor_abdominal_colico',
|
|
65
|
-
label: 'Dolor abdominal tipo cólico',
|
|
66
|
-
options: [
|
|
67
|
-
{
|
|
68
|
-
grade: 1,
|
|
69
|
-
brand: 'BUSCAPINA COMPUESTA',
|
|
70
|
-
drug: 'Butilhioscina/Metamizol',
|
|
71
|
-
strength: '10/250 mg',
|
|
72
|
-
instructions: '1 tableta cada 8 a 12 horas por razón necesaria',
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
key: 'estrenimiento',
|
|
78
|
-
label: 'Estreñimiento',
|
|
79
|
-
options: [
|
|
80
|
-
{ grade: 1, brand: 'SENOKOT', drug: 'Senósidos', strength: null, instructions: '2 tabletas cada noche por 5 días' },
|
|
81
|
-
{
|
|
82
|
-
grade: 2,
|
|
83
|
-
brand: 'LACTULAX',
|
|
84
|
-
drug: 'Lactulosa',
|
|
85
|
-
strength: null,
|
|
86
|
-
instructions: '10 ml cada 8 horas hasta lograr evacuación, después suspender',
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
key: 'mucositis',
|
|
92
|
-
label: 'Mucositis',
|
|
93
|
-
options: [
|
|
94
|
-
{
|
|
95
|
-
grade: 1,
|
|
96
|
-
brand: null,
|
|
97
|
-
drug: 'Colutorios alcalinos',
|
|
98
|
-
strength: '½ L de agua con 1 cucharadita de sal y 2 cucharaditas de bicarbonato',
|
|
99
|
-
instructions: 'enjuagues y gárgaras de 1 minuto cada 6 horas por 5 días',
|
|
100
|
-
isPharmacological: false,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
grade: 2,
|
|
104
|
-
brand: 'VELIAN',
|
|
105
|
-
drug: 'Dexketoprofeno',
|
|
106
|
-
strength: '25 mg/10 ml en sobres',
|
|
107
|
-
instructions: '1 sobre cada 8 horas, 30 minutos antes de los alimentos, y tragar, por 7 días',
|
|
108
|
-
escalateIf: `si persiste, ${MEDICAL_REVIEW}`,
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
key: 'dolor',
|
|
114
|
-
label: 'Dolor',
|
|
115
|
-
options: [
|
|
116
|
-
{
|
|
117
|
-
grade: 1,
|
|
118
|
-
brand: 'TEMPRA / TYLENOL',
|
|
119
|
-
drug: 'Paracetamol',
|
|
120
|
-
strength: '750 mg',
|
|
121
|
-
instructions: '1 a 2 tabletas cada 8 horas por razón necesaria, por 5 días',
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
grade: 2,
|
|
125
|
-
brand: 'CELEBREX',
|
|
126
|
-
drug: 'Celecoxib',
|
|
127
|
-
strength: '200 mg',
|
|
128
|
-
instructions: '1 cápsula cada 24 horas con alimentos por 5 días',
|
|
129
|
-
steppedUpFromGrade: 1,
|
|
130
|
-
escalateIf: `siempre, ${MEDICAL_REVIEW}`,
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
key: 'neuropatia',
|
|
136
|
-
label: 'Neuropatía',
|
|
137
|
-
alwaysEscalate: MEDICAL_REVIEW,
|
|
138
|
-
recognition: 'ardor, sensación de adormecimiento o piquetes; sigue el trayecto de un nervio, o aparece en manos y pies al mismo tiempo',
|
|
139
|
-
options: [],
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
key: 'sindrome_mano_pie',
|
|
143
|
-
label: 'Síndrome mano-pie',
|
|
144
|
-
options: [
|
|
145
|
-
{
|
|
146
|
-
grade: 1,
|
|
147
|
-
brand: 'CERAVE',
|
|
148
|
-
drug: 'Ceramidas',
|
|
149
|
-
strength: null,
|
|
150
|
-
instructions: '2 a 3 veces al día de forma continua',
|
|
151
|
-
isPharmacological: false,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
grade: 2,
|
|
155
|
-
brand: 'NUTRAPLUS',
|
|
156
|
-
drug: 'Urea',
|
|
157
|
-
strength: '10%',
|
|
158
|
-
instructions: 'capa fina cada 12 horas de forma continua',
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
key: 'rinitis_alergia',
|
|
164
|
-
label: 'Rinitis o alergia',
|
|
165
|
-
options: [
|
|
166
|
-
{ grade: 1, brand: 'REACTINE', drug: 'Cetirizina', strength: '10 mg', instructions: '1 tableta cada 24 horas por 7 días' },
|
|
167
|
-
{ grade: 2, brand: 'REACTINE', drug: 'Cetirizina', strength: '10 mg', instructions: '1 tableta cada 24 horas por 7 días' },
|
|
168
|
-
],
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
key: 'insomnio',
|
|
172
|
-
label: 'Insomnio',
|
|
173
|
-
options: [
|
|
174
|
-
{ grade: 1, brand: 'MELATOL', drug: 'Melatonina', strength: '3 mg', instructions: '1 tableta cada 24 horas por la noche por 14 días' },
|
|
175
|
-
{ grade: 2, brand: 'MELATOL', drug: 'Melatonina', strength: '3 mg', instructions: '1 tableta cada 24 horas por la noche por 14 días' },
|
|
176
|
-
],
|
|
177
|
-
},
|
|
178
|
-
]);
|
|
179
|
-
|
|
180
|
-
const byKey = new Map(SYMPTOM_RELIEF_PROTOCOL.map((entry) => [entry.key, entry]));
|
|
181
|
-
|
|
182
|
-
function protocolFor(symptomKey, grade) {
|
|
183
|
-
const entry = byKey.get(String(symptomKey ?? '').trim());
|
|
184
|
-
if (!entry) return null;
|
|
185
|
-
|
|
186
|
-
const option = entry.options.find((candidate) => candidate.grade === grade) ?? null;
|
|
187
|
-
return {
|
|
188
|
-
key: entry.key,
|
|
189
|
-
label: entry.label,
|
|
190
|
-
grade,
|
|
191
|
-
option,
|
|
192
|
-
alwaysEscalate: entry.alwaysEscalate ?? null,
|
|
193
|
-
recognition: entry.recognition ?? null,
|
|
194
|
-
hasNoOptionForGrade: option === null,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function protocolExcerpt(symptoms = []) {
|
|
199
|
-
const seen = new Set();
|
|
200
|
-
const excerpt = [];
|
|
201
|
-
for (const { key, grade } of symptoms) {
|
|
202
|
-
const id = `${key}:${grade}`;
|
|
203
|
-
if (seen.has(id)) continue;
|
|
204
|
-
seen.add(id);
|
|
205
|
-
const entry = protocolFor(key, grade);
|
|
206
|
-
if (entry) excerpt.push(entry);
|
|
207
|
-
}
|
|
208
|
-
return excerpt;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
module.exports = {
|
|
212
|
-
PROTOCOL_VERSION,
|
|
213
|
-
SYMPTOM_RELIEF_PROTOCOL,
|
|
214
|
-
protocolFor,
|
|
215
|
-
protocolExcerpt,
|
|
216
|
-
};
|