@integraciones_doc24/sdk 1.16.32 → 1.16.33
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/userSdk/schedule.js
CHANGED
|
@@ -17,7 +17,10 @@ const getScheduleMethods = (makeRequest) => {
|
|
|
17
17
|
};
|
|
18
18
|
const path = `/schedule/dates/${patientId}/${JSON.stringify(mappedFilter)}`;
|
|
19
19
|
const response = await makeRequest('GET', path);
|
|
20
|
-
|
|
20
|
+
// Doc24 devuelve fecha/hora en el user_time_zone enviado (o en -03 si no
|
|
21
|
+
// se envía). `time_zone` de la respuesta es el de la marca, no el de la
|
|
22
|
+
// hora: no usarlo para parsear.
|
|
23
|
+
return response.data.available_dates.map((o) => utils_1.parseDate(o.date, filter.userTimeZone));
|
|
21
24
|
};
|
|
22
25
|
const getSchedule = async (patientId, specialtyId, filter = {}) => {
|
|
23
26
|
var _a;
|
|
@@ -37,7 +40,7 @@ const getScheduleMethods = (makeRequest) => {
|
|
|
37
40
|
const response = await makeRequest('GET', path);
|
|
38
41
|
return response.data.available_appointments.map((a) => ({
|
|
39
42
|
id: a.id,
|
|
40
|
-
date: utils_1.parseDateTime(`${a.date} ${a.hour}`,
|
|
43
|
+
date: utils_1.parseDateTime(`${a.date} ${a.hour}`, filter.userTimeZone),
|
|
41
44
|
clinicId: a.clinic,
|
|
42
45
|
professional: {
|
|
43
46
|
id: a.professional_id,
|
|
@@ -68,7 +71,8 @@ const getScheduleMethods = (makeRequest) => {
|
|
|
68
71
|
return {
|
|
69
72
|
id: response.data.id,
|
|
70
73
|
professionalId: response.data.professional_id,
|
|
71
|
-
|
|
74
|
+
// Sin user_time_zone en el request, la hora viene en -03.
|
|
75
|
+
date: utils_1.parseDateTime(`${response.data.date} ${response.data.hour}`),
|
|
72
76
|
};
|
|
73
77
|
};
|
|
74
78
|
const getAppointmentByVcToken = async (vcToken) => {
|
|
@@ -77,7 +81,8 @@ const getScheduleMethods = (makeRequest) => {
|
|
|
77
81
|
return {
|
|
78
82
|
id: response.data.id,
|
|
79
83
|
professionalId: response.data.professional_id,
|
|
80
|
-
|
|
84
|
+
// Sin user_time_zone en el request, la hora viene en -03.
|
|
85
|
+
date: utils_1.parseDateTime(`${response.data.date} ${response.data.hour}`),
|
|
81
86
|
};
|
|
82
87
|
};
|
|
83
88
|
return {
|
|
@@ -71,7 +71,8 @@ const getVideoVisitMethods = (makeRequest) => {
|
|
|
71
71
|
appointment: response.data.appointment_id
|
|
72
72
|
? {
|
|
73
73
|
id: response.data.appointment_id,
|
|
74
|
-
|
|
74
|
+
// `time_zone` es el de la marca; la hora viene en -03.
|
|
75
|
+
date: utils_1.parseDateTime(`${response.data.appointment_date} ${response.data.appointment_time}`),
|
|
75
76
|
}
|
|
76
77
|
: null,
|
|
77
78
|
report: {
|
|
@@ -229,7 +230,8 @@ const mapVideoVisit = (raw) => {
|
|
|
229
230
|
appointment: raw.appointment_id
|
|
230
231
|
? {
|
|
231
232
|
id: raw.appointment_id,
|
|
232
|
-
|
|
233
|
+
// `time_zone` es el de la marca; la hora viene en -03.
|
|
234
|
+
date: utils_1.parseDateTime(`${raw.appointment_date} ${raw.appointment_time}`),
|
|
233
235
|
}
|
|
234
236
|
: undefined,
|
|
235
237
|
videoVisit: raw.video_visit_id
|
package/package.json
CHANGED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Doc24 } from '../types';
|
|
2
|
-
export declare const getConsultationMethods: (url: string, credentials: Doc24.SdkCredentials) => {
|
|
3
|
-
getConsultation: (consultationId: number) => Promise<{
|
|
4
|
-
pdf_laboratorios?: any;
|
|
5
|
-
pdf_otras?: any;
|
|
6
|
-
pdf_imagenes?: any;
|
|
7
|
-
snapshot_paciente?: any;
|
|
8
|
-
snapshot_profesional?: any;
|
|
9
|
-
custom_1?: any;
|
|
10
|
-
custom_2?: any;
|
|
11
|
-
custom_3?: any;
|
|
12
|
-
custom_4?: any;
|
|
13
|
-
custom_5?: any;
|
|
14
|
-
tag_idioma: string;
|
|
15
|
-
id_consulta: number;
|
|
16
|
-
tipo_consulta: string;
|
|
17
|
-
estado: string;
|
|
18
|
-
tipo_usuario_cancelacion: string | null;
|
|
19
|
-
fecha_cancelacion: string | null;
|
|
20
|
-
estado_pago: string;
|
|
21
|
-
referencia_mercadopago: string | null;
|
|
22
|
-
id_atencion: number;
|
|
23
|
-
id_profesional: number;
|
|
24
|
-
profesional: string;
|
|
25
|
-
modalidad_paciente_turno: string | null;
|
|
26
|
-
provincia_consultorio: string | null;
|
|
27
|
-
localidad_consultorio: string | null;
|
|
28
|
-
domicilio_consultorio: string | null;
|
|
29
|
-
marketplace: string;
|
|
30
|
-
profesional_matriculas: any[];
|
|
31
|
-
info_paciente: {
|
|
32
|
-
email?: string | null | undefined;
|
|
33
|
-
apellido?: string | null | undefined;
|
|
34
|
-
nombre?: string | null | undefined;
|
|
35
|
-
genero?: string | null | undefined;
|
|
36
|
-
valor_identificacion?: string | null | undefined;
|
|
37
|
-
telefono?: string | null | undefined;
|
|
38
|
-
id_pais?: string | null | undefined;
|
|
39
|
-
provincia?: string | null | undefined;
|
|
40
|
-
localidad?: string | null | undefined;
|
|
41
|
-
domicilio?: string | null | undefined;
|
|
42
|
-
fecha_de_nacimiento?: string | null | undefined;
|
|
43
|
-
tag_idioma?: number | null | undefined;
|
|
44
|
-
estado_paciente?: number | null | undefined;
|
|
45
|
-
fecha_suspension?: string | null | undefined;
|
|
46
|
-
fecha_activacion?: string | null | undefined;
|
|
47
|
-
fecha_modificacion?: string | null | undefined;
|
|
48
|
-
fecha_baja?: string | null | undefined;
|
|
49
|
-
id_paciente: number;
|
|
50
|
-
id_tipo_de_identificacion: number;
|
|
51
|
-
};
|
|
52
|
-
fecha_primer_llamado_profesional: string;
|
|
53
|
-
fecha_inicio: string;
|
|
54
|
-
fecha_primer_acceso_paciente: string;
|
|
55
|
-
fecha_ultimo_acceso_paciente: string;
|
|
56
|
-
fecha_corte_medico: string;
|
|
57
|
-
fecha_fin: string;
|
|
58
|
-
intentos_conexion: number;
|
|
59
|
-
id_turno: number | null;
|
|
60
|
-
fecha_turno_invitacion: string | null;
|
|
61
|
-
hora_turno_invitacion: string | null;
|
|
62
|
-
firma_profesional: string | null;
|
|
63
|
-
id_especialidad: number;
|
|
64
|
-
especialidad: string;
|
|
65
|
-
motivo: string;
|
|
66
|
-
enfermedad_actual: string;
|
|
67
|
-
conducta_terapeutica: string;
|
|
68
|
-
signos_alerta: string;
|
|
69
|
-
motivo_extendido_consulta: string;
|
|
70
|
-
presencial_requerida: string;
|
|
71
|
-
derivada: string;
|
|
72
|
-
derivada_id_especialidad: string | number;
|
|
73
|
-
derivada_presencial_obligatoria: string;
|
|
74
|
-
derivada_comentarios: string | null;
|
|
75
|
-
diagnostico: any[];
|
|
76
|
-
practicas: any[];
|
|
77
|
-
link_medicacion: any[];
|
|
78
|
-
medicacion: any[];
|
|
79
|
-
link_receta: string | null;
|
|
80
|
-
link_compra: string | null;
|
|
81
|
-
identificador_receta: string | null;
|
|
82
|
-
codigo_verificacion_receta: string | null;
|
|
83
|
-
financiador: string;
|
|
84
|
-
registro_custom: any[];
|
|
85
|
-
pdf_medicacion: any[];
|
|
86
|
-
uploads: any[];
|
|
87
|
-
files_atencion: any[];
|
|
88
|
-
motivo_cancelacion: string | null;
|
|
89
|
-
detalle_cancelacion: string | null;
|
|
90
|
-
documentos: string;
|
|
91
|
-
id_consultorio: number;
|
|
92
|
-
token: string;
|
|
93
|
-
tipo_protocolo_seguimiento: string | null;
|
|
94
|
-
form_data: {};
|
|
95
|
-
ubicacion: string;
|
|
96
|
-
link_full: string;
|
|
97
|
-
timestamp: string;
|
|
98
|
-
} | null>;
|
|
99
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getConsultationMethods = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const schemas_1 = require("../schemas");
|
|
6
|
-
const request_1 = require("../request");
|
|
7
|
-
const validation_1 = require("../request/validation");
|
|
8
|
-
const getConsultationMethods = (url, credentials) => {
|
|
9
|
-
const getConsultation = validation_1.validateFunction(zod_1.tuple([zod_1.number()]), schemas_1.doc24Schemas.consultation, async (consultationId) => {
|
|
10
|
-
// Replace /sdk with /api/v2 in the base URL
|
|
11
|
-
const apiUrl = url.replace('/sdk', '/api/v2');
|
|
12
|
-
const apiRequest = await request_1.getRequestFactory(apiUrl, credentials);
|
|
13
|
-
const path = `/consulta/${consultationId}`;
|
|
14
|
-
const response = await apiRequest('GET', path);
|
|
15
|
-
// Remove pdf_atencion and pdf_certificado from the response
|
|
16
|
-
const { pdf_atencion, pdf_certificado, ...attention } = response === null || response === void 0 ? void 0 : response.data;
|
|
17
|
-
return attention;
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
getConsultation,
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
exports.getConsultationMethods = getConsultationMethods;
|