@blackcode_sa/metaestetics-api 1.6.3 → 1.6.5

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 (40) hide show
  1. package/dist/admin/index.d.mts +439 -25
  2. package/dist/admin/index.d.ts +439 -25
  3. package/dist/admin/index.js +36107 -2493
  4. package/dist/admin/index.mjs +36093 -2461
  5. package/dist/backoffice/index.d.mts +254 -1
  6. package/dist/backoffice/index.d.ts +254 -1
  7. package/dist/backoffice/index.js +86 -12
  8. package/dist/backoffice/index.mjs +86 -13
  9. package/dist/index.d.mts +1434 -621
  10. package/dist/index.d.ts +1434 -621
  11. package/dist/index.js +1381 -970
  12. package/dist/index.mjs +1433 -1016
  13. package/package.json +1 -1
  14. package/src/admin/aggregation/appointment/appointment.aggregation.service.ts +321 -0
  15. package/src/admin/booking/booking.admin.ts +376 -3
  16. package/src/admin/index.ts +15 -1
  17. package/src/admin/notifications/notifications.admin.ts +1 -1
  18. package/src/admin/requirements/README.md +128 -0
  19. package/src/admin/requirements/patient-requirements.admin.service.ts +482 -0
  20. package/src/backoffice/types/product.types.ts +2 -0
  21. package/src/index.ts +16 -1
  22. package/src/services/appointment/appointment.service.ts +386 -250
  23. package/src/services/clinic/clinic-admin.service.ts +3 -0
  24. package/src/services/clinic/clinic-group.service.ts +8 -0
  25. package/src/services/documentation-templates/documentation-template.service.ts +24 -16
  26. package/src/services/documentation-templates/filled-document.service.ts +253 -136
  27. package/src/services/patient/patientRequirements.service.ts +285 -0
  28. package/src/services/procedure/procedure.service.ts +1 -0
  29. package/src/types/appointment/index.ts +136 -11
  30. package/src/types/documentation-templates/index.ts +34 -2
  31. package/src/types/notifications/README.md +77 -0
  32. package/src/types/notifications/index.ts +154 -27
  33. package/src/types/patient/patient-requirements.ts +81 -0
  34. package/src/types/procedure/index.ts +7 -0
  35. package/src/validations/appointment.schema.ts +298 -62
  36. package/src/validations/documentation-templates/template.schema.ts +55 -0
  37. package/src/validations/documentation-templates.schema.ts +9 -14
  38. package/src/validations/notification.schema.ts +3 -3
  39. package/src/validations/patient/patient-requirements.schema.ts +75 -0
  40. package/src/validations/procedure.schema.ts +3 -0
@@ -0,0 +1,482 @@
1
+ import * as admin from "firebase-admin";
2
+ // Import client-side Timestamp for type compatibility with shared types
3
+ import { Timestamp as FirebaseClientTimestamp } from "@firebase/firestore";
4
+ import {
5
+ PatientRequirementInstance,
6
+ PatientInstructionStatus,
7
+ PatientRequirementOverallStatus,
8
+ PatientRequirementInstruction,
9
+ PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME,
10
+ } from "../../types/patient/patient-requirements";
11
+ import {
12
+ NotificationType,
13
+ RequirementInstructionDueNotification,
14
+ NOTIFICATIONS_COLLECTION,
15
+ NotificationStatus,
16
+ } from "../../types/notifications";
17
+ import { PatientProfile, PATIENTS_COLLECTION } from "../../types/patient";
18
+ import { UserRole } from "../../types"; // Assuming UserRole is in the main types index
19
+ import { NotificationsAdmin } from "../notifications/notifications.admin";
20
+
21
+ /**
22
+ * @class PatientRequirementsAdminService
23
+ * @description Handles administrative tasks for patient requirement instances, primarily managing associated notifications.
24
+ * This service is intended to be used by Cloud Functions triggered by changes to PatientRequirementInstance documents.
25
+ */
26
+ export class PatientRequirementsAdminService {
27
+ private db: admin.firestore.Firestore;
28
+ private notificationsAdmin: NotificationsAdmin;
29
+
30
+ constructor(firestore?: admin.firestore.Firestore) {
31
+ this.db = firestore || admin.firestore();
32
+ this.notificationsAdmin = new NotificationsAdmin(this.db);
33
+ }
34
+
35
+ /**
36
+ * Processes a newly created or updated PatientRequirementInstance to schedule notifications for its instructions.
37
+ * It will also cancel pre-existing notifications if due times have changed significantly.
38
+ *
39
+ * @param patientId - The ID of the patient.
40
+ * @param instance - The PatientRequirementInstance data (either new or updated).
41
+ * @param previousInstanceData - Optional. The previous state of the instance data if it's an update.
42
+ * Used to determine if notifications need to be cancelled/rescheduled.
43
+ * @returns {Promise<void>} A promise that resolves when processing is complete.
44
+ */
45
+ async processRequirementInstanceAndScheduleNotifications(
46
+ patientId: string,
47
+ instance: PatientRequirementInstance,
48
+ previousInstanceData?: PatientRequirementInstance
49
+ ): Promise<void> {
50
+ console.log(
51
+ `[PRA_Service] Processing requirement instance ${instance.id} for patient ${patientId}. Overall Status: ${instance.overallStatus}`
52
+ );
53
+
54
+ const patientProfileRef = this.db
55
+ .collection(PATIENTS_COLLECTION)
56
+ .doc(patientId);
57
+ let patientExpoTokens: string[] = [];
58
+
59
+ try {
60
+ const patientDoc = await patientProfileRef.get();
61
+ if (patientDoc.exists) {
62
+ const patientData = patientDoc.data() as PatientProfile;
63
+ patientExpoTokens = patientData.expoTokens || [];
64
+ }
65
+ } catch (error) {
66
+ console.error(
67
+ `[PRA_Service] Error fetching patient ${patientId} for expo tokens:`,
68
+ error
69
+ );
70
+ }
71
+
72
+ if (patientExpoTokens.length === 0) {
73
+ console.log(
74
+ `[PRA_Service] Patient ${patientId} has no expo tokens. Skipping notification creation for instance ${instance.id}.`
75
+ );
76
+ }
77
+ // Create a new array of instruction objects to avoid mutating the original
78
+ // Keep original Timestamp objects by reference
79
+ const updatedInstructions: PatientRequirementInstruction[] =
80
+ instance.instructions.map((instr) => ({ ...instr }));
81
+ let instructionUpdatesMade = false;
82
+
83
+ for (let i = 0; i < updatedInstructions.length; i++) {
84
+ let currentInstruction = updatedInstructions[i];
85
+ const previousInstruction = previousInstanceData?.instructions.find(
86
+ (pi) => pi.instructionId === currentInstruction.instructionId
87
+ );
88
+ const adminTsNow = admin.firestore.Timestamp.now();
89
+
90
+ if (
91
+ instance.overallStatus ===
92
+ PatientRequirementOverallStatus.CANCELLED_APPOINTMENT ||
93
+ instance.overallStatus ===
94
+ PatientRequirementOverallStatus.SUPERSEDED_RESCHEDULE ||
95
+ currentInstruction.status === PatientInstructionStatus.CANCELLED
96
+ ) {
97
+ if (currentInstruction.notificationId) {
98
+ console.log(
99
+ `[PRA_Service] Cancelling notification ${currentInstruction.notificationId} for instruction ${currentInstruction.instructionId} of instance ${instance.id}.`
100
+ );
101
+ await this.notificationsAdmin.updateNotificationStatus(
102
+ currentInstruction.notificationId,
103
+ NotificationStatus.CANCELLED
104
+ );
105
+ currentInstruction = {
106
+ ...currentInstruction,
107
+ notificationId: undefined,
108
+ status: PatientInstructionStatus.CANCELLED,
109
+ updatedAt: new FirebaseClientTimestamp(
110
+ adminTsNow.seconds,
111
+ adminTsNow.nanoseconds
112
+ ),
113
+ };
114
+ updatedInstructions[i] = currentInstruction;
115
+ instructionUpdatesMade = true;
116
+ }
117
+ continue;
118
+ }
119
+
120
+ const dueTimeChanged =
121
+ previousInstruction &&
122
+ currentInstruction.dueTime && // Ensure dueTime exists
123
+ previousInstruction.dueTime.toMillis() !==
124
+ currentInstruction.dueTime.toMillis();
125
+
126
+ // Simplified: if previous was CANCELLED, and we are in this part of the code,
127
+ // it means currentInstruction.status is NOT CANCELLED (i.e., it's active).
128
+ const wasPreviouslyCancelledAndNowActive =
129
+ previousInstruction &&
130
+ previousInstruction.status === PatientInstructionStatus.CANCELLED;
131
+
132
+ if (
133
+ previousInstruction &&
134
+ (dueTimeChanged || wasPreviouslyCancelledAndNowActive) && // Use the simplified variable
135
+ currentInstruction.notificationId
136
+ ) {
137
+ console.log(
138
+ `[PRA_Service] Due time changed or instruction reactivated for ${currentInstruction.instructionId}. Cancelling old notification ${currentInstruction.notificationId}.`
139
+ );
140
+ await this.notificationsAdmin.updateNotificationStatus(
141
+ currentInstruction.notificationId,
142
+ NotificationStatus.CANCELLED
143
+ );
144
+ currentInstruction = {
145
+ ...currentInstruction,
146
+ notificationId: undefined,
147
+ updatedAt: new FirebaseClientTimestamp(
148
+ adminTsNow.seconds,
149
+ adminTsNow.nanoseconds
150
+ ),
151
+ };
152
+ updatedInstructions[i] = currentInstruction;
153
+ instructionUpdatesMade = true;
154
+ }
155
+
156
+ const shouldSchedule =
157
+ currentInstruction.dueTime && // Ensure dueTime exists
158
+ currentInstruction.status ===
159
+ PatientInstructionStatus.PENDING_NOTIFICATION &&
160
+ !currentInstruction.notificationId &&
161
+ currentInstruction.dueTime.toMillis() > adminTsNow.toMillis() &&
162
+ patientExpoTokens.length > 0;
163
+
164
+ if (shouldSchedule) {
165
+ console.log(
166
+ `[PRA_Service] Scheduling notification for instruction ${
167
+ currentInstruction.instructionId
168
+ } of instance ${
169
+ instance.id
170
+ } at ${currentInstruction.dueTime.toDate()}.`
171
+ );
172
+
173
+ const notificationPayload: Omit<
174
+ RequirementInstructionDueNotification,
175
+ "id" | "createdAt" | "updatedAt" | "status" | "isRead"
176
+ > = {
177
+ userId: patientId,
178
+ userRole: UserRole.PATIENT,
179
+ notificationType: NotificationType.REQUIREMENT_INSTRUCTION_DUE,
180
+ notificationTime: currentInstruction.dueTime, // This is a Firestore Timestamp
181
+ notificationTokens: patientExpoTokens,
182
+ title: `Reminder: ${instance.requirementName}`,
183
+ body: currentInstruction.instructionText,
184
+ appointmentId: instance.appointmentId,
185
+ patientRequirementInstanceId: instance.id,
186
+ instructionId: currentInstruction.instructionId,
187
+ originalRequirementId: instance.originalRequirementId,
188
+ };
189
+
190
+ try {
191
+ const createdNotificationId =
192
+ await this.notificationsAdmin.createNotification(
193
+ notificationPayload as any
194
+ );
195
+ currentInstruction = {
196
+ ...currentInstruction,
197
+ notificationId: createdNotificationId,
198
+ status: PatientInstructionStatus.PENDING_NOTIFICATION,
199
+ updatedAt: new FirebaseClientTimestamp(
200
+ adminTsNow.seconds,
201
+ adminTsNow.nanoseconds
202
+ ),
203
+ };
204
+ updatedInstructions[i] = currentInstruction;
205
+ instructionUpdatesMade = true;
206
+ } catch (error) {
207
+ console.error(
208
+ `[PRA_Service] Failed to create notification for instruction ${currentInstruction.instructionId}:`,
209
+ error
210
+ );
211
+ }
212
+ }
213
+ }
214
+
215
+ if (instructionUpdatesMade) {
216
+ console.log(
217
+ `[PRA_Service] Updating instructions array for instance ${instance.id} on patient ${patientId}.`
218
+ );
219
+ const instanceDocRef = this.db
220
+ .collection(PATIENTS_COLLECTION)
221
+ .doc(patientId)
222
+ .collection(PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME)
223
+ .doc(instance.id);
224
+
225
+ const finalAdminTsNow = admin.firestore.Timestamp.now();
226
+ await instanceDocRef.update({
227
+ instructions: updatedInstructions, // Array of instructions with actual Timestamps
228
+ updatedAt: new FirebaseClientTimestamp(
229
+ finalAdminTsNow.seconds,
230
+ finalAdminTsNow.nanoseconds
231
+ ),
232
+ });
233
+ }
234
+ }
235
+
236
+ /**
237
+ * Cancels all PENDING notifications associated with a specific PatientRequirementInstance.
238
+ * Typically called when the instance itself is deleted or its overall status becomes CANCELLED.
239
+ *
240
+ * @param instance - The PatientRequirementInstance.
241
+ * @returns {Promise<void>}
242
+ */
243
+ async cancelAllNotificationsForInstance(
244
+ instance: PatientRequirementInstance
245
+ ): Promise<void> {
246
+ console.log(
247
+ `[PRA_Service] Attempting to cancel all pending notifications for instance ${instance.id}.`
248
+ );
249
+ let cancelledCount = 0;
250
+ for (const instruction of instance.instructions) {
251
+ if (instruction.notificationId) {
252
+ try {
253
+ const notification = await this.notificationsAdmin.getNotification(
254
+ instruction.notificationId
255
+ );
256
+ if (
257
+ notification &&
258
+ notification.status === NotificationStatus.PENDING
259
+ ) {
260
+ await this.notificationsAdmin.updateNotificationStatus(
261
+ instruction.notificationId,
262
+ NotificationStatus.CANCELLED
263
+ );
264
+ console.log(
265
+ `[PRA_Service] Cancelled notification ${instruction.notificationId} for instruction ${instruction.instructionId}.`
266
+ );
267
+ cancelledCount++;
268
+ } else if (notification) {
269
+ console.log(
270
+ `[PRA_Service] Notification ${instruction.notificationId} for instruction ${instruction.instructionId} was not pending (status: ${notification.status}). Not cancelling.`
271
+ );
272
+ }
273
+ } catch (error) {
274
+ console.error(
275
+ `[PRA_Service] Error cancelling notification ${instruction.notificationId}:`,
276
+ error
277
+ );
278
+ }
279
+ }
280
+ }
281
+ if (cancelledCount > 0) {
282
+ console.log(
283
+ `[PRA_Service] Cancelled ${cancelledCount} notifications for instance ${instance.id}.`
284
+ );
285
+ }
286
+ }
287
+
288
+ /**
289
+ * (Optional - For a cron job)
290
+ * Scans for instructions that are past their due time but not yet actioned, and updates their status to MISSED.
291
+ * This would typically be called by a scheduled Cloud Function.
292
+ *
293
+ * @param patientId - The ID of the patient.
294
+ * @param instanceId - The ID of the PatientRequirementInstance.
295
+ * @returns {Promise<void>}
296
+ */
297
+ async updateMissedInstructions(
298
+ patientId: string,
299
+ instanceId: string
300
+ ): Promise<void> {
301
+ const instanceRef = this.db
302
+ .collection(PATIENTS_COLLECTION)
303
+ .doc(patientId)
304
+ .collection(PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME)
305
+ .doc(instanceId);
306
+
307
+ const instanceSnap = await instanceRef.get();
308
+ if (!instanceSnap.exists) {
309
+ console.warn(
310
+ `[PRA_Service] Instance ${instanceId} not found during missed check for patient ${patientId}.`
311
+ );
312
+ return;
313
+ }
314
+
315
+ const instance = instanceSnap.data() as PatientRequirementInstance;
316
+ const adminNowForMissed = admin.firestore.Timestamp.now();
317
+
318
+ // Create a new array of instruction objects to avoid mutating the original
319
+ const updatedInstructions: PatientRequirementInstruction[] =
320
+ instance.instructions.map((instr) => ({ ...instr }));
321
+ let changesMade = false;
322
+
323
+ for (let i = 0; i < updatedInstructions.length; i++) {
324
+ let currentInstruction = updatedInstructions[i];
325
+ if (
326
+ currentInstruction.dueTime && // Ensure dueTime exists
327
+ (currentInstruction.status ===
328
+ PatientInstructionStatus.PENDING_NOTIFICATION ||
329
+ currentInstruction.status === PatientInstructionStatus.ACTION_DUE) &&
330
+ currentInstruction.dueTime.toMillis() < adminNowForMissed.toMillis()
331
+ ) {
332
+ currentInstruction = {
333
+ ...currentInstruction,
334
+ status: PatientInstructionStatus.MISSED,
335
+ updatedAt: new FirebaseClientTimestamp(
336
+ adminNowForMissed.seconds,
337
+ adminNowForMissed.nanoseconds
338
+ ),
339
+ };
340
+ updatedInstructions[i] = currentInstruction;
341
+ changesMade = true;
342
+ console.log(
343
+ `[PRA_Service] Marked instruction ${currentInstruction.instructionId} in instance ${instanceId} as MISSED.`
344
+ );
345
+ }
346
+ }
347
+
348
+ if (changesMade) {
349
+ const finalAdminNowForMissedUpdate = admin.firestore.Timestamp.now();
350
+ await instanceRef.update({
351
+ instructions: updatedInstructions, // Array of instructions with actual Timestamps
352
+ updatedAt: new FirebaseClientTimestamp(
353
+ finalAdminNowForMissedUpdate.seconds,
354
+ finalAdminNowForMissedUpdate.nanoseconds
355
+ ),
356
+ });
357
+ console.log(
358
+ `[PRA_Service] Updated missed instructions for instance ${instanceId}.`
359
+ );
360
+ }
361
+ }
362
+
363
+ /**
364
+ * Calculates and updates the overallStatus of a PatientRequirementInstance
365
+ * based on the statuses of its individual instructions.
366
+ *
367
+ * @param patientId - The ID of the patient.
368
+ * @param instanceId - The ID of the PatientRequirementInstance to update.
369
+ * @returns {Promise<void>} A promise that resolves when processing is complete.
370
+ */
371
+ async updateOverallInstanceStatus(
372
+ patientId: string,
373
+ instanceId: string
374
+ ): Promise<void> {
375
+ const instanceRef = this.db
376
+ .collection(PATIENTS_COLLECTION)
377
+ .doc(patientId)
378
+ .collection(PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME)
379
+ .doc(instanceId);
380
+
381
+ const instanceSnap = await instanceRef.get();
382
+ if (!instanceSnap.exists) {
383
+ console.warn(
384
+ `[PRA_Service] Instance ${instanceId} not found while trying to update overall status for patient ${patientId}.`
385
+ );
386
+ return;
387
+ }
388
+
389
+ const instance = instanceSnap.data() as PatientRequirementInstance;
390
+
391
+ // Do not override terminal statuses set by other processes
392
+ if (
393
+ instance.overallStatus ===
394
+ PatientRequirementOverallStatus.CANCELLED_APPOINTMENT ||
395
+ instance.overallStatus ===
396
+ PatientRequirementOverallStatus.SUPERSEDED_RESCHEDULE ||
397
+ instance.overallStatus ===
398
+ PatientRequirementOverallStatus.FAILED_TO_PROCESS // Assuming FAILED_TO_PROCESS is also a terminal state set by other means if it's a hard failure.
399
+ ) {
400
+ console.log(
401
+ `[PRA_Service] Instance ${instanceId} has overallStatus ${instance.overallStatus}, skipping overall status update based on instruction completion logic.`
402
+ );
403
+ return;
404
+ }
405
+
406
+ const nonCancelledInstructions = instance.instructions.filter(
407
+ (instr) => instr.status !== PatientInstructionStatus.CANCELLED
408
+ );
409
+
410
+ if (nonCancelledInstructions.length === 0) {
411
+ // If all instructions are cancelled or there are no instructions.
412
+ // If it was previously something like ALL_INSTRUCTIONS_MET, it should revert to ACTIVE or a default.
413
+ if (instance.overallStatus !== PatientRequirementOverallStatus.ACTIVE) {
414
+ console.log(
415
+ `[PRA_Service] Instance ${instanceId} has no active (non-cancelled) instructions. Setting to ACTIVE.`
416
+ );
417
+ await instanceRef.update({
418
+ overallStatus: PatientRequirementOverallStatus.ACTIVE,
419
+ updatedAt: new FirebaseClientTimestamp(
420
+ admin.firestore.Timestamp.now().seconds,
421
+ admin.firestore.Timestamp.now().nanoseconds
422
+ ),
423
+ });
424
+ }
425
+ return;
426
+ }
427
+
428
+ // Check if any instruction is still pending action by the patient
429
+ const hasPendingOrDueInstructions = nonCancelledInstructions.some(
430
+ (instr) =>
431
+ instr.status === PatientInstructionStatus.PENDING_NOTIFICATION ||
432
+ instr.status === PatientInstructionStatus.ACTION_DUE
433
+ );
434
+
435
+ let newOverallStatus: PatientRequirementOverallStatus;
436
+
437
+ if (hasPendingOrDueInstructions) {
438
+ newOverallStatus = PatientRequirementOverallStatus.ACTIVE;
439
+ } else {
440
+ // All non-cancelled instructions are in a "resolved" state (ACTION_TAKEN, MISSED, SKIPPED)
441
+ const effectivelyCompletedCount = nonCancelledInstructions.filter(
442
+ (instr) =>
443
+ instr.status === PatientInstructionStatus.ACTION_TAKEN ||
444
+ instr.status === PatientInstructionStatus.SKIPPED
445
+ ).length;
446
+
447
+ const totalNonCancelled = nonCancelledInstructions.length;
448
+ const completionPercentage =
449
+ (effectivelyCompletedCount / totalNonCancelled) * 100;
450
+
451
+ if (completionPercentage === 100) {
452
+ newOverallStatus = PatientRequirementOverallStatus.ALL_INSTRUCTIONS_MET;
453
+ } else if (completionPercentage >= 60) {
454
+ // Changed from >60 to >=60 as per common understanding of "more than 60%" often including 60%
455
+ newOverallStatus = PatientRequirementOverallStatus.PARTIALLY_COMPLETED;
456
+ } else {
457
+ // Less than 60% effectively completed (could include some MISSED ones not blocking this calculation directly)
458
+ // Or if all are MISSED, this would also fall here if FAILED_TO_PROCESS isn't set for other reasons.
459
+ // Your logic: "if less then 60% of instructions are action taken or skipped, then we move status to failed"
460
+ newOverallStatus = PatientRequirementOverallStatus.FAILED_TO_PROCESS;
461
+ }
462
+ }
463
+
464
+ if (newOverallStatus !== instance.overallStatus) {
465
+ console.log(
466
+ `[PRA_Service] Updating overallStatus for instance ${instanceId} from ${instance.overallStatus} to ${newOverallStatus}.`
467
+ );
468
+ const adminTsNow = admin.firestore.Timestamp.now();
469
+ await instanceRef.update({
470
+ overallStatus: newOverallStatus,
471
+ updatedAt: new FirebaseClientTimestamp(
472
+ adminTsNow.seconds,
473
+ adminTsNow.nanoseconds
474
+ ),
475
+ });
476
+ } else {
477
+ console.log(
478
+ `[PRA_Service] Calculated overallStatus ${newOverallStatus} for instance ${instanceId} is same as current. No update needed.`
479
+ );
480
+ }
481
+ }
482
+ }
@@ -21,7 +21,9 @@ export interface Product {
21
21
  id?: string;
22
22
  name: string;
23
23
  brandId: string;
24
+ brandName: string;
24
25
  technologyId: string;
26
+ technologyName: string;
25
27
  createdAt: Date;
26
28
  updatedAt: Date;
27
29
  isActive: boolean;
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@ export { CalendarServiceV2 } from "./services/calendar/calendar-refactored.servi
33
33
  export { SyncedCalendarsService } from "./services/calendar/synced-calendars.service";
34
34
  export { ReviewService } from "./services/reviews/reviews.service";
35
35
  export { AppointmentService } from "./services/appointment/appointment.service";
36
+ export { PatientRequirementsService } from "./services/patient/patientRequirements.service";
36
37
 
37
38
  // Backoffice services
38
39
  export { BrandService } from "./backoffice/services/brand.service";
@@ -74,7 +75,6 @@ export type {
74
75
  PreRequirementNotification,
75
76
  PostRequirementNotification,
76
77
  AppointmentReminderNotification,
77
- AppointmentNotification,
78
78
  } from "./types/notifications";
79
79
  export { NotificationType, NotificationStatus } from "./types/notifications";
80
80
 
@@ -346,3 +346,18 @@ export {
346
346
  reviewSchema,
347
347
  createReviewSchema,
348
348
  } from "./validations/reviews.schema";
349
+
350
+ // Patient Requirement Types
351
+ export type {
352
+ PatientRequirementInstance,
353
+ PatientRequirementInstruction,
354
+ } from "./types/patient/patient-requirements";
355
+ export {
356
+ PatientInstructionStatus,
357
+ PatientRequirementOverallStatus,
358
+ PATIENT_REQUIREMENTS_SUBCOLLECTION_NAME,
359
+ } from "./types/patient/patient-requirements";
360
+
361
+ // Patient Requirement Validation Schemas (if they exist and are for client use)
362
+ // Assuming the path, add if it exists and is needed:
363
+ // export * from "./validations/patient/patient-requirements.schema";