react-native-altibbi 0.1.1 → 0.1.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/README.md +3 -5
- package/package.json +1 -1
- package/src/connection.ts +143 -48
- package/src/index.tsx +25 -6
- package/src/service.ts +7 -7
- package/src/types.ts +178 -15
- package/lib/commonjs/connection.js +0 -200
- package/lib/commonjs/connection.js.map +0 -1
- package/lib/commonjs/data.js +0 -12
- package/lib/commonjs/data.js.map +0 -1
- package/lib/commonjs/index.js +0 -275
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/scoket.js +0 -245
- package/lib/commonjs/scoket.js.map +0 -1
- package/lib/commonjs/service.js +0 -21
- package/lib/commonjs/service.js.map +0 -1
- package/lib/commonjs/types.js +0 -2
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/video/OT.js +0 -57
- package/lib/commonjs/video/OT.js.map +0 -1
- package/lib/commonjs/video/OTError.js +0 -17
- package/lib/commonjs/video/OTError.js.map +0 -1
- package/lib/commonjs/video/OTPublisher.js +0 -171
- package/lib/commonjs/video/OTPublisher.js.map +0 -1
- package/lib/commonjs/video/OTSession.js +0 -205
- package/lib/commonjs/video/OTSession.js.map +0 -1
- package/lib/commonjs/video/OTSubscriber.js +0 -185
- package/lib/commonjs/video/OTSubscriber.js.map +0 -1
- package/lib/commonjs/video/contexts/OTContext.js +0 -11
- package/lib/commonjs/video/contexts/OTContext.js.map +0 -1
- package/lib/commonjs/video/helpers/OTHelper.js +0 -92
- package/lib/commonjs/video/helpers/OTHelper.js.map +0 -1
- package/lib/commonjs/video/helpers/OTPublisherHelper.js +0 -117
- package/lib/commonjs/video/helpers/OTPublisherHelper.js.map +0 -1
- package/lib/commonjs/video/helpers/OTSessionHelper.js +0 -206
- package/lib/commonjs/video/helpers/OTSessionHelper.js.map +0 -1
- package/lib/commonjs/video/helpers/OTSubscriberHelper.js +0 -121
- package/lib/commonjs/video/helpers/OTSubscriberHelper.js.map +0 -1
- package/lib/commonjs/video/index.js +0 -42
- package/lib/commonjs/video/index.js.map +0 -1
- package/lib/commonjs/video/views/OTPublisherView.js +0 -26
- package/lib/commonjs/video/views/OTPublisherView.js.map +0 -1
- package/lib/commonjs/video/views/OTSubscriberView.js +0 -25
- package/lib/commonjs/video/views/OTSubscriberView.js.map +0 -1
- package/lib/module/connection.js +0 -180
- package/lib/module/connection.js.map +0 -1
- package/lib/module/data.js +0 -6
- package/lib/module/data.js.map +0 -1
- package/lib/module/index.js +0 -12
- package/lib/module/index.js.map +0 -1
- package/lib/module/scoket.js +0 -235
- package/lib/module/scoket.js.map +0 -1
- package/lib/module/service.js +0 -14
- package/lib/module/service.js.map +0 -1
- package/lib/module/types.js +0 -2
- package/lib/module/types.js.map +0 -1
- package/lib/module/video/OT.js +0 -49
- package/lib/module/video/OT.js.map +0 -1
- package/lib/module/video/OTError.js +0 -10
- package/lib/module/video/OTError.js.map +0 -1
- package/lib/module/video/OTPublisher.js +0 -162
- package/lib/module/video/OTPublisher.js.map +0 -1
- package/lib/module/video/OTSession.js +0 -195
- package/lib/module/video/OTSession.js.map +0 -1
- package/lib/module/video/OTSubscriber.js +0 -175
- package/lib/module/video/OTSubscriber.js.map +0 -1
- package/lib/module/video/contexts/OTContext.js +0 -4
- package/lib/module/video/contexts/OTContext.js.map +0 -1
- package/lib/module/video/helpers/OTHelper.js +0 -82
- package/lib/module/video/helpers/OTHelper.js.map +0 -1
- package/lib/module/video/helpers/OTPublisherHelper.js +0 -110
- package/lib/module/video/helpers/OTPublisherHelper.js.map +0 -1
- package/lib/module/video/helpers/OTSessionHelper.js +0 -195
- package/lib/module/video/helpers/OTSessionHelper.js.map +0 -1
- package/lib/module/video/helpers/OTSubscriberHelper.js +0 -112
- package/lib/module/video/helpers/OTSubscriberHelper.js.map +0 -1
- package/lib/module/video/index.js +0 -7
- package/lib/module/video/index.js.map +0 -1
- package/lib/module/video/views/OTPublisherView.js +0 -18
- package/lib/module/video/views/OTPublisherView.js.map +0 -1
- package/lib/module/video/views/OTSubscriberView.js +0 -17
- package/lib/module/video/views/OTSubscriberView.js.map +0 -1
- package/lib/typescript/src/connection.d.ts +0 -40
- package/lib/typescript/src/connection.d.ts.map +0 -1
- package/lib/typescript/src/data.d.ts +0 -7
- package/lib/typescript/src/data.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -12
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/scoket.d.ts +0 -100
- package/lib/typescript/src/scoket.d.ts.map +0 -1
- package/lib/typescript/src/service.d.ts +0 -9
- package/lib/typescript/src/service.d.ts.map +0 -1
- package/lib/typescript/src/types.d.ts +0 -22
- package/lib/typescript/src/types.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
This
|
|
2
|
-
|
|
1
|
+
This React native SDK provides integration for the Altibbi services, including video consultation, text consultation, push
|
|
2
|
+
Welcome to the React Native SDK for Altibbi services, your comprehensive solution for integrating health consultation services into your React Native applications. This SDK enables video and text consultations, push notifications, and many other features to provide a seamless healthcare experience.
|
|
3
3
|
project.
|
|
4
4
|
|
|
5
5
|
|
|
@@ -14,8 +14,6 @@ project.
|
|
|
14
14
|
- React Native 0.60 or higher
|
|
15
15
|
- Node.js 16 or higher
|
|
16
16
|
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
17
|
## Installation
|
|
20
18
|
Install the SDK with npm:
|
|
21
19
|
|
|
@@ -39,7 +37,7 @@ Initialize the Altibbi SDK with the following parameters:
|
|
|
39
37
|
```js
|
|
40
38
|
import { init } from 'react-native-altibbi';
|
|
41
39
|
|
|
42
|
-
init('
|
|
40
|
+
init('TOKEN', 'PARTNER_ENDPOINT', 'LANGUAGE');
|
|
43
41
|
```
|
|
44
42
|
|
|
45
43
|
|
package/package.json
CHANGED
package/src/connection.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TBIConstants } from './service';
|
|
2
|
-
import { UserType } from './types';
|
|
2
|
+
import { ConsultationType, MediaType, ResponseType, UserType } from './types';
|
|
3
3
|
|
|
4
4
|
interface MethodsObject {
|
|
5
5
|
get: string;
|
|
@@ -11,7 +11,7 @@ interface MethodsObject {
|
|
|
11
11
|
interface ConsultationObject {
|
|
12
12
|
question: string;
|
|
13
13
|
medium: string;
|
|
14
|
-
|
|
14
|
+
user_id: number;
|
|
15
15
|
mediaIds?: string[];
|
|
16
16
|
followUpId?: string;
|
|
17
17
|
}
|
|
@@ -64,9 +64,9 @@ export const request = async ({
|
|
|
64
64
|
fileName,
|
|
65
65
|
download,
|
|
66
66
|
}: RequestParamsInterface) => {
|
|
67
|
-
if (!TBIConstants.
|
|
67
|
+
if (!TBIConstants.baseURL) {
|
|
68
68
|
return {
|
|
69
|
-
message: 'Add your
|
|
69
|
+
message: 'Add your baseURL to Init',
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -76,7 +76,7 @@ export const request = async ({
|
|
|
76
76
|
'accept-language': TBIConstants.language,
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
let url = `${TBIConstants.
|
|
79
|
+
let url = `${TBIConstants.baseURL}/v1/${endPoint}`;
|
|
80
80
|
let body;
|
|
81
81
|
if (method === Methods.get) {
|
|
82
82
|
url = url + '?' + new URLSearchParams(data).toString();
|
|
@@ -115,81 +115,138 @@ export const request = async ({
|
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
export const getUser = (
|
|
119
|
-
|
|
118
|
+
export const getUser = async (
|
|
119
|
+
user_id: string
|
|
120
|
+
): Promise<ResponseType<UserType>> => {
|
|
121
|
+
const response: ResponseType<UserType> = await request({
|
|
120
122
|
method: Methods.get,
|
|
121
123
|
data: {},
|
|
122
|
-
endPoint: `users/${
|
|
124
|
+
endPoint: `users/${user_id}`,
|
|
123
125
|
});
|
|
126
|
+
if (response.status === 200) {
|
|
127
|
+
return response;
|
|
128
|
+
}
|
|
129
|
+
throw Error(JSON.stringify(response));
|
|
130
|
+
};
|
|
124
131
|
|
|
125
|
-
export const getUsers = (
|
|
126
|
-
|
|
132
|
+
export const getUsers = async (
|
|
133
|
+
page: number = 1,
|
|
134
|
+
perPage: number = 20
|
|
135
|
+
): Promise<ResponseType<UserType[]>> => {
|
|
136
|
+
const response: ResponseType<UserType[]> = await request({
|
|
127
137
|
method: Methods.get,
|
|
128
138
|
data: { page, 'per-page': perPage },
|
|
129
139
|
endPoint: `users`,
|
|
130
140
|
});
|
|
141
|
+
if (response.status === 200) {
|
|
142
|
+
return response;
|
|
143
|
+
}
|
|
144
|
+
throw Error(JSON.stringify(response));
|
|
145
|
+
};
|
|
131
146
|
|
|
132
|
-
export const createUser = (
|
|
133
|
-
|
|
147
|
+
export const createUser = async (
|
|
148
|
+
user: UserType
|
|
149
|
+
): Promise<ResponseType<UserType>> => {
|
|
150
|
+
const response: ResponseType<UserType> = await request({
|
|
134
151
|
method: Methods.post,
|
|
135
152
|
data: user,
|
|
136
153
|
endPoint: `users`,
|
|
137
154
|
});
|
|
138
|
-
|
|
139
|
-
|
|
155
|
+
if (response.status === 201) {
|
|
156
|
+
return response;
|
|
157
|
+
}
|
|
158
|
+
throw Error(JSON.stringify(response));
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const updateUser = async (
|
|
162
|
+
user: UserType,
|
|
163
|
+
user_id: string
|
|
164
|
+
): Promise<ResponseType<UserType>> => {
|
|
165
|
+
const response: ResponseType<UserType> = await request({
|
|
140
166
|
method: Methods.put,
|
|
141
167
|
data: user,
|
|
142
|
-
endPoint: `users/${
|
|
168
|
+
endPoint: `users/${user_id}`,
|
|
143
169
|
});
|
|
170
|
+
if (response.status === 201) {
|
|
171
|
+
return response;
|
|
172
|
+
}
|
|
173
|
+
throw Error(JSON.stringify(response));
|
|
174
|
+
};
|
|
144
175
|
|
|
145
|
-
export const deleteUser = (
|
|
146
|
-
|
|
176
|
+
export const deleteUser = async (
|
|
177
|
+
user_id: string
|
|
178
|
+
): Promise<ResponseType<string>> => {
|
|
179
|
+
const response: ResponseType<string> = await request({
|
|
147
180
|
method: Methods.delete,
|
|
148
181
|
data: {},
|
|
149
|
-
endPoint: `users/${
|
|
182
|
+
endPoint: `users/${user_id}`,
|
|
150
183
|
});
|
|
184
|
+
if (response.status === 204) {
|
|
185
|
+
return response;
|
|
186
|
+
}
|
|
187
|
+
throw Error(JSON.stringify(response));
|
|
188
|
+
};
|
|
151
189
|
|
|
152
190
|
export const createConsultation = async ({
|
|
153
191
|
question,
|
|
154
192
|
medium,
|
|
155
|
-
|
|
193
|
+
user_id,
|
|
156
194
|
mediaIds,
|
|
157
195
|
followUpId,
|
|
158
|
-
}: ConsultationObject) => {
|
|
159
|
-
if (!question || !medium || !
|
|
160
|
-
|
|
196
|
+
}: ConsultationObject): Promise<ResponseType<ConsultationType>> => {
|
|
197
|
+
if (!question || !medium || !user_id) {
|
|
198
|
+
throw Error('missing field');
|
|
161
199
|
}
|
|
162
200
|
|
|
163
201
|
const data = {
|
|
164
202
|
question,
|
|
165
203
|
medium,
|
|
166
|
-
user_id
|
|
204
|
+
user_id,
|
|
167
205
|
media_ids: mediaIds,
|
|
168
206
|
expand:
|
|
169
207
|
'pusherAppKey,parentConsultation,consultations,user,media,pusherChannel,' +
|
|
170
208
|
'chatConfig,chatHistory,voipConfig,videoConfig,recommendation',
|
|
171
209
|
followUpId,
|
|
172
210
|
};
|
|
173
|
-
|
|
211
|
+
const response: ResponseType<ConsultationType> = await request({
|
|
174
212
|
method: Methods.post,
|
|
175
213
|
data,
|
|
176
214
|
endPoint: `consultations`,
|
|
177
215
|
});
|
|
216
|
+
|
|
217
|
+
if (response.status === 201) {
|
|
218
|
+
return response;
|
|
219
|
+
}
|
|
220
|
+
throw Error(JSON.stringify(response));
|
|
178
221
|
};
|
|
179
222
|
|
|
180
|
-
export const getConsultationInfo = (
|
|
181
|
-
|
|
223
|
+
export const getConsultationInfo = async (
|
|
224
|
+
consultation_id: number
|
|
225
|
+
): Promise<ResponseType<ConsultationType>> => {
|
|
226
|
+
const response: ResponseType<ConsultationType> = await request({
|
|
182
227
|
method: Methods.get,
|
|
183
228
|
data: {
|
|
184
229
|
expand:
|
|
185
230
|
'pusherAppKey,parentConsultation,consultations,user,media,pusherChannel,' +
|
|
186
231
|
'chatConfig,chatHistory,voipConfig,videoConfig,recommendation',
|
|
187
232
|
},
|
|
188
|
-
endPoint: `consultations/${
|
|
233
|
+
endPoint: `consultations/${consultation_id}`,
|
|
189
234
|
});
|
|
235
|
+
if (response.status === 200) {
|
|
236
|
+
response.data.socketParams = {
|
|
237
|
+
apiKey: response?.data?.[0]?.pusherAppKey,
|
|
238
|
+
cluster: 'eu',
|
|
239
|
+
authEndpoint: `${TBIConstants.baseURL}/v1/auth/pusher?access-token=${TBIConstants.token}`,
|
|
240
|
+
};
|
|
241
|
+
return response;
|
|
242
|
+
}
|
|
243
|
+
throw Error(JSON.stringify(response));
|
|
244
|
+
};
|
|
190
245
|
|
|
191
|
-
export const getLastConsultation = ()
|
|
192
|
-
|
|
246
|
+
export const getLastConsultation = async (): Promise<
|
|
247
|
+
ResponseType<ConsultationType[]>
|
|
248
|
+
> => {
|
|
249
|
+
const response: ResponseType<ConsultationType[]> = await request({
|
|
193
250
|
method: Methods.get,
|
|
194
251
|
data: {
|
|
195
252
|
'per-page': 1,
|
|
@@ -200,46 +257,79 @@ export const getLastConsultation = () =>
|
|
|
200
257
|
},
|
|
201
258
|
endPoint: `consultations`,
|
|
202
259
|
});
|
|
260
|
+
if (response.status === 200) {
|
|
261
|
+
response.data[0].socketParams = {
|
|
262
|
+
apiKey: response.data[0].pusherAppKey,
|
|
263
|
+
cluster: 'eu',
|
|
264
|
+
authEndpoint: `${TBIConstants.baseURL}/v1/auth/pusher?access-token=${TBIConstants.token}`,
|
|
265
|
+
};
|
|
266
|
+
return response;
|
|
267
|
+
}
|
|
268
|
+
throw Error(JSON.stringify(response));
|
|
269
|
+
};
|
|
203
270
|
|
|
204
271
|
export const getConsultationList = async (
|
|
205
|
-
|
|
272
|
+
user_id: number,
|
|
206
273
|
page: number = 1,
|
|
207
274
|
perPage = 20
|
|
208
|
-
) => {
|
|
209
|
-
if (!
|
|
210
|
-
|
|
275
|
+
): Promise<ResponseType<ConsultationType[]>> => {
|
|
276
|
+
if (!user_id) {
|
|
277
|
+
throw Error('missing user id');
|
|
211
278
|
}
|
|
212
279
|
|
|
213
|
-
|
|
280
|
+
const response = await request({
|
|
214
281
|
method: Methods.get,
|
|
215
282
|
data: {
|
|
216
283
|
page,
|
|
217
284
|
'per-page': perPage,
|
|
218
|
-
'filter[user_id]':
|
|
285
|
+
'filter[user_id]': user_id,
|
|
219
286
|
'expand':
|
|
220
287
|
'pusherAppKey,parentConsultation,consultations,user,media,pusherChannel,' +
|
|
221
288
|
'chatConfig,chatHistory,voipConfig,videoConfig,recommendation',
|
|
222
289
|
},
|
|
223
290
|
endPoint: `consultations`,
|
|
224
291
|
});
|
|
292
|
+
if (response.status === 200) {
|
|
293
|
+
return response;
|
|
294
|
+
}
|
|
295
|
+
throw Error(JSON.stringify(response));
|
|
225
296
|
};
|
|
226
297
|
|
|
227
|
-
export const deleteConsultation = (
|
|
228
|
-
|
|
298
|
+
export const deleteConsultation = async (
|
|
299
|
+
consultation_id: number
|
|
300
|
+
): Promise<ResponseType<string>> => {
|
|
301
|
+
const response: ResponseType<string> = await request({
|
|
229
302
|
method: Methods.delete,
|
|
230
303
|
data: {},
|
|
231
|
-
endPoint: `consultations/${
|
|
304
|
+
endPoint: `consultations/${consultation_id}`,
|
|
232
305
|
});
|
|
306
|
+
if (response.status === 204) {
|
|
307
|
+
return response;
|
|
308
|
+
}
|
|
309
|
+
throw Error(JSON.stringify(response));
|
|
310
|
+
};
|
|
233
311
|
|
|
234
|
-
export const cancelConsultation = (
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
312
|
+
export const cancelConsultation = async (
|
|
313
|
+
consultation_id: number
|
|
314
|
+
): Promise<ResponseType<{ consultation_id: number; status: string }>> => {
|
|
315
|
+
const response: ResponseType<{ consultation_id: number; status: string }> =
|
|
316
|
+
await request({
|
|
317
|
+
method: Methods.post,
|
|
318
|
+
data: {},
|
|
319
|
+
endPoint: `consultations/${consultation_id}/cancel`,
|
|
320
|
+
});
|
|
321
|
+
if (response.status === 200) {
|
|
322
|
+
return response;
|
|
323
|
+
}
|
|
324
|
+
throw Error(JSON.stringify(response));
|
|
325
|
+
};
|
|
240
326
|
|
|
241
|
-
export const uploadMedia = (
|
|
242
|
-
|
|
327
|
+
export const uploadMedia = async (
|
|
328
|
+
path: string,
|
|
329
|
+
type: string,
|
|
330
|
+
fileName: string
|
|
331
|
+
): Promise<ResponseType<MediaType>> => {
|
|
332
|
+
const response: ResponseType<MediaType> = await request({
|
|
243
333
|
method: Methods.post,
|
|
244
334
|
endPoint: `media`,
|
|
245
335
|
data: {},
|
|
@@ -247,10 +337,15 @@ export const uploadMedia = (path: string, type: string, fileName: string) =>
|
|
|
247
337
|
type,
|
|
248
338
|
fileName,
|
|
249
339
|
});
|
|
340
|
+
if (response.status === 200) {
|
|
341
|
+
return response;
|
|
342
|
+
}
|
|
343
|
+
throw Error(JSON.stringify(response));
|
|
344
|
+
};
|
|
250
345
|
|
|
251
|
-
export const getPrescription = (
|
|
346
|
+
export const getPrescription = (consultation_id: number) =>
|
|
252
347
|
request({
|
|
253
348
|
method: Methods.get,
|
|
254
|
-
endPoint: `consultations/${
|
|
349
|
+
endPoint: `consultations/${consultation_id}/download-prescription`,
|
|
255
350
|
download: true,
|
|
256
351
|
});
|
package/src/index.tsx
CHANGED
|
@@ -63,13 +63,32 @@ export {
|
|
|
63
63
|
type TBISocketAuthorizerResult,
|
|
64
64
|
} from './scoket';
|
|
65
65
|
|
|
66
|
-
export {
|
|
66
|
+
export type {
|
|
67
|
+
ResponseType,
|
|
68
|
+
MediumType,
|
|
69
|
+
BloodType,
|
|
70
|
+
MaritalStatus,
|
|
71
|
+
BoolString,
|
|
72
|
+
GenderType,
|
|
67
73
|
UserType,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
MediaType,
|
|
75
|
+
ChatData,
|
|
76
|
+
ChatHistory,
|
|
77
|
+
ChatConfig,
|
|
78
|
+
VoipConfig,
|
|
79
|
+
Recommendation,
|
|
80
|
+
RecommendationData,
|
|
81
|
+
RecommendationLab,
|
|
82
|
+
RecommendationLabItem,
|
|
83
|
+
RecommendationDrug,
|
|
84
|
+
RecommendationFdaDrug,
|
|
85
|
+
RecommendationICD10,
|
|
86
|
+
RecommendationSymptom,
|
|
87
|
+
RecommendationDiagnosis,
|
|
88
|
+
RecommendationFollowUp,
|
|
89
|
+
RecommendationDoctorReferral,
|
|
90
|
+
RecommendationPostCallAnswer,
|
|
91
|
+
ConsultationType,
|
|
73
92
|
} from './types';
|
|
74
93
|
export {
|
|
75
94
|
materialStatusArray,
|
package/src/service.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
interface ConstantObject {
|
|
2
|
-
domain: string;
|
|
3
|
-
language: string;
|
|
4
2
|
token: string;
|
|
3
|
+
baseURL: string;
|
|
4
|
+
language: string;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export let TBIConstants: ConstantObject = {
|
|
8
|
-
domain: '',
|
|
9
|
-
language: 'ar',
|
|
10
8
|
token: '',
|
|
9
|
+
baseURL: '',
|
|
10
|
+
language: 'ar',
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const init = (
|
|
13
|
+
export const init = (token: string, baseURL: string, language: string) => {
|
|
14
14
|
TBIConstants = {
|
|
15
|
-
domain,
|
|
16
|
-
language,
|
|
17
15
|
token,
|
|
16
|
+
baseURL,
|
|
17
|
+
language,
|
|
18
18
|
};
|
|
19
19
|
};
|
package/src/types.ts
CHANGED
|
@@ -1,22 +1,185 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
type MediumType = 'chat' | 'gsm' | 'voip' | 'video';
|
|
2
|
+
type BloodType = 'A+' | 'B+' | 'AB+' | 'O+' | 'A-' | 'B-' | 'AB-' | 'O-';
|
|
3
|
+
type MaritalStatus = 'single' | 'married' | 'divorced' | 'widow';
|
|
4
|
+
type BoolString = 'yes' | 'no';
|
|
5
|
+
type GenderType = 'male' | 'female';
|
|
6
|
+
interface UserType {
|
|
7
|
+
id?: number;
|
|
8
|
+
name?: string;
|
|
9
|
+
phone_number?: string;
|
|
9
10
|
email?: string;
|
|
10
|
-
|
|
11
|
+
date_of_birth?: string;
|
|
11
12
|
gender?: GenderType;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
insurance_id?: string;
|
|
14
|
+
policy_number?: string;
|
|
15
|
+
nationality_number?: string;
|
|
15
16
|
height?: string;
|
|
16
17
|
weight?: string;
|
|
17
|
-
|
|
18
|
+
blood_type?: BloodType;
|
|
18
19
|
smoker?: BoolString;
|
|
19
20
|
alcoholic?: BoolString;
|
|
20
|
-
|
|
21
|
+
marital_status?: MaritalStatus;
|
|
22
|
+
created_at?: string;
|
|
23
|
+
updated_at?: string;
|
|
24
|
+
}
|
|
25
|
+
interface MediaType {
|
|
26
|
+
id?: string;
|
|
27
|
+
type?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
path?: string;
|
|
30
|
+
extension?: string;
|
|
31
|
+
url?: string;
|
|
32
|
+
size?: number;
|
|
33
|
+
}
|
|
34
|
+
interface SocketParams {
|
|
35
|
+
apiKey?: string;
|
|
36
|
+
cluster?: string;
|
|
37
|
+
authEndpoint?: string;
|
|
38
|
+
}
|
|
39
|
+
interface ResponseType<T> {
|
|
40
|
+
status: number;
|
|
41
|
+
data: T;
|
|
42
|
+
}
|
|
43
|
+
interface ChatData {
|
|
44
|
+
id?: string;
|
|
45
|
+
message?: string;
|
|
46
|
+
sent_at?: string;
|
|
47
|
+
chat_user_id?: string;
|
|
48
|
+
}
|
|
49
|
+
interface ChatHistory {
|
|
50
|
+
id?: number;
|
|
51
|
+
consultation_id?: number;
|
|
52
|
+
data?: ChatData[];
|
|
53
|
+
created_at?: string;
|
|
54
|
+
updated_at?: string;
|
|
55
|
+
}
|
|
56
|
+
interface ChatConfig {
|
|
57
|
+
id?: number;
|
|
58
|
+
consultation_id?: number;
|
|
59
|
+
group_id?: String;
|
|
60
|
+
chat_user_id?: String;
|
|
61
|
+
app_id?: String;
|
|
62
|
+
chat_user_token?: String;
|
|
63
|
+
}
|
|
64
|
+
interface VoipConfig {
|
|
65
|
+
id?: number;
|
|
66
|
+
consultation_id?: number;
|
|
67
|
+
apiKey?: string;
|
|
68
|
+
callId?: string;
|
|
69
|
+
token?: string;
|
|
70
|
+
}
|
|
71
|
+
interface Recommendation {
|
|
72
|
+
id?: number;
|
|
73
|
+
consultation_id?: number;
|
|
74
|
+
data?: RecommendationData;
|
|
75
|
+
created_at?: string;
|
|
76
|
+
updated_at?: string;
|
|
77
|
+
}
|
|
78
|
+
interface RecommendationData {
|
|
79
|
+
lab?: RecommendationLab;
|
|
80
|
+
drug?: RecommendationDrug;
|
|
81
|
+
icd10?: RecommendationICD10;
|
|
82
|
+
followUp?: RecommendationFollowUp[] | null;
|
|
83
|
+
doctorReferral?: RecommendationDoctorReferral;
|
|
84
|
+
postCallAnswer?: RecommendationPostCallAnswer[] | null;
|
|
85
|
+
}
|
|
86
|
+
interface RecommendationLab {
|
|
87
|
+
lab?: RecommendationLabItem[] | null;
|
|
88
|
+
panel?: RecommendationLabItem[] | null;
|
|
89
|
+
}
|
|
90
|
+
interface RecommendationLabItem {
|
|
91
|
+
name?: string;
|
|
92
|
+
}
|
|
93
|
+
interface RecommendationDrug {
|
|
94
|
+
fdaDrug?: RecommendationFdaDrug[] | null;
|
|
95
|
+
}
|
|
96
|
+
interface RecommendationFdaDrug {
|
|
97
|
+
name?: string;
|
|
98
|
+
dosage?: string;
|
|
99
|
+
duration?: number;
|
|
100
|
+
howToUse?: string;
|
|
101
|
+
frequency?: string;
|
|
102
|
+
tradeName?: string;
|
|
103
|
+
dosageForm?: string;
|
|
104
|
+
dosageUnit?: string;
|
|
105
|
+
packageSize?: string;
|
|
106
|
+
packageType?: string;
|
|
107
|
+
strengthValue?: string;
|
|
108
|
+
relationWithFood?: string;
|
|
109
|
+
specialInstructions?: string;
|
|
110
|
+
routeOfAdministration?: string;
|
|
111
|
+
}
|
|
112
|
+
interface RecommendationICD10 {
|
|
113
|
+
symptom?: RecommendationSymptom[] | null;
|
|
114
|
+
diagnosis?: RecommendationDiagnosis[] | null;
|
|
115
|
+
}
|
|
116
|
+
interface RecommendationSymptom {
|
|
117
|
+
code?: string;
|
|
118
|
+
name?: string;
|
|
119
|
+
}
|
|
120
|
+
interface RecommendationDiagnosis {
|
|
121
|
+
code?: string;
|
|
122
|
+
name?: string;
|
|
123
|
+
}
|
|
124
|
+
interface RecommendationFollowUp {
|
|
125
|
+
name?: string;
|
|
126
|
+
}
|
|
127
|
+
interface RecommendationDoctorReferral {
|
|
128
|
+
name?: string;
|
|
129
|
+
}
|
|
130
|
+
interface RecommendationPostCallAnswer {
|
|
131
|
+
answer?: string;
|
|
132
|
+
question?: string;
|
|
133
|
+
}
|
|
134
|
+
interface ConsultationType {
|
|
135
|
+
id?: number;
|
|
136
|
+
userId?: number;
|
|
137
|
+
question?: string;
|
|
138
|
+
doctorName?: string;
|
|
139
|
+
doctorAvatar?: string;
|
|
140
|
+
medium?: string;
|
|
141
|
+
status?: string;
|
|
142
|
+
isFulfilled?: number;
|
|
143
|
+
parentConsultationId?: number;
|
|
144
|
+
createdAt?: string;
|
|
145
|
+
updatedAt?: string;
|
|
146
|
+
user?: UserType;
|
|
147
|
+
parentConsultation?: ConsultationType;
|
|
148
|
+
media?: MediaType[];
|
|
149
|
+
consultations?: ConsultationType[];
|
|
150
|
+
pusherChannel?: string;
|
|
151
|
+
pusherAppKey?: string;
|
|
152
|
+
chatConfig?: ChatConfig;
|
|
153
|
+
voipConfig?: VoipConfig;
|
|
154
|
+
videoConfig?: VoipConfig;
|
|
155
|
+
chatHistory: ChatHistory;
|
|
156
|
+
recommendation?: Recommendation;
|
|
157
|
+
socketParams?: SocketParams;
|
|
21
158
|
}
|
|
22
|
-
|
|
159
|
+
export type {
|
|
160
|
+
ResponseType,
|
|
161
|
+
MediumType,
|
|
162
|
+
BloodType,
|
|
163
|
+
MaritalStatus,
|
|
164
|
+
BoolString,
|
|
165
|
+
GenderType,
|
|
166
|
+
UserType,
|
|
167
|
+
MediaType,
|
|
168
|
+
ChatData,
|
|
169
|
+
ChatHistory,
|
|
170
|
+
ChatConfig,
|
|
171
|
+
VoipConfig,
|
|
172
|
+
Recommendation,
|
|
173
|
+
RecommendationData,
|
|
174
|
+
RecommendationLab,
|
|
175
|
+
RecommendationLabItem,
|
|
176
|
+
RecommendationDrug,
|
|
177
|
+
RecommendationFdaDrug,
|
|
178
|
+
RecommendationICD10,
|
|
179
|
+
RecommendationSymptom,
|
|
180
|
+
RecommendationDiagnosis,
|
|
181
|
+
RecommendationFollowUp,
|
|
182
|
+
RecommendationDoctorReferral,
|
|
183
|
+
RecommendationPostCallAnswer,
|
|
184
|
+
ConsultationType,
|
|
185
|
+
};
|