-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial final summary view for mtb and rd
- Loading branch information
Showing
18 changed files
with
218 additions
and
212 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
packages/core/src/components/core/query/QuerySummaryDemographics.vue
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,56 @@ | ||
<script lang="ts"> | ||
import { type PropType, defineComponent } from 'vue'; | ||
import type { QuerySummaryDemographics } from '../../../domains'; | ||
import { DChartBar, DChartDoughnut } from '../../utility'; | ||
export default defineComponent({ | ||
components: { DChartDoughnut, DChartBar }, | ||
props: { | ||
entity: { | ||
type: Object as PropType<QuerySummaryDemographics>, | ||
required: true, | ||
}, | ||
}, | ||
}); | ||
</script> | ||
<template> | ||
<div> | ||
<h5>Allgemein</h5> | ||
<div class="row"> | ||
<div class="col-12 col-xl-4"> | ||
<div class="entity-card text-center mb-3 w-100"> | ||
<h6> | ||
Patienten pro Standort | ||
</h6> | ||
<DChartDoughnut | ||
style="max-height: 390px" | ||
:items="entity.siteDistribution" | ||
/> | ||
</div> | ||
</div> | ||
<div class="col-12 col-xl-4"> | ||
<div class="entity-card text-center mb-3 w-100"> | ||
<h6> | ||
Verteilung von Geschlechtern | ||
</h6> | ||
<DChartDoughnut | ||
style="max-height: 390px" | ||
:items="entity.genderDistribution" | ||
/> | ||
</div> | ||
</div> | ||
<div class="col-12 col-xl-4"> | ||
<div class="entity-card text-center mb-3 w-100"> | ||
<h6> | ||
Verteilung des Alters | ||
</h6> | ||
<DChartBar | ||
style="max-height: 390px" | ||
:items="entity.ageDistribution" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { default as DQuerySummaryGrouped } from './QuerySummaryGrouped.vue'; | ||
export { default as DQuerySummaryDemographics } from './QuerySummaryDemographics.vue'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import type { KeyValueRecord } from '../../../domains'; | ||
import { isCoding, isMinMaxRange } from '../../../domains'; | ||
import { stringToColor } from '../../../utils'; | ||
|
||
export function generateChartLabelsForKeyValueRecord( | ||
item: KeyValueRecord, | ||
) : string | undefined { | ||
if (isCoding(item.key)) { | ||
return item.key.display || item.key.code; | ||
} | ||
|
||
if (isMinMaxRange(item.key)) { | ||
return `${item.key.min}-${item.key.max}`; | ||
} | ||
|
||
if (Array.isArray(item.key)) { | ||
return `${item.key.join(', ')}`; | ||
} | ||
|
||
if (typeof item.key === 'string') { | ||
return item.key; | ||
} | ||
|
||
return undefined; | ||
} | ||
|
||
export function generateChartBackgroundColorForKeyValueRecord( | ||
item: KeyValueRecord, | ||
) : string | undefined { | ||
if (isCoding(item.key)) { | ||
return `${stringToColor(item.key.display || item.key.code)}`; | ||
} | ||
|
||
if (isMinMaxRange(item.key)) { | ||
return `${stringToColor(`${(item.key.min + item.key.max) * 10}`)}`; | ||
} | ||
|
||
if (Array.isArray(item.key)) { | ||
return `${stringToColor(item.key.join('+'))}`; | ||
} | ||
|
||
if (typeof item.key === 'string') { | ||
return stringToColor(item.key); | ||
} | ||
|
||
return undefined; | ||
} |
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.