Skip to main content

medicmobile@0.5.0

Functions

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

The following functions are exported from the common adaptor:

alterState()
dataPath()
dataValue()
each()
field()
fields()
fn()
fnIf()
lastReferenceValue()
merge()
sourceValue()

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)