-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
259faab
commit cab9b91
Showing
10 changed files
with
170 additions
and
101 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
.../esm-patient-chart-app/src/clinical-views/components/clinical-views-summary.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { useMemo } from 'react'; | ||
import { useConfig } from '@openmrs/esm-framework'; | ||
import { getEncounterTileColumns } from '../../encounter-tile/utils/encounter-tile-config-builder'; | ||
import { | ||
MemoizedEncounterTile, | ||
type EncounterTileColumn, | ||
} from '../../encounter-tile/components/encounter-tile.component'; | ||
|
||
interface OverviewListProps { | ||
patientUuid: string; | ||
} | ||
|
||
interface TileDefinition { | ||
title: string; | ||
columns: Array<EncounterTileColumn>; | ||
} | ||
|
||
const ClinicalViewsSummary: React.FC<OverviewListProps> = ({ patientUuid }) => { | ||
const config = useConfig(); | ||
const tilesDefinitions = config.tilesDefinitions; | ||
|
||
const tilesData = useMemo( | ||
() => | ||
tilesDefinitions?.map((tile: any) => ({ | ||
title: tile.tileHeader, | ||
columns: getEncounterTileColumns(tile), | ||
})), | ||
[tilesDefinitions], | ||
); | ||
|
||
return ( | ||
<> | ||
{tilesData?.length > 0 && | ||
tilesData?.map((tile, index) => ( | ||
<MemoizedEncounterTile | ||
key={index} | ||
patientUuid={patientUuid} | ||
columns={tile.columns} | ||
headerTitle={tile.title} | ||
/> | ||
))} | ||
</> | ||
); | ||
}; | ||
|
||
export default ClinicalViewsSummary; |
34 changes: 0 additions & 34 deletions
34
...esm-patient-chart-app/src/clinical-views/components/patient-program-summary.component.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.