From 54016c0168cd0436858dd5acd5200fc12794fce5 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sat, 17 Sep 2022 09:07:49 -0700 Subject: [PATCH] added more components. --- .../list-device.component.ts | 16 +++++ .../list-diagnostic-report.component.ts | 16 +++++ .../list-goal.component.ts | 15 +++++ .../resource-list/resource-list.component.ts | 12 ++++ frontend/src/app/components/shared.module.ts | 63 +++++++++++-------- 5 files changed, 95 insertions(+), 27 deletions(-) create mode 100644 frontend/src/app/components/list-generic-resource/list-device.component.ts create mode 100644 frontend/src/app/components/list-generic-resource/list-diagnostic-report.component.ts create mode 100644 frontend/src/app/components/list-generic-resource/list-goal.component.ts diff --git a/frontend/src/app/components/list-generic-resource/list-device.component.ts b/frontend/src/app/components/list-generic-resource/list-device.component.ts new file mode 100644 index 00000000..42bcd6cc --- /dev/null +++ b/frontend/src/app/components/list-generic-resource/list-device.component.ts @@ -0,0 +1,16 @@ +import {Component} from '@angular/core'; +import {GenericColumnDefn, ListGenericResourceComponent} from './list-generic-resource.component'; +import {attributeXTime} from './utils'; + +@Component({ + selector: 'app-list-device', + templateUrl: './list-generic-resource.component.html', + styleUrls: ['./list-generic-resource.component.scss'] +}) +export class ListDeviceComponent extends ListGenericResourceComponent { + columnDefinitions: GenericColumnDefn[] = [ + { title: 'Device', versions: '*', getter: d => d.model }, + { title: 'Type', versions: '*', format: 'date', getter: d => d.type.coding[0] }, + { title: 'Unique ID', versions: '*', getter: d => d.udi?.name || d.udiCarrier?.deviceIdentifier }, + ] +} diff --git a/frontend/src/app/components/list-generic-resource/list-diagnostic-report.component.ts b/frontend/src/app/components/list-generic-resource/list-diagnostic-report.component.ts new file mode 100644 index 00000000..94c80d1b --- /dev/null +++ b/frontend/src/app/components/list-generic-resource/list-diagnostic-report.component.ts @@ -0,0 +1,16 @@ +import {Component} from '@angular/core'; +import {GenericColumnDefn, ListGenericResourceComponent} from './list-generic-resource.component'; +import {attributeXTime} from './utils'; + +@Component({ + selector: 'app-list-diagnostic-report', + templateUrl: './list-generic-resource.component.html', + styleUrls: ['./list-generic-resource.component.scss'] +}) +export class ListDiagnosticReportComponent extends ListGenericResourceComponent { + columnDefinitions: GenericColumnDefn[] = [ + { title: 'Code', versions: '*', format: 'code', getter: d => d.code.coding[0] }, + { title: 'Issued', versions: '*', format: 'date', getter: d => d.issued }, + { title: 'Performer', versions: '*', getter: d => d.performer.display }, + ] +} diff --git a/frontend/src/app/components/list-generic-resource/list-goal.component.ts b/frontend/src/app/components/list-generic-resource/list-goal.component.ts new file mode 100644 index 00000000..fa67abad --- /dev/null +++ b/frontend/src/app/components/list-generic-resource/list-goal.component.ts @@ -0,0 +1,15 @@ +import {Component, OnChanges, OnInit} from '@angular/core'; +import {GenericColumnDefn, ListGenericResourceComponent, ResourceListComponentInterface} from './list-generic-resource.component'; + +@Component({ + selector: 'app-list-goal', + templateUrl: './list-generic-resource.component.html', + styleUrls: ['./list-generic-resource.component.scss'] +}) +export class ListGoalComponent extends ListGenericResourceComponent { + columnDefinitions: GenericColumnDefn[] = [ + { title: 'Description', versions: '*', getter: e => e.description.text }, + { title: 'Status', versions: '*', getter: e => e.lifecycleStatus }, + { title: 'Status Reason', versions: '*', getter: e => e.statusReason }, + ] +} diff --git a/frontend/src/app/components/resource-list/resource-list.component.ts b/frontend/src/app/components/resource-list/resource-list.component.ts index 524c04d5..506c6a0b 100644 --- a/frontend/src/app/components/resource-list/resource-list.component.ts +++ b/frontend/src/app/components/resource-list/resource-list.component.ts @@ -26,6 +26,9 @@ import {ListCarePlanComponent} from '../list-generic-resource/list-care-plan.com import {ListAllergyIntoleranceComponent} from '../list-generic-resource/list-allergy-intolerance.component'; import {ResourceListOutletDirective} from './resource-list-outlet.directive'; import {ListAppointmentComponent} from '../list-generic-resource/list-appointment.component'; +import {ListDeviceComponent} from '../list-generic-resource/list-device.component'; +import {ListDiagnosticReportComponent} from '../list-generic-resource/list-diagnostic-report.component'; +import {ListGoalComponent} from '../list-generic-resource/list-goal.component'; @Component({ selector: 'source-resource-list', @@ -110,15 +113,24 @@ export class ResourceListComponent implements OnInit, OnChanges { case "Coverage": { return ListCoverageComponent; } + case "Device": { + return ListDeviceComponent; + } case "DeviceRequest": { return ListDeviceRequestComponent; } + case "DiagnosticReport": { + return ListDiagnosticReportComponent; + } case "DocumentReference": { return ListDocumentReferenceComponent; } case "Encounter": { return ListEncounterComponent; } + case "Goal": { + return ListGoalComponent; + } case "Immunization": { return ListImmunizationComponent; } diff --git a/frontend/src/app/components/shared.module.ts b/frontend/src/app/components/shared.module.ts index 0020245a..659090cf 100644 --- a/frontend/src/app/components/shared.module.ts +++ b/frontend/src/app/components/shared.module.ts @@ -27,6 +27,9 @@ import {ListCarePlanComponent} from './list-generic-resource/list-care-plan.comp import {ListAllergyIntoleranceComponent} from './list-generic-resource/list-allergy-intolerance.component'; import {ResourceListOutletDirective} from './resource-list/resource-list-outlet.directive'; import {ListAppointmentComponent} from './list-generic-resource/list-appointment.component'; +import {ListDeviceComponent} from './list-generic-resource/list-device.component'; +import {ListDiagnosticReportComponent} from './list-generic-resource/list-diagnostic-report.component'; +import {ListGoalComponent} from './list-generic-resource/list-goal.component'; @NgModule({ imports: [ @@ -58,36 +61,42 @@ import {ListAppointmentComponent} from './list-generic-resource/list-appointment ListServiceRequestComponent, ListDocumentReferenceComponent, ListAppointmentComponent, + ListDeviceComponent, + ListDiagnosticReportComponent, + ListGoalComponent, ResourceListComponent, ResourceListOutletDirective, ], - exports: [ - ComponentsSidebarComponent, - ListAllergyIntoleranceComponent, - ListAdverseEventComponent, - ListCarePlanComponent, - ListCommunicationComponent, - ListConditionComponent, - ListEncounterComponent, - ListAppointmentComponent, - ListGenericResourceComponent, - ListImmunizationComponent, - ListMedicationAdministrationComponent, - ListMedicationComponent, - ListMedicationDispenseComponent, - ListMedicationRequestComponent, - ListNutritionOrderComponent, - ListObservationComponent, - ListPatientComponent, - ListProcedureComponent, - ListDeviceRequestComponent, - UtilitiesSidebarComponent, - ListCoverageComponent, - ListServiceRequestComponent, - ListDocumentReferenceComponent, - ResourceListComponent, - ResourceListOutletDirective - ] + exports: [ + ComponentsSidebarComponent, + ListAllergyIntoleranceComponent, + ListAdverseEventComponent, + ListCarePlanComponent, + ListCommunicationComponent, + ListConditionComponent, + ListEncounterComponent, + ListAppointmentComponent, + ListGenericResourceComponent, + ListImmunizationComponent, + ListMedicationAdministrationComponent, + ListMedicationComponent, + ListMedicationDispenseComponent, + ListMedicationRequestComponent, + ListNutritionOrderComponent, + ListObservationComponent, + ListPatientComponent, + ListProcedureComponent, + ListDeviceRequestComponent, + UtilitiesSidebarComponent, + ListCoverageComponent, + ListServiceRequestComponent, + ListDocumentReferenceComponent, + ListDeviceComponent, + ListDiagnosticReportComponent, + ListGoalComponent, + ResourceListComponent, + ResourceListOutletDirective + ] }) export class SharedModule { }