Skip to content

Commit

Permalink
Merge branch 'master' into POC-781
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Mutai authored Jul 21, 2024
2 parents cb94831 + 15a4427 commit 66f5bdf
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 26 deletions.
38 changes: 19 additions & 19 deletions programs/patient-program-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "ae35ed69-e07c-4209-93ce-f23733aa816b",
Expand Down Expand Up @@ -159,7 +159,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "cb5c0abd-0817-40e3-9413-8669561fadb9",
Expand Down Expand Up @@ -224,7 +224,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "cb5c0abd-0817-40e3-9413-8669561fadb9",
Expand Down Expand Up @@ -660,7 +660,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "ae35ed69-e07c-4209-93ce-f23733aa816b",
Expand Down Expand Up @@ -1369,7 +1369,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "cb5c0abd-0817-40e3-9413-8669561fadb9",
Expand Down Expand Up @@ -1446,7 +1446,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "cb5c0abd-0817-40e3-9413-8669561fadb9",
Expand Down Expand Up @@ -1523,7 +1523,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "ae35ed69-e07c-4209-93ce-f23733aa816b",
Expand Down Expand Up @@ -1596,7 +1596,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "cb5c0abd-0817-40e3-9413-8669561fadb9",
Expand Down Expand Up @@ -1677,7 +1677,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "ae35ed69-e07c-4209-93ce-f23733aa816b",
Expand Down Expand Up @@ -1746,7 +1746,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "cb5c0abd-0817-40e3-9413-8669561fadb9",
Expand Down Expand Up @@ -1847,7 +1847,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "ae35ed69-e07c-4209-93ce-f23733aa816b",
Expand Down Expand Up @@ -2713,7 +2713,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "cb5c0abd-0817-40e3-9413-8669561fadb9",
Expand Down Expand Up @@ -2974,7 +2974,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "5ef97eed-18f5-40f6-9fbf-a11b1f06484a",
Expand Down Expand Up @@ -3071,7 +3071,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "cb5c0abd-0817-40e3-9413-8669561fadb9",
Expand Down Expand Up @@ -3133,7 +3133,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "ae35ed69-e07c-4209-93ce-f23733aa816b",
Expand Down Expand Up @@ -3988,7 +3988,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "466d6707-8429-4e61-b5a0-d63444f5ad35",
Expand Down Expand Up @@ -4027,7 +4027,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "ae35ed69-e07c-4209-93ce-f23733aa816b",
Expand Down Expand Up @@ -4543,7 +4543,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "cb5c0abd-0817-40e3-9413-8669561fadb9",
Expand Down Expand Up @@ -4609,7 +4609,7 @@
{
"uuid": "238625fc-8a25-44b2-aa5a-8bf48fa0e18d",
"display": "ONCOLOGYVIA",
"allowedIf": "age >= 25 && age <= 49 && gender === 'F'"
"allowedIf": "age >= 15 && age <= 65 && gender === 'F'"
},
{
"uuid": "ae35ed69-e07c-4209-93ce-f23733aa816b",
Expand Down
46 changes: 44 additions & 2 deletions programs/scope-builder.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,28 @@ function buildScope(dataDictionary) {
'09004e76-1352-11df-a1f1-0026b9348838',
'e907044b-4170-49e1-98e8-93258596bb23',
'0900b000-1352-11df-a1f1-0026b9348838',
'b4f7483a-00b8-4ff4-be70-dfefc85c60fa'
'b4f7483a-00b8-4ff4-be70-dfefc85c60fa',
'9d1025b7-280d-46f7-8f0d-33b3b7aeab41',
'd0d133f1-22f3-49c3-b9f1-d2f64944eb0d',
'7a8c0cc5-be43-48e1-aa41-33cb1e9cc26f',
'22a1255d-e56b-446a-a32b-e7ea8bd1a89c',
'6cd0b441-d644-487c-8466-5820a73f9ce5',
'523d5060-07ee-46d9-b439-12867c4e83ac',
'b56b5219-0c8f-4520-810e-ba43302c63eb',
'516c889a-f9ea-4861-b89c-e39f08dfb15c',
'e05cbb83-9418-4ebc-9240-ae2512d70321',
'de051b8a-78ab-4fa8-bb08-5364c8e87297',
'fc26648e-aa47-4928-8595-5c96943b44b2',
'20bd486d-5c84-44f4-9ffa-2f1c1d9e79f8',
'f0e8d70a-dd24-4f59-bcf3-3566b8a1d5cc',
'0a2d9adf-d758-4c81-8429-2ff54e2c58d6',
'0900b104-1352-11df-a1f1-0026b9348838',
'0943a3b0-3630-4d71-ad09-cc55cfd3bde1',
'0900aace-1352-11df-a1f1-0026b9348838',
'8b6f450b-8a61-4051-b4bd-b1a79cb541ee',
'0900b212-1352-11df-a1f1-0026b9348838',
'48305e5b-2ca5-44e1-8f6b-008c4d2789ba',
'38eec9dd-8b52-4f8c-ad25-f045486299c1'
].includes(dataDictionary.intendedVisitLocationUuid);
if (dataDictionary.patient) {
buildPatientScopeMembers(scope, dataDictionary.patient);
Expand Down Expand Up @@ -193,7 +214,28 @@ function buildScope(dataDictionary) {
'09004e76-1352-11df-a1f1-0026b9348838',
'e907044b-4170-49e1-98e8-93258596bb23',
'0900b000-1352-11df-a1f1-0026b9348838',
'b4f7483a-00b8-4ff4-be70-dfefc85c60fa'
'b4f7483a-00b8-4ff4-be70-dfefc85c60fa',
'9d1025b7-280d-46f7-8f0d-33b3b7aeab41',
'd0d133f1-22f3-49c3-b9f1-d2f64944eb0d',
'7a8c0cc5-be43-48e1-aa41-33cb1e9cc26f',
'22a1255d-e56b-446a-a32b-e7ea8bd1a89c',
'6cd0b441-d644-487c-8466-5820a73f9ce5',
'523d5060-07ee-46d9-b439-12867c4e83ac',
'b56b5219-0c8f-4520-810e-ba43302c63eb',
'516c889a-f9ea-4861-b89c-e39f08dfb15c',
'e05cbb83-9418-4ebc-9240-ae2512d70321',
'de051b8a-78ab-4fa8-bb08-5364c8e87297',
'fc26648e-aa47-4928-8595-5c96943b44b2',
'20bd486d-5c84-44f4-9ffa-2f1c1d9e79f8',
'f0e8d70a-dd24-4f59-bcf3-3566b8a1d5cc',
'0a2d9adf-d758-4c81-8429-2ff54e2c58d6',
'0900b104-1352-11df-a1f1-0026b9348838',
'0943a3b0-3630-4d71-ad09-cc55cfd3bde1',
'0900aace-1352-11df-a1f1-0026b9348838',
'8b6f450b-8a61-4051-b4bd-b1a79cb541ee',
'0900b212-1352-11df-a1f1-0026b9348838',
'48305e5b-2ca5-44e1-8f6b-008c4d2789ba',
'38eec9dd-8b52-4f8c-ad25-f045486299c1'
].includes(dataDictionary.intendedVisitLocationUuid);
}

Expand Down
42 changes: 37 additions & 5 deletions service/patient-reminder.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ function newViralLoadPresent(data) {
}

function pendingViralLoadLabResult(eidResults) {
// console.log('EID Results', eidResults);
let incompleteResult = eidResults.find((result) => {
if (result) {
if (result.sample_status) {
Expand Down Expand Up @@ -1100,12 +1099,45 @@ function transformZeroVl(vl) {
}

function getEncountersByEncounterType(patient_uuid) {
const family_testing_encounter = '975ae894-7660-4224-b777-468c2e710a2a';
return new Promise(function (resolve, reject) {
const primaryFamilyTestingEncounter = '975ae894-7660-4224-b777-468c2e710a2a';
const secondaryFamilyTestingEncounter =
'5a58f6f5-f5a6-47eb-a644-626abd83f83b';
const specificConceptUuid = '0df3af2d-4eeb-4552-8395-51ef32270842';

function findSpecificObservation(encounters) {
for (const encounter of encounters) {
if (Array.isArray(encounter.obs)) {
for (const observation of encounter.obs) {
if (observation.concept.uuid === specificConceptUuid) {
return true;
}
}
}
}
return false;
}

return new Promise((resolve, reject) => {
encounter_service
.getEncountersByEncounterType(patient_uuid, family_testing_encounter)
.getEncountersByEncounterType(patient_uuid, primaryFamilyTestingEncounter)
.then((encounters) => {
resolve(encounters);
if (encounters == null || encounters.results.length === 0) {
return encounter_service.getEncountersByEncounterType(
patient_uuid,
secondaryFamilyTestingEncounter
);
}
return encounters;
})
.then((encounters) => {
if (encounters == null || encounters.results.length === 0) {
resolve(null);
} else {
if (findSpecificObservation(encounters.results)) {
console.log('Encounters from Family testing: ', encounters);
}
resolve(encounters);
}
})
.catch((err) => {
reject(err);
Expand Down

0 comments on commit 66f5bdf

Please sign in to comment.