@integraciones_doc24/sdk 1.1.1 → 1.2.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.
Files changed (163) hide show
  1. package/lib/baseSdk/user.d.ts +3 -2
  2. package/lib/index.d.ts +3 -2
  3. package/lib/lib/baseSdk/diagnostica.d.ts +11 -0
  4. package/lib/lib/baseSdk/diagnostica.js +79 -0
  5. package/lib/lib/baseSdk/index.d.ts +161 -0
  6. package/lib/lib/baseSdk/index.js +66 -0
  7. package/lib/lib/baseSdk/user.d.ts +41 -0
  8. package/lib/lib/baseSdk/user.js +130 -0
  9. package/lib/lib/index.d.ts +182 -0
  10. package/lib/lib/index.js +22 -0
  11. package/lib/lib/lib/baseSdk/diagnostica.d.ts +6 -0
  12. package/lib/lib/lib/baseSdk/diagnostica.js +79 -0
  13. package/lib/lib/lib/baseSdk/index.d.ts +51 -0
  14. package/lib/lib/lib/baseSdk/index.js +66 -0
  15. package/lib/lib/lib/baseSdk/user.d.ts +9 -0
  16. package/lib/lib/lib/baseSdk/user.js +130 -0
  17. package/lib/lib/lib/index.d.ts +168 -0
  18. package/lib/lib/lib/index.js +22 -0
  19. package/lib/lib/lib/request/index.d.ts +2 -0
  20. package/lib/lib/lib/request/index.js +26 -0
  21. package/lib/lib/lib/request/token.d.ts +2 -0
  22. package/lib/lib/lib/request/token.js +34 -0
  23. package/lib/lib/lib/request/validation.d.ts +10 -0
  24. package/lib/lib/lib/request/validation.js +28 -0
  25. package/lib/lib/lib/schemas.d.ts +1334 -0
  26. package/lib/lib/lib/schemas.js +325 -0
  27. package/lib/lib/lib/test.d.ts +1 -0
  28. package/lib/lib/lib/test.js +55 -0
  29. package/lib/lib/lib/types.d.ts +1 -0
  30. package/lib/lib/lib/types.js +2 -0
  31. package/lib/lib/lib/userSdk/chat.d.ts +9 -0
  32. package/lib/lib/lib/userSdk/chat.js +98 -0
  33. package/lib/lib/lib/userSdk/index.d.ts +102 -0
  34. package/lib/lib/lib/userSdk/index.js +27 -0
  35. package/lib/lib/lib/userSdk/patients.d.ts +5 -0
  36. package/lib/lib/lib/userSdk/patients.js +55 -0
  37. package/lib/lib/lib/userSdk/schedule.d.ts +7 -0
  38. package/lib/lib/lib/userSdk/schedule.js +76 -0
  39. package/lib/lib/lib/userSdk/specialties.d.ts +4 -0
  40. package/lib/lib/lib/userSdk/specialties.js +19 -0
  41. package/lib/lib/lib/userSdk/videoVisit.d.ts +10 -0
  42. package/lib/lib/lib/userSdk/videoVisit.js +147 -0
  43. package/lib/lib/lib/utils.d.ts +4 -0
  44. package/lib/lib/lib/utils.js +19 -0
  45. package/lib/lib/lib/webhook/index.d.ts +8 -0
  46. package/lib/lib/lib/webhook/index.js +55 -0
  47. package/lib/lib/lib/webhook/responses.d.ts +36 -0
  48. package/lib/lib/lib/webhook/responses.js +42 -0
  49. package/lib/lib/lib/webhook/token.d.ts +2 -0
  50. package/lib/lib/lib/webhook/token.js +23 -0
  51. package/lib/lib/request/index.d.ts +2 -0
  52. package/lib/lib/request/index.js +26 -0
  53. package/lib/lib/request/token.d.ts +2 -0
  54. package/lib/lib/request/token.js +34 -0
  55. package/lib/lib/request/validation.d.ts +10 -0
  56. package/lib/lib/request/validation.js +28 -0
  57. package/lib/lib/schemas.d.ts +1334 -0
  58. package/lib/lib/schemas.js +325 -0
  59. package/lib/lib/src/baseSdk/diagnostica.d.ts +11 -0
  60. package/lib/lib/src/baseSdk/diagnostica.js +79 -0
  61. package/lib/lib/src/baseSdk/index.d.ts +162 -0
  62. package/lib/lib/src/baseSdk/index.js +66 -0
  63. package/lib/lib/src/baseSdk/user.d.ts +41 -0
  64. package/lib/lib/src/baseSdk/user.js +130 -0
  65. package/lib/lib/src/index.d.ts +183 -0
  66. package/lib/lib/src/index.js +22 -0
  67. package/lib/lib/src/request/index.d.ts +2 -0
  68. package/lib/lib/src/request/index.js +26 -0
  69. package/lib/lib/src/request/token.d.ts +2 -0
  70. package/lib/lib/src/request/token.js +34 -0
  71. package/lib/lib/src/request/validation.d.ts +10 -0
  72. package/lib/lib/src/request/validation.js +28 -0
  73. package/lib/lib/src/schemas.d.ts +1340 -0
  74. package/lib/lib/src/schemas.js +325 -0
  75. package/lib/lib/src/types.d.ts +1 -0
  76. package/lib/lib/src/types.js +2 -0
  77. package/lib/lib/src/userSdk/chat.d.ts +9 -0
  78. package/lib/lib/src/userSdk/chat.js +98 -0
  79. package/lib/lib/src/userSdk/index.d.ts +241 -0
  80. package/lib/lib/src/userSdk/index.js +27 -0
  81. package/lib/lib/src/userSdk/patients.d.ts +13 -0
  82. package/lib/lib/src/userSdk/patients.js +55 -0
  83. package/lib/lib/src/userSdk/schedule.d.ts +15 -0
  84. package/lib/lib/src/userSdk/schedule.js +76 -0
  85. package/lib/lib/src/userSdk/specialties.d.ts +4 -0
  86. package/lib/lib/src/userSdk/specialties.js +19 -0
  87. package/lib/lib/src/userSdk/videoVisit.d.ts +72 -0
  88. package/lib/lib/src/userSdk/videoVisit.js +147 -0
  89. package/lib/lib/src/utils.d.ts +4 -0
  90. package/lib/lib/src/utils.js +19 -0
  91. package/lib/lib/src/webhook/index.d.ts +8 -0
  92. package/lib/lib/src/webhook/index.js +55 -0
  93. package/lib/lib/src/webhook/responses.d.ts +36 -0
  94. package/lib/lib/src/webhook/responses.js +42 -0
  95. package/lib/lib/src/webhook/token.d.ts +2 -0
  96. package/lib/lib/src/webhook/token.js +23 -0
  97. package/lib/lib/test.d.ts +1 -0
  98. package/lib/lib/test.js +55 -0
  99. package/lib/lib/types.d.ts +1 -0
  100. package/lib/lib/types.js +2 -0
  101. package/lib/lib/userSdk/chat.d.ts +9 -0
  102. package/lib/lib/userSdk/chat.js +98 -0
  103. package/lib/lib/userSdk/index.d.ts +240 -0
  104. package/lib/lib/userSdk/index.js +27 -0
  105. package/lib/lib/userSdk/patients.d.ts +13 -0
  106. package/lib/lib/userSdk/patients.js +55 -0
  107. package/lib/lib/userSdk/schedule.d.ts +15 -0
  108. package/lib/lib/userSdk/schedule.js +76 -0
  109. package/lib/lib/userSdk/specialties.d.ts +4 -0
  110. package/lib/lib/userSdk/specialties.js +19 -0
  111. package/lib/lib/userSdk/videoVisit.d.ts +72 -0
  112. package/lib/lib/userSdk/videoVisit.js +147 -0
  113. package/lib/lib/utils.d.ts +4 -0
  114. package/lib/lib/utils.js +19 -0
  115. package/lib/lib/webhook/index.d.ts +8 -0
  116. package/lib/lib/webhook/index.js +55 -0
  117. package/lib/lib/webhook/responses.d.ts +36 -0
  118. package/lib/lib/webhook/responses.js +42 -0
  119. package/lib/lib/webhook/token.d.ts +2 -0
  120. package/lib/lib/webhook/token.js +23 -0
  121. package/lib/schemas.d.ts +32 -16
  122. package/lib/schemas.js +6 -5
  123. package/lib/src/baseSdk/diagnostica.d.ts +54 -0
  124. package/lib/src/baseSdk/diagnostica.js +79 -0
  125. package/lib/src/baseSdk/index.d.ts +2 -0
  126. package/lib/src/baseSdk/index.js +66 -0
  127. package/lib/src/baseSdk/user.d.ts +89 -0
  128. package/lib/src/baseSdk/user.js +130 -0
  129. package/lib/src/index.d.ts +188 -0
  130. package/lib/src/index.js +22 -0
  131. package/lib/src/request/index.d.ts +3 -0
  132. package/lib/src/request/index.js +26 -0
  133. package/lib/src/request/token.d.ts +2 -0
  134. package/lib/src/request/token.js +34 -0
  135. package/lib/src/request/validation.d.ts +10 -0
  136. package/lib/src/request/validation.js +28 -0
  137. package/lib/src/schemas.d.ts +1311 -0
  138. package/lib/src/schemas.js +325 -0
  139. package/lib/src/types.d.ts +124 -0
  140. package/lib/src/types.js +2 -0
  141. package/lib/src/userSdk/chat.d.ts +57 -0
  142. package/lib/src/userSdk/chat.js +98 -0
  143. package/lib/src/userSdk/index.d.ts +2 -0
  144. package/lib/src/userSdk/index.js +27 -0
  145. package/lib/src/userSdk/patients.d.ts +33 -0
  146. package/lib/src/userSdk/patients.js +55 -0
  147. package/lib/src/userSdk/schedule.d.ts +44 -0
  148. package/lib/src/userSdk/schedule.js +76 -0
  149. package/lib/src/userSdk/specialties.d.ts +7 -0
  150. package/lib/src/userSdk/specialties.js +19 -0
  151. package/lib/src/userSdk/videoVisit.d.ts +111 -0
  152. package/lib/src/userSdk/videoVisit.js +147 -0
  153. package/lib/src/utils.d.ts +4 -0
  154. package/lib/src/utils.js +19 -0
  155. package/lib/src/webhook/index.d.ts +2 -0
  156. package/lib/src/webhook/index.js +55 -0
  157. package/lib/src/webhook/responses.d.ts +35 -0
  158. package/lib/src/webhook/responses.js +42 -0
  159. package/lib/src/webhook/token.d.ts +2 -0
  160. package/lib/src/webhook/token.js +23 -0
  161. package/lib/types.d.ts +1 -0
  162. package/lib/userSdk/patients.d.ts +3 -2
  163. package/package.json +1 -1
@@ -0,0 +1,325 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.doc24Schemas = void 0;
4
+ const zod_1 = require("zod");
5
+ const gender = zod_1.enum(['m', 'f']);
6
+ const identificationType = zod_1.enum(['ndi', 'passport', 'credential']);
7
+ const sdkCredentials = zod_1.object({ iss: zod_1.string(), key: zod_1.string() });
8
+ const basePersonData = zod_1.object({
9
+ firstName: zod_1.string(),
10
+ lastName: zod_1.string(),
11
+ identificationType,
12
+ identificationValue: zod_1.string(),
13
+ countryId: zod_1.string(),
14
+ birthdate: zod_1.date(),
15
+ gender,
16
+ });
17
+ const patient = basePersonData;
18
+ const user = basePersonData.extend({ phone: zod_1.string(), email: zod_1.string() });
19
+ const specialtyMode = zod_1.enum(['appointment', 'chat', 'instant']);
20
+ const specialty = zod_1.object({
21
+ id: zod_1.number(),
22
+ description: zod_1.string(),
23
+ });
24
+ const scheduleAvailabilityFilter = zod_1.object({
25
+ specialtyId: zod_1.number().optional(),
26
+ professionalId: zod_1.number().optional(),
27
+ });
28
+ const availableAppointment = zod_1.object({
29
+ id: zod_1.number().or(zod_1.string()),
30
+ date: zod_1.date(),
31
+ clinicId: zod_1.number(),
32
+ professional: zod_1.object({
33
+ id: zod_1.number(),
34
+ fullName: zod_1.string(),
35
+ logoUrl: zod_1.string(),
36
+ }),
37
+ cost: zod_1.string(),
38
+ specialty: specialty,
39
+ type: specialtyMode,
40
+ atentions: zod_1.number(),
41
+ ranking: zod_1.unknown(),
42
+ length: zod_1.number().nullish(),
43
+ });
44
+ const appointment = zod_1.object({
45
+ id: zod_1.number(),
46
+ professionalId: zod_1.number(),
47
+ date: zod_1.date(),
48
+ });
49
+ const availableScheduleClinics = zod_1.object({
50
+ specialties: specialty.array(),
51
+ specialtiesER: specialty.array(),
52
+ professionals: zod_1.object({
53
+ id: zod_1.number(),
54
+ fullName: zod_1.string(),
55
+ clinicId: zod_1.number(),
56
+ specialties: specialty.array(),
57
+ }).array(),
58
+ });
59
+ const baseScheduleParameters = zod_1.object({
60
+ patientId: zod_1.number(),
61
+ specialtyId: zod_1.number(),
62
+ language: zod_1.string(),
63
+ details: zod_1.string(),
64
+ extraInfo: zod_1.any(),
65
+ });
66
+ const appointmentScheduleParameters = baseScheduleParameters.extend({
67
+ type: zod_1.literal('appointment'),
68
+ appointmentId: zod_1.number().or(zod_1.string()),
69
+ });
70
+ const instantScheduleParameters = baseScheduleParameters.extend({
71
+ type: zod_1.literal('instant'),
72
+ });
73
+ const chatroomAvailabilityFilter = zod_1.object({
74
+ limit: zod_1.number().optional(),
75
+ offset: zod_1.number().optional(),
76
+ });
77
+ const chatParameters = zod_1.object({
78
+ patientId: zod_1.number(),
79
+ chatroomId: zod_1.number(),
80
+ language: zod_1.string(),
81
+ specialtyId: zod_1.number(),
82
+ });
83
+ const availableChatroom = zod_1.object({
84
+ id: zod_1.number(),
85
+ professional: zod_1.object({
86
+ id: zod_1.number(),
87
+ fullName: zod_1.string(),
88
+ logoUrl: zod_1.string(),
89
+ }),
90
+ specialty: zod_1.object({ id: zod_1.number(), description: zod_1.string() }),
91
+ });
92
+ const chatDetails = zod_1.object({
93
+ id: zod_1.number(),
94
+ chatRoomId: zod_1.number(),
95
+ startDate: zod_1.date(),
96
+ lastEventDate: zod_1.date(),
97
+ closureDate: zod_1.date().nullable(),
98
+ patient: zod_1.object({
99
+ id: zod_1.number(),
100
+ firstName: zod_1.string(),
101
+ lastName: zod_1.string(),
102
+ }),
103
+ patientLastPost: zod_1.date().nullable(),
104
+ professional: zod_1.object({
105
+ id: zod_1.number(),
106
+ fullName: zod_1.string(),
107
+ logoUrl: zod_1.string(),
108
+ }),
109
+ professionalLastPost: zod_1.date().nullable(),
110
+ specialty: zod_1.object({ id: zod_1.number(), description: zod_1.string() }),
111
+ status: zod_1.string(),
112
+ paymentStatus: zod_1.string(),
113
+ });
114
+ const chatPost = zod_1.object({
115
+ id: zod_1.number(),
116
+ userType: zod_1.enum(['patient', 'professional']),
117
+ message: zod_1.string(),
118
+ date: zod_1.date(),
119
+ });
120
+ const enrollmentParams = zod_1.object({
121
+ firstName: zod_1.string(),
122
+ lastName: zod_1.string(),
123
+ gender: gender,
124
+ identificationNumber: zod_1.string(),
125
+ birthdate: zod_1.date(),
126
+ email: zod_1.string().email(),
127
+ plan: zod_1.string(),
128
+ startDate: zod_1.date(),
129
+ });
130
+ const diagnosticaHistoryAppointment = zod_1.object({
131
+ date: zod_1.date(),
132
+ location: zod_1.string(),
133
+ exams: zod_1.string().array(),
134
+ deepLink: zod_1.string().url(),
135
+ });
136
+ const diagnosticaPatient = zod_1.object({
137
+ firstName: zod_1.string(),
138
+ lastName: zod_1.string(),
139
+ birthday: zod_1.date(),
140
+ identificationType: zod_1.literal('dni'),
141
+ identificationValue: zod_1.string(),
142
+ gender: gender,
143
+ });
144
+ const diagnosticaUser = diagnosticaPatient.merge(zod_1.object({
145
+ phone: zod_1.string(),
146
+ email: zod_1.string().email(),
147
+ language: zod_1.string(),
148
+ }));
149
+ const diagnosticaDeepLinkResponse = zod_1.object({
150
+ forwardingRequired: zod_1.literal(true),
151
+ deepLink: zod_1.string().url(),
152
+ }).or(zod_1.object({ forwardingRequired: zod_1.literal(false) }));
153
+ const coverageInfo = zod_1.object({
154
+ financerId: zod_1.number().nullable(),
155
+ defaultAffiliationId: zod_1.number().nullable(),
156
+ plan: zod_1.string().nullable(),
157
+ identificationNumber: zod_1.string(),
158
+ credentialNumber: zod_1.string().nullable(),
159
+ lastName: zod_1.string().nullable(),
160
+ firstName: zod_1.string().nullable(),
161
+ birthdate: zod_1.date(),
162
+ financerPlanId: zod_1.number().nullable(),
163
+ gender,
164
+ brand: zod_1.number().nullable(),
165
+ holderIdentificationNumber: zod_1.string().nullable(),
166
+ copaymentValue: zod_1.number().nullable(),
167
+ mobilePhone: zod_1.string().nullable(),
168
+ company: zod_1.string().nullable(),
169
+ email: zod_1.string().email().nullable(),
170
+ dischargeDate: zod_1.date().nullable(),
171
+ leavingDate: zod_1.date().nullable(),
172
+ identificacion_tributaria: zod_1.string().nullable(),
173
+ deregistrationDate: zod_1.date().nullable(),
174
+ authorizationCode: zod_1.string().nullable(),
175
+ authorizationCodeExpiration: zod_1.date().nullable(),
176
+ }).nullable();
177
+ const sendVerificationCodeParams = zod_1.object({
178
+ identificationType,
179
+ identificationValue: zod_1.string(),
180
+ channel: zod_1.enum(['1', '2']),
181
+ });
182
+ const declareUserParams = zod_1.object({
183
+ user,
184
+ channel: zod_1.enum(['1', '2']).optional(),
185
+ code: zod_1.string().optional(),
186
+ });
187
+ const declarePatientParams = zod_1.object({
188
+ patient,
189
+ channel: zod_1.enum(['1', '2']).optional(),
190
+ code: zod_1.string().optional(),
191
+ });
192
+ const declarePatientResponse = zod_1.object({
193
+ patientId: zod_1.number().nullable(),
194
+ userInfo: zod_1.object({
195
+ email: zod_1.string(),
196
+ phone: zod_1.string(),
197
+ }),
198
+ askCode: zod_1.boolean(),
199
+ });
200
+ const declareUserResponse = declarePatientResponse.extend({ userId: zod_1.number() });
201
+ exports.doc24Schemas = {
202
+ identificationType,
203
+ sdkCredentials,
204
+ sdkParams: zod_1.object({ url: zod_1.string(), credentials: sdkCredentials }),
205
+ user,
206
+ patient,
207
+ specialtyMode,
208
+ specialty,
209
+ scheduleAvailabilityFilter,
210
+ availableAppointment,
211
+ availableScheduleClinics,
212
+ scheduleFilter: zod_1.object({
213
+ professionalId: zod_1.number().optional(),
214
+ offset: zod_1.number().optional(),
215
+ limit: zod_1.number().optional(),
216
+ weekDay: zod_1.number().optional(),
217
+ date: zod_1.date().optional(),
218
+ startHour: zod_1.string().optional(),
219
+ finishHour: zod_1.string().optional(),
220
+ }),
221
+ scheduleParameters: zod_1.union([
222
+ appointmentScheduleParameters,
223
+ instantScheduleParameters,
224
+ ]),
225
+ videoVisit: zod_1.object({
226
+ id: zod_1.number().nullable(),
227
+ creationDate: zod_1.date(),
228
+ patientId: zod_1.number(),
229
+ user: zod_1.object({
230
+ id: zod_1.number(),
231
+ email: zod_1.string().nullable(),
232
+ phone: zod_1.string().nullable(),
233
+ }),
234
+ vcToken: zod_1.string(),
235
+ appointment: zod_1.object({
236
+ id: zod_1.number(),
237
+ date: zod_1.date(),
238
+ }).optional(),
239
+ videoVisit: zod_1.object({
240
+ id: zod_1.number(),
241
+ status: zod_1.string(),
242
+ }).optional(),
243
+ paymentStatus: zod_1.string().optional(),
244
+ atentionId: zod_1.number().optional(),
245
+ }),
246
+ videoVisitDetails: zod_1.object({
247
+ id: zod_1.number(),
248
+ status: zod_1.string(),
249
+ paymentStatus: zod_1.string(),
250
+ professional: zod_1.object({
251
+ id: zod_1.number(),
252
+ fullName: zod_1.string(),
253
+ }).optional(),
254
+ patient: zod_1.object({
255
+ fullName: zod_1.string(),
256
+ firstAccessDate: zod_1.date(),
257
+ lastAccessDate: zod_1.date(),
258
+ }),
259
+ finishDate: zod_1.date().nullable(),
260
+ retries: zod_1.number(),
261
+ language: zod_1.string(),
262
+ appointment: zod_1.object({ id: zod_1.number(), date: zod_1.date() }).nullable(),
263
+ report: zod_1.object({
264
+ motive: zod_1.string().nullable(),
265
+ actualDesease: zod_1.string().nullable(),
266
+ indications: zod_1.string().nullable(),
267
+ alertSigns: zod_1.string().nullable(),
268
+ extendedMotive: zod_1.string().nullable(),
269
+ diagnose: zod_1.array(zod_1.object({ description: zod_1.string(), code: zod_1.string() })),
270
+ }),
271
+ pdf: zod_1.object({
272
+ atention: zod_1.string().optional(),
273
+ labs: zod_1.string().optional(),
274
+ otherExams: zod_1.string().optional(),
275
+ images: zod_1.string().optional(),
276
+ medication: zod_1.array(zod_1.any()),
277
+ }),
278
+ files: zod_1.array(zod_1.object({ name: zod_1.string(), url: zod_1.string().url() })),
279
+ }),
280
+ activeVideoVisitData: zod_1.object({
281
+ consultationId: zod_1.number(),
282
+ patientId: zod_1.number(),
283
+ vcToken: zod_1.string(),
284
+ }),
285
+ professional: zod_1.object({
286
+ id: zod_1.number(),
287
+ firstName: zod_1.string(),
288
+ lastName: zod_1.string(),
289
+ birthdate: zod_1.date(),
290
+ gender,
291
+ email: zod_1.string(),
292
+ phone: zod_1.string().nullable(),
293
+ logoUrl: zod_1.string(),
294
+ matriculation: zod_1.array(zod_1.object({ number: zod_1.string(), type: zod_1.string() })),
295
+ specialties: zod_1.array(specialty),
296
+ degree: zod_1.string(),
297
+ languages: zod_1.array(zod_1.string()),
298
+ resume: zod_1.object({
299
+ link: zod_1.string(),
300
+ brief: zod_1.string(),
301
+ }),
302
+ }),
303
+ appointment,
304
+ chatroomAvailabilityFilter,
305
+ chatParameters,
306
+ availableChatroom,
307
+ chatDetails,
308
+ chatPost,
309
+ enrollmentParams,
310
+ diagnosticaPatientFilter: zod_1.object({
311
+ gender,
312
+ identificationType,
313
+ identificationValue: zod_1.string(),
314
+ }),
315
+ diagnosticaHistoryAppointment,
316
+ diagnosticaUser,
317
+ diagnosticaPatient,
318
+ diagnosticaDeepLinkResponse,
319
+ coverageInfo,
320
+ sendVerificationCodeParams,
321
+ declareUserParams,
322
+ declareUserResponse,
323
+ declarePatientParams,
324
+ declarePatientResponse,
325
+ };
@@ -0,0 +1,11 @@
1
+ export var __esModule: boolean;
2
+ export function getDiagnosticaMethods(makeRequest: any): {
3
+ getDiagnosticaHistory: (...params: any) => Promise<any>;
4
+ getDiagnosticaDeepLink: (...params: any) => Promise<{
5
+ forwardingRequired: true;
6
+ deepLink: string;
7
+ } | {
8
+ forwardingRequired: false;
9
+ }>;
10
+ getDiagnosticaAccess: (...params: any) => Promise<void>;
11
+ };
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDiagnosticaMethods = void 0;
4
+ const date_fns_1 = require("date-fns");
5
+ const zod_1 = require("zod");
6
+ const validation_1 = require("../request/validation");
7
+ const schemas_1 = require("../schemas");
8
+ const getDiagnosticaMethods = (makeRequest) => {
9
+ const getDiagnosticaHistory = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.diagnosticaPatientFilter, zod_1.date(), zod_1.date()]), schemas_1.doc24Schemas.diagnosticaHistoryAppointment.array(), async (patient, from, to) => {
10
+ const path = '/history-diagnostica';
11
+ const response = await makeRequest('POST', path, {
12
+ patient: {
13
+ gender: patient.gender,
14
+ id_type: patient.identificationType === 'ndi'
15
+ ? 'DNI'
16
+ : patient.identificationType,
17
+ id_value: patient.identificationValue,
18
+ },
19
+ dateFrom: from.toISOString(),
20
+ dateTo: to.toISOString(),
21
+ });
22
+ const list = response.data.info;
23
+ return list.map((i) => ({
24
+ date: new Date(Date.parse(i.date)),
25
+ location: i.location,
26
+ exams: i.exams,
27
+ deepLink: i.deeplink,
28
+ }));
29
+ });
30
+ const getDiagnosticaDeepLink = validation_1.validateFunction(zod_1.tuple([
31
+ zod_1.string(),
32
+ schemas_1.doc24Schemas.diagnosticaUser,
33
+ schemas_1.doc24Schemas.diagnosticaPatient,
34
+ ]), schemas_1.doc24Schemas.diagnosticaDeepLinkResponse, async (kiosk, user, patient) => {
35
+ const path = '/deeplink-diagnostica';
36
+ const response = await makeRequest('POST', path, {
37
+ kiosk,
38
+ user: mapUserData(user),
39
+ patient: mapPatientData(patient),
40
+ });
41
+ const data = response.data.info.data;
42
+ if (data.forwarding_required)
43
+ return { forwardingRequired: true, deepLink: data.deeplink };
44
+ return { forwardingRequired: false };
45
+ });
46
+ const getDiagnosticaAccess = validation_1.validateFunction(zod_1.tuple([
47
+ zod_1.string(),
48
+ schemas_1.doc24Schemas.diagnosticaUser,
49
+ schemas_1.doc24Schemas.diagnosticaPatient,
50
+ ]), zod_1.void(), async (kiosk, user, patient) => {
51
+ const path = '/access-diagnostica';
52
+ await makeRequest('POST', path, {
53
+ kiosk,
54
+ user: mapUserData(user),
55
+ patient: mapPatientData(patient),
56
+ });
57
+ return;
58
+ });
59
+ return { getDiagnosticaHistory, getDiagnosticaDeepLink, getDiagnosticaAccess };
60
+ };
61
+ exports.getDiagnosticaMethods = getDiagnosticaMethods;
62
+ const mapPatientData = (patient) => {
63
+ return {
64
+ name: patient.firstName,
65
+ surname: patient.lastName,
66
+ birthday: date_fns_1.format(patient.birthday, 'yyyy-MM-dd'),
67
+ id_type: 'DNI',
68
+ id_value: patient.identificationValue,
69
+ gender: patient.gender.toLocaleUpperCase(),
70
+ };
71
+ };
72
+ const mapUserData = (user) => {
73
+ return {
74
+ ...mapPatientData(user),
75
+ phone: user.phone,
76
+ email: user.email,
77
+ language: user.language,
78
+ };
79
+ };
@@ -0,0 +1,162 @@
1
+ export var __esModule: boolean;
2
+ export function getBaseSdk(url: any, credentials: any): Promise<{
3
+ getProfessional: (...params: any) => Promise<{
4
+ id: any;
5
+ firstName: any;
6
+ lastName: any;
7
+ birthdate: Date;
8
+ gender: any;
9
+ email: any;
10
+ phone: any;
11
+ logoUrl: any;
12
+ matriculation: any;
13
+ specialties: any;
14
+ degree: any;
15
+ languages: any;
16
+ resume: {
17
+ link: any;
18
+ brief: any;
19
+ };
20
+ }>;
21
+ getAvailableScheduleClinics: () => Promise<{
22
+ specialties: any;
23
+ specialtiesER: any;
24
+ professionals: any;
25
+ }>;
26
+ declareUser: (params: {
27
+ user: {
28
+ firstName: string;
29
+ lastName: string;
30
+ identificationType: "ndi" | "passport" | "credential";
31
+ identificationValue: string;
32
+ countryId: string;
33
+ birthdate: Date;
34
+ gender: "m" | "f";
35
+ phone: string;
36
+ email: string;
37
+ };
38
+ } & {
39
+ code?: string | undefined;
40
+ channel?: "1" | "2" | undefined;
41
+ }) => Promise<{
42
+ patientId: number | null;
43
+ userInfo: {
44
+ phone: string;
45
+ email: string;
46
+ };
47
+ askCode: boolean;
48
+ userId: number;
49
+ }>;
50
+ getUserId: (user: {
51
+ firstName: string;
52
+ lastName: string;
53
+ identificationType: "ndi" | "passport" | "credential";
54
+ identificationValue: string;
55
+ countryId: string;
56
+ birthdate: Date;
57
+ gender: "m" | "f";
58
+ phone: string;
59
+ email: string;
60
+ }) => Promise<number>;
61
+ sendVerificationCode: (params: {
62
+ identificationType: "ndi" | "passport" | "credential";
63
+ identificationValue: string;
64
+ channel: "1" | "2";
65
+ }) => Promise<any>;
66
+ getUserInstance: (user: number | {
67
+ firstName: string;
68
+ lastName: string;
69
+ identificationType: "ndi" | "passport" | "credential";
70
+ identificationValue: string;
71
+ countryId: string;
72
+ birthdate: Date;
73
+ gender: "m" | "f";
74
+ phone: string;
75
+ email: string;
76
+ }) => Promise<any>;
77
+ enroll: (params: {
78
+ firstName: string;
79
+ lastName: string;
80
+ birthdate: Date;
81
+ gender: "m" | "f";
82
+ email: string;
83
+ startDate: Date;
84
+ identificationNumber: string;
85
+ plan: string;
86
+ }) => Promise<void>;
87
+ getConverageInfo: (identificationValue: string) => Promise<{
88
+ firstName: string | null;
89
+ lastName: string | null;
90
+ birthdate: Date;
91
+ gender: "m" | "f";
92
+ email: string | null;
93
+ identificationNumber: string;
94
+ plan: string | null;
95
+ financerId: number | null;
96
+ defaultAffiliationId: number | null;
97
+ credentialNumber: string | null;
98
+ financerPlanId: number | null;
99
+ brand: number | null;
100
+ holderIdentificationNumber: string | null;
101
+ copaymentValue: number | null;
102
+ mobilePhone: string | null;
103
+ company: string | null;
104
+ dischargeDate: Date | null;
105
+ leavingDate: Date | null;
106
+ identificacion_tributaria: string | null;
107
+ deregistrationDate: Date | null;
108
+ authorizationCode: string | null;
109
+ authorizationCodeExpiration: Date | null;
110
+ } | null>;
111
+ getDiagnosticaHistory: (patient: {
112
+ identificationType: "ndi" | "passport" | "credential";
113
+ identificationValue: string;
114
+ gender: "m" | "f";
115
+ }, from: Date, to: Date) => Promise<{
116
+ date: Date;
117
+ location: string;
118
+ exams: string[];
119
+ deepLink: string;
120
+ }[]>;
121
+ getDiagnosticaDeepLink: (kiosk: string, user: {
122
+ firstName: string;
123
+ lastName: string;
124
+ identificationType: "dni";
125
+ identificationValue: string;
126
+ gender: "m" | "f";
127
+ phone: string;
128
+ email: string;
129
+ language: string;
130
+ birthday: Date;
131
+ }, patient: {
132
+ firstName: string;
133
+ lastName: string;
134
+ identificationType: "dni";
135
+ identificationValue: string;
136
+ gender: "m" | "f";
137
+ birthday: Date;
138
+ }) => Promise<{
139
+ forwardingRequired: true;
140
+ deepLink: string;
141
+ } | {
142
+ forwardingRequired: false;
143
+ }>;
144
+ getDiagnosticaAccess: (kiosk: string, user: {
145
+ firstName: string;
146
+ lastName: string;
147
+ identificationType: "dni";
148
+ identificationValue: string;
149
+ gender: "m" | "f";
150
+ phone: string;
151
+ email: string;
152
+ language: string;
153
+ birthday: Date;
154
+ }, patient: {
155
+ firstName: string;
156
+ lastName: string;
157
+ identificationType: "dni";
158
+ identificationValue: string;
159
+ gender: "m" | "f";
160
+ birthday: Date;
161
+ }) => Promise<void>;
162
+ }>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBaseSdk = void 0;
4
+ const zod_1 = require("zod");
5
+ const request_1 = require("../request");
6
+ const validation_1 = require("../request/validation");
7
+ const schemas_1 = require("../schemas");
8
+ const utils_1 = require("../utils");
9
+ const diagnostica_1 = require("./diagnostica");
10
+ const user_1 = require("./user");
11
+ const getBaseSdk = async (url, credentials) => {
12
+ const makeRequest = await request_1.getRequestFactory(url, credentials);
13
+ const diagnosticaMethods = diagnostica_1.getDiagnosticaMethods(makeRequest);
14
+ const userMethods = user_1.getUserMethods(makeRequest, url, credentials);
15
+ const baseSdk = {
16
+ ...diagnosticaMethods,
17
+ ...userMethods,
18
+ getProfessional: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), schemas_1.doc24Schemas.professional, async (professionalId) => {
19
+ const path = `/professional/${professionalId}`;
20
+ const response = await makeRequest('GET', path);
21
+ const raw = response.data;
22
+ return {
23
+ id: raw.professional_id,
24
+ firstName: raw.name,
25
+ lastName: raw.lastname,
26
+ birthdate: utils_1.parseDate(raw.birthdate),
27
+ gender: raw.gender.toLowerCase(),
28
+ email: raw.email,
29
+ phone: raw.phone,
30
+ logoUrl: raw.image,
31
+ matriculation: raw.matriculation,
32
+ specialties: raw.specialties.map((s) => ({
33
+ id: s.specialty_id,
34
+ description: s.specialty,
35
+ })),
36
+ degree: raw.degree,
37
+ languages: raw.languages.map((l) => l.languages),
38
+ resume: {
39
+ link: raw.resume_link,
40
+ brief: raw.resume_brief,
41
+ },
42
+ };
43
+ }),
44
+ getAvailableScheduleClinics: validation_1.validateFunction(zod_1.tuple([]), schemas_1.doc24Schemas.availableScheduleClinics, async () => {
45
+ const path = `/schedule/clinics`;
46
+ const response = await makeRequest('GET', path);
47
+ const mapSpeciality = (s) => ({
48
+ id: s.id_especialidad,
49
+ description: s.especialidad,
50
+ });
51
+ const mapped = {
52
+ specialties: response.data.specialties.map(mapSpeciality),
53
+ specialtiesER: response.data.specialties_er.map(mapSpeciality),
54
+ professionals: response.data.professionals.map((p) => ({
55
+ id: p.id_profesional,
56
+ fullName: p.denominacion,
57
+ clinicId: p.id_consultorio,
58
+ specialties: p.especialidades.map(mapSpeciality),
59
+ })),
60
+ };
61
+ return mapped;
62
+ }),
63
+ };
64
+ return baseSdk;
65
+ };
66
+ exports.getBaseSdk = getBaseSdk;
@@ -0,0 +1,41 @@
1
+ export var __esModule: boolean;
2
+ export function getUserMethods(makeRequest: any, url: any, credentials: any): {
3
+ declareUser: (params_0?: {
4
+ user: any;
5
+ channel: any;
6
+ code: any;
7
+ }) => Promise<{
8
+ userId: any;
9
+ patientId: any;
10
+ userInfo: any;
11
+ askCode: any;
12
+ }>;
13
+ getUserId: (user?: any) => Promise<any>;
14
+ sendVerificationCode: (params?: any) => Promise<void>;
15
+ getUserInstance: (user?: any) => Promise<any>;
16
+ enroll: (params?: any) => Promise<void>;
17
+ getConverageInfo: (identificationValue?: any) => Promise<{
18
+ firstName: string | null;
19
+ lastName: string | null;
20
+ birthdate: Date;
21
+ gender: "m" | "f";
22
+ email: string | null;
23
+ identificationNumber: string;
24
+ plan: string | null;
25
+ financerId: number | null;
26
+ defaultAffiliationId: number | null;
27
+ credentialNumber: string | null;
28
+ financerPlanId: number | null;
29
+ brand: number | null;
30
+ holderIdentificationNumber: string | null;
31
+ copaymentValue: number | null;
32
+ mobilePhone: string | null;
33
+ company: string | null;
34
+ dischargeDate: Date | null;
35
+ leavingDate: Date | null;
36
+ identificacion_tributaria: string | null;
37
+ deregistrationDate: Date | null;
38
+ authorizationCode: string | null;
39
+ authorizationCodeExpiration: Date | null;
40
+ } | null>;
41
+ };