@integraciones_doc24/sdk 1.16.26 → 1.16.27
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 +13 -0
- package/lib/schemas.js +5 -0
- package/lib/types.d.ts +2 -0
- package/lib/userSdk/patients.d.ts +5 -0
- package/lib/userSdk/patients.js +9 -0
- package/package.json +1 -1
package/lib/schemas.d.ts
CHANGED
|
@@ -2466,4 +2466,17 @@ export declare const doc24Schemas: {
|
|
|
2466
2466
|
vcToken: string;
|
|
2467
2467
|
attachedFile: string;
|
|
2468
2468
|
}>;
|
|
2469
|
+
healthQuizParams: import("zod").ZodObject<{
|
|
2470
|
+
patientId: import("zod").ZodNumber;
|
|
2471
|
+
quiz: import("zod").ZodRecord<import("zod").ZodAny>;
|
|
2472
|
+
origen: import("zod").ZodString;
|
|
2473
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
2474
|
+
patientId: number;
|
|
2475
|
+
quiz: Record<string, any>;
|
|
2476
|
+
origen: string;
|
|
2477
|
+
}, {
|
|
2478
|
+
patientId: number;
|
|
2479
|
+
quiz: Record<string, any>;
|
|
2480
|
+
origen: string;
|
|
2481
|
+
}>;
|
|
2469
2482
|
};
|
package/lib/schemas.js
CHANGED
|
@@ -532,4 +532,9 @@ exports.doc24Schemas = {
|
|
|
532
532
|
attachedFile: zod_1.string(),
|
|
533
533
|
fileName: zod_1.string().optional(),
|
|
534
534
|
}),
|
|
535
|
+
healthQuizParams: zod_1.object({
|
|
536
|
+
patientId: zod_1.number(),
|
|
537
|
+
quiz: zod_1.record(zod_1.any()),
|
|
538
|
+
origen: zod_1.string(),
|
|
539
|
+
}),
|
|
535
540
|
};
|
package/lib/types.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export declare namespace Doc24 {
|
|
|
51
51
|
type BinahWellnessResponse = TypeOf<typeof doc24Schemas.binahWellnessResponse>;
|
|
52
52
|
type ProfessionalsBySpecialtyFilter = TypeOf<typeof doc24Schemas.professionalsBySpecialtyFilter>;
|
|
53
53
|
type UploadFileConsultationParams = TypeOf<typeof doc24Schemas.uploadFileConsultationParams>;
|
|
54
|
+
type HealthQuizParams = TypeOf<typeof doc24Schemas.healthQuizParams>;
|
|
54
55
|
type BaseSdk = {
|
|
55
56
|
declareUser: (params: DeclareUserParams) => Promise<DeclareUserResponse>;
|
|
56
57
|
getUserId: (user: User) => Promise<number>;
|
|
@@ -99,6 +100,7 @@ export declare namespace Doc24 {
|
|
|
99
100
|
getExternalAppointments: () => Promise<ExternalAppointment[]>;
|
|
100
101
|
cancelExternalAppointment: (appointmentId: ExternalAppointment) => Promise<void>;
|
|
101
102
|
getPatientPHR: (patientId: number) => Promise<string>;
|
|
103
|
+
submitHealthQuiz: (params: HealthQuizParams) => Promise<void>;
|
|
102
104
|
userId: number;
|
|
103
105
|
getBinahWellnessLink: (body: BinahWellnessGetLinkParams) => Promise<BinahWellnessResponse>;
|
|
104
106
|
uploadFileConsultation: (params: UploadFileConsultationParams) => Promise<unknown>;
|
|
@@ -50,4 +50,9 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
|
|
|
50
50
|
}) => Promise<number>;
|
|
51
51
|
deletePatient: (patientId: number) => Promise<void>;
|
|
52
52
|
getPatientPHR: (patientId: number) => Promise<string>;
|
|
53
|
+
submitHealthQuiz: (params: {
|
|
54
|
+
patientId: number;
|
|
55
|
+
quiz: Record<string, any>;
|
|
56
|
+
origen: string;
|
|
57
|
+
}) => Promise<void>;
|
|
53
58
|
};
|
package/lib/userSdk/patients.js
CHANGED
|
@@ -70,11 +70,20 @@ const getPatientMethods = (makeRequest) => {
|
|
|
70
70
|
const response = await makeRequest('GET', path);
|
|
71
71
|
return response.data.url_acceso_paciente;
|
|
72
72
|
};
|
|
73
|
+
const submitHealthQuiz = async ({ patientId, quiz, origen, }) => {
|
|
74
|
+
const path = '/health-quiz-external';
|
|
75
|
+
await makeRequest('POST', path, {
|
|
76
|
+
id_persona: patientId,
|
|
77
|
+
quiz,
|
|
78
|
+
origen,
|
|
79
|
+
});
|
|
80
|
+
};
|
|
73
81
|
return {
|
|
74
82
|
declarePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.declarePatientParams]), schemas_1.doc24Schemas.declarePatientResponse, declarePatient),
|
|
75
83
|
getPatientId: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.patient]), zod_1.number(), getPatientId),
|
|
76
84
|
deletePatient: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.void(), deletePatient),
|
|
77
85
|
getPatientPHR: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.string(), getPatientPHR),
|
|
86
|
+
submitHealthQuiz: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.healthQuizParams]), zod_1.void(), submitHealthQuiz),
|
|
78
87
|
};
|
|
79
88
|
};
|
|
80
89
|
exports.getPatientMethods = getPatientMethods;
|