@integraciones_doc24/sdk 0.42.3 → 0.42.6

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/README.md CHANGED
@@ -112,6 +112,10 @@ Most of the methods need a user specified, so `getUserInstance` returns an insta
112
112
  ```ts
113
113
  type UserSdk = {
114
114
  declarePatient: (patient: Patient) => Promise<number>;
115
+ updatePatient: (
116
+ oldIdentification: OldIdentification,
117
+ patient: PatientUpdate,
118
+ ) => Promise<number>;
115
119
  getSpecialties: (
116
120
  mode: SpecialtyMode,
117
121
  language: string,
@@ -134,3 +138,7 @@ type UserSdk = {
134
138
  userId: number;
135
139
  };
136
140
  ```
141
+
142
+ `Patient` contains identity and demographic data. `PatientUpdate` additionally
143
+ requires a valid `email` and a string `phone`; those contact fields are sent only
144
+ to `/update-patient`, not to `/patient`.
@@ -11,22 +11,22 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
11
11
  deepLink: string;
12
12
  }[]>;
13
13
  getDiagnosticaDeepLink: (kiosk: string, user: {
14
- language: string;
15
14
  firstName: string;
16
15
  lastName: string;
17
- birthday: Date;
18
16
  identificationType: "dni";
19
17
  identificationValue: string;
20
18
  gender: "m" | "f";
21
- phone: string;
22
19
  email: string;
20
+ phone: string;
21
+ language: string;
22
+ birthday: Date;
23
23
  }, patient: {
24
24
  firstName: string;
25
25
  lastName: string;
26
- birthday: Date;
27
26
  identificationType: "dni";
28
27
  identificationValue: string;
29
28
  gender: "m" | "f";
29
+ birthday: Date;
30
30
  }) => Promise<{
31
31
  forwardingRequired: true;
32
32
  deepLink: string;
@@ -34,21 +34,21 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
34
34
  forwardingRequired: false;
35
35
  }>;
36
36
  getDiagnosticaAccess: (kiosk: string, user: {
37
- language: string;
38
37
  firstName: string;
39
38
  lastName: string;
40
- birthday: Date;
41
39
  identificationType: "dni";
42
40
  identificationValue: string;
43
41
  gender: "m" | "f";
44
- phone: string;
45
42
  email: string;
43
+ phone: string;
44
+ language: string;
45
+ birthday: Date;
46
46
  }, patient: {
47
47
  firstName: string;
48
48
  lastName: string;
49
- birthday: Date;
50
49
  identificationType: "dni";
51
50
  identificationValue: string;
52
51
  gender: "m" | "f";
52
+ birthday: Date;
53
53
  }) => Promise<void>;
54
54
  };
@@ -6,20 +6,20 @@ export declare const getUserMethods: (makeRequest: RequestMaker, url: string, cr
6
6
  lastName: string;
7
7
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
8
8
  identificationValue: string;
9
- gender: "m" | "f";
10
- phone: string;
11
- email: string;
12
9
  countryId: string;
13
10
  birthdate: Date;
11
+ gender: "m" | "f";
12
+ email: string;
13
+ phone: string;
14
14
  }) => Promise<any>;
15
15
  getUserInstance: (...params: any) => Promise<any>;
16
16
  enroll: (...params: any) => Promise<void>;
17
17
  getConverageInfo: (identificationValue: string) => Promise<{
18
18
  firstName: string | null;
19
19
  lastName: string | null;
20
+ birthdate: Date;
20
21
  gender: "m" | "f";
21
22
  email: string | null;
22
- birthdate: Date;
23
23
  identificationNumber: string;
24
24
  plan: string | null;
25
25
  financerId: number | null;
package/lib/index.d.ts CHANGED
@@ -10,32 +10,32 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
10
10
  lastName: string;
11
11
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
12
12
  identificationValue: string;
13
- gender: "m" | "f";
14
- phone: string;
15
- email: string;
16
13
  countryId: string;
17
14
  birthdate: Date;
15
+ gender: "m" | "f";
16
+ email: string;
17
+ phone: string;
18
18
  }) => Promise<number>;
19
19
  getUserInstance: (user: number | {
20
20
  firstName: string;
21
21
  lastName: string;
22
22
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
23
23
  identificationValue: string;
24
- gender: "m" | "f";
25
- phone: string;
26
- email: string;
27
24
  countryId: string;
28
25
  birthdate: Date;
26
+ gender: "m" | "f";
27
+ email: string;
28
+ phone: string;
29
29
  }) => Promise<Doc24.UserSdk>;
30
30
  getProfessional: (professionalId: number) => Promise<{
31
- id: number;
32
- logoUrl: string;
33
31
  firstName: string;
34
32
  lastName: string;
33
+ birthdate: Date;
35
34
  gender: "m" | "f";
36
- phone: string | null;
37
35
  email: string;
38
- birthdate: Date;
36
+ phone: string | null;
37
+ id: number;
38
+ logoUrl: string;
39
39
  specialties: {
40
40
  id: number;
41
41
  description: string;
@@ -73,9 +73,9 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
73
73
  enroll: (params: {
74
74
  firstName: string;
75
75
  lastName: string;
76
+ birthdate: Date;
76
77
  gender: "m" | "f";
77
78
  email: string;
78
- birthdate: Date;
79
79
  startDate: Date;
80
80
  identificationNumber: string;
81
81
  plan: string;
@@ -83,9 +83,9 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
83
83
  getConverageInfo: (identificationValue: string) => Promise<{
84
84
  firstName: string | null;
85
85
  lastName: string | null;
86
+ birthdate: Date;
86
87
  gender: "m" | "f";
87
88
  email: string | null;
88
- birthdate: Date;
89
89
  identificationNumber: string;
90
90
  plan: string | null;
91
91
  financerId: number | null;
@@ -211,22 +211,22 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
211
211
  deepLink: string;
212
212
  }[]>;
213
213
  getDiagnosticaDeepLink: (kiosk: string, user: {
214
- language: string;
215
214
  firstName: string;
216
215
  lastName: string;
217
- birthday: Date;
218
216
  identificationType: "dni";
219
217
  identificationValue: string;
220
218
  gender: "m" | "f";
221
- phone: string;
222
219
  email: string;
220
+ phone: string;
221
+ language: string;
222
+ birthday: Date;
223
223
  }, patient: {
224
224
  firstName: string;
225
225
  lastName: string;
226
- birthday: Date;
227
226
  identificationType: "dni";
228
227
  identificationValue: string;
229
228
  gender: "m" | "f";
229
+ birthday: Date;
230
230
  }) => Promise<{
231
231
  forwardingRequired: true;
232
232
  deepLink: string;
@@ -234,22 +234,22 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
234
234
  forwardingRequired: false;
235
235
  }>;
236
236
  getDiagnosticaAccess: (kiosk: string, user: {
237
- language: string;
238
237
  firstName: string;
239
238
  lastName: string;
240
- birthday: Date;
241
239
  identificationType: "dni";
242
240
  identificationValue: string;
243
241
  gender: "m" | "f";
244
- phone: string;
245
242
  email: string;
243
+ phone: string;
244
+ language: string;
245
+ birthday: Date;
246
246
  }, patient: {
247
247
  firstName: string;
248
248
  lastName: string;
249
- birthday: Date;
250
249
  identificationType: "dni";
251
250
  identificationValue: string;
252
251
  gender: "m" | "f";
252
+ birthday: Date;
253
253
  }) => Promise<void>;
254
254
  }>;
255
255
  export type { Doc24 } from './types';
package/lib/schemas.d.ts CHANGED
@@ -51,21 +51,21 @@ export declare const doc24Schemas: {
51
51
  lastName: string;
52
52
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
53
53
  identificationValue: string;
54
- gender: "m" | "f";
55
- phone: string;
56
- email: string;
57
54
  countryId: string;
58
55
  birthdate: Date;
56
+ gender: "m" | "f";
57
+ email: string;
58
+ phone: string;
59
59
  }, {
60
60
  firstName: string;
61
61
  lastName: string;
62
62
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
63
63
  identificationValue: string;
64
- gender: "m" | "f";
65
- phone: string;
66
- email: string;
67
64
  countryId: string;
68
65
  birthdate: Date;
66
+ gender: "m" | "f";
67
+ email: string;
68
+ phone: string;
69
69
  }>;
70
70
  patient: import("zod").ZodObject<{
71
71
  firstName: import("zod").ZodString;
@@ -80,17 +80,49 @@ export declare const doc24Schemas: {
80
80
  lastName: string;
81
81
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
82
82
  identificationValue: string;
83
+ countryId: string;
84
+ birthdate: Date;
83
85
  gender: "m" | "f";
86
+ }, {
87
+ firstName: string;
88
+ lastName: string;
89
+ identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
90
+ identificationValue: string;
84
91
  countryId: string;
85
92
  birthdate: Date;
93
+ gender: "m" | "f";
94
+ }>;
95
+ patientUpdate: import("zod").ZodObject<import("zod").extendShape<{
96
+ firstName: import("zod").ZodString;
97
+ lastName: import("zod").ZodString;
98
+ identificationType: import("zod").ZodEnum<["dni", "ndi", "passport", "credential", "nn", "cpf", "rg", "rut", "cuit"]>;
99
+ identificationValue: import("zod").ZodString;
100
+ countryId: import("zod").ZodString;
101
+ birthdate: import("zod").ZodDate;
102
+ gender: import("zod").ZodEnum<["m", "f"]>;
86
103
  }, {
104
+ email: import("zod").ZodString;
105
+ phone: import("zod").ZodString;
106
+ }>, "strip", import("zod").ZodTypeAny, {
87
107
  firstName: string;
88
108
  lastName: string;
89
109
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
90
110
  identificationValue: string;
111
+ countryId: string;
112
+ birthdate: Date;
91
113
  gender: "m" | "f";
114
+ email: string;
115
+ phone: string;
116
+ }, {
117
+ firstName: string;
118
+ lastName: string;
119
+ identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
120
+ identificationValue: string;
92
121
  countryId: string;
93
122
  birthdate: Date;
123
+ gender: "m" | "f";
124
+ email: string;
125
+ phone: string;
94
126
  }>;
95
127
  specialtyMode: import("zod").ZodEnum<["appointment", "chat", "instant"]>;
96
128
  specialty: import("zod").ZodObject<{
@@ -356,13 +388,13 @@ export declare const doc24Schemas: {
356
388
  email: import("zod").ZodNullable<import("zod").ZodString>;
357
389
  phone: import("zod").ZodNullable<import("zod").ZodString>;
358
390
  }, "strip", import("zod").ZodTypeAny, {
359
- id: number;
360
- phone: string | null;
361
391
  email: string | null;
362
- }, {
363
- id: number;
364
392
  phone: string | null;
393
+ id: number;
394
+ }, {
365
395
  email: string | null;
396
+ phone: string | null;
397
+ id: number;
366
398
  }>;
367
399
  vcToken: import("zod").ZodString;
368
400
  appointment: import("zod").ZodOptional<import("zod").ZodObject<{
@@ -402,9 +434,9 @@ export declare const doc24Schemas: {
402
434
  patientId: number;
403
435
  creationDate: Date;
404
436
  user: {
405
- id: number;
406
- phone: string | null;
407
437
  email: string | null;
438
+ phone: string | null;
439
+ id: number;
408
440
  };
409
441
  vcToken: string;
410
442
  }, {
@@ -422,9 +454,9 @@ export declare const doc24Schemas: {
422
454
  patientId: number;
423
455
  creationDate: Date;
424
456
  user: {
425
- id: number;
426
- phone: string | null;
427
457
  email: string | null;
458
+ phone: string | null;
459
+ id: number;
428
460
  };
429
461
  vcToken: string;
430
462
  }>;
@@ -1000,14 +1032,14 @@ export declare const doc24Schemas: {
1000
1032
  brief: string;
1001
1033
  }>;
1002
1034
  }, "strip", import("zod").ZodTypeAny, {
1003
- id: number;
1004
- logoUrl: string;
1005
1035
  firstName: string;
1006
1036
  lastName: string;
1037
+ birthdate: Date;
1007
1038
  gender: "m" | "f";
1008
- phone: string | null;
1009
1039
  email: string;
1010
- birthdate: Date;
1040
+ phone: string | null;
1041
+ id: number;
1042
+ logoUrl: string;
1011
1043
  specialties: {
1012
1044
  id: number;
1013
1045
  description: string;
@@ -1023,14 +1055,14 @@ export declare const doc24Schemas: {
1023
1055
  brief: string;
1024
1056
  };
1025
1057
  }, {
1026
- id: number;
1027
- logoUrl: string;
1028
1058
  firstName: string;
1029
1059
  lastName: string;
1060
+ birthdate: Date;
1030
1061
  gender: "m" | "f";
1031
- phone: string | null;
1032
1062
  email: string;
1033
- birthdate: Date;
1063
+ phone: string | null;
1064
+ id: number;
1065
+ logoUrl: string;
1034
1066
  specialties: {
1035
1067
  id: number;
1036
1068
  description: string;
@@ -1144,13 +1176,13 @@ export declare const doc24Schemas: {
1144
1176
  firstName: import("zod").ZodString;
1145
1177
  lastName: import("zod").ZodString;
1146
1178
  }, "strip", import("zod").ZodTypeAny, {
1147
- id: number;
1148
1179
  firstName: string;
1149
1180
  lastName: string;
1150
- }, {
1151
1181
  id: number;
1182
+ }, {
1152
1183
  firstName: string;
1153
1184
  lastName: string;
1185
+ id: number;
1154
1186
  }>;
1155
1187
  patientLastPost: import("zod").ZodNullable<import("zod").ZodDate>;
1156
1188
  professional: import("zod").ZodObject<{
@@ -1182,9 +1214,9 @@ export declare const doc24Schemas: {
1182
1214
  }, "strip", import("zod").ZodTypeAny, {
1183
1215
  id: number;
1184
1216
  patient: {
1185
- id: number;
1186
1217
  firstName: string;
1187
1218
  lastName: string;
1219
+ id: number;
1188
1220
  };
1189
1221
  professional: {
1190
1222
  id: number;
@@ -1206,9 +1238,9 @@ export declare const doc24Schemas: {
1206
1238
  }, {
1207
1239
  id: number;
1208
1240
  patient: {
1209
- id: number;
1210
1241
  firstName: string;
1211
1242
  lastName: string;
1243
+ id: number;
1212
1244
  };
1213
1245
  professional: {
1214
1246
  id: number;
@@ -1256,18 +1288,18 @@ export declare const doc24Schemas: {
1256
1288
  }, "strip", import("zod").ZodTypeAny, {
1257
1289
  firstName: string;
1258
1290
  lastName: string;
1291
+ birthdate: Date;
1259
1292
  gender: "m" | "f";
1260
1293
  email: string;
1261
- birthdate: Date;
1262
1294
  startDate: Date;
1263
1295
  identificationNumber: string;
1264
1296
  plan: string;
1265
1297
  }, {
1266
1298
  firstName: string;
1267
1299
  lastName: string;
1300
+ birthdate: Date;
1268
1301
  gender: "m" | "f";
1269
1302
  email: string;
1270
- birthdate: Date;
1271
1303
  startDate: Date;
1272
1304
  identificationNumber: string;
1273
1305
  plan: string;
@@ -1313,25 +1345,25 @@ export declare const doc24Schemas: {
1313
1345
  email: import("zod").ZodString;
1314
1346
  language: import("zod").ZodString;
1315
1347
  }>, "strip", import("zod").ZodTypeAny, {
1316
- language: string;
1317
1348
  firstName: string;
1318
1349
  lastName: string;
1319
- birthday: Date;
1320
1350
  identificationType: "dni";
1321
1351
  identificationValue: string;
1322
1352
  gender: "m" | "f";
1323
- phone: string;
1324
1353
  email: string;
1325
- }, {
1354
+ phone: string;
1326
1355
  language: string;
1356
+ birthday: Date;
1357
+ }, {
1327
1358
  firstName: string;
1328
1359
  lastName: string;
1329
- birthday: Date;
1330
1360
  identificationType: "dni";
1331
1361
  identificationValue: string;
1332
1362
  gender: "m" | "f";
1333
- phone: string;
1334
1363
  email: string;
1364
+ phone: string;
1365
+ language: string;
1366
+ birthday: Date;
1335
1367
  }>;
1336
1368
  diagnosticaPatient: import("zod").ZodObject<{
1337
1369
  firstName: import("zod").ZodString;
@@ -1343,17 +1375,17 @@ export declare const doc24Schemas: {
1343
1375
  }, "strip", import("zod").ZodTypeAny, {
1344
1376
  firstName: string;
1345
1377
  lastName: string;
1346
- birthday: Date;
1347
1378
  identificationType: "dni";
1348
1379
  identificationValue: string;
1349
1380
  gender: "m" | "f";
1381
+ birthday: Date;
1350
1382
  }, {
1351
1383
  firstName: string;
1352
1384
  lastName: string;
1353
- birthday: Date;
1354
1385
  identificationType: "dni";
1355
1386
  identificationValue: string;
1356
1387
  gender: "m" | "f";
1388
+ birthday: Date;
1357
1389
  }>;
1358
1390
  diagnosticaDeepLinkResponse: import("zod").ZodUnion<[import("zod").ZodObject<{
1359
1391
  forwardingRequired: import("zod").ZodLiteral<true>;
@@ -1397,9 +1429,9 @@ export declare const doc24Schemas: {
1397
1429
  }, "strip", import("zod").ZodTypeAny, {
1398
1430
  firstName: string | null;
1399
1431
  lastName: string | null;
1432
+ birthdate: Date;
1400
1433
  gender: "m" | "f";
1401
1434
  email: string | null;
1402
- birthdate: Date;
1403
1435
  identificationNumber: string;
1404
1436
  plan: string | null;
1405
1437
  financerId: number | null;
@@ -1420,9 +1452,9 @@ export declare const doc24Schemas: {
1420
1452
  }, {
1421
1453
  firstName: string | null;
1422
1454
  lastName: string | null;
1455
+ birthdate: Date;
1423
1456
  gender: "m" | "f";
1424
1457
  email: string | null;
1425
- birthdate: Date;
1426
1458
  identificationNumber: string;
1427
1459
  plan: string | null;
1428
1460
  financerId: number | null;
package/lib/schemas.js CHANGED
@@ -24,6 +24,10 @@ const basePersonData = zod_1.object({
24
24
  birthdate: zod_1.date(),
25
25
  gender,
26
26
  });
27
+ const patientUpdateData = basePersonData.extend({
28
+ email: zod_1.string().email(),
29
+ phone: zod_1.string(),
30
+ });
27
31
  const specialtyMode = zod_1.enum(['appointment', 'chat', 'instant']);
28
32
  const specialty = zod_1.object({
29
33
  id: zod_1.number(),
@@ -299,6 +303,7 @@ exports.doc24Schemas = {
299
303
  sdkParams: zod_1.object({ url: zod_1.string(), credentials: sdkCredentials }),
300
304
  user: basePersonData.extend({ phone: zod_1.string(), email: zod_1.string() }),
301
305
  patient: basePersonData,
306
+ patientUpdate: patientUpdateData,
302
307
  specialtyMode,
303
308
  specialty,
304
309
  scheduleAvailabilityFilter,
package/lib/types.d.ts CHANGED
@@ -6,6 +6,7 @@ export declare namespace Doc24 {
6
6
  type SdkParams = TypeOf<typeof doc24Schemas.sdkParams>;
7
7
  type User = TypeOf<typeof doc24Schemas.user>;
8
8
  type Patient = TypeOf<typeof doc24Schemas.patient>;
9
+ type PatientUpdate = TypeOf<typeof doc24Schemas.patientUpdate>;
9
10
  type Specialty = TypeOf<typeof doc24Schemas.specialty>;
10
11
  type ScheduleAvailabilityFilter = TypeOf<typeof doc24Schemas.scheduleAvailabilityFilter>;
11
12
  type AvailableAppointment = TypeOf<typeof doc24Schemas.availableAppointment>;
@@ -31,7 +32,9 @@ export declare namespace Doc24 {
31
32
  type DiagnosticaPatient = TypeOf<typeof doc24Schemas.diagnosticaPatient>;
32
33
  type DiagnosticaHistoryAppointment = TypeOf<typeof doc24Schemas.diagnosticaHistoryAppointment>;
33
34
  type DiagnosticaDeepLinkResponse = TypeOf<typeof doc24Schemas.diagnosticaDeepLinkResponse>;
34
- type OldIdentificaiton = TypeOf<typeof doc24Schemas.oldIdentificaiton>;
35
+ type OldIdentification = TypeOf<typeof doc24Schemas.oldIdentificaiton>;
36
+ /** @deprecated Use OldIdentification. */
37
+ type OldIdentificaiton = OldIdentification;
35
38
  type VideoCallLink = TypeOf<typeof doc24Schemas.videoCallLink>;
36
39
  type BaseSdk = {
37
40
  declareUser: (user: User) => Promise<number>;
@@ -47,7 +50,7 @@ export declare namespace Doc24 {
47
50
  };
48
51
  type UserSdk = {
49
52
  declarePatient: (patient: Patient) => Promise<number>;
50
- updatePatient: (oldIdentification: OldIdentificaiton, patient: Patient) => Promise<number>;
53
+ updatePatient: (oldIdentification: OldIdentification, patient: PatientUpdate) => Promise<number>;
51
54
  getSpecialties: (mode: SpecialtyMode, language: string) => Promise<Specialty[]>;
52
55
  getScheduleDates: (patientId: number, filter?: ScheduleAvailabilityFilter) => Promise<Date[]>;
53
56
  getSchedule: (patientId: number, specialtyId: number, filter?: ScheduleFilter) => Promise<AvailableAppointment[]>;
@@ -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;
28
27
  firstName: string;
29
28
  lastName: string;
29
+ id: number;
30
30
  };
31
31
  professional: {
32
32
  id: number;
@@ -5,9 +5,9 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
5
5
  lastName: string;
6
6
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
7
7
  identificationValue: string;
8
- gender: "m" | "f";
9
8
  countryId: string;
10
9
  birthdate: Date;
10
+ gender: "m" | "f";
11
11
  }) => Promise<number>;
12
12
  updatePatient: (oldIdentification: {
13
13
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
@@ -17,8 +17,10 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
17
17
  lastName: string;
18
18
  identificationType: "dni" | "ndi" | "passport" | "credential" | "nn" | "cpf" | "rg" | "rut" | "cuit";
19
19
  identificationValue: string;
20
- gender: "m" | "f";
21
20
  countryId: string;
22
21
  birthdate: Date;
22
+ gender: "m" | "f";
23
+ email: string;
24
+ phone: string;
23
25
  }) => Promise<number>;
24
26
  };
@@ -22,7 +22,7 @@ const getPatientMethods = (makeRequest) => {
22
22
  });
23
23
  return response.data.patient_id;
24
24
  };
25
- const updatePatient = async (oldIdentificaiton, patient) => {
25
+ const updatePatient = async (oldIdentification, patient) => {
26
26
  const mappedPatient = {
27
27
  lastname: patient.lastName,
28
28
  firstname: patient.firstName,
@@ -30,17 +30,19 @@ const getPatientMethods = (makeRequest) => {
30
30
  identification_value: patient.identificationValue,
31
31
  birthdate: date_fns_1.format(patient.birthdate, 'yyyy-MM-dd'),
32
32
  gender: patient.gender.toUpperCase(),
33
+ email: patient.email,
34
+ phone: patient.phone,
33
35
  };
34
36
  const response = await makeRequest('POST', '/update-patient', {
35
- old_identification_type: utils_1.getIndetificationTypeId(oldIdentificaiton.identificationType),
36
- old_identification_value: oldIdentificaiton.identificationValue,
37
+ old_identification_type: utils_1.getIndetificationTypeId(oldIdentification.identificationType),
38
+ old_identification_value: oldIdentification.identificationValue,
37
39
  user_data: mappedPatient,
38
40
  });
39
41
  return response.data.patient_id;
40
42
  };
41
43
  return {
42
44
  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),
45
+ updatePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.oldIdentificaiton, schemas_1.doc24Schemas.patientUpdate]), zod_1.number(), updatePatient),
44
46
  };
45
47
  };
46
48
  exports.getPatientMethods = getPatientMethods;
@@ -32,9 +32,9 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
32
32
  patientId: number;
33
33
  creationDate: Date;
34
34
  user: {
35
- id: number;
36
- phone: string | null;
37
35
  email: string | null;
36
+ phone: string | null;
37
+ id: number;
38
38
  };
39
39
  vcToken: string;
40
40
  }>;
@@ -53,9 +53,9 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
53
53
  patientId: number;
54
54
  creationDate: Date;
55
55
  user: {
56
- id: number;
57
- phone: string | null;
58
56
  email: string | null;
57
+ phone: string | null;
58
+ id: number;
59
59
  };
60
60
  vcToken: string;
61
61
  }[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "0.42.3",
3
+ "version": "0.42.6",
4
4
  "publishConfig": {
5
5
  "tag": "0.x"
6
6
  },
@@ -8,6 +8,7 @@
8
8
  "main": "lib/index.js",
9
9
  "scripts": {
10
10
  "build": "tsc",
11
+ "test": "npm run build && node --test tests/*.test.js",
11
12
  "prepublish": "npm run build"
12
13
  },
13
14
  "keywords": [],