Hey Gerald,
You can read more about the task schema, configuration and its creation here and an easy to understand example can be found here.
If I can understand correctly you are submitting a report that should trigger a task, but that task isn’t appearing? If you submitted a report and are expecting a task there are several reasons a task might not appear:
Task Creation Logic checks:
-
Task start date is yet to come or due date or end date has passed (corresponding task schema parameter: appliesTo,appliesToType): Say you submit a pregnancy report and are expecting an ANC visit task, the ANC visit might be configured to appear 20 days after the reported days for 7 days. So until 20 days after the pregnancy was reported (start_date) has not passed the task will not appear. Alternatively, consider that the report was submitted 30 days ago but the task was configured to only show for 20+7 i.e. upto the 27th day of reporting(due_date) the task would not appear when you check on the 30th day.
-
The conditions to trigger the task creation is not met (corresponding task schema parameter: appliesIf): We have another parameter called applies_if in task schema, which can be used to control which reports, patient attributes, reports’ parameters etc would trigger a task creation, if this is not met, the task will not be created as well.
“Currently I report uuids whose task_uuids I can not see in my tasks data” - Could you please tell me how you are currently checking this data? Also, you mention task_uuids which doesn’t seem to be a standard named variable for tasks in CHT so could you please elaborate on this?
For Task monitoring:
If you have access to the underlying CouchDB docs in postgres via couch2pg or CHT Sync, you can use a query like follows to get the task details for each task and fiddle over them in excel or any dashboarding tool like superset.
Supposing you have the couchDb table. The following query skeleton should work to extract task data.
SELECT
---- contact hierarchical info ----
couchdb.doc ->> '_id' AS task_id,
couchdb.doc ->> 'type' AS type,
Date(TO_TIMESTAMP((couchdb.doc ->> 'authoredOn')::BIGINT / 1000)) AS authored_on,
couchdb.doc -> 'stateHistory' AS state_history,
couchdb.doc ->> 'user' AS "user",
(couchdb.doc -> 'emission') ->> '_id' AS emission_id,
(couchdb.doc -> 'emission') ->> 'title' AS task_title,
(couchdb.doc -> 'emission') ->> 'icon' AS emission_icon,
(couchdb.doc -> 'emission') ->> 'deleted' AS emission_deleted,
(couchdb.doc -> 'emission') ->> 'resolved' AS emission_resolved,
(couchdb.doc -> 'emission') -> 'actions' AS emission_actions,
((couchdb.doc -> 'emission') -> 'contact') ->> 'name' AS contact_name,
((couchdb.doc -> 'emission') ->> 'dueDate')::DATE AS due_date,
((couchdb.doc -> 'emission') ->> 'startDate')::DATE AS start_date,
((couchdb.doc -> 'emission') ->> 'endDate')::DATE AS end_date,
(couchdb.doc -> 'emission') ->> 'forId' AS patient_uuid_from_task,
(((couchdb.doc -> 'emission') -> 'actions') -> 0) ->> 'type' AS action_type,
(((couchdb.doc -> 'emission') -> 'actions') -> 0) ->> 'form' AS action_form,
(((couchdb.doc -> 'emission') -> 'actions') -> 0) ->> 'label' AS action_label,
((((couchdb.doc -> 'emission') -> 'actions') -> 0) -> 'content') ->> 'source' AS action_content_source,
((((couchdb.doc -> 'emission') -> 'actions') -> 0) -> 'content') ->> 'source_id' AS action_content_source_id,
((((couchdb.doc -> 'emission') -> 'actions') -> 0) -> 'content') ->> 'danger_sign_code' AS action_content_danger_sign_code,
couchdb.doc ->> 'state' AS state
FROM couchdb
--- join contact Hierarchy tables ---
WHERE (couchdb.doc ->> 'type') = 'task'
Then you can create a chart like this in superset tracking each Community health workers’ due task across various time ranges.
Let me know if this helps. Also, Feel free to set up a meeting with me if necessary.