Build > Reports
Data & report management in the CHT
How to revalidate an invalid report
You may encounter a dreaded case when reports coming in to a Medic Webapp instance have a red indicator instead of the green indicator.
Invalid reports
This may be caused by:
app_settings
config.registrations
and patient_reports
. Forms that don’t have a patient_id field because it is generated afterwards, e.g ANCR, IMMR, go to the registrations
section, while form that have a patient_id field e.g ANCP, ANCV, IMMV; go to the patient_reports
sectionTo revalidate an invalid report, we need to clear the errors field on the doc (set it to []). Updating this field from Futon will not work and will result in an endless update process. The recommended way to do it is to download the doc, update it and then upload it. This will also ensure propagation and replication in couchdb.
To download a doc, use:
curl 'https://<username>:<password>@<instance>.app.medicmobile.org/medic/<doc id>' > filename.json
filename.json
is the local file in your computer you have stored the doc json
Update filename.json
: Set “errors” to [] and remove “accept_patient_reports” transition so that sentinel can revalidate the report.
Upload filename.json
with:
curl -X PUT hhttps://<username>:<password>@<instance>.app.medicmobile.org/medic/<doc id> -d @filename.json --header "Content-Type: application/json"
Data & report management in the CHT