@integraciones_doc24/sdk 0.39.7 → 0.39.8
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/baseSdk/consultation.d.ts +99 -0
- package/lib/baseSdk/consultation.js +23 -0
- package/lib/baseSdk/diagnostica.d.ts +16 -16
- package/lib/baseSdk/diagnostica.js +19 -22
- package/lib/baseSdk/index.js +3 -4
- package/lib/baseSdk/user.d.ts +10 -60
- package/lib/baseSdk/user.js +26 -74
- package/lib/index.d.ts +133 -243
- package/lib/schemas.d.ts +411 -776
- package/lib/schemas.js +136 -152
- package/lib/types.d.ts +9 -35
- package/lib/userSdk/chat.d.ts +2 -2
- package/lib/userSdk/index.js +0 -3
- package/lib/userSdk/patients.d.ts +16 -30
- package/lib/userSdk/patients.js +14 -35
- package/lib/userSdk/schedule.d.ts +2 -5
- package/lib/userSdk/schedule.js +16 -21
- package/lib/userSdk/videoVisit.d.ts +2 -4
- package/lib/userSdk/videoVisit.js +4 -11
- package/lib/utils.d.ts +4 -2
- package/lib/utils.js +22 -11
- package/lib/webhook/index.js +0 -1
- package/package.json +2 -2
- package/lib/baseSdk/external.d.ts +0 -177
- package/lib/baseSdk/external.js +0 -96
- package/lib/userSdk/external.d.ts +0 -34
- package/lib/userSdk/external.js +0 -72
package/lib/schemas.js
CHANGED
|
@@ -2,20 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doc24Schemas = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const gender = zod_1.enum(['m', 'f'
|
|
6
|
-
|
|
5
|
+
const gender = zod_1.enum(['m', 'f']);
|
|
6
|
+
const identificationType = zod_1.enum([
|
|
7
|
+
'dni',
|
|
8
|
+
'ndi',
|
|
9
|
+
'passport',
|
|
10
|
+
'credential',
|
|
11
|
+
'nn',
|
|
12
|
+
'cpf',
|
|
13
|
+
'rg',
|
|
14
|
+
]);
|
|
7
15
|
const sdkCredentials = zod_1.object({ iss: zod_1.string(), key: zod_1.string() });
|
|
8
16
|
const basePersonData = zod_1.object({
|
|
9
17
|
firstName: zod_1.string(),
|
|
10
18
|
lastName: zod_1.string(),
|
|
11
|
-
identificationType
|
|
12
|
-
identificationValue: zod_1.string()
|
|
19
|
+
identificationType,
|
|
20
|
+
identificationValue: zod_1.string(),
|
|
13
21
|
countryId: zod_1.string(),
|
|
14
22
|
birthdate: zod_1.date(),
|
|
15
23
|
gender,
|
|
16
24
|
});
|
|
17
|
-
const patient = basePersonData;
|
|
18
|
-
const user = basePersonData.extend({ phone: zod_1.string().optional(), email: zod_1.string() });
|
|
19
25
|
const specialtyMode = zod_1.enum(['appointment', 'chat', 'instant']);
|
|
20
26
|
const specialty = zod_1.object({
|
|
21
27
|
id: zod_1.number(),
|
|
@@ -24,7 +30,6 @@ const specialty = zod_1.object({
|
|
|
24
30
|
const scheduleAvailabilityFilter = zod_1.object({
|
|
25
31
|
specialtyId: zod_1.number().optional(),
|
|
26
32
|
professionalId: zod_1.number().optional(),
|
|
27
|
-
language: zod_1.string().optional(),
|
|
28
33
|
});
|
|
29
34
|
const availableAppointment = zod_1.object({
|
|
30
35
|
id: zod_1.number().or(zod_1.string()),
|
|
@@ -41,7 +46,6 @@ const availableAppointment = zod_1.object({
|
|
|
41
46
|
atentions: zod_1.number(),
|
|
42
47
|
ranking: zod_1.unknown(),
|
|
43
48
|
length: zod_1.number().nullish(),
|
|
44
|
-
consultation_value: zod_1.string().optional().nullish()
|
|
45
49
|
});
|
|
46
50
|
const appointment = zod_1.object({
|
|
47
51
|
id: zod_1.number(),
|
|
@@ -139,7 +143,7 @@ const diagnosticaPatient = zod_1.object({
|
|
|
139
143
|
firstName: zod_1.string(),
|
|
140
144
|
lastName: zod_1.string(),
|
|
141
145
|
birthday: zod_1.date(),
|
|
142
|
-
identificationType: zod_1.literal('
|
|
146
|
+
identificationType: zod_1.literal('dni'),
|
|
143
147
|
identificationValue: zod_1.string(),
|
|
144
148
|
gender: gender,
|
|
145
149
|
});
|
|
@@ -152,31 +156,6 @@ const diagnosticaDeepLinkResponse = zod_1.object({
|
|
|
152
156
|
forwardingRequired: zod_1.literal(true),
|
|
153
157
|
deepLink: zod_1.string().url(),
|
|
154
158
|
}).or(zod_1.object({ forwardingRequired: zod_1.literal(false) }));
|
|
155
|
-
const videoVisit = zod_1.object({
|
|
156
|
-
id: zod_1.number().nullable(),
|
|
157
|
-
creationDate: zod_1.date(),
|
|
158
|
-
patientId: zod_1.number(),
|
|
159
|
-
user: zod_1.object({
|
|
160
|
-
id: zod_1.number(),
|
|
161
|
-
email: zod_1.string().nullable(),
|
|
162
|
-
phone: zod_1.string().nullable(),
|
|
163
|
-
}),
|
|
164
|
-
vcToken: zod_1.string(),
|
|
165
|
-
appointment: zod_1.object({
|
|
166
|
-
id: zod_1.number(),
|
|
167
|
-
date: zod_1.date(),
|
|
168
|
-
}).optional(),
|
|
169
|
-
videoVisit: zod_1.object({
|
|
170
|
-
id: zod_1.number(),
|
|
171
|
-
status: zod_1.string(),
|
|
172
|
-
}).optional(),
|
|
173
|
-
paymentStatus: zod_1.string().optional(),
|
|
174
|
-
atentionId: zod_1.number().optional(),
|
|
175
|
-
});
|
|
176
|
-
const historicalVideoVisit = videoVisit.extend({
|
|
177
|
-
specialty: zod_1.string(),
|
|
178
|
-
professional: zod_1.string(),
|
|
179
|
-
});
|
|
180
159
|
const coverageInfo = zod_1.object({
|
|
181
160
|
financerId: zod_1.number().nullable(),
|
|
182
161
|
defaultAffiliationId: zod_1.number().nullable(),
|
|
@@ -201,109 +180,112 @@ const coverageInfo = zod_1.object({
|
|
|
201
180
|
authorizationCode: zod_1.string().nullable(),
|
|
202
181
|
authorizationCodeExpiration: zod_1.date().nullable(),
|
|
203
182
|
}).nullable();
|
|
204
|
-
const
|
|
205
|
-
identificationType
|
|
183
|
+
const oldIdentificaiton = zod_1.object({
|
|
184
|
+
identificationType,
|
|
206
185
|
identificationValue: zod_1.string(),
|
|
207
|
-
channel: zod_1.enum(['1', '2']),
|
|
208
186
|
});
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
email: zod_1.string(),
|
|
234
|
-
|
|
187
|
+
const consultation = zod_1.object({
|
|
188
|
+
id_consulta: zod_1.number(),
|
|
189
|
+
tipo_consulta: zod_1.string(),
|
|
190
|
+
estado: zod_1.string(),
|
|
191
|
+
tipo_usuario_cancelacion: zod_1.string().nullable(),
|
|
192
|
+
fecha_cancelacion: zod_1.string().nullable(),
|
|
193
|
+
estado_pago: zod_1.string(),
|
|
194
|
+
referencia_mercadopago: zod_1.string().nullable(),
|
|
195
|
+
id_atencion: zod_1.number(),
|
|
196
|
+
id_profesional: zod_1.number(),
|
|
197
|
+
profesional: zod_1.string(),
|
|
198
|
+
modalidad_paciente_turno: zod_1.string().nullable(),
|
|
199
|
+
provincia_consultorio: zod_1.string().nullable(),
|
|
200
|
+
localidad_consultorio: zod_1.string().nullable(),
|
|
201
|
+
domicilio_consultorio: zod_1.string().nullable(),
|
|
202
|
+
marketplace: zod_1.string(),
|
|
203
|
+
profesional_matriculas: zod_1.array(zod_1.any()),
|
|
204
|
+
info_paciente: zod_1.object({
|
|
205
|
+
id_paciente: zod_1.number(),
|
|
206
|
+
apellido: zod_1.string().optional().nullable(),
|
|
207
|
+
nombre: zod_1.string().optional().nullable(),
|
|
208
|
+
genero: zod_1.string().optional().nullable(),
|
|
209
|
+
id_tipo_de_identificacion: zod_1.number(),
|
|
210
|
+
valor_identificacion: zod_1.string().optional().nullable(),
|
|
211
|
+
email: zod_1.string().optional().nullable(),
|
|
212
|
+
telefono: zod_1.string().optional().nullable(),
|
|
213
|
+
id_pais: zod_1.string().optional().nullable(),
|
|
214
|
+
provincia: zod_1.string().optional().nullable(),
|
|
215
|
+
localidad: zod_1.string().optional().nullable(),
|
|
216
|
+
domicilio: zod_1.string().optional().nullable(),
|
|
217
|
+
fecha_de_nacimiento: zod_1.string().optional().nullable(),
|
|
218
|
+
tag_idioma: zod_1.number().optional().nullable(),
|
|
219
|
+
estado_paciente: zod_1.number().optional().nullable(),
|
|
220
|
+
fecha_suspension: zod_1.string().optional().nullable(),
|
|
221
|
+
fecha_activacion: zod_1.string().optional().nullable(),
|
|
222
|
+
fecha_modificacion: zod_1.string().optional().nullable(),
|
|
223
|
+
fecha_baja: zod_1.string().optional().nullable(),
|
|
235
224
|
}),
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
.
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
})
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
patientName: zod_1.string(),
|
|
294
|
-
birthdate: zod_1.date(),
|
|
295
|
-
appointment: zod_1.string(),
|
|
296
|
-
clinic: zod_1.string(),
|
|
297
|
-
professionalName: zod_1.string(),
|
|
298
|
-
date: zod_1.date(),
|
|
299
|
-
specialty: zod_1.string(),
|
|
300
|
-
modality: zod_1.string(),
|
|
225
|
+
fecha_primer_llamado_profesional: zod_1.string(),
|
|
226
|
+
fecha_inicio: zod_1.string(),
|
|
227
|
+
fecha_primer_acceso_paciente: zod_1.string(),
|
|
228
|
+
fecha_ultimo_acceso_paciente: zod_1.string(),
|
|
229
|
+
fecha_corte_medico: zod_1.string(),
|
|
230
|
+
fecha_fin: zod_1.string(),
|
|
231
|
+
intentos_conexion: zod_1.number(),
|
|
232
|
+
tag_idioma: zod_1.string(),
|
|
233
|
+
id_turno: zod_1.number().nullable(),
|
|
234
|
+
fecha_turno_invitacion: zod_1.string().nullable(),
|
|
235
|
+
hora_turno_invitacion: zod_1.string().nullable(),
|
|
236
|
+
firma_profesional: zod_1.string().nullable(),
|
|
237
|
+
id_especialidad: zod_1.number(),
|
|
238
|
+
especialidad: zod_1.string(),
|
|
239
|
+
motivo: zod_1.string(),
|
|
240
|
+
enfermedad_actual: zod_1.string(),
|
|
241
|
+
conducta_terapeutica: zod_1.string(),
|
|
242
|
+
signos_alerta: zod_1.string(),
|
|
243
|
+
motivo_extendido_consulta: zod_1.string(),
|
|
244
|
+
presencial_requerida: zod_1.string(),
|
|
245
|
+
derivada: zod_1.string(),
|
|
246
|
+
derivada_id_especialidad: zod_1.string(),
|
|
247
|
+
derivada_presencial_obligatoria: zod_1.string(),
|
|
248
|
+
derivada_comentarios: zod_1.string().nullable(),
|
|
249
|
+
diagnostico: zod_1.array(zod_1.any()),
|
|
250
|
+
practicas: zod_1.array(zod_1.any()),
|
|
251
|
+
link_medicacion: zod_1.array(zod_1.any()),
|
|
252
|
+
medicacion: zod_1.array(zod_1.any()),
|
|
253
|
+
link_receta: zod_1.string().nullable(),
|
|
254
|
+
link_compra: zod_1.string().nullable(),
|
|
255
|
+
identificador_receta: zod_1.string().nullable(),
|
|
256
|
+
codigo_verificacion_receta: zod_1.string().nullable(),
|
|
257
|
+
financiador: zod_1.string(),
|
|
258
|
+
registro_custom: zod_1.array(zod_1.any()),
|
|
259
|
+
pdf_medicacion: zod_1.array(zod_1.any()),
|
|
260
|
+
pdf_laboratorios: zod_1.any(),
|
|
261
|
+
pdf_otras: zod_1.any(),
|
|
262
|
+
pdf_imagenes: zod_1.any(),
|
|
263
|
+
uploads: zod_1.array(zod_1.any()),
|
|
264
|
+
files_atencion: zod_1.array(zod_1.any()),
|
|
265
|
+
motivo_cancelacion: zod_1.string().nullable(),
|
|
266
|
+
detalle_cancelacion: zod_1.string().nullable(),
|
|
267
|
+
documentos: zod_1.string(),
|
|
268
|
+
snapshot_paciente: zod_1.any().nullable(),
|
|
269
|
+
snapshot_profesional: zod_1.any().nullable(),
|
|
270
|
+
id_consultorio: zod_1.number(),
|
|
271
|
+
token: zod_1.string(),
|
|
272
|
+
tipo_protocolo_seguimiento: zod_1.string().nullable(),
|
|
273
|
+
custom_1: zod_1.any().nullable(),
|
|
274
|
+
custom_2: zod_1.any().nullable(),
|
|
275
|
+
custom_3: zod_1.any().nullable(),
|
|
276
|
+
custom_4: zod_1.any().nullable(),
|
|
277
|
+
custom_5: zod_1.any().nullable(),
|
|
278
|
+
form_data: zod_1.object({}),
|
|
279
|
+
ubicacion: zod_1.string(),
|
|
280
|
+
link_full: zod_1.string(),
|
|
281
|
+
timestamp: zod_1.string(),
|
|
301
282
|
});
|
|
302
283
|
exports.doc24Schemas = {
|
|
284
|
+
identificationType,
|
|
303
285
|
sdkCredentials,
|
|
304
286
|
sdkParams: zod_1.object({ url: zod_1.string(), credentials: sdkCredentials }),
|
|
305
|
-
user,
|
|
306
|
-
patient,
|
|
287
|
+
user: basePersonData.extend({ phone: zod_1.string(), email: zod_1.string() }),
|
|
288
|
+
patient: basePersonData,
|
|
307
289
|
specialtyMode,
|
|
308
290
|
specialty,
|
|
309
291
|
scheduleAvailabilityFilter,
|
|
@@ -317,14 +299,32 @@ exports.doc24Schemas = {
|
|
|
317
299
|
date: zod_1.date().optional(),
|
|
318
300
|
startHour: zod_1.string().optional(),
|
|
319
301
|
finishHour: zod_1.string().optional(),
|
|
320
|
-
language: zod_1.string().optional(),
|
|
321
302
|
}),
|
|
322
303
|
scheduleParameters: zod_1.union([
|
|
323
304
|
appointmentScheduleParameters,
|
|
324
305
|
instantScheduleParameters,
|
|
325
306
|
]),
|
|
326
|
-
videoVisit
|
|
327
|
-
|
|
307
|
+
videoVisit: zod_1.object({
|
|
308
|
+
id: zod_1.number().nullable(),
|
|
309
|
+
creationDate: zod_1.date(),
|
|
310
|
+
patientId: zod_1.number(),
|
|
311
|
+
user: zod_1.object({
|
|
312
|
+
id: zod_1.number(),
|
|
313
|
+
email: zod_1.string().nullable(),
|
|
314
|
+
phone: zod_1.string().nullable(),
|
|
315
|
+
}),
|
|
316
|
+
vcToken: zod_1.string(),
|
|
317
|
+
appointment: zod_1.object({
|
|
318
|
+
id: zod_1.number(),
|
|
319
|
+
date: zod_1.date(),
|
|
320
|
+
}).optional(),
|
|
321
|
+
videoVisit: zod_1.object({
|
|
322
|
+
id: zod_1.number(),
|
|
323
|
+
status: zod_1.string(),
|
|
324
|
+
}).optional(),
|
|
325
|
+
paymentStatus: zod_1.string().optional(),
|
|
326
|
+
atentionId: zod_1.number().optional(),
|
|
327
|
+
}),
|
|
328
328
|
videoVisitDetails: zod_1.object({
|
|
329
329
|
id: zod_1.number(),
|
|
330
330
|
status: zod_1.string(),
|
|
@@ -364,6 +364,7 @@ exports.doc24Schemas = {
|
|
|
364
364
|
patientId: zod_1.number(),
|
|
365
365
|
vcToken: zod_1.string(),
|
|
366
366
|
}),
|
|
367
|
+
consultation,
|
|
367
368
|
professional: zod_1.object({
|
|
368
369
|
id: zod_1.number(),
|
|
369
370
|
firstName: zod_1.string(),
|
|
@@ -381,7 +382,6 @@ exports.doc24Schemas = {
|
|
|
381
382
|
link: zod_1.string(),
|
|
382
383
|
brief: zod_1.string(),
|
|
383
384
|
}),
|
|
384
|
-
consultation_value: zod_1.string().optional().nullish()
|
|
385
385
|
}),
|
|
386
386
|
appointment,
|
|
387
387
|
chatroomAvailabilityFilter,
|
|
@@ -392,7 +392,7 @@ exports.doc24Schemas = {
|
|
|
392
392
|
enrollmentParams,
|
|
393
393
|
diagnosticaPatientFilter: zod_1.object({
|
|
394
394
|
gender,
|
|
395
|
-
identificationType
|
|
395
|
+
identificationType,
|
|
396
396
|
identificationValue: zod_1.string(),
|
|
397
397
|
}),
|
|
398
398
|
diagnosticaHistoryAppointment,
|
|
@@ -400,21 +400,5 @@ exports.doc24Schemas = {
|
|
|
400
400
|
diagnosticaPatient,
|
|
401
401
|
diagnosticaDeepLinkResponse,
|
|
402
402
|
coverageInfo,
|
|
403
|
-
|
|
404
|
-
declareUserParams,
|
|
405
|
-
declareUserResponse,
|
|
406
|
-
declarePatientParams,
|
|
407
|
-
declarePatientResponse,
|
|
408
|
-
verificationCodeParams,
|
|
409
|
-
externalLoginParams,
|
|
410
|
-
externalLoginResponse,
|
|
411
|
-
preExternalEnrollmentParams,
|
|
412
|
-
externalEnrollmentParams,
|
|
413
|
-
sendExternalVerificationCodeParams,
|
|
414
|
-
verifyExternalVerificationCodeParams,
|
|
415
|
-
externalResetPasswordParams,
|
|
416
|
-
externalPatient,
|
|
417
|
-
externalAppointment,
|
|
418
|
-
emailOrPhone,
|
|
419
|
-
emailOrPhoneCode,
|
|
403
|
+
oldIdentificaiton,
|
|
420
404
|
};
|
package/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TypeOf } from 'zod';
|
|
2
2
|
import { doc24Schemas } from './schemas';
|
|
3
3
|
export declare namespace Doc24 {
|
|
4
|
+
type IdentificationType = TypeOf<typeof doc24Schemas.identificationType>;
|
|
4
5
|
type SdkCredentials = TypeOf<typeof doc24Schemas.sdkCredentials>;
|
|
5
6
|
type SdkParams = TypeOf<typeof doc24Schemas.sdkParams>;
|
|
6
7
|
type User = TypeOf<typeof doc24Schemas.user>;
|
|
@@ -12,7 +13,6 @@ export declare namespace Doc24 {
|
|
|
12
13
|
type ScheduleFilter = TypeOf<typeof doc24Schemas.scheduleFilter>;
|
|
13
14
|
type ScheduleParameters = TypeOf<typeof doc24Schemas.scheduleParameters>;
|
|
14
15
|
type VideoVisit = TypeOf<typeof doc24Schemas.videoVisit>;
|
|
15
|
-
type HistoricalVideoVisit = TypeOf<typeof doc24Schemas.historicalVideoVisit>;
|
|
16
16
|
type VideoVisitDetails = TypeOf<typeof doc24Schemas.videoVisitDetails>;
|
|
17
17
|
type ActiveVideoVisitData = TypeOf<typeof doc24Schemas.activeVideoVisitData>;
|
|
18
18
|
type SpecialtyMode = TypeOf<typeof doc24Schemas.specialtyMode>;
|
|
@@ -25,49 +25,28 @@ export declare namespace Doc24 {
|
|
|
25
25
|
type ChatPost = TypeOf<typeof doc24Schemas.chatPost>;
|
|
26
26
|
type EnrollmentParams = TypeOf<typeof doc24Schemas.enrollmentParams>;
|
|
27
27
|
type CoverageInfo = TypeOf<typeof doc24Schemas.coverageInfo>;
|
|
28
|
+
type Consultation = TypeOf<typeof doc24Schemas.consultation>;
|
|
28
29
|
type DiagnosticaPatientFilter = TypeOf<typeof doc24Schemas.diagnosticaPatientFilter>;
|
|
29
30
|
type DiagnosticaUser = TypeOf<typeof doc24Schemas.diagnosticaUser>;
|
|
30
31
|
type DiagnosticaPatient = TypeOf<typeof doc24Schemas.diagnosticaPatient>;
|
|
31
32
|
type DiagnosticaHistoryAppointment = TypeOf<typeof doc24Schemas.diagnosticaHistoryAppointment>;
|
|
32
33
|
type DiagnosticaDeepLinkResponse = TypeOf<typeof doc24Schemas.diagnosticaDeepLinkResponse>;
|
|
33
|
-
type
|
|
34
|
-
type DeclareUserParams = TypeOf<typeof doc24Schemas.declareUserParams>;
|
|
35
|
-
type DeclareUserResponse = TypeOf<typeof doc24Schemas.declareUserResponse>;
|
|
36
|
-
type DeclarePatientParams = TypeOf<typeof doc24Schemas.declarePatientParams>;
|
|
37
|
-
type DeclarePatientResponse = TypeOf<typeof doc24Schemas.declarePatientResponse>;
|
|
38
|
-
type VerificationCodeParams = TypeOf<typeof doc24Schemas.verificationCodeParams>;
|
|
39
|
-
type ExternalLoginParams = TypeOf<typeof doc24Schemas.externalLoginParams>;
|
|
40
|
-
type ExternalLoginResponse = TypeOf<typeof doc24Schemas.externalLoginResponse>;
|
|
41
|
-
type PreExternalEnrollmentParams = TypeOf<typeof doc24Schemas.preExternalEnrollmentParams>;
|
|
42
|
-
type ExternalEnrollmentParams = TypeOf<typeof doc24Schemas.externalEnrollmentParams>;
|
|
43
|
-
type SendExternalVerificationCodeParams = TypeOf<typeof doc24Schemas.sendExternalVerificationCodeParams>;
|
|
44
|
-
type VerifyExternalVerificationCodeParams = TypeOf<typeof doc24Schemas.verifyExternalVerificationCodeParams>;
|
|
45
|
-
type ExternalResetPasswordParams = TypeOf<typeof doc24Schemas.externalResetPasswordParams>;
|
|
46
|
-
type ExternalPatient = TypeOf<typeof doc24Schemas.externalPatient>;
|
|
47
|
-
type ExternalAppointment = TypeOf<typeof doc24Schemas.externalAppointment>;
|
|
34
|
+
type OldIdentificaiton = TypeOf<typeof doc24Schemas.oldIdentificaiton>;
|
|
48
35
|
type BaseSdk = {
|
|
49
|
-
declareUser: (
|
|
50
|
-
getUserId: (user: User) => Promise<number>;
|
|
36
|
+
declareUser: (user: User) => Promise<number>;
|
|
51
37
|
getUserInstance: (user: User | number) => Promise<UserSdk>;
|
|
52
38
|
getProfessional: (professionalId: number) => Promise<Professional>;
|
|
53
39
|
getAvailableScheduleClinics: () => Promise<AvailableScheduleClinics>;
|
|
54
40
|
enroll: (params: EnrollmentParams) => Promise<void>;
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
getConverageInfo: (identificationValue: string) => Promise<CoverageInfo>;
|
|
42
|
+
getConsultation: (consultationId: number) => Promise<Consultation | null>;
|
|
57
43
|
getDiagnosticaHistory: (patient: DiagnosticaPatientFilter, from: Date, to: Date) => Promise<DiagnosticaHistoryAppointment[]>;
|
|
58
44
|
getDiagnosticaDeepLink: (kiosk: string, user: DiagnosticaUser, patient: DiagnosticaPatient) => Promise<DiagnosticaDeepLinkResponse>;
|
|
59
45
|
getDiagnosticaAccess: (kiosk: string, user: DiagnosticaUser, patient: DiagnosticaPatient) => Promise<void>;
|
|
60
|
-
externalLogin: (params: ExternalLoginParams) => Promise<ExternalLoginResponse>;
|
|
61
|
-
preExternalEnrollment: (params: PreExternalEnrollmentParams) => Promise<void>;
|
|
62
|
-
externalEnrollment: (params: ExternalEnrollmentParams) => Promise<ExternalLoginResponse>;
|
|
63
|
-
sendExternalVerificationCode: (params: SendExternalVerificationCodeParams) => Promise<void>;
|
|
64
|
-
verifyExternalVerificationCode: (params: VerifyExternalVerificationCodeParams) => Promise<any>;
|
|
65
|
-
externalResetPassword: (params: ExternalResetPasswordParams) => Promise<any>;
|
|
66
46
|
};
|
|
67
47
|
type UserSdk = {
|
|
68
|
-
declarePatient: (
|
|
69
|
-
|
|
70
|
-
deletePatient: (patientId: number) => Promise<void>;
|
|
48
|
+
declarePatient: (patient: Patient) => Promise<number>;
|
|
49
|
+
updatePatient: (oldIdentification: OldIdentificaiton, patient: Patient) => Promise<number>;
|
|
71
50
|
getSpecialties: (mode: SpecialtyMode, language: string) => Promise<Specialty[]>;
|
|
72
51
|
getScheduleDates: (patientId: number, filter?: ScheduleAvailabilityFilter) => Promise<Date[]>;
|
|
73
52
|
getSchedule: (patientId: number, specialtyId: number, filter?: ScheduleFilter) => Promise<AvailableAppointment[]>;
|
|
@@ -78,7 +57,7 @@ export declare namespace Doc24 {
|
|
|
78
57
|
getVideoVisit: (vcToken: string, patientId: number) => Promise<VideoVisit>;
|
|
79
58
|
getVideoVisitDetails: (vcId: number) => Promise<VideoVisitDetails>;
|
|
80
59
|
getVideoVisitLink: (vcToken: string, patientId: number) => Promise<string | null>;
|
|
81
|
-
getPatientVideoVisitHistory: (patientId: number) => Promise<
|
|
60
|
+
getPatientVideoVisitHistory: (patientId: number) => Promise<VideoVisit[]>;
|
|
82
61
|
getActiveVideoVisits: () => Promise<ActiveVideoVisitData[]>;
|
|
83
62
|
getAvailableChatrooms: (patientId: number, specialtyId: number, filter: ChatroomAvailabilityFilter) => Promise<AvailableChatroom[]>;
|
|
84
63
|
createNewChat: (chatParameters: ChatParameters) => Promise<number>;
|
|
@@ -86,10 +65,6 @@ export declare namespace Doc24 {
|
|
|
86
65
|
getChatPosts: (chatId: number) => Promise<ChatPost[]>;
|
|
87
66
|
cancelChat: (chatId: number) => Promise<void>;
|
|
88
67
|
sendChatMessage: (chatId: number, message: string) => Promise<number>;
|
|
89
|
-
getExternalStudiesHistoryLink: (patient: ExternalPatient) => Promise<string | null>;
|
|
90
|
-
getExternalAppointmentsLink: (identificationValue: string, birthdate: Date) => Promise<string | null>;
|
|
91
|
-
getExternalAppointments: () => Promise<ExternalAppointment[]>;
|
|
92
|
-
cancelExternalAppointment: (appointmentId: ExternalAppointment) => Promise<void>;
|
|
93
68
|
userId: number;
|
|
94
69
|
};
|
|
95
70
|
namespace Webhook {
|
|
@@ -113,7 +88,6 @@ export declare namespace Doc24 {
|
|
|
113
88
|
type AppointmentStatusChangeEvent = {
|
|
114
89
|
id: number;
|
|
115
90
|
status: StatusChangeEventStatus;
|
|
116
|
-
vcToken?: string;
|
|
117
91
|
changeDate: Date;
|
|
118
92
|
};
|
|
119
93
|
type ChatUpdateEvent = {
|
package/lib/userSdk/chat.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export declare const getChatMethods: (makeRequest: RequestMaker) => {
|
|
|
24
24
|
getPatientChats: (patientId: number) => Promise<{
|
|
25
25
|
id: number;
|
|
26
26
|
patient: {
|
|
27
|
+
id: number;
|
|
27
28
|
firstName: string;
|
|
28
29
|
lastName: string;
|
|
29
|
-
id: number;
|
|
30
30
|
};
|
|
31
31
|
professional: {
|
|
32
32
|
id: number;
|
|
@@ -34,11 +34,11 @@ export declare const getChatMethods: (makeRequest: RequestMaker) => {
|
|
|
34
34
|
logoUrl: string;
|
|
35
35
|
};
|
|
36
36
|
status: string;
|
|
37
|
-
paymentStatus: string;
|
|
38
37
|
specialty: {
|
|
39
38
|
id: number;
|
|
40
39
|
description: string;
|
|
41
40
|
};
|
|
41
|
+
paymentStatus: string;
|
|
42
42
|
chatRoomId: number;
|
|
43
43
|
startDate: Date;
|
|
44
44
|
lastEventDate: Date;
|
package/lib/userSdk/index.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.userSdk = void 0;
|
|
4
4
|
const request_1 = require("../request");
|
|
5
5
|
const chat_1 = require("./chat");
|
|
6
|
-
const external_1 = require("./external");
|
|
7
6
|
const patients_1 = require("./patients");
|
|
8
7
|
const schedule_1 = require("./schedule");
|
|
9
8
|
const specialties_1 = require("./specialties");
|
|
@@ -15,14 +14,12 @@ const userSdk = async (url, credentials, userId) => {
|
|
|
15
14
|
const scheduleMethods = schedule_1.getScheduleMethods(makeRequest);
|
|
16
15
|
const videoVisitMethods = videoVisit_1.getVideoVisitMethods(makeRequest);
|
|
17
16
|
const chatMethods = chat_1.getChatMethods(makeRequest);
|
|
18
|
-
const externalMethods = external_1.getExternalMethods(makeRequest);
|
|
19
17
|
const sdk = {
|
|
20
18
|
...patientMethods,
|
|
21
19
|
...specialtyMethods,
|
|
22
20
|
...scheduleMethods,
|
|
23
21
|
...videoVisitMethods,
|
|
24
22
|
...chatMethods,
|
|
25
|
-
...externalMethods,
|
|
26
23
|
userId,
|
|
27
24
|
};
|
|
28
25
|
return sdk;
|
|
@@ -1,38 +1,24 @@
|
|
|
1
1
|
import { RequestMaker } from '../request';
|
|
2
2
|
export declare const getPatientMethods: (makeRequest: RequestMaker) => {
|
|
3
|
-
declarePatient: (
|
|
4
|
-
patient: {
|
|
5
|
-
identificationType?: number | undefined;
|
|
6
|
-
identificationValue?: string | undefined;
|
|
7
|
-
gender?: "m" | "f" | "o" | undefined;
|
|
8
|
-
firstName: string;
|
|
9
|
-
lastName: string;
|
|
10
|
-
countryId: string;
|
|
11
|
-
birthdate: Date;
|
|
12
|
-
};
|
|
13
|
-
} & {
|
|
14
|
-
code?: string | undefined;
|
|
15
|
-
channel?: "1" | "2" | undefined;
|
|
16
|
-
}) => Promise<{
|
|
17
|
-
askCode: true;
|
|
18
|
-
userInfo: {
|
|
19
|
-
firstName: string;
|
|
20
|
-
lastName: string;
|
|
21
|
-
phone: string;
|
|
22
|
-
email: string;
|
|
23
|
-
};
|
|
24
|
-
} | {
|
|
25
|
-
patientId: number | null;
|
|
26
|
-
askCode: false;
|
|
27
|
-
}>;
|
|
28
|
-
getPatientId: (patient: {
|
|
29
|
-
identificationType?: number | undefined;
|
|
30
|
-
identificationValue?: string | undefined;
|
|
31
|
-
gender?: "m" | "f" | "o" | undefined;
|
|
3
|
+
declarePatient: (patient: {
|
|
32
4
|
firstName: string;
|
|
33
5
|
lastName: string;
|
|
6
|
+
identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg";
|
|
7
|
+
identificationValue: string;
|
|
8
|
+
gender: "m" | "f";
|
|
9
|
+
countryId: string;
|
|
10
|
+
birthdate: Date;
|
|
11
|
+
}) => Promise<number>;
|
|
12
|
+
updatePatient: (oldIdentification: {
|
|
13
|
+
identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg";
|
|
14
|
+
identificationValue: string;
|
|
15
|
+
}, patient: {
|
|
16
|
+
firstName: string;
|
|
17
|
+
lastName: string;
|
|
18
|
+
identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg";
|
|
19
|
+
identificationValue: string;
|
|
20
|
+
gender: "m" | "f";
|
|
34
21
|
countryId: string;
|
|
35
22
|
birthdate: Date;
|
|
36
23
|
}) => Promise<number>;
|
|
37
|
-
deletePatient: (patientId: number) => Promise<void>;
|
|
38
24
|
};
|
package/lib/userSdk/patients.js
CHANGED
|
@@ -5,63 +5,42 @@ const date_fns_1 = require("date-fns");
|
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const validation_1 = require("../request/validation");
|
|
7
7
|
const schemas_1 = require("../schemas");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
8
9
|
const getPatientMethods = (makeRequest) => {
|
|
9
|
-
const declarePatient = async (
|
|
10
|
-
var _a;
|
|
11
|
-
const path = '/patient';
|
|
10
|
+
const declarePatient = async (patient) => {
|
|
12
11
|
const mappedPatient = {
|
|
13
12
|
lastname: patient.lastName,
|
|
14
13
|
firstname: patient.firstName,
|
|
15
|
-
identification_type: patient.identificationType,
|
|
14
|
+
identification_type: utils_1.getIndetificationTypeId(patient.identificationType),
|
|
16
15
|
identification_value: patient.identificationValue,
|
|
17
16
|
birthdate: date_fns_1.format(patient.birthdate, 'yyyy-MM-dd'),
|
|
18
|
-
gender:
|
|
17
|
+
gender: patient.gender.toUpperCase(),
|
|
19
18
|
country_id: patient.countryId,
|
|
20
19
|
};
|
|
21
|
-
const
|
|
22
|
-
const response = await makeRequest('POST', path, {
|
|
20
|
+
const response = await makeRequest('POST', '/patient', {
|
|
23
21
|
user_data: mappedPatient,
|
|
24
|
-
channel: parsedChannel,
|
|
25
|
-
code,
|
|
26
22
|
});
|
|
27
|
-
|
|
28
|
-
if (data.ask_code)
|
|
29
|
-
return {
|
|
30
|
-
userInfo: {
|
|
31
|
-
firstName: data.user_info.firstname,
|
|
32
|
-
lastName: data.user_info.lastname,
|
|
33
|
-
phone: data.user_info.phone,
|
|
34
|
-
email: data.user_info.email,
|
|
35
|
-
},
|
|
36
|
-
askCode: true,
|
|
37
|
-
};
|
|
38
|
-
return { askCode: false, patientId: data.patient_id };
|
|
23
|
+
return response.data.patient_id;
|
|
39
24
|
};
|
|
40
|
-
const
|
|
41
|
-
var _a;
|
|
42
|
-
const path = '/search-patient';
|
|
25
|
+
const updatePatient = async (oldIdentificaiton, patient) => {
|
|
43
26
|
const mappedPatient = {
|
|
44
27
|
lastname: patient.lastName,
|
|
45
28
|
firstname: patient.firstName,
|
|
46
|
-
identification_type: patient.identificationType,
|
|
29
|
+
identification_type: utils_1.getIndetificationTypeId(patient.identificationType),
|
|
47
30
|
identification_value: patient.identificationValue,
|
|
48
31
|
birthdate: date_fns_1.format(patient.birthdate, 'yyyy-MM-dd'),
|
|
49
|
-
gender:
|
|
50
|
-
country_id: patient.countryId,
|
|
32
|
+
gender: patient.gender.toUpperCase(),
|
|
51
33
|
};
|
|
52
|
-
const response = await makeRequest('POST',
|
|
34
|
+
const response = await makeRequest('POST', '/update-patient', {
|
|
35
|
+
old_identification_type: utils_1.getIndetificationTypeId(oldIdentificaiton.identificationType),
|
|
36
|
+
old_identification_value: oldIdentificaiton.identificationValue,
|
|
53
37
|
user_data: mappedPatient,
|
|
54
38
|
});
|
|
55
39
|
return response.data.patient_id;
|
|
56
40
|
};
|
|
57
|
-
const deletePatient = async (patientId) => {
|
|
58
|
-
const path = `/patient/${patientId}`;
|
|
59
|
-
await makeRequest('DELETE', path);
|
|
60
|
-
};
|
|
61
41
|
return {
|
|
62
|
-
declarePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.
|
|
63
|
-
|
|
64
|
-
deletePatient: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.void(), deletePatient),
|
|
42
|
+
declarePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.patient]), zod_1.number(), declarePatient),
|
|
43
|
+
updatePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.oldIdentificaiton, schemas_1.doc24Schemas.patient]), zod_1.number(), updatePatient),
|
|
65
44
|
};
|
|
66
45
|
};
|
|
67
46
|
exports.getPatientMethods = getPatientMethods;
|