Skip to content

Commit

Permalink
add back integration design tips
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksa-krolls committed Oct 22, 2024
1 parent 29deba1 commit 1dcd3de
Showing 1 changed file with 37 additions and 17 deletions.
54 changes: 37 additions & 17 deletions adaptors/commcare.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,6 @@ projects with the Pro Plan or above include API access
- Government: Collects data for public services, such as health enrollment,
school enrollment, and census data.

### CommCare Data Model

When integrating with CommCare, generally there are options to read or modify
`forms`, `cases`, or `lookup tables`. Most often, OpenFn users opt to integrate
`cases`, as these records typically contain the latest information about the
entities being managed in CommCare (e.g., patients, households, groups).

[See CommCare docs](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143954460/Metadata+Glossary#Types-of-Data-in-CommCare)
for a detailed description of the types of data.

> In the CommCare data model, a case is anything that we track over time, while
> form data is any information collected about a case at a specific point in
> time through a CommCare form. Ultimately form data is the source of all case
> data, but not all form data is case data.
![CommCare-data-model](/img/commecare-data-model.png)

## Integration Options

CommCare supports 2 primary integration options:
Expand Down Expand Up @@ -234,6 +217,43 @@ note:
:::


## Integration Design Tips

### CommCare Data Model

When integrating with CommCare, generally there are options to read or modify
`forms`, `cases`, or `lookup tables`. Most often, OpenFn users opt to integrate
`cases`, as these records typically contain the latest information about the
entities being managed in CommCare (e.g., patients, households, groups).

[See CommCare docs](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143954460/Metadata+Glossary#Types-of-Data-in-CommCare)
for a detailed description of the types of data.

> In the CommCare data model, a case is anything that we track over time, while
> form data is any information collected about a case at a specific point in
> time through a CommCare form. Ultimately form data is the source of all case
> data, but not all form data is case data.
![CommCare-data-model](/img/commecare-data-model.png)

### Mapping CommCare Metadata to External Systems
Use the [CommCare App Summary](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143956371/App+Summary) to view and export case or form metadata to XLS. This will help you discover what data is available to be mapped to an external system.

### Unique Identifiers

- As CommCare data is stored in forms and cases, there are two types of UIDs in
CommCare: `case_id` & form `id`.
- You can search for a particular case or form submission in CommCare by using the `Find Data by ID` feature [here](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143955380/Find+Data+by+ID).
- [See docs](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143946126/Generating+a+Unique+ID+for+beneficiaries) for more on generating custom unique IDs.

:::tip Embedding External IDs and Hidden Values in Forms

If integrating with CommCare `forms`, you may need to make sure that any unique identifiers or external IDs you want to reference in your integration are configured in your forms. You may consider using
[hidden values](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143954117/Hidden+Values+Tutorial+Part+1+Adding+Two+Questions+Using+a+Hidden+Value) to capture external IDs in form data, without affecting the end user experience.

:::


## Helpful Links

### About Forms, case and data management
Expand Down

0 comments on commit 1dcd3de

Please sign in to comment.