Skip to content

Commit

Permalink
Merge branch 'master' into POC-768
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Mutai authored Jul 21, 2024
2 parents 7932331 + eb5d787 commit cf39fc2
Show file tree
Hide file tree
Showing 9 changed files with 254 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ export class DailyScheduleAppointmentsComponent implements OnInit, OnDestroy {
width: 120,
field: 'arv_first_regimen_start_date'
},
{
headerName: 'Weight',
width: 200,
field: 'weight'
},
{
headerName: 'Height',
width: 200,
field: 'height'
},
{
headerName: 'WHO Stage',
width: 200,
field: 'stage'
},
{
headerName: 'Covid-19 Assessment Status',
width: 250,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ export class DailyScheduleNotReturnedComponent implements OnInit, OnDestroy {
width: 120,
field: 'arv_first_regimen_start_date'
},
{
headerName: 'Weight',
width: 200,
field: 'weight'
},
{
headerName: 'Height',
width: 200,
field: 'height'
},
{
headerName: 'WHO Stage',
width: 200,
field: 'stage'
},
{
headerName: 'Covid-19 Assessment Status',
width: 250,
Expand Down
10 changes: 7 additions & 3 deletions src/app/etl-api/family-testing-resource.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ export class FamilyTestingService {
);
}

public getPatientEncounters(patientUuid: string) {
const familyTestingEncounterTypeUuid =
'975ae894-7660-4224-b777-468c2e710a2a';
public getPatientEncounters(
patientUuid: string,
isFamilyTestingEncounter: boolean
) {
const familyTestingEncounterTypeUuid = isFamilyTestingEncounter
? '975ae894-7660-4224-b777-468c2e710a2a'
: '5a58f6f5-f5a6-47eb-a644-626abd83f83b';
return this.http.get(
`${this.amrsUrl()}encounter?patient=${patientUuid}&encounterType=${familyTestingEncounterTypeUuid}`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export class IptReportPatientListComponent implements OnInit {

public addExtraColumns() {
const extraColumns = {
weight: 'Weight',
height: 'Height',
stage: 'WHO Stage',
phone_number: 'Phone Number',
enrollment_date: 'Date Enrolled',
last_appointment: 'Latest Appointment',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ export class Moh731PatientListComponent implements OnInit, OnChanges {

public addExtraColumns(indicators: Array<any>) {
const extraColumns = {
weight: 'Weight',
height: 'Height',
stage: 'WHO Stage',
location: 'Location',
enrollment_date: 'Enrollment Date',
arv_first_regimen_start_date: 'ARVs Initial Start Date',
Expand Down
49 changes: 49 additions & 0 deletions src/app/lab-order-search/lab-order-search-helper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class LabOrdersSearchHelperService {
conceptUuid: 'a898fe80-1350-11df-a1f1-0026b9348838',
display: 'DNA PCR'
},

{
type: 'VL',
conceptUuid: 'a8982474-1350-11df-a1f1-0026b9348838',
Expand All @@ -24,13 +25,26 @@ export class LabOrdersSearchHelperService {
conceptUuid: 'a896cce6-1350-11df-a1f1-0026b9348838',
display: 'CD4 Panel'
},
{
type: 'HPV',
conceptUuid: 'a8a46fd6-1350-11df-a1f1-0026b9348838',
display: 'HPV'
},
{
type: 'Other',
conceptUuid: '',
display: 'Others'
}
];
}
public get hpvTestSampleTypes() {
return [
{
id: 1,
display: 'Cervical Swab'
}
];
}

public get sampleTypes() {
return [
Expand Down Expand Up @@ -181,6 +195,41 @@ export class LabOrdersSearchHelperService {
};
}

public createHpvPayload(
order: any,
encounterObs: any,
encounterLocationUuid: any,
patientIdentifier: any,
patientName: any,
sex: any,
birthDate: any,
dateRecieved: any,
sampleType: any,
isPregnant = 0,
breastfeeding = 0
) {
const vlJustificationUuid: any = this.findObsValueByConceptUuid(
encounterObs,
'0a98f01f-57f1-44b7-aacf-e1121650a967'
);

return {
type: 'HPV',
locationUuid: encounterLocationUuid,
orderNumber: order.orderNumber,
providerIdentifier: order.orderer.identifier,
patientName: patientName,
patientIdentifier: patientIdentifier,
sex: sex,
birthDate: this.formatDate(birthDate),
sampleType: sampleType,
vlJustificationUuid: vlJustificationUuid,
isPregnant: isPregnant,
breastfeeding: breastfeeding,
dateDrawn: this.formatDate(order.dateActivated),
dateReceived: this.formatDate(dateRecieved)
};
}
public createViralLoadPayload(
order,
encounterObs,
Expand Down
48 changes: 48 additions & 0 deletions src/app/lab-order-search/lab-order-search-post.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,34 @@ <h5>
</div>
<div class="clear"></div>
<!-- DNAPCR ends -->
<!-- HPV starts-->
<div class="panel-info" *ngIf="isHPVtest">
<h5>
<span>HPV Summary Info</span>
</h5>
<table class="table">
<tbody>
<tr class="after_table row_0">
<td>Entry Point:</td>
<td>{{ HPVData.entryPoint }}</td>
</tr>
<tr>
<td>HIV Status:</td>
<td>{{ HPVData.hivStatus }}</td>
</tr>
<tr>
<td>Type Of Screening:</td>
<td>{{ HPVData.typeOfScreening }}</td>
</tr>
<tr>
<td>Sample Collection Method:</td>
<td>{{ HPVData.sampleCollectionMethod }}</td>
</tr>
</tbody>
</table>
</div>
<div class="clear"></div>
<!-- HPV ends -->
<div *ngIf="!isBusy" class="container-fluid">
<div class="row">
<div>
Expand Down Expand Up @@ -214,6 +242,26 @@ <h5>
</div>
</div>
</div>
<div class="row" *ngIf="orderType.type === 'HPV'">
<div>
<div class="form-group">
<label for="hpvTestSampleType">Sample Type</label>
<select
class="form-control"
id="hpvTestSampleType"
[(ngModel)]="selectedSampleType"
>
<option [ngValue]=""></option>
<option
*ngFor="let sample of hpvTestSampleTypes"
[ngValue]="sample.id"
>
{{ sample.display }}
</option>
</select>
</div>
</div>
</div>
<div class="row">
<div>
<div class="form-group">
Expand Down
85 changes: 85 additions & 0 deletions src/app/lab-order-search/lab-order-search-post.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,27 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
public hivSummary: any;
public error: any;
public hasDnaPcr = false;
public isHPVtest = false;
public dnaPcrData: any = {
hivStatusOfMother: '',
infantProphylaxis: '',
infantFeeding: ''
};
public HPVData: any = {
entryPoint: '',
hivStatus: '',
typeOfScreening: '',
sampleCollectionMethod: '',
dateOfSampleCollection: ''
};

public isPregnant = false;
public isBreastfeeding = false;

public labLocations: any;
public patientIdentifers = [];
public sampleTypes: any;
public hpvTestSampleTypes: any;
public orderTypes: any;
public isBusy = true;

Expand All @@ -104,6 +113,7 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
this.labLocations = this.labOrdersSearchHelperService.labLocations;
this.sampleTypes = this.labOrdersSearchHelperService.sampleTypes;
this.orderTypes = this.labOrdersSearchHelperService.orderTypes;
this.hpvTestSampleTypes = this.labOrdersSearchHelperService.hpvTestSampleTypes;
}

public ngOnInit() {
Expand Down Expand Up @@ -152,6 +162,7 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
this.displayPregnancy();
this.loadHivSummary(this.person.uuid);
this.displayDnaPcrInputs();
this.displayHPVInputs();
this.setDefaultLocation();
}

Expand Down Expand Up @@ -224,7 +235,64 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
}
);
}
public displayHPVInputs() {
const ot = this.orderType.type;
if (ot !== 'HPV') {
return;
} else {
this.isHPVtest = true;

this.HPVData.entryPoint = this.hpvValue(
this.findObs(
this.order.encounter.obs,
'a8a17e48-1350-11df-a1f1-0026b9348838'
).display
);
this.HPVData.hivStatus = this.hpvValue(
this.findObs(
this.order.encounter.obs,
'9e4d6436-4040-46a3-a0ae-6dbc0acfe593'
).display
);
this.HPVData.typeOfScreening = this.hpvValue(
this.findObs(
this.order.encounter.obs,
'6048b6bd-c698-48c9-8d20-424ab0b3d628'
).display
);
this.HPVData.sampleCollectionMethod = this.hpvValue(
this.findObs(
this.order.encounter.obs,
'aa14f397-5d82-4cd3-8dc8-bb381a935717'
).display
);
this.HPVData.dateOfSampleCollection = this.hpvValue(
this.findObs(
this.order.encounter.obs,
'e07623c2-38af-4caa-8d8d-d01791441c59'
).display
);
}
}
public hpvValue(displayString: any) {
const parts = displayString.split(':');
return parts.length > 1 ? parts[1].trim() : displayString;
}
public getHpvConceptValues(uuid: string, property: string) {
this.conceptResourceService
.getConceptByUuid(uuid)
.pipe(take(1))
.subscribe(
(data) => {
if (data) {
this.dnaPcrData[property] += `${data.name.display} ,`;
}
},
(error) => {
console.error('Failed to load concepts ', error);
}
);
}
public displayDnaPcrInputs() {
const ot = this.orderType.type;
if (ot !== 'DNAPCR') {
Expand Down Expand Up @@ -298,8 +366,10 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
if (!this.hasLoadingTimeRequiredInputs()) {
return;
}

const payload = this.getPayload();
const location = this.selectedLabLocation;
console.log('uchunguzi ', payload);
this.isBusy = true;
this.labOrderPostService
.postOrderToEid(location, payload)
Expand Down Expand Up @@ -387,6 +457,21 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
this.isBreastfeeding ? 1 : 0
);
}
if (this.orderType.type === 'HPV') {
payload = this.labOrdersSearchHelperService.createHpvPayload(
order,
obs,
locationUuid,
patientIdentifier,
patientName,
gender,
birthdate,
this.dateReceived,
this.selectedSampleType,
this.isPregnant ? 1 : 0,
this.isBreastfeeding ? 1 : 0
);
}

if (this.orderType.type === 'CD4') {
payload = this.labOrdersSearchHelperService.createCD4Payload(
Expand Down
Loading

0 comments on commit cf39fc2

Please sign in to comment.