@bahmni/widgets 0.0.1-dev.100
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/LICENSE +9 -0
- package/README.md +5 -0
- package/dist/allergies/AllergiesTable.d.ts +8 -0
- package/dist/allergies/AllergiesTable.d.ts.map +1 -0
- package/dist/allergies/index.d.ts +2 -0
- package/dist/allergies/index.d.ts.map +1 -0
- package/dist/allergies/utils.d.ts +34 -0
- package/dist/allergies/utils.d.ts.map +1 -0
- package/dist/conditions/ConditionsTable.d.ts +8 -0
- package/dist/conditions/ConditionsTable.d.ts.map +1 -0
- package/dist/conditions/index.d.ts +2 -0
- package/dist/conditions/index.d.ts.map +1 -0
- package/dist/conditions/models.d.ts +22 -0
- package/dist/conditions/models.d.ts.map +1 -0
- package/dist/conditions/utils.d.ts +11 -0
- package/dist/conditions/utils.d.ts.map +1 -0
- package/dist/diagnoses/DiagnosesTable.d.ts +7 -0
- package/dist/diagnoses/DiagnosesTable.d.ts.map +1 -0
- package/dist/diagnoses/index.d.ts +2 -0
- package/dist/diagnoses/index.d.ts.map +1 -0
- package/dist/diagnoses/useDiagnoses.d.ts +14 -0
- package/dist/diagnoses/useDiagnoses.d.ts.map +1 -0
- package/dist/genericServiceRequest/GenericServiceRequestTable.d.ts +10 -0
- package/dist/genericServiceRequest/GenericServiceRequestTable.d.ts.map +1 -0
- package/dist/genericServiceRequest/index.d.ts +2 -0
- package/dist/genericServiceRequest/index.d.ts.map +1 -0
- package/dist/genericServiceRequest/models.d.ts +11 -0
- package/dist/genericServiceRequest/models.d.ts.map +1 -0
- package/dist/genericServiceRequest/utils.d.ts +37 -0
- package/dist/genericServiceRequest/utils.d.ts.map +1 -0
- package/dist/hooks/useActivePractitioner.d.ts +15 -0
- package/dist/hooks/useActivePractitioner.d.ts.map +1 -0
- package/dist/hooks/usePatientUUID.d.ts +6 -0
- package/dist/hooks/usePatientUUID.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75283 -0
- package/dist/labinvestigation/LabInvestigation.d.ts +5 -0
- package/dist/labinvestigation/LabInvestigation.d.ts.map +1 -0
- package/dist/labinvestigation/LabInvestigationItem.d.ts +8 -0
- package/dist/labinvestigation/LabInvestigationItem.d.ts.map +1 -0
- package/dist/labinvestigation/index.d.ts +2 -0
- package/dist/labinvestigation/index.d.ts.map +1 -0
- package/dist/medications/MedicationsTable.d.ts +4 -0
- package/dist/medications/MedicationsTable.d.ts.map +1 -0
- package/dist/medications/index.d.ts +2 -0
- package/dist/medications/index.d.ts.map +1 -0
- package/dist/medications/useMedicationRequest.d.ts +14 -0
- package/dist/medications/useMedicationRequest.d.ts.map +1 -0
- package/dist/medications/utils.d.ts +67 -0
- package/dist/medications/utils.d.ts.map +1 -0
- package/dist/notification/NotificationContext.d.ts +9 -0
- package/dist/notification/NotificationContext.d.ts.map +1 -0
- package/dist/notification/NotificationProvider.d.ts +7 -0
- package/dist/notification/NotificationProvider.d.ts.map +1 -0
- package/dist/notification/NotificationServiceComponent.d.ts +8 -0
- package/dist/notification/NotificationServiceComponent.d.ts.map +1 -0
- package/dist/notification/index.d.ts +5 -0
- package/dist/notification/index.d.ts.map +1 -0
- package/dist/notification/useNotification.d.ts +9 -0
- package/dist/notification/useNotification.d.ts.map +1 -0
- package/dist/patientDetails/PatientDetails.d.ts +4 -0
- package/dist/patientDetails/PatientDetails.d.ts.map +1 -0
- package/dist/patientDetails/index.d.ts +2 -0
- package/dist/patientDetails/index.d.ts.map +1 -0
- package/dist/patientDetails/usePatient.d.ts +14 -0
- package/dist/patientDetails/usePatient.d.ts.map +1 -0
- package/dist/patientPrograms/PatientProgramsTable.d.ts +13 -0
- package/dist/patientPrograms/PatientProgramsTable.d.ts.map +1 -0
- package/dist/patientPrograms/constants.d.ts +2 -0
- package/dist/patientPrograms/constants.d.ts.map +1 -0
- package/dist/patientPrograms/index.d.ts +2 -0
- package/dist/patientPrograms/index.d.ts.map +1 -0
- package/dist/patientPrograms/model.d.ts +15 -0
- package/dist/patientPrograms/model.d.ts.map +1 -0
- package/dist/patientPrograms/utils.d.ts +9 -0
- package/dist/patientPrograms/utils.d.ts.map +1 -0
- package/dist/radiologyInvestigation/RadiologyInvestigationTable.d.ts +10 -0
- package/dist/radiologyInvestigation/RadiologyInvestigationTable.d.ts.map +1 -0
- package/dist/radiologyInvestigation/__mocks__/mocks.d.ts +17 -0
- package/dist/radiologyInvestigation/__mocks__/mocks.d.ts.map +1 -0
- package/dist/radiologyInvestigation/index.d.ts +2 -0
- package/dist/radiologyInvestigation/index.d.ts.map +1 -0
- package/dist/radiologyInvestigation/models.d.ts +16 -0
- package/dist/radiologyInvestigation/models.d.ts.map +1 -0
- package/dist/radiologyInvestigation/utils.d.ts +38 -0
- package/dist/radiologyInvestigation/utils.d.ts.map +1 -0
- package/dist/registry/index.d.ts +10 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/model.d.ts +12 -0
- package/dist/registry/model.d.ts.map +1 -0
- package/dist/registry/widgetMap.d.ts +3 -0
- package/dist/registry/widgetMap.d.ts.map +1 -0
- package/dist/searchPatient/SearchPatient.d.ts +9 -0
- package/dist/searchPatient/SearchPatient.d.ts.map +1 -0
- package/dist/searchPatient/SearchStrategy.interface.d.ts +62 -0
- package/dist/searchPatient/SearchStrategy.interface.d.ts.map +1 -0
- package/dist/searchPatient/index.d.ts +2 -0
- package/dist/searchPatient/index.d.ts.map +1 -0
- package/dist/searchPatient/strategies/AppointmentSearchStrategy.d.ts +37 -0
- package/dist/searchPatient/strategies/AppointmentSearchStrategy.d.ts.map +1 -0
- package/dist/searchPatient/strategies/AttributeSearchStrategy.d.ts +40 -0
- package/dist/searchPatient/strategies/AttributeSearchStrategy.d.ts.map +1 -0
- package/dist/searchPatient/strategies/NameOrIdSearchStrategy.d.ts +29 -0
- package/dist/searchPatient/strategies/NameOrIdSearchStrategy.d.ts.map +1 -0
- package/dist/searchPatient/strategies/SearchStrategyRegistry.d.ts +37 -0
- package/dist/searchPatient/strategies/SearchStrategyRegistry.d.ts.map +1 -0
- package/dist/userPrivileges/UserPrivilegeContext.d.ts +11 -0
- package/dist/userPrivileges/UserPrivilegeContext.d.ts.map +1 -0
- package/dist/userPrivileges/UserPrivilegeProvider.d.ts +7 -0
- package/dist/userPrivileges/UserPrivilegeProvider.d.ts.map +1 -0
- package/dist/userPrivileges/useUserPrivilege.d.ts +3 -0
- package/dist/userPrivileges/useUserPrivilege.d.ts.map +1 -0
- package/dist/vitalFlowSheet/VitalFlowSheet.d.ts +12 -0
- package/dist/vitalFlowSheet/VitalFlowSheet.d.ts.map +1 -0
- package/dist/vitalFlowSheet/index.d.ts +3 -0
- package/dist/vitalFlowSheet/index.d.ts.map +1 -0
- package/dist/vitalFlowSheet/useVitalFlowSheet.d.ts +20 -0
- package/dist/vitalFlowSheet/useVitalFlowSheet.d.ts.map +1 -0
- package/dist/vitalFlowSheet/utils.d.ts +48 -0
- package/dist/vitalFlowSheet/utils.d.ts.map +1 -0
- package/package.json +43 -0
|
@@ -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, context: SearchContext): 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,EAClC,OAAO,EAAE,aAAa,GACrB,yBAAyB;IAkB5B;;OAEG;IACH,OAAO,CAAC,aAAa;IAQrB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAgB3B;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAK1B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
* Parse JSON string safely
|
|
22
|
+
*/
|
|
23
|
+
private parseJSON;
|
|
24
|
+
/**
|
|
25
|
+
* Transform results to format dates, calculate ages, and parse address/custom attributes
|
|
26
|
+
*/
|
|
27
|
+
transformResults(results: PatientSearchResultBundle, context: SearchContext): PatientSearchResultBundle;
|
|
28
|
+
}
|
|
29
|
+
//# 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;IAQrC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB;IAOzC;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIlC;;OAEG;IACH,OAAO,CAAC,SAAS;IAUjB;;OAEG;IACH,gBAAgB,CACd,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,aAAa,GACrB,yBAAyB;CAyB7B"}
|
|
@@ -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"}
|
|
@@ -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 @@
|
|
|
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,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface VitalFlowSheetConfig {
|
|
3
|
+
latestCount: number;
|
|
4
|
+
obsConcepts: string[];
|
|
5
|
+
groupBy?: string;
|
|
6
|
+
}
|
|
7
|
+
interface VitalFlowSheetProps {
|
|
8
|
+
config: VitalFlowSheetConfig;
|
|
9
|
+
}
|
|
10
|
+
declare const VitalFlowSheet: React.FC<VitalFlowSheetProps>;
|
|
11
|
+
export default VitalFlowSheet;
|
|
12
|
+
//# 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;AAavC,UAAU,oBAAoB;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,mBAAmB;IAC3B,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AA0BD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6NjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -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,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bahmni/widgets",
|
|
3
|
+
"version": "0.0.1-dev.100",
|
|
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
|
+
"@bahmni/design-system": "^0.0.1-0",
|
|
30
|
+
"@bahmni/services": "^0.0.1-0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": ">=18.0.0",
|
|
34
|
+
"react-dom": ">=18.0.0",
|
|
35
|
+
"@tanstack/react-query": "^5.85.5"
|
|
36
|
+
},
|
|
37
|
+
"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.",
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE"
|
|
42
|
+
]
|
|
43
|
+
}
|