@blackcode_sa/metaestetics-api 1.11.3 → 1.12.1

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 (53) hide show
  1. package/dist/admin/index.d.mts +378 -334
  2. package/dist/admin/index.d.ts +378 -334
  3. package/dist/backoffice/index.d.mts +1198 -430
  4. package/dist/backoffice/index.d.ts +1198 -430
  5. package/dist/backoffice/index.js +1128 -245
  6. package/dist/backoffice/index.mjs +1119 -209
  7. package/dist/index.d.mts +4478 -4031
  8. package/dist/index.d.ts +4478 -4031
  9. package/dist/index.js +1974 -757
  10. package/dist/index.mjs +1735 -490
  11. package/package.json +1 -1
  12. package/src/backoffice/expo-safe/index.ts +4 -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 +2 -0
  26. package/src/backoffice/types/procedure-product.types.ts +38 -0
  27. package/src/backoffice/types/product.types.ts +31 -4
  28. package/src/backoffice/types/static/contraindication.types.ts +1 -0
  29. package/src/backoffice/types/static/treatment-benefit.types.ts +1 -0
  30. package/src/backoffice/types/technology.types.ts +113 -4
  31. package/src/backoffice/validations/schemas.ts +35 -9
  32. package/src/services/appointment/appointment.service.ts +0 -5
  33. package/src/services/appointment/utils/appointment.utils.ts +124 -113
  34. package/src/services/base.service.ts +10 -3
  35. package/src/services/documentation-templates/documentation-template.service.ts +116 -0
  36. package/src/services/media/media.service.ts +2 -2
  37. package/src/services/practitioner/practitioner.service.ts +201 -83
  38. package/src/services/procedure/README.md +76 -1
  39. package/src/services/procedure/procedure.service.ts +538 -235
  40. package/src/types/appointment/index.ts +2 -3
  41. package/src/types/clinic/index.ts +1 -6
  42. package/src/types/patient/medical-info.types.ts +3 -3
  43. package/src/types/procedure/index.ts +39 -20
  44. package/src/validations/clinic.schema.ts +1 -6
  45. package/src/validations/patient/medical-info.schema.ts +7 -2
  46. package/src/validations/procedure-product.schema.ts +41 -0
  47. package/src/validations/procedure.schema.ts +59 -8
  48. package/src/backoffice/services/__tests__/brand.service.test.ts +0 -196
  49. package/src/backoffice/services/__tests__/category.service.test.ts +0 -201
  50. package/src/backoffice/services/__tests__/product.service.test.ts +0 -358
  51. package/src/backoffice/services/__tests__/requirement.service.test.ts +0 -226
  52. package/src/backoffice/services/__tests__/subcategory.service.test.ts +0 -181
  53. 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
  */
@@ -405,61 +663,23 @@ interface TechnologyDocumentationTemplate {
405
663
  interface Technology {
406
664
  id?: string;
407
665
  name: string;
408
- description: string;
409
- family: ProcedureFamily;
410
- categoryId: string;
411
- subcategoryId: string;
412
- technicalDetails?: string;
413
- requirements: {
414
- pre: Requirement[];
415
- post: Requirement[];
416
- };
417
- blockingConditions: BlockingCondition[];
418
- contraindications: Contraindication[];
419
- benefits: TreatmentBenefit[];
420
- certificationRequirement: CertificationRequirement;
421
- documentationTemplates?: TechnologyDocumentationTemplate[];
422
- isActive: boolean;
423
- createdAt: Date;
424
- updatedAt: Date;
425
- }
426
-
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;
666
+ description: string;
667
+ family: ProcedureFamily;
668
+ categoryId: string;
669
+ subcategoryId: string;
670
+ technicalDetails?: string;
671
+ requirements: {
672
+ pre: Requirement[];
673
+ post: Requirement[];
674
+ };
675
+ blockingConditions: BlockingCondition[];
676
+ contraindications: ContraindicationDynamic[];
677
+ benefits: TreatmentBenefitDynamic[];
678
+ certificationRequirement: CertificationRequirement;
679
+ documentationTemplates?: TechnologyDocumentationTemplate[];
680
+ isActive: boolean;
453
681
  createdAt: Date;
454
682
  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
683
  }
464
684
 
465
685
  declare enum PricingMeasure {
@@ -478,6 +698,38 @@ declare enum Currency {
478
698
  AUD = "AUD"
479
699
  }
480
700
 
701
+ /**
702
+ * @fileoverview Defines the ProcedureProduct type, which represents a product associated with a procedure,
703
+ * including its pricing information. This is used to allow procedures to have multiple products with different prices.
704
+ * @packageDocumentation
705
+ */
706
+
707
+ /**
708
+ * Represents a product associated with a procedure, including its specific pricing information.
709
+ */
710
+ interface ProcedureProduct {
711
+ /**
712
+ * The product used in the procedure.
713
+ * @see {@link Product}
714
+ */
715
+ product: Product;
716
+ /**
717
+ * The price of the procedure when using this specific product.
718
+ */
719
+ price: number;
720
+ /**
721
+ * The currency for the price of this product.
722
+ * @see {@link Currency}
723
+ */
724
+ currency: Currency;
725
+ /**
726
+ * How the price is measured (e.g., per ml, per zone).
727
+ * @see {@link PricingMeasure}
728
+ */
729
+ pricingMeasure: PricingMeasure;
730
+ isDefault?: boolean;
731
+ }
732
+
481
733
  /**
482
734
  * Type that allows a field to be either a URL string or a File object
483
735
  */
@@ -506,22 +758,27 @@ interface Procedure {
506
758
  subcategory: Subcategory;
507
759
  /** Technology used in this procedure */
508
760
  technology: Technology;
509
- /** Product used in this procedure */
761
+ /** Default product used in this procedure */
510
762
  product: Product;
511
- /** Price of the procedure */
763
+ /** Default price of the procedure */
512
764
  price: number;
513
765
  /** Currency for the price */
514
766
  currency: Currency;
515
- /** How the price is measured (per ml, per zone, etc.) */
767
+ /** How the price is measured (per ml, per zone, etc.) - for default product*/
516
768
  pricingMeasure: PricingMeasure;
517
769
  /** Duration of the procedure in minutes */
770
+ productsMetadata: ProcedureProduct[];
518
771
  duration: number;
519
772
  /** Blocking conditions that prevent this procedure */
520
773
  blockingConditions: BlockingCondition[];
521
774
  /** Treatment benefits of this procedure */
522
- treatmentBenefits: TreatmentBenefit[];
775
+ treatmentBenefits: TreatmentBenefitDynamic[];
776
+ /** A list of just the string IDs of the treatment benefits, for efficient querying. */
777
+ treatmentBenefitIds: string[];
523
778
  /** Contraindications of this procedure */
524
- contraindications: Contraindication[];
779
+ contraindications: ContraindicationDynamic[];
780
+ /** A list of just the string IDs of the contraindications, for efficient querying. */
781
+ contraindicationIds: string[];
525
782
  /** Pre-procedure requirements */
526
783
  preRequirements: Requirement[];
527
784
  /** Post-procedure requirements */
@@ -1012,7 +1269,7 @@ interface PatientMedicalInfo {
1012
1269
  notes?: string | null;
1013
1270
  }[];
1014
1271
  contraindications: {
1015
- condition: Contraindication;
1272
+ condition: ContraindicationDynamic;
1016
1273
  lastOccurrence: Timestamp;
1017
1274
  frequency: "rare" | "occasional" | "frequent";
1018
1275
  isActive: boolean;
@@ -1202,219 +1459,6 @@ interface PatientProfileInfo {
1202
1459
  gender: Gender;
1203
1460
  }
1204
1461
 
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
1462
  /**
1419
1463
  * Enum defining the possible statuses of an appointment.
1420
1464
  */
@@ -1628,7 +1672,7 @@ interface Appointment {
1628
1672
  paymentTransactionId?: string | null;
1629
1673
  /** Procedure-related conditions and requirements */
1630
1674
  blockingConditions: BlockingCondition[];
1631
- contraindications: Contraindication[];
1675
+ contraindications: ContraindicationDynamic[];
1632
1676
  preProcedureRequirements: Requirement[];
1633
1677
  postProcedureRequirements: Requirement[];
1634
1678
  /** Tracking information for requirements completion */