@integraciones_doc24/sdk 1.15.19 → 1.16.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/README.md +1 -0
- package/lib/types.d.ts +1 -0
- package/lib/userSdk/patients.d.ts +1 -0
- package/lib/userSdk/patients.js +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -197,6 +197,7 @@ export type UserSdk = {
|
|
|
197
197
|
getChatPosts: (chatId: number) => Promise<ChatPost[]>;
|
|
198
198
|
cancelChat: (chatId: number) => Promise<void>;
|
|
199
199
|
sendChatMessage: (chatId: number, message: string) => Promise<number>;
|
|
200
|
+
getPatientPHR: (patientId: number) => Promise<string>;
|
|
200
201
|
userId: number;
|
|
201
202
|
};
|
|
202
203
|
```
|
package/lib/types.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ export declare namespace Doc24 {
|
|
|
93
93
|
getExternalAppointmentsLink: (identificationValue: string, birthdate: Date) => Promise<string | null>;
|
|
94
94
|
getExternalAppointments: () => Promise<ExternalAppointment[]>;
|
|
95
95
|
cancelExternalAppointment: (appointmentId: ExternalAppointment) => Promise<void>;
|
|
96
|
+
getPatientPHR: (patientId: number) => Promise<string>;
|
|
96
97
|
userId: number;
|
|
97
98
|
};
|
|
98
99
|
namespace Webhook {
|
package/lib/userSdk/patients.js
CHANGED
|
@@ -58,10 +58,16 @@ const getPatientMethods = (makeRequest) => {
|
|
|
58
58
|
const path = `/patient/${patientId}`;
|
|
59
59
|
await makeRequest('DELETE', path);
|
|
60
60
|
};
|
|
61
|
+
const getPatientPHR = async (patientId) => {
|
|
62
|
+
const path = `/view-phr/${patientId}`;
|
|
63
|
+
const response = await makeRequest('GET', path);
|
|
64
|
+
return response.data.url_acceso_paciente;
|
|
65
|
+
};
|
|
61
66
|
return {
|
|
62
67
|
declarePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.declarePatientParams]), schemas_1.doc24Schemas.declarePatientResponse, declarePatient),
|
|
63
68
|
getPatientId: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.patient]), zod_1.number(), getPatientId),
|
|
64
69
|
deletePatient: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.void(), deletePatient),
|
|
70
|
+
getPatientPHR: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.string(), getPatientPHR),
|
|
65
71
|
};
|
|
66
72
|
};
|
|
67
73
|
exports.getPatientMethods = getPatientMethods;
|