@blackcode_sa/metaestetics-api 1.12.68 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/admin/index.d.mts +801 -2
  2. package/dist/admin/index.d.ts +801 -2
  3. package/dist/admin/index.js +2332 -153
  4. package/dist/admin/index.mjs +2321 -153
  5. package/dist/index.d.mts +1057 -2
  6. package/dist/index.d.ts +1057 -2
  7. package/dist/index.js +4150 -2117
  8. package/dist/index.mjs +3832 -1810
  9. package/package.json +1 -1
  10. package/src/admin/aggregation/appointment/appointment.aggregation.service.ts +140 -0
  11. package/src/admin/analytics/analytics.admin.service.ts +278 -0
  12. package/src/admin/analytics/index.ts +2 -0
  13. package/src/admin/index.ts +6 -0
  14. package/src/backoffice/services/README.md +17 -0
  15. package/src/backoffice/services/analytics.service.proposal.md +863 -0
  16. package/src/backoffice/services/analytics.service.summary.md +143 -0
  17. package/src/services/analytics/ARCHITECTURE.md +199 -0
  18. package/src/services/analytics/CLOUD_FUNCTIONS.md +225 -0
  19. package/src/services/analytics/GROUPED_ANALYTICS.md +501 -0
  20. package/src/services/analytics/QUICK_START.md +393 -0
  21. package/src/services/analytics/README.md +287 -0
  22. package/src/services/analytics/SUMMARY.md +141 -0
  23. package/src/services/analytics/USAGE_GUIDE.md +518 -0
  24. package/src/services/analytics/analytics-cloud.service.ts +222 -0
  25. package/src/services/analytics/analytics.service.ts +1632 -0
  26. package/src/services/analytics/index.ts +3 -0
  27. package/src/services/analytics/utils/appointment-filtering.utils.ts +138 -0
  28. package/src/services/analytics/utils/cost-calculation.utils.ts +154 -0
  29. package/src/services/analytics/utils/grouping.utils.ts +394 -0
  30. package/src/services/analytics/utils/stored-analytics.utils.ts +347 -0
  31. package/src/services/analytics/utils/time-calculation.utils.ts +186 -0
  32. package/src/services/appointment/appointment.service.ts +50 -6
  33. package/src/services/index.ts +1 -0
  34. package/src/types/analytics/analytics.types.ts +500 -0
  35. package/src/types/analytics/grouped-analytics.types.ts +148 -0
  36. package/src/types/analytics/index.ts +4 -0
  37. package/src/types/analytics/stored-analytics.types.ts +137 -0
  38. package/src/types/index.ts +3 -0
  39. package/src/types/notifications/index.ts +21 -0
package/dist/index.d.mts CHANGED
@@ -3216,6 +3216,7 @@ declare enum NotificationType {
3216
3216
  FORM_REMINDER = "formReminder",// Reminds user to fill a specific form
3217
3217
  FORM_SUBMISSION_CONFIRMATION = "formSubmissionConfirmation",// Confirms form was submitted
3218
3218
  REVIEW_REQUEST = "reviewRequest",// Request for patient review post-appointment
3219
+ PROCEDURE_RECOMMENDATION = "procedureRecommendation",// Doctor recommended a procedure for follow-up
3219
3220
  PAYMENT_DUE = "paymentDue",
3220
3221
  PAYMENT_CONFIRMATION = "paymentConfirmation",
3221
3222
  PAYMENT_FAILED = "paymentFailed",
@@ -3385,6 +3386,24 @@ interface ReviewRequestNotification extends BaseNotification {
3385
3386
  practitionerName?: string;
3386
3387
  procedureName?: string;
3387
3388
  }
3389
+ /**
3390
+ * Notification for when a doctor recommends a procedure for follow-up.
3391
+ * Example: "Dr. Smith recommended [Procedure Name] for you. Suggested timeframe: in 2 weeks"
3392
+ */
3393
+ interface ProcedureRecommendationNotification extends BaseNotification {
3394
+ notificationType: NotificationType.PROCEDURE_RECOMMENDATION;
3395
+ appointmentId: string;
3396
+ recommendationId: string;
3397
+ procedureId: string;
3398
+ procedureName: string;
3399
+ practitionerName: string;
3400
+ clinicName: string;
3401
+ note?: string;
3402
+ timeframe: {
3403
+ value: number;
3404
+ unit: 'day' | 'week' | 'month' | 'year';
3405
+ };
3406
+ }
3388
3407
  /**
3389
3408
  * Generic notification for direct messages or announcements.
3390
3409
  */
@@ -3400,7 +3419,7 @@ interface PaymentConfirmationNotification extends BaseNotification {
3400
3419
  /**
3401
3420
  * Unija svih tipova notifikacija
3402
3421
  */
3403
- type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | GeneralMessageNotification | PaymentConfirmationNotification;
3422
+ type Notification = PreRequirementNotification | PostRequirementNotification | RequirementInstructionDueNotification | AppointmentReminderNotification | AppointmentStatusChangeNotification | AppointmentRescheduledProposalNotification | AppointmentCancelledNotification | FormReminderNotification | FormSubmissionConfirmationNotification | ReviewRequestNotification | ProcedureRecommendationNotification | GeneralMessageNotification | PaymentConfirmationNotification;
3404
3423
 
3405
3424
  declare enum AllergyType {
3406
3425
  MEDICATION = "medication",
@@ -3977,6 +3996,732 @@ interface CreatePatientTokenData {
3977
3996
  expiresAt?: Date;
3978
3997
  }
3979
3998
 
3999
+ /**
4000
+ * Base metrics interface with common properties
4001
+ */
4002
+ interface BaseMetrics {
4003
+ total: number;
4004
+ dateRange?: {
4005
+ start: Date;
4006
+ end: Date;
4007
+ };
4008
+ }
4009
+ /**
4010
+ * Date range filter for analytics queries
4011
+ */
4012
+ interface AnalyticsDateRange {
4013
+ start: Date;
4014
+ end: Date;
4015
+ }
4016
+ /**
4017
+ * Common filters for analytics queries
4018
+ */
4019
+ interface AnalyticsFilters {
4020
+ clinicBranchId?: string;
4021
+ practitionerId?: string;
4022
+ procedureId?: string;
4023
+ patientId?: string;
4024
+ }
4025
+ /**
4026
+ * Grouping period for trend analysis
4027
+ */
4028
+ type GroupingPeriod = 'day' | 'week' | 'month';
4029
+ /**
4030
+ * Entity type for grouping analytics
4031
+ */
4032
+ type EntityType = 'clinic' | 'practitioner' | 'patient' | 'procedure' | 'technology';
4033
+ /**
4034
+ * Practitioner Analytics
4035
+ * Comprehensive metrics for a practitioner's performance
4036
+ */
4037
+ interface PractitionerAnalytics extends BaseMetrics {
4038
+ practitionerId: string;
4039
+ practitionerName: string;
4040
+ totalAppointments: number;
4041
+ completedAppointments: number;
4042
+ canceledAppointments: number;
4043
+ noShowAppointments: number;
4044
+ pendingAppointments: number;
4045
+ confirmedAppointments: number;
4046
+ cancellationRate: number;
4047
+ noShowRate: number;
4048
+ averageBookedTime: number;
4049
+ averageActualTime: number;
4050
+ timeEfficiency: number;
4051
+ totalRevenue: number;
4052
+ averageRevenuePerAppointment: number;
4053
+ currency: string;
4054
+ topProcedures: Array<{
4055
+ procedureId: string;
4056
+ procedureName: string;
4057
+ count: number;
4058
+ revenue: number;
4059
+ }>;
4060
+ patientRetentionRate: number;
4061
+ uniquePatients: number;
4062
+ }
4063
+ /**
4064
+ * Procedure Analytics
4065
+ * Comprehensive metrics for procedure performance
4066
+ */
4067
+ interface ProcedureAnalytics extends BaseMetrics {
4068
+ procedureId: string;
4069
+ procedureName: string;
4070
+ procedureFamily: string;
4071
+ categoryName: string;
4072
+ subcategoryName: string;
4073
+ technologyName: string;
4074
+ totalAppointments: number;
4075
+ completedAppointments: number;
4076
+ canceledAppointments: number;
4077
+ noShowAppointments: number;
4078
+ cancellationRate: number;
4079
+ noShowRate: number;
4080
+ averageCost: number;
4081
+ totalRevenue: number;
4082
+ averageRevenuePerAppointment: number;
4083
+ currency: string;
4084
+ averageBookedDuration: number;
4085
+ averageActualDuration: number;
4086
+ productUsage: Array<{
4087
+ productId: string;
4088
+ productName: string;
4089
+ brandName: string;
4090
+ totalQuantity: number;
4091
+ totalRevenue: number;
4092
+ usageCount: number;
4093
+ }>;
4094
+ }
4095
+ /**
4096
+ * Time Efficiency Metrics
4097
+ * Analysis of booked time vs actual time spent
4098
+ */
4099
+ interface TimeEfficiencyMetrics {
4100
+ totalAppointments: number;
4101
+ appointmentsWithActualTime: number;
4102
+ averageBookedDuration: number;
4103
+ averageActualDuration: number;
4104
+ averageEfficiency: number;
4105
+ totalOverrun: number;
4106
+ totalUnderutilization: number;
4107
+ averageOverrun: number;
4108
+ averageUnderutilization: number;
4109
+ efficiencyDistribution: Array<{
4110
+ range: string;
4111
+ count: number;
4112
+ percentage: number;
4113
+ }>;
4114
+ }
4115
+ /**
4116
+ * Cancellation Metrics
4117
+ * Analysis of appointment cancellations
4118
+ */
4119
+ interface CancellationMetrics {
4120
+ entityId: string;
4121
+ entityName: string;
4122
+ entityType: EntityType;
4123
+ totalAppointments: number;
4124
+ canceledAppointments: number;
4125
+ cancellationRate: number;
4126
+ canceledByPatient: number;
4127
+ canceledByClinic: number;
4128
+ canceledByPractitioner: number;
4129
+ canceledRescheduled: number;
4130
+ averageCancellationLeadTime: number;
4131
+ cancellationReasons: Array<{
4132
+ reason: string;
4133
+ count: number;
4134
+ percentage: number;
4135
+ }>;
4136
+ }
4137
+ /**
4138
+ * No-Show Metrics
4139
+ * Analysis of appointment no-shows
4140
+ */
4141
+ interface NoShowMetrics {
4142
+ entityId: string;
4143
+ entityName: string;
4144
+ entityType: EntityType;
4145
+ totalAppointments: number;
4146
+ noShowAppointments: number;
4147
+ noShowRate: number;
4148
+ }
4149
+ /**
4150
+ * Revenue Metrics
4151
+ * Financial analysis and revenue tracking
4152
+ */
4153
+ interface RevenueMetrics {
4154
+ totalRevenue: number;
4155
+ averageRevenuePerAppointment: number;
4156
+ totalAppointments: number;
4157
+ completedAppointments: number;
4158
+ currency: string;
4159
+ revenueByStatus: Partial<Record<AppointmentStatus, number>>;
4160
+ revenueByPaymentStatus: Partial<Record<PaymentStatus, number>>;
4161
+ unpaidRevenue: number;
4162
+ refundedRevenue: number;
4163
+ totalTax: number;
4164
+ totalSubtotal: number;
4165
+ }
4166
+ /**
4167
+ * Revenue Trend
4168
+ * Revenue data over time
4169
+ */
4170
+ interface RevenueTrend {
4171
+ period: string;
4172
+ startDate: Date;
4173
+ endDate: Date;
4174
+ revenue: number;
4175
+ appointmentCount: number;
4176
+ averageRevenue: number;
4177
+ }
4178
+ /**
4179
+ * Duration Trend
4180
+ * Appointment duration trends over time
4181
+ */
4182
+ interface DurationTrend {
4183
+ period: string;
4184
+ startDate: Date;
4185
+ endDate: Date;
4186
+ averageBookedDuration: number;
4187
+ averageActualDuration: number;
4188
+ averageEfficiency: number;
4189
+ appointmentCount: number;
4190
+ }
4191
+ /**
4192
+ * Product Usage Metrics
4193
+ * Analysis of product usage in appointments
4194
+ */
4195
+ interface ProductUsageMetrics {
4196
+ productId: string;
4197
+ productName: string;
4198
+ brandId: string;
4199
+ brandName: string;
4200
+ totalQuantity: number;
4201
+ totalRevenue: number;
4202
+ averagePrice: number;
4203
+ currency: string;
4204
+ usageCount: number;
4205
+ averageQuantityPerAppointment: number;
4206
+ usageByProcedure: Array<{
4207
+ procedureId: string;
4208
+ procedureName: string;
4209
+ count: number;
4210
+ totalQuantity: number;
4211
+ }>;
4212
+ }
4213
+ /**
4214
+ * Product Revenue Metrics
4215
+ * Revenue contribution by product
4216
+ */
4217
+ interface ProductRevenueMetrics {
4218
+ productId: string;
4219
+ productName: string;
4220
+ brandName: string;
4221
+ totalRevenue: number;
4222
+ currency: string;
4223
+ usageCount: number;
4224
+ averageRevenuePerUsage: number;
4225
+ }
4226
+ /**
4227
+ * Product Usage by Procedure
4228
+ * Product usage patterns for specific procedures
4229
+ */
4230
+ interface ProductUsageByProcedure {
4231
+ procedureId: string;
4232
+ procedureName: string;
4233
+ products: Array<{
4234
+ productId: string;
4235
+ productName: string;
4236
+ brandName: string;
4237
+ totalQuantity: number;
4238
+ totalRevenue: number;
4239
+ usageCount: number;
4240
+ }>;
4241
+ }
4242
+ /**
4243
+ * Patient Analytics
4244
+ * Comprehensive patient metrics
4245
+ */
4246
+ interface PatientAnalytics {
4247
+ patientId: string;
4248
+ patientName: string;
4249
+ totalAppointments: number;
4250
+ completedAppointments: number;
4251
+ canceledAppointments: number;
4252
+ noShowAppointments: number;
4253
+ cancellationRate: number;
4254
+ noShowRate: number;
4255
+ totalRevenue: number;
4256
+ averageRevenuePerAppointment: number;
4257
+ currency: string;
4258
+ lifetimeValue: number;
4259
+ firstAppointmentDate: Date | null;
4260
+ lastAppointmentDate: Date | null;
4261
+ averageDaysBetweenAppointments: number | null;
4262
+ uniquePractitioners: number;
4263
+ uniqueClinics: number;
4264
+ favoriteProcedures: Array<{
4265
+ procedureId: string;
4266
+ procedureName: string;
4267
+ count: number;
4268
+ }>;
4269
+ }
4270
+ /**
4271
+ * Patient Lifetime Value Metrics
4272
+ * Patient value analysis
4273
+ */
4274
+ interface PatientLifetimeValueMetrics {
4275
+ totalPatients: number;
4276
+ averageLifetimeValue: number;
4277
+ currency: string;
4278
+ topPatients: Array<{
4279
+ patientId: string;
4280
+ patientName: string;
4281
+ lifetimeValue: number;
4282
+ appointmentCount: number;
4283
+ }>;
4284
+ valueDistribution: Array<{
4285
+ range: string;
4286
+ count: number;
4287
+ percentage: number;
4288
+ }>;
4289
+ }
4290
+ /**
4291
+ * Patient Retention Metrics
4292
+ * Patient retention and return analysis
4293
+ */
4294
+ interface PatientRetentionMetrics {
4295
+ totalPatients: number;
4296
+ newPatients: number;
4297
+ returningPatients: number;
4298
+ retentionRate: number;
4299
+ averageAppointmentsPerPatient: number;
4300
+ patientsByAppointmentCount: Array<{
4301
+ appointmentCount: number;
4302
+ patientCount: number;
4303
+ percentage: number;
4304
+ }>;
4305
+ }
4306
+ /**
4307
+ * Cost Per Patient Metrics
4308
+ * Cost analysis per patient
4309
+ */
4310
+ interface CostPerPatientMetrics {
4311
+ totalPatients: number;
4312
+ totalRevenue: number;
4313
+ averageCostPerPatient: number;
4314
+ currency: string;
4315
+ costDistribution: Array<{
4316
+ range: string;
4317
+ patientCount: number;
4318
+ percentage: number;
4319
+ }>;
4320
+ patientCosts?: Array<{
4321
+ patientId: string;
4322
+ patientName: string;
4323
+ totalCost: number;
4324
+ appointmentCount: number;
4325
+ averageCost: number;
4326
+ }>;
4327
+ }
4328
+ /**
4329
+ * Payment Status Breakdown
4330
+ * Analysis of payment statuses
4331
+ */
4332
+ interface PaymentStatusBreakdown {
4333
+ totalAppointments: number;
4334
+ byStatus: Partial<Record<PaymentStatus, {
4335
+ count: number;
4336
+ percentage: number;
4337
+ totalRevenue: number;
4338
+ }>>;
4339
+ unpaidCount: number;
4340
+ unpaidRevenue: number;
4341
+ paidCount: number;
4342
+ paidRevenue: number;
4343
+ partiallyPaidCount: number;
4344
+ partiallyPaidRevenue: number;
4345
+ refundedCount: number;
4346
+ refundedRevenue: number;
4347
+ }
4348
+ /**
4349
+ * Clinic Analytics
4350
+ * Comprehensive clinic performance metrics
4351
+ */
4352
+ interface ClinicAnalytics {
4353
+ clinicBranchId: string;
4354
+ clinicName: string;
4355
+ totalAppointments: number;
4356
+ completedAppointments: number;
4357
+ canceledAppointments: number;
4358
+ noShowAppointments: number;
4359
+ cancellationRate: number;
4360
+ noShowRate: number;
4361
+ totalRevenue: number;
4362
+ averageRevenuePerAppointment: number;
4363
+ currency: string;
4364
+ practitionerCount: number;
4365
+ patientCount: number;
4366
+ procedureCount: number;
4367
+ topPractitioners: Array<{
4368
+ practitionerId: string;
4369
+ practitionerName: string;
4370
+ appointmentCount: number;
4371
+ revenue: number;
4372
+ }>;
4373
+ topProcedures: Array<{
4374
+ procedureId: string;
4375
+ procedureName: string;
4376
+ appointmentCount: number;
4377
+ revenue: number;
4378
+ }>;
4379
+ }
4380
+ /**
4381
+ * Clinic Comparison Metrics
4382
+ * Comparison data for multiple clinics
4383
+ */
4384
+ interface ClinicComparisonMetrics {
4385
+ clinicBranchId: string;
4386
+ clinicName: string;
4387
+ totalAppointments: number;
4388
+ completedAppointments: number;
4389
+ cancellationRate: number;
4390
+ noShowRate: number;
4391
+ totalRevenue: number;
4392
+ averageRevenuePerAppointment: number;
4393
+ practitionerCount: number;
4394
+ patientCount: number;
4395
+ efficiency: number;
4396
+ }
4397
+ /**
4398
+ * Procedure Popularity
4399
+ * Popularity metrics for procedures
4400
+ */
4401
+ interface ProcedurePopularity {
4402
+ procedureId: string;
4403
+ procedureName: string;
4404
+ categoryName: string;
4405
+ subcategoryName: string;
4406
+ technologyName: string;
4407
+ appointmentCount: number;
4408
+ completedCount: number;
4409
+ rank: number;
4410
+ }
4411
+ /**
4412
+ * Procedure Profitability
4413
+ * Profitability metrics for procedures
4414
+ */
4415
+ interface ProcedureProfitability {
4416
+ procedureId: string;
4417
+ procedureName: string;
4418
+ categoryName: string;
4419
+ subcategoryName: string;
4420
+ technologyName: string;
4421
+ totalRevenue: number;
4422
+ averageRevenue: number;
4423
+ appointmentCount: number;
4424
+ rank: number;
4425
+ }
4426
+ /**
4427
+ * Cancellation Reason Statistics
4428
+ * Breakdown of cancellation reasons
4429
+ */
4430
+ interface CancellationReasonStats {
4431
+ reason: string;
4432
+ count: number;
4433
+ percentage: number;
4434
+ averageLeadTime: number;
4435
+ }
4436
+ /**
4437
+ * Dashboard Analytics
4438
+ * Comprehensive dashboard data aggregation
4439
+ */
4440
+ interface DashboardAnalytics {
4441
+ overview: {
4442
+ totalAppointments: number;
4443
+ completedAppointments: number;
4444
+ canceledAppointments: number;
4445
+ noShowAppointments: number;
4446
+ pendingAppointments: number;
4447
+ confirmedAppointments: number;
4448
+ totalRevenue: number;
4449
+ averageRevenuePerAppointment: number;
4450
+ currency: string;
4451
+ uniquePatients: number;
4452
+ uniquePractitioners: number;
4453
+ uniqueProcedures: number;
4454
+ cancellationRate: number;
4455
+ noShowRate: number;
4456
+ };
4457
+ practitionerMetrics: PractitionerAnalytics[];
4458
+ procedureMetrics: ProcedureAnalytics[];
4459
+ cancellationMetrics: CancellationMetrics;
4460
+ noShowMetrics: NoShowMetrics;
4461
+ revenueTrends: RevenueTrend[];
4462
+ timeEfficiency: TimeEfficiencyMetrics;
4463
+ topProducts: ProductUsageMetrics[];
4464
+ recentActivity: Array<{
4465
+ type: 'appointment' | 'cancellation' | 'completion' | 'no_show';
4466
+ date: Date;
4467
+ description: string;
4468
+ entityId?: string;
4469
+ entityName?: string;
4470
+ }>;
4471
+ }
4472
+
4473
+ /**
4474
+ * Period type for analytics snapshots
4475
+ */
4476
+ type AnalyticsPeriod = 'daily' | 'weekly' | 'monthly' | 'yearly' | 'all_time';
4477
+ /**
4478
+ * Analytics document metadata
4479
+ */
4480
+ interface AnalyticsMetadata {
4481
+ clinicBranchId: string;
4482
+ period: AnalyticsPeriod;
4483
+ periodStart: Date;
4484
+ periodEnd: Date;
4485
+ computedAt: Timestamp;
4486
+ computedBy: 'cloud_function' | 'manual';
4487
+ version: string;
4488
+ }
4489
+ /**
4490
+ * Stored Practitioner Analytics
4491
+ * Stored in: clinics/{clinicBranchId}/analytics/practitioners/{practitionerId}/{period}
4492
+ */
4493
+ interface StoredPractitionerAnalytics extends PractitionerAnalytics {
4494
+ metadata: AnalyticsMetadata;
4495
+ }
4496
+ /**
4497
+ * Stored Procedure Analytics
4498
+ * Stored in: clinics/{clinicBranchId}/analytics/procedures/{procedureId}/{period}
4499
+ */
4500
+ interface StoredProcedureAnalytics extends ProcedureAnalytics {
4501
+ metadata: AnalyticsMetadata;
4502
+ }
4503
+ /**
4504
+ * Stored Clinic Analytics
4505
+ * Stored in: clinics/{clinicBranchId}/analytics/clinic/{period}
4506
+ */
4507
+ interface StoredClinicAnalytics extends ClinicAnalytics {
4508
+ metadata: AnalyticsMetadata;
4509
+ }
4510
+ /**
4511
+ * Stored Dashboard Analytics
4512
+ * Stored in: clinics/{clinicBranchId}/analytics/dashboard/{period}
4513
+ */
4514
+ interface StoredDashboardAnalytics extends DashboardAnalytics {
4515
+ metadata: AnalyticsMetadata;
4516
+ }
4517
+ /**
4518
+ * Stored Time Efficiency Metrics
4519
+ * Stored in: clinics/{clinicBranchId}/analytics/time_efficiency/{period}
4520
+ */
4521
+ interface StoredTimeEfficiencyMetrics extends TimeEfficiencyMetrics {
4522
+ metadata: AnalyticsMetadata;
4523
+ }
4524
+ /**
4525
+ * Stored Cancellation Metrics
4526
+ * Stored in: clinics/{clinicBranchId}/analytics/cancellations/{entityType}/{period}
4527
+ */
4528
+ interface StoredCancellationMetrics extends CancellationMetrics {
4529
+ metadata: AnalyticsMetadata;
4530
+ }
4531
+ /**
4532
+ * Stored No-Show Metrics
4533
+ * Stored in: clinics/{clinicBranchId}/analytics/no_shows/{entityType}/{period}
4534
+ */
4535
+ interface StoredNoShowMetrics extends NoShowMetrics {
4536
+ metadata: AnalyticsMetadata;
4537
+ }
4538
+ /**
4539
+ * Stored Revenue Metrics
4540
+ * Stored in: clinics/{clinicBranchId}/analytics/revenue/{period}
4541
+ */
4542
+ interface StoredRevenueMetrics extends RevenueMetrics {
4543
+ metadata: AnalyticsMetadata;
4544
+ }
4545
+ /**
4546
+ * Collection names for stored analytics
4547
+ */
4548
+ declare const ANALYTICS_COLLECTION = "analytics";
4549
+ declare const PRACTITIONER_ANALYTICS_SUBCOLLECTION = "practitioners";
4550
+ declare const PROCEDURE_ANALYTICS_SUBCOLLECTION = "procedures";
4551
+ declare const CLINIC_ANALYTICS_SUBCOLLECTION = "clinic";
4552
+ declare const DASHBOARD_ANALYTICS_SUBCOLLECTION = "dashboard";
4553
+ declare const TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION = "time_efficiency";
4554
+ declare const CANCELLATION_ANALYTICS_SUBCOLLECTION = "cancellations";
4555
+ declare const NO_SHOW_ANALYTICS_SUBCOLLECTION = "no_shows";
4556
+ declare const REVENUE_ANALYTICS_SUBCOLLECTION = "revenue";
4557
+ /**
4558
+ * Options for reading stored analytics
4559
+ */
4560
+ interface ReadStoredAnalyticsOptions {
4561
+ /**
4562
+ * Whether to use cached/pre-computed data
4563
+ * @default true
4564
+ */
4565
+ useCache?: boolean;
4566
+ /**
4567
+ * Maximum age of cached data in hours before recalculating
4568
+ * @default 12
4569
+ */
4570
+ maxCacheAgeHours?: number;
4571
+ /**
4572
+ * Period to read
4573
+ * @default 'all_time'
4574
+ */
4575
+ period?: AnalyticsPeriod;
4576
+ /**
4577
+ * Date range for the period (calculated if not provided)
4578
+ */
4579
+ dateRange?: AnalyticsDateRange;
4580
+ /**
4581
+ * Clinic branch ID (required for reading stored analytics)
4582
+ */
4583
+ clinicBranchId?: string;
4584
+ }
4585
+
4586
+ /**
4587
+ * Base interface for grouped analytics results
4588
+ * All grouped analytics share common entity identification
4589
+ */
4590
+ interface GroupedAnalyticsBase {
4591
+ entityId: string;
4592
+ entityName: string;
4593
+ entityType: EntityType;
4594
+ }
4595
+ /**
4596
+ * Grouped Revenue Metrics
4597
+ * Revenue analytics grouped by clinic, practitioner, procedure, or patient
4598
+ */
4599
+ interface GroupedRevenueMetrics extends GroupedAnalyticsBase {
4600
+ totalRevenue: number;
4601
+ averageRevenuePerAppointment: number;
4602
+ totalAppointments: number;
4603
+ completedAppointments: number;
4604
+ currency: string;
4605
+ unpaidRevenue: number;
4606
+ refundedRevenue: number;
4607
+ totalTax: number;
4608
+ totalSubtotal: number;
4609
+ }
4610
+ /**
4611
+ * Grouped Product Usage Metrics
4612
+ * Product usage analytics grouped by clinic, practitioner, procedure, or patient
4613
+ */
4614
+ interface GroupedProductUsageMetrics extends GroupedAnalyticsBase {
4615
+ totalProductsUsed: number;
4616
+ uniqueProducts: number;
4617
+ totalProductRevenue: number;
4618
+ totalProductQuantity: number;
4619
+ averageProductsPerAppointment: number;
4620
+ topProducts: Array<{
4621
+ productId: string;
4622
+ productName: string;
4623
+ brandName: string;
4624
+ totalQuantity: number;
4625
+ totalRevenue: number;
4626
+ usageCount: number;
4627
+ }>;
4628
+ }
4629
+ /**
4630
+ * Grouped Patient Retention Metrics
4631
+ * Patient retention analytics grouped by clinic, practitioner, or procedure
4632
+ */
4633
+ interface GroupedPatientRetentionMetrics extends GroupedAnalyticsBase {
4634
+ totalPatients: number;
4635
+ newPatients: number;
4636
+ returningPatients: number;
4637
+ retentionRate: number;
4638
+ averageAppointmentsPerPatient: number;
4639
+ patientsByAppointmentCount: Array<{
4640
+ appointmentCount: number;
4641
+ patientCount: number;
4642
+ percentage: number;
4643
+ }>;
4644
+ }
4645
+ /**
4646
+ * Grouped Time Efficiency Metrics
4647
+ * Time efficiency analytics grouped by clinic, practitioner, procedure, or patient
4648
+ */
4649
+ interface GroupedTimeEfficiencyMetrics extends GroupedAnalyticsBase {
4650
+ totalAppointments: number;
4651
+ appointmentsWithActualTime: number;
4652
+ averageBookedDuration: number;
4653
+ averageActualDuration: number;
4654
+ averageEfficiency: number;
4655
+ totalOverrun: number;
4656
+ totalUnderutilization: number;
4657
+ averageOverrun: number;
4658
+ averageUnderutilization: number;
4659
+ }
4660
+ /**
4661
+ * Grouped Patient Behavior Metrics
4662
+ * Patient behavior (no-show, cancellation) grouped by clinic, practitioner, or procedure
4663
+ */
4664
+ interface GroupedPatientBehaviorMetrics extends GroupedAnalyticsBase {
4665
+ totalPatients: number;
4666
+ patientsWithNoShows: number;
4667
+ patientsWithCancellations: number;
4668
+ averageNoShowRate: number;
4669
+ averageCancellationRate: number;
4670
+ topNoShowPatients: Array<{
4671
+ patientId: string;
4672
+ patientName: string;
4673
+ noShowCount: number;
4674
+ totalAppointments: number;
4675
+ noShowRate: number;
4676
+ }>;
4677
+ topCancellationPatients: Array<{
4678
+ patientId: string;
4679
+ patientName: string;
4680
+ cancellationCount: number;
4681
+ totalAppointments: number;
4682
+ cancellationRate: number;
4683
+ }>;
4684
+ }
4685
+ /**
4686
+ * Grouped Procedure Performance Metrics
4687
+ * Procedure performance grouped by clinic or practitioner
4688
+ */
4689
+ interface GroupedProcedurePerformanceMetrics extends GroupedAnalyticsBase {
4690
+ totalProcedures: number;
4691
+ totalAppointments: number;
4692
+ completedAppointments: number;
4693
+ totalRevenue: number;
4694
+ averageRevenuePerProcedure: number;
4695
+ topProcedures: Array<{
4696
+ procedureId: string;
4697
+ procedureName: string;
4698
+ appointmentCount: number;
4699
+ revenue: number;
4700
+ cancellationRate: number;
4701
+ noShowRate: number;
4702
+ }>;
4703
+ }
4704
+ /**
4705
+ * Grouped Practitioner Performance Metrics
4706
+ * Practitioner performance grouped by clinic
4707
+ */
4708
+ interface GroupedPractitionerPerformanceMetrics extends GroupedAnalyticsBase {
4709
+ totalPractitioners: number;
4710
+ totalAppointments: number;
4711
+ completedAppointments: number;
4712
+ totalRevenue: number;
4713
+ averageRevenuePerPractitioner: number;
4714
+ topPractitioners: Array<{
4715
+ practitionerId: string;
4716
+ practitionerName: string;
4717
+ appointmentCount: number;
4718
+ revenue: number;
4719
+ cancellationRate: number;
4720
+ noShowRate: number;
4721
+ timeEfficiency: number;
4722
+ }>;
4723
+ }
4724
+
3980
4725
  /**
3981
4726
  * Procedure represents a specific medical procedure that can be performed by a practitioner in a clinic
3982
4727
  * It inherits properties from technology and adds clinic/practitioner specific details
@@ -6791,6 +7536,316 @@ declare class AppointmentService extends BaseService {
6791
7536
  }): Promise<NextStepsRecommendation[]>;
6792
7537
  }
6793
7538
 
7539
+ /**
7540
+ * AnalyticsService provides comprehensive financial and analytical intelligence
7541
+ * for the Clinic Admin app, including metrics about doctors, procedures,
7542
+ * appointments, patients, products, and clinic operations.
7543
+ */
7544
+ declare class AnalyticsService extends BaseService {
7545
+ private appointmentService;
7546
+ /**
7547
+ * Creates a new AnalyticsService instance.
7548
+ *
7549
+ * @param db Firestore instance
7550
+ * @param auth Firebase Auth instance
7551
+ * @param app Firebase App instance
7552
+ * @param appointmentService Appointment service instance for querying appointments
7553
+ */
7554
+ constructor(db: Firestore, auth: Auth, app: FirebaseApp, appointmentService: AppointmentService);
7555
+ /**
7556
+ * Fetches appointments with optional filters
7557
+ *
7558
+ * @param filters - Optional filters
7559
+ * @param dateRange - Optional date range
7560
+ * @returns Array of appointments
7561
+ */
7562
+ private fetchAppointments;
7563
+ /**
7564
+ * Get practitioner performance metrics
7565
+ * First checks for stored analytics, then calculates if not available or stale
7566
+ *
7567
+ * @param practitionerId - ID of the practitioner
7568
+ * @param dateRange - Optional date range filter
7569
+ * @param options - Options for reading stored analytics
7570
+ * @returns Practitioner analytics object
7571
+ */
7572
+ getPractitionerAnalytics(practitionerId: string, dateRange?: AnalyticsDateRange, options?: ReadStoredAnalyticsOptions): Promise<PractitionerAnalytics>;
7573
+ /**
7574
+ * Get procedure performance metrics
7575
+ * First checks for stored analytics, then calculates if not available or stale
7576
+ *
7577
+ * @param procedureId - ID of the procedure (optional, if not provided returns all)
7578
+ * @param dateRange - Optional date range filter
7579
+ * @param options - Options for reading stored analytics
7580
+ * @returns Procedure analytics object or array
7581
+ */
7582
+ getProcedureAnalytics(procedureId?: string, dateRange?: AnalyticsDateRange, options?: ReadStoredAnalyticsOptions): Promise<ProcedureAnalytics | ProcedureAnalytics[]>;
7583
+ /**
7584
+ * Calculate analytics for a specific procedure
7585
+ *
7586
+ * @param appointments - Appointments for the procedure
7587
+ * @param procedureId - Procedure ID
7588
+ * @returns Procedure analytics
7589
+ */
7590
+ private calculateProcedureAnalytics;
7591
+ /**
7592
+ * Get procedure popularity metrics
7593
+ *
7594
+ * @param dateRange - Optional date range filter
7595
+ * @param limit - Number of top procedures to return
7596
+ * @returns Array of procedure popularity metrics
7597
+ */
7598
+ getProcedurePopularity(dateRange?: AnalyticsDateRange, limit?: number): Promise<ProcedurePopularity[]>;
7599
+ /**
7600
+ * Get procedure profitability metrics
7601
+ *
7602
+ * @param dateRange - Optional date range filter
7603
+ * @param limit - Number of top procedures to return
7604
+ * @returns Array of procedure profitability metrics
7605
+ */
7606
+ getProcedureProfitability(dateRange?: AnalyticsDateRange, limit?: number): Promise<ProcedureProfitability[]>;
7607
+ /**
7608
+ * Get time efficiency metrics grouped by clinic, practitioner, procedure, patient, or technology
7609
+ *
7610
+ * @param groupBy - Group by 'clinic' | 'practitioner' | 'procedure' | 'patient' | 'technology'
7611
+ * @param dateRange - Optional date range filter
7612
+ * @param filters - Optional additional filters
7613
+ * @returns Grouped time efficiency metrics
7614
+ */
7615
+ getTimeEfficiencyMetricsByEntity(groupBy: EntityType, dateRange?: AnalyticsDateRange, filters?: AnalyticsFilters): Promise<GroupedTimeEfficiencyMetrics[]>;
7616
+ /**
7617
+ * Get time efficiency metrics for appointments
7618
+ * First checks for stored analytics, then calculates if not available or stale
7619
+ *
7620
+ * @param filters - Optional filters
7621
+ * @param dateRange - Optional date range filter
7622
+ * @param options - Options for reading stored analytics
7623
+ * @returns Time efficiency metrics
7624
+ */
7625
+ getTimeEfficiencyMetrics(filters?: AnalyticsFilters, dateRange?: AnalyticsDateRange, options?: ReadStoredAnalyticsOptions): Promise<TimeEfficiencyMetrics>;
7626
+ /**
7627
+ * Get cancellation metrics
7628
+ * First checks for stored analytics when grouping by clinic, then calculates if not available or stale
7629
+ *
7630
+ * @param groupBy - Group by 'clinic' | 'practitioner' | 'patient' | 'procedure' | 'technology'
7631
+ * @param dateRange - Optional date range filter
7632
+ * @param options - Options for reading stored analytics (requires clinicBranchId for cache)
7633
+ * @returns Cancellation metrics grouped by specified entity
7634
+ */
7635
+ getCancellationMetrics(groupBy: EntityType, dateRange?: AnalyticsDateRange, options?: ReadStoredAnalyticsOptions): Promise<CancellationMetrics | CancellationMetrics[]>;
7636
+ /**
7637
+ * Group cancellations by clinic
7638
+ */
7639
+ private groupCancellationsByClinic;
7640
+ /**
7641
+ * Group cancellations by practitioner
7642
+ */
7643
+ private groupCancellationsByPractitioner;
7644
+ /**
7645
+ * Group cancellations by patient
7646
+ */
7647
+ private groupCancellationsByPatient;
7648
+ /**
7649
+ * Group cancellations by procedure
7650
+ */
7651
+ private groupCancellationsByProcedure;
7652
+ /**
7653
+ * Group cancellations by technology
7654
+ * Aggregates all procedures using the same technology across all doctors
7655
+ */
7656
+ private groupCancellationsByTechnology;
7657
+ /**
7658
+ * Calculate cancellation metrics for a specific entity
7659
+ */
7660
+ private calculateCancellationMetrics;
7661
+ /**
7662
+ * Get no-show metrics
7663
+ * First checks for stored analytics when grouping by clinic, then calculates if not available or stale
7664
+ *
7665
+ * @param groupBy - Group by 'clinic' | 'practitioner' | 'patient' | 'procedure' | 'technology'
7666
+ * @param dateRange - Optional date range filter
7667
+ * @param options - Options for reading stored analytics (requires clinicBranchId for cache)
7668
+ * @returns No-show metrics grouped by specified entity
7669
+ */
7670
+ getNoShowMetrics(groupBy: EntityType, dateRange?: AnalyticsDateRange, options?: ReadStoredAnalyticsOptions): Promise<NoShowMetrics | NoShowMetrics[]>;
7671
+ /**
7672
+ * Group no-shows by clinic
7673
+ */
7674
+ private groupNoShowsByClinic;
7675
+ /**
7676
+ * Group no-shows by practitioner
7677
+ */
7678
+ private groupNoShowsByPractitioner;
7679
+ /**
7680
+ * Group no-shows by patient
7681
+ */
7682
+ private groupNoShowsByPatient;
7683
+ /**
7684
+ * Group no-shows by procedure
7685
+ */
7686
+ private groupNoShowsByProcedure;
7687
+ /**
7688
+ * Group no-shows by technology
7689
+ * Aggregates all procedures using the same technology across all doctors
7690
+ */
7691
+ private groupNoShowsByTechnology;
7692
+ /**
7693
+ * Get revenue metrics grouped by clinic, practitioner, procedure, patient, or technology
7694
+ *
7695
+ * @param groupBy - Group by 'clinic' | 'practitioner' | 'procedure' | 'patient' | 'technology'
7696
+ * @param dateRange - Optional date range filter
7697
+ * @param filters - Optional additional filters
7698
+ * @returns Grouped revenue metrics
7699
+ */
7700
+ getRevenueMetricsByEntity(groupBy: EntityType, dateRange?: AnalyticsDateRange, filters?: AnalyticsFilters): Promise<GroupedRevenueMetrics[]>;
7701
+ /**
7702
+ * Get revenue metrics
7703
+ * First checks for stored analytics, then calculates if not available or stale
7704
+ *
7705
+ * @param filters - Optional filters
7706
+ * @param dateRange - Optional date range filter
7707
+ * @param options - Options for reading stored analytics
7708
+ * @returns Revenue metrics
7709
+ */
7710
+ getRevenueMetrics(filters?: AnalyticsFilters, dateRange?: AnalyticsDateRange, options?: ReadStoredAnalyticsOptions): Promise<RevenueMetrics>;
7711
+ /**
7712
+ * Get product usage metrics grouped by clinic, practitioner, procedure, or patient
7713
+ *
7714
+ * @param groupBy - Group by 'clinic' | 'practitioner' | 'procedure' | 'patient'
7715
+ * @param dateRange - Optional date range filter
7716
+ * @param filters - Optional additional filters
7717
+ * @returns Grouped product usage metrics
7718
+ */
7719
+ getProductUsageMetricsByEntity(groupBy: EntityType, dateRange?: AnalyticsDateRange, filters?: AnalyticsFilters): Promise<GroupedProductUsageMetrics[]>;
7720
+ /**
7721
+ * Get product usage metrics
7722
+ *
7723
+ * @param productId - Optional product ID (if not provided, returns all products)
7724
+ * @param dateRange - Optional date range filter
7725
+ * @returns Product usage metrics
7726
+ */
7727
+ getProductUsageMetrics(productId?: string, dateRange?: AnalyticsDateRange): Promise<ProductUsageMetrics | ProductUsageMetrics[]>;
7728
+ /**
7729
+ * Get patient behavior metrics grouped by clinic, practitioner, procedure, or technology
7730
+ * Shows patient no-show and cancellation patterns per entity
7731
+ *
7732
+ * @param groupBy - Group by 'clinic' | 'practitioner' | 'procedure' | 'technology'
7733
+ * @param dateRange - Optional date range filter
7734
+ * @param filters - Optional additional filters
7735
+ * @returns Grouped patient behavior metrics
7736
+ */
7737
+ getPatientBehaviorMetricsByEntity(groupBy: 'clinic' | 'practitioner' | 'procedure' | 'technology', dateRange?: AnalyticsDateRange, filters?: AnalyticsFilters): Promise<GroupedPatientBehaviorMetrics[]>;
7738
+ /**
7739
+ * Get patient analytics
7740
+ *
7741
+ * @param patientId - Optional patient ID (if not provided, returns aggregate)
7742
+ * @param dateRange - Optional date range filter
7743
+ * @returns Patient analytics
7744
+ */
7745
+ getPatientAnalytics(patientId?: string, dateRange?: AnalyticsDateRange): Promise<PatientAnalytics | PatientAnalytics[]>;
7746
+ /**
7747
+ * Calculate analytics for a specific patient
7748
+ */
7749
+ private calculatePatientAnalytics;
7750
+ /**
7751
+ * Determines analytics period from date range
7752
+ */
7753
+ private determinePeriodFromDateRange;
7754
+ /**
7755
+ * Get comprehensive dashboard data
7756
+ * First checks for stored analytics, then calculates if not available or stale
7757
+ *
7758
+ * @param filters - Optional filters
7759
+ * @param dateRange - Optional date range filter
7760
+ * @param options - Options for reading stored analytics
7761
+ * @returns Complete dashboard analytics
7762
+ */
7763
+ getDashboardData(filters?: AnalyticsFilters, dateRange?: AnalyticsDateRange, options?: ReadStoredAnalyticsOptions): Promise<DashboardAnalytics>;
7764
+ }
7765
+
7766
+ /**
7767
+ * Request data for on-demand analytics calculation
7768
+ */
7769
+ interface CalculateAnalyticsRequest {
7770
+ analyticsType: 'dashboard' | 'practitioner' | 'procedure' | 'clinic' | 'timeEfficiency' | 'revenue' | 'cancellation' | 'noShow' | 'productUsage' | 'patient' | 'revenueByEntity' | 'productUsageByEntity' | 'timeEfficiencyByEntity' | 'patientBehaviorByEntity';
7771
+ filters?: AnalyticsFilters;
7772
+ dateRange?: {
7773
+ start: string;
7774
+ end: string;
7775
+ };
7776
+ entityId?: string;
7777
+ groupBy?: EntityType;
7778
+ options?: {
7779
+ storeInCache?: boolean;
7780
+ useCache?: boolean;
7781
+ maxCacheAgeHours?: number;
7782
+ };
7783
+ }
7784
+ /**
7785
+ * Client-side service for calling analytics Cloud Functions
7786
+ *
7787
+ * This service provides a convenient way to trigger on-demand analytics
7788
+ * calculations via Cloud Functions, which can be faster and more efficient
7789
+ * than calculating on the client.
7790
+ */
7791
+ declare class AnalyticsCloudService {
7792
+ private functions;
7793
+ /**
7794
+ * Creates a new AnalyticsCloudService instance
7795
+ *
7796
+ * @param app - Firebase App instance
7797
+ * @param region - Functions region (default: 'europe-west6')
7798
+ */
7799
+ constructor(app: FirebaseApp, region?: string);
7800
+ /**
7801
+ * Calls the Cloud Function to calculate analytics on-demand
7802
+ *
7803
+ * @param request - Analytics calculation request
7804
+ * @returns Promise resolving to the calculated analytics data
7805
+ */
7806
+ calculateOnDemand(request: CalculateAnalyticsRequest): Promise<any>;
7807
+ /**
7808
+ * Calculate dashboard analytics on-demand
7809
+ */
7810
+ calculateDashboard(filters: AnalyticsFilters, dateRange: AnalyticsDateRange, options?: {
7811
+ storeInCache?: boolean;
7812
+ }): Promise<any>;
7813
+ /**
7814
+ * Calculate practitioner analytics on-demand
7815
+ */
7816
+ calculatePractitioner(practitionerId: string, dateRange?: AnalyticsDateRange, options?: {
7817
+ storeInCache?: boolean;
7818
+ clinicBranchId?: string;
7819
+ }): Promise<any>;
7820
+ /**
7821
+ * Calculate procedure analytics on-demand
7822
+ */
7823
+ calculateProcedure(procedureId: string, dateRange?: AnalyticsDateRange, options?: {
7824
+ storeInCache?: boolean;
7825
+ clinicBranchId?: string;
7826
+ }): Promise<any>;
7827
+ /**
7828
+ * Calculate revenue metrics grouped by entity on-demand
7829
+ */
7830
+ calculateRevenueByEntity(groupBy: EntityType, dateRange?: AnalyticsDateRange, filters?: AnalyticsFilters, options?: {
7831
+ storeInCache?: boolean;
7832
+ }): Promise<any>;
7833
+ /**
7834
+ * Calculate cancellation metrics grouped by entity on-demand
7835
+ */
7836
+ calculateCancellations(groupBy: EntityType, dateRange?: AnalyticsDateRange, options?: {
7837
+ storeInCache?: boolean;
7838
+ clinicBranchId?: string;
7839
+ }): Promise<any>;
7840
+ /**
7841
+ * Calculate no-show metrics grouped by entity on-demand
7842
+ */
7843
+ calculateNoShows(groupBy: EntityType, dateRange?: AnalyticsDateRange, options?: {
7844
+ storeInCache?: boolean;
7845
+ clinicBranchId?: string;
7846
+ }): Promise<any>;
7847
+ }
7848
+
6794
7849
  declare class UserService extends BaseService {
6795
7850
  private patientService;
6796
7851
  private clinicAdminService;
@@ -7695,4 +8750,4 @@ declare const getFirebaseApp: () => Promise<FirebaseApp>;
7695
8750
  declare const getFirebaseStorage: () => Promise<FirebaseStorage>;
7696
8751
  declare const getFirebaseFunctions: () => Promise<Functions>;
7697
8752
 
7698
- 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 };
8753
+ export { AESTHETIC_ANALYSIS_COLLECTION, ANALYTICS_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, AnalyticsCloudService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, AnalyticsService, type Appointment, type AppointmentCancelledNotification, type AppointmentMediaItem, type AppointmentMetadata, type AppointmentProductMetadata, type AppointmentReminderNotification, type AppointmentRescheduledProposalNotification, AppointmentService, AppointmentStatus, type AppointmentStatusChangeNotification, type AssessmentScales, AuthService, type BaseDocumentElement, type BaseMetrics, type BaseNotification, BaseService, type BeforeAfterPerZone, type BillingInfo, type BillingPerZone, type BillingTransaction, BillingTransactionType, BillingTransactionsService, type BinaryChoiceElement, BlockingCondition, type Brand, BrandService, CALENDAR_COLLECTION, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ADMINS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CLINIC_GROUPS_COLLECTION, type CalendarEvent, CalendarEventStatus, type CalendarEventTime, CalendarEventType, CalendarServiceV2, CalendarServiceV3, CalendarSyncStatus, type CancellationMetrics, type CancellationReasonStats, type Category, CategoryService, CertificationLevel, CertificationSpecialty, type Clinic, type ClinicAdmin, ClinicAdminService, type ClinicAdminSignupData, type ClinicAnalytics, type ClinicBranchSetupData, type ClinicComparisonMetrics, 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 CostPerPatientMetrics, 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, DASHBOARD_ANALYTICS_SUBCOLLECTION, DEFAULT_MEDICAL_INFO, DOCTOR_FORMS_SUBCOLLECTION, DOCUMENTATION_TEMPLATES_COLLECTION, type DashboardAnalytics, type DatePickerElement, type DateRange, type DigitalSignatureElement, type DoctorInfo, type DocumentElement, DocumentElementType, type DocumentTemplate, DocumentationTemplateService, type DurationTrend, type DynamicTextElement, DynamicVariable, type EmergencyContact, type EntityType, 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 GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, 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, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NextStepsRecommendation, type NoShowMetrics, 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_ANALYTICS_SUBCOLLECTION, PRACTITIONER_INVITES_COLLECTION, PROCEDURES_COLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type ParagraphElement, type PatientAnalytics, type PatientClinic, type PatientDoctor, type PatientGoals, PatientInstructionStatus, type PatientLifetimeValueMetrics, type PatientLocationInfo, type PatientMedicalInfo, type PatientProfile, type PatientProfileComplete, type PatientProfileForDoctor, type PatientProfileInfo, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, type PatientRequirementsFilters, PatientRequirementsService, type PatientRetentionMetrics, type PatientReviewInfo, type PatientSensitiveInfo, PatientService, type PatientToken, PatientTokenStatus, type PaymentConfirmationNotification, PaymentStatus, type PaymentStatusBreakdown, type PlanDetails, type PostRequirementNotification, PracticeType, type Practitioner, type PractitionerAnalytics, 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 ProcedureAnalytics, type ProcedureCategorization, type ProcedureExtendedInfo, ProcedureFamily, type ProcedureInfo, type ProcedurePopularity, type ProcedureProduct, type ProcedureProfitability, type ProcedureRecommendationNotification, type ProcedureReview, type ProcedureReviewInfo, ProcedureService, type ProcedureSummaryInfo, type Product, type ProductRevenueMetrics, ProductService, type ProductUsageByProcedure, type ProductUsageMetrics, type ProposedWorkingHours, REGISTER_TOKENS_COLLECTION, REVENUE_ANALYTICS_SUBCOLLECTION, REVIEWS_COLLECTION, type RatingScaleElement, type ReadStoredAnalyticsOptions, type RecommendedProcedure, type RequesterInfo, type Requirement, type RequirementInstructionDueNotification, type RequirementSourceProcedure, RequirementType, type RevenueMetrics, type RevenueTrend, type Review, type ReviewRequestNotification, ReviewService, SYNCED_CALENDARS_COLLECTION, type SearchAppointmentsParams, type SearchCalendarEventsParams, SearchLocationEnum, type SearchPatientsParams, type SignatureElement, type SingleChoiceElement, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, type Subcategory, SubcategoryService, SubscriptionModel, SubscriptionStatus, type SyncedCalendar, type SyncedCalendarEvent, SyncedCalendarProvider, SyncedCalendarsService, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type Technology, type TechnologyDocumentationTemplate, TechnologyService, type TextInputElement, type TimeEfficiencyMetrics, 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 };