Skip to content

Commit

Permalink
On ART program validated check on ccc_no match with patient first name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald-pro committed May 15, 2024
1 parent c0bc356 commit ebac8b5
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions routes/processes/nishauri_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,15 +799,15 @@ router.post(
where: { clinic_number: ccc_no }
});

if (check_program_valid) {
if (
check_program_valid.f_name.toUpperCase() !== firstname.toUpperCase()
) {
if (!check_program_valid) {
// if (
// check_program_valid.f_name.toUpperCase() !== firstname.toUpperCase()
// ) {
return res.status(200).json({
success: false,
msg: `Invalid CCC Number: ${ccc_no}, The CCC Number does not match in Nishauri`
});
}
// }
}

let check_valid_user = await Client.findOne({
Expand Down Expand Up @@ -866,7 +866,23 @@ router.post(
msg: "An error occurred, could not create program record"
});
}


} else if (existing_other_program) {
if (!check_program_valid) {

return res.status(200).json({
success: false,
msg: `Invalid CCC Number: ${ccc_no}, The CCC Number does not match in Nishauri`
});
}
if (!check_valid_user) {
return res.status(200).json({
success: false,
msg: `Invalid CCC Number/ First Name Match: ${ccc_no}, The CCC Number/First Name does not match in Nishauri`
});
}

const update_program = await NUserprograms.update(
{ is_active: "1" },
{
Expand Down

0 comments on commit ebac8b5

Please sign in to comment.