From aed27120c1401f9738332318fdf9b5514719291e Mon Sep 17 00:00:00 2001 From: Alfred Mutai <124869802+Alfred-Mutai@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:24:33 +0300 Subject: [PATCH 1/5] Could not generate Jan datim reports for those doing comparison with previous month (#1709) --- .../datim-reports/tx-rtt-report.component.ts | 19 +++++++------------ .../tx-ml-report/tx-ml-report.component.ts | 19 +++++++------------ 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/app/data-analytics-dashboard/hiv/datim-reports/tx-rtt-report.component.ts b/src/app/data-analytics-dashboard/hiv/datim-reports/tx-rtt-report.component.ts index 919da8913..359d27c78 100644 --- a/src/app/data-analytics-dashboard/hiv/datim-reports/tx-rtt-report.component.ts +++ b/src/app/data-analytics-dashboard/hiv/datim-reports/tx-rtt-report.component.ts @@ -58,7 +58,7 @@ export class TxRttReportComponent this.errorMessage = 'Locations are required!'; } } - public getDates(currentEndDate) { + public getDates(currentEndDate: string) { // Convert the currentEndDate string to a Date object const currentDate = new Date(currentEndDate); @@ -67,24 +67,19 @@ export class TxRttReportComponent const currentYear = currentDate.getFullYear(); // Calculate the previous month's last date + const previousMonth = currentMonth === 0 ? 11 : currentMonth - 1; // Adjust for January + const previousYear = currentMonth === 0 ? currentYear - 1 : currentYear; // Subtract one year if current month is January const previousMonthLastDate = new Date( - currentYear, - currentMonth, - 0 - ).getDate(); - - // Calculate the current month's end date - const currentMonthEndDate = new Date( - currentYear, - currentMonth + 1, + previousYear, + previousMonth + 1, 0 ).getDate(); // Format the dates as strings in the "YYYY-MM-DD" format const previousMonthLastDateString = - currentYear + + previousYear + '-' + - currentMonth.toString().padStart(2, '0') + + (previousMonth + 1).toString().padStart(2, '0') + '-' + previousMonthLastDate.toString().padStart(2, '0'); const currentMonthEndDateString = currentEndDate; diff --git a/src/app/data-analytics-dashboard/hiv/tx-ml-report/tx-ml-report.component.ts b/src/app/data-analytics-dashboard/hiv/tx-ml-report/tx-ml-report.component.ts index feae967a4..66bf1e26e 100644 --- a/src/app/data-analytics-dashboard/hiv/tx-ml-report/tx-ml-report.component.ts +++ b/src/app/data-analytics-dashboard/hiv/tx-ml-report/tx-ml-report.component.ts @@ -121,7 +121,7 @@ export class TxMlReportComponent }; } - public getDates(currentEndDate) { + public getDates(currentEndDate: string) { // Convert the currentEndDate string to a Date object const currentDate = new Date(currentEndDate); @@ -130,24 +130,19 @@ export class TxMlReportComponent const currentYear = currentDate.getFullYear(); // Calculate the previous month's last date + const previousMonth = currentMonth === 0 ? 11 : currentMonth - 1; // Adjust for January + const previousYear = currentMonth === 0 ? currentYear - 1 : currentYear; // Subtract one year if current month is January const previousMonthLastDate = new Date( - currentYear, - currentMonth, - 0 - ).getDate(); - - // Calculate the current month's end date - const currentMonthEndDate = new Date( - currentYear, - currentMonth + 1, + previousYear, + previousMonth + 1, 0 ).getDate(); // Format the dates as strings in the "YYYY-MM-DD" format const previousMonthLastDateString = - currentYear + + previousYear + '-' + - currentMonth.toString().padStart(2, '0') + + (previousMonth + 1).toString().padStart(2, '0') + '-' + previousMonthLastDate.toString().padStart(2, '0'); const currentMonthEndDateString = currentEndDate; From cb44ba3d0f249becadec52ad0bed951b22b53a7d Mon Sep 17 00:00:00 2001 From: Alfred Mutai <124869802+Alfred-Mutai@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:04:22 +0300 Subject: [PATCH 2/5] POC-649: Update DATIM patient list to meet new requirements (#1713) * Update DATIM patient list to meet new requirements * Update DATIM patient list to meet new requirements --- .../tx-curr-report-patient-list.component.ts | 3 +++ .../tx-ml-report-patient-list.component.ts | 3 +++ .../tx-mmd-report-patient-list.component.ts | 3 +++ .../tx-new-report-patient-list.component.ts | 3 +++ .../tx-rtt-report-patient-list.component.ts | 3 +++ 5 files changed, 15 insertions(+) diff --git a/src/app/hiv-care-lib/tx-curr-report/tx-curr-report-patient-list/tx-curr-report-patient-list.component.ts b/src/app/hiv-care-lib/tx-curr-report/tx-curr-report-patient-list/tx-curr-report-patient-list.component.ts index 44018923b..c8e8a0f4c 100644 --- a/src/app/hiv-care-lib/tx-curr-report/tx-curr-report-patient-list/tx-curr-report-patient-list.component.ts +++ b/src/app/hiv-care-lib/tx-curr-report/tx-curr-report-patient-list/tx-curr-report-patient-list.component.ts @@ -56,12 +56,15 @@ export class TxCurrReportPatientListComponent implements OnInit { public addExtraColumns() { const extraColumns = { + weight: 'Weight', phone_number: 'Phone', enrollment_date: 'Enrolment Date', last_appointment: 'Last Appointment', latest_rtc_date: 'Latest RTC Date', days_since_rtc_date: 'Days since RTC', arv_first_regimen: 'ARV first regimen', + cd4_1: 'CD4', + cd4_1_date: 'CD4 Date', arv_first_regimen_start_date: 'First ARV start date', cur_meds: 'Current Regimen', cur_arv_line: 'Current ARV Line', diff --git a/src/app/hiv-care-lib/tx-ml-report/tx-ml-report-patient-list/tx-ml-report-patient-list.component.ts b/src/app/hiv-care-lib/tx-ml-report/tx-ml-report-patient-list/tx-ml-report-patient-list.component.ts index b489dc493..5cc0afd57 100644 --- a/src/app/hiv-care-lib/tx-ml-report/tx-ml-report-patient-list/tx-ml-report-patient-list.component.ts +++ b/src/app/hiv-care-lib/tx-ml-report/tx-ml-report-patient-list/tx-ml-report-patient-list.component.ts @@ -54,12 +54,15 @@ export class TxMlReportPatientListComponent implements OnInit { public addExtraColumns() { const extraColumns = { + weight: 'Weight', phone_number: 'Phone', enrollment_date: 'Enrolment Date', last_appointment: 'Last Appointment', latest_rtc_date: 'Latest RTC Date', days_since_rtc_date: 'Days since RTC', arv_first_regimen: 'ARV first regimen', + cd4_1: 'CD4', + cd4_1_date: 'CD4 Date', arv_first_regimen_start_date: 'First ARV start date', cur_meds: 'Current Regimen', cur_arv_line: 'Current ARV Line', diff --git a/src/app/hiv-care-lib/tx-mmd-report/tx-mmd-report-patient-list/tx-mmd-report-patient-list.component.ts b/src/app/hiv-care-lib/tx-mmd-report/tx-mmd-report-patient-list/tx-mmd-report-patient-list.component.ts index 1baa46394..726eb925a 100644 --- a/src/app/hiv-care-lib/tx-mmd-report/tx-mmd-report-patient-list/tx-mmd-report-patient-list.component.ts +++ b/src/app/hiv-care-lib/tx-mmd-report/tx-mmd-report-patient-list/tx-mmd-report-patient-list.component.ts @@ -54,12 +54,15 @@ export class TxMmdReportPatientListComponent implements OnInit { public addExtraColumns() { const extraColumns = { + weight: 'Weight', phone_number: 'Phone', enrollment_date: 'Enrolment Date', last_appointment: 'Last Appointment', latest_rtc_date: 'Latest RTC Date', days_since_rtc_date: 'Days since RTC', arv_first_regimen: 'ARV first regimen', + cd4_1: 'CD4', + cd4_1_date: 'CD4 Date', arv_first_regimen_start_date: 'First ARV start date', cur_meds: 'Current Regimen', cur_arv_line: 'Current ARV Line', diff --git a/src/app/hiv-care-lib/tx-new-report/tx-new-report-patient-list/tx-new-report-patient-list.component.ts b/src/app/hiv-care-lib/tx-new-report/tx-new-report-patient-list/tx-new-report-patient-list.component.ts index d86698cf0..557c3cea0 100644 --- a/src/app/hiv-care-lib/tx-new-report/tx-new-report-patient-list/tx-new-report-patient-list.component.ts +++ b/src/app/hiv-care-lib/tx-new-report/tx-new-report-patient-list/tx-new-report-patient-list.component.ts @@ -54,12 +54,15 @@ export class TxNewReportPatientListComponent implements OnInit { public addExtraColumns() { const extraColumns = { + weight: 'Weight', phone_number: 'Phone', enrollment_date: 'Enrolment Date', last_appointment: 'Last Appointment', latest_rtc_date: 'Latest RTC Date', days_since_rtc_date: 'Days since RTC', arv_first_regimen: 'ARV first regimen', + cd4_1: 'CD4', + cd4_1_date: 'CD4 Date', arv_first_regimen_start_date: 'First ARV start date', cur_meds: 'Current Regimen', cur_arv_line: 'Current ARV Line', diff --git a/src/app/hiv-care-lib/tx-rtt-report/tx-rtt-report-patient-list/tx-rtt-report-patient-list.component.ts b/src/app/hiv-care-lib/tx-rtt-report/tx-rtt-report-patient-list/tx-rtt-report-patient-list.component.ts index d813f7e9a..9346a5fb5 100644 --- a/src/app/hiv-care-lib/tx-rtt-report/tx-rtt-report-patient-list/tx-rtt-report-patient-list.component.ts +++ b/src/app/hiv-care-lib/tx-rtt-report/tx-rtt-report-patient-list/tx-rtt-report-patient-list.component.ts @@ -54,12 +54,15 @@ export class TxRttReportPatientListComponent implements OnInit { public addExtraColumns() { const extraColumns = { + weight: 'Weight', phone_number: 'Phone', enrollment_date: 'Enrolment Date', last_appointment: 'Last Appointment', latest_rtc_date: 'Latest RTC Date', days_since_rtc_date: 'Days since RTC', arv_first_regimen: 'ARV first regimen', + cd4_1: 'CD4', + cd4_1_date: 'CD4 Date', arv_first_regimen_start_date: 'First ARV start date', cur_meds: 'Current Regimen', cur_arv_line: 'Current ARV Line', From 401de18f672e7321314137cc5695454beb44763b Mon Sep 17 00:00:00 2001 From: Henry Korir <5462699+henrykorir@users.noreply.github.com> Date: Wed, 14 Feb 2024 10:29:29 +0300 Subject: [PATCH 3/5] POC-651: Enhancement of DQA Report (#1714) POC-651: Enhancement of DQA Report POC-651: Enhancement of DQA Report POC-651: Enhancement of DQA Report --- ...chart-abstraction-patientlist.component.ts | 205 +++++++++--------- 1 file changed, 102 insertions(+), 103 deletions(-) diff --git a/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.ts b/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.ts index 86c445237..e29f65ac9 100644 --- a/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.ts +++ b/src/app/hiv-care-lib/dqa-reports/chart-abstraction-patientlist/chart-abstraction-patientlist.component.ts @@ -73,25 +73,28 @@ export class ChartAbstractionPatientlistComponent implements OnInit { const extraColumns = { NUPI: 'NUPI', sex_gender: 'Sex', + height: 'Height', + weight: 'Weight', birthdate: 'Date of Birth (DD/MM/YYYY)', hiv_start_date: 'Date Confirmed HIV Positive (DD/MM/YYYY)', arv_first_regimen_start_date: 'Date of ART Initiation (DD/MM/YYYY)', + cd4_1: 'Baseline CD4', + vl_1: 'Viral Load Results', arv_start_date: 'Date of Current ART Initiation (DD/MM/YYYY)', - drugs_given: 'Current ART Regimen', - cur_arv_med_basis: 'Current ART Regimen', + drugs_given: 'Current Regimen', + cur_arv_med_basis: 'Current ART Regimen Basis', drugs_duration: 'Drug dosage given (duration)', - height: 'Height at Last visit', - weight: 'Weight at Last visit', BMI: 'BMI at Last visit', muac: 'MUAC at Last visit', tb_screened_this_visit: 'Was TB Screening done at last visit', + pcp_prophylaxis: 'PCP Prophylaxis', + ctx_dispensed: 'CTX Dispensed', tb_screening_result: 'TB Screening outcomes', last_ipt_start_date: 'IPT start date (DD/MM/YYYY)', tpt_status: 'IPT status', ipt_completion_date: 'IPT outcome date (DD/MM/YYYY)', viral_load_validity: 'Does the client have a Valid Viral load result', vl_suppression: 'Is the client virally suppressed', - cd4_1: 'Baseline screening for CD4', has_cd4_1: 'Does this client have Baseline screening for CD4', is_crag_screened: 'Does this client have Baseline screening for CrAG', last_clinical_encounter: 'Last clinical encounter date (DD/MM/YYYY)', @@ -99,20 +102,16 @@ export class ChartAbstractionPatientlistComponent implements OnInit { dysBP: 'Diastolic BP', nutrition: 'Nutrition Assessment Done', DSD: 'DSD Model', - // cd4_1: 'Baseline CD4 Test Result', - // vl_1: 'Latest Valid VL', - vl_1: 'Does the client have a Valid viral load result', ovcid_id: 'OVCID', ipt_stop_date: 'IPT Stop Date (DD/MM/YYYY)', - // last_clinical_encounter: 'Last Clinical Encounter', - // last_appointment_date: 'Date of Last Appointment', next_appointment: 'Next appointment date (DD/MM/YYYY)', - // next_appointment: 'Date of Next Appointment ', visit_type: 'Visit Type', status: 'Status', - // is_crag_screened: 'Baseline CrAG Screened', cur_who_stage: 'Current Who Stage', - category: 'Category' + category: 'Category', + delivery_method: 'Delivery Method', + pregnancy_outcome: 'Pregnancy Outcome', + svd_and_live_birth: 'SVD Livebirth' }; for (const indicator in extraColumns) { if (indicator) { @@ -123,79 +122,39 @@ export class ChartAbstractionPatientlistComponent implements OnInit { } } this.overrideColumns.push( - { field: 'ccc_number', hide: true, pinned: true }, + { field: 'ccc_number', hide: false, pinned: true }, { field: 'birthdate', - // cellRenderer: (column) => { - // if (column.value != null) { - // // return moment(column.value).format('YYYY-MM-DD'); - // return moment(column.value).format('DD-MMM-YYYY'); - // } - // return 'missing'; - // }, + hide: true, pinned: false }, { - field: 'last_appointment_date' - // cellRenderer: (column) => { - // if (column.value != null) { - // return moment(column.value).format('DD-MM-YYYY'); - // } - // } + field: 'last_appointment_date', + hide: true }, { - field: 'arv_first_regimen_start_date' - // cellRenderer: (column) => { - // if (column.value != null) { - // if (moment(column.value).isBefore('1900-01-01', 'year')){ - // return column.value; - // } - // return '' - // } - // } + field: 'arv_first_regimen_start_date', + hide: false }, { field: 'arv_start_date', - // cellRenderer: (column) => { - // if (column.value != null) { - // return moment(column.value).format('DD-MM-YYYY'); - // } - // }, hide: true }, { - field: 'hiv_start_date' - // cellRenderer: (column) => { - // if (column.value != null) { - // return moment(column.value).format('DD-MM-YYYY'); - // } - // } + field: 'hiv_start_date', + hide: true }, { - field: 'last_clinical_encounter' - // cellRenderer: (column) => { - // if (column.value != null) { - // return moment(column.value).format('DD-MM-YYYY'); - // } - // } + field: 'last_clinical_encounter', + hide: true }, { - field: 'next_appointment' - // cellRenderer: (column) => { - // if (column.value != null) { - // return moment(column.value).format('DD-MM-YYYY'); - // } - // } + field: 'next_appointment', + hide: true }, { - field: 'tb_screened_this_visit' - // width: 150, - // cellRenderer: (column) => { - // if (column.value === 0) { - // return 'No'; - // } - // return 'Yes'; - // } + field: 'tb_screened_this_visit', + hide: true }, { field: 'vl_1', @@ -205,7 +164,7 @@ export class ChartAbstractionPatientlistComponent implements OnInit { } return column.value; }, - hide: true + hide: false }, { field: 'nutrition', @@ -215,41 +174,22 @@ export class ChartAbstractionPatientlistComponent implements OnInit { return 'YES'; } return 'NO'; - } + }, + hide: true }, { field: 'last_ipt_start_date', - // cellRenderer: (column) => { - // if (column.value != null) { - // return moment(column.value).format('DD-MM-YYYY'); - // } - // }, hide: false }, { field: 'ipt_completion_date', - // cellRenderer: (column) => { - // if (column.value != null) { - // return moment(column.value).format('DD-MM-YYYY'); - // } - // }, hide: false }, { field: 'ipt_stop_date', - // cellRenderer: (column) => { - // if (column.value != null) { - // return moment(column.value).format('DD-MM-YYYY'); - // } - // }, hide: true, suppressToolPanel: true }, - { - field: 'drugs_given', - width: 280, - hide: true - }, { field: 'height', width: 100 @@ -260,7 +200,8 @@ export class ChartAbstractionPatientlistComponent implements OnInit { }, { field: 'muac', - width: 100 + width: 100, + hide: true }, { field: 'visit_type', @@ -280,8 +221,9 @@ export class ChartAbstractionPatientlistComponent implements OnInit { }, { field: 'NUPI', - width: 150 - // pinned: true + width: 150, + hide: true, + pinned: true }, { field: 'upi_number', @@ -293,7 +235,7 @@ export class ChartAbstractionPatientlistComponent implements OnInit { { field: 'drugs_given', width: 280, - hide: true + hide: false }, { field: 'cur_arv_med_basis', @@ -330,8 +272,7 @@ export class ChartAbstractionPatientlistComponent implements OnInit { { field: 'age', width: 150, - hide: true, - suppressToolPanel: true + hide: false }, { field: 'sex_gender', @@ -358,14 +299,12 @@ export class ChartAbstractionPatientlistComponent implements OnInit { { field: 'dysBP', width: 150, - hide: true, - suppressToolPanel: true + hide: true }, { field: 'nutrition', width: 150, - hide: true, - suppressToolPanel: true + hide: true }, { field: 'DSD', @@ -382,18 +321,17 @@ export class ChartAbstractionPatientlistComponent implements OnInit { { field: 'cur_who_stage', width: 150, - hide: true, - suppressToolPanel: true + hide: true }, { field: 'vl_suppression', width: 150, - hide: false + hide: true }, { field: 'is_crag_screened', width: 150, - hide: false + hide: true }, { field: 'status', @@ -403,7 +341,68 @@ export class ChartAbstractionPatientlistComponent implements OnInit { { field: 'cd4_1', width: 150, + hide: false + }, + { + field: 'category', + width: 150, hide: true + }, + { + field: 'has_cd4_1', + width: 150, + hide: true + }, + { + field: 'BMI', + width: 150, + hide: true + }, + { + field: 'tpt_status', + width: 150, + hide: true + }, + { + field: 'ipt_start_date', + width: 150, + hide: true + }, + { + field: 'last_ipt_start_date', + hide: true + }, + { + field: 'ipt_completion_date', + hide: true + }, + { + field: 'cur_arv_med_basis', + hide: true + }, + { + field: 'vl_suppression', + hide: true + }, + { + field: 'viral_load_validity', + hide: true + }, + { + field: 'pcp_prophylaxis', + hide: true + }, + { + field: 'delivery_method', + hide: true + }, + { + field: 'pregnancy_outcome', + hide: true + }, + { + field: 'svd_and_live_birth', + hide: false } ); } From e4c47721254fb50bce2cfb75e6db389629fec1e7 Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:55:45 +0300 Subject: [PATCH 4/5] POC-626: added project beyond consent (#1715) --- .../common/patient-dashboard.common.module.ts | 6 +- .../otz-consent/otz-consent.component.css | 3 + .../otz-consent/otz-consent.component.html | 43 ++++++ .../otz-consent/otz-consent.component.spec.ts | 24 ++++ .../otz-consent/otz-consent.component.ts | 113 ++++++++++++++++ .../patient-info/patient-info.component.html | 4 +- .../project-beyond.component.css | 3 + .../project-beyond.component.html | 44 +++++++ .../project-beyond.component.spec.ts | 24 ++++ .../project-beyond.component.ts | 123 ++++++++++++++++++ .../telecare/telecare.component.html | 10 +- 11 files changed, 393 insertions(+), 4 deletions(-) create mode 100644 src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.css create mode 100644 src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.html create mode 100644 src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.spec.ts create mode 100644 src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.ts create mode 100644 src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.css create mode 100644 src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.html create mode 100644 src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.spec.ts create mode 100644 src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.ts diff --git a/src/app/patient-dashboard/common/patient-dashboard.common.module.ts b/src/app/patient-dashboard/common/patient-dashboard.common.module.ts index cda1544f9..ad035415e 100644 --- a/src/app/patient-dashboard/common/patient-dashboard.common.module.ts +++ b/src/app/patient-dashboard/common/patient-dashboard.common.module.ts @@ -136,6 +136,8 @@ import { EditPatientEducationComponent } from './patient-info/education/edit-pat import { OvcSnapshotComponent } from './ovc-snapshot/ovc-snapshot.component'; import { UserDefaultPropertiesService } from 'src/app/user-default-properties/user-default-properties.service'; import { OtzSnapshotComponent } from './otz-snapshot/otz-snapshot.component'; +import { ProjectBeyondComponent } from './patient-info/project-beyond/project-beyond.component'; +import { OtzConsentComponent } from './patient-info/otz-consent/otz-consent.component'; @NgModule({ imports: [ @@ -293,7 +295,9 @@ import { OtzSnapshotComponent } from './otz-snapshot/otz-snapshot.component'; AddPatientEducationComponent, EditPatientEducationComponent, OvcSnapshotComponent, - OtzSnapshotComponent + OtzSnapshotComponent, + ProjectBeyondComponent, + OtzConsentComponent ], providers: [ { diff --git a/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.css b/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.css new file mode 100644 index 000000000..033fec0b6 --- /dev/null +++ b/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.css @@ -0,0 +1,3 @@ +.edit_link:hover { + cursor: pointer; +} diff --git a/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.html b/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.html new file mode 100644 index 000000000..8673500a1 --- /dev/null +++ b/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.html @@ -0,0 +1,43 @@ +
+ Change OTZ Consent + + + + + + + + + + + + + + + Add OTZ Consent + + +
+ Patient Consented: {{ + otzClientConsent.value.display + }} + + Consent valid from: + {{ otzClientConsent.dateofConsent }} +
+
diff --git a/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.spec.ts b/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.spec.ts new file mode 100644 index 000000000..36818e353 --- /dev/null +++ b/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OtzConsentComponent } from './otz-consent.component'; + +describe('OtzConsentComponent', () => { + let component: OtzConsentComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [OtzConsentComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OtzConsentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.ts b/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.ts new file mode 100644 index 000000000..f2f3ac7aa --- /dev/null +++ b/src/app/patient-dashboard/common/patient-info/otz-consent/otz-consent.component.ts @@ -0,0 +1,113 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ObsResourceService } from 'src/app/openmrs-api/obs-resource.service'; +import { PatientService } from 'src/app/patient-dashboard/services/patient.service'; +import { Subscription } from 'rxjs'; +import { Router } from '@angular/router'; +import * as moment from 'moment/moment'; + +@Component({ + selector: 'otz-consent', + templateUrl: './otz-consent.component.html', + styleUrls: ['./otz-consent.component.css'] +}) +export class OtzConsentComponent implements OnInit { + public otzClientConsent: any = {}; + public otzConceptUuid: any = []; + public otzConsentExist = false; + public otzpatientUuid: any = ''; + public subscription: Subscription; + constructor( + private obsService: ObsResourceService, + private patientService: PatientService, + private router: Router + ) {} + + ngOnInit() { + this.subscription = this.patientService.currentlyLoadedPatientUuid.subscribe( + (uuid) => { + this.otzpatientUuid = uuid; + this.getOtzClientConsent(); + } + ); + } + getOtzClientConsent() { + this.otzConceptUuid = ['d6f0f5db-3658-47ae-b84e-13a9bc5a9162']; + const otzEncounter = 'b832e5b1-eaf6-401b-ba20-a75208087f9f'; + this.subscription = this.obsService + .getObsPatientObsByConcepts(this.otzpatientUuid, this.otzConceptUuid) + .subscribe((data) => { + const results = data['results']; + if (results.length > 0) { + const encDateTime = results[0].encounter.encounterDatetime; + this.otzClientConsent.dateofConsent = moment(encDateTime).format( + 'DD-MM-YYYY HH-mm' + ); + this.otzClientConsent.encounterUuid = results[0].encounter.uuid; + results.forEach((element) => { + if (element.encounter.encounterDatetime === encDateTime) { + if (this.otzConceptUuid.includes(element.concept.uuid)) { + if (element.concept.uuid === this.otzConceptUuid[0]) { + this.otzClientConsent.value = element.value; + if (element.value.display === 'NO') { + this.otzClientConsent.styling = 'text-danger'; + } + this.otzConsentExist = true; + } else if ( + element.concept.uuid === this.otzConceptUuid[1] && + element.encounter.encounterType.uuid === otzEncounter + ) { + this.otzClientConsent.comments = element.value; + } else if ( + element.concept.uuid === this.otzConceptUuid[2] && + element.encounter.encounterType.uuid === otzEncounter + ) { + this.otzClientConsent.expiryofConsent = moment( + element.value + ).format('DD-MM-YYYY HH-mm'); + } else if ( + element.concept.uuid === this.otzConceptUuid[3] && + element.encounter.encounterType.uuid === otzEncounter + ) { + this.otzClientConsent.sms = element.value.display; + } else if ( + element.concept.uuid === this.otzConceptUuid[4] && + element.encounter.encounterType.uuid === otzEncounter + ) { + this.otzClientConsent.smsTime = moment(element.value).format( + 'HH:mm' + ); + } + } + } + }); + } + }); + } + fillOtzConsentForm() { + if (this.otzpatientUuid === undefined || this.otzpatientUuid === null) { + return; + } + if (this.otzConsentExist) { + const consentFormUUID = '60f2428f-e998-4efd-81f7-99d793243850'; + const url = `/patient-dashboard/patient/${this.otzpatientUuid}/general/general/formentry/${consentFormUUID}`; + this.router.navigate([url], { + queryParams: { + encounter: this.otzClientConsent.encounterUuid, + visitTypeUuid: '' + } + }); + } else { + this.router.navigate([ + '/patient-dashboard/patient/' + + this.otzpatientUuid + + '/general/general/formentry/60f2428f-e998-4efd-81f7-99d793243850' + ]); + } + } + // tslint:disable-next-line: use-life-cycle-interface + ngOnDestroy(): void { + if (this.subscription) { + this.subscription.unsubscribe(); + } + } +} diff --git a/src/app/patient-dashboard/common/patient-info/patient-info.component.html b/src/app/patient-dashboard/common/patient-info/patient-info.component.html index b88973d8d..7519a9f4a 100644 --- a/src/app/patient-dashboard/common/patient-info/patient-info.component.html +++ b/src/app/patient-dashboard/common/patient-info/patient-info.component.html @@ -41,9 +41,11 @@
Highest Education Level

-
Home Visit / Phone / SMS Consent
+
Patient Consent
+ +

diff --git a/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.css b/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.css new file mode 100644 index 000000000..033fec0b6 --- /dev/null +++ b/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.css @@ -0,0 +1,3 @@ +.edit_link:hover { + cursor: pointer; +} diff --git a/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.html b/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.html new file mode 100644 index 000000000..fe9627c29 --- /dev/null +++ b/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.html @@ -0,0 +1,44 @@ +
+ Change Project Beyond Consent + + + + + + + + + + + + + + + + Add Project Beyond Consent + + + +
+ How do you get ARV medicines? : {{ + pbClientConsent.value.display + }} + + Teleconsultation Consent through phone calls?: + {{ pbClientConsent.teleconConsult }} + + Physical Tracing / Home Visit Consent? + {{ pbClientConsent.deliveryConsent }} + + Delivery of Medicine Consent + {{ pbClientConsent.homevisitConsent }} +
+
diff --git a/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.spec.ts b/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.spec.ts new file mode 100644 index 000000000..d9c5c9466 --- /dev/null +++ b/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProjectBeyondComponent } from './project-beyond.component'; + +describe('ProjectBeyondComponent', () => { + let component: ProjectBeyondComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ProjectBeyondComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProjectBeyondComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.ts b/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.ts new file mode 100644 index 000000000..fa0813f92 --- /dev/null +++ b/src/app/patient-dashboard/common/patient-info/project-beyond/project-beyond.component.ts @@ -0,0 +1,123 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ObsResourceService } from 'src/app/openmrs-api/obs-resource.service'; +import { PatientService } from 'src/app/patient-dashboard/services/patient.service'; +import { Subscription } from 'rxjs'; +import { Router } from '@angular/router'; +import * as moment from 'moment/moment'; + +@Component({ + selector: 'project-beyond-consent', + templateUrl: './project-beyond.component.html', + styleUrls: ['./project-beyond.component.css'] +}) +export class ProjectBeyondComponent implements OnInit { + public pbClientConsent: any = {}; + public pbConceptUuid: any = []; + public pbConsentExist = false; + public pbPatientUuid: any = ''; + public subscription: Subscription; + constructor( + private obsService: ObsResourceService, + private patientService: PatientService, + private router: Router + ) {} + + ngOnInit() { + this.subscription = this.patientService.currentlyLoadedPatientUuid.subscribe( + (uuid) => { + this.pbPatientUuid = uuid; + this.getPBpbClientConsent(); + } + ); + } + getPBpbClientConsent() { + this.pbConceptUuid = [ + 'ab4e94d0-7bec-42fc-94c9-8b291d9e91f7', + '6ef9b8e3-ba2d-4d24-82e4-3afd4ecc3c34', + '0035c116-31c7-48e3-9479-f9931b3ec3c6', + 'aaff0b06-6436-4ab4-8956-070f5d75d9c8' + ]; + const projectBeyondEncounter = 'd50d238b-eef5-4225-ba87-2548ae50b269'; + this.subscription = this.obsService + .getObsPatientObsByConcepts(this.pbPatientUuid, this.pbConceptUuid) + .subscribe((data) => { + const results = data['results']; + console.log('results', results); + if (results.length > 0) { + const encDateTime = results[0].encounter.encounterDatetime; + this.pbClientConsent.dateofConsent = moment(encDateTime).format( + 'DD-MM-YYYY HH-mm' + ); + + this.pbClientConsent.encounterUuid = results[0].encounter.uuid; + results.forEach((element) => { + if (element.encounter.encounterDatetime === encDateTime) { + if (this.pbConceptUuid.includes(element.concept.uuid)) { + if (element.concept.uuid === this.pbConceptUuid[0]) { + this.pbClientConsent.value = element.value; + if (element.value.display === 'NO') { + this.pbClientConsent.styling = 'text-danger'; + } + this.pbConsentExist = true; + } else if ( + element.concept.uuid === this.pbConceptUuid[1] && + element.encounter.encounterType.uuid === + projectBeyondEncounter + ) { + this.pbClientConsent.teleconConsult = element.value.display; + } else if ( + element.concept.uuid === this.pbConceptUuid[2] && + element.encounter.encounterType.uuid === + projectBeyondEncounter + ) { + this.pbClientConsent.homevisitConsent = element.value.display; + } else if ( + element.concept.uuid === this.pbConceptUuid[3] && + element.encounter.encounterType.uuid === + projectBeyondEncounter + ) { + this.pbClientConsent.deliveryConsent = element.value.display; + } else if ( + element.concept.uuid === this.pbConceptUuid[4] && + element.encounter.encounterType.uuid === + projectBeyondEncounter + ) { + this.pbClientConsent.smsTime = moment(element.value).format( + 'HH:mm' + ); + } + } + } + }); + } + }); + } + fillPbConsentForm() { + if (this.pbPatientUuid === undefined || this.pbPatientUuid === null) { + return; + } + if (this.pbConsentExist) { + const consentFormUUID = '1a12eede-98ca-4691-86d3-bbfb564d45c2'; + const url = `/patient-dashboard/patient/${this.pbPatientUuid}/general/general/formentry/${consentFormUUID}`; + this.router.navigate([url], { + queryParams: { + encounter: this.pbClientConsent.encounterUuid, + visitTypeUuid: '' + } + }); + } else { + this.router.navigate([ + '/patient-dashboard/patient/' + + this.pbPatientUuid + + '/general/general/formentry/1a12eede-98ca-4691-86d3-bbfb564d45c2' + ]); + } + } + + // tslint:disable-next-line: use-life-cycle-interface + ngOnDestroy(): void { + if (this.subscription) { + this.subscription.unsubscribe(); + } + } +} diff --git a/src/app/patient-dashboard/common/patient-info/telecare/telecare.component.html b/src/app/patient-dashboard/common/patient-info/telecare/telecare.component.html index 628554606..666fcf3ee 100644 --- a/src/app/patient-dashboard/common/patient-info/telecare/telecare.component.html +++ b/src/app/patient-dashboard/common/patient-info/telecare/telecare.component.html @@ -1,6 +1,9 @@
Change consent Change Home Visit, Phone , SMS + consent @@ -35,7 +38,10 @@ Add consentAdd Home Visit, Phone, SMS + Consent From 51d4206fe36255f53a17148c9a893194014713fb Mon Sep 17 00:00:00 2001 From: Henry Korir <5462699+henrykorir@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:15:56 +0300 Subject: [PATCH 5/5] POC-633: Display the Total abdominal hysterectomy on the patient dashboard. Concept ID 5276 (#1707) --- .../hiv-program-snapshot.component.html | 15 ++++++++++++++- .../hiv-program-snapshot.component.ts | 17 +++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.html b/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.html index 838eaba9c..aa82882d0 100644 --- a/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.html +++ b/src/app/patient-dashboard/hiv/program-snapshot/hiv-program-snapshot.component.html @@ -244,7 +244,20 @@

Last Encounter

-
+
+

+ Cervical Cancer Screening : + {{ reason_cacx_not_done }} +

+
+

Cervical Cancer Screening : 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 d4150513d..1ebccf526 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 @@ -128,6 +128,7 @@ export class HivProgramSnapshotComponent implements OnInit { public last_pcr_status: string; public last_pcr_date: string; public infant_feeding_method: string; + public reason_cacx_not_done: string = null; constructor( private hivSummaryResourceService: HivSummaryResourceService, @@ -656,6 +657,9 @@ export class HivProgramSnapshotComponent implements OnInit { this.cervicalScreeningSummary = result; if (result.length > 0) { this.latestCervicalScreeningSummary = result[0]; + this.reason_cacx_not_done = this.reasonCaCxNotDone( + result[0].reason + ); } } }, @@ -819,4 +823,17 @@ export class HivProgramSnapshotComponent implements OnInit { return INFANT_FEEDING_METHODS[this.patientData.infant_feeding_method]; } + + public reasonCaCxNotDone(reasons: string): string { + if (reasons.includes('=5276')) { + return 'Not Done: Total Abdominal Hysterectomy'; + } else if (reasons.includes('12110=12109')) { + return 'Not Done: Cervix Not Accessible'; + } else if (reasons.includes('12110=5989')) { + return 'Not Done: Menstruating'; + } else if (reasons.includes('12110=1504')) { + return 'Not Done: Patient Refusal'; + } + return null; + } }