generated from PackagrIO/goweb-template
-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patient resource list and card (#501)
- Loading branch information
1 parent
7b7a005
commit 4642223
Showing
18 changed files
with
507 additions
and
59 deletions.
There are no files selected for viewing
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
4 changes: 2 additions & 2 deletions
4
frontend/src/app/components/fhir-card/resources/immunization/immunization.component.spec.ts
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
18 changes: 9 additions & 9 deletions
18
frontend/src/app/components/fhir-card/resources/immunization/immunization.component.ts
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
73 changes: 73 additions & 0 deletions
73
frontend/src/app/components/fhir-card/resources/patient/patient.component.html
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,73 @@ | ||
<div class="patient-card card"> | ||
<div class="card-header bg-fasten-purple"> | ||
<h2 class="mb-0 text-white">{{ displayModel.patient_name }}</h2> | ||
</div> | ||
<div class="card-body"> | ||
<div class="row"> | ||
<!-- Basic Information --> | ||
<div class="col-md-6 mb-4"> | ||
<h3 class="h5 mb-3">Basic Information</h3> | ||
<ul class="list-unstyled"> | ||
<li><strong>Date of Birth:</strong> {{ displayModel.patient_birthdate | date:'mediumDate' }}</li> | ||
<li><strong>Age:</strong> {{ displayModel.patient_age }}</li> | ||
<li><strong>Gender:</strong> {{ displayModel.patient_gender | titlecase }}</li> | ||
<li><strong>Birth Sex:</strong> {{ displayModel.birth_sex }}</li> | ||
<li><strong>Marital Status:</strong> {{ displayModel.marital_status }}</li> | ||
<li><strong>Race:</strong> {{ displayModel.race }}</li> | ||
<li><strong>Ethnicity:</strong> {{ displayModel.ethnicity }}</li> | ||
</ul> | ||
</div> | ||
|
||
<!-- Contact Information --> | ||
<div class="col-md-6 mb-4"> | ||
<h3 class="h5 mb-3">Contact Information</h3> | ||
<ul class="list-unstyled"> | ||
<li><strong>Address:</strong> | ||
<address class="mb-0 ml-3"> | ||
<div *ngFor="let line of displayModel.patient_address">{{line}}</div> | ||
</address> | ||
</li> | ||
<li><strong>Phone{{ displayModel.patient_phones.length > 0 ? '' : 's' }}:</strong> | ||
<ul class="list-unstyled ml-3"> | ||
<li *ngFor="let phone of displayModel.patient_phones">{{ phone.value }} ({{ phone.use }})</li> | ||
</ul> | ||
</li> | ||
<li><strong>Language{{ displayModel.communication_languages.length > 0 ? '' : 's' }}:</strong> | ||
<span *ngFor="let language of displayModel.communication_languages; let last = last"> | ||
{{ language.display }}{{last ? '' : ', '}} | ||
</span> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<!-- Additional Information --> | ||
<div class="col-md-6 mb-4"> | ||
<h3 class="h5 mb-3">Additional Information</h3> | ||
<ul class="list-unstyled"> | ||
<li><strong>Mother's Maiden Name:</strong> {{ displayModel.mothers_maiden_name }}</li> | ||
<li><strong>Birth Place:</strong> {{ displayModel.birth_place }}</li> | ||
<li><strong>Multiple Birth:</strong> {{ displayModel.multiple_birth ? 'Yes' : 'No' }}</li> | ||
</ul> | ||
</div> | ||
|
||
<!-- Identifiers --> | ||
<div class="col-md-6 mb-4"> | ||
<h3 class="h5 mb-3">Identifiers</h3> | ||
<ul class="list-unstyled"> | ||
<li *ngIf="displayModel.mrn"><strong>Medical Record Number:</strong> <code class="ml-2 text-muted">{{ displayModel.mrn }}</code></li> | ||
<li *ngIf="displayModel.ssn"><strong>SSN:</strong> <code class="ml-2 text-muted">{{ displayModel.ssn }}</code></li> | ||
</ul> | ||
<ng-container *ngIf="displayModel.identifiers && displayModel.identifiers.length > 0"> | ||
<h4 class="h6 mt-3">Other Identifiers:</h4> | ||
<ul class="list-unstyled ml-3"> | ||
<li *ngFor="let identifier of displayModel.identifiers"> | ||
<strong>{{ identifier.type }}:</strong> <code class="ml-2 text-muted">{{ identifier.value }}</code> | ||
</li> | ||
</ul> | ||
</ng-container> | ||
</div> | ||
|
||
|
||
</div> | ||
</div> | ||
</div> |
28 changes: 28 additions & 0 deletions
28
frontend/src/app/components/fhir-card/resources/patient/patient.component.scss
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,28 @@ | ||
.bg-fasten-purple { | ||
background-color: #5b47fb; | ||
} | ||
|
||
.patient-card { | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
padding: 20px; | ||
margin-bottom: 20px; | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | ||
|
||
h2 { | ||
margin-top: 0; | ||
margin-bottom: 15px; | ||
font-size: 1.5rem; | ||
} | ||
|
||
.patient-info { | ||
p { | ||
margin: 5px 0; | ||
} | ||
|
||
strong { | ||
font-weight: bold; | ||
margin-right: 5px; | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
frontend/src/app/components/fhir-card/resources/patient/patient.component.spec.ts
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,28 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; | ||
|
||
import { PatientModel } from 'src/lib/models/resources/patient-model'; | ||
import { PatientComponent } from './patient.component'; | ||
|
||
describe('PatientComponent', () => { | ||
let component: PatientComponent; | ||
let fixture: ComponentFixture<PatientComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [ PatientComponent, NgbCollapseModule, RouterTestingModule ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(PatientComponent); | ||
component = fixture.componentInstance; | ||
component.displayModel = new PatientModel({}); | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
}); |
31 changes: 31 additions & 0 deletions
31
frontend/src/app/components/fhir-card/resources/patient/patient.component.ts
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,31 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; | ||
import { Router, RouterModule } from '@angular/router'; | ||
import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; | ||
import { PatientModel } from '../../../../../lib/models/resources/patient-model'; | ||
import { BadgeComponent } from '../../common/badge/badge.component'; | ||
import { TableComponent } from '../../common/table/table.component'; | ||
import { FhirCardComponentInterface } from '../../fhir-card/fhir-card-component-interface'; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [NgbCollapseModule, CommonModule, BadgeComponent, TableComponent, RouterModule], | ||
selector: 'fhir-patient', | ||
templateUrl: './patient.component.html', | ||
styleUrls: ['./patient.component.scss'] | ||
}) | ||
export class PatientComponent implements OnInit, FhirCardComponentInterface { | ||
@Input() displayModel: PatientModel; | ||
@Input() showDetails: boolean = true; | ||
@Input() isCollapsed: boolean = false; | ||
|
||
constructor(public changeRef: ChangeDetectorRef, public router: Router) { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
markForCheck(){ | ||
this.changeRef.markForCheck() | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...nents/fhir-datatable/datatable-generic-resource/datatable-generic-resource.component.html
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
15 changes: 15 additions & 0 deletions
15
...c/app/components/fhir-datatable/datatable-generic-resource/datatable-patient.component.ts
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,15 @@ | ||
import {Component} from '@angular/core'; | ||
import {attributeXTime} from './utils'; | ||
import {GenericColumnDefn, DatatableGenericResourceComponent} from './datatable-generic-resource.component'; | ||
|
||
@Component({ | ||
selector: 'fhir-datatable-patient', | ||
templateUrl: './datatable-generic-resource.component.html', | ||
styleUrls: ['./datatable-generic-resource.component.scss'] | ||
}) | ||
export class DatatablePatientComponent extends DatatableGenericResourceComponent { | ||
columnDefinitions: GenericColumnDefn[] = [ | ||
{ title: 'Name', versions: '*', format: 'humanName', getter: p => p.name?.[0] }, | ||
{ title: 'DOB', versions: '*', getter: p => p.birthDate, format: 'date' }, | ||
] | ||
} |
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
9 changes: 3 additions & 6 deletions
9
...end/src/app/components/form-request-health-system/form-request-health-system.component.ts
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.