diff --git a/src/app/lab-order-search/lab-order-search-post.component.ts b/src/app/lab-order-search/lab-order-search-post.component.ts
index 3a7c7366b..92e89444e 100644
--- a/src/app/lab-order-search/lab-order-search-post.component.ts
+++ b/src/app/lab-order-search/lab-order-search-post.component.ts
@@ -72,11 +72,19 @@ 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;
@@ -84,6 +92,7 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
public labLocations: any;
public patientIdentifers = [];
public sampleTypes: any;
+ public hpvTestSampleTypes: any;
public orderTypes: any;
public isBusy = true;
@@ -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() {
@@ -152,6 +162,7 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
this.displayPregnancy();
this.loadHivSummary(this.person.uuid);
this.displayDnaPcrInputs();
+ this.displayHPVInputs();
this.setDefaultLocation();
}
@@ -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') {
@@ -387,6 +455,28 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
this.isBreastfeeding ? 1 : 0
);
}
+ if (this.orderType.type === 'HPV') {
+ const artStartDateInitial = this.hivSummary.arv_first_regimen_start_date;
+ const artStartDateCurrent = this.hivSummary.arv_start_date;
+ const currentArtRegimenId = this.hivSummary.cur_arv_meds_id;
+
+ payload = this.labOrdersSearchHelperService.createHpvPayload(
+ order,
+ obs,
+ locationUuid,
+ patientIdentifier,
+ patientName,
+ gender,
+ birthdate,
+ this.dateReceived,
+ artStartDateInitial,
+ artStartDateCurrent,
+ this.selectedSampleType,
+ currentArtRegimenId,
+ this.isPregnant ? 1 : 0,
+ this.isBreastfeeding ? 1 : 0
+ );
+ }
if (this.orderType.type === 'CD4') {
payload = this.labOrdersSearchHelperService.createCD4Payload(
From 060e95585d4ece17228fe4ed6453e740df94a0df Mon Sep 17 00:00:00 2001
From: Faith Kamau <121166087+hiqedme@users.noreply.github.com>
Date: Wed, 26 Jun 2024 17:39:47 +0300
Subject: [PATCH 2/5] POC-781: added the HPV test
---
.../lab-order-search-helper.service.ts | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/src/app/lab-order-search/lab-order-search-helper.service.ts b/src/app/lab-order-search/lab-order-search-helper.service.ts
index 96fa91495..5e81ec219 100644
--- a/src/app/lab-order-search/lab-order-search-helper.service.ts
+++ b/src/app/lab-order-search/lab-order-search-helper.service.ts
@@ -195,6 +195,47 @@ export class LabOrdersSearchHelperService {
};
}
+ public createHpvPayload(
+ order: any,
+ encounterObs: any,
+ encounterLocationUuid: any,
+ patientIdentifier: any,
+ patientName: any,
+ sex: any,
+ birthDate: any,
+ dateRecieved: any,
+ artStartDateInitial: any,
+ artStartDateCurrent: any,
+ sampleType: any,
+ artRegimenIds: 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),
+ artStartDateInitial: this.formatDate(artStartDateInitial),
+ artStartDateCurrent: this.formatDate(artStartDateCurrent),
+ sampleType: sampleType,
+ artRegimenUuid: artRegimenIds,
+ vlJustificationUuid: vlJustificationUuid,
+ isPregnant: isPregnant,
+ breastfeeding: breastfeeding,
+ dateDrawn: this.formatDate(order.dateActivated),
+ dateReceived: this.formatDate(dateRecieved)
+ };
+ }
public createViralLoadPayload(
order,
encounterObs,
From 7941826ab2f7a1ddec305c27a415a69eac976229 Mon Sep 17 00:00:00 2001
From: Faith Kamau <121166087+hiqedme@users.noreply.github.com>
Date: Fri, 28 Jun 2024 11:19:59 +0300
Subject: [PATCH 3/5] POC-781: added the HPV test 2
---
.../lab-order-search-helper.service.ts | 36 -------------------
1 file changed, 36 deletions(-)
diff --git a/src/app/lab-order-search/lab-order-search-helper.service.ts b/src/app/lab-order-search/lab-order-search-helper.service.ts
index 5e81ec219..3eec2395d 100644
--- a/src/app/lab-order-search/lab-order-search-helper.service.ts
+++ b/src/app/lab-order-search/lab-order-search-helper.service.ts
@@ -277,42 +277,6 @@ export class LabOrdersSearchHelperService {
dateReceived: this.formatDate(dateRecieved)
};
}
- public createHpvPayload(
- order: any,
- encounterObs: any,
- encounterLocationUuid: any,
- patientIdentifier: any,
- patientName: any,
- sex: any,
- birthDate: any,
- dateRecieved: any,
- artStartDateInitial: any,
- artStartDateCurrent: any,
- sampleType: any,
- artRegimenIds: any,
- isPregnant = 0,
- breastfeeding = 0
- ) {
- return {
- type: 'VL',
- locationUuid: encounterLocationUuid,
- orderNumber: order.orderNumber,
- providerIdentifier: order.orderer.identifier,
- patientName: patientName,
- patientIdentifier: patientIdentifier,
- sex: sex,
- birthDate: this.formatDate(birthDate),
- artStartDateInitial: this.formatDate(artStartDateInitial),
- artStartDateCurrent: this.formatDate(artStartDateCurrent),
- sampleType: sampleType,
- artRegimenUuid: artRegimenIds,
- vlJustificationUuid: '',
- isPregnant: isPregnant,
- breastfeeding: breastfeeding,
- dateDrawn: this.formatDate(order.dateActivated),
- dateReceived: this.formatDate(dateRecieved)
- };
- }
public formatDate(date) {
const momentDate = Moment(date);
From 070388a6aa354d871c0d05e7eff12f7828ce3b6a Mon Sep 17 00:00:00 2001
From: Faith Kamau <121166087+hiqedme@users.noreply.github.com>
Date: Wed, 17 Jul 2024 10:17:07 +0300
Subject: [PATCH 4/5] POC-581: added HPV payload to etl
---
.../lab-order-search-helper.service.ts | 6 ------
.../lab-order-search-post.component.ts | 10 ++++------
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/app/lab-order-search/lab-order-search-helper.service.ts b/src/app/lab-order-search/lab-order-search-helper.service.ts
index 3eec2395d..3300610a3 100644
--- a/src/app/lab-order-search/lab-order-search-helper.service.ts
+++ b/src/app/lab-order-search/lab-order-search-helper.service.ts
@@ -204,10 +204,7 @@ export class LabOrdersSearchHelperService {
sex: any,
birthDate: any,
dateRecieved: any,
- artStartDateInitial: any,
- artStartDateCurrent: any,
sampleType: any,
- artRegimenIds: any,
isPregnant = 0,
breastfeeding = 0
) {
@@ -225,10 +222,7 @@ export class LabOrdersSearchHelperService {
patientIdentifier: patientIdentifier,
sex: sex,
birthDate: this.formatDate(birthDate),
- artStartDateInitial: this.formatDate(artStartDateInitial),
- artStartDateCurrent: this.formatDate(artStartDateCurrent),
sampleType: sampleType,
- artRegimenUuid: artRegimenIds,
vlJustificationUuid: vlJustificationUuid,
isPregnant: isPregnant,
breastfeeding: breastfeeding,
diff --git a/src/app/lab-order-search/lab-order-search-post.component.ts b/src/app/lab-order-search/lab-order-search-post.component.ts
index 92e89444e..516e58df8 100644
--- a/src/app/lab-order-search/lab-order-search-post.component.ts
+++ b/src/app/lab-order-search/lab-order-search-post.component.ts
@@ -366,8 +366,11 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
if (!this.hasLoadingTimeRequiredInputs()) {
return;
}
+ console.log('uchunguzi ');
+
const payload = this.getPayload();
const location = this.selectedLabLocation;
+ console.log('uchunguzi ', payload);
this.isBusy = true;
this.labOrderPostService
.postOrderToEid(location, payload)
@@ -456,9 +459,7 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
);
}
if (this.orderType.type === 'HPV') {
- const artStartDateInitial = this.hivSummary.arv_first_regimen_start_date;
- const artStartDateCurrent = this.hivSummary.arv_start_date;
- const currentArtRegimenId = this.hivSummary.cur_arv_meds_id;
+ console.log('WE ARE HPV');
payload = this.labOrdersSearchHelperService.createHpvPayload(
order,
@@ -469,10 +470,7 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
gender,
birthdate,
this.dateReceived,
- artStartDateInitial,
- artStartDateCurrent,
this.selectedSampleType,
- currentArtRegimenId,
this.isPregnant ? 1 : 0,
this.isBreastfeeding ? 1 : 0
);
From 2639e0138130827280c39ec82bcc8b8be7c0a4ad Mon Sep 17 00:00:00 2001
From: Faith Kamau <121166087+hiqedme@users.noreply.github.com>
Date: Thu, 18 Jul 2024 15:47:21 +0300
Subject: [PATCH 5/5] POC-781: added HPV payload to etl
---
src/app/lab-order-search/lab-order-search-post.component.ts | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/app/lab-order-search/lab-order-search-post.component.ts b/src/app/lab-order-search/lab-order-search-post.component.ts
index 516e58df8..c7e3ef7d2 100644
--- a/src/app/lab-order-search/lab-order-search-post.component.ts
+++ b/src/app/lab-order-search/lab-order-search-post.component.ts
@@ -366,7 +366,6 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
if (!this.hasLoadingTimeRequiredInputs()) {
return;
}
- console.log('uchunguzi ');
const payload = this.getPayload();
const location = this.selectedLabLocation;
@@ -459,8 +458,6 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges {
);
}
if (this.orderType.type === 'HPV') {
- console.log('WE ARE HPV');
-
payload = this.labOrdersSearchHelperService.createHpvPayload(
order,
obs,