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
Param | Type | Description |
---|---|---|
operations | Array | Operations to be performed. |
Example
execute(
create('foo'),
delete('bar')
)(state)
login(state) ⇒ State
Logs in to OpenMRS, gets a session token.
Kind: global function
Param | Type | Description |
---|---|---|
state | State | Runtime state. |
Example
login(state)
cleanupState(state) ⇒ State
Removes unserializable or confidential keys from the state.
Kind: global function
Param | Type |
---|---|
state | State |
Example
cleanupState(state)
getPatient(params) ⇒ Operation
Gets patient matching a uuid
Kind: global function
Param | Type | Description |
---|---|---|
params | object | object with uuid for the patient |
Example
execute(
getPatient({ uuid: 123 })
)(state)
getPatients(criteria, options) ⇒ Operation
Gets patients matching criteria
Kind: global function
Param | Type | Description |
---|---|---|
criteria | object | Criteria object for the patient |
options | object | Options |
Example
execute(
getPatients(criteria)
)(state)
getPeople(criteria, options) ⇒ Operation
Gets people matching criteria
Kind: global function
Param | Type | Description |
---|---|---|
criteria | object | Criteria object for the people |
options | object | Options object for the handling of responses |
Example
execute(
getPeople(
{ identifier: '007' },
{ exactlyOne: true }
)(state)
createEncounter(params) ⇒ Operation
Creates an encounter
Kind: global function
Param | Type | Description |
---|---|---|
params | object | parameters 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
Param | Type | Description |
---|---|---|
params | object | parameters for the request |
callback | function | a callback to execute on the next state |
Example
req({
method: 'GET'
url: 'encounterType'
})(state)