Hello,
It is my first time posting, and I am still new to CHT, so please let me know if there are posting conventions I should follow!
We have found many instances in our form data where the data submitted by the Community Health Toolkit user is duplicated, except for a different report_uuid and a slightly different report_date. I’ve screenshotted an example below, and highlighted in yellow the report_uuid, report_date, and open text field (exactly the same text):
This happens across our forms and is not isolated to one form type.
Does anyone have any insight to why this happens? I’ve posted our SQL query below as well. Nothing seems to be amiss from my perspective:
CREATE OR REPLACE VIEW public.reportview_malnutrition_48h
AS SELECT reports.doc ->> '_id'::text AS report_uuid,
to_timestamp((((reports.doc ->> 'reported_date'::text)::bigint) / 1000)::double precision) AS report_date,
reports.doc ->> 'form'::text AS which_report,
reports.doc #>> '{contact,parent,_id}'::text[] AS hh_uuid,
reports.doc #>> '{fields,patient_uuid}'::text[] AS hhmem_uuid,
reports.doc #>> '{contact,_id}'::text[] AS chc_uuid,
reports.doc #>> '{fields,patient_uuid}'::text[] AS patient_uuid,
reports.doc #>> '{fields,patient_id}'::text[] AS patient_id,
reports.doc #>> '{fields,patient_gender}'::text[] AS patient_gender,
reports.doc #>> '{fields,inputs,contact,date_of_birth}'::text[] AS birthdate,
reports.doc #>> '{fields,patient_age_in_months}'::text[] AS patient_age_inmonths,
reports.doc #>> '{fields,patient_age_in_years}'::text[] AS patient_age_inyears,
reports.doc #>> '{fields,g_continue,continue}'::text[] AS continue_followup,
reports.doc #>> '{fields,g_visit,visit_rhu}'::text[] AS visitrhu_continue_yes,
reports.doc #>> '{fields,g_input,visit_date}'::text[] AS rhu_date_attendance,
reports.doc #>> '{fields,g_input,weight}'::text[] AS continue_weight,
reports.doc #>> '{fields,g_input,height}'::text[] AS continue_height,
reports.doc #>> '{fields,data,__hfa_class}'::text[] AS hfa_class,
reports.doc #>> '{fields,data,__hfa_score}'::text[] AS hfa_score,
reports.doc #>> '{fields,data,__weight}'::text[] AS patient_weight,
reports.doc #>> '{fields,data,__target_weight}'::text[] AS target_weight,
reports.doc #>> '{fields,g_treatment,treatment}'::text[] AS treatment,
reports.doc #>> '{fields,data,__wfh_class}'::text[] AS wfh_class,
reports.doc #>> '{fields,data,__wfh_score}'::text[] AS wfh_score,
reports.doc #>> '{fields,data,__rhu_visit_done}'::text[] AS rhu_done_visitation,
reports.doc #>> '{fields,g_continue,reschedule}'::text[] AS resched_date,
reports.doc #>> '{fields,inputs,contact,parent,parent,contact,name}'::text[] AS patient_parent_name,
reports.doc #>> '{fields,inputs,contact,parent,parent,contact,phone}'::text[] AS patient_parent_phone
FROM raw_reports reports
WHERE (reports.doc ->> 'form'::text) = 'malnutrition_followup_48h'::text
ORDER BY (to_timestamp((((reports.doc ->> 'reported_date'::text)::bigint) / 1000)::double precision)) DESC;
Thanks for any insight, and please let me know if other information would be helpful to provide!