@integraciones_doc24/sdk 0.38.1 → 0.38.2
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.js +1 -1
- package/lib/test.d.ts +1 -1
- package/lib/test.js +18 -4
- package/lib/userSdk/patients.d.ts +1 -1
- package/lib/userSdk/patients.js +3 -4
- package/package.json +1 -1
package/lib/schemas.js
CHANGED
|
@@ -180,7 +180,7 @@ const coverageInfo = zod_1.object({
|
|
|
180
180
|
}).nullable();
|
|
181
181
|
const emergencyIdentificaiton = zod_1.object({
|
|
182
182
|
identificationType: zod_1.literal('nn'),
|
|
183
|
-
identificationValue: zod_1.string()
|
|
183
|
+
identificationValue: zod_1.string(),
|
|
184
184
|
});
|
|
185
185
|
exports.doc24Schemas = {
|
|
186
186
|
identificationType,
|
package/lib/test.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const test: () => Promise<
|
|
1
|
+
export declare const test: () => Promise<void>;
|
package/lib/test.js
CHANGED
|
@@ -13,14 +13,28 @@ const test = async () => {
|
|
|
13
13
|
const userSdk = await baseSdk.getUserInstance({
|
|
14
14
|
firstName: '-',
|
|
15
15
|
lastName: '-',
|
|
16
|
+
identificationType: 'nn',
|
|
17
|
+
identificationValue: 'jhYuPe9wu8WmSUroB4tLq8',
|
|
18
|
+
countryId: 'AR',
|
|
16
19
|
birthdate: new Date(),
|
|
17
|
-
email: 'nomail@diagnostica.com.ar',
|
|
18
|
-
phone: '',
|
|
19
20
|
gender: 'm',
|
|
20
|
-
|
|
21
|
+
phone: '',
|
|
22
|
+
email: 'nomail@diagnostica.com.ar',
|
|
23
|
+
});
|
|
24
|
+
console.log(userSdk.userId);
|
|
25
|
+
const res = await userSdk.updateEmergencyPatient({
|
|
21
26
|
identificationType: 'nn',
|
|
27
|
+
identificationValue: 'jhYuPe9wu8WmSUroB4tLq8',
|
|
28
|
+
}, {
|
|
29
|
+
firstName: 'Test',
|
|
30
|
+
lastName: 'Emergency',
|
|
31
|
+
identificationType: 'dni',
|
|
32
|
+
identificationValue: '37972512',
|
|
22
33
|
countryId: 'AR',
|
|
34
|
+
birthdate: new Date(),
|
|
35
|
+
gender: 'm',
|
|
23
36
|
});
|
|
24
|
-
|
|
37
|
+
console.log(res);
|
|
25
38
|
};
|
|
26
39
|
exports.test = test;
|
|
40
|
+
exports.test();
|
package/lib/userSdk/patients.js
CHANGED
|
@@ -30,18 +30,17 @@ 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
|
-
country_id: patient.countryId,
|
|
34
33
|
};
|
|
35
34
|
const response = await makeRequest('POST', '/update-emergency-patient', {
|
|
36
|
-
nn_identification_type: emergencyIdentificaiton.identificationType,
|
|
35
|
+
nn_identification_type: utils_1.getIndetificationTypeId(emergencyIdentificaiton.identificationType),
|
|
37
36
|
nn_identification_value: emergencyIdentificaiton.identificationValue,
|
|
38
37
|
user_data: mappedPatient,
|
|
39
38
|
});
|
|
40
|
-
return response.data;
|
|
39
|
+
return response.data.patient_id;
|
|
41
40
|
};
|
|
42
41
|
return {
|
|
43
42
|
declarePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.patient]), zod_1.number(), declarePatient),
|
|
44
|
-
updateEmergencyPatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.emergencyIdentificaiton, schemas_1.doc24Schemas.patient]), zod_1.
|
|
43
|
+
updateEmergencyPatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.emergencyIdentificaiton, schemas_1.doc24Schemas.patient]), zod_1.number(), updateEmergencyPatient),
|
|
45
44
|
};
|
|
46
45
|
};
|
|
47
46
|
exports.getPatientMethods = getPatientMethods;
|