@blackcode_sa/metaestetics-api 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/index.d.mts +106 -1
- package/dist/admin/index.d.ts +106 -1
- package/dist/admin/index.js +1303 -130
- package/dist/admin/index.mjs +1303 -130
- package/dist/index.d.mts +326 -2
- package/dist/index.d.ts +326 -2
- package/dist/index.js +3188 -1888
- package/dist/index.mjs +2909 -1610
- package/package.json +1 -1
- package/src/services/analytics/README.md +17 -0
- package/src/services/analytics/TRENDS.md +380 -0
- package/src/services/analytics/analytics.service.ts +540 -30
- package/src/services/analytics/index.ts +1 -0
- package/src/services/analytics/review-analytics.service.ts +941 -0
- package/src/services/analytics/utils/cost-calculation.utils.ts +32 -4
- package/src/services/analytics/utils/grouping.utils.ts +40 -0
- package/src/services/analytics/utils/trend-calculation.utils.ts +200 -0
- package/src/services/appointment/appointment.service.ts +9 -0
- package/src/services/procedure/procedure.service.ts +117 -4
- package/src/services/reviews/reviews.service.ts +58 -7
- package/src/types/analytics/analytics.types.ts +98 -1
- package/src/types/analytics/grouped-analytics.types.ts +25 -0
package/dist/admin/index.d.mts
CHANGED
|
@@ -2071,6 +2071,10 @@ interface AnalyticsFilters {
|
|
|
2071
2071
|
* Grouping period for trend analysis
|
|
2072
2072
|
*/
|
|
2073
2073
|
type GroupingPeriod = 'day' | 'week' | 'month';
|
|
2074
|
+
/**
|
|
2075
|
+
* Trend period type (only predefined periods, no custom)
|
|
2076
|
+
*/
|
|
2077
|
+
type TrendPeriod = 'week' | 'month' | 'quarter' | 'year';
|
|
2074
2078
|
/**
|
|
2075
2079
|
* Entity type for grouping analytics
|
|
2076
2080
|
*/
|
|
@@ -2178,6 +2182,8 @@ interface CancellationMetrics {
|
|
|
2178
2182
|
count: number;
|
|
2179
2183
|
percentage: number;
|
|
2180
2184
|
}>;
|
|
2185
|
+
practitionerId?: string;
|
|
2186
|
+
practitionerName?: string;
|
|
2181
2187
|
}
|
|
2182
2188
|
/**
|
|
2183
2189
|
* No-Show Metrics
|
|
@@ -2190,6 +2196,8 @@ interface NoShowMetrics {
|
|
|
2190
2196
|
totalAppointments: number;
|
|
2191
2197
|
noShowAppointments: number;
|
|
2192
2198
|
noShowRate: number;
|
|
2199
|
+
practitionerId?: string;
|
|
2200
|
+
practitionerName?: string;
|
|
2193
2201
|
}
|
|
2194
2202
|
/**
|
|
2195
2203
|
* Revenue Metrics
|
|
@@ -2219,6 +2227,13 @@ interface RevenueTrend {
|
|
|
2219
2227
|
revenue: number;
|
|
2220
2228
|
appointmentCount: number;
|
|
2221
2229
|
averageRevenue: number;
|
|
2230
|
+
currency?: string;
|
|
2231
|
+
previousPeriod?: {
|
|
2232
|
+
revenue: number;
|
|
2233
|
+
appointmentCount: number;
|
|
2234
|
+
percentageChange: number;
|
|
2235
|
+
direction: 'up' | 'down' | 'stable';
|
|
2236
|
+
};
|
|
2222
2237
|
}
|
|
2223
2238
|
/**
|
|
2224
2239
|
* Duration Trend
|
|
@@ -2232,6 +2247,77 @@ interface DurationTrend {
|
|
|
2232
2247
|
averageActualDuration: number;
|
|
2233
2248
|
averageEfficiency: number;
|
|
2234
2249
|
appointmentCount: number;
|
|
2250
|
+
previousPeriod?: {
|
|
2251
|
+
averageBookedDuration: number;
|
|
2252
|
+
averageActualDuration: number;
|
|
2253
|
+
averageEfficiency: number;
|
|
2254
|
+
efficiencyPercentageChange: number;
|
|
2255
|
+
direction: 'up' | 'down' | 'stable';
|
|
2256
|
+
};
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* Appointment Count Trend
|
|
2260
|
+
* Appointment count trends over time
|
|
2261
|
+
*/
|
|
2262
|
+
interface AppointmentTrend {
|
|
2263
|
+
period: string;
|
|
2264
|
+
startDate: Date;
|
|
2265
|
+
endDate: Date;
|
|
2266
|
+
totalAppointments: number;
|
|
2267
|
+
completedAppointments: number;
|
|
2268
|
+
canceledAppointments: number;
|
|
2269
|
+
noShowAppointments: number;
|
|
2270
|
+
pendingAppointments: number;
|
|
2271
|
+
confirmedAppointments: number;
|
|
2272
|
+
previousPeriod?: {
|
|
2273
|
+
totalAppointments: number;
|
|
2274
|
+
completedAppointments: number;
|
|
2275
|
+
percentageChange: number;
|
|
2276
|
+
direction: 'up' | 'down' | 'stable';
|
|
2277
|
+
};
|
|
2278
|
+
}
|
|
2279
|
+
/**
|
|
2280
|
+
* Cancellation Rate Trend
|
|
2281
|
+
* Cancellation and no-show rate trends over time
|
|
2282
|
+
*/
|
|
2283
|
+
interface CancellationRateTrend {
|
|
2284
|
+
period: string;
|
|
2285
|
+
startDate: Date;
|
|
2286
|
+
endDate: Date;
|
|
2287
|
+
cancellationRate: number;
|
|
2288
|
+
noShowRate: number;
|
|
2289
|
+
totalAppointments: number;
|
|
2290
|
+
canceledAppointments: number;
|
|
2291
|
+
noShowAppointments: number;
|
|
2292
|
+
previousPeriod?: {
|
|
2293
|
+
cancellationRate: number;
|
|
2294
|
+
noShowRate: number;
|
|
2295
|
+
cancellationRateChange: number;
|
|
2296
|
+
noShowRateChange: number;
|
|
2297
|
+
direction: 'up' | 'down' | 'stable';
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Review Trend
|
|
2302
|
+
* Review rating and recommendation trends over time
|
|
2303
|
+
*/
|
|
2304
|
+
interface ReviewTrend {
|
|
2305
|
+
period: string;
|
|
2306
|
+
startDate: Date;
|
|
2307
|
+
endDate: Date;
|
|
2308
|
+
averageRating: number;
|
|
2309
|
+
recommendationRate: number;
|
|
2310
|
+
totalReviews: number;
|
|
2311
|
+
practitionerAverage?: number;
|
|
2312
|
+
procedureAverage?: number;
|
|
2313
|
+
previousPeriod?: {
|
|
2314
|
+
averageRating: number;
|
|
2315
|
+
recommendationRate: number;
|
|
2316
|
+
percentageChange: number;
|
|
2317
|
+
direction: 'up' | 'down' | 'stable';
|
|
2318
|
+
};
|
|
2319
|
+
entityId?: string;
|
|
2320
|
+
entityName?: string;
|
|
2235
2321
|
}
|
|
2236
2322
|
/**
|
|
2237
2323
|
* Product Usage Metrics
|
|
@@ -2637,6 +2723,18 @@ interface GroupedAnalyticsBase {
|
|
|
2637
2723
|
entityName: string;
|
|
2638
2724
|
entityType: EntityType;
|
|
2639
2725
|
}
|
|
2726
|
+
/**
|
|
2727
|
+
* Review metrics for grouped analytics
|
|
2728
|
+
* Note: This is a simplified version for grouped analytics.
|
|
2729
|
+
* For full review analytics, see ReviewAnalyticsService.ReviewMetrics
|
|
2730
|
+
*/
|
|
2731
|
+
interface ReviewMetrics {
|
|
2732
|
+
totalReviews: number;
|
|
2733
|
+
averageRating: number;
|
|
2734
|
+
recommendationRate: number;
|
|
2735
|
+
ratingDifference?: number;
|
|
2736
|
+
recommendationDifference?: number;
|
|
2737
|
+
}
|
|
2640
2738
|
/**
|
|
2641
2739
|
* Grouped Revenue Metrics
|
|
2642
2740
|
* Revenue analytics grouped by clinic, practitioner, procedure, or patient
|
|
@@ -2651,6 +2749,9 @@ interface GroupedRevenueMetrics extends GroupedAnalyticsBase {
|
|
|
2651
2749
|
refundedRevenue: number;
|
|
2652
2750
|
totalTax: number;
|
|
2653
2751
|
totalSubtotal: number;
|
|
2752
|
+
practitionerId?: string;
|
|
2753
|
+
practitionerName?: string;
|
|
2754
|
+
reviewMetrics?: ReviewMetrics;
|
|
2654
2755
|
}
|
|
2655
2756
|
/**
|
|
2656
2757
|
* Grouped Product Usage Metrics
|
|
@@ -2670,6 +2771,8 @@ interface GroupedProductUsageMetrics extends GroupedAnalyticsBase {
|
|
|
2670
2771
|
totalRevenue: number;
|
|
2671
2772
|
usageCount: number;
|
|
2672
2773
|
}>;
|
|
2774
|
+
practitionerId?: string;
|
|
2775
|
+
practitionerName?: string;
|
|
2673
2776
|
}
|
|
2674
2777
|
/**
|
|
2675
2778
|
* Grouped Patient Retention Metrics
|
|
@@ -2701,6 +2804,8 @@ interface GroupedTimeEfficiencyMetrics extends GroupedAnalyticsBase {
|
|
|
2701
2804
|
totalUnderutilization: number;
|
|
2702
2805
|
averageOverrun: number;
|
|
2703
2806
|
averageUnderutilization: number;
|
|
2807
|
+
practitionerId?: string;
|
|
2808
|
+
practitionerName?: string;
|
|
2704
2809
|
}
|
|
2705
2810
|
/**
|
|
2706
2811
|
* Grouped Patient Behavior Metrics
|
|
@@ -4565,4 +4670,4 @@ declare class UserProfileAdminService {
|
|
|
4565
4670
|
initializePractitionerRole(userId: string): Promise<User>;
|
|
4566
4671
|
}
|
|
4567
4672
|
|
|
4568
|
-
export { ANALYTICS_COLLECTION, AnalyticsAdminService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, type Appointment, AppointmentAggregationService, type AppointmentCancellationEmailData, type AppointmentConfirmationEmailData, type AppointmentEmailDataBase, AppointmentMailingService, type AppointmentReminderNotification, type AppointmentRequestedEmailData, type AppointmentRescheduledProposalEmailData, AppointmentStatus, type AvailableSlot, BaseMailingService, type BaseMetrics, type BaseNotification, type BillingInfo, type BillingTransaction, BillingTransactionType, BookingAdmin, BookingAvailabilityCalculator, type BookingAvailabilityRequest, type BookingAvailabilityResponse, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CalendarAdminService, type CancellationMetrics, type CancellationReasonStats, type Clinic, type ClinicAdminNotificationData, ClinicAggregationService, type ClinicAnalytics, type ClinicComparisonMetrics, type ClinicInfo, type ClinicLocation, type CostPerPatientMetrics, type CreateBillingTransactionData, DASHBOARD_ANALYTICS_SUBCOLLECTION, type DashboardAnalytics, type DoctorInfo, DocumentManagerAdminService, type DurationTrend, type EntityType, type ExistingPractitionerInviteEmailData, ExistingPractitionerInviteMailingService, type FilledDocument, FilledFormsAggregationService, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, type InitializeAppointmentFormsResult, Logger, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NewMailgunClient$2 as NewMailgunClient, type NoShowMetrics, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type OrchestrateAppointmentCreationData, PATIENTS_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type PatientProfile as Patient, PatientAggregationService, type PatientAnalytics, PatientInstructionStatus, type PatientLifetimeValueMetrics, type PatientProfile, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsAdminService, type PatientRetentionMetrics, type PatientSensitiveInfo, type PaymentStatusBreakdown, type PlanDetails, type PostRequirementNotification, type Practitioner, PractitionerAggregationService, type PractitionerAnalytics, type PractitionerInvite, PractitionerInviteAggregationService, type PractitionerInviteEmailData, PractitionerInviteMailingService, PractitionerInviteStatus, type PractitionerToken, PractitionerTokenStatus, type PreRequirementNotification, type Procedure, ProcedureAggregationService, type ProcedureAnalytics, type ProcedurePopularity, type ProcedureProfitability, type ProcedureSummaryInfo, type ProductRevenueMetrics, type ProductUsageByProcedure, type ProductUsageMetrics, REVENUE_ANALYTICS_SUBCOLLECTION, type ReadStoredAnalyticsOptions, type RequirementSourceProcedure, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAddedEmailData, type ReviewRequestEmailData, ReviewsAggregationService, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, SubscriptionStatus, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type TimeEfficiencyMetrics, type TimeInterval, UserProfileAdminService, UserRole, freeConsultationInfrastructure };
|
|
4673
|
+
export { ANALYTICS_COLLECTION, AnalyticsAdminService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, type Appointment, AppointmentAggregationService, type AppointmentCancellationEmailData, type AppointmentConfirmationEmailData, type AppointmentEmailDataBase, AppointmentMailingService, type AppointmentReminderNotification, type AppointmentRequestedEmailData, type AppointmentRescheduledProposalEmailData, AppointmentStatus, type AppointmentTrend, type AvailableSlot, BaseMailingService, type BaseMetrics, type BaseNotification, type BillingInfo, type BillingTransaction, BillingTransactionType, BookingAdmin, BookingAvailabilityCalculator, type BookingAvailabilityRequest, type BookingAvailabilityResponse, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CalendarAdminService, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Clinic, type ClinicAdminNotificationData, ClinicAggregationService, type ClinicAnalytics, type ClinicComparisonMetrics, type ClinicInfo, type ClinicLocation, type CostPerPatientMetrics, type CreateBillingTransactionData, DASHBOARD_ANALYTICS_SUBCOLLECTION, type DashboardAnalytics, type DoctorInfo, DocumentManagerAdminService, type DurationTrend, type EntityType, type ExistingPractitionerInviteEmailData, ExistingPractitionerInviteMailingService, type FilledDocument, FilledFormsAggregationService, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, type InitializeAppointmentFormsResult, Logger, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NewMailgunClient$2 as NewMailgunClient, type NoShowMetrics, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type OrchestrateAppointmentCreationData, PATIENTS_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type PatientProfile as Patient, PatientAggregationService, type PatientAnalytics, PatientInstructionStatus, type PatientLifetimeValueMetrics, type PatientProfile, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsAdminService, type PatientRetentionMetrics, type PatientSensitiveInfo, type PaymentStatusBreakdown, type PlanDetails, type PostRequirementNotification, type Practitioner, PractitionerAggregationService, type PractitionerAnalytics, type PractitionerInvite, PractitionerInviteAggregationService, type PractitionerInviteEmailData, PractitionerInviteMailingService, PractitionerInviteStatus, type PractitionerToken, PractitionerTokenStatus, type PreRequirementNotification, type Procedure, ProcedureAggregationService, type ProcedureAnalytics, type ProcedurePopularity, type ProcedureProfitability, type ProcedureSummaryInfo, type ProductRevenueMetrics, type ProductUsageByProcedure, type ProductUsageMetrics, REVENUE_ANALYTICS_SUBCOLLECTION, type ReadStoredAnalyticsOptions, type RequirementSourceProcedure, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAddedEmailData, type ReviewMetrics, type ReviewRequestEmailData, type ReviewTrend, ReviewsAggregationService, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, SubscriptionStatus, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type TimeEfficiencyMetrics, type TimeInterval, type TrendPeriod, UserProfileAdminService, UserRole, freeConsultationInfrastructure };
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -2071,6 +2071,10 @@ interface AnalyticsFilters {
|
|
|
2071
2071
|
* Grouping period for trend analysis
|
|
2072
2072
|
*/
|
|
2073
2073
|
type GroupingPeriod = 'day' | 'week' | 'month';
|
|
2074
|
+
/**
|
|
2075
|
+
* Trend period type (only predefined periods, no custom)
|
|
2076
|
+
*/
|
|
2077
|
+
type TrendPeriod = 'week' | 'month' | 'quarter' | 'year';
|
|
2074
2078
|
/**
|
|
2075
2079
|
* Entity type for grouping analytics
|
|
2076
2080
|
*/
|
|
@@ -2178,6 +2182,8 @@ interface CancellationMetrics {
|
|
|
2178
2182
|
count: number;
|
|
2179
2183
|
percentage: number;
|
|
2180
2184
|
}>;
|
|
2185
|
+
practitionerId?: string;
|
|
2186
|
+
practitionerName?: string;
|
|
2181
2187
|
}
|
|
2182
2188
|
/**
|
|
2183
2189
|
* No-Show Metrics
|
|
@@ -2190,6 +2196,8 @@ interface NoShowMetrics {
|
|
|
2190
2196
|
totalAppointments: number;
|
|
2191
2197
|
noShowAppointments: number;
|
|
2192
2198
|
noShowRate: number;
|
|
2199
|
+
practitionerId?: string;
|
|
2200
|
+
practitionerName?: string;
|
|
2193
2201
|
}
|
|
2194
2202
|
/**
|
|
2195
2203
|
* Revenue Metrics
|
|
@@ -2219,6 +2227,13 @@ interface RevenueTrend {
|
|
|
2219
2227
|
revenue: number;
|
|
2220
2228
|
appointmentCount: number;
|
|
2221
2229
|
averageRevenue: number;
|
|
2230
|
+
currency?: string;
|
|
2231
|
+
previousPeriod?: {
|
|
2232
|
+
revenue: number;
|
|
2233
|
+
appointmentCount: number;
|
|
2234
|
+
percentageChange: number;
|
|
2235
|
+
direction: 'up' | 'down' | 'stable';
|
|
2236
|
+
};
|
|
2222
2237
|
}
|
|
2223
2238
|
/**
|
|
2224
2239
|
* Duration Trend
|
|
@@ -2232,6 +2247,77 @@ interface DurationTrend {
|
|
|
2232
2247
|
averageActualDuration: number;
|
|
2233
2248
|
averageEfficiency: number;
|
|
2234
2249
|
appointmentCount: number;
|
|
2250
|
+
previousPeriod?: {
|
|
2251
|
+
averageBookedDuration: number;
|
|
2252
|
+
averageActualDuration: number;
|
|
2253
|
+
averageEfficiency: number;
|
|
2254
|
+
efficiencyPercentageChange: number;
|
|
2255
|
+
direction: 'up' | 'down' | 'stable';
|
|
2256
|
+
};
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* Appointment Count Trend
|
|
2260
|
+
* Appointment count trends over time
|
|
2261
|
+
*/
|
|
2262
|
+
interface AppointmentTrend {
|
|
2263
|
+
period: string;
|
|
2264
|
+
startDate: Date;
|
|
2265
|
+
endDate: Date;
|
|
2266
|
+
totalAppointments: number;
|
|
2267
|
+
completedAppointments: number;
|
|
2268
|
+
canceledAppointments: number;
|
|
2269
|
+
noShowAppointments: number;
|
|
2270
|
+
pendingAppointments: number;
|
|
2271
|
+
confirmedAppointments: number;
|
|
2272
|
+
previousPeriod?: {
|
|
2273
|
+
totalAppointments: number;
|
|
2274
|
+
completedAppointments: number;
|
|
2275
|
+
percentageChange: number;
|
|
2276
|
+
direction: 'up' | 'down' | 'stable';
|
|
2277
|
+
};
|
|
2278
|
+
}
|
|
2279
|
+
/**
|
|
2280
|
+
* Cancellation Rate Trend
|
|
2281
|
+
* Cancellation and no-show rate trends over time
|
|
2282
|
+
*/
|
|
2283
|
+
interface CancellationRateTrend {
|
|
2284
|
+
period: string;
|
|
2285
|
+
startDate: Date;
|
|
2286
|
+
endDate: Date;
|
|
2287
|
+
cancellationRate: number;
|
|
2288
|
+
noShowRate: number;
|
|
2289
|
+
totalAppointments: number;
|
|
2290
|
+
canceledAppointments: number;
|
|
2291
|
+
noShowAppointments: number;
|
|
2292
|
+
previousPeriod?: {
|
|
2293
|
+
cancellationRate: number;
|
|
2294
|
+
noShowRate: number;
|
|
2295
|
+
cancellationRateChange: number;
|
|
2296
|
+
noShowRateChange: number;
|
|
2297
|
+
direction: 'up' | 'down' | 'stable';
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Review Trend
|
|
2302
|
+
* Review rating and recommendation trends over time
|
|
2303
|
+
*/
|
|
2304
|
+
interface ReviewTrend {
|
|
2305
|
+
period: string;
|
|
2306
|
+
startDate: Date;
|
|
2307
|
+
endDate: Date;
|
|
2308
|
+
averageRating: number;
|
|
2309
|
+
recommendationRate: number;
|
|
2310
|
+
totalReviews: number;
|
|
2311
|
+
practitionerAverage?: number;
|
|
2312
|
+
procedureAverage?: number;
|
|
2313
|
+
previousPeriod?: {
|
|
2314
|
+
averageRating: number;
|
|
2315
|
+
recommendationRate: number;
|
|
2316
|
+
percentageChange: number;
|
|
2317
|
+
direction: 'up' | 'down' | 'stable';
|
|
2318
|
+
};
|
|
2319
|
+
entityId?: string;
|
|
2320
|
+
entityName?: string;
|
|
2235
2321
|
}
|
|
2236
2322
|
/**
|
|
2237
2323
|
* Product Usage Metrics
|
|
@@ -2637,6 +2723,18 @@ interface GroupedAnalyticsBase {
|
|
|
2637
2723
|
entityName: string;
|
|
2638
2724
|
entityType: EntityType;
|
|
2639
2725
|
}
|
|
2726
|
+
/**
|
|
2727
|
+
* Review metrics for grouped analytics
|
|
2728
|
+
* Note: This is a simplified version for grouped analytics.
|
|
2729
|
+
* For full review analytics, see ReviewAnalyticsService.ReviewMetrics
|
|
2730
|
+
*/
|
|
2731
|
+
interface ReviewMetrics {
|
|
2732
|
+
totalReviews: number;
|
|
2733
|
+
averageRating: number;
|
|
2734
|
+
recommendationRate: number;
|
|
2735
|
+
ratingDifference?: number;
|
|
2736
|
+
recommendationDifference?: number;
|
|
2737
|
+
}
|
|
2640
2738
|
/**
|
|
2641
2739
|
* Grouped Revenue Metrics
|
|
2642
2740
|
* Revenue analytics grouped by clinic, practitioner, procedure, or patient
|
|
@@ -2651,6 +2749,9 @@ interface GroupedRevenueMetrics extends GroupedAnalyticsBase {
|
|
|
2651
2749
|
refundedRevenue: number;
|
|
2652
2750
|
totalTax: number;
|
|
2653
2751
|
totalSubtotal: number;
|
|
2752
|
+
practitionerId?: string;
|
|
2753
|
+
practitionerName?: string;
|
|
2754
|
+
reviewMetrics?: ReviewMetrics;
|
|
2654
2755
|
}
|
|
2655
2756
|
/**
|
|
2656
2757
|
* Grouped Product Usage Metrics
|
|
@@ -2670,6 +2771,8 @@ interface GroupedProductUsageMetrics extends GroupedAnalyticsBase {
|
|
|
2670
2771
|
totalRevenue: number;
|
|
2671
2772
|
usageCount: number;
|
|
2672
2773
|
}>;
|
|
2774
|
+
practitionerId?: string;
|
|
2775
|
+
practitionerName?: string;
|
|
2673
2776
|
}
|
|
2674
2777
|
/**
|
|
2675
2778
|
* Grouped Patient Retention Metrics
|
|
@@ -2701,6 +2804,8 @@ interface GroupedTimeEfficiencyMetrics extends GroupedAnalyticsBase {
|
|
|
2701
2804
|
totalUnderutilization: number;
|
|
2702
2805
|
averageOverrun: number;
|
|
2703
2806
|
averageUnderutilization: number;
|
|
2807
|
+
practitionerId?: string;
|
|
2808
|
+
practitionerName?: string;
|
|
2704
2809
|
}
|
|
2705
2810
|
/**
|
|
2706
2811
|
* Grouped Patient Behavior Metrics
|
|
@@ -4565,4 +4670,4 @@ declare class UserProfileAdminService {
|
|
|
4565
4670
|
initializePractitionerRole(userId: string): Promise<User>;
|
|
4566
4671
|
}
|
|
4567
4672
|
|
|
4568
|
-
export { ANALYTICS_COLLECTION, AnalyticsAdminService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, type Appointment, AppointmentAggregationService, type AppointmentCancellationEmailData, type AppointmentConfirmationEmailData, type AppointmentEmailDataBase, AppointmentMailingService, type AppointmentReminderNotification, type AppointmentRequestedEmailData, type AppointmentRescheduledProposalEmailData, AppointmentStatus, type AvailableSlot, BaseMailingService, type BaseMetrics, type BaseNotification, type BillingInfo, type BillingTransaction, BillingTransactionType, BookingAdmin, BookingAvailabilityCalculator, type BookingAvailabilityRequest, type BookingAvailabilityResponse, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CalendarAdminService, type CancellationMetrics, type CancellationReasonStats, type Clinic, type ClinicAdminNotificationData, ClinicAggregationService, type ClinicAnalytics, type ClinicComparisonMetrics, type ClinicInfo, type ClinicLocation, type CostPerPatientMetrics, type CreateBillingTransactionData, DASHBOARD_ANALYTICS_SUBCOLLECTION, type DashboardAnalytics, type DoctorInfo, DocumentManagerAdminService, type DurationTrend, type EntityType, type ExistingPractitionerInviteEmailData, ExistingPractitionerInviteMailingService, type FilledDocument, FilledFormsAggregationService, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, type InitializeAppointmentFormsResult, Logger, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NewMailgunClient$2 as NewMailgunClient, type NoShowMetrics, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type OrchestrateAppointmentCreationData, PATIENTS_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type PatientProfile as Patient, PatientAggregationService, type PatientAnalytics, PatientInstructionStatus, type PatientLifetimeValueMetrics, type PatientProfile, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsAdminService, type PatientRetentionMetrics, type PatientSensitiveInfo, type PaymentStatusBreakdown, type PlanDetails, type PostRequirementNotification, type Practitioner, PractitionerAggregationService, type PractitionerAnalytics, type PractitionerInvite, PractitionerInviteAggregationService, type PractitionerInviteEmailData, PractitionerInviteMailingService, PractitionerInviteStatus, type PractitionerToken, PractitionerTokenStatus, type PreRequirementNotification, type Procedure, ProcedureAggregationService, type ProcedureAnalytics, type ProcedurePopularity, type ProcedureProfitability, type ProcedureSummaryInfo, type ProductRevenueMetrics, type ProductUsageByProcedure, type ProductUsageMetrics, REVENUE_ANALYTICS_SUBCOLLECTION, type ReadStoredAnalyticsOptions, type RequirementSourceProcedure, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAddedEmailData, type ReviewRequestEmailData, ReviewsAggregationService, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, SubscriptionStatus, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type TimeEfficiencyMetrics, type TimeInterval, UserProfileAdminService, UserRole, freeConsultationInfrastructure };
|
|
4673
|
+
export { ANALYTICS_COLLECTION, AnalyticsAdminService, type AnalyticsDateRange, type AnalyticsFilters, type AnalyticsMetadata, type AnalyticsPeriod, type Appointment, AppointmentAggregationService, type AppointmentCancellationEmailData, type AppointmentConfirmationEmailData, type AppointmentEmailDataBase, AppointmentMailingService, type AppointmentReminderNotification, type AppointmentRequestedEmailData, type AppointmentRescheduledProposalEmailData, AppointmentStatus, type AppointmentTrend, type AvailableSlot, BaseMailingService, type BaseMetrics, type BaseNotification, type BillingInfo, type BillingTransaction, BillingTransactionType, BookingAdmin, BookingAvailabilityCalculator, type BookingAvailabilityRequest, type BookingAvailabilityResponse, CANCELLATION_ANALYTICS_SUBCOLLECTION, CLINICS_COLLECTION, CLINIC_ANALYTICS_SUBCOLLECTION, CalendarAdminService, type CancellationMetrics, type CancellationRateTrend, type CancellationReasonStats, type Clinic, type ClinicAdminNotificationData, ClinicAggregationService, type ClinicAnalytics, type ClinicComparisonMetrics, type ClinicInfo, type ClinicLocation, type CostPerPatientMetrics, type CreateBillingTransactionData, DASHBOARD_ANALYTICS_SUBCOLLECTION, type DashboardAnalytics, type DoctorInfo, DocumentManagerAdminService, type DurationTrend, type EntityType, type ExistingPractitionerInviteEmailData, ExistingPractitionerInviteMailingService, type FilledDocument, FilledFormsAggregationService, type GroupedAnalyticsBase, type GroupedPatientBehaviorMetrics, type GroupedPatientRetentionMetrics, type GroupedPractitionerPerformanceMetrics, type GroupedProcedurePerformanceMetrics, type GroupedProductUsageMetrics, type GroupedRevenueMetrics, type GroupedTimeEfficiencyMetrics, type GroupingPeriod, type InitializeAppointmentFormsResult, Logger, NOTIFICATIONS_COLLECTION, NO_SHOW_ANALYTICS_SUBCOLLECTION, type NewMailgunClient$2 as NewMailgunClient, type NoShowMetrics, type Notification, NotificationStatus, NotificationType, NotificationsAdmin, type OrchestrateAppointmentCreationData, PATIENTS_COLLECTION, PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME, PATIENT_SENSITIVE_INFO_COLLECTION, PRACTITIONER_ANALYTICS_SUBCOLLECTION, PROCEDURE_ANALYTICS_SUBCOLLECTION, type PatientProfile as Patient, PatientAggregationService, type PatientAnalytics, PatientInstructionStatus, type PatientLifetimeValueMetrics, type PatientProfile, type PatientRequirementInstance, type PatientRequirementInstruction, PatientRequirementOverallStatus, PatientRequirementsAdminService, type PatientRetentionMetrics, type PatientSensitiveInfo, type PaymentStatusBreakdown, type PlanDetails, type PostRequirementNotification, type Practitioner, PractitionerAggregationService, type PractitionerAnalytics, type PractitionerInvite, PractitionerInviteAggregationService, type PractitionerInviteEmailData, PractitionerInviteMailingService, PractitionerInviteStatus, type PractitionerToken, PractitionerTokenStatus, type PreRequirementNotification, type Procedure, ProcedureAggregationService, type ProcedureAnalytics, type ProcedurePopularity, type ProcedureProfitability, type ProcedureSummaryInfo, type ProductRevenueMetrics, type ProductUsageByProcedure, type ProductUsageMetrics, REVENUE_ANALYTICS_SUBCOLLECTION, type ReadStoredAnalyticsOptions, type RequirementSourceProcedure, type RevenueMetrics, type RevenueTrend, type Review, type ReviewAddedEmailData, type ReviewMetrics, type ReviewRequestEmailData, type ReviewTrend, ReviewsAggregationService, type StoredCancellationMetrics, type StoredClinicAnalytics, type StoredDashboardAnalytics, type StoredNoShowMetrics, type StoredPractitionerAnalytics, type StoredProcedureAnalytics, type StoredRevenueMetrics, type StoredTimeEfficiencyMetrics, type StripeTransactionData, SubscriptionStatus, TIME_EFFICIENCY_ANALYTICS_SUBCOLLECTION, type TimeEfficiencyMetrics, type TimeInterval, type TrendPeriod, UserProfileAdminService, UserRole, freeConsultationInfrastructure };
|