@blackcode_sa/metaestetics-api 1.7.3 → 1.7.4
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 +41 -8
- package/dist/admin/index.d.ts +41 -8
- package/dist/admin/index.js +621 -109
- package/dist/admin/index.mjs +621 -109
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
- package/src/admin/aggregation/appointment/appointment.aggregation.service.ts +553 -112
- package/src/admin/calendar/calendar.admin.service.ts +230 -65
- package/src/services/calendar/calendar-refactored.service.ts +2 -0
- package/src/types/calendar/index.ts +1 -0
package/dist/admin/index.d.mts
CHANGED
|
@@ -1069,7 +1069,8 @@ declare enum CalendarEventStatus {
|
|
|
1069
1069
|
REJECTED = "rejected",// When event is rejected by the clinic administrator or patient
|
|
1070
1070
|
CANCELED = "canceled",// When event is canceled by the patient
|
|
1071
1071
|
RESCHEDULED = "rescheduled",// When event is rescheduled by the clinic administrator
|
|
1072
|
-
COMPLETED = "completed"
|
|
1072
|
+
COMPLETED = "completed",// When event is completed
|
|
1073
|
+
NO_SHOW = "no_show"
|
|
1073
1074
|
}
|
|
1074
1075
|
/**
|
|
1075
1076
|
* Enum for calendar event sync status
|
|
@@ -1966,15 +1967,44 @@ declare class AppointmentAggregationService {
|
|
|
1966
1967
|
*/
|
|
1967
1968
|
private updateRelatedPatientRequirementInstances;
|
|
1968
1969
|
/**
|
|
1969
|
-
* Manages
|
|
1970
|
-
*
|
|
1971
|
-
* Removes patientId on appointment cancellation (basic removal, can be enhanced).
|
|
1970
|
+
* Manages relationships between a patient and clinics/practitioners.
|
|
1971
|
+
* Only updates the patient profile with doctorIds and clinicIds.
|
|
1972
1972
|
*
|
|
1973
|
-
* @param {
|
|
1974
|
-
* @param {
|
|
1973
|
+
* @param {PatientProfile} patientProfile - The patient profile to update
|
|
1974
|
+
* @param {string} practitionerId - The practitioner ID
|
|
1975
|
+
* @param {string} clinicId - The clinic ID
|
|
1976
|
+
* @param {"create" | "cancel"} action - 'create' to add IDs, 'cancel' to potentially remove them
|
|
1977
|
+
* @param {AppointmentStatus} [cancelStatus] - The appointment status if action is 'cancel'
|
|
1975
1978
|
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
1976
1979
|
*/
|
|
1977
1980
|
private managePatientClinicPractitionerLinks;
|
|
1981
|
+
/**
|
|
1982
|
+
* Adds practitioner and clinic IDs to the patient profile.
|
|
1983
|
+
*
|
|
1984
|
+
* @param {PatientProfile} patientProfile - The patient profile to update
|
|
1985
|
+
* @param {string} practitionerId - The practitioner ID to add
|
|
1986
|
+
* @param {string} clinicId - The clinic ID to add
|
|
1987
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
1988
|
+
*/
|
|
1989
|
+
private addPatientLinks;
|
|
1990
|
+
/**
|
|
1991
|
+
* Removes practitioner and clinic IDs from the patient profile if there are no more active appointments.
|
|
1992
|
+
*
|
|
1993
|
+
* @param {PatientProfile} patientProfile - The patient profile to update
|
|
1994
|
+
* @param {string} practitionerId - The practitioner ID to remove
|
|
1995
|
+
* @param {string} clinicId - The clinic ID to remove
|
|
1996
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
1997
|
+
*/
|
|
1998
|
+
private removePatientLinksIfNoActiveAppointments;
|
|
1999
|
+
/**
|
|
2000
|
+
* Checks if there are active appointments between a patient and another entity (practitioner or clinic).
|
|
2001
|
+
*
|
|
2002
|
+
* @param {string} patientId - The patient ID.
|
|
2003
|
+
* @param {"practitionerId" | "clinicBranchId"} entityField - The field to check for the entity ID.
|
|
2004
|
+
* @param {string} entityId - The entity ID (practitioner or clinic).
|
|
2005
|
+
* @returns {Promise<number>} The number of active appointments found.
|
|
2006
|
+
*/
|
|
2007
|
+
private checkActiveAppointments;
|
|
1978
2008
|
private fetchPatientProfile;
|
|
1979
2009
|
/**
|
|
1980
2010
|
* Fetches the sensitive information for a given patient ID.
|
|
@@ -2495,10 +2525,13 @@ declare class CalendarAdminService {
|
|
|
2495
2525
|
* associated with a given appointment.
|
|
2496
2526
|
*
|
|
2497
2527
|
* @param appointment - The appointment object.
|
|
2498
|
-
* @param newEventTime - The new CalendarEventTime object (using
|
|
2528
|
+
* @param newEventTime - The new CalendarEventTime object (using admin.firestore.Timestamp).
|
|
2499
2529
|
* @returns {Promise<void>} A promise that resolves when all updates are attempted.
|
|
2500
2530
|
*/
|
|
2501
|
-
updateAppointmentCalendarEventsTime(appointment: Appointment, newEventTime:
|
|
2531
|
+
updateAppointmentCalendarEventsTime(appointment: Appointment, newEventTime: {
|
|
2532
|
+
start: admin.firestore.Timestamp;
|
|
2533
|
+
end: admin.firestore.Timestamp;
|
|
2534
|
+
}): Promise<void>;
|
|
2502
2535
|
/**
|
|
2503
2536
|
* Deletes all three calendar events associated with a given appointment.
|
|
2504
2537
|
* Note: This is a hard delete. Consider marking as CANCELLED instead if soft delete is preferred.
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -1069,7 +1069,8 @@ declare enum CalendarEventStatus {
|
|
|
1069
1069
|
REJECTED = "rejected",// When event is rejected by the clinic administrator or patient
|
|
1070
1070
|
CANCELED = "canceled",// When event is canceled by the patient
|
|
1071
1071
|
RESCHEDULED = "rescheduled",// When event is rescheduled by the clinic administrator
|
|
1072
|
-
COMPLETED = "completed"
|
|
1072
|
+
COMPLETED = "completed",// When event is completed
|
|
1073
|
+
NO_SHOW = "no_show"
|
|
1073
1074
|
}
|
|
1074
1075
|
/**
|
|
1075
1076
|
* Enum for calendar event sync status
|
|
@@ -1966,15 +1967,44 @@ declare class AppointmentAggregationService {
|
|
|
1966
1967
|
*/
|
|
1967
1968
|
private updateRelatedPatientRequirementInstances;
|
|
1968
1969
|
/**
|
|
1969
|
-
* Manages
|
|
1970
|
-
*
|
|
1971
|
-
* Removes patientId on appointment cancellation (basic removal, can be enhanced).
|
|
1970
|
+
* Manages relationships between a patient and clinics/practitioners.
|
|
1971
|
+
* Only updates the patient profile with doctorIds and clinicIds.
|
|
1972
1972
|
*
|
|
1973
|
-
* @param {
|
|
1974
|
-
* @param {
|
|
1973
|
+
* @param {PatientProfile} patientProfile - The patient profile to update
|
|
1974
|
+
* @param {string} practitionerId - The practitioner ID
|
|
1975
|
+
* @param {string} clinicId - The clinic ID
|
|
1976
|
+
* @param {"create" | "cancel"} action - 'create' to add IDs, 'cancel' to potentially remove them
|
|
1977
|
+
* @param {AppointmentStatus} [cancelStatus] - The appointment status if action is 'cancel'
|
|
1975
1978
|
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
1976
1979
|
*/
|
|
1977
1980
|
private managePatientClinicPractitionerLinks;
|
|
1981
|
+
/**
|
|
1982
|
+
* Adds practitioner and clinic IDs to the patient profile.
|
|
1983
|
+
*
|
|
1984
|
+
* @param {PatientProfile} patientProfile - The patient profile to update
|
|
1985
|
+
* @param {string} practitionerId - The practitioner ID to add
|
|
1986
|
+
* @param {string} clinicId - The clinic ID to add
|
|
1987
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
1988
|
+
*/
|
|
1989
|
+
private addPatientLinks;
|
|
1990
|
+
/**
|
|
1991
|
+
* Removes practitioner and clinic IDs from the patient profile if there are no more active appointments.
|
|
1992
|
+
*
|
|
1993
|
+
* @param {PatientProfile} patientProfile - The patient profile to update
|
|
1994
|
+
* @param {string} practitionerId - The practitioner ID to remove
|
|
1995
|
+
* @param {string} clinicId - The clinic ID to remove
|
|
1996
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
1997
|
+
*/
|
|
1998
|
+
private removePatientLinksIfNoActiveAppointments;
|
|
1999
|
+
/**
|
|
2000
|
+
* Checks if there are active appointments between a patient and another entity (practitioner or clinic).
|
|
2001
|
+
*
|
|
2002
|
+
* @param {string} patientId - The patient ID.
|
|
2003
|
+
* @param {"practitionerId" | "clinicBranchId"} entityField - The field to check for the entity ID.
|
|
2004
|
+
* @param {string} entityId - The entity ID (practitioner or clinic).
|
|
2005
|
+
* @returns {Promise<number>} The number of active appointments found.
|
|
2006
|
+
*/
|
|
2007
|
+
private checkActiveAppointments;
|
|
1978
2008
|
private fetchPatientProfile;
|
|
1979
2009
|
/**
|
|
1980
2010
|
* Fetches the sensitive information for a given patient ID.
|
|
@@ -2495,10 +2525,13 @@ declare class CalendarAdminService {
|
|
|
2495
2525
|
* associated with a given appointment.
|
|
2496
2526
|
*
|
|
2497
2527
|
* @param appointment - The appointment object.
|
|
2498
|
-
* @param newEventTime - The new CalendarEventTime object (using
|
|
2528
|
+
* @param newEventTime - The new CalendarEventTime object (using admin.firestore.Timestamp).
|
|
2499
2529
|
* @returns {Promise<void>} A promise that resolves when all updates are attempted.
|
|
2500
2530
|
*/
|
|
2501
|
-
updateAppointmentCalendarEventsTime(appointment: Appointment, newEventTime:
|
|
2531
|
+
updateAppointmentCalendarEventsTime(appointment: Appointment, newEventTime: {
|
|
2532
|
+
start: admin.firestore.Timestamp;
|
|
2533
|
+
end: admin.firestore.Timestamp;
|
|
2534
|
+
}): Promise<void>;
|
|
2502
2535
|
/**
|
|
2503
2536
|
* Deletes all three calendar events associated with a given appointment.
|
|
2504
2537
|
* Note: This is a hard delete. Consider marking as CANCELLED instead if soft delete is preferred.
|