Skip to content

Commit

Permalink
avniproject/avni-infra#41 | add check to avoid etl failure for bad da…
Browse files Browse the repository at this point in the history
…ta in repeatableQuestionGroup
  • Loading branch information
himeshr committed Nov 18, 2024
1 parent 70acf8a commit df15156
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ FROM (
where et.uuid = '${encounter_type_uuid}'
and st.uuid = '${subject_type_uuid}'
and mainTable.observations ->> '${repeatable_question_group_concept_uuid}' is not null
and jsonb_typeof((mainTable.observations ->> '${repeatable_question_group_concept_uuid}')::jsonb) = 'array'
and jsonb_array_length((mainTable.observations ->> '${repeatable_question_group_concept_uuid}')::jsonb) > 0
and mainTable.cancel_date_time isnull
and mainTable.last_modified_date_time > '${start_time}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ FROM (
and st.uuid = '${subject_type_uuid}'
and p.uuid = '${program_uuid}'
and mainTable.observations ->> '${repeatable_question_group_concept_uuid}' is not null
and jsonb_typeof((mainTable.observations ->> '${repeatable_question_group_concept_uuid}')::jsonb) = 'array'
and jsonb_array_length((mainTable.observations ->> '${repeatable_question_group_concept_uuid}')::jsonb) > 0
and mainTable.cancel_date_time isnull
and mainTable.last_modified_date_time > '${start_time}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ FROM (
where p.uuid = '${program_uuid}'
and mainTable.observations ->> '${repeatable_question_group_concept_uuid}' is not null
and st.uuid = '${subject_type_uuid}'
and jsonb_typeof((mainTable.observations ->> '${repeatable_question_group_concept_uuid}')::jsonb) = 'array'
and jsonb_array_length((mainTable.observations ->> '${repeatable_question_group_concept_uuid}')::jsonb) > 0
and mainTable.last_modified_date_time > '${start_time}'
and mainTable.last_modified_date_time <= '${end_time}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ FROM (
inner join public.subject_type st on mainTable.subject_type_id = st.id
where st.uuid = '${subject_type_uuid}'
and mainTable.observations ->> '${repeatable_question_group_concept_uuid}' is not null
and jsonb_typeof((mainTable.observations ->> '${repeatable_question_group_concept_uuid}')::jsonb) = 'array'
and jsonb_array_length((mainTable.observations ->> '${repeatable_question_group_concept_uuid}')::jsonb) > 0
and mainTable.last_modified_date_time > '${start_time}'
and mainTable.last_modified_date_time <= '${end_time}'
Expand Down

0 comments on commit df15156

Please sign in to comment.