Data Structure¶
A Case is a Document in a CouchDB database. A Case consists of 4 other Entities: CaseEvent, EventForm, and Participant. A Case is described by its CaseDefinition. A CaseDefinition also contains CaseEvetnDefinition(s) that describe what CaseEvents can exist in a Case, EventFormDefinition(s) that define what EventForms can exist in what CaseEvents, and Roles that describe what kind of Participants can exist in a Case. Lastly, all EventForms relate to separate FormResponse Documents in the database.
FormResponse Schema¶
CaseDefinition Schema¶
{
// A unique string that will be used to refer to the CaseDefinition.
"id": "case-type-1",
// An ID of a Form listed in forms.json that will be used to store Case level variables.
"formId": "case-type-1-manifest",
...
}
Case Schema¶
{
// A UUID generated by Tangerine to refer to the Case internal to Tangerine. Useful if Study IDs have collisions.
"id": "00673b47-8452-4b4c-9597-5a56fe8a059c",
// Because every Case is also a FormResponse, a Case includes top level form info you would find on a FormResponse.
"form": {
// The ID of the FormResponse this Case relates to. Shoudl be the same as the related CaseDefinition's formId.
"id": "case-type-1-manifest",
...
},
// The related CaseDefinition's id property.
"caseDefinitionId": "case-type-1",
...
}