@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 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 {
@@ -35,4 +35,5 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
35
35
  birthdate: Date;
36
36
  }) => Promise<number>;
37
37
  deletePatient: (patientId: number) => Promise<void>;
38
+ getPatientPHR: (patientId: number) => Promise<string>;
38
39
  };
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.15.19",
3
+ "version": "1.16.0",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },
@@ -33,4 +33,4 @@
33
33
  "files": [
34
34
  "lib"
35
35
  ]
36
- }
36
+ }