@blackcode_sa/metaestetics-api 1.11.2 → 1.12.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 (49) hide show
  1. package/dist/admin/index.d.mts +331 -318
  2. package/dist/admin/index.d.ts +331 -318
  3. package/dist/backoffice/index.d.mts +1166 -430
  4. package/dist/backoffice/index.d.ts +1166 -430
  5. package/dist/backoffice/index.js +1128 -245
  6. package/dist/backoffice/index.mjs +1119 -209
  7. package/dist/index.d.mts +4429 -4034
  8. package/dist/index.d.ts +4429 -4034
  9. package/dist/index.js +1644 -666
  10. package/dist/index.mjs +1408 -402
  11. package/package.json +1 -1
  12. package/src/backoffice/expo-safe/index.ts +3 -0
  13. package/src/backoffice/services/README.md +40 -0
  14. package/src/backoffice/services/brand.service.ts +85 -6
  15. package/src/backoffice/services/category.service.ts +92 -10
  16. package/src/backoffice/services/constants.service.ts +308 -0
  17. package/src/backoffice/services/documentation-template.service.ts +56 -2
  18. package/src/backoffice/services/index.ts +1 -0
  19. package/src/backoffice/services/product.service.ts +126 -5
  20. package/src/backoffice/services/requirement.service.ts +13 -0
  21. package/src/backoffice/services/subcategory.service.ts +184 -13
  22. package/src/backoffice/services/technology.service.ts +344 -129
  23. package/src/backoffice/types/admin-constants.types.ts +69 -0
  24. package/src/backoffice/types/brand.types.ts +1 -0
  25. package/src/backoffice/types/index.ts +1 -0
  26. package/src/backoffice/types/product.types.ts +31 -4
  27. package/src/backoffice/types/static/contraindication.types.ts +1 -0
  28. package/src/backoffice/types/static/treatment-benefit.types.ts +1 -0
  29. package/src/backoffice/types/technology.types.ts +113 -4
  30. package/src/backoffice/validations/schemas.ts +35 -9
  31. package/src/services/appointment/appointment.service.ts +0 -5
  32. package/src/services/appointment/utils/appointment.utils.ts +124 -113
  33. package/src/services/base.service.ts +10 -3
  34. package/src/services/documentation-templates/documentation-template.service.ts +116 -0
  35. package/src/services/media/media.service.ts +2 -2
  36. package/src/services/procedure/procedure.service.ts +436 -234
  37. package/src/types/appointment/index.ts +4 -3
  38. package/src/types/clinic/index.ts +1 -6
  39. package/src/types/patient/medical-info.types.ts +3 -3
  40. package/src/types/procedure/index.ts +20 -17
  41. package/src/validations/appointment.schema.ts +1 -0
  42. package/src/validations/clinic.schema.ts +1 -6
  43. package/src/validations/patient/medical-info.schema.ts +7 -2
  44. package/src/backoffice/services/__tests__/brand.service.test.ts +0 -196
  45. package/src/backoffice/services/__tests__/category.service.test.ts +0 -201
  46. package/src/backoffice/services/__tests__/product.service.test.ts +0 -358
  47. package/src/backoffice/services/__tests__/requirement.service.test.ts +0 -226
  48. package/src/backoffice/services/__tests__/subcategory.service.test.ts +0 -181
  49. package/src/backoffice/services/__tests__/technology.service.test.ts +0 -1097
@@ -138,6 +138,52 @@ interface Review {
138
138
  overallRating: number;
139
139
  }
140
140
 
141
+ /**
142
+ * @file Defines types for dynamically managed administrative constants,
143
+ * such as treatment benefits and contraindications. These are stored in
144
+ * the 'admin-constants' collection in Firestore.
145
+ */
146
+ /**
147
+ * Represents a single dynamic treatment benefit.
148
+ * These are positive effects or results a patient can expect from a treatment.
149
+ */
150
+ interface TreatmentBenefitDynamic {
151
+ /**
152
+ * A unique identifier for the benefit, typically in snake_case.
153
+ * @example "wrinkle_reduction"
154
+ */
155
+ id: string;
156
+ /**
157
+ * A human-readable name for the treatment benefit.
158
+ * @example "Wrinkle Reduction"
159
+ */
160
+ name: string;
161
+ /**
162
+ * A detailed description of the benefit.
163
+ */
164
+ description?: string;
165
+ }
166
+ /**
167
+ * Represents a single dynamic contraindication.
168
+ * These are conditions or factors that can affect a procedure and require special attention.
169
+ */
170
+ interface ContraindicationDynamic {
171
+ /**
172
+ * A unique identifier for the contraindication, typically in snake_case.
173
+ * @example "sensitive_skin"
174
+ */
175
+ id: string;
176
+ /**
177
+ * A human-readable name for the contraindication.
178
+ * @example "Sensitive Skin"
179
+ */
180
+ name: string;
181
+ /**
182
+ * A detailed description of the contraindication.
183
+ */
184
+ description?: string;
185
+ }
186
+
141
187
  /**
142
188
  * Familije procedura u sistemu
143
189
  * Predstavlja najviši nivo hijerarhije i deli procedure na estetske i hirurške
@@ -184,33 +230,256 @@ interface Category {
184
230
  }
185
231
 
186
232
  /**
187
- * Podkategorija procedura
188
- * Podkategorije su drugi nivo hijerarhije i pripadaju određenoj kategoriji
189
- * One grupišu slične tehnologije u okviru kategorije
233
+ * Enum for element types in documentation templates
234
+ */
235
+ declare enum DocumentElementType {
236
+ HEADING = "heading",
237
+ PARAGRAPH = "paragraph",
238
+ LIST = "list",
239
+ DYNAMIC_TEXT = "dynamic_text",
240
+ BINARY_CHOICE = "binary_choice",
241
+ MULTIPLE_CHOICE = "multiple_choice",
242
+ SINGLE_CHOICE = "single_choice",
243
+ RATING_SCALE = "rating_scale",
244
+ TEXT_INPUT = "text_input",
245
+ DATE_PICKER = "date_picker",
246
+ SIGNATURE = "signature",
247
+ DITIGAL_SIGNATURE = "digital_signature",
248
+ FILE_UPLOAD = "file_upload"
249
+ }
250
+ /**
251
+ * Enum for list types
252
+ */
253
+ declare enum ListType {
254
+ ORDERED = "ordered",
255
+ UNORDERED = "unordered"
256
+ }
257
+ /**
258
+ * Enum for heading levels
259
+ */
260
+ declare enum HeadingLevel {
261
+ H1 = "h1",
262
+ H2 = "h2",
263
+ H3 = "h3",
264
+ H4 = "h4",
265
+ H5 = "h5",
266
+ H6 = "h6"
267
+ }
268
+ /**
269
+ * Base interface for all document elements
270
+ */
271
+ interface BaseDocumentElement {
272
+ id: string;
273
+ type: DocumentElementType;
274
+ required?: boolean;
275
+ }
276
+ /**
277
+ * Interface for heading element
278
+ */
279
+ interface HeadingElement extends BaseDocumentElement {
280
+ type: DocumentElementType.HEADING;
281
+ text: string;
282
+ level: HeadingLevel;
283
+ }
284
+ /**
285
+ * Interface for paragraph element
286
+ */
287
+ interface ParagraphElement extends BaseDocumentElement {
288
+ type: DocumentElementType.PARAGRAPH;
289
+ text: string;
290
+ }
291
+ /**
292
+ * Interface for list element
293
+ */
294
+ interface ListElement extends BaseDocumentElement {
295
+ type: DocumentElementType.LIST;
296
+ items: string[];
297
+ listType: ListType;
298
+ }
299
+ /**
300
+ * Interface for dynamic text element
301
+ */
302
+ interface DynamicTextElement extends BaseDocumentElement {
303
+ type: DocumentElementType.DYNAMIC_TEXT;
304
+ text: string;
305
+ }
306
+ /**
307
+ * Interface for binary choice element (Yes/No)
308
+ */
309
+ interface BinaryChoiceElement extends BaseDocumentElement {
310
+ type: DocumentElementType.BINARY_CHOICE;
311
+ question: string;
312
+ defaultValue?: boolean;
313
+ }
314
+ /**
315
+ * Interface for multiple choice element
316
+ */
317
+ interface MultipleChoiceElement extends BaseDocumentElement {
318
+ type: DocumentElementType.MULTIPLE_CHOICE;
319
+ question: string;
320
+ options: string[];
321
+ defaultValues?: string[];
322
+ }
323
+ /**
324
+ * Interface for single choice element
325
+ */
326
+ interface SingleChoiceElement extends BaseDocumentElement {
327
+ type: DocumentElementType.SINGLE_CHOICE;
328
+ question: string;
329
+ options: string[];
330
+ defaultValue?: string;
331
+ }
332
+ /**
333
+ * Interface for rating scale element
334
+ */
335
+ interface RatingScaleElement extends BaseDocumentElement {
336
+ type: DocumentElementType.RATING_SCALE;
337
+ question: string;
338
+ min: number;
339
+ max: number;
340
+ labels?: {
341
+ [key: number]: string;
342
+ };
343
+ defaultValue?: number;
344
+ }
345
+ /**
346
+ * Interface for text input element
347
+ */
348
+ interface TextInputElement extends BaseDocumentElement {
349
+ type: DocumentElementType.TEXT_INPUT;
350
+ label: string;
351
+ placeholder?: string;
352
+ multiline?: boolean;
353
+ defaultValue?: string;
354
+ }
355
+ /**
356
+ * Interface for date picker element
357
+ */
358
+ interface DatePickerElement extends BaseDocumentElement {
359
+ type: DocumentElementType.DATE_PICKER;
360
+ label: string;
361
+ defaultValue?: string;
362
+ }
363
+ /**
364
+ * Interface for signature element
365
+ */
366
+ interface SignatureElement extends BaseDocumentElement {
367
+ type: DocumentElementType.SIGNATURE;
368
+ label: string;
369
+ }
370
+ /**
371
+ * Interface for file upload element
372
+ */
373
+ interface FileUploadElement extends BaseDocumentElement {
374
+ type: DocumentElementType.FILE_UPLOAD;
375
+ label: string;
376
+ allowedFileTypes?: string[];
377
+ maxFileSizeMB?: number;
378
+ }
379
+ /**
380
+ * Union type for all document elements
381
+ */
382
+ type DocumentElement = HeadingElement | ParagraphElement | ListElement | DynamicTextElement | BinaryChoiceElement | MultipleChoiceElement | SingleChoiceElement | RatingScaleElement | TextInputElement | DatePickerElement | SignatureElement | FileUploadElement;
383
+ /**
384
+ * Interface for document template
385
+ */
386
+ interface DocumentTemplate {
387
+ id: string;
388
+ title: string;
389
+ description?: string;
390
+ createdAt: number;
391
+ updatedAt: number;
392
+ createdBy: string;
393
+ elements: DocumentElement[];
394
+ tags?: string[];
395
+ isUserForm?: boolean;
396
+ isRequired?: boolean;
397
+ sortingOrder?: number;
398
+ version: number;
399
+ isActive: boolean;
400
+ }
401
+ /**
402
+ * Interface for a filled document (completed form)
403
+ */
404
+ interface FilledDocument {
405
+ id: string;
406
+ templateId: string;
407
+ templateVersion: number;
408
+ isUserForm: boolean;
409
+ isRequired: boolean;
410
+ procedureId: string;
411
+ appointmentId: string;
412
+ patientId: string;
413
+ practitionerId: string;
414
+ clinicId: string;
415
+ createdAt: number;
416
+ updatedAt: number;
417
+ values: {
418
+ [elementId: string]: any | FilledDocumentFileValue;
419
+ };
420
+ status: FilledDocumentStatus;
421
+ }
422
+ /**
423
+ * Enum for filled document status
424
+ */
425
+ declare enum FilledDocumentStatus {
426
+ DRAFT = "draft",
427
+ SKIPPED = "skipped",
428
+ PENDING = "pending",
429
+ COMPLETED = "completed",// When doctor or patient completes the form
430
+ SIGNED = "signed",// Only used for user forms
431
+ REJECTED = "rejected"
432
+ }
433
+ /**
434
+ * Interface for file upload results to be stored in filled document values
435
+ */
436
+ interface FilledDocumentFileValue {
437
+ mediaId: string;
438
+ url: string;
439
+ name: string;
440
+ contentType: string;
441
+ size: number;
442
+ uploadedAt: number;
443
+ }
444
+
445
+ /**
446
+ * Product used in procedures
447
+ * Can be consumables, equipment, or any other product needed for performing procedures
190
448
  *
191
- * @property id - Jedinstveni identifikator podkategorije
192
- * @property name - Naziv podkategorije
193
- * @property description - Detaljan opis podkategorije i njene namene
194
- * @property categoryId - ID kategorije kojoj podkategorija pripada
195
- * @property isActive - Da li je podkategorija aktivna u sistemu
196
- * @property createdAt - Datum kreiranja
197
- * @property updatedAt - Datum poslednjeg ažuriranja
449
+ * @property id - Unique identifier of the product
450
+ * @property name - Name of the product
451
+ * @property description - Detailed description of the product and its purpose
452
+ * @property brandId - ID of the brand that manufactures this product
453
+ * @property technologyId - ID of the technology this product is used with
454
+ * @property technicalDetails - Technical details and specifications
455
+ * @property warnings - List of warnings related to product use
456
+ * @property dosage - Dosage information (if applicable)
457
+ * @property composition - Product composition
458
+ * @property indications - List of indications for use
459
+ * @property contraindications - List of contraindications
460
+ * @property isActive - Whether the product is active in the system
461
+ * @property createdAt - Creation date
462
+ * @property updatedAt - Last update date
198
463
  */
199
- interface Subcategory {
200
- /** Jedinstveni identifikator podkategorije (automatski generisan od strane Firestore) */
464
+ interface Product {
201
465
  id?: string;
202
- /** Naziv podkategorije */
203
466
  name: string;
204
- /** Detaljniji opis podkategorije */
205
- description?: string;
206
- /** ID kategorije kojoj podkategorija pripada */
467
+ brandId: string;
468
+ brandName: string;
469
+ technologyId: string;
470
+ technologyName: string;
207
471
  categoryId: string;
208
- /** Flag koji označava da li je podkategorija aktivna */
209
- isActive: boolean;
210
- /** Datum kreiranja podkategorije */
472
+ subcategoryId: string;
211
473
  createdAt: Date;
212
- /** Datum poslednjeg ažuriranja podkategorije */
213
474
  updatedAt: Date;
475
+ isActive: boolean;
476
+ description?: string;
477
+ technicalDetails?: string;
478
+ warnings?: string[];
479
+ dosage?: string;
480
+ composition?: string;
481
+ indications?: string[];
482
+ contraindications?: ContraindicationDynamic[];
214
483
  }
215
484
 
216
485
  /**
@@ -268,6 +537,36 @@ interface Requirement {
268
537
  updatedAt: Date;
269
538
  }
270
539
 
540
+ /**
541
+ * Podkategorija procedura
542
+ * Podkategorije su drugi nivo hijerarhije i pripadaju određenoj kategoriji
543
+ * One grupišu slične tehnologije u okviru kategorije
544
+ *
545
+ * @property id - Jedinstveni identifikator podkategorije
546
+ * @property name - Naziv podkategorije
547
+ * @property description - Detaljan opis podkategorije i njene namene
548
+ * @property categoryId - ID kategorije kojoj podkategorija pripada
549
+ * @property isActive - Da li je podkategorija aktivna u sistemu
550
+ * @property createdAt - Datum kreiranja
551
+ * @property updatedAt - Datum poslednjeg ažuriranja
552
+ */
553
+ interface Subcategory {
554
+ /** Jedinstveni identifikator podkategorije (automatski generisan od strane Firestore) */
555
+ id?: string;
556
+ /** Naziv podkategorije */
557
+ name: string;
558
+ /** Detaljniji opis podkategorije */
559
+ description?: string;
560
+ /** ID kategorije kojoj podkategorija pripada */
561
+ categoryId: string;
562
+ /** Flag koji označava da li je podkategorija aktivna */
563
+ isActive: boolean;
564
+ /** Datum kreiranja podkategorije */
565
+ createdAt: Date;
566
+ /** Datum poslednjeg ažuriranja podkategorije */
567
+ updatedAt: Date;
568
+ }
569
+
271
570
  /**
272
571
  * Blokirajući uslovi koji mogu sprečiti proceduru
273
572
  * Ovi uslovi predstavljaju apsolutne kontraindikacije koje onemogućavaju izvođenje procedure
@@ -290,47 +589,6 @@ declare enum BlockingCondition {
290
589
  EPILEPSY = "epilepsy"
291
590
  }
292
591
 
293
- /**
294
- * Kontraindikacije koje mogu uticati na proceduru
295
- * Ovi uslovi predstavljaju relativne kontraindikacije koje zahtevaju posebnu pažnju
296
- */
297
- declare enum Contraindication {
298
- SENSITIVE_SKIN = "sensitive_skin",
299
- RECENT_TANNING = "recent_tanning",
300
- RECENT_BOTOX = "recent_botox",
301
- RECENT_FILLERS = "recent_fillers",
302
- SKIN_ALLERGIES = "skin_allergies",
303
- MEDICATIONS = "medications",
304
- RECENT_CHEMICAL_PEEL = "recent_chemical_peel",
305
- RECENT_LASER = "recent_laser",
306
- SKIN_INFLAMMATION = "skin_inflammation",
307
- OPEN_WOUNDS = "open_wounds",
308
- HERPES_SIMPLEX = "herpes_simplex",
309
- COLD_SORES = "cold_sores"
310
- }
311
-
312
- /**
313
- * Benefiti koji se mogu očekivati od procedure
314
- * Lista mogućih pozitivnih efekata i rezultata tretmana
315
- */
316
- declare enum TreatmentBenefit {
317
- WRINKLE_REDUCTION = "wrinkle_reduction",
318
- SKIN_TIGHTENING = "skin_tightening",
319
- COLLAGEN_PRODUCTION = "collagen_production",
320
- ACNE_REDUCTION = "acne_reduction",
321
- SCAR_REDUCTION = "scar_reduction",
322
- PIGMENTATION_IMPROVEMENT = "pigmentation_improvement",
323
- HAIR_REMOVAL = "hair_removal",
324
- MUSCLE_TONING = "muscle_toning",
325
- FAT_REDUCTION = "fat_reduction",
326
- CELLULITE_REDUCTION = "cellulite_reduction",
327
- SKIN_REJUVENATION = "skin_rejuvenation",
328
- PORE_REDUCTION = "pore_reduction",
329
- TEXTURE_IMPROVEMENT = "texture_improvement",
330
- HYDRATION_BOOST = "hydration_boost",
331
- CIRCULATION_IMPROVEMENT = "circulation_improvement"
332
- }
333
-
334
592
  /**
335
593
  * Nivoi sertifikacije medicinskog osoblja, poređani od najnižeg do najvišeg
336
594
  */
@@ -415,8 +673,8 @@ interface Technology {
415
673
  post: Requirement[];
416
674
  };
417
675
  blockingConditions: BlockingCondition[];
418
- contraindications: Contraindication[];
419
- benefits: TreatmentBenefit[];
676
+ contraindications: ContraindicationDynamic[];
677
+ benefits: TreatmentBenefitDynamic[];
420
678
  certificationRequirement: CertificationRequirement;
421
679
  documentationTemplates?: TechnologyDocumentationTemplate[];
422
680
  isActive: boolean;
@@ -424,44 +682,6 @@ interface Technology {
424
682
  updatedAt: Date;
425
683
  }
426
684
 
427
- /**
428
- * Product used in procedures
429
- * Can be consumables, equipment, or any other product needed for performing procedures
430
- *
431
- * @property id - Unique identifier of the product
432
- * @property name - Name of the product
433
- * @property description - Detailed description of the product and its purpose
434
- * @property brandId - ID of the brand that manufactures this product
435
- * @property technologyId - ID of the technology this product is used with
436
- * @property technicalDetails - Technical details and specifications
437
- * @property warnings - List of warnings related to product use
438
- * @property dosage - Dosage information (if applicable)
439
- * @property composition - Product composition
440
- * @property indications - List of indications for use
441
- * @property contraindications - List of contraindications
442
- * @property isActive - Whether the product is active in the system
443
- * @property createdAt - Creation date
444
- * @property updatedAt - Last update date
445
- */
446
- interface Product {
447
- id?: string;
448
- name: string;
449
- brandId: string;
450
- brandName: string;
451
- technologyId: string;
452
- technologyName: string;
453
- createdAt: Date;
454
- updatedAt: Date;
455
- isActive: boolean;
456
- description?: string;
457
- technicalDetails?: string;
458
- warnings?: string[];
459
- dosage?: string;
460
- composition?: string;
461
- indications?: string[];
462
- contraindications?: string[];
463
- }
464
-
465
685
  declare enum PricingMeasure {
466
686
  PER_ML = "per_ml",
467
687
  PER_ZONE = "per_zone",
@@ -519,9 +739,13 @@ interface Procedure {
519
739
  /** Blocking conditions that prevent this procedure */
520
740
  blockingConditions: BlockingCondition[];
521
741
  /** Treatment benefits of this procedure */
522
- treatmentBenefits: TreatmentBenefit[];
742
+ treatmentBenefits: TreatmentBenefitDynamic[];
743
+ /** A list of just the string IDs of the treatment benefits, for efficient querying. */
744
+ treatmentBenefitIds: string[];
523
745
  /** Contraindications of this procedure */
524
- contraindications: Contraindication[];
746
+ contraindications: ContraindicationDynamic[];
747
+ /** A list of just the string IDs of the contraindications, for efficient querying. */
748
+ contraindicationIds: string[];
525
749
  /** Pre-procedure requirements */
526
750
  preRequirements: Requirement[];
527
751
  /** Post-procedure requirements */
@@ -1012,7 +1236,7 @@ interface PatientMedicalInfo {
1012
1236
  notes?: string | null;
1013
1237
  }[];
1014
1238
  contraindications: {
1015
- condition: Contraindication;
1239
+ condition: ContraindicationDynamic;
1016
1240
  lastOccurrence: Timestamp;
1017
1241
  frequency: "rare" | "occasional" | "frequent";
1018
1242
  isActive: boolean;
@@ -1202,219 +1426,6 @@ interface PatientProfileInfo {
1202
1426
  gender: Gender;
1203
1427
  }
1204
1428
 
1205
- /**
1206
- * Enum for element types in documentation templates
1207
- */
1208
- declare enum DocumentElementType {
1209
- HEADING = "heading",
1210
- PARAGRAPH = "paragraph",
1211
- LIST = "list",
1212
- DYNAMIC_TEXT = "dynamic_text",
1213
- BINARY_CHOICE = "binary_choice",
1214
- MULTIPLE_CHOICE = "multiple_choice",
1215
- SINGLE_CHOICE = "single_choice",
1216
- RATING_SCALE = "rating_scale",
1217
- TEXT_INPUT = "text_input",
1218
- DATE_PICKER = "date_picker",
1219
- SIGNATURE = "signature",
1220
- DITIGAL_SIGNATURE = "digital_signature",
1221
- FILE_UPLOAD = "file_upload"
1222
- }
1223
- /**
1224
- * Enum for list types
1225
- */
1226
- declare enum ListType {
1227
- ORDERED = "ordered",
1228
- UNORDERED = "unordered"
1229
- }
1230
- /**
1231
- * Enum for heading levels
1232
- */
1233
- declare enum HeadingLevel {
1234
- H1 = "h1",
1235
- H2 = "h2",
1236
- H3 = "h3",
1237
- H4 = "h4",
1238
- H5 = "h5",
1239
- H6 = "h6"
1240
- }
1241
- /**
1242
- * Base interface for all document elements
1243
- */
1244
- interface BaseDocumentElement {
1245
- id: string;
1246
- type: DocumentElementType;
1247
- required?: boolean;
1248
- }
1249
- /**
1250
- * Interface for heading element
1251
- */
1252
- interface HeadingElement extends BaseDocumentElement {
1253
- type: DocumentElementType.HEADING;
1254
- text: string;
1255
- level: HeadingLevel;
1256
- }
1257
- /**
1258
- * Interface for paragraph element
1259
- */
1260
- interface ParagraphElement extends BaseDocumentElement {
1261
- type: DocumentElementType.PARAGRAPH;
1262
- text: string;
1263
- }
1264
- /**
1265
- * Interface for list element
1266
- */
1267
- interface ListElement extends BaseDocumentElement {
1268
- type: DocumentElementType.LIST;
1269
- items: string[];
1270
- listType: ListType;
1271
- }
1272
- /**
1273
- * Interface for dynamic text element
1274
- */
1275
- interface DynamicTextElement extends BaseDocumentElement {
1276
- type: DocumentElementType.DYNAMIC_TEXT;
1277
- text: string;
1278
- }
1279
- /**
1280
- * Interface for binary choice element (Yes/No)
1281
- */
1282
- interface BinaryChoiceElement extends BaseDocumentElement {
1283
- type: DocumentElementType.BINARY_CHOICE;
1284
- question: string;
1285
- defaultValue?: boolean;
1286
- }
1287
- /**
1288
- * Interface for multiple choice element
1289
- */
1290
- interface MultipleChoiceElement extends BaseDocumentElement {
1291
- type: DocumentElementType.MULTIPLE_CHOICE;
1292
- question: string;
1293
- options: string[];
1294
- defaultValues?: string[];
1295
- }
1296
- /**
1297
- * Interface for single choice element
1298
- */
1299
- interface SingleChoiceElement extends BaseDocumentElement {
1300
- type: DocumentElementType.SINGLE_CHOICE;
1301
- question: string;
1302
- options: string[];
1303
- defaultValue?: string;
1304
- }
1305
- /**
1306
- * Interface for rating scale element
1307
- */
1308
- interface RatingScaleElement extends BaseDocumentElement {
1309
- type: DocumentElementType.RATING_SCALE;
1310
- question: string;
1311
- min: number;
1312
- max: number;
1313
- labels?: {
1314
- [key: number]: string;
1315
- };
1316
- defaultValue?: number;
1317
- }
1318
- /**
1319
- * Interface for text input element
1320
- */
1321
- interface TextInputElement extends BaseDocumentElement {
1322
- type: DocumentElementType.TEXT_INPUT;
1323
- label: string;
1324
- placeholder?: string;
1325
- multiline?: boolean;
1326
- defaultValue?: string;
1327
- }
1328
- /**
1329
- * Interface for date picker element
1330
- */
1331
- interface DatePickerElement extends BaseDocumentElement {
1332
- type: DocumentElementType.DATE_PICKER;
1333
- label: string;
1334
- defaultValue?: string;
1335
- }
1336
- /**
1337
- * Interface for signature element
1338
- */
1339
- interface SignatureElement extends BaseDocumentElement {
1340
- type: DocumentElementType.SIGNATURE;
1341
- label: string;
1342
- }
1343
- /**
1344
- * Interface for file upload element
1345
- */
1346
- interface FileUploadElement extends BaseDocumentElement {
1347
- type: DocumentElementType.FILE_UPLOAD;
1348
- label: string;
1349
- allowedFileTypes?: string[];
1350
- maxFileSizeMB?: number;
1351
- }
1352
- /**
1353
- * Union type for all document elements
1354
- */
1355
- type DocumentElement = HeadingElement | ParagraphElement | ListElement | DynamicTextElement | BinaryChoiceElement | MultipleChoiceElement | SingleChoiceElement | RatingScaleElement | TextInputElement | DatePickerElement | SignatureElement | FileUploadElement;
1356
- /**
1357
- * Interface for document template
1358
- */
1359
- interface DocumentTemplate {
1360
- id: string;
1361
- title: string;
1362
- description?: string;
1363
- createdAt: number;
1364
- updatedAt: number;
1365
- createdBy: string;
1366
- elements: DocumentElement[];
1367
- tags?: string[];
1368
- isUserForm?: boolean;
1369
- isRequired?: boolean;
1370
- sortingOrder?: number;
1371
- version: number;
1372
- isActive: boolean;
1373
- }
1374
- /**
1375
- * Interface for a filled document (completed form)
1376
- */
1377
- interface FilledDocument {
1378
- id: string;
1379
- templateId: string;
1380
- templateVersion: number;
1381
- isUserForm: boolean;
1382
- isRequired: boolean;
1383
- procedureId: string;
1384
- appointmentId: string;
1385
- patientId: string;
1386
- practitionerId: string;
1387
- clinicId: string;
1388
- createdAt: number;
1389
- updatedAt: number;
1390
- values: {
1391
- [elementId: string]: any | FilledDocumentFileValue;
1392
- };
1393
- status: FilledDocumentStatus;
1394
- }
1395
- /**
1396
- * Enum for filled document status
1397
- */
1398
- declare enum FilledDocumentStatus {
1399
- DRAFT = "draft",
1400
- SKIPPED = "skipped",
1401
- PENDING = "pending",
1402
- COMPLETED = "completed",// When doctor or patient completes the form
1403
- SIGNED = "signed",// Only used for user forms
1404
- REJECTED = "rejected"
1405
- }
1406
- /**
1407
- * Interface for file upload results to be stored in filled document values
1408
- */
1409
- interface FilledDocumentFileValue {
1410
- mediaId: string;
1411
- url: string;
1412
- name: string;
1413
- contentType: string;
1414
- size: number;
1415
- uploadedAt: number;
1416
- }
1417
-
1418
1429
  /**
1419
1430
  * Enum defining the possible statuses of an appointment.
1420
1431
  */
@@ -1573,6 +1584,8 @@ interface AppointmentMetadata {
1573
1584
  zoneBilling: Record<string, BillingPerZone> | null;
1574
1585
  /** Final billing calculations for the appointment */
1575
1586
  finalbilling: FinalBilling | null;
1587
+ /** Final note for the appointment */
1588
+ finalizationNotes: string | null;
1576
1589
  }
1577
1590
  /**
1578
1591
  * Represents a booked appointment, aggregating key information and relevant procedure rules.
@@ -1626,7 +1639,7 @@ interface Appointment {
1626
1639
  paymentTransactionId?: string | null;
1627
1640
  /** Procedure-related conditions and requirements */
1628
1641
  blockingConditions: BlockingCondition[];
1629
- contraindications: Contraindication[];
1642
+ contraindications: ContraindicationDynamic[];
1630
1643
  preProcedureRequirements: Requirement[];
1631
1644
  postProcedureRequirements: Requirement[];
1632
1645
  /** Tracking information for requirements completion */