oro-sdk-apis 1.28.0 → 1.30.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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.28.0",
2
+ "version": "1.30.0",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
@@ -122,85 +122,198 @@ 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
+ * Hides the locality column
303
+ */
304
+ hideLocality?: boolean
305
+ /**
306
+ * Hides the plan name column
307
+ */
308
+ hidePlan?: boolean
309
+ /**
310
+ * Hides the fax column
311
+ */
312
+ hideFax?: boolean
313
+ /**
314
+ * Hides the expires at column
315
+ */
316
+ hideExpiresAt?: boolean
204
317
  }
205
318
  >
206
319
 
@@ -212,7 +325,7 @@ export type PracticeConfigs =
212
325
  | PracticeConfigPracticeOnlinePharmacy
213
326
  | PracticeConfigPracticeCssVariables
214
327
  | PracticeConfigPracticeFontsLinks
215
- | PracticeConfigPracticeConfigExample // Here for demonstration only
328
+ | PracticeConfigPracticeConfigExample // Here for integration tests only
216
329
 
217
330
  export interface PracticeWorkflow {
218
331
  id?: number ///optional for insertion
@@ -411,14 +524,15 @@ export interface Practitioner {
411
524
  }
412
525
 
413
526
  export interface HydratedPracticeConfigs {
414
- [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList
415
- [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox
527
+ [PracticeConfigKind.PracticeCloseConsultationTypes]?: PracticeConfigPracticeCloseConsultationTypes
416
528
  [PracticeConfigKind.PracticeConfigExample]?: PracticeConfigPracticeConfigExample
417
- [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher
418
529
  [PracticeConfigKind.PracticeCookieBanner]?: PracticeConfigPracticeCookieBanner
419
- [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy
420
530
  [PracticeConfigKind.PracticeCssVariables]?: PracticeConfigPracticeCssVariables
421
531
  [PracticeConfigKind.PracticeFontsLinks]?: PracticeConfigPracticeFontsLinks
532
+ [PracticeConfigKind.PracticeLocaleSwitcher]?: PracticeConfigPracticeLocaleSwitcher
533
+ [PracticeConfigKind.PracticePharmacyPicker]?: PracticeConfigPracticeOnlinePharmacy
534
+ [PracticeConfigKind.PractitionerChatbox]?: PracticeConfigPractitionerChatbox
535
+ [PracticeConfigKind.PractitionerConsultList]?: PracticeConfigPractitionerConsultList
422
536
  }
423
537
 
424
538
  export interface Practice {