oro-sdk-apis 1.27.0-dev1 → 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, ReasonWhyClosed, 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[], reasonsWhyClosed?: ReasonWhyClosed[], reasonsWhyOther?: string[], 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[], reasonsWhyClosed?: ReasonWhyClosed[], reasonsWhyOther?: string[], 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, ReasonWhyClosed } 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, reasonWhyClosed?: ReasonWhyClosed, reasonWhyOther?: string, 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.27.0-dev1",
2
+ "version": "1.29.0-dev1",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
@@ -82,7 +82,7 @@ export enum TaskStatus {
82
82
  Done = 'Done',
83
83
  }
84
84
 
85
- export enum ReasonWhyClosed {
85
+ export enum ClosedReasonType {
86
86
  Completed = "Completed",
87
87
  NotADisease = "NotADisease",
88
88
  NotAppropriateForVirtual = "NotAppropriateForVirtual",
@@ -110,8 +110,8 @@ export interface Consult {
110
110
  uuidAssignedDoctor: string
111
111
  uuidCurrentAssigned: string
112
112
  statusTask?: TaskStatus
113
- reasonWhyClosed?: ReasonWhyClosed
114
- reasonWhyOther?: string
113
+ closedReasonType?: ClosedReasonType
114
+ closedReasonMsg?: string
115
115
  hasTransmissions?: boolean
116
116
  assignedAssistant?: ConsultAssignedAssistant[]
117
117
  shortId?: string
@@ -122,77 +122,195 @@ 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',
141
+ PracticeFontsLinks = 'PracticeFontsLinks',
142
+ PracticeLocaleSwitcher = 'PracticeLocaleSwitcher',
143
+ PracticePharmacyPicker = 'PracticePharmacyPicker',
144
+ PractitionerChatbox = 'PractitionerChatbox',
145
+ PractitionerConsultList = 'PractitionerConsultList',
133
146
  }
134
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
+ */
135
187
  export interface PracticeConfig<K, T> {
188
+ /**
189
+ * The uuid of the practice to apply the config
190
+ */
136
191
  uuidPractice: string
137
- 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
+ */
138
199
  config: T
139
200
  }
140
201
 
141
- export type PracticeConfigPractitionerConsultList = PracticeConfig<
142
- PracticeConfigKind.PractitionerConsultList,
143
- {
144
- hideLocality?: boolean
145
- hideFax?: boolean
146
- hideExpiresAt?: boolean
147
- showExpirationInDays?: boolean
148
- }
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 }
149
208
  >
150
209
 
151
- export type PracticeConfigPracticeLocaleSwitcher = PracticeConfig<
152
- PracticeConfigKind.PracticeLocaleSwitcher,
153
- {
154
- hideLocaleSwitcher?: boolean
155
- }
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
+ }
156
220
  >
157
221
 
158
- export type PracticeConfigPractitionerChatbox = PracticeConfig<
159
- PracticeConfigKind.PractitionerChatbox,
160
- {
161
- planAddedMessage?: { [languageISO639_3: string]: string }
162
- planUpdatedMessage?: { [languageISO639_3: string]: string }
163
- examsUpdatedMessage?: { [languageISO639_3: string]: string }
164
- }
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>
165
229
  >
166
230
 
167
- export type PracticeConfigPracticeOnlinePharmacy = PracticeConfig<
168
- PracticeConfigKind.PracticePharmacyPicker,
169
- {
170
- onlinePharmacy?: PlaceData
171
- }
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
+ }
172
246
  >
173
247
 
174
- export type PracticeConfigPracticeCookieBanner = PracticeConfig<
175
- PracticeConfigKind.PracticeCookieBanner,
176
- {
177
- showCookieBanner?: boolean
178
- policyLink?: string
179
- useOfCookieLink?: string
180
- }
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
+ }
181
259
  >
182
260
 
183
- // This type is for demonstration only for now
184
- export type PracticeConfigPracticeConfigExample = PracticeConfig<
185
- PracticeConfigKind.PracticeConfigExample,
186
- { 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
+ }
187
272
  >
188
273
 
189
274
  /**
190
- * This interface describes all practice css variables
191
- * The keys should reflect the exact css name
275
+ * Defines the consultation chatbox configs
192
276
  */
193
- export type PracticeConfigPracticeCssVariables = PracticeConfig<
194
- PracticeConfigKind.PracticeCssVariables,
195
- 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
+ }
293
+ >
294
+
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,
300
+ {
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
313
+ }
196
314
  >
197
315
 
198
316
  export type PracticeConfigs =
@@ -202,7 +320,8 @@ export type PracticeConfigs =
202
320
  | PracticeConfigPracticeCookieBanner
203
321
  | PracticeConfigPracticeOnlinePharmacy
204
322
  | PracticeConfigPracticeCssVariables
205
- | PracticeConfigPracticeConfigExample // Here for demonstration only
323
+ | PracticeConfigPracticeFontsLinks
324
+ | PracticeConfigPracticeConfigExample // Here for integration tests only
206
325
 
207
326
  export interface PracticeWorkflow {
208
327
  id?: number ///optional for insertion
@@ -401,13 +520,15 @@ export interface Practitioner {
401
520
  }
402
521
 
403
522
  export interface HydratedPracticeConfigs {
404
- [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList
405
- [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox
523
+ [PracticeConfigKind.PracticeCloseConsultationTypes]?: PracticeConfigPracticeCloseConsultationTypes
406
524
  [PracticeConfigKind.PracticeConfigExample]?: PracticeConfigPracticeConfigExample
407
- [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher
408
525
  [PracticeConfigKind.PracticeCookieBanner]?: PracticeConfigPracticeCookieBanner
409
- [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy
410
526
  [PracticeConfigKind.PracticeCssVariables]?: PracticeConfigPracticeCssVariables
527
+ [PracticeConfigKind.PracticeFontsLinks]?: PracticeConfigPracticeFontsLinks
528
+ [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher
529
+ [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy
530
+ [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox
531
+ [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList
411
532
  }
412
533
 
413
534
  export interface Practice {
@@ -5,7 +5,7 @@ import {
5
5
  ConsultRequest,
6
6
  MedicalStatus,
7
7
  ConsultTransmission,
8
- ReasonWhyClosed,
8
+ ClosedReasonType,
9
9
  TransmissionKind,
10
10
  TransmissionStatus,
11
11
  } from '../models'
@@ -39,8 +39,8 @@ export class ConsultService {
39
39
  uuidRequester?: Uuid,
40
40
  statusesMedical?: MedicalStatus[],
41
41
  statusesExclude?: MedicalStatus[],
42
- reasonsWhyClosed?: ReasonWhyClosed[],
43
- reasonsWhyOther?: string[],
42
+ closedReasonTypes?: ClosedReasonType[],
43
+ closedReasonMsgs?: string[],
44
44
  shortId?: string,
45
45
  columnToSortTo?: string[],
46
46
  orderToSortTo?: string[],
@@ -60,8 +60,8 @@ export class ConsultService {
60
60
  uuidRequester,
61
61
  statusesMedical,
62
62
  statusesExclude,
63
- reasonsWhyClosed,
64
- reasonsWhyOther,
63
+ closedReasonTypes,
64
+ closedReasonMsgs,
65
65
  shortId,
66
66
  perPage,
67
67
  page: indexPage,
@@ -109,8 +109,8 @@ export class ConsultService {
109
109
  uuidRequester?: Uuid,
110
110
  statusesMedical?: MedicalStatus[],
111
111
  statusesExclude?: MedicalStatus[],
112
- reasonsWhyClosed?: ReasonWhyClosed[],
113
- reasonsWhyOther?: string[],
112
+ closedReasonTypes?: ClosedReasonType[],
113
+ closedReasonMsgs?: string[],
114
114
  shortId?: string,
115
115
  columnToSortTo?: string[],
116
116
  orderToSortTo?: string[],
@@ -127,8 +127,8 @@ export class ConsultService {
127
127
  uuidRequester,
128
128
  statusesMedical,
129
129
  statusesExclude,
130
- reasonsWhyClosed,
131
- reasonsWhyOther,
130
+ closedReasonTypes,
131
+ closedReasonMsgs,
132
132
  shortId,
133
133
  perPage,
134
134
  page: indexPage,
@@ -150,6 +150,8 @@ export class ConsultService {
150
150
  uuidConsult: Uuid,
151
151
  consult: {
152
152
  statusMedical?: MedicalStatus
153
+ closedReasonType?: ClosedReasonType
154
+ closedReasonMsg?: string
153
155
  uuidAssignedDoctor?: Uuid
154
156
  neverExpires?: boolean
155
157
  },
@@ -6,7 +6,7 @@ import {
6
6
  MedicalStatus,
7
7
  Uuid,
8
8
  ResumeConsultEmailRequest,
9
- ReasonWhyClosed,
9
+ ClosedReasonType,
10
10
  } from '../models'
11
11
  export class TellerService {
12
12
  constructor(private api: APIService, private baseURL: string) {}
@@ -29,15 +29,15 @@ export class TellerService {
29
29
  patientUuid: Uuid,
30
30
  uuidConsult: Uuid,
31
31
  statusMedical: MedicalStatus,
32
- reasonWhyClosed?: ReasonWhyClosed,
33
- reasonWhyOther?: string,
32
+ closedReasonType?: ClosedReasonType,
33
+ closedReasonMsg?: string,
34
34
  neverExpires?: boolean
35
35
  ): Promise<Consult> {
36
36
  return this.api.put<Consult>(`${this.baseURL}/v1/consults/${uuidConsult}`, {
37
37
  patientUuid,
38
38
  statusMedical,
39
- reasonWhyClosed,
40
- reasonWhyOther,
39
+ closedReasonType,
40
+ closedReasonMsg,
41
41
  neverExpires,
42
42
  })
43
43
  }