@openfn/language-medicmobile
TypeScript icon, indicating that this package has built-in type declarations

0.4.2 • Public • Published

Language Medic Mobile

Language Pack for building expressions and operations to make calls to the Medic Mobile API.
For an overview of Medic's database, check out Medic's DB Schema v2
The exported functions in this language package can be executed by OpenFn/core:

../core/lib/cli.js execute -l ./lib/Adaptor -s ./tmp/state.json -e ./tmp/expression.js

For quick-start help, clone OpenFn/openfn-devtools and follow the README.md

Documentation

Configuration

View all the required and optional properties for state.configuration in the official configuration-schema definition.

sample fetchSubmissions expression

fetchSubmissions(
  'pregnancy', // formId
  { 'last-event-id': 334 }, // params, last-event-id will be replaced by cursor
  'http://localhost:4000/inbox/abc-123-xyz' // postUrl
);

sample changesApi and pickFormData usage

// get all the changes...
changesApi({
  include_docs: true,
  // This only gets used the first time the job is run.
  // Subsequent runs take the lastSeq value as their cursor.
  // "last-event-id": 789,
});

// Picks out the field data for a given formId.
pickFormData('pregnancy');

Development

Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

Run tests using pnpm run test or pnpm run test:watch

Build the project using pnpm build.

To just build the docs run pnpm build docs

Readme

Keywords

none

Package Sidebar

Install

npm i @openfn/language-medicmobile

Weekly Downloads

0

Version

0.4.2

License

LGPLv3

Unpacked Size

75.5 kB

Total Files

10

Last publish

Collaborators

  • mtuchi
  • elias-ba
  • stuartc-openfn
  • taylordowns2000