@blackcode_sa/metaestetics-api 1.11.0 → 1.11.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 (35) hide show
  1. package/dist/admin/index.d.mts +328 -319
  2. package/dist/admin/index.d.ts +328 -319
  3. package/dist/backoffice/index.d.mts +283 -67
  4. package/dist/backoffice/index.d.ts +283 -67
  5. package/dist/backoffice/index.js +114 -6
  6. package/dist/backoffice/index.mjs +112 -6
  7. package/dist/index.d.mts +3872 -3806
  8. package/dist/index.d.ts +3872 -3806
  9. package/dist/index.js +369 -123
  10. package/dist/index.mjs +369 -124
  11. package/package.json +1 -1
  12. package/src/backoffice/expo-safe/index.ts +2 -0
  13. package/src/backoffice/services/README.md +40 -0
  14. package/src/backoffice/services/constants.service.ts +268 -0
  15. package/src/backoffice/services/technology.service.ts +122 -10
  16. package/src/backoffice/types/admin-constants.types.ts +69 -0
  17. package/src/backoffice/types/index.ts +1 -0
  18. package/src/backoffice/types/product.types.ts +3 -1
  19. package/src/backoffice/types/technology.types.ts +4 -4
  20. package/src/backoffice/validations/schemas.ts +35 -9
  21. package/src/services/appointment/appointment.service.ts +0 -5
  22. package/src/services/appointment/utils/appointment.utils.ts +124 -113
  23. package/src/services/procedure/procedure.service.ts +434 -234
  24. package/src/types/appointment/index.ts +5 -3
  25. package/src/types/clinic/index.ts +1 -6
  26. package/src/types/patient/medical-info.types.ts +3 -3
  27. package/src/types/procedure/index.ts +20 -17
  28. package/src/validations/clinic.schema.ts +1 -6
  29. package/src/validations/patient/medical-info.schema.ts +7 -2
  30. package/src/backoffice/services/__tests__/brand.service.test.ts +0 -196
  31. package/src/backoffice/services/__tests__/category.service.test.ts +0 -201
  32. package/src/backoffice/services/__tests__/product.service.test.ts +0 -358
  33. package/src/backoffice/services/__tests__/requirement.service.test.ts +0 -226
  34. package/src/backoffice/services/__tests__/subcategory.service.test.ts +0 -181
  35. package/src/backoffice/services/__tests__/technology.service.test.ts +0 -1097
@@ -184,33 +184,300 @@ interface Category {
184
184
  }
185
185
 
186
186
  /**
187
- * Podkategorija procedura
188
- * Podkategorije su drugi nivo hijerarhije i pripadaju određenoj kategoriji
189
- * One grupišu slične tehnologije u okviru kategorije
187
+ * Enum for element types in documentation templates
188
+ */
189
+ declare enum DocumentElementType {
190
+ HEADING = "heading",
191
+ PARAGRAPH = "paragraph",
192
+ LIST = "list",
193
+ DYNAMIC_TEXT = "dynamic_text",
194
+ BINARY_CHOICE = "binary_choice",
195
+ MULTIPLE_CHOICE = "multiple_choice",
196
+ SINGLE_CHOICE = "single_choice",
197
+ RATING_SCALE = "rating_scale",
198
+ TEXT_INPUT = "text_input",
199
+ DATE_PICKER = "date_picker",
200
+ SIGNATURE = "signature",
201
+ DITIGAL_SIGNATURE = "digital_signature",
202
+ FILE_UPLOAD = "file_upload"
203
+ }
204
+ /**
205
+ * Enum for list types
206
+ */
207
+ declare enum ListType {
208
+ ORDERED = "ordered",
209
+ UNORDERED = "unordered"
210
+ }
211
+ /**
212
+ * Enum for heading levels
213
+ */
214
+ declare enum HeadingLevel {
215
+ H1 = "h1",
216
+ H2 = "h2",
217
+ H3 = "h3",
218
+ H4 = "h4",
219
+ H5 = "h5",
220
+ H6 = "h6"
221
+ }
222
+ /**
223
+ * Base interface for all document elements
224
+ */
225
+ interface BaseDocumentElement {
226
+ id: string;
227
+ type: DocumentElementType;
228
+ required?: boolean;
229
+ }
230
+ /**
231
+ * Interface for heading element
232
+ */
233
+ interface HeadingElement extends BaseDocumentElement {
234
+ type: DocumentElementType.HEADING;
235
+ text: string;
236
+ level: HeadingLevel;
237
+ }
238
+ /**
239
+ * Interface for paragraph element
240
+ */
241
+ interface ParagraphElement extends BaseDocumentElement {
242
+ type: DocumentElementType.PARAGRAPH;
243
+ text: string;
244
+ }
245
+ /**
246
+ * Interface for list element
247
+ */
248
+ interface ListElement extends BaseDocumentElement {
249
+ type: DocumentElementType.LIST;
250
+ items: string[];
251
+ listType: ListType;
252
+ }
253
+ /**
254
+ * Interface for dynamic text element
255
+ */
256
+ interface DynamicTextElement extends BaseDocumentElement {
257
+ type: DocumentElementType.DYNAMIC_TEXT;
258
+ text: string;
259
+ }
260
+ /**
261
+ * Interface for binary choice element (Yes/No)
262
+ */
263
+ interface BinaryChoiceElement extends BaseDocumentElement {
264
+ type: DocumentElementType.BINARY_CHOICE;
265
+ question: string;
266
+ defaultValue?: boolean;
267
+ }
268
+ /**
269
+ * Interface for multiple choice element
270
+ */
271
+ interface MultipleChoiceElement extends BaseDocumentElement {
272
+ type: DocumentElementType.MULTIPLE_CHOICE;
273
+ question: string;
274
+ options: string[];
275
+ defaultValues?: string[];
276
+ }
277
+ /**
278
+ * Interface for single choice element
279
+ */
280
+ interface SingleChoiceElement extends BaseDocumentElement {
281
+ type: DocumentElementType.SINGLE_CHOICE;
282
+ question: string;
283
+ options: string[];
284
+ defaultValue?: string;
285
+ }
286
+ /**
287
+ * Interface for rating scale element
288
+ */
289
+ interface RatingScaleElement extends BaseDocumentElement {
290
+ type: DocumentElementType.RATING_SCALE;
291
+ question: string;
292
+ min: number;
293
+ max: number;
294
+ labels?: {
295
+ [key: number]: string;
296
+ };
297
+ defaultValue?: number;
298
+ }
299
+ /**
300
+ * Interface for text input element
301
+ */
302
+ interface TextInputElement extends BaseDocumentElement {
303
+ type: DocumentElementType.TEXT_INPUT;
304
+ label: string;
305
+ placeholder?: string;
306
+ multiline?: boolean;
307
+ defaultValue?: string;
308
+ }
309
+ /**
310
+ * Interface for date picker element
311
+ */
312
+ interface DatePickerElement extends BaseDocumentElement {
313
+ type: DocumentElementType.DATE_PICKER;
314
+ label: string;
315
+ defaultValue?: string;
316
+ }
317
+ /**
318
+ * Interface for signature element
319
+ */
320
+ interface SignatureElement extends BaseDocumentElement {
321
+ type: DocumentElementType.SIGNATURE;
322
+ label: string;
323
+ }
324
+ /**
325
+ * Interface for file upload element
326
+ */
327
+ interface FileUploadElement extends BaseDocumentElement {
328
+ type: DocumentElementType.FILE_UPLOAD;
329
+ label: string;
330
+ allowedFileTypes?: string[];
331
+ maxFileSizeMB?: number;
332
+ }
333
+ /**
334
+ * Union type for all document elements
335
+ */
336
+ type DocumentElement = HeadingElement | ParagraphElement | ListElement | DynamicTextElement | BinaryChoiceElement | MultipleChoiceElement | SingleChoiceElement | RatingScaleElement | TextInputElement | DatePickerElement | SignatureElement | FileUploadElement;
337
+ /**
338
+ * Interface for document template
339
+ */
340
+ interface DocumentTemplate {
341
+ id: string;
342
+ title: string;
343
+ description?: string;
344
+ createdAt: number;
345
+ updatedAt: number;
346
+ createdBy: string;
347
+ elements: DocumentElement[];
348
+ tags?: string[];
349
+ isUserForm?: boolean;
350
+ isRequired?: boolean;
351
+ sortingOrder?: number;
352
+ version: number;
353
+ isActive: boolean;
354
+ }
355
+ /**
356
+ * Interface for a filled document (completed form)
357
+ */
358
+ interface FilledDocument {
359
+ id: string;
360
+ templateId: string;
361
+ templateVersion: number;
362
+ isUserForm: boolean;
363
+ isRequired: boolean;
364
+ procedureId: string;
365
+ appointmentId: string;
366
+ patientId: string;
367
+ practitionerId: string;
368
+ clinicId: string;
369
+ createdAt: number;
370
+ updatedAt: number;
371
+ values: {
372
+ [elementId: string]: any | FilledDocumentFileValue;
373
+ };
374
+ status: FilledDocumentStatus;
375
+ }
376
+ /**
377
+ * Enum for filled document status
378
+ */
379
+ declare enum FilledDocumentStatus {
380
+ DRAFT = "draft",
381
+ SKIPPED = "skipped",
382
+ PENDING = "pending",
383
+ COMPLETED = "completed",// When doctor or patient completes the form
384
+ SIGNED = "signed",// Only used for user forms
385
+ REJECTED = "rejected"
386
+ }
387
+ /**
388
+ * Interface for file upload results to be stored in filled document values
389
+ */
390
+ interface FilledDocumentFileValue {
391
+ mediaId: string;
392
+ url: string;
393
+ name: string;
394
+ contentType: string;
395
+ size: number;
396
+ uploadedAt: number;
397
+ }
398
+
399
+ /**
400
+ * @file Defines types for dynamically managed administrative constants,
401
+ * such as treatment benefits and contraindications. These are stored in
402
+ * the 'admin-constants' collection in Firestore.
403
+ */
404
+ /**
405
+ * Represents a single dynamic treatment benefit.
406
+ * These are positive effects or results a patient can expect from a treatment.
407
+ */
408
+ interface TreatmentBenefitDynamic {
409
+ /**
410
+ * A unique identifier for the benefit, typically in snake_case.
411
+ * @example "wrinkle_reduction"
412
+ */
413
+ id: string;
414
+ /**
415
+ * A human-readable name for the treatment benefit.
416
+ * @example "Wrinkle Reduction"
417
+ */
418
+ name: string;
419
+ /**
420
+ * A detailed description of the benefit.
421
+ */
422
+ description?: string;
423
+ }
424
+ /**
425
+ * Represents a single dynamic contraindication.
426
+ * These are conditions or factors that can affect a procedure and require special attention.
427
+ */
428
+ interface ContraindicationDynamic {
429
+ /**
430
+ * A unique identifier for the contraindication, typically in snake_case.
431
+ * @example "sensitive_skin"
432
+ */
433
+ id: string;
434
+ /**
435
+ * A human-readable name for the contraindication.
436
+ * @example "Sensitive Skin"
437
+ */
438
+ name: string;
439
+ /**
440
+ * A detailed description of the contraindication.
441
+ */
442
+ description?: string;
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 */
207
- categoryId: string;
208
- /** Flag koji označava da li je podkategorija aktivna */
209
- isActive: boolean;
210
- /** Datum kreiranja podkategorije */
467
+ brandId: string;
468
+ brandName: string;
469
+ technologyId: string;
470
+ technologyName: string;
211
471
  createdAt: Date;
212
- /** Datum poslednjeg ažuriranja podkategorije */
213
472
  updatedAt: Date;
473
+ isActive: boolean;
474
+ description?: string;
475
+ technicalDetails?: string;
476
+ warnings?: string[];
477
+ dosage?: string;
478
+ composition?: string;
479
+ indications?: string[];
480
+ contraindications?: ContraindicationDynamic[];
214
481
  }
215
482
 
216
483
  /**
@@ -268,6 +535,36 @@ interface Requirement {
268
535
  updatedAt: Date;
269
536
  }
270
537
 
538
+ /**
539
+ * Podkategorija procedura
540
+ * Podkategorije su drugi nivo hijerarhije i pripadaju određenoj kategoriji
541
+ * One grupišu slične tehnologije u okviru kategorije
542
+ *
543
+ * @property id - Jedinstveni identifikator podkategorije
544
+ * @property name - Naziv podkategorije
545
+ * @property description - Detaljan opis podkategorije i njene namene
546
+ * @property categoryId - ID kategorije kojoj podkategorija pripada
547
+ * @property isActive - Da li je podkategorija aktivna u sistemu
548
+ * @property createdAt - Datum kreiranja
549
+ * @property updatedAt - Datum poslednjeg ažuriranja
550
+ */
551
+ interface Subcategory {
552
+ /** Jedinstveni identifikator podkategorije (automatski generisan od strane Firestore) */
553
+ id?: string;
554
+ /** Naziv podkategorije */
555
+ name: string;
556
+ /** Detaljniji opis podkategorije */
557
+ description?: string;
558
+ /** ID kategorije kojoj podkategorija pripada */
559
+ categoryId: string;
560
+ /** Flag koji označava da li je podkategorija aktivna */
561
+ isActive: boolean;
562
+ /** Datum kreiranja podkategorije */
563
+ createdAt: Date;
564
+ /** Datum poslednjeg ažuriranja podkategorije */
565
+ updatedAt: Date;
566
+ }
567
+
271
568
  /**
272
569
  * Blokirajući uslovi koji mogu sprečiti proceduru
273
570
  * Ovi uslovi predstavljaju apsolutne kontraindikacije koje onemogućavaju izvođenje procedure
@@ -290,47 +587,6 @@ declare enum BlockingCondition {
290
587
  EPILEPSY = "epilepsy"
291
588
  }
292
589
 
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
590
  /**
335
591
  * Nivoi sertifikacije medicinskog osoblja, poređani od najnižeg do najvišeg
336
592
  */
@@ -415,8 +671,8 @@ interface Technology {
415
671
  post: Requirement[];
416
672
  };
417
673
  blockingConditions: BlockingCondition[];
418
- contraindications: Contraindication[];
419
- benefits: TreatmentBenefit[];
674
+ contraindications: ContraindicationDynamic[];
675
+ benefits: TreatmentBenefitDynamic[];
420
676
  certificationRequirement: CertificationRequirement;
421
677
  documentationTemplates?: TechnologyDocumentationTemplate[];
422
678
  isActive: boolean;
@@ -424,44 +680,6 @@ interface Technology {
424
680
  updatedAt: Date;
425
681
  }
426
682
 
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
683
  declare enum PricingMeasure {
466
684
  PER_ML = "per_ml",
467
685
  PER_ZONE = "per_zone",
@@ -519,9 +737,13 @@ interface Procedure {
519
737
  /** Blocking conditions that prevent this procedure */
520
738
  blockingConditions: BlockingCondition[];
521
739
  /** Treatment benefits of this procedure */
522
- treatmentBenefits: TreatmentBenefit[];
740
+ treatmentBenefits: TreatmentBenefitDynamic[];
741
+ /** A list of just the string IDs of the treatment benefits, for efficient querying. */
742
+ treatmentBenefitIds: string[];
523
743
  /** Contraindications of this procedure */
524
- contraindications: Contraindication[];
744
+ contraindications: ContraindicationDynamic[];
745
+ /** A list of just the string IDs of the contraindications, for efficient querying. */
746
+ contraindicationIds: string[];
525
747
  /** Pre-procedure requirements */
526
748
  preRequirements: Requirement[];
527
749
  /** Post-procedure requirements */
@@ -1012,7 +1234,7 @@ interface PatientMedicalInfo {
1012
1234
  notes?: string | null;
1013
1235
  }[];
1014
1236
  contraindications: {
1015
- condition: Contraindication;
1237
+ condition: ContraindicationDynamic;
1016
1238
  lastOccurrence: Timestamp;
1017
1239
  frequency: "rare" | "occasional" | "frequent";
1018
1240
  isActive: boolean;
@@ -1202,219 +1424,6 @@ interface PatientProfileInfo {
1202
1424
  gender: Gender;
1203
1425
  }
1204
1426
 
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
1427
  /**
1419
1428
  * Enum defining the possible statuses of an appointment.
1420
1429
  */
@@ -1623,7 +1632,7 @@ interface Appointment {
1623
1632
  paymentTransactionId?: string | null;
1624
1633
  /** Procedure-related conditions and requirements */
1625
1634
  blockingConditions: BlockingCondition[];
1626
- contraindications: Contraindication[];
1635
+ contraindications: ContraindicationDynamic[];
1627
1636
  preProcedureRequirements: Requirement[];
1628
1637
  postProcedureRequirements: Requirement[];
1629
1638
  /** Tracking information for requirements completion */