@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,11 @@
1
+ import { UserPrivilege } from '@bahmni/services';
2
+ export interface UserPrivilegeContextType {
3
+ userPrivileges: UserPrivilege[] | null;
4
+ setUserPrivileges: (privileges: UserPrivilege[] | null) => void;
5
+ isLoading: boolean;
6
+ setIsLoading: (loading: boolean) => void;
7
+ error: Error | null;
8
+ setError: (error: Error | null) => void;
9
+ }
10
+ export declare const UserPrivilegeContext: import('react').Context<UserPrivilegeContextType | undefined>;
11
+ //# sourceMappingURL=UserPrivilegeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserPrivilegeContext.d.ts","sourceRoot":"","sources":["../../src/userPrivileges/UserPrivilegeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IACvC,iBAAiB,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IAChE,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,oBAAoB,+DAErB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ interface UserPrivilegeProviderProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare const UserPrivilegeProvider: React.FC<UserPrivilegeProviderProps>;
6
+ export {};
7
+ //# sourceMappingURL=UserPrivilegeProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserPrivilegeProvider.d.ts","sourceRoot":"","sources":["../../src/userPrivileges/UserPrivilegeProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAgC,MAAM,OAAO,CAAC;AAGvE,UAAU,0BAA0B;IAClC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA4CtE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { UserPrivilegeContextType } from './UserPrivilegeContext';
2
+ export declare const useUserPrivilege: () => UserPrivilegeContextType;
3
+ //# sourceMappingURL=useUserPrivilege.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUserPrivilege.d.ts","sourceRoot":"","sources":["../../src/userPrivileges/useUserPrivilege.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,gBAAgB,QAAO,wBAUnC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ interface VitalFlowSheetProps {
3
+ latestCount: number;
4
+ obsConcepts: string[];
5
+ groupBy?: string;
6
+ }
7
+ declare const VitalFlowSheet: React.FC<VitalFlowSheetProps>;
8
+ export default VitalFlowSheet;
9
+ //# sourceMappingURL=VitalFlowSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VitalFlowSheet.d.ts","sourceRoot":"","sources":["../../src/vitalFlowSheet/VitalFlowSheet.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAYvC,UAAU,mBAAmB;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA0BD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+NjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as VitalFlowSheet } from './VitalFlowSheet';
2
+ export { useVitalFlowSheet } from './useVitalFlowSheet';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vitalFlowSheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { VitalFlowSheetData } from '@bahmni/services';
2
+ interface UseVitalFlowSheetParams {
3
+ latestCount: number;
4
+ obsConcepts: string[];
5
+ groupBy: string;
6
+ }
7
+ interface UseVitalFlowSheetResult {
8
+ data: VitalFlowSheetData | null;
9
+ loading: boolean;
10
+ error: Error | null;
11
+ refetch: () => void;
12
+ }
13
+ /**
14
+ * Custom hook to fetch and manage vital flow sheet data
15
+ * @param params - Parameters for fetching vital flow sheet data
16
+ * @returns Object containing data, loading state, error state, and refetch function
17
+ */
18
+ export declare const useVitalFlowSheet: (params: UseVitalFlowSheetParams) => UseVitalFlowSheetResult;
19
+ export {};
20
+ //# sourceMappingURL=useVitalFlowSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVitalFlowSheet.d.ts","sourceRoot":"","sources":["../../src/vitalFlowSheet/useVitalFlowSheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AAK1B,UAAU,uBAAuB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,uBAAuB;IAC/B,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,uBAAuB,KAC9B,uBAiEF,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { VitalFlowSheetConceptDetail, VitalFlowSheetData } from '@bahmni/services';
2
+ export declare const getSortedObservationTimes: (vitalsData: VitalFlowSheetData | null | undefined) => string[];
3
+ export declare const getTranslatedConceptName: (conceptName: string) => string;
4
+ export declare const translateBodyPosition: (position: string) => string;
5
+ interface FlowSheetRow {
6
+ id: string;
7
+ vitalSign: string;
8
+ units?: string;
9
+ conceptDetail?: VitalFlowSheetConceptDetail;
10
+ type: 'group' | 'concept';
11
+ groupName?: string;
12
+ isSubRow?: boolean;
13
+ parentGroupId?: string;
14
+ [key: string]: unknown;
15
+ }
16
+ export declare const categorizeConceptsIntoGroups: (conceptDetails: VitalFlowSheetConceptDetail[]) => {
17
+ groupedConcepts: Map<string, VitalFlowSheetConceptDetail[]>;
18
+ ungroupedConcepts: VitalFlowSheetConceptDetail[];
19
+ };
20
+ export declare const createGroupRows: (groupedConcepts: Map<string, VitalFlowSheetConceptDetail[]>, obsTimeKeys: string[], vitalsData: VitalFlowSheetData, t: (key: string) => string) => FlowSheetRow[];
21
+ export declare const createConceptRows: (ungroupedConcepts: VitalFlowSheetConceptDetail[], obsTimeKeys: string[], vitalsData: VitalFlowSheetData) => FlowSheetRow[];
22
+ export declare const CONCEPT_GROUPS: {
23
+ 'blood-pressure': {
24
+ nameKey: string;
25
+ units: string;
26
+ concepts: string[];
27
+ combineDisplay: (values: Record<string, {
28
+ value: string;
29
+ abnormal: boolean;
30
+ } | null>, conceptDetails?: VitalFlowSheetConceptDetail[]) => {
31
+ value: string;
32
+ abnormal: boolean;
33
+ complexData: {
34
+ systolic: {
35
+ value: string;
36
+ abnormal: boolean | undefined;
37
+ };
38
+ diastolic: {
39
+ value: string;
40
+ abnormal: boolean | undefined;
41
+ };
42
+ position: string;
43
+ };
44
+ };
45
+ };
46
+ };
47
+ export {};
48
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/vitalFlowSheet/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,yBAAyB,GACpC,YAAY,kBAAkB,GAAG,IAAI,GAAG,SAAS,KAChD,MAAM,EAOR,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,aAAa,MAAM,KAAG,MAmB9D,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,KAAG,MAiBxD,CAAC;AAGF,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,4BAA4B,GACvC,gBAAgB,2BAA2B,EAAE;;;CAyB9C,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,iBAAiB,GAAG,CAAC,MAAM,EAAE,2BAA2B,EAAE,CAAC,EAC3D,aAAa,MAAM,EAAE,EACrB,YAAY,kBAAkB,EAC9B,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACzB,YAAY,EAwCd,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,mBAAmB,2BAA2B,EAAE,EAChD,aAAa,MAAM,EAAE,EACrB,YAAY,kBAAkB,KAC7B,YAAY,EAwBd,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;iCAMb,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAE,GAAG,IAAI,CAAC,mBAClD,2BAA2B,EAAE;;;;;;;;;;;;;;;;CAyCnD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@bahmni/widgets",
3
+ "version": "0.0.1-dev.4",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./styles": "./dist/index.css"
16
+ },
17
+ "author": "Thoughtworks Inc.",
18
+ "license": "MPLv2",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/Bahmni/bahmni-apps-frontend.git",
22
+ "directory": "bahmni-apps-frontend/packages/bahmni-widgets"
23
+ },
24
+ "scripts": {
25
+ "build": "vite build",
26
+ "prepublishOnly": "yarn run build"
27
+ },
28
+ "dependencies": {
29
+ "@carbon/react": "^1.70.0",
30
+ "classnames": "^2.3.0",
31
+ "date-fns": "^4.1.0",
32
+ "@types/fhir": "^0.0.41",
33
+ "react-router-dom": "^7.5.3",
34
+ "react-i18next": "^13.0.0",
35
+ "i18next": "^23.0.0",
36
+ "@bahmni/design-system": "^0.0.1-0",
37
+ "@bahmni/services": "^0.0.1-0"
38
+ },
39
+ "peerDependencies": {
40
+ "react": ">=18.0.0",
41
+ "react-dom": ">=18.0.0",
42
+ "@tanstack/react-query": "^5.85.5"
43
+ },
44
+ "description": "Reusable React display controls and components extracted for sharing across Bahmni modules. Includes common clinical widgets and notification provider to avoid duplication across different Bahmni applications.",
45
+ "files": [
46
+ "dist",
47
+ "README.md",
48
+ "LICENSE"
49
+ ]
50
+ }