Skip to main content

openmrs@0.10.0

Adaptor

Adaptor.getPatient

Kind: static class of Adaptor

new exports.getPatient(params)

Gets patient matching a uuid

ParamTypeDescription
paramsobjectobject with uuid for the patient

Example

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

Adaptor.getPeople

Kind: static class of Adaptor

new exports.getPeople(criteria, options)

Gets people matching criteria

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

Example

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

Adaptor.createEncounter

Kind: static class of Adaptor

new exports.createEncounter(params)

Creates an encounter

ParamTypeDescription
paramsobjectparameters of the encounter

Example

execute(
createEncounter(params)(state)

Adaptor.req

Kind: static class of Adaptor

new exports.req(params, callback)

Make a request to any OpenMRS endpoint and execute a callback

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

Example

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

Adaptor.execute(operations) ⇒ Operation

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

Kind: static method of Adaptor

ParamTypeDescription
operationsArrayOperations to be performed.

Example

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

Adaptor.getPatients(criteria, options) ⇒ Operation

Gets patients matching criteria

Kind: static method of Adaptor

ParamTypeDescription
criteriaobjectCriteria object for the patient
optionsobjectOptions

Example

execute(
getPatients(criteria)
)(state)

Adaptor~login(state) ⇒ State

Logs in to OpenMRS, gets a session token.

Kind: inner method of Adaptor

ParamTypeDescription
stateStateRuntime state.

Example

login(state)

Adaptor~cleanupState(state) ⇒ State

Removes unserializable or confidential keys from the state.

Kind: inner method of Adaptor

ParamType
stateState

Example

cleanupState(state)