From c674777f0e4e151ac8c2dab06c31d46210a67404 Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:05:25 +0300 Subject: [PATCH 1/5] 2.17.3-prerelease --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 00881c608..9e3acd904 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ngx-amrs", - "version": "2.17.2", + "version": "2.17.3-prerelease", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 5b81cbaad..5b5a03cf8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngx-amrs", - "version": "2.17.2", + "version": "2.17.3-prerelease", "scripts": { "ng": "ng", "start": "ng serve --host 0.0.0.0 --port 3000", From e10a08043381fac3ab6511b2e89d0e62753d91ae Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:42:40 +0300 Subject: [PATCH 2/5] POC-534: Introduced Adult Program --- src/app/constants/program.constants.ts | 7 + .../formentry-referrals-handler.service.ts | 2 +- .../department-programs-config.json | 58 +- .../program-visits-config.json | 555 +----------------- 4 files changed, 11 insertions(+), 611 deletions(-) diff --git a/src/app/constants/program.constants.ts b/src/app/constants/program.constants.ts index 3dee969d2..bd9c93ac5 100644 --- a/src/app/constants/program.constants.ts +++ b/src/app/constants/program.constants.ts @@ -12,6 +12,12 @@ const STANDARD_HIV_PROGRAM: Program = { dept: 'HIV', compatibleWithOtherDeptPrograms: false }; +const ADULT_PROGRAM: Program = { + uuid: 'fa96b074-e058-44ca-81e5-02f5ea144319', + name: 'ADULT PROGRAM', + dept: 'HIV', + compatibleWithOtherDeptPrograms: false +}; const HIV_DIFFERENTIATED_CARE_PROGRAM: Program = { uuid: '334c9e98-173f-4454-a8ce-f80b20b7fdf0', name: 'HIV DIFFERENTIATED CARE PROGRAM', @@ -108,6 +114,7 @@ const NUTRITION_PROGRAM: Program = { export const Programs = { PMTCT_PROGRAM, STANDARD_HIV_PROGRAM, + ADULT_PROGRAM, HIV_DIFFERENTIATED_CARE_PROGRAM, VIREMIA_PROGRAM, HIV_TRANSIT_PROGRAM, 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..0da2fc0b3 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 @@ -32,7 +32,7 @@ import { FormUuids } from './../../../constants/forms.constants'; export class FormentryReferralsHandlerService { private PMTCT_PROGRAM: Program = Programs.PMTCT_PROGRAM; private STANDARD_PROGRAM: Program = Programs.STANDARD_HIV_PROGRAM; - + private ADULT_PROGRAM: Program = Programs.ADULT_PROGRAM; constructor( public diffCareReferralService: DifferentiatedCareReferralService, public localStorageService: LocalStorageService, diff --git a/src/app/program-visit-encounter-search/department-programs-config.json b/src/app/program-visit-encounter-search/department-programs-config.json index 1781dc95b..2d8d1f4d5 100644 --- a/src/app/program-visit-encounter-search/department-programs-config.json +++ b/src/app/program-visit-encounter-search/department-programs-config.json @@ -3,64 +3,8 @@ "name": "HIV", "programs": [ { - "uuid": "781d85b0-1359-11df-a1f1-0026b9348838", + "uuid": "fa96b074-e058-44ca-81e5-02f5ea144319", "name": "HIV TREATMENT" - }, - { - "uuid": "f7793d42-11ac-4cfd-9b35-e0a21a7a7c31", - "name": "RESISTANCE CLINIC PROGRAM" - }, - { - "uuid": "781d897a-1359-11df-a1f1-0026b9348838", - "name": "PREVENTION OF MOTHER-TO-CHILD TRANSMISSION OF HIV" - }, - { - "uuid": "96047aaf-7ab3-45e9-be6a-b61810fe617d", - "name": "PEP PROGRAM" - }, - { - "uuid": "c19aec66-1a40-4588-9b03-b6be55a8dd1d", - "name": "PrEP PROGRAM" - }, - { - "uuid": "334c9e98-173f-4454-a8ce-f80b20b7fdf0", - "name": "HIV DIFFERENTIATED CARE PROGRAM" - }, - { - "uuid": "96ba279b-b23b-4e78-aba9-dcbd46a96b7b", - "name": "HIV TRANSIT PROGRAM" - }, - { - "uuid": "781d8880-1359-11df-a1f1-0026b9348838", - "name": "EXPRESS CARE PROGRAM" - }, - { - "uuid": "c6bf3625-de80-4a88-a913-38273e300a55", - "name": "HIV OUTREACH PROGRAM" - }, - { - "uuid": "c37ca57d-5f7e-41e3-93e0-2cd6cd01de91", - "name": "HIV COMMUNITY BASED CARE RESEARCH PROGRAM" - }, - { - "uuid": "4480c782-ef05-4d88-b2f8-c892c99438f6", - "name": "ACTG PROGRAM" - }, - { - "uuid": "c4246ff0-b081-460c-bcc5-b0678012659e", - "name": "VIREMIA PROGRAM" - }, - { - "uuid": "781d8768-1359-11df-a1f1-0026b9348838", - "name": "OVC PROGRAM" - }, - { - "uuid": "0904172d-0b6a-40df-b8a2-b3653d16dc45", - "name": "TURBO DIFFERENTIATED CARE PILOT PROGRAM" - }, - { - "uuid": "6ff0a6dc-ef8f-467a-86fc-9d9b263d8761", - "name": "PHARMACOVIGILANCE PROGRAM" } ] }, diff --git a/src/app/program-visit-encounter-search/program-visits-config.json b/src/app/program-visit-encounter-search/program-visits-config.json index 049b072d7..78877a98d 100644 --- a/src/app/program-visit-encounter-search/program-visits-config.json +++ b/src/app/program-visit-encounter-search/program-visits-config.json @@ -1,6 +1,6 @@ { - "781d85b0-1359-11df-a1f1-0026b9348838": { - "name": "STANDARD HIV TREATMENT", + "fa96b074-e058-44ca-81e5-02f5ea144319": { + "name": "ADULT PROGRAM", "dataDependencies": [ "patient", "enrollment", @@ -72,10 +72,6 @@ { "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "8d5b2dde-c2cc-11de-8d13-0010c6dffd0f", - "display": "PEDSINITIAL" } ] }, @@ -91,10 +87,6 @@ { "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "f6257ec8-706d-4342-ada4-ddc2f6478470", - "display": "PEDSTRANSFERIN" } ] }, @@ -110,67 +102,6 @@ { "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "8d5b3108-c2cc-11de-8d13-0010c6dffd0f", - "display": "PEDSRETURN" - } - ] - }, - { - "uuid": "03f5b165-c577-4e1e-b7ae-acfc3ba18ebf", - "name": "Youth HIV Initial Visit ", - "allowedIf": "age >= 10 && age <= 20 && programLocation === intendedVisitLocationUuid && isFirstAMPATHHIVVisit", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", - "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "fc8c1694-90fc-46a8-962b-73ce9a99a78f", - "display": "YOUTHINITIAL" - } - ] - }, - { - "uuid": "b27e13f7-7118-4c0d-b9d6-b759495991d6", - "name": "Youth Transfer In Visit ", - "allowedIf": "age >= 10 && age <= 20 && programLocation === intendedVisitLocationUuid && !isFirstAMPATHHIVVisit && previousHIVClinicallocation !== programLocation", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", - "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "a0c2fe63-7be4-4067-87cc-a8654deb552e", - "display": "YOUTHTRANSFERIN" - } - ] - }, - { - "uuid": "824cf3e6-dd16-4767-ba41-2e04dede349e", - "name": "Youth HIV Return Visit ", - "allowedIf": "age >= 10 && age <= 20 && programLocation === intendedVisitLocationUuid && !isFirstAMPATHHIVVisit", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", - "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "4e7553b4-373d-452f-bc89-3f4ad9a01ce7", - "display": "YOUTHRETURN" } ] }, @@ -234,14 +165,6 @@ "uuid": "8d5b2be0-c2cc-11de-8d13-0010c6dffd0f", "display": "ADULTRETURN" }, - { - "uuid": "4e7553b4-373d-452f-bc89-3f4ad9a01ce7", - "display": "YOUTHRETURN" - }, - { - "uuid": "8d5b3108-c2cc-11de-8d13-0010c6dffd0f", - "display": "PEDSRETURN" - }, { "uuid": "3c8cd5d4-cdc2-4136-8326-224b682b6543", "display": "MDTFORM" @@ -249,479 +172,5 @@ ] } ] - }, - "725b5193-3452-43fc-aca3-6a80432d9bfa": { - "name": "ONCOLOGY PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [] - }, - "fc15ac01-5381-4854-bf5e-917c907aa77f": { - "name": "CDM PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "8072afd0-0cd9-409e-914d-1833e83943f7", - "name": "CDM Visit", - "encounterTypes": [] - } - ] - }, - "781d897a-1359-11df-a1f1-0026b9348838": { - "name": "PREVENTION OF MOTHER-TO-CHILD TRANSMISSION OF HIV", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "45b55bfd-84f5-4783-b7fb-ac4d82832c24", - "allowedIf": "programLocation === intendedVisitLocationUuid", - "name": "PMTCT Visit ", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", - "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "7bf4632a-00e8-4c0a-a296-c3977fdd6671", - "display": "PMTCTENCOUNTER" - }, - { - "uuid": "5e019c94-0f80-49b7-8593-28100eb4f787", - "display": "HEIFOLLOWUP" - }, - { - "uuid": "b1e9ed0f-5222-4d47-98f7-5678b8a21ebd", - "display": "PMTCTPOSTNATAL " - }, - { - "uuid": "df553c4a-1350-11df-a1f1-0026b9348838", - "display": "PMTCTANC" - } - ] - } - ] - }, - "781d8768-1359-11df-a1f1-0026b9348838": { - "name": "OVC PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [] - }, - "781d8a88-1359-11df-a1f1-0026b9348838": { - "name": "BSG PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [] - }, - "96047aaf-7ab3-45e9-be6a-b61810fe617d": { - "name": "PEP PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "58f20c53-aac7-4e73-bd7a-97986435e570", - "name": "PEP Visit ", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "c3a78744-f94a-4a25-ac9d-1c48df887895", - "display": "PEPINITIAL" - }, - { - "uuid": "f091b833-9e1a-4eef-8364-fc289095a832", - "display": "PEPRETURN" - } - ] - } - ] - }, - "c19aec66-1a40-4588-9b03-b6be55a8dd1d": { - "name": "PrEP PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "330d9739-833d-48a8-8986-f1069c320194", - "name": "PrEP Visit ", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "00ee2fd6-9c95-4ffc-ab31-6b1ce2dede4d", - "display": "PREPINITIAL" - }, - { - "uuid": "ddd96f1c-524f-4caa-81a6-1a6f9789a4bc", - "display": "PREPRETURN" - } - ] - } - ] - }, - "334c9e98-173f-4454-a8ce-f80b20b7fdf0": { - "name": "HIV DIFFERENTIATED CARE PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "9bf3fadd-4938-40fa-a093-4e01bf197876", - "name": "Differentiated Care Clinical Visit ", - "allowedIf": "programLocation === intendedVisitLocationUuid", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", - "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "e3202a01-8cd5-4224-b0dd-760557f85310", - "display": "DIFFERENTIATEDCARE" - } - ] - }, - { - "uuid": "6bf34991-7414-4b5e-ad75-ca217d4c4939", - "name": "Differentiated Care Pharmacy Visit ", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", - "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "e3202a01-8cd5-4224-b0dd-760557f85310", - "display": "DIFFERENTIATEDCARE" - } - ] - } - ] - }, - "96ba279b-b23b-4e78-aba9-dcbd46a96b7b": { - "name": "HIV TRANSIT PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "52e67f49-4ec3-41b2-bfe2-93144ea03eb2", - "name": "Transit Care Visit ", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "704abe82-d00f-4fd3-a5fd-616c53d78b48", - "display": "TRANSITVISIT" - } - ] - } - ] - }, - "142939b0-28a9-4649-baf9-a9d012bf3b3d": { - "name": "BREAST CANCER SCREENING PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "55d8d186-3f74-43ad-9e40-eb16bb52b596", - "name": "Breast Cancer Screening ", - "encounterTypes": [ - { - "uuid": "fc08ae1c-4588-443b-ae46-856bb20a5ee9", - "display": "OncologyDiagnosisChange" - }, - { - "uuid": "9bc0fa73-474e-45ab-bdac-7282e95d856f", - "display": "ONCOLOGYDYSPLASIA" - }, - { - "uuid": "d17b3adc-0837-4ac6-862b-0953fc664cb8", - "display": "OncologyInitial " - }, - { - "uuid": "c7fd9ee7-c376-436d-a252-01e89cc51112", - "display": "OncologyLabandChemoTracking " - }, - { - "uuid": "eeb9600c-314f-4071-9122-133ff3da37bb", - "display": "OncologyReturn" - }, - { - "uuid": "49bd34db-39e8-4b70-bbba-676ccaf9fdd3", - "display": "OncologyReturnWithNewDiagnosticInfo" - }, - { - "uuid": "f8e35989-74b7-4a18-87ac-31e98b8d9004", - "display": "ONCOLOGYTRIAGE" - }, - { - "uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d", - "display": "ONCOLOGYVIA" - } - ] - } - ] - }, - "cad71628-692c-4d8f-8dac-b2e20bece27f": { - "name": "CERVICAL CANCER SCREENING PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "8103a0f3-a3d3-4453-ac3e-aaecd542ccd1", - "name": "Cervical Cancer Screening ", - "encounterTypes": [ - { - "uuid": "fc08ae1c-4588-443b-ae46-856bb20a5ee9", - "display": "OncologyDiagnosisChange" - }, - { - "uuid": "9bc0fa73-474e-45ab-bdac-7282e95d856f", - "display": "ONCOLOGYDYSPLASIA" - }, - { - "uuid": "d17b3adc-0837-4ac6-862b-0953fc664cb8", - "display": "OncologyInitial " - }, - { - "uuid": "c7fd9ee7-c376-436d-a252-01e89cc51112", - "display": "OncologyLabandChemoTracking " - }, - { - "uuid": "eeb9600c-314f-4071-9122-133ff3da37bb", - "display": "OncologyReturn" - }, - { - "uuid": "49bd34db-39e8-4b70-bbba-676ccaf9fdd3", - "display": "OncologyReturnWithNewDiagnosticInfo" - }, - { - "uuid": "f8e35989-74b7-4a18-87ac-31e98b8d9004", - "display": "ONCOLOGYTRIAGE" - }, - { - "uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d", - "display": "ONCOLOGYVIA" - } - ] - } - ] - }, - "43b42170-b3ce-4e03-9390-6bd78384ac06": { - "name": "CERVICAL CANCER TREATMENT PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "b12cb85e-0c1e-4372-92ed-3bedcec1b105", - "name": "Cervical Cancer Treatment ", - "encounterTypes": [ - { - "uuid": "5fa823ce-7592-482f-a0aa-361abf326ade", - "display": "HematOncologyTriage" - }, - { - "uuid": "eeb9600c-314f-4071-9122-133ff3da37bb", - "display": "OncologyReturn" - }, - { - "uuid": "d17b3adc-0837-4ac6-862b-0953fc664cb8", - "display": "OncologyInitial " - } - ] - } - ] - }, - "88566621-828f-4569-9af5-c54f8237750a": { - "name": "BREAST CANCER TREATMENT PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "e0d41d1c-47b5-4c97-b3c7-ba4e4268d9e6", - "name": "Breast Cancer Treatment ", - "encounterTypes": [ - { - "uuid": "9ad5292c-14c3-489b-9c14-5f816e839691", - "display": "BreastCancerInitial" - }, - { - "uuid": "e58469f1-f6be-4e53-a843-fb06f93c60ba", - "display": "BreastCancerReturn" - }, - { - "uuid": "5fa823ce-7592-482f-a0aa-361abf326ade", - "display": "HematOncologyTriage" - } - ] - } - ] - }, - "e48b266e-4d80-41f8-a56a-a8ce5449ebc6": { - "name": "SICKLE CELL PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "ba3bd879-c66d-4288-80d4-8302d2b823a8", - "name": "Sickle cell ", - "encounterTypes": [ - { - "uuid": "5fa823ce-7592-482f-a0aa-361abf326ade", - "display": "HematOncologyTriage" - }, - { - "uuid": "ba5a15eb-576f-496b-a58d-e30b802a5da5", - "display": "SICKLECELLINITIAL" - }, - { - "uuid": "3a0e7e4e-426e-4dc7-8f60-9114c43432eb", - "display": "SICKLECELLRETURN" - } - ] - } - ] - }, - "698b7153-bff3-4931-9638-d279ca47b32e": { - "name": "MULTIPLE MYELOMA PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "055436f7-cdc5-4e74-bef9-a8a06c746c3a", - "name": "Multiple Myeloma ", - "encounterTypes": [ - { - "uuid": "5fa823ce-7592-482f-a0aa-361abf326ade", - "display": "HematOncologyTriage" - }, - { - "uuid": "bf762b3e-b60a-436a-a40b-f874c59869ec", - "display": "MULTIPLEMYELOMAINITIAL" - }, - { - "uuid": "50f307c4-b92e-4a41-bbbb-5cee1bd1c561", - "display": "MULTIPLEMYELOMARETURN" - } - ] - } - ] - }, - "a3610ba4-9811-46b3-9628-83ec9310be13": { - "name": "HEMOPHILIA PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "4c5cd268-0986-444e-8122-1160c4605884", - "name": "Hemophilia ", - "encounterTypes": [ - { - "uuid": "5fa823ce-7592-482f-a0aa-361abf326ade", - "display": "HematOncologyTriage" - }, - { - "uuid": "3945005a-c24f-478b-90ec-4af84ffcdf6b", - "display": "HEMOPHILIAINITIAL" - }, - { - "uuid": "36927b3c-db32-4063-90df-e45640e9aabc", - "display": "HEMOPHILIARETURN" - } - ] - } - ] - }, - "781d8880-1359-11df-a1f1-0026b9348838": { - "name": "EXPRESS CARE PROGRAM", - "dataDependencies": [ - "patient", - "enrollment", - "hivLastTenClinicalEncounters" - ], - "visitTypes": [ - { - "uuid": "e2c37c46-3ee9-4cff-9af6-aa5c41fb30da", - "name": "Express Care Visit ", - "encounterTypes": [ - { - "uuid": "a44ad5e2-b3ec-42e7-8cfa-8ba3dbcf5ed7", - "display": "HIVTRIAGE" - }, - { - "uuid": "cbe2d31d-2201-44ce-b52e-fbd5dc7cff33", - "display": "TRANSFERENCOUNTER" - }, - { - "uuid": "df554398-1350-11df-a1f1-0026b9348838", - "display": "ECSTABLE" - } - ] - } - ] } } From bfb1a693623e1f84d02eaabe77f8df23b62fc8ec Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Mon, 11 Dec 2023 09:58:42 +0300 Subject: [PATCH 3/5] POC-534: added new model --- src/app/constants/model.constants.ts | 10 ++++++++++ src/app/constants/program.constants.ts | 7 +++++++ src/app/interfaces/model.interface.ts | 4 ++++ .../department-programs-config.json | 4 ++-- .../program-visits-config.json | 4 ++-- 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/app/constants/model.constants.ts create mode 100644 src/app/interfaces/model.interface.ts diff --git a/src/app/constants/model.constants.ts b/src/app/constants/model.constants.ts new file mode 100644 index 000000000..7243dab19 --- /dev/null +++ b/src/app/constants/model.constants.ts @@ -0,0 +1,10 @@ +import { Model } from '../interfaces/model.interface'; + +const STANDARD_CARE_MODEL: Model = { + uuid: '520825cf-d045-4bbf-a7f5-a7018f14dd76', + name: 'STANDARD CARE MODEL' +}; + +export const Models = { + STANDARD_CARE_MODEL +}; diff --git a/src/app/constants/program.constants.ts b/src/app/constants/program.constants.ts index bd9c93ac5..e1d37f414 100644 --- a/src/app/constants/program.constants.ts +++ b/src/app/constants/program.constants.ts @@ -6,6 +6,12 @@ const PMTCT_PROGRAM: Program = { dept: 'HIV', compatibleWithOtherDeptPrograms: false }; +const STANDARD_CARE_MODEL: Program = { + uuid: '520825cf-d045-4bbf-a7f5-a7018f14dd76', + name: 'STANDARD CARE MODEL', + dept: 'HIV', + compatibleWithOtherDeptPrograms: false +}; const STANDARD_HIV_PROGRAM: Program = { uuid: '781d85b0-1359-11df-a1f1-0026b9348838', name: 'STANDARD HIV TREATMENT', @@ -115,6 +121,7 @@ export const Programs = { PMTCT_PROGRAM, STANDARD_HIV_PROGRAM, ADULT_PROGRAM, + STANDARD_CARE_MODEL, HIV_DIFFERENTIATED_CARE_PROGRAM, VIREMIA_PROGRAM, HIV_TRANSIT_PROGRAM, diff --git a/src/app/interfaces/model.interface.ts b/src/app/interfaces/model.interface.ts new file mode 100644 index 000000000..33984d2a3 --- /dev/null +++ b/src/app/interfaces/model.interface.ts @@ -0,0 +1,4 @@ +export interface Model { + uuid: string; + name: string; +} diff --git a/src/app/program-visit-encounter-search/department-programs-config.json b/src/app/program-visit-encounter-search/department-programs-config.json index 2d8d1f4d5..a4d65710f 100644 --- a/src/app/program-visit-encounter-search/department-programs-config.json +++ b/src/app/program-visit-encounter-search/department-programs-config.json @@ -3,8 +3,8 @@ "name": "HIV", "programs": [ { - "uuid": "fa96b074-e058-44ca-81e5-02f5ea144319", - "name": "HIV TREATMENT" + "uuid": "520825cf-d045-4bbf-a7f5-a7018f14dd76", + "name": "STANDARD CARE MODEL" } ] }, diff --git a/src/app/program-visit-encounter-search/program-visits-config.json b/src/app/program-visit-encounter-search/program-visits-config.json index 78877a98d..d0fe10d10 100644 --- a/src/app/program-visit-encounter-search/program-visits-config.json +++ b/src/app/program-visit-encounter-search/program-visits-config.json @@ -1,6 +1,6 @@ { - "fa96b074-e058-44ca-81e5-02f5ea144319": { - "name": "ADULT PROGRAM", + "520825cf-d045-4bbf-a7f5-a7018f14dd76": { + "name": "STANDARD CARE MODEL", "dataDependencies": [ "patient", "enrollment", From bbc52a9730d48c30200f795f943b28fd6cfe3f72 Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Wed, 24 Jan 2024 11:47:22 +0300 Subject: [PATCH 4/5] POC-534: completed registration Adult Program --- .../common/visit/visit.component.html | 2 +- .../common/visit/visit.component.ts | 1 + .../base/program-manager-base.component.ts | 45 +++++++++++-- .../new-program/new-program.component.html | 65 +++++++++++++++++-- .../new-program/new-program.component.ts | 27 ++++++-- .../schema/patient.dashboard.conf.json | 10 +++ 6 files changed, 132 insertions(+), 18 deletions(-) diff --git a/src/app/patient-dashboard/common/visit/visit.component.html b/src/app/patient-dashboard/common/visit/visit.component.html index 812befc80..2f7b7520e 100644 --- a/src/app/patient-dashboard/common/visit/visit.component.html +++ b/src/app/patient-dashboard/common/visit/visit.component.html @@ -2,7 +2,7 @@ Patient enrolled in - {{ toTitleCase(currentEnrollment?.openmrsModel?.display) }} + {{ toTitleCase(modelEnrolled) }} Select Department class="btn btn-primary pull-right" (click)="goToProgram()" > - Continue + Continue To Program + +   + + + + + +
+
+ +
+

Check Patient Status

+
+
+
+
+
+
+ + + + +
+
+
+
+
+
+ +  
@@ -82,16 +139,16 @@

Select Program

 
diff --git a/src/app/program-manager/new-program/new-program.component.ts b/src/app/program-manager/new-program/new-program.component.ts index f81c0344b..f3748d921 100644 --- a/src/app/program-manager/new-program/new-program.component.ts +++ b/src/app/program-manager/new-program/new-program.component.ts @@ -42,6 +42,7 @@ export class NewProgramComponent public unenrollExpressely = false; public enrolling = false; public isReferral = false; + public patientStatus: any; public isButtonVisible = true; public maxDate: string; public reasonForUnenroll = ` @@ -102,8 +103,12 @@ export class NewProgramComponent const dept = JSON.parse( this.localStorageService.getItem('userDefaultDepartment') ); + this.department = dept[0].itemName; + this.departmentid = dept[0].id; + this.selectDepartment(dept[0].itemName); + this.getEnrollmentQuestion(this.departmentid); if (this.route.snapshot.queryParams.program) { this.selectProgram(this.route.snapshot.queryParams.program); } @@ -141,7 +146,7 @@ export class NewProgramComponent selectedProgram: this.selectedProgram, programVisitConfig: this.programVisitConfig }); - this.checkForRequiredQuestions(); + // this.checkForRequiredQuestions(); this.checkIfEnrollmentIsAllowed(); this.goToDetails(); } @@ -150,10 +155,11 @@ export class NewProgramComponent if (this.department) { this.removeMessage(); this.availableDepartmentPrograms = _.orderBy( - this.getProgramsByDepartmentName(), + this.getProgramsByDepartmentName(this.patientStatus), ['name'], ['asc'] ); + if (this.availableDepartmentPrograms.length === 0) { this.showMessage('No Active programs in this department'); } else { @@ -188,7 +194,10 @@ export class NewProgramComponent } public goBack() { - if (this.currentStep === 4) { + if (this.currentStep === 5) { + this.currentStep = this.currentStep - 2; + this.jumpStep = this.currentStep; + } else if (this.currentStep === 3) { this.currentStep = this.currentStep - 2; this.jumpStep = this.currentStep; } else { @@ -198,8 +207,8 @@ export class NewProgramComponent public goToDetails() { // incompatibility step has 'go back' issue. enforce the current step here - this.currentStep = 2; - this.jumpStep = -1; + this.currentStep = 3; + this.jumpStep = 1; if (this.program) { this.unenrollAndGoToDetails(); } else { @@ -262,10 +271,12 @@ export class NewProgramComponent public startVisit() { const dashboardRoutesConfig: any = this.routesProviderService .patientDashboardConfig; + const route: any = _.find( dashboardRoutesConfig.programs, (_r: any) => _r['programUuid'] === this.newlyEnrolledProgram.program.uuid ); + const _route = '/patient-dashboard/patient/' + this.patient.uuid + @@ -372,10 +383,14 @@ export class NewProgramComponent this.requiredProgramQuestions = this.programVisitConfig.enrollmentOptions.requiredProgramQuestions; } } - + public onRequiredDeptQuestionChange(question) { + this.patientStatus = question.value; + } public onRequiredQuestionChange(question) { question = this.checkRelatedQuestions(question); // pick questions that have wrong answer + this.patientStatus = question.value; + const questionWithWrongAnswer = _.find( this.requiredProgramQuestions, (q) => { diff --git a/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json b/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json index eccbf775c..df5e7a02d 100644 --- a/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json +++ b/src/app/shared/dynamic-route/schema/patient.dashboard.conf.json @@ -68,6 +68,16 @@ } ] }, + { + "programName": "ADULT PROGRAM", + "programUuid": "fa96b074-e058-44ca-81e5-02f5ea144319", + "baseRoute": "fa96b074-e058-44ca-81e5-02f5ea144319", + "alias": "hiv", + "published": true, + "requiresPatientEnrollment": true, + "shared-routes-class": "hiv", + "routes": [] + }, { "programName": "Standard HIV Treatment", "programUuid": "781d85b0-1359-11df-a1f1-0026b9348838", From 206de8f31a68b28e1ac43f7bbdbb51ced20f295b Mon Sep 17 00:00:00 2001 From: Faith Kamau <121166087+hiqedme@users.noreply.github.com> Date: Tue, 12 Mar 2024 12:23:51 +0300 Subject: [PATCH 5/5] POC-534: linked models on form assignation --- src/app/constants/model.constants.ts | 2 +- src/app/constants/program.constants.ts | 25 +- .../openmrs-api/patient-resource.service.ts | 7 +- .../formentry-referrals-handler.service.ts | 3 +- .../common/formentry/formentry.component.ts | 57 ++- .../common/forms/form-list.service.ts | 3 +- .../sources/common-vitals.source.ts | 7 + .../todays-vitals/todays-vitals.service.ts | 3 + .../common/visit/visit.component.ts | 30 +- .../landing-page.component.html | 4 +- .../programs/program.service.ts | 1 + .../services/patient.service.ts | 1 + .../base/program-manager-base.component.ts | 11 +- .../enrollment-shortcut.component.html | 4 +- .../new-program/new-program.component.ts | 1 + .../patient-referral.service.ts | 1 + .../program-manager.service.ts | 1 + .../department-programs-config.json | 10 +- .../program-visits-config.json | 350 +++++++++++++++++- .../schema/patient.dashboard.conf.json | 26 +- 20 files changed, 520 insertions(+), 27 deletions(-) diff --git a/src/app/constants/model.constants.ts b/src/app/constants/model.constants.ts index 7243dab19..b0bd56eb4 100644 --- a/src/app/constants/model.constants.ts +++ b/src/app/constants/model.constants.ts @@ -1,7 +1,7 @@ import { Model } from '../interfaces/model.interface'; const STANDARD_CARE_MODEL: Model = { - uuid: '520825cf-d045-4bbf-a7f5-a7018f14dd76', + uuid: 'f0faccb7-657e-413c-abad-54f13409d106', name: 'STANDARD CARE MODEL' }; diff --git a/src/app/constants/program.constants.ts b/src/app/constants/program.constants.ts index e1d37f414..da29b4177 100644 --- a/src/app/constants/program.constants.ts +++ b/src/app/constants/program.constants.ts @@ -7,23 +7,31 @@ const PMTCT_PROGRAM: Program = { compatibleWithOtherDeptPrograms: false }; const STANDARD_CARE_MODEL: Program = { - uuid: '520825cf-d045-4bbf-a7f5-a7018f14dd76', + uuid: 'f0faccb7-657e-413c-abad-54f13409d106', name: 'STANDARD CARE MODEL', dept: 'HIV', compatibleWithOtherDeptPrograms: false }; -const STANDARD_HIV_PROGRAM: Program = { - uuid: '781d85b0-1359-11df-a1f1-0026b9348838', - name: 'STANDARD HIV TREATMENT', +const AHD_MODEL: Program = { + uuid: '4545685e-65f6-48c4-a6b4-860cea88c4d4', + name: 'ADVANCED HIV DISEASE MODEL', dept: 'HIV', compatibleWithOtherDeptPrograms: false }; -const ADULT_PROGRAM: Program = { - uuid: 'fa96b074-e058-44ca-81e5-02f5ea144319', - name: 'ADULT PROGRAM', +const VIREMIA_MODEL: Program = { + uuid: '30521f4d-0708-4644-9e88-a108a830a5fd', + name: 'VIREMIA MODEL', dept: 'HIV', compatibleWithOtherDeptPrograms: false }; + +const STANDARD_HIV_PROGRAM: Program = { + uuid: '781d85b0-1359-11df-a1f1-0026b9348838', + name: 'STANDARD HIV TREATMENT', + dept: 'HIV', + compatibleWithOtherDeptPrograms: false +}; + const HIV_DIFFERENTIATED_CARE_PROGRAM: Program = { uuid: '334c9e98-173f-4454-a8ce-f80b20b7fdf0', name: 'HIV DIFFERENTIATED CARE PROGRAM', @@ -120,8 +128,9 @@ const NUTRITION_PROGRAM: Program = { export const Programs = { PMTCT_PROGRAM, STANDARD_HIV_PROGRAM, - ADULT_PROGRAM, STANDARD_CARE_MODEL, + AHD_MODEL, + VIREMIA_MODEL, HIV_DIFFERENTIATED_CARE_PROGRAM, VIREMIA_PROGRAM, HIV_TRANSIT_PROGRAM, diff --git a/src/app/openmrs-api/patient-resource.service.ts b/src/app/openmrs-api/patient-resource.service.ts index 0e849f9a1..f1f541b95 100644 --- a/src/app/openmrs-api/patient-resource.service.ts +++ b/src/app/openmrs-api/patient-resource.service.ts @@ -61,9 +61,14 @@ export class PatientResourceService { v && v.length > 0 ? v : this.v ); - return this.http.get(url, { + // return this.http.get(url, { + // params: params + // }); + const parameters = this.http.get(url, { params: params }); + + return parameters; } public saveUpdatePatientIdentifier( uuid, 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 0da2fc0b3..adb3f1a93 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 @@ -32,7 +32,7 @@ import { FormUuids } from './../../../constants/forms.constants'; export class FormentryReferralsHandlerService { private PMTCT_PROGRAM: Program = Programs.PMTCT_PROGRAM; private STANDARD_PROGRAM: Program = Programs.STANDARD_HIV_PROGRAM; - private ADULT_PROGRAM: Program = Programs.ADULT_PROGRAM; + private AHD_MODEL: Program = Programs.AHD_MODEL; constructor( public diffCareReferralService: DifferentiatedCareReferralService, public localStorageService: LocalStorageService, @@ -151,6 +151,7 @@ export class FormentryReferralsHandlerService { enrolledIncompatiblePrograms.push(enrolledProgram); } }); + console.log('enrolledIncompatiblePrograms', enrolledIncompatiblePrograms); batchProgramUnenrollments.push( this.programManagerService.editProgramEnrollments( 'stop', diff --git a/src/app/patient-dashboard/common/formentry/formentry.component.ts b/src/app/patient-dashboard/common/formentry/formentry.component.ts index 87fe5e185..061ca6414 100644 --- a/src/app/patient-dashboard/common/formentry/formentry.component.ts +++ b/src/app/patient-dashboard/common/formentry/formentry.component.ts @@ -37,7 +37,7 @@ import { FormSubmissionService } from './form-submission.service'; import { MonthlyScheduleResourceService } from '../../../etl-api/monthly-scheduled-resource.service'; import { Patient } from '../../../models/patient.model'; import { PatientService } from '../../services/patient.service'; - +import { ProgramManagerService } from '../../../program-manager/program-manager.service'; import { PatientProgramResourceService } from '../../../etl-api/patient-program-resource.service'; import { PersonResourceService } from '../../../openmrs-api/person-resource.service'; import { RetrospectiveDataEntryService } from '../../../retrospective-data-entry/services/retrospective-data-entry.service'; @@ -53,6 +53,8 @@ import { Covid19StatusSummary } from './../../../interfaces/covid-19-summary.int // constants import { FormUuids } from './../../../constants/forms.constants'; +import { ComponentResolver } from 'ag-grid/dist/lib/components/framework/componentResolver'; +import { Console } from 'console'; interface RefProgram { uuid: string; @@ -155,6 +157,7 @@ export class FormentryComponent implements OnInit, OnDestroy { private referralsHandler: FormentryReferralsHandlerService, private formDataSourceService: FormDataSourceService, private formSubmissionService: FormSubmissionService, + private programManagerService: ProgramManagerService, private monthlyScheduleResourceService: MonthlyScheduleResourceService, private patientService: PatientService, private patientTransferService: PatientTransferService, @@ -500,7 +503,7 @@ export class FormentryComponent implements OnInit, OnDestroy { if ( encounterProvider.length > 0 && this.compiledSchemaWithEncounter && - this.compiledSchemaWithEncounter.provider !== {} + this.compiledSchemaWithEncounter.provider.length !== 0 ) { let provider = this.compiledSchemaWithEncounter.provider.uuid; if (retroSettings && retroSettings.enabled) { @@ -672,7 +675,56 @@ export class FormentryComponent implements OnInit, OnDestroy { .subscribe(() => {}); } } + public enrollPatientToNewModel(data: any): void { + let programToEnroll = ''; + let modelSelected = []; + modelSelected = this.form.searchNodeByQuestionId('dsdModel'); + if (modelSelected.length === 0) { + modelSelected = this.form.searchNodeByQuestionId('moreIntense'); // moreIntense + } + const modelUuid = modelSelected[0].initialValue.value.uuid; + + switch (modelUuid) { + case 'c8b9b024-1a3a-47a4-a2aa-fcaf3053ea27': + programToEnroll = '4545685e-65f6-48c4-a6b4-860cea88c4d4'; // AHD + break; + case '520825cf-d045-4bbf-a7f5-a7018f14dd76': + programToEnroll = 'f0faccb7-657e-413c-abad-54f13409d106'; // Standard + break; + case 'fe239aa1-f5d4-4d15-83a1-ce417e9fb879': + programToEnroll = '30521f4d-0708-4644-9e88-a108a830a5fd'; // viremia + break; + } + console.log('Response:', programToEnroll); + const enrollpayload = { + programUuid: programToEnroll, + patient: this.patient, + dateEnrolled: '', + dateCompleted: '', + location: this.userDefaultPropertiesService.getCurrentUserDefaultLocationObject() + .uuid, + enrollmentUuid: '' + }; + console.log('Response:', enrollpayload); + this.referralsHandler + .getPatientProgramVisitConfigs(this.patient, programToEnroll) + .pipe(take(1)) + .subscribe((programConfig) => { + console.log('Response:', programConfig); + this.referralsHandler + .unenrollFromIncompatiblePrograms(this.patient, programConfig) + .subscribe((res) => { + this.programManagerService + .enrollPatient(enrollpayload) + .pipe(take(1)) + .subscribe((program) => { + console.log('Response:', program); + }); + console.log('Response:', res); + }); + }); + } public handleProgramManagerRedirects(data: any): void { const step = ['step', 3]; this.patientTransferService @@ -1410,6 +1462,7 @@ export class FormentryComponent implements OnInit, OnDestroy { this.failedPayloadTypes = null; // this.showSuccessDialog = true; this.updatePatientDemographics(response); + this.enrollPatientToNewModel(response); // handle referrals here this.handleFormReferrals(response); } diff --git a/src/app/patient-dashboard/common/forms/form-list.service.ts b/src/app/patient-dashboard/common/forms/form-list.service.ts index 410204812..f82f0f7cc 100644 --- a/src/app/patient-dashboard/common/forms/form-list.service.ts +++ b/src/app/patient-dashboard/common/forms/form-list.service.ts @@ -64,7 +64,8 @@ export class FormListService { } // comment out /*item.published && */ for all unretired forms (NOTE : ng-forms build) const publishedOpenmrsForms = _.filter(unsortArray, (item) => { - return item.published && !item.retired; + // return item.published && !item.retired; + return !item.retired; }); return publishedOpenmrsForms; diff --git a/src/app/patient-dashboard/common/todays-vitals/sources/common-vitals.source.ts b/src/app/patient-dashboard/common/todays-vitals/sources/common-vitals.source.ts index 5d3eddab4..40783e2db 100644 --- a/src/app/patient-dashboard/common/todays-vitals/sources/common-vitals.source.ts +++ b/src/app/patient-dashboard/common/todays-vitals/sources/common-vitals.source.ts @@ -76,6 +76,13 @@ export class CommonVitalsSource implements VitalSourceInterface { order: 7, value: ob.value.display }); + case 'feb271fc-a47a-4c6c-8888-c0b6c6e08ecd': + return this.vitalModel.createVital({ + name: 'model', + label: 'Model:', + order: 8, + value: ob.value.display + }); default: return this.vitalModel; } diff --git a/src/app/patient-dashboard/common/todays-vitals/todays-vitals.service.ts b/src/app/patient-dashboard/common/todays-vitals/todays-vitals.service.ts index 425539f12..14240c95e 100644 --- a/src/app/patient-dashboard/common/todays-vitals/todays-vitals.service.ts +++ b/src/app/patient-dashboard/common/todays-vitals/todays-vitals.service.ts @@ -32,6 +32,7 @@ export class TodaysVitalsService { const vitalSource = new source(new Vital({}), this.patient); for (const obs of obsArray) { const ob = obs; + if (typeof ob.concept !== 'undefined') { createdVital = vitalSource.getVitals(ob, this.vitalsDataSource); if (typeof createdVital !== 'undefined' && createdVital.name) { @@ -54,7 +55,9 @@ export class TodaysVitalsService { ) ); } + console.log('createdVital:', createdVital); }); + this.applyCompounding(); } diff --git a/src/app/patient-dashboard/common/visit/visit.component.ts b/src/app/patient-dashboard/common/visit/visit.component.ts index 463a9c2bf..8fb3ebbff 100644 --- a/src/app/patient-dashboard/common/visit/visit.component.ts +++ b/src/app/patient-dashboard/common/visit/visit.component.ts @@ -19,6 +19,7 @@ import { BsModalService, BsModalRef } from 'ngx-bootstrap'; import { ViewChild } from '@angular/core'; import { PatientService } from '../../services/patient.service'; import { PatientProgramResourceService } from 'src/app/etl-api/patient-program-resource.service'; +import { ObsResourceService } from 'src/app/openmrs-api/obs-resource.service'; import * as moment from 'moment'; @Component({ @@ -30,7 +31,7 @@ import * as moment from 'moment'; export class VisitComponent implements OnInit, OnDestroy { public currentProgramConfig = {}; public showVisitStartedMsg = false; - public modelEnrolled: any = 'STANDARD MODEL'; + public modelEnrolled: any = 'STANDARD CARE MODEL'; public patients: any; private subs: Subscription[] = []; public isRetrospectiveVisit = false; @@ -49,6 +50,7 @@ export class VisitComponent implements OnInit, OnDestroy { public enrolledPrograms: Array = []; public currentProgramEnrollmentUuid = ''; public currentEnrollment: any = undefined; + public patientAssignedModel: any = 'Anon'; public visit: any; public visits: Array = []; public programVisitsObj: any = undefined; @@ -75,11 +77,13 @@ export class VisitComponent implements OnInit, OnDestroy { private communityGroupMemberService: CommunityGroupMemberService, private bsModalService: BsModalService, private patientService: PatientService, - private patientProgramResourceService: PatientProgramResourceService + private patientProgramResourceService: PatientProgramResourceService, + private obsResourceService: ObsResourceService ) {} public ngOnInit() { this.getPatientUuid(); + this.getPatientModel(); // this.isBusy = true; // app feature analytics // this.appFeatureAnalytics @@ -107,10 +111,32 @@ export class VisitComponent implements OnInit, OnDestroy { } } ); + console.log('Sub:', sub); this.subs.push(sub); } + public getPatientModel() { + console.log('PatientEnrolled', this.patient.uuid); + const patientUuid = this.patient.uuid; + const patientModelConceptUuid = ['af0c1b76-991c-4a8e-a197-7157d9498a33']; + // '2f0a08cc-af60-443e-9536-65fca9494970', + let patientModel; + this.obsResourceService + .getObsPatientObsByConcept(patientUuid, patientModelConceptUuid) + .subscribe((data) => { + console.log('Model', data); + const results = data['results']; + if (results.length > 0) { + this.modelEnrolled = results[0].value.display; + patientModel = this.modelEnrolled; + console.log('patientModel', patientModel); + return patientModel; + } + }); + return patientModel; + } + public checkIfPatientEnrolledInGroup() { this.isBusy = true; const DIFFERENTIATED_CARE = '334c9e98-173f-4454-a8ce-f80b20b7fdf0'; diff --git a/src/app/patient-dashboard/general-landing-page/landing-page.component.html b/src/app/patient-dashboard/general-landing-page/landing-page.component.html index bc186f46d..3acb87b94 100644 --- a/src/app/patient-dashboard/general-landing-page/landing-page.component.html +++ b/src/app/patient-dashboard/general-landing-page/landing-page.component.html @@ -5,13 +5,13 @@

Patient Care Program Snapshots

-
Do you wish to enroll patient into another program? -
+
-->
diff --git a/src/app/patient-dashboard/programs/program.service.ts b/src/app/patient-dashboard/programs/program.service.ts index bbe62f96b..5b68278e2 100644 --- a/src/app/patient-dashboard/programs/program.service.ts +++ b/src/app/patient-dashboard/programs/program.service.ts @@ -85,6 +85,7 @@ export class ProgramService { location: locationUuid }; + console.log('Payload: ', payLoad); // delete dateCompleted property if the dateCompleted is null at enrollment if (!payLoad.dateCompleted || enrollmentUuid === '') { delete payLoad['dateCompleted']; diff --git a/src/app/patient-dashboard/services/patient.service.ts b/src/app/patient-dashboard/services/patient.service.ts index 20807001c..ea97b24d4 100644 --- a/src/app/patient-dashboard/services/patient.service.ts +++ b/src/app/patient-dashboard/services/patient.service.ts @@ -59,6 +59,7 @@ export class PatientService { this.encounterResource.getEncountersByPatientUuid(patientUuid) ).subscribe( (data) => { + console.log('Data:', data); const patient = data[0]; patient.enrolledPrograms = data[1]; patient.encounters = data[2]; diff --git a/src/app/program-manager/base/program-manager-base.component.ts b/src/app/program-manager/base/program-manager-base.component.ts index 64839398b..4e2dddc9c 100644 --- a/src/app/program-manager/base/program-manager-base.component.ts +++ b/src/app/program-manager/base/program-manager-base.component.ts @@ -84,6 +84,7 @@ export class ProgramManagerBaseComponent implements OnInit { const programConfigLoaded: Subject = new Subject(); this.patientService.currentlyLoadedPatient.pipe(shareReplay()).subscribe( (patient) => { + console.log('ProgramPatient', patient); if (patient) { this.patient = patient; this.availablePrograms = _.filter( @@ -176,15 +177,20 @@ export class ProgramManagerBaseComponent implements OnInit { const department = _.find(this.departmentConf, (config: any) => { return config.name === this.department; }); + console.log('ProgramDepartment: ', department); + console.log('patientStatus: ', patientStatus); + console.log('AvailablePrograms: ', this.availablePrograms); if (department) { // Remove already enrolled programs if (patientStatus) { + console.log('We are here'); return _.filter(department.programs, (program) => { const programs = _.map(this.availablePrograms, (a) => a.programUuid); - console.log('Programs: ', this.availablePrograms); + // Additional condition to filter by positivity - const isPositive = program.status === 'positive'; // Replace 'positive' with the actual property or condition + const isPositive = + program.status === 'positive' || program.status === 'all'; // Replace 'positive' with the actual property or condition return _.includes(programs, program.uuid) && isPositive; }); @@ -194,6 +200,7 @@ export class ProgramManagerBaseComponent implements OnInit { // return _.includes(programs, program.uuid); // }); } else { + console.log('We are here no here'); return _.filter(department.programs, (program) => { const programs = _.map(this.availablePrograms, (a) => a.programUuid); return _.includes(programs, program.uuid); diff --git a/src/app/program-manager/enrollment-shortcut/enrollment-shortcut.component.html b/src/app/program-manager/enrollment-shortcut/enrollment-shortcut.component.html index 4585d357d..a9edc30ad 100644 --- a/src/app/program-manager/enrollment-shortcut/enrollment-shortcut.component.html +++ b/src/app/program-manager/enrollment-shortcut/enrollment-shortcut.component.html @@ -1,6 +1,6 @@
- + -->