@integraciones_doc24/sdk 0.38.2 → 0.39.0
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/schemas.d.ts +1 -1
- package/lib/schemas.js +2 -2
- package/lib/test.js +21 -16
- package/lib/types.d.ts +2 -2
- package/lib/userSdk/patients.d.ts +1 -1
- package/lib/userSdk/patients.js +5 -5
- package/package.json +1 -1
package/lib/schemas.d.ts
CHANGED
|
@@ -1112,7 +1112,7 @@ export declare const doc24Schemas: {
|
|
|
1112
1112
|
authorizationCode: string | null;
|
|
1113
1113
|
authorizationCodeExpiration: Date | null;
|
|
1114
1114
|
}>>;
|
|
1115
|
-
|
|
1115
|
+
oldIdentificaiton: import("zod").ZodObject<{
|
|
1116
1116
|
identificationType: import("zod").ZodLiteral<"nn">;
|
|
1117
1117
|
identificationValue: import("zod").ZodString;
|
|
1118
1118
|
}, "strip", import("zod").ZodTypeAny, {
|
package/lib/schemas.js
CHANGED
|
@@ -178,7 +178,7 @@ const coverageInfo = zod_1.object({
|
|
|
178
178
|
authorizationCode: zod_1.string().nullable(),
|
|
179
179
|
authorizationCodeExpiration: zod_1.date().nullable(),
|
|
180
180
|
}).nullable();
|
|
181
|
-
const
|
|
181
|
+
const oldIdentificaiton = zod_1.object({
|
|
182
182
|
identificationType: zod_1.literal('nn'),
|
|
183
183
|
identificationValue: zod_1.string(),
|
|
184
184
|
});
|
|
@@ -301,5 +301,5 @@ exports.doc24Schemas = {
|
|
|
301
301
|
diagnosticaPatient,
|
|
302
302
|
diagnosticaDeepLinkResponse,
|
|
303
303
|
coverageInfo,
|
|
304
|
-
|
|
304
|
+
oldIdentificaiton,
|
|
305
305
|
};
|
package/lib/test.js
CHANGED
|
@@ -10,31 +10,36 @@ const test = async () => {
|
|
|
10
10
|
key: 'gS2J78V0Zw8XiZJPGC9RS8TlECgqM2TmVtOzNAZbqputgmtc',
|
|
11
11
|
},
|
|
12
12
|
});
|
|
13
|
-
const
|
|
13
|
+
const userId = await baseSdk.getUserInstance({
|
|
14
14
|
firstName: '-',
|
|
15
15
|
lastName: '-',
|
|
16
16
|
identificationType: 'nn',
|
|
17
17
|
identificationValue: 'jhYuPe9wu8WmSUroB4tLq8',
|
|
18
|
+
// identificationValue: '6511a9d659bbdfce7385dfda',
|
|
18
19
|
countryId: 'AR',
|
|
19
|
-
birthdate: new Date(),
|
|
20
|
+
birthdate: new Date('2023-09-25'),
|
|
20
21
|
gender: 'm',
|
|
21
22
|
phone: '',
|
|
22
23
|
email: 'nomail@diagnostica.com.ar',
|
|
23
24
|
});
|
|
24
|
-
console.log(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
console.log(userId.userId);
|
|
26
|
+
// const userSdk = await baseSdk.getUserInstance(20892);
|
|
27
|
+
// const res = await userSdk.updatePatient(
|
|
28
|
+
// {
|
|
29
|
+
// identificationType: 'nn',
|
|
30
|
+
// identificationValue: 'jhYuPe9wu8WmSUroB4tLq8',
|
|
31
|
+
// },
|
|
32
|
+
// {
|
|
33
|
+
// firstName: 'Test',
|
|
34
|
+
// lastName: 'Emergency',
|
|
35
|
+
// identificationType: 'dni',
|
|
36
|
+
// identificationValue: '37972512',
|
|
37
|
+
// countryId: 'AR',
|
|
38
|
+
// birthdate: new Date(),
|
|
39
|
+
// gender: 'm',
|
|
40
|
+
// },
|
|
41
|
+
// );
|
|
42
|
+
// console.log(res);
|
|
38
43
|
};
|
|
39
44
|
exports.test = test;
|
|
40
45
|
exports.test();
|
package/lib/types.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare namespace Doc24 {
|
|
|
30
30
|
type DiagnosticaPatient = TypeOf<typeof doc24Schemas.diagnosticaPatient>;
|
|
31
31
|
type DiagnosticaHistoryAppointment = TypeOf<typeof doc24Schemas.diagnosticaHistoryAppointment>;
|
|
32
32
|
type DiagnosticaDeepLinkResponse = TypeOf<typeof doc24Schemas.diagnosticaDeepLinkResponse>;
|
|
33
|
-
type
|
|
33
|
+
type OldIdentificaiton = TypeOf<typeof doc24Schemas.oldIdentificaiton>;
|
|
34
34
|
type BaseSdk = {
|
|
35
35
|
declareUser: (user: User) => Promise<number>;
|
|
36
36
|
getUserInstance: (user: User | number) => Promise<UserSdk>;
|
|
@@ -44,7 +44,7 @@ export declare namespace Doc24 {
|
|
|
44
44
|
};
|
|
45
45
|
type UserSdk = {
|
|
46
46
|
declarePatient: (patient: Patient) => Promise<number>;
|
|
47
|
-
|
|
47
|
+
updatePatient: (oldIdentification: OldIdentificaiton, patient: Patient) => Promise<number>;
|
|
48
48
|
getSpecialties: (mode: SpecialtyMode, language: string) => Promise<Specialty[]>;
|
|
49
49
|
getScheduleDates: (patientId: number, filter?: ScheduleAvailabilityFilter) => Promise<Date[]>;
|
|
50
50
|
getSchedule: (patientId: number, specialtyId: number, filter?: ScheduleFilter) => Promise<AvailableAppointment[]>;
|
|
@@ -9,7 +9,7 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
|
|
|
9
9
|
countryId: string;
|
|
10
10
|
birthdate: Date;
|
|
11
11
|
}) => Promise<number>;
|
|
12
|
-
|
|
12
|
+
updatePatient: (oldIdentification: {
|
|
13
13
|
identificationType: "nn";
|
|
14
14
|
identificationValue: string;
|
|
15
15
|
}, patient: {
|
package/lib/userSdk/patients.js
CHANGED
|
@@ -22,7 +22,7 @@ const getPatientMethods = (makeRequest) => {
|
|
|
22
22
|
});
|
|
23
23
|
return response.data.patient_id;
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const updatePatient = async (oldIdentificaiton, patient) => {
|
|
26
26
|
const mappedPatient = {
|
|
27
27
|
lastname: patient.lastName,
|
|
28
28
|
firstname: patient.firstName,
|
|
@@ -31,16 +31,16 @@ const getPatientMethods = (makeRequest) => {
|
|
|
31
31
|
birthdate: date_fns_1.format(patient.birthdate, 'yyyy-MM-dd'),
|
|
32
32
|
gender: patient.gender.toUpperCase(),
|
|
33
33
|
};
|
|
34
|
-
const response = await makeRequest('POST', '/update-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const response = await makeRequest('POST', '/update-patient', {
|
|
35
|
+
old_identification_type: utils_1.getIndetificationTypeId(oldIdentificaiton.identificationType),
|
|
36
|
+
old_identification_value: oldIdentificaiton.identificationValue,
|
|
37
37
|
user_data: mappedPatient,
|
|
38
38
|
});
|
|
39
39
|
return response.data.patient_id;
|
|
40
40
|
};
|
|
41
41
|
return {
|
|
42
42
|
declarePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.patient]), zod_1.number(), declarePatient),
|
|
43
|
-
|
|
43
|
+
updatePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.oldIdentificaiton, schemas_1.doc24Schemas.patient]), zod_1.number(), updatePatient),
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
exports.getPatientMethods = getPatientMethods;
|