avniproject / jss-sickle-cell-screening

0 stars 0 forks source link

[RFT] rulesConfig is not defined #82

Open Gojo-Taqi opened 4 months ago

Gojo-Taqi commented 4 months ago

Link to the report

Rule uuid - 'e93303fa-f465-4db7-a945-d4fd6295f2b9'

BEULAHEVANJALIN commented 1 month ago
update rule_failure_log
set is_closed        = true,
    closed_date_time = current_timestamp
where uuid in (
               'dd0d39d8-9260-41fe-8778-7a39e4532948',
               '7d8d707a-20b7-4b45-900e-e6c12d66393f',
               '0c29f6aa-e85b-4671-b3b0-1ae82510d8ad',
               'af6d741c-0b8e-4e5e-8049-40e5356fc74f'
    )
  and is_closed is not true; -- 4

Closed 4 RFLs as they are old and use voided forms.

BEULAHEVANJALIN commented 1 month ago
select rfl.entity_id,
       rfl.entity_type,
       rfl.rule_type,
       f.name,
       rfl.uuid,
       rfl.error_message,
       rfl.created_date_time,
       p.name,
       p.enrolment_summary_rule,
       stacktrace
from rule_failure_log rfl
         left join form f on rfl.form_id = f.uuid
         join public.program_enrolment on program_enrolment.uuid = entity_id
         join program p on program_enrolment.program_id = p.id
where error_message like '%rulesConfig is not defined%'
  and is_closed is not true
order by rfl.created_date_time desc; -- 25 rows

There were 25 RFLs from sickle cell program summary. Seems the script is correct with all null checks added. We need to find out if there are any missings on the prod side. Also this summary rule uses findObservationInEntireEnrolment in a lot of places. We need to check if this method causing the issue. The same with encounter as well.

Users are also syncing their apps regularly, seems that the sync is always complete. So the only thing is to check the rules line by line by commenting and verifying them.