Several years ago, I logged an issue about the problems I was having getting the accept_case_reports transition to work.
opened 01:53PM - 27 Aug 24 UTC
Type: Bug
**Describe the bug**
So, this is some ancient history (and I do not fully under… stand the workflow). But, I was trying to manually configure and test `case_id` functionality by using the `accept_case_reports` transition to set the `place_uuid` field on a report based on its `case_id` value.
Unfortunately, I could not get this to work. The transition code would get triggered as expected, but the `onMatch` function [returns the result of `silenceRegistrations`](https://github.com/medic/cht-core/blob/53439767aa828c8bd7e5513ab59f1461ae7a741f/shared-libs/transitions/src/transitions/accept_case_reports.js#L97). In order to trigger the updates to the doc to be written to the DB, the `onMatch` function should resolve a truthy value. However, the `silenceRegistrations` function [does not seem to ever resolve something truthy](https://github.com/medic/cht-core/blob/53439767aa828c8bd7e5513ab59f1461ae7a741f/shared-libs/transitions/src/transitions/accept_patient_reports.js#L175).
**To Reproduce**
Once again, I am not super familiar with the "proper" case_id workflow, so maybe I am just doing something wrong here....
I started with a `register_case` app form that is associated with a contact when it gets saved. With this form, I enabled the `registration` transition and added the following app_settings config:
```json
"registrations": [{
"form": "register_case",
"events": [{
"name": "on_create",
"trigger": "add_case"
}]
}],
```
When I submitted a `register_case` form, the transition would automatically update the report with a generated `case_id`.
Then I created a `case_event` form that contained nothing but a field to set the `case_id` (no linkage to any kind of contact). I enabled the `accept_case_reports` transition with the following config:
```json
"accept_case_reports": [{
"form": "case_event",
"validations": {},
"messages": []
}],
```
When I submit a `case_event` report (with the case_id assigned to my previous `register_case` report), I can see the `accept_case_reports` transition is triggered. It finds the existing case registration and sets the expected `place_uuid` field onto the `case_event` doc. However, since the `silenceRegistrations` function resolves `undefined`, this doc update is not persisted to the DB.
**Expected behavior**
I was expecting the `case_event` report to be assigned to the place associated with my `register_case` report.
**Additional context**
It seems like this workflow was broken in `3.9.0` :sweat: with [these changes](https://github.com/medic/cht-core/commit/32f501134ebde24e81075af56018971d1649f28d#diff-3cb63b4eca753069d70e238b3bb489a4857b55751231efd4bd9ffcd47f846b9fL191) to the `accept_patient_reports.silenceRegistrations` logic. Previously that function resolved `true` when it successfully completed. Afterwards, it resolves `undefined`.
There has not been any updates on this issue and at this point I want to open the discussion if anyone is still using the accept_case_reports transition and/or the case_id workflows?
If so, maybe I was just configuring something incorrectly when I logged that issue and all we need to do is update the docs. If no one is using it, I think we should consider removing support for it since we are maintaining some bespoke code for it.
@yuv I know you have some experience with these registration transitions, so maybe you have some context?
@kenn you also come to mind as someone with visibility into a lot of the different ways the CHT has been deployed over the years. Do you know anyone currently (or previously) using the case_id functionality?
Thank you!
diana
May 12, 2026, 7:52am
2
I saw a Nepali project was using it. tagging @Prajwol .