Skip to content

Commit

Permalink
POC-739 added data for HEI
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqedme committed Jun 5, 2024
1 parent 7a9a298 commit e7fe89b
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 229 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h4 *ngIf="!statusError">
<strong>Viewing a Draft Version of the Report for the chosen month. </strong>
This report is likely to change without warning.
</div>
<div style="padding: 20px; font-size: 12px !important" #contentToSnapshot>
<div style="padding: 20px; font-size: 12px !important" #contentToSnapshot *ngIf="heiRegisterData && heiRegisterData.length > 0">
<div class="table-responsive">
<div class="row">
<div class="col-md-4">
Expand All @@ -61,7 +61,7 @@ <h4 *ngIf="!statusError">
<th colspan="5" rowspan="2">
First HIV DNA PCR Test at Birth, 6 weeks or First Contact
</th>
<th colspan="4" rowspan="2">Second HIV DNA PCR Tes</th>
<th colspan="4" rowspan="2">Second HIV DNA PCR Test</th>
<th colspan="4" rowspan="2">Third HIV DNA PCR Test</th>
<th colspan="4" rowspan="2">HEI Outcomes at 12 months</th>
<th colspan="4" rowspan="2">Confirmatory PCR</th>
Expand All @@ -79,10 +79,10 @@ <h4 *ngIf="!statusError">
<th colspan="3" rowspan="2">
Date of Collected enrollment (DD/MM/YYYY)
</th>
<th colspan="3">HEI ID (MFL-YYYY-NNNN)</th>
<th colspan="3" rowspan="2">Infant's Name</th>
<th colspan="4" rowspan="2">DOB (DD/MM/YYYY)</th>
<th colspan="2" rowspan="2">Header</th>
<th colspan="3">Birth Certificate Number</th>
<th colspan="3" rowspan="2">HEI ID (MFL-YYYY-NNNN)</th>
<th colspan="4" rowspan="2">Infant's Name</th>
<th colspan="2" rowspan="2">DOB (DD/MM/YYYY)</th>
<th colspan="2">Sex</th>
<th colspan="3">
Infant Prophylaxis 1=NVP, 2=AZT, 3=NVP &AZT, 4=None,
Expand Down Expand Up @@ -152,206 +152,54 @@ <h4 *ngIf="!statusError">
</tr>
</thead>
<tbody>
<tr>
<td class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center"></td>
<td class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
</tr>
<tr>
<td colspan="3" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
</tr>
<tr>
<td class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center"></td>
<td class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
</tr>
<tr>
<td colspan="3" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
</tr>
<tr>
<td class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center"></td>
<td class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
</tr>
<tr>
<td colspan="3" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
</tr>
<tr>
<td class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center"></td>
<td class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
</tr>
<tr>
<td colspan="3" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
</tr>
<tr>
<td class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="3" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="3" class="text-center" rowspan="2"></td>
<td colspan="4" class="text-center"></td>
<td class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center" rowspan="2"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center" rowspan="2"></td>
</tr>
<tr>
<td colspan="3" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="4" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
<td colspan="2" class="text-center"></td>
</tr>
<ng-container
*ngFor="let data of heiRegisterData; let a = index"
>
<tr>
<td class="text-center" rowspan="2">{{a+1}}</td>
<td colspan="3" class="text-center" rowspan="2">{{data.date_enrolled}}</td>
<td colspan="3" class="text-center">{{data.Birth_Certificate_number}}</td>
<td colspan="3" class="text-center" rowspan="2">{{data.HEI_ID}}</td>
<td colspan="4" class="text-center" rowspan="2">{{data.Infant_name}}</td>
<td colspan="2" class="text-center" rowspan="2">{{data.birth_date}}</td>
<td colspan="2" class="text-center">Sex</td>
<td colspan="3" class="text-center" rowspan="2">{{null}}</td>
<td colspan="4" class="text-center">{{data.parent_name}}</td>
<td class="text-center" rowspan="2">{{data.age_in_weeks_on_first_pcr}}</td>
<td colspan="2" class="text-center" rowspan="2">{{date_enrolled}}</td>
<td colspan="2" class="text-center">{{data.first_pcr_date}}</td>
<td colspan="2" class="text-center" rowspan="2">{{data.age_in_months_on_second_pcr}}</td>
<td colspan="2" class="text-center">{{data.second_pcr_date}}</td>
<td colspan="2" class="text-center" rowspan="2">{{data.age_in_months_on_third_pcr}}</td>
<td colspan="2" class="text-center">{{data.third_pcr_date}}</td>
<td colspan="2" class="text-center">Infant Feeding</td>
<td colspan="2" class="text-center" rowspan="2">{{data.hei_outcome}}</td>
<td colspan="2" class="text-center" rowspan="2">{{data.age_in_months_on_confirm_pcr}}</td>
<td colspan="2" class="text-center">{{data.confirm_pcr_date}}</td>
<td colspan="2" class="text-center" rowspan="2">{{data.age_in_months_on_first_antibody}}</td>
<td colspan="2" class="text-center">{{data.first_antibody_date}}</td>
<td colspan="2" class="text-center">{{null}}</td>
<td colspan="2" class="text-center">{{null}}</td>
<td colspan="4" class="text-center" rowspan="2">{{null}}</td>
</tr>
<tr>
<td colspan="3" class="text-center">{{data.NUPI}}</td>
<td colspan="2" class="text-center">{{data.gender}}</td>
<td colspan="4" class="text-center">{{data.Phone_Number}}</td>
<td colspan="2" class="text-center">{{data.results_pcr_first_pcr}}</td>
<td colspan="2" class="text-center">{{data.results_pcr_second_pcr}}</td>
<td colspan="2" class="text-center">{{data.results_pcr_third_pcr}}</td>
<td colspan="2" class="text-center">{{data.infant_feeding}}</td>
<td colspan="2" class="text-center">{{data.results_confirm_pcr}}</td>
<td colspan="2" class="text-center">{{data.results_first_antibody}}</td>
<td colspan="2" class="text-center">{{null}}</td>
<td colspan="2" class="text-center">{{null}}</td>
</tr>
</ng-container>




</tbody>
</table>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, OnInit, Output } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import * as _ from 'lodash';
import * as Moment from 'moment';
import { HeiRegisterResourceService } from 'src/app/etl-api/hei-register-resource.service';
@Component({
selector: 'app-hei-register',
templateUrl: './hei-register.component.html',
Expand All @@ -12,7 +13,7 @@ export class HeiRegisterComponent implements OnInit {
public params: any;
public indicators: string;
public selectedIndicators = [];
public txnewReportSummaryData: any = [];
public heiRegisterData: any = [];
public columnDefs: any = [];
public reportName = 'HEI Register';
public currentView = 'monthly';
Expand Down Expand Up @@ -48,7 +49,11 @@ export class HeiRegisterComponent implements OnInit {
this._locationUuids = locationUuids;
}

constructor(public router: Router, public route: ActivatedRoute) {
constructor(
public router: Router,
public route: ActivatedRoute,
public heiRegisterService: HeiRegisterResourceService
) {
this.route.queryParams.subscribe((data) => {
data.month === undefined
? (this._month = Moment()
Expand All @@ -71,8 +76,8 @@ export class HeiRegisterComponent implements OnInit {
this.route.parent.parent.params.subscribe((params: any) => {
this.storeParamsInUrl(params.location_uuid);
});
this.txnewReportSummaryData = [];
// this.getTxNewReport(this.params);
this.heiRegisterData = [];
this.getHeiRegisterData(this.params);
}

public storeParamsInUrl(param) {
Expand All @@ -89,31 +94,32 @@ export class HeiRegisterComponent implements OnInit {
});
}

// public getTxNewReport(params: any) {
// this.isLoading = true;
// this.txnewReport.getTxNewReport(params).subscribe((data) => {
// if (data.error) {
// this.showInfoMessage = true;
// this.errorMessage = `There has been an error while loading the report, please retry again`;
// this.isLoading = false;
// } else {
// this.showInfoMessage = false;
// this.columnDefs = data.sectionDefinitions;
// this.txnewReportSummaryData = data.result;
// this.calculateTotalSummary();
// this.isLoading = false;
// this.showDraftReportAlert(this._month);
// }
// });
// }
public getHeiRegisterData(params: any) {
this.isLoading = true;
this.heiRegisterService.getHeiRegister(params).subscribe((data) => {
if (data.error) {
this.showInfoMessage = true;
this.errorMessage = `There has been an error while loading the report, please retry again`;
this.isLoading = false;
} else {
console.log('HeiDataSummary: ', data);
this.showInfoMessage = false;
this.columnDefs = data.sectionDefinitions;
this.heiRegisterData = data;
// this.calculateTotalSummary();
this.isLoading = false;
this.showDraftReportAlert(this._month);
}
});
}

public calculateTotalSummary() {
const totalsRow = [];
if (this.txnewReportSummaryData.length > 0) {
if (this.heiRegisterData.length > 0) {
const totalObj = {
location: 'Totals'
};
_.each(this.txnewReportSummaryData, (row) => {
_.each(this.heiRegisterData, (row) => {
Object.keys(row).map((key) => {
if (Number.isInteger(row[key]) === true) {
if (totalObj[key]) {
Expand Down
Loading

0 comments on commit e7fe89b

Please sign in to comment.