Skip to content

Commit

Permalink
ensure patient summary populates data
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyjemutai committed Jun 14, 2024
1 parent 95d7f0a commit 0678bf9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { getObsFromEncounter, getConditionalConceptValue } from './encounter-list-utils';
import { extractSchemaValues, replaceWithConfigDefaults } from './schema-manipulation';

export const getSummaryCardProps = (schemaConfig) => {
const columns = schemaConfig.columns?.map((column) => ({
export const getSummaryCardProps = (schemaConfig, config = null) => {
const configDefaults = extractSchemaValues(config);
const transformedSchemaConfig = replaceWithConfigDefaults(schemaConfig, configDefaults);
const columns = transformedSchemaConfig.columns?.map((column) => ({
key: column.id,
header: column.title,
concept: column.concept,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const TBSummaryOverviewList: React.FC<OverviewListProps> = ({ patientUuid }) =>
const config = useConfig();
const previousCaseTabs = getMenuItemTabConfiguration(previousCasesConfigSchema, config);
const tbVisitsTabs = getMenuItemTabConfiguration(tbVisitsConfigSchema, config);
const summaryCardColumns = getSummaryCardProps(recentTuberculosisConfigSchema);
const summaryCardColumns = getSummaryCardProps(recentTuberculosisConfigSchema, config);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const TptPatientSummary: React.FC<OverviewListProps> = ({ patientUuid }) => {
const config = useConfig();
const previousCaseTabs = getMenuItemTabConfiguration(tptPreviousCasesConfigSchema, config);
const tbVisitsTabs = getMenuItemTabConfiguration(tptVisitsConfigSchema, config);
const summaryCardColumns = getSummaryCardProps(recentTptConfigSchema);
const summaryCardColumns = getSummaryCardProps(recentTptConfigSchema, config);

return (
<>
Expand Down

0 comments on commit 0678bf9

Please sign in to comment.