@integraciones_doc24/sdk 1.14.2 → 1.14.4
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/diagnostica.d.ts +11 -11
- package/lib/baseSdk/diagnostica.js +18 -20
- package/lib/baseSdk/index.js +0 -3
- package/lib/baseSdk/user.d.ts +6 -56
- package/lib/baseSdk/user.js +25 -70
- package/lib/index.d.ts +24 -258
- package/lib/schemas.d.ts +56 -738
- package/lib/schemas.js +37 -149
- package/lib/test.d.ts +1 -0
- package/lib/test.js +45 -0
- package/lib/types.d.ts +7 -34
- package/lib/userSdk/chat.d.ts +2 -2
- package/lib/userSdk/patients.d.ts +14 -28
- package/lib/userSdk/patients.js +12 -31
- package/lib/userSdk/schedule.d.ts +2 -4
- package/lib/userSdk/schedule.js +14 -18
- package/lib/userSdk/videoVisit.d.ts +2 -4
- package/lib/userSdk/videoVisit.js +2 -9
- package/lib/utils.d.ts +4 -2
- package/lib/utils.js +18 -11
- package/package.json +1 -1
|
@@ -33,10 +33,10 @@ const getVideoVisitMethods = (makeRequest) => {
|
|
|
33
33
|
const response = await makeRequest('GET', path);
|
|
34
34
|
return mapVideoVisit(response.data);
|
|
35
35
|
});
|
|
36
|
-
const getPatientVideoVisitHistory = validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.array(schemas_1.doc24Schemas.
|
|
36
|
+
const getPatientVideoVisitHistory = validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.array(schemas_1.doc24Schemas.videoVisit), async (patientId) => {
|
|
37
37
|
const path = `/video-visit-history/${patientId}`;
|
|
38
38
|
const response = await makeRequest('GET', path);
|
|
39
|
-
return response.data.map((raw) =>
|
|
39
|
+
return response.data.map((raw) => mapVideoVisit(raw));
|
|
40
40
|
});
|
|
41
41
|
const getVideoVisitDetails = validation_1.validateFunction(zod_1.tuple([zod_1.number()]), schemas_1.doc24Schemas.videoVisitDetails, async (vcId) => {
|
|
42
42
|
const path = `/video-visit-records/${vcId}`;
|
|
@@ -145,10 +145,3 @@ const mapVideoVisit = (raw) => {
|
|
|
145
145
|
atentionId: (_b = raw.atentionId) !== null && _b !== void 0 ? _b : undefined,
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
|
-
const mapHistoricalVideoVisit = (raw) => {
|
|
149
|
-
return {
|
|
150
|
-
...mapVideoVisit(raw),
|
|
151
|
-
professional: raw.professional,
|
|
152
|
-
specialty: raw.specialty,
|
|
153
|
-
};
|
|
154
|
-
};
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
import { Doc24 } from '.';
|
|
2
|
+
export declare const parseDate: (str: string) => Date;
|
|
3
|
+
export declare const parseDateTime: (str: string) => Date;
|
|
4
|
+
export declare const getIndetificationTypeId: (type: Doc24.IdentificationType) => 1 | 6 | 5 | 999 | 1000;
|
package/lib/utils.js
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseDateTime = exports.parseDate = void 0;
|
|
3
|
+
exports.getIndetificationTypeId = exports.parseDateTime = exports.parseDate = void 0;
|
|
4
4
|
const date_fns_1 = require("date-fns");
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const parseDate = (str, timeZone) => exports.parseDateTime(`${str} 00:00:00`, timeZone);
|
|
5
|
+
const timeZone = '-03';
|
|
6
|
+
const parseDate = (str) => exports.parseDateTime(`${str} 00:00:00`);
|
|
8
7
|
exports.parseDate = parseDate;
|
|
9
|
-
const parseDateTime = (str
|
|
8
|
+
const parseDateTime = (str) => date_fns_1.parse(`${str} ${timeZone}`, 'yyyy-MM-dd HH:mm:ss X', new Date());
|
|
10
9
|
exports.parseDateTime = parseDateTime;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const getIndetificationTypeId = (type) => {
|
|
11
|
+
if (type === 'dni')
|
|
12
|
+
return 1;
|
|
13
|
+
if (type === 'ndi')
|
|
14
|
+
return 6;
|
|
15
|
+
if (type === 'passport')
|
|
16
|
+
return 5;
|
|
17
|
+
if (type === 'credential')
|
|
18
|
+
return 999;
|
|
19
|
+
if (type === 'nn')
|
|
20
|
+
return 1000;
|
|
21
|
+
throw new Error('Invalid identificationType');
|
|
22
|
+
};
|
|
23
|
+
exports.getIndetificationTypeId = getIndetificationTypeId;
|