Skip to content

Commit

Permalink
POC-698b: Added otz register endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Angie-540 authored and Alfred-Mutai committed Apr 29, 2024
1 parent 3564f99 commit 7ea244a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ <h4><b>Registration Details</b></h4>
rowspan="2"
style="width: 20%; text-align: center"
>
2022-01-01
{{data.original_art_regimen}}
</td>
<td colspan="2" style="width: 20%; text-align: center">
{{ data.firstname_middlename }}
Expand Down Expand Up @@ -217,32 +217,33 @@ <h4><b>Registration Details</b></h4>
</td>
<td colspan="2">{{ data.first_regimen_switch }}</td>
<td colspan="2">{{ data.first_regimen_switch_date }}</td>
<td colspan="2">gm</td>
<td colspan="2">{{ data.first_regimen_switch_reason }}</td>
<td colspan="2">{{ data.third_regimen_switch }}</td>
<td colspan="2">{{ data.third_regimen_switch_date }}</td>
<td colspan="2">pppprrr</td>
<td colspan="2">{{ data.third_regimen_switch_reason }}</td>
<ng-container *ngFor="let i of counterArray">
<td colspan="2">rrrr</td>
<td colspan="2">{{ vlResult }}</td>
</ng-container>
<td colspan="6"></td>
<td colspan="2" rowspan="2">gx</td>
<td colspan="2" rowspan="2">gy</td>
<td colspan="6">{{ data.discontinue_otz_reason }}</td>
<td colspan="2" rowspan="2"></td>
<td colspan="2" rowspan="2">{{ data.clinical_remarks }}</td>
</tr>
<tr>
<td colspan="2">{{ data.age_at_enrollment }} years</td>

<td colspan="2">{{ data.last_name }}</td>
<td colspan="3">{{ data.vl_result_date_at_otz_enrollment }}</td>
<td colspan="3">{{ data.art_regimen_start_date_at_otz_enrollment }}</td>
<td colspan="2">{{ data.second_regimen_switch }}</td>
<td colspan="2">{{ data.second_regimen_switch_date }}</td>
<td colspan="2">xxx</td>
<td colspan="2">{{ data.second_regimen_switch_reason }}</td>
<td colspan="2">{{ data.fourth_regimen_switch }}</td>
<td colspan="2">{{ data.fourth_regimen_switch_date }}</td>
<td colspan="2">yyy</td>
<td colspan="2">{{ data.fourth_regimen_switch_reason }}</td>
<ng-container *ngFor="let i of counterArray">
<td colspan="2">gg</td>
<td colspan="2">{{ vlDate }}</td>
</ng-container>
<td colspan="6">gggg</td>
<td colspan="6">{{ data.discontinue_otz_date }}</td>
</tr>
</ng-container>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export class OtzRegisterComponent implements OnInit {
public otzData = [];
public enabledControls = 'monthControl';
public _month: string;

public vlDate = [];
public vlResult = [] ;

counterArray = Array(18)
.fill(0)
.map((_, index) => index + 1);
Expand Down Expand Up @@ -47,7 +49,29 @@ export class OtzRegisterComponent implements OnInit {
this.otzData = result.results.results;
console.log("otzdata", this.otzData);
console.log('age2', this.otzData[1].age_at_enrollment);

for (let data of this.otzData) {
const viral_load = data.vl_result_post_otz_enrollment;
const vl_array = viral_load.split(',');
console.log(vl_array);
const mapped_vls = vl_array.map((v) => {
const vl_dates = v.split('=');
this.vlDate = vl_dates[0];
this.vlResult = vl_dates[1];
console.log('Date:', this.vlDate, 'Result:', this.vlResult);
return {
vlDate: vl_dates[0],
vlResult: vl_dates[1]

};
});
console.log('mapped_vls',mapped_vls);


}

})


}
}

0 comments on commit 7ea244a

Please sign in to comment.