An OpenFn adaptor for building integration jobs for use with the WHO Go.Data API.
Go.Data is an outbreak investigation tool for field data collection during public health emergencies. The tool includes functionality for case investigation, contact follow-up, visualization of chains of transmission including secure data exchange and is designed for flexibility in the field, to adapt to the wide range of outbreak scenarios.
- View the documentation at https://openfn.github.io/language-godata/
- To update the documentation site, run:
./node_modules/.bin/jsdoc --readme ./README.md ./lib -d docs
{
"email": "[email protected]",
"password": "supersecret",
"apiUrl": "https://www.who-godata.com/api"
}
This function is used to fetch the whole list of outbreaks in Go.Data.
listOutbreaks({}, state => {
console.log(state.data);
return state;
});
This function can be used to fetch one specific outbreak. A filtering mechanism is used to specify a criteria to match.
getOutbreak({ where: { name: 'Outbreak demo' } }, {}, state => {
console.log(state.data);
return state;
});
This function is used to either update a record in Go.Data if matched or insert a new one if no record matched the unique id.
upsertOutbreak({
externalId: '3dec33-ede3',
data: {
name: 'string',
description: 'string',
disease: 'string',
countries: [
{
id: 'SENEGAL',
},
],
startDate: '2020-12-17T14:54:19.498Z',
endDate: '2020-12-17T14:54:19.498Z',
longPeriodsBetweenCaseOnset: 0,
periodOfFollowup: 0,
},
});
This function is used to fetch the whole list of cases for a specific outbreak in Go.Data.
listCases('4c444f7-4e11-41d0-c1af-331dd15a892e', {}, state => {
console.log(state);
return state;
});
This function can be used to fetch one specific case for an outbreak. A filtering mechanism can specify a criteria to match.
getCase(
'4c444f7-4e11-41d0-c1af-331dd15a892e',
{ 'where.relationship': { active: true }, where: { firstName: 'Luca' } },
{},
state => {
console.log(state);
return state;
}
);
This function is used to either update a case in Go.Data if matched or insert a new one if no record matched the unique id.
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,
};
},
});
This function is used to fetch the whole list of contacts for a specific outbreak in Go.Data.
listContacts('4c444f7-4e11-41d0-c1af-331dd15a892e', {}, state => {
console.log(state);
return state;
});
This function can be used to get one specific contact for an outbreak. A filtering mechanism can specify a criteria to match.
getContact('343d-dc3e', { where: { firstName: 'Luca' } }, {}, state => {
console.log(state.data);
return state;
});
This function is used to either update a contact in Go.Data if matched or insert a new one if no record matched the unique id.
upsertContact('4dce-3eedce3-rd33', 'visualId', {
data: {
firstName: 'Luca',
gender: 'male',
'age:years': '20',
},
});
This function is used to fetch the list of locations.
listLocations({}, state => {
console.log(state);
return state;
});
This function can be used to get one specific location. A filtering mechanism can specify a criteria to match.
getLocation({ where: { name: '30 DE MAYO' } }, {}, state => {
console.log(state.data);
return state;
});
This function is used to either update a location if matched or insert a new. A custom externalId
can be provided.
upsertLocation('name', {
data: {
name: '30 DE DECIEMBRE',
synonyms: [],
identifiers: [],
active: true,
populationDensity: 0,
geoLocation: {
lat: -45.343244,
lng: -67.193873,
},
},
});
Clone the repo, run npm install
.
Run tests using npm run test
or npm run test:watch
Build the project using make
.