Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC-475c #1720

Merged
merged 34 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3ab2c32
suggested traker changes
hiqedme Aug 1, 2023
ce173f9
added patient tracker
hiqedme Aug 15, 2023
d12571b
POC-475: added patient tracker
hiqedme Aug 16, 2023
2c48471
Viral Load and Treatment Changes Tracker
Angie-540 Sep 5, 2023
29aaa2b
interface
Angie-540 Sep 19, 2023
ab20531
ahd-events
Angie-540 Sep 22, 2023
6fda0fc
ahd-events
Angie-540 Sep 22, 2023
69e9ee2
ahd-summary
Angie-540 Sep 26, 2023
c3f1cb8
ahd-summary
Angie-540 Sep 26, 2023
3ad972e
ahd-events
Angie-540 Sep 26, 2023
6a8ee60
ahd-events
Angie-540 Sep 29, 2023
1b49b40
ahd-events
Angie-540 Sep 29, 2023
e18769b
ahd-events
Angie-540 Sep 29, 2023
ac6cee8
ahd-events
Angie-540 Sep 29, 2023
f6be62d
ahd-summary
Angie-540 Oct 3, 2023
a871f17
ahd-summary
Angie-540 Oct 3, 2023
ef07633
ahd-events
Angie-540 Oct 5, 2023
1fd382e
ahd events
Angie-540 Oct 6, 2023
fc8142f
POC-475: added AHD component to summary
Angie-540 Oct 6, 2023
e3e7c75
suggested traker changes
hiqedme Aug 1, 2023
1b1b262
added patient tracker
hiqedme Aug 15, 2023
177ca03
POC-475: added an array
Angie-540 Oct 6, 2023
0434f3e
isheiactive
Angie-540 Oct 6, 2023
b44df0b
suggested traker changes
hiqedme Aug 1, 2023
de60406
POC-475: added patient tracker
hiqedme Aug 16, 2023
4f7a561
uniquedates
Angie-540 Oct 9, 2023
4060e74
display dates
Angie-540 Oct 9, 2023
c02b677
start and end dates
Angie-540 Oct 9, 2023
a1283be
UI
Angie-540 Oct 16, 2023
dff61de
conditional rendering
Angie-540 Oct 17, 2023
bbf1671
POC-475: modified columns under patient tracker
Angie-540 Oct 17, 2023
742d276
Update package-lock.json
Alfred-Mutai Feb 15, 2024
ac12985
Update hiv-summary-historical.component.html
Alfred-Mutai Feb 15, 2024
0b2ad43
Merge branch 'master' into POC-475c
Alfred-Mutai Feb 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* .header {
display: flex;
justify-content: space-between;
} */
/*
table tbody tr,
table thead tr{
display: flex;
flex-direction: row;

} */
table tbody tr td,
table thead tr th {
width: 50%;
}

/* table tbody tr td{
background-color: blue;
} */

/* .ahd {
max-width: 100%;
} */
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<div>
<div>
<table
class="table table-hover table-striped table-responsive"
*ngIf="tbStartdates.length > 0 || tbEnddates[0] != null"
>
<thead>
<tr>
<th>TB Treatment Start Date</th>
<th>TB Treatment End Date</th>
</tr>
</thead>
<tbody>
<tr>
<td *ngFor="let startDate of tbStartdates">
{{ startDate | date: 'dd-MM-yyyy' }}
</td>
<td *ngFor="let endDate of tbEnddates">
{{ endDate | date: 'dd-MM-yyyy' }}
</td>
</tr>
</tbody>
</table>

<table
class="table table-hover table-striped table-responsive"
*ngIf="
cryptococallStartDates[0] != null || cryptococallEndDates[0] != null
"
>
<thead>
<tr>
<th>Cryptococcal Treatment Start Date :</th>
<th>Cryptococcal Treatment End Date :</th>
</tr>
</thead>
<tbody>
<tr>
<td *ngFor="let startDate of cryptococallStartDates">
{{ startDate | date: 'dd-MM-yyyy' }}
</td>
<td *ngFor="let endDate of cryptococallEndDates">
{{ endDate | date: 'dd-MM-yyyy' }}
</td>
</tr>
</tbody>
</table>

<table
class="table table-hover table-striped table-responsive"
*ngIf="pcpStartDates[0] != null || pcpEndDates[0] != null"
>
<thead>
<tr>
<th>PCP Treatment Start Date</th>
<th>PCP Treatment End Date</th>
</tr>
</thead>
<tbody>
<tr>
<td *ngFor="let startDate of pcpStartDates">
{{ startDate | date: 'dd-MM-yyyy' }}
</td>
<td *ngFor="let endDate of pcpEndDates">
{{ endDate | date: 'dd-MM-yyyy' }}
</td>
</tr>
</tbody>
</table>

<table
class="table table-hover table-striped table-responsive"
*ngIf="
toxoplasmosisStartDates[0] != null || toxoplasmosisEndDates[0] != null
"
>
<thead>
<tr>
<th>Toxoplasmosis Treatment Start Date</th>
<th>Toxoplasmosis Treatment End Date</th>
</tr>
</thead>
<tbody>
<tr>
<td *ngFor="let startDate of toxoplasmosisStartDates">
{{ startDate | date: 'dd-MM-yyyy' }}
</td>
<td *ngFor="let startDate of toxoplasmosisEndDates">
{{ endDate | date: 'dd-MM-yyyy' }}
</td>
</tr>
</tbody>
</table>

<table
class="table table-hover table-striped table-responsive"
*ngIf="kaposisStartDates[0] != null || kaposisEndDates[0] != null"
>
<thead>
<tr>
<th>Kaposis Sarcoma Treatment Start Date</th>
<th>Kaposis Sarcoma Treatment End Date</th>
</tr>
</thead>
<tbody>
<tr>
<td *ngFor="let startDate of kaposisStartDates">
{{ startDate | date: 'dd-MM-yyyy' }}
</td>
<td *ngFor="let startDate of kaposisEndDates">
{{ endDate | date: 'dd-MM-yyyy' }}
</td>
</tr>
</tbody>
</table>
</div>

<div
*ngIf="
kaposisStartDates[0] == null &&
kaposisEndDates[0] == null &&
toxoplasmosisStartDates[0] == null &&
toxoplasmosisEndDates[0] == null &&
tbStartdates.length == 0 &&
tbEnddates[0] == null &&
pcpStartDates[0] == null &&
pcpEndDates[0] == null &&
cryptococallStartDates[0] == null &&
cryptococallEndDates[0] == null
"
>
<p class="mx-8">NO AHD SUMMARY DATA!</p>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { AhdEventsSummaryComponent } from './ahd-events-summary.component';

describe('AhdEventsSummaryComponent', () => {
let component: AhdEventsSummaryComponent;
let fixture: ComponentFixture<AhdEventsSummaryComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [AhdEventsSummaryComponent]
}).compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AhdEventsSummaryComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { DatePipe } from '@angular/common';
import { HivSummaryService } from '../hiv-summary.service';
import { PatientService } from 'src/app/patient-dashboard/services/patient.service';
import { Patient } from 'src/app/models/patient.model';
import { Subscription } from 'rxjs';
import * as _ from 'lodash';

@Component({
selector: 'app-ahd-events-summary',
templateUrl: './ahd-events-summary.component.html',
styleUrls: ['./ahd-events-summary.component.css']
})
export class AhdEventsSummaryComponent implements OnInit, OnDestroy {
public patientUuid: any;
public patient: Patient;
isHEIActive = false;
public hasError = false;
public dataLoaded = false;
public toxoplasmosisStartDates: any = [];
public toxoplasmosisEndDates: any = [];
public kaposisStartDates: any = [];
public kaposisEndDates: any = [];
public pcpStartDates: any = [];
public pcpEndDates: any = [];
public tbStartdates: any = [];
public tbEnddates: any = [];
public cryptococallStartDates: any = [];
public cryptococallEndDates: any = [];
public ahdSummary: any = [];
public ahd: any;
public subscription: Subscription[] = [];
public errors: any = [];
public loadingAhdSummary = false;
public isLoading: boolean;

constructor(
private patientService: PatientService,
private hivSummaryService: HivSummaryService,
private datePipe: DatePipe
) {}

public ngOnInit() {
this.loadPatient();
}

public ngOnDestroy() {
this.subscription.forEach((sub) => {
sub.unsubscribe();
});
}

public loadPatient() {
this.loadingAhdSummary = true;
const patientSub = this.patientService.currentlyLoadedPatient.subscribe(
(patient) => {
if (patient) {
this.patient = patient;
this.patientUuid = this.patient.person.uuid;
this.getPatientHivSummary(this.patientUuid);
}
this.loadingAhdSummary = false;
},
(err) => {
this.loadingAhdSummary = true;
this.errors.push({
id: 'patient',
message: 'error fetching patient'
});
}
);
this.subscription.push(patientSub);
}

public getPatientHivSummary(patientUuid) {
const summary = this.hivSummaryService
.getHivSummary(patientUuid, 0, 1, false, this.isHEIActive)
.subscribe((data) => {
// this.tbStartdates = [];
if (data) {
console.log('tb-history: ', data);
if (data.length > 0) {
for (const result in data) {
if (data.hasOwnProperty(result)) {
const hivsum = data[result];
console.log('hivsum.tb_tx_start_date: ', hivsum);
if (
hivsum.tb_tx_start_date !== null &&
!this.tbStartdates.includes(hivsum.tb_tx_start_date)
) {
this.tbStartdates = [
...this.tbStartdates,
hivsum.tb_tx_start_date
];
}

if (!this.tbEnddates.includes(hivsum.tb_tx_end_date)) {
this.tbEnddates.push(hivsum.tb_tx_end_date);
}

if (
!this.cryptococallStartDates.includes(
hivsum.cm_treatment_start_date
)
) {
this.cryptococallStartDates.push(
hivsum.cm_treatment_start_date
);
}

if (
!this.cryptococallEndDates.includes(
hivsum.cm_treatment_end_date
)
) {
this.cryptococallEndDates.push(hivsum.cm_treatment_end_date);
}

if (
!this.pcpStartDates.includes(
hivsum.pcp_prophylaxis_start_date
)
) {
this.pcpStartDates.push(hivsum.pcp_prophylaxis_start_date);
}

if (
!this.pcpEndDates.includes(hivsum.pcp_prophylaxis_end_date)
) {
this.pcpEndDates.push(hivsum.pcp_prophylaxis_end_date);
}

if (
!this.toxoplasmosisStartDates.includes(
hivsum.toxoplasmosis_start_date
)
) {
this.toxoplasmosisStartDates.push(
hivsum.toxoplasmosis_start_date
);
}

if (
!this.toxoplasmosisEndDates.includes(
hivsum.toxoplasmosis_end_date
)
) {
this.toxoplasmosisEndDates.push(
hivsum.toxoplasmosis_end_date
);
}

if (
!this.kaposisStartDates.includes(hivsum.kaposis_start_date)
) {
this.kaposisStartDates.push(hivsum.kaposis_start_date);
}

if (!this.kaposisEndDates.includes(hivsum.kaposis_end_date)) {
this.kaposisEndDates.push(hivsum.kaposis_end_date);
}
}
}
}
console.log('stx: ', this.tbStartdates);
console.log('tbend: ', this.tbEnddates);
this.isLoading = false;
} else {
this.dataLoaded = true;
}
});
this.subscription.push(summary);
}
}
Loading
Loading