adding groupsummary

This commit is contained in:
Jason Kulatunga 2023-10-13 20:19:07 -07:00
parent 1008b31ef6
commit 8c54c9f6c9
No known key found for this signature in database
11 changed files with 297 additions and 141 deletions

View File

@ -20,150 +20,20 @@
<div class="table-responsive">
<table class="table mg-b-0">
<tbody>
<tr>
<tr *ngFor="let groupInfo of groupLookup">
<td>
<div class="az-img-user"><img src="assets/icons/allergies.svg" alt=""></div>
<div class="az-img-user"><img src="assets/icons/{{groupInfo.imageName}}.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Allergies</h6>
<h6 class="mg-b-0 tx-inverse">{{groupInfo.displayName}}</h6>
<small class="tx-11 tx-gray-500" *ngIf="groupInfo.includedResourceTypes.length > 1">
<span *ngFor="let resourceTypes of groupInfo.includedResourceTypes">
{{resourceTypes}}<br/>
</span>
</small>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">7</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/clinicalnotes.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Clinical Notes</h6>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">85</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/careplans.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Care Plans</h6>
<small class="tx-11 tx-gray-500">Appointments<br/>Medical Conditions<br/>Health Goals<br/>Orders</small>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">83</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/careteam.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Care Team</h6>
<small class="tx-11 tx-gray-500">Primary Care Provider<br/>Provider Details</small>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">8</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/demographics.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Demographic Information</h6>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">3</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/labresults.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Lab Results</h6>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">3</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/healthgoals.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Health Goals</h6>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">2</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/conditions.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Health Issues</h6>
<small class="tx-11 tx-gray-500">Conditions</small>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">6</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/immunizations.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Immunizations</h6>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">9</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/implants.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Implants</h6>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">22</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/medications.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Medications</h6>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">22</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>
<tr>
<td>
<div class="az-img-user"><img src="assets/icons/procedures.svg" alt=""></div>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">Procedures</h6>
</td>
<td>
<h6 class="mg-b-0 tx-inverse">22</h6>
<h6 class="mg-b-0 tx-inverse">{{groupInfo.count}}</h6>
<small class="tx-11 tx-gray-500">Records</small>
</td>
</tr>

View File

@ -6,6 +6,16 @@ import {LoadingWidgetComponent} from '../loading-widget/loading-widget.component
import {EmptyWidgetComponent} from '../empty-widget/empty-widget.component';
import {DashboardWidgetComponent} from '../dashboard-widget/dashboard-widget.component';
import {DashboardWidgetConfig} from '../../models/widget/dashboard-widget-config';
import {Summary} from '../../models/fasten/summary';
class GroupedSummary {
displayName: string
imageName: string
resourceTypes: string[]
includedResourceTypes: string[] = []
count: number = 0
}
@Component({
standalone: true,
@ -18,6 +28,130 @@ export class RecordsSummaryWidgetComponent extends DashboardWidgetComponent impl
// constructor() { }
summary: Summary
groupLookup: GroupedSummary[] = [
{
displayName: 'Allergies',
imageName: 'allergies',
resourceTypes: ['AllergyIntolerance', 'AdverseEvent'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Care Team',
imageName: 'care-team',
resourceTypes: ['CareTeam', 'Practitioner', 'Patient', 'RelatedPerson', 'PractitionerRole'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Clinical Notes',
imageName: 'clinical-notes',
resourceTypes: ['DocumentReference', 'DiagnosticReport'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Files',
imageName: 'files',
resourceTypes: ['Binary', 'Media'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Lab Results',
imageName: 'lab-results',
resourceTypes: ['Observation', 'Specimen'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Health Issues',
imageName: 'health-issues',
resourceTypes: ['Conditions', 'Encounters'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Facilities',
imageName: 'facilities',
resourceTypes: ['Organization', 'Location'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Health Goals',
imageName: 'health-goals',
resourceTypes: ['Goal'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Health Insurance',
imageName: 'health-insurance',
resourceTypes: ['Coverage', 'ExplanationOfBenefit', 'Claim'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Health Assessments',
imageName: 'health-assessments',
resourceTypes: ['QuestionnaireResponse','Questionnaire', 'CarePlan', 'FamilyMemberHistory'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Immunizations',
imageName: 'immunizations',
resourceTypes: ['Immunization'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Implants',
imageName: 'implants',
resourceTypes: ['Device'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Medications',
imageName: 'medications',
resourceTypes: ['Medication', 'MedicationRequest', 'MedicationStatement', 'MedicationAdministration', 'MedicationDispense'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Demographics',
imageName: 'demographics',
resourceTypes: ['Patient'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Procedures',
imageName: 'procedures',
resourceTypes: ['Procedure','ServiceRequest'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Provenance',
imageName: 'provenance',
resourceTypes: ['Provenance'],
includedResourceTypes:[],
count: 0
},
{
displayName: 'Appointments',
imageName: 'appointments',
resourceTypes: ['Appointment', 'Schedule', 'Slot'],
includedResourceTypes:[],
count: 0
}
]
ngOnInit(): void {
//manually define the widget config, rather than pull from the configuration file
this.widgetConfig = {
@ -27,12 +161,47 @@ export class RecordsSummaryWidgetComponent extends DashboardWidgetComponent impl
width: 4,
height: 5,
title_text: 'Medical Records',
queries: []
queries: [
]
} as DashboardWidgetConfig
super.ngOnInit();
this.loading = true
this.isEmpty = true
this.fastenApi.getSummary().subscribe((summary: Summary) => {
this.summary = summary
for(let resourceTypeCount of summary.resource_type_counts){
let foundGroup = false
for(let groupKey in this.groupLookup){
let group = this.groupLookup[groupKey]
if(group.resourceTypes.indexOf(resourceTypeCount.resource_type) > -1){
foundGroup = true
this.groupLookup[groupKey].count += resourceTypeCount.count
this.groupLookup[groupKey].includedResourceTypes.push(resourceTypeCount.resource_type)
}
}
if(!foundGroup){
console.log('no group found for ' + resourceTypeCount.resource_type)
this.groupLookup[resourceTypeCount.resource_type] = {
displayName: resourceTypeCount.resource_type,
resourceTypes: [resourceTypeCount.resource_type],
count: resourceTypeCount.count
}
}
}
//filter any groups with 0 counts
this.groupLookup = this.groupLookup.filter((group) => {
return group.count > 0
})
})
//call Summary endpoint
this.loading = false
this.isEmpty = false
}
}

View File

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 891 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,38 @@
<svg id="Icon" xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
<defs>
<style>
.cls-1 {
fill: #706e85;
}
.cls-2 {
fill: #c0c7d2;
}
</style>
</defs>
<rect class="cls-1" x="4" y="57" width="56" height="3" rx="1.38"/>
<path class="cls-2" d="M16.65,8.73H47.35A4.65,4.65,0,0,1,52,13.38V57a0,0,0,0,1,0,0H12a0,0,0,0,1,0,0V13.38A4.65,4.65,0,0,1,16.65,8.73Z"/>
<g>
<rect class="cls-1" x="16.55" y="22.66" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="16.55" y="31.31" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="16.55" y="39.97" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="25.57" y="22.66" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="25.57" y="31.31" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="25.57" y="39.97" width="4.88" height="5.77" rx="0.65"/>
</g>
<g>
<rect class="cls-1" x="34.55" y="22.66" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="34.55" y="31.31" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="34.55" y="39.97" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="43.57" y="22.66" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="43.57" y="31.31" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="43.57" y="39.97" width="4.88" height="5.77" rx="0.65"/>
</g>
<rect class="cls-1" x="34.55" y="14.14" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="26" y="49" width="13" height="7" rx="1.17"/>
<rect class="cls-1" x="43.57" y="14.14" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="16.55" y="14.14" width="4.88" height="5.77" rx="0.65"/>
<rect class="cls-1" x="25.57" y="14.14" width="4.88" height="5.77" rx="0.65"/>
<path class="cls-2" d="M21.87,5.89H44.13a.87.87,0,0,1,.87.87v2a0,0,0,0,1,0,0H21a0,0,0,0,1,0,0v-2A.87.87,0,0,1,21.87,5.89Z"/>
<path class="cls-2" d="M25.58,4H40.42a.58.58,0,0,1,.58.58V5.89a0,0,0,0,1,0,0H25a0,0,0,0,1,0,0V4.58A.58.58,0,0,1,25.58,4Z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,48 @@
<svg id="Icon" xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
<defs>
<style>
.cls-1 {
fill: #ffd67b;
}
.cls-2 {
fill: #fdba19;
}
.cls-3 {
fill: #fffbd5;
}
.cls-4 {
fill: #243147;
}
.cls-5 {
fill: #1eb37a;
}
.cls-6 {
fill: #14866d;
}
.cls-7 {
fill: #c0c7d2;
}
</style>
</defs>
<g>
<g>
<path class="cls-1" d="M11,10H41a7,7,0,0,1,7,7V49a7,7,0,0,1-7,7H16L4,44V17A7,7,0,0,1,11,10Z"/>
<path class="cls-2" d="M10.82,44H4L16,56V49.18A5.18,5.18,0,0,0,10.82,44Z"/>
<rect class="cls-3" x="9" y="17" width="27" height="3" transform="translate(45 37) rotate(-180)"/>
<rect class="cls-3" x="9" y="22" width="17" height="3" transform="translate(35 47) rotate(-180)"/>
<rect class="cls-3" x="9" y="28" width="11" height="3" transform="translate(29 59) rotate(-180)"/>
</g>
<g>
<path class="cls-4" d="M24.35,40.66h2.24a0,0,0,0,1,0,0v5.6a1.12,1.12,0,0,1-1.12,1.12h0a1.12,1.12,0,0,1-1.12-1.12v-5.6a0,0,0,0,1,0,0Z" transform="translate(38.59 -5.12) rotate(45)"/>
<path class="cls-5" d="M57.17,18.67,32.6,43.23a4.47,4.47,0,0,1-6.33,0h0a4.48,4.48,0,0,1,0-6.34L50.83,12.33Z"/>
<path class="cls-6" d="M58,11.54a4.48,4.48,0,0,0-6.34,0l-2.18,2.18,6.34,6.34L58,17.88A4.48,4.48,0,0,0,58,11.54Z"/>
<path class="cls-7" d="M59.27,21.42l-8.75-8.76-1.75,1.76,8.75,8.75L47.89,32.8a1.24,1.24,0,0,0,1.75,1.75l9.63-9.63h0a2.47,2.47,0,0,0,0-3.5Z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,31 @@
<svg id="Icon" xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
<defs>
<style>
.cls-1 {
fill: #de9c76;
}
.cls-2 {
fill: #f8f9fb;
}
.cls-3 {
fill: #9eacc3;
}
.cls-4 {
fill: #c0c7d2;
}
</style>
</defs>
<rect class="cls-1" x="10" y="6" width="44" height="52" rx="3.44"/>
<g>
<rect class="cls-1" x="10" y="6" width="44" height="52" rx="7"/>
<rect class="cls-2" x="15" y="9" width="34" height="45" rx="2.07"/>
<path class="cls-3" d="M21.75,6h20.5a0,0,0,0,1,0,0V9.2a1.92,1.92,0,0,1-1.92,1.92H23.67A1.92,1.92,0,0,1,21.75,9.2V6A0,0,0,0,1,21.75,6Z"/>
</g>
<rect class="cls-4" x="20" y="18" width="25" height="3"/>
<rect class="cls-4" x="20" y="24" width="25" height="3"/>
<rect class="cls-4" x="20" y="30" width="25" height="3"/>
<rect class="cls-4" x="20" y="36" width="25" height="3"/>
</svg>

After

Width:  |  Height:  |  Size: 937 B

View File

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 891 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 950 B

After

Width:  |  Height:  |  Size: 950 B