@blackcode_sa/metaestetics-api 1.6.23 → 1.6.25
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 +31 -3
- package/dist/admin/index.d.ts +31 -3
- package/dist/admin/index.js +126 -36
- package/dist/admin/index.mjs +126 -36
- package/dist/backoffice/index.d.mts +82 -55
- package/dist/backoffice/index.d.ts +82 -55
- package/dist/backoffice/index.js +85 -4
- package/dist/backoffice/index.mjs +85 -4
- package/dist/index.d.mts +419 -392
- package/dist/index.d.ts +419 -392
- package/dist/index.js +65 -2
- package/dist/index.mjs +65 -2
- package/package.json +1 -1
- package/src/admin/booking/booking.admin.ts +8 -5
- package/src/admin/documentation-templates/document-manager.admin.ts +128 -0
- package/src/backoffice/services/documentation-template.service.ts +28 -2
- package/src/backoffice/types/technology.types.ts +16 -2
- package/src/services/documentation-templates/documentation-template.service.ts +100 -3
- package/src/types/procedure/index.ts +5 -2
package/dist/index.d.mts
CHANGED
|
@@ -355,265 +355,18 @@ interface CertificationRequirement {
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
/**
|
|
358
|
-
*
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
*
|
|
362
|
-
|
|
363
|
-
declare const DOCUMENTATION_TEMPLATES_COLLECTION = "documentation-templates";
|
|
364
|
-
declare const FILLED_DOCUMENTS_COLLECTION = "filled-documents";
|
|
365
|
-
declare const USER_FORMS_SUBCOLLECTION = "user-forms";
|
|
366
|
-
declare const DOCTOR_FORMS_SUBCOLLECTION = "doctor-forms";
|
|
367
|
-
/**
|
|
368
|
-
* Enum for element types in documentation templates
|
|
369
|
-
*/
|
|
370
|
-
declare enum DocumentElementType {
|
|
371
|
-
HEADING = "heading",
|
|
372
|
-
PARAGRAPH = "paragraph",
|
|
373
|
-
LIST = "list",
|
|
374
|
-
DYNAMIC_TEXT = "dynamic_text",
|
|
375
|
-
BINARY_CHOICE = "binary_choice",
|
|
376
|
-
MULTIPLE_CHOICE = "multiple_choice",
|
|
377
|
-
SINGLE_CHOICE = "single_choice",
|
|
378
|
-
RATING_SCALE = "rating_scale",
|
|
379
|
-
TEXT_INPUT = "text_input",
|
|
380
|
-
DATE_PICKER = "date_picker",
|
|
381
|
-
SIGNATURE = "signature",
|
|
382
|
-
DITIGAL_SIGNATURE = "digital_signature",
|
|
383
|
-
FILE_UPLOAD = "file_upload"
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Enum for list types
|
|
387
|
-
*/
|
|
388
|
-
declare enum ListType {
|
|
389
|
-
ORDERED = "ordered",
|
|
390
|
-
UNORDERED = "unordered"
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Enum for heading levels
|
|
394
|
-
*/
|
|
395
|
-
declare enum HeadingLevel {
|
|
396
|
-
H1 = "h1",
|
|
397
|
-
H2 = "h2",
|
|
398
|
-
H3 = "h3",
|
|
399
|
-
H4 = "h4",
|
|
400
|
-
H5 = "h5",
|
|
401
|
-
H6 = "h6"
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Enum for dynamic variable placeholders
|
|
405
|
-
*/
|
|
406
|
-
declare enum DynamicVariable {
|
|
407
|
-
PATIENT_NAME = "$[PATIENT_NAME]",
|
|
408
|
-
DOCTOR_NAME = "$[DOCTOR_NAME]",
|
|
409
|
-
CLINIC_NAME = "$[CLINIC_NAME]",
|
|
410
|
-
PATIENT_BIRTHDAY = "$[PATIENT_BIRTHDAY]",
|
|
411
|
-
APPOINTMENT_DATE = "$[APPOINTMENT_DATE]",
|
|
412
|
-
CURRENT_DATE = "$[CURRENT_DATE]",
|
|
413
|
-
PROCEDURE_NAME = "$[PROCEDURE_NAME]",
|
|
414
|
-
PROCEDURE_DESCRIPTION = "$[PROCEDURE_DESCRIPTION]",
|
|
415
|
-
PROCEDURE_COST = "$[PROCEDURE_COST]",
|
|
416
|
-
PROCEDURE_DURATION = "$[PROCEDURE_DURATION]",
|
|
417
|
-
PROCEDURE_RISK = "$[PROCEDURE_RISK]"
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Base interface for all document elements
|
|
421
|
-
*/
|
|
422
|
-
interface BaseDocumentElement {
|
|
423
|
-
id: string;
|
|
424
|
-
type: DocumentElementType;
|
|
425
|
-
required?: boolean;
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Interface for heading element
|
|
429
|
-
*/
|
|
430
|
-
interface HeadingElement extends BaseDocumentElement {
|
|
431
|
-
type: DocumentElementType.HEADING;
|
|
432
|
-
text: string;
|
|
433
|
-
level: HeadingLevel;
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Interface for paragraph element
|
|
437
|
-
*/
|
|
438
|
-
interface ParagraphElement extends BaseDocumentElement {
|
|
439
|
-
type: DocumentElementType.PARAGRAPH;
|
|
440
|
-
text: string;
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* Interface for list element
|
|
444
|
-
*/
|
|
445
|
-
interface ListElement extends BaseDocumentElement {
|
|
446
|
-
type: DocumentElementType.LIST;
|
|
447
|
-
items: string[];
|
|
448
|
-
listType: ListType;
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* Interface for dynamic text element
|
|
452
|
-
*/
|
|
453
|
-
interface DynamicTextElement extends BaseDocumentElement {
|
|
454
|
-
type: DocumentElementType.DYNAMIC_TEXT;
|
|
455
|
-
text: string;
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Interface for binary choice element (Yes/No)
|
|
459
|
-
*/
|
|
460
|
-
interface BinaryChoiceElement extends BaseDocumentElement {
|
|
461
|
-
type: DocumentElementType.BINARY_CHOICE;
|
|
462
|
-
question: string;
|
|
463
|
-
defaultValue?: boolean;
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Interface for multiple choice element
|
|
467
|
-
*/
|
|
468
|
-
interface MultipleChoiceElement extends BaseDocumentElement {
|
|
469
|
-
type: DocumentElementType.MULTIPLE_CHOICE;
|
|
470
|
-
question: string;
|
|
471
|
-
options: string[];
|
|
472
|
-
defaultValues?: string[];
|
|
473
|
-
}
|
|
474
|
-
/**
|
|
475
|
-
* Interface for single choice element
|
|
476
|
-
*/
|
|
477
|
-
interface SingleChoiceElement extends BaseDocumentElement {
|
|
478
|
-
type: DocumentElementType.SINGLE_CHOICE;
|
|
479
|
-
question: string;
|
|
480
|
-
options: string[];
|
|
481
|
-
defaultValue?: string;
|
|
482
|
-
}
|
|
483
|
-
/**
|
|
484
|
-
* Interface for rating scale element
|
|
485
|
-
*/
|
|
486
|
-
interface RatingScaleElement extends BaseDocumentElement {
|
|
487
|
-
type: DocumentElementType.RATING_SCALE;
|
|
488
|
-
question: string;
|
|
489
|
-
min: number;
|
|
490
|
-
max: number;
|
|
491
|
-
labels?: {
|
|
492
|
-
[key: number]: string;
|
|
493
|
-
};
|
|
494
|
-
defaultValue?: number;
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Interface for text input element
|
|
498
|
-
*/
|
|
499
|
-
interface TextInputElement extends BaseDocumentElement {
|
|
500
|
-
type: DocumentElementType.TEXT_INPUT;
|
|
501
|
-
label: string;
|
|
502
|
-
placeholder?: string;
|
|
503
|
-
multiline?: boolean;
|
|
504
|
-
defaultValue?: string;
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* Interface for date picker element
|
|
508
|
-
*/
|
|
509
|
-
interface DatePickerElement extends BaseDocumentElement {
|
|
510
|
-
type: DocumentElementType.DATE_PICKER;
|
|
511
|
-
label: string;
|
|
512
|
-
defaultValue?: string;
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* Interface for signature element
|
|
516
|
-
*/
|
|
517
|
-
interface SignatureElement extends BaseDocumentElement {
|
|
518
|
-
type: DocumentElementType.SIGNATURE;
|
|
519
|
-
label: string;
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* Interface for digital signature element
|
|
523
|
-
*/
|
|
524
|
-
interface DigitalSignatureElement extends BaseDocumentElement {
|
|
525
|
-
type: DocumentElementType.DITIGAL_SIGNATURE;
|
|
526
|
-
label: string;
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Interface for file upload element
|
|
530
|
-
*/
|
|
531
|
-
interface FileUploadElement extends BaseDocumentElement {
|
|
532
|
-
type: DocumentElementType.FILE_UPLOAD;
|
|
533
|
-
label: string;
|
|
534
|
-
allowedFileTypes?: string[];
|
|
535
|
-
maxFileSizeMB?: number;
|
|
536
|
-
}
|
|
537
|
-
/**
|
|
538
|
-
* Union type for all document elements
|
|
539
|
-
*/
|
|
540
|
-
type DocumentElement = HeadingElement | ParagraphElement | ListElement | DynamicTextElement | BinaryChoiceElement | MultipleChoiceElement | SingleChoiceElement | RatingScaleElement | TextInputElement | DatePickerElement | SignatureElement | FileUploadElement;
|
|
541
|
-
/**
|
|
542
|
-
* Interface for document template
|
|
543
|
-
*/
|
|
544
|
-
interface DocumentTemplate {
|
|
545
|
-
id: string;
|
|
546
|
-
title: string;
|
|
547
|
-
description?: string;
|
|
548
|
-
createdAt: number;
|
|
549
|
-
updatedAt: number;
|
|
550
|
-
createdBy: string;
|
|
551
|
-
elements: DocumentElement[];
|
|
552
|
-
tags?: string[];
|
|
553
|
-
isUserForm?: boolean;
|
|
554
|
-
isRequired?: boolean;
|
|
555
|
-
sortingOrder?: number;
|
|
556
|
-
version: number;
|
|
557
|
-
isActive: boolean;
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* Interface for creating a new document template
|
|
561
|
-
*/
|
|
562
|
-
interface CreateDocumentTemplateData {
|
|
563
|
-
title: string;
|
|
564
|
-
description?: string;
|
|
565
|
-
elements: Omit<DocumentElement, "id">[];
|
|
566
|
-
tags?: string[];
|
|
567
|
-
isUserForm?: boolean;
|
|
568
|
-
isRequired?: boolean;
|
|
569
|
-
sortingOrder?: number;
|
|
570
|
-
}
|
|
571
|
-
/**
|
|
572
|
-
* Interface for updating an existing document template
|
|
573
|
-
*/
|
|
574
|
-
interface UpdateDocumentTemplateData {
|
|
575
|
-
title?: string;
|
|
576
|
-
description?: string;
|
|
577
|
-
elements?: Omit<DocumentElement, "id">[];
|
|
578
|
-
tags?: string[];
|
|
579
|
-
isActive?: boolean;
|
|
580
|
-
isUserForm?: boolean;
|
|
581
|
-
isRequired?: boolean;
|
|
582
|
-
sortingOrder?: number;
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* Interface for a filled document (completed form)
|
|
358
|
+
* Reference to a documentation template with metadata
|
|
359
|
+
* @property templateId - ID of the documentation template
|
|
360
|
+
* @property isUserForm - Whether this template is filled by users
|
|
361
|
+
* @property isRequired - Whether this template is required
|
|
362
|
+
* @property sortingOrder - The display order of this template
|
|
586
363
|
*/
|
|
587
|
-
interface
|
|
588
|
-
id: string;
|
|
364
|
+
interface TechnologyDocumentationTemplate {
|
|
589
365
|
templateId: string;
|
|
590
|
-
templateVersion: number;
|
|
591
366
|
isUserForm: boolean;
|
|
592
367
|
isRequired: boolean;
|
|
593
|
-
|
|
594
|
-
appointmentId: string;
|
|
595
|
-
patientId: string;
|
|
596
|
-
practitionerId: string;
|
|
597
|
-
clinicId: string;
|
|
598
|
-
createdAt: number;
|
|
599
|
-
updatedAt: number;
|
|
600
|
-
values: {
|
|
601
|
-
[elementId: string]: any;
|
|
602
|
-
};
|
|
603
|
-
status: FilledDocumentStatus;
|
|
604
|
-
}
|
|
605
|
-
/**
|
|
606
|
-
* Enum for filled document status
|
|
607
|
-
*/
|
|
608
|
-
declare enum FilledDocumentStatus {
|
|
609
|
-
DRAFT = "draft",
|
|
610
|
-
SKIPPED = "skipped",
|
|
611
|
-
PENDING = "pending",
|
|
612
|
-
COMPLETED = "completed",// When doctor or patient completes the form
|
|
613
|
-
SIGNED = "signed",// Only used for user forms
|
|
614
|
-
REJECTED = "rejected"
|
|
368
|
+
sortingOrder: number;
|
|
615
369
|
}
|
|
616
|
-
|
|
617
370
|
/**
|
|
618
371
|
* Technology used in medical procedures
|
|
619
372
|
* Technologies are now a top-level collection that reference their full path in the hierarchy
|
|
@@ -631,7 +384,7 @@ declare enum FilledDocumentStatus {
|
|
|
631
384
|
* @property contraindications - List of conditions requiring special attention
|
|
632
385
|
* @property benefits - List of expected benefits from the procedure
|
|
633
386
|
* @property certificationRequirement - Required certification level and specialties
|
|
634
|
-
* @property documentationTemplates - List of documentation
|
|
387
|
+
* @property documentationTemplates - List of documentation template references
|
|
635
388
|
* @property isActive - Whether the technology is active in the system
|
|
636
389
|
* @property createdAt - Creation date
|
|
637
390
|
* @property updatedAt - Last update date
|
|
@@ -652,7 +405,7 @@ interface Technology {
|
|
|
652
405
|
contraindications: Contraindication[];
|
|
653
406
|
benefits: TreatmentBenefit[];
|
|
654
407
|
certificationRequirement: CertificationRequirement;
|
|
655
|
-
documentationTemplates?:
|
|
408
|
+
documentationTemplates?: TechnologyDocumentationTemplate[];
|
|
656
409
|
isActive: boolean;
|
|
657
410
|
createdAt: Date;
|
|
658
411
|
updatedAt: Date;
|
|
@@ -797,7 +550,7 @@ interface Procedure {
|
|
|
797
550
|
/** Certification requirements for performing this procedure */
|
|
798
551
|
certificationRequirement: CertificationRequirement;
|
|
799
552
|
/** Documentation templates required for this procedure */
|
|
800
|
-
documentationTemplates:
|
|
553
|
+
documentationTemplates: TechnologyDocumentationTemplate[];
|
|
801
554
|
/** ID of the practitioner who performs this procedure */
|
|
802
555
|
practitionerId: string;
|
|
803
556
|
/** ID of the clinic branch where this procedure is performed */
|
|
@@ -1809,181 +1562,441 @@ interface CreatePatientLocationInfoData {
|
|
|
1809
1562
|
locationData: LocationData;
|
|
1810
1563
|
}
|
|
1811
1564
|
/**
|
|
1812
|
-
* Tip za ažuriranje lokacijskih informacija
|
|
1565
|
+
* Tip za ažuriranje lokacijskih informacija
|
|
1566
|
+
*/
|
|
1567
|
+
interface UpdatePatientLocationInfoData extends Partial<CreatePatientLocationInfoData> {
|
|
1568
|
+
updatedAt?: FieldValue;
|
|
1569
|
+
}
|
|
1570
|
+
/**
|
|
1571
|
+
* Interfejs za osetljive informacije pacijenta (subkolekcija)
|
|
1572
|
+
*/
|
|
1573
|
+
interface PatientSensitiveInfo {
|
|
1574
|
+
patientId: string;
|
|
1575
|
+
userRef: string;
|
|
1576
|
+
photoUrl?: string;
|
|
1577
|
+
firstName: string;
|
|
1578
|
+
lastName: string;
|
|
1579
|
+
dateOfBirth: Timestamp | null;
|
|
1580
|
+
gender: Gender;
|
|
1581
|
+
email?: string;
|
|
1582
|
+
phoneNumber?: string;
|
|
1583
|
+
alternativePhoneNumber?: string;
|
|
1584
|
+
addressData?: AddressData;
|
|
1585
|
+
emergencyContacts?: EmergencyContact[];
|
|
1586
|
+
createdAt: Timestamp;
|
|
1587
|
+
updatedAt: Timestamp;
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* Tip za kreiranje osetljivih informacija
|
|
1591
|
+
*/
|
|
1592
|
+
interface CreatePatientSensitiveInfoData {
|
|
1593
|
+
patientId: string;
|
|
1594
|
+
userRef: string;
|
|
1595
|
+
photoUrl?: string;
|
|
1596
|
+
firstName: string;
|
|
1597
|
+
lastName: string;
|
|
1598
|
+
dateOfBirth: Timestamp | null;
|
|
1599
|
+
gender: Gender;
|
|
1600
|
+
email?: string;
|
|
1601
|
+
phoneNumber?: string;
|
|
1602
|
+
alternativePhoneNumber?: string;
|
|
1603
|
+
addressData?: AddressData;
|
|
1604
|
+
emergencyContacts?: EmergencyContact[];
|
|
1605
|
+
}
|
|
1606
|
+
/**
|
|
1607
|
+
* Tip za ažuriranje osetljivih informacija
|
|
1608
|
+
*/
|
|
1609
|
+
interface UpdatePatientSensitiveInfoData extends Partial<CreatePatientSensitiveInfoData> {
|
|
1610
|
+
updatedAt?: FieldValue;
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Interfejs za doktora pacijenta
|
|
1614
|
+
*/
|
|
1615
|
+
interface PatientDoctor {
|
|
1616
|
+
userRef: string;
|
|
1617
|
+
assignedAt: Timestamp;
|
|
1618
|
+
assignedBy?: string;
|
|
1619
|
+
isActive: boolean;
|
|
1620
|
+
notes?: string;
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Interfejs za kliniku pacijenta
|
|
1624
|
+
*/
|
|
1625
|
+
interface PatientClinic {
|
|
1626
|
+
clinicId: string;
|
|
1627
|
+
assignedAt: Timestamp;
|
|
1628
|
+
assignedBy?: string;
|
|
1629
|
+
isActive: boolean;
|
|
1630
|
+
notes?: string;
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Glavni interfejs za Patient profil (top-level kolekcija)
|
|
1634
|
+
*/
|
|
1635
|
+
interface PatientProfile {
|
|
1636
|
+
id: string;
|
|
1637
|
+
userRef: string;
|
|
1638
|
+
displayName: string;
|
|
1639
|
+
profilePhoto: string | null;
|
|
1640
|
+
gamification: GamificationInfo;
|
|
1641
|
+
expoTokens: string[];
|
|
1642
|
+
isActive: boolean;
|
|
1643
|
+
isVerified: boolean;
|
|
1644
|
+
phoneNumber?: string | null;
|
|
1645
|
+
dateOfBirth?: Timestamp | null;
|
|
1646
|
+
doctors: PatientDoctor[];
|
|
1647
|
+
clinics: PatientClinic[];
|
|
1648
|
+
doctorIds: string[];
|
|
1649
|
+
clinicIds: string[];
|
|
1650
|
+
createdAt: Timestamp;
|
|
1651
|
+
updatedAt: Timestamp;
|
|
1652
|
+
}
|
|
1653
|
+
/**
|
|
1654
|
+
* Tip za kreiranje novog Patient profila
|
|
1655
|
+
*/
|
|
1656
|
+
interface CreatePatientProfileData {
|
|
1657
|
+
userRef: string;
|
|
1658
|
+
displayName: string;
|
|
1659
|
+
expoTokens: string[];
|
|
1660
|
+
gamification?: GamificationInfo;
|
|
1661
|
+
isActive: boolean;
|
|
1662
|
+
isVerified: boolean;
|
|
1663
|
+
doctors?: PatientDoctor[];
|
|
1664
|
+
clinics?: PatientClinic[];
|
|
1665
|
+
doctorIds?: string[];
|
|
1666
|
+
clinicIds?: string[];
|
|
1667
|
+
}
|
|
1668
|
+
/**
|
|
1669
|
+
* Tip za ažuriranje Patient profila
|
|
1670
|
+
*/
|
|
1671
|
+
interface UpdatePatientProfileData extends Partial<Omit<PatientProfile, 'id' | 'createdAt' | 'updatedAt'>> {
|
|
1672
|
+
updatedAt?: FieldValue;
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* Parameters for searching patient profiles.
|
|
1676
|
+
*/
|
|
1677
|
+
interface SearchPatientsParams {
|
|
1678
|
+
/** Optional: Filter patients associated with this clinic ID. */
|
|
1679
|
+
clinicId?: string;
|
|
1680
|
+
/** Optional: Filter patients associated with this practitioner ID. */
|
|
1681
|
+
practitionerId?: string;
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* Information about the entity requesting the patient search.
|
|
1685
|
+
*/
|
|
1686
|
+
interface RequesterInfo {
|
|
1687
|
+
/** ID of the clinic admin user or practitioner user making the request. */
|
|
1688
|
+
id: string;
|
|
1689
|
+
/** Role of the requester, determining the search context. */
|
|
1690
|
+
role: 'clinic_admin' | 'practitioner';
|
|
1691
|
+
/** If role is 'clinic_admin', this is the associated clinic ID. */
|
|
1692
|
+
associatedClinicId?: string;
|
|
1693
|
+
/** If role is 'practitioner', this is the associated practitioner profile ID. */
|
|
1694
|
+
associatedPractitionerId?: string;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
interface PatientProfileComplete {
|
|
1698
|
+
patientProfile?: PatientProfile;
|
|
1699
|
+
patientSensitiveInfo?: PatientSensitiveInfo;
|
|
1700
|
+
patientMedicalInfo?: PatientMedicalInfo;
|
|
1701
|
+
patientLocationInfo?: PatientLocationInfo;
|
|
1702
|
+
}
|
|
1703
|
+
interface PatientProfileForDoctor {
|
|
1704
|
+
patientProfile?: PatientProfile;
|
|
1705
|
+
patientSensitiveInfo?: PatientSensitiveInfo;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Interface for clinic profile information
|
|
1710
|
+
*/
|
|
1711
|
+
interface ClinicInfo {
|
|
1712
|
+
id: string;
|
|
1713
|
+
featuredPhoto: string;
|
|
1714
|
+
name: string;
|
|
1715
|
+
description?: string | null;
|
|
1716
|
+
location: ClinicLocation;
|
|
1717
|
+
contactInfo: ClinicContactInfo;
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Interface for practitioner profile information
|
|
1721
|
+
*/
|
|
1722
|
+
interface PractitionerProfileInfo {
|
|
1723
|
+
id: string;
|
|
1724
|
+
practitionerPhoto: string | null;
|
|
1725
|
+
name: string;
|
|
1726
|
+
email: string;
|
|
1727
|
+
phone: string | null;
|
|
1728
|
+
certification: PractitionerCertification;
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Interface for patient profile information
|
|
1732
|
+
*/
|
|
1733
|
+
interface PatientProfileInfo {
|
|
1734
|
+
id: string;
|
|
1735
|
+
fullName: string;
|
|
1736
|
+
email: string;
|
|
1737
|
+
phone: string | null;
|
|
1738
|
+
dateOfBirth: Timestamp$1;
|
|
1739
|
+
gender: Gender;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
/**
|
|
1743
|
+
* Types for the Medical Documentation Templating System
|
|
1744
|
+
*/
|
|
1745
|
+
/**
|
|
1746
|
+
* Kolekcija u Firestore bazi gde se čuvaju dokumentacijske šablone
|
|
1747
|
+
*/
|
|
1748
|
+
declare const DOCUMENTATION_TEMPLATES_COLLECTION = "documentation-templates";
|
|
1749
|
+
declare const FILLED_DOCUMENTS_COLLECTION = "filled-documents";
|
|
1750
|
+
declare const USER_FORMS_SUBCOLLECTION = "user-forms";
|
|
1751
|
+
declare const DOCTOR_FORMS_SUBCOLLECTION = "doctor-forms";
|
|
1752
|
+
/**
|
|
1753
|
+
* Enum for element types in documentation templates
|
|
1754
|
+
*/
|
|
1755
|
+
declare enum DocumentElementType {
|
|
1756
|
+
HEADING = "heading",
|
|
1757
|
+
PARAGRAPH = "paragraph",
|
|
1758
|
+
LIST = "list",
|
|
1759
|
+
DYNAMIC_TEXT = "dynamic_text",
|
|
1760
|
+
BINARY_CHOICE = "binary_choice",
|
|
1761
|
+
MULTIPLE_CHOICE = "multiple_choice",
|
|
1762
|
+
SINGLE_CHOICE = "single_choice",
|
|
1763
|
+
RATING_SCALE = "rating_scale",
|
|
1764
|
+
TEXT_INPUT = "text_input",
|
|
1765
|
+
DATE_PICKER = "date_picker",
|
|
1766
|
+
SIGNATURE = "signature",
|
|
1767
|
+
DITIGAL_SIGNATURE = "digital_signature",
|
|
1768
|
+
FILE_UPLOAD = "file_upload"
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* Enum for list types
|
|
1772
|
+
*/
|
|
1773
|
+
declare enum ListType {
|
|
1774
|
+
ORDERED = "ordered",
|
|
1775
|
+
UNORDERED = "unordered"
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* Enum for heading levels
|
|
1779
|
+
*/
|
|
1780
|
+
declare enum HeadingLevel {
|
|
1781
|
+
H1 = "h1",
|
|
1782
|
+
H2 = "h2",
|
|
1783
|
+
H3 = "h3",
|
|
1784
|
+
H4 = "h4",
|
|
1785
|
+
H5 = "h5",
|
|
1786
|
+
H6 = "h6"
|
|
1787
|
+
}
|
|
1788
|
+
/**
|
|
1789
|
+
* Enum for dynamic variable placeholders
|
|
1790
|
+
*/
|
|
1791
|
+
declare enum DynamicVariable {
|
|
1792
|
+
PATIENT_NAME = "$[PATIENT_NAME]",
|
|
1793
|
+
DOCTOR_NAME = "$[DOCTOR_NAME]",
|
|
1794
|
+
CLINIC_NAME = "$[CLINIC_NAME]",
|
|
1795
|
+
PATIENT_BIRTHDAY = "$[PATIENT_BIRTHDAY]",
|
|
1796
|
+
APPOINTMENT_DATE = "$[APPOINTMENT_DATE]",
|
|
1797
|
+
CURRENT_DATE = "$[CURRENT_DATE]",
|
|
1798
|
+
PROCEDURE_NAME = "$[PROCEDURE_NAME]",
|
|
1799
|
+
PROCEDURE_DESCRIPTION = "$[PROCEDURE_DESCRIPTION]",
|
|
1800
|
+
PROCEDURE_COST = "$[PROCEDURE_COST]",
|
|
1801
|
+
PROCEDURE_DURATION = "$[PROCEDURE_DURATION]",
|
|
1802
|
+
PROCEDURE_RISK = "$[PROCEDURE_RISK]"
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* Base interface for all document elements
|
|
1806
|
+
*/
|
|
1807
|
+
interface BaseDocumentElement {
|
|
1808
|
+
id: string;
|
|
1809
|
+
type: DocumentElementType;
|
|
1810
|
+
required?: boolean;
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* Interface for heading element
|
|
1814
|
+
*/
|
|
1815
|
+
interface HeadingElement extends BaseDocumentElement {
|
|
1816
|
+
type: DocumentElementType.HEADING;
|
|
1817
|
+
text: string;
|
|
1818
|
+
level: HeadingLevel;
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Interface for paragraph element
|
|
1822
|
+
*/
|
|
1823
|
+
interface ParagraphElement extends BaseDocumentElement {
|
|
1824
|
+
type: DocumentElementType.PARAGRAPH;
|
|
1825
|
+
text: string;
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* Interface for list element
|
|
1829
|
+
*/
|
|
1830
|
+
interface ListElement extends BaseDocumentElement {
|
|
1831
|
+
type: DocumentElementType.LIST;
|
|
1832
|
+
items: string[];
|
|
1833
|
+
listType: ListType;
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* Interface for dynamic text element
|
|
1837
|
+
*/
|
|
1838
|
+
interface DynamicTextElement extends BaseDocumentElement {
|
|
1839
|
+
type: DocumentElementType.DYNAMIC_TEXT;
|
|
1840
|
+
text: string;
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* Interface for binary choice element (Yes/No)
|
|
1813
1844
|
*/
|
|
1814
|
-
interface
|
|
1815
|
-
|
|
1845
|
+
interface BinaryChoiceElement extends BaseDocumentElement {
|
|
1846
|
+
type: DocumentElementType.BINARY_CHOICE;
|
|
1847
|
+
question: string;
|
|
1848
|
+
defaultValue?: boolean;
|
|
1816
1849
|
}
|
|
1817
1850
|
/**
|
|
1818
|
-
*
|
|
1851
|
+
* Interface for multiple choice element
|
|
1819
1852
|
*/
|
|
1820
|
-
interface
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
lastName: string;
|
|
1826
|
-
dateOfBirth: Timestamp | null;
|
|
1827
|
-
gender: Gender;
|
|
1828
|
-
email?: string;
|
|
1829
|
-
phoneNumber?: string;
|
|
1830
|
-
alternativePhoneNumber?: string;
|
|
1831
|
-
addressData?: AddressData;
|
|
1832
|
-
emergencyContacts?: EmergencyContact[];
|
|
1833
|
-
createdAt: Timestamp;
|
|
1834
|
-
updatedAt: Timestamp;
|
|
1853
|
+
interface MultipleChoiceElement extends BaseDocumentElement {
|
|
1854
|
+
type: DocumentElementType.MULTIPLE_CHOICE;
|
|
1855
|
+
question: string;
|
|
1856
|
+
options: string[];
|
|
1857
|
+
defaultValues?: string[];
|
|
1835
1858
|
}
|
|
1836
1859
|
/**
|
|
1837
|
-
*
|
|
1860
|
+
* Interface for single choice element
|
|
1838
1861
|
*/
|
|
1839
|
-
interface
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
lastName: string;
|
|
1845
|
-
dateOfBirth: Timestamp | null;
|
|
1846
|
-
gender: Gender;
|
|
1847
|
-
email?: string;
|
|
1848
|
-
phoneNumber?: string;
|
|
1849
|
-
alternativePhoneNumber?: string;
|
|
1850
|
-
addressData?: AddressData;
|
|
1851
|
-
emergencyContacts?: EmergencyContact[];
|
|
1862
|
+
interface SingleChoiceElement extends BaseDocumentElement {
|
|
1863
|
+
type: DocumentElementType.SINGLE_CHOICE;
|
|
1864
|
+
question: string;
|
|
1865
|
+
options: string[];
|
|
1866
|
+
defaultValue?: string;
|
|
1852
1867
|
}
|
|
1853
1868
|
/**
|
|
1854
|
-
*
|
|
1869
|
+
* Interface for rating scale element
|
|
1855
1870
|
*/
|
|
1856
|
-
interface
|
|
1857
|
-
|
|
1871
|
+
interface RatingScaleElement extends BaseDocumentElement {
|
|
1872
|
+
type: DocumentElementType.RATING_SCALE;
|
|
1873
|
+
question: string;
|
|
1874
|
+
min: number;
|
|
1875
|
+
max: number;
|
|
1876
|
+
labels?: {
|
|
1877
|
+
[key: number]: string;
|
|
1878
|
+
};
|
|
1879
|
+
defaultValue?: number;
|
|
1858
1880
|
}
|
|
1859
1881
|
/**
|
|
1860
|
-
*
|
|
1882
|
+
* Interface for text input element
|
|
1861
1883
|
*/
|
|
1862
|
-
interface
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1884
|
+
interface TextInputElement extends BaseDocumentElement {
|
|
1885
|
+
type: DocumentElementType.TEXT_INPUT;
|
|
1886
|
+
label: string;
|
|
1887
|
+
placeholder?: string;
|
|
1888
|
+
multiline?: boolean;
|
|
1889
|
+
defaultValue?: string;
|
|
1868
1890
|
}
|
|
1869
1891
|
/**
|
|
1870
|
-
*
|
|
1892
|
+
* Interface for date picker element
|
|
1871
1893
|
*/
|
|
1872
|
-
interface
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
isActive: boolean;
|
|
1877
|
-
notes?: string;
|
|
1894
|
+
interface DatePickerElement extends BaseDocumentElement {
|
|
1895
|
+
type: DocumentElementType.DATE_PICKER;
|
|
1896
|
+
label: string;
|
|
1897
|
+
defaultValue?: string;
|
|
1878
1898
|
}
|
|
1879
1899
|
/**
|
|
1880
|
-
*
|
|
1900
|
+
* Interface for signature element
|
|
1881
1901
|
*/
|
|
1882
|
-
interface
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
displayName: string;
|
|
1886
|
-
profilePhoto: string | null;
|
|
1887
|
-
gamification: GamificationInfo;
|
|
1888
|
-
expoTokens: string[];
|
|
1889
|
-
isActive: boolean;
|
|
1890
|
-
isVerified: boolean;
|
|
1891
|
-
phoneNumber?: string | null;
|
|
1892
|
-
dateOfBirth?: Timestamp | null;
|
|
1893
|
-
doctors: PatientDoctor[];
|
|
1894
|
-
clinics: PatientClinic[];
|
|
1895
|
-
doctorIds: string[];
|
|
1896
|
-
clinicIds: string[];
|
|
1897
|
-
createdAt: Timestamp;
|
|
1898
|
-
updatedAt: Timestamp;
|
|
1902
|
+
interface SignatureElement extends BaseDocumentElement {
|
|
1903
|
+
type: DocumentElementType.SIGNATURE;
|
|
1904
|
+
label: string;
|
|
1899
1905
|
}
|
|
1900
1906
|
/**
|
|
1901
|
-
*
|
|
1907
|
+
* Interface for digital signature element
|
|
1902
1908
|
*/
|
|
1903
|
-
interface
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
expoTokens: string[];
|
|
1907
|
-
gamification?: GamificationInfo;
|
|
1908
|
-
isActive: boolean;
|
|
1909
|
-
isVerified: boolean;
|
|
1910
|
-
doctors?: PatientDoctor[];
|
|
1911
|
-
clinics?: PatientClinic[];
|
|
1912
|
-
doctorIds?: string[];
|
|
1913
|
-
clinicIds?: string[];
|
|
1909
|
+
interface DigitalSignatureElement extends BaseDocumentElement {
|
|
1910
|
+
type: DocumentElementType.DITIGAL_SIGNATURE;
|
|
1911
|
+
label: string;
|
|
1914
1912
|
}
|
|
1915
1913
|
/**
|
|
1916
|
-
*
|
|
1914
|
+
* Interface for file upload element
|
|
1917
1915
|
*/
|
|
1918
|
-
interface
|
|
1919
|
-
|
|
1916
|
+
interface FileUploadElement extends BaseDocumentElement {
|
|
1917
|
+
type: DocumentElementType.FILE_UPLOAD;
|
|
1918
|
+
label: string;
|
|
1919
|
+
allowedFileTypes?: string[];
|
|
1920
|
+
maxFileSizeMB?: number;
|
|
1920
1921
|
}
|
|
1921
1922
|
/**
|
|
1922
|
-
*
|
|
1923
|
+
* Union type for all document elements
|
|
1923
1924
|
*/
|
|
1924
|
-
|
|
1925
|
-
/** Optional: Filter patients associated with this clinic ID. */
|
|
1926
|
-
clinicId?: string;
|
|
1927
|
-
/** Optional: Filter patients associated with this practitioner ID. */
|
|
1928
|
-
practitionerId?: string;
|
|
1929
|
-
}
|
|
1925
|
+
type DocumentElement = HeadingElement | ParagraphElement | ListElement | DynamicTextElement | BinaryChoiceElement | MultipleChoiceElement | SingleChoiceElement | RatingScaleElement | TextInputElement | DatePickerElement | SignatureElement | FileUploadElement;
|
|
1930
1926
|
/**
|
|
1931
|
-
*
|
|
1927
|
+
* Interface for document template
|
|
1932
1928
|
*/
|
|
1933
|
-
interface
|
|
1934
|
-
/** ID of the clinic admin user or practitioner user making the request. */
|
|
1929
|
+
interface DocumentTemplate {
|
|
1935
1930
|
id: string;
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
patientLocationInfo?: PatientLocationInfo;
|
|
1931
|
+
title: string;
|
|
1932
|
+
description?: string;
|
|
1933
|
+
createdAt: number;
|
|
1934
|
+
updatedAt: number;
|
|
1935
|
+
createdBy: string;
|
|
1936
|
+
elements: DocumentElement[];
|
|
1937
|
+
tags?: string[];
|
|
1938
|
+
isUserForm?: boolean;
|
|
1939
|
+
isRequired?: boolean;
|
|
1940
|
+
sortingOrder?: number;
|
|
1941
|
+
version: number;
|
|
1942
|
+
isActive: boolean;
|
|
1949
1943
|
}
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1944
|
+
/**
|
|
1945
|
+
* Interface for creating a new document template
|
|
1946
|
+
*/
|
|
1947
|
+
interface CreateDocumentTemplateData {
|
|
1948
|
+
title: string;
|
|
1949
|
+
description?: string;
|
|
1950
|
+
elements: Omit<DocumentElement, "id">[];
|
|
1951
|
+
tags?: string[];
|
|
1952
|
+
isUserForm?: boolean;
|
|
1953
|
+
isRequired?: boolean;
|
|
1954
|
+
sortingOrder?: number;
|
|
1953
1955
|
}
|
|
1954
|
-
|
|
1955
1956
|
/**
|
|
1956
|
-
* Interface for
|
|
1957
|
+
* Interface for updating an existing document template
|
|
1957
1958
|
*/
|
|
1958
|
-
interface
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1959
|
+
interface UpdateDocumentTemplateData {
|
|
1960
|
+
title?: string;
|
|
1961
|
+
description?: string;
|
|
1962
|
+
elements?: Omit<DocumentElement, "id">[];
|
|
1963
|
+
tags?: string[];
|
|
1964
|
+
isActive?: boolean;
|
|
1965
|
+
isUserForm?: boolean;
|
|
1966
|
+
isRequired?: boolean;
|
|
1967
|
+
sortingOrder?: number;
|
|
1965
1968
|
}
|
|
1966
1969
|
/**
|
|
1967
|
-
* Interface for
|
|
1970
|
+
* Interface for a filled document (completed form)
|
|
1968
1971
|
*/
|
|
1969
|
-
interface
|
|
1972
|
+
interface FilledDocument {
|
|
1970
1973
|
id: string;
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1974
|
+
templateId: string;
|
|
1975
|
+
templateVersion: number;
|
|
1976
|
+
isUserForm: boolean;
|
|
1977
|
+
isRequired: boolean;
|
|
1978
|
+
procedureId: string;
|
|
1979
|
+
appointmentId: string;
|
|
1980
|
+
patientId: string;
|
|
1981
|
+
practitionerId: string;
|
|
1982
|
+
clinicId: string;
|
|
1983
|
+
createdAt: number;
|
|
1984
|
+
updatedAt: number;
|
|
1985
|
+
values: {
|
|
1986
|
+
[elementId: string]: any;
|
|
1987
|
+
};
|
|
1988
|
+
status: FilledDocumentStatus;
|
|
1976
1989
|
}
|
|
1977
1990
|
/**
|
|
1978
|
-
*
|
|
1991
|
+
* Enum for filled document status
|
|
1979
1992
|
*/
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1993
|
+
declare enum FilledDocumentStatus {
|
|
1994
|
+
DRAFT = "draft",
|
|
1995
|
+
SKIPPED = "skipped",
|
|
1996
|
+
PENDING = "pending",
|
|
1997
|
+
COMPLETED = "completed",// When doctor or patient completes the form
|
|
1998
|
+
SIGNED = "signed",// Only used for user forms
|
|
1999
|
+
REJECTED = "rejected"
|
|
1987
2000
|
}
|
|
1988
2001
|
|
|
1989
2002
|
/**
|
|
@@ -4103,7 +4116,7 @@ declare class TechnologyService extends BaseService {
|
|
|
4103
4116
|
pre: Requirement[];
|
|
4104
4117
|
post: Requirement[];
|
|
4105
4118
|
};
|
|
4106
|
-
documentationTemplates?:
|
|
4119
|
+
documentationTemplates?: TechnologyDocumentationTemplate[] | undefined;
|
|
4107
4120
|
benefits: TreatmentBenefit[];
|
|
4108
4121
|
certificationRequirement: CertificationRequirement;
|
|
4109
4122
|
id: string;
|
|
@@ -6409,9 +6422,10 @@ declare class DocumentationTemplateService extends BaseService {
|
|
|
6409
6422
|
/**
|
|
6410
6423
|
* Get a document template by ID
|
|
6411
6424
|
* @param templateId - ID of the template to retrieve
|
|
6425
|
+
* @param version - Optional version number to retrieve (defaults to latest version)
|
|
6412
6426
|
* @returns The template or null if not found
|
|
6413
6427
|
*/
|
|
6414
|
-
getTemplateById(templateId: string): Promise<DocumentTemplate | null>;
|
|
6428
|
+
getTemplateById(templateId: string, version?: number): Promise<DocumentTemplate | null>;
|
|
6415
6429
|
/**
|
|
6416
6430
|
* Update an existing document template
|
|
6417
6431
|
* @param templateId - ID of the template to update
|
|
@@ -6419,6 +6433,19 @@ declare class DocumentationTemplateService extends BaseService {
|
|
|
6419
6433
|
* @returns The updated template
|
|
6420
6434
|
*/
|
|
6421
6435
|
updateTemplate(templateId: string, data: UpdateDocumentTemplateData): Promise<DocumentTemplate>;
|
|
6436
|
+
/**
|
|
6437
|
+
* Get a specific version of a template
|
|
6438
|
+
* @param templateId - ID of the template
|
|
6439
|
+
* @param versionNumber - Version number to retrieve
|
|
6440
|
+
* @returns The template version or null if not found
|
|
6441
|
+
*/
|
|
6442
|
+
getTemplateVersion(templateId: string, versionNumber: number): Promise<DocumentTemplate | null>;
|
|
6443
|
+
/**
|
|
6444
|
+
* Get all versions of a template
|
|
6445
|
+
* @param templateId - ID of the template
|
|
6446
|
+
* @returns Array of template versions
|
|
6447
|
+
*/
|
|
6448
|
+
getTemplateOldVersions(templateId: string): Promise<DocumentTemplate[]>;
|
|
6422
6449
|
/**
|
|
6423
6450
|
* Delete a document template
|
|
6424
6451
|
* @param templateId - ID of the template to delete
|