@blackcode_sa/metaestetics-api 1.12.62 → 1.12.63
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 +4 -2
- package/dist/admin/index.d.ts +4 -2
- package/dist/admin/index.js +4 -45
- package/dist/admin/index.mjs +4 -45
- package/dist/backoffice/index.d.mts +9 -0
- package/dist/backoffice/index.d.ts +9 -0
- package/dist/backoffice/index.js +11 -0
- package/dist/backoffice/index.mjs +11 -0
- package/dist/index.d.mts +99 -3
- package/dist/index.d.ts +99 -3
- package/dist/index.js +545 -281
- package/dist/index.mjs +867 -603
- package/package.json +119 -119
- package/src/__mocks__/firstore.ts +10 -10
- package/src/admin/aggregation/README.md +79 -79
- package/src/admin/aggregation/appointment/README.md +128 -128
- package/src/admin/aggregation/appointment/appointment.aggregation.service.ts +1844 -1844
- package/src/admin/aggregation/appointment/index.ts +1 -1
- package/src/admin/aggregation/clinic/README.md +52 -52
- package/src/admin/aggregation/clinic/clinic.aggregation.service.ts +703 -703
- package/src/admin/aggregation/clinic/index.ts +1 -1
- package/src/admin/aggregation/forms/README.md +13 -13
- package/src/admin/aggregation/forms/filled-forms.aggregation.service.ts +322 -322
- package/src/admin/aggregation/forms/index.ts +1 -1
- package/src/admin/aggregation/index.ts +8 -8
- package/src/admin/aggregation/patient/README.md +27 -27
- package/src/admin/aggregation/patient/index.ts +1 -1
- package/src/admin/aggregation/patient/patient.aggregation.service.ts +141 -141
- package/src/admin/aggregation/practitioner/README.md +42 -42
- package/src/admin/aggregation/practitioner/index.ts +1 -1
- package/src/admin/aggregation/practitioner/practitioner.aggregation.service.ts +433 -433
- package/src/admin/aggregation/practitioner-invite/index.ts +1 -1
- package/src/admin/aggregation/practitioner-invite/practitioner-invite.aggregation.service.ts +961 -961
- package/src/admin/aggregation/procedure/README.md +43 -43
- package/src/admin/aggregation/procedure/index.ts +1 -1
- package/src/admin/aggregation/procedure/procedure.aggregation.service.ts +702 -702
- package/src/admin/aggregation/reviews/index.ts +1 -1
- package/src/admin/aggregation/reviews/reviews.aggregation.service.ts +641 -689
- package/src/admin/booking/README.md +125 -125
- package/src/admin/booking/booking.admin.ts +1037 -1037
- package/src/admin/booking/booking.calculator.ts +712 -712
- package/src/admin/booking/booking.types.ts +59 -59
- package/src/admin/booking/index.ts +3 -3
- package/src/admin/booking/timezones-problem.md +185 -185
- package/src/admin/calendar/README.md +7 -7
- package/src/admin/calendar/calendar.admin.service.ts +345 -345
- package/src/admin/calendar/index.ts +1 -1
- package/src/admin/documentation-templates/document-manager.admin.ts +260 -260
- package/src/admin/documentation-templates/index.ts +1 -1
- package/src/admin/free-consultation/free-consultation-utils.admin.ts +148 -148
- package/src/admin/free-consultation/index.ts +1 -1
- package/src/admin/index.ts +75 -75
- package/src/admin/logger/index.ts +78 -78
- package/src/admin/mailing/README.md +95 -95
- package/src/admin/mailing/appointment/appointment.mailing.service.ts +732 -732
- package/src/admin/mailing/appointment/index.ts +1 -1
- package/src/admin/mailing/appointment/templates/patient/appointment-confirmed.html +40 -40
- package/src/admin/mailing/base.mailing.service.ts +208 -208
- package/src/admin/mailing/index.ts +3 -3
- package/src/admin/mailing/practitionerInvite/existing-practitioner-invite.mailing.ts +611 -611
- package/src/admin/mailing/practitionerInvite/index.ts +2 -2
- package/src/admin/mailing/practitionerInvite/practitionerInvite.mailing.ts +395 -395
- package/src/admin/mailing/practitionerInvite/templates/existing-practitioner-invitation.template.ts +155 -155
- package/src/admin/mailing/practitionerInvite/templates/invitation.template.ts +101 -101
- package/src/admin/mailing/practitionerInvite/templates/invite-accepted-notification.template.ts +228 -228
- package/src/admin/mailing/practitionerInvite/templates/invite-rejected-notification.template.ts +242 -242
- package/src/admin/notifications/index.ts +1 -1
- package/src/admin/notifications/notifications.admin.ts +710 -710
- package/src/admin/requirements/README.md +128 -128
- package/src/admin/requirements/index.ts +1 -1
- package/src/admin/requirements/patient-requirements.admin.service.ts +475 -475
- package/src/admin/users/index.ts +1 -1
- package/src/admin/users/user-profile.admin.ts +405 -405
- package/src/backoffice/constants/certification.constants.ts +13 -13
- package/src/backoffice/constants/index.ts +1 -1
- package/src/backoffice/errors/backoffice.errors.ts +181 -181
- package/src/backoffice/errors/index.ts +1 -1
- package/src/backoffice/expo-safe/README.md +26 -26
- package/src/backoffice/expo-safe/index.ts +41 -41
- package/src/backoffice/index.ts +5 -5
- package/src/backoffice/services/FIXES_README.md +102 -102
- package/src/backoffice/services/README.md +40 -40
- package/src/backoffice/services/brand.service.ts +256 -256
- package/src/backoffice/services/category.service.ts +318 -318
- package/src/backoffice/services/constants.service.ts +385 -385
- package/src/backoffice/services/documentation-template.service.ts +202 -202
- package/src/backoffice/services/index.ts +8 -8
- package/src/backoffice/services/migrate-products.ts +116 -116
- package/src/backoffice/services/product.service.ts +553 -553
- package/src/backoffice/services/requirement.service.ts +235 -235
- package/src/backoffice/services/subcategory.service.ts +395 -395
- package/src/backoffice/services/technology.service.ts +1083 -1070
- package/src/backoffice/types/README.md +12 -12
- package/src/backoffice/types/admin-constants.types.ts +69 -69
- package/src/backoffice/types/brand.types.ts +29 -29
- package/src/backoffice/types/category.types.ts +62 -62
- package/src/backoffice/types/documentation-templates.types.ts +28 -28
- package/src/backoffice/types/index.ts +10 -10
- package/src/backoffice/types/procedure-product.types.ts +38 -38
- package/src/backoffice/types/product.types.ts +240 -240
- package/src/backoffice/types/requirement.types.ts +63 -63
- package/src/backoffice/types/static/README.md +18 -18
- package/src/backoffice/types/static/blocking-condition.types.ts +21 -21
- package/src/backoffice/types/static/certification.types.ts +37 -37
- package/src/backoffice/types/static/contraindication.types.ts +19 -19
- package/src/backoffice/types/static/index.ts +6 -6
- package/src/backoffice/types/static/pricing.types.ts +16 -16
- package/src/backoffice/types/static/procedure-family.types.ts +14 -14
- package/src/backoffice/types/static/treatment-benefit.types.ts +22 -22
- package/src/backoffice/types/subcategory.types.ts +34 -34
- package/src/backoffice/types/technology.types.ts +163 -161
- package/src/backoffice/validations/index.ts +1 -1
- package/src/backoffice/validations/schemas.ts +164 -163
- package/src/config/__mocks__/firebase.ts +99 -99
- package/src/config/firebase.ts +78 -78
- package/src/config/index.ts +9 -9
- package/src/errors/auth.error.ts +6 -6
- package/src/errors/auth.errors.ts +200 -200
- package/src/errors/clinic.errors.ts +32 -32
- package/src/errors/firebase.errors.ts +47 -47
- package/src/errors/user.errors.ts +99 -99
- package/src/index.backup.ts +407 -407
- package/src/index.ts +6 -6
- package/src/locales/en.ts +31 -31
- package/src/recommender/admin/index.ts +1 -1
- package/src/recommender/admin/services/recommender.service.admin.ts +5 -5
- package/src/recommender/front/index.ts +1 -1
- package/src/recommender/front/services/onboarding.service.ts +5 -5
- package/src/recommender/front/services/recommender.service.ts +3 -3
- package/src/recommender/index.ts +1 -1
- package/src/services/PATIENTAUTH.MD +197 -197
- package/src/services/README.md +106 -106
- package/src/services/__tests__/auth/auth.mock.test.ts +17 -17
- package/src/services/__tests__/auth/auth.setup.ts +293 -293
- package/src/services/__tests__/auth.service.test.ts +346 -346
- package/src/services/__tests__/base.service.test.ts +77 -77
- package/src/services/__tests__/user.service.test.ts +528 -528
- package/src/services/appointment/README.md +17 -17
- package/src/services/appointment/appointment.service.ts +2505 -2082
- package/src/services/appointment/index.ts +1 -1
- package/src/services/appointment/utils/appointment.utils.ts +552 -552
- package/src/services/appointment/utils/extended-procedure.utils.ts +314 -314
- package/src/services/appointment/utils/form-initialization.utils.ts +225 -225
- package/src/services/appointment/utils/recommended-procedure.utils.ts +195 -195
- package/src/services/appointment/utils/zone-management.utils.ts +353 -353
- package/src/services/appointment/utils/zone-photo.utils.ts +152 -152
- package/src/services/auth/auth.service.ts +989 -989
- package/src/services/auth/auth.v2.service.ts +961 -961
- package/src/services/auth/index.ts +7 -7
- package/src/services/auth/utils/error.utils.ts +90 -90
- package/src/services/auth/utils/firebase.utils.ts +49 -49
- package/src/services/auth/utils/index.ts +21 -21
- package/src/services/auth/utils/practitioner.utils.ts +125 -125
- package/src/services/base.service.ts +41 -41
- package/src/services/calendar/calendar.service.ts +1077 -1077
- package/src/services/calendar/calendar.v2.service.ts +1683 -1683
- package/src/services/calendar/calendar.v3.service.ts +313 -313
- package/src/services/calendar/externalCalendar.service.ts +178 -178
- package/src/services/calendar/index.ts +5 -5
- package/src/services/calendar/synced-calendars.service.ts +743 -743
- package/src/services/calendar/utils/appointment.utils.ts +265 -265
- package/src/services/calendar/utils/calendar-event.utils.ts +646 -646
- package/src/services/calendar/utils/clinic.utils.ts +237 -237
- package/src/services/calendar/utils/docs.utils.ts +157 -157
- package/src/services/calendar/utils/google-calendar.utils.ts +697 -697
- package/src/services/calendar/utils/index.ts +8 -8
- package/src/services/calendar/utils/patient.utils.ts +198 -198
- package/src/services/calendar/utils/practitioner.utils.ts +221 -221
- package/src/services/calendar/utils/synced-calendar.utils.ts +472 -472
- package/src/services/clinic/README.md +204 -204
- package/src/services/clinic/__tests__/clinic-admin.service.test.ts +287 -287
- package/src/services/clinic/__tests__/clinic-group.service.test.ts +352 -352
- package/src/services/clinic/__tests__/clinic.service.test.ts +354 -354
- package/src/services/clinic/billing-transactions.service.ts +217 -217
- package/src/services/clinic/clinic-admin.service.ts +202 -202
- package/src/services/clinic/clinic-group.service.ts +310 -310
- package/src/services/clinic/clinic.service.ts +708 -708
- package/src/services/clinic/index.ts +5 -5
- package/src/services/clinic/practitioner-invite.service.ts +519 -519
- package/src/services/clinic/utils/admin.utils.ts +551 -551
- package/src/services/clinic/utils/clinic-group.utils.ts +646 -646
- package/src/services/clinic/utils/clinic.utils.ts +949 -949
- package/src/services/clinic/utils/filter.utils.d.ts +23 -23
- package/src/services/clinic/utils/filter.utils.ts +446 -446
- package/src/services/clinic/utils/index.ts +11 -11
- package/src/services/clinic/utils/photos.utils.ts +188 -188
- package/src/services/clinic/utils/search.utils.ts +84 -84
- package/src/services/clinic/utils/tag.utils.ts +124 -124
- package/src/services/documentation-templates/documentation-template.service.ts +537 -537
- package/src/services/documentation-templates/filled-document.service.ts +587 -587
- package/src/services/documentation-templates/index.ts +2 -2
- package/src/services/index.ts +13 -13
- package/src/services/media/index.ts +1 -1
- package/src/services/media/media.service.ts +418 -418
- package/src/services/notifications/__tests__/notification.service.test.ts +242 -242
- package/src/services/notifications/index.ts +1 -1
- package/src/services/notifications/notification.service.ts +215 -215
- package/src/services/patient/README.md +48 -48
- package/src/services/patient/To-Do.md +43 -43
- package/src/services/patient/__tests__/patient.service.test.ts +294 -294
- package/src/services/patient/index.ts +2 -2
- package/src/services/patient/patient.service.ts +883 -883
- package/src/services/patient/patientRequirements.service.ts +285 -285
- package/src/services/patient/utils/aesthetic-analysis.utils.ts +176 -176
- package/src/services/patient/utils/clinic.utils.ts +80 -80
- package/src/services/patient/utils/docs.utils.ts +142 -142
- package/src/services/patient/utils/index.ts +9 -9
- package/src/services/patient/utils/location.utils.ts +126 -126
- package/src/services/patient/utils/medical-stuff.utils.ts +143 -143
- package/src/services/patient/utils/medical.utils.ts +458 -458
- package/src/services/patient/utils/practitioner.utils.ts +260 -260
- package/src/services/patient/utils/profile.utils.ts +510 -510
- package/src/services/patient/utils/sensitive.utils.ts +260 -260
- package/src/services/patient/utils/token.utils.ts +211 -211
- package/src/services/practitioner/README.md +145 -145
- package/src/services/practitioner/index.ts +1 -1
- package/src/services/practitioner/practitioner.service.ts +1742 -1742
- package/src/services/procedure/README.md +163 -163
- package/src/services/procedure/index.ts +1 -1
- package/src/services/procedure/procedure.service.ts +1682 -1682
- package/src/services/reviews/index.ts +1 -1
- package/src/services/reviews/reviews.service.ts +636 -683
- package/src/services/user/index.ts +1 -1
- package/src/services/user/user.service.ts +489 -489
- package/src/services/user/user.v2.service.ts +466 -466
- package/src/types/appointment/index.ts +481 -453
- package/src/types/calendar/index.ts +258 -258
- package/src/types/calendar/synced-calendar.types.ts +66 -66
- package/src/types/clinic/index.ts +489 -489
- package/src/types/clinic/practitioner-invite.types.ts +91 -91
- package/src/types/clinic/preferences.types.ts +159 -159
- package/src/types/clinic/to-do +3 -3
- package/src/types/documentation-templates/index.ts +308 -308
- package/src/types/index.ts +44 -44
- package/src/types/notifications/README.md +77 -77
- package/src/types/notifications/index.ts +265 -265
- package/src/types/patient/aesthetic-analysis.types.ts +66 -66
- package/src/types/patient/allergies.ts +58 -58
- package/src/types/patient/index.ts +275 -273
- package/src/types/patient/medical-info.types.ts +152 -152
- package/src/types/patient/patient-requirements.ts +92 -92
- package/src/types/patient/token.types.ts +61 -61
- package/src/types/practitioner/index.ts +206 -206
- package/src/types/procedure/index.ts +181 -181
- package/src/types/profile/index.ts +39 -39
- package/src/types/reviews/index.ts +130 -132
- package/src/types/tz-lookup.d.ts +4 -4
- package/src/types/user/index.ts +38 -38
- package/src/utils/TIMESTAMPS.md +176 -176
- package/src/utils/TimestampUtils.ts +241 -241
- package/src/utils/index.ts +1 -1
- package/src/validations/appointment.schema.ts +574 -574
- package/src/validations/calendar.schema.ts +225 -225
- package/src/validations/clinic.schema.ts +493 -493
- package/src/validations/common.schema.ts +25 -25
- package/src/validations/documentation-templates/index.ts +1 -1
- package/src/validations/documentation-templates/template.schema.ts +220 -220
- package/src/validations/documentation-templates.schema.ts +10 -10
- package/src/validations/index.ts +20 -20
- package/src/validations/media.schema.ts +10 -10
- package/src/validations/notification.schema.ts +90 -90
- package/src/validations/patient/aesthetic-analysis.schema.ts +55 -55
- package/src/validations/patient/medical-info.schema.ts +125 -125
- package/src/validations/patient/patient-requirements.schema.ts +84 -84
- package/src/validations/patient/token.schema.ts +29 -29
- package/src/validations/patient.schema.ts +217 -216
- package/src/validations/practitioner.schema.ts +222 -222
- package/src/validations/procedure-product.schema.ts +41 -41
- package/src/validations/procedure.schema.ts +124 -124
- package/src/validations/profile-info.schema.ts +41 -41
- package/src/validations/reviews.schema.ts +189 -195
- package/src/validations/schemas.ts +104 -104
- package/src/validations/shared.schema.ts +78 -78
package/dist/admin/index.d.mts
CHANGED
|
@@ -70,7 +70,6 @@ interface PractitionerReview extends BaseReview {
|
|
|
70
70
|
/**
|
|
71
71
|
* Procedure review interface
|
|
72
72
|
* @description Full review for a medical procedure
|
|
73
|
-
* Used for both main and extended procedures
|
|
74
73
|
*/
|
|
75
74
|
interface ProcedureReview extends BaseReview {
|
|
76
75
|
procedureId: string;
|
|
@@ -139,7 +138,6 @@ interface Review {
|
|
|
139
138
|
clinicReview?: ClinicReview;
|
|
140
139
|
practitionerReview?: PractitionerReview;
|
|
141
140
|
procedureReview?: ProcedureReview;
|
|
142
|
-
extendedProcedureReviews?: ProcedureReview[];
|
|
143
141
|
overallComment: string;
|
|
144
142
|
overallRating: number;
|
|
145
143
|
}
|
|
@@ -689,6 +687,8 @@ interface Technology {
|
|
|
689
687
|
benefits: TreatmentBenefitDynamic[];
|
|
690
688
|
certificationRequirement: CertificationRequirement;
|
|
691
689
|
documentationTemplates?: TechnologyDocumentationTemplate[];
|
|
690
|
+
/** Media ID of the default photo template image for this technology */
|
|
691
|
+
photoTemplate?: string;
|
|
692
692
|
isActive: boolean;
|
|
693
693
|
createdAt: Date;
|
|
694
694
|
updatedAt: Date;
|
|
@@ -1517,6 +1517,8 @@ interface PatientProfile {
|
|
|
1517
1517
|
clinics: PatientClinic[];
|
|
1518
1518
|
doctorIds: string[];
|
|
1519
1519
|
clinicIds: string[];
|
|
1520
|
+
/** IDs of dismissed next steps recommendations (format: appointmentId:recommendationIndex) */
|
|
1521
|
+
dismissedNextStepsRecommendations?: string[];
|
|
1520
1522
|
createdAt: Timestamp;
|
|
1521
1523
|
updatedAt: Timestamp;
|
|
1522
1524
|
}
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -70,7 +70,6 @@ interface PractitionerReview extends BaseReview {
|
|
|
70
70
|
/**
|
|
71
71
|
* Procedure review interface
|
|
72
72
|
* @description Full review for a medical procedure
|
|
73
|
-
* Used for both main and extended procedures
|
|
74
73
|
*/
|
|
75
74
|
interface ProcedureReview extends BaseReview {
|
|
76
75
|
procedureId: string;
|
|
@@ -139,7 +138,6 @@ interface Review {
|
|
|
139
138
|
clinicReview?: ClinicReview;
|
|
140
139
|
practitionerReview?: PractitionerReview;
|
|
141
140
|
procedureReview?: ProcedureReview;
|
|
142
|
-
extendedProcedureReviews?: ProcedureReview[];
|
|
143
141
|
overallComment: string;
|
|
144
142
|
overallRating: number;
|
|
145
143
|
}
|
|
@@ -689,6 +687,8 @@ interface Technology {
|
|
|
689
687
|
benefits: TreatmentBenefitDynamic[];
|
|
690
688
|
certificationRequirement: CertificationRequirement;
|
|
691
689
|
documentationTemplates?: TechnologyDocumentationTemplate[];
|
|
690
|
+
/** Media ID of the default photo template image for this technology */
|
|
691
|
+
photoTemplate?: string;
|
|
692
692
|
isActive: boolean;
|
|
693
693
|
createdAt: Date;
|
|
694
694
|
updatedAt: Date;
|
|
@@ -1517,6 +1517,8 @@ interface PatientProfile {
|
|
|
1517
1517
|
clinics: PatientClinic[];
|
|
1518
1518
|
doctorIds: string[];
|
|
1519
1519
|
clinicIds: string[];
|
|
1520
|
+
/** IDs of dismissed next steps recommendations (format: appointmentId:recommendationIndex) */
|
|
1521
|
+
dismissedNextStepsRecommendations?: string[];
|
|
1520
1522
|
createdAt: Timestamp;
|
|
1521
1523
|
updatedAt: Timestamp;
|
|
1522
1524
|
}
|
package/dist/admin/index.js
CHANGED
|
@@ -6375,16 +6375,6 @@ var ReviewsAggregationService = class {
|
|
|
6375
6375
|
this.updateProcedureReviewInfo(review.procedureReview.procedureId)
|
|
6376
6376
|
);
|
|
6377
6377
|
}
|
|
6378
|
-
if (review.extendedProcedureReviews && review.extendedProcedureReviews.length > 0) {
|
|
6379
|
-
console.log(
|
|
6380
|
-
`[ReviewsAggregationService] Processing ${review.extendedProcedureReviews.length} extended procedure reviews`
|
|
6381
|
-
);
|
|
6382
|
-
review.extendedProcedureReviews.forEach((extendedReview) => {
|
|
6383
|
-
updatePromises.push(
|
|
6384
|
-
this.updateProcedureReviewInfo(extendedReview.procedureId)
|
|
6385
|
-
);
|
|
6386
|
-
});
|
|
6387
|
-
}
|
|
6388
6378
|
await Promise.all(updatePromises);
|
|
6389
6379
|
console.log(
|
|
6390
6380
|
`[ReviewsAggregationService] Successfully processed review: ${review.id}`
|
|
@@ -6427,20 +6417,6 @@ var ReviewsAggregationService = class {
|
|
|
6427
6417
|
)
|
|
6428
6418
|
);
|
|
6429
6419
|
}
|
|
6430
|
-
if (review.extendedProcedureReviews && review.extendedProcedureReviews.length > 0) {
|
|
6431
|
-
console.log(
|
|
6432
|
-
`[ReviewsAggregationService] Processing deletion of ${review.extendedProcedureReviews.length} extended procedure reviews`
|
|
6433
|
-
);
|
|
6434
|
-
review.extendedProcedureReviews.forEach((extendedReview) => {
|
|
6435
|
-
updatePromises.push(
|
|
6436
|
-
this.updateProcedureReviewInfo(
|
|
6437
|
-
extendedReview.procedureId,
|
|
6438
|
-
extendedReview,
|
|
6439
|
-
true
|
|
6440
|
-
)
|
|
6441
|
-
);
|
|
6442
|
-
});
|
|
6443
|
-
}
|
|
6444
6420
|
await Promise.all(updatePromises);
|
|
6445
6421
|
console.log(
|
|
6446
6422
|
`[ReviewsAggregationService] Successfully processed deleted review: ${review.id}`
|
|
@@ -6658,21 +6634,8 @@ var ReviewsAggregationService = class {
|
|
|
6658
6634
|
valueForMoney: 0,
|
|
6659
6635
|
recommendationPercentage: 0
|
|
6660
6636
|
};
|
|
6661
|
-
const
|
|
6662
|
-
|
|
6663
|
-
const procedureReviews = [];
|
|
6664
|
-
reviews.forEach((review) => {
|
|
6665
|
-
if (review.procedureReview && review.procedureReview.procedureId === procedureId) {
|
|
6666
|
-
procedureReviews.push(review.procedureReview);
|
|
6667
|
-
}
|
|
6668
|
-
if (review.extendedProcedureReviews && review.extendedProcedureReviews.length > 0) {
|
|
6669
|
-
const matchingExtended = review.extendedProcedureReviews.filter(
|
|
6670
|
-
(extReview) => extReview.procedureId === procedureId
|
|
6671
|
-
);
|
|
6672
|
-
procedureReviews.push(...matchingExtended);
|
|
6673
|
-
}
|
|
6674
|
-
});
|
|
6675
|
-
if (procedureReviews.length === 0) {
|
|
6637
|
+
const reviewsQuery = await this.db.collection(REVIEWS_COLLECTION).where("procedureReview.procedureId", "==", procedureId).get();
|
|
6638
|
+
if (isRemoval && reviewsQuery.size <= 1 || reviewsQuery.empty) {
|
|
6676
6639
|
const updatedReviewInfo2 = {
|
|
6677
6640
|
totalReviews: 0,
|
|
6678
6641
|
averageRating: 0,
|
|
@@ -6692,6 +6655,8 @@ var ReviewsAggregationService = class {
|
|
|
6692
6655
|
);
|
|
6693
6656
|
return updatedReviewInfo2;
|
|
6694
6657
|
}
|
|
6658
|
+
const reviews = reviewsQuery.docs.map((doc) => doc.data());
|
|
6659
|
+
const procedureReviews = reviews.map((review) => review.procedureReview).filter((review) => review !== void 0);
|
|
6695
6660
|
let totalRating = 0;
|
|
6696
6661
|
let totalEffectivenessOfTreatment = 0;
|
|
6697
6662
|
let totalOutcomeExplanation = 0;
|
|
@@ -6785,16 +6750,10 @@ var ReviewsAggregationService = class {
|
|
|
6785
6750
|
if (review.procedureReview) {
|
|
6786
6751
|
review.procedureReview.isVerified = true;
|
|
6787
6752
|
}
|
|
6788
|
-
if (review.extendedProcedureReviews && review.extendedProcedureReviews.length > 0) {
|
|
6789
|
-
review.extendedProcedureReviews.forEach((extReview) => {
|
|
6790
|
-
extReview.isVerified = true;
|
|
6791
|
-
});
|
|
6792
|
-
}
|
|
6793
6753
|
batch.update(reviewRef, {
|
|
6794
6754
|
clinicReview: review.clinicReview,
|
|
6795
6755
|
practitionerReview: review.practitionerReview,
|
|
6796
6756
|
procedureReview: review.procedureReview,
|
|
6797
|
-
extendedProcedureReviews: review.extendedProcedureReviews,
|
|
6798
6757
|
updatedAt: admin13.firestore.FieldValue.serverTimestamp()
|
|
6799
6758
|
});
|
|
6800
6759
|
await batch.commit();
|
package/dist/admin/index.mjs
CHANGED
|
@@ -6313,16 +6313,6 @@ var ReviewsAggregationService = class {
|
|
|
6313
6313
|
this.updateProcedureReviewInfo(review.procedureReview.procedureId)
|
|
6314
6314
|
);
|
|
6315
6315
|
}
|
|
6316
|
-
if (review.extendedProcedureReviews && review.extendedProcedureReviews.length > 0) {
|
|
6317
|
-
console.log(
|
|
6318
|
-
`[ReviewsAggregationService] Processing ${review.extendedProcedureReviews.length} extended procedure reviews`
|
|
6319
|
-
);
|
|
6320
|
-
review.extendedProcedureReviews.forEach((extendedReview) => {
|
|
6321
|
-
updatePromises.push(
|
|
6322
|
-
this.updateProcedureReviewInfo(extendedReview.procedureId)
|
|
6323
|
-
);
|
|
6324
|
-
});
|
|
6325
|
-
}
|
|
6326
6316
|
await Promise.all(updatePromises);
|
|
6327
6317
|
console.log(
|
|
6328
6318
|
`[ReviewsAggregationService] Successfully processed review: ${review.id}`
|
|
@@ -6365,20 +6355,6 @@ var ReviewsAggregationService = class {
|
|
|
6365
6355
|
)
|
|
6366
6356
|
);
|
|
6367
6357
|
}
|
|
6368
|
-
if (review.extendedProcedureReviews && review.extendedProcedureReviews.length > 0) {
|
|
6369
|
-
console.log(
|
|
6370
|
-
`[ReviewsAggregationService] Processing deletion of ${review.extendedProcedureReviews.length} extended procedure reviews`
|
|
6371
|
-
);
|
|
6372
|
-
review.extendedProcedureReviews.forEach((extendedReview) => {
|
|
6373
|
-
updatePromises.push(
|
|
6374
|
-
this.updateProcedureReviewInfo(
|
|
6375
|
-
extendedReview.procedureId,
|
|
6376
|
-
extendedReview,
|
|
6377
|
-
true
|
|
6378
|
-
)
|
|
6379
|
-
);
|
|
6380
|
-
});
|
|
6381
|
-
}
|
|
6382
6358
|
await Promise.all(updatePromises);
|
|
6383
6359
|
console.log(
|
|
6384
6360
|
`[ReviewsAggregationService] Successfully processed deleted review: ${review.id}`
|
|
@@ -6596,21 +6572,8 @@ var ReviewsAggregationService = class {
|
|
|
6596
6572
|
valueForMoney: 0,
|
|
6597
6573
|
recommendationPercentage: 0
|
|
6598
6574
|
};
|
|
6599
|
-
const
|
|
6600
|
-
|
|
6601
|
-
const procedureReviews = [];
|
|
6602
|
-
reviews.forEach((review) => {
|
|
6603
|
-
if (review.procedureReview && review.procedureReview.procedureId === procedureId) {
|
|
6604
|
-
procedureReviews.push(review.procedureReview);
|
|
6605
|
-
}
|
|
6606
|
-
if (review.extendedProcedureReviews && review.extendedProcedureReviews.length > 0) {
|
|
6607
|
-
const matchingExtended = review.extendedProcedureReviews.filter(
|
|
6608
|
-
(extReview) => extReview.procedureId === procedureId
|
|
6609
|
-
);
|
|
6610
|
-
procedureReviews.push(...matchingExtended);
|
|
6611
|
-
}
|
|
6612
|
-
});
|
|
6613
|
-
if (procedureReviews.length === 0) {
|
|
6575
|
+
const reviewsQuery = await this.db.collection(REVIEWS_COLLECTION).where("procedureReview.procedureId", "==", procedureId).get();
|
|
6576
|
+
if (isRemoval && reviewsQuery.size <= 1 || reviewsQuery.empty) {
|
|
6614
6577
|
const updatedReviewInfo2 = {
|
|
6615
6578
|
totalReviews: 0,
|
|
6616
6579
|
averageRating: 0,
|
|
@@ -6630,6 +6593,8 @@ var ReviewsAggregationService = class {
|
|
|
6630
6593
|
);
|
|
6631
6594
|
return updatedReviewInfo2;
|
|
6632
6595
|
}
|
|
6596
|
+
const reviews = reviewsQuery.docs.map((doc) => doc.data());
|
|
6597
|
+
const procedureReviews = reviews.map((review) => review.procedureReview).filter((review) => review !== void 0);
|
|
6633
6598
|
let totalRating = 0;
|
|
6634
6599
|
let totalEffectivenessOfTreatment = 0;
|
|
6635
6600
|
let totalOutcomeExplanation = 0;
|
|
@@ -6723,16 +6688,10 @@ var ReviewsAggregationService = class {
|
|
|
6723
6688
|
if (review.procedureReview) {
|
|
6724
6689
|
review.procedureReview.isVerified = true;
|
|
6725
6690
|
}
|
|
6726
|
-
if (review.extendedProcedureReviews && review.extendedProcedureReviews.length > 0) {
|
|
6727
|
-
review.extendedProcedureReviews.forEach((extReview) => {
|
|
6728
|
-
extReview.isVerified = true;
|
|
6729
|
-
});
|
|
6730
|
-
}
|
|
6731
6691
|
batch.update(reviewRef, {
|
|
6732
6692
|
clinicReview: review.clinicReview,
|
|
6733
6693
|
practitionerReview: review.practitionerReview,
|
|
6734
6694
|
procedureReview: review.procedureReview,
|
|
6735
|
-
extendedProcedureReviews: review.extendedProcedureReviews,
|
|
6736
6695
|
updatedAt: admin13.firestore.FieldValue.serverTimestamp()
|
|
6737
6696
|
});
|
|
6738
6697
|
await batch.commit();
|
|
@@ -1005,6 +1005,8 @@ interface Technology {
|
|
|
1005
1005
|
benefits: TreatmentBenefitDynamic[];
|
|
1006
1006
|
certificationRequirement: CertificationRequirement;
|
|
1007
1007
|
documentationTemplates?: TechnologyDocumentationTemplate[];
|
|
1008
|
+
/** Media ID of the default photo template image for this technology */
|
|
1009
|
+
photoTemplate?: string;
|
|
1008
1010
|
isActive: boolean;
|
|
1009
1011
|
createdAt: Date;
|
|
1010
1012
|
updatedAt: Date;
|
|
@@ -1944,6 +1946,7 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
|
|
|
1944
1946
|
benefits: TreatmentBenefitDynamic[];
|
|
1945
1947
|
certificationRequirement: CertificationRequirement;
|
|
1946
1948
|
documentationTemplates?: TechnologyDocumentationTemplate[] | undefined;
|
|
1949
|
+
photoTemplate?: string | undefined;
|
|
1947
1950
|
id: string;
|
|
1948
1951
|
}>;
|
|
1949
1952
|
/**
|
|
@@ -5077,6 +5080,7 @@ declare const technologySchema: z.ZodObject<{
|
|
|
5077
5080
|
minimumLevel: CertificationLevel;
|
|
5078
5081
|
requiredSpecialties?: CertificationSpecialty[] | undefined;
|
|
5079
5082
|
}>;
|
|
5083
|
+
photoTemplate: z.ZodOptional<z.ZodString>;
|
|
5080
5084
|
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
5081
5085
|
}, "strip", z.ZodTypeAny, {
|
|
5082
5086
|
name: string;
|
|
@@ -5224,6 +5228,7 @@ declare const technologySchema: z.ZodObject<{
|
|
|
5224
5228
|
}[];
|
|
5225
5229
|
description?: string | undefined;
|
|
5226
5230
|
technicalDetails?: string | undefined;
|
|
5231
|
+
photoTemplate?: string | undefined;
|
|
5227
5232
|
}, {
|
|
5228
5233
|
name: string;
|
|
5229
5234
|
family: ProcedureFamily;
|
|
@@ -5370,6 +5375,7 @@ declare const technologySchema: z.ZodObject<{
|
|
|
5370
5375
|
isActive?: boolean | undefined;
|
|
5371
5376
|
}[];
|
|
5372
5377
|
} | undefined;
|
|
5378
|
+
photoTemplate?: string | undefined;
|
|
5373
5379
|
}>;
|
|
5374
5380
|
/**
|
|
5375
5381
|
* Category validation schema
|
|
@@ -6090,6 +6096,7 @@ declare const technologyUpdateSchema: z.ZodObject<{
|
|
|
6090
6096
|
minimumLevel: CertificationLevel;
|
|
6091
6097
|
requiredSpecialties?: CertificationSpecialty[] | undefined;
|
|
6092
6098
|
}>>;
|
|
6099
|
+
photoTemplate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
6093
6100
|
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
6094
6101
|
}, "strip", z.ZodTypeAny, {
|
|
6095
6102
|
name?: string | undefined;
|
|
@@ -6237,6 +6244,7 @@ declare const technologyUpdateSchema: z.ZodObject<{
|
|
|
6237
6244
|
description?: string | undefined;
|
|
6238
6245
|
tags?: string[] | undefined;
|
|
6239
6246
|
}[] | undefined;
|
|
6247
|
+
photoTemplate?: string | undefined;
|
|
6240
6248
|
}, {
|
|
6241
6249
|
name?: string | undefined;
|
|
6242
6250
|
isActive?: boolean | undefined;
|
|
@@ -6383,6 +6391,7 @@ declare const technologyUpdateSchema: z.ZodObject<{
|
|
|
6383
6391
|
isRequired?: boolean | undefined;
|
|
6384
6392
|
sortingOrder?: number | undefined;
|
|
6385
6393
|
}[] | undefined;
|
|
6394
|
+
photoTemplate?: string | undefined;
|
|
6386
6395
|
}>;
|
|
6387
6396
|
declare const requirementUpdateSchema: z.ZodObject<{
|
|
6388
6397
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -1005,6 +1005,8 @@ interface Technology {
|
|
|
1005
1005
|
benefits: TreatmentBenefitDynamic[];
|
|
1006
1006
|
certificationRequirement: CertificationRequirement;
|
|
1007
1007
|
documentationTemplates?: TechnologyDocumentationTemplate[];
|
|
1008
|
+
/** Media ID of the default photo template image for this technology */
|
|
1009
|
+
photoTemplate?: string;
|
|
1008
1010
|
isActive: boolean;
|
|
1009
1011
|
createdAt: Date;
|
|
1010
1012
|
updatedAt: Date;
|
|
@@ -1944,6 +1946,7 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
|
|
|
1944
1946
|
benefits: TreatmentBenefitDynamic[];
|
|
1945
1947
|
certificationRequirement: CertificationRequirement;
|
|
1946
1948
|
documentationTemplates?: TechnologyDocumentationTemplate[] | undefined;
|
|
1949
|
+
photoTemplate?: string | undefined;
|
|
1947
1950
|
id: string;
|
|
1948
1951
|
}>;
|
|
1949
1952
|
/**
|
|
@@ -5077,6 +5080,7 @@ declare const technologySchema: z.ZodObject<{
|
|
|
5077
5080
|
minimumLevel: CertificationLevel;
|
|
5078
5081
|
requiredSpecialties?: CertificationSpecialty[] | undefined;
|
|
5079
5082
|
}>;
|
|
5083
|
+
photoTemplate: z.ZodOptional<z.ZodString>;
|
|
5080
5084
|
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
5081
5085
|
}, "strip", z.ZodTypeAny, {
|
|
5082
5086
|
name: string;
|
|
@@ -5224,6 +5228,7 @@ declare const technologySchema: z.ZodObject<{
|
|
|
5224
5228
|
}[];
|
|
5225
5229
|
description?: string | undefined;
|
|
5226
5230
|
technicalDetails?: string | undefined;
|
|
5231
|
+
photoTemplate?: string | undefined;
|
|
5227
5232
|
}, {
|
|
5228
5233
|
name: string;
|
|
5229
5234
|
family: ProcedureFamily;
|
|
@@ -5370,6 +5375,7 @@ declare const technologySchema: z.ZodObject<{
|
|
|
5370
5375
|
isActive?: boolean | undefined;
|
|
5371
5376
|
}[];
|
|
5372
5377
|
} | undefined;
|
|
5378
|
+
photoTemplate?: string | undefined;
|
|
5373
5379
|
}>;
|
|
5374
5380
|
/**
|
|
5375
5381
|
* Category validation schema
|
|
@@ -6090,6 +6096,7 @@ declare const technologyUpdateSchema: z.ZodObject<{
|
|
|
6090
6096
|
minimumLevel: CertificationLevel;
|
|
6091
6097
|
requiredSpecialties?: CertificationSpecialty[] | undefined;
|
|
6092
6098
|
}>>;
|
|
6099
|
+
photoTemplate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
6093
6100
|
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
6094
6101
|
}, "strip", z.ZodTypeAny, {
|
|
6095
6102
|
name?: string | undefined;
|
|
@@ -6237,6 +6244,7 @@ declare const technologyUpdateSchema: z.ZodObject<{
|
|
|
6237
6244
|
description?: string | undefined;
|
|
6238
6245
|
tags?: string[] | undefined;
|
|
6239
6246
|
}[] | undefined;
|
|
6247
|
+
photoTemplate?: string | undefined;
|
|
6240
6248
|
}, {
|
|
6241
6249
|
name?: string | undefined;
|
|
6242
6250
|
isActive?: boolean | undefined;
|
|
@@ -6383,6 +6391,7 @@ declare const technologyUpdateSchema: z.ZodObject<{
|
|
|
6383
6391
|
isRequired?: boolean | undefined;
|
|
6384
6392
|
sortingOrder?: number | undefined;
|
|
6385
6393
|
}[] | undefined;
|
|
6394
|
+
photoTemplate?: string | undefined;
|
|
6386
6395
|
}>;
|
|
6387
6396
|
declare const requirementUpdateSchema: z.ZodObject<{
|
|
6388
6397
|
name: z.ZodOptional<z.ZodString>;
|
package/dist/backoffice/index.js
CHANGED
|
@@ -2285,6 +2285,9 @@ var TechnologyService = class extends BaseService {
|
|
|
2285
2285
|
if (technology.technicalDetails) {
|
|
2286
2286
|
newTechnology.technicalDetails = technology.technicalDetails;
|
|
2287
2287
|
}
|
|
2288
|
+
if (technology.photoTemplate) {
|
|
2289
|
+
newTechnology.photoTemplate = technology.photoTemplate;
|
|
2290
|
+
}
|
|
2288
2291
|
const docRef = await (0, import_firestore11.addDoc)(this.technologiesRef, newTechnology);
|
|
2289
2292
|
return { id: docRef.id, ...newTechnology };
|
|
2290
2293
|
}
|
|
@@ -2407,6 +2410,13 @@ var TechnologyService = class extends BaseService {
|
|
|
2407
2410
|
delete updateData[key];
|
|
2408
2411
|
}
|
|
2409
2412
|
});
|
|
2413
|
+
if ("photoTemplate" in technology) {
|
|
2414
|
+
if (technology.photoTemplate === null || technology.photoTemplate === "") {
|
|
2415
|
+
updateData.photoTemplate = null;
|
|
2416
|
+
} else if (technology.photoTemplate !== void 0) {
|
|
2417
|
+
updateData.photoTemplate = technology.photoTemplate;
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2410
2420
|
updateData.updatedAt = /* @__PURE__ */ new Date();
|
|
2411
2421
|
const docRef = (0, import_firestore11.doc)(this.technologiesRef, id);
|
|
2412
2422
|
const beforeTech = await this.getById(id);
|
|
@@ -3510,6 +3520,7 @@ var technologySchema = import_zod2.z.object({
|
|
|
3510
3520
|
documentationTemplates: import_zod2.z.array(documentTemplateSchema),
|
|
3511
3521
|
benefits: import_zod2.z.array(treatmentBenefitSchemaBackoffice),
|
|
3512
3522
|
certificationRequirement: certificationRequirementSchema,
|
|
3523
|
+
photoTemplate: import_zod2.z.string().url("Photo template must be a valid URL").optional(),
|
|
3513
3524
|
isActive: import_zod2.z.boolean().default(true)
|
|
3514
3525
|
});
|
|
3515
3526
|
var categorySchema = import_zod2.z.object({
|
|
@@ -2305,6 +2305,9 @@ var TechnologyService = class extends BaseService {
|
|
|
2305
2305
|
if (technology.technicalDetails) {
|
|
2306
2306
|
newTechnology.technicalDetails = technology.technicalDetails;
|
|
2307
2307
|
}
|
|
2308
|
+
if (technology.photoTemplate) {
|
|
2309
|
+
newTechnology.photoTemplate = technology.photoTemplate;
|
|
2310
|
+
}
|
|
2308
2311
|
const docRef = await addDoc6(this.technologiesRef, newTechnology);
|
|
2309
2312
|
return { id: docRef.id, ...newTechnology };
|
|
2310
2313
|
}
|
|
@@ -2427,6 +2430,13 @@ var TechnologyService = class extends BaseService {
|
|
|
2427
2430
|
delete updateData[key];
|
|
2428
2431
|
}
|
|
2429
2432
|
});
|
|
2433
|
+
if ("photoTemplate" in technology) {
|
|
2434
|
+
if (technology.photoTemplate === null || technology.photoTemplate === "") {
|
|
2435
|
+
updateData.photoTemplate = null;
|
|
2436
|
+
} else if (technology.photoTemplate !== void 0) {
|
|
2437
|
+
updateData.photoTemplate = technology.photoTemplate;
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2430
2440
|
updateData.updatedAt = /* @__PURE__ */ new Date();
|
|
2431
2441
|
const docRef = doc9(this.technologiesRef, id);
|
|
2432
2442
|
const beforeTech = await this.getById(id);
|
|
@@ -3537,6 +3547,7 @@ var technologySchema = z2.object({
|
|
|
3537
3547
|
documentationTemplates: z2.array(documentTemplateSchema),
|
|
3538
3548
|
benefits: z2.array(treatmentBenefitSchemaBackoffice),
|
|
3539
3549
|
certificationRequirement: certificationRequirementSchema,
|
|
3550
|
+
photoTemplate: z2.string().url("Photo template must be a valid URL").optional(),
|
|
3540
3551
|
isActive: z2.boolean().default(true)
|
|
3541
3552
|
});
|
|
3542
3553
|
var categorySchema = z2.object({
|
package/dist/index.d.mts
CHANGED
|
@@ -70,7 +70,6 @@ interface PractitionerReview extends BaseReview {
|
|
|
70
70
|
/**
|
|
71
71
|
* Procedure review interface
|
|
72
72
|
* @description Full review for a medical procedure
|
|
73
|
-
* Used for both main and extended procedures
|
|
74
73
|
*/
|
|
75
74
|
interface ProcedureReview extends BaseReview {
|
|
76
75
|
procedureId: string;
|
|
@@ -139,7 +138,6 @@ interface Review {
|
|
|
139
138
|
clinicReview?: ClinicReview;
|
|
140
139
|
practitionerReview?: PractitionerReview;
|
|
141
140
|
procedureReview?: ProcedureReview;
|
|
142
|
-
extendedProcedureReviews?: ProcedureReview[];
|
|
143
141
|
overallComment: string;
|
|
144
142
|
overallRating: number;
|
|
145
143
|
}
|
|
@@ -946,6 +944,8 @@ interface Technology {
|
|
|
946
944
|
benefits: TreatmentBenefitDynamic[];
|
|
947
945
|
certificationRequirement: CertificationRequirement;
|
|
948
946
|
documentationTemplates?: TechnologyDocumentationTemplate[];
|
|
947
|
+
/** Media ID of the default photo template image for this technology */
|
|
948
|
+
photoTemplate?: string;
|
|
949
949
|
isActive: boolean;
|
|
950
950
|
createdAt: Date;
|
|
951
951
|
updatedAt: Date;
|
|
@@ -2167,6 +2167,7 @@ declare class TechnologyService extends BaseService implements ITechnologyServic
|
|
|
2167
2167
|
benefits: TreatmentBenefitDynamic[];
|
|
2168
2168
|
certificationRequirement: CertificationRequirement;
|
|
2169
2169
|
documentationTemplates?: TechnologyDocumentationTemplate[] | undefined;
|
|
2170
|
+
photoTemplate?: string | undefined;
|
|
2170
2171
|
id: string;
|
|
2171
2172
|
}>;
|
|
2172
2173
|
/**
|
|
@@ -3689,6 +3690,8 @@ interface PatientProfile {
|
|
|
3689
3690
|
clinics: PatientClinic[];
|
|
3690
3691
|
doctorIds: string[];
|
|
3691
3692
|
clinicIds: string[];
|
|
3693
|
+
/** IDs of dismissed next steps recommendations (format: appointmentId:recommendationIndex) */
|
|
3694
|
+
dismissedNextStepsRecommendations?: string[];
|
|
3692
3695
|
createdAt: Timestamp;
|
|
3693
3696
|
updatedAt: Timestamp;
|
|
3694
3697
|
}
|
|
@@ -4960,6 +4963,33 @@ interface SearchAppointmentsParams {
|
|
|
4960
4963
|
}
|
|
4961
4964
|
/** Firestore collection name */
|
|
4962
4965
|
declare const APPOINTMENTS_COLLECTION = "appointments";
|
|
4966
|
+
/**
|
|
4967
|
+
* Interface for next steps recommendation with context about when and who suggested it
|
|
4968
|
+
*/
|
|
4969
|
+
interface NextStepsRecommendation {
|
|
4970
|
+
/** Unique identifier for this recommendation (appointmentId + recommendationIndex) */
|
|
4971
|
+
id: string;
|
|
4972
|
+
/** The recommended procedure details */
|
|
4973
|
+
recommendedProcedure: RecommendedProcedure;
|
|
4974
|
+
/** ID of the appointment where this was recommended */
|
|
4975
|
+
appointmentId: string;
|
|
4976
|
+
/** Date of the appointment when this was recommended */
|
|
4977
|
+
appointmentDate: Timestamp;
|
|
4978
|
+
/** ID of the practitioner who made the recommendation */
|
|
4979
|
+
practitionerId: string;
|
|
4980
|
+
/** Name of the practitioner who made the recommendation */
|
|
4981
|
+
practitionerName: string;
|
|
4982
|
+
/** ID of the clinic where the appointment took place */
|
|
4983
|
+
clinicBranchId: string;
|
|
4984
|
+
/** Name of the clinic where the appointment took place */
|
|
4985
|
+
clinicName: string;
|
|
4986
|
+
/** Status of the appointment when recommendation was made */
|
|
4987
|
+
appointmentStatus: AppointmentStatus;
|
|
4988
|
+
/** Whether this recommendation has been dismissed by the patient */
|
|
4989
|
+
isDismissed?: boolean;
|
|
4990
|
+
/** When the recommendation was dismissed (if dismissed) */
|
|
4991
|
+
dismissedAt?: Timestamp | null;
|
|
4992
|
+
}
|
|
4963
4993
|
|
|
4964
4994
|
/**
|
|
4965
4995
|
* Refactored Calendar Service
|
|
@@ -6618,6 +6648,72 @@ declare class AppointmentService extends BaseService {
|
|
|
6618
6648
|
* @returns Photo entry
|
|
6619
6649
|
*/
|
|
6620
6650
|
getZonePhotoEntry(appointmentId: string, zoneId: string, photoIndex: number): Promise<BeforeAfterPerZone>;
|
|
6651
|
+
/**
|
|
6652
|
+
* Gets all next steps recommendations for a patient from their past appointments.
|
|
6653
|
+
* Returns recommendations with context about which appointment, practitioner, and clinic suggested them.
|
|
6654
|
+
*
|
|
6655
|
+
* @param patientId ID of the patient
|
|
6656
|
+
* @param options Optional parameters for filtering
|
|
6657
|
+
* @returns Array of next steps recommendations with context
|
|
6658
|
+
*/
|
|
6659
|
+
getPatientNextStepsRecommendations(patientId: string, options?: {
|
|
6660
|
+
/** Include dismissed recommendations (default: false) */
|
|
6661
|
+
includeDismissed?: boolean;
|
|
6662
|
+
/** Filter by clinic branch ID */
|
|
6663
|
+
clinicBranchId?: string;
|
|
6664
|
+
/** Filter by practitioner ID */
|
|
6665
|
+
practitionerId?: string;
|
|
6666
|
+
/** Limit the number of results */
|
|
6667
|
+
limit?: number;
|
|
6668
|
+
}): Promise<NextStepsRecommendation[]>;
|
|
6669
|
+
/**
|
|
6670
|
+
* Dismisses a next steps recommendation for a patient.
|
|
6671
|
+
* This prevents the recommendation from showing up in the default view.
|
|
6672
|
+
*
|
|
6673
|
+
* @param patientId ID of the patient
|
|
6674
|
+
* @param recommendationId ID of the recommendation to dismiss (format: appointmentId:recommendationIndex)
|
|
6675
|
+
* @returns Updated patient profile
|
|
6676
|
+
*/
|
|
6677
|
+
dismissNextStepsRecommendation(patientId: string, recommendationId: string): Promise<void>;
|
|
6678
|
+
/**
|
|
6679
|
+
* Undismisses a next steps recommendation for a patient.
|
|
6680
|
+
* This makes the recommendation visible again in the default view.
|
|
6681
|
+
*
|
|
6682
|
+
* @param patientId ID of the patient
|
|
6683
|
+
* @param recommendationId ID of the recommendation to undismiss (format: appointmentId:recommendationIndex)
|
|
6684
|
+
* @returns Updated patient profile
|
|
6685
|
+
*/
|
|
6686
|
+
undismissNextStepsRecommendation(patientId: string, recommendationId: string): Promise<void>;
|
|
6687
|
+
/**
|
|
6688
|
+
* Gets next steps recommendations for a clinic.
|
|
6689
|
+
* Returns all recommendations from appointments at the specified clinic.
|
|
6690
|
+
* This is useful for clinic admins to see what treatments have been recommended to their patients.
|
|
6691
|
+
*
|
|
6692
|
+
* @param clinicBranchId ID of the clinic branch
|
|
6693
|
+
* @param options Optional parameters for filtering
|
|
6694
|
+
* @returns Array of next steps recommendations with context
|
|
6695
|
+
*/
|
|
6696
|
+
getClinicNextStepsRecommendations(clinicBranchId: string, options?: {
|
|
6697
|
+
/** Filter by patient ID */
|
|
6698
|
+
patientId?: string;
|
|
6699
|
+
/** Filter by practitioner ID */
|
|
6700
|
+
practitionerId?: string;
|
|
6701
|
+
/** Limit the number of results */
|
|
6702
|
+
limit?: number;
|
|
6703
|
+
}): Promise<NextStepsRecommendation[]>;
|
|
6704
|
+
/**
|
|
6705
|
+
* Gets next steps recommendations from a specific appointment.
|
|
6706
|
+
* This is useful when viewing an appointment detail page in the clinic app
|
|
6707
|
+
* to see what procedures were recommended during that appointment.
|
|
6708
|
+
*
|
|
6709
|
+
* @param appointmentId ID of the appointment
|
|
6710
|
+
* @param options Optional parameters for filtering
|
|
6711
|
+
* @returns Array of next steps recommendations from that appointment
|
|
6712
|
+
*/
|
|
6713
|
+
getAppointmentNextStepsRecommendations(appointmentId: string, options?: {
|
|
6714
|
+
/** Filter by clinic branch ID - only show recommendations for procedures available at this clinic */
|
|
6715
|
+
clinicBranchId?: string;
|
|
6716
|
+
}): Promise<NextStepsRecommendation[]>;
|
|
6621
6717
|
}
|
|
6622
6718
|
|
|
6623
6719
|
declare class UserService extends BaseService {
|
|
@@ -7524,4 +7620,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
|
|
|
7524
7620
|
declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
|
|
7525
7621
|
declare const getFirebaseFunctions: () => Promise<Functions>;
|
|
7526
7622
|
|
|
7527
|
-
export { AESTHETIC_ANALYSIS_COLLECTION, APPOINTMENTS_COLLECTION, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type AestheticAnalysis, type AestheticAnalysisStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AssessmentScales, AuthService, type BaseDocumentElement, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, type ClinicalFindingDetail, type ClinicalFindings, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAestheticAnalysisData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBillingTransactionData, type CreateBlockingEventParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DEFAULT_MEDICAL_INFO, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, NOTIFICATIONS_COLLECTION, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PRACTITIONER_INVITES_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, type PatientGoals, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PlanDetails, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerInvite, type PractitionerInviteFilters, PractitionerInviteService, PractitionerInviteStatus, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedureProduct, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, ProductService, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RecommendedProcedure, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, type RequirementSourceProcedure, RequirementType, type Review, type ReviewRequestNotification, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, type ZoneItemData, type ZonePhotoUploadData, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
|
|
7623
|
+
export { AESTHETIC_ANALYSIS_COLLECTION, APPOINTMENTS_COLLECTION, type AddAllergyData, type AddBlockingConditionData, type AddContraindicationData, type AddMedicationData, type AddressData, type AdminInfo, type AdminToken, AdminTokenStatus, type AestheticAnalysis, type AestheticAnalysisStatus, type Allergy, type AllergySubtype, AllergyType, type AllergyTypeWithSubtype, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AssessmentScales, AuthService, type BaseDocumentElement, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicBranchSetupData, type ClinicContactInfo, type ClinicGroup, ClinicGroupService, type ClinicGroupSetupData, type ClinicInfo, type ClinicLocation, ClinicPhotoTag, type ClinicReview, type ClinicReviewInfo, ClinicService, ClinicTag, type ClinicTags, type ClinicalFindingDetail, type ClinicalFindings, ConstantsService, type ContactPerson, Contraindication, type ContraindicationDynamic, CosmeticAllergySubtype, type CreateAdminTokenData, type CreateAestheticAnalysisData, type CreateAppointmentData, type CreateAppointmentHttpData, type CreateAppointmentParams, type CreateBillingTransactionData, type CreateBlockingEventParams, type CreateCalendarEventData, type CreateClinicAdminData, type CreateClinicData, type CreateClinicGroupData, type CreateDefaultClinicGroupData, type CreateDocumentTemplateData, type CreateDraftPractitionerData, type CreateManualPatientData, type CreatePatientLocationInfoData, type CreatePatientMedicalInfoData, type CreatePatientProfileData, type CreatePatientSensitiveInfoData, type CreatePatientTokenData, type CreatePractitionerData, type CreatePractitionerInviteData, type CreatePractitionerTokenData, type CreateProcedureData, type CreateSyncedCalendarData, type CreateUserData, Currency, DEFAULT_MEDICAL_INFO, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DynamicTextElement, DynamicVariable, type EmergencyContact, EnvironmentalAllergySubtype, type ExtendedProcedureInfo, ExternalCalendarService, FILLED_DOCUMENTS_COLLECTION, type FileUploadElement, type FilledDocument, type FilledDocumentFileValue, FilledDocumentService, FilledDocumentStatus, type FinalBilling, type FirebaseUser, FoodAllergySubtype, type FormReminderNotification, type FormSubmissionConfirmationNotification, type GamificationInfo, Gender, type GeneralMessageNotification, type HeadingElement, HeadingLevel, INVITE_TOKENS_COLLECTION, Language, type LinkedFormInfo, type ListElement, ListType, type LocationData, MEDIA_METADATA_COLLECTION, MediaAccessLevel, type MediaMetadata, type MediaResource, MediaService, MediaType, MedicationAllergySubtype, type MultipleChoiceElement, NOTIFICATIONS_COLLECTION, type NextStepsRecommendation, type Notification, NotificationService, NotificationStatus, NotificationType, PATIENTS_COLLECTION, PATIENT_APPOINTMENTS_COLLECTION, PATIENT_LOCATION_INFO_COLLECTION, PATIENT_MEDICAL_HISTORY_COLLECTION, PATIENT_MEDICAL_INFO_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONERS_COLLECTION, PRACTITIONER_INVITES_COLLECTION, PROCEDURES_COLLECTION, type ParagraphElement, type PatientClinic, type PatientDoctor, type PatientGoals, PatientInstructionStatus, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PlanDetails, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerBasicInfo, type PractitionerCertification, type PractitionerClinicProcedures, type PractitionerClinicWorkingHours, type PractitionerInvite, type PractitionerInviteFilters, PractitionerInviteService, PractitionerInviteStatus, type PractitionerProfileInfo, type PractitionerReview, type PractitionerReviewInfo, PractitionerService, PractitionerStatus, type PractitionerToken, PractitionerTokenStatus, type PractitionerWorkingHours, type PreRequirementNotification, PricingMeasure, type Procedure, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedureProduct, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, ProductService, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type RecommendedProcedure, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, type RequirementSourceProcedure, RequirementType, type Review, type ReviewRequestNotification, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeSlot, TimeUnit, TreatmentBenefit, type TreatmentBenefitDynamic, USERS_COLLECTION, USER_FORMS_SUBCOLLECTION, type UpdateAestheticAnalysisData, type UpdateAllergyData, type UpdateAppointmentData, type UpdateAppointmentParams, type UpdateBlockingConditionData, type UpdateBlockingEventParams, type UpdateCalendarEventData, type UpdateClinicAdminData, type UpdateClinicData, type UpdateClinicGroupData, type UpdateContraindicationData, type UpdateDocumentTemplateData, type UpdateMedicationData, type UpdatePatientLocationInfoData, type UpdatePatientMedicalInfoData, type UpdatePatientProfileData, type UpdatePatientSensitiveInfoData, type UpdatePractitionerData, type UpdatePractitionerInviteData, type UpdateProcedureData, type UpdateSyncedCalendarData, type UpdateVitalStatsData, type User, UserRole, UserService, type VitalStats, type WorkingHours, type ZoneItemData, type ZonePhotoUploadData, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstance, getFirebaseStorage, initializeFirebase };
|