# \`accept\_case\_reports\` form entry dependency on a corresponding entry in \`registrations\`?

**URL:** <https://forum.communityhealthtoolkit.org/t/accept-case-reports-form-entry-dependency-on-a-corresponding-entry-in-registrations/2759>\
**Category:** Technical Support\
**Created:** [May 20, 2023, 11:24am UTC](https://forum.communityhealthtoolkit.org/t/accept-case-reports-form-entry-dependency-on-a-corresponding-entry-in-registrations/2759 "2023-05-20T11:24:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bernard](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/bernard/32/88_2.png) [@bernard](https://forum.communityhealthtoolkit.org/u/bernard)\
**Post date:** [May 20, 2023, 11:24am UTC](https://forum.communityhealthtoolkit.org/t/accept-case-reports-form-entry-dependency-on-a-corresponding-entry-in-registrations/2759/1 "2023-05-20T11:24:39Z")

</div>

I have this config (reducted) in app settings.

```auto
"registrations": [
    {
        "form": "chv_signal_reporting",
        "events": [{
            "name": "on_create",
            "trigger": "add_case"
        }],
        "messages": [
            {
                "event_type": "report_accepted",
                "bool_expr": "true",
                "message": "<message>",
                "recipient": "parent"
            }
        ]
    },
    {
        "form": "cha_signal_reporting_verification",
        "events": [{
            "name": "on_create",
            "trigger": "add_case"
        }],
        "messages": [
            {
                "event_type": "report_accepted",
                "bool_expr": "<condition>",
                "message": "<message>",
                "recipient": "parent"
            }
        ]
    },
    {
        "form": "cha_signal_verification",
        "events": [{
            "name": "on_create",
            "trigger": "clear_schedule",
            "params": "dummy"
        }]
    }
  ],
  "accept_case_reports": [
    {
        "form": "cha_signal_verification",
        "validations": {},
        "messages": [
            {
                "event_type": "report_accepted",
                "bool_expr": "<condition>",
                "message": "<msg>",
                "recipient": "parent"
            }
        ]
    }
  ],
  "schedules": [
    {
      "name": "dummy",
      "summary": "<txt>",
      "description": "",
      "start_from": "reported_date",
      "start_mid_group": true,
      "messages": [
        {
          "translation_key": "schedules.dummy.message",
          "group": 1,
          "offset": "52 weeks",
          "send_day": "monday",
          "send_time": "09:00",
          "recipient": "reporting_unit"
        }
      ]
    }
  ]

```

Note that there is a `dummy` schedule entry whose only purpose is to allow registering `cha_signal_verification` in `registrations`.

What I really wanted to do is to just accept `cha_signal_verification` report as a case report linked to the case generated in `chv_signal_reporting`’s registration and send an SMS notification.

If I omit the entry for `cha_signal_verification` form in registrations, it’s `accept_case_reports` config does not work and no SMS is sent.

Is this by design? It seems to me accepting a case report should be independent of a registration for a form.

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [May 23, 2023, 4:38am UTC](https://forum.communityhealthtoolkit.org/t/accept-case-reports-form-entry-dependency-on-a-corresponding-entry-in-registrations/2759/2 "2023-05-23T04:38:34Z")

</div>

Hi @bernard

I believe this is by design, as the `registration` transition first “assigns” a unique `case_id` to the original report, with subsequent reports referring to this generated `case_id`. This is how `accept_patient_reports` works as well - it relies on the `patient_id` being created beforehand by something else (but there are more mechanisms that generate `patient_id`s).

---

<div class="post-metadata">

**Author:** ![bernard](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/bernard/32/88_2.png) [@bernard](https://forum.communityhealthtoolkit.org/u/bernard)\
**Post date:** [June 3, 2023, 8:29am UTC](https://forum.communityhealthtoolkit.org/t/accept-case-reports-form-entry-dependency-on-a-corresponding-entry-in-registrations/2759/3 "2023-06-03T08:29:54Z")

</div>

Thank you @diana for confirming. In this case though, the report that generates the `case_id` is different from the one referring to it. For such cases, we should consider breaking the dependency. What do you think?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [June 5, 2023, 8:55am UTC](https://forum.communityhealthtoolkit.org/t/accept-case-reports-form-entry-dependency-on-a-corresponding-entry-in-registrations/2759/4 "2023-06-05T08:55:06Z")

</div>

Hi @bernard

I’ve tested this locally and I’m getting an SMS message even though I have no schedule or registration entry for the second form:

```auto
    "transitions": {
      "accept_case_reports": true,
      "default_responses": true,
      "registration": true,
      "update_clinics": true,
      "generate_patient_id_on_people": true,
    },
    "forms": {
        "CW": {
        "meta": {
          "code": "CW",
          "icon": "child",
          "translation_key": "form.cw.title"
        },
        "fields": {
          "weeks_since_birth": {
            "labels": {
              "short": {
                "translation_key": "report.cw.weeks_since_birth"
              }
            },
            "position": 0,
            "type": "integer",
            "length": [
              1,
              3
            ],
            "range": [
              0,
              260
            ],
            "required": true,
            "validations": {},
            "flags": {}
          },
          "patient_name": {
            "labels": {
              "short": {
                "translation_key": "report.cw.patient_name"
              }
            },
            "position": 1,
            "type": "string",
            "length": [
              1,
              30
            ],
            "required": true
          }
        },
        "public_form": false,
        "use_sentinel": true
      },
    "GC": {
        "meta": {
          "code": "GC",
          "icon": "child",
          "translation_key": "form.g.title"
        },
        "fields": {
          "case_id": {
            "labels": {
              "short": {
                "translation_key": "case_id"
              },
              "tiny": {
                "en": "ID"
              }
            },
            "position": 0,
            "type": "string",
            "length": [
              5,
              13
            ],
            "required": true,
            "validations": {},
            "flags": {}
          },
          "severity": {
            "labels": {
              "short": {
                "translation_key": "report.g.severity"
              },
              "tiny": {
                "en": "severity"
              }
            },
            "position": 1,
            "type": "string",
            "length": [
              1,
              1
            ],
            "required": true
          }
        },
        "public_form": false,
        "use_sentinel": true
      },
    },
    "schedules": [],
    "registrations": [
      {
        "form": "CW",
        "events": [
          {
            "name": "on_create",
            "trigger": "add_case",
            "params": "",
            "bool_expr": ""
          }
        ]
      }
    ],
    "accept_case_reports": [
      {
        "form": "GC",
        "messages": [
          {
            "event_type": "report_accepted",
            "message": "Case accepted",
            "recipient": "parent",
            "params": "",
            "bool_expr": ""
          }
        ]
      }
    ]

```
