Passer au contenu principal

openmrs@0.10.3

Functions

execute(operations)Operation

Execute a sequence of operations. Wraps language-common/execute, and prepends initial state for OpenMRS.

login(state)State

Logs in to OpenMRS, gets a session token.

cleanupState(state)State

Removes unserializable or confidential keys from the state.

getPatient(params)Operation

Gets patient matching a uuid

getPatients(criteria, options)Operation

Gets patients matching criteria

getPeople(criteria, options)Operation

Gets people matching criteria

createEncounter(params)Operation

Creates an encounter

req(params, callback)Operation

Make a request to any OpenMRS endpoint and execute a callback

execute(operations) ⇒ Operation

Execute a sequence of operations. Wraps language-common/execute, and prepends initial state for OpenMRS.

Kind: global function

ParamTypeDescription
operationsArrayOperations to be performed.

Example

execute(
create('foo'),
delete('bar')
)(state)

login(state) ⇒ State

Logs in to OpenMRS, gets a session token.

Kind: global function

ParamTypeDescription
stateStateRuntime state.

Example

login(state)

cleanupState(state) ⇒ State

Removes unserializable or confidential keys from the state.

Kind: global function

ParamType
stateState

Example

cleanupState(state)

getPatient(params) ⇒ Operation

Gets patient matching a uuid

Kind: global function

ParamTypeDescription
paramsobjectobject with uuid for the patient

Example

execute(
getPatient({ uuid: 123 })
)(state)

getPatients(criteria, options) ⇒ Operation

Gets patients matching criteria

Kind: global function

ParamTypeDescription
criteriaobjectCriteria object for the patient
optionsobjectOptions

Example

execute(
getPatients(criteria)
)(state)

getPeople(criteria, options) ⇒ Operation

Gets people matching criteria

Kind: global function

ParamTypeDescription
criteriaobjectCriteria object for the people
optionsobjectOptions object for the handling of responses

Example

execute(
getPeople(
{ identifier: '007' },
{ exactlyOne: true }
)(state)

createEncounter(params) ⇒ Operation

Creates an encounter

Kind: global function

ParamTypeDescription
paramsobjectparameters of the encounter

Example

execute(
createEncounter(params)(state)

req(params, callback) ⇒ Operation

Make a request to any OpenMRS endpoint and execute a callback

Kind: global function

ParamTypeDescription
paramsobjectparameters for the request
callbackfunctiona callback to execute on the next state

Example

req({
method: 'GET'
url: 'encounterType'
})(state)