oro-sdk-apis 1.28.0 → 1.29.0-dev1

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.
@@ -1,5 +1,5 @@
1
1
  import { APIService } from './api';
2
- import { Uuid, Consult, ConsultRequest, MedicalStatus, ConsultTransmission, TransmissionStatus } from '../models';
2
+ import { Uuid, Consult, ConsultRequest, MedicalStatus, ConsultTransmission, ClosedReasonType, TransmissionStatus } from '../models';
3
3
  export declare class ConsultService {
4
4
  private api;
5
5
  private baseURL;
@@ -22,7 +22,7 @@ export declare class ConsultService {
22
22
  * @param filterAssignee array of practitioner uuids with which you want to filter the consultations
23
23
  * @returns a number of consult
24
24
  */
25
- countConsults(uuidPractice?: Uuid, uuidRequester?: Uuid, statusesMedical?: MedicalStatus[], statusesExclude?: MedicalStatus[], shortId?: string, columnToSortTo?: string[], orderToSortTo?: string[], perPage?: number, indexPage?: number, filterAssignedDoctor?: string, filterCurrentPractitioner?: string, filterIsoLocality?: string[], filterAssignee?: string[]): Promise<number>;
25
+ countConsults(uuidPractice?: Uuid, uuidRequester?: Uuid, statusesMedical?: MedicalStatus[], statusesExclude?: MedicalStatus[], closedReasonTypes?: ClosedReasonType[], closedReasonMsgs?: string[], shortId?: string, columnToSortTo?: string[], orderToSortTo?: string[], perPage?: number, indexPage?: number, filterAssignedDoctor?: string, filterCurrentPractitioner?: string, filterIsoLocality?: string[], filterAssignee?: string[]): Promise<number>;
26
26
  /**
27
27
  * This function get consults using parameters
28
28
  * @param uuidPractice the practice uuid
@@ -39,10 +39,12 @@ export declare class ConsultService {
39
39
  * @param filterIsoLocality the of isoLocality to filter with
40
40
  * @returns a list of consult
41
41
  */
42
- getConsults(uuidPractice?: Uuid, uuidRequester?: Uuid, statusesMedical?: MedicalStatus[], statusesExclude?: MedicalStatus[], shortId?: string, columnToSortTo?: string[], orderToSortTo?: string[], perPage?: number, indexPage?: number, filterAssignedDoctor?: string, filterCurrentPractitioner?: string, filterIsoLocality?: string[], filterAssignee?: string[]): Promise<Consult[]>;
42
+ getConsults(uuidPractice?: Uuid, uuidRequester?: Uuid, statusesMedical?: MedicalStatus[], statusesExclude?: MedicalStatus[], closedReasonTypes?: ClosedReasonType[], closedReasonMsgs?: string[], shortId?: string, columnToSortTo?: string[], orderToSortTo?: string[], perPage?: number, indexPage?: number, filterAssignedDoctor?: string, filterCurrentPractitioner?: string, filterIsoLocality?: string[], filterAssignee?: string[]): Promise<Consult[]>;
43
43
  getConsultByUUID(uuidConsult: Uuid, uuidPractice?: Uuid): Promise<Consult>;
44
44
  updateConsultByUUID(uuidConsult: Uuid, consult: {
45
45
  statusMedical?: MedicalStatus;
46
+ closedReasonType?: ClosedReasonType;
47
+ closedReasonMsg?: string;
46
48
  uuidAssignedDoctor?: Uuid;
47
49
  neverExpires?: boolean;
48
50
  }, uuidPractice?: Uuid, uuidRequester?: Uuid): Promise<Consult>;
@@ -1,11 +1,11 @@
1
1
  import { APIService } from './api';
2
- import { Consult, DataCreateResponse, LockboxDataRequest, MedicalStatus, Uuid, ResumeConsultEmailRequest } from '../models';
2
+ import { Consult, DataCreateResponse, LockboxDataRequest, MedicalStatus, Uuid, ResumeConsultEmailRequest, ClosedReasonType } from '../models';
3
3
  export declare class TellerService {
4
4
  private api;
5
5
  private baseURL;
6
6
  constructor(api: APIService, baseURL: string);
7
7
  lockboxDataStore(lockboxUuid: Uuid, req: LockboxDataRequest, lockboxOwnerUuid?: Uuid, previousDataUuid?: Uuid): Promise<DataCreateResponse>;
8
- updateConsultByUUID(patientUuid: Uuid, uuidConsult: Uuid, statusMedical: MedicalStatus, neverExpires?: boolean): Promise<Consult>;
8
+ updateConsultByUUID(patientUuid: Uuid, uuidConsult: Uuid, statusMedical: MedicalStatus, closedReasonType?: ClosedReasonType, closedReasonMsg?: string, neverExpires?: boolean): Promise<Consult>;
9
9
  /**
10
10
  * This function notifies teller that the fax sent for a specific consult did not get through
11
11
  * @todo - Make service only exposed route
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.28.0",
2
+ "version": "1.29.0-dev1",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
@@ -82,6 +82,14 @@ export enum TaskStatus {
82
82
  Done = 'Done',
83
83
  }
84
84
 
85
+ export enum ClosedReasonType {
86
+ Completed = "Completed",
87
+ NotADisease = "NotADisease",
88
+ NotAppropriateForVirtual = "NotAppropriateForVirtual",
89
+ Other = "Other",
90
+ RequiresInPerson = "RequiresInPerson"
91
+ }
92
+
85
93
  export interface ConsultRequest {
86
94
  uuidPractice: string
87
95
  tagSpecialtyRequired: string
@@ -102,6 +110,8 @@ export interface Consult {
102
110
  uuidAssignedDoctor: string
103
111
  uuidCurrentAssigned: string
104
112
  statusTask?: TaskStatus
113
+ closedReasonType?: ClosedReasonType
114
+ closedReasonMsg?: string
105
115
  hasTransmissions?: boolean
106
116
  assignedAssistant?: ConsultAssignedAssistant[]
107
117
  shortId?: string
@@ -122,85 +122,194 @@ export interface PracticeAccount {
122
122
  urlSubdomain?: string
123
123
  }
124
124
 
125
+ /**
126
+ * Defines all the practice config kind.
127
+ *
128
+ * Please respect the following when defining a new practice config:
129
+ * - be really specific on its role
130
+ * - all configs needs to have default values in app
131
+ * - the default behavior should always to be display the feature.
132
+ * In other words, practice configs should either be used to hide a functionnality or overwrite a default behavior.
133
+ * To be extra explicit, if you want to show a functionnality only in one practice, you will have to add a practice configs in all other practice to hide it (yes it is cumbersome).
134
+ *
135
+ */
125
136
  export enum PracticeConfigKind {
126
- PractitionerConsultList = 'PractitionerConsultList',
127
- PractitionerChatbox = 'PractitionerChatbox',
137
+ PracticeCloseConsultationTypes = 'PracticeCloseConsultationTypes',
128
138
  PracticeConfigExample = 'PracticeConfigExample',
129
- PracticeLocaleSwitcher = 'PracticeLocaleSwitcher',
130
139
  PracticeCookieBanner = 'PracticeCookieBanner',
131
- PracticePharmacyPicker = 'PracticePharmacyPicker',
132
140
  PracticeCssVariables = 'PracticeCssVariables',
133
141
  PracticeFontsLinks = 'PracticeFontsLinks',
142
+ PracticeLocaleSwitcher = 'PracticeLocaleSwitcher',
143
+ PracticePharmacyPicker = 'PracticePharmacyPicker',
144
+ PractitionerChatbox = 'PractitionerChatbox',
145
+ PractitionerConsultList = 'PractitionerConsultList',
134
146
  }
135
147
 
148
+ /**
149
+ * Defines the close consultation types to hide in the close consultation modal of a practice
150
+ */
151
+ export type PracticeConfigPracticeCloseConsultationTypes = PracticeConfig<
152
+ PracticeConfigKind.PracticeCloseConsultationTypes,
153
+ {
154
+ /**
155
+ * Should hide item with value "Completed"
156
+ */
157
+ hideCompleted?: boolean
158
+
159
+ /**
160
+ * Should hide item with value "Requires-in-person"
161
+ */
162
+ hideRequiresInPerson?: boolean
163
+
164
+ /**
165
+ * Should hide item with value "Other"
166
+ */
167
+ hideOther?: boolean
168
+
169
+ /**
170
+ * Should hide item with value "Not-a-disease"
171
+ */
172
+ hideNotADisease?: boolean
173
+
174
+ /**
175
+ * Should hide item with value "Appropriate-for-virtual"
176
+ */
177
+ hideNotAppropriateForVirtual?: boolean
178
+ }
179
+ >
180
+
181
+ /**
182
+ * Generic interface of a practice config
183
+ *
184
+ * Practice configs needs to have a JSDoc for **all** interface and fields.
185
+ *
186
+ */
136
187
  export interface PracticeConfig<K, T> {
188
+ /**
189
+ * The uuid of the practice to apply the config
190
+ */
137
191
  uuidPractice: string
138
- kind: K // PracticeConfigKind
192
+ /**
193
+ * The kind of the practice config. Used as a discriminator to help auto-completion.
194
+ */
195
+ kind: PracticeConfigKind
196
+ /**
197
+ * The actual interface of the config
198
+ */
139
199
  config: T
140
200
  }
141
201
 
142
- export type PracticeConfigPractitionerConsultList = PracticeConfig<
143
- PracticeConfigKind.PractitionerConsultList,
144
- {
145
- hideLocality?: boolean
146
- hideFax?: boolean
147
- hideExpiresAt?: boolean
148
- showExpirationInDays?: boolean
149
- }
202
+ /**
203
+ * This type is for test (do not remove without updating the integration tests)
204
+ */
205
+ export type PracticeConfigPracticeConfigExample = PracticeConfig<
206
+ PracticeConfigKind.PracticeConfigExample,
207
+ { primaryColor?: string }
150
208
  >
151
209
 
152
- export type PracticeConfigPracticeLocaleSwitcher = PracticeConfig<
153
- PracticeConfigKind.PracticeLocaleSwitcher,
154
- {
155
- hideLocaleSwitcher?: boolean
156
- }
210
+ /**
211
+ * Defines the practice cookie banner
212
+ */
213
+ export type PracticeConfigPracticeCookieBanner = PracticeConfig<
214
+ PracticeConfigKind.PracticeCookieBanner,
215
+ {
216
+ showCookieBanner?: boolean
217
+ policyLink?: string
218
+ useOfCookieLink?: string
219
+ }
157
220
  >
158
221
 
159
- export type PracticeConfigPractitionerChatbox = PracticeConfig<
160
- PracticeConfigKind.PractitionerChatbox,
161
- {
162
- planAddedMessage?: { [languageISO639_3: string]: string }
163
- planUpdatedMessage?: { [languageISO639_3: string]: string }
164
- examsUpdatedMessage?: { [languageISO639_3: string]: string }
165
- }
222
+ /**
223
+ * This interface describes all practice css variables
224
+ * The keys should reflect the exact css name
225
+ */
226
+ export type PracticeConfigPracticeCssVariables = PracticeConfig<
227
+ PracticeConfigKind.PracticeCssVariables,
228
+ Record<string, string>
166
229
  >
167
230
 
168
- export type PracticeConfigPracticeOnlinePharmacy = PracticeConfig<
169
- PracticeConfigKind.PracticePharmacyPicker,
170
- {
171
- onlinePharmacy?: PlaceData
172
- }
231
+ /**
232
+ * Defines the font of the practice css url
233
+ */
234
+ export type PracticeConfigPracticeFontsLinks = PracticeConfig<
235
+ PracticeConfigKind.PracticeFontsLinks,
236
+ {
237
+ /**
238
+ * sans serif font family
239
+ */
240
+ sansSerif?: string
241
+ /**
242
+ * serif font family
243
+ */
244
+ serif?: string
245
+ }
173
246
  >
174
247
 
175
- export type PracticeConfigPracticeCookieBanner = PracticeConfig<
176
- PracticeConfigKind.PracticeCookieBanner,
177
- {
178
- showCookieBanner?: boolean
179
- policyLink?: string
180
- useOfCookieLink?: string
181
- }
248
+ /**
249
+ * Defines the locale switcher config
250
+ */
251
+ export type PracticeConfigPracticeLocaleSwitcher = PracticeConfig<
252
+ PracticeConfigKind.PracticeLocaleSwitcher,
253
+ {
254
+ /**
255
+ * Should hide the locale switcher
256
+ */
257
+ hideLocaleSwitcher?: boolean
258
+ }
182
259
  >
183
260
 
184
- // This type is for demonstration only for now
185
- export type PracticeConfigPracticeConfigExample = PracticeConfig<
186
- PracticeConfigKind.PracticeConfigExample,
187
- { primaryColor?: string }
261
+ /**
262
+ * Defines the online pharmacy address of the practice
263
+ */
264
+ export type PracticeConfigPracticeOnlinePharmacy = PracticeConfig<
265
+ PracticeConfigKind.PracticePharmacyPicker,
266
+ {
267
+ /**
268
+ * The address of the online pharmacy
269
+ */
270
+ onlinePharmacy?: PlaceData
271
+ }
188
272
  >
189
273
 
190
274
  /**
191
- * This interface describes all practice css variables
192
- * The keys should reflect the exact css name
275
+ * Defines the consultation chatbox configs
193
276
  */
194
- export type PracticeConfigPracticeCssVariables = PracticeConfig<
195
- PracticeConfigKind.PracticeCssVariables,
196
- Record<string, string>
277
+ export type PracticeConfigPractitionerChatbox = PracticeConfig<
278
+ PracticeConfigKind.PractitionerChatbox,
279
+ {
280
+ /**
281
+ * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been added. Indexed by locale.
282
+ */
283
+ planAddedMessage?: { [languageISO639_3: string]: string }
284
+ /**
285
+ * If defined will replace the automatic chatbox comment notifiying the patient a new treatment plan has been updated. Indexed by locale.
286
+ */
287
+ planUpdatedMessage?: { [languageISO639_3: string]: string }
288
+ /**
289
+ * If defined will replace the automatic chatbox comment notifiying the patient a new exam has been dispatched. Indexed by locale.
290
+ */
291
+ examsUpdatedMessage?: { [languageISO639_3: string]: string }
292
+ }
197
293
  >
198
294
 
199
- export type PracticeConfigPracticeFontsLinks = PracticeConfig<
200
- PracticeConfigKind.PracticeFontsLinks,
295
+ /**
296
+ * This config is used to configure the layout of the consult list for practitioners
297
+ */
298
+ export type PracticeConfigPractitionerConsultList = PracticeConfig<
299
+ PracticeConfigKind.PractitionerConsultList,
201
300
  {
202
- sansSerif?: string,
203
- serif?: string
301
+ /**
302
+ * Should hide the locality column
303
+ */
304
+ hideLocality?: boolean
305
+ /**
306
+ * Should hide the fax column
307
+ */
308
+ hideFax?: boolean
309
+ /**
310
+ * Should hide the expires at column
311
+ */
312
+ hideExpiresAt?: boolean
204
313
  }
205
314
  >
206
315
 
@@ -212,7 +321,7 @@ export type PracticeConfigs =
212
321
  | PracticeConfigPracticeOnlinePharmacy
213
322
  | PracticeConfigPracticeCssVariables
214
323
  | PracticeConfigPracticeFontsLinks
215
- | PracticeConfigPracticeConfigExample // Here for demonstration only
324
+ | PracticeConfigPracticeConfigExample // Here for integration tests only
216
325
 
217
326
  export interface PracticeWorkflow {
218
327
  id?: number ///optional for insertion
@@ -411,14 +520,15 @@ export interface Practitioner {
411
520
  }
412
521
 
413
522
  export interface HydratedPracticeConfigs {
414
- [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList
415
- [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox
523
+ [PracticeConfigKind.PracticeCloseConsultationTypes]?: PracticeConfigPracticeCloseConsultationTypes
416
524
  [PracticeConfigKind.PracticeConfigExample]?: PracticeConfigPracticeConfigExample
417
- [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher
418
525
  [PracticeConfigKind.PracticeCookieBanner]?: PracticeConfigPracticeCookieBanner
419
- [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy
420
526
  [PracticeConfigKind.PracticeCssVariables]?: PracticeConfigPracticeCssVariables
421
527
  [PracticeConfigKind.PracticeFontsLinks]?: PracticeConfigPracticeFontsLinks
528
+ [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher
529
+ [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy
530
+ [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox
531
+ [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList
422
532
  }
423
533
 
424
534
  export interface Practice {
@@ -5,6 +5,7 @@ import {
5
5
  ConsultRequest,
6
6
  MedicalStatus,
7
7
  ConsultTransmission,
8
+ ClosedReasonType,
8
9
  TransmissionKind,
9
10
  TransmissionStatus,
10
11
  } from '../models'
@@ -38,6 +39,8 @@ export class ConsultService {
38
39
  uuidRequester?: Uuid,
39
40
  statusesMedical?: MedicalStatus[],
40
41
  statusesExclude?: MedicalStatus[],
42
+ closedReasonTypes?: ClosedReasonType[],
43
+ closedReasonMsgs?: string[],
41
44
  shortId?: string,
42
45
  columnToSortTo?: string[],
43
46
  orderToSortTo?: string[],
@@ -57,6 +60,8 @@ export class ConsultService {
57
60
  uuidRequester,
58
61
  statusesMedical,
59
62
  statusesExclude,
63
+ closedReasonTypes,
64
+ closedReasonMsgs,
60
65
  shortId,
61
66
  perPage,
62
67
  page: indexPage,
@@ -104,6 +109,8 @@ export class ConsultService {
104
109
  uuidRequester?: Uuid,
105
110
  statusesMedical?: MedicalStatus[],
106
111
  statusesExclude?: MedicalStatus[],
112
+ closedReasonTypes?: ClosedReasonType[],
113
+ closedReasonMsgs?: string[],
107
114
  shortId?: string,
108
115
  columnToSortTo?: string[],
109
116
  orderToSortTo?: string[],
@@ -120,6 +127,8 @@ export class ConsultService {
120
127
  uuidRequester,
121
128
  statusesMedical,
122
129
  statusesExclude,
130
+ closedReasonTypes,
131
+ closedReasonMsgs,
123
132
  shortId,
124
133
  perPage,
125
134
  page: indexPage,
@@ -141,6 +150,8 @@ export class ConsultService {
141
150
  uuidConsult: Uuid,
142
151
  consult: {
143
152
  statusMedical?: MedicalStatus
153
+ closedReasonType?: ClosedReasonType
154
+ closedReasonMsg?: string
144
155
  uuidAssignedDoctor?: Uuid
145
156
  neverExpires?: boolean
146
157
  },
@@ -6,6 +6,7 @@ import {
6
6
  MedicalStatus,
7
7
  Uuid,
8
8
  ResumeConsultEmailRequest,
9
+ ClosedReasonType,
9
10
  } from '../models'
10
11
  export class TellerService {
11
12
  constructor(private api: APIService, private baseURL: string) {}
@@ -28,11 +29,15 @@ export class TellerService {
28
29
  patientUuid: Uuid,
29
30
  uuidConsult: Uuid,
30
31
  statusMedical: MedicalStatus,
32
+ closedReasonType?: ClosedReasonType,
33
+ closedReasonMsg?: string,
31
34
  neverExpires?: boolean
32
35
  ): Promise<Consult> {
33
36
  return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, {
34
37
  patientUuid,
35
38
  statusMedical,
39
+ closedReasonType,
40
+ closedReasonMsg,
36
41
  neverExpires,
37
42
  })
38
43
  }