diff --git a/src/app/clinic-dashboard/general/clinic-lab-orders/clinic-lab-orders.component.ts b/src/app/clinic-dashboard/general/clinic-lab-orders/clinic-lab-orders.component.ts index f84d8b8ba..a0895a1a0 100644 --- a/src/app/clinic-dashboard/general/clinic-lab-orders/clinic-lab-orders.component.ts +++ b/src/app/clinic-dashboard/general/clinic-lab-orders/clinic-lab-orders.component.ts @@ -504,6 +504,11 @@ export class ClinicLabOrdersComponent implements OnInit, OnDestroy { width: 200, field: 'last_appointment' }, + { + headerName: 'Patient Category', + width: 150, + field: 'patient_category' + }, { headerName: 'Latest RTC Date', width: 150, diff --git a/src/app/clinic-dashboard/general/defaulter-list/defaulter-list.component.ts b/src/app/clinic-dashboard/general/defaulter-list/defaulter-list.component.ts index 99bbe31ab..b1a3b16b7 100644 --- a/src/app/clinic-dashboard/general/defaulter-list/defaulter-list.component.ts +++ b/src/app/clinic-dashboard/general/defaulter-list/defaulter-list.component.ts @@ -91,6 +91,11 @@ export class DefaulterListComponent implements OnInit { width: 200, field: 'last_appointment' }, + { + headerName: 'Patient Category', + width: 150, + field: 'patient_category' + }, { headerName: 'Latest RTC Date', width: 150, diff --git a/src/app/clinic-dashboard/hiv/hiv-enhanced-program/hiv-enhanced-program.component.ts b/src/app/clinic-dashboard/hiv/hiv-enhanced-program/hiv-enhanced-program.component.ts index 0aa313e35..25f745020 100644 --- a/src/app/clinic-dashboard/hiv/hiv-enhanced-program/hiv-enhanced-program.component.ts +++ b/src/app/clinic-dashboard/hiv/hiv-enhanced-program/hiv-enhanced-program.component.ts @@ -89,6 +89,11 @@ export class HivEnhancedComponent implements OnInit { width: 200, field: 'last_appointment_max' }, + { + headerName: 'Patient Category', + width: 150, + field: 'patient_category' + }, { headerName: 'Latest RTC Date', width: 150, diff --git a/src/app/clinic-dashboard/hiv/patient-status-change-visualization/patient-status-change-list.component.ts b/src/app/clinic-dashboard/hiv/patient-status-change-visualization/patient-status-change-list.component.ts index 6ecf9a026..4e004b144 100644 --- a/src/app/clinic-dashboard/hiv/patient-status-change-visualization/patient-status-change-list.component.ts +++ b/src/app/clinic-dashboard/hiv/patient-status-change-visualization/patient-status-change-list.component.ts @@ -28,6 +28,11 @@ export class PatientStatusChangeListComponent implements OnInit, OnDestroy { width: 200, field: 'last_appointment' }, + { + headerName: 'Patient Category', + width: 150, + field: 'patient_category' + }, { headerName: 'Latest RTC Date', width: 150, diff --git a/src/app/clinic-schedule-lib/daily-schedule/daily-schedule-appointments.component.ts b/src/app/clinic-schedule-lib/daily-schedule/daily-schedule-appointments.component.ts index 658701ed3..59ab9a315 100644 --- a/src/app/clinic-schedule-lib/daily-schedule/daily-schedule-appointments.component.ts +++ b/src/app/clinic-schedule-lib/daily-schedule/daily-schedule-appointments.component.ts @@ -76,6 +76,11 @@ export class DailyScheduleAppointmentsComponent implements OnInit, OnDestroy { width: 100, field: 'sms_receive_time' }, + { + headerName: 'VL Category', + width: 250, + field: 'vl_category' + }, { headerName: 'SMS Delivery Status', width: 100, diff --git a/src/app/data-entry-statistics/data-entry-statistics-patient-list.component.ts b/src/app/data-entry-statistics/data-entry-statistics-patient-list.component.ts index c72f84a28..ee89aac79 100644 --- a/src/app/data-entry-statistics/data-entry-statistics-patient-list.component.ts +++ b/src/app/data-entry-statistics/data-entry-statistics-patient-list.component.ts @@ -103,6 +103,11 @@ export class DataEntryStatisticsPatientListComponent width: 200, field: 'last_appointment' }, + { + headerName: 'Patient Category', + width: 150, + field: 'patient_category' + }, { headerName: 'Latest RTC Date', width: 150, diff --git a/src/app/hiv-care-lib/family-testing/contact-list/contact-list.component.ts b/src/app/hiv-care-lib/family-testing/contact-list/contact-list.component.ts index ded634b2c..1ff8a54e7 100644 --- a/src/app/hiv-care-lib/family-testing/contact-list/contact-list.component.ts +++ b/src/app/hiv-care-lib/family-testing/contact-list/contact-list.component.ts @@ -50,9 +50,8 @@ export class ContactListComponent implements OnInit { headerName: 'Reported test date', width: 150 }, - { - field: 'modified_fm_status', + field: 'test_result_value', headerName: 'Current test results', width: 150 }, diff --git a/src/app/hiv-care-lib/ipt-report/ipt-report-patient-list.component.ts b/src/app/hiv-care-lib/ipt-report/ipt-report-patient-list.component.ts index 956507994..17f8d855b 100644 --- a/src/app/hiv-care-lib/ipt-report/ipt-report-patient-list.component.ts +++ b/src/app/hiv-care-lib/ipt-report/ipt-report-patient-list.component.ts @@ -41,6 +41,7 @@ export class IptReportPatientListComponent implements OnInit { phone_number: 'Phone Number', enrollment_date: 'Date Enrolled', last_appointment: 'Latest Appointment', + patient_category: 'Patient Category', latest_rtc_date: 'Latest RTC Date', days_since_rtc_date: 'Days Since RTC', status: 'Current Status', diff --git a/src/app/hiv-care-lib/moh-731-report/moh-731-patientlist.component.ts b/src/app/hiv-care-lib/moh-731-report/moh-731-patientlist.component.ts index 3c67e3e35..9522b7ba9 100644 --- a/src/app/hiv-care-lib/moh-731-report/moh-731-patientlist.component.ts +++ b/src/app/hiv-care-lib/moh-731-report/moh-731-patientlist.component.ts @@ -247,10 +247,12 @@ export class Moh731PatientListComponent implements OnInit, OnChanges { cur_arv_line: 'Current ARV Line (edited)', cur_arv_meds: 'Current ARV Regimen', vl_1: 'Viral Load', + vl_category: 'VL Category', vl_1_date: 'Viral Load Date', has_pending_vl_test: 'Pending Viral Load Test', phone_number: 'Phone Number', last_appointment: 'Latest Appointment', + patient_category: 'Patient Category', latest_rtc_date: 'Latest RTC Date', latest_vl: 'Latest VL', latest_vl_date: 'Latest VL Date', diff --git a/src/app/hiv-care-lib/patient-gains-and-loses/patient-gains-and-loses-patient-list/patient-gains-and-loses-patient-list.component.ts b/src/app/hiv-care-lib/patient-gains-and-loses/patient-gains-and-loses-patient-list/patient-gains-and-loses-patient-list.component.ts index d9b9dedf9..974913ef4 100644 --- a/src/app/hiv-care-lib/patient-gains-and-loses/patient-gains-and-loses-patient-list/patient-gains-and-loses-patient-list.component.ts +++ b/src/app/hiv-care-lib/patient-gains-and-loses/patient-gains-and-loses-patient-list/patient-gains-and-loses-patient-list.component.ts @@ -97,9 +97,7 @@ export class PatientGainsAndLosesPatientListComponent implements OnInit { } ); } - public extraColumns() { - return this.patientListCols; - } + private getPatientList(params: any) { this.patientGainLose .getPatientGainAndLosePatientList(params) diff --git a/src/app/hiv-care-lib/patients-requiring-vl/patients-requiring-vl-base.component.ts b/src/app/hiv-care-lib/patients-requiring-vl/patients-requiring-vl-base.component.ts index ccdf1034b..ee07e65b0 100644 --- a/src/app/hiv-care-lib/patients-requiring-vl/patients-requiring-vl-base.component.ts +++ b/src/app/hiv-care-lib/patients-requiring-vl/patients-requiring-vl-base.component.ts @@ -95,6 +95,14 @@ export class PatientsRequiringVLBaseComponent implements OnInit { cellStyle: { 'white-space': 'normal' } + }, + { + headerName: 'VL Category', + field: 'vl_category', + width: 170, + cellStyle: { + 'white-space': 'normal' + } } ]; } diff --git a/src/app/hiv-care-lib/retention-report/retention-report-patient-list.component.ts b/src/app/hiv-care-lib/retention-report/retention-report-patient-list.component.ts index 68c3b5051..b7102892b 100644 --- a/src/app/hiv-care-lib/retention-report/retention-report-patient-list.component.ts +++ b/src/app/hiv-care-lib/retention-report/retention-report-patient-list.component.ts @@ -98,6 +98,11 @@ export class RetentionReportPatientListComponent implements OnInit { field: 'visit_type', width: 200 }, + { + headerName: 'Patient Category', + width: 150, + field: 'patient_category' + }, { headerName: 'Latest RTC date', field: 'latest_rtc_date', diff --git a/src/app/patient-dashboard/common/patient-reminders/patient-reminders.component.ts b/src/app/patient-dashboard/common/patient-reminders/patient-reminders.component.ts index 524711bd5..2c879f7b5 100644 --- a/src/app/patient-dashboard/common/patient-reminders/patient-reminders.component.ts +++ b/src/app/patient-dashboard/common/patient-reminders/patient-reminders.component.ts @@ -98,6 +98,7 @@ export class PatientRemindersComponent implements OnInit, OnDestroy { this.errorMessage = error; } ); + this.patientReminderService.getVlEligible(); this.subscriptions.push(sub2); } } diff --git a/src/app/patient-dashboard/common/patient-reminders/patient-reminders.service.ts b/src/app/patient-dashboard/common/patient-reminders/patient-reminders.service.ts index 3bac9b47e..4326c660d 100644 --- a/src/app/patient-dashboard/common/patient-reminders/patient-reminders.service.ts +++ b/src/app/patient-dashboard/common/patient-reminders/patient-reminders.service.ts @@ -5,6 +5,7 @@ import { PatientReminderResourceService } from '../../../etl-api/patient-reminde @Injectable() export class PatientReminderService { + public vl_eligible: any; constructor( private patientReminderResourceService: PatientReminderResourceService ) {} @@ -19,6 +20,7 @@ export class PatientReminderService { personUuid: data.person_uuid, generatedReminders: data.reminders }; + this.vl_eligible = data.reminders; return remindersObj; } else { return {}; @@ -30,4 +32,7 @@ export class PatientReminderService { }) ); } + public getVlEligible(): string { + return this.vl_eligible; + } } diff --git a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.html b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.html index ed226e9e6..4419d5242 100644 --- a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.html +++ b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.html @@ -198,14 +198,14 @@ }}
  • - INH Prophylaxis Medication : {{ iptProphylaxisMedication }} + TPT Medication : {{ iptProphylaxisMedication }}
  • - INH Prophylaxis Start Date : + TPT Start Date : {{ hivSummary?.ipt_start_date | date: 'dd-MM-yyyy' }}
  • - INH Prophylaxis End Date : + TPT End Date : {{ hivSummary?.ipt_completion_date | date: 'dd-MM-yyyy' }} +

    + VL Category: {{ this.viralLoadCategory }} +

    +

    Last Encounter

    diff --git a/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.ts b/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.ts index d4aa9e47a..4704060fd 100644 --- a/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.ts +++ b/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.ts @@ -13,6 +13,7 @@ import { EncounterResourceService } from 'src/app/openmrs-api/encounter-resource import { UserDefaultPropertiesService } from '../../../user-default-properties/user-default-properties.service'; import { CervicalCancerScreeningSummaResourceService } from './../../../etl-api/cervical-cancer-screening-summary-resource.service'; import { Covid19ResourceService } from './../../../etl-api/covid-19-resource-service'; +import { PatientReminderService } from '../../common/patient-reminders/patient-reminders.service'; const mdtProgramUuid = 'c4246ff0-b081-460c-bcc5-b0678012659e'; const stdProgramUuid = '781d85b0-1359-11df-a1f1-0026b9348838'; @@ -75,6 +76,8 @@ export class HivProgramSnapshotComponent implements OnInit { public hasSubsequentClinicalEncounter = false; public resolvedCareStatus: any; public showCareStatus = true; + public viralLoadCategory: any = ''; + public viralloadColor = ' '; public backgroundColor: any = { pink: '#FFC0CB', yellow: '#FFFF00' @@ -119,7 +122,8 @@ export class HivProgramSnapshotComponent implements OnInit { private locationResource: LocationResourceService, private userDefaultPropertiesService: UserDefaultPropertiesService, private cervicalCancerScreeningSummaryService: CervicalCancerScreeningSummaResourceService, - private covid19Service: Covid19ResourceService + private covid19Service: Covid19ResourceService, + private patientReminderService: PatientReminderService ) {} public ngOnInit() { @@ -140,6 +144,7 @@ export class HivProgramSnapshotComponent implements OnInit { 0, this.patient.uuid ); + this.getMoriskyScore(); } @@ -160,7 +165,7 @@ export class HivProgramSnapshotComponent implements OnInit { latestVlResult = this.getlatestVlResult(results); latestVlDate = latestVlResult.vl_1_date; latestVl = latestVlResult.vl_1; - latestVl = latestVlResult.vl_1; + this.patientCareStatus = results[0].patient_care_status; this.hivDisclosureStatus = results[0].hiv_status_disclosed === 1 ? 'Yes' : 'No'; @@ -234,6 +239,50 @@ export class HivProgramSnapshotComponent implements OnInit { ); } + public getViralLoadCategory(latestViralLoad: any) { + const eligiblility = this.patientReminderService.vl_eligible; + let isEligible: any; + _.each(eligiblility, (vl_eligibiliy: any) => { + if (vl_eligibiliy.title === 'Viral Load Reminder') { + isEligible = 1; + } else { + isEligible = 2; + } + }); + if (isEligible) { + switch (true) { + case latestViralLoad < 50 && + latestViralLoad != null && + isEligible === 2: + this.viralLoadCategory = 'LDL'; + this.viralloadColor = 'green'; + break; + case latestViralLoad >= 50 && latestViralLoad < 200 && isEligible === 2: + this.viralLoadCategory = 'Low Risk Low Level Viremia'; + this.viralloadColor = 'yellowgreen'; + break; + case latestViralLoad >= 200 && + latestViralLoad < 1000 && + isEligible === 2: + this.viralLoadCategory = 'High Risk Low Level Viremia'; + this.viralloadColor = 'orange'; + break; + case latestViralLoad >= 1000 && isEligible === 2: + this.viralLoadCategory = 'Suspected Treatment Failure'; + this.viralloadColor = 'red'; + break; + case isEligible === 1: + this.viralLoadCategory = 'Missing VL'; + this.viralloadColor = 'purple'; + break; + default: + this.viralLoadCategory = 'N/A'; + this.viralloadColor = 'black'; + break; + } + } + } + public getPatientCareStatus(care_status_id: any) { const translateMap = { '159': 'DECEASED', diff --git a/src/app/patients-program-enrollment/program-enrollent-patient-list.component.ts b/src/app/patients-program-enrollment/program-enrollent-patient-list.component.ts index d58cb2f40..1f5d81f0d 100644 --- a/src/app/patients-program-enrollment/program-enrollent-patient-list.component.ts +++ b/src/app/patients-program-enrollment/program-enrollent-patient-list.component.ts @@ -135,6 +135,11 @@ export class ProgramEnrollmentPatientListComponent width: 200, field: 'last_appointment' }, + { + headerName: 'Patient Category', + width: 150, + field: 'patient_category' + }, { headerName: 'Latest RTC Date', width: 150, diff --git a/src/app/shared/data-lists/patient-list/patient-list-columns.data.ts b/src/app/shared/data-lists/patient-list/patient-list-columns.data.ts index ae6e78968..a04f7b1c4 100644 --- a/src/app/shared/data-lists/patient-list/patient-list-columns.data.ts +++ b/src/app/shared/data-lists/patient-list/patient-list-columns.data.ts @@ -69,6 +69,11 @@ export class PatientListColumns { width: 200, field: 'last_appointment' }, + { + headerName: 'Patient Category', + width: 150, + field: 'patient_category' + }, { headerName: 'Visit Type', width: 200,