diff --git a/models/forms/data_record.sql b/models/forms/data_record.sql index cff11c01..6129afc0 100644 --- a/models/forms/data_record.sql +++ b/models/forms/data_record.sql @@ -22,6 +22,7 @@ SELECT document_metadata.saved_timestamp, to_timestamp((NULLIF(doc->>'reported_date'::text, ''::text)::bigint / 1000)::double precision) AS reported, doc->>'form' as form, + doc#>>'{fields,inputs,source}' as source, doc->>'from' as from_phone, COALESCE( diff --git a/models/forms/forms.yml b/models/forms/forms.yml index cbf125df..1d35b754 100644 --- a/models/forms/forms.yml +++ b/models/forms/forms.yml @@ -23,6 +23,8 @@ models: data_type: timestamp with time zone - name: form data_type: string + - name: source + data_type: string - name: from_phone data_type: string - name: patient_id