Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC-667: Clients indicated to have been done Total Abdominal hysterectomy and yet no documentation in the system #1374

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 9 additions & 37 deletions service/cervical-cancer-screening-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,47 +48,19 @@ 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
Loading