@blackcode_sa/metaestetics-api 1.11.1 → 1.11.2
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/dist/admin/index.d.mts +324 -330
- package/dist/admin/index.d.ts +324 -330
- package/dist/backoffice/index.d.mts +67 -283
- package/dist/backoffice/index.d.ts +67 -283
- package/dist/backoffice/index.js +6 -114
- package/dist/backoffice/index.mjs +6 -112
- package/dist/index.d.mts +3037 -3100
- package/dist/index.d.ts +3037 -3100
- package/dist/index.js +129 -379
- package/dist/index.mjs +130 -379
- package/package.json +1 -1
- package/src/backoffice/expo-safe/index.ts +0 -2
- package/src/backoffice/services/__tests__/brand.service.test.ts +196 -0
- package/src/backoffice/services/__tests__/category.service.test.ts +201 -0
- package/src/backoffice/services/__tests__/product.service.test.ts +358 -0
- package/src/backoffice/services/__tests__/requirement.service.test.ts +226 -0
- package/src/backoffice/services/__tests__/subcategory.service.test.ts +181 -0
- package/src/backoffice/services/__tests__/technology.service.test.ts +1097 -0
- package/src/backoffice/services/technology.service.ts +10 -122
- package/src/backoffice/types/index.ts +0 -1
- package/src/backoffice/types/product.types.ts +1 -3
- package/src/backoffice/types/technology.types.ts +4 -4
- package/src/backoffice/validations/schemas.ts +9 -35
- package/src/services/appointment/appointment.service.ts +5 -0
- package/src/services/appointment/utils/appointment.utils.ts +113 -124
- package/src/services/procedure/procedure.service.ts +234 -434
- package/src/types/appointment/index.ts +37 -43
- package/src/types/clinic/index.ts +6 -1
- package/src/types/patient/medical-info.types.ts +3 -3
- package/src/types/procedure/index.ts +17 -20
- package/src/validations/appointment.schema.ts +118 -170
- package/src/validations/clinic.schema.ts +6 -1
- package/src/validations/patient/medical-info.schema.ts +2 -7
- package/src/backoffice/services/README.md +0 -40
- package/src/backoffice/services/constants.service.ts +0 -268
- package/src/backoffice/types/admin-constants.types.ts +0 -69
package/dist/admin/index.d.mts
CHANGED
|
@@ -184,300 +184,33 @@ interface Category {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
|
-
*
|
|
188
|
-
|
|
189
|
-
|
|
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
|
|
187
|
+
* Podkategorija procedura
|
|
188
|
+
* Podkategorije su drugi nivo hijerarhije i pripadaju određenoj kategoriji
|
|
189
|
+
* One grupišu slične tehnologije u okviru kategorije
|
|
448
190
|
*
|
|
449
|
-
* @property id -
|
|
450
|
-
* @property name -
|
|
451
|
-
* @property description -
|
|
452
|
-
* @property
|
|
453
|
-
* @property
|
|
454
|
-
* @property
|
|
455
|
-
* @property
|
|
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
|
|
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
|
|
463
198
|
*/
|
|
464
|
-
interface
|
|
199
|
+
interface Subcategory {
|
|
200
|
+
/** Jedinstveni identifikator podkategorije (automatski generisan od strane Firestore) */
|
|
465
201
|
id?: string;
|
|
202
|
+
/** Naziv podkategorije */
|
|
466
203
|
name: string;
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
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 */
|
|
471
211
|
createdAt: Date;
|
|
212
|
+
/** Datum poslednjeg ažuriranja podkategorije */
|
|
472
213
|
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[];
|
|
481
214
|
}
|
|
482
215
|
|
|
483
216
|
/**
|
|
@@ -535,36 +268,6 @@ interface Requirement {
|
|
|
535
268
|
updatedAt: Date;
|
|
536
269
|
}
|
|
537
270
|
|
|
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
|
-
|
|
568
271
|
/**
|
|
569
272
|
* Blokirajući uslovi koji mogu sprečiti proceduru
|
|
570
273
|
* Ovi uslovi predstavljaju apsolutne kontraindikacije koje onemogućavaju izvođenje procedure
|
|
@@ -587,6 +290,47 @@ declare enum BlockingCondition {
|
|
|
587
290
|
EPILEPSY = "epilepsy"
|
|
588
291
|
}
|
|
589
292
|
|
|
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
|
+
|
|
590
334
|
/**
|
|
591
335
|
* Nivoi sertifikacije medicinskog osoblja, poređani od najnižeg do najvišeg
|
|
592
336
|
*/
|
|
@@ -671,8 +415,8 @@ interface Technology {
|
|
|
671
415
|
post: Requirement[];
|
|
672
416
|
};
|
|
673
417
|
blockingConditions: BlockingCondition[];
|
|
674
|
-
contraindications:
|
|
675
|
-
benefits:
|
|
418
|
+
contraindications: Contraindication[];
|
|
419
|
+
benefits: TreatmentBenefit[];
|
|
676
420
|
certificationRequirement: CertificationRequirement;
|
|
677
421
|
documentationTemplates?: TechnologyDocumentationTemplate[];
|
|
678
422
|
isActive: boolean;
|
|
@@ -680,6 +424,44 @@ interface Technology {
|
|
|
680
424
|
updatedAt: Date;
|
|
681
425
|
}
|
|
682
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;
|
|
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
|
+
|
|
683
465
|
declare enum PricingMeasure {
|
|
684
466
|
PER_ML = "per_ml",
|
|
685
467
|
PER_ZONE = "per_zone",
|
|
@@ -737,13 +519,9 @@ interface Procedure {
|
|
|
737
519
|
/** Blocking conditions that prevent this procedure */
|
|
738
520
|
blockingConditions: BlockingCondition[];
|
|
739
521
|
/** Treatment benefits of this procedure */
|
|
740
|
-
treatmentBenefits:
|
|
741
|
-
/** A list of just the string IDs of the treatment benefits, for efficient querying. */
|
|
742
|
-
treatmentBenefitIds: string[];
|
|
522
|
+
treatmentBenefits: TreatmentBenefit[];
|
|
743
523
|
/** Contraindications of this procedure */
|
|
744
|
-
contraindications:
|
|
745
|
-
/** A list of just the string IDs of the contraindications, for efficient querying. */
|
|
746
|
-
contraindicationIds: string[];
|
|
524
|
+
contraindications: Contraindication[];
|
|
747
525
|
/** Pre-procedure requirements */
|
|
748
526
|
preRequirements: Requirement[];
|
|
749
527
|
/** Post-procedure requirements */
|
|
@@ -1234,7 +1012,7 @@ interface PatientMedicalInfo {
|
|
|
1234
1012
|
notes?: string | null;
|
|
1235
1013
|
}[];
|
|
1236
1014
|
contraindications: {
|
|
1237
|
-
condition:
|
|
1015
|
+
condition: Contraindication;
|
|
1238
1016
|
lastOccurrence: Timestamp;
|
|
1239
1017
|
frequency: "rare" | "occasional" | "frequent";
|
|
1240
1018
|
isActive: boolean;
|
|
@@ -1424,6 +1202,219 @@ interface PatientProfileInfo {
|
|
|
1424
1202
|
gender: Gender;
|
|
1425
1203
|
}
|
|
1426
1204
|
|
|
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
|
+
|
|
1427
1418
|
/**
|
|
1428
1419
|
* Enum defining the possible statuses of an appointment.
|
|
1429
1420
|
*/
|
|
@@ -1525,7 +1516,8 @@ interface BeforeAfterPerZone {
|
|
|
1525
1516
|
/** URL for after photo or null if not available */
|
|
1526
1517
|
after: MediaResource | null;
|
|
1527
1518
|
/** Optional note for the zone */
|
|
1528
|
-
|
|
1519
|
+
afterNote?: string | null;
|
|
1520
|
+
beforeNote?: string | null;
|
|
1529
1521
|
}
|
|
1530
1522
|
/**
|
|
1531
1523
|
* Interface for billing information per zone
|
|
@@ -1547,6 +1539,8 @@ interface BillingPerZone {
|
|
|
1547
1539
|
Subtotal: number;
|
|
1548
1540
|
/** Optional billing note */
|
|
1549
1541
|
Note: string | null;
|
|
1542
|
+
/** Ion/Batch number for traceability */
|
|
1543
|
+
IonNumber: string | null;
|
|
1550
1544
|
}
|
|
1551
1545
|
/**
|
|
1552
1546
|
* Interface for final billing calculations of the appointment
|
|
@@ -1621,7 +1615,7 @@ interface Appointment {
|
|
|
1621
1615
|
actualDurationMinutes?: number;
|
|
1622
1616
|
/** Cancellation Details */
|
|
1623
1617
|
cancellationReason?: string | null;
|
|
1624
|
-
canceledBy?:
|
|
1618
|
+
canceledBy?: 'patient' | 'clinic' | 'practitioner' | 'system';
|
|
1625
1619
|
/** Notes */
|
|
1626
1620
|
internalNotes?: string | null;
|
|
1627
1621
|
patientNotes?: string | null;
|
|
@@ -1632,7 +1626,7 @@ interface Appointment {
|
|
|
1632
1626
|
paymentTransactionId?: string | null;
|
|
1633
1627
|
/** Procedure-related conditions and requirements */
|
|
1634
1628
|
blockingConditions: BlockingCondition[];
|
|
1635
|
-
contraindications:
|
|
1629
|
+
contraindications: Contraindication[];
|
|
1636
1630
|
preProcedureRequirements: Requirement[];
|
|
1637
1631
|
postProcedureRequirements: Requirement[];
|
|
1638
1632
|
/** Tracking information for requirements completion */
|