diff --git a/package-lock.json b/package-lock.json index 0b683431e..f5d2e1c78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ngx-amrs", - "version": "2.16.5-SNAPSHOT", + "version": "2.17.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ngx-amrs", - "version": "2.16.5-SNAPSHOT", + "version": "2.17.1", "dependencies": { "@ampath-kenya/ngx-openmrs-formentry": "2.12.23", "@angular/animations": "^6.1.0", diff --git a/package.json b/package.json index 84c18ba32..dd1b7ba4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngx-amrs", - "version": "2.17.0", + "version": "2.17.1", "scripts": { "ng": "ng", "start": "ng serve --host 0.0.0.0 --port 3000", 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 e2fce01ec..4c7e54e29 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 @@ -111,6 +111,11 @@ export class DefaulterListComponent implements OnInit { field: 'ovcid_id', width: 150 }, + { + headerName: 'Outreach Follow-up', + width: 150, + field: 'outreach_follow_up' + }, { headerName: 'Latest VL', width: 75, diff --git a/src/app/patient-dashboard/common/visit/visit-details/visit-details.component.html b/src/app/patient-dashboard/common/visit/visit-details/visit-details.component.html index 83e59c726..7328d7f60 100644 --- a/src/app/patient-dashboard/common/visit/visit-details/visit-details.component.html +++ b/src/app/patient-dashboard/common/visit/visit-details/visit-details.component.html @@ -172,6 +172,12 @@

Oops! You cannot schedule an Adult return visit for a date that comes before the initial visit + To access clinical forms kindly fill Enhanced Adherence Encounter + Form diff --git a/src/app/patient-dashboard/common/visit/visit-details/visit-details.component.ts b/src/app/patient-dashboard/common/visit/visit-details/visit-details.component.ts index ed557bd3f..98587566e 100644 --- a/src/app/patient-dashboard/common/visit/visit-details/visit-details.component.ts +++ b/src/app/patient-dashboard/common/visit/visit-details/visit-details.component.ts @@ -33,6 +33,7 @@ export class VisitDetailsComponent implements OnInit { public retrospectiveAttributeTypeUuid = '3bb41949-6596-4ff9-a54f-d3d7883a69ed'; public qualifiesForCovidScreening = false; + public isViremicHighVL = false; public isRetrospectiveVisit = false; public isAdultReturnVisitBeforeInitialVisit = false; @@ -243,6 +244,23 @@ export class VisitDetailsComponent implements OnInit { } }); } + // Check if their are allowed Viremia clinical encounters already capture in the allowed visits. + const viremiaEncounterFilter = visitType.encounterTypes.allowedEncounters.filter( + (encounterType) => { + return [ + '8d5b2be0-c2cc-11de-8d13-0010c6dffd0f', + '4e7553b4-373d-452f-bc89-3f4ad9a01ce7', + '8d5b3108-c2cc-11de-8d13-0010c6dffd0f' + ].includes(encounterType.uuid); + } + ); + + if ( + Array.isArray(viremiaEncounterFilter) && + viremiaEncounterFilter.length === 0 + ) { + this.isViremicHighVL = true; + } if ( visitType && 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 213903d83..9bb83dba8 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 @@ -278,11 +278,41 @@ Current weight (kg): {{ hivSummary?.weight !== null ? hivSummary?.weight : 'NONE' }} -
  • - Last PCR status: {{ lastPCRStatus }} +
  • + PCR 1 +
    Age PCR Done: {{ pcrSnapShop?.hiv_dna_pcr_1_at }}M
    +
    PCR Results: {{ pcrSnapShop?.hiv_dna_pcr_1 }}
    +
    + Date Done: {{ hivSummary?.hiv_dna_pcr_1_date | date: 'dd-MM-yyyy' }} +
  • -
  • - Last PCR Date: {{ lastPCRDate | date: 'dd-MM-yyyy' }} +
  • + PCR 2 +
    Age PCR Done: {{ pcrSnapShop?.hiv_dna_pcr_2_at }}M
    +
    PCR Results: {{ pcrSnapShop?.hiv_dna_pcr_2 }}
    +
    + Date Done: {{ hivSummary?.hiv_dna_pcr_2_date | date: 'dd-MM-yyyy' }} +
    +
  • +
  • + PCR 3 +
    Age PCR Done: {{ pcrSnapShop?.hiv_dna_pcr_3_at }}M
    +
    PCR Results: {{ pcrSnapShop?.hiv_dna_pcr_3 }}
    +
    + Date Done: {{ hivSummary?.hiv_dna_pcr_3_date | date: 'dd-MM-yyyy' }} +
  • Current ART Prophylaxis: {{ hivSummary?.cur_arv_meds }} diff --git a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts index 0c1b3edbf..5f717a050 100644 --- a/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts +++ b/src/app/patient-dashboard/hiv/hiv-summary/hiv-summary-latest.component.ts @@ -58,6 +58,14 @@ export class HivSummaryLatestComponent implements OnInit, OnDestroy { public infantFeedingMethod: string; public heiOutCome: string; public pcpProphylaxis: string; + public pcrSnapShop = { + hiv_dna_pcr_1: null, + hiv_dna_pcr_1_at: null, + hiv_dna_pcr_2: null, + hiv_dna_pcr_2_at: null, + hiv_dna_pcr_3: null, + hiv_dna_pcr_3_at: null + }; constructor( private hivSummaryService: HivSummaryService, @@ -243,6 +251,7 @@ export class HivSummaryLatestComponent implements OnInit, OnDestroy { this.infantFeedingMethod = this.getInfantFeedingMethod(); this.heiOutCome = this.getHEIOutcome(); this.pcpProphylaxis = this.getPCPprophylaxis(); + this.getHEIPCRSnapshot(); } } this.getPatientEligibility(this.hivSummary); @@ -469,4 +478,50 @@ export class HivSummaryLatestComponent implements OnInit, OnDestroy { } return 'NONE'; } + + private pcr_status_helper(pcr_status: number): string { + if (pcr_status === 664) { + return 'NEGATIVE'; + } else if (pcr_status === 703) { + return 'POSITIVE'; + } else if (pcr_status === 1118) { + return 'NOT DONE'; + } else if (pcr_status === 1138) { + return 'INDETERMINATE'; + } else if (pcr_status === 1304) { + return 'POOR SAMPLE QUALITY'; + } else { + return 'NONE'; + } + } + + private calculate_age_by_pcr_date(pcr_date: string): number { + const age = Moment(pcr_date).diff( + Moment(this.hivSummary.birth_date), + 'months' + ); + return age; + } + + public getHEIPCRSnapshot(): void { + this.pcrSnapShop.hiv_dna_pcr_1 = this.pcr_status_helper( + this.hivSummary.hiv_dna_pcr_1 + ); + this.pcrSnapShop.hiv_dna_pcr_2 = this.pcr_status_helper( + this.hivSummary.hiv_dna_pcr_2 + ); + this.pcrSnapShop.hiv_dna_pcr_3 = this.pcr_status_helper( + this.hivSummary.hiv_dna_pcr_3 + ); + + this.pcrSnapShop.hiv_dna_pcr_1_at = this.calculate_age_by_pcr_date( + this.hivSummary.hiv_dna_pcr_1_date + ); + this.pcrSnapShop.hiv_dna_pcr_2_at = this.calculate_age_by_pcr_date( + this.hivSummary.hiv_dna_pcr_2_date + ); + this.pcrSnapShop.hiv_dna_pcr_3_at = this.calculate_age_by_pcr_date( + this.hivSummary.hiv_dna_pcr_3_date + ); + } } 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 7cbc151b5..f0c1f2de4 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 @@ -93,24 +93,12 @@

    Last Encounter

    -
    +

    Date: {{ patientData?.encounter_datetime | date: 'dd-MM-yyyy' }}

    -
    +

    Type: {{ @@ -125,8 +113,11 @@

    Last Encounter

    ARV Regimen: {{ patientData?.cur_arv_meds }}

    -
    -

    +

    +

    Last Viral Load: {{ patientData?.latest_vl | zeroVl }} ({{ @@ -135,6 +126,12 @@

    Last Encounter

    >)

    +

    + Age PCR Done: {{ age_of_ped_on_last_pcr }}M +

    Last Encounter

  • -

    RTC Date: {{ patientData?.rtc_date | date: 'dd-MM-yyyy' }}

    +

    + RTC Date: {{ patientData?.rtc_date | date: 'dd-MM-yyyy' }} +

    +

    + Infant Feeding Method: {{ infant_feeding_method }} +

    Disclosure Status: @@ -211,6 +213,14 @@

    Last Encounter

    +
    +

    + PCR Results: + + {{ 'NEGATIVE' }} + +

    +
    Last Encounter
    +
    +
    +

    RTC Date: {{ patientData?.rtc_date | date: 'dd-MM-yyyy' }}

    +
    +
    +

    Date of PCR: {{ last_pcr_date | date: 'dd-MM-yyyy' }}

    +
    +
    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 9a2d15ad2..b07e0bb40 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 @@ -124,6 +124,10 @@ export class HivProgramSnapshotComponent implements OnInit { public prediction: any; public isHEIActive = false; + public age_of_ped_on_last_pcr: number; + public last_pcr_status: string; + public last_pcr_date: string; + public infant_feeding_method: string; constructor( private hivSummaryResourceService: HivSummaryResourceService, @@ -251,6 +255,15 @@ export class HivProgramSnapshotComponent implements OnInit { this.resolveLastEncounterLocation(this.patientData.location_uuid); } } + if (this.isHEIActive) { + this.last_pcr_date = this.getLastPCRDate(); + this.last_pcr_status = this.getLastPCRStatus(); + this.infant_feeding_method = this.getInfantFeedingMethod(); + this.age_of_ped_on_last_pcr = moment(this.last_pcr_date).diff( + moment(this.patientData.birth_date), + 'months' + ); + } }); } @@ -725,4 +738,79 @@ export class HivProgramSnapshotComponent implements OnInit { return latestStatus[0]; } + + public getLastPCRDate(): string { + let last_pcr_date = ''; + + if (this.patientData.hiv_dna_pcr_4_date !== null) { + last_pcr_date = this.patientData.hiv_dna_pcr_4_date; + } else if (this.patientData.hiv_dna_pcr_3_date !== null) { + last_pcr_date = this.patientData.hiv_dna_pcr_3_date; + } else if (this.patientData.hiv_dna_pcr_2_date !== null) { + last_pcr_date = this.patientData.hiv_dna_pcr_2_date; + } else if (this.patientData.hiv_dna_pcr_1_date !== null) { + last_pcr_date = this.patientData.hiv_dna_pcr_1_date; + } else { + return ''; + } + + return last_pcr_date; + } + + public getLastPCRStatus(): string { + let last_pcr_status: number; + + if (this.patientData.hiv_dna_pcr_resulted !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_resulted; + } else if (this.patientData.hiv_dna_pcr_4 !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_4; + } else if (this.patientData.hiv_dna_pcr_3 !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_3; + } else if (this.patientData.hiv_dna_pcr_2 !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_2; + } else if (this.patientData.hiv_dna_pcr_1 !== null) { + last_pcr_status = this.patientData.hiv_dna_pcr_1; + } else { + last_pcr_status = null; + } + if (last_pcr_status === 664) { + return 'NEGATIVE'; + } else if (last_pcr_status === 703) { + return 'POSITIVE'; + } else if (last_pcr_status === 1118) { + return 'NOT DONE'; + } else if (last_pcr_status === 1138) { + return 'INDETERMINATE'; + } else if (last_pcr_status === 1304) { + return 'POOR SAMPLE QUALITY'; + } else { + return 'NONE'; + } + } + + public getInfantFeedingMethod(): string { + const INFANT_FEEDING_METHODS = [ + 'NONE', + 'EXPRESSED BREASTMILK', + 'WEANED', + 'INFANT FORMULA', + 'BREASTFEEDING PREDOMINATELY', + 'MIXED FEEDING', + 'BREASTFEEDING EXCLUSIVELY', + 'COW MILK', + 'REGULAR FOOD', + 'BREASTFEEDING', + 'LIQUID FOODS OTHER THAN BREAST MILK', + 'WATER', + 'SOLID FOOD', + 'UJI', + 'OTHER NON-CODED', + 'COMPLEMENTARY FEEDING', + 'PLUMPY NUT', + 'NEVER BREASTFED', + 'CHILD ON REPLACEMENT FEEDING' + ]; + + return INFANT_FEEDING_METHODS[this.patientData.infant_feeding_method]; + } }