godata@3.5.4
- getCase(id, query, callback)
- getContact(id, query, callback)
- getLocation(query, callback)
- getOutbreak(query, callback)
- getReferenceData(query, callback)
- listCases(id, callback)
- listContacts(id, callback)
- listLocations(callback)
- listOutbreaks(callback)
- listReferenceData(callback)
- upsertCase(id, externalId, goDataCase, callback)
- upsertContact(id, externalId, goDataContact, callback)
- upsertLocation(externalId, goDataLocation, callback)
- upsertOutbreak(outbreak, callback)
- upsertReferenceData(externalId, goDataReferenceData, callback)
This adaptor exports the following from common:
- alterState()
- dataPath()
- dataValue()
- each()
- field()
- fields()
- fn()
- fnIf()
- lastReferenceValue()
- merge()
- sourceValue()
Functions
getCase
getCase(id, query, callback) ⇒ Operation
Get one or multiple cases within an outbreak from a query filter
Param | Type | Description |
---|---|---|
id | string | Outbreak id |
query | object | An object with a query filter parameter |
callback | function | (Optional) Callback function |
Example
getCase(
'3b55-cdf4',
{ 'where.relationship': { active: true }, where: { firstName: 'Luca'} },
state => {
console.log(state);
return state;
}
);
getContact
getContact(id, query, callback) ⇒ Operation
Get one or multiple contacts within an outbreak from a query filter
Param | Type | Description |
---|---|---|
id | string | Outbreak id |
query | object | An object with a query filter parameter |
callback | function | (Optional) Callback function |
Example
getContact("343d-dc3e", {"where":{"firstName": "Luca"}}, state => {
console.log(state.data);
return state;
});
getLocation
getLocation(query, callback) ⇒ Operation
Get one or multiple locations from a query filter
Param | Type | Description |
---|---|---|
query | object | An object with a query filter parameter |
callback | function | (Optional) Callback function |
Example
getLocation({"where":{"name": "30 DE OCTUBRE"}}, state => {
console.log(state.data);
return state;
});
getOutbreak
getOutbreak(query, callback) ⇒ Operation
Get one or multiple outbreaks from a query filter
Param | Type | Description |
---|---|---|
query | object | An object with a query filter parameter |
callback | function | (Optional) Callback function |
Example
getOutbreak({"where":{"name": "Outbreak demo"}}, state => {
console.log(state.data);
return state;
});
getReferenceData
getReferenceData(query, callback) ⇒ Operation
Get one or multiple reference data from a query filter
Param | Type | Description |
---|---|---|
query | object | An object with a query filter parameter |
callback | function | (Optional) Callback function |
Example
getReferenceData({"where":{"categoryId": "LNG_REFERENCE_DATA_CATEGORY_CENTRE_NAME"}}, state => {
console.log(state.data);
return state;
});
listCases
listCases(id, callback) ⇒ Operation
Fetch the list of cases within a particular outbreak using its ID.
Param | Type | Description |
---|---|---|
id | string | Outbreak id |
callback | function | (Optional) Callback function |
Example
listCases("343d-dc3e", state => {
console.log(state);
return state;
});
listContacts
listContacts(id, callback) ⇒ Operation
Fetch the list of contacts within a particular outbreak using its ID.
Param | Type | Description |
---|---|---|
id | string | Outbreak id |
callback | function | (Optional) Callback function |
Example
listContacts("343d-dc3e", // Outbreak Id
state => {
console.log(state);
return state;
});
listLocations
listLocations(callback) ⇒ Operation
Fetch the list of locations
Param | Type | Description |
---|---|---|
callback | function | (Optional) Callback function |
Example
listLocations(state => {
console.log(state.data);
return state;
});
listOutbreaks
listOutbreaks(callback) ⇒ Operation
Fetch the list of outbreaks
Param | Type | Description |
---|---|---|
callback | function | (Optional) Callback function |
Example
listOutbreaks(state => {
console.log(state.data);
return state;
});
listReferenceData
listReferenceData(callback) ⇒ Operation
Fetch the list of reference data
Param | Type | Description |
---|---|---|
callback | function | (Optional) Callback function |
Example
listReferenceData(state => {
console.log(state.data);
return state;
});
upsertCase
upsertCase(id, externalId, goDataCase, callback) ⇒ Operation
Upsert case to godata using an external id to mach a specific record
Param | Type | Description |
---|---|---|
id | string | Outbreak id |
externalId | string | External Id to match |
goDataCase | object | an object with some case data. |
callback | function | (Optional) Callback function |
Example
upsertCase("4dce-3eedce3-rd33", 'visualId',
data: state => {
const patient = state.data.body;
return {
firstName: patient.Patient_name.split(' ')[0],
lastName: patient.Patient_name.split(' ')[1],
visualId: patient.Case_ID,
'age:years': patient.Age_in_year,
gender: patient.Sex,
};
})
upsertContact
upsertContact(id, externalId, goDataContact, callback) ⇒ Operation
Upsert contact to godata using an external id to match a specific record.
Param | Type | Description |
---|---|---|
id | string | Outbreak id |
externalId | string | External Id to match |
goDataContact | object | an object with some case data. |
callback | function | (Optional) Callback function |
Example
upsertContact("4dce-3eedce3-rd33", 'visualId',
{
firstName: 'Luca',
gender: 'male',
'age:years': '20'
...
}
)
upsertLocation
upsertLocation(externalId, goDataLocation, callback) ⇒ Operation
Upsert location to godata
Param | Type | Description |
---|---|---|
externalId | string | External Id to match |
goDataLocation | object | an object with some location data. |
callback | function | (Optional) Callback function |
Example
upsertLocation('name', {...})
upsertOutbreak
upsertOutbreak(outbreak, callback) ⇒ Operation
Upsert outbreak to godata
Param | Type | Description |
---|---|---|
outbreak | object | an object with an externalId and some outbreak data. |
callback | function | (Optional) Callback function |
Example
upsertOutbreak({externalId: "3dec33-ede3", data: {...}})
upsertReferenceData
upsertReferenceData(externalId, goDataReferenceData, callback) ⇒ Operation
Upsert reference data to godata
Param | Type | Description |
---|---|---|
externalId | string | External Id to match |
goDataReferenceData | object | an object with some reference data. |
callback | function | (Optional) Callback function |
Example
upsertReferenceData('id', {...})