Skip to content

Commit

Permalink
Merge pull request #685 from palladiumkenya/feat/new-reporting-layer
Browse files Browse the repository at this point in the history
corrected vl column in otz apis
cbrianbet authored Dec 20, 2023
2 parents ec2dceb + 63a5c9e commit 521ee48
Showing 5 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -20,10 +20,10 @@ export class GetOtzVlSuppressionAmongAlhivNotEnrolledInOtzByAgeHandler
let vlSuppressionOtzByAgeAlhiv = this.repository
.createQueryBuilder('f')
.select([
'[AgeGroup] ageGroup, ValidVLResultCategory Last12MVLResult, SUM([HasValidVL]) AS vlSuppression',
'[AgeGroup] ageGroup, ValidVLResultCategory2 Last12MVLResult, SUM([HasValidVL]) AS vlSuppression',
])
.andWhere(
'f.MFLCode IS NOT NULL AND ValidVLResultCategory IS NOT NULL AND Enrolled = 0',
'f.MFLCode IS NOT NULL AND ValidVLResultCategory2 IS NOT NULL AND Enrolled = 0',
);

if (query.county) {
@@ -80,7 +80,7 @@ export class GetOtzVlSuppressionAmongAlhivNotEnrolledInOtzByAgeHandler
}

return await vlSuppressionOtzByAgeAlhiv
.groupBy('[AgeGroup], ValidVLResultCategory')
.groupBy('[AgeGroup], ValidVLResultCategory2')
.orderBy('[AgeGroup]')
.getRawMany();
}
Original file line number Diff line number Diff line change
@@ -23,10 +23,10 @@ export class GetOtzVlSuppressionAmongAlhivNotEnrolledInOtzByCountyHandler
const vlSuppressionOtzByCounty = this.repository
.createQueryBuilder('f')
.select([
'[County], ValidVLResultCategory Last12MVLResult, SUM([HasValidVL]) AS vlSuppression',
'[County], ValidVLResultCategory2 Last12MVLResult, SUM([HasValidVL]) AS vlSuppression',
])
.andWhere(
'f.MFLCode IS NOT NULL AND ValidVLResultCategory IS NOT NULL AND Enrolled = 0',
'f.MFLCode IS NOT NULL AND ValidVLResultCategory2 IS NOT NULL AND Enrolled = 0',
);

if (query.county) {
@@ -80,7 +80,7 @@ export class GetOtzVlSuppressionAmongAlhivNotEnrolledInOtzByCountyHandler
}

return await vlSuppressionOtzByCounty
.groupBy('[County], ValidVLResultCategory')
.groupBy('[County], ValidVLResultCategory2')
.orderBy('[County]')
.getRawMany();
}
Original file line number Diff line number Diff line change
@@ -23,10 +23,10 @@ export class GetOtzVlSuppressionAmongAlhivNotEnrolledInOtzByPartnerHandler
const vlSuppressionOtzByPartner = this.repository
.createQueryBuilder('f')
.select([
'[PartnerName] CTPartner, ValidVLResultCategory Last12MVLResult, SUM([HasValidVL]) AS vlSuppression',
'[PartnerName] CTPartner, ValidVLResultCategory2 Last12MVLResult, SUM([HasValidVL]) AS vlSuppression',
])
.andWhere(
'f.MFLCode IS NOT NULL AND ValidVLResultCategory IS NOT NULL AND Enrolled = 0',
'f.MFLCode IS NOT NULL AND ValidVLResultCategory2 IS NOT NULL AND Enrolled = 0',
);

if (query.county) {
@@ -79,7 +79,7 @@ export class GetOtzVlSuppressionAmongAlhivNotEnrolledInOtzByPartnerHandler
}

return await vlSuppressionOtzByPartner
.groupBy('[PartnerName], ValidVLResultCategory')
.groupBy('[PartnerName], ValidVLResultCategory2')
.orderBy('[PartnerName]')
.getRawMany();
}
Original file line number Diff line number Diff line change
@@ -21,10 +21,10 @@ export class GetOtzVlSuppressionAmongAlhivNotEnrolledInOtzBySexHandler
const vlSuppressionOtzBySex = this.repository
.createQueryBuilder('f')
.select([
'[Gender], ValidVLResultCategory Last12MVLResult, SUM([HasValidVL]) AS vlSuppression',
'[Gender], ValidVLResultCategory2 Last12MVLResult, SUM([HasValidVL]) AS vlSuppression',
])
.andWhere(
'f.MFLCode IS NOT NULL AND ValidVLResultCategory IS NOT NULL AND Enrolled = 0',
'f.MFLCode IS NOT NULL AND ValidVLResultCategory2 IS NOT NULL AND Enrolled = 0',
);

if (query.county) {
@@ -71,7 +71,7 @@ export class GetOtzVlSuppressionAmongAlhivNotEnrolledInOtzBySexHandler
}

return await vlSuppressionOtzBySex
.groupBy('[Gender], ValidVLResultCategory')
.groupBy('[Gender], ValidVLResultCategory2')
.orderBy('[Gender]')
.getRawMany();
}
4 changes: 0 additions & 4 deletions src/manifests/queries/handlers/get-recency-uploads.handler.ts
Original file line number Diff line number Diff line change
@@ -29,10 +29,6 @@ export class GetRecencyUploadsHandler
.toString()
.replace(/,/g, "','")}')`
}
// if (query.facility) {
// recencySql = `${recencySql} and facility IN (?)`;
// params.push(query.facility);
// }
if (query.partner) {
recencySql = `${recencySql} and Partner IN ('${query.partner
.toString()

0 comments on commit 521ee48

Please sign in to comment.