From 75d60d9a1b86eb11cc49e409aa36feb010f21c12 Mon Sep 17 00:00:00 2001 From: Alfred Mutai <124869802+Alfred-Mutai@users.noreply.github.com> Date: Tue, 28 May 2024 17:04:42 +0300 Subject: [PATCH 1/3] =?UTF-8?q?POC-730:=20Internal=20movement=20form,=20ad?= =?UTF-8?q?d=20Patient=20type=20with=20options=20Antena=E2=80=A6=20(#1740)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * POC-730: Internal movement form, add Patient type with options Antenatal and Postnatal care programs under PMTCT program and validate * POC-730: Internal movement form, add Patient type with options Antenatal and Postnatal care programs under PMTCT program and validate --- src/app/constants/program.constants.ts | 16 ++++++++++++++- .../constants/referral-concepts.contants.ts | 6 +++++- src/app/interfaces/return-value.interface.ts | 1 + .../formentry-referrals-handler.service.ts | 20 +++++++++++++++---- .../hiv-referrals/hiv-referral.component.ts | 9 ++++----- .../hiv-referrals/hiv-referral.service.ts | 5 ++++- 6 files changed, 45 insertions(+), 12 deletions(-) diff --git a/src/app/constants/program.constants.ts b/src/app/constants/program.constants.ts index 3dee969d2..32931f6a8 100644 --- a/src/app/constants/program.constants.ts +++ b/src/app/constants/program.constants.ts @@ -6,6 +6,18 @@ const PMTCT_PROGRAM: Program = { dept: 'HIV', compatibleWithOtherDeptPrograms: false }; +const ANC_PROGRAM: Program = { + uuid: '52aeb285-fb18-455b-893e-3e53ccc77ceb', + name: 'ANTENATAL CARE PROGRAM', + dept: 'HIV', + compatibleWithOtherDeptPrograms: false +}; +const PNC_PROGRAM: Program = { + uuid: 'd2552058-d7bd-47c6-aed1-480a4308027a', + name: 'POSTNATAL PROGRAM', + dept: 'HIV', + compatibleWithOtherDeptPrograms: false +}; const STANDARD_HIV_PROGRAM: Program = { uuid: '781d85b0-1359-11df-a1f1-0026b9348838', name: 'STANDARD HIV TREATMENT', @@ -122,5 +134,7 @@ export const Programs = { EXPRESS_CARE_PROGRAM, DTG_PHARMACO_VIGILANCE_PROGRAM, HIV_SOCIAL_WORK_PROGRAM, - NUTRITION_PROGRAM + NUTRITION_PROGRAM, + ANC_PROGRAM, + PNC_PROGRAM }; diff --git a/src/app/constants/referral-concepts.contants.ts b/src/app/constants/referral-concepts.contants.ts index d36c21306..1f9062369 100644 --- a/src/app/constants/referral-concepts.contants.ts +++ b/src/app/constants/referral-concepts.contants.ts @@ -13,6 +13,8 @@ const PPP_REFERRAL_CONCEPT = '4e6d1c61-624c-4350-a604-374f835aa481'; const PATIENT_PREFERENCE_CONCEPT = '7e7d4555-362a-498a-b5ed-abcddcfce2a7'; const STANDARD_HIV_CARE_REFERRAL_CONCEPT = 'b412ae76-4ab4-4d00-800e-bd8d167769e1'; +const ANC_CONCEPT = '375e6d4a-ba94-41ac-8ac3-5a56015c4d92'; +const PNC_CONCEPT = 'c5789e91-2c76-450a-94f7-94fce32335d3'; export const ReferralConcepts = { differentiatedCareConceptUuid, @@ -27,5 +29,7 @@ export const ReferralConcepts = { BACK_TO_CCC_REFERRAL_CONCEPT, PPP_REFERRAL_CONCEPT, PATIENT_PREFERENCE_CONCEPT, - STANDARD_HIV_CARE_REFERRAL_CONCEPT + STANDARD_HIV_CARE_REFERRAL_CONCEPT, + ANC_CONCEPT, + PNC_CONCEPT }; diff --git a/src/app/interfaces/return-value.interface.ts b/src/app/interfaces/return-value.interface.ts index c4c7381dc..c985522df 100644 --- a/src/app/interfaces/return-value.interface.ts +++ b/src/app/interfaces/return-value.interface.ts @@ -16,4 +16,5 @@ export interface ReturnValue { providerUuid: string; locationUuid: string; hivReferralLocationUuid: string; + pmtctProgrammeUuid: string; } diff --git a/src/app/patient-dashboard/common/formentry/formentry-referrals-handler.service.ts b/src/app/patient-dashboard/common/formentry/formentry-referrals-handler.service.ts index b01362f96..25e9b525c 100644 --- a/src/app/patient-dashboard/common/formentry/formentry-referrals-handler.service.ts +++ b/src/app/patient-dashboard/common/formentry/formentry-referrals-handler.service.ts @@ -30,7 +30,8 @@ import { FormUuids } from './../../../constants/forms.constants'; @Injectable() export class FormentryReferralsHandlerService { - private PMTCT_PROGRAM: Program = Programs.PMTCT_PROGRAM; + private PNC_PROGRAM: Program = Programs.PNC_PROGRAM; + private ANC_PROGRAM: Program = Programs.ANC_PROGRAM; private STANDARD_PROGRAM: Program = Programs.STANDARD_HIV_PROGRAM; constructor( @@ -217,7 +218,8 @@ export class FormentryReferralsHandlerService { encounterDatetime: null, providerUuid: '', locationUuid: '', - hivReferralLocationUuid: '' + hivReferralLocationUuid: '', + pmtctProgrammeUuid: '' }; const formUuid = form.schema.uuid ? form.schema.uuid : ''; @@ -226,6 +228,7 @@ export class FormentryReferralsHandlerService { const referrals_1 = this.getQuestionValue(form, 'referrals'); const internalMvmentData = this.getQuestionValue(form, 'careType'); const interMovementQstnAns = this.getQuestionValue(form, 'internalMove'); + // validating if selected option is DC care and referrals is blank. Adult and youth forms are different const referrals = referrals_1 === undefined @@ -257,6 +260,8 @@ export class FormentryReferralsHandlerService { // haS PMTCT referral if (internalMvmentData === ReferralConcepts.MCH_PROGRAM_CONCEPT) { returnValue.hasPmtctReferral = true; + const pmtctPatientType = this.getQuestionValue(form, 'pmtctType'); + returnValue.pmtctProgrammeUuid = pmtctPatientType; } // has ACTG referral @@ -319,8 +324,15 @@ export class FormentryReferralsHandlerService { referralMetaData: referralObj }; if (referralObj.hasPmtctReferral) { - refProgram.uuid = this.PMTCT_PROGRAM.uuid; - refProgram.name = this.PMTCT_PROGRAM.name; + if (referralObj.pmtctProgrammeUuid === ReferralConcepts.ANC_CONCEPT) { + refProgram.uuid = this.ANC_PROGRAM.uuid; + refProgram.name = this.ANC_PROGRAM.name; + } else if ( + referralObj.pmtctProgrammeUuid === ReferralConcepts.PNC_CONCEPT + ) { + refProgram.uuid = this.PNC_PROGRAM.uuid; + refProgram.name = this.PNC_PROGRAM.name; + } } else { refProgram.uuid = this.STANDARD_PROGRAM.uuid; refProgram.name = this.STANDARD_PROGRAM.name; diff --git a/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts b/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts index 25b823e9a..68507b90b 100644 --- a/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts +++ b/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.component.ts @@ -208,14 +208,13 @@ export class HivReferralComponent implements OnInit, OnChanges, OnDestroy { const enrollmentsPayload = hivPrograms.map( (hivProgram: ProgramEnrollment) => { if ( - hivProgram.program.uuid === Programs.STANDARD_HIV_PROGRAM.uuid && - this.referredHivProgram.uuid === Programs.PMTCT_PROGRAM.uuid - ) { - } else if ( - hivProgram.program.uuid === Programs.PMTCT_PROGRAM.uuid && this.referredHivProgram.uuid === Programs.STANDARD_HIV_PROGRAM.uuid ) { referredToStandard = true; + } else if ( + this.referredHivProgram.uuid === Programs.PNC_PROGRAM.uuid || + this.referredHivProgram.uuid === Programs.ANC_PROGRAM.uuid + ) { } else { return { location: this.referredHivProgram.locationUuid, diff --git a/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.service.ts b/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.service.ts index 15684f514..f7b60ab98 100644 --- a/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.service.ts +++ b/src/app/patient-dashboard/common/patient-referrals/hiv-referrals/hiv-referral.service.ts @@ -130,7 +130,10 @@ export class HivReferralService { let autoEnrollmentUuid = ''; if (programUuid === Programs.STANDARD_HIV_PROGRAM.uuid) { autoEnrollmentUuid = this.STANDARD_HIV_AUTO_ENROLLMENT_ENCOUNTER; - } else if (programUuid === Programs.PMTCT_PROGRAM.uuid) { + } else if ( + programUuid === Programs.ANC_PROGRAM.uuid || + programUuid === Programs.PNC_PROGRAM.uuid + ) { autoEnrollmentUuid = this.PMTCT_AUTO_ENROLLMENT_ENCOUNTER; } return autoEnrollmentUuid; From c5ef9b7c516e046ae262348083ffba106fa6a5f2 Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Tue, 18 Jun 2024 11:51:10 +0300 Subject: [PATCH 2/3] Poc 759 (#1758) * POC-759 added an extra check for PLHIV >18 months * POC-759 added an extra check for PLHIV >18 months --- .../lab-order-search/lab-order-search-post.component.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 bcd6ca1c2..3a7c7366b 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 @@ -129,8 +129,15 @@ export class LabOrderSearchPostComponent implements OnInit, OnChanges { this.patientIdentifers = identifiers; }); this.patient = this.order.patient; + this.person = new Person(this.order.patient.person); - if (Moment().diff(Moment(this.person.birthdate), 'months') <= 18) { + if ( + Moment().diff(Moment(this.person.birthdate), 'months') <= 18 && + !( + this.patient.identifiers[0].identifierType.uuid === + this.cccIdentifierType + ) + ) { this.isHEIActive = true; } else { this.isHEIActive = false; From f299779aef0a2349e86748e1b926adcfd2b5486b Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Fri, 19 Jul 2024 20:44:54 +0300 Subject: [PATCH 3/3] Poc 781 (#1762) * POC-780: added the HPV test * POC-781: added the HPV test * POC-781: added the HPV test 2 * POC-581: added HPV payload to etl * POC-781: added HPV payload to etl --- .../lab-order-search-helper.service.ts | 49 +++++++++++ .../lab-order-search-post.component.html | 48 +++++++++++ .../lab-order-search-post.component.ts | 85 +++++++++++++++++++ 3 files changed, 182 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 3f91b81ea..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 @@ -14,6 +14,7 @@ export class LabOrdersSearchHelperService { conceptUuid: 'a898fe80-1350-11df-a1f1-0026b9348838', display: 'DNA PCR' }, + { type: 'VL', conceptUuid: 'a8982474-1350-11df-a1f1-0026b9348838', @@ -24,6 +25,11 @@ 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: '', @@ -31,6 +37,14 @@ export class LabOrdersSearchHelperService { } ]; } + public get hpvTestSampleTypes() { + return [ + { + id: 1, + display: 'Cervical Swab' + } + ]; + } public get sampleTypes() { return [ @@ -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, diff --git a/src/app/lab-order-search/lab-order-search-post.component.html b/src/app/lab-order-search/lab-order-search-post.component.html index 50aee64a0..3a718fd01 100644 --- a/src/app/lab-order-search/lab-order-search-post.component.html +++ b/src/app/lab-order-search/lab-order-search-post.component.html @@ -160,6 +160,34 @@
+ +
+
+ HPV Summary Info +
+ + + + + + + + + + + + + + + + + + + +
Entry Point:{{ HPVData.entryPoint }}
HIV Status:{{ HPVData.hivStatus }}
Type Of Screening:{{ HPVData.typeOfScreening }}
Sample Collection Method:{{ HPVData.sampleCollectionMethod }}
+
+
+
@@ -214,6 +242,26 @@
+
+
+
+ + +
+
+
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..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 @@ -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') { @@ -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) @@ -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(