Skip to main content

medicmobile@0.4.2

Functions

changesApi(params, callback)
fetchSubmissions(formId, params, postUrl)
pickFormData(formId)

changesApi

changesApi(params, callback) ⇒ Operation

Access the CouchDB Changes API

ParamTypeDescription
paramsobjectQuery parameters
callbackfunction(Optional) Callback function

Example

changesApi(params, callback)

fetchSubmissions

fetchSubmissions(formId, params, postUrl) ⇒ Operation

Access form submissions and post them as JSON.

ParamTypeDescription
formIdstringQuery parameters
paramsobjectStarting sequence id
postUrlstringInbox to post form data

Example

fetchSubmissions(
"pregnancy", // formId
{ "last-event-id": 334 }, // params
"http://localhost:4000/inbox/abc-123-xyz" // postUrl
);

pickFormData

pickFormData(formId) ⇒ Operation

Select submissions for a specific form

ParamTypeDescription
formIdstringThe form ID.

Example

pickFormData(formId)