Global

Methods

getCase(id, query, callback) → {Operation}

Get one or multiple cases within an outbreak from a query filter
Parameters:
Name Type Description
id string Outbreak id
query object An object with a query filter parameter
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
getCase(
   '3b55-cdf4',
   { 'where.relationship': { active: true }, where: { firstName: 'Luca'} },
   state => {
     console.log(state);
     return state;
   }
);

getContact(id, query, callback) → {Operation}

Get one or multiple contacts within an outbreak from a query filter
Parameters:
Name Type Description
id string Outbreak id
query object An object with a query filter parameter
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
getContact("343d-dc3e", {"where":{"firstName": "Luca"}}, state => {
   console.log(state.data);
   return state;
 });

getLocation(query, callback) → {Operation}

Get one or multiple locations from a query filter
Parameters:
Name Type Description
query object An object with a query filter parameter
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
getLocation({"where":{"name": "30 DE OCTUBRE"}}, state => {
   console.log(state.data);
   return state;
 });

getOutbreak(query, callback) → {Operation}

Get one or multiple outbreaks from a query filter
Parameters:
Name Type Description
query object An object with a query filter parameter
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
getOutbreak({"where":{"name": "Outbreak demo"}}, state => {
   console.log(state.data);
   return state;
 });

getReferenceData(query, callback) → {Operation}

Get one or multiple reference data from a query filter
Parameters:
Name Type Description
query object An object with a query filter parameter
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
getReferenceData({"where":{"categoryId": "LNG_REFERENCE_DATA_CATEGORY_CENTRE_NAME"}}, state => {
   console.log(state.data);
   return state;
 });

listCases(id, callback) → {Operation}

Fetch the list of cases within a particular outbreak using its ID.
Parameters:
Name Type Description
id string Outbreak id
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
listCases("343d-dc3e", state => {
   console.log(state);
   return state;
 });

listContacts(id, callback) → {Operation}

Fetch the list of contacts within a particular outbreak using its ID.
Parameters:
Name Type Description
id string Outbreak id
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
listContacts("343d-dc3e", // Outbreak Id
   state => {
      console.log(state);
   return state;
 });

listLocations(callback) → {Operation}

Fetch the list of locations
Parameters:
Name Type Description
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
listLocations(state => {
   console.log(state.data);
   return state;
 });

listOutbreaks(callback) → {Operation}

Fetch the list of outbreaks
Parameters:
Name Type Description
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
listOutbreaks(state => {
   console.log(state.data);
   return state;
 });

listReferenceData(callback) → {Operation}

Fetch the list of reference data
Parameters:
Name Type Description
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
listReferenceData(state => {
   console.log(state.data);
   return state;
 });

upsertCase(id, externalId, goDataCase, callback) → {Operation}

Upsert case to godata using an external id to mach a specific record
Parameters:
Name 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
Source:
Returns:
Type
Operation
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(id, externalId, goDataContact, callback) → {Operation}

Upsert contact to godata using an external id to match a specific record.
Parameters:
Name 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
Source:
Returns:
Type
Operation
Example
upsertContact("4dce-3eedce3-rd33", 'visualId',
   {
     firstName: 'Luca',
     gender: 'male',
     'age:years': '20'
     ...
   }
 )

upsertLocation(externalId, goDataLocation, callback) → {Operation}

Upsert location to godata
Parameters:
Name Type Description
externalId string External Id to match
goDataLocation object an object with some location data.
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
upsertLocation('name', {...})

upsertOutbreak(outbreak, callback) → {Operation}

Upsert outbreak to godata
Parameters:
Name Type Description
outbreak object an object with an externalId and some outbreak data.
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
upsertOutbreak({externalId: "3dec33-ede3", data: {...}})

upsertReferenceData(externalId, goDataReferenceData, callback) → {Operation}

Upsert reference data to godata
Parameters:
Name Type Description
externalId string External Id to match
goDataReferenceData object an object with some reference data.
callback function (Optional) Callback function
Source:
Returns:
Type
Operation
Example
upsertReferenceData('id', {...})