@bahmni/widgets 0.0.1-dev.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.
Files changed (103) hide show
  1. package/LICENCE +9 -0
  2. package/README.md +5 -0
  3. package/dist/allergies/AllergiesTable.d.ts +7 -0
  4. package/dist/allergies/AllergiesTable.d.ts.map +1 -0
  5. package/dist/allergies/index.d.ts +2 -0
  6. package/dist/allergies/index.d.ts.map +1 -0
  7. package/dist/allergies/useAllergies.d.ts +14 -0
  8. package/dist/allergies/useAllergies.d.ts.map +1 -0
  9. package/dist/allergies/utils.d.ts +34 -0
  10. package/dist/allergies/utils.d.ts.map +1 -0
  11. package/dist/conditions/ConditionsTable.d.ts +8 -0
  12. package/dist/conditions/ConditionsTable.d.ts.map +1 -0
  13. package/dist/conditions/index.d.ts +2 -0
  14. package/dist/conditions/index.d.ts.map +1 -0
  15. package/dist/conditions/models.d.ts +22 -0
  16. package/dist/conditions/models.d.ts.map +1 -0
  17. package/dist/conditions/utils.d.ts +11 -0
  18. package/dist/conditions/utils.d.ts.map +1 -0
  19. package/dist/diagnoses/DiagnosesTable.d.ts +7 -0
  20. package/dist/diagnoses/DiagnosesTable.d.ts.map +1 -0
  21. package/dist/diagnoses/index.d.ts +2 -0
  22. package/dist/diagnoses/index.d.ts.map +1 -0
  23. package/dist/diagnoses/useDiagnoses.d.ts +14 -0
  24. package/dist/diagnoses/useDiagnoses.d.ts.map +1 -0
  25. package/dist/hooks/useActivePractitioner.d.ts +15 -0
  26. package/dist/hooks/useActivePractitioner.d.ts.map +1 -0
  27. package/dist/hooks/usePatientUUID.d.ts +6 -0
  28. package/dist/hooks/usePatientUUID.d.ts.map +1 -0
  29. package/dist/index.css +1 -0
  30. package/dist/index.d.ts +15 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +81399 -0
  33. package/dist/labinvestigation/LabInvestigation.d.ts +4 -0
  34. package/dist/labinvestigation/LabInvestigation.d.ts.map +1 -0
  35. package/dist/labinvestigation/LabInvestigationItem.d.ts +8 -0
  36. package/dist/labinvestigation/LabInvestigationItem.d.ts.map +1 -0
  37. package/dist/labinvestigation/index.d.ts +2 -0
  38. package/dist/labinvestigation/index.d.ts.map +1 -0
  39. package/dist/labinvestigation/useLabInvestigations.d.ts +11 -0
  40. package/dist/labinvestigation/useLabInvestigations.d.ts.map +1 -0
  41. package/dist/medications/MedicationsTable.d.ts +4 -0
  42. package/dist/medications/MedicationsTable.d.ts.map +1 -0
  43. package/dist/medications/index.d.ts +2 -0
  44. package/dist/medications/index.d.ts.map +1 -0
  45. package/dist/medications/useMedicationRequest.d.ts +14 -0
  46. package/dist/medications/useMedicationRequest.d.ts.map +1 -0
  47. package/dist/medications/utils.d.ts +67 -0
  48. package/dist/medications/utils.d.ts.map +1 -0
  49. package/dist/notification/NotificationContext.d.ts +9 -0
  50. package/dist/notification/NotificationContext.d.ts.map +1 -0
  51. package/dist/notification/NotificationProvider.d.ts +7 -0
  52. package/dist/notification/NotificationProvider.d.ts.map +1 -0
  53. package/dist/notification/NotificationServiceComponent.d.ts +8 -0
  54. package/dist/notification/NotificationServiceComponent.d.ts.map +1 -0
  55. package/dist/notification/index.d.ts +5 -0
  56. package/dist/notification/index.d.ts.map +1 -0
  57. package/dist/notification/useNotification.d.ts +9 -0
  58. package/dist/notification/useNotification.d.ts.map +1 -0
  59. package/dist/patientDetails/PatientDetails.d.ts +4 -0
  60. package/dist/patientDetails/PatientDetails.d.ts.map +1 -0
  61. package/dist/patientDetails/index.d.ts +2 -0
  62. package/dist/patientDetails/index.d.ts.map +1 -0
  63. package/dist/patientDetails/usePatient.d.ts +14 -0
  64. package/dist/patientDetails/usePatient.d.ts.map +1 -0
  65. package/dist/radiologyInvestigation/RadiologyInvestigationTable.d.ts +8 -0
  66. package/dist/radiologyInvestigation/RadiologyInvestigationTable.d.ts.map +1 -0
  67. package/dist/radiologyInvestigation/__mocks__/mocks.d.ts +17 -0
  68. package/dist/radiologyInvestigation/__mocks__/mocks.d.ts.map +1 -0
  69. package/dist/radiologyInvestigation/index.d.ts +2 -0
  70. package/dist/radiologyInvestigation/index.d.ts.map +1 -0
  71. package/dist/radiologyInvestigation/useRadiologyInvestigation.d.ts +14 -0
  72. package/dist/radiologyInvestigation/useRadiologyInvestigation.d.ts.map +1 -0
  73. package/dist/radiologyInvestigation/utils.d.ts +30 -0
  74. package/dist/radiologyInvestigation/utils.d.ts.map +1 -0
  75. package/dist/searchPatient/SearchPatient.d.ts +9 -0
  76. package/dist/searchPatient/SearchPatient.d.ts.map +1 -0
  77. package/dist/searchPatient/SearchStrategy.interface.d.ts +61 -0
  78. package/dist/searchPatient/SearchStrategy.interface.d.ts.map +1 -0
  79. package/dist/searchPatient/index.d.ts +2 -0
  80. package/dist/searchPatient/index.d.ts.map +1 -0
  81. package/dist/searchPatient/strategies/AppointmentSearchStrategy.d.ts +37 -0
  82. package/dist/searchPatient/strategies/AppointmentSearchStrategy.d.ts.map +1 -0
  83. package/dist/searchPatient/strategies/AttributeSearchStrategy.d.ts +40 -0
  84. package/dist/searchPatient/strategies/AttributeSearchStrategy.d.ts.map +1 -0
  85. package/dist/searchPatient/strategies/NameOrIdSearchStrategy.d.ts +25 -0
  86. package/dist/searchPatient/strategies/NameOrIdSearchStrategy.d.ts.map +1 -0
  87. package/dist/searchPatient/strategies/SearchStrategyRegistry.d.ts +37 -0
  88. package/dist/searchPatient/strategies/SearchStrategyRegistry.d.ts.map +1 -0
  89. package/dist/userPrivileges/UserPrivilegeContext.d.ts +11 -0
  90. package/dist/userPrivileges/UserPrivilegeContext.d.ts.map +1 -0
  91. package/dist/userPrivileges/UserPrivilegeProvider.d.ts +7 -0
  92. package/dist/userPrivileges/UserPrivilegeProvider.d.ts.map +1 -0
  93. package/dist/userPrivileges/useUserPrivilege.d.ts +3 -0
  94. package/dist/userPrivileges/useUserPrivilege.d.ts.map +1 -0
  95. package/dist/vitalFlowSheet/VitalFlowSheet.d.ts +9 -0
  96. package/dist/vitalFlowSheet/VitalFlowSheet.d.ts.map +1 -0
  97. package/dist/vitalFlowSheet/index.d.ts +3 -0
  98. package/dist/vitalFlowSheet/index.d.ts.map +1 -0
  99. package/dist/vitalFlowSheet/useVitalFlowSheet.d.ts +20 -0
  100. package/dist/vitalFlowSheet/useVitalFlowSheet.d.ts.map +1 -0
  101. package/dist/vitalFlowSheet/utils.d.ts +48 -0
  102. package/dist/vitalFlowSheet/utils.d.ts.map +1 -0
  103. package/package.json +50 -0
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ declare const LabInvestigation: React.FC;
3
+ export default LabInvestigation;
4
+ //# sourceMappingURL=LabInvestigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LabInvestigation.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/LabInvestigation.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAwE7B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { FormattedLabTest } from '@bahmni/services';
2
+ import { default as React } from 'react';
3
+ interface LabInvestigationItemProps {
4
+ test: FormattedLabTest;
5
+ }
6
+ declare const LabInvestigationItem: React.FC<LabInvestigationItemProps>;
7
+ export default LabInvestigationItem;
8
+ //# sourceMappingURL=LabInvestigationItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LabInvestigationItem.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/LabInvestigationItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,yBAAyB;IACjC,IAAI,EAAE,gBAAgB,CAAC;CACxB;AACD,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA8B7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as LabInvestigation } from './LabInvestigation';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { FormattedLabTest } from '@bahmni/services';
2
+ /**
3
+ * Hook to fetch and manage lab investigations for the current patient
4
+ * @returns Object containing lab tests, loading state, and error state
5
+ */
6
+ export default function useLabInvestigations(): {
7
+ labTests: FormattedLabTest[];
8
+ isLoading: boolean;
9
+ hasError: boolean;
10
+ };
11
+ //# sourceMappingURL=useLabInvestigations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLabInvestigations.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/useLabInvestigations.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAI1B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB;;;;EAqC3C"}
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ declare const MedicationsTable: React.FC;
3
+ export default MedicationsTable;
4
+ //# sourceMappingURL=MedicationsTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MedicationsTable.d.ts","sourceRoot":"","sources":["../../src/medications/MedicationsTable.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAmD9D,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EA8N7B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as MedicationsTable } from './MedicationsTable';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/medications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { MedicationRequest } from '@bahmni/services';
2
+ interface MedicationRequestResult {
3
+ medications: MedicationRequest[];
4
+ loading: boolean;
5
+ error: Error | null;
6
+ refetch: () => void;
7
+ }
8
+ /**
9
+ * Custom hook to fetch and manage medications for the current patient
10
+ * @returns Object containing medications, loading state, error state, and refetch function
11
+ */
12
+ export declare const useMedicationRequest: () => MedicationRequestResult;
13
+ export default useMedicationRequest;
14
+ //# sourceMappingURL=useMedicationRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMedicationRequest.d.ts","sourceRoot":"","sources":["../../src/medications/useMedicationRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGlB,MAAM,kBAAkB,CAAC;AAI1B,UAAU,uBAAuB;IAC/B,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,uBAoCvC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { MedicationRequest, FormattedMedicationRequest } from '../../../bahmni-services/src/medicationRequestService/models';
2
+ /**
3
+ * Priority order for medication status levels (case insensitive)
4
+ * Index 0 = highest priority, higher index = lower priority
5
+ * Used for sorting medications by status: active → on-hold → stopped → cancelled → completed →
6
+ * entered-in-error → draft → unknown
7
+ */
8
+ export declare const MEDICATION_STATUS_PRIORITY_ORDER: string[];
9
+ /**
10
+ * Maps medication status to numeric priority for sorting.
11
+ * Uses a case-insensitive match against the MEDICATION_STATUS_PRIORITY_ORDER.
12
+ *
13
+ * @param status - The status of the medication (e.g. 'active', 'completed').
14
+ * @returns A numeric priority index for sorting (lower = higher priority).
15
+ */
16
+ export declare const getMedicationStatusPriority: (status: string) => number;
17
+ /**
18
+ * Sorts an array of medication requests by status priority in the order:
19
+ * active → on-hold → completed → stopped. Stable sort ensures original
20
+ * order is preserved for medications with the same status.
21
+ *
22
+ * @param medications - The array of FormattedMedicationRequest objects to be sorted.
23
+ * @returns A new sorted array of FormattedMedicationRequest objects.
24
+ */
25
+ export declare const sortMedicationsByStatus: (medications: FormattedMedicationRequest[]) => FormattedMedicationRequest[];
26
+ /**
27
+ * Gets the priority value for medication based only on isImmediate flag.
28
+ * Lower values indicate higher priority.
29
+ *
30
+ * @param medication - The FormattedMedicationRequest object to get priority for.
31
+ * @returns A numeric priority value (0 = immediate medications, 1 = all other medications).
32
+ */
33
+ export declare const getMedicationPriority: (medication: FormattedMedicationRequest) => number;
34
+ /**
35
+ * Sorts an array of medication requests by priority based only on isImmediate flag.
36
+ * Priority order: immediate medications → all other medications (asNeeded, regular, etc.).
37
+ * Stable sort ensures original order is preserved within the same priority group.
38
+ *
39
+ * @param medications - The array of FormattedMedicationRequest objects to be sorted.
40
+ * @returns A new sorted array of FormattedMedicationRequest objects.
41
+ */
42
+ export declare const sortMedicationsByPriority: (medications: FormattedMedicationRequest[]) => FormattedMedicationRequest[];
43
+ /**
44
+ * Converts a short-form duration unit code into its full string representation.
45
+ *
46
+ * @param medication - The duration unit code ('s', 'min', 'h', 'd', 'wk', 'mo', 'a').
47
+ * @returns The full unit name (e.g. 'days' for 'd', 'weeks' for 'wk').
48
+ */
49
+ export declare function formatMedicationRequestDate(medication: 's' | 'min' | 'h' | 'd' | 'wk' | 'mo' | 'a'): string;
50
+ /**
51
+ * Converts a MedicationRequest object into a FormattedMedicationRequest object.
52
+ * Handles formatting of dosage, instructions, and date fields.
53
+ *
54
+ * @param medication - The original MedicationRequest object to format.
55
+ * @returns A new FormattedMedicationRequest object with readable, formatted data.
56
+ */
57
+ export declare function formatMedicationRequest(medication: MedicationRequest): FormattedMedicationRequest;
58
+ /**
59
+ * Sorts an array of medication requests by date distance from today using startDate.
60
+ * Orders medications with today's date first, yesterday second, day before third, etc.
61
+ * Invalid dates are placed at the end. Maintains stable sort for medications with the same date.
62
+ *
63
+ * @param medications - The array of FormattedMedicationRequest objects to be sorted.
64
+ * @returns A new sorted array of FormattedMedicationRequest objects.
65
+ */
66
+ export declare const sortMedicationsByDateDistance: (medications: FormattedMedicationRequest[]) => FormattedMedicationRequest[];
67
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/medications/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,8DAA8D,CAAC;AAGtE;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,UAS5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GAAI,QAAQ,MAAM,KAAG,MAE5D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,aAAa,0BAA0B,EAAE,KACxC,0BAA0B,EAO5B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAChC,YAAY,0BAA0B,KACrC,MAGF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,aAAa,0BAA0B,EAAE,KACxC,0BAA0B,EAI5B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GACtD,MAAM,CAiBR;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,iBAAiB,GAC5B,0BAA0B,CA2D5B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,GACxC,aAAa,0BAA0B,EAAE,KACxC,0BAA0B,EAU5B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Notification } from '@bahmni/services';
2
+ export interface NotificationContextType {
3
+ notifications: Notification[];
4
+ addNotification: (notification: Omit<Notification, 'id'>) => string;
5
+ removeNotification: (id: string) => void;
6
+ clearAllNotifications: () => void;
7
+ }
8
+ export declare const NotificationContext: import('react').Context<NotificationContextType | undefined>;
9
+ //# sourceMappingURL=NotificationContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationContext.d.ts","sourceRoot":"","sources":["../../src/notification/NotificationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,eAAe,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,MAAM,CAAC;IACpE,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,qBAAqB,EAAE,MAAM,IAAI,CAAC;CACnC;AAED,eAAO,MAAM,mBAAmB,8DAEpB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ interface NotificationProviderProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare const NotificationProvider: React.FC<NotificationProviderProps>;
6
+ export {};
7
+ //# sourceMappingURL=NotificationProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationProvider.d.ts","sourceRoot":"","sources":["../../src/notification/NotificationProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAKZ,SAAS,EACV,MAAM,OAAO,CAAC;AAGf,UAAU,yBAAyB;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAqFjE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Component that connects the notification service to the notification context
4
+ * This should be rendered inside the NotificationProvider
5
+ */
6
+ export declare const NotificationServiceComponent: React.FC;
7
+ export default NotificationServiceComponent;
8
+ //# sourceMappingURL=NotificationServiceComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationServiceComponent.d.ts","sourceRoot":"","sources":["../../src/notification/NotificationServiceComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAGzC;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAchD,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { NotificationContext, type NotificationContextType, } from './NotificationContext';
2
+ export { useNotification } from './useNotification';
3
+ export { NotificationServiceComponent } from './NotificationServiceComponent';
4
+ export { NotificationProvider } from './NotificationProvider';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { NotificationContextType } from '../notification';
2
+ /**
3
+ * Custom hook to use the notification service
4
+ * @returns {NotificationContextType} The notification context
5
+ * @throws {Error} If used outside of a NotificationProvider
6
+ */
7
+ export declare const useNotification: () => NotificationContextType;
8
+ export default useNotification;
9
+ //# sourceMappingURL=useNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNotification.d.ts","sourceRoot":"","sources":["../../src/notification/useNotification.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAuB,MAAM,iBAAiB,CAAC;AAE/E;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAO,uBAUlC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ declare const PatientDetails: React.FC;
3
+ export default PatientDetails;
4
+ //# sourceMappingURL=PatientDetails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientDetails.d.ts","sourceRoot":"","sources":["../../src/patientDetails/PatientDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EA0E3B,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as PatientDetails } from './PatientDetails';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patientDetails/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { FormattedPatientData } from '@bahmni/services';
2
+ interface UsePatientResult {
3
+ patient: FormattedPatientData | null;
4
+ loading: boolean;
5
+ error: Error | null;
6
+ refetch: () => void;
7
+ }
8
+ /**
9
+ * Custom hook to fetch and manage patient data
10
+ * @returns Object containing patient, loading state, error state, and refetch function
11
+ */
12
+ export declare const usePatient: () => UsePatientResult;
13
+ export {};
14
+ //# sourceMappingURL=usePatient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePatient.d.ts","sourceRoot":"","sources":["../../src/patientDetails/usePatient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAGrB,MAAM,kBAAkB,CAAC;AAI1B,UAAU,gBAAgB;IACxB,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAO,gBA8B7B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Component to display patient radiology investigations grouped by date in accordion format
4
+ * Each accordion item contains an SortableDataTable with radiology investigations for that date
5
+ */
6
+ declare const RadiologyInvestigationTable: React.FC;
7
+ export default RadiologyInvestigationTable;
8
+ //# sourceMappingURL=RadiologyInvestigationTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadiologyInvestigationTable.d.ts","sourceRoot":"","sources":["../../src/radiologyInvestigation/RadiologyInvestigationTable.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAQpD;;;GAGG;AACH,QAAA,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAwHxC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { RadiologyInvestigation } from '@bahmni/services';
2
+ import { Bundle, ServiceRequest } from 'fhir/r4';
3
+ export declare const mockPatientUUID = "c81876c3-b464-486a-9ebf-20eea9431fb1";
4
+ export declare const mockFhirRadiologyTests: ServiceRequest[];
5
+ export declare const mockRadiologyTestBasic: ServiceRequest;
6
+ export declare const mockRadiologyTestWithMultipleReplaces: ServiceRequest;
7
+ export declare const mockRadiologyTestWithEmptyReplaces: ServiceRequest;
8
+ export declare const mockFhirRadiologyBundle: Bundle;
9
+ export declare const mockFormattedRadiologyInvestigations: RadiologyInvestigation[];
10
+ export declare const mockRadiologyInvestigationWithReplaces: RadiologyInvestigation;
11
+ export declare const mockRadiologyInvestigationReplaced: RadiologyInvestigation;
12
+ export declare const mockRadiologyInvestigationStandalone: RadiologyInvestigation;
13
+ export declare const mockRadiologyInvestigationsForFiltering: RadiologyInvestigation[];
14
+ export declare const mockRadiologyInvestigationWithMultipleReplaces: RadiologyInvestigation;
15
+ export declare const mockRadiologyChainReplacement: RadiologyInvestigation[];
16
+ export declare const createMockRadiologyInvestigation: (id: string, testName: string, priority: string, replaces?: string[]) => RadiologyInvestigation;
17
+ //# sourceMappingURL=mocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../../src/radiologyInvestigation/__mocks__/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGjD,eAAO,MAAM,eAAe,yCAAyC,CAAC;AAGtE,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAkMlD,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,cAgBpC,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,cA0BnD,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,cAsBhD,CAAC;AAGF,eAAO,MAAM,uBAAuB,EAAE,MAkBrC,CAAC;AAGF,eAAO,MAAM,oCAAoC,EAAE,sBAAsB,EAuBxE,CAAC;AAGF,eAAO,MAAM,sCAAsC,EAAE,sBAOpD,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,sBAMhD,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,sBAMlD,CAAC;AAGF,eAAO,MAAM,uCAAuC,EAAE,sBAAsB,EAKzE,CAAC;AAEJ,eAAO,MAAM,8CAA8C,EAAE,sBAQ1D,CAAC;AAGJ,eAAO,MAAM,6BAA6B,EAAE,sBAAsB,EA+BjE,CAAC;AAGF,eAAO,MAAM,gCAAgC,GAC3C,IAAI,MAAM,EACV,UAAU,MAAM,EAChB,UAAU,MAAM,EAChB,WAAW,MAAM,EAAE,KAClB,sBAOD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as RadiologyInvestigationTable } from './RadiologyInvestigationTable';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/radiologyInvestigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { RadiologyInvestigation } from '@bahmni/services';
2
+ interface UseRadiologyInvestigationResult {
3
+ radiologyInvestigations: RadiologyInvestigation[];
4
+ loading: boolean;
5
+ error: Error | null;
6
+ refetch: () => void;
7
+ }
8
+ /**
9
+ * Custom hook to fetch and manage radiology investigations for the current patient
10
+ * @returns Object containing radiology investigations, loading state, error state, and refetch function
11
+ */
12
+ export declare const useRadiologyInvestigation: () => UseRadiologyInvestigationResult;
13
+ export default useRadiologyInvestigation;
14
+ //# sourceMappingURL=useRadiologyInvestigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRadiologyInvestigation.d.ts","sourceRoot":"","sources":["../../src/radiologyInvestigation/useRadiologyInvestigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,sBAAsB,EAEvB,MAAM,kBAAkB,CAAC;AAI1B,UAAU,+BAA+B;IACvC,uBAAuB,EAAE,sBAAsB,EAAE,CAAC;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAChC,+BAuCH,CAAC;AAEJ,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { RadiologyInvestigation } from '@bahmni/services';
2
+ /**
3
+ * Priority order for radiology investigation priorities (case insensitive)
4
+ * Index 0 = highest priority, higher index = lower priority
5
+ * Used for sorting radiology investigations by priority: stat → routine
6
+ */
7
+ export declare const PRIORITY_ORDER: string[];
8
+ /**
9
+ * Maps radiology investigation priority to numeric priority for sorting
10
+ * Uses generic getPriorityByOrder function with PRIORITY_ORDER
11
+ * @param priority - The priority of the radiology investigation
12
+ * @returns Numeric priority (lower = higher priority)
13
+ */
14
+ export declare const getRadiologyPriority: (priority: string) => number;
15
+ /**
16
+ * Sorts radiology investigations by priority: stat → routine
17
+ * Maintains stable sorting (preserves original order for same priority)
18
+ * @param investigations - Array of radiology investigations to sort
19
+ * @returns New sorted array (does not mutate original)
20
+ */
21
+ export declare const sortRadiologyInvestigationsByPriority: (investigations: RadiologyInvestigation[]) => RadiologyInvestigation[];
22
+ /**
23
+ * Filters out radiology investigations that have replacement relationships
24
+ * Removes both the replacing entry (has replaces field) and the replaced entries (referenced in replaces)
25
+ * This prevents duplicate entries from showing in the UI where one investigation replaces another
26
+ * @param investigations - Array of formatted radiology investigations
27
+ * @returns Filtered array without replacement-related entries
28
+ */
29
+ export declare const filterRadiologyInvestionsReplacementEntries: (investigations: RadiologyInvestigation[]) => RadiologyInvestigation[];
30
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/radiologyInvestigation/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAGvB,MAAM,kBAAkB,CAAC;AAE1B;;;;GAIG;AACH,eAAO,MAAM,cAAc,UAAsB,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAU,MAAM,KAAG,MAEvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC,GAChD,gBAAgB,sBAAsB,EAAE,KACvC,sBAAsB,EAIxB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,2CAA2C,GACtD,gBAAgB,sBAAsB,EAAE,KACvC,sBAAsB,EAMxB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { PatientSearchResultBundle } from '@bahmni/services';
2
+ interface SearchPatientProps {
3
+ buttonTitle: string;
4
+ searchBarPlaceholder: string;
5
+ onSearch: (data: PatientSearchResultBundle | undefined, searchTerm: string, isLoading: boolean, isError: boolean, isAdvancedSearch: boolean, selectedFieldType?: string) => void;
6
+ }
7
+ declare const SearchPatient: React.FC<SearchPatientProps>;
8
+ export default SearchPatient;
9
+ //# sourceMappingURL=SearchPatient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchPatient.d.ts","sourceRoot":"","sources":["../../src/searchPatient/SearchPatient.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EAI1B,MAAM,kBAAkB,CAAC;AAQ1B,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,CACR,IAAI,EAAE,yBAAyB,GAAG,SAAS,EAC3C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,OAAO,EACzB,iBAAiB,CAAC,EAAE,MAAM,KACvB,IAAI,CAAC;CACX;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA0V/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { PatientSearchResultBundle, PatientSearchField } from '@bahmni/services';
2
+ /**
3
+ * Type definition for different patient search types
4
+ */
5
+ export type PatientSearchType = 'nameOrId' | 'attributes' | 'appointment';
6
+ /**
7
+ * Context object passed to search strategies containing necessary information
8
+ * for executing searches
9
+ */
10
+ export interface SearchContext {
11
+ selectedField?: PatientSearchField;
12
+ searchFields: PatientSearchField[];
13
+ translator: (key: string, params?: any) => string;
14
+ }
15
+ /**
16
+ * Result of input validation
17
+ */
18
+ export interface ValidationResult {
19
+ valid: boolean;
20
+ error?: string;
21
+ }
22
+ /**
23
+ * Base strategy interface that all search strategies must implement.
24
+ * This follows the Strategy Pattern to encapsulate different search algorithms.
25
+ *
26
+ * @template T - The type of search result (e.g., PatientSearchResult, AppointmentSearchResult)
27
+ */
28
+ export interface SearchStrategy {
29
+ /**
30
+ * Unique identifier for this search strategy
31
+ */
32
+ readonly type: PatientSearchType;
33
+ /**
34
+ * Execute the search operation
35
+ * @param searchTerm - The search term entered by the user
36
+ * @param context - Context containing search configuration and utilities
37
+ * @returns Promise resolving to search results
38
+ */
39
+ execute(searchTerm: string, context: SearchContext): Promise<PatientSearchResultBundle>;
40
+ /**
41
+ * Optional: Validate the search input before executing the search
42
+ * @param input - The input to validate
43
+ * @param context - Context for validation
44
+ * @returns Validation result indicating if input is valid
45
+ */
46
+ validate?(input: string, context: SearchContext): ValidationResult;
47
+ /**
48
+ * Optional: Format/transform the input before searching
49
+ * @param input - The input to format
50
+ * @param context - Context for formatting
51
+ * @returns Formatted input string
52
+ */
53
+ formatInput?(input: string, context: SearchContext): string;
54
+ /**
55
+ * Optional: Transform/post-process the search results
56
+ * @param results - The raw search results
57
+ * @returns Transformed search results
58
+ */
59
+ transformResults?(results: PatientSearchResultBundle): PatientSearchResultBundle;
60
+ }
61
+ //# sourceMappingURL=SearchStrategy.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchStrategy.interface.d.ts","sourceRoot":"","sources":["../../src/searchPatient/SearchStrategy.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,YAAY,EAAE,kBAAkB,EAAE,CAAC;IAEnC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IAEjC;;;;;OAKG;IACH,OAAO,CACL,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,gBAAgB,CAAC;IAEnE;;;;;OAKG;IACH,WAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAAC;IAE5D;;;;OAIG;IACH,gBAAgB,CAAC,CACf,OAAO,EAAE,yBAAyB,GACjC,yBAAyB,CAAC;CAC9B"}
@@ -0,0 +1,2 @@
1
+ export { default as SearchPatient } from './SearchPatient';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/searchPatient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { PatientSearchResultBundle } from '@bahmni/services';
2
+ import { SearchStrategy, SearchContext, ValidationResult } from '../SearchStrategy.interface';
3
+ /**
4
+ * Strategy for searching patients by appointment attributes
5
+ */
6
+ export declare class AppointmentSearchStrategy implements SearchStrategy {
7
+ readonly type: "appointment";
8
+ /**
9
+ * Execute appointment search
10
+ */
11
+ execute(searchTerm: string, context: SearchContext): Promise<PatientSearchResultBundle>;
12
+ /**
13
+ * Validate appointment search input
14
+ */
15
+ validate(input: string): ValidationResult;
16
+ /**
17
+ * Format the input by trimming whitespace
18
+ */
19
+ formatInput(input: string): string;
20
+ /**
21
+ * Build the search request with appointment number and date range
22
+ */
23
+ private buildSearchRequest;
24
+ /**
25
+ * Transform appointments to patient search result bundle
26
+ */
27
+ private transformAppointmentsToPatientBundle;
28
+ /**
29
+ * Transform a single appointment to a search result
30
+ */
31
+ private transformAppointmentToSearchResult;
32
+ /**
33
+ * Extract and format appointment reasons
34
+ */
35
+ private getAppointmentReasons;
36
+ }
37
+ //# sourceMappingURL=AppointmentSearchStrategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppointmentSearchStrategy.d.ts","sourceRoot":"","sources":["../../../src/searchPatient/strategies/AppointmentSearchStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAErC;;GAEG;AACH,qBAAa,yBAA0B,YAAW,cAAc;IAC9D,QAAQ,CAAC,IAAI,EAAG,aAAa,CAAU;IAEvC;;OAEG;IACG,OAAO,CACX,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,yBAAyB,CAAC;IAUrC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB;IAOzC;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIlC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAoB1B;;OAEG;IACH,OAAO,CAAC,oCAAoC;IAS5C;;OAEG;IACH,OAAO,CAAC,kCAAkC,CA4BvC;IAEH;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAS9B"}
@@ -0,0 +1,40 @@
1
+ import { PatientSearchResultBundle } from '@bahmni/services';
2
+ import { SearchStrategy, SearchContext, ValidationResult } from '../SearchStrategy.interface';
3
+ /**
4
+ * Strategy for searching patients by custom attributes (e.g., phone number)
5
+ */
6
+ export declare class AttributeSearchStrategy implements SearchStrategy {
7
+ readonly type: "attributes";
8
+ /**
9
+ * Execute custom attribute search
10
+ */
11
+ execute(searchTerm: string, context: SearchContext): Promise<PatientSearchResultBundle>;
12
+ /**
13
+ * Validate custom attribute search input
14
+ * Includes special validation for phone numbers
15
+ */
16
+ validate(input: string, context: SearchContext): ValidationResult;
17
+ /**
18
+ * Format the input
19
+ * Includes special formatting for phone numbers
20
+ */
21
+ formatInput(input: string, context: SearchContext): string;
22
+ /**
23
+ * Transform results to format dates and calculate ages
24
+ */
25
+ transformResults(results: PatientSearchResultBundle): PatientSearchResultBundle;
26
+ /**
27
+ * Check if the current search is for phone numbers
28
+ */
29
+ private isPhoneSearch;
30
+ /**
31
+ * Validate phone number format
32
+ * Allows only digits and optional leading '+'
33
+ */
34
+ private validatePhoneNumber;
35
+ /**
36
+ * Format phone number to contain only digits and optional leading '+'
37
+ */
38
+ private formatPhoneNumber;
39
+ }
40
+ //# sourceMappingURL=AttributeSearchStrategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttributeSearchStrategy.d.ts","sourceRoot":"","sources":["../../../src/searchPatient/strategies/AttributeSearchStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EAG1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAErC;;GAEG;AACH,qBAAa,uBAAwB,YAAW,cAAc;IAC5D,QAAQ,CAAC,IAAI,EAAG,YAAY,CAAU;IAEtC;;OAEG;IACG,OAAO,CACX,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,yBAAyB,CAAC;IAgBrC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,gBAAgB;IAajE;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM;IAS1D;;OAEG;IACH,gBAAgB,CACd,OAAO,EAAE,yBAAyB,GACjC,yBAAyB;IAe5B;;OAEG;IACH,OAAO,CAAC,aAAa;IAQrB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAgB3B;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAK1B"}
@@ -0,0 +1,25 @@
1
+ import { PatientSearchResultBundle } from '@bahmni/services';
2
+ import { SearchStrategy, SearchContext, ValidationResult } from '../SearchStrategy.interface';
3
+ /**
4
+ * Strategy for searching patients by name or patient ID
5
+ */
6
+ export declare class NameOrIdSearchStrategy implements SearchStrategy {
7
+ readonly type: "nameOrId";
8
+ /**
9
+ * Execute name or ID search
10
+ */
11
+ execute(searchTerm: string, context: SearchContext): Promise<PatientSearchResultBundle>;
12
+ /**
13
+ * Validate name or ID search input
14
+ */
15
+ validate(input: string): ValidationResult;
16
+ /**
17
+ * Format the input by trimming whitespace
18
+ */
19
+ formatInput(input: string): string;
20
+ /**
21
+ * Transform results to format dates and calculate ages
22
+ */
23
+ transformResults(results: PatientSearchResultBundle): PatientSearchResultBundle;
24
+ }
25
+ //# sourceMappingURL=NameOrIdSearchStrategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NameOrIdSearchStrategy.d.ts","sourceRoot":"","sources":["../../../src/searchPatient/strategies/NameOrIdSearchStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EAG1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAErC;;GAEG;AACH,qBAAa,sBAAuB,YAAW,cAAc;IAC3D,QAAQ,CAAC,IAAI,EAAG,UAAU,CAAU;IAEpC;;OAEG;IACG,OAAO,CACX,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,yBAAyB,CAAC;IAKrC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB;IAOzC;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIlC;;OAEG;IACH,gBAAgB,CACd,OAAO,EAAE,yBAAyB,GACjC,yBAAyB;CAc7B"}
@@ -0,0 +1,37 @@
1
+ import { SearchStrategy, PatientSearchType } from '../SearchStrategy.interface';
2
+ /**
3
+ * Registry for managing patient search strategies.
4
+ * Implements the Strategy Pattern to allow dynamic selection of search algorithms.
5
+ */
6
+ export declare class SearchStrategyRegistry {
7
+ private strategies;
8
+ /**
9
+ * Register a search strategy
10
+ * @param strategy - The strategy to register
11
+ */
12
+ register(strategy: SearchStrategy): void;
13
+ /**
14
+ * Get a search strategy by type
15
+ * @param type - The type of search strategy to retrieve
16
+ * @returns The requested search strategy
17
+ * @throws Error if no strategy is registered for the given type
18
+ */
19
+ getStrategy(type: PatientSearchType): SearchStrategy;
20
+ /**
21
+ * Check if a strategy is registered for a given type
22
+ * @param type - The type to check
23
+ * @returns true if a strategy is registered, false otherwise
24
+ */
25
+ hasStrategy(type: PatientSearchType): boolean;
26
+ /**
27
+ * Get all registered strategy types
28
+ * @returns Array of registered strategy types
29
+ */
30
+ getRegisteredTypes(): PatientSearchType[];
31
+ }
32
+ /**
33
+ * Singleton instance of the search strategy registry with all strategies pre-registered
34
+ */
35
+ export declare const searchStrategyRegistry: SearchStrategyRegistry;
36
+ export default searchStrategyRegistry;
37
+ //# sourceMappingURL=SearchStrategyRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchStrategyRegistry.d.ts","sourceRoot":"","sources":["../../../src/searchPatient/strategies/SearchStrategyRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAKhF;;;GAGG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,UAAU,CAAgD;IAElE;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAIxC;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,cAAc;IAQpD;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO;IAI7C;;;OAGG;IACH,kBAAkB,IAAI,iBAAiB,EAAE;CAG1C;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,wBAA+B,CAAC;AAQnE,eAAe,sBAAsB,CAAC"}