Skip to content

Commit

Permalink
Merge pull request #1375 from henrykorir/POC-667
Browse files Browse the repository at this point in the history
POC-667: Clients indicated to have been done Total Abdominal hysterectomy and yet no documentation in the system
  • Loading branch information
Alfred-Mutai authored Mar 24, 2024
2 parents 7d11f1c + 87f818b commit fcc487d
Showing 1 changed file with 7 additions and 36 deletions.
43 changes: 7 additions & 36 deletions service/cervical-cancer-screening-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,47 +48,18 @@ function getPatientCervicalCancerScreeningSummary(patientUuId) {
if (patientUuId === '' || patientUuId === null) {
reject('Patient Uuid is missing');
} else {
const sql = `SELECT
person_id,
DATE_FORMAT(test_datetime, '%d-%m-%Y') AS 'test_date',
via_or_via_vili,
pap_smear,
hpv,
uuid,
CASE
WHEN via_or_via_vili IS NOT NULL THEN 'VIA or VIA/VILI'
WHEN pap_smear IS NOT NULL THEN 'PAP SMEAR'
WHEN hpv IS NOT NULL THEN 'HPV'
ELSE NULL
END AS 'test',
CASE
WHEN via_or_via_vili = 7469 THEN 'ACETOWHITE LESION'
WHEN via_or_via_vili = 1115 THEN 'NORMAL'
WHEN via_or_via_vili = 6497 THEN 'DYSFUNCTIONAL UTERINE BLEEDING'
WHEN via_or_via_vili = 703 THEN 'POSITIVE'
WHEN via_or_via_vili = 7470 THEN 'PUNCTUATED CAPILLARIES'
WHEN via_or_via_vili = 664 THEN 'NEGATIVE'
WHEN via_or_via_vili = 7472 THEN 'ATYPICAL BLOOD VESSELS'
WHEN via_or_via_vili = 7293 THEN 'ULCER'
WHEN via_or_via_vili = 9593 THEN 'FRIABLE TISSUE'
WHEN via_or_via_vili = 6971 THEN 'POSSIBLE'
ELSE NULL
END AS 'via_test_result'
FROM
etl.flat_labs_and_imaging
WHERE
(via_or_via_vili IS NOT NULL
OR pap_smear IS NOT NULL
OR hpv IS NOT NULL)
AND uuid = '${patientUuId}'
ORDER BY test_datetime DESC
LIMIT 10;`;
const sql = `CALL etl.sp_get_cacx_info('${patientUuId}')`;

const queryParts = {
sql: sql
};
db.queryServer(queryParts, function (result) {
resolve(result);
const results = {
startIndex: result.startIndex,
size: result.result[0].length,
result: result.result[0]
};
resolve(results);
});
}
});
Expand Down

0 comments on commit fcc487d

Please sign in to comment.