diff --git a/404.html b/404.html index 5d4fcbd45fe..39cbb434a46 100644 --- a/404.html +++ b/404.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/adaptors.html b/adaptors.html index 0d131d2a3fa..69da9b56726 100644 --- a/adaptors.html +++ b/adaptors.html @@ -21,7 +21,7 @@ - + @@ -48,7 +48,7 @@ npmjs.com.

Adaptors list in npm

Building and extending adaptors

The source code and technical documentation for developing or extending existing adaptors can be found here.

Need Help ? See the Get Help page for

more information :::

- + \ No newline at end of file diff --git a/adaptors/cht.html b/adaptors/cht.html index 23f61dc16c0..961b23d69c3 100644 --- a/adaptors/cht.html +++ b/adaptors/cht.html @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ property. This will structure the payload that is sent to your OpenFn Inbox as a "Message".

To send data to CHT applications, check out the CHT API.

- + \ No newline at end of file diff --git a/adaptors/ckan.html b/adaptors/ckan.html index 9c184dd32b2..2c6e61d5bd1 100644 --- a/adaptors/ckan.html +++ b/adaptors/ckan.html @@ -21,7 +21,7 @@ - + @@ -92,7 +92,7 @@ to access the web API.

Implementation Examples

CKAN has been implemented in catalog.data.gov, open.canada.ca/data, and data.humdata.org.

- + \ No newline at end of file diff --git a/adaptors/commcare.html b/adaptors/commcare.html index 14477f08731..1e8683b4a14 100644 --- a/adaptors/commcare.html +++ b/adaptors/commcare.html @@ -21,7 +21,7 @@ - + @@ -103,7 +103,7 @@ with the CommCare API.

Implementation Examples

- + \ No newline at end of file diff --git a/adaptors/dhis2.html b/adaptors/dhis2.html index 08df7b6bf44..73e23e5ccc6 100644 --- a/adaptors/dhis2.html +++ b/adaptors/dhis2.html @@ -21,7 +21,7 @@ - + @@ -82,7 +82,7 @@ https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-235/web-api.html

  • Metadata integration via DHIS2 Web API. OpenFn implementations can leverage the DHIS2 adaptor.

  • Integration Examples

    1. DHIS2 Demo Implementations: https://github.com/OpenFn/dhis2-demo
    2. Lesotho Integration connecting two DHIS2 instances: https://github.com/OpenFn/lesotho-dhis2
    - + \ No newline at end of file diff --git a/adaptors/godata.html b/adaptors/godata.html index 7f3cb5756eb..9bedb27ba03 100644 --- a/adaptors/godata.html +++ b/adaptors/godata.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ language-http can be used to make HTTP requests to the Go.Data API and can perform any operations not supported by language-godata.

    Implementation Examples

    See Go.Data docs site: https://worldhealthorganization.github.io/godata/integration-scripts/

    - + \ No newline at end of file diff --git a/adaptors/googlesheets.html b/adaptors/googlesheets.html index 3f1673f58b3..7333348c1df 100644 --- a/adaptors/googlesheets.html +++ b/adaptors/googlesheets.html @@ -21,7 +21,7 @@ - + @@ -69,7 +69,7 @@ in this tutorial that shows us how to get data via a REST API and push it to Google Sheet.

    Helpful Resources

    - + \ No newline at end of file diff --git a/adaptors/kobotoolbox.html b/adaptors/kobotoolbox.html index 9c41f95493f..19af3607b77 100644 --- a/adaptors/kobotoolbox.html +++ b/adaptors/kobotoolbox.html @@ -21,7 +21,7 @@ - + @@ -90,7 +90,7 @@ requirements, language-http may also be implemented to send GET/POST/PUT requests to the Kobo APIs.

    Integration Examples

    See the ConSoSci GitHub repo for several example Kobo-to-database jobs: https://github.com/OpenFn/consosci

    - + \ No newline at end of file diff --git a/adaptors/library.html b/adaptors/library.html index dde3b89358a..19210e6ad76 100644 --- a/adaptors/library.html +++ b/adaptors/library.html @@ -21,7 +21,7 @@ - + @@ -62,7 +62,7 @@ experience in the future. We'd like to provide a way for users to "upvote" or "downvote" certain jobs (think: StackOverflow) which they found useful. Get in touch if you're interested in helping out!

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02.html b/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02.html index 67cd4c83454..f3fcdf023e9 100644 --- a/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02.html +++ b/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    0 - Get TEI data

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, getData

    Expression

    // TODO: get all TEIs with vaccination state 'NOT YET REQUESTED' via save filter from Austin.


    // NOTE: if we can get a webhook with the desired info, let's drop this job!

    getData('trackedEntityInstances', {
    fields: '*',
    ou: 'V5XvX1wr1kF', // traningland?
    program: 'EZkN8vYZwjR', //
    trackedEntityInstance: dataValue('id'), // the value from the post
    });

    alterState(state => {
    console.log('The response from DHIS2', state.data);
    console.log('Only pass necessary data to the DIVOC job.');
    const necessary = state.data.trackedEntityInstances[0];
    console.log(necessary);
    return { ...state, data: necessary };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04.html b/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04.html index 5b99f928f77..fd8881b6cf4 100644 --- a/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04.html +++ b/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    01 send mailgun email

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, send

    Expression

    send(
    fields(
    field('from', 'aleksa@openfn.org'),
    field('to', 'aleksa@openfn.org, aleksa@verasolutions.org'),
    field('subject', 'Kobo: New Form Submitted'),
    //You can write your own custom, anonymous functions to do whatever you desire - see function(state)
    field('text', function(state) {
    const msgText = "A form was submitted by "+ dataValue("_submitted_by")(state) + ". Please login to review!"
    return msgText
    //result will be an email with body text "A form was submitted by [Kobo Submitted By User]. Please login to review!"

    })
    )
    )
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19.html b/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19.html index 72131fd291b..87ace8d8155 100644 --- a/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19.html +++ b/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    01a/ Create Registrants

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 01a/ Create Registrants
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, post, JSON

    Expression

    // @trigger 'odk submission' either via Aggregate JSON Forwarding or via direct
    // submission to OpenFn.org/inbox
    // @credential 'ihris'
    // @adaptor 'http'
    // -----------------------------------------------------------------------------

    // =============================================================================
    // Pluck out parts of the ODK submission and prepare our 'person' object that we
    // will use in multiple requests to iHRIS. =====================================
    console.log(JSON.stringify(state.data))
    alterState(state => {
    state.person = {
    'form[person][0][0][fields][id]': 'person|0',
    'form[person][0][0][fields][surname]': state.data.RegistrationForm.last_name,
    'form[person][0][0][fields][firstname]': state.data.RegistrationForm.first_name,
    'form[person][0][0][fields][nationality]': `country|${state.data.RegistrationForm.country}`,
    'form[person][0][0][fields][residence]': 'district|3',
    };
    return state;
    });

    // =============================================================================
    // Create records via iHRIS api, with the hostUrl, port, and authentication
    // handled by the credential ===================================================
    post(
    '/manage/person',
    {
    formData: state => {
    state.person.submit_type = 'confirm';
    return state.person;
    },
    },
    post('/manage/person', {
    formData: state => {
    state.person.submit_type = 'save';
    return state.person;
    },
    options: {
    successCodes: [302],
    },
    })
    );


    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13.html b/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13.html index 67f0a11b466..af3930c2d9d 100644 --- a/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13.html +++ b/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    01b/ Query new person record

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 01b/ Query new person record
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    sqlString(state => {
    // The person information is in state from the previous operation
    console.log(state.references[0].RegistrationForm)
    return (
    `SELECT id FROM hippo_person WHERE firstname='` +
    state.references[0].RegistrationForm.first_name +
    `' AND surname='` +
    state.references[0].RegistrationForm.last_name +
    `'`
    );
    });

    alterState(state => {
    // Note: we pluck out on the 'RowDataResponses' from the SQL server.
    const personData = state.response.body;
    console.log(personData);
    // Get the first record
    state.data.person_id = personData[0] && personData[0].id
    return state;
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13.html b/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13.html index bdb7f2dccd6..7bbc6012652 100644 --- a/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13.html +++ b/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    01c/ Create person_position record

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 01c/ Create person_position record
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, post

    Expression

    // Pluck out parts of the ODK submission and prepare our 'person_postion' object that we
    // will use in multiple requests to iHRIS. =====================================
    alterState(state => {
    console.log(state);
    // The position field in the form holds the position ID and the salary
    const positionData = state.references[0].RegistrationForm.position.split('_');
    const startDateComponents = state.references[0].RegistrationForm.start_date.split('-')
    state.person_position = {
    'form[person_position][0][0][fields][id]': 'person_position|0',
    'form[person_position][0][0][fields][parent]': state.data.person_id,
    'form[person_position][0][0][fields][position]': 'position|'+positionData[0],
    'form[person_position][0][0][fields][start_date][day]': startDateComponents[2],
    'form[person_position][0][0][fields][start_date][month]': startDateComponents[1],
    'form[person_position][0][0][fields][start_date][year]': startDateComponents[0],
    'form[salary][0][0][fields][salary]': 'currency|3='+positionData[1],
    'can_edit_position': '1'
    };
    state.person_contact = {
    'form[person_contact_personal][0][0][fields][id]': 'person_contact_personal|0',
    'form[person_contact_personal][0][0][fields][parent]': state.data.person_id,
    'form[person_contact_personal][0][0][fields][mobile_phone]': state.references[0].RegistrationForm.phone_number,
    'contact_type': 'personal',
    };
    return state;
    });

    // =============================================================================
    // Create records via iHRIS api, with the hostUrl, port, and authentication
    // handled by the credential ===================================================
    post(
    '/manage/make_offer',
    {
    formData: state => {
    state.person_position.submit_type = 'confirm';
    return state.person_position;
    },
    },
    post('/manage/make_offer', {
    formData: state => {
    state.person_position.submit_type = 'save';
    return state.person_position;
    },
    options: {
    successCodes: [302],
    },
    })
    );

    post(
    '/manage/contact?contact_type=personal',
    {
    formData: state => {
    state.person_contact.submit_type = 'confirm';
    return state.person_contact;
    },
    },
    post('/manage/contact?contact_type=personal', {
    formData: state => {
    state.person_contact.submit_type = 'save';
    return state.person_contact;
    },
    options: {
    successCodes: [302],
    },
    })
    );


    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11.html b/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11.html index 51f4775e601..f0b89331e11 100644 --- a/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11.html +++ b/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    02a/ Query DB for people to pay

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 02a/ Query DB for people to pay
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression


    sqlString(state => {
    // stored procedure will return a list of names, phone numbers (MSISDN), and salary info for employees that should be paid today
    return 'CALL get_employees_to_pay();';
    });

    //alterState(state => {
    // Note: we pluck out on the 'RowDataResponses' from the SQL server.
    // state.data.records = state.response.body[0];
    // return state;
    //});
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19.html b/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19.html index 511e39066c7..9aa9bdd41a5 100644 --- a/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19.html +++ b/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    02b/ Initiate Payments

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 02b/ Initiate Payments
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, dataPath, each, map, post

    Expression

    // @trigger 'when 2a succeeds'
    // @credential 'ihris-mifos-combined'
    // @adaptor 'http'
    // -----------------------------------------------------------------------------

    // Hang 'payees' on state so that operations which replace "response" don't
    // overwrite these data. QUESTION: Why pluck body[0] instead of body[*]? What
    // happens if there are multiple payees? Is that first item in the body array an
    // array itself?
    alterState(state => {
    state.data = { payees: state.response.body[0] };
    state.saved_config = state.configuration;
    return state;
    });

    // ===========================================================================
    // Make payment requests in Mifos with the reponse, either in bulk or by
    // iterating through the array of registrants and making a separate request
    // for each one ==============================================================
    each(
    dataPath('payees[*]'),
    post(
    `${state.configuration.mifosUrl}/channel/transactions`,
    {
    authentication: state.configuration.mifosAuth,
    headers: {
    'content-type': 'application/json',
    'X-Tenant-Identifier': 'tn07',
    },
    // Can we send an array of payments to make in a single request?
    // body: state.data.registrants.map(r => {
    // console.log(`Initiating payment for ${r.name}.`);
    // return {
    // payer: { msisdn: state.configuration.mifosAcct },
    // payee: { msisdn: r.phone },
    // amount: r.amount,
    // };
    // }),
    body: state => {
    return {
    payer: {
    partyIdInfo: {
    partyIdType: 'MSISDN',
    partyIdentifier: '27710203999',
    },
    },
    payee: {
    partyIdInfo: {
    partyIdType: 'MSISDN',
    partyIdentifier: state.data.msisdn,
    },
    },
    amountType: 'SEND',
    transactionType: {
    scenario: 'PAYMENT',
    initiator: 'PAYER',
    initiatorType: 'CONSUMER',
    },
    amount: {
    currency: 'USD',
    amount: state.data.salary / 52,
    },
    };
    },
    },
    state => {
    const today = new Date();
    const currPayee = state.references[0];
    state.data.person_payment = {
    'form[person_payments][0][0][fields][id]': 'person_payments|0',
    'form[person_payments][0][0][fields][parent]':
    'person|' + currPayee.person_id,
    'form[person_payments][0][0][fields][date][day]': today.getDate(),
    'form[person_payments][0][0][fields][date][month]':
    today.getMonth() + 1,
    'form[person_payments][0][0][fields][date][year]': today.getFullYear(),
    'form[person_payments][0][0][fields][amount]': currPayee.salary / 52,
    'form[person_payments][0][0][fields][transactionId]':
    state.data.body.transactionId,
    'form[person_payments][0][0][fields][status]':
    state.data.body.transactionId ? 'initiated' : 'failed',
    };
    // =====================================================================
    // Create "initiated" payments in iHRIS with their mifos external IDs ==
    post(
    `${state.saved_config.ihrisUrl}/manage/person_payments`,
    {
    authentication: state.configuration.ihrisAuth,
    formData: state => {
    state.data.person_payment.submit_type = 'confirm';
    console.log('PaymentData: ' + state.data.person_payment);
    return state.data.person_payment;
    },
    },
    post(`${state.saved_config.ihrisUrl}/manage/person_payments`, {
    authentication: state.configuration.ihrisAuth,
    formData: state => {
    state.references[1].person_payment.submit_type = 'save';
    return state.references[1].person_payment;
    },
    options: {
    successCodes: [302],
    },
    })
    )(state);
    }
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19.html b/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19.html index c40d8f2e3ca..398e55e6383 100644 --- a/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19.html +++ b/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    03/ Update Payment Status

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 03/ Update Payment Status
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    sqlString(state => {
    console.log(state.data.transactionCode);
    return `SELECT record FROM entry WHERE string_value='${state.data.transactionCode}'`;
    });

    alterState(state => {
    // Note: we pluck out on the 'RowDataResponses' from the SQL server.
    const recordData = state.response.body.filter(x => x.record !== undefined);
    // Get the first record
    state.data.record = recordData[0] && recordData[0].record;
    return state;
    });

    sqlString(state => {
    return `UPDATE entry SET string_value='completed' where record=${state.data.record} and string_value='initiated'`;
    });

    sqlString(state => {
    return `UPDATE last_entry SET string_value='completed' where record=${state.data.record} and string_value='initiated'`;
    });

    sqlString(state => {
    return `UPDATE hippo_person_payments SET status='completed' where id='person_payments|${state.data.record}'`;
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12.html b/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12.html index 4d615e5640c..7edb80c9b27 100644 --- a/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12.html +++ b/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    04a/Query for job changes

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 04a/Query for job changes
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    sqlString(state => {
    return "SELECT position_id, position_name, salary, facility_id, facility_name, status \
    FROM position_updates WHERE status in ('NEW', 'CLOSED');";
    });

    alterState(state => {
    state.new_jobs = state.response.body;
    console.log(state.new_jobs);
    return state;
    })

    sqlString(state => {
    return `UPDATE position_updates SET status='PROCESSED' WHERE status in ('NEW','CLOSED')`;
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03.html b/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03.html index 4af7c79a0a0..7922e2135bd 100644 --- a/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03.html +++ b/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    04b/ Update ODK form

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 04b/ Update ODK form
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    get, post, Number

    Expression

    // Your job goes here.
    get(
    'http://165.227.185.106/formXml',
    {
    query: {
    formId: 'registration_form',
    },
    },
    state => {
    console.log('Start processing state and form template!');

    let template = state.data.body;
    let templateUpdated = false;

    const itemEx = /<item>\s?<label>[^<>]*<\/label>\s?<value>[^<>]*<\/value>\s?<\/item>/gi;
    const itemMatches = template.match(itemEx);

    const selectFacilityEx = /<select1\s+ref="\/RegistrationForm\/position_facility">/gi;
    //const selectFacilityEx = /<select1\s+ref="\/data\/position_facility">/gi;
    const selectPositionEx = /<select1\s+ref="\/RegistrationForm\/position">/gi;
    //const selectPositionEx = /<select1\s+ref="\/data\/position">/gi;

    console.log(`Received ${state.new_jobs.length} new data!`);

    for(let j = 0; j < state.new_jobs.length; j ++) {
    let facilityExists = false;
    let positionExists = false;

    let facilityId = state.new_jobs[j].facility_id;
    console.log(`Processing facility: ${facilityId}.`);

    const positions = state.new_jobs[j].position_id.split('|');
    const salaries = state.new_jobs[j].salary.split('=');

    let positionId = `${positions[1]}_${salaries[1]}`;
    console.log(`Processing position: ${positionId}.`);
    for(let i = 0; i < itemMatches.length; i ++) {
    if (itemMatches[i].indexOf(facilityId) >= 0) {
    facilityExists = true;
    }
    if (itemMatches[i].indexOf(positionId) >= 0) {
    if (state.new_jobs[j].status === 'CLOSED') {
    console.log(`Removing closed position: ${positionId}.`);
    template = template.replace(itemMatches[i], '');
    templateUpdated = true;
    }
    positionExists = true;
    }
    }

    if (!facilityExists) {
    const selectFacilityMatches = template.match(selectFacilityEx);
    console.log("Facility matches: "+selectFacilityMatches)
    const facilityItem =
    `<item><label>${state.new_jobs[j].facility_name}</label><value>${facilityId}</value></item>`;
    console.log(`Adding facility: ${facilityItem}.`);
    template = template.replace(
    selectFacilityEx,
    selectFacilityMatches[0] + facilityItem
    );
    templateUpdated = true;
    } else {
    console.log('Not seeing any facility to add. Moving along!');
    }

    if (!positionExists && state.new_jobs[j].status === 'NEW') {
    const selectPositionMatches = template.match(selectPositionEx);
    const positionItem =
    `<item><label>${state.new_jobs[j].position_name}</label><value>${positionId}</value></item>`;
    console.log(`Adding position: ${positionItem}.`);
    template = template.replace(
    selectPositionEx,
    selectPositionMatches[0] + positionItem
    );
    templateUpdated = true;
    } else {
    console.log('Not seeing any position to add. Moving along!');
    }
    }

    if (templateUpdated) {
    const versionEx = /id="\S+"\s+version="(\S+)"/;
    const versionMatches = template.match(versionEx);
    const currentVersion = Number.parseInt(versionMatches[1]);
    console.log(`Updating form version from: ${currentVersion}`);
    template = template.replace(currentVersion, currentVersion + 1);
    }

    state.template = template;
    return state;
    }
    );

    post('http://165.227.185.106/formUpload', {
    formData: state => {
    return {
    form_def_file: {
    value: state.template,
    options: {
    filename: 'registration_form.xml'
    }
    }
    };
    },
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03.html b/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03.html index 90bd3212e46..3a4311eb866 100644 --- a/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03.html +++ b/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    05/ Submit employee evaluation

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 05/ Submit employee evaluation
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, post

    Expression

    // @trigger 'when employee evaluation form arrives'
    // @credential 'ihris-mifos-combined'
    // @adaptor 'http'
    // -----------------------------------------------------------------------------

    alterState(state => {
    state.payee = state.data.EvaluationForm;
    state.saved_config = state.configuration;
    return state;
    });

    post(
    `${state.configuration.mifosUrl}/channel/transactions`,
    {
    authentication: state.configuration.mifosAuth,
    headers: {
    'content-type': 'application/json',
    'X-Tenant-Identifier': 'tn07',
    },
    body: state => {
    return {
    payer: {
    partyIdInfo: {
    partyIdType: 'MSISDN',
    partyIdentifier: '27710407990',
    },
    },
    payee: {
    partyIdInfo: {
    partyIdType: 'MSISDN',
    partyIdentifier: state.payee.social_worker_id.split('_')[1],
    },
    },
    amountType: 'SEND',
    transactionType: {
    scenario: 'PAYMENT',
    initiator: 'PAYER',
    initiatorType: 'CONSUMER',
    },
    amount: {
    currency: 'USD',
    // Calculate the bonus amount - for now just use number of clients seen * 100
    amount: state.payee.client_counts*100,
    },
    };
    },
    },
    state => {
    const today = new Date();
    state.data.person_payment = {
    'form[person_payments][0][0][fields][id]': 'person_payments|0',
    'form[person_payments][0][0][fields][parent]':
    'person|' + state.payee.social_worker_id.split('_')[0],
    'form[person_payments][0][0][fields][date][day]': today.getDate(),
    'form[person_payments][0][0][fields][date][month]':
    today.getMonth() + 1,
    'form[person_payments][0][0][fields][date][year]': today.getFullYear(),
    'form[person_payments][0][0][fields][amount]': state.payee.client_counts*100,
    'form[person_payments][0][0][fields][transactionId]':
    state.data.body.transactionId,
    'form[person_payments][0][0][fields][status]':
    state.data.body.transactionId ? 'initiated' : 'failed',
    };
    // =====================================================================
    // Create "initiated" payments in iHRIS with their mifos external IDs ==
    post(
    `${state.saved_config.ihrisUrl}/manage/person_payments`,
    {
    authentication: state.configuration.ihrisAuth,
    formData: state => {
    state.data.person_payment.submit_type = 'confirm';
    console.log('PaymentData: ' + state.data.person_payment);
    return state.data.person_payment;
    },
    },
    post(`${state.saved_config.ihrisUrl}/manage/person_payments`, {
    authentication: state.configuration.ihrisAuth,
    formData: state => {
    state.references[1].person_payment.submit_type = 'save';
    return state.references[1].person_payment;
    },
    options: {
    successCodes: [302],
    },
    })
    )(state);
    }
    );


    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19.html b/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19.html index 9cfa43a1e75..8ee5282bd2b 100644 --- a/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19.html +++ b/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    05a/Query for new employees

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 05a/Query for new employees
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    sqlString(state => {
    return "SELECT person_id, person_name, msisdn, status FROM employee_updates WHERE status='NEW';";
    });

    alterState(state => {
    state.new_employees = state.response.body;
    console.log(state.new_employees);
    return state;
    })

    sqlString(state => {
    return `UPDATE employee_updates SET status='PROCESSED' WHERE status='NEW'`;
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19.html b/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19.html index ff9a8eb2004..63eeaadc847 100644 --- a/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19.html +++ b/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    05b/Update ODK eval form

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 05b/Update ODK eval form
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created almost 5 years ago
    • Updated over 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    get, post, Number

    Expression

    // Your job goes here.
    get(
    'http://165.227.185.106/formXml',
    {
    query: {
    formId: 'evaluation_form',
    },
    },
    state => {
    let template = state.data.body;
    let templateUpdated = false;

    const itemEx = /<item>\s?<label>[^<>]*<\/label>\s?<value>[^<>]*<\/value>\s?<\/item>/gi;
    const itemMatches = template.match(itemEx);

    const selectUserEx = /<select1\s+ref="\/EvaluationForm\/social_worker_id">/gi;

    console.log(`Receiving ${state.new_employees.length} new data!`);

    for (let j = 0; j < state.new_employees.length; j++) {
    let userExists = false;

    let userId = state.new_employees[j].person_id.split('|')[1];
    console.log(`Processing user: ${userId}.`);

    for (let i = 0; i < itemMatches.length; i++) {
    if (itemMatches[i].indexOf(userId) >= 0) {
    userExists = true;
    }
    }

    if (!userExists) {
    const selectUserMatches = template.match(selectUserEx);
    const msisdn = state.new_employees[j].msisdn;
    const userItem =
    `<item><label>${state.new_employees[j].person_name}</label><value>${userId}_${msisdn}</value></item>`;
    console.log(`Adding user: ${userItem}.`);
    template = template.replace(
    selectUserEx,
    selectUserMatches[0] + userItem
    );
    templateUpdated = true;
    } else {
    console.log('Not seeing any user to add. Moving along!');
    }
    }

    if (templateUpdated) {
    const versionEx = /id="\S+"\s+version="(\S+)"/;
    const versionMatches = template.match(versionEx);
    const currentVersion = Number.parseInt(versionMatches[1]);
    console.log(`Updating form version from: ${currentVersion}`);
    template = template.replace(currentVersion, currentVersion + 1);
    }

    state.template = template;
    return state;
    }
    );

    post('http://165.227.185.106/formUpload', {
    formData: state => {
    return {
    form_def_file: {
    value: state.template,
    options: {
    filename: 'evaluation_form.xml'
    }
    }
    };
    },
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03.html b/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03.html index 5ec09a77060..de6a1a1227e 100644 --- a/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03.html +++ b/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    1. Create Payment in SF

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue, field, fields, relationship

    Expression

    create('Payment__c', fields(
    field('Name', dataValue('reference_number')),
    field('Amount__c', dataValue('amount')),
    field('Phone_Number__c', dataValue('sender_number')),
    relationship('Contract__r', 'ContractNumber', dataValue('contract_number'))
    ));
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08.html b/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08.html index 648938a558a..924db634e8d 100644 --- a/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08.html +++ b/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    1 Get CommCare Forms Bulk Extract

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 1 Get CommCare Forms Bulk Extract
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created over 3 years ago
    • Updated about 2 months ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    each, get, post

    Expression

    get(
    'https://www.commcarehq.org/a/grassrootsoccertrial/api/v0.5/form/',
    {
    query: {
    limit: 1000, //max limit: 1000
    offset: state.meta && state.meta.next ? state.meta.limit + state.meta.offset : 0,
    received_on_start: '2024-05-16',
    received_on_end: '2024-05-30',
    xmlns: 'http://openrosa.org/formdesigner/6F130211-5A05-4915-8F55-A413A6B9D61B',
    },
    },
    state => {
    const { meta, objects } = state.data;
    const { openfnInboxUrl } = state.configuration;
    const xmlnsList = [
    `http://openrosa.org/formdesigner/6F130211-5A05-4915-8F55-A413A6B9D61B`, //Outcome Survey form
    // 'http://openrosa.org/formdesigner/40BBC9E3-C650-4F72-A027-235BF33D87AB', //Create Intervention form
    // 'http://openrosa.org/formdesigner/D50A9A33-B1B4-41B2-9ACA-15DBBDFBCF8C', // My Team/Group Name form
    //'http://openrosa.org/formdesigner/D771417E-354E-4906-A686-DF0BA230F16A', // Register Participant form
    // 'http://openrosa.org/formdesigner/2B9F69A2-7E51-49F6-9FF9-F72F3EC14A9E', // Register Participant skillz
    // 'http://openrosa.org/formdesigner/304CABA9-C8A8-4360-83C6-5E2EC1D2C2AC', // Intervention notes
    //'http://openrosa.org/formdesigner/56DB98AC-67EC-4BBA-91FC-9443E84E43CE', //PHQ9
    // 'http://openrosa.org/formdesigner/5E2E3990-2C3C-42F5-BE0B-922ED29939C4', // ART Adherence Self-Reporting Tool
    // 'http://openrosa.org/formdesigner/4CFAC371-88F7-4349-BEB2-3DA2BDE445EA', //Malaria Testing Event Snapshot
    // 'http://openrosa.org/formdesigner/FAF8F169-0FF1-4DE4-98B7-E4450BECBC84', //Malaria Testing Event Statistics
    // 'http://openrosa.org/formdesigner/E31B9126-1DCA-4603-AD57-271A843448B3', //Register Skillz Plus Club
    //'http://openrosa.org/formdesigner/5D8455CE-6044-471D-83BB-131A3D52794B', // Service Referral Followup -> confirm services received
    // 'http://openrosa.org/formdesigner/0B3DD3B4-A767-4671-A63C-8A352DAA8E2D', // service referral followup
    //'http://openrosa.org/formdesigner/59E1207B-969F-402D-9EEE-675504036F78', //Home Visit log form
    // 'http://openrosa.org/formdesigner/3B4B1C64-092A-4922-B033-94D80A11D960', // Coach Session Register form
    // 'http://openrosa.org/formdesigner/41DF97A0-0E4B-460D-B983-13D404565009', //HIV Testing Event Snapshot
    // 'http://openrosa.org/formdesigner/EAA0ABBB-C517-4E7F-82A9-5799E944FE52', //HIV Testing Event Statistics
    // 'http://openrosa.org/formdesigner/EA6C0348-91F7-44FC-8786-B34F50B0CB62', //Register Event
    // 'http://openrosa.org/formdesigner/34DD6DFD-13E7-4E19-8A27-F18B6D39E12E', //Attendance
    //'http://openrosa.org/formdesigner/F55C4DF9-0CCD-4AED-A5C4-1E39ED2E45C4', //Attendance skillz plus club
    // 'http://openrosa.org/formdesigner/A3AF9DA6-1D57-46E4-8431-A5C262DC2DBA', // Pre Challenges
    // 'http://openrosa.org/formdesigner/D2F0F23F-9C0E-41E7-9C46-7553F8B5DCC8', // Post Challenges
    //'http://openrosa.org/formdesigner/0DAB6FD9-A7C1-4F56-A1C8-794B7C123F95', // Service Referral
    // 'http://openrosa.org/formdesigner/98041DA3-B37D-4E8E-A9B9-29EDC036A46A', // Aggregate Service Referrals
    // 'http://openrosa.org/formdesigner/50A337EB-FBD8-4607-A664-21AAE51DFCD1', // Coach Support Visit form
    // 'http://openrosa.org/formdesigner/AA396157-EBF9-4B51-B25A-D5BDA4F3DF73', // Coach Support Visit form Zambia
    // 'http://openrosa.org/formdesigner/3FFDCE4F-35A9-4FA9-971F-EFFDC94E597F', //Risk & vulnerability assessment
    //'http://openrosa.org/formdesigner/3DAF13EC-FA77-4480-8946-667D841B439A', //risk & vulnerability assessment | new Referrals
    ];

    // const forms = objects.filter(obj => xmlnsList.includes(obj.form['@xmlns']));
    const forms = objects;

    state.configuration = { baseUrl: 'https://www.openfn.org' };
    console.log('Posting form submissions to OpenFn Inbox...');

    return each(forms, state => {
    return post(`/inbox/${openfnInboxUrl}`, { body: state.data }, state => ({
    ...state,
    data: {},
    references: [],
    }))(state);
    })(state);
    }
    );
    //ALL form xmlns codes
    //xmlns: 'http://openrosa.org/formdesigner/D50A9A33-B1B4-41B2-9ACA-15DBBDFBCF8C', // My Team/Group Name form
    //xmlns: 'http://openrosa.org/formdesigner/D771417E-354E-4906-A686-DF0BA230F16A', // Register Participant form
    //xmlns: 'http://openrosa.org/formdesigner/2B9F69A2-7E51-49F6-9FF9-F72F3EC14A9E', // Register Participant skillz
    //xmlns: 'http://openrosa.org/formdesigner/304CABA9-C8A8-4360-83C6-5E2EC1D2C2AC', // Intervention notes
    //xmlns: 'http://openrosa.org/formdesigner/304CABA9-C8A8-4360-83C6-5E2EC1D2C2AC', // Intervention Notes form
    //xmlns: 'http://openrosa.org/formdesigner/AA396157-EBF9-4B51-B25A-D5BDA4F3DF73', // Coach Support Visit form Zambia
    //xmlns: 'http://openrosa.org/formdesigner/50A337EB-FBD8-4607-A664-21AAE51DFCD1', // Coach Support Visit form
    //xmlns: 'http://openrosa.org/formdesigner/3B4B1C64-092A-4922-B033-94D80A11D960', // Coach Session Register form
    //xmlns: 'http://openrosa.org/formdesigner/34DD6DFD-13E7-4E19-8A27-F18B6D39E12E', //Attendance
    //xmlns: 'http://openrosa.org/formdesigner/4CFAC371-88F7-4349-BEB2-3DA2BDE445EA', //Malaria Testing Event Snapshot
    //xmlns: 'http://openrosa.org/formdesigner/59E1207B-969F-402D-9EEE-675504036F78', //Home Visit log form
    //xmlns: 'http://openrosa.org/formdesigner/41DF97A0-0E4B-460D-B983-13D404565009', //HIV Testing Event Snapshot
    //xmlns: 'http://openrosa.org/formdesigner/551BCED9-077B-40EE-849D-0416756B9A75', // PHQ9
    //xmlns: 'http://openrosa.org/formdesigner/0DAB6FD9-A7C1-4F56-A1C8-794B7C123F95', // Service Referral
    //xmlns: 'http://openrosa.org/formdesigner/0B3DD3B4-A767-4671-A63C-8A352DAA8E2D', // Service Referral Followup
    //xmlns: 'http://openrosa.org/formdesigner/98041DA3-B37D-4E8E-A9B9-29EDC036A46A', // Aggregate Service Referrals
    //xmlns: 'http://openrosa.org/formdesigner/5E2E3990-2C3C-42F5-BE0B-922ED29939C4', // ART Adherence Self-Reporting Tool
    //xmlns: 'http://openrosa.org/formdesigner/A3AF9DA6-1D57-46E4-8431-A5C262DC2DBA', // Pre Challenges
    //xmlns: 'http://openrosa.org/formdesigner/D2F0F23F-9C0E-41E7-9C46-7553F8B5DCC8', // Post Challenges
    //xmlns: 'http://openrosa.org/formdesigner/FAF8F169-0FF1-4DE4-98B7-E4450BECBC84', // Malaria Testing Event Statistics
    //xmlns: 'http://openrosa.org/formdesigner/EA6C0348-91F7-44FC-8786-B34F50B0CB62', //Register Event
    //xmlns: 'http://openrosa.org/formdesigner/EAA0ABBB-C517-4E7F-82A9-5799E944FE52', //HIV Testing Event Statistics

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08.html b/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08.html index 929bb5a728c..0785a0e9743 100644 --- a/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08.html +++ b/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14.html b/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14.html index 76a9b680b83..a2955fa63ae 100644 --- a/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14.html +++ b/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    2. SMS Balance Update to Customer

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, send

    Expression

    send(
    fields(
    field('to_number',
    dataValue('Envelope.Body.notification.Phone_Number__c')
    ),
    field('message_type', 'sms'),
    field('route_id', 'PN5d224d8136086997'),
    field('content',
    'Payment successful! Your updated contract balance is '
    + state.data.Envelope.Body.notification.AmountDue__c
    )
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28.html b/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28.html index 8a5ec66dc2e..fd11ee8f311 100644 --- a/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28.html +++ b/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Add DHIS2 Data Value Sets

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Add DHIS2 Data Value Sets
    • Adaptor: @openfn/language-dhis2
    • Adaptor Version: v0.1.0
    • Created over 8 years ago
    • Updated almost 7 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    dataPath, dataValue, each, field, fields

    Expression

    each(
    dataPath("data[*]"),
    // Use our system specific helper functions...
    dataValueSet(
    fields(
    field("dataSet", "pBOMPrpg1QX"),
    field("orgUnit", "DiszpKrYNg8"),
    field("period", "201401"),
    field("completeData", dataValue("today")),
    field("dataValues", function(state) {
    // Or write your own JS...
    console.log("Do anything you want in here.");
    return [
    dataElement("qrur9Dvnyt5", state.data.site_school_number),
    dataElement("oZg33kd9taw", state.data.light_source),
    dataElement("msodh3rEMJa", state.data.number_of_children)
    ];
    })
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Asana-test-2024-07-29.html b/adaptors/library/jobs/auto/Asana-test-2024-07-29.html index 7b38be6b9d8..e9ed49c9b50 100644 --- a/adaptors/library/jobs/auto/Asana-test-2024-07-29.html +++ b/adaptors/library/jobs/auto/Asana-test-2024-07-29.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Asana-test

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    Expression

    /* eslint-disable no-undef */
    // Your job goes here.
    getTasks("11989019982662", {
    opt_fields: "name",
    });
    fn(state => {
    console.log({ state });
    return state;
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14.html b/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14.html index 15971a8be59..a59f2a2db76 100644 --- a/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14.html +++ b/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Attendance Non Skillz

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    fn(state => {
    if (!state.data.form.attendance_list.update_participant_cases.item) {
    console.log('No participant attendance data was provided, not upserting to Salesforce.');
    return state;
    } else {
    // query(
    // `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.attendance_list.update_participant_cases.item[0]['@id']}'`
    // );

    // fn(state => {
    const records = lastReferenceValue('records')(state);
    const eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);

    // if (!eventName) {
    // console.log(
    // `Participant not found with CommCare_Case_ID__c: ${state.data.form.attendance_list.update_participant_cases.item[0]['@id']}`
    // );
    // return state;
    // }

    return execute(
    fn(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = eventName ? eventName.replace(/\//gi, '') : null;

    function getSessionValue(present) {
    switch (present.toString().toLowerCase()) {
    case 'yes':
    return 'X';
    case 'no':
    return 'A';
    case '':
    return 'N';
    default:
    return 'U';
    }
    }

    function getSessionId(session_text) {
    return session_text.toString().trim().slice(0, session_text.indexOf(' ')).slice(1);
    }

    function objectToArray(object) {
    if (!object) return [];
    return !Array.isArray(object) ? [object] : object;
    }

    state.data.form.attendance_list.update_participant_cases.item = objectToArray(
    state.data.form.attendance_list.update_participant_cases.item
    );

    //When GRS enters session names incorrectly in CommCare (e.g., session: "P8 // My body is mine)
    function findPValue(input) {
    // Regular expression to match "P" followed by one or more digits, then "//"
    const regex = /P(\d+)\s*\/\//;

    // Match the input against the regex
    const match = input.match(regex);

    // If a match is found, return the captured digits as an integer
    if (match) {
    return parseInt(match[1], 10);
    } else {
    // If no match is found, return null or handle as needed
    return 'Session_not_found';
    }
    }

    const sessionText = dataValue('form.attendance_list.session')(state);
    const sessionId = sessionText.includes('//') ? findPValue(sessionText) : getSessionId(sessionText);

    console.log('sessionText:: ', sessionText);
    console.log('sessionId:: ', sessionText);

    const sessionDate = dataValue("form.case['@date_modified']")(state);

    state.data.form.attendance_list.update_participant_cases.item =
    state.data.form.attendance_list.update_participant_cases.item.map(item => {
    const sessionValue = getSessionValue(item.attendance_session);
    return {
    ...item,
    dynamicFields: {
    [`Session_${sessionId}__c`]: sessionValue,
    [`Session_${sessionId}_Date__c`]: sessionDate,
    },
    };
    });

    return state;
    }),

    each(
    merge(
    dataPath('form.attendance_list.update_participant_cases.item[*]'),
    fields(
    field('intervention_name', dataValue('form.intervention_name')),
    field('eventName', dataValue('eventName')),
    field('caseid', dataValue('form.case.@case_id'))
    )
    ),
    upsert('Attendance__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    relationship('Event__r', 'CommCare_Case_ID__c', dataValue('caseid')),
    field(
    'CommCare_Ext_ID__c',
    state => `${state.data['@id']}-${toUTF8(state.data.intervention_name)}`
    ),
    relationship('Person_Attendance__r', 'Participant_Identification_Number_PID__c', dataValue('@id'))
    ),
    ...state.data.dynamicFields,
    }))
    )
    )(state);
    }
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27.html b/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27.html index 55b656f3da5..eebd6f481b1 100644 --- a/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27.html +++ b/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    CHW case to DHIS2

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue

    Expression

    create('trackedEntityInstances', {
    trackedEntityType: 'nEenWmSyUEp', // a person
    orgUnit: 'DiszpKrYNg8',
    attributes: [
    {
    attribute: 'w75KJ2mc4zz', // attribute id for first name
    value: dataValue('case.firstName')(state) // data from submission
    },
    {
    attribute: 'zDhUuAYrxNC', // attribute id for last name
    value: dataValue('case.lastName')(state) // data from another submission field
    }
    ]
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26.html b/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26.html index 87e97531bd5..e7ee3395231 100644 --- a/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26.html +++ b/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Catch Error in HTTP Request

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Catch Error in HTTP Request
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created about 8 years ago
    • Updated almost 2 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    get, JSON

    Expression

    get(
    'https://jsonplaceholder.typicode.com/wrongUrl', // the url
    {
    transformResponse: [
    data => {
    console.log("The data from the response, BEFORE the error is thrown");
    console.log(JSON.stringify(data, null, 2))
    return data;
    }
    ],
    }, // no additional options
    state => { // the callback
    console.log('the data', state.data)
    return state;
    }
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03.html b/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03.html index aa4f8639742..afd0f73d094 100644 --- a/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03.html +++ b/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Coach Session Register

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, each, field, fields, query, relationship, upsert

    Expression

    // push to production
    query(
    `SELECT Coach_A__c, Coach_A__r.Name from Event__c where CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    const present = dataValue('form.present')(state).toLowerCase();

    function getSessionValue() {
    let value;
    switch (present) {
    case 'yes':
    value = 'X';
    break;
    case 'no':
    value = 'A';
    break;
    case '':
    value = 'N';
    break;
    default:
    value = 'U';
    break;
    }
    return value;
    }

    const session_text = dataValue('form.session')(state);

    const session_id = session_text.trim().slice(0, session_text.indexOf(' ')).slice(1);
    console.log("session_id: ", session_id);

    const coachname = dataValue('form.coach_name')(state)
    ? dataValue('form.coach_name')(state)
    : state.references[0].records[0].Coach_A__r.Name;

    let external_id = `${dataValue('form.case.@case_id')(state)}
    ${coachname}`; //case_id + coach_name for external Id

    state.data.commcare_external_id = external_id.toLowerCase().replace(/\s/g, '').trim();

    state.data.dynamicFields = [
    field(`Session_${session_id}__c`, getSessionValue()),
    field(`Session_${session_id}_Date__c`, dataValue('form.date')(state)),
    //field(`Session_${session_id}_Duration__c`, dataValue('form.duration')(state)), //NOTE: Duration fields don't exist in SF?
    ];

    state.data.durationFields = [field(`Session_${session_id}_Duration__c`, dataValue('form.duration')(state))];
    console.log(state.data.durationFields);

    return state;
    });

    upsert('Event__c', 'CommCare_Case_ID__c', state => ({
    ...fields(field('CommCare_Case_ID__c', dataValue('form.case.@case_id'))),
    ...fields(...state.data.durationFields),
    }));

    query(
    `SELECT Coach_A__c, Coach_A__r.CommCare_Ext_ID__c from Event__c where CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    const coaches = dataValue('form.coach_name')(state).split(' ');
    const dynamicFields = state.data.dynamicFields;
    const commcare_external_id = state.data.commcare_external_id;
    const caseid = state.data.form.case['@case_id'];
    return each(
    coaches,
    upsert('Attendance__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    //relationship('RecordType', 'Name', 'Coach Development'),
    field('RecordTypeId', '012500000009jqaAAA'),
    relationship('Event__r', 'CommCare_Case_ID__c', caseid),
    relationship('Person_Attendance__r', 'CommCare_Ext_ID__c', state => {
    const coach_name = state.data;
    return coach_name;
    }),
    field('CommCare_Ext_ID__c', commcare_external_id)
    ),
    ...fields(...dynamicFields),
    }))
    )(state);
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/CommCare-FHIR.html b/adaptors/library/jobs/auto/CommCare-FHIR.html index 1683bd33f47..86e3cdf3c16 100644 --- a/adaptors/library/jobs/auto/CommCare-FHIR.html +++ b/adaptors/library/jobs/auto/CommCare-FHIR.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Create encounter in OpenHIM

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataValue, field, fields

    Expression

    // CommCare form submission mapped to the FHIR patient encounter standard,
    // submitted by Simon Kelly @ Dimagi.
    encounter(
    fields(
    field('resourceType', 'Encounter'),
    field('status', 'finished'),
    field('type', function (state) {
    return [
    {
    coding: [
    {
    system: 'momconnect:type',
    code: '8',
    },
    ],
    },
    ];
    }),
    field('contained', function (state) {
    return [
    {
    resourceType: 'Patient',
    id: 'patient',
    identifier: [
    {
    use: 'official',
    system: 'momconnect:sanid',
    value: dataValue('properties.id_number')(state),
    },
    ],
    name: [
    {
    use: 'official',
    family: [dataValue('properties.family_name')(state)],
    given: [dataValue('properties.given_name')(state)],
    text: dataValue('properties.given_name')(state).concat(
    ' ',
    dataValue('properties.family_name')(state)
    ),
    },
    ],
    gender: 'female',
    birthDate: dataValue('properties.dob')(state),
    telecom: [
    {
    system: 'phone',
    value: dataValue('properties.msisdn')(state),
    },
    ],
    communication: [
    {
    language: {
    coding: [
    {
    system: 'urn:ietf:bcp:47',
    code: dataValue('properties.language_code')(state),
    },
    ],
    },
    preferred: true,
    },
    ],
    },
    {
    resourceType: 'Observation',
    id: 'edd',
    code: {
    coding: [
    {
    system: 'http://loinc.org',
    code: '11778-8',
    display: 'Delivery date Estimated',
    },
    ],
    },
    valueDateTime: dataValue('properties.edd')(state),
    status: 'preliminary',
    },
    ];
    }),
    field('patient', function (state) {
    return {
    reference: '#patient',
    };
    }),
    field('period', function (state) {
    return {
    start: dataValue('properties.visit_date')(state),
    };
    }),
    field('extension', function (state) {
    return [
    {
    url: 'momconnect:mha',
    valueInteger: 2,
    },
    {
    url: 'momconnect:swt',
    valueInteger: 3,
    },
    {
    url: 'momconnect:dmsisdn',
    valueString: '+27831111111',
    },
    ];
    })
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27.html b/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27.html index f8a72921628..ee901ad55a7 100644 --- a/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27.html +++ b/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    CommCare to Azure Sql

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, join, map, sql

    Expression

    // Insert household, fail on duplicate (consider upsert strategy, if you want!)
    sql({
    query:
    'INSERT INTO Household (' +
    [
    'commcare_id',
    'is_head',
    'total_members',
    'head_name',
    'date_registered',
    'village',
    'new_thing',
    ].join(', ') +
    `) VALUES ('` +
    [
    state.data.metadata.instanceID,
    state.data.form.head_of_household === 'yes' ? 1 : 0,
    state.data.form.hh_members,
    state.data.form.individual_name,
    state.data.form.registration_date,
    state.data.form.village_name,
    state.data.form.new_q,
    ].join(`', '`) +
    `');`,
    });

    // Prepare a string to be used for VALUES (...) in our member insert.
    alterState(state => {
    const data = state.references[0];
    const form = data.form;
    const parentId = data.metadata.instanceID;
    const memArr = form.register_hh_members.map((m, i) => {
    return `('${parentId}-${i}', '${parentId}', '${m.hh_member_name}', '${m.age}')`;
    });

    state.members = memArr.join(', ');
    return state;
    });

    // Insert members, fail on duplicate
    sql({
    query: state =>
    `INSERT INTO HouseholdMember (commcare_id, parent, name, age) VALUES ${state.members}`,
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html b/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html index 3873660c197..1997d3d7484 100644 --- a/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html +++ b/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Create Intervention

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsert

    Expression

    alterState((state) => {

    function clean(str) {
    if (!!str)
    return str
    .split('_')
    .map(word => {
    let new_word = word.toString().toLowerCase();
    return new_word.slice(0, 1).toUpperCase() + new_word.slice(1);
    })
    .join(' ');
    }

    state.data.form.delivery_method = clean(state.data.form.delivery_method);

    const coachFieldNames = ['Coach_A__r','Coach_B__r','Coach_C__r','Coach_D__r']

    state.data.destinationCoachFields = state.data.form.coaches
    .split(' ')
    .reduce(
    (accumulator, currentValue, currentIndex) => [
    ...accumulator,
    (currentIndex < coachFieldNames.length && !!currentValue
    ? relationship(coachFieldNames[currentIndex], 'CommCare_Ext_ID__c', currentValue)
    : []),
    ],
    []
    );

    return state;
    });

    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    state=>({
    ...fields(
    field('Name', dataValue('form.name_of_intervention')),
    field('CommCare_Ext_ID__c', state => {
    return dataValue('form.name_of_intervention')(state).replace(/\//gi, '');
    }),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    relationship('RecordType', 'Name', 'Intervention'),
    field('Business_Unit__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu==='65680f0c4c144b03ad0f86bdc46c1ebc' ? 'GRS Zambia' :
    bu==='04d98397e28046118fade28ced6b65cb' ? 'GRS Zimbabwe' :
    bu==='ed125ab19ec34aacab79585e59eb76f4' ? 'GRS Partnerships': undefined ;
    }),
    relationship(
    'Site__r',
    'CommCare_Ext_ID__c',
    dataValue('form.site')
    ),
    relationship(
    'Venue__r',
    'CommCare_Ext_ID__c',
    dataValue('form.Venue')

    ),
    relationship(
    'Curriculum__r',
    'CommCare_Ext_ID__c',
    dataValue('form.curriculum_selection.curriculum')
    ),
    // relationship(
    // 'Grant__r',
    // 'CommCare_Ext_ID__c',
    // dataValue('form.grant')
    // ),
    field('Delivery_Method__c', dataValue('form.delivery_method')),
    field('Class_Group_Team__c', dataValue('form.class_grade')),
    field('Pre_Post_Administered__c', dataValue('form.prepost_administered')),
    field('Start_Date__c', dataValue('form.intervention_dates.start_date')),
    field('End_Date__c', dataValue('form.intervention_dates.end_date'))
    ),
    ...fields(...state.data.destinationCoachFields)
    })
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24.html b/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24.html index 659eb8d7e62..d678a328ece 100644 --- a/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24.html +++ b/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Create Patient in OpenMRS

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields

    Expression

    //Job to create patient in OpenMRS 
    patient(
    fields(
    field("gender", dataValue("form.gender")), //map values from CommCare forms
    field("names", function(state) {
    return [{
    "patient_id": dataValue("form.case.@case_id")(state),
    "creator": dataValue("form.user")(state)
    }]
    })
    )
    )





    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12.html b/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12.html index b660e5bc585..be542719120 100644 --- a/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12.html +++ b/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Create Person in OpenMRS

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields

    Expression

    person(
    fields(
    field("gender", "M"),
    field("names", function(state) {
    return [{
    "givenName": dataValue("form.first_name")(state),
    "familyName": "Sports_Music_Field_Day"
    }]
    })
    )
    )
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25.html b/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25.html index 1968d542a0a..e83996f8528 100644 --- a/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25.html +++ b/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Create Person in SF

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, humanProper, relationship, upsert

    Expression

    upsert("Patient__c", "CommCare_Case_ID__c", fields(
    field('CommCare_Case_ID__c', dataValue("form.case.@case_id")),
    relationship('Clinic__r', 'Location_ID__c', dataValue('form.case.create.owner_id')),
    field('First_Name__c', humanProper(state.data.form.case.update.patient_first_name)),
    field('Last_Name__c', humanProper(state.data.form.case.update.patient_last_name)),
    field('Patient_ID__c', dataValue('form.case.update.patient_id')),
    field('Age_Months_Started_Treatment__c', dataValue('form.case.update.age_months_start_treatment_rounded')),
    field('Registration_Date__c', (state) => {
    const validDate = state.data.form.case.update.registration_date
    return ( validDate ? new Date(validDate).toISOString() : null )
    })
    ))
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF.html b/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF.html index 93f0a5201c6..3828636cb93 100644 --- a/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF.html +++ b/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Create SMS linked to contact

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    create, dataValue, field, fields, relationship

    Expression

    create(
    'SMS__c',
    fields(
    field('text__c', dataValue('message_text')),
    relationship(
    'Contact__r',
    'Contact_Phone_Number__c',
    dataValue('from_number')
    ),
    field('date__c', dataValue('date'))
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22.html b/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22.html index ac2830a4abb..311b29e3f09 100644 --- a/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22.html +++ b/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Create TEI (dhis2)

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue

    Expression

    create('trackedEntityInstances', {
    orgUnit: 'g8upMTyEZGZ',
    trackedEntityType: 'nEenWmSyUEp',
    program: 'IpHINAT79UW',
    attributes: [
    { attribute: 'zDhUuAYrxNC', value: dataValue('body.Patient_name') },
    { attribute: 'w75KJ2mc4zz', value: dataValue('body.Last_Name_of_Patient') },
    ],
    enrollments: [
    {
    orgUnit: 'g8upMTyEZGZ',
    program: 'IpHINAT79UW',
    programState: 'oRySG82BKE6', // active
    enrollmentDate: dataValue('body.Date'),
    incidentDate: dataValue('body.Date'),
    },
    ],
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-contact-2021-03-01.html b/adaptors/library/jobs/auto/Create-contact-2021-03-01.html index 42e0805c306..0cbb4670014 100644 --- a/adaptors/library/jobs/auto/Create-contact-2021-03-01.html +++ b/adaptors/library/jobs/auto/Create-contact-2021-03-01.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Create contact

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue

    Expression

    create('Contact', {
    FirstName: dataValue("body.Patient_name"),
    LastName: dataValue('body.Last_Name_of_Patient'),
    Age__c: dataValue("body.Age"),
    Sex__c: dataValue('body.Sex'),
    Case_ID__c: dataValue("body.National_ID"),
    Comments__c: dataValue("body.Comments")
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/DHIS2-DataValues-API.html b/adaptors/library/jobs/auto/DHIS2-DataValues-API.html index ff974850fe3..c3e2945aeac 100644 --- a/adaptors/library/jobs/auto/DHIS2-DataValues-API.html +++ b/adaptors/library/jobs/auto/DHIS2-DataValues-API.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Add data values

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataValue, field, fields

    Expression

    // ----
    // Add data to data value sets in DHIS2 using a generic JSON message, submitted
    // by Taylor Downs @ OpenFn.
    // ---

    dataValueSet(
    fields(
    field('dataSet', 'pBOMPrpg1QX'),
    field('orgUnit', 'DiszpKrYNg8'),
    field('period', '201401'),
    field('completeData', dataValue('form.date')),
    field('dataValues', function (state) {
    return [
    dataElement('qrur9Dvnyt5', dataValue('form.prop_a')(state)),
    dataElement('oZg33kd9taw', dataValue('form.prop_b')(state)),
    dataElement('msodh3rEMJa', dataValue('form.prop_c')(state)),
    ];
    })
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html b/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html index dd57adf1084..677771609fd 100644 --- a/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html +++ b/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    DHIS2 Events

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue, Math

    Expression

    create('trackedEntityInstances', {
    orgUnit: 'DiszpKrYNg8',
    trackedEntityType: 'Zy2SEgA61ys',
    attributes: [
    {
    attribute: 'flGbXLXCrEo', // system case ID
    value: Math.random(),
    },
    ],
    });

    // create('trackedEntityInstances', {
    // trackedEntityType: 'nEenWmSyUEp', // a person
    // orgUnit: 'g8upMTyEZGZ', // Njandama MCHP
    // attributes: [
    // {
    // attribute: 'w75KJ2mc4zz', // attribute id for first name
    // value: dataValue('case.firstName')(state), // data from submission
    // },
    // {
    // attribute: 'zDhUuAYrxNC', // attribute id for last name
    // value: dataValue('case.lastName')(state), // data from another submission field
    // },
    // ],
    // enrollments: [
    // {
    // orgUnit: 'g8upMTyEZGZ', // Njandama MCHP
    // program: 'IpHINAT79UW', // enroll in Child Program
    // enrollmentDate: new Date().toISOString().slice(0, 10), // some custom javascript
    // incidentDate: state.data.metadata.timeStart.slice(0, 10), // more custom javascript
    // },
    // ],
    // });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/DHIS2-Events-API.html b/adaptors/library/jobs/auto/DHIS2-Events-API.html index 7c9b61a13fa..e4d765762f4 100644 --- a/adaptors/library/jobs/auto/DHIS2-Events-API.html +++ b/adaptors/library/jobs/auto/DHIS2-Events-API.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Add events

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataValue, field, fields

    Expression

    // ----
    // Create new events in DHIS2 using a generic JSON message, submitted by
    // Taylor Downs @ OpenFn for demonstration porpoises.
    // ---

    event(
    fields(
    field('program', 'eBAyeGv0exc'),
    field('orgUnit', 'DiszpKrYNg8'),
    field('eventDate', dataValue('meta.date')),
    field('status', 'COMPLETED'),
    field('storedBy', 'admin'),
    field('coordinate', {
    latitude: '59.8',
    longitude: '10.9',
    }),
    field('dataValues', function (state) {
    return [
    dataElement('qrur9Dvnyt5', dataValue('form.prop_a')(state)),
    dataElement('oZg33kd9taw', dataValue('form.prop_b')(state)),
    dataElement('msodh3rEMJa', dataValue('form.prop_c')(state)),
    ];
    })
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11.html b/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11.html index a8589e1c21f..67ad461fd30 100644 --- a/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11.html +++ b/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23.html b/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23.html index a073a6f042e..8d4b358b76c 100644 --- a/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23.html +++ b/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Failed Payment Notification

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Failed Payment Notification
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created over 3 years ago
    • Updated over 3 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    alterState(state => {
    console.log("We have notified the administrator to manually initiate payment.");
    console.log("We have notified the CHW that payment is pending.");
    return state;
    })
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html b/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html index 17d807f52aa..5011ee5969b 100644 --- a/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html +++ b/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Fetch Claims

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, get, map, JSON

    Expression

    // establish a baseline for the cursor
    fn(state => {
    const today = new Date().toISOString().split('T')[0];
    console.log(
    `Fetching all claims updated on or after ${state.cursor || '2023-07-19'}`
    );
    return { ...state, today };
    });

    // Get claims and related patients from HAPI, updated since cursor date
    get(
    'Claim',
    {
    query: {
    _lastUpdated: `ge${state.cursor || '2023-07-19'}`,
    _include: 'Claim:patient',
    _sort: '-_lastUpdated',
    _count: 200,
    },
    },
    next => {
    if (next.data.total == 0)
    return { ...next, data: { claims: [], patients: [] } };

    const byType = next.data.entry.reduce((r, a) => {
    r[a.resource.resourceType] = r[a.resource.resourceType] || [];
    r[a.resource.resourceType].push(a);
    return r;
    }, Object.create(null));

    return {
    ...next,
    data: {
    claims: byType.Claim,
    patients: byType.Patient,
    },
    };
    }
    );

    // clean and merge data
    fn(state => {
    const { claims, patients } = state.data;

    // Noisy logs to help debug data quality issues
    claims.forEach(c => {
    const { resource } = c;
    if (!resource.id) console.log('claim', resource.id, 'has no id');
    if (!resource.item) {
    console.log('claim', resource.id, 'has no item');
    } else if (!resource.item[0].productOrService.coding) {
    console.log('claim', resource.id, 'has no coding');
    }

    if (!resource.patient.reference.split('/')[1])
    console.log('claim', resource.id, 'has no patient');
    });

    const patientsWithClaims = patients
    // drop all patients without identifiers
    .filter(p => p.resource.identifier)
    .map(p => ({
    ...p,
    claims: claims.filter(c => {
    return (
    // has item
    c.resource.item &&
    // has coding
    c.resource.item[0].productOrService.coding &&
    // for this patient
    p.resource.id == c.resource.patient.reference.split('/')[1]
    );
    }),
    }));

    return { ...state, data: { patientsWithClaims } };
    });

    // print some logs and update the cursor for next time
    fn(state => {
    const { data, today } = state;

    console.log('Found the following patients and claims in FHIR:');
    console.log(
    JSON.stringify(
    data.patientsWithClaims.map(p => ({
    patient: p.resource.id,
    claims: p.claims.map(c => c.resource.id),
    })),
    null,
    2
    )
    );

    return { data: state.data, cursor: today };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22.html b/adaptors/library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22.html index f972416ada1..67d695162b2 100644 --- a/adaptors/library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22.html +++ b/adaptors/library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16.html b/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16.html index 4a599ce0268..d46a26fd190 100644 --- a/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16.html +++ b/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Get CommCare Forms (Bulk Extract)

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Get CommCare Forms (Bulk Extract)
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created over 2 years ago
    • Updated over 2 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    each, get, post

    Expression

    // Your job goes here.
    get(
    'https://www.commcarehq.org/a/commcare-demo-2035/api/v0.5/form/',
    {
    query: {
    limit: 1000, //max limit: 1000
    offset: state.meta && state.meta.next ? state.meta.limit + state.meta.offset : 0,
    received_on_start: '2022-05-16',
    received_on_end: '2022-05-18',
    xmlns: 'http://openrosa.org/formdesigner/C87A7E2A-D98D-4E2C-9F0B-997E0AE635C6',
    },
    },
    state => {
    const { meta, objects } = state.data;
    const { openfnInboxUrl } = state.configuration;
    const xmlnsList = [
    'http://openrosa.org/formdesigner/C87A7E2A-D98D-4E2C-9F0B-997E0AE635C6'

    ];

    // const forms = objects.filter(obj => xmlnsList.includes(obj.form['@xmlns']));
    const forms = objects;

    state.configuration = { baseUrl: 'https://www.openfn.org' };
    console.log('Posting form submissions to OpenFn Inbox...');

    return each(forms, state => {
    return post(`/inbox/${openfnInboxUrl}`, { body: state.data }, state => ({
    ...state,
    data: {},
    references: [],
    }))(state);
    })(state);
    }
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23.html b/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23.html index b5cba8ca5f5..a49805d1659 100644 --- a/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23.html +++ b/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Get cases from Primero

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    getCases, JSON

    Expression

    getCases({
    remote: true,
    case_id: "234bbac3-7278-430a-98b5-1abc460671ec" //extract 1 case using case id
    //query: //...or use 'query' to filter by other criteria to get many cases
    }, state => {
    console.log(`Primero cases extracted: ${JSON.stringify(state.data)}`); //logging Primero response
    return { ...state, data: {}, references: [] }
    })
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03.html b/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03.html index b77d7e0f7c1..0b25341b568 100644 --- a/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03.html +++ b/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    HIV Testing Event Snapshot

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, upsert

    Expression

    // push to production
    upsert(
    'Event__c',
    'CommCare_Ext_ID__c',
    fields(
    field('Name', dataValue('form.basic_information.intervention')),
    field('Venue__c', dataValue('form.basic_information.venue')),
    field('Coach_A__c', dataValue('form.hidden_properties.coach_name')),
    field('Date__c', dataValue('form.basic_information.event_date')),
    field('Testing_Partner_Contact_Persion__c', dataValue('form.basic_information.testing_partner__contact_people')),
    field('of_People_in_Attendance_Testing_Events__c', dataValue('form.basic_information.number_in_attendance')),
    field('Event_Type__c', dataValue('form.basic_information.testing_event_type')),
    field('Coordinator__c', dataValue('form.basic_information.event_coordinator')),
    field(
    'What_organization_discussed_VMMC__c',
    dataValue('form.basic_information.question2.what_organisation_discussed_mmc')
    ),
    field(
    'What_organization_s_What_topic_s__c',
    dataValue(
    'form.basic_information.information_sessions_other.what_organisations_delivered_a_session_and_what_was_the_topic_of_the_sessio'
    )
    ),
    field(
    'How_was_the_information_presented__c',
    dataValue('form.basic_information.question2.how_was_this_information_presented_eg_lecture_individua_sessions_etc')
    ),
    field('how_many_people_attended_the_sessions__c', dataValue('form.basic_information.number_in_attendance')),
    field(
    'How_many_people_attended_the_sessions_oh__c',
    dataValue('form.basic_information.question2.approximately_how_many_people_attended_the_sessions_in_total')
    ),
    field(
    'Did_other_organizations_conduct__c',
    dataValue(
    'form.basic_information.information_sessions_other.did_other_organisations_eg_youth-friendly_clinic_ministry_of_health_etc_con'
    )
    ),
    field(
    'Testing_Key_Lesson_s_Learned__c',
    dataValue('form.basic_information.event_overview.highlights_key_challenges')
    ),
    field(
    'X2_Main_challenges__c',
    dataValue(
    'form.basic_information.event_overview.please_describe_highlights_key_challenges_and_main_lessons_learned_from_thi'
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03.html b/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03.html index b46b263e8a7..24e507172d2 100644 --- a/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03.html +++ b/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    HIV Testing Event Statistics

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, upsert

    Expression

    // push to production
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field('Name', dataValue('form.event_name')),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    field('Tested_Negative_Males_0_9__c', dataValue('form.table_1_testing_results.male_hiv_negative.question2')),
    field('Tested_Negative_Males_10_14__c', dataValue('form.table_1_testing_results.male_hiv_negative.question7')),
    field('Tested_Negative_Males_15_19__c', dataValue('form.table_1_testing_results.male_hiv_negative.question13')),
    field('Tested_Negative_Males_20_24__c', dataValue('form.table_1_testing_results.male_hiv_negative.question18')),
    field('Tested_Negative_Males_25_49__c', dataValue('form.table_1_testing_results.male_hiv_negative.question28')),
    field('Tested_Negative_Males_50__c', dataValue('form.table_1_testing_results.male_hiv_negative.question32')),
    field('Tested_Positive_Males_0_9__c', dataValue('form.table_1_testing_results.question33.question36')),
    field('Tested_Positive_Males_10_14__c', dataValue('form.table_1_testing_results.question33.question41')),
    field('Tested_Positive_Males_15_19__c', dataValue('form.table_1_testing_results.question33.question45')),
    field('Tested_Positive_Males_20_24__c', dataValue('form.table_1_testing_results.question33.question50')),
    field('Tested_Positive_Males_25_49__c', dataValue('form.table_1_testing_results.question33.question56')),
    field('Tested_Positive_Males_50__c', dataValue('form.table_1_testing_results.question33.question60')),
    field('Tested_Negative_Females_0_9__c', dataValue('form.table_1_testing_results.question61.question65')),
    field('Tested_Negative_Females_10_14__c', dataValue('form.table_1_testing_results.question61.question69')),
    field('Tested_Negative_Females_15_19__c', dataValue('form.table_1_testing_results.question61.question73')),
    field('Tested_Negative_Females_20_24__c', dataValue('form.table_1_testing_results.question61.question78')),
    field('Tested_Negative_Females_25_49__c', dataValue('form.table_1_testing_results.question61.question84')),
    field('Tested_Negative_Females_50__c', dataValue('form.table_1_testing_results.question61.question88')),
    field('Tested_Positive_Females_0_9__c', dataValue('form.table_1_testing_results.question89.question92')),
    field('Tested_Positive_Females_10_14__c', dataValue('form.table_1_testing_results.question89.question97')),
    field('Tested_Positive_Females_15_19__c', dataValue('form.table_1_testing_results.question89.question101')),
    field('Tested_Positive_Females_20_24__c', dataValue('form.table_1_testing_results.question89.question106')),
    field('Tested_Positive_Females_25_49__c', dataValue('form.table_1_testing_results.question89.question112')),
    field('Tested_Positive_Females_50__c', dataValue('form.table_1_testing_results.question89.question116')),
    field(
    'Pregnant_Women_Tested_0_9__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question120'
    )
    ),
    field(
    'Pregnant_Women_Tested_10_14__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question124'
    )
    ),
    field(
    'Pregnant_Women_Tested_15_19__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question129'
    )
    ),
    field(
    'Pregnant_Women_Tested_20_24__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question134'
    )
    ),
    field(
    'Pregnant_Women_Tested_25_49__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question140'
    )
    ),
    field(
    'Pregnant_Women_Tested_50__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question144'
    )
    ),
    //field(
    // 'Total_Pregnant_Women_Tested__c',
    // dataValue(
    // 'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.total_tested_pregnant'
    // )
    //),
    field(
    'First_Time_Females_0_9__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question65')(state) +
    dataValue('form.table_4_first_time_testers.question89.question92')(state)
    ),
    field(
    'First_Time_Females_10_14__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question69')(state) +
    dataValue('form.table_4_first_time_testers.question89.question97')(state)
    ),
    field(
    'First_Time_Females_15_19__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question73')(state) +
    dataValue('form.table_4_first_time_testers.question89.question101')(state)
    ),
    field(
    'First_Time_Females_20_24__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question78')(state) +
    dataValue('form.table_4_first_time_testers.question89.question106')(state)
    ),
    field(
    'First_Time_Females_25_49__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question84')(state) +
    dataValue('form.table_4_first_time_testers.question89.question112')(state)
    ),
    field(
    'First_Time_Females_50__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question88')(state) +
    dataValue('form.table_4_first_time_testers.question89.question116')(state)
    ),
    field(
    'First_Time_Males_0_9__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question2')(state) +
    dataValue('form.table_4_first_time_testers.question33.question36')(state)
    ),
    field(
    'First_Time_Males_10_14__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question7')(state) +
    dataValue('form.table_4_first_time_testers.question33.question41')(state)
    ),
    field(
    'First_Time_Males_15_19__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question13')(state) +
    dataValue('form.table_4_first_time_testers.question33.question45')(state)
    ),
    field(
    'First_Time_Males_20_24__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question18')(state) +
    dataValue('form.table_4_first_time_testers.question33.question50')(state)
    ),
    field(
    'First_Time_Males_25_49__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question28')(state) +
    dataValue('form.table_4_first_time_testers.question33.question56')(state)
    ),
    field(
    'First_Time_Males_50__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question32')(state) +
    dataValue('form.table_4_first_time_testers.question33.question60')(state)
    ),
    field(
    'of_Males_Referred_to_Sexual_Abuse__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.abuseviolence_referral'
    )
    ),
    field(
    'of_Males_Referred_to_Family_Referral__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.family_planning_referral'
    )
    ),
    field(
    'of_Males_Referred_for_HIV_Positive__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.hiv_positive_referral'
    )
    ),
    field(
    'of_Males_Referred_to_MMC_Referral__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.medical_male_circumcision_referral'
    )
    ),
    field(
    'of_Males_Referred_to_STI__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.sexually_transmitted_infection_sti_referral'
    )
    ),
    field(
    'of_Males_Referred_to_Tuberculosis__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.tuberculosis_tb_referral'
    )
    ),
    field(
    'of_Females_Referred_to_Sexual_Abuse__c',
    dataValue('form.table5_referrals.women_referred_number.abuseviolence_referral_women')
    ),
    field(
    'of_Females_Referred_to_Antenatal_Care__c',
    dataValue('form.table5_referrals.women_referred_number.antenatal_care_anc_referral_women')
    ),
    field(
    'of_Females_Referred_to_Family_Referral__c',
    dataValue('form.table5_referrals.women_referred_number.family_planning_referral_women')
    ),
    field(
    'of_Females_Referred_for_HIV_Positive__c',
    dataValue('form.table5_referrals.women_referred_number.hiv_positive_referral_women')
    ),
    field(
    'of_Females_Referred_to_PMTCT__c',
    dataValue('form.table5_referrals.women_referred_number.prevention_of_mother-to-child_transmission_women')
    ),
    field(
    'of_Females_Referred_to_STI__c',
    dataValue('form.table5_referrals.women_referred_number.sexually_transmitted_infection_sti_referral_women')
    ),
    field(
    'of_Females_Referred_to_Tuberculosis__c',
    dataValue('form.table5_referrals.women_referred_number.tuberculosis_tb_referral_women')
    ),

    field('Community_Members__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.community_members')),
    field('GRS_Coaches__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.skillz_coaches')),
    field('GRS_Participants__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.skillz_participants')),
    field('GRS_Staff__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.staff')),
    //field('Total_Tested__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.total_tested')),
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13.html b/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13.html index 3a0acf684c3..e79645bdda0 100644 --- a/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13.html +++ b/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Kobo to sheets

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    appendValues, dataValue

    Expression

    appendValues({
    spreadsheetId: '13JNoH_nzG4x_mwvW83BMrpTWdKt4asBiZiLfQduB7B0',
    range: 'Sheet1!A1:E1',
    values: [
    [
    dataValue('National_ID'),
    dataValue('First_Name_of_Patient'),
    dataValue('Last_Name_of_Patient'),
    ],
    ],
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22.html b/adaptors/library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22.html index ea9fd1f01d6..6b4bcced7f0 100644 --- a/adaptors/library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22.html +++ b/adaptors/library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Load-to-DB-2022-05-16.html b/adaptors/library/jobs/auto/Load-to-DB-2022-05-16.html index 35c2af0b179..86c6c9f4ebf 100644 --- a/adaptors/library/jobs/auto/Load-to-DB-2022-05-16.html +++ b/adaptors/library/jobs/auto/Load-to-DB-2022-05-16.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Load to DB

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, upsert

    Expression

    // Your job goes here.
    upsert('patient', 'ON CONSTRAINT patient_pk', {
    patient_id: dataValue('data.patient_name'),
    patient_name: dataValue('data.patient_name'),
    village_name: dataValue('data.village_name'),
    last_menstrual_period: dataValue('data.last_menstrual_period'),
    expected_delivery_date: dataValue('data.expected_delivery_date'),
    children_alive: dataValue('data.children_alive'),
    living_children: dataValue('data.living_children'),
    feeling_sick: dataValue('data.feeling_sick'),
    total_children: dataValue('data.Total_children'),
    risk_level: dataValue('data.Risk_level')

    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17.html b/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17.html index ca534e86e00..5e071f03d42 100644 --- a/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17.html +++ b/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Load to DHIS2

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, get, join, map, async

    Expression

    // build and log nested dhis2 records
    fn(state => {
    const { patientsWithClaims } = state.data;
    const today = new Date().toISOString().split('T')[0];

    const teis = patientsWithClaims.map(p => {
    const patient = p.resource;
    const claims = p.claims;
    const treatments = claims
    .map(c => c.resource.item[0])
    .map(t => t.productOrService.coding[0].display)
    .join('; ');

    const enrollments = claims.map(c => {
    const claim = c.resource;
    const display = claim.insurance && claim.insurance[0].coverage.display;

    const oclMapping = {
    PARN: 'GMfuAqBFS1g',
    'Programme Vaccination': 'GMfuAqBFS1g',
    'Santé Maternelle': 'wBUDpZSS4Bh',
    };

    console.log(
    `We could use OCL to map "${display}" to "${
    oclMapping[display] || 'q5Qyv66pIAI (mTOMADY Other)'
    }"`
    );

    return {
    orgUnit: 'KUVJPjmUmWc',
    program: oclMapping[display] || 'q5Qyv66pIAI',
    status: 'ACTIVE', // active
    enrolledAt: today,
    occurredAt: today,
    };
    });

    return {
    orgUnit: 'KUVJPjmUmWc', // Madagascar
    trackedEntityType: 'x5fZpgCyv50', // Patient
    attributes: [
    { attribute: 'rDeWj9yYtzv', value: patient.identifier[0].value },
    { attribute: 'E4f4wBsDVgR', value: patient.name[0].family },
    { attribute: 'Fz33peSkK1I', value: patient.name[0].given[0] },
    {
    attribute: 'POCXiJxpYX1',
    value: `${treatments}`,
    },
    { attribute: 'dA6ShmrHmhk', value: patient.birthDate },
    { attribute: 'mWOlfweGigO', value: patient.gender },
    ],
    enrollments: enrollments,
    };
    });

    return { ...state, teis };
    });

    // get current TEIs
    get('tracker/trackedEntities', {
    orgUnit: 'KUVJPjmUmWc',
    trackedEntityType: 'x5fZpgCyv50',
    });

    // create upsertable array
    fn(state => {
    const { configuration, teis } = state;
    const existing = state.data.instances;

    const createable = [];
    const updateable = [];

    teis.forEach(t => {
    const match = existing.find(e => {
    const idAttr = e.attributes.find(a => a.displayName == 'Unique ID');
    return idAttr && idAttr.value == t.attributes[0].value;
    });

    if (match) {
    const enrollments =
    (match.enrollments && match.enrollments.concat(t.enrollments)) ||
    t.enrollments;

    updateable.push({ ...match, ...t, enrollments });
    } else {
    createable.push(t);
    }
    });

    console.log(`${updateable.length} to update; ${createable.length} to create`);
    const trackedEntities = [...createable, ...updateable];

    return { configuration, trackedEntities, references: [] };
    });

    // send data to DHIS2
    create('tracker', state => ({ trackedEntities: state.trackedEntities }), {
    params: {
    importStrategy: 'CREATE_AND_UPDATE',
    atomicMode: 'OBJECT',
    async: 'false',
    },
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03.html b/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03.html index 1d2b3aab42e..e4ae81fd7da 100644 --- a/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03.html +++ b/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Malaria Testing Event Snapshot

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, upsert

    Expression

    // push to production
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field('Name', dataValue('form.hidden_properties.event_name')),
    field('Date__c', dataValue('form.basic_information.event_details.event_date')),
    field('Testing_Partner_Contact_Persion__c', dataValue('form.event_information.testing_partner__contact_people')),
    field('of_People_in_Attendance_Testing_Events__c', dataValue('form.event_information.number_in_attendance')),
    field('Coordinator__c', dataValue('form.event_information.event_coordinator')),
    field(
    'Did_an_organization_discuss_Malaria__c',
    dataValue('form.malaria_treatment_prevention.info_malaria_treatment')
    ),
    field('What_organization_s_What_topic_s__c', dataValue('form.malaria_treatment_prevention.which_organizations')),
    field(
    'How_was_the_information_presented__c',
    dataValue('form.malaria_treatment_prevention.how_was_info_presented')
    ),
    //field('of_Participants__c', dataValue('form.malaria_treatment_prevention.how_many_total_participants')),
    field(
    'Did_other_organizations_conduct__c',
    dataValue("form.skills_activities['did_other_organisations_eg_youth-friendly_clinic_ministry_of_health_etc_con']")
    ),
    field(
    'What_organization_s_What_topic_s__c',
    dataValue('form.skills_activities.what_organisations_delivered_a_session_and_what_was_the_topic_of_the_sessio')
    ),
    field('Facilitator_1__c', dataValue('form.skills_activities.facilitators')),
    field(
    'How_many_people_attended_the_sessions__c',
    dataValue('form.skills_activities.how_many_people_attended_the_sessions_in_total')
    ),
    field(
    'How_many_people_attended_the_sessions_oh__c',
    dataValue('form.skills_activities.how_many_people_attended_the_sessions_in_total')
    ),
    field(
    'X2_Main_challenges__c',
    dataValue('form.bed_net_distribution.please_describe_highlights_key_challenges_and_main_lessons_learned_from_thi')
    ),
    field(
    'X1_Main_successes__c',
    dataValue('form.bed_net_distribution.please_describe_highlights_key_challenges_and_main_lessons_learned_from_thi')
    ),
    field(
    'Number_of_Bed_Nets_Distributed__c',
    dataValue('form.bed_net_distribution.total_number_of_bed_nets_distributed')
    ),
    //field('Site__c', dataValue('form.event_information.site')),
    //field('Venue__c', dataValue('form.event_information.venue')),
    //field('Curriculum__c', dataValue('form.event_information.curriculum')),
    field('X1_0_Intervention_Name__c', dataValue('form.event_information.intervention')),
    //field('Coach_1__c', dataValue('form.hidden_properties.coach_name')),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    field('Date__c', dataValue('form.event_information.event_date')),
    field('Testing_Partner_Contact_Persion__c', dataValue('form.event_information.testing_partner__contact_people')),
    field('of_People_in_Attendance_Testing_Events__c', dataValue('form.event_information.number_in_attendance')),
    field('Coordinator__c', dataValue('form.event_information.event_coordinator'))
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03.html b/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03.html index f36127add6c..59130df3141 100644 --- a/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03.html +++ b/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Malaria Testing Event Statistics

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, upsert

    Expression

    // push to production
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field('Name', dataValue('form.event_information.event_name')),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    field(
    'Tested_Negative_Males_0_9__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question2')
    ),
    field(
    'Tested_Negative_Males_10_14__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question7')
    ),
    field(
    'Tested_Negative_Males_15_19__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question13')
    ),
    field(
    'Tested_Negative_Males_20_24__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question18')
    ),
    field(
    'Tested_Negative_Males_25_49__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question28')
    ),
    field(
    'Tested_Negative_Males_50__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question32')
    ),
    field('Tested_Positive_Males_0_9__c', dataValue('form.table_1_testing_results_malaria.question33.question36')),
    field('Tested_Positive_Males_10_14__c', dataValue('form.table_1_testing_results_malaria.question33.question41')),
    field('Tested_Positive_Males_15_19__c', dataValue('form.table_1_testing_results_malaria.question33.question45')),
    field('Tested_Positive_Males_20_24__c', dataValue('form.table_1_testing_results_malaria.question33.question50')),
    field('Tested_Positive_Males_25_49__c', dataValue('form.table_1_testing_results_malaria.question33.question56')),
    field('Tested_Positive_Males_50__c', dataValue('form.table_1_testing_results_malaria.question33.question60')),
    field('Tested_Negative_Females_0_9__c', dataValue('form.table_1_testing_results_malaria.question61.question65')),
    field('Tested_Negative_Females_10_14__c', dataValue('form.table_1_testing_results_malaria.question61.question69')),
    field('Tested_Negative_Females_15_19__c', dataValue('form.table_1_testing_results_malaria.question61.question73')),
    field('Tested_Negative_Females_20_24__c', dataValue('form.table_1_testing_results_malaria.question61.question78')),
    field('Tested_Negative_Females_25_49__c', dataValue('form.table_1_testing_results_malaria.question61.question84')),
    field('Tested_Negative_Females_50__c', dataValue('form.table_1_testing_results_malaria.question61.question88')),
    field('Tested_Positive_Females_0_9__c', dataValue('form.table_1_testing_results_malaria.question89.question92')),
    field('Tested_Positive_Females_10_14__c', dataValue('form.table_1_testing_results_malaria.question89.question97')),
    field('Tested_Positive_Females_15_19__c', dataValue('form.table_1_testing_results_malaria.question89.question101')),
    field('Tested_Positive_Females_20_24__c', dataValue('form.table_1_testing_results_malaria.question89.question106')),
    field('Tested_Positive_Females_25_49__c', dataValue('form.table_1_testing_results_malaria.question89.question112')),
    field('Tested_Positive_Females_50__c', dataValue('form.table_1_testing_results_malaria.question89.question116'))
    ));

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.html b/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.html index d4ceec40f83..b8cd66f4d66 100644 --- a/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.html +++ b/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Handling multiple ODK repeat groups

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    create, dataPath, dataValue, each, field, fields, lastReferenceValue, merge

    Expression

    /*
    Create many records from an ODK submission, moving in and out of repeat
    blocks, submitted by Taylor Downs @ OpenFn.
    */

    beta.each(
    '$.data.data[*]',
    create(
    'ODK__c',
    fields(
    field('Event_Type__c', dataValue('event_type')),
    field('Training_Type__c', dataValue('training_type')),
    field('Event_Leader_ID__c', dataValue('leader')),
    field('Event_Date__c', dataValue('date')),
    field('metainstanceid__c', dataValue('*meta-instance-id*'))
    )
    )
    );

    beta.each(
    merge(
    dataPath('data[*].attendee_new[*]'),
    fields(field('parentId', lastReferenceValue('id')))
    ),
    create(
    'ODK_Child_2__c',
    fields(
    field('ODK__c', dataValue('parentId')),
    field('Barcode__c', dataValue('new_attendee_id')),
    field('First_Name__c', dataValue('new_attendee_first_name')),
    field('Last_Name__c', dataValue('new_attendee_last_name')),
    field('Phone_Number__c', dataValue('new_attendee_phone'))
    )
    )
    );

    beta.each(
    merge(
    dataPath('data[*].attendee[*]'),
    fields(
    field('parentId', function (state) {
    return state.references[state.references.length - 1].id;
    })
    // ^^ This will get the sfID of the 1st item created.
    )
    ),
    create(
    'ODK_Child_1__c',
    fields(
    field('ODK__c', dataValue('parentId')),
    field('Barcode__c', dataValue('attendee_id')),
    field('Late__c', dataValue('late'))
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16.html b/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16.html index d4c5d13cf4a..d6030a2c4ef 100644 --- a/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16.html +++ b/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Outcome Survey

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, upsert

    Expression

    fn((state) => {


    state.capitalizeFirstLetter = (text) => {
    if (!text) return text; // Return the text if it's empty or undefined
    return text.charAt(0).toUpperCase() + text.slice(1);
    };

    state.replaceUnderscoreWithSpace = (text) => {
    if (typeof text !== 'string') {
    return ''; // Return an empty string if input is not a string
    }
    return text.replace(/_/g, ' ');
    }

    state.replaceSpaceWithSemiColon = (text) => {
    if (typeof text !== 'string') {
    return ''; // Return an empty string if input is not a string
    }
    return text.replace(/ /g, ';');

    }

    state.HIVtestMap = {
    agree: "Positive",
    negative: "Negative",
    "copy-2-of-days": "5 - 6 days",
    "i_dont_knowdeclined": "I don't know / Declined to answer",
    "i_dont_knowdeclined_answer": "I don't know / Declined to answer",
    "i_dont_knowdeclined_to_answer": "I don't know / Declined to answer"
    };



    state.daysMap = {
    days: "1 - 2 days",
    "copy-1-of-days": "3 - 4 days",
    "copy-2-of-days": "5 - 6 days",
    "more_than_6_days": "More than 6 days",
    "none": "None"
    };

    state.agreeDisagreeMap = {
    Agree: 'Yes', //New
    Disagree: 'No', // Continued
    "I don't know/Declined to answer": "Declined to answer",
    "I_dont_know_declined_to_answer": "Declined to answer",
    "I_dont_knowdeclined_to_answer": "I don't know",
    "choice2": "No"
    };

    state.agreeDisagreeMap2 = {
    Agree: 'Yes', //New
    Disagree: 'No', // Continued
    "I don't know/Declined to answer": "Declined to answer",
    "I_dont_know_declined_to_answer": "Declined to answer",
    "I_dont_knowdeclined_to_answer": "Declined to answer",
    "choice2": "No"
    };

    state.timeMap = {
    "all_of_the_time": "All of the time",
    "most_of_the_time": "Most of the time",
    "more_than_half_of_the_time": "More than half of the time",
    "less_than_half_of_the_time": "Less than half of the time",
    "some_of_the_time": "Some of the time",
    "at_no_time": "At no time",
    "choice10": "Less than half of the time"
    }

    state.choiceMapping = {
    "choice1": "Confidentiality concerns",
    "choice2": "Contraceptives including pills, injections, implants or similar",
    "choice3": "Condoms – male or female",
    "choice4": "Voluntary medical male circumcision",
    "choice10": "Less than half of the time",
    "Sexual and reproductive health informationtalks": "Sexual and reproductive health information/talks"

    }

    state.choiceMapping2 = {
    "Choice2": "Yes",
    }

    state.idkdeclinedtodeclined = {
    "I_dont_know_declined_to_answer": "Declined to answer",
    }

    state.idkdeclinedtoidkdeclined = {
    "I_dont_know_declined_to_answer": "I don't know / Declined to answer",
    "I_dont_knowdeclined_to_answer": "I don't know / Declined to answer"
    }


    // function capitalizeFirstLetter(text) {
    // if (!text) return text; // Return the text if it's empty or undefined
    // return text.charAt(0).toUpperCase() + text.slice(1);
    // }

    function transform(value) {
    if (!value) return;
    //console.log("value in switch", value.toString().trim().toLowerCase());
    switch (value.toString().trim().toLowerCase()) {
    case "Agree":
    return "Yes";
    case "Disagree":
    return "No";
    case "I don't know/Declined to answer":
    return "Declined to answer";
    default:
    return value;
    }
    }

    state.helperFunctions = { transform };

    return state;
    });

    fn((state) => {
    const { form } = state.data;
    state.surveyMappings = {
    CommCare_Ext_ID__c: dataValue("id"),
    Name_of_Interviewer__c: form["name_of_interviewer"],
    Date__c: form.date,
    Interview_Start_Time__c: form.interview_start_time,
    Interview_End_Time__c: form.interview_end_time,
    What_was_the_main_reason_the_participant__c:
    form[
    "copy-1-of-what_was_the_main_reason_the_participant_did_not_consent_to_participate_in_"
    ],
    Site_Name__c: state.capitalizeFirstLetter(form.site),
    Venue_Name__c: form.venue,
    Group_Name__c: form.group_name,
    //Grade__c: 'form.grade',
    Curriculum_Attended__c: form.curriculum,
    Give_permission_to_participate__c:
    form["did_the_individual_give_permission_to_participate_in_the_survey"],
    Main_reason_of_not_consenting__c: state.choiceMapping[state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(
    form["what_was_the_main_reason_the_participant_did_not_consent_to_participate_in_"]))],
    Participant_Name__c: form.participant_name,
    Participant_Gender__c: state.capitalizeFirstLetter(form.participant_gender),
    Participant_DOB__c: form.participant_date_of_birth,
    Currently_live_with_at_home__c: state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["who_do_you_currently_live_with_at_home"])),
    Days_did_you_go_without_food__c: state.daysMap[form["in_the_last_week_how_many_days_did_you_go_without_food"]],
    Ever_been_in_any_kind_of_sexual_relation__c: state.capitalizeFirstLetter(form["have_you_ever_been_in_any_kind_of_sexual_relationship_with_someone"]),
    In_any_form_of_sexual_relationship__c: state.choiceMapping2[state.capitalizeFirstLetter(form["are_you_currently_in_any_form_of_sexual_relationship"])],
    Age_of_your_current_last_sexual_partner__c: state.capitalizeFirstLetter(form["what_is_the_age_of_your_currentlast_sexual_partner"]),
    Ever_had_sexual_intercourse__c: state.capitalizeFirstLetter(form["have_you_ever_had_sexual_intercourse"]),
    Age_at_first_sex__c: state.capitalizeFirstLetter(form["how_old_were_you_when_you_had_sexual_intercourse_for_the_first_time"]),
    La__c: state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["the_last_time_you_had_sexual_intercourse_why_did_you_do_it"])),
    Last_2_years_pregnant_or_given_birth__c: state.capitalizeFirstLetter(form["in_the_last_2_years_did_you_ever_get_pregnant_or_give_birth_instruction_thi"]),
    HIV_positive_should_hide_it_from_others__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["people_who_test_hiv_positive_should_hide_it_from_others"])],
    I_would_rather_not_know_if_I_have_HIV__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_would_rather_not_know_if_i_have_hiv"])],
    someone_with_HIV_to_stop_taking_their_AR__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_okay_for_someone_with_hiv_to_stop_taking_their_arv_as_soon_as_they_st"])],
    People_with_HIV_to_have_unprotected_sex__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_okay_for_two_people_with_hiv_to_have_unprotected_sex_with_each_other"])],
    Someone_has_HIV_by_looking_at_him_or_her__c: state.capitalizeFirstLetter(form["i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her"]),
    talk_to_a_partner_about_HIV_STI_testing__c: state.capitalizeFirstLetter(form["i_know_how_to_talk_to_a_partner_about_hivsti_testing"]),
    HIV_testing_is_free_at_government_health__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["hiv_testing_is_free_at_government_health_facilities"])],
    Have_you_ever_tested_for_HIV__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["have_you_ever_tested_for_hiv"])],
    Result_of_your_last_HIV_test__c: state.HIVtestMap[form["what_was_the_result_of_your_last_most_recent_hiv_test"]],
    Where_to_get_support_services__c: state.capitalizeFirstLetter(form["i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related"]),
    Right_to_access_sexual_health_services__c: state.capitalizeFirstLetter(form["i_have_the_right_to_access_sexual_health_services_such_as_sti_and_hiv_testi"]),
    Where_to_get_support_services_for_GBV__c: state.agreeDisagreeMap[state.capitalizeFirstLetter[form["i_know_where_to_get_support_services_for_me_or_someone_else_for_gender-base"]]],
    Services_accessed_in_the_past_2_years__c: state.choiceMapping[state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["in_the_last_2_years_which_of_these_services_have_you_accessed_through_the_c"]))],
    Accessed_the_above_services__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["did_you_access_the_above_services_more_than_once_per_year"])],
    The_staff_at_my_nearest_clinic_are_frien__c: state.capitalizeFirstLetter(form["the_staff_at_my_nearest_clinic_are_friendly"]),
    Keep_my_personal_information_private__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["the_staff_at_my_nearest_clinic_will_keep_my_personal_information_private"])],
    Feel_stigmatism_or_judged__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["i_do_not_feel_stigmatism_or_judged_when_i_go_to_access_sexual_reproductive_"])],
    Suggests_using_a_condom__c: state.agreeDisagreeMap[state.capitalizeFirstLetter[form["when_a_partner_suggests_using_a_condom_it_means_he_or_she_has_had_sex_with_"]]],
    //A_condom_would_make_sex_less_pleasing__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["using_a_condom_would_make_sex_less_pleasant"])],
    I_know_how_to_correctly_use_a_condom__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["i_know_how_to_correctly_use_a_condom"])],
    Able_to_refuse_to_have_sex__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_would_be_able_to_refuse_to_have_sex_if_my_partner_did_not_want_to_use_a_c"])],
    Condoms_are_the_only_contraceptive__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["condoms_are_the_only_contraceptive_method_that_protect_against_pregnancy_as"])],
    Use_a_condom__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["i_should_use_a_condom_even_if_my_girlfriend_is_on_another_form_of_birth_con"])],
    The_last_time_you_had_sexual_intercourse__c: state.capitalizeFirstLetter(form["the_last_time_you_had_sexual_intercourse_did_you_and_your_partner_use_a_con"]),
    A_girl_woman_can_get_pregnant__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["a_girl_or_woman_can_get_pregnant_the_very_first_time_she_has_sex"])],
    Sign_of_Pregnancy__c: state.capitalizeFirstLetter(form["one_sign_of_pregnancy_is_a_girl_missing_her_period"]),
    Ever_used_family_planning_method__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["have_you_ever_used_any_type_of_family_planning"])],
    Recieved_Family_Planning__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["in_the_last_2_years_did_you_ask_for_or_receive_family_planning"])],
    Type_of_Family_Planning_accessed__c: state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["in_the_last_2_years_what_type_of_family_planning_services_did_you_access"])),
    Methods_to_avoid_unwanted_pregnancy__c: state.capitalizeFirstLetter(form["i_know_at_least_three_methods_to_avoid_an_unwanted_pregnancy"]),
    Support_for_prevention_of_teen_pregnancy__c: state.capitalizeFirstLetter(form["in_the_last_2_years_did_you_get_support_for_prevention_of_teenage_pregnancy"]),
    I_have_felt_cheerful_and_in_good_spirits__c: state.timeMap[(form["i_have_felt_cheerful_and_in_good_spirits"])],
    I_have_felt_calm_and_relaxed__c: state.timeMap[form["i_have_felt_calm_and_relaxed"]],
    I_have_felt_active_and_vigorous__c: state.timeMap[form["question11"]],
    I_woke_up_feeling_fresh_and_rested__c: state.timeMap[form["i_woke_up_feeling_fresh_and_rested"]],
    Life_filled_with_things_interesting_me__c: state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["my_daily_life_has_been_filled_with_things_that_interest_me"])),
    Sign_of_personal_weakness__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["a_mental_illness_is_a_sign_of_personal_weakness"])],
    //Sign_of_personal_weakness__c: state.capitalizeFirstLetter(form["seeking_help_for_mental_health_challenges_is_a_sign_of_weakness"]),
    Expectations_dealing_with_emotions__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["society_expects_boys_and_girls_to_deal_with_their_emotions_differently"])],
    Self_control_and_smart_decisions__c: state.capitalizeFirstLetter(form["self-control_helps_you_make_smart_decisions_when_you_are_angry_or_upset"]),
    Avoid_using_violent_behaviour__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["when_i_am_angry_i_know_how_to_avoid_using_violent_behaviour"])],
    Confidence_and_face_to_face_appointments__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_am_confident_attending_face_to_face_appointments_to_seek_information_abou"])],
    Seek_information_about_mental_illness__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["i_am_confident_that_i_know_where_to_seek_information_about_mental_illness"])],
    Bounce_back_from_difficult_situations__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_can_bounce_back_from_difficult_situations"])],
    Avoid_people_with_mental_illness__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi"])],
    Informed_decisions_about_sexual_health__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_can_make_my_own_informed_decisions_about_my_sexual_healthcare"])],
    Say_no_to_sex_despite_pressure__c: state.capitalizeFirstLetter(form["i_can_say_no_to_sex_even_if_my_boyfriend_or_friends_pressure_me_to_have_sex"]),
    Make_my_own_decisions_pressure__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others"])],
    Tell_someone_if_I_were_touched__c: state.capitalizeFirstLetter(form["i_would_tell_someone_if_i_were_touched_in_a_manner_that_made_me_uncomfortab"]),
    Say_no_to_sex_no_matter_who_asks_me__c: state.capitalizeFirstLetter(form["i_can_say_no_to_sex_no_matter_who_asks_me"]),
    How_to_overcome_challenges__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_know_how_to_overcome_challenges_that_i_may_face_in_my_life"])],
    I_can_achieve_my_goals__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_can_achieve_my_goals_even_if_i_face_challenges"])],
    Confident_setting_measurable_goals__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_feel_confident_setting_measurable_goals"])],
    Good_reason_to_hit_his_girlfriend_wife__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["sometimes_a_man_or_boyfriend_may_have_a_good_reason_to_hit_his_girlfriend_o"])],
    Take_part_in_household_chores__c: state.capitalizeFirstLetter(form["men_should_take_part_in_household_chores_such_as_washing_plates_and_sweepin"]),
    Girls_responsibility_on_pregnancy__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_only_the_girls_responsibility_to_avoid_getting_pregnant"])],
    Right_to_have_sex__c: state.capitalizeFirstLetter(form["a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want"]),
    Appropriate_for_a_girl_to_carry_condoms__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_not_appropriate_for_a_girlwoman_to_carry_condoms"])],
    Where_to_get_support__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["copy-1-of-i_know_where_to_get_support_services_for_me_or_someone_else_for_gender-base"])],
    Gone_to_seek_support_forself__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["in_the_last_2_years_have_you_ever_gone_to_seek_support_for_yourself_or_for_"])],
    People_in_my_life_who_I_can_get_help__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["there_are_people_in_my_life_who_i_can_get_help_from_if_i_need_it"])],
    People_in_my_life_who_I_can_talk_to__c: state.capitalizeFirstLetter(form["there_are_people_in_my_life_who_i_can_talk_to_about_how_to_handle_things"]),
    Where_to_go_for_support_for_alcohol__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh"])],
    };
    return state;
    });

    upsert(
    "SKILLZ_Outcome_Monitoring_Survey__c",
    "CommCare_Ext_ID__c",
    (state) => state.surveyMappings
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/PHQ9-2021-05-03.html b/adaptors/library/jobs/auto/PHQ9-2021-05-03.html index ab3fa6531fb..a005bdb6d2d 100644 --- a/adaptors/library/jobs/auto/PHQ9-2021-05-03.html +++ b/adaptors/library/jobs/auto/PHQ9-2021-05-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    PHQ9

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, relationship, upsert

    Expression

    alterState(state => {
    function capitalizeFirstLetter(str) {
    if (!str) return;
    let new_str = str.toString().toLowerCase();
    return new_str.slice(0, 1).toUpperCase() + new_str.slice(1);
    }

    function transform(value) {
    if (!value) return;
    switch (value.toString().trim()) {
    case 'Daughterson':
    return 'Daughter/Son';
    case 'Other_specify':
    return 'Other';
    case 'Single_never_married':
    return 'Single/Never Married';
    case 'Divorced__separated':
    return 'Divorced/separated';
    default:
    return value;
    }
    }

    function getAge(dateString) {
    if (!dateString) return;

    const today = new Date();
    const birthDate = new Date(dateString);
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age--;
    }
    return age;
    }

    state.data.form.begin_interview.what_is_your_marital_status = state.data.form.begin_interview && state.data.form.begin_interview.what_is_your_marital_status ? transform(
    capitalizeFirstLetter(state.data.form.begin_interview.what_is_your_marital_status)
    ): undefined;

    state.data.form.begin_interview.position_of_respondent_in_the_household = state.data.form.begin_interview && state.data.form.begin_interview.position_of_respondent_in_the_household ? transform(
    capitalizeFirstLetter(state.data.form.begin_interview.position_of_respondent_in_the_household)
    ): undefined;

    state.helperFunctions = { getAge };
    return state;
    });

    upsert(
    'PHQ_9_Strong_Minds__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),

    // relationship('Intervention_Name__r', 'CommCare_Case_ID__c', state => {
    // if (state.data.form.hidden_properties.intervention_id) return state.data.form.hidden_properties.intervention_id;
    // else return "990221ac-3c05-475d-87c7-24d8a5fcb63e";
    // }),
    relationship('Intervention_Name__r', 'CommCare_Case_ID__c', dataValue('form.hidden_properties.intervention_id')),


    //relationship('Participant__r','CommCare_Ext_ID__c', dataValue('form.hidden_properties.participant_fullname')),
    field('Mobile_Contact_Information__c', dataValue('form.hidden_properties.mobile_number')),
    field('Curriculum__c', dataValue('form.hidden_properties.curriculum')),
    //field('Intervention__c', dataValue('form.hidden_properties.intervention')),
    field('Gender__c', dataValue('form.hidden_properties.gender')),
    field('Participant_Name__c', state => {
    const firstname = state.data.form.hidden_properties.participant_first_name;
    const lastname = state.data.form.hidden_properties.participant_surname;
    return firstname + ' ' + lastname;
    }),

    field('Coach_Name__c', dataValue('form.hidden_properties.coach_name')),
    relationship(
    'Venue2__r',
    'CommCare_Ext_ID__c',
    dataValue('form.hidden_properties.venue')
    ),
    //field('Venue__c', dataValue('form.hidden_properties.venue')), replacing with the lookup
    relationship(
    'Site2__r',
    'CommCare_Ext_ID__c',
    dataValue('form.hidden_properties.site')
    ),
    //field('Site__c', dataValue('form.hidden_properties.site')), replacing with the lookup
    field('Interview_Date__c', dataValue('form.interview_date')),
    field('Resident_not_shifting_in_3_months_time__c', dataValue('form.full_time_resident')),
    field('Participant_DOB__c', state => {
    const dob = dataValue('form.hidden_properties.date_of_birth')(state);
    return dob ? dob : null;
    }),
    //field('Area_Center__c', dataValue('form.hidden_properties.venue')), //Can get from Intervention
    field('Age_of_Participant__c', state => {
    const dob = dataValue('form.hidden_properties.date_of_birth')(state);

    return dob ? state.helperFunctions.getAge(dob) : null;
    }),


    field('Marital_Status__c', dataValue('form.begin_interview.what_is_your_marital_status')),
    field(
    'Position_of_Respondent_in_Household__c',
    dataValue('form.begin_interview.position_of_respondent_in_the_household')
    ),
    field('Q1_Little_interest_pleasure__c', dataValue('form.begin_interview.questions.little_interest')),
    field('Q2_Sad_Down_Depressed_Hopeless__c', dataValue('form.begin_interview.questions.depressed_sad_hopeless')),
    field('Q3_Trouble_sleeping__c', dataValue('form.begin_interview.questions.trouble_sleeping')),
    field('Q4_Feeling_tired__c', dataValue('form.begin_interview.questions.heavy_burden')),
    field('Q5_Appetite_problems__c', dataValue('form.begin_interview.questions.appetite_problems')),
    field('Q6_Failure_Worthless_Guilt__c', dataValue('form.begin_interview.questions.feeling_bad')),
    field('Q7_Trouble_concentrating__c', dataValue('form.begin_interview.questions.trouble_concentrating')),
    field('Q8_Trouble_in_speech__c', dataValue('form.begin_interview.questions.moving_slowly')),
    field('Q9_Suicidal_thoughts__c', dataValue('form.begin_interview.questions.thoughts_suicide'))
    //field('PHQ9_Total_Score__c', dataValue('form.begin_interview.questions.phq9_result.PHQ9_score'))
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html b/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html index 66b1efae298..33e889b0b1b 100644 --- a/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html +++ b/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19.html b/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19.html index 31010025545..be86505bc3c 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19.html +++ b/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Q3 2022 Create Distribution & Referral in SF

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, join, map, relationship, upsert

    Expression

    //Job to integrate CommCare 'Distribution & Referrals' form
    upsert(
    'Family_Planning_community_Distribution__c',
    'Commcare_Case_ID__c',
    fields(
    field('Commcare_Case_ID__c', dataValue('id')),
    relationship('RecordType', 'Name', 'FP Community Distribution & Referrals'),
    field('Distribute_Date__c', dataValue('form.date')),
    field('Client_Name__c', dataValue('form.name')),
    field('Client_Gender__c', dataValue('form.gender')),
    field('Client_Age__c', dataValue('form.age')),
    field('Client_currently_on_FP__c', dataValue('form.current_use')),
    field('Referral_Date__c', dataValue('form.Referral_Date')),
    field('Referral_Method__c', state => {
    var method = dataValue('form.referral_method')(state);
    var newMethod = method
    ? method
    .split(/_/g)
    .map(
    word =>
    `${word.substring(0, 1).toUpperCase()}${word.substring(1)}`
    )
    .join(' ')
    : '';
    return newMethod;
    }),
    field('Implant_Type__c', state => {
    var type = dataValue('form.implant_type')(state);
    var newType = '';
    if (type) {
    if (type === 'implanon') {
    newType = '3-year Implanon';
    } else {
    newType = type === 'jadelle' ? '5-year Jadelle' : null;
    }
    }
    return newType;
    }),
    field('Male_Condoms__c', dataValue('form.male_condoms_count')),
    field('Female_Condoms__c', dataValue('form.female_condoms_count')),
    field('POP__c', dataValue('form.POP_count')),
    field('COC__c', dataValue('form.COC_count')),
    field('Emergency_Pills__c', dataValue('form.emergency_pills_count')),
    field(
    'Pregnancy_test_positive__c',
    dataValue('form.positive_pregnancy_tests')
    ),
    field('Pregnancy_referrals__c', dataValue('form.pregnancy_referrals')),
    field(
    'Contraception_referrals__c',
    dataValue('form.family_planning_referrals')
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27.html b/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27.html index ae9179101e1..7d15f49ea44 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27.html +++ b/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Q3 2022 Update HH Name in CommCare

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    map, submitXls, Array

    Expression

    // Update CommCare case
    fn(state => {
    const { Notification } = state.data.Envelope.Body.notifications;

    const Notifications = Array.isArray(Notification)
    ? Notification
    : [Notification];

    const notifications = Notifications.map(notification => {
    console.log(
    `Mapping HH code to CommCare: `,
    notification.sObject.Household_Code_Autonumber__c
    );
    return {
    case_id: notification.sObject.Commcare_Code__c,
    name: notification.sObject.Household_Code_Autonumber__c,
    };
    });

    return { ...state, notifications };
    });

    submitXls(state => state.notifications, {
    case_type: 'Household',
    search_field: 'case_id',
    search_column: 'case_id',
    name_column: 'name',
    create_new_cases: 'off',
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28.html b/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28.html index 6e2f9efea52..590c182c5e7 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28.html +++ b/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Q3 2022 Upsert Household & Household Visit in SF

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Q3 2022 Upsert Household & Household Visit in SF
    • Adaptor: @openfn/language-salesforce
    • Adaptor Version: latest
    • Created about 2 years ago
    • Updated 6 months ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    dataValue, field, fields, join, map, query, relationship, upsertIf, Array

    Expression

    query(
    `SELECT Id, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c FROM Location__c WHERE CommCare_User_ID__c = '${dataValue(
    'properties.owner_id'
    )(state)}'`
    );

    fn(state => { console.log("query1 done"); return state; });
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('4 second cooldown finished.');
    resolve(state);
    }, 4000);
    });
    });

    fn(state => ({
    ...state,
    data: {
    ...state.data,
    villageNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Id
    : undefined,
    areaNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Parent_Geographic_Area__c
    : undefined,
    catchmentNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? (state.references[0].records[0].Parent_Geographic_Area__r
    ? state.references[0].records[0].Parent_Geographic_Area__r.Parent_Geographic_Area__c
    : undefined)
    : undefined,
    },
    }));

    upsertIf(
    state.data.properties.commcare_username !== 'openfn.test' &&
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' ,
    'Household__c',
    'CommCare_Code__c',
    fields(
    field('CommCare_Username__c', dataValue('properties.commcare_username')),
    field('MOH_household_code__c', dataValue('properties.moh_code')),
    field('CommCare_Code__c', dataValue('case_id')),
    field('Source__c', true),
    //field('Household_CHW__c', 'a030Q00000A0jeYQAR'), //sandbox hardcoded mapping
    field('Household_CHW__c', state => {
    var chw = dataValue('properties.CHW_ID')(state);
    return chw === 'a030800001zQrk'
    ? 'a030800001zQrk5'
    : chw
    ? chw
    : undefined;
    }),
    //TODO: Prod mapping to add back before go-live
    field('Catchment__c', dataValue('catchmentNewId')),
    field('Area__c', dataValue('areaNewId')),
    field('Village__c', dataValue('villageNewId')),
    field('Household_Village__c', dataValue('properties.village')),
    // relationship('Catchment__r', 'Name', state => {
    // var catchment =
    // state.data.properties.catchement ||
    // state.data.properties.catchment_name;
    // return catchment === '' || catchment === undefined
    // ? 'Unknown Location'
    // : catchment;
    // }), // check
    // field('Area__c', state => {
    // // var area = dataValue('properties.Area_Name')(state);
    // return area === '' || area === undefined ? 'a000Q00000Egmu4' : area;
    // }), // Commented out because it was causing a job error
    // field('Household_village__c', dataValue('properties.village')),//case property, but not in message

    // field('Village__c',dataValue('properties.village_name')), //lookup
    field('Deaths_in_the_last_6_months__c', state => {
    var death = dataValue(
    'properties.deaths_in_past_6_months'
    )(state);
    return death > 0 ? 'Yes' : 'No';
    }),
    field('Access_to_safe_water__c',dataValue('properties.Safe_Water')),//not coming through
    field('Treats_Drinking_Water__c',dataValue('properties.Treats_Drinking_Water')),//not coming through
    field('Tippy_Tap__c',dataValue('properties.Active_Handwashing_Station')),//not coming through
    field('Pit_Latrine__c',dataValue('properties.Functional_Latrine')),//not coming through
    field('Rubbish_Pit__c',dataValue('properties.Rubbish_Pit')),//not coming through
    field('Drying_Rack__c',dataValue('properties.Drying_Rack')),//not coming through
    field('Kitchen_Garden__c',dataValue('properties.Kitchen_Garden')),//not coming through
    field('Cookstove__c',dataValue('properties.Improved_Cooking_Method')),//not coming through
    field('Clothe__c',dataValue('properties.Clothesline')),//not coming through
    field('WASH_Trained__c',dataValue('properties.WASH_Trained')),//not coming through
    field('Uses_ITNs__c',dataValue('properties.ITNs')),
    field(
    'Has_muac_tape__c',
    dataValue('properties.family_muac_tape_available')
    ),
    //field('Total_household_people__c',dataValue('properties.Total_Number_of_Members')), //not coming through
    field('Health_insurance__c', dataValue('properties.health_insurace_cover')),
    field('Health_insurance_active_status__c',dataValue('properties.healthinsurance_active')),
    field('Health_insurance_type__c', state => {
    var status = dataValue('properties.health_insurance')(state);
    return status && status === 'other_please_specify_if_active'
    ? 'Other'
    : status === 'nhif'
    ? 'NHIF'
    : status === 'Linda_mama' || 'linda_mama'
    ? 'Linda mama'
    : status;
    }),
    field('Other_Health_Insurance__c',dataValue('properties.if_other_please_specify')),
    field('Work_with_TBA__c', dataValue('properties.tba')),
    field('TBA_name__c', dataValue('properties.which_tba')),
    field('Last_Modified_Date_CommCare__c', dataValue('server_date_modified')),//Need a case property),
    field('Active_Household__c', state => {
    var status = dataValue('properties.Household_Status')(state);
    return status && status === 'No'
    ? false
    : status === 'Yes'
    ? true
    : status;
    }),
    // relationship('Head_of_Household__r', 'CommCare_ID__c', dataValue('properties.head_of_household_case_id')),
    field('Inactive_Reason__c', state => {
    var reason = dataValue('properties.Reason_for_Inactive')(state);
    return reason ? reason.toString().replace(/_/g, ' ') : null;
    }),
    field(
    'Active_in_Nutrition_Program__c',
    dataValue(
    'properties.enrolled_in_a_lwala_nutrition_program'
    )
    ),
    field(
    'lwala_nutrition_program_enrollment_date__c',
    dataValue(
    'properties.lwala_nutrition_program_enrollment_date'
    )
    ),
    field(
    'Trained_in_gardening__c',
    dataValue('properties.household_trained_on_gardening')
    ),
    field(
    'household_trained_on_gardening_date__c',
    dataValue(
    'properties.when_was_the_household_trained_on_gardening'
    )
    ),
    field(
    'Seed_Input_Support__c',
    dataValue('properties.household_provided_with_seed_input_support'
    )
    ),
    field(
    'household_provided_with_seed_input_suppo__c',
    dataValue(
    'properties.when_was_the_household_provided_with_seed_input_support'
    )
    ),
    field(
    'MIYCN_Trained__c',
    dataValue('properties.household_trained_on_MIYCN')
    ),
    // not in message:
    // field(
    // 'Kitchen_Garden__c',
    // dataValue('properties.nutrition_enrollment.household_has_kitchen_garden')
    // ),

    //field('Case_Closed_Date__c', state => {
    // var closed = dataValue('date_closed')(state);
    // var date = dataValue('server_date_modified')(state);
    // return closed && closed == true ? date : undefined;
    // })
    )
    );

    fn(state => { console.log("upsertIf1 done"); return state; });
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('4 second cooldown finished.');
    resolve(state);
    }, 4000);
    });
    });

    //Household Visit
    query(
    `SELECT Id, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c FROM Location__c WHERE CommCare_User_ID__c = '${dataValue(
    'properties.owner_id'
    )(state)}'`
    );

    fn(state => { console.log("query2 done"); return state; });
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('4 second cooldown finished.');
    resolve(state);
    }, 4000);
    });
    });

    fn(state => ({
    ...state,
    data: {
    ...state.data,
    catchmentNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? (state.references[0].records[0].Parent_Geographic_Area__r
    ? state.references[0].records[0].Parent_Geographic_Area__r.Parent_Geographic_Area__c
    : undefined)
    : undefined,
    },
    }));

    fn(state => {
    /* const deaths = state.data.form.household_deaths
    ? state.data.form.household_deaths.deaths
    : '';
    if (deaths !== '' && !Array.isArray(deaths)) {
    state.data.form.household_deaths.deaths = [deaths];
    }*/

    const supervisorMap = {
    community_health_nurse: 'Community Health Nurse',
    chw_supervisor: 'CHW Supervisor',
    chewschas: 'CHEWs/CHAs',
    other: 'Other',
    none: 'None',
    };

    const insuranceMap = {
    nhif: 'NHIF',
    Linda_mama: 'Linda mama',
    other_please_specify_if_active: 'Other',
    none: 'None',
    };

    return { ...state, supervisorMap, insuranceMap };
    });

    upsertIf(
    // state.data.properties.username !== 'openfn.test' &&
    state.data.properties.username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' ,
    'Visit__c',
    'CommCare_Visit_ID__c',
    fields(
    field('CommCare_Username__c', dataValue('properties.commcare_username')),//
    // field('CommCare_Visit_ID__c', dataValue('id')),
    field('CommCare_Visit_ID__c', state => {
    var case_id = dataValue('case_id')(state);
    var submitted = dataValue('properties.last_form_opened_date_and_time')(state);
    return case_id + '_' + submitted;
    }),
    // field('Household_CHW__c', 'a030Q00000A0jeY'),
    // field('Catchment__c', dataValue('a000Q00000Egmtk')),
    field('Catchment__c', dataValue('catchmentNewId')),
    // field('Household__c','a010Q00000BL6lT'),
    // field('Household__c', dataValue('form.case.@case_id')),
    relationship(
    'Household__r',
    'CommCare_Code__c',
    dataValue('case_id')),
    field('Date__c',dataValue('properties.Date')),
    field('Form_Submitted__c', dataValue('properties.last_form_opened_name')),

    //field('MOH_household_code__c', state => {
    // var moh = dataValue('form.Household_Information.moh_code')(state);
    // var mohLinked = dataValue('form.MOH_household_code_linked')(state);
    // return moh ? moh : mohLinked && mohLinked !== '' ? mohLinked : undefined;
    // }),
    field('Active_Household__c', state => {
    var status = dataValue('properties.Household_Status')(state);
    return status && status === 'No'
    ? false
    : status === 'Yes'
    ? true
    : status;
    }),
    //field('Inactive_Reason__c', state => {
    // var reason = dataValue('form.Reason_for_Inactive')(state);
    // return reason ? reason.toString().replace(/_/g, ' ') : null;
    //}),
    //field('Source__c', 1),//
    //relationship(
    // 'Household_CHW__r',
    // 'CommCare_ID__c',
    // dataValue('form.sfid')),TO UPDATE IN PRODUCTION
    // field('Household_village__c', dataValue('form.village')),//
    //New Nutrition Field (MOTG)
    field(
    'Active_in_Nutrition_Program__c',
    dataValue(
    'properties.enrolled_in_a_lwala_nutrition_program'
    )
    ),
    field(
    'lwala_nutrition_program_enrollment_date__c',
    dataValue(
    'properties.lwala_nutrition_program_enrollment_date'
    )
    ),
    field(
    'Trained_in_gardening__c',
    dataValue('properties.household_trained_on_gardening')
    ),
    field(
    'household_trained_on_gardening_date__c',
    dataValue(
    'properties.when_was_the_household_trained_on_gardening'
    )
    ),
    field(
    'Seed_Input_Support__c',
    dataValue(
    'properties.household_provided_with_seed_input_support'
    )
    ),
    field(
    'household_provided_with_seed_input_suppo__c',
    dataValue(
    'properties.when_was_the_household_provided_with_seed_input_support'
    )
    ),
    field(
    'MIYCN_Trained__c',
    dataValue('properties.household_trained_on_MIYCN')
    ),
    field(
    'Kitchen_Garden__c',
    dataValue('properties.Kitchen_Garden')
    ),

    field(
    'Access_to_safe_water__c',
    dataValue('properties.Safe_Water')
    ),
    field(
    'Treats_Drinking_Water__c',
    dataValue('properties.Treats_Drinking_Water')
    ),
    field(
    'Tippy_Tap__c',
    dataValue('properties.Active_Handwashing_Station')
    ),
    field(
    'Pit_Latrine__c',
    dataValue('properties.Functional_Latrine')
    ),
    field(
    'Rubbish_Pit__c',
    dataValue('properties.Rubbish_Pit')
    ),
    field(
    'Drying_Rack__c',
    dataValue('properties.Drying_Rack')
    ),
    field(
    'Kitchen_Garden__c',
    dataValue('properties.Kitchen_Garden')
    ),
    field(
    'Cookstove__c',
    dataValue('properties.Improved_Cooking_Method')
    ),
    field('Clothe__c', dataValue('properties.Clothesline')),
    field(
    'WASH_Trained__c',
    dataValue('properties.WASH_Trained')
    ),
    field(
    'Has_muac_tape__c',
    dataValue('properties.family_muac_tape_available')
    ),
    field('Uses_ITNs__c', dataValue('properties.ITNs')),
    field('Supervisor_Visit__c', state =>
    state.data.properties.supervisor_visit
    ? state.supervisorMap[state.data.properties.supervisor_visit]
    : null
    ),
    field('Health_insurance__c', dataValue('properties.health_insurace_cover')),
    field(
    'Health_insurance_active_status__c',
    dataValue('properties.healthinsurance_active')
    ),
    field('Health_insurance_type__c', state => {
    var status = dataValue('properties.health_insurance')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.insuranceMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field(
    'Other_Health_Insurance__c',
    dataValue('properties.if_other_please_specify')
    ),
    //field('Last_Modified_Date_CommCare__c', dataValue('server_modified_on')),
    field('CommCare_Form_Opened__c', state=> {
    var form_opened = dataValue('properties.last_form_opened_date_and_time')(state);
    var value1 = form_opened.split('-').slice(0, 2).join('-');
    var value2 = form_opened.split('-').slice(2).join('-');
    var formattedValue = [value1, value2].join(' ');
    return new Date(formattedValue).toISOString();
    }),
    field('Case_Closed_Date__c', state => {
    var closed = dataValue('date_closed')(state);
    var date = dataValue('server_modified_on')(state);
    return closed && closed == true ? date : undefined;
    })
    )
    );

    fn(state => { console.log("upsertIf2 done"); return state; });
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('Final 4 second cooldown finished.');
    resolve(state);
    }, 4000);
    });
    });


    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21.html b/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21.html index f41291de4b6..c25083c4458 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21.html +++ b/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Q3 2022 Upsert Person

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, join, map, query, relationship, upsertIf

    Expression

    // create constants and functions
    fn(state => {
    state.cleanChoice = function (state, choice) {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    };

    state.handleMultiSelect = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value.charAt(0).toUpperCase() + value.slice(1).replace('_', ' ')
    );
    })
    .join(';')
    : '';
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const counselMap = {
    anc_visits: 'ANC Visits',
    early_initiation_of_anc_less_than_3_months:
    'Early initiation of ANC (less than 3 months)',
    completing_recomended_anc_visits: 'Completing recomended ANC visits',
    danger_signs: 'Danger signs',
    skilled_birth: 'Skilled birth',
    immunization: 'Immunization',
    individual_birth_plan: 'Individual Birth Plan',
    emergency_preparedness: 'Emergency preparedness',
    childcare_and_affection: 'Childcare and affection',
    nutrition_counseling: 'Nutrition counseling',
    growth_monitoring: 'Growth monitoring',
    exclusive_breastfeeding: 'Exclusive breastfeeding',
    complementary_feeding: 'Complementary feeding',
    sleeping_under_llitn: 'Sleeping under LLITN',
    knowing_hiv_status: 'Knowing HIV status',
    indoor_pollution: 'Indoor pollution',
    personal_hygiene: 'Personal Hygiene',
    safe_drinking_water: 'Safe drinking water',
    safe_disposal_of_human_waste: 'Safe disposal of human waste',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for other Ols',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const reasonMapping = {
    lack_of_access_to_fp_information: 'Lack of access to FP information',
    no_access_to_fp_services_hospitals:
    'Lack of hospitals or places where FP services can be accessed',
    not_willing_to_use_fp_due_to_negative_effects_myths_and_misconceptions:
    'Myths and misconceptions',
    barriers_at_service_delivery_points: 'Barriers at service delivery points',
    pregnant: 'The client is pregnant',
    intentions_of_getting_pregnant: 'Intentions of getting pregnant',
    not_sexually_active: 'The client is not sexually active',
    other_barriers_culture_male_partners_parents_etc:
    'Other barriers (culture, male partners, parents, etc)',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays Learning Difficulties',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Delay Speech and Language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const milestoneMap = {
    movement: 'Movement',
    hearing: 'Hearing',
    communication: 'Communication',
    seeing: 'Seeing',
    cognitive_delays: 'Cognitive Delays',
    play: 'Play',
    };
    const nutritionMap = {
    severe: 'Severely Malnourished',
    moderate: 'Moderately Malnourished',
    normal: 'Normal',
    };

    const fpMethodMap = {
    male_condoms: 'Male condoms',
    female_condoms: 'Female condoms',
    pop: 'POP',
    coc: 'COC',
    emergency_pills: 'Emergency pills',
    none: 'None',
    };

    return {
    ...state,
    counselMap,
    serviceMap,
    reasonMapping,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    };
    });

    // get data from SF
    query(
    `SELECT Id, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c FROM Location__c WHERE CommCare_User_ID__c = '${dataValue(
    'properties.owner_id'
    )(state)}'`
    );

    // build IDs from queried SF data
    fn(state => ({
    ...state,
    data: {
    ...state.data,
    villageNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Id
    : undefined,
    areaNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Parent_Geographic_Area__c
    : undefined,
    catchmentNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Parent_Geographic_Area__r
    ? state.references[0].records[0].Parent_Geographic_Area__r
    .Parent_Geographic_Area__c
    : undefined
    : undefined,
    },
    }));

    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes',
    'Household__c',
    'CommCare_Code__c',
    fields(
    field('CommCare_Code__c', state => {
    return (
    dataValue('indices.parent.case_id')(state) ||
    dataValue('properties.parent_id')(state)
    );
    })
    )
    ),

    // build sfRecord before upserting
    fn(state => {
    // This mapping was initially constructed with fields(field(), ...) syntax. We
    // preserve it here and use "expandReferences" but could also refactor this to
    // use standard object syntax, as Salesforce looks for { k: v, ... }.
    const originalMapping = fields(
    /* field(
    'deworming_medication__c',
    dataValue('form.TT5.Child_Information.Deworming')
    ),depracated field*/
    field('Source__c', 1),
    field('CommCare_ID__c', dataValue('case_id')),
    relationship(
    'Household__r',
    'CommCare_Code__c', state => {
    // (dataValue('properties.parent_id') || dataValue('indices.parent.case_id'))
    return (
    dataValue('properties.parent_id')(state) ||
    dataValue('indices.parent.case_id')(state)
    );
    }),
    field('commcare_location_id__c',dataValue('properties.commcare_location_id')),
    field('CommCare_Username__c',dataValue('properties.commcare_username')),
    field('Telephone__c', dataValue('properties.contact_phone_number')),
    field(
    'Consent_for_data_use__c',
    dataValue('properties.data_sharing_consent')
    ),
    field('CommCare_HH_Code__c', dataValue('indices.parent.case_id')),
    field('Client_Status__c', dataValue('properties.Client_Status')),
    field('Catchment__c', dataValue('catchmentNewId')),
    field('Area__c', dataValue('areaNewId')),
    field('Household_Village__c', dataValue('villageNewId')),
    field('Name', state => {
    var name1 = dataValue('properties.Person_Name')(state); //check
    var unborn = dataValue('properties.name')(state); //check
    var name2 =
    name1 === undefined || name1 === '' || name1 === null
    ? unborn
    : name1.replace(/\w\S*/g, function (txt) {
    return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    });
    return name1 !== null ? name2 : 'Unborn Child';
    }),
    field('Chronic_illness__c', state => {
    var choice = dataValue(
    'properties.please_specify_which_chronic_illness_the_person_has'
    )(state);
    var choice2 = state.handleMultiSelect(state, choice);
    return choice2 ? choice2.replace(/_/g, ' ') : '';
    }),
    field(
    'Currently_enrolled_in_school__c',
    dataValue('properties.enrolled_in_school')
    ),
    field('Education_Level__c', state => {
    var level = dataValue('properties.Education_Level')(state);
    return level ? level.toString().replace(/_/g, ' ') : null;
    }),
    field('Relation_to_the_head_of_the_household__c', state => {
    var relation = dataValue('properties.relation_to_hh')(state);
    if (relation) {
    relation = relation.toString().replace(/_/g, ' ');
    var toTitleCase = relation.charAt(0).toUpperCase() + relation.slice(1);
    return toTitleCase;
    }

    return null;
    }),
    field('Gender__c',dataValue('properties.Gender')),
    field('Disability__c', state => {
    var disability = dataValue('properties.disability')(state);
    var toTitleCase =
    disability !== undefined
    ? disability
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    : null;
    return toTitleCase;
    }), //need case property
    field('Other_disability__c', state => {
    var disability = dataValue('properties.other_disability')(state);
    var toTitleCase =
    disability !== undefined
    ? disability
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    : null;
    return toTitleCase;
    }), //need case property

    field('Use_mosquito_net__c', dataValue('properties.sleep_under_net')), //need case property
    // field('Birth_Certificate__c',dataValue('properties.birth_certificate')),
    field('Birth_Certificate__c', dataValue('properties.birth_certificate')),
    field('Child_Status__c', state => {
    var status = dataValue('properties.Child_Status')(state);
    var rt = dataValue('properties.Record_Type')(state); //check that this is the right one
    if (status && rt === 'Unborn') {
    status = 'Unborn';
    } else if (status && rt === 'Born') {
    status = 'Born';
    }
    return status;
    }),
    //===================================================//
    relationship('RecordType', 'Name', state => {
    var rt = dataValue('properties.Record_Type')(state);
    return rt === 'Unborn' || rt === ''
    ? 'Child'
    : rt.toString().replace(/_/g, ' '); //convert Unborn children to Child RT
    }),

    //TT5 Mother Information

    field('MCH_booklet__c', dataValue('properties.mch_booklet')), //need to create a case property
    field('Reason_for_not_taking_a_pregnancy_test__c', state => {
    var reason = dataValue('properties.No_Preg_Test')(state);
    return reason ? reason.toString().replace(/_/g, ' ') : undefined;
    }),
    field('Pregnancy_danger_signs__c', state => {
    var signs = dataValue('properties.pregnancy_danger_signs')(state);
    return signs ? state.pregDangerMap[signs] : undefined;
    }),
    field(
    'Individual_birth_plan_counselling__c',
    dataValue('properties.individual_birth_plan')
    ),
    field('Child_Danger_Signs__c', state => {
    var signs = dataValue('properties.Other_Danger_Signs')(state);
    return signs
    ? signs
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    .toString()
    .replace(/_/g, ' ')
    : signs;
    }),

    //HAWI
    field(
    'Unique_Patient_Code__c',
    dataValue('properties.Unique_Patient_Code')
    ),
    field(
    'Active_in_Support_Group__c',
    dataValue('properties.Active_in_Support_Group')
    ),
    field(
    'Preferred_Care_Facility__c',
    dataValue('properties.Preferred_Care_Facility')
    ),
    field('Currently_on_ART_s__c', dataValue('properties.ART')),
    field('ART_Regimen__c', dataValue('properties.ARVs')),
    field('HAWI_Defaulter__c', state => {
    var hawi = dataValue('properties.default')(state);
    return hawi === 'Yes' ? true : false;
    }),
    field('Date_of_Default__c', dataValue('properties.date_of_default')),
    field('Know_HIV_status__c', dataValue('properties.known_hiv_status')),
    field('HIV_Status__c', dataValue('properties.hiv_status')),
    /*field('HIV_Status__c', state => {
    var status = dataValue('properties.hiv_status')(state);
    return status === 'yes'
    ? 'Known'
    : status === 'no'
    ? 'Unknown'
    : undefined;
    }),//CHECK MAPPING ON THIS ONE*/

    //Illness
    field('Persons_temperature__c', dataValue('properties.temperature')),
    field(
    'Days_since_illness_start__c',
    dataValue('properties.duration_of_sickness')
    ),
    field(
    'Current_Malaria_Status__c',
    dataValue('properties.malaria_test_results')
    ),
    field('Malaria_test__c', dataValue('properties.malaria_test')),
    field(
    'Last_Malaria_Home_Test__c',
    dataValue('properties.malaria_test_date')
    ),
    field('Last_Malaria_Home_Treatment__c', state => {
    var choice = dataValue(
    'properties.malaria_test_date'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    /*field('Current_Malaria_Status__c', dataValue('form.Malaria_Status')),//check
    field('Malaria_Facility__c',dataValue('form.treatment_and_tracking.malaria_referral_facility')),
    field('Fever_over_7days__c',dataValue('form.treatment_and_tracking.symptoms_check_fever')),//check*/
    field('Cough_over_14days__c', dataValue('properties.symptoms_check_cough')),
    /*field('Diarrhoea_over_14days__c',dataValue('form.treatment_and_tracking.symptoms_check_diarrhea')),//check
    field('Diarrhoea_less_than_14_days__c',dataValue('form.treatment_and_tracking.mild_symptoms_check_diarrhea')),//check*/
    field(
    'TB_patients_therapy_observed__c',
    dataValue('properties.observed_tb_therapy')
    ),
    field('Injuries_or_wounds__c', dataValue('properties.wounds_or_injuries')),
    field(
    'Pulse_Oximeter__c',
    dataValue('properties.pulse_oximeter_available')
    ),
    field(
    'Heart_Rate_Pulse_Oximeter__c',
    dataValue('properties.heart_rate_pulse_oximeter')
    ),
    field(
    'Oxygen_Concentration_Pulse_Oximeter__c',
    dataValue('properties.oxygen_concentration')
    ),
    field('Can_child_drink__c', dataValue('properties.can_child_drink')),
    // field('Antibiotic_provided_for_fast_breathing__c',dataValue('properties.antibiotic_fast_breathing')),
    field('Antibiotic_provided_for_fast_breathing__c', state => {
    var choice = dataValue('properties.antibiotic_fast_breathing')(state);
    return state.cleanChoice(state, choice);
    }),
    // field('Antibiotic_provided_for_chest_indrawing__c',dataValue('properties.antibiotic_chest_indrawing')),
    field('Antibiotic_provided_for_chest_indrawing__c', state => {
    var choice = dataValue('properties.antibiotic_chest_indrawing')(state);
    return state.cleanChoice(state, choice);
    }),
    /*field('Child_zinc__c',dataValue('form.TT5.Child_Information.Clinical_Services.diarrhea_clinic_treatment_zinc')),//check
    field('Child_ORS__c',dataValue('form.TT5.Child_Information.Clinical_Services.diarrhea_clinic_treatment_ORS')),//check
    field('Childs_breath_per_minute__c',dataValue('form.psbi.breaths_per_minuite')),//check
    field('Child_chest_in_drawing__c',dataValue('form.psbi.Child_chest_in_drawing_c')),//check*/
    field('Default_on_TB_treatment__c', state => {
    var choice = dataValue('properties.default_tb_treatment')(state); //check
    return state.cleanChoice(state, choice);
    }),
    field('Treatment_Distribution__c', state => {
    var choice = dataValue('properties.distributed_treatments')(state);
    return state.cleanChoice(state, choice);
    }), //check

    //Delivery
    field(
    'Immediate_Breastfeeding__c',
    dataValue('properties.Breastfeeding_Delivery')
    ),
    field('Place_of_Delivery__c', state => {
    var facility = dataValue('properties.Delivery_Type')(state);
    return facility === 'Skilled'
    ? 'Facility'
    : facility === 'Unskilled'
    ? 'Home'
    : undefined;
    }),
    field('Delivery_Facility__c', state => {
    var facility = dataValue('properties.Delivery_Facility')(state);
    return facility ? facility.toString().replace(/_/g, ' ') : null;
    }),
    /* field('Delivery_Facility__c', state => {
    //HMN 21//11/2022
    var birthFacility =dataValue('properties.Birth_Facility')(state);
    var deliveryFacility = dataValue('properties.Delivery_Facility')(state);
    var facilityOfBirth = dataValue ('properties.Facility_of_Birth')(state);
    var faciliy_val =
    facilityOfBirth //!== undefined || facilityOfBirth !== '' || facilityOfBirth !== null
    ? facilityOfBirth
    :birthFacility //!== undefined || birthFacility !== '' || birthFacility !== null
    ? birthFacility
    :deliveryFacility //!== undefined || deliveryFacility !== '' || deliveryFacility !== null
    ? deliveryFacility
    :"";
    return faciliy_val.toString().replace(/_/g, ' ');
    //HMN
    }), */
    //field('Delivery_Facility__c', state => {
    // var facility = dataValue('properties.Birth_Facility')(state);
    // return facility ? facility.toString().replace(/_/g, ' ') : null;
    //}),
    field(
    'Delivery_Facility_Other__c',
    dataValue('properties.Delivery_Facility_Other')
    ),

    //Family Planning

    field('LMP__c', dataValue('properties.LMP')),
    field('Family_Planning__c', dataValue('properties.family_planning')),
    field(
    'Family_Planning_Method__c',
    dataValue('properties.family_planning_method')
    ),
    field('FP_Method_Distributed__c', state => {
    var status = dataValue('properties.FP_commodity')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.fpMethodMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Reasons_for_not_taking_FP_method__c', state => {
    var status = dataValue('properties.No_FPmethod_reason')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.reasonMapping[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Pregnant__c', state => {
    var preg = dataValue('properties.Pregnant')(state);
    return preg === 'Yes' ? true : false;
    }),
    field('Date_of_Delivery__c', dataValue('properties.delivery_date')),
    field(
    'Counselled_on_FP_Methods__c',
    dataValue('properties.CounselledFP_methods')
    ),
    field('Client_counselled_on__c', state => {
    var choices =
    dataValue('properties.counsel_topic')(state) ||
    dataValue('properties.counsel_topic')(state); //need to create a case property
    var choiceGroups = choices ? choices.split(' ') : null;
    var choicesMulti = choiceGroups
    ? choiceGroups
    .map(cg => {
    return state.counselMap[cg];
    })
    .join(';')
    : choiceGroups;
    return choicesMulti;
    }), //OpenFn Question - can this be simplified now that this is a case property
    field('Client_provided_with_FP__c', state => {
    var choice = dataValue(
    'properties.was_the_woman_15-49yrs_provided_with_family_planning_commodities_by_chv'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'Received_pregnancy_test__c',
    dataValue('properties.did_you_adminsiter_a_pregnancy_test')
    ),
    field(
    'Pregnancy_test_result__c',
    dataValue('properties.pregnancy_test_result')
    ),
    field('Gravida__c', dataValue('properties.Gravida')),
    field('Parity__c', dataValue('properties.Parity')),

    //TT5 Child Information

    field(
    'Exclusive_Breastfeeding__c',
    dataValue('properties.Exclusive_Breastfeeding')
    ),
    field(
    'Counselled_on_Exclusive_Breastfeeding__c',
    dataValue('properties.counseling')
    ),
    field(
    'Newborn_visited_48_hours_of_delivery__c',
    dataValue('properties.newborn_visited_48_hours_of_delivery')
    ),
    field('Newborn_visit_counselling__c', state => {
    var choice = dataValue('properties.did_you_consel_the_mother_on1')(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'mother_visited_48_hours_of_the_delivery__c',
    dataValue('properties.visit_mother_48')
    ),
    /*
    //HMN -06012023- The object Visit_after_unskilled__c seems to be missing in sfRecord
    //Investigation issue https://lwala.atlassian.net/browse/LWAL-716 raised
    //Meanwhile this is being removed to allow re-processing
    field(
    'Visit_after_unskilled__c',
    dataValue('properties.visit_24hours_after_unskilled_delivery')
    ),
    */
    field('Mother_visit_counselling__c', state => {
    var choice = dataValue('properties.did_you_consel_the_mother_on2')(state);
    return state.cleanChoice(state, choice);
    }),
    /*field('Newborn_visited_48_hours_of_delivery__c',dataValue('properties.newborn_visited_48_hours_of_delivery')), Duplicate Mapping*/
    field(
    'Newborn_visited_by_a_CHW_within_6_days__c',
    dataValue('properties.visit_6_days_from_delivery')
    ),

    //Nutrition

    field(
    'Caretaker_action_after_muac_screening__c',
    dataValue('properties.mother_screened_muac_action')
    ),
    field(
    'Caretaker_muac_findings__c',
    dataValue('properties.mother_screened_child_muac_result')
    ),
    field('Food_groups_3_times_a_day__c',dataValue('properties.food_groups')),
    // field('Caretaker_screened_for_muac_this__c', dataValue('properties.mother_screened_child_muac')),
    field('Caretaker_screened_for_muac_this__c', state => {
    var choice = dataValue('properties.mother_screened_child_muac')(state); //check
    return state.cleanChoice(state, choice);
    }),
    // field('Caretaker_trained_in_muac__c', dataValue('properties.mother_trained_muac')),
    field('Caretaker_trained_in_muac__c', state => {
    var choice = dataValue('properties.mother_trained_muac')(state); //check
    return state.cleanChoice(state, choice);
    }),
    field(
    'of_Caretaker_MUAC_screenings__c',
    dataValue('properties.mother_nb_screening')
    ),
    field('Current_Weight__c', dataValue('properties.Current_Weight')), //Only on task update
    field('Current_Height__c', dataValue('properties.current_height')),
    field('Current_MUAC__c', dataValue('properties.MUAC')),
    field('Current_Nutrition_Status__c', state => {
    var status = dataValue('properties.Nutrition_Status')(state);
    return status ? state.nutritionMap[status] : undefined;
    }),

    //TT5 & HAWI
    field('TT5_Mother_Registrant__c', state => {
    var preg = dataValue('properties.Pregnant')(state);
    return preg == 'Yes' ? 'Yes' : null;
    }),
    field('Enrollment_Date__c', state => {
    var age = dataValue('properties.age')(state);
    var date = dataValue('server_date_modified')(state);
    var preg = dataValue('properties.Pregnant')(state);
    return age < 5 || preg == 'Yes' ? date : null;
    }),
    field('HAWI_Enrollment_Date__c', state => {
    var date = dataValue('server_date_modified')(state);
    var status = dataValue('properties.hiv_status')(state);
    return status == 'positive' ? date : null;
    }),
    field('Thrive_Thru_5_Registrant__c', state => {
    var age = dataValue('properties.age')(state);
    var preg = dataValue('properties.Pregnant')(state);
    return age < 5 || preg == 'Yes' ? 'Yes' : 'No';
    }), //check mapping
    field('HAWI_Registrant__c', state => {
    var status = dataValue('properties.hiv_status')(state);
    return status == 'positive' ? 'Yes' : 'No';
    }),

    //ANC
    field('ANC_1__c', state => {
    var date = dataValue('properties.ANC_1')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('ANC_2__c', state => {
    var date = dataValue('properties.ANC_2')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('ANC_3__c', state => {
    var date = dataValue('properties.ANC_3')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('ANC_4__c', state => {
    var date = dataValue('properties.ANC_4')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('ANC_5__c', state => {
    var date = dataValue('properties.ANC_5')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('Date_of_Birth__c', state => {
    var date = dataValue('properties.DOB')(state);
    return date && date !== '' ? date : undefined;
    }),

    //Immunization

    field(
    'Child_missed_immunization_type__c',
    dataValue('form.TT5.Child_Information.Immunizations.immunization_type')
    ), //check
    field('BCG__c', dataValue('properties.BCG')),
    field('OPV_0__c', dataValue('properties.OPV_0')),
    field('Measles_6__c', dataValue('properties.Measles_6')),
    field('Measles_9__c', dataValue('properties.Measles_9')),
    field('Measles_18__c', dataValue('properties.Measles_18')),
    field('OPV_1__c', dataValue('properties.OPV_PCV_Penta_1')),
    field('OPV_2__c', dataValue('properties.OPV_PCV_Penta_2')),
    field('OPV_3__c', dataValue('properties.OPV_PCV_Penta_3')),
    field('Rotavirus_1__c', dataValue('properties.rotavirus_1')),
    field('Rotavirus_2__c', dataValue('properties.rotavirus_2')),
    field('IPV__c', dataValue('properties.IPV')),
    field('Vitamin_A_12__c', dataValue('properties.Vitamine_A')),
    field('Vitamin_A_18__c', dataValue('properties.Vitamine_A_2')),
    field('Vitamin_A_24__c', dataValue('properties.Vitamine_A_3')),
    field('Deworming_12__c', dataValue('properties.Deworming_1')),
    field('Deworming_18__c', dataValue('properties.Deworming_2')),
    field('Deworming_24__c', dataValue('properties.Deworming_3')),

    //ECD
    // field('Did_you_counsel_caregiver_on__c',dataValue('properties.did_you_counsel_the_caregiver_on_delayed_milestones')),
    field('Did_you_counsel_caregiver_on__c', state => {
    var choice = dataValue(
    'properties.did_you_counsel_the_caregiver_on_delayed_milestones'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    // field('Delayed_Milestone__c',dataValue('properties.does_the_child_has_a_delayed_milestone')),
    field('Delayed_Milestone__c', state => {
    var choice = dataValue(
    'properties.does_the_child_has_a_delayed_milestone'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    // field('Child_has_2_or_more_play_items__c',dataValue('properties.does_the_child_has_2_or_more_play_items_at_home')),
    field('Child_has_2_or_more_play_items__c', state => {
    var choice = dataValue(
    'properties.does_the_child_has_2_or_more_play_items_at_home'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    // field('Child_has_3_or_more_picture_books__c',dataValue('properties.does_the_child_has_3_or_more_picture_books')),
    field('Child_has_3_or_more_picture_books__c', state => {
    var choice = dataValue(
    'properties.does_the_child_has_3_or_more_picture_books'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Delayed_Milestones_Counselled_On__c', state => {
    var ms = dataValue(
    'properties.which_delayed_milestone_area_did_you_counsel_the_caregiver_on'
    )(state);
    return ms ? state.milestoneMap[ms] : undefined;
    }),
    field('Delayed_Milestone_Type__c', state => {
    var ms = dataValue('properties.which_delayed_milestone')(state);
    return ms ? state.milestoneTypeMap[ms] : undefined;
    }),

    //Death
    field('Date_of_Death__c', dataValue('properties.Date_of_Death')),
    field('Cause_of_Death__c', state => {
    var death = dataValue('properties.cause_of_death_dead')(state);
    return death ? death.toString().replace(/_/g, ' ') : death;
    }), //check which case property to use - there are 2
    field('Verbal_autopsy__c', dataValue('properties.verbal_autopsy')),

    //Closing
    field('Last_Modified_Date_CommCare__c', dataValue('date_modified')),
    field('Case_Closed_Date__c',dataValue('date_closed')),
    //field('Case_Closed_Date__c', state => {
    // var closed = dataValue('date_closed')(state);
    // var date = dataValue('date_modified')(state);
    // return closed && closed == true ? date : undefined;
    //}) //need case property
    );

    let sfRecord = expandReferences(originalMapping)(state);

    Object.entries(sfRecord).forEach(([key, value]) => {
    if (value === '') sfRecord[key] = undefined;
    });

    return { ...state, sfRecord };
    });

    // upsert data to SF
    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' ,
    'Person__c', 'CommCare_ID__c', state => state.sfRecord);

    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' &&
    state.data.properties.caretaker_case_id !== undefined && state.data.properties.caretaker_case_id !== '',
    'Person__c', 'CommCare_ID__c',
    fields(
    relationship('Primary_Caregiver_Lookup__r', 'CommCare_ID__c', state => {
    return caregiver = dataValue('properties.caretaker_case_id')(state);
    }),
    field('CommCare_ID__c', dataValue('case_id')),
    )
    );

    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' &&
    state.data.properties.mother_case_id !== undefined && state.data.properties.mother_case_id !== '',
    'Person__c', 'CommCare_ID__c',
    fields(
    relationship('Mother__r', 'CommCare_ID__c', state => {
    return caregiver = dataValue('properties.mother_case_id')(state);
    }),
    field('CommCare_ID__c', dataValue('case_id')),
    )
    );

    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' &&
    state.data.properties.head_of_household_case_id !== undefined && state.data.properties.head_of_household_case_id !== '',
    'Household__c', 'CommCare_Code__c',
    fields(
    field('CommCare_Code__c', state => {
    return (
    dataValue('indices.parent.case_id')(state) ||
    dataValue('properties.parent_id')(state)
    )
    }),
    relationship('Head_of_Household__r', 'CommCare_ID__c', dataValue('properties.head_of_household_case_id')),
    )
    )

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28.html b/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28.html index c8c423fd56f..da77170a3c7 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28.html +++ b/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Q3 2022 Upsert Person Visit

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, join, map, query, relationship, upsertIf

    Expression

    //UPSERT PERSON VISIT
    query(
    `SELECT Id, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c FROM Location__c WHERE CommCare_User_ID__c = '${dataValue(
    'properties.owner_id'
    )(state)}'`
    );

    fn(state => {
    state.cleanChoice = function (state, choice) {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    };

    fn(state => ({
    ...state,
    data: {
    ...state.data,
    catchmentNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? (state.references[0].records[0].Parent_Geographic_Area__r
    ? state.references[0].records[0].Parent_Geographic_Area__r.Parent_Geographic_Area__c
    : undefined)
    : undefined,
    },
    }));

    state.handleMultiSelect = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value.charAt(0).toUpperCase() + value.slice(1).replace('_', ' ')
    );
    })
    .join(';')
    : '';
    };

    state.handleMultiSelectOriginal = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value
    );
    })
    .join(';')
    : '';
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const counselMap = {
    anc_visits: 'ANC Visits',
    early_initiation_of_anc_less_than_3_months:
    'Early initiation of ANC (less than 3 months)',
    completing_recomended_anc_visits: 'Completing recomended ANC visits',
    danger_signs: 'Danger signs',
    skilled_birth: 'Skilled birth',
    immunization: 'Immunization',
    individual_birth_plan: 'Individual Birth Plan',
    emergency_preparedness: 'Emergency preparedness',
    childcare_and_affection: 'Childcare and affection',
    nutrition_counseling: 'Nutrition counseling',
    growth_monitoring: 'Growth monitoring',
    exclusive_breastfeeding: 'Exclusive breastfeeding',
    complementary_feeding: 'Complementary feeding',
    sleeping_under_llitn: 'Sleeping under LLITN',
    knowing_hiv_status: 'Knowing HIV status',
    indoor_pollution: 'Indoor pollution',
    personal_hygiene: 'Personal Hygiene',
    safe_drinking_water: 'Safe drinking water',
    safe_disposal_of_human_waste: 'Safe disposal of human waste',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for other Ols',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const reasonMap = {
    lack_of_access_to_fp_information: 'Lack of access to FP information',
    no_access_to_fp_services_hospitals:
    'Lack of hospitals or places where FP services can be accessed',
    not_willing_to_use_fp_due_to_negative_effects_myths_and_misconceptions:
    'Myths and misconceptions',
    barriers_at_service_delivery_points: 'Barriers at service delivery points',
    pregnant: 'The client is pregnant',
    intentions_of_getting_pregnant: 'Intentions of getting pregnant',
    not_sexually_active: 'The client is not sexually active',
    other_barriers_culture_male_partners_parents_etc:
    'Other barriers (culture, male partners, parents, etc)',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays Learning Difficulties',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Delay Speech and Language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const milestoneMap = {
    movement: 'Movement',
    hearing: 'Hearing',
    communication: 'Communication',
    seeing: 'Seeing',
    cognitive_delays: 'Cognitive Delays',
    play: 'Play',
    };
    const nutritionMap = {
    severe: 'Severely Malnourished',
    moderate: 'Moderately Malnourished',
    normal: 'Normal',
    };

    const fpMethodMap = {
    male_condoms: "Male condoms",
    female_condoms: "Female condoms",
    pop: "POP",
    coc: "COC",
    emergency_pills: "Emergency pills",
    none: "None",
    //HMN -12/01/2023-
    //adding normalization for the family_planning_method to Family_Planning_Method__c
    iucd: "IUCD",
    condoms: "Condoms",
    depo:"Depo",
    implant: "Implant",
    injection: "Injection",
    pills: "Pills",
    traditional: "Traditional"
    };

    const symptomsMap = {
    convulsions: 'Convulsions',
    not_able_to_eatdrink: 'Not able to drink or feed at all',
    vomits_everything: 'Vomits everything',
    'chest_in-drawing': 'Chest in - drawing',
    unusually_sleepyunconscious: 'Unusually sleepy or unconscious',
    swelling_of_both_feet: 'Swelling of both feet',
    none: "None",
    };

    const supervisorMap ={
    community_health_nurse: "Community_health_nurse",
    chw_supervisor: "CHW_supervisor",
    chewschas: "Chewschas",
    other: "Other",
    none: "None"
    };

    const treatmentDistributionMap = {
    ors_205gltr_sachets: 'ORS (20.5h/ltr): Sachets',
    acts_6s: 'ACTs (6s)',
    acts_12s: 'ACTs (12s)',
    acts_18s: 'ACTs (18s)',
    acts_24s: 'ACTs (24s)',
    albendazole_abz_tabs: 'Albendazole (ABZ): Tabs',
    paracetamol_tabs: 'Tetracycline Eye Ointment (TEO): 1%:tube',
    tetracycline_eye_ointment_teo_1_tube: 'Tetracycline Eye Ointment (TEO): 1%:tube',
    amoxycillin: 'Amoxycillin (125mg/5mls: Bottle',
    none: 'None'
    };

    const childDangerSignsMap = {
    none: 'None',
    Poor_Breastfeeding: 'Poor Breastfeeding',
    not_able_to_feed_since_birth_or_stopped_feeding_well: 'Not able to feed since birth, or stopped feeding well',
    not_able_to_breastfeed: 'Not able to breastfeed',
    Fever: 'Fever',
    very_low_temperature: 'Very low temperature (35.4 C or less)',
    shivering: 'Shivering',
    Fast_Breathing: 'Fast Breathing',
    Very_Sleepy: 'Very Sleepy',
    Convulsions_and_Fits: 'Convulsions and Fits',
    only_moves_when_stimulated_or_does_not_move_even_on_stimulation: 'Only moves when stimulated, or does not move even on stimulation',
    yellow_solebaby_body_turning_yellow_especially_eyes_palms_soles: 'Yellow sole(Baby body turning yellow especially eyes, palms,soles)',
    bleeding_from_the_umbilical_stump: 'Bleeding from the umbilical stump',
    signs_of_local_infection_umbilicus_is_red_or_draining_pus_skin_boils_or_eye: 'Signs of local infection: umbilicus is red or draining pus, skin boils, or eyes draining pus',
    weight_chart_using_color_coded_scales_if_red_or_yellowweight_below_25kg_or_: 'Weight chart using color coded scales if RED or YELLOW(Weight below 2.5kg or born less than 36 weeks of age)',
    unable_to_cry: 'Unable to cry',
    cyanosis: 'Cyanosis',
    bulging_fontanelle: 'Bulging fontanelle'
    }

    return {
    ...state,
    counselMap,
    serviceMap,
    reasonMap,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    symptomsMap,
    supervisorMap,
    treatmentDistributionMap,
    childDangerSignsMap
    };
    });

    upsertIf(
    // state.data.properties.username !== 'openfn.test' &&
    state.data.properties.username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' ,
    'Person_visit__c',
    'CommCare_ID__c',
    fields(
    //field('CommCare_ID__c', dataValue('form.case.@case_id')),
    // field('CommCare_ID__c', dataValue('id')),
    //field('CommCare_ID__c', state => {
    // var case_id = dataValue('case_id')(state);
    // var submitted = dataValue('properties.last_form_opened_date_and_time')(state);
    // return case_id + '_' + submitted;
    //}),
    field('CommCare_ID__c',dataValue('case_id')),

    relationship(
    'Person__r',
    'CommCare_ID__c',
    dataValue('indices.parent.case_id')
    ),
    /*relationship(
    'Household_CHW__r',
    'CommCare_ID__c',
    dataValue('properties.sfid')),*/
    // field('CommCare_Visit_ID__c',dataValue('metadata.instanceID')),
    field('CommCare_Visit_ID__c', state => {
    var case_id = dataValue('case_id')(state);
    var submitted = dataValue('properties.last_form_opened_date_and_time')(state);
    return case_id + '_' + submitted;
    }),
    field('Date__c',dataValue('properties.Date')),
    field('Form_Submitted__c', dataValue('properties.last_form_opened_name')),
    field('Birth_Status__c',dataValue('properties.child_status')),
    field('Catchment__c', dataValue('catchmentNewId')),
    /*
    //HMN 05/01/2022 Caused alot of failures, removed this RecordType Field
    relationship('RecordType', 'Name', state => {
    var rt = dataValue('properties.RecordType')(state);
    if (rt === 'Unborn' || rt === 'Child') {
    return 'Child Visit';
    };
    if (rt === 'Youth') {
    return 'Youth Visit';
    };
    if (rt === 'Male Adult') {
    return 'Adult Male Visit';
    };
    if (rt === 'Female Adult') {
    return 'Adult Female Visit';
    };
    }),*/
    field('Use_mosquito_net__c', state => {
    var choice = dataValue(
    'properties.sleep_under_net'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'Individual_birth_plan_counselling__c',
    dataValue('properties.individual_birth_plan')
    ),
    field('Reason_for_not_taking_a_pregnancy_test__c', state => {
    var reason = dataValue('properties.No_Preg_Test')(state);
    return reason ? reason.toString().replace(/_/g, ' ') : undefined;
    }),
    field('Pregnancy_danger_signs__c', state => {
    var signs = dataValue(
    'properties.No_Preg_Test'
    )(state);
    return signs ? state.pregDangerMap[signs] : undefined;
    }),
    field('Child_Danger_Signs__c', state => {
    var signs = dataValue(
    'properties.Other_Danger_Signs'
    )(state);
    return signs ? state.childDangerSignsMap[signs] : undefined
    }),
    field('Current_Malaria_Status__c', state => {
    var choice = dataValue(
    'properties.malaria_test_results'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Malaria_Home_Test__c', dataValue('properties.malaria_test_date')),
    /*field('Current_Malaria_Status__c', state => {
    var choice = dataValue(
    'properties.Malaria_Status'
    )(state);
    return state.cleanChoice(state, choice);
    }),*/
    // field('Malaria_Home_Treatment__c',dataValue('form.treatment_and_tracking.home_treatment')),
    field('Malaria_Home_Treatment__c', dataValue('properties.malaria_test_date')),
    field('Persons_symptoms__c', state => {
    var check = dataValue('properties.symptoms_check_other')(state);
    var value =
    check && check !== ''
    ? check
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.symptomsMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Active_in_Support_Group__c', dataValue('properties.Active_in_Support_Group')),
    field('HAWI_Defaulter__c', state => {
    var hawi = dataValue('properties.default')(state);
    return hawi === 'Yes' ? true : false;
    }),
    field(
    'Date_of_Default__c',
    dataValue('properties.date_of_default')
    ),
    field(
    'Persons_temperature__c',
    dataValue('properties.temperature')
    ),
    field(
    'Days_since_illness_start__c',
    dataValue('properties.duration_of_sickness')
    ),
    field(
    'Newborn_visited_48_hours_of_delivery__c',
    dataValue(
    'properties.newborn_visited_48_hours_of_delivery'
    )
    ),
    field(
    'Newborn_visited_by_a_CHW_within_6_days__c',
    dataValue('properties.visit_6_days_from_delivery')
    ),
    field(
    'Current_Malaria_Status__c',
    dataValue('properties.malaria_test_results')
    ),
    field('Malaria_test__c', state => {
    var choice = dataValue(
    'properties.malaria_test'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Fever__c', state => {
    var choice = dataValue(
    'properties.symptoms_check_fever'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Cough__c', state => {
    var choice = dataValue(
    'properties.symptoms_check_cough'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Diarrhoea__c', state => {
    var choice = dataValue(
    'properties.symptoms_check_diarrhea'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'TB_patients_therapy_observed__c',
    dataValue('properties.observed_tb_therapy')
    ),
    field(
    'Injuries_or_wounds__c',
    dataValue('properties.wounds_or_injuries')
    ),
    field('Currently_on_ART_s__c', dataValue('properties.ART')),
    /*field('ART_Regimen__c', state => {
    var choice = dataValue(
    'properties.ARVs'
    )(state);
    return state.cleanChoice(state, choice);
    }),*/
    field(
    'Immediate_Breastfeeding__c',
    dataValue(
    'properties.Breastfeeding_Delivery'
    )
    ),
    field(
    'Exclusive_Breastfeeding__c',
    dataValue(
    'properties.Exclusive_Breastfeeding'
    )
    ),
    field(
    'Counselled_on_Exclusive_Breastfeeding__c',
    dataValue('properties.counseling')
    ),
    field('LMP__c',dataValue('properties.when_was_your_lmp')),
    field('Family_Planning__c', state => {
    var choice = dataValue(
    'properties.family_planning'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    //HMN 12/01/2023 Failures on picklist within Salesforce
    /*
    field(
    'Family_Planning_Method__c',
    dataValue('properties.family_planning_method')
    ),*/
    field('Family_Planning_Method__c', state => {
    //var status = dataValue('form.treatment_and_tracking.distribution.distributed_treatments')(state);
    var status = dataValue('properties.family_planning_method')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.fpMethodMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('FP_Method_Distributed__c', state => {
    //var status = dataValue('form.treatment_and_tracking.distribution.distributed_treatments')(state);
    var status = dataValue('properties.FP_commodity')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.fpMethodMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Reasons_for_not_taking_FP_method__c', state => {
    // var reason = dataValue('form.TT5.Mother_Information.No_FPmethod_reason')(state);
    // return reason ? state.reasonMap[reason] : undefined;
    var status = dataValue('properties.No_FPmethod_reason')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.reasonMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Pregnant__c', state => {
    var preg = dataValue('properties.Pregnant')(state);
    return preg === 'Yes' ? true : false;
    }),
    field('Counselled_on_FP_Methods__c', state => {
    var choice = dataValue(
    'properties.CounselledFP_methods'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Client_counselled_on__c', state => {
    var choices =
    dataValue('properties.counsel_topic')(
    state
    ) || dataValue('properties.counsel_topic')(state);
    var choiceGroups = choices ? choices.split(' ') : null;
    var choicesMulti = choiceGroups
    ? choiceGroups
    .map(cg => {
    return state.counselMap[cg];
    })
    .join(';')
    : choiceGroups;
    return choicesMulti;
    }),
    field('Client_provided_with_FP__c', state => {
    var choice = dataValue(
    'properties.was_the_woman_15-49yrs_provided_with_family_planning_commodities_by_chv'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'Newborn_visited_48_hours_of_delivery__c',
    dataValue(
    'properties.newborn_visited_48_hours_of_delivery'
    )
    ),
    field('Mother_visit_counselling__c', state => {
    var choice = dataValue(
    'properties.did_you_consel_the_mother_on1'
    )(state);
    return state.handleMultiSelectOriginal(state, choice);
    }),
    field(
    'mother_visited_48_hours_of_the_delivery__c',
    dataValue('properties.visit_mother_48')
    ),
    field('Newborn_visit_counselling__c', state => {
    var choice = dataValue(
    'properties.did_you_consel_the_mother_on2'
    )(state);
    return state.handleMultiSelectOriginal(state, choice);
    }),
    field('Know_HIV_status__c', state => {
    var choice = dataValue(
    'properties.known_hiv_status'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('HIV_Status__c', dataValue('properties.hiv_status')),
    field('Treatment_Distribution__c', state => {
    //var status = dataValue('form.treatment_and_tracking.distribution.distributed_treatments')(state);
    var status = dataValue('properties.distributed_treatments')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.treatmentDistributionMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field(
    'Current_Weight__c',
    dataValue('properties.Current_Weight')
    ),
    field(
    'Current_Height__c',
    dataValue('properties.current_height')
    ),
    field(
    'Current_MUAC__c',
    dataValue('properties.MUAC')
    ),
    field('Food_groups_3_times_a_day__c',dataValue('properties.food_groups')),
    field('Nutrition_Case_Managed__c',dataValue('properties.nutrition_case_managed')),
    field('Nutrition_Danger_Signs__c',state => {
    var choice = dataValue(
    'properties.nutrition_danger_signs'
    )(state);
    return state.handleMultiSelectOriginal(state, choice);

    }),
    field('Why_was_nutrition_case_not_managed__c',dataValue('properties.nutrition_case_not_managed_why')),
    field('Community_Nutrition_Treatment__c',dataValue('properties.nutrition_treatment_severe')),
    field('Community_Nutrition_Treatment__c',dataValue('properties.nutrition_treatment_moderate')),
    field('Why_was_nutrition_treatment_not_given__c',dataValue('properties.nutrition_treatment_not_given')),
    field('Current_Nutrition_Status__c', state => {
    var status = dataValue(
    'properties.Nutrition_Status'
    )(state);
    return status ? state.nutritionMap[status] : undefined;
    }),
    field('Default_on_TB_treatment__c', state => {
    var choice = dataValue(
    'properties.default_tb_treatment'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Received_pregnancy_test__c', state => {
    var choice = dataValue(
    'properties.did_you_adminsiter_a_pregnancy_test'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Pregnancy_test_result__c', state => {
    var choice = dataValue(
    'properties.pregnancy_test_result'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Chronic_illness__c', state => {
    var choice = dataValue(
    'properties.please_specify_which_chronic_illness_the_person_has'
    )(state);
    var choice2 = state.handleMultiSelect(state, choice);
    return choice2 ? choice2.replace(/_/g, ' ') : '';
    }),
    /*field(
    'Birth_Certificate__c',
    dataValue('form.Status.birth_certificate')
    ),
    field(
    'Child_zinc__c',
    dataValue(
    'form.TT5.Child_Information.Clinical_Services.diarrhea_clinic_treatment_zinc'
    )
    ),
    field(
    'Child_ORS__c',
    dataValue(
    'form.TT5.Child_Information.Clinical_Services.diarrhea_clinic_treatment_ORS'
    )
    ),*/
    field(
    'Childs_breath_per_minute__c',
    dataValue('properties.breaths_per_minuite')
    ),
    field(
    'Child_chest_in_drawing__c',
    dataValue('properties.Child_chest_in_drawing_c')
    ),
    field(
    'Caregiver_counseled_on_delayed_milestone__c',
    dataValue(
    'properties.did_you_counsel_the_caregiver_on_delayed_milestones'
    )
    ),
    field(
    'Delayed_Milestone__c',
    dataValue(
    'properties.does_the_child_has_a_delayed_milestone'
    )
    ),
    field(
    'Child_has_2_or_more_play_items__c',
    dataValue(
    'properties.does_the_child_has_2_or_more_play_items_at_home'
    )
    ),
    field(
    'Child_has_3_more_picture_books__c',
    dataValue(
    'properties.does_the_child_has_3_or_more_picture_books'
    )
    ),
    field('Delayed_Milestones_Counselled_On__c', state => {
    var ms = dataValue(
    'properties.which_delayed_milestone_area_did_you_counsel_the_caregiver_on'
    )(state);
    return ms ? state.milestoneMap[ms] : undefined;
    }),
    field('Delayed_Milestone_Type__c', state => {
    var ms = dataValue('properties.which_delayed_milestone')(
    state
    );
    return ms ? state.milestoneTypeMap[ms] : undefined;
    }),
    field(
    'Caretaker_trained_in_muac__c',
    dataValue('properties.mother_trained_muac')
    ),
    field(
    'Caretaker_screened_for_muac_this__c',
    dataValue(
    'properties.mother_screened_child_muac'
    )
    ),
    field(
    'Caretaker_muac_findings__c',
    dataValue(
    'properties.mother_screened_child_muac_result'
    )
    ),
    field(
    'Caretaker_action_after_muac_screening__c',
    dataValue(
    'properties.mother_screened_muac_action'
    )
    ),
    field(
    'of_Caretaker_MUAC_screenings__c',
    dataValue('properties.mother_nb_screening')
    ),
    field('Pulse_Oximeter__c', dataValue('properties.pulse_oximeter_available')),
    field(
    'Heart_Rate_Pulse_Oximeter__c',
    dataValue('properties.heart_rate_pulse_oximeter')
    ),
    field(
    'Oxygen_Concentration_Pulse_Oximeter__c',
    dataValue('properties.oxygen_concentration')
    ),
    field('Can_child_drink__c', dataValue('properties.can_child_drink')),
    field(
    'Antibiotic_provided_for_fast_breathing__c',
    dataValue('properties.antibiotic_fast_breathing')
    ),
    field(
    'Antibiotic_provided_for_chest_indrawing__c',
    dataValue('properties.antibiotic_chest_indrawing')
    ),
    field('Supervisor_Visit__c', state => {
    var check = dataValue('properties.supervisor_visit')(state);
    var value =
    check && check !== ''
    ? check
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.supervisorMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    /*
    //HMN- 05012023 - Removed field('Visit_Closed_Date__c', dataValue('date_closed')),
    //Because I could not find it in Salesforce. It was causing errors on staging
    field('Visit_Closed_Date__c', dataValue('date_closed')),
    */
    //field('Case_Closed_Date__c', state => {
    // var closed = dataValue('date_closed')(state);
    // var date = dataValue('date_modified')(state);
    // return closed && closed == true ? date : undefined;
    // })
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22.html b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22.html index e4fb5409e71..6590d615dcd 100644 --- a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22.html +++ b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Q4 2022 Upsert Supervision - Accompaniment

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert, upsertIf

    Expression

    //Job to integrate CommCare 'Accompaniement' form from the Supervision App.
    fn(state => {
    state.handleMultiSelect = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /g, ';')
    : '';
    };

    state.cleanChoice = function (state, choice) {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    }

    return {
    ...state
    };

    });


    upsert(
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    fields(
    field('CommCare_Form_ID__c', dataValue('id')),
    relationship('RecordType', 'Name', 'Accompanient Form'),
    field('Supervisor_Name__c', dataValue('form.prologue.supervisor_sfid')),
    field('CHW_Name__c', dataValue('form.prologue.chw_sfid')),
    relationship(
    'Village__r',
    'CommCare_User_ID__c',
    dataValue('form.prologue.chw_village')
    ),
    field('Form_Date__c',dataValue('form.Date')),
    field('Fertile_Women_in_Household__c',dataValue('form.WRA_check')),
    field('CHW_Asked_About_Family_Planning__c',dataValue('form.women_of_reproductive_age.fp_check')),
    field('Contraception_Distributed__c', state => {
    var choice = dataValue(
    'form.women_of_reproductive_age.fp_resources_check'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),


    field('Household_members_aware_of_CHW_SRH__c',dataValue('form.women_of_reproductive_age.srh_awareness_check')),
    field('Pregnant_Women_in_HH__c',dataValue('form.pregnancy_check')),
    field('CHW_Asked_About_ANC_Visits__c',dataValue('form.pregnant_women.anc_check')),
    field('CHW_Counseled_On_Value_of_ANC_Visits__c',dataValue('form.pregnant_women.anc_counsel_check')),
    field('CHW_Read_Each_Pregnancy_Danger_Sign__c',dataValue('form.pregnant_women.danger_sign_check')),
    field('Household_aware_of_CHW_MCH_Services__c',dataValue('form.pregnant_women.pregnancy_support_awareness_check')),
    field('Pregnant_Woman_Delivered__c',dataValue('form.pregnant_women.delivery_check')),
    field('Used_MCH_Booklet__c',dataValue('form.delivery.vaccination_check')),
    field('Counsel_on_vaccination_schedule__c',dataValue('form.delivery.vaccination_counsel_check')),
    field('Counselled_on_Exclusive_Breastfeeding__c',dataValue('form.delivery.ebf_check')),
    field('Children_Under_5_in_Household__c',dataValue('form.cu5_check')),
    field('All_children_under_5_registered__c',dataValue('form.children_under_5.cu5_enrollment_check')),
    field('MUAC_taken_for_all_children__c',dataValue('form.children_under_5.muac_check')),
    field('Measured_MUAC_circumference_properly__c',dataValue('form.children_under_5.muac_method_check')),
    // field('Measured_MUAC_circumference_properly__c', state => {
    // var choice = dataValue(
    // 'form.children_under_5.muac_method_check'
    // )(state);
    // return state.cleanChoice(state, choice);
    // }),
    field('HIV_Members_in_the_Household__c',dataValue('form.hiv_check')),
    field('Recorded_HIV_Status_Information__c',dataValue('form.hiv_clients.hiv_info_check')),
    field('Counselled_on_ART_Adherence_HIV_Services__c',dataValue('form.hiv_clients.hiv_counsel_check')),
    field('Sick_Household_Members_at_Visit__c',dataValue('form.illness_check')),
    field('Household_member_reported_fever__c',dataValue('form.illness_referrals.fever_check')),
    field('Conducted_malaria_home_test__c', dataValue('form.illness_referrals.malaria_test_check')),
    field('Malaria_test_protocol_followed__c',dataValue('form.illness_referrals.malaria_test_method_check')),
    field('Sick_person_referred__c',dataValue('form.illness_referrals.referral_accompaniment_check')),
    field('Referral_discussed_with_family__c',dataValue('form.illness_referrals.referral_followup_check')),
    field('Distributed_treatments_medications__c',dataValue('form.distribution_check')),
    field('Stock_is_full__c',dataValue('form.stocks_check')),
    field('Missing_Stock__c', state => {
    var choice = dataValue(
    'form.missing_stocks_details'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('Other_Missing_Stock__c',dataValue('form.missing_stocks_details_other')),
    field('Demonstrated_active_listening__c',dataValue('form.chw_behavior.active_listening_check')),
    field('Acted_with_respect_courtesy__c',dataValue('form.chw_behavior.respect_check')),
    field('CHW_Rating__c',dataValue('form.chw_behavior.interview_technique_check')),
    field('Tablet_used__c',dataValue('form.chw_behavior.tablet_use_check')),
    field('Tablet_used_effectively__c',dataValue('form.chw_behavior.tablet_competency_check')),
    field('Tablet_problem_observed__c', state => {
    var choice = dataValue(
    'form.chw_behavior.tablet_issues'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('Visit_Length_Mins__c',dataValue('form.visit_length')),
    field('Accompanient_components_covered__c', state => {
    var choice = dataValue(
    'form.feedback_type'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('Other_comments__c',dataValue('form.supervisor_comments')),
    field('Contraception_Distributed__c', state => {
    var choice = dataValue(
    'form.women_of_reproductive_age.fp_resources_check'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    )
    );

    upsertIf(
    state.data.form.prologue.hh_code !== '' &&
    state.data.form.prologue.hh_code !== null,
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    relationship('Household_Code__r',
    'Name',
    dataValue('form.prologue.hh_code')
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19.html b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19.html index 6b3766bb30c..15eba851b97 100644 --- a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19.html +++ b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Q4 2022 Upsert Supervision - Feedback

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert

    Expression

    //Job to integrate CommCare 'Feedback' form from the Supervision App

    upsert(
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    fields(
    field('CommCare_Form_ID__c', dataValue('id')),
    relationship('RecordType', 'Name', 'Feedback Form'),
    field('Supervisor_Name__c', dataValue('form.prologue.supervisor_sfid')),
    field('CHW_Name__c', dataValue('form.prologue.chw_sfid')),
    relationship(
    'Village__r',
    'CommCare_User_ID__c',
    dataValue('form.prologue.chw_village')
    ),
    relationship('Catchment__r',
    'Name',
    dataValue('form.prologue.catchment')
    ),
    field('Form_Date__c',dataValue('form.Date')),
    field('Strengths__c', dataValue('form.chw_perspectives_and_reflections.chw_strengths')),
    field('Weaknesses__c', dataValue('form.chw_perspectives_and_reflections.chw_improvement_areas')),
    field('Challenges__c', dataValue('form.chw_perspectives_and_reflections.chw_challenges')),
    field('Solutions__c', dataValue('form.chw_perspectives_and_reflections.chw_improvement_areas')),
    field('of_Household_Visit_As_Expected__c', dataValue('form.supervision_dashboard_feedback.hh_visits_check')),
    field('of_Household_Visit_Explanation__c',dataValue('form.supervision_dashboard_feedback.hh_visits_explanation')),
    field('of_Priority_Clients_as_Expected__c', dataValue('form.supervision_dashboard_feedback.priority_hh_visits_check')),
    field('of_Priority_Clients_Explanation__c',dataValue('form.supervision_dashboard_feedback.priority_hh_visits_explanation')),
    field('Feedback_on_Indicators__c',dataValue('form.supervision_dashboard_feedback.chw_sd_feedback')),
    field('CHW_Strengths__c',dataValue('form.supervisor_perspectives_and_reflections.chw_strengths_supervisor')),
    field('CHW_Areas_for_Improvement__c',dataValue('form.supervisor_perspectives_and_reflections.chw_improvement_areas_supervisor')),
    field('CHW_Immediate_Solutions__c',dataValue('form.supervisor_perspectives_and_reflections.chw_solutions_supervisor')),
    field('Other_Recommendations__c',dataValue('form.supervisor_perspectives_and_reflections.chw_recommendation_other_supervisor')),
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24.html b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24.html index bd7bca54fb5..c09839be4d9 100644 --- a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24.html +++ b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Q4 2022 Upsert Supervision - Household Spot Check

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Q4 2022 Upsert Supervision - Household Spot Check
    • Adaptor: @openfn/language-salesforce
    • Adaptor Version: latest
    • Created about 2 years ago
    • Updated 6 months ago
    • Score: 18 (an indicator of how useful this job may be)

    Key Functions

    dataValue, field, fields, relationship, upsert, upsertIf

    Expression

    //Job to integrate CommCare 'Household Spotcheck' form from the Supervision App
    fn(state => {
    state.handleMultiSelect = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /g, ';')
    : '';
    };
    return {
    ...state
    };
    });


    upsert(
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    fields(
    field('CommCare_Form_ID__c', dataValue('id')),
    relationship('RecordType', 'Name', 'Household Spotcheck Form'),
    // relationship('Household_Code__r',
    //'Name',
    //dataValue('form.prologue.hh_code')
    // ),
    field('Supervisor_Name__c', dataValue('form.prologue.spot_checker_sfid')),
    field('CHW_Name__c', dataValue('form.prologue.chw_sfid')),
    relationship(
    'Village__r',
    'CommCare_User_ID__c',
    dataValue('form.prologue.village')
    ),
    relationship('Catchment__r',
    'Name',
    dataValue('form.prologue.catchment')
    ),
    field('Form_Date__c',dataValue('form.Date')),
    field('CHW_Name_Identified__c',dataValue('form.chw_awareness.chw_name_reported')),
    field('Knows_where_CHW_lives__c',dataValue('form.chw_awareness.chw_location_confirmation')),
    field('Knows_CHW_contact_number__c',dataValue('form.chw_awareness.chw_contact_number')),
    field('CHW_paid_for_services__c',dataValue('form.chw_awareness.service_fee')),
    field('CHW_Visit_Frequency__c',dataValue('form.chw_awareness.chw_visit_frequency')),
    field('Household_member_reported_fever__c',dataValue('form.iccm.fever_management')),
    field('details_on_chw_conduct__c',dataValue('form.chw_behavior.chw_conduct_detail')),
    field('Tablet_used__c',dataValue('form.chw_behavior.tablet_use_check')),
    field('Other_Recommendations__c',dataValue('form.community_comments.community_recommendations_detail')),
    field('Other_comments__c',dataValue('form.community_comments.do_you_have_any_other_comments_at_this_time')),
    field('CHW_tested_treated_child_for_malaria__c',dataValue('form.iccm.malaria_management')),
    field('If_so_when_Within_the__c',dataValue('form.iccm.malaria_management_timeline')),
    field('CHW_ever_managed_your_child_for_diarrhea__c',dataValue('form.iccm.diarrhea_management')),
    field('CHW_measured_child_s_arm_past_90_days__c',dataValue('form.iccm.muac_check')),
    field('CHW_ever_managed_child_for__c',dataValue('form.iccm.pneumonia_management')),
    field('rate_the_quality_of_services__c',dataValue('form.iccm.chw_service_quality')),
    field('CHW_revisit__c',dataValue('form.referrals_and_follow-up_visits.follow_up_check_1')),
    field('follow_up_within_3_days_of_initial_visit__c',dataValue('form.referrals_and_follow-up_visits.follow_up_check_2')),
    field('does_CHW_revisit_child_for_follow_up__c',dataValue('form.referrals_and_follow-up_visits.follow_up_check_3')),
    field('when_child_is_sick__c',dataValue('form.referrals_and_follow-up_visits.follow_up_check_4')),
    field('CHW_conduct__c',dataValue('form.chw_behavior.chw_conduct_check')),
    field('comfortable_sharing_sensitive_info__c',dataValue('form.chw_behavior.sensitive_info_check')),
    field('Please_explain__c',dataValue('form.chw_behavior.sensitive_info_detail')),
    field('Does_your_CHW_listen_to_your_perspective__c',dataValue('form.chw_behavior.listening_check')),
    field('ever_experienced_a_problem_with_CHW__c', dataValue('form.chw_behavior.problem_check')),
    field('describe_problem_experienced_with_CHW__c',dataValue('form.chw_behavior.problem_detail')),
    field('any_recommendations_for_impr__c',dataValue('form.community_comments.community_recommendations')),
    field('How_was_the_fever_managed__c', state => {
    var choice = dataValue(
    'form.iccm.fever_management_detail'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('How_was_the_malaria_managed__c', state => {
    var choice = dataValue(
    'form.iccm.malaria_management_detail'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('How_did_she_he_manage_the_diarrhea__c', state => {
    var choice = dataValue(
    'form.iccm.malaria_management_detail'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('How_did_she_he_manage_the_pneumonia__c', state => {
    var choice = dataValue(
    'form.iccm.pneumonia_managemnt_detail'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('COHORT_ONE_Maternal_and_Child_Health__c', state => {
    var choice = dataValue(
    'form.chw_service_provision.cohort_one'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('COHORT_TWO_Childcare__c', state => {
    var choice = dataValue(
    'form.chw_service_provision.cohort_two'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('COHORT_THREE_WASH_and_Nutrition__c', state => {
    var choice = dataValue(
    'form.chw_service_provision.cohort_three'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('COHORT_FOUR_FIVE_Sexual_Reproductive__c', state => {
    var choice = dataValue(
    'form.chw_service_provision.cohort_four_-_five'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    )
    );

    upsertIf(
    state.data.form.prologue.hh_code !== '' &&
    state.data.form.prologue.hh_code !== null,
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    relationship('Household_Code__r',
    'Name',
    dataValue('form.prologue.hh_code')
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02.html b/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02.html index 70fff9ff0b3..7a631c00cfa 100644 --- a/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02.html +++ b/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Register Participant - V2 Skillz

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    query(`SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`);

    alterState(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);

    function objectToArray(object) {
    return !Array.isArray(object) ? [object] : object;
    }

    // if (state.data.form.question1) {
    // console.log('Ensuring that "question1" is an array.');
    // state.data.form.question1 = objectToArray(state.data.form.question1);
    // } else {
    // console.log('Shifting "new_participants" to "question1" array.');
    // state.data.form.question1 = objectToArray(state.data.form.new_participants);
    // console.log('Creating a "case" object inside each item in that array.');
    // state.data.form.question1 = state.data.form.question1.map(item => ({
    // ...item,
    // case: item.create_skillz_plus_participant.case,
    // }));
    // }

    console.log('Done with initial data manipulation.');

    return state;
    });

    // beta.each(
    // merge(
    // dataPath('form.question1[*]'),
    // fields(
    // field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))
    // ),

    upsert(
    'Person__c',
    'Participant_Identification_Number_PID__c',
    fields(
    field('Notes__c', dataValue('form.intervention_notes_to_save')),
    field('First_Name__c', dataValue('form.new_participants.participant_first_name')),
    field('Surname__c', dataValue('form.new_participants.participant_surname')),
    relationship('RecordType', 'Name', 'Participant'),
    field('Participant_Identification_Number_PID__c', state => state.data.form.new_participants.create_skillz_plus_participant.case['@case_id']),
    field('Sex__c', dataValue('gender')),
    field('Mobile_Number_1__c', dataValue('form.new_participants.mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?
    field('School_name_person__c', dataValue('form.new_participants.school_name')),
    field('Date_of_Birth__c', dataValue('date_of_birth')),
    field('School_name_person__c', dataValue('form.new_participants.school_name')),
    field('Physical_Address__c', dataValue('form.new_participants.participants_home_address'))
    //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    )
    )
    //);

    // each(
    // merge(dataPath('form.question1[*]'), fields(
    // field('intervention_name', dataValue('form.intervention_name')),
    // field('eventName', dataValue('eventName')))),
    upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', state => {
    var eventid = `${state.data.eventName}` || dataValue('form.intervention_name')(state);
    var personid = state.data.form.new_participants.create_skillz_plus_participant.case['case_id'];//state.data.case['@case_id'];
    return personid + '-' + eventid;
    }),
    relationship(
    //Attendance looks up to Persn via the case_id
    'Person_Attendance__r',
    'Participant_Identification_Number_PID__c',
    state => state.data.case['@case_id']
    ),
    relationship(
    //Attendance looks up to Event via the intervention_name
    'Event__r',
    'CommCare_Case_ID__c',
    state.data.form.new_participants.create_skillz_plus_participant.case.index.parent['#text']
    ),
    field('Date_of_Birth__c', dataValue('form.new_participants.date_of_birth'))
    )
    )
    //);
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html b/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html index 475aaccf8a6..54dce1984d3 100644 --- a/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html +++ b/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Register Patient

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    appendValues, JSON

    Expression

    appendValues({
    spreadsheetId: '1EFkY4zD4qqxnJdH-QaeasKd1zXC-1sNKpEg08W-3sT0',
    range: 'COVID-19 Cases!A2',
    values: state => {
    const kobo = state.data.body;

    console.log('Submission data: ' + JSON.stringify(kobo, null, 2));

    return [
    [
    kobo['National_ID'],
    kobo['Patient_name'],
    kobo['Last_Name_of_Patient'],
    kobo['Sex'],
    kobo['Age'],
    kobo['Comments'],
    Date(),
    ],
    ];
    },
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Registration-forms-new-case-2023-06-22.html b/adaptors/library/jobs/auto/Registration-forms-new-case-2023-06-22.html index 42e618b79b0..a584ff4b518 100644 --- a/adaptors/library/jobs/auto/Registration-forms-new-case-2023-06-22.html +++ b/adaptors/library/jobs/auto/Registration-forms-new-case-2023-06-22.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11.html b/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11.html index 3637a5a2a3d..451088ae66b 100644 --- a/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11.html +++ b/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Request Vitas Sync

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Request Vitas Sync
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created over 3 years ago
    • Updated almost 3 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, dataPath, dataValue, each, post

    Expression

    alterState(state => {
    const vitasSystemsToCheck = [
    'vitas-1',
    'thatMinistry-vitas-7',
    '3',
    '4',
    '5',
    ]
    return { ...state, data: { vitasSystemsToCheck } };
    });

    each(
    dataPath('vitasSystemsToCheck[*]'),
    post(state.configuration.inboxUrl, {
    body: { "db": dataValue('database-id') },
    })
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27.html b/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27.html index df65f9cce69..5f8d2723585 100644 --- a/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27.html +++ b/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Risk and Vulnerability Assessment

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, upsert

    Expression

    // Your job goes here. Testing github
    alterState(state => {
    function checked(key, str) {
    if (!str) return false;
    return str.toString().split(' ').indexOf(key) >= 0;
    }

    function capitalizeFirstLetter(str) {
    if (!str) return;
    let new_str = str.toString().toLowerCase();
    return new_str.slice(0, 1).toUpperCase() + new_str.slice(1);
    }

    function transformDont(str) {
    if (!str) return str;
    return str
    .toString()
    .split('_')
    .map(word => word.replace(/dont/i, "don't"))
    .join('_')
    .toString()
    .trim();
    }

    function transformCant(str) {
    if (!str) return str;
    return str
    .toString()
    .split('_')
    .map(word => word.replace(/cant/i, "can't"))
    .join('_')
    .toString()
    .trim();
    }

    function splitAndJoin(str, splitDelimiter, joinDelimiter) {
    if (!str) return;

    return str.toString().split(splitDelimiter).join(joinDelimiter).toString().trim();
    }

    function transformHowOften(str) {
    if (!str) return;
    if (str === 'special_occasions') return 'Special Occasions';
    return transformGenericText(str).toString().trim();
    }

    function transformHIVStatus(status) {
    switch (status) {
    case 'yes_negative':
    return 'Yes,Negative';
    case 'yes_positive':
    return 'Yes,Positive';
    case 'no_i_dont':
    return "No,I don't know";
    case 'yes_dont_want_to_disclose':
    return "Yes, don't want to disclose";
    default:
    return;
    }
    }

    function transformLastTested(str) {
    if (!str) return;
    switch (str.toString()) {
    case 'yes_negative':
    return 'Yes,Negative';
    case 'yes_positive':
    return 'Yes,Positive';
    case 'no_i_dont':
    return "No,I don't know";
    case 'yes_dont_want_to_disclose':
    return "Yes, don't want to disclose";
    default:
    return;
    }
    }

    function transformMonthAgo(str) {
    if (!str) return;
    switch (str) {
    case 'month_ago':
    return '1 month ago';
    case 'months_ago':
    return '3 months ago';
    case 'month_ago':
    return 'copy-1-of-months_ago ';
    case 'month_ago':
    return '6 months ago';
    case 'a_year_or_more_ago':
    return 'A year or more';
    default:
    return;
    }
    }

    function transformGenericText(str) {
    if (!str) return;
    return capitalizeFirstLetter(splitAndJoin(transformDont(str), '_', ' '))
    .toString()
    .trim();
    }

    function transformRange(range) {
    if (!range) return;
    return range
    .toString()
    .replace(/\d_\d/i, match => match.replace('_', '-'))
    .toString()
    .trim();
    }

    function transformAgeRange(range) {
    if (!range) return;
    if (range === '10_years') return '< 10 years';
    if (range === 'greater_than_19') return '> 19 years';
    return capitalizeFirstLetter(transformDont(transformCant(splitAndJoin(transformRange(range), '_', ' '))))
    .toString()
    .trim();
    }

    function transformAbuseExperienced(str) {
    if (!str) return;
    return str
    .split(' ')
    .map(word => capitalizeFirstLetter(word))
    .join(' ')
    .toString()
    .trim();
    }

    function getAge(dateString) {
    if (!dateString) return;

    const today = new Date();
    const birthDate = new Date(dateString);
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age--;
    }
    return age;
    }

    state.data.perform_a_risk_assessment = state.data.form.do_you_want_to_perform_a_risk_assessment === 'yes';

    state.data.complete_service_referrals = state.data.form.referral_services ? true : false;

    state.data.form.hidden_properties.gender =
    capitalizeFirstLetter(state.data.form.hidden_properties.gender);

    state.helperFunctions = {
    checked,
    transformAgeRange,
    transformHIVStatus,
    transformLastTested,
    transformMonthAgo,
    transformGenericText,
    transformDont,
    splitAndJoin,
    transformHowOften,
    transformAbuseExperienced,
    getAge,
    };
    return state;
    });

    upsert(
    'Risk_Assessment__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    field('Date__c', dataValue('form.date')),
    field('Participant_Name__c', state => {
    var firstname = state.data.form.hidden_properties.praticipant_first_name;
    var lastname = state.data.form.hidden_properties.participant_surname;
    return firstname + ' ' + lastname;
    }),
    field('Participant_Age__c', state => {
    const dob = dataValue('form.hidden_properties.date_of_birth')(state);

    return state.helperFunctions.getAge(dob);
    }),
    field('Participant_Sex__c', dataValue('form.hidden_properties.gender')),
    field('X1_0_Sexually_Active_past_12_month__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.sexually_active_12_months')(state)
    )
    ),
    field('X1_1_Age_at_first_sex__c', state =>
    state.helperFunctions.transformAgeRange(
    dataValue('form.sexual_risk_and_pregnancy.age_at_first_sex')(state)
    )
    ),
    field('X1_2_Have_you_ever_had_unprotected_sex__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.have_you_ever_had_unprotected_sex')(state)
    )
    ),
    field('X1_3_Sex_for_monetary_or_material_benefi__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.sex_monetary_material')(state)
    )
    ),
    field('Do_you_know_your_HIV_status__c', state =>
    state.helperFunctions.transformHIVStatus(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.do_you_know_your_hiv_status')(state)
    )
    ),
    field('X2_1_When_last_did_you_test_for_HIV__c', state =>
    state.helperFunctions.transformMonthAgo(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.when_last_did_you_test_for_hiv')(state)
    )
    ),
    field('X2_2_Are_you_on_treatment_ART__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.are_you_on_treatment_art')(state)
    )
    ),
    field('X3_0_Had_an_STI_in_the_last_12months_yea__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.hiv_last_12_months')(state)
    )
    ),
    field('X3_1_Past_12_months_sex_HIV_status_part__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.knowing_partners_hiv_status')(state)
    )
    ),
    //PENDING Donny change data type in SF
    // field('X4_0_Forms_of_abuse_experienced_before__c', state =>
    // state.helperFunctions.transformAbuseExperienced(
    // dataValue('form.risk_assessment.gender_based_violence.abuse_experienced')(state)
    // )
    // ),
    field('X4_1_Feel_unsafe_any1_interact_with_ofte__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.unsafe_with_others')(state)
    )
    ),
    field('X4_2_Of_what_relationship_person_to_you__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.relationship_of_abuser')(state)
    )
    ),
    field('X5_0_Do_you_take_alcohol_or_drugs__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.do_you_take_alcohol_andor_drugs')(state)
    )
    ),
    field('X5_1_On_average_how_often_drink_alcohol__c', state =>
    state.helperFunctions.transformHowOften(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.how_often_alcohol')(state)
    )
    ),
    field('X5_2_On_average_how_often_take_drugs__c', state =>
    state.helperFunctions.transformHowOften(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.how_often_drugs')(state)
    )
    ),
    field('X5_3_Easy_for_teens_to_obtain_alcohol__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.alcohol_19')(state)
    )
    ),
    field('X5_4__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.illegal_drugs_19')(state)
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30.html index fa9a8d89287..3e496880ad3 100644 --- a/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert ART Adherence Self-Reporting Tool

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, upsert

    Expression

    // Push to production
    alterState(state => {

    function getAge(dateString) {
    if (!dateString) return;

    const today = new Date();
    const birthDate = new Date(dateString);
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age--;
    }
    return age;
    }

    function transform(value) {
    if (!value) return;
    switch (value.toString().trim()) {
    case 'i_dont_know__i_dont_recall':
    return "I don't know/I don't recall";
    case 'i_dont_recall':
    return "I don't know/I don't recall";
    case 'no':
    return 'No';
    case 'yes':
    return 'Yes';
    case 'na':
    return 'NA';
    case 'disagree':
    return '2 (Disagree)';
    case 'agree':
    return '4 (Agree)';
    case 'neither_agree_or_disagree':
    return '3 (Neither Agree or Disagree)';
    case 'strongly_agree':
    return '5 (Strongly Agree)';
    case 'strongly_disagree':
    return '1 (Strongly Disagree)';
    case 'sure':
    return '4 (Agree)';
    case 'very_sure':
    return '5 (Strongly Agree)';
    case 'i_dont_know':
    return 'I dont know';
    case 'suppressed':
    return 'Suppressed';
    case 'unsuppressed':
    return 'Unsuppressed';
    default:
    return value;
    }
    }

    state.helperFunctions = { getAge };

    state.data.form.behavioural.are_you_taking_any_other_religious_treatment_ie_holy_water_anointing_oilwat =
    transform(state.data.form.behavioural.are_you_taking_any_other_religious_treatment_ie_holy_water_anointing_oilwat)

    state.data.form.behavioural.are_you_taking_any_traditional_medicine_as_a_supplement_to_the_arvs =
    transform(state.data.form.behavioural.are_you_taking_any_traditional_medicine_as_a_supplement_to_the_arvs)

    state.data.form.behavioural.if_yes_to_any_of_the_above_did_it_affect_your_taking_of_medication_treatmen =
    transform(state.data.form.behavioural.if_yes_to_any_of_the_above_did_it_affect_your_taking_of_medication_treatmen)

    state.data.form.behavioural.in_the_past_month_did_you_go_for_a_party_or_other_leisure_activities =
    transform(state.data.form.behavioural.in_the_past_month_did_you_go_for_a_party_or_other_leisure_activities)

    state.data.form.behavioural.in_the_past_month_did_you_sleep_away_from_home =
    transform(state.data.form.behavioural.in_the_past_month_did_you_sleep_away_from_home)

    state.data.form.clinical_knowledge.do_you_know_your_cd4_count =
    transform(state.data.form.clinical_knowledge.do_you_know_your_cd4_count)

    state.data.form.clinical_knowledge.question16 =
    transform(state.data.form.clinical_knowledge.question16)

    state.data.form.clinical_knowledge.do_you_know_your_viral_load =
    transform(state.data.form.clinical_knowledge.do_you_know_your_viral_load)

    state.data.form.clinical_knowledge.when_did_you_last_go_for_these_two_clinical_tests =
    transform(state.data.form.clinical_knowledge.when_did_you_last_go_for_these_two_clinical_tests)

    state.data.form.treatment_adherence.did_you_encounter_any_challenges_in_taking_your_medication_as_prescribed_in =
    transform(state.data.form.treatment_adherence.did_you_encounter_any_challenges_in_taking_your_medication_as_prescribed_in)

    state.data.form.treatment_adherence.in_the_past_month_have_you_failed_to_take_any_of_your_art_treatment =
    transform(state.data.form.treatment_adherence.in_the_past_month_have_you_failed_to_take_any_of_your_art_treatment)

    state.data.form.treatment_adherence.in_the_past_month_have_you_taken_any_of_your_art_treatment_at_times_other_t =
    transform(state.data.form.treatment_adherence.in_the_past_month_have_you_taken_any_of_your_art_treatment_at_times_other_t)

    state.data.form.treatment_adherence.in_the_past_month_have_you_taken_less_or_more_pills_of_any_of_your_art_trea =
    transform(state.data.form.treatment_adherence.in_the_past_month_have_you_taken_less_or_more_pills_of_any_of_your_art_trea)

    state.data.form['treatment_self-efficacy'].how_sure_are_you_that_you_will_be_taking_your_medication_as_are_directed = how_sure_are_you_that_you_will_be_taking_your_medication_as_are_directed =
    transform(state.data.form['treatment_self-efficacy'].how_sure_are_you_that_you_will_be_taking_your_medication_as_are_directed)

    state.data.form['treatment_self-efficacy'].how_sure_are_you_that_your_medication_will_have_a_positive_effect_on_your_h =
    transform(state.data.form['treatment_self-efficacy'].how_sure_are_you_that_your_medication_will_have_a_positive_effect_on_your_h)

    state.data.form['treatment_self-efficacy'].how_sure_are_you_that_your_medication_will_help_you_live_a_longer_and_healt =
    transform(state.data.form['treatment_self-efficacy'].how_sure_are_you_that_your_medication_will_help_you_live_a_longer_and_healt)

    state.data.form.clinical_knowledge.question16 =
    transform(state.data.form.clinical_knowledge.question16)

    state.data.form.clinical_knowledge.when_did_you_last_have_your_clinical_test =
    state.data.form.clinical_knowledge.when_did_you_last_have_your_clinical_test ? transform(state.data.form.clinical_knowledge.when_did_you_last_have_your_clinical_test)
    : transform(state.data.form.clinical_knowledge.when_did_you_last_go_for_these_two_clinical_tests);

    return state;
    });



    upsert(
    'ART_ADHERENCE_SELF_SELF_REPORTING_TOOL__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    field('Date__c', dataValue('form.demographic_information.date')),
    field('Sex__c', dataValue('form.gender')),
    field('Facility_Name__c', dataValue('form.school')),
    field('Patient_ID_or_Facility_File_Number__c', dataValue('form.skillz_lplus_number')),
    //field('Business_Unit__c', 'GRS Zambia'),
    field('Captured_By__c', dataValue('form.coach_name')),
    field('Verified_By__c', dataValue('form.coach_name')),
    field('Captured_Date__c', dataValue('form.demographic_information.date')),
    field('Verified_Date__c', dataValue('form.demographic_information.date')),
    field('Age__c', state => {
    const dob = dataValue('form.date_of_birth')(state);
    return state.helperFunctions.getAge(dob);
    }),
    field(
    'Treatment_Adherence_3__c',
    dataValue('form.treatment_adherence.in_the_past_month_have_you_taken_any_of_your_art_treatment_at_times_other_t')
    ),
    field(
    'Treatment_Adherence_2__c',
    dataValue('form.treatment_adherence.in_the_past_month_have_you_failed_to_take_any_of_your_art_treatment')
    ),
    field(
    'Treatment_Adherence_4__c',
    dataValue('form.treatment_adherence.in_the_past_month_have_you_taken_less_or_more_pills_of_any_of_your_art_trea')
    ),
    field(
    'Treatment_Adherence_5_a__c',
    dataValue('form.treatment_adherence.did_you_encounter_any_challenges_in_taking_your_medication_as_prescribed_in')
    ),


    field('Clinical_Knowledge_2__c', dataValue('form.clinical_knowledge.question16')),
    field(
    'Clinical_Knowledge_1__c',
    dataValue('form.clinical_knowledge.when_did_you_last_have_your_clinical_test')
    ),
    field(
    'Treatment_Self_Efficacy__c',
    dataValue('form.treatment_self-efficacy.how_sure_are_you_that_you_will_be_taking_your_medication_as_are_directed')
    ),
    field(
    'Treatment_Self_Efficacy_10__c',
    dataValue(
    'form.treatment_self-efficacy.how_sure_are_you_that_your_medication_will_have_a_positive_effect_on_your_h'
    )
    ),
    field(
    'Treatment_Self_Efficacy_11__c',
    dataValue(
    'form.treatment_self-efficacy.how_sure_are_you_that_your_medication_will_help_you_live_a_longer_and_healt'
    )
    ),
    field(
    'Behavioural_Factors_12__c',
    dataValue('form.behavioural.in_the_past_month_did_you_go_for_a_party_or_other_leisure_activities')
    ),
    field('Behavioural_Factors_13__c', dataValue('form.behavioural.in_the_past_month_did_you_sleep_away_from_home')),
    field(
    'Behavioural_Factors_14__c',
    dataValue('form.behavioural.are_you_taking_any_traditional_medicine_as_a_supplement_to_the_arvs')
    ),
    field(
    'Behavioural_Factors_14__c',
    dataValue('form.behavioural.are_you_taking_any_other_religious_treatment_ie_holy_water_anointing_oilwat')
    ),
    field(
    'Behavioural_Factors_15__c',
    dataValue('form.behavioural.if_yes_to_any_of_the_above_did_it_affect_your_taking_of_medication_treatmen')
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30.html index 2600aa7e651..bf528393e8f 100644 --- a/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Aggregate Service Referrals

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert

    Expression

    // Push to production
    upsert(
    'GRS_Referral_Agg__c',
    'CommCare_Ext_ID__c',
    fields(
    relationship(
    'SiteName__r',
    'CommCare_Ext_ID__c',
    dataValue('form.general_referral_information.event_information.site')
    ),
    field('CommCare_Ext_ID__c', dataValue('form.general_referral_information.event_information.site')),
    //TO DO
    //field('Business_Unit__c', dataValue('form.general_referral_information.event_information.business_unit')),
    field('Business_Unit__c', state => {
    const bu = dataValue('form.general_referral_information.event_information.business_unit')(state);
    return bu==='65680f0c4c144b03ad0f86bdc46c1ebc' ? 'GRS Zambia' :
    bu==='04d98397e28046118fade28ced6b65cb' ? 'GRS Zimbabwe' :
    bu==='ed125ab19ec34aacab79585e59eb76f4' ? 'GRS Partnerships': undefined ;
    }),
    relationship(
    //Attendance looks up to Event via the intervention_name
    'Events__r',
    'CommCare_Ext_ID__c',
    dataValue('form.general_referral_information.event_information.event_name')
    ),
    field('Type_of_Referral__c', dataValue('form.general_referral_information.type_of_referral')),
    field(
    'Enter_Partner_s_Name__c',
    dataValue('form.general_referral_information.partner_or_organization_referred_to')
    ),
    field('Males_Referred_HIV_Testing__c', dataValue('form.hivsti_services.males_referred_for_hiv_testing')),
    field('Males_referred_for_STI_Screening__c', dataValue('form.hivsti_services.males_referred_for_sti_screening')),
    field('Males_Referred_for_PEP__c', dataValue('form.hivsti_services.males_referred_for_pep')),
    field('Males_Referred_for_PrEP__c', dataValue('form.hivsti_services.males_referred_for_prep')),
    field('Males_Referred_for_VMMC__c', dataValue('form.hivsti_services.males_referred_for_vmmc')),
    field('Females_Referred_for_HIV_Testing__c', dataValue('form.hivsti_services.females_referred_for_hiv_testing')),
    field(
    'Females_Referred_for_STI_Screening__c',
    dataValue('form.hivsti_services.females_referred_for_sti_screening')
    ),
    field('Date_Referred__c', dataValue('form.general_referral_information.date_referred')),
    field('Females_Referred_for_PEP__c', dataValue('form.hivsti_services.females_referred_for_pep')),
    field('Females_Referred_for_PrEP__c', dataValue('form.hivsti_services.females_referred_for_prep')),
    field('Males_Referred_for_ART__c', dataValue('form.art_services.males_referred_for_art')),
    field('Males_Referred_for_SKILLZ_Club__c', dataValue('form.art_services.males_referred_for_skillz__club')),
    field('Females_Referred_for_ART__c', dataValue('form.art_services.females_referred_for_art')),
    field('Females_Referred_SKILLZ_Club__c', dataValue('form.art_services.females_referred_for_skillz__club')),
    field('Females_Referred_for_PMTCT__c', dataValue('form.art_services.females_referred_for_pmtct')),

    field(
    'Males_Referred_for_Psycho_Social_Support__c',
    dataValue('form.psycho_-_social_services.males_referred_for_psycho-social_support')
    ),
    field(
    'Females_Referred_Psycho_Social_Support__c',
    dataValue('form.psycho_-_social_services.females_referred_for_psycho-social_support')
    ),
    field('Males_Referred_for_TB_Screening__c', dataValue('form.tb_services.males_referred_for_tb_screening')),
    field('Females_Referred_for_TB_Screening__c', dataValue('form.tb_services.females_referred_for_rb_screening')),
    field(
    'Number_of_Male_Condoms_distributed__c',
    dataValue('form.condom_distributions.number_of_male_condoms_distributed')
    ),
    field('Number_of_Male_Condoms_Accessed__c', dataValue('form.condom_distributions.number_of_male_condoms_accessed')),
    field(
    'Number_of_Female_Condoms_distributed__c',
    dataValue('form.condom_distributions.number_of_female_condoms_distributed')
    ),
    field(
    'Number_of_Female_Condoms_Accessedx__c',
    dataValue('form.condom_distributions.number_of_female_condoms_accessed')
    ),
    field(
    'Females_Referred_for_Family_Planning__c',
    dataValue('form.other_srhr_services.females_referred_for_family_planning')
    ),
    field(
    'Females_Referred_for_Cervical_Cancer__c',
    dataValue('form.other_srhr_services.females_referred_for_cervical_cancer')
    ),
    field('Females_Referred_for_Antenatal__c', dataValue('form.other_srhr_services.females_referred_for_antenatal')),
    field(
    'Males_Referred_for_Malaria_Testing__c',
    dataValue('form.other_referral_services.males_referred_for_malaria_testing')
    ),
    field('Males_Referred_for_GBV__c', dataValue('form.other_referral_services.males_referred_for_gbv')),
    field(
    'Females_Referred_for_Malaria_Testing__c',
    dataValue('form.other_referral_services.females_referred_for_malaria_testing')
    ),
    field('Females_Referred_for_GBV__c', dataValue('form.other_referral_services.females_referred_for_gbv')),
    field(
    'Females_Referred_for_HPV_Vaccine__c',
    dataValue('form.other_referral_services.females_referred_for_hpv_vaccine')
    )
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24.html b/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24.html index 7d316ed955a..3ae87a8bb9f 100644 --- a/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24.html +++ b/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Attendance Skillz Plus Club

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, each, field, fields, lastReferenceValue, map, query, relationship, upsert, Array

    Expression

    query(
    `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.attendance_list.update_participant_cases.item[0]['@id']}'`
    );

    fn(state => {
    const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);

    if (!PID) {
    console.log(
    `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.attendance_list.update_participant_cases.item[0]['@id']}`
    );
    return state;
    }
    return execute(
    // Set state.references to event record
    query(
    `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    ),
    // Organise data and keep it safe
    fn(state => {
    function objectToArray(object) {
    if (!object) return [];
    return !Array.isArray(object) ? [object] : object;
    }

    const eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);
    state.data.eventName = eventName;

    state.data.form.attendance_list.update_participant_cases.item = objectToArray(
    state.data.form.attendance_list.update_participant_cases.item
    );

    state.data.form.attendance_list.update_participant_cases.item =
    state.data.form.attendance_list.update_participant_cases.item.map(item => ({
    ...item,
    CommCare_Ext_ID__c: `${item['@id']}-${eventName}`,
    event_case_id: state.data.form.case['@case_id'],
    }));

    // Keep our data safe
    state.items = state.data.form.attendance_list.update_participant_cases.item;

    // Reset references
    state.references = [];

    return state;
    }),
    // Set state.references to an array of attendance records for each participant
    beta.each(
    '$.items[*]',
    query(
    state => `SELECT CommCare_Ext_ID__c, Session_1__c, Session_2__c, Session_3__c, Session_4__c, Session_5__c, Session_6__c, Session_7__c, Session_8__c, Session_9__c, Session_10__c, Session_11__c, Session_12__c, Session_13__c, Session_14__c, Session_15__c, Session_16__c, Session_17__c, Session_18__c, Session_19__c, Session_20__c, Session_21__c, Session_22__c, Session_23__c,Session_24__c, Session_25__c, Session_26__c, Session_27__c, Session_28__c
    FROM Attendance__c
    WHERE CommCare_Ext_ID__c = '${state.data.CommCare_Ext_ID__c}'
    `
    )
    ),
    // Calculate dynamic fields
    fn(state => {
    state.items = state.items.map(item => {
    const record = state.references.find(rec =>
    rec.records[0] ? rec.records[0].CommCare_Ext_ID__c === item.CommCare_Ext_ID__c : true
    ).records[0];

    function getSessionValue(present) {
    if (!present) return 'U';
    switch (present.toString().toLowerCase()) {
    case 'yes':
    return 'X';
    case 'no':
    return 'A';
    case '':
    return 'N';
    default:
    return 'U';
    }
    }

    function getSessionFieldName(record) {
    if (!record || Object.keys(record).length === 0) {
    return 'Session_1__c';
    }

    const fieldName = Object.entries(record)
    .filter(rec => rec[1] === null && rec[0] !== 'CommCare_Ext_ID__c')
    .sort(function (a, b) {
    return a[0].split('_')[1] - b[0].split('_')[1];
    })[0][0];

    return fieldName;
    }

    const sessionValue = getSessionValue(item.attendance_session);
    const sessionDate = item.date;
    const sessionFieldName = getSessionFieldName(record);
    const sessionDateFieldName = `Session_${sessionFieldName.split('_')[1]}_Date__c`;

    return {
    ...item,
    dynamicFields: {
    [sessionFieldName]: sessionValue,
    [sessionDateFieldName]: sessionDate,
    },
    };
    });

    // Reset state.references
    state.references = [];

    return state;
    }),

    // Upsert
    beta.each(
    '$.items[*]',
    upsert('Attendance__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    field('CommCare_Ext_ID__c', dataValue('CommCare_Ext_ID__c')),
    relationship('Person_Attendance__r', 'Participant_Identification_Number_PID__c', dataValue('@id')),
    relationship('Event__r', 'CommCare_Case_ID__c', dataValue('event_case_id'))
    ),
    ...state.data.dynamicFields,
    }))
    )
    )(state);
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28.html b/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28.html index be7c13aa20f..7755838cb74 100644 --- a/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28.html +++ b/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Coach Support Visit CSV

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsert

    Expression

    //openfn.org source
    alterState(state => {
    function clean(str) {
    console.log('str', str);

    if (!str) return '';

    return str
    .split('_')
    .map(word => {
    let new_word = word.toString().toLowerCase();
    return new_word.slice(0, 1).toUpperCase() + new_word.slice(1);
    })
    .join(' ');
    }

    if (state.data.form['step_3_-_the_big_5'] !== undefined ){
    state.data.form['step_3_-_the_big_5'].faciliation = clean(state.data.form['step_3_-_the_big_5'].faciliation);
    }
    else{
    state.data.form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.faciliation =
    clean(state.data.form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.faciliation);
    }

    function transform(value) {
    if (!value) return;
    switch (value.toString().trim()) {
    case 'copy-1-of-excellent':
    return 'Excellent';
    case 'needs_improvement':
    return 'Needs Improvement';
    case 'meets_expectations':
    return 'Meets Expectations';
    case 'excellent':
    return 'Excellent';
    case 'unsatisfactory':
    return 'Unsatisfactory';
    case 'exceeds_expectations':
    return 'Exceeds Expectations';
    default:
    return value;
    }
    }

    state.data.form['step_3_-_the_big_5'].builds_personal_connections =
    transform(state.data.form['step_3_-_the_big_5'].builds_personal_connections)

    state.data.form['step_3_-_the_big_5'].cool_down =
    transform(state.data.form['step_3_-_the_big_5'].cool_down)

    state.data.form['step_3_-_the_big_5'].creates_safe_space =
    transform(state.data.form['step_3_-_the_big_5'].creates_safe_space)

    state.data.form['step_3_-_the_big_5'].faciliation =
    transform(state.data.form['step_3_-_the_big_5'].faciliation)

    state.data.form['step_3_-_the_big_5'].gives_praise =
    transform(state.data.form['step_3_-_the_big_5'].gives_praise)

    state.data.form['step_3_-_the_big_5'].praise =
    transform(state.data.form['step_3_-_the_big_5'].praise)

    state.data.form['step_3_-_the_big_5'].preparation =
    transform(state.data.form['step_3_-_the_big_5'].preparation)

    state.data.form['step_3_-_the_big_5'].shares_accurate_information_about_hivaids_sexual_reproductive_health_and_ri =
    transform(state.data.form['step_3_-_the_big_5'].shares_accurate_information_about_hivaids_sexual_reproductive_health_and_ri)

    state.data.form['step_3_-_the_big_5'].sparks_vital_conversations =
    transform(state.data.form['step_3_-_the_big_5'].sparks_vital_conversations)

    state.data.form['step_3_-_the_big_5'].time_management =
    transform(state.data.form['step_3_-_the_big_5'].time_management)

    state.data.form['step_3_-_the_big_5'].warm_up =
    transform(state.data.form['step_3_-_the_big_5'].warm_up)


    return state;
    });

    upsert(
    'Coach_Support_Visit__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    relationship('Coach_Person__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.step_1_basic_information.select_coach')(state) ||
    dataValue('form.step_1_csv_information.select_coach')(state);
    }),
    relationship('Venue__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.hidden_properties.venue')(state) ||
    dataValue('form.step_1_csv_information.venue')(state);
    }),
    relationship('Event__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.hidden_properties.intervention')(state) ||
    dataValue('form.step_1_csv_information.intervention')(state);
    }),
    relationship('Curriculum_Aggregate__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.hidden_properties.curriculum')(state) ||
    dataValue('form.step_1_csv_information.curriculum')(state);
    }),
    relationship('Site_Lookup__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.hidden_properties.site')(state) ||
    dataValue('form.step_1_csv_information.site')(state);
    }),
    field('Date__c', dataValue('form.step_2_practice_information.date_of_csv')),
    //== TODO: FIx repeated mappings to only reference destination field 1 time ===//
    field(
    'Accurate_Information__c', state => {
    return dataValue('form.step_3_-_the_big_5.shares_accurate_information_about_hivaids_sexual_reproductive_health_and_ri')(state) ||
    dataValue(
    'form.step_3_the_big_five.question1.shares_accurate_information_about_hivaids_sexual_reproductive_health_and_ri'
    )(state);
    }),
    field('Creates_safe_space__c', state => {
    return dataValue('form.step_3_-_the_big_5.creates_safe_space')(state) ||
    dataValue('form.step_3_the_big_five.question1.creates_safe_space')(state);

    }),
    field('Builds_personal_connections__c', state => {
    return dataValue('form.step_3_-_the_big_5.builds_personal_connections')(state) ||
    dataValue('form.step_3_the_big_five.question1.builds_personal_connections')(state);
    }),
    field('Gives_praise__c', state => {
    return dataValue('form.step_3_-_the_big_5.gives_praise')(state) ||
    dataValue('form.step_3_the_big_five.question1.gives_powerful_praise')(state);
    }),
    field('Sparks_vital_conversations__c', state => {
    return dataValue('form.step_3_-_the_big_5.sparks_vital_conversations')(state) ||
    dataValue('form.step_3_the_big_five.question1.sparks_vital_conversations')(state);
    }),
    field('X2_Warm_Up__c', state => {
    return dataValue('form.step_3_-_the_big_5.warm_up')(state) ||
    dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.warm_up'
    )(state);
    }),
    field('X3_Activity__c', state => {
    return dataValue('form.step_3_-_the_big_5.activity')(state) || dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.activity'
    )(state);
    }),
    field('X4_Cool_Down__c', state => {
    return dataValue('form.step_3_-_the_big_5.cool_down')(state) || dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.cool_down'
    )(state);
    }),
    field('X5_Facilitation__c', state => {
    return dataValue('form.step_3_-_the_big_5.faciliation')(state) ||
    dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.faciliation'
    )(state);
    }),
    field(
    'X6_Time_Management__c',
    dataValue('form.step_3_-_the_big_5.time_management')
    ),
    field(
    'X1_Preparation__c',
    dataValue('form.step_3_-_the_big_5.preparation')
    ),
    field('Introduces_micromove__c', state => {
    return //dataValue('form.step_3_-_the_big_5.faciliation')(state) ||
    dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.micromove'
    )(state);
    }),
    field(
    'Notes__c',
    dataValue(
    'form.step_3_-_the_big_5.additional_notes.include_your_obsevations_related_to_preparation_punctuality_process'
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14.html b/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14.html index 67fa34d60d6..34a5ed387cb 100644 --- a/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14.html +++ b/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Confirm Services Received

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, upsert

    Expression

    // Your job goes here.
    alterState(state => {
    state.data.external_commcare_id = (
    dataValue('form.hidden_properties.intervention_name')(state) +
    dataValue('form.hidden_properties.participant_first_name')(state) +
    dataValue('form.hidden_properties.participant_surname')(state)
    )
    .toString()
    .toLowerCase()
    .replace(/\s/g, '')
    .trim();

    return state;
    });

    upsert(
    'NewReferral__c',
    'CommCare_Ext_ID__c',
    fields(
    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu === 'X' ? 'GRS Zambia' : bu;
    }),
    field('CommCare_Ext_ID__c', dataValue('form.case.@case_id')),
    field('HIV_Testing_Services_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option1')(state)
    )
    ),
    field('TB_Screening_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option2')(state)
    )
    ),
    field('VMMC_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option3')(state)
    )
    ),
    field('Post_Exposure_Prophylaxis_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option4'
    )(state)
    )
    ),
    field('PrEP_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option5'
    )(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option6'
    )(state)
    )
    ),
    field('ART_Initiation_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option1')(
    state
    )
    )
    ),
    field('SKILLZ_Plus_Club_Support_Service_Provid__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option2')(
    state
    )
    )
    ),

    field(
    'PMTCT_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option3')(
    state
    )
    )
    ),
    field('IPTG_Health_Facility__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option1')(
    state
    )
    )
    ),
    field('IPTG_Specialized_to_SMZ__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option2')(
    state
    )
    )
    ),

    field('ART_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.referred_art_support_services')(state)
    )
    ),
    field(
    'Victim_Friendly_Services_Service_Provide__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option1'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option2'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option3'
    )(state)
    )
    ),
    field('Legal_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option3'
    )(state)
    )
    ),

    field('STI_Screen_Testing_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option1')(state))
    ),

    field('Contraception_Family_Plan_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option2')(state))
    ),
    field('Cervical_Cancer_Screen_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option3')(state))
    ),
    field('HPV_vaccine_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option4')(state))
    ),
    field('Antenatal_Care_ANC_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option5')(state))
    ),
    field('Sexual_and_GBV_Abuse_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option6')(state))
    ),
    field(
    'Psycho_Social_Support_Service_Provider__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option9'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option8'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option7'
    )(state)
    )
    ),
    field('Psycho_Social_Services_Other_Service_Pro__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option10')(state))
    ),
    field(
    'Legal_Services_Other_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_referral_services')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option1')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option2')(state)
    )
    ),

    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.html b/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.html index 74bb50b8ddd..a9c157d9f62 100644 --- a/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.html +++ b/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.html @@ -21,15 +21,15 @@ - +
    -
    Skip to main content

    Upsert Home Visit Log Form

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, lastReferenceValue, query, relationship, upsert

    Expression

    // push to production

    query(
    `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);
    if (!PID) {
    console.log(
    `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.case['@case_id']}`
    );
    return state;
    }

    return execute(
    fn(state => {
    const { form } = state.data;
    const { basic_information } = form;
    if (basic_information.intervention_hidden) {
    return query(
    `SELECT Id, Event__c, CreatedDate, Person_Attendance__c
    FROM Attendance__c
    WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'
    ORDER BY CreatedDate DESC LIMIT 1`
    )(state).then(state => {
    const { records } = state.references[0];
    const eventId = records[0].Event__c;
    state.data.eventField = [field('Event__c', eventId)];
    return state;
    });
    // state.data.eventField = [
    // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')(state)),
    // ];
    // return state;
    } else {
    return query(
    `SELECT Id, Event__c, CreatedDate, Person_Attendance__c
    FROM Attendance__c
    WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'
    ORDER BY CreatedDate DESC LIMIT 1`
    )(state).then(state => {
    const { records } = state.references[0];
    const eventId = records[0].Event__c;
    state.data.eventField = [field('Event__c', eventId)];
    return state;
    });
    }
    }),

    upsert('Home_Visit__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')),
    relationship('Person_visiting__r', 'Participant_Identification_Number_PID__c', dataValue('form.case.@case_id')),
    //=== NOTE: We do not need to map People information because Home Visit is related to Person. ======//
    //This info already lives on the Person-level.
    // field('First_Name__c', dataValue('form.basic_information.participant_first_name')),
    // field('Surname__c', dataValue('form.basic_information.participant_surname')),
    // field('Sex__c', dataValue('form.basic_information.gender')),
    // field('Date_of_Birth__c', dataValue('form.basic_information.date_of_birth')),
    // field('Physical Address Community City', dataValue('form.basic_information.participant_address')),
    //================
    field('Mobile_Number__c', dataValue('form.basic_information.Mobile_number')),
    field('Consent_Given__c', dataValue('form.basic_information.consent_received')),
    //field('Consent_Given__c', dataValue('form.participant_infomation.visit_information.consent_given')) //Repeated mapping
    //field('From_Venue__c', dataValue('form.basic_information.venue_hidden')),
    field('Reason_for_Home_Visit__c', dataValue('form.participant_infomation.reason_for_home_visit')),
    field('Visit_Date__c', dataValue('form.participant_infomation.visit_information.visit_date')),
    field('Additional_Comments__c', dataValue('form.administrative.visit_notes'))
    ),
    ...fields(...state.data.eventField),
    }))
    )(state);
    });

    - +
    Skip to main content

    Upsert Home Visit Log Form

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, lastReferenceValue, query, relationship, upsert

    Expression

    // push to production

    query(
    `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);
    if (!PID) {
    console.log(
    `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.case['@case_id']}`
    );
    return state;
    }

    return execute(
    fn(state => {
    const { form } = state.data;
    const { basic_information } = form;
    if (basic_information.intervention_hidden) {
    return query(
    `SELECT Id, Event__c, CreatedDate, Person_Attendance__c
    FROM Attendance__c
    WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'
    ORDER BY CreatedDate DESC LIMIT 1`
    )(state).then(state => {
    const { records } = state.references[0];
    const eventId = records[0].Event__c;
    state.data.eventField = [field('Event__c', eventId)];
    return state;
    });
    // state.data.eventField = [
    // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')(state)),
    // ];
    // return state;
    } else {
    return query(
    `SELECT Id, Event__c, CreatedDate, Person_Attendance__c
    FROM Attendance__c
    WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'
    ORDER BY CreatedDate DESC LIMIT 1`
    )(state).then(state => {
    const { records } = state.references[0];
    const eventId = records[0].Event__c;
    state.data.eventField = [field('Event__c', eventId)];
    return state;
    });
    }
    }),

    upsert('Home_Visit__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')),
    relationship('Person_visiting__r', 'Participant_Identification_Number_PID__c', dataValue('form.case.@case_id')),
    //=== NOTE: We do not need to map People information because Home Visit is related to Person. ======//
    //This info already lives on the Person-level.
    // field('First_Name__c', dataValue('form.basic_information.participant_first_name')),
    // field('Surname__c', dataValue('form.basic_information.participant_surname')),
    // field('Sex__c', dataValue('form.basic_information.gender')),
    // field('Date_of_Birth__c', dataValue('form.basic_information.date_of_birth')),
    // field('Physical Address Community City', dataValue('form.basic_information.participant_address')),
    //================
    field('Mobile_Number__c', dataValue('form.basic_information.Mobile_number')),
    field('Consent_Given__c', dataValue('form.basic_information.consent_received')),
    //field('Consent_Given__c', dataValue('form.participant_infomation.visit_information.consent_given')) //Repeated mapping
    //field('From_Venue__c', dataValue('form.basic_information.venue_hidden')),
    field('Reason_for_Home_Visit__c', dataValue('form.participant_infomation.reason_for_home_visit')),
    field('Visit_Date__c', dataValue('form.participant_infomation.visit_information.visit_date')),
    field('Additional_Comments__c', dataValue('form.administrative.visit_notes'))
    ),
    ...fields(...state.data.eventField),
    }))
    )(state);
    });

    + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28.html b/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28.html index 439cc913786..9433039077c 100644 --- a/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28.html +++ b/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Intervention Notes

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert

    Expression

    //openfn.org source 
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    //field('Name', dataValue('form.intervention_name')),
    field('Notes__c', dataValue('form.intervention_notes_to_save')),
    relationship('RecordType', 'Name', 'Intervention')
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30.html index 26f8724da23..2b6d3f26958 100644 --- a/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Post Challenges

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, lastReferenceValue, query, relationship, upsert

    Expression

    fn(state => {
    function transform(value) {
    if (!value) return;
    switch (value.toString().trim().toLowerCase()) {
    case 'true':
    case 'yes':
    case 'agree':
    case 'concordo':
    case 'verdade':
    case 'copy-1-of-yes':
    case 'choice1':
    return 1;
    case 'false':
    case 'no':
    case 'disagree':
    case 'discordo':
    case 'falso':
    case 'copy-1-of-no':
    case 'choice3':
    case 'choice6':
    return 2;
    case 'i_dont_know':
    case 'na':
    return 3;
    case 'unanswered':
    case `not_sexually_active`:
    return 4;
    case 'not_applicable':
    return 5;
    default:
    return value;
    }
    }

    state.helperFunctions = { transform };

    return query(
    `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.case['@case_id']}'`
    )(state);
    });

    fn(state => {
    const { form } = state.data;

    const formVersion = Object.keys(form).find(key => key.includes('challenge'));
    if (formVersion == 'post_challenge_ecap_-_post_-_season_survey_for_athletes') {
    console.log('Skipping upsert for ECAP data');
    return { ...state, formVersion };
    }
    console.log('form version', formVersion);

    const sfFieldMapping = {
    'portuguese_pre_challenge_gcr_-_skillz_malaria': {
    Post_1__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.dormir_dentro_da_rede_mosquiteira_tratada_todas_as_noites_pode_proteger_me_',
    Post_2__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.posso_esperar_uns_dias_antes_de_fazer_o_teste_de_malria_se_tiver_febres',
    Post_3__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.um_mdico_tradicionalcurandeiro_pode_me_dar_um_tratamento_para_curar_a_malri',
    Post_4__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.se_tiver_malria_e_no_for_tratado_posso_transmitir_a_malria_a_algum',
    Post_5__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.somente_as_mulheres_grvidas_e_as_crianas_menores_de_5_anos__que_precisam_de',
    Post_6__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.a_malria_pode_matar_se_no_fr_tratada',
    Post_7__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.a_febre__um_sintoma_da_malria',
    Post_8__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.eu_me_sinto_bem_conmigo_mesmo',
    Post_9__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.tenho_algum_na_minha_vida_que_pode_me_dar_bons_conselhos_quando_preciso_de_',
    Post_10__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.eu_sei_onde_posso_ter_tratamento_para_malria_na_minha_comunidade',
    Post_11__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.posso_proteger-me_da_malria',
    },

    'post_challenge_south_africa_-_skillz_girl': {
    Post_1__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_have_an_older_person_in_my_life_i_can_go_to_for_advice_i_have_an_older_pe',
    Post_2__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_how_to_make_a_plan_to_deal_with_the_challenges_i_may_face_in_reachin',
    Post_3__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_4__c: 'form.post_challenge_south_africa_-_skillz_girl.every_day_i_can_find_something_to_be_grateful_for',
    Post_5__c:
    'form.post_challenge_south_africa_-_skillz_girl.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Post_6__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Post_7__c:
    'form.post_challenge_south_africa_-_skillz_girl.girls_have_a_greater_risk_of_contracting_hiv_than_boys',
    Post_8__c:
    'form.post_challenge_south_africa_-_skillz_girl.if_i_am_sexually_active_i_go_to_a_clinic_to_get_protection_from_hivstis_and',
    Post_9__c: 'form.post_challenge_south_africa_-_skillz_girl.like_physical_health_we_all_have_mental_health',
    Post_10__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_11__c:
    'form.post_challenge_south_africa_-_skillz_girl.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Post_12__c:
    'form.post_challenge_south_africa_-_skillz_girl.if_a_girl_is_sexually_abused_she_can_reduce_her_risk_of_getting_hiv_by_goin',
    Post_13__c:
    'form.post_challenge_south_africa_-_skillz_girl.sometimes_a_man_may_have_a_good_reason_to_hit_his_partner',
    Post_14__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Post_15__c:
    'form.post_challenge_south_africa_-_skillz_girl.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Post_16__c:
    'form.post_challenge_south_africa_-_skillz_girl.if_sexually_active_i_or_my_partner_is_using_a_prevention_method_to_protect_',
    Post_17__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_where_to_go_to_receive_counselling_for_mental_health_challenges',
    Post_18__c:
    'form.post_challenge_south_africa_-_skillz_girl.loss_of_interest_in_funenjoyable_activities_is_a_common_sign_of_depression',
    Post_19__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_at_least_three_methods_to_prevent_an_unwanted_pregnancy',
    },
    'portuguese_post_challenge_gcr_-_skillz_girl': {
    Post_1__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.falei_sobre_o_hiv_com_uma_pessoa_adulta_nos_ltimos_2_meses_fora_do_skillz',
    Post_2__c: 'form.portuguese_post_challenge_gcr_-_skillz_girl.sei_como_expressar_a_minha_raiva_sem_ser_violento',
    Post_3__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.sei_como_superar_os_desafios_que_possa_enfrentar_na_minha_vida',
    Post_4__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.sei_quais_as_decises_a_tomar_para_alcanar_os_meus_objectivos',
    Post_5__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.os_rapazes_correm_um_risco_mais_elevado_de_serem_vtimas_de_violncia_do_que_',
    Post_6__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.conheco_que_mudanas_ocorrem_no_meu_corpo_durante_a_puberdade',
    Post_7__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.conheo_pelo_menos_trs_mtodos_para_evitar_uma_gravidez_indesejada',
    Post_8__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.os_preservativos_so_o_nico_mtodo_contraceptivo_que_protege_contra_a_gravide',
    Post_9__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.conheco_onde_obter_servios_de_apoio_para_mim_ou_outra_pessoa_para_casos_de_',
    Post_10__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.se_uma_rapariga_inicia_seu_perodo_menstrual_significa_que_est_pronta_para_c',
    Post_11__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.caso_eu_seja_abusada_sexualmente_prefiro_guard-lo_para_mim_para_evitar_que_',
    Post_12__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.um_homem_tem_o_direito_de_ter_sexo_com_a_sua_namorada_mesmo_que_ela_no_o_qu',
    Post_13__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.pessoas_com_problemas_de_sade_mental_so_apenas_confusas_ou_loucas',
    Post_14__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.pessoas_com_problemas_de_sade_mental_so_apenas_confusas_ou_loucas',
    Post_15__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.informaria_a_algum_caso_fosse_tocada_por_alguem_de_uma_forma_que_me_deixass',
    Post_16__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.uma_filha_deve_sempre_respeitar_a_deciso_dos_seus_pais_para_se_casar',
    Post_17__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.um_casamento_bem_sucedido__mais_importante_para_as_raparigas_do_que_termina',
    Post_18__c: 'form.portuguese_post_challenge_gcr_-_skillz_girl.eu_no_praticaria_desporto_com_algum_que_tem_hiv',
    Post_19__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.um_namorado_pode_ter_boas_razes_para_bater_na_sua_namorada',
    Post_20__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.no_faz_mal_que_um_rapaz_ameace_bater_na_sua_namorada_se_nunca_a_bater_fisic',
    },
    'post_challenge_zambia_-_plus_mh_enhanced_zambia': {
    Post_1__c: 'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.in_general_i_feel_good_about_myself',
    Post_2__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.i_have_the_skills_and_knowledge_to_avoid_getting_infected_with_another_kind',
    Post_3__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_important_to_know_why_and_how_i_want_to_tell_someone_my_hiv_status',
    Post_4__c: 'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.i_accept_myself_and_my_hiv_status',
    Post_5__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Post_6__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.are_you_or_have_you_been_past_12_months_in_a_sexual_relationship_na_if_not_',
    Post_7__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    Post_8__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Post_9__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.there_are_people_i_trust_with_whom_i_can_talk_about_my_status',
    Post_10__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_okay_for_two_people_with_hiv_to_have_unprotected_sex_with_each_other',
    Post_11__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_okay_for_someone_with_hiv_to_stop_taking_their_arv_as_soon_as_they_st',
    Post_12__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.when_i_have_a_choice_it_is_important_to_eat_a_variety_of_foods_including_gr',
    Post_13__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.mental_health_problems_have_nothing_to_do_with_being_lazy_or_weak_and_many_',
    Post_14__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.art_adherence_is_an_important_part_of_my_overall_health_and_well-being',
    Post_15__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.the_most_common_illnesses_of_mental_health_are_depression_and_anxiety',
    Post_16__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.biological_and_social_factors_contribute_to_females_and_males_experiencing_',
    },
    'post_challenge_nigeria_-_advanced_skills': {
    Post_1__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_have_talked_about_hiv_with_an_adult_in_the_past_two_months_outside_skillz',
    Post_2__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_have_talked_about_malaria_with_an_adult_in_the_past_two_months_outside_sk',
    Post_3__c:
    'form.post_challenge_nigeria_-_advanced_skills.unequal_power_in_relationships_can_contribute_to_the_spread_of_hiv',
    Post_4__c:
    'form.post_challenge_nigeria_-_advanced_skills.the_most_effective_way_to_avoid_getting_hiv_is_to_abstain_from_sex',
    Post_5__c: 'form.post_challenge_nigeria_-_advanced_skills.malaria_is_spread_by_standing_under_the_hot_sun',
    Post_6__c: 'form.post_challenge_nigeria_-_advanced_skills.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Post_7__c:
    'form.post_challenge_nigeria_-_advanced_skills.sleeping_under_a_mosquito_net_every_night_can_help_protect_me_from_malaria',
    Post_8__c:
    'form.post_challenge_nigeria_-_advanced_skills.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Post_9__c:
    'form.post_challenge_nigeria_-_advanced_skills.it_is_okay_for_someone_with_malaria_to_stop_taking_their_medication_as_soon',
    Post_10__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_can_abstain_from_sex_until_i_am_older_even_if_it_is_difficult',
    Post_11__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Post_12__c:
    'form.post_challenge_nigeria_-_advanced_skills.men_should_share_the_work_around_the_house_such_as_cleaning',
    Post_13__c:
    'form.post_challenge_nigeria_-_advanced_skills.it_is_the_males_responsibilty_to_make_decisions_in_a_relationship',
    Post_14__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_can_use_drugs_and_still_easily_reach_my_goals_in_life',
    Post_15__c:
    'form.post_challenge_nigeria_-_advanced_skills.when_sick_it_is_better_to_visit_the_herb_seller_than_to_visit_a_doctor_or_a',
    Post_16__c:
    'form.post_challenge_nigeria_-_advanced_skills.it_is_okay_to_use_violence_with_my_partner_if_he_or_she_makes_me_angry',
    Post_17__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_have_the_power_to_change_gender_expectations_that_i_do_not_agree_with',
    },
    'post_challenge_zimbabwe_-_skillz_core_zimbabwe': {
    Post_1__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_know_what_decisions_to_make_to_achieve_my_goals',
    Post_2__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girlboy',
    Post_3__c: 'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_what_i_am_good_at',
    Post_4__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Post_5__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Post_6__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Post_7__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_access_sexual_health_services_such_as_sti_and_hiv_testi',
    Post_8__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_9__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_10__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.girls_should_be_obedient_and_should_not_disagree_with_boys',
    Post_11__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Post_12__c: 'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.my_skillz_coach_helps_me_to_be_a_better_person',
    Post_13__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Post_14__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.if_i_test_positive_for_hiv_there_will_be_someone_who_will_help_and_support_',
    Post_15__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_who_to_go_to_if_i_amsomeone_i_know_is_abused_sexually_physically_and',
    Post_16__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_who_to_go_to_if_someone_touches_me_in_a_way_that_makes_me_uncomforta',
    Post_17__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Post_18__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Post_19__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    },
    'copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe': {
    Post_1__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_know_what_decisions_to_make_to_achieve_my_goals',
    Post_2__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_dont_always_have_to_do_what_people_expect_just_because_i_am_girlboy',
    Post_3__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Post_4__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_can_make_my_own_informed_decisions_about_my_sexual_health',
    Post_5__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_6__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_7__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.my_skillz_coach_helps_me_to_be_a_better_person',
    Post_8__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advise_or_when_i_have_a',
    Post_9__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    },
    'post_challenge_skillz_girl_-_zam_311': {
    Post_1__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_what_i_am_good_at',
    Post_2__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_how_to_overcome_challenges_that_i_may_face_in_my_life',
    Post_3__c: 'form.post_challenge_skillz_girl_-_zam_311.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girl',
    Post_4__c: 'form.post_challenge_skillz_girl_-_zam_311.i_would_be_able_to_ask_my_boyfriend_that_i_want_to_use_a_condom',
    Post_5__c: 'form.post_challenge_skillz_girl_-_zam_311.i_can_say_no_to_sex_even_if_my_boyfriend_or_friends_pressure_me_to_have_sex',
    Post_6__c: 'form.post_challenge_skillz_girl_-_zam_311.if_i_am_sexually_active_i_go_to_a_healthcare_provider_to_get_protection_fro',
    Post_7__c: 'form.post_challenge_skillz_girl_-_zam_311.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Post_8__c: 'form.post_challenge_skillz_girl_-_zam_311.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Post_9__c: 'form.post_challenge_skillz_girl_-_zam_311.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_10__c: 'form.post_challenge_skillz_girl_-_zam_311.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_or_wife',
    Post_11__c: 'form.post_challenge_skillz_girl_-_zam_311.a_successful_marriage_is_more_important_to_girls_than_completing_school',
    Post_12__c: 'form.post_challenge_skillz_girl_-_zam_311.a_daughter_should_always_respect_her_parents_decision_for_her_to_get_marrie',
    Post_13__c: 'form.post_challenge_skillz_girl_-_zam_311.i_can_decide_when_is_the_right_time_for_me_to_have_a_baby',
    Post_14__c: 'form.post_challenge_skillz_girl_-_zam_311.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Post_15__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Post_16__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_gender_base',
    Post_17__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_prevention_',
    Post_18__c: 'form.post_challenge_skillz_girl_-_zam_311.one_sign_of_pregnancy_is_a_girl_missing_her_period',
    Post_19__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_at_least_three_methods_to_avoid_an_unwanted_pregnancy',
    Post_20__c: 'form.post_challenge_skillz_girl_-_zam_311.are_you_or_your_boyfriend_currently_using_any_contraceptive_method',
    },
    'post_challenge_skillz_core_zambia_211': {
    Post_1__c: 'form.post_challenge_skillz_core_zambia_211.question1',
    Post_2__c: 'form.post_challenge_skillz_core_zambia_211.i_know_how_to_overcome_challenges_i_may_have_in_my_life',
    Post_3__c: 'form.post_challenge_skillz_core_zambia_211.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Post_4__c: 'form.post_challenge_skillz_core_zambia_211.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_5__c: 'form.post_challenge_skillz_core_zambia_211.i_dont_always_have_to_do_what_people_expect_because_i_am_a_boygirl',
    Post_6__c: 'form.post_challenge_skillz_core_zambia_211.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_7__c: 'form.post_challenge_skillz_core_zambia_211.girls_should_not_disagree_with_boys',
    Post_8__c: 'form.post_challenge_skillz_core_zambia_211.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Post_9__c: 'form.post_challenge_skillz_core_zambia_211.i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Post_10__c: 'form.post_challenge_skillz_core_zambia_211.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Post_11__c: 'form.post_challenge_skillz_core_zambia_211.if_i_test_positive_for_hivthere_will_be_someone_who_will_help_and_support_m',
    Post_12__c: 'form.post_challenge_skillz_core_zambia_211.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Post_13__c: 'form.post_challenge_skillz_core_zambia_211.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Post_14__c: 'form.post_challenge_skillz_core_zambia_211.i_know_where_to_get_support_services_for_me_or_someone_elsefor_hiv_-_relate',
    Post_15__c: 'form.post_challenge_skillz_core_zambia_211.i_know_where_to_get_support_services_for_me_or_someone_elsefor_abuse',
    Post_16__c: 'form.post_challenge_skillz_core_zambia_211.i_have_the_right_to_access_sexual_health_servicessuch_as_sti_and_hiv_testin',
    Post_17__c: 'form.post_challenge_skillz_core_zambia_211.one_sign_of_pregnancy_is_a_girl_missing_her_period',
    Post_18__c: 'form.post_challenge_skillz_core_zambia_211.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Post_19__c: 'form.post_challenge_skillz_core_zambia_211.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    Post_20__c: 'form.post_challenge_skillz_core_zambia_211.i_know_what_decisions_to_make_to_achieve_my_goals',
    },
    'post_challenge_skillz_boy_zambia110': {
    Post_1__c: 'form.post_challenge_skillz_boy_zambia110.in_general_i_feel_good_about_myself',
    Post_2__c: 'form.post_challenge_skillz_boy_zambia110.i_would_be_able_to_ask_my_girlfriend_that_i_want_to_use_a_condom',
    Post_3__c: 'form.post_challenge_skillz_boy_zambia110.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_boy',
    Post_4__c: 'form.post_challenge_skillz_boy_zambia110.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_5__c: 'form.post_challenge_skillz_boy_zambia110.it_is_more_important_for_boys_to_be_educated_than_girls',
    Post_6__c: 'form.post_challenge_skillz_boy_zambia110.men_are_better_leaders_than_women',
    Post_7__c: 'form.post_challenge_skillz_boy_zambia110.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_8__c: 'form.post_challenge_skillz_boy_zambia110.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Post_9__c: 'form.post_challenge_skillz_boy_zambia110.it_is_okay_for_a_boyfriend_to_threaten_to_hit_his_girlfriend_if_he_never_hi',
    Post_10__c: 'form.post_challenge_skillz_boy_zambia110.i_can_say_no_to_sex_even_if_my_friends_or_girlfriend_pressure_me_to_have_se',
    Post_11__c: 'form.post_challenge_skillz_boy_zambia110.people_who_abuse_alcohol_are_more_likely_to_engage_in_risky_sexual_behaviou',
    Post_12__c: 'form.post_challenge_skillz_boy_zambia110.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_13__c: 'form.post_challenge_skillz_boy_zambia110.i_have_a_friend_that_i_can_go_to_for_advice_when_i_have_a_problem',
    Post_14__c: 'form.post_challenge_skillz_boy_zambia110.i_have_the_right_to_access_sexual_health_services_such_as_hiv_and_sti_testi',
    Post_15__c: 'form.post_challenge_skillz_boy_zambia110.i_know_where_to_access_sexual_health_services_such_as_sti_and_hiv_testing',
    Post_16__c: 'form.post_challenge_skillz_boy_zambia110.before_making_a_decision_i_think_about_how_it_can_affect_me_or_others',
    Post_17__c: 'form.post_challenge_skillz_boy_zambia110.i_know_how_to_express_my_anger_without_being_violent_such_as_hitting_kickin',
    Post_18__c: 'form.post_challenge_skillz_boy_zambia110.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Post_19__c: 'form.post_challenge_skillz_boy_zambia110.i_know_how_to_correctly_use_a_male_condom',
    Post_20__c: 'form.post_challenge_skillz_boy_zambia110.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    },
    'post_challenge_skillz_guyz_mh_-_sa_100':{
    Post_1__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_have_to_be_respectful_communicate_and_take_action_to_be_a_role_model_in_m',
    Post_2__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_have_skills_that_help_me_bounce_back_from_difficult_situations',
    Post_3__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_can_identify_my_strengths_or_things_that_i_am_good_at',
    Post_4__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.when_i_am_angry_i_know_how_to_avoid_using_violent_behaviour',
    Post_5__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.when_i_express_my_feelings_clearly_people_understand_me_better',
    Post_6__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Post_7__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.sadness_and_a_loss_of_pleasure_in_things_you_enjoy_are_common_symptoms_of_d',
    Post_8__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_know_where_to_access_health_services_and_mental_health_services',
    Post_9__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_will_share_accurate_information_about_mental_health_services_to_avoid_sti',
    Post_10__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Post_11__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.men_should_share_the_work_around_the_house_such_as_cleaning_and_taking_care',
    Post_12__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.its_okay_for_a_guy_to_beat_a_girl_when_there_is_a_misunderstanding',
    Post_13__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_should_respect_the_rights_of_others_such_as_their_right_to_their_own_opin',
    Post_14__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_feel_confident_setting_my_goals',
    Post_15__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.stress_is_a_normal_part_of_life',
    Post_16__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Post_17__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.there_are_people_i_trust_with_whom_i_can_talk_to_about_my_mental_health',
    Post_18__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_have_no_fear_or_shame_when_accessing_health_services_or_mental_health_ser',
    Post_19__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Post_20__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Post_21__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_can_stand_up_to_peer_pressure_when_i_have_to',
    Post_22__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_should_use_a_condom_even_if_my_girlfriend_is_on_another_form_of_birth_con',
    Post_23__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_know_where_to_go_for_support_if_i_or_someone_i_know_abuses_alcohol',
    },
    'post_challenge_mindskillz-_zambia_100': {
    Post_1__c:'form.post_challenge_mindskillz-_zambia_100.when_i_express_my_feelings_clearly_people_understand_me_better',
    Post_2__c:'form.post_challenge_mindskillz-_zambia_100.i_have_skills_that_help_me_bounce_back_from_difficult_situations',
    Post_3__c:'form.post_challenge_mindskillz-_zambia_100.stress_is_a_normal_part_of_life',
    Post_4__c:'form.post_challenge_mindskillz-_zambia_100.i_can_reach_my_goals_in_life',
    Post_5__c:'form.post_challenge_mindskillz-_zambia_100.if_i_have_a_problem_i_have_someone_in_my_life_i_can_go_to_for_support',
    Post_6__c:'form.post_challenge_mindskillz-_zambia_100.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_7__c:'form.post_challenge_mindskillz-_zambia_100.self_control_helps_you_make_smart_decisions_when_you_are_angry_or_upset',
    Post_8__c:'form.post_challenge_mindskillz-_zambia_100.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Post_9__c:'form.post_challenge_mindskillz-_zambia_100.i_know_how_to_express_my_anger_without_being_violent',
    Post_10__c:'form.post_challenge_mindskillz-_zambia_100.listening_carefully_to_others_is_an_important_communication_skill',
    Post_11__c:'form.post_challenge_mindskillz-_zambia_100.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Post_12__c:'form.post_challenge_mindskillz-_zambia_100.i_can_understand_how_others_are_feeling_and_be_sensitive_to_their_emotions',
    Post_13__c:'form.post_challenge_mindskillz-_zambia_100.i_am_confident_that_i_know_where_to_seek_information_about_mental_illness',
    Post_14__c:'form.post_challenge_mindskillz-_zambia_100.i_am_confident_using_the_computer_or_telephone_to_seek_information_about_me',
    Post_15__c:'form.post_challenge_mindskillz-_zambia_100.i_am_confident_attending_face_to_face_appointments_to_seek_information_abou',
    Post_16__c:'form.post_challenge_mindskillz-_zambia_100.i_am_confident_i_have_access_to_resources_eg_doctor_internet_friends_that_i',
    Post_17__c:'form.post_challenge_mindskillz-_zambia_100.people_with_mental_illness_could_snap_out_of_it_if_they_wanted',
    Post_18__c:'form.post_challenge_mindskillz-_zambia_100.a_mental_illness_is_a_sign_of_personal_weakness',
    Post_19__c:'form.post_challenge_mindskillz-_zambia_100.a_mental_illness_is_not_a_real_medical_illness',
    Post_20__c:'form.post_challenge_mindskillz-_zambia_100.people_with_mental_illness_are_dangerous',
    Post_21__c:'form.post_challenge_mindskillz-_zambia_100.it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi',
    Post_22__c:'form.post_challenge_mindskillz-_zambia_100.if_i_had_a_mental_illness_i_would_not_tell_anyone',
    Post_23__c:'form.post_challenge_mindskillz-_zambia_100.seeing_a_mental_health_professional_means_you_are_not_strong_enough_to_mana',
    Post_24__c:'form.post_challenge_mindskillz-_zambia_100.if_i_had_mental_illness_i_would_not_seek_help_from_a_mental_health_professi',
    Post_25__c:'form.post_challenge_mindskillz-_zambia_100.i_believe_treatment_for_a_mental_illness_provided_by_a_mental_health_profes',
    },
    'post_challenge_skillz_girl_nih200': {
    Post_1__c:'form.post_challenge_skillz_girl_nih200.i_have_talked_about_hiv_with_an_adult_in_the_past_two_months_outside_skillz',
    Post_2__c:'form.post_challenge_skillz_girl_nih200.i_have_talked_about_hiv_with_a_friend_in_the_past_two_months_outside_skillz',
    Post_3__c:'form.post_challenge_skillz_girl_nih200.having_sex_with_an_older_partner_increases_my_risk_of_getting_hiv',
    Post_4__c:'form.post_challenge_skillz_girl_nih200.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Post_5__c:'form.post_challenge_skillz_girl_nih200.i_know_someone_in_my_community_who_distributes_contraceptives_and_other_sex',
    Post_6__c:'form.post_challenge_skillz_girl_nih200.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Post_7__c:'form.post_challenge_skillz_girl_nih200.i_have_the_right_to_say_no_to_sex_no_matter_who_asks',
    Post_8__c:'form.post_challenge_skillz_girl_nih200.as_a_girl_i_have_a_greater_risk_of_getting_hiv_than_boys',
    Post_9__c:'form.post_challenge_skillz_girl_nih200.i_know_where_to_get_support_services_for_rape',
    Post_10__c:'form.post_challenge_skillz_girl_nih200.if_a_girl_is_sexually_abused_she_can_reduce_her_risk_of_getting_hiv_by_taki',
    Post_11__c:'form.post_challenge_skillz_girl_nih200.i_feel_good_about_being_a_girl',
    Post_12__c:'form.post_challenge_skillz_girl_nih200.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_13__c:'form.post_challenge_skillz_girl_nih200.boys_should_share_the_work_around_the_home_such_as_household_chores',
    Post_14__c:'form.post_challenge_skillz_girl_nih200.i_know_what_i_want_to_be_after_finishing_secondary_school',
    Post_15__c:'form.post_challenge_skillz_girl_nih200.if_i_have_a_problem_i_have_someone_in_my_life_i_can_talk_to_for_advise',
    Post_16__c:'form.post_challenge_skillz_girl_nih200.a_boyfriend_may_have_good_reason_to_hit_his_girlfriend',
    Post_17__c:'form.post_challenge_skillz_girl_nih200.i_would_tell_someone_if_i_were_touched_in_a_manner_that_made_me_uncomfortab',
    Post_18__c:'form.post_challenge_skillz_girl_nih200.i_can_reach_my_goals_in_life',
    Post_19__c:'form.post_challenge_skillz_girl_nih200.a_girl_should_wait_to_get_married_until_after_college',
    Post_20__c:'form.post_challenge_skillz_girl_nih200.biological_and_social_factors_contribute_to_females_and_males_experiencing_',
    Post_21__c:'form.post_challenge_skillz_girl_nih200.the_most_common_illness_of_mental_health_are_depression_and_anxiety',
    Post_22__c:'form.post_challenge_skillz_girl_nih200.mental_health_problems_have_nothing_to_do_with_being_lazy_or_weak_and_many_',
    Post_23__c:'form.post_challenge_skillz_girl_nih200.i_am_ready_to_take_an_hiv_test',
    Post_24__c:'form.post_challenge_skillz_girl_nih200.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    },
    'post_challenge_mindskillz_pamumvuri':{
    Post_1__c: 'form.post_challenge_mindskillz_pamumvuri.when_i_express_my_feelings_clearly_people_understand_me_better',
    Post_2__c: 'form.post_challenge_mindskillz_pamumvuri.have_skills_that_help_me_bounce_back_from_difficult_situations',
    Post_3__c: 'form.post_challenge_mindskillz_pamumvuri.stress_is_a_normal_part_of_life',
    Post_4__c: 'form.post_challenge_mindskillz_pamumvuri.i_can_reach_my_goals_in_life',
    Post_5__c: 'form.post_challenge_mindskillz_pamumvuri.if_i_have_a_problem_i_have_someone_in_my_life_i_can_go_to_for_support',
    Post_6__c: 'form.post_challenge_mindskillz_pamumvuri.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_7__c: 'form.post_challenge_mindskillz_pamumvuri.self_control_helps_you_make_smart_decisions_when_you_are_angry_or_upset',
    Post_8__c: 'form.post_challenge_mindskillz_pamumvuri.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Post_9__c: 'form.post_challenge_mindskillz_pamumvuri.i_know_how_to_express_my_anger_without_being_violent',
    Post_10__c: 'form.post_challenge_mindskillz_pamumvuri.listening_carefully_to_others_is_an_important_communication_skill',
    Post_11__c: 'form.post_challenge_mindskillz_pamumvuri.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Post_12__c: 'form.post_challenge_mindskillz_pamumvuri.i_can_understand_how_others_are_feeling_and_be_sensitive_to_their_emotions',
    Post_13__c: 'form.post_challenge_mindskillz_pamumvuri.i_am_confident_that_i_know_where_to_seek_information_about_mental_illness',
    Post_14__c: 'form.post_challenge_mindskillz_pamumvuri.i_am_confident_using_the_computer_or_telephone_to_seek_information_about_me',
    Post_15__c: 'form.post_challenge_mindskillz_pamumvuri.i_am_confident_attending_face_to_face_appointments_to_seek_information_abou',
    Post_16__c: 'form.post_challenge_mindskillz_pamumvuri.i_am_confident_i_have_access_to_resources_eg_doctor_internet_friends_that_i',
    Post_17__c: 'form.post_challenge_mindskillz_pamumvuri.people_with_mental_illness_could_snap_out_of_it_if_they_wanted',
    Post_18__c: 'form.post_challenge_mindskillz_pamumvuri.a_mental_illness_is_a_sign_of_personal_weakness',
    Post_19__c: 'form.post_challenge_mindskillz_pamumvuri.a_mental_illness_is_not_a_real_medical_illness',
    Post_20__c: 'form.post_challenge_mindskillz_pamumvuri.people_with_mental_illness_are_dangerous',
    Post_21__c: 'form.post_challenge_mindskillz_pamumvuri.it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi',
    Post_22__c: 'form.post_challenge_mindskillz_pamumvuri.if_i_had_a_mental_illness_i_would_not_tell_anyone',
    Post_23__c: 'form.post_challenge_mindskillz_pamumvuri.seeing_a_mental_health_professional_means_you_are_not_strong_enough_to_mana',
    Post_24__c: 'form.post_challenge_mindskillz_pamumvuri.if_i_had_mental_illness_i_would_not_seek_help_from_a_mental_health_professi',
    Post_25__c: 'form.post_challenge_mindskillz_pamumvuri.i_believe_treatment_for_a_mental_illness_provided_by_a_mental_health_profes',

    },

    'post_challenge_south_africa_-_skillz_girl_mh_sa_211':{
    Post_1__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_my_rights_and_responsibilities',
    Post_2__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_3__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Post_4__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.stress_is_a_normal_part_of_life',
    Post_5__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.like_physical_health_we_all_have_mental_health',
    Post_6__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Post_7__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.healthy_relationships_are_based_on_healthy_communication_and_mutual_respect',
    Post_8__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_partner_or_wif',
    Post_9__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Post_10__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Post_11__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.taking_prep_and_using_a_condom_can_lower_my_risk_of_getting_hiv',
    Post_12__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_13__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Post_14__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.post_exposure_prophylaxis_pep_can_reduce_my_risk_of_getting_hiv_if_taken_1-',
    Post_15__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.it_is_my_right_to_access_health_services',
    Post_16__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_have_an_adult_or_someone_in_my_life_i_can_go_to_for_advice',
    Post_17__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_give_support_and_encouragement_to_a_friend_or_family_member_who_is_li',
    Post_18__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.using_a_condom_and_another_contraceptive_method_can_help_prevent_unwanted_p',
    Post_19__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Post_20__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.drinking_too_much_alcohol_can_harm_the_body_and_the_mind',
    },

    'post_challenge_skillz_girl_abbreviated_south_africa':{
    Post_1__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_my_rights_and_responsibilities',
    Post_2__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_3__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Post_4__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.stress_is_a_normal_part_of_life',
    Post_5__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.like_physical_health_we_all_have_mental_health',
    Post_6__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Post_7__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.in_a_relationship_it_is_both_partners_responsibility_to_prevent_unwanted_pr',
    Post_8__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.healthy_relationships_are_based_on_healthy_communication_and_respect',
    Post_9__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_partner_or_wif',
    Post_10__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.a_person_has_the_right_to_have_sex_with_their_partner_even_if_the_partner_d',
    Post_11__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Post_12__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Post_13__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.taking_prep_and_using_a_condom_can_lower_my_risk_of_getting_hiv',
    Post_14__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_15__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Post_16__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_can_use_coping_skills_to_handle_stress',
    Post_17__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.post_exposure_prophylaxis_pep_can_reduce_my_risk_of_getting_hiv_if_taken_1-',
    Post_18__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.it_is_my_right_to_access_health_services',
    Post_19__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_have_an_adult_or_someone_in_my_life_i_can_go_to_for_advice',
    Post_20__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.using_a_condom_and_another_contraceptive_method_can_help_prevent_unwanted_p',
    Post_21__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Post_22__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.drinking_too_much_alcohol_can_harm_the_body_and_mind',
    Post_23__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_at_least_two_ways_of_saving_money',
    Post_24__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.a_budget_is_the_estimated_income_and_expenses_for_a_certain_time_period',
    Post_25__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.accepting_money_for_sexual_favors_can_create_risks_to_my_health_and_safety',
    Post_26__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.using_assertive_communication_means_respectfully_sharing_my_thoughts_and_fe',
    Post_27__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_have_the_right_to_access_emergency_contraception',
    Post_28__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.if_a_girl_has_unprotected_sex_and_misses_her_period_this_could_mean_she_is_',
    }

    };

    const pluckSfValue = val => {
    // if sfFieldMapping[formVersion][val] == undefined
    return sfFieldMapping[formVersion][val];
    };

    return { ...state, formVersion, pluckSfValue };
    });

    fn(state => {
    if (state.formVersion == 'post_challenge_ecap_-_post_-_season_survey_for_athletes') {
    return state;
    }
    const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);

    if (!PID) {
    console.log(
    `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.case['@case_id']}`
    );
    return state;
    }

    return upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    //field('Event__c', dataValue('form.hidden_properties.intervention_name')),

    // field('CommCare_Ext_ID__c', state => {
    // const value =
    // dataValue('form.case.@case_id')(state) +
    // '-' +
    // toUTF8(dataValue('form.hidden_properties.intervention_name')(state)).replace(/\//gi, '');
    // return scrubEmojis(value, '');
    // }),
    field("CommCare_Ext_ID__c", (state) => {
    return toUTF8(`${dataValue("form.case.@case_id")(state)}-${scrubEmojis(
    dataValue("form.hidden_properties.intervention_name")(state),
    ""
    ).replace(/\//gi, "")}`);
    }),

    //relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.hidden_properties.intervention_name')),
    relationship('Person_Attendance__r', 'Participant_Identification_Number_PID__c', dataValue('form.case.@case_id')),
    field('Pre_Post_Completed__c', state => {
    var done = dataValue('form.hidden_properties.post_questionnaire_complete')(state);
    return done === 'Yes' ? true : done === 'No' ? false : undefined;
    }),
    field('Date_Post_Administered__c', dataValue('form.hidden_properties.date')),
    field('Post_1__c', state => {
    const value = dataValue(state.pluckSfValue('Post_1__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_2__c', state => {
    if (state.pluckSfValue('Post_2__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_2__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Post_3__c', state => {
    const value = dataValue(state.pluckSfValue('Post_3__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Post_4__c', state => {
    const value = dataValue(state.pluckSfValue('Post_4__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Post_5__c', state => {
    const value = dataValue(state.pluckSfValue('Post_5__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_6__c', state => {
    const value = dataValue(state.pluckSfValue('Post_6__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_7__c', state => {
    const value = dataValue(state.pluckSfValue('Post_7__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_8__c', state => {
    const value = dataValue(state.pluckSfValue('Post_8__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_9__c', state => {
    const value = dataValue(state.pluckSfValue('Post_9__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_10__c', state => {
    if (state.pluckSfValue('Post_10__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_10__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_11__c', state => {
    if (state.pluckSfValue('Post_11__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_10__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_12__c', state => {
    if (state.pluckSfValue('Post_12__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_12__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_13__c', state => {
    if (state.pluckSfValue('Post_13__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_13__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_14__c', state => {
    if (state.pluckSfValue('Post_14__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_14__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_15__c', state => {
    if (state.pluckSfValue('Post_15__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_15__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_16__c', state => {
    if (state.pluckSfValue('Post_16__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_16__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_17__c', state => {
    if (state.pluckSfValue('Post_17__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_17__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_18__c', state => {
    if (state.pluckSfValue('Post_18__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_18__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_19__c', state => {
    if (state.pluckSfValue('Post_19__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_19__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_20__c', state => {
    if (state.pluckSfValue('Post_20__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_20__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_21__c', state => {
    if (state.pluckSfValue('Post_21__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_21__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_22__c', state => {
    if (state.pluckSfValue('Post_22__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_22__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_23__c', state => {
    if (state.pluckSfValue('Post_23__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_23__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_24__c', state => {
    if (state.pluckSfValue('Post_24__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_24__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_25__c', state => {
    if (state.pluckSfValue('Post_25__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_25__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_26__c', state => {
    if (state.pluckSfValue('Post_26__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Post_26__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_27__c', state => {
    if (state.pluckSfValue('Post_27__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Post_27__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_28__c', state => {
    if (state.pluckSfValue('Post_28__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Post_28__c'))(state);
    return state.helperFunctions.transform(value);
    })
    )
    )(state);
    });

    //Removing mapping... need case_id to upsert Events. Date_of_Post__c update should be handled on the SF side.
    /*upsert(
    'Event__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('form.hidden_properties.intervention_name')),
    field('Date_of_Post__c', dataValue('form.date')),
    )
    );*/

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30.html index 60ed2ae7c8d..f27cff24684 100644 --- a/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Pre Challenges

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, lastReferenceValue, query, relationship, upsert

    Expression

    fn(state => {
    function transform(value) {
    if (!value) return;
    //console.log("value in switch", value.toString().trim().toLowerCase());
    switch (value.toString().trim().toLowerCase()) {
    case 'true':
    case 'yes':
    case 'agree':
    case 'verdade':
    case 'concorda':
    case 'concordo':
    case 'choice1':
    return 1;
    case 'false':
    case 'no':
    case 'disagree':
    case 'discorda':
    case 'discordo':
    case 'falso':
    case 'choice6':
    case 'choice3':
    return 2;
    case 'i_dont_know':
    case 'na':
    return 3;
    case 'unanswered':
    return 4;
    case 'not_applicable':
    return 5;
    default:
    return value;
    }
    }

    state.helperFunctions = { transform };

    return query(
    `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.case['@case_id']}'`
    )(state);
    });

    fn(state => {
    const { form } = state.data;

    const formVersion = Object.keys(form).find(key => key.includes('pre_challenge'));

    console.log("form version", formVersion);

    const sfFieldMapping = {
    'pre_challenge_south_africa_-_skillz_girl': {
    Pre_1__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_have_an_older_person_in_my_life_i_can_go_to_for_advice_i_have_an_older_pe',
    Pre_2__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_how_to_make_a_plan_to_deal_with_the_challenges_i_may_face_in_reachin',
    Pre_3__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_4__c: 'form.pre_challenge_south_africa_-_skillz_girl.every_day_i_can_find_something_to_be_grateful_for',
    Pre_5__c: 'form.pre_challenge_south_africa_-_skillz_girl.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Pre_6__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Pre_7__c: 'form.pre_challenge_south_africa_-_skillz_girl.girls_have_a_greater_risk_of_contracting_hiv_than_boys',
    Pre_8__c: 'form.pre_challenge_south_africa_-_skillz_girl.if_i_am_sexually_active_i_go_to_a_clinic_to_get_protection_from_hivstis_and',
    Pre_9__c: 'form.pre_challenge_south_africa_-_skillz_girl.like_physical_health_we_all_have_mental_health',
    Pre_10__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_11__c: 'form.pre_challenge_south_africa_-_skillz_girl.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Pre_12__c: 'form.pre_challenge_south_africa_-_skillz_girl.if_a_girl_is_sexually_abused_she_can_reduce_her_risk_of_getting_hiv_by_goin',
    Pre_13__c: 'form.pre_challenge_south_africa_-_skillz_girl.sometimes_a_man_may_have_a_good_reason_to_hit_his_partner',
    Pre_14__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Pre_15__c: 'form.pre_challenge_south_africa_-_skillz_girl.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Pre_16__c: 'form.pre_challenge_south_africa_-_skillz_girl.if_sexually_active_i_or_my_partner_is_using_a_prevention_method_to_protect_',
    Pre_17__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_where_to_go_to_receive_counselling_for_mental_health_challenges',
    Pre_18__c: 'form.pre_challenge_south_africa_-_skillz_girl.loss_of_interest_in_funenjoyable_activities_is_a_common_sign_of_depression',
    Pre_19__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_at_least_three_methods_to_prevent_an_unwanted_pregnancy',
    },
    'portuguese_pre_challenge_gcr_-_skillz_malaria': {
    Pre_1__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.dormir_dentro_da_rede_mosquiteira_tratada_todas_as_noites_pode_proteger_me_',
    Pre_2__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.posso_esperar_uns_dias_antes_de_fazer_o_teste_de_malria_se_tiver_febres',
    Pre_3__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.um_mdico_tradicionalcurandeiro_pode_me_dar_um_tratamento_para_curar_a_malri',
    Pre_4__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.se_tiver_malria_e_no_for_tratado_posso_transmitir_a_malria_a_algum',
    Pre_5__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.somente_as_mulheres_grvidas_e_as_crianas_menores_de_5_anos__que_precisam_de',
    Pre_6__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.a_malria_pode_matar_se_no_fr_tratada',
    Pre_7__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.a_febre__um_sintoma_da_malria',
    Pre_8__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.eu_me_sinto_bem_conmigo_mesmo',
    Pre_9__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.tenho_algum_na_minha_vida_que_pode_me_dar_bons_conselhos_quando_preciso_de_',
    Pre_10__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.eu_sei_onde_posso_ter_tratamento_para_malria_na_minha_comunidade',
    Pre_11__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.posso_proteger-me_da_malria',
    },

    'portuguese_pre_challenge_gcr_-_skillz_girl': {
    Pre_1__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.falei_sobre_o_hiv_com_uma_pessoa_adulta_nos_ltimos_2_meses_fora_do_skillz',
    Pre_2__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.sei_como_expressar_a_minha_raiva_sem_ser_violento',
    Pre_3__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.sei_como_superar_os_desafios_que_possa_enfrentar_na_minha_vida',
    Pre_4__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.sei_quais_as_decises_a_tomar_para_alcanar_os_meus_objectivos',
    Pre_5__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.os_rapazes_correm_um_risco_mais_elevado_de_serem_vtimas_de_violncia_do_que_',
    Pre_6__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.conheco_que_mudanas_ocorrem_no_meu_corpo_durante_a_puberdade',
    Pre_7__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.conheo_pelo_menos_trs_mtodos_para_evitar_uma_gravidez_indesejada',
    Pre_8__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.os_preservativos_so_o_nico_mtodo_contraceptivo_que_protege_contra_a_gravide',
    Pre_9__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.conheco_onde_obter_servios_de_apoio_para_mim_ou_outra_pessoa_para_casos_de_',
    Pre_10__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.se_uma_rapariga_inicia_seu_perodo_menstrual_significa_que_est_pronta_para_c',
    Pre_11__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.caso_eu_seja_abusada_sexualmente_prefiro_guard-lo_para_mim_para_evitar_que_',
    Pre_12__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.um_homem_tem_o_direito_de_ter_sexo_com_a_sua_namorada_mesmo_que_ela_no_o_qu',
    Pre_13__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.pessoas_com_problemas_de_sade_mental_so_apenas_confusas_ou_loucas',
    Pre_14__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.pessoas_com_problemas_de_sade_mental_so_apenas_confusas_ou_loucas',
    Pre_15__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.informaria_a_algum_caso_fosse_tocada_por_alguem_de_uma_forma_que_me_deixass',
    Pre_16__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.uma_filha_deve_sempre_respeitar_a_deciso_dos_seus_pais_para_se_casar',
    Pre_17__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.um_casamento_bem_sucedido__mais_importante_para_as_raparigas_do_que_termina',
    Pre_18__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.eu_no_praticaria_desporto_com_algum_que_tem_hiv',
    Pre_19__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.um_namorado_pode_ter_boas_razes_para_bater_na_sua_namorada',
    Pre_20__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.no_faz_mal_que_um_rapaz_ameace_bater_na_sua_namorada_se_nunca_a_bater_fisic',
    },
    'pre_challenge_zambia_-_plus_mh_enhanced_zambia': {
    Pre_1__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.in_general_i_feel_good_about_myself',
    Pre_2__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.i_have_the_skills_and_knowledge_to_avoid_getting_infected_with_another_kind',
    Pre_3__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_important_to_know_why_and_how_i_want_to_tell_someone_my_hiv_status',
    Pre_4__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.i_accept_myself_and_my_hiv_status',
    Pre_5__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Pre_6__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.are_you_or_have_you_been_past_12_months_in_a_sexual_relationship_na_if_not_',
    Pre_7__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    Pre_8__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Pre_9__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.there_are_people_i_trust_with_whom_i_can_talk_about_my_status',
    Pre_10__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_okay_for_two_people_with_hiv_to_have_unprotected_sex_with_each_other',
    Pre_11__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_okay_for_someone_with_hiv_to_stop_taking_their_arv_as_soon_as_they_st',
    Pre_12__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.when_i_have_a_choice_it_is_important_to_eat_a_variety_of_foods_including_gr',
    Pre_13__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.mental_health_problems_have_nothing_to_do_with_being_lazy_or_weak_and_many_',
    Pre_14__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.art_adherence_is_an_important_part_of_my_overall_health_and_well-being',
    Pre_15__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.the_most_common_illnesses_of_mental_health_are_depression_and_anxiety',
    Pre_16__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.biological_and_social_factors_contribute_to_females_and_males_experiencing_',
    },
    'pre_challenge_nigeria_-_advanced_skills':{
    Pre_1__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_have_talked_about_hiv_with_an_adult_in_the_past_two_months_outside_skillz',
    Pre_2__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_have_talked_about_malaria_with_an_adult_in_the_past_two_months_outside_sk',
    Pre_3__c: 'form.pre_challenge_nigeria_-_advanced_skills.unequal_power_in_relationships_can_contribute_to_the_spread_of_hiv',
    Pre_4__c: 'form.pre_challenge_nigeria_-_advanced_skills.the_most_effective_way_to_avoid_getting_hiv_is_to_abstain_from_sex',
    Pre_5__c: 'form.pre_challenge_nigeria_-_advanced_skills.malaria_is_spread_by_standing_under_the_hot_sun',
    Pre_6__c: 'form.pre_challenge_nigeria_-_advanced_skills.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Pre_7__c: 'form.pre_challenge_nigeria_-_advanced_skills.sleeping_under_a_mosquito_net_every_night_can_help_protect_me_from_malaria',
    Pre_8__c: 'form.pre_challenge_nigeria_-_advanced_skills.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Pre_9__c: 'form.pre_challenge_nigeria_-_advanced_skills.it_is_okay_for_someone_with_malaria_to_stop_taking_their_medication_as_soon',
    Pre_10__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_can_abstain_from_sex_until_i_am_older_even_if_it_is_difficult',
    Pre_11__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Pre_12__c: 'form.pre_challenge_nigeria_-_advanced_skills.men_should_share_the_work_around_the_house_such_as_cleaning',
    Pre_13__c: 'form.pre_challenge_nigeria_-_advanced_skills.it_is_the_males_responsibilty_to_make_decisions_in_a_relationship',
    Pre_14__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_can_use_drugs_and_still_easily_reach_my_goals_in_life',
    Pre_15__c: 'form.pre_challenge_nigeria_-_advanced_skills.when_sick_it_is_better_to_visit_the_herb_seller_than_to_visit_a_doctor_or_a',
    Pre_16__c: 'form.pre_challenge_nigeria_-_advanced_skills.it_is_okay_to_use_violence_with_my_partner_if_he_or_she_makes_me_angry',
    Pre_17__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_have_the_power_to_change_gender_expectations_that_i_do_not_agree_with',
    },
    'pre_challenge_zimbabwe_-_skillz_core_zimbabwe': {
    Pre_1__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_know_what_decisions_to_make_to_achieve_my_goals',
    Pre_2__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girlboy',
    Pre_3__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_what_i_am_good_at',
    Pre_4__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Pre_5__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Pre_6__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Pre_7__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_access_sexual_health_services_such_as_sti_and_hiv_testi',
    Pre_8__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_9__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_10__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.girls_should_be_obedient_and_should_not_disagree_with_boys',
    Pre_11__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Pre_12__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.my_skillz_coach_helps_me_to_be_a_better_person',
    Pre_13__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Pre_14__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.if_i_test_positive_for_hiv_there_will_be_someone_who_will_help_and_support_',
    Pre_15__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_who_to_go_to_if_i_amsomeone_i_know_is_abused_sexually_physically_and',
    Pre_16__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_who_to_go_to_if_someone_touches_me_in_a_way_that_makes_me_uncomforta',
    Pre_17__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Pre_18__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Pre_19__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    },
    'pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe': {
    Pre_1__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_know_what_decisions_to_make_to_achieve_my_goals',
    Pre_2__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_dont_always_have_to_do_what_people_expect_just_because_i_am_girlboy',
    Pre_3__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Pre_4__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_can_make_my_own_informed_decisions_about_my_sexual_health',
    Pre_5__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_6__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_7__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.my_skillz_coach_helps_me_to_be_a_better_person',
    Pre_8__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advise_or_when_i_have_a',
    Pre_9__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    },
    'pre_challenge_mindskillz-_zambia_100': {
    Pre_1__c:'form.pre_challenge_mindskillz-_zambia_100.when_i_express_my_feelings_clearly_people_understand_me_better',
    Pre_2__c:'form.pre_challenge_mindskillz-_zambia_100.i_have_skills_that_help_me_bounce_back_from_difficult_situations',
    Pre_3__c:'form.pre_challenge_mindskillz-_zambia_100.stress_is_a_normal_part_of_life',
    Pre_4__c:'form.pre_challenge_mindskillz-_zambia_100.i_can_reach_my_goals_in_life',
    Pre_5__c:'form.pre_challenge_mindskillz-_zambia_100.if_i_have_a_problem_i_have_someone_in_my_life_i_can_go_to_for_support',
    Pre_6__c:'form.pre_challenge_mindskillz-_zambia_100.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_7__c:'form.pre_challenge_mindskillz-_zambia_100.self_control_helps_you_make_smart_decisions_when_you_are_angry_or_upset',
    Pre_8__c:'form.pre_challenge_mindskillz-_zambia_100.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Pre_9__c:'form.pre_challenge_mindskillz-_zambia_100.i_know_how_to_express_my_anger_without_being_violent',
    Pre_10__c:'form.pre_challenge_mindskillz-_zambia_100.listening_carefully_to_others_is_an_important_communication_skill',
    Pre_11__c:'form.pre_challenge_mindskillz-_zambia_100.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Pre_12__c:'form.pre_challenge_mindskillz-_zambia_100.i_can_understand_how_others_are_feeling_and_be_sensitive_to_their_emotions',
    Pre_13__c:'form.pre_challenge_mindskillz-_zambia_100.i_am_confident_that_i_know_where_to_seek_information_about_mental_illness',
    Pre_14__c:'form.pre_challenge_mindskillz-_zambia_100.i_am_confident_using_the_computer_or_telephone_to_seek_information_about_me',
    Pre_15__c:'form.pre_challenge_mindskillz-_zambia_100.i_am_confident_attending_face_to_face_appointments_to_seek_information_abou',
    Pre_16__c:'form.pre_challenge_mindskillz-_zambia_100.i_am_confident_i_have_access_to_resources_eg_doctor_internet_friends_that_i',
    Pre_17__c:'form.pre_challenge_mindskillz-_zambia_100.people_with_mental_illness_could_snap_out_of_it_if_they_wanted',
    Pre_18__c:'form.pre_challenge_mindskillz-_zambia_100.a_mental_illness_is_a_sign_of_personal_weakness',
    Pre_19__c:'form.pre_challenge_mindskillz-_zambia_100.a_mental_illness_is_not_a_real_medical_illness',
    Pre_20__c:'form.pre_challenge_mindskillz-_zambia_100.people_with_mental_illness_are_dangerous',
    Pre_21__c:'form.pre_challenge_mindskillz-_zambia_100.it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi',
    Pre_22__c:'form.pre_challenge_mindskillz-_zambia_100.if_i_had_a_mental_illness_i_would_not_tell_anyone',
    Pre_23__c:'form.pre_challenge_mindskillz-_zambia_100.seeing_a_mental_health_professional_means_you_are_not_strong_enough_to_mana',
    Pre_24__c:'form.pre_challenge_mindskillz-_zambia_100.if_i_had_mental_illness_i_would_not_seek_help_from_a_mental_health_professi',
    Pre_25__c:'form.pre_challenge_mindskillz-_zambia_100.i_believe_treatment_for_a_mental_illness_provided_by_a_mental_health_profes',
    },
    'pre_challenge_skillz_girl_nih200':{
    Pre_1__c:'form.pre_challenge_skillz_girl_nih200.i_have_talked_about_hiv_with_an_adult_in_the_past_two_months_outside_skillz',
    Pre_2__c:'form.pre_challenge_skillz_girl_nih200.i_have_talked_about_hiv_with_a_friend_in_the_past_two_months_outside_skillz',
    Pre_3__c:'form.pre_challenge_skillz_girl_nih200.having_sex_with_an_older_partner_increases_my_risk_of_getting_hiv',
    Pre_4__c:'form.pre_challenge_skillz_girl_nih200.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Pre_5__c:'form.pre_challenge_skillz_girl_nih200.i_know_someone_in_my_community_who_distributes_contraceptives_and_other_sex',
    Pre_6__c:'form.pre_challenge_skillz_girl_nih200.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Pre_7__c:'form.pre_challenge_skillz_girl_nih200.i_have_the_right_to_say_no_to_sex_no_matter_who_asks',
    Pre_8__c:'form.pre_challenge_skillz_girl_nih200.as_a_girl_i_have_a_greater_risk_of_getting_hiv_than_boys',
    Pre_9__c:'form.pre_challenge_skillz_girl_nih200.i_know_where_to_get_support_services_for_rape',
    Pre_10__c:'form.pre_challenge_skillz_girl_nih200.if_a_girl_is_sexually_abused_she_can_reduce_her_risk_of_getting_hiv_by_taki',
    Pre_11__c:'form.pre_challenge_skillz_girl_nih200.i_feel_good_about_being_a_girl',
    Pre_12__c:'form.pre_challenge_skillz_girl_nih200.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_13__c:'form.pre_challenge_skillz_girl_nih200.boys_should_share_the_work_around_the_home_such_as_household_chores',
    Pre_14__c:'form.pre_challenge_skillz_girl_nih200.i_know_what_i_want_to_be_after_finishing_secondary_school',
    Pre_15__c:'form.pre_challenge_skillz_girl_nih200.if_i_have_a_problem_i_have_someone_in_my_life_i_can_talk_to_for_advise',
    Pre_16__c:'form.pre_challenge_skillz_girl_nih200.a_boyfriend_may_have_good_reason_to_hit_his_girlfriend',
    Pre_17__c:'form.pre_challenge_skillz_girl_nih200.i_would_tell_someone_if_i_were_touched_in_a_manner_that_made_me_uncomfortab',
    Pre_18__c:'form.pre_challenge_skillz_girl_nih200.i_can_reach_my_goals_in_life',
    Pre_19__c:'form.pre_challenge_skillz_girl_nih200.a_girl_should_wait_to_get_married_until_after_college',
    Pre_20__c:'form.pre_challenge_skillz_girl_nih200.biological_and_social_factors_contribute_to_females_and_males_experiencing_',
    Pre_21__c:'form.pre_challenge_skillz_girl_nih200.the_most_common_illness_of_mental_health_are_depression_and_anxiety',
    Pre_22__c:'form.pre_challenge_skillz_girl_nih200.mental_health_problems_have_nothing_to_do_with_being_lazy_or_weak_and_many_',
    Pre_23__c:'form.pre_challenge_skillz_girl_nih200.i_am_ready_to_take_an_hiv_test',
    Pre_24__c:'form.pre_challenge_skillz_girl_nih200.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    },

    'pre_challenge_mindskillz_pamumvuri':{
    Pre_1__c: 'form.pre_challenge_mindskillz_pamumvuri.when_i_express_my_feelings_clearly_people_understand_me_better',
    Pre_2__c: 'form.pre_challenge_mindskillz_pamumvuri.have_skills_that_help_me_bounce_back_from_difficult_situations',
    Pre_3__c: 'form.pre_challenge_mindskillz_pamumvuri.stress_is_a_normal_part_of_life',
    Pre_4__c: 'form.pre_challenge_mindskillz_pamumvuri.i_can_reach_my_goals_in_life',
    Pre_5__c: 'form.pre_challenge_mindskillz_pamumvuri.if_i_have_a_problem_i_have_someone_in_my_life_i_can_go_to_for_support',
    Pre_6__c: 'form.pre_challenge_mindskillz_pamumvuri.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_7__c: 'form.pre_challenge_mindskillz_pamumvuri.self_control_helps_you_make_smart_decisions_when_you_are_angry_or_upset',
    Pre_8__c: 'form.pre_challenge_mindskillz_pamumvuri.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Pre_9__c: 'form.pre_challenge_mindskillz_pamumvuri.i_know_how_to_express_my_anger_without_being_violent',
    Pre_10__c: 'form.pre_challenge_mindskillz_pamumvuri.listening_carefully_to_others_is_an_important_communication_skill',
    Pre_11__c: 'form.pre_challenge_mindskillz_pamumvuri.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Pre_12__c: 'form.pre_challenge_mindskillz_pamumvuri.i_can_understand_how_others_are_feeling_and_be_sensitive_to_their_emotions',
    Pre_13__c: 'form.pre_challenge_mindskillz_pamumvuri.i_am_confident_that_i_know_where_to_seek_information_about_mental_illness',
    Pre_14__c: 'form.pre_challenge_mindskillz_pamumvuri.i_am_confident_using_the_computer_or_telephone_to_seek_information_about_me',
    Pre_15__c: 'form.pre_challenge_mindskillz_pamumvuri.i_am_confident_attending_face_to_face_appointments_to_seek_information_abou',
    Pre_16__c: 'form.pre_challenge_mindskillz_pamumvuri.i_am_confident_i_have_access_to_resources_eg_doctor_internet_friends_that_i',
    Pre_17__c: 'form.pre_challenge_mindskillz_pamumvuri.people_with_mental_illness_could_snap_out_of_it_if_they_wanted',
    Pre_18__c: 'form.pre_challenge_mindskillz_pamumvuri.a_mental_illness_is_a_sign_of_personal_weakness',
    Pre_19__c: 'form.pre_challenge_mindskillz_pamumvuri.a_mental_illness_is_not_a_real_medical_illness',
    Pre_20__c: 'form.pre_challenge_mindskillz_pamumvuri.people_with_mental_illness_are_dangerous',
    Pre_21__c: 'form.pre_challenge_mindskillz_pamumvuri.it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi',
    Pre_22__c: 'form.pre_challenge_mindskillz_pamumvuri.if_i_had_a_mental_illness_i_would_not_tell_anyone',
    Pre_23__c: 'form.pre_challenge_mindskillz_pamumvuri.seeing_a_mental_health_professional_means_you_are_not_strong_enough_to_mana',
    Pre_24__c: 'form.pre_challenge_mindskillz_pamumvuri.if_i_had_mental_illness_i_would_not_seek_help_from_a_mental_health_professi',
    Pre_25__c: 'form.pre_challenge_mindskillz_pamumvuri.i_believe_treatment_for_a_mental_illness_provided_by_a_mental_health_profes',
    },
    'pre_challenge_skillz_girl_-_zam_311': {
    Pre_1__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_what_i_am_good_at',
    Pre_2__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_how_to_overcome_challenges_that_i_may_face_in_my_life',
    Pre_3__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girl',
    Pre_4__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_would_be_able_to_ask_my_boyfriend_that_i_want_to_use_a_condom',
    Pre_5__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_can_say_no_to_sex_even_if_my_boyfriend_or_friends_pressure_me_to_have_sex',
    Pre_6__c: 'form.pre_challenge_skillz_girl_-_zam_311.if_i_am_sexually_active_i_go_to_a_healthcare_provider_to_get_protection_fro',
    Pre_7__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Pre_8__c: 'form.pre_challenge_skillz_girl_-_zam_311.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Pre_9__c: 'form.pre_challenge_skillz_girl_-_zam_311.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_10__c: 'form.pre_challenge_skillz_girl_-_zam_311.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_or_wife',
    Pre_11__c: 'form.pre_challenge_skillz_girl_-_zam_311.a_successful_marriage_is_more_important_to_girls_than_completing_school',
    Pre_12__c: 'form.pre_challenge_skillz_girl_-_zam_311.a_daughter_should_always_respect_her_parents_decision_for_her_to_get_marrie',
    Pre_13__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_can_decide_when_is_the_right_time_for_me_to_have_a_baby',
    Pre_14__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Pre_15__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Pre_16__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_gender_base',
    Pre_17__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_prevention_',
    Pre_18__c: 'form.pre_challenge_skillz_girl_-_zam_311.one_sign_of_pregnancy_is_a_girl_missing_her_period',
    Pre_19__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_at_least_three_methods_to_avoid_an_unwanted_pregnancy',
    Pre_20__c: 'form.pre_challenge_skillz_girl_-_zam_311.are_you_or_your_boyfriend_currently_using_any_contraceptive_method',
    },
    'pre_challenge_skillz_core_zambia_211':{
    Pre_1__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_what_i_am_good_at',
    Pre_2__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_how_to_overcome_challenges_i_may_have_in_my_life',
    Pre_3__c: 'form.pre_challenge_skillz_core_zambia_211.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Pre_4__c: 'form.pre_challenge_skillz_core_zambia_211.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_5__c: 'form.pre_challenge_skillz_core_zambia_211.i_dont_always_have_to_do_what_people_expect_because_i_am_a_boygirl',
    Pre_6__c: 'form.pre_challenge_skillz_core_zambia_211.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_7__c: 'form.pre_challenge_skillz_core_zambia_211.girls_should_not_disagree_with_boys',
    Pre_8__c: 'form.pre_challenge_skillz_core_zambia_211.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Pre_9__c: 'form.pre_challenge_skillz_core_zambia_211.i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Pre_10__c: 'form.pre_challenge_skillz_core_zambia_211.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Pre_11__c: 'form.pre_challenge_skillz_core_zambia_211.if_i_test_positive_for_hivthere_will_be_someone_who_will_help_and_support_m',
    Pre_12__c: 'form.pre_challenge_skillz_core_zambia_211.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Pre_13__c: 'form.pre_challenge_skillz_core_zambia_211.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Pre_14__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_where_to_get_support_services_for_me_or_someone_elsefor_hiv_-_relate',
    Pre_15__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_where_to_get_support_services_for_me_or_someone_elsefor_abuse',
    Pre_16__c: 'form.pre_challenge_skillz_core_zambia_211.i_have_the_right_to_access_sexual_health_servicessuch_as_sti_and_hiv_testin',
    Pre_17__c: 'form.pre_challenge_skillz_core_zambia_211.one_sign_of_pregnancy_is_a_girl_missing_her_period',
    Pre_18__c: 'form.pre_challenge_skillz_core_zambia_211.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Pre_19__c: 'form.pre_challenge_skillz_core_zambia_211.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    Pre_20__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_what_decisions_to_make_to_achieve_my_goals',
    },
    'pre_challenge_skillz_boy_zambia110':{
    Pre_1__c: 'form.pre_challenge_skillz_boy_zambia110.in_general_i_feel_good_about_myself',
    Pre_2__c: 'form.pre_challenge_skillz_boy_zambia110.i_would_be_able_to_ask_my_girlfriend_that_i_want_to_use_a_condom',
    Pre_3__c: 'form.pre_challenge_skillz_boy_zambia110.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_boy',
    Pre_4__c: 'form.pre_challenge_skillz_boy_zambia110.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_5__c: 'form.pre_challenge_skillz_boy_zambia110.it_is_more_important_for_boys_to_be_educated_than_girls',
    Pre_6__c: 'form.pre_challenge_skillz_boy_zambia110.men_are_better_leaders_than_women',
    Pre_7__c: 'form.pre_challenge_skillz_boy_zambia110.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_8__c: 'form.pre_challenge_skillz_boy_zambia110.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Pre_9__c: 'form.pre_challenge_skillz_boy_zambia110.it_is_okay_for_a_boyfriend_to_threaten_to_hit_his_girlfriend_if_he_never_hi',
    Pre_10__c: 'form.pre_challenge_skillz_boy_zambia110.i_can_say_no_to_sex_even_if_my_friends_or_girlfriend_pressure_me_to_have_se',
    Pre_11__c: 'form.pre_challenge_skillz_boy_zambia110.people_who_abuse_alcohol_are_more_likely_to_engage_in_risky_sexual_behaviou',
    Pre_12__c: 'form.pre_challenge_skillz_boy_zambia110.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_13__c: 'form.pre_challenge_skillz_boy_zambia110.i_have_a_friend_that_i_can_go_to_for_advice_when_i_have_a_problem',
    Pre_14__c: 'form.pre_challenge_skillz_boy_zambia110.i_have_the_right_to_access_sexual_health_services_such_as_hiv_and_sti_testi',
    Pre_15__c: 'form.pre_challenge_skillz_boy_zambia110.i_know_where_to_access_sexual_health_services_such_as_sti_and_hiv_testing',
    Pre_16__c: 'form.pre_challenge_skillz_boy_zambia110.before_making_a_decision_i_think_about_how_it_can_affect_me_or_others',
    Pre_17__c: 'form.pre_challenge_skillz_boy_zambia110.i_know_how_to_express_my_anger_without_being_violent_such_as_hitting_kickin',
    Pre_18__c: 'form.pre_challenge_skillz_boy_zambia110.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Pre_19__c: 'form.pre_challenge_skillz_boy_zambia110.i_know_how_to_correctly_use_a_male_condom',
    Pre_20__c: 'form.pre_challenge_skillz_boy_zambia110.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',

    },
    'pre_challenge_skillz_guyz_mh_-_sa_100':{
    Pre_1__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_have_to_be_respectful_communicate_and_take_action_to_be_a_role_model_in_m',
    Pre_2__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_have_skills_that_help_me_bounce_back_from_difficult_situations',
    Pre_3__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_can_identify_my_strengths_or_things_that_i_am_good_at',
    Pre_4__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.when_i_am_angry_i_know_how_to_avoid_using_violent_behaviour',
    Pre_5__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.when_i_express_my_feelings_clearly_people_understand_me_better',
    Pre_6__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Pre_7__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.sadness_and_a_loss_of_pleasure_in_things_you_enjoy_are_common_symptoms_of_d',
    Pre_8__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_know_where_to_access_health_services_and_mental_health_services',
    Pre_9__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_will_share_accurate_information_about_mental_health_services_to_avoid_sti',
    Pre_10__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Pre_11__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.men_should_share_the_work_around_the_house_such_as_cleaning_and_taking_care',
    Pre_12__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.its_okay_for_a_guy_to_beat_a_girl_when_there_is_a_misunderstanding',
    Pre_13__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_should_respect_the_rights_of_others_such_as_their_right_to_their_own_opin',
    Pre_14__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_feel_confident_setting_my_goals',
    Pre_15__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.stress_is_a_normal_part_of_life',
    Pre_16__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Pre_17__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.there_are_people_i_trust_with_whom_i_can_talk_to_about_my_mental_health',
    Pre_18__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_have_no_fear_or_shame_when_accessing_health_services_or_mental_health_ser',
    Pre_19__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Pre_20__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Pre_21__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_can_stand_up_to_peer_pressure_when_i_have_to',
    Pre_22__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_should_use_a_condom_even_if_my_girlfriend_is_on_another_form_of_birth_con',
    Pre_23__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_know_where_to_go_for_support_if_i_or_someone_i_know_abuses_alcohol',
    },


    'pre_challenge_south_africa_-_skillz_girl_mh_sa_211':{
    Pre_1__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_my_rights_and_responsibilities',
    Pre_2__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_3__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Pre_4__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.stress_is_a_normal_part_of_life',
    Pre_5__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.like_physical_health_we_all_have_mental_health',
    Pre_6__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Pre_7__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.healthy_relationships_are_based_on_healthy_communication_and_mutual_respect',
    Pre_8__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_partner_or_wif',
    Pre_9__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Pre_10__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Pre_11__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.taking_prep_and_using_a_condom_can_lower_my_risk_of_getting_hiv',
    Pre_12__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_13__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Pre_14__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.post_exposure_prophylaxis_pep_can_reduce_my_risk_of_getting_hiv_if_taken_1-',
    Pre_15__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.it_is_my_right_to_access_health_services',
    Pre_16__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_have_an_adult_or_someone_in_my_life_i_can_go_to_for_advice',
    Pre_17__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_give_support_and_encouragement_to_a_friend_or_family_member_who_is_li',
    Pre_18__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.using_a_condom_and_another_contraceptive_method_can_help_prevent_unwanted_p',
    Pre_19__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Pre_20__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.drinking_too_much_alcohol_can_harm_the_body_and_the_mind',
    },

    'pre_challenge_skillz_girl_abbreviated_south_africa':{
    Pre_1__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_my_rights_and_responsibilities',
    Pre_2__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_3__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Pre_4__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.stress_is_a_normal_part_of_life',
    Pre_5__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.like_physical_health_we_all_have_mental_health',
    Pre_6__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Pre_7__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.in_a_relationship_it_is_both_partners_responsibility_to_prevent_unwanted_pr',
    Pre_8__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.healthy_relationships_are_based_on_healthy_communication_and_respect',
    Pre_9__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_partner_or_wif',
    Pre_10__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.a_person_has_the_right_to_have_sex_with_their_partner_even_if_the_partner_d',
    Pre_11__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Pre_12__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Pre_13__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.taking_prep_and_using_a_condom_can_lower_my_risk_of_getting_hiv',
    Pre_14__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_15__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Pre_16__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_can_use_coping_skills_to_handle_stress',
    Pre_17__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.post_exposure_prophylaxis_pep_can_reduce_my_risk_of_getting_hiv_if_taken_1-',
    Pre_18__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.it_is_my_right_to_access_health_services',
    Pre_19__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_have_an_adult_or_someone_in_my_life_i_can_go_to_for_advice',
    Pre_20__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.using_a_condom_and_another_contraceptive_method_can_help_prevent_unwanted_p',
    Pre_21__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Pre_22__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.drinking_too_much_alcohol_can_harm_the_body_and_mind',
    Pre_23__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_at_least_two_ways_of_saving_money',
    Pre_24__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.a_budget_is_the_estimated_income_and_expenses_for_a_certain_time_period',
    Pre_25__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.accepting_money_for_sexual_favors_can_create_risks_to_my_health_and_safety',
    Pre_26__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.using_assertive_communication_means_respectfully_sharing_my_thoughts_and_fe',
    Pre_27__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_have_the_right_to_access_emergency_contraception',
    Pre_28__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.if_a_girl_has_unprotected_sex_and_misses_her_period_this_could_mean_she_is_',
    }
    };

    const pluckSfValue = val => {
    return sfFieldMapping[formVersion][val];
    };

    return { ...state, pluckSfValue };
    });

    // fn(state => {
    // console.log("test")
    // console.log(state.pluckSfValue('Pre_1__c'));
    // return state;
    // });

    fn(state => {
    const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);

    if (!PID) {
    console.log(
    `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.case['@case_id']}`
    );
    return state;
    }

    return upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    //field('Event__c', dataValue('form.hidden_properties.intervention_name')),
    //relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.hidden_properties.intervention_name')),
    relationship('Person_Attendance__r', 'Participant_Identification_Number_PID__c', dataValue('form.case.@case_id')),
    // relationship('Person_Attendance__r','CommCare_Ext_ID__c', state => {
    // return (
    // dataValue('form.hidden_properties.participant_first_name')(state) +
    // dataValue('form.hidden_properties.participant_surname')(state)
    // )
    // }),

    // field('CommCare_Ext_ID__c', state => {
    // return `${dataValue('form.case.@case_id')(state)}-${scrubEmojis(
    // dataValue('form.hidden_properties.intervention_name')(state),
    // ''
    // ).replace(/\//gi, '')}`;
    // }),
    field("CommCare_Ext_ID__c", (state) => {
    return toUTF8(`${dataValue("form.case.@case_id")(state)}-${scrubEmojis(
    dataValue("form.hidden_properties.intervention_name")(state),
    ""
    ).replace(/\//gi, "")}`);
    }),

    //field(
    //'Person_Attendance__c',
    // state =>
    // dataValue('form.hidden_properties.participant_first_name')(state) +
    // ' ' +
    // dataValue('form.hidden_properties.participant_surname')(state)
    //),
    field('Gender__c', dataValue('form.hidden_properties.gender')),
    field('Grade__c', state => {
    const grade = dataValue('form.hidden_properties.grade')(state);
    return grade ? grade.replace(/\D/g, '') : undefined;
    }),
    field('Class__c', dataValue('form.hidden_properties.class')),
    field('Pre_Post_Completed__c', state => {
    var done = dataValue('form.hidden_properties.pre_questionnaire_complete')(state);
    return done === 'Yes' ? true : done === 'No' ? false : undefined;
    }),
    field('Date_Pre_Administered__c', dataValue('form.date')),
    field('Pre_1__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_1__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_2__c', state => {
    if (state.pluckSfValue('Pre_2__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_2__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Pre_3__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_3__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Pre_4__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_4__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Pre_5__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_5__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_6__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_6__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_7__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_7__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_8__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_8__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_9__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_9__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_10__c', state => {
    if (state.pluckSfValue('Pre_10__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_10__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_11__c', state => {
    if (state.pluckSfValue('Pre_11__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_10__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_12__c', state => {
    if (state.pluckSfValue('Pre_12__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_12__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_13__c', state => {
    if (state.pluckSfValue('Pre_13__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_13__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_14__c', state => {
    if (state.pluckSfValue('Pre_14__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_14__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_15__c', state => {
    if (state.pluckSfValue('Pre_15__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_15__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_16__c', state => {
    if (state.pluckSfValue('Pre_16__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_16__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_17__c', state => {
    if (state.pluckSfValue('Pre_17__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_17__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_18__c', state => {
    if (state.pluckSfValue('Pre_18__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_18__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_19__c', state => {
    if (state.pluckSfValue('Pre_19__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_19__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_20__c', state => {
    if (state.pluckSfValue('Pre_20__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_20__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_21__c', state => {
    if (state.pluckSfValue('Pre_21__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_21__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_22__c', state => {
    if (state.pluckSfValue('Pre_22__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_22__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_23__c', state => {
    if (state.pluckSfValue('Pre_23__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_23__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_24__c', state => {
    if (state.pluckSfValue('Pre_24__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_24__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_25__c', state => {
    if (state.pluckSfValue('Pre_25__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_25__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_26__c', state => {
    if (state.pluckSfValue('Pre_26__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_26__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_27__c', state => {
    if (state.pluckSfValue('Pre_27__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_27__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_28__c', state => {
    if (state.pluckSfValue('Pre_28__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_28__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    )
    )(state);
    });

    //Removing mapping... need case_id to upsert Events. Date_of_Pre__c update should be handled on the SF side.
    // upsert(
    // 'Event__c',
    // 'CommCare_Ext_ID__c',
    // fields(
    // field('CommCare_Ext_ID__c', dataValue('form.hidden_properties.intervention_name')),
    // field('Date_of_Pre__c', dataValue('form.date')),

    // )
    // );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30.html index a688a1219c6..83b12a61a98 100644 --- a/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Register Event

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsert

    Expression

    alterState((state) => {

    function clean(str) {
    if (!!str)
    return str
    .split('_')
    .map(word => {
    let new_word = word.toString().toLowerCase();
    return new_word.slice(0, 1).toUpperCase() + new_word.slice(1);
    })
    .join(' ');
    }

    const coachFieldNames = ['Coach_A__r','Coach_B__r','Coach_C__r','Coach_D__r']

    state.data.destinationCoachFields = state.data.form.event_information.coaches
    .split(' ')
    .reduce(
    (accumulator, currentValue, currentIndex) => [
    ...accumulator,
    (currentIndex < coachFieldNames.length && !!currentValue
    ? relationship(coachFieldNames[currentIndex], 'CommCare_Ext_ID__c', currentValue)
    : []),
    ],
    []
    );

    const eventtype = state.data.form.event_information.event_type;

    const recordtype = eventtype==='community_health_event' || eventtype==='soccer_tournament' ? 'Testing Event' : 'Malaria Testing Event';
    console.log(recordtype)

    state.data.recordtype = recordtype;

    return state;
    });

    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    state=>({
    ...fields(
    field('Name', dataValue('form.event_information.Event_Name')),
    relationship('RecordType', 'Name', dataValue('recordtype')),
    field('CommCare_Ext_ID__c', state => {
    var event = dataValue('form.event_information.Event_Name')(state);
    return event ? event.replace(/\//gi, '') : event;
    }),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    field('Business_Unit__c', state => {
    const bu = dataValue('form.event_information.business_unit')(state);
    return bu==='65680f0c4c144b03ad0f86bdc46c1ebc' ? 'GRS Zambia' :
    bu==='04d98397e28046118fade28ced6b65cb' ? 'GRS Zimbabwe' :
    bu==='ed125ab19ec34aacab79585e59eb76f4' ? 'GRS Partnerships': undefined ;
    }),
    relationship('Site__r','CommCare_Ext_ID__c', dataValue('form.event_information.site')),
    relationship('Venue__r', 'CommCare_Ext_ID__c',dataValue('form.event_information.Venue')),
    field('Date__c', dataValue('form.event_information.event_date')),
    field('Event_Type__c', dataValue('recordtype')),
    field('Testing_Event_Type__c', state => {
    const type = dataValue('form.event_information.event_type')(state);
    return type.includes('malaria') ? 'Malaria Testing Event (General Event)' : 'Other';
    }),
    field('Coordinator__c', dataValue('form.event_information.event_coordinator')),
    ),
    ...fields(...state.data.destinationCoachFields)
    })
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.html b/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.html index 20eaadce609..ea3bb3caae3 100644 --- a/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.html +++ b/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.html @@ -21,15 +21,15 @@ - +
    -
    Skip to main content

    Upsert Register Participant

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    query(
    `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);
    state.data.eventCase = dataValue('form.case.@case_id')(state);

    function objectToArray(object) {
    return !Array.isArray(object) ? [object] : object;
    }

    const { form } = state.data;
    if (form.question1) {
    console.log('Ensuring that "question1" is an array.');
    form.question1 = objectToArray(form.question1);
    } else if (!form.new_participants) {
    console.log('Nothing to upsert. No participants were registered');
    } else {
    console.log('Shifting "new_participants" to "question1" array.');
    form.question1 = objectToArray(form.new_participants);
    console.log('Creating a "case" object inside each item in that array.');
    form.question1 = form.question1.map(item => ({
    ...item,
    case: item.create_skillz_plus_participant.case,
    }));
    }

    console.log('Done with initial data manipulation.');
    const persons = merge(
    dataPath('form.question1[*]'),
    fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))
    )(state);

    const attendances = merge(
    dataPath('form.question1[*]'),
    fields(
    field('intervention_name', dataValue('form.intervention_name')),
    field('eventCase', dataValue('eventCase')),
    field('eventName', dataValue('eventName'))
    )
    )(state);

    return { ...state, persons, attendances };
    });

    each(
    'persons[*]',
    upsert(
    'Person__c',
    'Participant_Identification_Number_PID__c',
    fields(
    field('Notes__c', dataValue('intervention_notes_to_save')),
    field('First_Name__c', dataValue('participant_first_name')),
    field('Surname__c', dataValue('participant_surname')),
    relationship('RecordType', 'Name', 'Participant'),
    relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),
    field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    field('Sex__c', dataValue('gender')),
    field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?
    field('School_name_person__c', dataValue('school_name')),
    field('Date_of_Birth__c', dataValue('date_of_birth')),
    field('School_name_person__c', dataValue('school_name')),
    field('Physical_Address__c', dataValue('participants_home_address'))
    //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    )
    )
    );

    each(
    'attendances[*]',
    upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', state => {
    const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;
    const personid = state.data.case['@case_id'];
    const value = personid + '-' + eventid.replace(/\//gi, '');
    return scrubEmojis(value, '');
    }),
    relationship(
    //Attendance looks up to Persn via the case_id
    'Person_Attendance__r',
    'Participant_Identification_Number_PID__c',
    state => state.data.case['@case_id']
    ),
    relationship(
    //Attendance looks up to Event via the Event case_id
    'Event__r',
    'CommCare_Case_ID__c',
    state => `${state.data.eventCase}`
    ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'CommCare_Ext_ID__c',
    // state => `${state.data.intervention_name}` || `${state.data.eventName}`
    // ),
    field('Date_of_Birth__c', dataValue('date_of_birth'))
    )
    )
    );

    //First we insert Person record
    // fn(state => {
    // return upsert(
    // 'Person__c',
    // 'Participant_Identification_Number_PID__c',
    // fields(
    // field('Notes__c', dataValue('form.intervention_notes_to_save')),
    // field('First_Name__c', dataValue('form.question1.participant_first_name')),
    // field('Surname__c', dataValue('form.question1.participant_surname')),
    // relationship('RecordType', 'Name', 'Participant'),
    // field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    // field('Sex__c', dataValue('form.question1.gender')),
    // //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    // field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),
    // field('School_name_person__c', dataValue('form.question1.school_name'))
    // )
    // )(state);
    // });

    // fn(state => {
    // //Then we upsert related Attendance records
    // return upsert(
    // 'Attendance__c',
    // 'CommCare_Ext_ID__c',
    // fields(
    // field('CommCare_Ext_ID__c', state => {
    // var eventid = dataValue('form.intervention_name')(state);
    // var personid = dataValue('form.case.@case_id')(state);
    // return personid + '-' + eventid;
    // }),
    // relationship(
    // //Attendance looks up to Persn via the case_id
    // 'Person_Attendance__r',
    // 'Participant_Identification_Number_PID__c',
    // dataValue('form.case.@case_id')
    // ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'Name',
    // dataValue('form.intervention_name')
    // ),
    // field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))
    // )
    // )(state);
    // });

    - +
    Skip to main content

    Upsert Register Participant

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    query(
    `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);
    state.data.eventCase = dataValue('form.case.@case_id')(state);

    function objectToArray(object) {
    return !Array.isArray(object) ? [object] : object;
    }

    const { form } = state.data;
    if (form.question1) {
    console.log('Ensuring that "question1" is an array.');
    form.question1 = objectToArray(form.question1);
    } else if (!form.new_participants) {
    console.log('Nothing to upsert. No participants were registered');
    } else {
    console.log('Shifting "new_participants" to "question1" array.');
    form.question1 = objectToArray(form.new_participants);
    console.log('Creating a "case" object inside each item in that array.');
    form.question1 = form.question1.map(item => ({
    ...item,
    case: item.create_skillz_plus_participant.case,
    }));
    }

    console.log('Done with initial data manipulation.');
    const persons = merge(
    dataPath('form.question1[*]'),
    fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))
    )(state);

    const attendances = merge(
    dataPath('form.question1[*]'),
    fields(
    field('intervention_name', dataValue('form.intervention_name')),
    field('eventCase', dataValue('eventCase')),
    field('eventName', dataValue('eventName'))
    )
    )(state);

    return { ...state, persons, attendances };
    });

    each(
    'persons[*]',
    upsert(
    'Person__c',
    'Participant_Identification_Number_PID__c',
    fields(
    field('Notes__c', dataValue('intervention_notes_to_save')),
    field('First_Name__c', dataValue('participant_first_name')),
    field('Surname__c', dataValue('participant_surname')),
    relationship('RecordType', 'Name', 'Participant'),
    relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),
    field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    field('Sex__c', dataValue('gender')),
    field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?
    field('School_name_person__c', dataValue('school_name')),
    field('Date_of_Birth__c', dataValue('date_of_birth')),
    field('School_name_person__c', dataValue('school_name')),
    field('Physical_Address__c', dataValue('participants_home_address'))
    //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    )
    )
    );

    each(
    'attendances[*]',
    upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', state => {
    const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;
    const personid = state.data.case['@case_id'];
    const value = personid + '-' + eventid.replace(/\//gi, '');
    return scrubEmojis(value, '');
    }),
    relationship(
    //Attendance looks up to Persn via the case_id
    'Person_Attendance__r',
    'Participant_Identification_Number_PID__c',
    state => state.data.case['@case_id']
    ),
    relationship(
    //Attendance looks up to Event via the Event case_id
    'Event__r',
    'CommCare_Case_ID__c',
    state => `${state.data.eventCase}`
    ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'CommCare_Ext_ID__c',
    // state => `${state.data.intervention_name}` || `${state.data.eventName}`
    // ),
    field('Date_of_Birth__c', dataValue('date_of_birth'))
    )
    )
    );

    //First we insert Person record
    // fn(state => {
    // return upsert(
    // 'Person__c',
    // 'Participant_Identification_Number_PID__c',
    // fields(
    // field('Notes__c', dataValue('form.intervention_notes_to_save')),
    // field('First_Name__c', dataValue('form.question1.participant_first_name')),
    // field('Surname__c', dataValue('form.question1.participant_surname')),
    // relationship('RecordType', 'Name', 'Participant'),
    // field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    // field('Sex__c', dataValue('form.question1.gender')),
    // //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    // field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),
    // field('School_name_person__c', dataValue('form.question1.school_name'))
    // )
    // )(state);
    // });

    // fn(state => {
    // //Then we upsert related Attendance records
    // return upsert(
    // 'Attendance__c',
    // 'CommCare_Ext_ID__c',
    // fields(
    // field('CommCare_Ext_ID__c', state => {
    // var eventid = dataValue('form.intervention_name')(state);
    // var personid = dataValue('form.case.@case_id')(state);
    // return personid + '-' + eventid;
    // }),
    // relationship(
    // //Attendance looks up to Persn via the case_id
    // 'Person_Attendance__r',
    // 'Participant_Identification_Number_PID__c',
    // dataValue('form.case.@case_id')
    // ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'Name',
    // dataValue('form.intervention_name')
    // ),
    // field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))
    // )
    // )(state);
    // });

    + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30.html b/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30.html index b7f7235b46f..28069038b57 100644 --- a/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30.html +++ b/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Register Participant Skillz

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    query(
    `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);
    state.data.eventCase = dataValue('form.case.@case_id')(state);

    function objectToArray(object) {
    return !Array.isArray(object) ? [object] : object;
    }

    const { form } = state.data;
    if (form.question1) {
    console.log('Ensuring that "question1" is an array.');
    form.question1 = objectToArray(form.question1);
    } else if (!form.new_participants) {
    console.log('Nothing to upsert. No participants were registered');
    } else {
    console.log('Shifting "new_participants" to "question1" array.');
    form.question1 = objectToArray(form.new_participants);
    console.log('Creating a "case" object inside each item in that array.');
    form.question1 = form.question1.map(item => ({
    ...item,
    case: item.create_skillz_plus_participant.case,
    }));
    }

    console.log('Done with initial data manipulation.');
    const persons = merge(
    dataPath('form.question1[*]'),
    fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))
    )(state);

    const attendances = merge(
    dataPath('form.question1[*]'),
    fields(
    field('intervention_name', dataValue('form.intervention_name')),
    field('eventCase', dataValue('eventCase')),
    field('eventName', dataValue('eventName'))
    )
    )(state);

    return { ...state, persons, attendances };
    });

    each(
    'persons[*]',
    upsert(
    'Person__c',
    'Participant_Identification_Number_PID__c',
    fields(
    field('Notes__c', dataValue('intervention_notes_to_save')),
    field('First_Name__c', dataValue('participant_first_name')),
    field('Surname__c', dataValue('participant_surname')),
    relationship('RecordType', 'Name', 'Participant'),
    relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),
    field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    field('Sex__c', dataValue('gender')),
    field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?
    field('School_name_person__c', dataValue('school_name')),
    field('Date_of_Birth__c', dataValue('date_of_birth')),
    field('School_name_person__c', dataValue('school_name')),
    field('Physical_Address__c', dataValue('participants_home_address'))
    //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    )
    )
    );

    each(
    'attendances[*]',
    upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', state => {
    const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;
    const personid = state.data.case['@case_id'];
    const value = personid + '-' + eventid.replace(/\//gi, '');
    return scrubEmojis(value, '');
    }),
    relationship(
    //Attendance looks up to Persn via the case_id
    'Person_Attendance__r',
    'Participant_Identification_Number_PID__c',
    state => state.data.case['@case_id']
    ),
    relationship(
    //Attendance looks up to Event via the Event case_id
    'Event__r',
    'CommCare_Case_ID__c',
    state => `${state.data.eventCase}`
    ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'CommCare_Ext_ID__c',
    // state => `${state.data.intervention_name}` || `${state.data.eventName}`
    // ),
    field('Date_of_Birth__c', dataValue('date_of_birth'))
    )
    )
    );

    //First we insert Person record
    // fn(state => {
    // return upsert(
    // 'Person__c',
    // 'Participant_Identification_Number_PID__c',
    // fields(
    // field('Notes__c', dataValue('form.intervention_notes_to_save')),
    // field('First_Name__c', dataValue('form.question1.participant_first_name')),
    // field('Surname__c', dataValue('form.question1.participant_surname')),
    // relationship('RecordType', 'Name', 'Participant'),
    // field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    // field('Sex__c', dataValue('form.question1.gender')),
    // //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    // field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),
    // field('School_name_person__c', dataValue('form.question1.school_name'))
    // )
    // )(state);
    // });

    // fn(state => {
    // //Then we upsert related Attendance records
    // return upsert(
    // 'Attendance__c',
    // 'CommCare_Ext_ID__c',
    // fields(
    // field('CommCare_Ext_ID__c', state => {
    // var eventid = dataValue('form.intervention_name')(state);
    // var personid = dataValue('form.case.@case_id')(state);
    // return personid + '-' + eventid;
    // }),
    // relationship(
    // //Attendance looks up to Persn via the case_id
    // 'Person_Attendance__r',
    // 'Participant_Identification_Number_PID__c',
    // dataValue('form.case.@case_id')
    // ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'Name',
    // dataValue('form.intervention_name')
    // ),
    // field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))
    // )
    // )(state);
    // });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30.html index 1e8e1e36776..3e7ccceed57 100644 --- a/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Register Skills plus Club

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsert

    Expression

    // push to production
    alterState((state) => {

    function clean(str) {
    if (!!str)
    return str
    .split('_')
    .map(word => {
    let new_word = word.toString().toLowerCase();
    return new_word.slice(0, 1).toUpperCase() + new_word.slice(1);
    })
    .join(' ');
    }

    const coachFieldNames = ['Coach_A__r','Coach_B__r','Coach_C__r','Coach_D__r']

    state.data.destinationCoachFields = state.data.form.coaches
    .split(' ')
    .reduce(
    (accumulator, currentValue, currentIndex) => [
    ...accumulator,
    (currentIndex < coachFieldNames.length && !!currentValue
    ? relationship(coachFieldNames[currentIndex], 'CommCare_Ext_ID__c', currentValue)
    : []),
    ],
    []
    );

    return state;
    });



    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    state=>({
    ...fields(
    field('Name', dataValue('form.name_of_skillz_plus_club')),
    field('CommCare_Ext_ID__c', dataValue('form.name_of_skillz_plus_club')),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    relationship('RecordType', 'Name', 'Intervention'),
    relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('form.skillz_plus_site')),
    relationship('Venue__r', 'CommCare_Ext_ID__c', dataValue('form.skillz_plus_venue')),
    ),
    ...fields(...state.data.destinationCoachFields)
    })
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25.html b/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25.html index aecb3eae9e9..6c810fb7d7c 100644 --- a/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25.html +++ b/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Risk and Vulnerability Assessment - Service Referral

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Upsert Risk and Vulnerability Assessment - Service Referral
    • Adaptor: @openfn/language-salesforce
    • Adaptor Version: v2.7.4
    • Created over 3 years ago
    • Updated 5 months ago
    • Score: 88 (an indicator of how useful this job may be)

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsertIf, Array

    Expression

    // Your job goes here.
    alterState(state => {
    function split(str, separator) {
    if (!str) {
    return [];
    } else {
    return str.toString().split(separator);
    }
    }
    function checked(key, str) {
    if (!str) return false;
    return split(str.toString(), ' ').indexOf(key) >= 0;
    }

    function capitalizeFirstLetter(str) {
    if (!str) return;
    let new_str = str.toString().toLowerCase();
    return new_str.slice(0, 1).toUpperCase() + new_str.slice(1);
    }

    function transformDont(str) {
    if (!str) return str;
    return split(str.toString(), '_')
    .map(word => word.replace(/dont/i, "don't"))
    .join('_')
    .toString()
    .trim();
    }

    function transformCant(str) {
    if (!str) return str;
    return split(str.toString(), '_')
    .map(word => word.replace(/cant/i, "can't"))
    .join('_')
    .toString()
    .trim();
    }

    function splitAndJoin(str, splitDelimiter, joinDelimiter) {
    if (!str) return;

    return split(str.toString(), splitDelimiter).join(joinDelimiter).toString().trim();
    }

    function transformHowOften(str) {
    if (!str) return;
    if (str === 'special_occasions') return 'Special Occasions';
    if (str === 'no_dont_want_to_disclose') return "Don't want to disclose";
    if (str === 'dont_want_to_disclose') return "Don't want to disclose";
    return transformGenericText(str).toString().trim();
    }

    function transformHIVStatus(status) {
    switch (status) {
    case 'yes_negative':
    return 'Yes,Negative';
    case 'yes_positive':
    return 'Yes,Positive';
    case 'no_i_dont':
    return "No,I don't know";
    case 'yes_dont_want_to_disclose':
    return "Yes, don't want to disclose";
    default:
    return;
    }
    }

    function transformLastTested(str) {
    if (!str) return;
    switch (str.toString()) {
    case 'yes_negative':
    return 'Yes,Negative';
    case 'yes_positive':
    return 'Yes,Positive';
    case 'no_i_dont':
    return "No,I don't know";
    case 'yes_dont_want_to_disclose':
    return "Yes, don't want to disclose";
    default:
    return;
    }
    }

    function transformMonthAgo(str) {
    if (!str) return;
    switch (str) {
    case 'month_ago':
    return '1 month ago';
    case 'months_ago':
    return '3 months ago';
    case 'month_ago':
    return 'copy-1-of-months_ago ';
    case 'month_ago':
    return '6 months ago';
    case 'a_year_or_more_ago':
    return 'A year or more';
    default:
    return;
    }
    }

    function transformGenericText(str) {
    if (!str) return;
    return capitalizeFirstLetter(splitAndJoin(transformDont(str), '_', ' '))
    .toString()
    .trim();
    }

    function transformRange(range) {
    if (!range) return;
    return range
    .toString()
    .replace(/\d_\d/i, match => match.replace('_', '-'))
    .toString()
    .trim();
    }

    function transformAgeRange(range) {
    if (!range) return;
    if (range === '10_years') return '< 10 years';
    if (range === 'greater_than_19') return '> 19 years';
    return capitalizeFirstLetter(transformDont(transformCant(splitAndJoin(transformRange(range), '_', ' '))))
    .toString()
    .trim();
    }

    function transformAbuseExperienced(str) {
    if (!str) return;
    return split(str, ' ')
    .map(word => capitalizeFirstLetter(word))
    .join(';')
    .toString()
    .trim();
    }

    function getAge(dateString) {
    if (!dateString) return;

    const today = new Date();
    const birthDate = new Date(dateString);
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age--;
    }
    return age;
    }

    state.data.perform_a_risk_assessment = state.data.form.do_you_want_to_perform_a_risk_assessment === 'yes';

    state.data.complete_service_referrals = state.data.form.referral_services ? true : false;

    state.data.form.client_information.gender = capitalizeFirstLetter(state.data.form.client_information.gender);

    state.helperFunctions = {
    split,
    checked,
    transformAgeRange,
    transformHIVStatus,
    transformLastTested,
    transformMonthAgo,
    transformGenericText,
    transformDont,
    splitAndJoin,
    transformHowOften,
    transformAbuseExperienced,
    getAge,
    };
    return state;
    });

    upsertIf(
    dataValue('perform_a_risk_assessment'),
    'Risk_Assessment__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    field('Date__c', dataValue('form.risk_assessment.date')),
    field('Participant_Name__c', dataValue('form.client_information.participant_full_name')),
    field('Participant_Age__c', state => {
    const dob = dataValue('form.client_information.date_of_birth')(state);

    return state.helperFunctions.getAge(dob);
    }),
    relationship('Site2__r', 'CommCare_Ext_ID__c', dataValue('form.client_information.site')),
    relationship('EventLink__r', 'CommCare_Ext_ID__c', dataValue('form.client_information.intervention_name')),
    relationship('Venue__r', 'CommCare_Ext_ID__c', dataValue('form.client_information.venue')),

    field('Participant_Sex__c', dataValue('form.client_information.gender')),
    field('X1_0_Sexually_Active_past_12_month__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.sexual_risk_and_pregnancy.sexually_active_12_months')(state)
    )
    ),
    field('X1_1_Age_at_first_sex__c', state =>
    state.helperFunctions.transformAgeRange(
    dataValue('form.risk_assessment.sexual_risk_and_pregnancy.age_at_first_sex')(state)
    )
    ),
    field('X1_2_Have_you_ever_had_unprotected_sex__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.sexual_risk_and_pregnancy.have_you_ever_had_unprotected_sex')(state)
    )
    ),
    field('X1_3_Sex_for_monetary_or_material_benefi__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.sexual_risk_and_pregnancy.sex_monetary_material')(state)
    )
    ),
    field('Do_you_know_your_HIV_status__c', state =>
    state.helperFunctions.transformHIVStatus(
    dataValue('form.risk_assessment.hiv_status.do_you_know_your_hiv_status')(state)
    )
    ),
    field('X2_1_When_last_did_you_test_for_HIV__c', state =>
    state.helperFunctions.transformMonthAgo(
    dataValue('form.risk_assessment.hiv_status.when_last_did_you_test_for_hiv')(state)
    )
    ),
    field('X2_2_Are_you_on_treatment_ART__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.hiv_status.are_you_on_treatment_art')(state)
    )
    ),
    field('X3_0_Had_an_STI_in_the_last_12months_yea__c', state =>
    state.helperFunctions.transformHowOften(dataValue('form.risk_assessment.sti_and_pep.hiv_last_12_months')(state))
    ),
    field('X3_1_Past_12_months_sex_HIV_status_part__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.sti_and_pep.knowing_partners_hiv_status')(state)
    )
    ),
    field('X4_0_Forms_of_abuse_experienced_before__c', state => {
    const abusesArray = state.helperFunctions.split(
    dataValue('form.risk_assessment.gender_based_violence.abuse_experienced')(state),
    ' '
    );
    const abuses = [];
    abusesArray.forEach(ab => {
    abuses.push(state.helperFunctions.transformGenericText(ab));
    });
    return abuses.join(';');
    }),
    field('X4_1_Feel_unsafe_any1_interact_with_ofte__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.gender_based_violence.unsafe_with_others')(state)
    )
    ),
    field('X4_2_Of_what_relationship_person_to_you__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.gender_based_violence.relationship_of_abuser')(state)
    )
    ),
    field('X5_0_Do_you_take_alcohol_or_drugs__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.do_you_take_alcohol_andor_drugs')(state)
    )
    ),
    field('X5_1_On_average_how_often_drink_alcohol__c', state =>
    state.helperFunctions.transformHowOften(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.how_often_alcohol')(state)
    )
    ),
    field('X5_2_On_average_how_often_take_drugs__c', state =>
    state.helperFunctions.transformHowOften(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.how_often_drugs')(state)
    )
    ),
    field('X5_3_Easy_for_teens_to_obtain_alcohol__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.alcohol_19')(state)
    )
    ),
    field('X5_4__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.illegal_drugs_19')(state)
    )
    )
    )
    );

    fn(state => {
    state.data.intervention_name = state.data.form.client_information.intervention_name
    ? [relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.client_information.intervention_name'))]
    : [];

    return state;
    });

    upsertIf(dataValue('complete_service_referrals'), 'NewReferral__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    field('CommCare_Ext_ID__c', state => {
    if (state.data.form.subcase_0.case) return state.data.form.subcase_0.case['@case_id'];
    else if (state.data.form.referral_services) {
    if (state.data.form.referral_services.art_support_services.skillz_plus_club_details)
    return state.data.form.referral_services.art_support_services.skillz_plus_club_details
    .create_skillz_plus_club_participant_case.case['@case_id'];
    }
    return undefined;
    }),
    field('Participants_Full_Name__c', dataValue('form.client_information.participant_full_name')),
    field('Service_Provider_Name__c', dataValue('form.client_information.coach_name')),
    field('Parent_Guardian_Full_Name__c', dataValue('form.parent__guardian_information.parent__guardian_full_name')),
    field('Relationship__c', dataValue('form.parent__guardian_information.relationship_to_client')),
    //field('', dataValue('form.parent__guardian_information.please_specify')),
    field('Parent_Guardian_Contact_Number__c', dataValue('form.parent__guardian_information.contact_number')),
    //field('', dataValue('form.parent__guardian_information.guardian_consent')),
    field('Institution_Referred_To_1__c', dataValue('form.referral_information.institution_referred_to')),
    field('Institution_Referred_To_2__c', dataValue('form.referral_information.copy-1-of-institution_referred_to')),
    field('Institution_Referred_To_3__c', dataValue('form.referral_information.copy-2-of-institution_referred_to')),
    field('HIV_Testing_Services_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'hiv_testing_services',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_Other__c', dataValue('form.referral_services.hiv_support__care.please_specify')),
    field('ART_Initiation_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'art_initiationenrollment',
    dataValue('form.referral_services.art_support_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('SKILLZ_Plus_Club_Support_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'grs_skillz_plus_club',
    dataValue('form.referral_services.art_support_services.skillz_plus_club_option')(state)
    )
    ),
    field('PMTCT_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'pmtct',
    dataValue('form.referral_services.art_support_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('VMMC_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'vmmc',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('TB_Screening_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'tb_screening_treatment_adherence',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Legal_Other__c', dataValue('form.referral_services.legal_services.please_specify_other_legal')),
    field('Post_Exposure_Prophylaxis_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'post_exposure_prophylaxis',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('PrEP_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'prep',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_Other__c', dataValue('form.referral_services.hiv_support__care.please_specify')),
    field(
    'Victim_Friendly_Services_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'suspected_abuse_reported_police_court_other_authority',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'post_violence_care_medical_legal_counseling',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'child_support_grant_social_foster_general_support',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'other',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    )
    ),

    field('Sexual_and_GBV_Abuse_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'sexual__gender-based_violenceabus',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),

    // field('missing in SF', dataValue('form.referral_services.child_protection_support_services.type_of_post_violence_care')),
    // field('missing in SF', dataValue('form.referral_services.child_protection_support_services.child_support_grant_for')),
    field(
    'Legal_Services_Other_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    ) ||
    state.helperFunctions.checked('id', dataValue('form.referral_services.legal_services.legal_services')(state)) ||
    state.helperFunctions.checked(
    'birth_bertificate',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    )
    ),
    field('Legal_Other__c', dataValue('form.referral_services.legal_services.please_specify_other_legal')),
    field('IPTG_Health_Facility__c', state =>
    state.helperFunctions.checked(
    'iptg_to_health_facility',
    dataValue('form.referral_services.mental_health_services.mental_health_select_services')
    )
    ),
    field('IPTG_Specialized_to_SMZ__c', state =>
    state.helperFunctions.checked(
    'iptg_specialised_to_smz',
    dataValue('form.referral_services.mental_health_services.mental_health_select_services')
    )
    ),
    field('STI_Screen_Testing_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'sti_screening_diagnosis_treatment',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Contraception_Family_Plan_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'contraceptivesfamily_planning',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Cervical_Cancer_Screening_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'cervical_cancer_screening',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HPV_vaccine_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'hpv',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Antenatal_Care_ANC_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'antenatal_care_anc',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),

    field(
    'Psycho_Social_Support_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'drug_or_alcohol_abuse',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    ) ||
    state.helperFunctions.checked(
    'psychiatric_careintensive_counseling',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    ) ||
    state.helperFunctions.checked(
    'psychosocial_support',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Psycho_Social_Services_Other_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Psycho_Other__c', dataValue('form.referral_services.other_srhr_services.please_specify_srhr_referred')),

    field('Date_Referred__c', dataValue('form.follow-up.date_referred')),
    field('Expected_Visit_Date__c', dataValue('form.follow-up.expected_visit_date')),
    field('Client_Follow_up_Consent_given__c', state =>
    state.helperFunctions.checked('client_follow-up_consent_given', dataValue('form.follow-up.select')(state))
    ),
    field('Client_Linked_to_care__c', state =>
    state.helperFunctions.checked('client_linked_to_care', dataValue('form.follow-up.select')(state))
    ),

    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.client_information.business_unit')(state);
    return bu === '65680f0c4c144b03ad0f86bdc46c1ebc'
    ? 'GRS Zambia'
    : bu === '04d98397e28046118fade28ced6b65cb'
    ? 'GRS Zimbabwe'
    : bu === 'ed125ab19ec34aacab79585e59eb76f4'
    ? 'GRS Partnerships'
    : undefined;
    })
    ),
    ...fields(...state.data.intervention_name),
    }));

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14.html b/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14.html index 474828a2bb2..6c34ef05ef0 100644 --- a/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14.html +++ b/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Service Referral 2

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, upsert

    Expression

    // push to production
    alterState(state => {
    state.data.external_commcare_id = (
    dataValue('form.hidden_properties.intervention_name')(state) +
    dataValue('form.hidden_properties.participant_first_name')(state) +
    dataValue('form.hidden_properties.participant_surname')(state)
    )
    .toString()
    .toLowerCase()
    .replace(/\s/g, '')
    .trim();

    return state;
    });

    upsert(
    'NewReferral__c',
    'CommCare_Ext_ID__c',
    fields(
    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu === 'X' ? 'GRS Zambia' : bu;
    }),
    field('CommCare_Ext_ID__c', dataValue('form.case.@case_id')),
    field('HIV_Testing_Services_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option1')(state)
    )
    ),
    field('TB_Screening_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option2')(state)
    )
    ),
    field('VMMC_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option3')(state)
    )
    ),
    field('Post_Exposure_Prophylaxis_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option4'
    )(state)
    )
    ),
    field('PrEP_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option5'
    )(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option6'
    )(state)
    )
    ),
    field('ART_Initiation_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option1')(
    state
    )
    )
    ),
    field('SKILLZ_Plus_Club_Support_Service_Provid__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option2')(
    state
    )
    )
    ),

    field(
    'PMTCT_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option3')(
    state
    )
    )
    ),
    field('IPTG_Health_Facility__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option1')(
    state
    )
    )
    ),
    field('IPTG_Specialized_to_SMZ__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option2')(
    state
    )
    )
    ),

    field('ART_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.referred_art_support_services')(state)
    )
    ),
    field(
    'Victim_Friendly_Services_Service_Provide__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option1'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option2'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option3'
    )(state)
    )
    ),
    field('Legal_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option3'
    )(state)
    )
    ),

    field('STI_Screen_Testing_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option1')(state))
    ),

    field('Contraception_Family_Plan_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option2')(state))
    ),
    field('Cervical_Cancer_Screen_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option3')(state))
    ),
    field('HPV_vaccine_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option4')(state))
    ),
    field('Antenatal_Care_ANC_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option5')(state))
    ),
    field('Sexual_and_GBV_Abuse_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option6')(state))
    ),
    field(
    'Psycho_Social_Support_Service_Provider__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option9'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option8'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option7'
    )(state)
    )
    ),
    field('Psycho_Social_Services_Other_Service_Pro__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option10')(state))
    ),
    field(
    'Legal_Services_Other_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_referral_services')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option1')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option2')(state)
    )
    ),

    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30.html index 45b74183995..f4ade8be3d1 100644 --- a/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Service Referral

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, relationship, upsert

    Expression

    alterState(state => {
    function checked(key, str) {
    if (!str) return false;
    return str.split(' ').indexOf(key) >= 0;
    }

    state.helperFunctions = { checked };

    function capitalizeFirstLetter(str) {
    if (!str) return;
    let new_str = str.toString().toLowerCase();
    return new_str.slice(0, 1).toUpperCase() + new_str.slice(1);
    }

    function transform(value) {
    if (!value) return;
    switch (value.toString().trim()) {
    case 'Daughterson':
    return 'Daughter/Son';
    case 'Other_specify':
    return 'Other';
    case 'Single_never_married':
    return 'Single/Never Married';
    case 'Divorced__separated':
    return 'Divorced/separated';
    default:
    return value;
    }
    }

    state.data.form.parent__guardian_information.relationship_to_client = transform(
    capitalizeFirstLetter(state.data.form.parent__guardian_information.relationship_to_client)
    );

    return state;
    });

    alterState(state => {
    if (!state.data.form.subcase_0) {
    console.log('No referral services to upsert');
    return state;
    }
    return upsert(
    'NewReferral__c',
    'CommCare_Ext_ID__c',
    fields(
    // field('Enter_Partner_s_Name__c', dataValue('form.referral_information.institution_referred_to')),
    // field('Type_of_Referral__c', dataValue('form.referral_information.type_of_referral')),
    field('Participants_Full_Name__c', dataValue('form.client_registration.participant_full_name')),
    //field('Parent_Guardian_Contact_Number__c', dataValue('form.client_registration.mobile_number')),
    relationship('Event__r', 'CommCare_Case_ID__c', dataValue('form.event_name')),
    field('CommCare_Ext_ID__c', state => {
    var subid = state.data.form.subcase_0;
    return subid && subid !== '' ? state.data.form.subcase_0.case['@case_id'] : dataValue('id')(state); //Set external id to 'service' subcase if available, otherwise use formid
    }),
    //field('Venue__c', dataValue('form.client_registration.school_name')),
    //field('Grade__c', dataValue('form.client_registration.grade')),
    //field('Class__c', dataValue('form.client_registration.class')),
    field('Parent_Guardian_Full_Name__c', dataValue('form.parent__guardian_information.parent__guardian_full_name')),
    field('Relationship_To_Client__c', dataValue('form.parent__guardian_information.relationship_to_client')),
    field('Parent_Guardian_Contact_Number__c', dataValue('form.parent__guardian_information.contact_number')),
    field('Institution_Referred_To_1__c', dataValue('form.referral_information.institution_referred_to')),
    field('Institution_Referred_To_2__c', dataValue('form.referral_information.copy-1-of-institution_referred_to')),
    field('Institution_Referred_To_3__c', dataValue('form.referral_information.copy-2-of-institution_referred_to')),
    field('Service_Provider_Name__c', dataValue('form.hidden_props.coach_name')),
    field('HIV_Testing_Services_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'hiv_testing_services',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('VMMC_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'vmmc',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('TB_Screening_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'tb_screening_treatment_adherence',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Post_Exposure_Prophylaxis_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'post_exposure_prophylaxis',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('PrEP_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'prep',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_Other__c', dataValue('form.referral_services.hiv_support__care.please_specify')),
    field('ART_Initiation_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'art_initiationenrollment',
    dataValue('form.referral_services.art_support_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('PMTCT_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'pmtct',
    dataValue('form.referral_services.art_support_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('SKILLZ_Plus_Club_Support_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'grs_skillz_plus_club',
    dataValue('form.referral_services.art_support_services.skillz_plus_club_option')(state)
    )
    ),
    field(
    'Victim_Friendly_Services_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'suspected_abuse_reported_police_court_other_authority',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'post_violence_care_medical_legal_counseling',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'child_support_grant_social_foster_general_support',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'other',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    )
    ),
    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu === '65680f0c4c144b03ad0f86bdc46c1ebc'
    ? 'GRS Zambia'
    : bu === '04d98397e28046118fade28ced6b65cb'
    ? 'GRS Zimbabwe'
    : bu === 'ed125ab19ec34aacab79585e59eb76f4'
    ? 'GRS Partnerships'
    : undefined;
    }),
    field(
    'Sexual_and_GBV_Abuse_GRS_Staff__c',
    dataValue('form.referral_services.child_protection_support_services.abuse_reported_to')
    ),

    field('Legal_Other__c', dataValue('form.referral_services.legal_services.please_specify_other_legal')),
    field(
    'Legal_Services_Other_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    ) ||
    state.helperFunctions.checked(
    'id',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    ) ||
    state.helperFunctions.checked(
    'birth_bertificate',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    )
    ),
    field('STI_Screen_Testing_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'sti_screening_diagnosis_treatment',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Contraception_Family_Plan_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'contraceptivesfamily_planning',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Cervical_Cancer_Screening_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'cervical_cancer_screening',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HPV_vaccine_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'hpv',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Antenatal_Care_ANC_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'antenatal_care_anc',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Sexual_and_GBV_Abuse_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'based_violenceabus',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field(
    'Psycho_Social_Support_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'drug_or_alcohol_abuse',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(
    state
    )
    ) ||
    state.helperFunctions.checked(
    'psychiatric_careintensive_counseling',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(
    state
    )
    ) ||
    state.helperFunctions.checked(
    'psychosocial_support',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(
    state
    )
    )
    ),
    field('Psycho_Social_Services_Other_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Psycho_Other__c', dataValue('form.referral_services.other_srhr_services.please_specify_srhr_referred')),
    field('Date_Referred__c', dataValue('form.follow-up.date_referred')),
    field('Expected_Visit_Date__c', dataValue('form.follow-up.expected_visit_date')),
    field('Client_Follow_up_Consent_given__c', state =>
    state.helperFunctions.checked('client_follow-up_consent_given', dataValue('form.follow-up.select')(state))
    ),
    field('Client_Linked_to_care__c', state =>
    state.helperFunctions.checked('client_linked_to_care', dataValue('form.follow-up.select')(state))
    )
    )
    )(state);
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30.html index 5eb2a889506..e124d79b00c 100644 --- a/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Service Referral Followup

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, upsert

    Expression

    // push to production
    alterState(state => {
    state.data.external_commcare_id = (
    dataValue('form.hidden_properties.intervention_name')(state) +
    dataValue('form.hidden_properties.participant_first_name')(state) +
    dataValue('form.hidden_properties.participant_surname')(state)
    )
    .toString()
    .toLowerCase()
    .replace(/\s/g, '')
    .trim();

    return state;
    });

    upsert(
    'NewReferral__c',
    'CommCare_Ext_ID__c',
    fields(
    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu === 'X' ? 'GRS Zambia' : bu;
    }),
    field('CommCare_Ext_ID__c', dataValue('form.case.@case_id')),
    field('HIV_Testing_Services_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option1')(state)
    )
    ),
    field('TB_Screening_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option2')(state)
    )
    ),
    field('VMMC_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option3')(state)
    )
    ),
    field('Post_Exposure_Prophylaxis_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option4'
    )(state)
    )
    ),
    field('PrEP_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option5'
    )(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option6'
    )(state)
    )
    ),
    field('ART_Initiation_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option1')(
    state
    )
    )
    ),
    field('SKILLZ_Plus_Club_Support_Service_Provid__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option2')(
    state
    )
    )
    ),

    field(
    'PMTCT_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option3')(
    state
    )
    )
    ),
    field('IPTG_Health_Facility__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option1')(
    state
    )
    )
    ),
    field('IPTG_Specialized_to_SMZ__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option2')(
    state
    )
    )
    ),

    field('ART_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.referred_art_support_services')(state)
    )
    ),
    field(
    'Victim_Friendly_Services_Service_Provide__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option1'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option2'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option3'
    )(state)
    )
    ),
    field('Legal_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option3'
    )(state)
    )
    ),

    field('STI_Screen_Testing_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option1')(state))
    ),

    field('Contraception_Family_Plan_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option2')(state))
    ),
    field('Cervical_Cancer_Screen_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option3')(state))
    ),
    field('HPV_vaccine_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option4')(state))
    ),
    field('Antenatal_Care_ANC_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option5')(state))
    ),
    field('Sexual_and_GBV_Abuse_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option6')(state))
    ),
    field(
    'Psycho_Social_Support_Service_Provider__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option9'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option8'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option7'
    )(state)
    )
    ),
    field('Psycho_Social_Services_Other_Service_Pro__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option10')(state))
    ),
    field(
    'Legal_Services_Other_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_referral_services')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option1')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option2')(state)
    )
    ),

    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28.html b/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28.html index 5a5ce85ccdb..2d39c0879a7 100644 --- a/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28.html +++ b/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert Team or Group Name

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert

    Expression

    // Upsert event by unique 'Name'
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field(
    'Class_Group_Team__c',
    dataValue('form.question_group.group__team_name')
    ),
    relationship('RecordType', 'Name', 'Intervention'),
    field(
    'CommCare_Case_ID__c',
    dataValue('form.case.@case_id')
    ),
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16.html b/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16.html index 68304fd8b14..826f7fe13eb 100644 --- a/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16.html +++ b/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert User in Salesforce

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, upsert

    Expression

    //Example job to upsert Users in Salesforce
    each('$.users[*]',
    dataPath('state.data.users'),
    upsert('User', 'Email', fields(
    field('Email', dataValue('email')),
    field('FirstName', dataValue('firstName')),
    field('LastName', dataValue('surname')),
    field('Active', 'true')
    ))
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11.html b/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11.html index a6ee5bdada0..82e2cf6eb87 100644 --- a/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11.html +++ b/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Upsert to mBrana

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    upsert

    Expression

    // Your job goes here.
    upsert(
    'users', // the DB table
    'ON CONSTRAINT users_pkey', // a DB column with a unique constraint OR a CONSTRAINT NAME
    { name: 'Elodie', id: 7 },
    { writeSql:true, execute: true }
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19.html b/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19.html index 23562538a98..8960a0259fd 100644 --- a/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    WF1-1 Bulk get HH cases

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    each, get, map

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['Household'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000;

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-04-26T10:00:00';

    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);
    //May 31st, 2023 at 3:00:13 PM.
    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    //t => `?type=${t}&indexed_on_start=2023-03-03T00:00:00&limit=${limit}&indexed_on_end=2023-03-06T00:00:00` //returns 14 records
    //t => `?type=${t}&indexed_on_start=2024-04-26T10:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form
    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);

    return { ...state, references: [], data: {} };
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19.html b/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19.html index 4e64462acca..3336218b322 100644 --- a/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    WF1-2 Bulk upsert HHs and HH Visits

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    bulk, join, map, query, JSON

    Expression

    fn(state => {
    if (state.payloads.length == 0)
    return { ...state, housevisits: [], households: [] };

    const owner_ids = state.payloads.map(data => data.properties.owner_id);
    const uniq_owner_ids = [...new Set(owner_ids)];

    return { ...state, uniq_owner_ids };
    });


    fn(state => {
    if (state.payloads.length == 0) return state;

    return query(
    `SELECT CommCare_User_ID__c, Id village, Parent_Geographic_Area__c area, Parent_Geographic_Area__r.Name name, Parent_Geographic_Area__r.Parent_Geographic_Area__c catchment FROM Location__c catchment WHERE CommCare_User_ID__c IN ('${state.uniq_owner_ids.join(
    "','"
    )}') GROUP BY Id, CommCare_User_ID__c, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c`
    )(state);
    });

    fn(state => {
    if (state.payloads.length == 0) return state;

    console.log('Done querying ✅');

    return state;
    });

    fn(state => {
    if (state.payloads.length == 0) return state;

    console.log(
    'Filtering out unwanted users and applying mapping for households and housevisits'
    );

    const [reference] = state.references;

    //HMN 06/11/2023
    // console.log(JSON.stringify(reference.records, null, 2));

    const records = reference.records;
    const fetchReference = (owner_id, arg) => {
    const result =
    records && records.length > 0
    ? records.filter(record => record.CommCare_User_ID__c === owner_id)
    : 0;

    //TODO: Update default value for 'unknown location' before go-live
    return result.length > 0
    ? result[0][arg]
    : 'a000800001tMobaAAC' /*unknown location*/;
    };

    const supervisorMap = {
    community_health_nurse: 'Community Health Nurse',
    chw_supervisor: 'CHW Supervisor',
    chewschas: 'CHEWs/CHAs',
    other: 'Other',
    none: 'None',
    };

    const insuranceMap = {
    nhif: 'NHIF',
    Linda_mama: 'Linda mama',
    other_please_specify_if_active: 'Other',
    none: 'None',
    };

    const households = state.payloads
    /* HMN 050723
    .filter(
    h =>
    h.properties.commcare_username !== 'openfn.test' &&
    h.properties.commcare_username !== 'test.2021' &&
    h.properties.test_user !== 'Yes'
    )
    */
    .map(h => {
    // Special calculations ==================================================
    const insuranceStatus = h.properties.health_insurance;
    const Health_insurance_type__c =
    insuranceStatus && insuranceStatus === 'other_please_specify_if_active'
    ? 'Other'
    : insuranceStatus === 'nhif'
    ? 'NHIF'
    : insuranceStatus === 'Linda_mama' || 'linda_mama'
    ? 'Linda mama'
    : insuranceStatus;

    const hhStatus = h.properties.Household_Status;
    const Active_Household__c =
    hhStatus && hhStatus === 'No'
    ? false
    : hhStatus === 'Yes'
    ? true
    : hhStatus;

    const reason = h.properties.Reason_for_Inactive;
    const Inactive_Reason__c = reason
    ? reason.toString().replace(/_/g, ' ')
    : null;
    //HMN 06/11/2023
    // console.log(JSON.stringify(h.properties, null, 2));
    /*HMN remove this dependancy 07/07/2023
    const chw = h.properties.CHW_ID;
    const Household_CHW__c =
    chw === 'a030800001zQrk' ? 'a030800001zQrk5' : chw ? chw : undefined;
    // =======================================================================
    */

    return {
    CommCare_Username__c: h.properties.commcare_username,
    MOH_household_code__c: h.properties.moh_code,
    CommCare_Code__c: h.case_id,
    Source__c: true,
    // TODO: Prod mapping to add back before go-live =======================
    Household_CHW__c: h.properties.CHW_ID, // Uncomment me to go live!
    //Household_CHW__c: 'a032400000GHpdsAAD', // Comment me OUT to go live!
    // Household_CHW__c: 'a03AW00000643nLYAQ',
    // =====================================================================
    Catchment__c: fetchReference(h.properties.owner_id, 'catchment'),
    Area__c: fetchReference(h.properties.owner_id, 'area'),
    Village__c: fetchReference(h.properties.owner_id, 'village'),
    Household_Village__c: h.properties.village,
    Deaths_in_the_last_6_months__c:
    h.properties.deaths_in_past_6_months > 0 ? 'Yes' : 'No',
    Access_to_safe_water__c: h.properties.Safe_Water,
    Treats_Drinking_Water__c: h.properties.Treats_Drinking_Water,
    Tippy_Tap__c: h.properties.Active_Handwashing_Station,
    Pit_Latrine__c: h.properties.Functional_Latrine,
    Rubbish_Pit__c: h.properties.Rubbish_Pit,
    Drying_Rack__c: h.properties.Drying_Rack,
    Kitchen_Garden__c: h.properties.Kitchen_Garden,
    Cookstove__c: h.properties.Improved_Cooking_Method,
    Clothe__c: h.properties.Clothesline,
    WASH_Trained__c: h.properties.WASH_Trained,
    Uses_ITNs__c: h.properties.ITNs,
    Has_muac_tape__c: h.properties.family_muac_tape_available,
    Health_insurance__c: h.properties.health_insurace_cover,
    Health_insurance_active_status__c: h.properties.healthinsurance_active,
    Health_insurance_type__c,
    Other_Health_Insurance__c: h.properties.if_other_please_specify,
    Work_with_TBA__c: h.properties.tba,
    TBA_name__c: h.properties.which_tba,
    Last_Modified_Date_CommCare__c: h.server_date_modified, //Need a case property,
    Active_Household__c,
    Inactive_Reason__c,
    Active_in_Nutrition_Program__c:
    h.properties.enrolled_in_a_lwala_nutrition_program,
    lwala_nutrition_program_enrollment_date__c:
    h.properties.lwala_nutrition_program_enrollment_date,
    Trained_in_gardening__c: h.properties.household_trained_on_gardening,
    household_trained_on_gardening_date__c:
    h.properties.when_was_the_household_trained_on_gardening,
    Seed_Input_Support__c:
    h.properties.household_provided_with_seed_input_support,
    household_provided_with_seed_input_suppo__c:
    h.properties.when_was_the_household_provided_with_seed_input_support,
    MIYCN_Trained__c: h.properties.household_trained_on_MIYC,
    // TODO: @Aleksa to find out if Case_Closed_Date__c still exist
    Case_Closed_Date__c: h.date_closed //&& h.date_closed == true
    ? h.date_closed
    : undefined
    };
    });

    const housevisits = state.payloads
    //HMN remove test user filters
    /*
    .filter(
    h =>
    h.properties.commcare_username !== 'openfn.test' &&
    h.properties.commcare_username !== 'test.2021' &&
    h.properties.test_user !== 'Yes'
    )*/
    .map(h => {
    // Special calculations ==================================================


    const visitIdC =
    h.case_id + '_' + h.properties.last_form_opened_date_and_time;

    const hVstatus = h.properties.Household_Status;
    const Active_Household__c =
    hVstatus === 'No' ? false : hVstatus === 'Yes' ? true : hVstatus;

    const insuranceTypeC = () => {
    let status = h.properties.health_insurance;

    let value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return insuranceMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    };

    const openedC = () => {
    const form_opened = h.properties.last_form_opened_date_and_time;

    if (form_opened) {
    const value1 = form_opened.split('-').slice(0, 2).join('-');
    const value2 = form_opened.split('-').slice(2).join('-');
    const formattedValue = [value1, value2].join(' ');
    return new Date(formattedValue).toISOString();
    }
    return undefined;
    };

    return {
    CommCare_Username__c: h.properties.commcare_username,
    CommCare_Visit_ID__c: visitIdC,
    Catchment__c: fetchReference(h.properties.owner_id, 'catchment'),
    'Household__r.CommCare_Code__c': h.case_id,
    Date__c: h.properties.Date,
    Form_Submitted__c: h.properties.last_form_opened_name,
    Active_Household__c: Active_Household__c,
    Active_in_Nutrition_Program__c:
    h.properties.enrolled_in_a_lwala_nutrition_program,
    lwala_nutrition_program_enrollment_date__c:
    h.properties.lwala_nutrition_program_enrollment_date,
    Trained_in_gardening__c: h.properties.household_trained_on_gardening,
    household_trained_on_gardening_date__c:
    h.properties.when_was_the_household_trained_on_gardening,
    Seed_Input_Support__c:
    h.properties.household_provided_with_seed_input_support,
    household_provided_with_seed_input_suppo__c:
    h.properties.when_was_the_household_provided_with_seed_input_support,
    MIYCN_Trained__c: h.properties.household_trained_on_MIYCN,
    Kitchen_Garden__c: h.properties.Kitchen_Garden,
    Access_to_safe_water__c: h.properties.Safe_Water,
    Treats_Drinking_Water__c: h.properties.Treats_Drinking_Water,
    Tippy_Tap__c: h.properties.Active_Handwashing_Station,
    Pit_Latrine__c: h.properties.Functional_Latrine,
    Rubbish_Pit__c: h.properties.Rubbish_Pit,
    Drying_Rack__c: h.properties.Drying_Rack,
    Cookstove__c: h.properties.Improved_Cooking_Method,
    Clothe__c: h.properties.Clothesline,
    WASH_Trained__c: h.properties.WASH_Trained,
    Has_muac_tape__c: h.properties.family_muac_tape_available,
    Uses_ITNs__c: h.properties.ITNs,
    Supervisor_Visit__c: h.properties.supervisor_visit
    ? supervisorMap[h.properties.supervisor_visit]
    : null,
    Health_insurance__c: h.properties.health_insurace_cover,
    Health_insurance_active_status__c: h.properties.healthinsurance_active,
    Health_insurance_type__c: insuranceTypeC(),

    Other_Health_Insurance__c: h.properties.if_other_please_specify,
    CommCare_Form_Opened__c: openedC(),

    };
    });

    return { ...state, households, housevisits, fetchReference };
    });

    //JSON logging of records
    //HMN 06/11/2023
    /*fn(state => {
    console.log('HHs to upsert ::', JSON.stringify(state.households));
    return state;
    });*/


    bulk(
    'Household__c',
    'upsert',
    {
    extIdField: 'CommCare_Code__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting households...');
    return state.households;
    }
    );

    fn(state => {
    if (state.payloads.length == 0) return state;

    console.log('house holds bulk upsert done');
    return state;
    });

    // TODO clean up in QA used for troubleshooting
    // Uncomment this block to add cooldown
    // fn(state => {
    // return new Promise((resolve, reject) => {
    // setTimeout(() => {
    // console.log('4 second cooldown finished.');
    // resolve(state);
    // }, 4000);
    // });
    // });

    bulk(
    'Visit__c',
    'upsert',
    {
    extIdField: 'CommCare_Visit_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting housevisits...');
    return state.housevisits;
    }
    );

    fn(state => {
    if (state.payloads.length == 0) return state;
    console.log('house visits bulk upsert done');
    return state;
    });

    // TODO clean up in QA for troubleshooting
    // Uncomment this block to add cooldown
    // fn(state => {
    // return new Promise((resolve, reject) => {
    // setTimeout(() => {
    // console.log('Final 4 second cooldown finished.');
    // resolve(state);
    // }, 4000);
    // });
    // });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19.html b/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19.html index b4dbc45e6d5..abfe98f85a5 100644 --- a/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    WF2-1 Bulk get Person cases

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: WF2-1 Bulk get Person cases
    • Adaptor: @openfn/language-http
    • Adaptor Version: v4.2.8
    • Created over 1 year ago
    • Updated 4 months ago
    • Score: 93 (an indicator of how useful this job may be)

    Key Functions

    each, get, map, JSON

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['Person'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000; //E.g., change to 10 to process records in smaller batch sizes

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-05-30T03:00:00';


    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);

    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    // t => `?type=${t}&indexed_on_start=2024-01-16T00:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form
    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);
    //HMN 11072023
    // console.log(JSON.stringify(state.payloads, null, 2));

    return { ...state, references: [], data: {} };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19.html b/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19.html index 16bd3efa0e5..e91b7fb8263 100644 --- a/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    WF2-2 Bulk upsert Persons

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    bulk, dataValue, field, fields, join, map, query, relationship, upsertIf, JSON

    Expression

    fn(state => {
    if (state.payloads.length == 0)
    return {
    ...state,
    householdMapping: [],
    headOfHouseholdMapping: [],
    motherMapping: [],
    caregiverMapping: [],
    sfRecordMapping: [],
    };
    // JSON logging of records
    //HMN debug
    //console.log('cases before query :: ', JSON.stringify(state.payloads, null, 2));
    const owner_ids = state.payloads.map(data => data.properties.owner_id);
    const uniq_owner_ids = [...new Set(owner_ids)];

    return { ...state, uniq_owner_ids };
    });

    // get data from SF
    fn(state => {
    if (state.payloads.length == 0) return state;

    return query(
    `SELECT CommCare_User_ID__c, Id village, Parent_Geographic_Area__c area, Parent_Geographic_Area__r.Name name, Parent_Geographic_Area__r.Parent_Geographic_Area__c catchment FROM Location__c WHERE CommCare_User_ID__c IN ('${state.uniq_owner_ids.join(
    "','"
    )}') GROUP BY Id, CommCare_User_ID__c, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c`
    )(state);
    });

    fn(state => {
    if (state.payloads.length == 0) return state;

    const [reference] = state.references;

    // console.log(JSON.stringify(reference.records, null, 2));

    const records = reference.records;
    const fetchReference = (owner_id, arg) => {
    const result =
    records && records.length > 0
    ? records.filter(record => record.CommCare_User_ID__c === owner_id)
    : 0;

    //TODO: Update default value for 'unknown location' before go-live
    return result.length > 0 ? result[0][arg]
    : 'a000800001tMobaAAC' /*unknown location*/;

    };

    const cleanChoice = choice => {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    };

    const handleMultiSelect = multiField => {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value.charAt(0).toUpperCase() + value.slice(1).replace('_', ' ')
    );
    })
    .join(';')
    : '';
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const counselMap = {
    anc_visits: 'ANC Visits',
    early_initiation_of_anc_less_than_3_months:
    'Early initiation of ANC (less than 3 months)',
    completing_recomended_anc_visits: 'Completing recomended ANC visits',
    danger_signs: 'Danger signs',
    skilled_birth: 'Skilled birth',
    immunization: 'Immunization',
    individual_birth_plan: 'Individual Birth Plan',
    emergency_preparedness: 'Emergency preparedness',
    childcare_and_affection: 'Childcare and affection',
    nutrition_counseling: 'Nutrition counseling',
    growth_monitoring: 'Growth monitoring',
    exclusive_breastfeeding: 'Exclusive breastfeeding',
    complementary_feeding: 'Complementary feeding',
    sleeping_under_llitn: 'Sleeping under LLITN',
    knowing_hiv_status: 'Knowing HIV status',
    indoor_pollution: 'Indoor pollution',
    personal_hygiene: 'Personal Hygiene',
    safe_drinking_water: 'Safe drinking water',
    safe_disposal_of_human_waste: 'Safe disposal of human waste',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for other Ols',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const reasonMapping = {
    lack_of_access_to_fp_information: 'Lack of access to FP information',
    no_access_to_fp_services_hospitals:
    'Lack of hospitals or places where FP services can be accessed',
    not_willing_to_use_fp_due_to_negative_effects_myths_and_misconceptions:
    'Myths and misconceptions',
    barriers_at_service_delivery_points: 'Barriers at service delivery points',
    pregnant: 'The client is pregnant',
    intentions_of_getting_pregnant: 'Intentions of getting pregnant',
    not_sexually_active: 'The client is not sexually active',
    other_barriers_culture_male_partners_parents_etc:
    'Other barriers (culture, male partners, parents, etc)',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays Learning Difficulties',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Delay Speech and Language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const milestoneMap = {
    movement: 'Movement',
    hearing: 'Hearing',
    communication: 'Communication',
    seeing: 'Seeing',
    cognitive_delays: 'Cognitive Delays',
    play: 'Play',
    };
    const nutritionMap = {
    severe: 'Severely Malnourished',
    moderate: 'Moderately Malnourished',
    normal: 'Normal',
    };

    const fpMethodMap = {
    male_condoms: 'Male condoms',
    female_condoms: 'Female condoms',
    pop: 'POP',
    coc: 'COC',
    emergency_pills: 'Emergency pills',
    none: 'None',
    };

    return {
    ...state,
    counselMap,
    serviceMap,
    reasonMapping,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    cleanChoice,
    handleMultiSelect,
    fetchReference,
    };
    });

    // build sfRecord before upserting
    fn(state => {
    if (state.payloads.length == 0) return state;

    const {
    counselMap,
    reasonMapping,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    cleanChoice,
    handleMultiSelect,
    fetchReference,
    } = state;

    const householdMapping = [
    ...new Map(
    state.payloads
    .filter(
    p =>
    p.indices.parent.case_id !== undefined &&
    p.indices.parent.case_id !== ''
    )
    .map(p => {
    return {
    CommCare_Code__c:
    p.indices.parent.case_id || p.properties.parent_id,
    };
    })
    .map(h => [h.CommCare_Code__c, h])
    ).values(),
    ];

    const headOfHouseholdMapping = state.payloads
    .filter(
    p =>
    p.properties.head_of_household_case_id !== undefined &&
    p.properties.head_of_household_case_id !== ''
    )
    .map(p => {
    return {
    CommCare_Code__c: p.indices.parent.case_id || p.properties.parent_id,
    'Head_of_Household__r.CommCare_ID__c':
    p.properties.head_of_household_case_id,
    };
    });

    const motherMapping = state.payloads
    .filter(
    p =>
    /*HMN 050723 p.properties.commcare_username !== 'test.2021' &&
    p.properties.test_user !== 'Yes' &&
    */
    p.properties.mother_case_id !== undefined &&
    p.properties.mother_case_id !== '' &&
    p.case_id!== undefined
    )
    .map(p => {
    return {
    'Mother__r.CommCare_ID__c': p.properties.mother_case_id,
    CommCare_ID__c: p.case_id,
    };
    });

    const caregiverMapping = state.payloads
    .filter(
    p =>
    /*HMN 070523 p.properties.commcare_username !== 'test.2021' &&
    p.properties.test_user !== 'Yes' &&
    */
    p.properties.caretaker_case_id !== undefined &&
    p.properties.caretaker_case_id !== '' &&
    p.case_id!== undefined
    )
    .map(p => {
    return {
    'Primary_Caregiver_Lookup__r.CommCare_ID__c':
    p.properties.caretaker_case_id,
    CommCare_ID__c: p.case_id,
    };
    });

    const sfRecordMapping = state.payloads
    .filter(
    p =>
    /*HMN 050723
    p.properties.commcare_username !== 'test.2021' &&
    p.properties.test_user !== 'Yes'
    */
    p.case_id !== undefined &&
    p.case_id !== ''
    )
    .map(p => {
    // For unbornOrName
    const name1 = p.properties.Person_Name || p.properties.case_name;
    const unborn = p.properties.name;

    const name2 =
    name1 === undefined || name1 === '' || name1 === null
    ? unborn
    : name1.replace(/\w\S*/g, function (txt) {
    return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    });
    const unbornOrName = name1 !== null ? name2 : 'Unborn Child';
    // console.log('Person Name ::', unbornOrName);

    // For chronicIllness
    const chronicChoice =p.properties.please_specify_which_chronic_illness_the_person_has;
    const choice2 = handleMultiSelect(chronicChoice);
    const chronicIllness = choice2 ? choice2.replace(/_/g, ' ') : '';

    const disabilityC =
    p.properties.disability !== undefined && p.properties.disability !=='---' && p.properties.disability !== null
    ? p.properties.disability
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    : null;
    //HMN remove
    console.log(p.case_id)
    //console.log(disabilityC)
    //
    const otherDisability =
    p.properties.other_disability !== undefined && p.properties.other_disability !=='---' && p.properties.other_disability !== null
    ? p.properties.other_disability
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    : null;
    //HMN remove
    //console.log(otherDisability)
    //HMN
    const hh_relation = p.properties.relation_to_hh;

    const relationToTheHead = hh_relation !== undefined && hh_relation !== null
    ? hh_relation.toString().replace(/_/g, ' ').charAt(0).toUpperCase() +
    hh_relation.toString().replace(/_/g, ' ').slice(1)
    : null;

    const childStatus =
    p.properties.Child_Status && p.properties.Record_Type === 'Unborn'
    ? (p.properties.Child_Status = 'Unborn')
    : p.properties.Child_Status && p.properties.Record_Type === 'Born'
    ? (p.properties.Child_Status = 'Born')
    : p.properties.Child_Status;

    const childDangerSigns = p.properties.Other_Danger_Signs !== undefined && p.properties.Other_Danger_Signs !== null
    ? p.properties.Other_Danger_Signs.toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    .toString()
    .replace(/_/g, ' ')
    : p.properties.Other_Danger_Signs;

    //clientCounselled
    const clientChoices = p.properties.counsel_topic;
    const choiceGroups = clientChoices ? clientChoices.split(' ') : null;
    const clientCounselled = choiceGroups
    ? choiceGroups
    .map(cg => {
    return counselMap[cg];
    })
    .join(';')
    : choiceGroups;

    // fpMethodDistributed
    const fpStatus = p.properties.FP_commodity;
    const fpValue =
    fpStatus && fpStatus !== ''
    ? fpStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return fpMethodMap[value] || value;
    })
    : undefined;
    const fpMethodDistributed = fpValue ? fpValue.join(';') : undefined;

    // placeOfDelivery
    const pFacility = p.properties.Delivery_Type;
    const placeOfDelivery =
    pFacility === 'Skilled'
    ? 'Facility'
    : pFacility === 'Unskilled'
    ? 'Home'
    : undefined;

    // reasonForNotTakingFP
    const rStatus = p.properties.No_FPmethod_reason;
    const rValue =
    rStatus && rStatus !== ''
    ? rStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return reasonMapping[value] || value;
    })
    : undefined;
    const reasonForNotTakingFP = rValue ? rValue.join(';') : undefined;

    const recordType = p.properties.Record_Type;


    return {
    // TODO @aleksa, Source__c is causing an error
    Source__c: true,
    CommCare_ID__c: p.case_id,

    //HMN 05072023 'Primary_Caregiver_Lookup__r.CommCare_ID__c':p.properties.caretaker_case_id,
    //HMN 05072023 'Mother__r.CommCare_ID__c': p.properties.mother_case_id,
    'Household__r.CommCare_Code__c':
    p.properties.parent_id || p.indices.parent.case_id,
    commcare_location_id__c: p.properties.commcare_location_id,
    CommCare_Username__c: p.properties.commcare_username,
    Telephone__c: p.properties.contact_phone_number,

    Consent_for_data_use__c: p.properties.data_sharing_consent,
    CommCare_HH_Code__c: p.indices.parent.case_id,
    Client_Status__c: p.properties.Client_Status,
    Catchment__c: fetchReference(p.properties.owner_id, 'catchment'),
    Area__c: fetchReference(p.properties.owner_id, 'area'),
    Household_Village__c: fetchReference(p.properties.owner_id, 'village'),
    Name: unbornOrName,
    Chronic_illness__c: chronicIllness,
    Currently_enrolled_in_school__c: p.properties.enrolled_in_school,
    Education_Level__c: p.properties.Education_Level !== null && p.properties.Education_Level !== undefined
    ? p.properties.Education_Level.toString().replace(/_/g, ' ')
    : null,
    Relation_to_the_head_of_the_household__c: relationToTheHead,
    Gender__c: p.properties.Gender !== undefined ? p.properties.Gender : null,
    Disability__c: disabilityC,
    Other_disability__c: otherDisability,
    Use_mosquito_net__c: p.properties.sleep_under_net,
    Birth_Certificate__c: p.properties.birth_certificate,
    Child_Status__c: childStatus,
    'RecordType.Name': recordType === 'Unborn' || recordType === ''
    ? 'Child'
    : recordType.toString().replace(/_/g, ' '), //convert Unborn children to Child RT
    //TT5 Mother Information =====================//
    MCH_booklet__c: p.properties.mch_booklet,
    Reason_for_not_taking_a_pregnancy_test__c: p.properties.No_Preg_Test
    ? p.properties.No_Preg_Test.toString().replace(/_/g, ' ')
    : undefined,
    Pregnancy_danger_signs__c: p.properties.pregnancy_danger_signs
    ? pregDangerMap[p.properties.pregnancy_danger_signs]
    : undefined,
    Individual_birth_plan_counselling__c:
    p.properties.individual_birth_plan,
    Child_Danger_Signs__c: childDangerSigns,
    //HAWI =====================//

    Unique_Patient_Code__c: p.properties.Unique_Patient_Code,
    Active_in_Support_Group__c: p.properties.Active_in_Support_Group,
    Preferred_Care_Facility__c: p.properties.Preferred_Care_Facility,
    Currently_on_ART_s__c: p.properties.ART,
    ART_Regimen__c: p.properties.ARVs,
    HAWI_Defaulter__c: p.properties.default === 'Yes' ? true : false,
    Date_of_Default__c: p.properties.date_of_default,
    Know_HIV_status__c: p.properties.known_hiv_status,
    HIV_Status__c: p.properties.hiv_status,
    //Illness ========================//
    Persons_temperature__c: p.properties.temperature,
    Days_since_illness_start__c: p.properties.duration_of_sickness,
    Current_Malaria_Status__c: p.properties.malaria_test_results,
    Malaria_test__c: p.properties.malaria_test,
    Last_Malaria_Home_Test__c: p.properties.malaria_test_date,
    Last_Malaria_Home_Treatment__c: cleanChoice(
    p.properties.malaria_test_date
    ),
    Cough_over_14days__c: p.properties.symptoms_check_cough,
    TB_patients_therapy_observed__c: p.properties.observed_tb_therapy,
    Injuries_or_wounds__c: p.properties.wounds_or_injuries,
    Pulse_Oximeter__c: p.properties.pulse_oximeter_available,
    Heart_Rate_Pulse_Oximeter__c: p.properties.heart_rate_pulse_oximeter,
    Oxygen_Concentration_Pulse_Oximeter__c:
    p.properties.oxygen_concentration,
    Can_child_drink__c: p.properties.can_child_drink,
    Antibiotic_provided_for_fast_breathing__c: cleanChoice(
    p.properties.antibiotic_fast_breathing
    ),
    Antibiotic_provided_for_chest_indrawing__c: cleanChoice(
    p.properties.antibiotic_chest_indrawing
    ),
    Default_on_TB_treatment__c: cleanChoice(
    p.properties.default_tb_treatment
    ),
    Treatment_Distribution__c: cleanChoice(
    p.properties.distributed_treatments
    ),
    //Delivery =====================//
    Immediate_Breastfeeding__c: p.properties.Breastfeeding_Delivery,
    Place_of_Delivery__c: placeOfDelivery,
    Delivery_Facility__c: p.properties.Delivery_Facility
    ? p.properties.Delivery_Facility.toString().replace(/_/g, ' ')
    : null,
    Delivery_Facility_Other__c: p.properties.Delivery_Facility_Other,
    //Family Planning =====================//
    LMP__c: p.properties.LMP,
    Family_Planning__c: p.properties.family_planning,
    Family_Planning_Method__c: p.properties.family_planning_method,
    FP_Method_Distributed__c: fpMethodDistributed,
    Reasons_for_not_taking_FP_method__c: reasonForNotTakingFP,
    Pregnant__c: p.properties.Pregnant === 'Yes' ? true : false,
    Date_of_Delivery__c: p.properties.delivery_date,
    Counselled_on_FP_Methods__c: p.properties.CounselledFP_methods,
    Client_counselled_on__c: clientCounselled,
    Client_provided_with_FP__c: cleanChoice(
    p.properties[
    'was_the_woman_15-49yrs_provided_with_family_planning_commodities_by_chv'
    ]
    ),
    Received_pregnancy_test__c:
    p.properties.did_you_adminsiter_a_pregnancy_test,
    Pregnancy_test_result__c: p.properties.pregnancy_test_result,
    Gravida__c: p.properties.Gravida,
    Parity__c: p.properties.Parity,
    //TT5 Child Information =====================//
    Exclusive_Breastfeeding__c: p.properties.Exclusive_Breastfeeding,
    Counselled_on_Exclusive_Breastfeeding__c: p.properties.counseling,
    Newborn_visited_48_hours_of_delivery__c:
    p.properties.newborn_visited_48_hours_of_delivery,
    Newborn_visit_counselling__c: cleanChoice(
    p.properties.did_you_consel_the_mother_on1
    ),
    mother_visited_48_hours_of_the_delivery__c:
    p.properties.visit_mother_48,
    Mother_visit_counselling__c: cleanChoice(
    p.properties.did_you_consel_the_mother_on2
    ),
    Newborn_visited_by_a_CHW_within_6_days__c:
    p.properties.visit_6_days_from_delivery,
    //Nutrition =====================//
    Caretaker_action_after_muac_screening__c:
    p.properties.mother_screened_muac_action,
    Caretaker_muac_findings__c:
    p.properties.mother_screened_child_muac_result,
    Food_groups_3_times_a_day__c: p.properties.food_groups,
    Caretaker_screened_for_muac_this__c: cleanChoice(
    p.properties.mother_screened_child_muac
    ),
    Caretaker_trained_in_muac__c: cleanChoice(
    p.properties.mother_trained_muac
    ),
    of_Caretaker_MUAC_screenings__c: p.properties.mother_nb_screening,
    Current_Height__c: p.properties.current_height,
    Current_MUAC__c: p.properties.MUAC,
    Current_Nutrition_Status__c: p.properties.Nutrition_Status
    ? nutritionMap[p.properties.Nutrition_Status]
    : undefined,
    //TT5 & HAWI =====================//
    TT5_Mother_Registrant__c: p.properties.Pregnant == 'Yes' ? 'Yes' : null,
    Enrollment_Date__c:
    p.properties.age < 5 || p.properties.Pregnant == 'Yes'
    ? p.server_date_modified
    : null,
    HAWI_Enrollment_Date__c:
    p.properties.hiv_status == 'positive' ? p.server_date_modified : null,
    Thrive_Thru_5_Registrant__c:
    p.properties.age < 5 || p.properties.Pregnant == 'Yes' ? 'Yes' : 'No',
    HAWI_Registrant__c:
    p.properties.hiv_status == 'positive' ? 'Yes' : 'No',
    //ANC =====================//
    ANC_1__c:
    p.properties.ANC_1 && p.properties.ANC_1 !== ''
    ? p.properties.ANC_1
    : undefined,
    ANC_2__c:
    p.properties.ANC_2 && p.properties.ANC_2 !== ''
    ? p.properties.ANC_2
    : undefined,
    ANC_3__c:
    p.properties.ANC_3 && p.properties.ANC_3 !== ''
    ? p.properties.ANC_3
    : undefined,
    ANC_4__c:
    p.properties.ANC_4 && p.properties.ANC_4 !== ''
    ? p.properties.ANC_4
    : undefined,
    ANC_5__c:
    p.properties.ANC_5 && p.properties.ANC_5 !== ''
    ? p.properties.ANC_5
    : undefined,
    Date_of_Birth__c:
    p.properties.DOB && p.properties.DOB !== ''
    ? p.properties.DOB.replace(/\\/g, '-')
    : undefined,
    //Immunization =====================//
    // Child_missed_immunization_type__c:
    // p.form.TT5.Child_Information.Immunizations.immunization_type,
    BCG__c: p.properties.BCG,
    OPV_0__c: p.properties.OPV_0,
    Measles_6__c: p.properties.Measles_6,
    Measles_9__c: p.properties.Measles_9,
    Measles_18__c: p.properties.Measles_18,
    OPV_1__c: p.properties.OPV_PCV_Penta_1,
    OPV_2__c: p.properties.OPV_PCV_Penta_2,
    OPV_3__c: p.properties.OPV_PCV_Penta_3,
    Rotavirus_1__c: p.properties.rotavirus_1,
    Rotavirus_2__c: p.properties.rotavirus_2,
    IPV__c: p.properties.IPV,
    Vitamin_A_12__c: p.properties.Vitamine_A,
    Vitamin_A_18__c: p.properties.Vitamine_A_2,
    Vitamin_A_24__c: p.properties.Vitamine_A_3,
    Deworming_12__c: p.properties.Deworming_1,
    Deworming_18__c: p.properties.Deworming_2,
    Deworming_24__c: p.properties.Deworming_3,
    //ECD =====================//
    Did_you_counsel_caregiver_on__c: cleanChoice(
    p.properties.did_you_counsel_the_caregiver_on_delayed_milestones
    ),
    Delayed_Milestone__c: cleanChoice(
    p.properties.does_the_child_has_a_delayed_milestone
    ),
    Child_has_2_or_more_play_items__c: cleanChoice(
    p.properties.does_the_child_has_2_or_more_play_items_at_home
    ),
    Child_has_3_or_more_picture_books__c: cleanChoice(
    p.properties.does_the_child_has_3_or_more_picture_books
    ),
    Delayed_Milestones_Counselled_On__c: p.properties
    .which_delayed_milestone_area_did_you_counsel_the_caregiver_on
    ? milestoneMap[
    p.properties
    .which_delayed_milestone_area_did_you_counsel_the_caregiver_on
    ]
    : undefined,
    Delayed_Milestone_Type__c: p.properties.which_delayed_milestone
    ? milestoneTypeMap[p.properties.which_delayed_milestone]
    : undefined,
    //Death =====================//
    Date_of_Death__c: p.properties.Date_of_Death,
    Cause_of_Death__c: p.properties.cause_of_death_dead
    ? p.properties.cause_of_death_dead.toString().replace(/_/g, ' ')
    : p.properties.cause_of_death_dead,
    Verbal_autopsy__c: p.properties.verbal_autopsy,
    //Closing =====================//
    Last_Modified_Date_CommCare__c: p.date_modified,
    Case_Closed_Date__c: p.date_closed,
    };
    });

    sfRecordMapping.forEach(rec => {
    Object.entries(rec).forEach(([key, value]) => {
    if (value === '' || value === null) rec[key] = undefined;
    });
    });

    // TODO clean up after QA
    // console.log(JSON.stringify(caregiverMapping, null, 2), 'careGiver');
    // console.log(JSON.stringify(motherMapping, null, 2), 'Mother');
    //console.log(JSON.stringify(sfRecordMapping, null, 2), 'sfRecordMapping');
    // console.log(JSON.stringify(householdMapping, null, 2), 'householdMapping');
    // console.log(
    // JSON.stringify(headOfHouseholdMapping, null, 2),
    // 'headOfHouseholdMapping'
    // );

    return {
    ...state,
    motherMapping,
    sfRecordMapping,
    caregiverMapping,
    householdMapping,
    headOfHouseholdMapping,
    };
    });


    // TODO, Clean up when pass QA
    /*fn(state => {
    state.sfRecordMapping.forEach(rec => {
    Object.entries(rec).forEach(([key, value]) => {
    if (typeof key !== 'string') throw `${key} is not a string`;
    });
    });
    return state;
    });
    */
    // bulk(
    // 'Household__c',
    // 'upsert',
    // {
    // extIdField: 'CommCare_Code__c',
    // failOnError: true,
    // allowNoOp: true,
    // },
    // state => {
    // console.log('Bulk upserting...');
    // return state.householdMapping;
    // }
    // );

    // TODO, Clean up when pass QA
    // upsert data to SF
    // upsertIf(
    // state.data.properties.commcare_username !== 'test.2021' &&
    // state.data.properties.test_user !== 'Yes',
    // 'Person__c',
    // 'CommCare_ID__c',
    // state => state.sfRecord
    // );

    bulk(
    'Person__c',
    'upsert',
    {
    extIdField: 'CommCare_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting persons ::');
    //HMN commented this
    //console.log(JSON.stringify(state.sfRecordMapping, null, 2));
    return state.sfRecordMapping;
    }
    );
    // TODO, Clean up when pass QA
    // upsertIf(
    // state.data.properties.commcare_username !== 'test.2021' &&
    // state.data.properties.test_user !== 'Yes' &&
    // state.data.properties.caretaker_case_id !== undefined &&
    // state.data.properties.caretaker_case_id !== '',
    // 'Person__c',
    // 'CommCare_ID__c',
    // fields(
    // relationship('Primary_Caregiver_Lookup__r', 'CommCare_ID__c', state => {
    // return (caregiver = dataValue('properties.caretaker_case_id')(state));
    // }),
    // field('CommCare_ID__c', dataValue('case_id'))
    // )
    // );

    bulk(
    'Person__c',
    'upsert',
    {
    extIdField: 'CommCare_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting primary caregiver Persons ::');
    //console.log(JSON.stringify(state.caregiverMapping, null, 2));
    return state.caregiverMapping;
    }
    );

    // TODO, Clean up when pass QA
    // upsertIf(
    // state.data.properties.commcare_username !== 'test.2021' &&
    // state.data.properties.test_user !== 'Yes' &&
    // state.data.properties.mother_case_id !== undefined &&
    // state.data.properties.mother_case_id !== '',
    // 'Person__c',
    // 'CommCare_ID__c',
    // fields(
    // relationship('Mother__r', 'CommCare_ID__c', state => {
    // return (caregiver = dataValue('properties.mother_case_id')(state));
    // }),
    // field('CommCare_ID__c', dataValue('case_id'))
    // )
    // );
    bulk(
    'Person__c',
    'upsert',
    {
    extIdField: 'CommCare_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting mother Person::');
    // console.log(JSON.stringify(state.motherMapping, null, 2));
    return state.motherMapping;
    }
    );

    // TODO, Clean up when pass QA
    // upsertIf(
    // state.data.properties.commcare_username !== 'test.2021' &&
    // state.data.properties.test_user !== 'Yes' &&
    // state.data.properties.head_of_household_case_id !== undefined &&
    // state.data.properties.head_of_household_case_id !== '',
    // 'Household__c',
    // 'CommCare_Code__c',
    // fields(
    // field('CommCare_Code__c', dataValue('indices.parent.case_id')),
    // relationship(
    // 'Head_of_Household__r',
    // 'CommCare_ID__c',
    // dataValue('properties.head_of_household_case_id')
    // )
    // )
    // );

    bulk(
    'Household__c',
    'upsert',
    {
    extIdField: 'CommCare_Code__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting head of household field on HH ::');
    // console.log(JSON.stringify(state.headOfHouseholdMapping, null, 2));
    return state.headOfHouseholdMapping;
    }
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19.html b/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19.html index 95eb4593f7f..708c946bcbe 100644 --- a/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    WF3-1 Bulk get Person Visit cases

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: WF3-1 Bulk get Person Visit cases
    • Adaptor: @openfn/language-http
    • Adaptor Version: v4.2.8
    • Created over 1 year ago
    • Updated 4 months ago
    • Score: 93 (an indicator of how useful this job may be)

    Key Functions

    each, get, map

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['visite'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000; //E.g., change to 10 to process records in smaller batch sizes

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-05-30T03:00:00';

    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);

    const aMinuteAgo = new Date( Date.now() - 1000 * 60 );
    console.log(aMinuteAgo);

    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    //t => `?type=${t}&indexed_on_start=2024-01-15T00:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form

    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);

    return { ...state, references: [], data: {} };
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19.html b/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19.html index 5fb956f8269..488d33fcacf 100644 --- a/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    WF3-2 Bulk upsert Person Visits

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    bulk, dataValue, join, map, query, JSON

    Expression

    fn(state => {
    if (state.payloads.length == 0) return { ...state, personVisits: [] };

    const owner_ids = state.payloads.map(data => data.properties.owner_id);
    const uniq_owner_ids = [...new Set(owner_ids)];

    return { ...state, uniq_owner_ids };
    });

    fn(state => {
    if (state.payloads.length == 0) return state;
    return query(
    `SELECT CommCare_User_ID__c, Id village, Parent_Geographic_Area__c area, Parent_Geographic_Area__r.Name name, Parent_Geographic_Area__r.Parent_Geographic_Area__c catchment FROM Location__c WHERE CommCare_User_ID__c IN ('${state.uniq_owner_ids.join(
    "','"
    )}') GROUP BY Id, CommCare_User_ID__c, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c`
    )(state);
    });

    fn(state => {
    if (state.payloads.length == 0) return state;
    const [reference] = state.references;


    // console.log(JSON.stringify(reference, null, 2));
    const records = reference.records;
    const fetchReference = (owner_id, arg) => {
    const result =
    records && records.length > 0
    ? records.filter(record => record.CommCare_User_ID__c === owner_id)
    : 0;

    return result.length > 0 ? result[0][arg] : undefined;
    };
    const cleanChoice = choice => {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    };

    const handleMultiSelect = multiField => {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value.charAt(0).toUpperCase() + value.slice(1).replace('_', ' ')
    );
    })
    .join(';')
    : '';
    };

    const handleMultiSelectOriginal = multiField => {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return value;
    })
    .join(';')
    : '';
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const counselMap = {
    anc_visits: 'ANC Visits',
    early_initiation_of_anc_less_than_3_months:
    'Early initiation of ANC (less than 3 months)',
    completing_recomended_anc_visits: 'Completing recomended ANC visits',
    danger_signs: 'Danger signs',
    skilled_birth: 'Skilled birth',
    immunization: 'Immunization',
    individual_birth_plan: 'Individual Birth Plan',
    emergency_preparedness: 'Emergency preparedness',
    childcare_and_affection: 'Childcare and affection',
    nutrition_counseling: 'Nutrition counseling',
    growth_monitoring: 'Growth monitoring',
    exclusive_breastfeeding: 'Exclusive breastfeeding',
    complementary_feeding: 'Complementary feeding',
    sleeping_under_llitn: 'Sleeping under LLITN',
    knowing_hiv_status: 'Knowing HIV status',
    indoor_pollution: 'Indoor pollution',
    personal_hygiene: 'Personal Hygiene',
    safe_drinking_water: 'Safe drinking water',
    safe_disposal_of_human_waste: 'Safe disposal of human waste',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for other Ols',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const reasonMap = {
    lack_of_access_to_fp_information: 'Lack of access to FP information',
    no_access_to_fp_services_hospitals:
    'Lack of hospitals or places where FP services can be accessed',
    not_willing_to_use_fp_due_to_negative_effects_myths_and_misconceptions:
    'Myths and misconceptions',
    barriers_at_service_delivery_points: 'Barriers at service delivery points',
    pregnant: 'The client is pregnant',
    intentions_of_getting_pregnant: 'Intentions of getting pregnant',
    not_sexually_active: 'The client is not sexually active',
    other_barriers_culture_male_partners_parents_etc:
    'Other barriers (culture, male partners, parents, etc)',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays Learning Difficulties',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Delay Speech and Language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const milestoneMap = {
    movement: 'Movement',
    hearing: 'Hearing',
    communication: 'Communication',
    seeing: 'Seeing',
    cognitive_delays: 'Cognitive Delays',
    play: 'Play',
    };
    const nutritionMap = {
    severe: 'Severely Malnourished',
    moderate: 'Moderately Malnourished',
    normal: 'Normal',
    };

    const fpMethodMap = {
    male_condoms: 'Male condoms',
    female_condoms: 'Female condoms',
    pop: 'POP',
    coc: 'COC',
    emergency_pills: 'Emergency pills',
    none: 'None',
    //HMN -12/01/2023-
    //adding normalization for the family_planning_method to Family_Planning_Method__c
    iucd: 'IUCD',
    condoms: 'Condoms',
    depo: 'Depo',
    implant: 'Implant',
    injection: 'Injection',
    pills: 'Pills',
    traditional: 'Traditional',
    };

    const symptomsMap = {
    convulsions: 'Convulsions',
    not_able_to_eatdrink: 'Not able to drink or feed at all',
    vomits_everything: 'Vomits everything',
    'chest_in-drawing': 'Chest in - drawing',
    unusually_sleepyunconscious: 'Unusually sleepy or unconscious',
    swelling_of_both_feet: 'Swelling of both feet',
    none: 'None',
    };

    const supervisorMap = {
    community_health_nurse: 'Community_health_nurse',
    chw_supervisor: 'CHW_supervisor',
    chewschas: 'Chewschas',
    other: 'Other',
    none: 'None',
    };

    const treatmentDistributionMap = {
    ors_205gltr_sachets: 'ORS (20.5h/ltr): Sachets',
    acts_6s: 'ACTs (6s)',
    acts_12s: 'ACTs (12s)',
    acts_18s: 'ACTs (18s)',
    acts_24s: 'ACTs (24s)',
    albendazole_abz_tabs: 'Albendazole (ABZ): Tabs',
    paracetamol_tabs: 'Tetracycline Eye Ointment (TEO): 1%:tube',
    tetracycline_eye_ointment_teo_1_tube:
    'Tetracycline Eye Ointment (TEO): 1%:tube',
    amoxycillin: 'Amoxycillin (125mg/5mls: Bottle',
    none: 'None',
    };

    const childDangerSignsMap = {
    none: 'None',
    Poor_Breastfeeding: 'Poor Breastfeeding',
    not_able_to_feed_since_birth_or_stopped_feeding_well:
    'Not able to feed since birth, or stopped feeding well',
    not_able_to_breastfeed: 'Not able to breastfeed',
    Fever: 'Fever',
    very_low_temperature: 'Very low temperature (35.4 C or less)',
    shivering: 'Shivering',
    Fast_Breathing: 'Fast Breathing',
    Very_Sleepy: 'Very Sleepy',
    Convulsions_and_Fits: 'Convulsions and Fits',
    only_moves_when_stimulated_or_does_not_move_even_on_stimulation:
    'Only moves when stimulated, or does not move even on stimulation',
    yellow_solebaby_body_turning_yellow_especially_eyes_palms_soles:
    'Yellow sole(Baby body turning yellow especially eyes, palms,soles)',
    bleeding_from_the_umbilical_stump: 'Bleeding from the umbilical stump',
    signs_of_local_infection_umbilicus_is_red_or_draining_pus_skin_boils_or_eye:
    'Signs of local infection: umbilicus is red or draining pus, skin boils, or eyes draining pus',
    weight_chart_using_color_coded_scales_if_red_or_yellowweight_below_25kg_or_:
    'Weight chart using color coded scales if RED or YELLOW(Weight below 2.5kg or born less than 36 weeks of age)',
    unable_to_cry: 'Unable to cry',
    cyanosis: 'Cyanosis',
    bulging_fontanelle: 'Bulging fontanelle',
    };

    return {
    ...state,
    counselMap,
    serviceMap,
    reasonMap,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    symptomsMap,
    supervisorMap,
    treatmentDistributionMap,
    childDangerSignsMap,
    fetchReference,
    cleanChoice,
    handleMultiSelect,
    handleMultiSelectOriginal,
    };
    });

    fn(state => {
    if (state.payloads.length == 0) return state;
    const {
    counselMap,
    serviceMap,
    reasonMap,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    symptomsMap,
    supervisorMap,
    treatmentDistributionMap,
    childDangerSignsMap,
    fetchReference,
    cleanChoice,
    handleMultiSelect,
    handleMultiSelectOriginal,
    } = state;

    const personVisits = state.payloads
    //HMN 30/06/2023 Allow test user to post
    /*
    .filter(
    p =>
    p.properties.username !== 'test.2021' &&
    p.properties.test_user !== 'Yes'
    )*/
    .map(p => {
    // commCareVisitID
    const commCareCase_id = p.case_id;
    const dateVisit = p.properties.date_opened;
    const commCareVisitID = commCareCase_id + '_' + dateVisit;

    // personsSymptoms
    const psCheck = p.properties.symptoms_check_other;
    const psValue =
    psCheck && psCheck !== ''
    ? psCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return symptomsMap[value] || value;
    })
    : undefined;
    const personsSymptoms = psValue ? psValue.join(';') : undefined;

    // familyPlanningMethod
    const fpmStatus = p.properties.family_planning_method;
    const fpmValue =
    fpmStatus && fpmStatus !== ''
    ? fpmStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return fpMethodMap[value] || value;
    })
    : undefined;
    const familyPlanningMethod = fpmValue ? fpmValue.join(';') : undefined;

    // fpMethodDistributed
    const fpmdStatus = p.properties.FP_commodity;
    const fpmdValue =
    fpmdStatus && fpmdStatus !== ''
    ? fpmdStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return fpMethodMap[value] || value;
    })
    : undefined;
    const fpMethodDistributed = fpmdValue ? fpmdValue.join(';') : undefined;

    // reasonForNotTakingFPMethod
    const rfntStatus = p.properties.No_FPmethod_reason;
    const rfntValue =
    rfntStatus && rfntStatus !== ''
    ? rfntStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return reasonMap[value] || value;
    })
    : undefined;
    const reasonForNotTakingFPMethod = rfntValue
    ? rfntValue.join(';')
    : undefined;

    // clientCounselledOnC
    const ccocChoices =
    p.properties.counsel_topic || p.properties.counsel_topic;
    const ccocVhoiceGroups = ccocChoices ? ccocChoices.split(' ') : null;
    const clientCounselledOnC = ccocVhoiceGroups
    ? ccocVhoiceGroups
    .map(cg => {
    return counselMap[cg];
    })
    .join(';')
    : ccocVhoiceGroups;

    // treatmentDistributionC
    //const tdcStatus = p.form.treatment_and_tracking.distribution.distributed_treatments;
    const tdcStatus = p.properties.distributed_treatments;
    const tdcValue =
    tdcStatus && tdcStatus !== ''
    ? tdcStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return treatmentDistributionMap[value] || value;
    })
    : undefined;
    const treatmentDistributionC = tdcValue ? tdcValue.join(';') : undefined;

    // chronicIllnesC
    const ciChoice =
    p.properties.please_specify_which_chronic_illness_the_person_has;
    const ciChoice2 = handleMultiSelect(ciChoice);
    const chronicIllnesC = ciChoice2 ? ciChoice2.replace(/_/g, ' ') : '';

    // supervisorVisit
    const svCheck = p.properties.supervisor_visit;
    const svValue =
    svCheck && svCheck !== ''
    ? svCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return supervisorMap[value] || value;
    })
    : undefined;
    const supervisorVisit = svValue ? svValue.join(';') : undefined;
    const recordType = p.properties.RecordType;

    return {
    CommCare_ID__c: p.case_id, //'visit' case_id
    'Person__r.CommCare_ID__c':
    p.indices.parent.case_id || p.properties.parent_id,
    CommCare_Visit_ID__c: commCareVisitID,
    Date__c: p.properties.Date,
    Birth_Status__c: p.properties.child_status,
    Catchment__c: fetchReference(p.properties.owner_id, 'catchment'),
    //HMN Accommodating Record Type in Visit
    'RecordType.Name': recordType === 'Unborn' || recordType === 'Child'
    ? 'Child Visit'
    :recordType === 'Youth'
    ? 'Youth Visit'
    :recordType === 'Male Adult'
    ? 'Adult Male Visit'
    : recordType === 'Female Adult'
    ? 'Adult Female Visit'
    :undefined,
    Use_mosquito_net__c: cleanChoice(p.properties.sleep_under_net),
    Individual_birth_plan_counselling__c:
    p.properties.individual_birth_plan,
    Reason_for_not_taking_a_pregnancy_test__c: p.properties.No_Preg_Test
    ? p.properties.No_Preg_Test.toString().replace(/_/g, ' ')
    : undefined,
    Pregnancy_danger_signs__c: p.properties.No_Preg_Test
    ? pregDangerMap[p.properties.No_Preg_Test]
    : undefined,
    Child_Danger_Signs__c: p.properties.Other_Danger_Signs
    ? childDangerSignsMap[p.properties.Other_Danger_Signs]
    : undefined,
    Current_Malaria_Status__c: cleanChoice(
    p.properties.malaria_test_results
    ),
    Malaria_Home_Test__c: p.properties.malaria_test_date,
    Malaria_Home_Treatment__c: p.properties.malaria_test_date,
    Persons_symptoms__c: personsSymptoms,
    Active_in_Support_Group__c: p.properties.Active_in_Support_Group,
    HAWI_Defaulter__c: p.properties.default === 'Yes' ? true : false,
    Date_of_Default__c: p.properties.date_of_default,
    Persons_temperature__c: p.properties.temperature,
    Days_since_illness_start__c: p.properties.duration_of_sickness,
    Newborn_visited_48_hours_of_delivery__c:
    p.properties.newborn_visited_48_hours_of_delivery,
    Newborn_visited_by_a_CHW_within_6_days__c:
    p.properties.visit_6_days_from_delivery,
    Current_Malaria_Status__c: p.properties.malaria_test_results,
    Malaria_test__c: cleanChoice(p.properties.malaria_test),
    Fever__c: cleanChoice(p.properties.symptoms_check_fever),
    Cough__c: cleanChoice(p.properties.symptoms_check_cough),
    Diarrhoea__c: cleanChoice(p.properties.symptoms_check_diarrhea),
    TB_patients_therapy_observed__c: p.properties.observed_tb_therapy,
    Injuries_or_wounds__c: p.properties.wounds_or_injuries,
    Currently_on_ART_s__c: p.properties.ART,
    // ART_Regimen__c: () => {
    // const choice = dataValue(
    // 'properties.ARVs;
    // return cleanChoice(choice);
    // },
    Immediate_Breastfeeding__c: p.properties.Breastfeeding_Delivery,
    Exclusive_Breastfeeding__c: p.properties.Exclusive_Breastfeeding,
    Counselled_on_Exclusive_Breastfeeding__c: p.properties.counseling,
    LMP__c: p.properties.when_was_your_lmp,
    Family_Planning__c: cleanChoice(p.properties.family_planning),
    Family_Planning_Method__c: p.properties.family_planning_method,
    Family_Planning_Method__c: familyPlanningMethod,
    FP_Method_Distributed__c: fpMethodDistributed,
    Reasons_for_not_taking_FP_method__c: reasonForNotTakingFPMethod,
    Pregnant__c: p.properties.Pregnant === 'Yes' ? true : false,
    Counselled_on_FP_Methods__c: cleanChoice(
    p.properties.CounselledFP_methods
    ),
    Client_counselled_on__c: clientCounselledOnC,
    Client_provided_with_FP__c: cleanChoice(
    p.properties[
    'was_the_woman_15-49yrs_provided_with_family_planning_commodities_by_chv'
    ]
    ),
    Newborn_visited_48_hours_of_delivery__c:
    p.properties.newborn_visited_48_hours_of_delivery,
    Mother_visit_counselling__c: cleanChoice(
    p.properties.did_you_consel_the_mother_on1
    ),
    mother_visited_48_hours_of_the_delivery__c:
    p.properties.visit_mother_48,
    Newborn_visit_counselling__c: cleanChoice(
    p.properties.did_you_consel_the_mother_on2
    ),
    Know_HIV_status__c: cleanChoice(p.properties.known_hiv_status),
    HIV_Status__c: p.properties.hiv_status,
    Treatment_Distribution__c: treatmentDistributionC,
    // QUESTION: Field name not found : Current_Weight__c
    // Current_Weight__c: p.properties.Current_Weight,
    Current_Height__c: p.properties.current_height,
    Current_MUAC__c: p.properties.MUAC,
    Food_groups_3_times_a_day__c: p.properties.food_groups,
    Nutrition_Case_Managed__c: p.properties.nutrition_case_managed,
    Nutrition_Danger_Signs__c: handleMultiSelectOriginal(
    p.properties.nutrition_danger_signs
    ),
    Why_was_nutrition_case_not_managed__c:
    p.properties.nutrition_case_not_managed_why,
    Community_Nutrition_Treatment__c:
    p.properties.nutrition_treatment_severe,
    Community_Nutrition_Treatment__c:
    p.properties.nutrition_treatment_moderate,
    Why_was_nutrition_treatment_not_given__c:
    p.properties.nutrition_treatment_not_given,
    Current_Nutrition_Status__c: p.properties.Nutrition_Status
    ? nutritionMap[p.properties.Nutrition_Status]
    : undefined,
    Default_on_TB_treatment__c: cleanChoice(
    p.properties.default_tb_treatment
    ),
    Received_pregnancy_test__c: cleanChoice(
    p.properties.did_you_adminsiter_a_pregnancy_test
    ),
    Pregnancy_test_result__c: cleanChoice(
    p.properties.pregnancy_test_result
    ),
    Chronic_illness__c: chronicIllnesC,
    Childs_breath_per_minute__c: p.properties.breaths_per_minuite,
    Child_chest_in_drawing__c: p.properties.Child_chest_in_drawing_c,
    Caregiver_counseled_on_delayed_milestone__c:
    p.properties.did_you_counsel_the_caregiver_on_delayed_milestones,
    Delayed_Milestone__c:
    p.properties.does_the_child_has_a_delayed_milestone,
    Child_has_2_or_more_play_items__c:
    p.properties.does_the_child_has_2_or_more_play_items_at_home,
    Child_has_3_more_picture_books__c:
    p.properties.does_the_child_has_3_or_more_picture_books,
    Delayed_Milestones_Counselled_On__c: p.properties
    .which_delayed_milestone_area_did_you_counsel_the_caregiver_on
    ? milestoneMap[
    p.properties
    .which_delayed_milestone_area_did_you_counsel_the_caregiver_on
    ]
    : undefined,
    Delayed_Milestone_Type__c: p.properties.which_delayed_milestone
    ? milestoneMap[p.properties.which_delayed_milestone]
    : undefined,
    Caretaker_trained_in_muac__c: p.properties.mother_trained_muac,
    Caretaker_screened_for_muac_this__c:
    p.properties.mother_screened_child_muac,
    Caretaker_muac_findings__c:
    p.properties.mother_screened_child_muac_result,
    Caretaker_action_after_muac_screening__c:
    p.properties.mother_screened_muac_action,
    of_Caretaker_MUAC_screenings__c: p.properties.mother_nb_screening,
    Pulse_Oximeter__c: p.properties.pulse_oximeter_available,
    Heart_Rate_Pulse_Oximeter__c: p.properties.heart_rate_pulse_oximeter,
    Oxygen_Concentration_Pulse_Oximeter__c:
    p.properties.oxygen_concentration,
    Can_child_drink__c: p.properties.can_child_drink,
    Antibiotic_provided_for_fast_breathing__c:
    p.properties.antibiotic_fast_breathing,
    Antibiotic_provided_for_chest_indrawing__c:
    p.properties.antibiotic_chest_indrawing,
    Supervisor_Visit__c: supervisorVisit,
    //HMN commented this one due to error "Error: InvalidBatch : Field name not found : Visit_Closed_Date__c"
    //Visit_Closed_Date__c: p.properties.date_closed,
    //29/06/2023 Added Malaria Vaccine mapping
    malaria_vaccine_received__c:
    p.properties.malaria_vaccine_received,
    rts_s_1_date__c:
    p.properties.rts_s_1_date,
    rts_s_2_date__c:
    p.properties.rts_s_2_date,
    rts_s_3_date__c:
    p.properties.rts_s_3_date,
    rts_s_4_date__c:
    p.properties.rts_s_4_date,

    //HMN 29/06/2023
    };
    });

    personVisits.forEach(person => {
    Object.entries(person).forEach(([key, value]) => {
    if (value === '' || value === null) person[key] = undefined;
    });
    });

    // JSON logging of records
    //HMN debugger 19/10/2023
    // console.log(JSON.stringify(personVisits, null, 2));

    return { ...state, personVisits };
    });

    bulk(
    'Person_visit__c',
    'upsert',
    {
    extIdField: 'CommCare_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting person visit...');
    return state.personVisits;
    }
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31.html b/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31.html index 9d4a9147d63..006d928542c 100644 --- a/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31.html +++ b/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    WF3-2a Repeat Failed Person Visits

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    each, get, map

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['visite'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000; //E.g., change to 10 to process records in smaller batch sizes

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-05-30T03:00:00';

    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);

    const aMinuteAgo = new Date( Date.now() - 1000 * 60 );
    console.log(aMinuteAgo);

    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    //t => `?type=${t}&indexed_on_start=2024-01-15T00:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form

    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);

    return { ...state, references: [], data: {} };
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19.html b/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19.html index d50d50d03ba..488dc0475b7 100644 --- a/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    WF4-1 Bulk get Referral Cases

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: WF4-1 Bulk get Referral Cases
    • Adaptor: @openfn/language-http
    • Adaptor Version: v4.2.8
    • Created over 1 year ago
    • Updated 6 months ago
    • Score: 93 (an indicator of how useful this job may be)

    Key Functions

    each, get, map

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['Case'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000; //E.g., change to 10 to process records in smaller batch sizes

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-01-17T00:00:00';

    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);

    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    //t => `?type=${t}&indexed_on_start=2024-01-14T00:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form
    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);
    return { ...state, references: [], data: {} };
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19.html b/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19.html index ad4ff39d719..469a2660f62 100644 --- a/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    WF4-2 Bulk upsert Services

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    bulk, join, map, query, JSON

    Expression

    // NOTE: We perform a query before anything else if this is a 'Case'
    fn(state => {
    // state.type = state.data.indices.parent.case_type;
    if (state.payloads.length == 0) return { ...state, services: [] };

    const caseType = state.payloads
    .filter(c => c.indices.parent.case_type === 'Case')
    .map(c => c.indices.parent.case_id);

    console.log(JSON.stringify(caseType, null, 2));

    if (caseType.length > 0)
    return query(
    `SELECT Person__r.CommCare_ID__c FROM Service__c WHERE Service_UID__c IN ('${caseType.join(
    "','"
    )}')`
    )(state).then(state => {
    const { records } = state.references[0];
    const ccId =
    records.length == 1 ? records[0].Person__r.CommCare_ID__c : null;
    return { ...state, ccId };
    });

    return state;
    });

    // NOTE: We construct a facilityMap and populate some conditional relationships
    fn(state => {
    if (state.payloads.length == 0) return state;
    const facilityMap = {
    Lwala_Hospital: 'Lwala Hospital',
    Minyenya_Dispensary: 'Minyenya Dispensary',
    Ndege_Oriedo_Dispensary: 'Ndege Oriedo Dispensary',
    'Rongo_Sub-District_Hospital': 'Rongo Sub-District Hospital',
    Kangeso_Dispensary: 'Kangeso Dispensary',
    Ngodhe_Dispensary: 'Ngodhe Dispensary',
    Ngere_Dispensary: 'Ngere Dispensary',
    Verna_Health_Center: 'Verna Health Center',
    Kochola_Dispensary: 'Kochola Dispensary',
    Ongo_Health_Center: 'Ongo Health Center',
    Royal_Medical_Center: 'Royal Medical Center',
    Rosewood_Facility: 'Rosewood Facility',
    Other: 'Other',
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for Other OIs',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays (Learning Difficulties)',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Speech and language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const symptomsMap = {
    convulsions: 'Convulsions',
    not_able_to_eatdrink: 'Not able to eat/drink',
    vomits_everything: 'Vomits everything',
    'chest_in-drawing': 'Chest in-drawing',
    unusually_sleepyunconscious: 'Unusually sleepy/unconscious',
    swelling_of_both_feet: 'Swelling of both feet',
    };

    const childSignMap = {
    Poor_Breastfeeding: 'Poor Breastfeeding (under 6 months old child)',
    not_able_to_feed_since_birth_or_stopped_feeding_well:
    'Not able to feed since birth, or stopped feeding well',
    not_able_to_breastfeed: 'Not able to breastfeed',
    Fever: 'Fever (37.5 C or more)',
    very_low_temperature: 'Very low temperature (35.4 C or less)',
    shivering: 'Shivering',
    Fast_Breathing: 'Fast Breathing',
    Very_Sleepy: 'Very Sleepy',
    Convulsions_and_Fits: 'Convulsions and Fits',
    only_moves_when_stimulated_or_does_not_move_even_on_stimulation:
    'Only moves when stimulated, or does not move even on stimulation',
    yellow_solebaby_body_turning_yellow_especially_eyes_palms_soles:
    'Yellow sole(Baby body turning yellow especially eyes, palms, soles)',
    bleeding_from_the_umbilical_stump: 'Bleeding from the umbilical stump',
    signs_of_local_infection_umbilicus_is_red_or_draining_pus_skin_boils_or_eye:
    'Signs of local infection: umbilicus is red or draining pus, skin boils, or eyes draining pus',
    weight_chart_using_color_coded_scales_if_red_or_yellowweight_below_25kg_or_:
    'Weight chart using color coded scales if RED or YELLOW(Weight below 2.5kg or born less than 36 weeks of age)',
    unable_to_cry: 'Unable to cry',
    cyanosis: 'Cyanosis',
    bulging_fontanelle: 'Bulging fontanelle',
    };

    const otherReferralMap = {
    HIV_Testing_and_Counseling: 'HIV Testing and Counseling',
    Visit_to_Clinician: 'Visit to Clinician',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    PMTCT: 'PMTCT',
    TB: 'TB',
    Treatment_for_other_OIs: 'Treatment for other OIs',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care_ANCE: 'Pregnancy Care (ANC)',
    Family_Planning_FP: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    blood_in_stool: 'Blood in Stool',
    Blood_in_Stool: 'Blood in Stool',
    Immunization: 'Immunization',
    Routine_Health_Check_ups: 'Routine Health Check ups',
    routine_health_check_ups: 'Routine Health Check ups',
    Other: 'Other',
    Poor_Breastfeeding: 'Poor Breastfeeding (under 6 months old child)',
    not_able_to_feed_since_birth_or_stopped_feeding_well:
    'Not able to feed since birth, or stopped feeding well',
    not_able_to_breastfeed: 'Not able to breastfeed',
    Fever: 'Fever (37.5 C or more)',
    very_low_temperature: 'Very low temperature (35.4 C or less)',
    shivering: 'Shivering',
    Fast_Breathing: 'Fast Breathing',
    Very_Sleepy: 'Very Sleepy',
    Convulsions_and_Fits: 'Convulsions and Fits',
    only_moves_when_stimulated_or_does_not_move_even_on_stimulation:
    'Only moves when stimulated, or does not move even on stimulation',
    yellow_solebaby_body_turning_yellow_especially_eyes_palms_soles:
    'Yellow sole(Baby body turning yellow especially eyes, palms, soles)',
    bleeding_from_the_umbilical_stump: 'Bleeding from the umbilical stump',
    signs_of_local_infection_umbilicus_is_red_or_draining_pus_skin_boils_or_eye:
    'Signs of local infection: umbilicus is red or draining pus, skin boils, or eyes draining pus',
    weight_chart_using_color_coded_scales_if_red_or_yellowweight_below_25kg_or_:
    'Weight chart using color coded scales if RED or YELLOW(Weight below 2.5kg or born less than 36 weeks of age)',
    unable_to_cry: 'Unable to cry',
    cyanosis: 'Cyanosis',
    bulging_fontanelle: 'Bulging fontanelle',
    };

    const homeCareMap = {
    Adherence_Counseling: 'Adherence Counseling',
    Pill_Count_Monitoring: 'Pill Count Monitoring',
    Nutrition_Assessment_and_Counseling: 'Nutrition Assessment and Counseling',
    WASH_Counseling: 'WASH Counseling',
    Prevention_Counseling: 'Prevention Counseling',
    Psychosocial_Support: 'Psychosocial Support',
    Provision_of_Supplies: 'Provision of Supplies',
    OI_Management_Support: 'OI Management Support',
    };

    const ecdMap = {
    physiotherapy: 'Physiotherapy',
    speech_therapy: 'Speech Therapy',
    nutrition_education: 'Nutrition Education',
    play_therapy: 'Play Therapy',
    assessment: 'Assessment',
    counselling: 'Counselling',
    other: 'Other',
    };

    const clinicalMap = {
    diarrhea: 'Diarrhea',
    malnutrition: 'Malnutrition',
    malaria: 'Malaria',
    acute_respiratory_infection: 'Acute Respiratoy Infection (ARI)',
    accident_injury: 'Accident/Injury',
    other: 'Other',
    };

    const caseType = state.payloads
    .filter(c => c.indices.parent.case_type === 'Case')
    .map(c => c.indices.parent.case_id);

    const personType = state.payloads
    .filter(c => c.indices.parent.case_type === 'Person')
    .map(c => c.indices.parent.case_id);

    let relationships = [];

    // If it's a person, add the person relationship
    if (personType.length > 0) {
    personType.forEach(case_id => {
    relationships.push({ 'Person__r.CommCare_ID__c': case_id });
    });
    }

    // If it's a service, add the service rship AND a different person rship
    if (caseType.length > 0) {
    caseType.forEach(case_id => {
    relationships.push({ 'Parent_Service__r.Service_UID__c': case_id });
    });

    relationships.push({ 'Person__r.CommCare_ID__c': state.ccId });
    }

    return {
    ...state,
    facilityMap,
    relationships,
    serviceMap,
    pregDangerMap,
    milestoneTypeMap,
    symptomsMap,
    childSignMap,
    otherReferralMap,
    homeCareMap,
    clinicalMap,
    ecdMap,
    };
    });

    // NOTE: We finally upsert to the Service__c object in Salesforce
    fn(state => {
    if (state.payloads.length == 0) return state;
    const services = state.payloads
    .filter(r => r.properties.owner_id !== '8e725928e3ce43d19b390dd604097069')
    .map(r => {
    // pregnancyDangerSigns
    const pCheck = r.properties.pregnancy_danger_signs;
    const pValue =
    pCheck && pCheck !== ''
    ? pCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.pregDangerMap[value] || value;
    })
    : undefined;
    const pregnancyDangerSigns = pValue ? pValue.join(';') : undefined;

    // childDangerSigns
    const cCheck = r.properties.Other_Danger_Signs;
    const cValue =
    cCheck && cCheck !== ''
    ? cCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.childSignMap[value] || value;
    })
    : undefined;
    const childDangerSigns = cValue ? cValue.join(';') : undefined;

    // delayedMilestone
    const dCheck = r.properties.which_delayed_milestone;
    const dValue =
    dCheck && dCheck !== ''
    ? dCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.milestoneTypeMap[value] || value;
    })
    : undefined;
    const delayedMilestone = dValue ? dValue.join(';') : undefined;

    // seriousSymptoms
    const sCheck = r.properties.symptoms_check_other;
    const sValue =
    sCheck && sCheck !== ''
    ? sCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.symptomsMap[value] || value;
    })
    : undefined;
    const seriousSymptoms = sValue ? sValue.join(';') : undefined;

    // otherReferralReason
    const otCheck = r.properties.Other_Referral_Reasons;
    const otValue =
    otCheck && otCheck !== ''
    ? otCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.otherReferralMap[value] || value;
    })
    : undefined;
    const otherReferralReason = otValue ? otValue.join(';') : undefined;

    // homeBasedCareRendered
    const homeCheck = r.properties.Home_Based_Care_Provided;
    const homeValue =
    homeCheck && homeCheck !== ''
    ? homeCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.homeCareMap[value] || value;
    })
    : undefined;
    const homeBasedCareRendered = homeValue ? homeValue.join(';') : undefined;

    // ecdClinicalService
    const ecdCheck = r.properties.ECD_Clinical_Service;
    const ecdValue =
    ecdCheck && ecdCheck !== ''
    ? ecdCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.ecdMap[value] || value;
    })
    : undefined;
    const ecdClinicalService = ecdValue ? ecdValue.join(';') : undefined;

    return {
    'Person__r.CommCare_ID__c':
    r.indices.parent.case_type === 'Person'
    ? r.indices.parent.case_id
    : r.indices.parent.case_type === 'Case'
    ? state.ccId
    : undefined,
    Service_UID__c: r.case_id,
    CommCare_Code__c: r.case_id,
    RecordTypeID: '01224000000YAuK',
    'Household_CHW__r.CommCare_ID__c': r.properties.CHW_ID,
    Open_Case__c: r.closed === false ? true : false,
    Case_Closed_Date__c: r.properties.date_closed,
    Age_Time_of_Service__c: r.properties.age,
    Source__c: r.properties.Source === '1',
    Clinical_facility__c: r.properties.Facility_Visited
    ? state.facilityMap[r.properties.Facility_Visited]
    : undefined,
    Client_Received_Services_at_Facility2__c: r.properties.Facility_Visit,
    Clinical_Visit_Date__c:
    r.properties.Facility_Date === '' ||
    r.properties.Facility_Date === undefined
    ? undefined
    : r.properties.Facility_Date,
    CHW_Followed_Up_with_the_Client__c: r['properties.Follow-Up']!== ''
    ? r['properties.Follow-Up']
    : undefined,
    Follow_Up_Date__c: r['properties.Follow-Up_Date'],

    Person_Complied_w_Referral_in_24_hrs__c:r.properties.referral_compliance,
    Skillled_Delivery__c: r.properties.skilled_delivery,
    Child_received_immunizations__c: r.properties.immunization,
    Received_a_diagnosis_for_PSBI__c: r.properties.psbi_diagnosis !== ''
    ? r.properties.psbi_diagnosis
    : undefined, //Form: CHW.Follow-Up.PSBI.psbi_diagnosis
    Received_antibiotics_per_protocol__c: r.properties.antibiotic_8days, //Form: CHW.Follow-Up.PSBI.antibiotic_8day

    Distributed_Treatment_on_Last_Visit__c:
    r.properties.distribute_treatment, //Form: CHW.Follow-Up.distribute_treatment
    Person_had_an_adverse_drug_reaction__c:
    r.properties.adverse_drug_reaction,
    Defaulted__c:
    r.properties.date_of_default && r.properties.date_of_default !== ''
    ? true
    : false,
    Date_of_Default__c: r.properties.date_of_default,
    Client_s_Symptoms_Improved__c: r.properties.Client_Improved,
    Case_Type__c: r.properties.Case_Type,
    Follow_Up_By_Date__c:
    r.properties['Follow-Up_By_Date'] &&
    r.properties['Follow-Up_By_Date'] !== ''
    ? r.properties['Follow-Up_By_Date']
    : undefined,
    Date__c: new Date(r.properties.date_opened).toISOString(),
    Reason_for_Service__c: r.properties.Reason_for_Service,
    Type_of_Service__c: r.properties.Type_of_Service,
    Malaria_Status__c: r.properties.Malaria_Status,
    Home_Treatment_Date__c: r.properties.home_treatment_date,
    Malaria_Home_Test_Date__c: r.properties.malaria_test_date,
    Home_ORS__c: r.properties.clinic_ors,
    Home_Zinc__c: r.properties.clinic_zinc,
    Height__c: r.properties.height,
    Weight__c: r.properties.weight,
    MUAC__c: r.properties.muac,
    Nutrition_Status__c: r.properties.Nutrition_Status,

    //===== NEW MAPPINGS - JAN 14 ===========================//
    Pregnancy_Danger_Signs__c: pregnancyDangerSigns,
    Child_Danger_Signs__c: childDangerSigns,
    Delayed_Milestone__c: delayedMilestone,
    Serious_Symptoms__c: seriousSymptoms,
    Other_Referral_Reasons__c: otherReferralReason,
    Home_Based_Care_Rendered__c: homeBasedCareRendered,
    PSBI_Visit__c:
    r.properties.psbi_task && r.properties.psbi_task !== ''
    ? `Day ${r.properties.psbi_task}`
    : undefined,
    Clinical_Services__c: r.properties.TT5_Clinical_Service
    ? state.clinicalMap[r.properties.TT5_Clinical_Service]
    : r.properties.TT5_Clinical_Service,
    Referred_Facility__c: r.properties.referred_facility
    ? state.facilityMap[r.properties.referred_facility]
    : r.properties.referred_facility,
    HAWI_Clinical_Services__c: r.properties.HAWI_Clinical_Service
    ? state.serviceMap[r.properties.HAWI_Clinical_Service]
    : r.properties.HAWI_Clinical_Service,
    ECD_Clinical_Services__c: ecdClinicalService,

    };
    });

    return { ...state, services };
    });
    /* JSON logging of records
    fn(state => {
    console.log('Services to upsert ::', JSON.stringify(state.services));
    return state;
    });
    */

    bulk(
    'Service__c',
    'upsert',
    {
    extIdField: 'Service_UID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting service...');
    return state.services;
    }
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html b/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html index 31a905c87bf..606854e5448 100644 --- a/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html +++ b/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    aleksa cron

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    Expression

    fn(state => {
    console.log(state);
    return state;
    })
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/alter-state-before-operations.html b/adaptors/library/jobs/auto/alter-state-before-operations.html index aa46f4bc8c5..6de4187cbf3 100644 --- a/adaptors/library/jobs/auto/alter-state-before-operations.html +++ b/adaptors/library/jobs/auto/alter-state-before-operations.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Pre-processing data

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, merge, relationship, upsert, Array

    Expression

    // Here, we make sure CommCare gives us an array to use in each(merge(...), ...)
    fn(state => {
    const idCards = state.data.form.ID_cards_given_to_vendor;
    if (!Array.isArray(idCards)) {
    state.data.form.ID_cards_given_to_vendor = [idCards];
    }
    return state;
    });

    // Now state has been changed, and we carry on...
    each(
    merge(
    dataPath('form.ID_cards_given_to_vendor[*]'),
    fields(
    field('Vendor_Id', dataValue('form.ID_vendor')),
    field('form_finished_time', dataValue('form.meta.timeEnd'))
    )
    ),
    upsert(
    'Small_Packet__c',
    'sp_id__c',
    fields(
    field('sp_id__c', dataValue('ID_cards_given_to_vendor')),
    relationship('Vendor__r', 'Badge_Code__c', dataValue('Vendor_Id')),
    field(
    'Small_Packet_Distribution_Date__c',
    dataValue('form_finished_time')
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/async-and-array-dot-map.html b/adaptors/library/jobs/auto/async-and-array-dot-map.html index 1bbd77cf7c4..893cc4c3f30 100644 --- a/adaptors/library/jobs/auto/async-and-array-dot-map.html +++ b/adaptors/library/jobs/auto/async-and-array-dot-map.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Using async and array.map

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    map, post, async, await, Promise

    Expression

    fn(state => {
    console.log('Here we will await the result of a LOT of async operations.');

    console.log('First we needed to break large arrays into smaller chunks.');
    function chunk(arr, chunkSize) {
    var R = [];
    for (var i = 0, len = arr.length; i < len; i += chunkSize)
    R.push(arr.slice(i, i + chunkSize));
    return R;
    }

    const clinicSets = chunk(state.data.Clinic, 10);
    const patientSets = chunk(state.data.Patient, 10);
    const visitSets = chunk(state.data.Visit, 10);
    const deletedVisitSets = chunk(state.data.VisitDeleted, 10);

    console.log('Then we define a bunch of different async functions.');
    const postClinics = async cs => {
    return post(state.configuration.inboxUrl, {
    body: { clinics: cs },
    })(state);
    };

    const postPatients = async ps => {
    return post(state.configuration.inboxUrl, {
    body: { patients: ps },
    })(state);
    };

    const postVisits = async vs => {
    return post(state.configuration.inboxUrl, {
    body: { visits: vs },
    })(state);
    };

    const postDeletedVisits = async dvs => {
    return post(state.configuration.inboxUrl, {
    body: { deletedVisits: dvs },
    })(state);
    };

    console.log(
    'Then we define a single function that wraps them all up and waits for all the individual functions to resolve.'
    );
    async function makePosts() {
    return Promise.all([
    ...clinicSets.map(item => postClinics(item)),
    ...patientSets.map(item => postPatients(item)),
    ...visitSets.map(item => postVisits(item)),
    ...deletedVisitSets.map(item => postDeletedVisits(item)),
    ]);
    }

    console.log(
    'Then we return that function, forcing our next operation to await the result of this one.'
    );
    return makePosts();
    });

    fn(state => {
    console.log('I show up AFTER those async functions are resolved.');
    return state;
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/async-findValue.html b/adaptors/library/jobs/auto/async-findValue.html index 2e21df62ce5..bcc5d52b4e6 100644 --- a/adaptors/library/jobs/auto/async-findValue.html +++ b/adaptors/library/jobs/auto/async-findValue.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Using findValue with an array of data

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    findValue, upsertMany, async, await

    Expression

    fn(async state => {
    const dataArray =
    state.data.body.st_grass_repeat ||
    state.data.body["plot_forest_area/st_grass_repeat"] ||
    [];
    const dataGrass = [];
    const path = state.data.body.st_grass_repeat
    ? "st_grass_repeat"
    : "plot_forest_area/st_grass_repeat";

    for (let data of uniqueGrass) {
    dataGrass.push({
    WCSPROGRAMS_TaxaID: await findValue({
    uuid: "WCSPROGRAMS_TaxaID",
    relation: "WCSPROGRAMS_Taxa",
    where: {
    ScientificName: `%${state.handleValue(
    data["st_grass_repeat/grass_species"]
    )}%`,
    },
    operator: { ScientificName: "like" },
    })(state),
    UnknownSpeciesImage: data[`${path}/noknown`],
    GrassPercent: data[`${path}/grass_perc`],
    GrassHeight: data[`${path}/grass_height`],
    AnswerId: state.data.body._id,
    });
    }

    return upsertMany(
    "WCSPROGRAMS_VegetationGrass",
    "WCSPROGRAMS_VegetationGrassCode",
    () => dataGrass
    )(state);
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.html b/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.html index b65167bc7c5..603cf598bfa 100644 --- a/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.html +++ b/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Using merge and each

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    create, dataPath, dataValue, each, field, fields, index, join, lastReferenceValue, merge, relationship

    Expression

    each(
    join('$.data.data[*]', '$.data.formId', 'formId'),
    create(
    'ODK_Submission__c',
    fields(
    //bridgetest sandbox record type, comment out when not in use
    field('RecordTypeId', '012J00000005hlb'),
    //prduction record type, comment out when not in use
    //field("RecordType", "XXXXXXXXXXXXXXXX"),
    // or
    //relationship("RecordType", "name", dataValue("recort_type_name")),
    field('Record_Type_Name__c', dataValue('record_type_id')),
    field('ODK_Form_Name__c', dataValue('formId')),
    field('Site_School_ID_Number__c', dataValue('site')),
    field('BT_Staff_ID__c', dataValue('recorded_by')),
    field('Date__c', dataValue('today')),
    field('Head_of_Household__c', dataValue('head_of_household')),
    field(
    'Head_of_Household_Gender__c',
    dataValue('head_of_household_gender')
    ),
    field('Head_of_Household_age__c', dataValue('head_of_household_age')),
    field('Light_Source__c', dataValue('light_source')),
    field('communication__c', dataValue('communication')),
    field('transport__c', dataValue('transport')),
    field(
    'number_of_children_in_household__c',
    dataValue('number_of_children')
    ),
    field('school_visits__c', dataValue('school_visits')),
    field('school_visit_reason__c', dataValue('school_visit_reason')),
    field('Village__c', dataValue('village')),
    field('ODK_Key__c', dataValue('*meta-instance-id*'))
    )
    )
    ),
    each(
    merge(
    dataPath('individual_na[*]'),
    fields(
    field('metaId', dataValue('*meta-instance-id*')),
    field('parentId', lastReferenceValue('id')),
    field('village', dataValue('$data.village'))
    )
    ),
    create(
    'ODK_Submission__c',
    fields(
    //bridgetest sandbox record type, comment out when not in use
    field('RecordTypeId', '012J00000005hla'),
    //prduction record type, comment out when not in use
    //field("RecordType", "XXXXXXXXXXXXXXXX"),
    // or
    //relationship("RecordType", "name", dataValue("recort_type_name")),
    field('Related_ODK_Submission__c', dataValue('parentId')),
    field('family_name__c', dataValue('given_name')),
    field('school_coded__c', dataValue('school_coded')),
    field('school_type__c', dataValue('school_type')),
    field('gender__c', dataValue('gender')),
    field('Pays_School_Fees__c', dataValue('school_fees_yes_no')),
    field('in_primary_school__c', dataValue('in_primary_school')),
    field('School_Fee_Amount__c', dataValue('school_fees')),
    field('Age__c', dataValue('age')),
    field('surname__c', dataValue('surname')),
    field('out_of_school_reason__c', dataValue('out_of_school_reason')),
    field('class_level__c', dataValue('class_level')),
    field(
    'other_out_of_school_reason__c',
    dataValue('other_out_of_school_reason')
    ),
    field('Village__c', dataValue('village')),
    // This is a concatenation, adding the unique child ID.
    field('ODK_Key__c', function (state) {
    return dataValue('metaId')(state).concat('(', index()(state), ')');
    })
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29.html b/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29.html index f04d7bf3332..b8fd1121a7d 100644 --- a/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29.html +++ b/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    commcare reports api

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: commcare reports api
    • Adaptor: @openfn/language-http
    • Adaptor Version: v0.0.9
    • Created about 8 years ago
    • Updated about 8 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    get, post, Promise

    Expression

    get("api/v0.5/configurablereportdata/daily_form_stats", {
    query: function(state) {
    return { date: state.lastSubmissionDate || "Aug 29, 2016 4:44:26 PM" }
    },
    callback: function(state) {
    // Pick submissions out in order to avoid `post` overwriting `response`.
    var submissions = state.response.body;
    // Use .slice to limit how much you send to the server for testing
    // return submissions
    return submissions.reduce(function(acc, item) {
    return acc.then(
    post(
    "http://localhost:4000/inbox/8ad63a29-5c25-4d8d-ba2c-fe6274dcfbab",
    { body: item }
    )
    )
    }, Promise.resolve(state))
    .then(function(state) {
    console.log(submissions.length)
    if (submissions.length) {
    state.lastSubmissionDate = submissions[submissions.length-1].SubmissionDate
    }
    return state;
    })
    .then(function(state) {
    delete state.response
    return state;
    })
    }
    })
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/complex-http-request-chains.html b/adaptors/library/jobs/auto/complex-http-request-chains.html index 8c682ceef2a..7d9aa28e229 100644 --- a/adaptors/library/jobs/auto/complex-http-request-chains.html +++ b/adaptors/library/jobs/auto/complex-http-request-chains.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Chaining HTTP Requests

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataPath, each, get, post, put

    Expression

    each(
    dataPath('someArray[*]'),
    post(
    'https://en7a5l7u3izq6.x.pipedream.net/',
    {
    body: state => {
    return { name: state.data.surname, age: state.data.age };
    },
    },
    state => {
    console.log('in the callback');
    console.log(state.data);
    get(
    'https://en7a5l7u3izq6.x.pipedream.net/',
    {},
    // Note how we don't use: `put(args)(state)` because state is already
    // provided by the parent operation, get(), to its callback...
    put('https://en7a5l7u3izq6.x.pipedream.net/')
    // ...but since we've called get() INSIDE an anonymous function, we'll
    // need to pass state to it manually: get(args)(state)...
    )(state);
    return state;
    }
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/complex-state-control.html b/adaptors/library/jobs/auto/complex-state-control.html index 04e844c5cd8..1cdeda20404 100644 --- a/adaptors/library/jobs/auto/complex-state-control.html +++ b/adaptors/library/jobs/auto/complex-state-control.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Using promises

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    query

    Expression

    // Example with language-salesforce
    fn(state => {
    // return state => {
    return new Promise((resolve, reject) => {
    query('SELECT Name FROM Account')(state)
    .then(state => {
    console.log(state.references[0].records);
    console.log('doing stuff here');
    return state;
    })
    .then(state => {
    console.log('and in here');
    resolve(state);
    });
    });
    // };
    });

    fn(state => {
    console.log('and also in here!');
    console.log(state.references);
    return state;
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html b/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html index 92db2229be6..534678fd49f 100644 --- a/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html +++ b/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Concat fields with nulls

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    arrayToString, create, dataValue, each, field, fields, relationship

    Expression

    each(
    '$.data.data[*]',
    create(
    'Verification__c',
    fields(
    field('RecordTypeId', '01236000000Q6PT'),
    relationship(
    'Supplier__r',
    'Unique_Entity_ID__c',
    dataValue('Unique_Entity_ID')
    ),
    field('Currency_ISO_Code__c', dataValue('Currency_ISO_Code')),
    field('Date_Conducted__c', dataValue('Date_Conducted')),
    field('ODK_Key__c', dataValue('*meta-instance-id*')),
    field('Unique_Entity_ID__c', dataValue('Unique_Entity_ID')),
    field('Interviewee__c', dataValue('Interviewee')),
    field('Interviewee_Role__c', dataValue('Interviewee_Role')),
    field(
    'Interviewee_Primary_Phone__c',
    dataValue('Interviewee_Primary_Phone')
    ),
    field('Interviewee_Phone_2__c', dataValue('Interviewee_Phone_2')),
    field('Interviewee_Phone_3__c', dataValue('Interviewee_Phone_3')),
    field(
    'Interviewee_Primary_Email__c',
    dataValue('Interviewee_Primary_Email')
    ),
    field('Trade_Name__c', dataValue('Trade_Name')),
    field('Registered_Name__c', dataValue('Registered_Name')),
    field('Location_Description__c', dataValue('Location_Description')),
    field('Main_Office_Country__c', dataValue('Main_Office_Country')),
    field('Main_Office_Region_Province_or_County__c', function (state) {
    return arrayToString(
    [
    dataValue('Main_Office_Region_Province_or_County_a')(state),
    dataValue('Main_Office_Region_Province_or_County_b')(state),
    dataValue('Main_Office_Region_Province_or_County_c')(state),
    dataValue('Main_Office_Region_Province_or_County_d')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field('Main_Office_City__c', function (state) {
    return arrayToString(
    [
    dataValue('Main_Office_City_a')(state),
    dataValue('Main_Office_City_b')(state),
    dataValue('Main_Office_City_c')(state),
    dataValue('Main_Office_City_d')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field(
    'Main_Office_Street_Address__c',
    dataValue('Main_Office_Street_Address')
    ),
    field('Geolocation__Latitude__s', dataValue('gps:Latitude')),
    field('Geolocation__Longitude__s', dataValue('gps:Longitude')),
    field('Main_Contact_First__c', dataValue('Main_Contact_First')),
    field('Main_Contact_Last__c', dataValue('Main_Contact_Last')),
    field('Main_Contact_Role__c', dataValue('Main_Contact_Role')),
    field('Main_Contact_Role_Other__c', dataValue('Main_Contact_Role_Other')),
    field(
    'Main_Contact_Phone_Mobile__c',
    dataValue('Main_Contact_Phone_Mobile')
    ),
    field('Main_Contact_Phone_Work__c', dataValue('Main_Contact_Phone_Work')),
    field(
    'Main_Contact_Phone_Other__c',
    dataValue('Main_Contact_Phone_Other')
    ),
    field('Main_Contact_Email_Work__c', dataValue('Main_Contact_Email_Work')),
    field('General_Phone__c', dataValue('General_Phone')),
    field('General_Email__c', dataValue('General_Email')),
    field('Website__c', dataValue('Website')),
    field('Interest_in_Website__c', dataValue('Interest_in_Website')),
    field(
    'Hours_of_Operation_Start__c',
    dataValue('Hours_of_Operation_Start')
    ),
    field('Hours_of_Operation_End__c', dataValue('Hours_of_Operation_End')),
    field(
    'Hours_of_Operation_Other__c',
    dataValue('Hours_of_Operation_Other')
    ),
    field(
    'Hours_of_Operation_Other_Start__c',
    dataValue('Hours_of_Operation_Other_Start')
    ),
    field(
    'Hours_of_Operation_Other_End__c',
    dataValue('Hours_of_Operation_Other_End')
    ),
    field(
    'Goods_and_Services_Description__c',
    dataValue('Goods_and_Services_Description')
    ),
    field('Primary_Sector__c', dataValue('Primary_Sector')),
    field('Primary_Subsectors__c', function (state) {
    return arrayToString(
    [
    dataValue('Primary_Subsectors_1')(state),
    dataValue('Primary_Subsectors_2')(state),
    dataValue('Primary_Subsectors_3')(state),
    dataValue('Primary_Subsectors_4')(state),
    dataValue('Primary_Subsectors_5')(state),
    dataValue('Primary_Subsectors_6')(state),
    dataValue('Primary_Subsectors_7')(state),
    dataValue('Primary_Subsectors_8')(state),
    dataValue('Primary_Subsectors_9')(state),
    dataValue('Primary_Subsectors_10')(state),
    dataValue('Primary_Subsectors_l1')(state),
    dataValue('Primary_Subsectors_12')(state),
    dataValue('Primary_Subsectors_13')(state),
    dataValue('Primary_Subsectors_14')(state),
    dataValue('Primary_Subsectors_15')(state),
    dataValue('Primary_Subsectors_16')(state),
    dataValue('Primary_Subsectors_17')(state),
    dataValue('Primary_Subsectors_18')(state),
    dataValue('Primary_Subsectors_19')(state),
    dataValue('Primary_Subsectors_20')(state),
    dataValue('Primary_Subsectors_21')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field('Other_Sectors__c', function (state) {
    return arrayToString(dataValue('Other_Sectors')(state), ',');
    }),
    field('Other_Subsectors__c', function (state) {
    return arrayToString(
    [
    dataValue('Other_Subsectors_1')(state),
    dataValue('Other_Subsectors_2')(state),
    dataValue('Other_Subsectors_3')(state),
    dataValue('Other_Subsectors_4')(state),
    dataValue('Other_Subsectors_5')(state),
    dataValue('Other_Subsectors_6')(state),
    dataValue('Other_Subsectors_7')(state),
    dataValue('Other_Subsectors_8')(state),
    dataValue('Other_Subsectors_9')(state),
    dataValue('Other_Subsectors_10')(state),
    dataValue('Other_Subsectors_l1')(state),
    dataValue('Other_Subsectors_12')(state),
    dataValue('Other_Subsectors_13')(state),
    dataValue('Other_Subsectors_14')(state),
    dataValue('Other_Subsectors_15')(state),
    dataValue('Other_Subsectors_16')(state),
    dataValue('Other_Subsectors_17')(state),
    dataValue('Other_Subsectors_18')(state),
    dataValue('Other_Subsectors_19')(state),
    dataValue('Other_Subsectors_20')(state),
    dataValue('Other_Subsectors_21')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field(
    'Entity_and_Registration_1__c',
    dataValue('Entity_and_Registration_1')
    ),
    field(
    'Entity_and_Registration_2__c',
    dataValue('Entity_and_Registration_2')
    ),
    field(
    'Entity_and_Registration_3__c',
    dataValue('Entity_and_Registration_3')
    ),
    field('Registration_Date__c', dataValue('Registration_Date')),
    field('Registration_Active__c', dataValue('Registration_Active')),
    field(
    'Business_Operation_Licenses__c',
    dataValue('Business_Operation_Licenses')
    ),
    field(
    'Business_Operation_Certificates__c',
    dataValue('Business_Operation_Certificates')
    ),
    field('Association_Memberships__c', dataValue('Association_Memberships')),
    field('Vendor_List_Memberships__c', dataValue('Vendor_List_Memberships')),
    field('Has_Marketing_Plan__c', dataValue('Has_Marketing_Plan')),
    field('Number_of_Competitors__c', dataValue('Number_of_Competitors')),
    field('Start_of_Operations__c', dataValue('Start_of_Operations')),
    field('Primary_Language__c', dataValue('Primary_Language')),
    field('Primary_Language_Other__c', dataValue('Primary_Language_Other')),
    field('English_Speakers__c', dataValue('English_Speakers')),
    field('Other_Languages__c', dataValue('Other_Languages')),
    field(
    'Frequency_of_Internet_Access__c',
    dataValue('Frequency_of_Internet_Access')
    ),
    field(
    'Method_of_Internet_Access__c',
    dataValue('Method_of_Internet_Access')
    ),
    field(
    'Method_of_Internet_Access_Other__c',
    dataValue('Method_of_Internet_Access_Other')
    ),
    field('Frequency_of_Email_Use__c', dataValue('Frequency_of_Email_Use')),
    field('Type_of_Email_Use__c', dataValue('Type_of_Email_Use')),
    field('Counties_Regions_Serviced__c', function (state) {
    return arrayToString(
    [
    dataValue('Counties_Regions_Serviced_a')(state),
    dataValue('Counties_Regions_Serviced_b')(state),
    dataValue('Counties_Regions_Serviced_c')(state),
    dataValue('Counties_Regions_Serviced_d')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field('Additional_Branches__c', dataValue('Additional_Branches')),
    field('Branch_Locations__c', function (state) {
    return arrayToString(
    [
    dataValue('Branch_Locations_a')(state),
    dataValue('Branch_Locations_b')(state),
    dataValue('Branch_Locations_c')(state),
    dataValue('Branch_Locations_d')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field(
    'Majority_Local_or_Foreign__c',
    dataValue('Majority_Local_or_Foreign')
    ),
    field('Num_of_Owners__c', dataValue('Num_of_Owners')),
    field('Num_of_Female_Owners__c', dataValue('Num_of_Female_Owners')),
    field('Num_of_Male_Owners__c', dataValue('Num_of_Male_Owners')),
    field(
    'Primary_Owner_is_Same_as_Main_Contact__c',
    dataValue('Primary_Owner_is_Same_as_Main_Contact')
    ),
    field('Primary_Owner__c', dataValue('Primary_Owner')),
    field('Primary_Owner_Gender__c', dataValue('Primary_Owner_Gender')),
    field(
    'Primary_Owner_Gender_Other__c',
    dataValue('Primary_Owner_Gender_Other')
    ),
    field(
    'Primary_Owner_Nationality__c',
    dataValue('Primary_Owner_Nationality')
    ),
    field(
    'Primary_Owner_Phone_Mobile__c',
    dataValue('Primary_Owner_Phone_Mobile')
    ),
    field(
    'Primary_Owner_Phone_Work__c',
    dataValue('Primary_Owner_Phone_Work')
    ),
    field(
    'Primary_Owner_Phone_Other__c',
    dataValue('Primary_Owner_Phone_Other')
    ),
    field('Primary_Owner_Email__c', dataValue('Primary_Owner_Email')),
    field('Num_of_Businesses_Owned__c', dataValue('Num_of_Businesses_Owned')),
    field(
    'Names_of_Businesses_Owned__c',
    dataValue('Names_of_Businesses_Owned')
    ),
    field('Num_of_Managers__c', dataValue('Num_of_Managers')),
    field('Num_of_Female_Managers__c', dataValue('Num_of_Female_Managers')),
    field('Num_of_Male_Managers__c', dataValue('Num_of_Male_Managers')),
    field('Finance_Management__c', dataValue('Finance_Management')),
    field(
    'Finance_Management_Other__c',
    dataValue('Finance_Management_Other')
    ),
    field('Dedicated_HR_Manager__c', dataValue('Dedicated_HR_Manager')),
    field(
    'Num_of_Permanent_Full_Time_Employees__c',
    dataValue('Num_of_Permanent_Full_Time_Employees')
    ),
    field(
    'Num_of_Perm_Full_Time_Female_Employees__c',
    dataValue('Num_of_Perm_Full_Time_Female_Employees')
    ),
    field(
    'Num_of_Perm_Full_Time_Male_Employees__c',
    dataValue('Num_of_Perm_Full_Time_Male_Employees')
    ),
    field(
    'Num_of_Full_Time_Temporary_Employees__c',
    dataValue('Num_of_Full_Time_Temporary_Employees')
    ),
    field(
    'Num_of_Full_Time_Temp_Female_Employees__c',
    dataValue('Num_of_Full_Time_Temp_Female_Employees')
    ),
    field(
    'Num_of_Full_Time_Temp_Male_Employees__c',
    dataValue('Num_of_Full_Time_Temp_Male_Employees')
    ),
    field(
    'Num_of_Local_Staff_Full_Part_Time__c',
    dataValue('Num_of_Local_Staff_Full_Part_Time')
    ),
    field(
    'Num_of_Expatriate_Staff_Full_Part_Time__c',
    dataValue('Num_of_Expatriate_Staff_Full_Part_Time')
    ),
    field(
    'International_Client_in_Past_Six_Months__c',
    dataValue('International_Client_in_Past_Six_Months')
    ),
    field('Principal_Client_Name__c', dataValue('Principal_Client_Name')),
    field(
    'Foreign_or_Domestic_Principal_Client__c',
    dataValue('Foreign_or_Domestic_Principal_Client')
    ),
    field('Principal_Client_Sector__c', dataValue('Principal_Client_Sector')),
    field(
    'Goods_Services_Provided_to_this_Client__c',
    dataValue('Goods_Services_Provided_to_this_Client')
    ),
    field(
    'End_of_Last_Contract_with_this_Client__c',
    dataValue('End_of_Last_Contract_with_this_Client')
    ),
    field(
    'Value_Goods_Services_Sold_Last_6_Months__c',
    dataValue('Value_Goods_Services_Sold_Last_6_Months')
    ),
    field(
    'Value_Goods_Sold_Last_6_Months_USD__c',
    dataValue('Value_Goods_Sold_Last_6_Months_USD')
    ),
    field(
    'Access_to_Finance_Constraint_Ranking__c',
    dataValue('Access_to_Finance_Constraint_Ranking')
    ),
    field('Bank_Account__c', dataValue('Bank_Account')),
    field('Bank_Guarantee__c', dataValue('Bank_Guarantee')),
    field(
    'Satisfied_with_Current_Bank__c',
    dataValue('Satisfied_with_Current_Bank')
    ),
    field(
    'Describe_Satisfaction_with_Current_Bank__c',
    dataValue('Describe_Satisfaction_with_Current_Bank')
    ),
    field(
    'Has_Received_a_Formal_Loan__c',
    dataValue('Has_Received_a_Formal_Loan')
    ),
    field('Formal_Loan_Provider__c', dataValue('Formal_Loan_Provider')),
    field(
    'Formal_Loan_Amount_Received__c',
    dataValue('Formal_Loan_Amount_Received')
    ),
    field(
    'Formal_Loan_Amount_Received_USD__c',
    dataValue('Formal_Loan_Amount_Received_USD')
    ),
    field(
    'Date_Formal_Loan_Received__c',
    dataValue('Date_Formal_Loan_Received')
    ),
    field('Formal_Loan_Purpose__c', dataValue('Formal_Loan_Purpose')),
    field(
    'Formal_Loan_Purpose_Other__c',
    dataValue('Formal_Loan_Purpose_Other')
    ),
    field('Formal_Loan_Repaid__c', dataValue('Formal_Loan_Repaid')),
    field('Interested_in_Loan__c', dataValue('Interested_in_Loan')),
    field('Interested_Loan_Amount__c', dataValue('Interested_Loan_Amount')),
    field(
    'Interested_Loan_Amount_USD__c',
    dataValue('Interested_Loan_Amount_USD')
    ),
    field(
    'Interested_Loan_Duration__c',
    dataValue('Interested_Loan_Duration')
    ),
    field('Interested_Loan_Purpose__c', dataValue('Interested_Loan_Purpose')),
    field(
    'Interested_Loan_Purpose_Other__c',
    dataValue('Interested_Loan_Purpose_Other')
    ),
    field(
    'Formal_Loan_Confidence_Ranking__c',
    dataValue('Formal_Loan_Confidence_Ranking')
    ),
    field(
    'Received_Loan_from_Family_Friends__c',
    dataValue('Received_Loan_from_Family_Friends')
    ),
    field(
    'Family_Friend_Loan_Amount__c',
    dataValue('Family_Friend_Loan_Amount')
    ),
    field(
    'Family_Friend_Loan_Amount_USD__c',
    dataValue('Family_Friend_Loan_Amount_USD')
    ),
    field(
    'Received_Loan_from_Informal_Lenders__c',
    dataValue('Received_Loan_from_Informal_Lenders')
    ),
    field(
    'Informal_Lender_Loan_Amount__c',
    dataValue('Informal_Lender_Loan_Amount')
    ),
    field(
    'Informal_Lender_Loan_Amount_USD__c',
    dataValue('Informal_Lender_Loan_Amount_USD')
    ),
    field(
    'Interested_in_Investor_Business_Partner__c',
    dataValue('Interested_in_Investor_Business_Partner')
    ),
    field(
    'Total_Turnover_Previous_Month__c',
    dataValue('Total_Turnover_Previous_Month')
    ),
    field(
    'Total_Turnover_Previous_Month_USD__c',
    dataValue('Total_Turnover_Previous_Month_USD')
    ),
    field(
    'Total_Turnover_Previous_Fiscal_Year__c',
    dataValue('Total_Turnover_Previous_Fiscal_Year')
    ),
    field(
    'Total_Turnover_Previous_Fiscal_Yr_USD__c',
    dataValue('Total_Turnover_Previous_Fiscal_Yr_USD')
    ),
    field(
    'Total_Profit_Previous_Fiscal_Year__c',
    dataValue('Total_Profit_Previous_Fiscal_Year')
    ),
    field(
    'Total_Profit_Previous_Fiscal_Year_USD__c',
    dataValue('Total_Profit_Previous_Fiscal_Year_USD')
    ),
    field(
    'Accepted_Modes_of_Payment__c',
    dataValue('Accepted_Modes_of_Payment')
    ),
    field(
    'Accepted_Modes_of_Payment_Other__c',
    dataValue('Accepted_Modes_of_Payment_Other')
    ),
    field(
    'Avg_Expen_Spent_on_Imported_Goods_Year__c',
    dataValue('Avg_Expen_Spent_on_Imported_Goods_Year')
    ),
    field(
    'Avg_Expen_Spent_on_Domestic_Goods_Year__c',
    dataValue('Avg_Expen_Spent_on_Domestic_Goods_Year')
    ),
    field(
    'Avg_Expen_on_Domestic_Suppliers_Year__c',
    dataValue('Avg_Expen_on_Domestic_Suppliers_Year')
    ),
    field(
    'Avg_Expen_on_Intl_Suppliers_Year__c',
    dataValue('Avg_Expen_on_Intl_Suppliers_Year')
    ),
    field(
    'Avg_Expen_Spent_on_Salaries_Year__c',
    dataValue('Avg_Expen_Spent_on_Salaries_Year')
    ),
    field(
    'Balance_Sheet_Statement_Available__c',
    dataValue('Balance_Sheet_Statement_Available')
    ),
    field('Profit_Loss_Statement__c', dataValue('Profit_Loss_Statement')),
    field('Directly_Imports_Goods__c', dataValue('Directly_Imports_Goods')),
    field(
    'Avg_of_Total_Costs_from_Imports__c',
    dataValue('Avg_of_Total_Costs_from_Imports')
    ),
    field('Highest_Costing_Import__c', dataValue('Highest_Costing_Import')),
    field(
    'Origin_Country_of_Highest_Costing_Import__c',
    dataValue('Origin_Country_of_Highest_Costing_Import')
    ),
    field('Other_Import_Countries__c', dataValue('Other_Import_Countries')),
    field('Exports_Products__c', dataValue('Exports_Products')),
    field(
    'Avg_of_Total_Revenue_from_Exports__c',
    dataValue('Avg_of_Total_Revenue_from_Exports')
    ),
    field('Primary_Export__c', dataValue('Primary_Export')),
    field('Destination_of_Exports__c', dataValue('Destination_of_Exports')),
    field(
    'Profits_Expectation_Next_Six_Months__c',
    dataValue('Profits_Expectation_Next_Six_Months')
    ),
    field(
    'Staff_Expectation_Next_Six_Months__c',
    dataValue('Staff_Expectation_Next_Six_Months')
    ),
    field(
    'Int_l_Entities_Represent_Good_Opp__c',
    dataValue('Int_l_Entities_Represent_Good_Opp')
    ),
    field(
    'Int_l_Concessionaires_Represent_Good_Opp__c',
    dataValue('Int_l_Concessionaires_Represent_Good_Opp')
    ),
    field(
    'Sectors_Representing_Best_Local_Opps__c',
    dataValue('Sectors_Presenting_Best_Local_Opps')
    ),
    field(
    'Obstacle_Working_with_Intl_Entities__c',
    dataValue('Obstacle_Working_with_Intl_Entities')
    ),
    field(
    'Biggest_Challenge_Next_6_Months__c',
    dataValue('Biggest_Challenge_Next_6_Months')
    ),
    field(
    'Second_Biggest_Challenge_Next_6_Months__c',
    dataValue('Second_Biggest_Challenge_Next_6_Months')
    ),
    field(
    'Financial_Management_Ranking__c',
    dataValue('Financial_Management_Ranking')
    ),
    field(
    'Access_to_Finance_Ranking__c',
    dataValue('Access_to_Finance_Ranking')
    ),
    field('Administration_Ranking__c', dataValue('Administration_Ranking')),
    field('Human_Resources_Ranking__c', dataValue('Human_Resources_Ranking')),
    field(
    'Technical_Expertise_Ranking__c',
    dataValue('Technical_Expertise_Ranking')
    ),
    field(
    'Training_Helps_Efficiency__c',
    dataValue('Training_Helps_Efficiency')
    ),
    field(
    'Capacity_Building_Activities_Offered__c',
    dataValue('Capacity_Building_Activities_Offered')
    ),
    field(
    'Capacity_Building_Offered_Other__c',
    dataValue('Capacity_Building_Offered_Other')
    ),
    field(
    'Can_Provide_Quotations_WP_on_Request__c',
    dataValue('Can_Provide_Quotations_WP_on_Request')
    ),
    field('Knows_What_a_Tender_is__c', dataValue('Knows_What_a_Tender_is')),
    field(
    'Frequency_Checking_for_Tenders__c',
    dataValue('Frequency_Checking_for_Tenders')
    ),
    field(
    'Has_Submitted_a_Tender_Bid__c',
    dataValue('Has_Submitted_a_Tender_Bid')
    ),
    field(
    'Has_Won_Tenders_in_Past_Six_Months__c',
    dataValue('Has_Won_Tenders_in_Past_Six_Months')
    ),
    field(
    'Details_of_Recently_Won_Tenders__c',
    dataValue('Details_of_Recently_Won_Tenders')
    ),
    field(
    'Num_of_Gov_t_Bids_in_Last_Six_Months__c',
    dataValue('Num_of_Govt_Bids_in_Last_Six_Months')
    ),
    field(
    'Num_of_Private_Bids_in_Last_Six_Months__c',
    dataValue('Num_of_Private_Bids_in_Last_Six_Months')
    ),
    field(
    'Num_of_NGO_INGO_IO_Bids_Last_Six_Months__c',
    dataValue('Num_of_NGO_INGO_IO_Bids_Last_Six_Months')
    ),
    field(
    'Main_Reason_for_Lost_Bids__c',
    dataValue('Main_Reason_for_Lost_Bids')
    ),
    field(
    'Main_Reason_for_Lost_Bids_Other__c',
    dataValue('Main_Reason_for_Lost_Bids_Other__c')
    ),
    field(
    'Main_Reason_for_Not_Bidding_on_Tenders__c',
    dataValue('Main_Reason_for_Not_Bidding_on_Tenders')
    ),
    field(
    'Main_Reason_Not_Bidding_Tenders_Others__c',
    dataValue('Main_Reason_Not_Bidding_Tenders_Others__c')
    ),
    field(
    'Planning_to_Bid_on_Future_Tenders__c',
    dataValue('Planning_to_Bid_on_Tenders_in_the_Future')
    ),
    field(
    'Services_That_Would_Help_to_Win_Tenders__c',
    dataValue('Services_That_Would_Help_to_Win_Tenders')
    ),
    field(
    'Interested_in_Future_BM_Communications__c',
    dataValue('Interested_in_Future_BM_Communications')
    ),
    field(
    'Future_BM_Communications__c',
    dataValue('Future_BM_Communications')
    ),
    field(
    'Interested_in_Attending_Future_Training__c',
    dataValue('Interested_in_Attending_Future_Training')
    ),
    field(
    'Training_Most_Interested_in_Attending__c',
    dataValue('Training_Most_Interested_in_Attending')
    ),
    field(
    'Training_Most_Interested_in_Other__c',
    dataValue('Training_Most_Interested_in_Other')
    ),
    field(
    'Amount_Willing_to_Pay_for_Training__c',
    dataValue('Amount_Willing_to_Pay_for_Training')
    ),
    field(
    'Amount_Willing_to_Pay_for_Training__c',
    dataValue('Amount_Willing_to_Pay_for_Training')
    ),
    field(
    'Training_Interested_In_but_Not_Offered__c',
    dataValue('Training_Interested_In_but_Not_Offered')
    ),
    field(
    'Advice_to_Entrepreneurs_in_your_Country__c',
    dataValue('Advice_to_Entrepreneurs_in_your_Country')
    ),
    field('Interviewer_Comments__c', dataValue('Interviewer_Comments'))
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/create-if-proposal.html b/adaptors/library/jobs/auto/create-if-proposal.html index f592c1adea9..98ed968e236 100644 --- a/adaptors/library/jobs/auto/create-if-proposal.html +++ b/adaptors/library/jobs/auto/create-if-proposal.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Create/update records if...

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    createIf, dataValue, field, fields, relationship, upsertIf

    Expression

    // Using upsertIf and createIf we can conditionally create or update records if
    // some condition in the source data is met.

    upsertIf(
    // a path which resolves to true/false
    dataValue('form.legal.allowedToSync'),
    'Patient__c',
    'Patient_ID__c',
    fields(
    field('Name__c', dataValue('form.name')),
    field('Patient_ID__c', dataValue('form.identification.govId'))
    )
    );

    createIf(
    // or a function which returns true/false
    state => state.data.form.completedVisit === 'yes',
    'Visit__c',
    fields(
    field('Date__c', dataValue('form.visit.visit_date')),
    field('Type__c', 'checkup'),
    relationship(
    'Patient__r',
    'Patient_ID__c',
    dataValue('form.identification.govId')
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/getKoboData.html b/adaptors/library/jobs/auto/getKoboData.html index 699925664c8..df67a0c4f82 100644 --- a/adaptors/library/jobs/auto/getKoboData.html +++ b/adaptors/library/jobs/auto/getKoboData.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Extract Kobo data from API to send to OpenFn Inbox

    📜 This job is an official example from OpenFn.

    Metadata

    • Name: Extract Kobo data from API to send to OpenFn Inbox
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created date unknown
    • Updated date unknown
    • Score: 100 (an indicator of how useful this job may be)

    Key Functions

    dataPath, each, get, map, post

    Expression

    //Sample job to get Kobo data and post back to OpenFn Inbox
    fn(state => {
    console.log(`Started at: ${new Date().toISOString()}`);
    state.submissions = [];
    state.data = {
    surveys: [
    // =========================================================================
    //== TODO: Specify new forms to fetch here, including the Kobo form id, tag, name, and owner ==//
    { id: 'aijj9FSpuCzMTRnMPGike8', tag: 'nrgt_historical', name: 'NRGT Makira 2017 - Test OpenFn', owner: 'bns' }, // example
    //consider listing multiple forms
    // =========================================================================

    ].map(survey => ({
    formId: survey.id,
    tag: survey.tag,
    name: survey.name,
    owner: survey.owner,
    url: `https://kf.kobotoolbox.org/api/v2/assets/${survey.id}/data/?format=json`,
    })),
    };
    console.log(`Fetching data for ${state.data.surveys.length} surveys.`);
    return state;
    });

    each(dataPath('surveys[*]'), state => {
    const { url, tag, formId, name, owner } = state.data;
    return get(url, {}, state => {
    state.data.submissions = state.data.results.map((submission, i) => {
    return {
    i,
    // Here we append the tags defined above to the Kobo form submission data
    form: tag,
    formName: name,
    formOwner: owner,
    body: submission,
    };
    });
    const count = state.data.submissions.length;
    console.log(`Fetched ${count} submissions from ${formId} (${tag}).`);
    //Once we fetch the data, we want to post each individual Kobo survey
    //back to the OpenFn inbox to run through the jobs
    return each(dataPath('submissions[*]'), state => {
    console.log(`Posting ${state.data.i + 1} of ${count}...`);
    // =========================================================================
    //== TODO: replace openfnInboxUrl with your OpenFn Project Inbox URL ====//
    return post(openfnInboxUrl, { body: state => state.data })(state);
    })(state);
    // =========================================================================
    })(state);
    });

    fn(state => {
    console.log(`Finished at: ${new Date().toISOString()}`);
    return {
    data: {
    message: "No cursor required. Job fetches all submission for given forms."
    },
    references: []
    };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/nawiri-2023-05-03.html b/adaptors/library/jobs/auto/nawiri-2023-05-03.html index 1f1a87e25fc..915e4de28dd 100644 --- a/adaptors/library/jobs/auto/nawiri-2023-05-03.html +++ b/adaptors/library/jobs/auto/nawiri-2023-05-03.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/no-return-2023-01-06.html b/adaptors/library/jobs/auto/no-return-2023-01-06.html index 1324c8403de..4e98ce78c50 100644 --- a/adaptors/library/jobs/auto/no-return-2023-01-06.html +++ b/adaptors/library/jobs/auto/no-return-2023-01-06.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    no return

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    Expression

    fn(state => {
    console.log("no return");
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/promise-all-nested-requests.html b/adaptors/library/jobs/auto/promise-all-nested-requests.html index 890544f6d12..d780aeab538 100644 --- a/adaptors/library/jobs/auto/promise-all-nested-requests.html +++ b/adaptors/library/jobs/auto/promise-all-nested-requests.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Promises and nested requests

    📜 This job is an official example from OpenFn.

    Metadata

    • Name: Promises and nested requests
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created date unknown
    • Updated date unknown
    • Score: 100 (an indicator of how useful this job may be)

    Key Functions

    each, get, Promise

    Expression

    each(
    '$.enrolledUsers[10]',
    fn(state => {
    const { host } = state.configuration;
    const { id } = state.data;
    const usersfields = [];
    return get(
    host,
    {
    query: {
    wstoken: state.token,
    wsfunction: 'core_user_get_users_by_field',
    field: 'id',
    'values[]': id,
    moodlewsrestformat: 'json',
    },
    },
    state => {
    const { id, phone1, address } = state.data[0];
    const fields = [
    { id, 'Teléfono móvil': phone1, Dirección: address, grades: [] },
    ];
    console.log(state.courseIds);
    let promises = [];
    state.courseIds.forEach(courseid => {
    promises.push(
    get(
    host,
    {
    query: {
    wstoken: state.token,
    wsfunction: 'gradereport_user_get_grade_items',
    userid: id,
    courseid,
    moodlewsrestformat: 'json',
    },
    },
    state => {
    console.log('fetched');
    const { graderaw } = state.data.usergrades[0].gradeitems[0];
    const grades = [{ courseid, graderaw }];
    fields[0].grades.push(...grades);
    }
    )(state)
    );
    });

    return Promise.all(promises).then(() => {
    usersfields.push(...fields);
    return {
    ...state,
    usersfields,
    enrolledUsers: [],
    response: [],
    };
    });
    }
    )(state);
    })
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/send-mail-in-mailgun.html b/adaptors/library/jobs/auto/send-mail-in-mailgun.html index 5b4f152f974..20537dd392c 100644 --- a/adaptors/library/jobs/auto/send-mail-in-mailgun.html +++ b/adaptors/library/jobs/auto/send-mail-in-mailgun.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    send email

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataValue, field, fields, send

    Expression

    send(
    fields(
    field('from', 'you@domain.com'),
    field('to', dataValue('form.submission.respondantEmail')),
    field('subject', 'Thanks for completing our survey.'),
    field('text', 'Your message goes here.')
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html b/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html index b299a6e7ab4..0a0040f7b81 100644 --- a/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html +++ b/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Send sms from Salesforce workflow action

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataValue, field, fields, send

    Expression

    send(
    fields(
    field(
    'to_number',
    dataValue(
    'Envelope.Body.notifications.Notification.sObject.phone_number__c'
    )
    ),
    field('message_type', 'sms'),
    field('route_id', ''),
    field('content', function (state) {
    return 'Hey there. Your name is '.concat(
    dataValue('Envelope.Body.notifications.Notification.sObject.name__c')(
    state
    ),
    '.'
    );
    })
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/synchronous-http-request.html b/adaptors/library/jobs/auto/synchronous-http-request.html index 94b3e233213..3978f1a9670 100644 --- a/adaptors/library/jobs/auto/synchronous-http-request.html +++ b/adaptors/library/jobs/auto/synchronous-http-request.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Chaining synchronous http requests

    📜 This job is an official example from OpenFn.

    Metadata

    • Name: Chaining synchronous http requests
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created date unknown
    • Updated date unknown
    • Score: 100 (an indicator of how useful this job may be)

    Key Functions

    post, async, await

    Expression

    fn(async state => {
    const { Patient, Visit } = state.data;

    console.log('Here we break large arrays into smaller chunks.');
    const chunk = (arr, chunkSize) => {
    var R = [];
    for (var i = 0, len = arr.length; i < len; i += chunkSize) R.push(arr.slice(i, i + chunkSize));
    return R;
    };

    const patientSets = chunk(Patient, 10);
    const visitSets = chunk(Visit, 10);

    console.log('Patient sets:', patientSets.length);
    console.log('Visit sets:', visitSets.length);

    const visitChunks = [];
    const patientChunks = [];

    patientSets.forEach(sets => {
    const data = {
    Visit: [],
    Patient: sets,
    };
    patientChunks.push(data);
    });

    visitSets.forEach(sets => {
    const data = {
    Visit: sets,
    Patient: [],
    };
    visitChunks.push(data);
    });

    let countInbox = 0;
    console.log('Then we define our async function that make multiple posts requests,');
    console.log('each after a fix period of time.');
    const postToInbox = async data => {
    countInbox++;
    console.log(`${countInbox} request to inbox`);

    await new Promise(resolve => setTimeout(resolve, 2000));
    await post(state.configuration.inboxUrl, { body: data })(state);
    };

    console.log('For each one of our chunks, we send one by one awaiting response.');
    for (const patient of patientChunks) {
    await postToInbox(patient);
    }
    for (const visit of visitChunks) {
    await postToInbox(visit);
    }

    return { ...state, patientChunks, visitChunks };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/timeout.html b/adaptors/library/jobs/auto/timeout.html index bc31d885031..479c04360a0 100644 --- a/adaptors/library/jobs/auto/timeout.html +++ b/adaptors/library/jobs/auto/timeout.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Timeout to create a delay

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    get

    Expression

    // To properly use a timeout, wrap it in a promise. This job has two operations
    // and it executes the get(...) operation after the fn(...) operation
    // waits for 4000ms.
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('wait, and then resolve');
    resolve(state);
    }, 4000);
    });
    });

    get('https://jsonplaceholder.typicode.com/todos/1');

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array.html b/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array.html index 22e04f77f4e..7551149f7e9 100644 --- a/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array.html +++ b/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Merge data into child array then upsert

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, merge, relationship, upsert

    Expression

    each(
    merge(
    dataPath('form.ID_cards_given_to_vendor[*]'),
    fields(
    field('Vendor_Id', dataValue('form.ID_vendor')),
    field('form_finished_time', dataValue('form.meta.timeEnd'))
    )
    ),
    upsert(
    'Small_Packet__c',
    'sp_id__c',
    fields(
    field('sp_id__c', dataValue('ID_cards_given_to_vendor')),
    relationship('Vendor__r', 'Badge_Code__c', dataValue('Vendor_Id')),
    field(
    'Small_Packet_Distribution_Date__c',
    dataValue('form_finished_time')
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/triggers/xmlns.html b/adaptors/library/triggers/xmlns.html index cf2194e7892..d3f77b125a5 100644 --- a/adaptors/library/triggers/xmlns.html +++ b/adaptors/library/triggers/xmlns.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Match a message with a fragment inside another object called `form`

    {
    "form": {
    "@xmlns": "http://openrosa.org/formdesigner/F732194-3278-nota-ReAL-one"
    }
    }
    - + \ No newline at end of file diff --git a/adaptors/magpi.html b/adaptors/magpi.html index 8e35ad0659a..3a05aba8000 100644 --- a/adaptors/magpi.html +++ b/adaptors/magpi.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    Magpi

    Magpi is not able to push data to external URLs. In order to fetch data from Magpi, you must run a scheduled job with a cron trigger using language-magpi:

    fetchSurveyData({
    surveyId: 37479, // the survey id
    afterDate: '2016-05-31', // the initial "after" date
    // after the first run, OpenFn will only fetch new submissions
    postUrl: 'https://www.openfn.org/inbox/secret-5c25-inbox-ba2c-url', // the inbox to post form data to.
    });

    Every time this job runs it will only fetch new data, by default.

    - + \ No newline at end of file diff --git a/adaptors/moodle.html b/adaptors/moodle.html index 9eef9abb2ab..b264fc9959c 100644 --- a/adaptors/moodle.html +++ b/adaptors/moodle.html @@ -21,7 +21,7 @@ - + @@ -49,7 +49,7 @@ reflected in my mobile app so that I can follow-up with the relevant support to ensure they perform well.

    Example job to get enrolled users via the Moodle API endpoint (aka web service function): core_enrol_get_enrolled_users

    fn(state => {
    const { loginUrl, username, password, host } = state.configuration;
    return get(
    `${loginUrl}&username=${username}&password=${password}`,
    {},
    state => {
    const { token } = state.data;
    const courseIds = [224, 225];
    const enrolledUsers = [];
    return each(
    courseIds,
    fn(state => {
    let courseid = state.data;
    return get(
    `${host}`,
    {
    query: {
    wstoken: token,
    wsfunction: 'core_enrol_get_enrolled_users',
    courseid,
    moodlewsrestformat: 'json',
    },
    headers: { 'content-type': 'application/json' },
    },
    state => {
    console.log(
    `Getting users enrolled in the course with ${courseid}...`
    );
    enrolledUsers.push(state.data);
    return { ...state, enrolledUsers };
    }
    )(state);
    })
    )(state);
    }
    )(state);
    });
    - + \ No newline at end of file diff --git a/adaptors/msgraph.html b/adaptors/msgraph.html index d72f1179be8..e833b4aad16 100644 --- a/adaptors/msgraph.html +++ b/adaptors/msgraph.html @@ -21,7 +21,7 @@ - + @@ -65,7 +65,7 @@ use case, so please refer to the MS Graph documentation on OAuth Scopes), and/or consult with your system administrator.

    1. User scopes:
    2. Mail scopes:
    3. Calendar scopes:
    4. Contacts scopes:
    5. Files scopes:
    6. Groups scopes:
    7. Directory scopes:
    8. Application scopes:
    9. Other scopes:
    - + \ No newline at end of file diff --git a/adaptors/odk.html b/adaptors/odk.html index 006a4986077..5b03e3154da 100644 --- a/adaptors/odk.html +++ b/adaptors/odk.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ is.

    Integration Options

    In order to fetch data from an ODK Central, you must run a scheduled job with a cron trigger using the odk adaptor.

    Here's an example of a job that gets submission data.

    getSubmissions($.projectId, $.xmlFormId);

    Every time this job runs it will get of all submissions and write them to state.data, leaving your state object looking like this:

    {
    "data": [
    {
    "__id": "uuid:85cb9aff-005e-4edd-9739-dc9c1a829c44",
    "age": 25,
    "meta": {
    "instanceID": "uuid:85cb9aff-005e-4edd-9739-dc9c1a829c44"
    },
    "name": "Bob"
    },
    {
    "__id": "uuid:297000fd-8eb2-4232-8863-d25f82521b87",
    "age": 30,
    "meta": {
    "instanceID": "uuid:297000fd-8eb2-4232-8863-d25f82521b87"
    },
    "name": "Alice"
    }
    ],
    "response": {
    /* ODK response headers, code and context*/
    }
    }
    - + \ No newline at end of file diff --git a/adaptors/ona.html b/adaptors/ona.html index 11ad5d7ea27..0d58e400e00 100644 --- a/adaptors/ona.html +++ b/adaptors/ona.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ and select Settings.
  • On the left-side menu, select Webhooks.
  • Paste your OpenFn inbox URL into the URL input field.
  • Click "Add webhook".
  • Ensure that the webhook is now listed with the JSON tag, indicating that it will forward data as JSON.
  • Check to see that, once a form is submitted, it is forwarded to your OpenFn inbox.
  • - + \ No newline at end of file diff --git a/adaptors/packages/asana-changelog.html b/adaptors/packages/asana-changelog.html index d7288553e8a..9e0d6c8937b 100644 --- a/adaptors/packages/asana-changelog.html +++ b/adaptors/packages/asana-changelog.html @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    2.1.6

    Patch Changes

    2.1.5

    Patch Changes

    2.1.4

    Patch Changes

    2.1.3

    Patch Changes

    2.1.2

    Patch Changes

    2.1.1

    Patch Changes

    2.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/asana-configuration-schema.html b/adaptors/packages/asana-configuration-schema.html index 57a50a01bc5..aeddaeaf388 100644 --- a/adaptors/packages/asana-configuration-schema.html +++ b/adaptors/packages/asana-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiVersion": "1.0",
    "token": "sample-tokenyWSJdXBACMLLWMNGgADFA"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "description": "The API version",
    "examples": [
    "1.0"
    ]
    },
    "token": {
    "title": "Token",
    "type": "string",
    "description": "The API token",
    "examples": [
    "sample-tokenyWSJdXBACMLLWMNGgADFA"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiVersion",
    "token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/asana-docs.html b/adaptors/packages/asana-docs.html index 571d2392ab7..495f4770a28 100644 --- a/adaptors/packages/asana-docs.html +++ b/adaptors/packages/asana-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    asana@4.0.2

    createTask(params, callback)
    createTaskStory(taskGid, params, callback)
    getTask(taskGid, params, callback)
    getTasks(projectGid, params, callback)
    request(path, params, callback)
    updateTask(taskGid, params, callback)
    upsertTask(projectGid, params, callback)

    This adaptor exports the following from common:

    alterState()
    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    createTask

    createTask(params, callback) ⇒ Operation

    Create a task.

    ParamTypeDescription
    paramsobjectBody parameters
    callbackfunction(Optional) callback function

    Example

    createTask({
    name: "test",
    approval_status: "pending",
    assignee: "12345",
    projects: ["1206933955023739"],
    });

    createTaskStory

    createTaskStory(taskGid, params, callback) ⇒ Operation

    Create a story to a specific task.

    ParamTypeDescription
    taskGidstringGlobally unique identifier for the task
    paramsStoryOptionsStory parameters
    callbackfunction(Optional) callback function

    Example: Create a plain text comment

    createTaskStory("1206933955023739", {
    text: "This is a comment",
    });

    Example: Create a HTML formatted text comment

    createTaskStory("1206933955023739", {
    html_text: "<body>This is a comment</body>",
    });

    getTask

    getTask(taskGid, params, callback) ⇒ Operation

    Get a single task of a given project.

    ParamTypeDescription
    taskGidstringGlobally unique identifier for the task
    paramsobjectQuery params to include.
    callbackfunction(Optional) callback function

    Example

    getTask("1206933955023739", {
    opt_fields: "name,notes,assignee",
    });

    getTasks

    getTasks(projectGid, params, callback) ⇒ Operation

    Get the list of tasks for a given project.

    ParamTypeDescription
    projectGidstringGlobally unique identifier for the project
    paramsobjectQuery params to include.
    callbackfunction(Optional) callback function

    Example

    getTasks("1206933955023739", {
    opt_fields: "name,notes,assignee",
    });

    request

    request(path, params, callback) ⇒ Operation

    Make a HTTP request against the Asana API.

    ParamTypeDescription
    pathstringPath to resource (excluding api/version)
    paramsRequestOptions(Optional) Query, body and method parameters
    callbackfunction(Optional) Callback function

    Example

    Get a task by id
    request("/tasks/1234");

    Example

    Query for tasks in a given project
    request("/tasks", {
    query: { project: "abc" },
    });

    Example

    Create a new task
    request("/tasks", {
    method: "POST",
    body: { data: { name: "do the thing", completed: false } },
    });

    updateTask

    updateTask(taskGid, params, callback) ⇒ Operation

    Update a specific task.

    ParamTypeDescription
    taskGidstringGlobally unique identifier for the task
    paramsobjectBody parameters
    callbackfunction(Optional) callback function

    Example

    updateTask("1206933955023739", {
    name: "test",
    approval_status: "pending",
    assignee: "12345",
    });

    upsertTask

    upsertTask(projectGid, params, callback) ⇒ Operation

    Update or create a task.

    ParamTypeDescription
    projectGidstringGlobally unique identifier for the project
    paramsobjectan object with an externalId and some task data.
    callbackfunction(Optional) callback function

    Example

    upsertTask("1201382240880", {
    externalId: "name",
    data: {
    name: "test",
    approval_status: "pending",
    projects: ["1201382240880"],
    assignee: "12345",
    },
    });

    Interfaces

    RequestOptions

    Options provided to the Asana API request

    Properties

    NameTypeDescription
    bodyobjectBody data to append to the request.
    queryobjectAn object of query parameters to be encoded into the URL.
    methodstringThe HTTP method to use. Defaults to GET

    StoryOptions

    Options provided to the createTaskStory request

    Properties

    NameTypeDescription
    textstringThe plain text of the comment to add. Cannot be used with html_text.
    html_textstringOpt In. HTML formatted text for a comment. This will not include the name of the creator.
    is_pinnedbooleanDefault to false. Whether the story should be pinned on the resource.
    sticker_namestringThe name of the sticker in this story. null if there is no sticker.
    opt_fieldsarrayOpt In. This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    opt_prettybooleanDefaults to false. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

    - + \ No newline at end of file diff --git a/adaptors/packages/asana-readme.html b/adaptors/packages/asana-readme.html index 39266f3e604..91d6d927425 100644 --- a/adaptors/packages/asana-readme.html +++ b/adaptors/packages/asana-readme.html @@ -21,7 +21,7 @@ - + @@ -40,7 +40,7 @@ the task does not exist, a new one will be created. The first parameter in this function should be the project_id.

    upsertTask('12344', {
    externalId: 'name',
    data: {
    name: 'A new task',
    projects: ['12344'],
    notes: 'This is a new task',
    },
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/azure-storage-changelog.html b/adaptors/packages/azure-storage-changelog.html index f618858f43e..07d43970d5c 100644 --- a/adaptors/packages/azure-storage-changelog.html +++ b/adaptors/packages/azure-storage-changelog.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Changelog for the azure-storage adaptor

    @openfn/language-azure-storage

    2.0.2

    Patch Changes

    2.0.1

    Patch Changes

    2.0.0

    Major Changes

    • Export new common http helpers (http namespace)

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.0.2

    Patch Changes

    1.0.1

    Patch Changes

    • 6afba70: Add proper variable declaration (linting)

    1.0.0

    Major Changes

    Intial adaptor release with support for Blob storage.

    • uploadBlob
    • downloadBlob
    • getBlobProperties
    - + \ No newline at end of file diff --git a/adaptors/packages/azure-storage-configuration-schema.html b/adaptors/packages/azure-storage-configuration-schema.html index 45d1e31d80f..23afe1fc3b9 100644 --- a/adaptors/packages/azure-storage-configuration-schema.html +++ b/adaptors/packages/azure-storage-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "accountName": "examplestorageaccount01",
    "accountKey": "zzUx5rA4BZkjPet8ztLTEll7azF65Sez7WxGKsJv5B+rp/dby8ARgYpEVe93xFCQDqGBi3FUlxjP+ASt4uepZg=="
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "accountName": {
    "title": "Account Name",
    "type": "string",
    "description": "Azure Storage Account Name",
    "examples": [
    "examplestorageaccount01"
    ]
    },
    "accountKey": {
    "title": "Account Key",
    "type": "string",
    "description": "Azure Account Key",
    "writeOnly": true,
    "examples": [
    "zzUx5rA4BZkjPet8ztLTEll7azF65Sez7WxGKsJv5B+rp/dby8ARgYpEVe93xFCQDqGBi3FUlxjP+ASt4uepZg=="
    ]
    },
    "containerName": {
    "title": "Container Name",
    "type": "string",
    "description": "Name of Azure Blob Storage Container",
    "writeOnly": true,
    "examples": [
    "mycontainername"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "accountName",
    "accountKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/azure-storage-docs.html b/adaptors/packages/azure-storage-docs.html index 5fa3371f4f0..623896b53fb 100644 --- a/adaptors/packages/azure-storage-docs.html +++ b/adaptors/packages/azure-storage-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    azure-storage@2.0.2

    downloadBlob(blobName, [options])
    getBlobProperties(blobName, options)
    uploadBlob(blobName, content, uploadOptions, [options])

    This adaptor exports the following from common:

    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    downloadBlob

    downloadBlob(blobName, [options]) ⇒ Operation

    Download a blob from Azure Blob Storage.

    ParamTypeDefaultDescription
    blobNamestringName of the blob to download.
    [options]Object{}Additional options for the download process.

    Example

    downloadBlob('mycontainer', 'myblob.txt', { downloadAs: 'string' })

    getBlobProperties

    getBlobProperties(blobName, options) ⇒ Operation

    Get properties of a blob in Azure Blob Storage.

    ParamTypeDescription
    blobNamestringName of the blob to get properties for.
    optionsstringAdditional options for the getBlobProperties process.

    Example

    getBlobProperties('mycontainer', 'myblob.txt')

    uploadBlob

    uploadBlob(blobName, content, uploadOptions, [options]) ⇒ Operation

    Upload content to Azure Blob Storage.

    ParamTypeDefaultDescription
    blobNamestringName of the blob to create or replace.
    contentstringContent to upload.
    uploadOptionsobjectSee BlockBlobUploadOptions in Azure Blob Storage docs
    [options]Object{}Additional options for the upload process.
    [options.createContainer]booleanfalseWhether to create the container if it doesn't exist.
    [options.overwrite]booleanfalseWhether to overwrite an existing blob with the same name.
    [options.containerName]stringContainer name. Overrides state.configuration.

    Example

    uploadBlob('mycontainer', 'myblob.txt', {foo:"bar"}, { blobHTTPHeaders: { blobContentType: 'application/json' } })

    - + \ No newline at end of file diff --git a/adaptors/packages/azure-storage-readme.html b/adaptors/packages/azure-storage-readme.html index 0027244862d..596950fd89b 100644 --- a/adaptors/packages/azure-storage-readme.html +++ b/adaptors/packages/azure-storage-readme.html @@ -21,7 +21,7 @@ - + @@ -39,7 +39,7 @@ downloads the same blob and fetches the blob properties. It would be extremely unusual to perform all of these actions in a single job.

    uploadBlob(
    state => {
    const date = new Date();
    const id = '0e82962a-6ed0-4a88-92c1-51ae785b4126';
    return `${date.getFullYear()}/${date.getMonth() + 1}/${id}.json`;
    },
    state.data,
    {
    blobHTTPHeaders: { blobContentType: 'application/json' }
    },
    { createContainer: true, overwrite: true }
    );

    downloadBlob(
    dataValue('blobName');
    );

    getBlobProperties(
    state => {
    return state.references[1].blobName;
    }
    );

    Run the job as follows:

    openfn job -a azure-storage -s state.json -O

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/beyonic-changelog.html b/adaptors/packages/beyonic-changelog.html index 7c4d771e1e0..e383d68d4d8 100644 --- a/adaptors/packages/beyonic-changelog.html +++ b/adaptors/packages/beyonic-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.1.9

    Patch Changes

    0.1.8

    Patch Changes

    0.1.7

    Patch Changes

    0.1.6

    Patch Changes

    0.1.5

    Patch Changes

    0.1.4

    Patch Changes

    0.1.3

    Patch Changes

    0.1.2

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/beyonic-configuration-schema.html b/adaptors/packages/beyonic-configuration-schema.html index 07d64efd403..614078b550b 100644 --- a/adaptors/packages/beyonic-configuration-schema.html +++ b/adaptors/packages/beyonic-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiUrl": "https://beyonic.com/api",
    "apiToken": "cdjhiooiSIUJHDYSYUIHASIOHKAANOAJJjsiujhaka"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiUrl": {
    "title": "API URL",
    "type": "string",
    "description": "API URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://beyonic.com/api"
    ]
    },
    "apiToken": {
    "title": "API Token",
    "type": "string",
    "description": "API token",
    "minLength": 1,
    "examples": [
    "cdjhiooiSIUJHDYSYUIHASIOHKAANOAJJjsiujhaka"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiUrl",
    "apiToken"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/beyonic-docs.html b/adaptors/packages/beyonic-docs.html index bf243272238..67fe04e6985 100644 --- a/adaptors/packages/beyonic-docs.html +++ b/adaptors/packages/beyonic-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    beyonic@0.3.4

    createCollectionRequest(data)
    createContact(data)
    createPayment(data)

    This adaptor exports the following from common:

    dataPath()
    dataValue()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    createCollectionRequest

    createCollectionRequest(data) ⇒ Operation

    Create a collection request

    ParamTypeDescription
    dataobjectPayload data for the collection request

    Example

    execute(
    createCollectionRequest(data)
    )(state)

    createContact

    createContact(data) ⇒ Operation

    Create a contact

    ParamTypeDescription
    dataobjectPayload data for the contact

    Example

    execute(
    createContact(data)
    )(state)

    createPayment

    createPayment(data) ⇒ Operation

    Create a payment

    ParamTypeDescription
    dataobjectPayload data for the payment

    Example

    execute(
    createPayment(data)
    )(state)

    - + \ No newline at end of file diff --git a/adaptors/packages/beyonic-readme.html b/adaptors/packages/beyonic-readme.html index edb0a3d708f..3dcb75d4197 100644 --- a/adaptors/packages/beyonic-readme.html +++ b/adaptors/packages/beyonic-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Payments API

    createPayment(...)

    createPayment(
    fields(
    field('phonenumber', '+256773712831'),
    field('first_name', 'Gideon'),
    field('last_name', 'Zelalem'),
    field('amount', 100.2),
    field('currency', 'USD'),
    field('account', 1),
    field('description', 'Long-term contract for Arseal'),
    field('payment_type', 'money'),
    field('callback_url', 'https://my.website/payments/callback')
    )
    );

    Collection Requests API

    createCollectionRequest(...)

    createCollectionRequest(
    fields(
    field('instructions', 'Send me some money, please!'),
    field('phonenumber', '+256773712831'),
    field('amount', 5.0),
    field('currency', 'USD')
    )
    );

    Contacts API

    createContact(...)

    createContact(
    fields(
    field('first_name', 'Granit'),
    field('last_name', 'Xhaka'),
    field('phone_number', '+256773712831'),
    field('email', 'granit@arsenal.com')
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/bigquery-changelog.html b/adaptors/packages/bigquery-changelog.html index 26881aea20e..039164b5861 100644 --- a/adaptors/packages/bigquery-changelog.html +++ b/adaptors/packages/bigquery-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.1.5

    Patch Changes

    1.1.4

    Patch Changes

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/bigquery-configuration-schema.html b/adaptors/packages/bigquery-configuration-schema.html index 6dab9cc987c..6e2eb77b239 100644 --- a/adaptors/packages/bigquery-configuration-schema.html +++ b/adaptors/packages/bigquery-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "type": "service_acconut",
    "project_id": "some-project-id",
    "private_key_id": "670b9e3c8c366e83aa569dd57cbfc5c575b72e42",
    "private_key": "-----BEGIN PRIVATE KEY-----\nblah\nmoreblah=\n-----END PRIVATE KEY-----\n",
    "client_email": "bigquery@some-project.iam.gserviceaccount.com",
    "client_id": "someid",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/bigquery%40some-project.iam.gserviceaccount.com"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "additionalProperties": true,
    "properties": {
    "type": {
    "title": "Type",
    "type": "string",
    "description": "",
    "examples": [
    "service_acconut"
    ]
    },
    "project_id": {
    "title": "Prokect id",
    "type": "string",
    "description": "Project id",
    "examples": [
    "some-project-id"
    ]
    },
    "private_key_id": {
    "title": "Private Key Id",
    "type": "string",
    "description": "Private key id",
    "examples": [
    "670b9e3c8c366e83aa569dd57cbfc5c575b72e42"
    ]
    },
    "private_key": {
    "title": "Private Key",
    "type": "string",
    "description": "Private key",
    "examples": [
    "-----BEGIN PRIVATE KEY-----\nblah\nmoreblah=\n-----END PRIVATE KEY-----\n"
    ]
    },
    "client_email": {
    "title": "Client Email",
    "type": "string",
    "description": "Client email",
    "examples": [
    "bigquery@some-project.iam.gserviceaccount.com"
    ]
    },
    "client_id": {
    "title": "Client Id",
    "type": "string",
    "description": "Client id",
    "examples": [
    "someid"
    ]
    },
    "auth_uri": {
    "title": "Auth Uri",
    "type": "string",
    "description": "Auth Uri",
    "examples": [
    "https://accounts.google.com/o/oauth2/auth"
    ]
    },
    "token_uri": {
    "title": "Token Uri",
    "type": "string",
    "description": "Token Uri",
    "examples": [
    "https://oauth2.googleapis.com/token"
    ]
    },
    "auth_provider_x509_cert_url": {
    "title": "Auth Provider x509 Cert Url",
    "type": "string",
    "description": "",
    "examples": [
    "https://www.googleapis.com/oauth2/v1/certs"
    ]
    },
    "client_x509_cert_url": {
    "title": "Client x509 Cert Url",
    "type": "string",
    "description": "",
    "examples": [
    "https://www.googleapis.com/robot/v1/metadata/x509/bigquery%40some-project.iam.gserviceaccount.com"
    ]
    }
    },
    "required": [
    "type",
    "project_id",
    "private_key_id",
    "private_key",
    "client_email",
    "client_id",
    "auth_uri",
    "token_uri",
    "auth_provider_x509_cert_url",
    "client_x509_cert_url"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/bigquery-docs.html b/adaptors/packages/bigquery-docs.html index 0178c721ab0..b7267a13bfb 100644 --- a/adaptors/packages/bigquery-docs.html +++ b/adaptors/packages/bigquery-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    bigquery@3.0.2

    load(dirPath, projectId, datasetId, tableId, loadOptions, callback)

    This adaptor exports the following from common:

    alterState()
    combine()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    parseCsv()
    sourceValue()

    Functions

    load

    load(dirPath, projectId, datasetId, tableId, loadOptions, callback) ⇒ Operation

    Load files to BigQuery

    ParamTypeDescription
    dirPathstringthe path to your local directory
    projectIdstringyour bigquery project id
    datasetIdstringyour bigquery dataset id
    tableIdstringthe name of the table you'd like to load
    loadOptionsobjectoptions to pass to the bigquery.load() API
    callbackfunctionand optional callback

    Example

    load(
    './tmp/files',
    'my-bg-project',
    'test01',
    'product-codes',
    {
    schema: 'FREQ:STRING,DATATYPE:STRING,PRODUCTCODE:STRING,PARTNER:STRING',
    writeDisposition: 'WRITE_APPEND',
    skipLeadingRows: 1,
    schemaUpdateOptions: ['ALLOW_FIELD_ADDITION'],
    createDisposition: 'CREATE_IF_NEEDED',
    }
    )

    - + \ No newline at end of file diff --git a/adaptors/packages/bigquery-readme.html b/adaptors/packages/bigquery-readme.html index db8f5c114a0..74696d1d785 100644 --- a/adaptors/packages/bigquery-readme.html +++ b/adaptors/packages/bigquery-readme.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@
    Skip to main content

    bigquery Adaptor developer README.md

    Source: https://github.com/OpenFn/adaptors/tree/main/packages/bigquery

    Language BigQuery

    Language Pack for building expressions and operations to make HTTP calls.

    Documentation

    state.json

    The configuration key must be a valid GCP credential as JSON.

    {
    "configuration": {
    "type": "service_account",
    "project_id": "some-project",
    "private_key_id": "670b9e3c8c366e83aa569dd57cbfc5c575b72e42",
    "private_key": "-----BEGIN PRIVATE KEY-----\nblah\nmoreblah=\n-----END PRIVATE KEY-----\n",
    "client_email": "bigquery@some-project.iam.gserviceaccount.com",
    "client_id": "someid",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/bigquery%40some-project.iam.gserviceaccount.com"
    },
    "data": { "a": 1 }
    }

    operations (expression.js)

    load(...)

    Load data to a table in bigquery from a CSV. See full options here.

    load(
    '/home/taylor/Desktop/type-C_r-ALL_ps-201012_freq-M_px-HS_pub-20200731_fmt-csv_ex-20200818.csv',
    'awesome-solutions-project', // project
    'test01', // dataset
    'mytable', // table
    {
    schema:
    'classification:STRING,year:STRING,period:STRING,period_desc:STRING,aggregate_level:STRING,is_leaf_code:STRING,trade_flow_code:STRING,trade_flow:STRING,reporter_code:STRING,reporter:STRING,reporter_iso:STRING,partner_code:STRING,partner:STRING,partner_iso:STRING,commodity_code:STRING,commodity:STRING,qty_unit_code:STRING,qty_unit:STRING,qty:INTEGER,netweight_kg:INTEGER,trade_value:INTEGER,flag:STRING',
    schemaUpdateOptions: ['ALLOW_FIELD_ADDITION'],
    // createDisposition: 'CREATE_IF_NEEDED',
    writeDisposition: 'WRITE_APPEND',
    skipLeadingRows: 1,
    } // loadOptions
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/cartodb-changelog.html b/adaptors/packages/cartodb-changelog.html index d418579fb63..5869e6ca7df 100644 --- a/adaptors/packages/cartodb-changelog.html +++ b/adaptors/packages/cartodb-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.1.4

    Patch Changes

    0.1.3

    Patch Changes

    0.1.2

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/cartodb-configuration-schema.html b/adaptors/packages/cartodb-configuration-schema.html index 9eaa2b21a03..19f7dee4588 100644 --- a/adaptors/packages/cartodb-configuration-schema.html +++ b/adaptors/packages/cartodb-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "account": "openfn",
    "apiKey": "longsecretkey"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "account": {
    "title": "Account",
    "type": "string",
    "description": "CartoDB account name",
    "minLength": 1,
    "examples": [
    "openfn"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "CartoDB API key",
    "minLength": 1,
    "examples": [
    "longsecretkey"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "account",
    "apiKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/cartodb-docs.html b/adaptors/packages/cartodb-docs.html index fbf3218ff02..3b21b0817a4 100644 --- a/adaptors/packages/cartodb-docs.html +++ b/adaptors/packages/cartodb-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/cartodb-readme.html b/adaptors/packages/cartodb-readme.html index d3e39e46457..add29535f1f 100644 --- a/adaptors/packages/cartodb-readme.html +++ b/adaptors/packages/cartodb-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Examples

    addRow(
    'your_table',
    fields(
    field('name', 'taylor'),
    field('lat', dataValue('lat')),
    field('long', dataValue('long')),
    field('mookie', dataValue('form.blaylock')),
    field('description', dataValue('type_description')),
    field('date', dataValue('SubmissionDate'))
    )
    );
    sql(function (state) {
    return (
    `INSERT INTO untitled_table (name, the_geom) VALUES ('` +
    dataValue('form.first_name')(state) +
    `', ST_SetSRID(ST_Point(` +
    dataValue('lat')(state) +
    `, ` +
    dataValue('long')(state) +
    `),4326))`
    );
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/cht-changelog.html b/adaptors/packages/cht-changelog.html index 98f6945ca0d..36d9122cf41 100644 --- a/adaptors/packages/cht-changelog.html +++ b/adaptors/packages/cht-changelog.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/cht-configuration-schema.html b/adaptors/packages/cht-configuration-schema.html index 84772c93f0b..244c29d73af 100644 --- a/adaptors/packages/cht-configuration-schema.html +++ b/adaptors/packages/cht-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "somenamehere"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "Community Health Kit base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://demo-cht.dev.medicmobile.org"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "somenamehere"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/cht-docs.html b/adaptors/packages/cht-docs.html index a5ae7f9c673..cc95e9c23b5 100644 --- a/adaptors/packages/cht-docs.html +++ b/adaptors/packages/cht-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    cht@1.0.2

    get(path, options, [callback])
    post(path, body, options, [callback])
    put(path, options, [callback])
    request(method, path, data, options, [callback])

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, options, [callback]) ⇒ Operation

    Make a GET request against the base URL.

    ParamTypeDescription
    pathstringPath to resource
    optionsRequestOptionsOptions to configure the HTTP request
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the CHT HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Get a list of contacts

    get("/api/v2/export/contacts");

    Example: Filter contacts given a name

    get("/api/v2/export/contacts", {
    query: {"filters": {
    "search": "jim"
    }}
    });

    post

    post(path, body, options, [callback]) ⇒ Operation

    Make a POST request against the base url

    ParamTypeDescription
    pathstringPath to resource
    bodyobjectObject which will be attached to the POST body
    optionsRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the CHT HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Create a new person

    post("/api/v1/people", {  
    "name": "Hannah",
    "phone": "+254712345678",
    "type": "contact",
    "contact_type": "patient", });

    put

    put(path, options, [callback]) ⇒ Operation

    Make a PUT request against the base url

    ParamTypeDescription
    pathstringPath to resource
    optionsRequestOptionsOptions to configure the HTTP request
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the CHT HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Update settings

    put("/api/v1/settings",{query:{overwrite:true}});

    request

    request(method, path, data, options, [callback]) ⇒ Operation

    Make a general HTTP request to CHT

    ParamTypeDescription
    methodstringHTTP method to use
    pathstringPath to resource
    dataobjectObject which will be attached to the POST body
    optionsRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the CHT HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    request("POST","/api/v1/people", {  
    "name": "Hannah",
    "phone": "+254712345678",
    "type": "contact",
    "contact_type": "patient", });

    - + \ No newline at end of file diff --git a/adaptors/packages/cht-readme.html b/adaptors/packages/cht-readme.html index 22a49dea400..7c9e1800b84 100644 --- a/adaptors/packages/cht-readme.html +++ b/adaptors/packages/cht-readme.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the post function

    post("/api/v1/people", {  
    "name": "Hannah",
    "phone": "+254712345678",
    "type": "contact",
    "contact_type": "patient", });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/commcare-changelog.html b/adaptors/packages/commcare-changelog.html index fe406c4e67c..942f0602ac6 100644 --- a/adaptors/packages/commcare-changelog.html +++ b/adaptors/packages/commcare-changelog.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.5.6

    Patch Changes

    1.5.5

    Patch Changes

    1.5.4

    Patch Changes

    1.5.3

    Patch Changes

    1.5.2

    Patch Changes

    1.5.1

    Patch Changes

    1.5.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/commcare-configuration-schema.html b/adaptors/packages/commcare-configuration-schema.html index f8be75b68a6..42681b5f7cc 100644 --- a/adaptors/packages/commcare-configuration-schema.html +++ b/adaptors/packages/commcare-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "hostUrl": "https://www.commcarehq.org",
    "domain": "some-proof-of-concept"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "hostUrl": {
    "title": "Host URL",
    "type": "string",
    "description": "The CommCare host url",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://www.commcarehq.org"
    ]
    },
    "domain": {
    "title": "Domain",
    "type": "string",
    "description": "The CommCare domain name",
    "minLength": 1,
    "examples": [
    "some-proof-of-concept"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "The CommCare API Key",
    "minLength": 1,
    "examples": [
    "the-long-uuid-provided-by-commcare-that-authenticates-requests"
    ]
    },
    "appId": {
    "title": "App ID",
    "type": "string",
    "description": "Your CommCare project UUID",
    "minLength": 1,
    "examples": [
    "the-long-uuid-in-the-url-that-designates-a-unique-commcare-project"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to CommCare",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to CommCare",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "superscretepassword"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "hostUrl",
    "domain"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/commcare-docs.html b/adaptors/packages/commcare-docs.html index 568a5c895ea..df6facbfb06 100644 --- a/adaptors/packages/commcare-docs.html +++ b/adaptors/packages/commcare-docs.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ Paginated responses will be fully downloaded and returned as a single array, unless an offset is passed.

    ParamTypeDescription
    pathstringPath to resource
    [params]ObjectInput parameters for the request. These vary by endpoint, see CommCare docs.
    [callback]functionOptional callback function. Invoked once per page of data retrieved.

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the CommCare server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Get a specific case by id

    get("/case/12345")

    Example: Get exactly 20 cases

    get("/case", { offset:0, limit: 20 })

    Example: Get forms by app id

    get("/form", { app_id: "02bf50ab803a89ea4963799362874f0c" })

    Example: Get all cases, 50 at a time, and add them to state

    get("/case", {}, (state) => {
    state.cases.push(...state.data) // adds 50 cases to the cases array
    return state;
    })

    post

    post(path, data, [params], [callback]) ⇒ Operation

    Make a POST request to any CommCare endpoint.

    ParamTypeDescription
    pathstringPath to resource
    dataobjectObject or JSON to use as the request body
    [params]ObjectOptional request params
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the CommCare server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Post a user object to to the /user endpoint

    post("/user", { "username":"test", "password":"somepassword" })

    submit

    submit(data) ⇒ Operation

    Submit forms to CommCare. Accepts an array of JSON objects, converts them into XML, and submits to CommCare as an x-form.

    ParamTypeDescription
    dataObjectThe form as a JSON object

    This operation writes the following keys to state:

    State KeyDescription
    datathe response from the CommCare Server

    Example: Submit a form to CommCare

     submit(
    fields(
    field("@", (state) => ({
    "xmlns": `http://openrosa.org/formdesigner/${state.formId}`
    }),
    field("question1", (state) => state.data.answer1),
    field("question2", (state) => state.data.answer2),
    )
    )

    submitXls

    submitXls(data, params) ⇒ Operation

    Bulk upload data to CommCare. Accepts an array of objects, converts them into an XLS representation, and uploads.

    ParamTypeDescription
    dataarrayArray of objects to upload
    paramsObjectInput parameters, see CommCare docs.

    This operation writes the following keys to state:

    State KeyDescription
    datathe response from the CommCare Server

    Example: Upload a single row of data

    submitXls(
    [
    {name: 'Mamadou', phone: '000000'},
    ],
    {
    case_type: 'student',
    search_field: 'external_id',
    create_new_cases: 'on',
    }
    )

    - + \ No newline at end of file diff --git a/adaptors/packages/commcare-readme.html b/adaptors/packages/commcare-readme.html index 73b0fb67ac4..f079216875b 100644 --- a/adaptors/packages/commcare-readme.html +++ b/adaptors/packages/commcare-readme.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ https://www.commcarehq.org/a/YOUR_PROJECT/apps/view/YOUR_APP_ID/

  • Note that the username is your full email address.

  • fetchReportData to pull aggregate data from CommCare

    It takes 3 arguments: reportId, params, and postUrl.

    fetchReportData(
    'reportId',
    { limit: 10, offset: 2, state: 'Vermont' },
    'http://www.openfn.org/inbox/secret-uuid'
    );

    simple body target:

    <data xmlns="http://openrosa.org/formdesigner/39A2CA97-2EB8-4A9C-A0D1-6AA666666A66">
    <firstname>Something</firstname>
    <lastname>Else</lastname>
    <age>29</age>
    </data>

    complex body target:

    <?xml version='1.0' ?>
    <data uiVersion="1" version="17" name="New Form" xmlns:jrm="http://dev.commcarehq.org/jr/xforms" xmlns="http://openrosa.org/formdesigner/1DFD8610-91E3-4409-BF8B-02D3B4FF3530">
    <foo>bar</foo>
    <n0:case case_id="ddb8e2b3-7ce0-43e4-ad45-d7a2eebe9169" user_id="user-xxx-eve" date_modified="2013-04-19T16:53:02.799-04" xmlns:n0="http://commcarehq.org/case/transaction/v2">
    <n0:create>
    <n0:case_name>bar</n0:case_name>
    <n0:owner_id>user-xxx-eve</n0:owner_id>
    <n0:case_type>member</n0:case_type>
    </n0:create>
    </n0:case>
    <n1:meta xmlns:n1="http://openrosa.org/jr/xforms">
    <n1:deviceID>A00000245706EE</n1:deviceID>
    <n1:timeStart>2013-04-19T16:52:41.000-04</n1:timeStart>
    <n1:timeEnd>2013-04-19T16:53:02.799-04</n1:timeEnd>
    <n1:username>eve</n1:username>
    <n1:userID>user-xxx-eve</n1:userID>
    <n1:instanceID>b58df19c-efd5-4ecf-9581-65dda8b8787c</n1:instanceID>
    <n2:appVersion xmlns:n2="http://commcarehq.org/xforms">CommCare ODK, version "2.4.1"(10083). App v19. CommCare Version 2.4. Build 10083, built on: March-12-2013</n2:appVersion>
    </n1:meta>
    </data>

    Submitting data to CommCare HQ

    Submit an XLS file

    This function bulk submit a JSON object as xls file to CommCare HQ

    submitXls([{ name: 'Mamadou', phone: '000000' }], {
    case_type: 'student',
    search_field: 'external_id',
    create_new_cases: 'on',
    });

    submit

    Here we're just building the most basic JSON object, that will be converted to an XML object and posted as the element.

    submit(
    fields(
    field('@', function (state) {
    return {
    xmlns:
    'http://openrosa.org/formdesigner/2BCC3E88-2D0D-4C07-8D4A-6B372F3799D9',
    };
    }),
    field('paitent_namentosh', dataValue('first_name')),
    field('question2', 'Some answer here.'),
    field('question3', 'HKS'),
    field('question4', 'item1'),
    field('question5', 69855),
    field('question6', 12)
    )
    );

    An open rosa form submission body should look like this:

    <?xml version="1.0" ?>
    <data name="Patient Registration" uiVersion="1" version="9" xmlns="http://openrosa.org/formdesigner/2BCC3E88-2D0D-4C07-8D4A-6B372F3799D9" xmlns:jrm="http://dev.commcarehq.org/jr/xforms">
    <paitent_namentosh>Taylor</paitent_namentosh>
    <question2>Moruki</question2>
    <question3>Hks</question3>
    <question4>item1</question4>
    <question5>69855</question5>
    <question6>12</question6>
    <n0:meta xmlns:n0="http://openrosa.org/jr/xforms">
    <n0:deviceID>358239055789384</n0:deviceID>
    <n0:timeStart>2015-08-21T16:21:59.807+02</n0:timeStart>
    <n0:timeEnd>2015-08-21T16:22:15.987+02</n0:timeEnd>
    <n0:username>openfn</n0:username>
    <n0:userID>5fe615b3af2834cb5dca59f7466d6174</n0:userID>
    <n0:instanceID>195e79eb-d823-46fe-9e4f-59b8327d5db2</n0:instanceID>
    <n1:appVersion xmlns:n1="http://commcarehq.org/xforms">CommCare ODK, version &quot;2.22.0&quot;(370023). App v9. CommCare Version 2.22. Build 370023, built on: July-22-2015</n1:appVersion>
    </n0:meta>
    </data>

    So the JSON emitted by your expression should look like this:

    {
    "data": {
    "name": "Patient Registration",
    "uiVersion": "1",
    "version": "9",
    "xmlns": "http://openrosa.org/formdesigner/2BCC3E88-2D0D-4C07-8D4A-6B372F3799D9",
    "xmlns:jrm": "http://dev.commcarehq.org/jr/xforms",
    "paitent_namentosh": "Taylor",
    "question2": " Moruki",
    "question3": "Hks",
    "question4": "item1",
    "question5": "69855",
    "question6": "12",
    "n0:meta": {
    "xmlns:n0": "http://openrosa.org/jr/xforms",
    "n0:deviceID": "358239055789384",
    "n0:timeStart": "2015-08-21T16:21:59.807+02",
    "n0:timeEnd": "2015-08-21T16:22:15.987+02",
    "n0:username": "openfn",
    "n0:userID": "5fe615b3af2834cb5dca59f7466d6174",
    "n0:instanceID": "195e79eb-d823-46fe-9e4f-59b8327d5db2",
    "n1:appVersion": {
    "xmlns:n1": "http://commcarehq.org/xforms",
    "$t": "CommCare ODK, version \"2.22.0\"(370023). App v9. CommCare Version 2.22. Build 370023, built on: July-22-2015"
    }
    }
    }
    }

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/common-changelog.html b/adaptors/packages/common-changelog.html index 35ca0dfc47a..b2a089a696d 100644 --- a/adaptors/packages/common-changelog.html +++ b/adaptors/packages/common-changelog.html @@ -21,7 +21,7 @@ - + @@ -45,7 +45,7 @@ in the data may have an object as it's value (when there is only one item), and an array of objects when there is more than one. toArray can be used to reconcile this inconsistency.
    - + \ No newline at end of file diff --git a/adaptors/packages/common-configuration-schema.html b/adaptors/packages/common-configuration-schema.html index 9bcdfcf4330..e66cbf6768f 100644 --- a/adaptors/packages/common-configuration-schema.html +++ b/adaptors/packages/common-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/common-docs.html b/adaptors/packages/common-docs.html index 1b0946ebc01..dacc1fb7907 100644 --- a/adaptors/packages/common-docs.html +++ b/adaptors/packages/common-docs.html @@ -21,7 +21,7 @@ - + @@ -67,7 +67,7 @@ easily add commonly used options. The return object is chainable so you can set as many options as you want. Pass an object to set your own options.

    ParamTypeDescription
    optionsCommonRequestOptionsoptions to pass to the request

    Example: Get with a query an oath token

    get($.data.url, http.options({ query: $.query }).oath($.configuration.access_token)

    http.post

    post(url, options) ⇒ Operation

    Make a POST request.

    ParamTypeDescription
    urlstringURL to access
    optionsCommonRequestOptionsRequest options

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Post a JSON object (setting the content-type header)

     http.post(
    'https://jsonplaceholder.typicode.com/todos',
    $.data,
    options().json(),
    })

    http.request

    request(method, url, options) ⇒ Operation

    Make a HTTP request.

    ParamTypeDescription
    methodstringThe HTTP method to use.
    urlstringURL to resource.
    optionsCommonRequestOptionsRequest options

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    http.request(
    'GET',
    'https://jsonplaceholder.typicode.com/todos'
    )

    Interfaces

    OptionsHelpers

    Helper functions provided by http.options.

    Properties

    NameTypeDescription
    jsonfunctionSets the `content-type' header to 'application/json'
    basicfunctionSets basic auth on the Authorization header. Pass username and password
    bearerfunctionSets a Bearer token on the Authorization header. Pass the token.
    oauthfunctionSets a Bearer token on the Authorization header. Pass the oauth token.

    - + \ No newline at end of file diff --git a/adaptors/packages/common-readme.html b/adaptors/packages/common-readme.html index f93324d5b94..141f6e7ea17 100644 --- a/adaptors/packages/common-readme.html +++ b/adaptors/packages/common-readme.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/dhis2-changelog.html b/adaptors/packages/dhis2-changelog.html index fca1edd8751..37dc6349175 100644 --- a/adaptors/packages/dhis2-changelog.html +++ b/adaptors/packages/dhis2-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    3.2.12

    Patch Changes

    3.2.11

    Patch Changes

    3.2.10

    Patch Changes

    3.2.9

    Patch Changes

    3.2.8

    Patch Changes

    3.2.7

    Patch Changes

    3.2.6

    Patch Changes

    3.2.5

    Patch Changes

    3.2.4

    Patch Changes

    3.2.3

    Patch Changes

    3.2.2

    Patch Changes

    3.2.1

    Patch Changes

    3.2.0

    Minor Changes

    3.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/dhis2-configuration-schema.html b/adaptors/packages/dhis2-configuration-schema.html index 05908ead0c3..a4cb1436789 100644 --- a/adaptors/packages/dhis2-configuration-schema.html +++ b/adaptors/packages/dhis2-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "hostUrl": "https://play.dhis2.org/2.36.6",
    "password": "@some(!)Password",
    "username": "admin"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "hostUrl": {
    "title": "Host URL",
    "type": "string",
    "description": "The base DHIS2 instance URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://play.dhis2.org/2.36.6"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Password"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "placeholder": "38",
    "description": "DHIS2 api version",
    "minLength": 1,
    "examples": [
    "v2"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "hostUrl",
    "password",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/dhis2-docs.html b/adaptors/packages/dhis2-docs.html index c70dfcec634..4208d58236d 100644 --- a/adaptors/packages/dhis2-docs.html +++ b/adaptors/packages/dhis2-docs.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    dhis2@5.0.2

    attr(attribute, value)
    create(resourceType, data, [options], [callback])
    destroy(resourceType, path, [data], [options], [callback])
    discover(httpMethod, endpoint)
    dv(dataElement, value)
    findAttributeValue(trackedEntityInstance, attributeDisplayName)
    get(resourceType, query, [options], [callback])
    patch(resourceType, path, data, [options], [callback])
    update(resourceType, path, data, [options], [callback])
    upsert(resourceType, query, data, [options], [callback])

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    group()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    attr

    attr(attribute, value) ⇒ object

    Converts an attribute ID and value into a DSHI2 attribute object

    ParamTypeDescription
    attributestringA tracked entity instance (TEI) attribute ID.
    valuestringThe value for that attribute.

    Example

    attr('w75KJ2mc4zz', 'Elias')

    create

    create(resourceType, data, [options], [callback]) ⇒ Operation

    Create a record

    ParamTypeDescription
    resourceTypestringType of resource to create. E.g. trackedEntityInstances, programs, events, ...
    dataDhis2DataObject which defines data that will be used to create a given instance of resource. To create a single instance of a resource, data must be a javascript object, and to create multiple instances of a resources, data must be an array of javascript objects.
    [options]ObjectOptional options to define URL parameters via params (E.g. filter, dimension and other import parameters), request config (E.g. auth) and the DHIS2 apiVersion.
    [callback]functionOptional callback to handle the response

    Example: a program

    create('programs', {
    name: 'name 20',
    shortName: 'n20',
    programType: 'WITHOUT_REGISTRATION',
    });

    Example: an event

    create('events', {
    program: 'eBAyeGv0exc',
    orgUnit: 'DiszpKrYNg8',
    status: 'COMPLETED',
    });

    Example: a trackedEntityInstance

    create('trackedEntityInstances', {
    orgUnit: 'TSyzvBiovKh',
    trackedEntityType: 'nEenWmSyUEp',
    attributes: [
    {
    attribute: 'w75KJ2mc4zz',
    value: 'Gigiwe',
    },
    ]
    });

    Example: a dataSet

    create('dataSets', { name: 'OpenFn Data Set', periodType: 'Monthly' });

    Example: a dataSetNotification

    create('dataSetNotificationTemplates', {
    dataSetNotificationTrigger: 'DATA_SET_COMPLETION',
    notificationRecipient: 'ORGANISATION_UNIT_CONTACT',
    name: 'Notification',
    messageTemplate: 'Hello',
    deliveryChannels: ['SMS'],
    dataSets: [],
    });

    Example: a dataElement

    create('dataElements', {
    aggregationType: 'SUM',
    domainType: 'AGGREGATE',
    valueType: 'NUMBER',
    name: 'Paracetamol',
    shortName: 'Para',
    });

    Example: a dataElementGroup

    create('dataElementGroups', {
    name: 'Data Element Group 1',
    dataElements: [],
    });

    Example: a dataElementGroupSet

    create('dataElementGroupSets', {
    name: 'Data Element Group Set 4',
    dataDimension: true,
    shortName: 'DEGS4',
    dataElementGroups: [],
    });

    Example: a dataValueSet

    create('dataValueSets', {
    dataElement: 'f7n9E0hX8qk',
    period: '201401',
    orgUnit: 'DiszpKrYNg8',
    value: '12',
    });

    Example: a dataValueSet with related dataValues

    create('dataValueSets', {
    dataSet: 'pBOMPrpg1QX',
    completeDate: '2014-02-03',
    period: '201401',
    orgUnit: 'DiszpKrYNg8',
    dataValues: [
    {
    dataElement: 'f7n9E0hX8qk',
    value: '1',
    },
    {
    dataElement: 'Ix2HsbDMLea',
    value: '2',
    },
    {
    dataElement: 'eY5ehpbEsB7',
    value: '3',
    },
    ],
    });

    Example: an enrollment

    create('enrollments', {
    trackedEntityInstance: 'bmshzEacgxa',
    orgUnit: 'TSyzvBiovKh',
    program: 'gZBxv9Ujxg0',
    enrollmentDate: '2013-09-17',
    incidentDate: '2013-09-17',
    });

    destroy

    destroy(resourceType, path, [data], [options], [callback]) ⇒ Operation

    Delete a record. A generic helper function to delete an object

    ParamTypeDescription
    resourceTypestringThe type of resource to be deleted. E.g. trackedEntityInstances, organisationUnits, etc.
    pathstringCan be an id of an object or path to the nested object to delete.
    [data]ObjectOptional. This is useful when you want to remove multiple objects from a collection in one request. You can send data as, for example, {"identifiableObjects": [{"id": "IDA"}, {"id": "IDB"}, {"id": "IDC"}]}. See more on DHIS2 API docs
    [options]ObjectOptional options for del operation including params e.g. {preheatCache: true, strategy: 'UPDATE', mergeMode: 'REPLACE'}. Run discover or see DHIS2 documentation. Defaults to {operationName: 'delete', apiVersion: state.configuration.apiVersion, responseType: 'json'}
    [callback]functionOptional callback to handle the response

    Example: a tracked entity instance

    destroy('trackedEntityInstances', 'LcRd6Nyaq7T');

    discover

    discover(httpMethod, endpoint) ⇒ Operation

    Discover DHIS2 api endpoint query parameters and allowed operators for a given resource's endpoint.

    ParamTypeDescription
    httpMethodstringThe HTTP to inspect parameter usage for a given endpoint, e.g., get, post,put,patch,delete
    endpointstringThe path for a given endpoint. E.g. /trackedEntityInstances or /dataValueSets

    Example: a list of parameters allowed on a given endpoint for specific http method

    discover('post', '/trackedEntityInstances')

    dv

    dv(dataElement, value) ⇒ object

    Converts a dataElement and value into a DSHI2 dataValue object

    ParamTypeDescription
    dataElementstringA data element ID.
    valuestringThe value for that data element.

    Example

    dv('f7n9E0hX8qk', 12)

    findAttributeValue

    findAttributeValue(trackedEntityInstance, attributeDisplayName) ⇒ string

    Gets an attribute value by its case-insensitive display name

    ParamTypeDescription
    trackedEntityInstanceObjectA tracked entity instance (TEI) object
    attributeDisplayNamestringThe 'displayName' to search for in the TEI's attributes

    Example

    findAttributeValue(state.data.trackedEntityInstances[0], 'first name')

    get

    get(resourceType, query, [options], [callback]) ⇒ Operation

    Get data. Generic helper method for getting data of any kind from DHIS2.

    • This can be used to get DataValueSets,events,trackedEntityInstances,etc.

    Returns: Operation - state

    ParamTypeDescription
    resourceTypestringThe type of resource to get(use its plural name). E.g. dataElements, trackedEntityInstances,organisationUnits, etc.
    queryObjectA query object that will limit what resources are retrieved when converted into request params.
    [options]ObjectOptional options to define URL parameters via params beyond filters, request configuration (e.g. auth) and DHIS2 api version to use.
    [callback]functionOptional callback to handle the response

    Example: all data values for the 'pBOMPrpg1QX' dataset

    get('dataValueSets', {
    dataSet: 'pBOMPrpg1QX',
    orgUnit: 'DiszpKrYNg8',
    period: '201401',
    fields: '*',
    });

    Example: all programs for an organization unit

    get('programs', { orgUnit: 'TSyzvBiovKh', fields: '*' });

    Example: a single tracked entity instance by a unique external ID

    get('trackedEntityInstances', {
    ou: 'DiszpKrYNg8',
    filter: ['flGbXLXCrEo:Eq:124', 'w75KJ2mc4zz:Eq:John'],
    });

    patch

    patch(resourceType, path, data, [options], [callback]) ⇒ Operation

    Patch a record. A generic helper function to send partial updates on one or more object properties.

    • You are not required to send the full body of object properties.
    • This is useful for cases where you don't want or need to update all properties on a object.
    ParamTypeDescription
    resourceTypestringThe type of resource to be updated. E.g. dataElements, organisationUnits, etc.
    pathstringThe id or path to the object to be updated. E.g. FTRrcoaog83 or FTRrcoaog83/{collection-name}/{object-id}
    dataObjectData to update. Include only the fields you want to update. E.g. {name: "New Name"}
    [options]ObjectOptional configuration, including params for the update ({preheatCache: true, strategy: 'UPDATE', mergeMode: 'REPLACE'}). Defaults to {operationName: 'patch', apiVersion: state.configuration.apiVersion, responseType: 'json'}
    [callback]functionOptional callback to handle the response

    Example: a dataElement

    patch('dataElements', 'FTRrcoaog83', { name: 'New Name' });

    update

    update(resourceType, path, data, [options], [callback]) ⇒ Operation

    Update data. A generic helper function to update a resource object of any type. Updating an object requires to send all required fields or the full body

    ParamTypeDescription
    resourceTypestringThe type of resource to be updated. E.g. dataElements, organisationUnits, etc.
    pathstringThe id or path to the object to be updated. E.g. FTRrcoaog83 or FTRrcoaog83/{collection-name}/{object-id}
    dataObjectData to update. It requires to send all required fields or the full body. If you want partial updates, use patch operation.
    [options]ObjectOptional options to define URL parameters via params (E.g. filter, dimension and other import parameters), request config (E.g. auth) and the DHIS2 apiVersion.
    [callback]functionOptional callback to handle the response

    Example: a program

    update('programs', 'qAZJCrNJK8H', {
    name: '14e1aa02c3f0a31618e096f2c6d03bed',
    shortName: '14e1aa02',
    programType: 'WITHOUT_REGISTRATION',
    });

    Example: an event

    update('events', 'PVqUD2hvU4E', {
    program: 'eBAyeGv0exc',
    orgUnit: 'Ngelehun CHC',
    status: 'COMPLETED',
    storedBy: 'admin',
    dataValues: [],
    });

    Example: a trackedEntityInstance

    update('trackedEntityInstances', 'IeQfgUtGPq2', {
    created: '2015-08-06T21:12:37.256',
    orgUnit: 'TSyzvBiovKh',
    createdAtClient: '2015-08-06T21:12:37.256',
    trackedEntityInstance: 'IeQfgUtGPq2',
    lastUpdated: '2015-08-06T21:12:37.257',
    trackedEntityType: 'nEenWmSyUEp',
    inactive: false,
    deleted: false,
    featureType: 'NONE',
    programOwners: [
    {
    ownerOrgUnit: 'TSyzvBiovKh',
    program: 'IpHINAT79UW',
    trackedEntityInstance: 'IeQfgUtGPq2',
    },
    ],
    enrollments: [],
    relationships: [],
    attributes: [
    {
    lastUpdated: '2016-01-12T00:00:00.000',
    displayName: 'Last name',
    created: '2016-01-12T00:00:00.000',
    valueType: 'TEXT',
    attribute: 'zDhUuAYrxNC',
    value: 'Russell',
    },
    {
    lastUpdated: '2016-01-12T00:00:00.000',
    code: 'MMD_PER_NAM',
    displayName: 'First name',
    created: '2016-01-12T00:00:00.000',
    valueType: 'TEXT',
    attribute: 'w75KJ2mc4zz',
    value: 'Catherine',
    },
    ],
    });

    Example: a dataSet

    update('dataSets', 'lyLU2wR22tC', { name: 'OpenFN Data Set', periodType: 'Weekly' });

    Example: a dataSetNotification

    update('dataSetNotificationTemplates', 'VbQBwdm1wVP', {
    dataSetNotificationTrigger: 'DATA_SET_COMPLETION',
    notificationRecipient: 'ORGANISATION_UNIT_CONTACT',
    name: 'Notification',
    messageTemplate: 'Hello Updated,
    deliveryChannels: ['SMS'],
    dataSets: [],
    });

    Example: a dataElement

    update('dataElements', 'FTRrcoaog83', {
    aggregationType: 'SUM',
    domainType: 'AGGREGATE',
    valueType: 'NUMBER',
    name: 'Paracetamol',
    shortName: 'Para',
    });

    Example: a dataElementGroup

    update('dataElementGroups', 'QrprHT61XFk', {
    name: 'Data Element Group 1',
    dataElements: [],
    });

    Example: a dataElementGroupSet

    update('dataElementGroupSets', 'VxWloRvAze8', {
    name: 'Data Element Group Set 4',
    dataDimension: true,
    shortName: 'DEGS4',
    dataElementGroups: [],
    });

    Example: a dataValueSet

    update('dataValueSets', 'AsQj6cDsUq4', {
    dataElement: 'f7n9E0hX8qk',
    period: '201401',
    orgUnit: 'DiszpKrYNg8',
    value: '12',
    });

    Example: a dataValueSet with related dataValues

    update('dataValueSets', 'Ix2HsbDMLea', {
    dataSet: 'pBOMPrpg1QX',
    completeDate: '2014-02-03',
    period: '201401',
    orgUnit: 'DiszpKrYNg8',
    dataValues: [
    {
    dataElement: 'f7n9E0hX8qk',
    value: '1',
    },
    {
    dataElement: 'Ix2HsbDMLea',
    value: '2',
    },
    {
    dataElement: 'eY5ehpbEsB7',
    value: '3',
    },
    ],
    });

    Example: a single enrollment

    update('enrollments', 'CmsHzercTBa' {
    trackedEntityInstance: 'bmshzEacgxa',
    orgUnit: 'TSyzvBiovKh',
    program: 'gZBxv9Ujxg0',
    enrollmentDate: '2013-10-17',
    incidentDate: '2013-10-17',
    });

    upsert

    upsert(resourceType, query, data, [options], [callback]) ⇒ Operation

    Upsert a record. A generic helper function used to atomically either insert a row, or on the basis of the row already existing, UPDATE that existing row instead.

    Throws:

    • RangeError - Throws range error
    ParamTypeDescription
    resourceTypestringThe type of a resource to upsert. E.g. trackedEntityInstances
    queryObjectA query object that allows to uniquely identify the resource to update. If no matches found, then the resource will be created.
    dataObjectThe data to use for update or create depending on the result of the query.
    [options]ObjectOptional configuration that will be applied to both the get and the create or update operations.
    [callback]functionOptional callback to handle the response

    Example: Example `expression.js` of upsert

    upsert('trackedEntityInstances', {
    ou: 'TSyzvBiovKh',
    filter: ['w75KJ2mc4zz:Eq:Qassim'],
    }, {
    orgUnit: 'TSyzvBiovKh',
    trackedEntityType: 'nEenWmSyUEp',
    attributes: [
    {
    attribute: 'w75KJ2mc4zz',
    value: 'Qassim',
    },
    ],
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/dhis2-readme.html b/adaptors/packages/dhis2-readme.html index 1da9aae2d5b..b1c407ad776 100644 --- a/adaptors/packages/dhis2-readme.html +++ b/adaptors/packages/dhis2-readme.html @@ -21,7 +21,7 @@ - + @@ -66,7 +66,7 @@ required. Otherwise the create integration tests would be broken again; and that's an endless faillure loop :(

    Anytime a new example is added in the documentation of a helper function, a new integration test should be built.

    - + \ No newline at end of file diff --git a/adaptors/packages/dynamics-changelog.html b/adaptors/packages/dynamics-changelog.html index db0dcba395b..2d39f752152 100644 --- a/adaptors/packages/dynamics-changelog.html +++ b/adaptors/packages/dynamics-changelog.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.5

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/dynamics-configuration-schema.html b/adaptors/packages/dynamics-configuration-schema.html index 8d6dba98b61..be78af08cfe 100644 --- a/adaptors/packages/dynamics-configuration-schema.html +++ b/adaptors/packages/dynamics-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "resource": "https://openfn.crm2.dynamics.com",
    "apiVersion": "8.2.0",
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "properties": {
    "resource": {
    "title": "Resource",
    "type": "string",
    "description": "Dynamics resource URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://openfn.crm2.dynamics.com"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "default": "8.2.0",
    "description": "Dynamics API version to use",
    "minLength": 1,
    "examples": [
    "8.2.0"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Dynamics API access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "resource",
    "apiVersion",
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/dynamics-docs.html b/adaptors/packages/dynamics-docs.html index 37e50982e22..15e3de9b932 100644 --- a/adaptors/packages/dynamics-docs.html +++ b/adaptors/packages/dynamics-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/dynamics-readme.html b/adaptors/packages/dynamics-readme.html index 0d922e63e2b..8e74fca08bf 100644 --- a/adaptors/packages/dynamics-readme.html +++ b/adaptors/packages/dynamics-readme.html @@ -21,7 +21,7 @@ - + @@ -39,7 +39,7 @@ in the expression. Otherwise it will perform a query on all data with the defined Entity Name

    query({
    entityName: 'contacts',
    entityId: '51a0e5b9-88df-e311-b8e5-6c3be5a8b200',
    query: {
    fields: ['fullname', 'birthdate'],
    limit: 10,
    orderBy: {
    field: 'lastname',
    direction: 'asc',
    },
    filter: "firstname eq 'Cat'",
    },
    });

    sample update expression

    updateEntity({
    entityName: 'accounts',
    entityId: 'f4301865-c64a-e711-80f3-e0071b6fd061',
    body: {
    name: 'wilder 2',
    creditonhold: true,
    address1_latitude: 47.639583,
    description: 'This is the description of the sample account',
    revenue: 5000000,
    accountcategorycode: 1,
    },
    });

    sample delete expression

    deleteEntity({
    entityName: 'accounts',
    entityId: 'aeef941b-254a-e711-80f1-e0071b685921',
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/facebook-changelog.html b/adaptors/packages/facebook-changelog.html index 9b9a23eede2..d80bd1a7496 100644 --- a/adaptors/packages/facebook-changelog.html +++ b/adaptors/packages/facebook-changelog.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/facebook-configuration-schema.html b/adaptors/packages/facebook-configuration-schema.html index 2d2751a2671..3234a9eb240 100644 --- a/adaptors/packages/facebook-configuration-schema.html +++ b/adaptors/packages/facebook-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "EAAGm0PX4ZCpsBAEHuZBwZBZCDEZDZD7ZC8ZBZBt7MbZA7sVZA"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "properties": {
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Facebook API access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "EAAGm0PX4ZCpsBAEHuZBwZBZCDEZDZD7ZC8ZBZBt7MbZA7sVZA"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/facebook-docs.html b/adaptors/packages/facebook-docs.html index f4eb234594e..85f14818211 100644 --- a/adaptors/packages/facebook-docs.html +++ b/adaptors/packages/facebook-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/facebook-readme.html b/adaptors/packages/facebook-readme.html index d039e051021..9d0a86e5526 100644 --- a/adaptors/packages/facebook-readme.html +++ b/adaptors/packages/facebook-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    postMessage

    sample expression using operation

    postMessage({
    recipient: {
    id: '<PSID>',
    },
    message: {
    text: '<YOUR MESSAGE GOES HERE>',
    },
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-changelog.html b/adaptors/packages/fhir-changelog.html index 94d4690eaf4..c9b791aee3e 100644 --- a/adaptors/packages/fhir-changelog.html +++ b/adaptors/packages/fhir-changelog.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    2.0.0

    Major Changes

    1.1.5

    Patch Changes

    1.1.4

    Patch Changes

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-configuration-schema.html b/adaptors/packages/fhir-configuration-schema.html index 35b6e6b1040..aedd9e79ef9 100644 --- a/adaptors/packages/fhir-configuration-schema.html +++ b/adaptors/packages/fhir-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://hapi.fhir.org",
    "apiPath": "baseR4"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
    "baseUrl": {
    "title": "Base Url",
    "type": "string",
    "description": "The baseUrl",
    "examples": [
    "https://hapi.fhir.org"
    ]
    },
    "apiPath": {
    "title": "API Path",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "placeholder": "R4",
    "description": "FHIR api path",
    "minLength": 1,
    "examples": [
    "baseR4",
    "R3",
    "R4"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "openfn_test"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your FHIR access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "the-long-access-token-from-your-auth"
    ]
    }
    },
    "required": [
    "baseUrl",
    "apiPath"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-docs.html b/adaptors/packages/fhir-docs.html index 2670ad16774..99cfe9c8e79 100644 --- a/adaptors/packages/fhir-docs.html +++ b/adaptors/packages/fhir-docs.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    fhir@5.0.2

    create(resourceType, resource, params, callback)
    createTransactionBundle(entries, callback)
    get(path, params, options, callback)
    getClaim(claimId, params, callback)
    post(path, data, options, callback)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    create

    create(resourceType, resource, params, callback) ⇒ Operation

    Creates a new resource with a server assigned resourceType. The resource object doesn't need resourceType or id

    ParamTypeDescription
    resourceTypestringThe resource type to create
    resourceobjectThe resource to create
    paramsobject(Optional) FHIR parameters to control and configure resource creation
    callbackfunction(Optional) callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Create a new patient

    create('Patient', {
    name: [
    {
    use: 'official',
    family: 'La Paradisio',
    given: ['Josephine', 'Nessa'],
    },
    ],
    });

    createTransactionBundle

    createTransactionBundle(entries, callback) ⇒ Operation

    Create a transaction bundle to process multiple requests at once

    ParamTypeDescription
    entriesarrayarray of transactions
    callbackfunction(Optional) callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example

    createTransactionBundle([
    {
    fullUrl: "https://hapi.fhir.org/baseR4/Patient/592442",
    resource: {
    resourceType: "Patient",
    id: "592442",
    name: [{ given: "Caleb", family: "Cushing" }],
    },
    request: {
    method: "POST",
    url: "Patient",
    },
    },
    ]);

    get

    get(path, params, options, callback) ⇒ Operation

    Send a HTTP GET request to the baseURL defined in config

    ParamTypeDescription
    pathstringPath to resource
    paramsobject(Optional) Parameters to encode into the URL query
    optionsGetOptions(Optional) Options to control the request
    callbackfunction(Optional) callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Get a Patient resource by id

    get('Patient/0bd0038b-8aad-4719-8d55-ff94bd3de5d0');

    Example: Get a resource with query parameters

    get("Claim", { _include: "Claim:patient", _sort: "-_lastUpdated", _count: 200 })

    getClaim

    getClaim(claimId, params, callback) ⇒ Operation

    Get Claim in a FHIR system

    ParamTypeDescription
    claimIdstringclaim id
    paramsobjectquery parameters
    callbackfunctioncallback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example

    getClaim('',{ _include: "Claim:patient", _sort: "-_lastUpdated", _count: 200 });

    post

    post(path, data, options, callback) ⇒ Operation

    Send a HTTP POST request to the baseURL defined in config

    ParamTypeDescription
    pathstringPath to resource
    dataobjectJSON data to append to the POST body
    optionsRequestOptions(Optional) Additional options for the request
    callbackfunction(Optional) callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Create bundle

    post("Bundle",{
    "resourceType": "Bundle"
    })

    Interfaces

    GetOptions

    Options provided to a GET HTTP request

    Properties

    NameTypeDescription
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.

    RequestOptions

    Options provided to a HTTP request

    Properties

    NameTypeDescription
    headersobjectObject of headers to append to the request
    bodyobjectJSON payload to attach to the request
    queryobjectQuery parameters for the request. Will be encoded into the URL
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-readme.html b/adaptors/packages/fhir-readme.html index 00542b2a292..a173d47e655 100644 --- a/adaptors/packages/fhir-readme.html +++ b/adaptors/packages/fhir-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Creates a resource in a destination system using a POST request

    create('/endpoint', { foo: 'bar' });

    Creates a transactionBundle for HAPI FHIR

    createTransactionBundle({
    entry: [transactionBundle],
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/godata-changelog.html b/adaptors/packages/godata-changelog.html index 0357005e200..5b2720b56ba 100644 --- a/adaptors/packages/godata-changelog.html +++ b/adaptors/packages/godata-changelog.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    3.2.4

    Patch Changes

    3.2.3

    Patch Changes

    3.2.2

    Patch Changes

    3.2.1

    Patch Changes

    3.2.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/godata-configuration-schema.html b/adaptors/packages/godata-configuration-schema.html index f750ef9c3d5..bf46c699423 100644 --- a/adaptors/packages/godata-configuration-schema.html +++ b/adaptors/packages/godata-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiUrl": "https://www.who-godata.com/api",
    "email": "test@openfn.org",
    "password": "@some(!)Strongpassword"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiUrl": {
    "title": "API URL",
    "type": "string",
    "description": "Godata API URL",
    "default": "https://www.who-godata.com/api",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://www.who-godata.com/api"
    ]
    },
    "email": {
    "title": "Email",
    "type": "string",
    "description": "Your Godata login email",
    "format": "email",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your Godata login password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Strongpassword"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiUrl",
    "email",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/godata-docs.html b/adaptors/packages/godata-docs.html index e6acdeffbdd..141417a24b1 100644 --- a/adaptors/packages/godata-docs.html +++ b/adaptors/packages/godata-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    godata@3.5.2

    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

    ParamTypeDescription
    idstringOutbreak id
    queryobjectAn object with a query filter parameter
    callbackfunction(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

    ParamTypeDescription
    idstringOutbreak id
    queryobjectAn object with a query filter parameter
    callbackfunction(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

    ParamTypeDescription
    queryobjectAn object with a query filter parameter
    callbackfunction(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

    ParamTypeDescription
    queryobjectAn object with a query filter parameter
    callbackfunction(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

    ParamTypeDescription
    queryobjectAn object with a query filter parameter
    callbackfunction(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.

    ParamTypeDescription
    idstringOutbreak id
    callbackfunction(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.

    ParamTypeDescription
    idstringOutbreak id
    callbackfunction(Optional) Callback function

    Example

    listContacts("343d-dc3e", // Outbreak Id
    state => {
    console.log(state);
    return state;
    });

    listLocations

    listLocations(callback) ⇒ Operation

    Fetch the list of locations

    ParamTypeDescription
    callbackfunction(Optional) Callback function

    Example

    listLocations(state => {
    console.log(state.data);
    return state;
    });

    listOutbreaks

    listOutbreaks(callback) ⇒ Operation

    Fetch the list of outbreaks

    ParamTypeDescription
    callbackfunction(Optional) Callback function

    Example

    listOutbreaks(state => {
    console.log(state.data);
    return state;
    });

    listReferenceData

    listReferenceData(callback) ⇒ Operation

    Fetch the list of reference data

    ParamTypeDescription
    callbackfunction(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

    ParamTypeDescription
    idstringOutbreak id
    externalIdstringExternal Id to match
    goDataCaseobjectan object with some case data.
    callbackfunction(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.

    ParamTypeDescription
    idstringOutbreak id
    externalIdstringExternal Id to match
    goDataContactobjectan object with some case data.
    callbackfunction(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

    ParamTypeDescription
    externalIdstringExternal Id to match
    goDataLocationobjectan object with some location data.
    callbackfunction(Optional) Callback function

    Example

    upsertLocation('name', {...})

    upsertOutbreak

    upsertOutbreak(outbreak, callback) ⇒ Operation

    Upsert outbreak to godata

    ParamTypeDescription
    outbreakobjectan object with an externalId and some outbreak data.
    callbackfunction(Optional) Callback function

    Example

    upsertOutbreak({externalId: "3dec33-ede3", data: {...}})

    upsertReferenceData

    upsertReferenceData(externalId, goDataReferenceData, callback) ⇒ Operation

    Upsert reference data to godata

    ParamTypeDescription
    externalIdstringExternal Id to match
    goDataReferenceDataobjectan object with some reference data.
    callbackfunction(Optional) Callback function

    Example

    upsertReferenceData('id', {...})

    - + \ No newline at end of file diff --git a/adaptors/packages/godata-readme.html b/adaptors/packages/godata-readme.html index 910f1b57d98..5963063364c 100644 --- a/adaptors/packages/godata-readme.html +++ b/adaptors/packages/godata-readme.html @@ -21,7 +21,7 @@ - + @@ -55,7 +55,7 @@ mechanism can specify a criteria to match.

    getReferenceData(
    { where: { categoryId: 'LNG_REFERENCE_DATA_CATEGORY_CENTRE_NAME' } },
    state => {
    console.log(state.data);
    return state;
    }
    );

    Insert or Update a reference data using a unique id as a key

    This function is used to either update a location if matched or insert a new. A custom externalId can be provided.

    upsertReferenceData('id', {
    categoryId: 'CATEGORY',
    value: 'VALUE',
    readOnly: false,
    active: true,
    id: 'ID',
    createdAt: '2020-10-01T18:48:31.784Z',
    createdBy: '95d31ea9',
    updatedAt: '2020-10-01T18:48:31.784Z',
    updatedBy: '95d31ea9',
    createdOn: 'API',
    deleted: false,
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/googlehealthcare-changelog.html b/adaptors/packages/googlehealthcare-changelog.html index afeb27832e5..c01b7e4991a 100644 --- a/adaptors/packages/googlehealthcare-changelog.html +++ b/adaptors/packages/googlehealthcare-changelog.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ information ({cloudRegion: string, projectId: string, datasetId: string, fhirStoreId: string}).

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/googlehealthcare-configuration-schema.html b/adaptors/packages/googlehealthcare-configuration-schema.html index c27b6dea3ae..0ac143f4d80 100644 --- a/adaptors/packages/googlehealthcare-configuration-schema.html +++ b/adaptors/packages/googlehealthcare-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "type": "object",
    "properties": {
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Google Cloud Healthcare access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "description": "The API version",
    "default": "v1",
    "examples": [
    "v1",
    "v1beta1"
    ]
    }
    },
    "required": [
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/googlehealthcare-docs.html b/adaptors/packages/googlehealthcare-docs.html index 205a8ba15b6..a27d596cbc9 100644 --- a/adaptors/packages/googlehealthcare-docs.html +++ b/adaptors/packages/googlehealthcare-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    googlehealthcare@1.1.2

    createFhirResource([fhirStore], resource, callback)

    This adaptor exports the following from common:

    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    createFhirResource

    createFhirResource([fhirStore], resource, callback) ⇒ Operation

    Create some resource in Google Cloud Healthcare

    ParamTypeDescription
    [fhirStore]ObjectThe FHIR store information. - cloudRegion (string): The cloud region where the FHIR store is located. - projectId (string): The ID of the project that contains the FHIR store. - datasetId (string): The ID of the dataset that contains the FHIR store. - fhirStoreId (string): The ID of the FHIR store.
    resourceobjectThe FHIR resource data to be created
    callbackfunctionAn optional callback function

    Example

    createFhirResource(
    {
    cloudRegion: "us-central1",
    projectId: "adjective-noun-123",
    datasetId: "my-dataset",
    fhirStoreId: "my-fhir-store",
    },
    {
    resourceType: "Patient",
    name: [{ use: "official", family: "Smith", given: ["Darcy"] }],
    gender: "female",
    birthDate: "1970-01-01",
    }
    );

    Example

    createFhirResource(
    {
    cloudRegion: "us-central1",
    projectId: "adjective-noun-123",
    datasetId: "my-dataset",
    fhirStoreId: "my-fhir-store",
    },
    (state) => ({
    resourceType: "Encounter",
    status: "finished",
    class: {
    system: "http://hl7.org/fhir/v3/ActCode",
    code: "IMP",
    display: "inpatient encounter",
    },
    reasonCode: [
    {
    text: "The patient had an abnormal heart rate. She was concerned about this.",
    },
    ],
    subject: {
    reference: `Patient/${state.data.id}`,
    },
    })
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/googlehealthcare-readme.html b/adaptors/packages/googlehealthcare-readme.html index 31108665617..b53be042b3c 100644 --- a/adaptors/packages/googlehealthcare-readme.html +++ b/adaptors/packages/googlehealthcare-readme.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ configuration-schema for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/googlesheets-changelog.html b/adaptors/packages/googlesheets-changelog.html index 3577f76c74d..c09f6f13c3e 100644 --- a/adaptors/packages/googlesheets-changelog.html +++ b/adaptors/packages/googlesheets-changelog.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    2.1.6

    Patch Changes

    2.1.5

    Patch Changes

    2.1.4

    Patch Changes

    2.1.3

    Patch Changes

    2.1.2

    Patch Changes

    2.1.1

    Patch Changes

    2.1.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/googlesheets-configuration-schema.html b/adaptors/packages/googlesheets-configuration-schema.html index 71bbad4c43d..f177c7f5c0a 100644 --- a/adaptors/packages/googlesheets-configuration-schema.html +++ b/adaptors/packages/googlesheets-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "properties": {
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Google Sheets access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/googlesheets-docs.html b/adaptors/packages/googlesheets-docs.html index 53e30b5cfd7..0512fe49aa0 100644 --- a/adaptors/packages/googlesheets-docs.html +++ b/adaptors/packages/googlesheets-docs.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    googlesheets@3.0.2

    appendValues(params, callback)
    batchUpdateValues(params, callback)
    getValues(spreadsheetId, range, callback)

    This adaptor exports the following from common:

    alterState()
    combine()
    cursor()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    appendValues

    appendValues(params, callback) ⇒ Operation

    Add an array of rows to the spreadsheet. https://developers.google.com/sheets/api/samples/writing#append_values

    ParamTypeDescription
    paramsObjectData object to add to the spreadsheet.
    [params.spreadsheetId]stringThe spreadsheet ID.
    [params.range]stringThe range of values to update.
    [params.values]arrayA 2d array of values to update.
    callbackfunction(Optional) Callback function

    Example

    appendValues({
    spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
    range: 'Sheet1!A1:E1',
    values: [
    ['From expression', '$15', '2', '3/15/2016'],
    ['Really now!', '$100', '1', '3/20/2016'],
    ],
    })

    batchUpdateValues

    batchUpdateValues(params, callback) ⇒ Operation

    Batch update values in a Spreadsheet.

    Returns: Operation - spreadsheet information

    ParamTypeDescription
    paramsObjectData object to add to the spreadsheet.
    [params.spreadsheetId]stringThe spreadsheet ID.
    [params.range]stringThe range of values to update.
    [params.valueInputOption]string(Optional) Value update options. Defaults to 'USER_ENTERED'
    [params.values]arrayA 2d array of values to update.
    callbackfunction(Optional) callback function

    Example

    batchUpdateValues({
    spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
    range: 'Sheet1!A1:E1',
    values: [
    ['From expression', '$15', '2', '3/15/2016'],
    ['Really now!', '$100', '1', '3/20/2016'],
    ],
    })

    getValues

    getValues(spreadsheetId, range, callback) ⇒ Operation

    Gets cell values from a Spreadsheet.

    Returns: Operation - spreadsheet information

    ParamTypeDescription
    spreadsheetIdstringThe spreadsheet ID.
    rangestringThe sheet range.
    callbackfunction(Optional) callback function

    Example

    getValues('1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos','Sheet1!A1:E1')

    - + \ No newline at end of file diff --git a/adaptors/packages/googlesheets-readme.html b/adaptors/packages/googlesheets-readme.html index 73c817dd20b..d058f5e4d97 100644 --- a/adaptors/packages/googlesheets-readme.html +++ b/adaptors/packages/googlesheets-readme.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ definition.

    appendValues()

    Add rows to an existing sheet: https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/Sheet1!A1:E1:append?valueInputOption=USER_ENTERED

    appendValues({
    spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
    range: 'Sheet1!A1:E1',
    values: [
    ['From expression', '$15', '2', '3/15/2016'],
    ['Really now!', '$100', '1', '3/20/2016'],
    ],
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/hive-changelog.html b/adaptors/packages/hive-changelog.html index 76304785eea..90ab8481bbc 100644 --- a/adaptors/packages/hive-changelog.html +++ b/adaptors/packages/hive-changelog.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    Changelog for the hive adaptor

    @openfn/language-hive

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    0.2.1

    Patch Changes

    • 02ab7a89: - Change host format from uri to string in configuration-schema.json
      • Update required list to include database

    0.2.0

    Minor Changes

    • a380347: Add query function
    - + \ No newline at end of file diff --git a/adaptors/packages/hive-configuration-schema.html b/adaptors/packages/hive-configuration-schema.html index 573f59cc09a..5761e15eb2e 100644 --- a/adaptors/packages/hive-configuration-schema.html +++ b/adaptors/packages/hive-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "some-host-url.compute-1.amazonaws.com",
    "database": "demo-db",
    "username": "admin-demo",
    "password": "@super(!)Secretpass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host URL",
    "type": "string",
    "description": "The database instance host URL",
    "format": "string",
    "minLength": 1,
    "examples": [
    "some-host-url.compute-1.amazonaws.com"
    ]
    },
    "port": {
    "title": "Port",
    "type": "integer",
    "default": 10001,
    "description": "Database instance port",
    "minLength": 1,
    "examples": [
    10001
    ]
    },
    "database": {
    "title": "Database",
    "type": "string",
    "description": "The database name",
    "minLength": 1,
    "examples": [
    "demo-db"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in the database",
    "minLength": 1,
    "examples": [
    "admin-demo"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in the database",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "database",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/hive-docs.html b/adaptors/packages/hive-docs.html index a7bcf58303e..7dd25d95fa1 100644 --- a/adaptors/packages/hive-docs.html +++ b/adaptors/packages/hive-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/hive-readme.html b/adaptors/packages/hive-readme.html index 87de7438e34..d2bda7f790f 100644 --- a/adaptors/packages/hive-readme.html +++ b/adaptors/packages/hive-readme.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the query function

    query('select count(*) from patient');

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/http-changelog.html b/adaptors/packages/http-changelog.html index 4aabad30bdc..385c2d86072 100644 --- a/adaptors/packages/http-changelog.html +++ b/adaptors/packages/http-changelog.html @@ -21,7 +21,7 @@ - + @@ -44,7 +44,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    4.2.8

    Patch Changes

    4.2.7

    Patch Changes

    4.2.6

    Patch Changes

    4.2.5

    Patch Changes

    4.2.4

    Patch Changes

    4.2.3

    Patch Changes

    4.2.2

    Patch Changes

    4.2.1

    Patch Changes

    4.2.0

    Minor Changes

    4.1.0

    Minor Changes

    4.0.1

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/http-configuration-schema.html b/adaptors/packages/http-configuration-schema.html index c2f8f23dcbd..15744a04b42 100644 --- a/adaptors/packages/http-configuration-schema.html +++ b/adaptors/packages/http-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "username": "test@openfn.org",
    "password": "@some(!)Password",
    "access_token": "00QCjAl4MlV-WPX",
    "baseUrl": "https://instance_name.surveycto.com"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Password"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "OAuth Access token, API key or other Bearer token",
    "writeOnly": true,
    "examples": [
    "00QCjAl4MlV-WPX"
    ]
    },
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://instance_name.surveycto.com"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/http-docs.html b/adaptors/packages/http-docs.html index 35b9aa282c1..7b02b879d97 100644 --- a/adaptors/packages/http-docs.html +++ b/adaptors/packages/http-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    http@6.4.4

    del(path, params, callback)
    get(path, params, callback)
    parseXML(body, script, callback)
    patch(path, params, callback)
    post(path, params, callback)
    put(path, params, callback)
    request(method, path, params, callback)

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    chunk()
    combine()
    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    group()
    humanProper()
    lastReferenceValue()
    merge()
    parseCsv()
    scrubEmojis()
    sourceValue()
    splitKeys()
    toArray()

    Functions

    del

    del(path, params, callback) ⇒ Operation

    Make a DELETE request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsBody, Query, Headers and Auth parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    del(`/myendpoint/${state => state.data.id}`, {
    headers: {'content-type': 'application/json'}
    })

    get

    get(path, params, callback) ⇒ Operation

    Make a GET request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsQuery, Headers and Authentication parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    get('/myEndpoint', {
    query: {foo: 'bar', a: 1},
    headers: {'content-type': 'application/json'},
    })

    parseXML

    parseXML(body, script, callback) ⇒ Operation

    Parse XML with the Cheerio parser

    ParamTypeDescription
    bodyStringdata string to be parsed
    scriptfunctionscript for extracting data
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed XML as a JSON object
    referencesan array of all previous data objects used in the Job

    Example

    parseXML(
    (state) => state.response,
    ($) => {
    return $("table[class=your_table]").parsetable(true, true, true);
    }
    );

    Example: Using parseXML with a callback

     parseXML(
    (state) => state.response,
    ($) => {
    return $("table[class=your_table]").parsetable(true, true, true);
    },
    (next) => ({ ...next, results: next.data.body })
    );

    patch

    patch(path, params, callback) ⇒ Operation

    Make a PATCH request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsBody, Query, Headers and Auth parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    patch('/myEndpoint', {
    body: {'foo': 'bar'},
    headers: {'content-type': 'application/json'},
    })

    post

    post(path, params, callback) ⇒ operation

    Make a POST request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsBody, Query, Headers and Authentication parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    post('/myEndpoint', {
    body: {'foo': 'bar'},
    headers: {'content-type': 'application/json'},
    })

    put

    put(path, params, callback) ⇒ Operation

    Make a PUT request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsBody, Query, Headers and Auth parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    put('/myEndpoint', {
    body: {'foo': 'bar'},
    headers: {'content-type': 'application/json'},
    })

    request

    request(method, path, params, callback) ⇒ Operation

    Make a HTTP request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    methodstringThe HTTP method to use.
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsQuery, Headers and Authentication parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    request(
    'GET',
    '/myEndpoint',
    {
    query: {foo: 'bar', a: 1},
    headers: {'content-type': 'application/json'},
    }
    )

    Interfaces

    RequestOptions

    Options provided to the HTTP request

    Properties

    NameTypeDescription
    bodyobject | stringbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
    formobjectPass a JSON object to be serialised into a multipart HTML form (as FormData) in the body.
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.
    parseAsstringParse the response body as json, text or stream. By default will use the response headers.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.
    tlsobjectTLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions

    - + \ No newline at end of file diff --git a/adaptors/packages/http-readme.html b/adaptors/packages/http-readme.html index 3f7cc2bb04b..82200bf62bd 100644 --- a/adaptors/packages/http-readme.html +++ b/adaptors/packages/http-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ definition.

    Get data

    This helper function allows the use of a get method to fetch data. You can specify a query string for filter.

    get(
    '/myendpoint',
    {
    query: { foo: 'bar', a: 1 },
    headers: { 'content-type': 'application/json' },
    authentication: { username: 'taylor', password: 'somethingsecret' },
    },
    state => {
    return state;
    }
    );

    Post existing data

    Send some data to an existing endpoint.

    post('/endpoint', {
    body: state => {
    return {
    field_1: 'some_data',
    field_2: 'some_more_data',
    field_id: dataValue('Some.Json.Object.Id')(state),
    };
    },
    headers: {
    Authorization: 'AUTH_KEY',
    'Content-Type': 'application/json',
    },
    });

    Update existing data with PUT or PATCH

    put(
    '/myendpoint',
    {
    body: { firstname: 'taylor', lastname: 'downs' },
    headers: { 'content-type': 'application/json' },
    authentication: { username: 'user', password: 'pass' },
    },
    state => {
    return state;
    }
    );
    patch(
    '/myendpoint',
    {
    body: { firstname: 'taylor', lastname: 'downs' },
    headers: { 'content-type': 'application/json' },
    authentication: { username: 'user', password: 'pass' },
    },
    state => {
    return state;
    }
    );

    Delete data

    del(
    '/myendpoint',
    {
    query: { id: 'someId' },
    headers: { 'content-type': 'application/json' },
    authentication: { username: 'user', password: 'pass' },
    },
    state => {
    return state;
    }
    );

    Parse XML

    This function allows you to parse some xml data. A callback function can be use to store in a table.

    parseXML(body, function ($) {
    return $('table[class=your_table]').parsetable(true, true, true);
    });

    Parse CSV

    parseCSV('someData.csv', {
    quoteChar: '"',
    header: false,
    });

    Sample parse local CSV file

    parseCSV('PatientsJan2009.csv', {
    quoteChar: '"',
    header: false,
    columns: true,
    skip_empty_lines: true,
    trim: true,
    bom: true,
    });

    Development

    Clone the repo, run pnpm install.

    Run tests using pnpm run test or pnpm run test:watch.

    To build the docs for this repo, run pnpm build:docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/khanacademy-changelog.html b/adaptors/packages/khanacademy-changelog.html index 17b70a14636..e6b00aab6d4 100644 --- a/adaptors/packages/khanacademy-changelog.html +++ b/adaptors/packages/khanacademy-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/khanacademy-configuration-schema.html b/adaptors/packages/khanacademy-configuration-schema.html index b83d9cdd7ec..2a737f9434e 100644 --- a/adaptors/packages/khanacademy-configuration-schema.html +++ b/adaptors/packages/khanacademy-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "email": "test@openfn.org",
    "password": "@some(!)Strongpassword",
    "secretKey": "otherThiNGfSECret",
    "consumerKey": "somEThINGkeyish"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "email": {
    "title": "Email",
    "type": "string",
    "description": "Your Khanacademy login email",
    "format": "email",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your Khanacademy login password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Strongpassword"
    ]
    },
    "consumerKey": {
    "title": "Consumer Key",
    "type": "string",
    "description": "Your Khanacademy consumer key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "somEThINGkeyish"
    ]
    },
    "secretKey": {
    "title": "Secret Key",
    "type": "string",
    "description": "Your Khanacademy secret key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "otherThiNGfSECret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "email",
    "password",
    "secretKey",
    "consumerKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/khanacademy-docs.html b/adaptors/packages/khanacademy-docs.html index c5766eb65e0..b5a61faaa75 100644 --- a/adaptors/packages/khanacademy-docs.html +++ b/adaptors/packages/khanacademy-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/khanacademy-readme.html b/adaptors/packages/khanacademy-readme.html index 1e9ac39a892..9f254ee43a2 100644 --- a/adaptors/packages/khanacademy-readme.html +++ b/adaptors/packages/khanacademy-readme.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ configuration-schema definition.

    fetch

    sample usage

    fetch({
    getEndpoint: 'user',
    queryParams: {
    email: 'thisoneuser@something.org',
    },
    postUrl: 'https://www.openfn.org/inbox/your-uuid',
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/kobotoolbox-changelog.html b/adaptors/packages/kobotoolbox-changelog.html index cec13aa219c..bda830d3845 100644 --- a/adaptors/packages/kobotoolbox-changelog.html +++ b/adaptors/packages/kobotoolbox-changelog.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.3.3

    Patch Changes

    1.3.2

    Patch Changes

    1.3.1

    Patch Changes

    1.3.0

    Minor Changes

    Patch Changes

    1.2.0

    Minor Changes

    Patch Changes

    1.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/kobotoolbox-configuration-schema.html b/adaptors/packages/kobotoolbox-configuration-schema.html index 5d4f924f3f5..11be0df7b35 100644 --- a/adaptors/packages/kobotoolbox-configuration-schema.html +++ b/adaptors/packages/kobotoolbox-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "username": "test@openfn.org",
    "baseURL": "https://kf.kobotoolbox.org",
    "password": "@some(!)Strongpassword",
    "apiVersion": "v2"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseURL": {
    "title": "Base URL",
    "type": "string",
    "default": "https://kf.kobotoolbox.org",
    "description": "Kobotoolbox URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://kf.kobotoolbox.org"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Kobotoolbox username",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Kobotoolbox password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Strongpassword"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "placeholder": "v2",
    "description": "Kobotoolbox API version to use",
    "minLength": 1,
    "examples": [
    "v2"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "username",
    "baseURL",
    "password",
    "apiVersion"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/kobotoolbox-docs.html b/adaptors/packages/kobotoolbox-docs.html index 8a4193ef616..e11e45867e1 100644 --- a/adaptors/packages/kobotoolbox-docs.html +++ b/adaptors/packages/kobotoolbox-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    kobotoolbox@2.4.2

    getDeploymentInfo(params, callback)
    getForms(params, callback)
    getSubmissions(params, callback)

    This adaptor exports the following from common:

    alterState()
    cursor()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    group()
    http()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    getDeploymentInfo

    getDeploymentInfo(params, callback) ⇒ Operation

    Get deployment information for a specific form

    ParamTypeDescription
    paramsobjectForm Id and data to make the fetch or filter
    callbackfunction(Optional) Callback function to execute after fetching form deployment information

    Example

    getDeploymentInfo({formId: 'aXecHjmbATuF6iGFmvBLBX'}, state => {
    console.log(state.data);
    return state;
    });

    getForms

    getForms(params, callback) ⇒ Operation

    Make a request to get the list of forms

    ParamTypeDescription
    paramsobjectQuery, Headers and Authentication parameters
    callbackfunction(Optional) Callback function to execute after fetching form list

    Example

    getForms({}, state => {
    console.log(state.data);
    return state;
    });

    getSubmissions

    getSubmissions(params, callback) ⇒ Operation

    Get submissions for a specific form

    ParamTypeDescription
    paramsobjectForm Id and data to make the fetch or filter
    callbackfunction(Optional) Callback function to execute after fetching form submissions

    Example

    getSubmissions({formId: 'aXecHjmbATuF6iGFmvBLBX'}, state => {
    console.log(state.data);
    return state;
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/kobotoolbox-readme.html b/adaptors/packages/kobotoolbox-readme.html index bbb0ce22f4b..f4a025f71fa 100644 --- a/adaptors/packages/kobotoolbox-readme.html +++ b/adaptors/packages/kobotoolbox-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Get the list of forms

    getForms({}, state => {
    console.log(state.data);
    return state;
    });

    Get submissions for a specific form

    A query can be used to filter results.

    getSubmissions(
    { formId: 'aXecHjmbATuF6iGFmvBLBX', query: { end: { $gte: '2020-11-20' } } },
    state => {
    console.log(state.data);
    return state;
    }
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/magpi-changelog.html b/adaptors/packages/magpi-changelog.html index 3078cba93ea..f290be1cc30 100644 --- a/adaptors/packages/magpi-changelog.html +++ b/adaptors/packages/magpi-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.0.5

    Patch Changes

    1.0.4

    Patch Changes

    1.0.3

    Patch Changes

    1.0.2

    Patch Changes

    1.0.1

    Patch Changes

    1.0.0

    Major Changes

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/magpi-configuration-schema.html b/adaptors/packages/magpi-configuration-schema.html index 389145d747d..078cd2c70bd 100644 --- a/adaptors/packages/magpi-configuration-schema.html +++ b/adaptors/packages/magpi-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "username": "test@openfn.org",
    "accessToken": "somEThINGkeyish"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "username": {
    "title": "username",
    "type": "string",
    "description": "Magpi username",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "accessToken": {
    "title": "Access Token",
    "type": "string",
    "description": "Magpi access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "somEThINGkeyish"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "username",
    "accessToken"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/magpi-docs.html b/adaptors/packages/magpi-docs.html index 94ed4898add..41ee11f8820 100644 --- a/adaptors/packages/magpi-docs.html +++ b/adaptors/packages/magpi-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    magpi@1.2.2

    fetchSurveyData(params)
    submitRecord(jsonData)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    fetchSurveyData

    fetchSurveyData(params) ⇒ Operation

    Make a POST request to fetch Magpi data and POST it somewhere else

    ParamTypeDescription
    paramsobjectdata to make the fetch

    Example

    fetchSurveyData({
    "surveyId": "37479",
    "afterDate": "2017-09-27",
    "postUrl": "https://www.openfn.org/inbox/your-inbox-url"
    })

    submitRecord

    submitRecord(jsonData) ⇒ Operation

    Submit a record for a form/survey which already exists in a Magpi user account

    ParamTypeDescription
    jsonDataobjectPayload data for the record

    Example

    submitRecord(jsonData)

    - + \ No newline at end of file diff --git a/adaptors/packages/magpi-readme.html b/adaptors/packages/magpi-readme.html index 0ad39ef7645..653df2b7e10 100644 --- a/adaptors/packages/magpi-readme.html +++ b/adaptors/packages/magpi-readme.html @@ -21,7 +21,7 @@ - + @@ -43,7 +43,7 @@ one on the data tab
  • enddate: End date of the data to be returned. Filtering is done based on the DateStamp and is inclusive.(Optional)
  • Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mailchimp-changelog.html b/adaptors/packages/mailchimp-changelog.html index 4c7e224a313..c36080674d7 100644 --- a/adaptors/packages/mailchimp-changelog.html +++ b/adaptors/packages/mailchimp-changelog.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.5

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/mailchimp-configuration-schema.html b/adaptors/packages/mailchimp-configuration-schema.html index 8bf0761c431..ea184e54aa2 100644 --- a/adaptors/packages/mailchimp-configuration-schema.html +++ b/adaptors/packages/mailchimp-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "server": "us11",
    "apiKey": "0eb22c7b4a1c5bcd789379bf8a92902d-us13"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "server": {
    "title": "Data Center",
    "type": "string",
    "description": "Mailchimp Data Center for your account",
    "minLength": 1,
    "examples": [
    "us11",
    "uk8",
    "in10"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "Mailchimp API Key",
    "minLength": 1,
    "examples": [
    "0eb22c7b4a1c5bcd789379bf8a92902d-us13"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "server",
    "apiKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mailchimp-docs.html b/adaptors/packages/mailchimp-docs.html index 52b2887b1af..23d7af5301a 100644 --- a/adaptors/packages/mailchimp-docs.html +++ b/adaptors/packages/mailchimp-docs.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    mailchimp@1.0.4

    addMember(params, [callback])
    archiveMember(params, [callback])
    deleteMember(params, [callback])
    get(path, query, [callback])
    listAudienceInfo(query, [callback])
    listAudiences(query, [callback])
    listBatches(params, [callback])
    listMembers(params, [callback])
    post(path, body, query, [callback])
    request(method, path, options, [callback])
    startBatch(params, [callback])
    tagMembers(params, [callback])
    updateMember(params, [callback])
    updateMemberTags(params, [callback])
    upsertMembers(params, [callback])

    This adaptor exports the following from common:

    alterState()
    chunk()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    addMember

    addMember(params, [callback]) ⇒ Operation

    addMember to a list

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    archiveMember

    archiveMember(params, [callback]) ⇒ Operation

    archiveMember in a list

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    deleteMember

    deleteMember(params, [callback]) ⇒ Operation

    Permanently delete a member from a list

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    get

    get(path, query, [callback]) ⇒ Operation

    The get function is used to make a GET request to the Mailchimp API.

    ParamTypeDescription
    pathstringThe endpoint of the api to which the request should be made
    queryobjectAn object containing query parameters to be included in the request
    [callback]function(Optional) callback to handle the response

    Example: Get a list of account exports for a given account

    get('/account-exports');

    listAudienceInfo

    listAudienceInfo(query, [callback]) ⇒ Operation

    Get information about a specific list in your Mailchimp account. Results include list members who have signed up but haven't confirmed their subscription yet and unsubscribed or cleaned.

    ParamTypeDescription
    queryobjectlistId and query parameters
    [callback]functionOptional callback to handle the response

    listAudiences

    listAudiences(query, [callback]) ⇒ Operation

    Get information about all lists in the account.

    ParamTypeDescription
    queryobjectQuery parameters
    [callback]functionOptional callback to handle the response

    listBatches

    listBatches(params, [callback]) ⇒ Operation

    listBatches

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    listMembers

    listMembers(params, [callback]) ⇒ Operation

    listMembers

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    post

    post(path, body, query, [callback]) ⇒ Operation

    The post function is used to make a POST request to the Mailchimp API.

    ParamTypeDescription
    pathstringThe endpoint of the api to which the request should be made.
    bodyobjectThe data to be sent in the body of the request
    queryobjectAn object containing query parameters to be included in the request
    [callback]function(Optional) callback to handle the response

    Example: Create a new account export in your Mailchimp account

    post('/accounts-export', {include_stages:[]});

    request

    request(method, path, options, [callback]) ⇒ Operation

    Make an HTTP request to Mailchimp API

    ParamTypeDescription
    methodstringThe HTTP method for the request (e.g., 'GET', 'POST', 'PUT', 'DELETE').
    pathstringThe endpoint of the api to which the request should be made.
    optionsObjectAdditional options for the request (query, body only).
    [callback]function(Optional) callback function to handle the response.

    Example: Get list to all other resources available in the API

    request('GET','/');

    Example: Create a new account export in your Mailchimp account

    request('POST','/accounts-export', {include_stages:[]});

    startBatch

    startBatch(params, [callback]) ⇒ Operation

    Start a batch with a list of operations.

    ParamTypeDescription
    paramsobjectoperations batch job
    [callback]functionOptional callback to handle the response

    Example

    startBatch(params)

    tagMembers

    tagMembers(params, [callback]) ⇒ Operation

    Tag members with a particular tag

    ParamTypeDescription
    paramsobjecta tagId, members, and a list
    [callback]functionOptional callback to handle the response

    Example

    tagMembers((state) => ({
    listId: "someId", // All Subscribers list
    tagId: "someTag", // User tag
    members: state.response.body.rows.map((u) => u.email),
    }));

    Example

    tagMembers((state) => ({
    listId: "someId",
    tagId: "someTag",
    members: state.response.body.rows
    .filter((u) => u.allow_other_emails)
    .map((u) => u.email),
    }));

    updateMember

    updateMember(params, [callback]) ⇒ Operation

    updateMember

    ParamTypeDescription
    paramsobjecta listId,subscriberHash and member
    [callback]functionOptional callback to handle the response

    updateMemberTags

    updateMemberTags(params, [callback]) ⇒ Operation

    updateMemberTags

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    upsertMembers

    upsertMembers(params, [callback]) ⇒ Operation

    Add or update a list members

    ParamTypeDescription
    paramsobjecta listId, users, and options
    [callback]functionOptional callback to handle the response

    Example

    upsertMembers((state) => ({
    listId: "someId",
    users: state.response.body.rows.map((u) => ({
    email: u.email,
    status: u.allow_other_emails ? "subscribed" : "unsubscribed",
    mergeFields: { FNAME: u.first_name, LNAME: u.last_name },
    })),
    }));

    - + \ No newline at end of file diff --git a/adaptors/packages/mailchimp-readme.html b/adaptors/packages/mailchimp-readme.html index 0dd5f2ca1f0..67052537df2 100644 --- a/adaptors/packages/mailchimp-readme.html +++ b/adaptors/packages/mailchimp-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mailgun-changelog.html b/adaptors/packages/mailgun-changelog.html index eb105834bd9..4e322947f6a 100644 --- a/adaptors/packages/mailgun-changelog.html +++ b/adaptors/packages/mailgun-changelog.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/mailgun-configuration-schema.html b/adaptors/packages/mailgun-configuration-schema.html index 678d96cab40..484c3ff44d0 100644 --- a/adaptors/packages/mailgun-configuration-schema.html +++ b/adaptors/packages/mailgun-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "domain": "sandbox-123.mailgun.org",
    "apiKey": "otherThiNGfSECret"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "domain": {
    "title": "Domain Name",
    "type": "string",
    "description": "Mailgun API Domain Name",
    "format": "string",
    "minLength": 1,
    "examples": [
    "sandbox-123.mailgun.org"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "Mailgun API Key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "otherThiNGfSECret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "domain",
    "apiKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mailgun-docs.html b/adaptors/packages/mailgun-docs.html index c11c7fd7403..e629d91aed6 100644 --- a/adaptors/packages/mailgun-docs.html +++ b/adaptors/packages/mailgun-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/mailgun-readme.html b/adaptors/packages/mailgun-readme.html index fec5d4c0997..c21e3abf043 100644 --- a/adaptors/packages/mailgun-readme.html +++ b/adaptors/packages/mailgun-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    send

    send(
    fields(
    field('from', 'from_email'),
    field('to', 'to_email'),
    field('subject', 'Your Subject'),
    field('text', 'Your message goes here')
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/maximo-changelog.html b/adaptors/packages/maximo-changelog.html index fdf405d9155..4cc9354f340 100644 --- a/adaptors/packages/maximo-changelog.html +++ b/adaptors/packages/maximo-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.5

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/maximo-configuration-schema.html b/adaptors/packages/maximo-configuration-schema.html index 2d3dde86c4b..4584ce5ffdf 100644 --- a/adaptors/packages/maximo-configuration-schema.html +++ b/adaptors/packages/maximo-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://maximo-demo76.mro.com",
    "username": "test@openfn.org",
    "password": "@some(!)passowrd"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "Maximo instance base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://maximo-demo76.mro.com"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Maximo instance username",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Maximo instance password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)passowrd"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/maximo-docs.html b/adaptors/packages/maximo-docs.html index 2e10007a5a3..66c16baef23 100644 --- a/adaptors/packages/maximo-docs.html +++ b/adaptors/packages/maximo-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    maximo@0.5.4

    fetch(params)
    update(params)
    update75(params)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    fetch

    fetch(params) ⇒ Operation

    Make a GET request and POST it somewhere else

    ParamTypeDescription
    paramsobjectdata to make the fetch

    Example

    fetch({
    endpoint: 'maxrest/rest/os/mxinventory',
    query: {
    ITEMNUM: '01226',
    _format: 'json',
    },
    postUrl: 'https://www.openfn.org/inbox/not-real',
    });

    update

    update(params) ⇒ Operation

    Make an update in Maximo 7.6 and beyond

    ParamTypeDescription
    paramsobjectdata to make the update

    Example

    execute(
    update(params)
    )(state)

    update75

    update75(params) ⇒ Operation

    Make an upadte in Maximo 7.5

    ParamTypeDescription
    paramsobjectdata to make the update

    Example

    execute(
    update75(params)
    )(state)

    - + \ No newline at end of file diff --git a/adaptors/packages/maximo-readme.html b/adaptors/packages/maximo-readme.html index a0081601e06..46014aee0a0 100644 --- a/adaptors/packages/maximo-readme.html +++ b/adaptors/packages/maximo-readme.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ configuration-schema definition.

    Fetch

    sample 'fetch' expression

    fetch({
    endpoint: 'maxrest/rest/os/mxinventory',
    query: {
    ITEMNUM: '01226',
    _format: 'json',
    },
    postUrl: 'https://www.openfn.org/inbox/not-real',
    });

    sample 'create' expression

    create({
    endpoint: 'maxrest/rest/os/mxinvbal/',
    body: function (state) {
    return {
    ITEMNUM: dataValue('form.ITEMNUM')(state),
    ITEMSETID: dataValue('form.ITEMSETID')(state),
    SITEID: dataValue('form.SITEID')(state),
    LOCATION: dataValue('form.LOCATION')(state),
    ISSUEUNIT: 'FOO',
    PHYSCNT: dataValue('PHYSCNT')(state),
    BINNUM: dataValue('form.BINNUM')(state),
    };
    },
    });

    sample 'update75' expression

    update75({
    endpoint: state => {
    return (
    'maxrest/rest/os/mxinvbal/' +
    dataValue('form.question1.INVBALANCESID')(state)
    );
    },
    body: state => {
    return {
    _action: 'AddChange', //this is required for the old Maximo API!
    ITEMNUM: dataValue('form.ITEMNUM')(state),
    ITEMSETID: dataValue('form.ITEMSETID')(state),
    SITEID: dataValue('form.SITEID')(state),
    LOCATION: dataValue('form.LOCATION')(state),
    PHYSCNT: dataValue('form.PHYSCNT')(state),
    BINNUM: dataValue('form.BINNUM')(state),
    };
    },
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/medicmobile-changelog.html b/adaptors/packages/medicmobile-changelog.html index b3cac214d79..1457030a524 100644 --- a/adaptors/packages/medicmobile-changelog.html +++ b/adaptors/packages/medicmobile-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/medicmobile-configuration-schema.html b/adaptors/packages/medicmobile-configuration-schema.html index b84b35303b4..2824ff0c376 100644 --- a/adaptors/packages/medicmobile-configuration-schema.html +++ b/adaptors/packages/medicmobile-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "server": "https://standard.app.medicmobile.org",
    "username": "admin",
    "password": "@super(!)Secret",
    "db": "medic"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "server": {
    "title": "Server URL",
    "type": "string",
    "description": "Medic's CouchDB api URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://standard.app.medicmobile.org"
    ]
    },
    "db": {
    "title": "Database",
    "type": "string",
    "description": "Database name",
    "minLength": 1,
    "examples": [
    "medic"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Medic instance username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Medic instance password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "server",
    "username",
    "password",
    "db"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/medicmobile-docs.html b/adaptors/packages/medicmobile-docs.html index 7fca457d8fc..80931648fd0 100644 --- a/adaptors/packages/medicmobile-docs.html +++ b/adaptors/packages/medicmobile-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    medicmobile@0.5.3

    changesApi(params, callback)
    fetchSubmissions(formId, params, postUrl)
    pickFormData(formId)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    changesApi

    changesApi(params, callback) ⇒ Operation

    Access the CouchDB Changes API

    ParamTypeDescription
    paramsobjectQuery parameters
    callbackfunction(Optional) Callback function

    Example

    changesApi(params, callback)

    fetchSubmissions

    fetchSubmissions(formId, params, postUrl) ⇒ Operation

    Access form submissions and post them as JSON.

    ParamTypeDescription
    formIdstringQuery parameters
    paramsobjectStarting sequence id
    postUrlstringInbox to post form data

    Example

    fetchSubmissions(
    "pregnancy", // formId
    { "last-event-id": 334 }, // params
    "http://localhost:4000/inbox/abc-123-xyz" // postUrl
    );

    pickFormData

    pickFormData(formId) ⇒ Operation

    Select submissions for a specific form

    ParamTypeDescription
    formIdstringThe form ID.

    Example

    pickFormData(formId)

    - + \ No newline at end of file diff --git a/adaptors/packages/medicmobile-readme.html b/adaptors/packages/medicmobile-readme.html index 7c3b2b27f8b..b337b22d7fc 100644 --- a/adaptors/packages/medicmobile-readme.html +++ b/adaptors/packages/medicmobile-readme.html @@ -21,7 +21,7 @@ - + @@ -40,7 +40,7 @@ configuration-schema definition.

    sample fetchSubmissions expression

    fetchSubmissions(
    'pregnancy', // formId
    { 'last-event-id': 334 }, // params, last-event-id will be replaced by cursor
    'http://localhost:4000/inbox/abc-123-xyz' // postUrl
    );

    sample changesApi and pickFormData usage

    // get all the changes...
    changesApi({
    include_docs: true,
    // This only gets used the first time the job is run.
    // Subsequent runs take the lastSeq value as their cursor.
    // "last-event-id": 789,
    });

    // Picks out the field data for a given formId.
    pickFormData('pregnancy');

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mogli-changelog.html b/adaptors/packages/mogli-changelog.html index 8cbfaa61192..44aaf8e1bf8 100644 --- a/adaptors/packages/mogli-changelog.html +++ b/adaptors/packages/mogli-changelog.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    v0.1.3

    - + \ No newline at end of file diff --git a/adaptors/packages/mogli-configuration-schema.html b/adaptors/packages/mogli-configuration-schema.html index 206a08f572f..fc4df7480d4 100644 --- a/adaptors/packages/mogli-configuration-schema.html +++ b/adaptors/packages/mogli-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "loginUrl": " https://www.orange-or-airtel-or-vodafone.com/api/",
    "username": "admin",
    "password": "@secret(!)Pass",
    "securityToken": "dGF5bG9yOnNlY3JldA==",
    "secret": "someotherThiNGfSECret"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "loginUrl": {
    "title": "Login URL",
    "type": "string",
    "description": "Mogli instance login URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    " https://www.orange-or-airtel-or-vodafone.com/api/"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Mogli instance username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Mogli instance password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@secret(!)Pass"
    ]
    },
    "securityToken": {
    "title": "Security Token",
    "type": "string",
    "description": "Mogli instance security token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "dGF5bG9yOnNlY3JldA=="
    ]
    },
    "secret": {
    "title": "Secret",
    "type": "string",
    "description": "Mogli instance secret",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "someotherThiNGfSECret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "loginUrl",
    "username",
    "password",
    "securityToken",
    "secret"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mogli-docs.html b/adaptors/packages/mogli-docs.html index e9ba132cbaa..cba6887a36c 100644 --- a/adaptors/packages/mogli-docs.html +++ b/adaptors/packages/mogli-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    mogli@0.5.4

    This adaptor exports the following namespaced functions:

    sourceHelpers.lookup(relationshipName, externalID, path)
    sourceHelpers.relationship(relationshipName, externalID, dataSource)

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    beta
    combine()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    index()
    join()
    lastReferenceValue()
    map()
    merge()
    referencePath()
    source()
    sourceValue()
    toArray()

    sourceHelpers

    These functions belong to the sourceHelpers namespace.

    sourceHelpers.lookup

    lookup(relationshipName, externalID, path) ⇒ object

    Adds a lookup or 'dome insert' to a record.

    ParamTypeDescription
    relationshipNamestring__r relationship field on the record.
    externalIDstringSalesforce ExternalID field.
    pathstringJSONPath to data source.

    Example: Example

    lookup("relationship_name__r", "externalID on related object", "$.path")

    sourceHelpers.relationship

    relationship(relationshipName, externalID, dataSource) ⇒ object

    Adds a lookup or 'dome insert' to a record.

    ParamTypeDescription
    relationshipNamestring__r relationship field on the record.
    externalIDstringSalesforce ExternalID field.
    dataSourcestringresolvable source.

    Example: Data Sourced Value

    relationship("relationship_name__r", "externalID on related object", dataSource("path"))

    Example: Fixed Value

    relationship("relationship_name__r", "externalID on related object", "hello world")

    - + \ No newline at end of file diff --git a/adaptors/packages/mogli-readme.html b/adaptors/packages/mogli-readme.html index 288dabe2448..7842614bd8c 100644 --- a/adaptors/packages/mogli-readme.html +++ b/adaptors/packages/mogli-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Create inbound SMS

    createSMS(
    fields(
    field('sender', dataValue('from_number')),
    field('receivedAt', dataValue('timestamp')),
    field('message', dataValue('message'))
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mongodb-changelog.html b/adaptors/packages/mongodb-changelog.html index d44788e621c..b6b353430ad 100644 --- a/adaptors/packages/mongodb-changelog.html +++ b/adaptors/packages/mongodb-changelog.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.0.6

    Patch Changes

    1.0.5

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/mongodb-configuration-schema.html b/adaptors/packages/mongodb-configuration-schema.html index f4912d81e7c..64b7b797529 100644 --- a/adaptors/packages/mongodb-configuration-schema.html +++ b/adaptors/packages/mongodb-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "clusterHostname": "yourCluster-xxxyzzz.mongodb.net",
    "username": "admin",
    "password": "@secret(!)Pass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "clusterHostname": {
    "title": "Cluster Hostname",
    "type": "string",
    "description": "Your MongoDB cluster hostname",
    "format": "string",
    "minLength": 1,
    "examples": [
    "yourCluster-xxxyzzz.mongodb.net"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Your MongoDB instance username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your MongoDB instance password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@secret(!)Pass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "clusterHostname",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mongodb-docs.html b/adaptors/packages/mongodb-docs.html index 24c3ba4f894..ef03f052dd8 100644 --- a/adaptors/packages/mongodb-docs.html +++ b/adaptors/packages/mongodb-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    mongodb@2.1.4

    findDocuments(params)
    insertDocuments(params)
    updateDocument(params)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    findDocuments

    findDocuments(params) ⇒ State

    Find documents in a mongoDb collection

    ParamTypeDescription
    paramsobjectConfiguration for mongo

    Example

    findDocuments({
    database: 'str',
    collection: 'cases',
    query: {a:3}
    });

    insertDocuments

    insertDocuments(params) ⇒ State

    Inserts documents into a mongoDb collection

    ParamTypeDescription
    paramsobjectConfiguration for mongo

    Example

    insertDocuments({
    database: 'str',
    collection: 'kids',
    documents: [1,2,3]
    });

    updateDocument

    updateDocument(params) ⇒ State

    Updates document (optionally upserting) into a mongoDb collection

    ParamTypeDescription
    paramsobjectConfiguration for mongo

    Example

    updateDocuments({
    database: 'str',
    collection: 'animals',
    filter: { type: 'fuzzy' },
    changes: { kind: 'soft' },
    options: { upsert: true }
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/mongodb-readme.html b/adaptors/packages/mongodb-readme.html index a19d1b5e47e..20a86ab02db 100644 --- a/adaptors/packages/mongodb-readme.html +++ b/adaptors/packages/mongodb-readme.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ configuration-schema definition.

    insertDocuments

    insertDocuments({
    database: 'yourDb',
    collection: 'yourCollection',
    documents: state => {
    return state.data.map(item => {
    return { name: item.name, age: item.age };
    });
    },
    // callback: (state) => state, // optional
    });

    findDocuments

    findDocuments({
    database: 'yourDb',
    collection: 'yourCollection',
    query: state => {
    return { name: 'stu' };
    },
    // callback: (state) => state, // optional
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/msgraph-changelog.html b/adaptors/packages/msgraph-changelog.html index 6b88a7b7a9a..c0d8f8afb0d 100644 --- a/adaptors/packages/msgraph-changelog.html +++ b/adaptors/packages/msgraph-changelog.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ accessToken are now both supported (access_token is preferred)

    0.6.1

    Patch Changes

    0.6.0

    Minor Changes

    Patch Changes

    0.5.5

    Patch Changes

    0.5.4

    Patch Changes

    0.5.3

    Patch Changes

    0.5.2

    Patch Changes

    0.5.1

    Patch Changes

    0.5.0

    Minor Changes

    Patch Changes

    0.4.0

    Minor Changes

    Patch Changes

    0.3.5

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    0.2.0

    Minor Changes

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/msgraph-configuration-schema.html b/adaptors/packages/msgraph-configuration-schema.html index 927618e41ca..8cea96c8fd3 100644 --- a/adaptors/packages/msgraph-configuration-schema.html +++ b/adaptors/packages/msgraph-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRl"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "properties": {
    "apiVersion": {
    "title": "API Version",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "placeholder": "v1.0",
    "description": "Microsoft Graph api version",
    "minLength": 1,
    "examples": [
    "v1.0",
    "beta"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Microsoft Graph access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRl"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/msgraph-docs.html b/adaptors/packages/msgraph-docs.html index 18cbd70575a..0424985578f 100644 --- a/adaptors/packages/msgraph-docs.html +++ b/adaptors/packages/msgraph-docs.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ some parent resource, like a group

    ParamTypeDefaultDescription
    specifierObjectA definition of the drive to retrieve - id {string} - The ID of the resource or owner. - owner {string} - The type of drive owner (e.g. sites, groups).
    namestringThe local name of the drive used to write to state.drives, ie, state.drives[name]
    [callback]functions => s(Optional) Callback function

    Example: Get a drive by ID

    getDrive({ id: "YXzpkoLwR06bxC8tNdg71m" })

    Example: Get the default drive for a site

    getDrive({ id: "openfn.sharepoint.com", owner: "sites" })

    getFile

    getFile(pathOrId, options, [callback]) ⇒ Operation

    Get file metadata or file content.

    ParamTypeDefaultDescription
    pathOrIdstringA path to a file or file id
    optionsobject(Optional) Query parameters
    [callback]functions => s(Optional) Callback function

    Example: Get a file by ID

    getFile('01LUM6XOGRONYNTZ26DBBJPTN5IFTQPBIW')

    Example: Get a file for a named drive by id

    getFile("01LUM6XOGRONYNTZ26DBBJPTN5IFTQPBIW",{ driveName: "mydrive"})

    getFolder

    getFolder(pathOrId, options, [callback]) ⇒ Operation

    Get the contents or metadata of a folder.

    ParamTypeDefaultDescription
    pathOrIdstringA path to a folder or folder id
    optionsobject(Optional) Query parameters
    [callback]functions => s(Optional) Callback function

    Example: Get a folder by ID

    getFolder('01LUM6XOCKDTZKQC7AVZF2VMHE2I3O6OY3')

    Example: Get a folder for a named drive by id

    getFolder("01LUM6XOCKDTZKQC7AVZF2VMHE2I3O6OY3",{ driveName: "mydrive"})

    uploadFile

    uploadFile(resource, data, callback) ⇒ Operation

    Upload a file to a drive

    ParamTypeDescription
    resourceObjectResource Object
    [resource.driveId]StringDrive Id
    [resource.driveId]StringSite Id
    [resource.folderId]StringParent folder id
    [resource.contentType]StringResource content-type
    [resource.onConflict]StringSpecify conflict behavior if file with the same name exists. Can be "rename
    dataObjectA buffer containing the file.
    callbackfunctionOptional callback function

    Example: Upload Excel file to a drive using `driveId` and `parantItemId`

    uploadFile(
    state => ({
    driveId: state.driveId,
    folderId: state.folderId,
    fileName: `Tracker.xlsx`,
    }),
    state => state.buffer
    );

    Example: Upload Excel file to a SharePoint drive using `siteId` and `parantItemId`

    uploadFile(
    state => ({
    siteId: state.siteId,
    folderId: state.folderId,
    fileName: `Report.xlsx`,
    }),
    state => state.buffer
    );

    Utils

    These functions belong to the Utils namespace.

    Utils.sheetToBuffer

    sheetToBuffer(rows, options) ⇒

    The function sheetToBuffer takes in rows, options and optional callback, It creates a workbook and worksheet using the rows, appends the worksheet to the workbook, and returns the workbook as a buffer.

    Returns: a buffer containing the Excel file in state.buffer.

    ParamTypeDescription
    rowsThe rows parameter is an array of objects representing the data to be written to the Excel sheet. Each object in the array represents a row in the sheet, and the keys of the object represent the column headers. The values of the object represent the data in each cell of the row.
    optionsThe options parameter is an object that contains additional configuration options
    [options.wsName]StringWorksheet name i.e 32 Characters
    [options.bookType]StringFile format of the exported file, Default is 'xlsx'. See here for the function. It can have the following properties:

    Example: Create a buffer containing excel file with `xlsx` output format

    sheetToBuffer('$.data[*]', {
    wsName: 'Invalid Grant Codes',
    bookType: 'xlsx',
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/msgraph-readme.html b/adaptors/packages/msgraph-readme.html index 7d74ff43476..43f2c30ba77 100644 --- a/adaptors/packages/msgraph-readme.html +++ b/adaptors/packages/msgraph-readme.html @@ -21,7 +21,7 @@ - + @@ -33,8 +33,8 @@ full technical documentation.

    Configuration

    View the configuration-schema for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the -"Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - +"Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    + \ No newline at end of file diff --git a/adaptors/packages/mssql-changelog.html b/adaptors/packages/mssql-changelog.html index 06f0aeadf31..3936bfe4ceb 100644 --- a/adaptors/packages/mssql-changelog.html +++ b/adaptors/packages/mssql-changelog.html @@ -3,7 +3,7 @@ -mssql changelog | OpenFn/docs +mssql changelog | OpenFn/docs @@ -21,20 +21,20 @@ - +
    -
    Skip to main content

    Changelog for the mssql adaptor

    @openfn/language-mssql

    5.0.3

    Patch Changes

    • 6d38a48: Removed process.exit(1) to prevent workflow crashes on errors

    5.0.2

    Patch Changes

    5.0.1

    Patch Changes

    5.0.0

    Major Changes

    • Export new common http helpers (http namespace)

    4.3.4

    Patch Changes

    4.3.3

    Patch Changes

    4.3.2

    Patch Changes

    • bb5436c: Add title and description for port configuration

    4.3.1

    Patch Changes

    4.3.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    4.2.4

    Patch Changes

    4.2.3

    Patch Changes

    4.2.2

    Patch Changes

    4.2.1

    Patch Changes

    4.2.0

    Minor Changes

    • 2964fc8d: - Add cursor() function
      • Update configuration-schema.json

    4.1.10

    Patch Changes

    4.1.9

    Patch Changes

    4.1.8

    Patch Changes

    4.1.7

    Patch Changes

    4.1.6

    Patch Changes

    4.1.5

    Patch Changes

    4.1.4

    Patch Changes

    4.1.3

    Patch Changes

    4.1.2

    Patch Changes

    4.1.1

    Patch Changes

    4.1.0

    Minor Changes

    - +be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    4.0.8

    Patch Changes

    • 57742d1: remove request dependency

    4.0.7

    Patch Changes

    • 04ed74f: update dependencies

    4.0.6

    Patch Changes

    • 43c3669: patch versions

    4.0.5

    Patch Changes

    4.0.4

    Patch Changes

    4.0.3

    Patch Changes

    • f7ebd3c: remove sample configuration

    4.0.2

    Patch Changes

    • f2aed32: add examples

    4.0.1

    Patch Changes

    • 6d8de03: change @constructor to @function and remove /* @module Adaptor /

    4.0.0

    Major Changes

    • 3878624: Modify composeNextState function, to flattern all rows into an array +of rows with their corresponding column names

    Patch Changes

    3.1.1

    Patch Changes

    • 8566b26: Fix typings
    • b3d45ff: Fix CJS export of npm package.
    • ecf5d30: remove sinon since it was not being used
    • Updated dependencies [8566b26]
    • Updated dependencies [b3d45ff]
    • Updated dependencies [b5eb665]
    • Updated dependencies [ecf5d30]

    3.1.0

    Minor Changes

    • c9b7ed7: Add language-mssql in monorepo

    Patch Changes

    • e04aa28: Rename credential-schema to configuration-schema, update descriptions
    + \ No newline at end of file diff --git a/adaptors/packages/mssql-configuration-schema.html b/adaptors/packages/mssql-configuration-schema.html index 4e46be1b332..e883bb4bdff 100644 --- a/adaptors/packages/mssql-configuration-schema.html +++ b/adaptors/packages/mssql-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -33,8 +33,8 @@ using the CLI, you can set up your own state.configuration by using the sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "server": "something.database.windows.net",
    "database": "demo-db",
    "userName": "admin",
    "password": "@super(!)Password"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and -notes those that are required.

    {
    "$schema": "https://json-schema.org/draft-07/schema#",
    "properties": {
    "server": {
    "title": "Server URL",
    "description": "The database instance server URL or IP address",
    "type": "string",
    "minLength": 1,
    "examples": [
    "something.database.windows.net",
    "192.168.12.10"
    ]
    },
    "database": {
    "title": "Database",
    "type": "string",
    "description": "The database name",
    "minLength": 1,
    "examples": [
    "demo-db"
    ]
    },
    "userName": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Password"
    ]
    },
    "port": {
    "title": "Port",
    "description": "Database instance port",
    "type": "integer",
    "default": 1433,
    "examples": [
    1432
    ]
    },
    "encrypt": {
    "type": "boolean",
    "default": true,
    "examples": [
    false
    ]
    },
    "rowCollectionOnRequestCompletion": {
    "type": "boolean",
    "default": true,
    "examples": [
    false
    ]
    },
    "trustServerCertificate": {
    "type": "boolean",
    "default": true,
    "examples": [
    false
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "server",
    "database",
    "userName",
    "password"
    ]
    }
    - +notes those that are required.

    {
    "$schema": "https://json-schema.org/draft-07/schema#",
    "properties": {
    "server": {
    "title": "Server URL",
    "description": "The database instance server URL or IP address",
    "type": "string",
    "minLength": 1,
    "examples": [
    "something.database.windows.net",
    "192.168.12.10"
    ]
    },
    "database": {
    "title": "Database",
    "type": "string",
    "description": "The database name",
    "minLength": 1,
    "examples": [
    "demo-db"
    ]
    },
    "userName": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Password"
    ]
    },
    "port": {
    "title": "Port",
    "description": "Database instance port",
    "type": "integer",
    "default": 1433,
    "examples": [
    1432
    ]
    },
    "encrypt": {
    "type": "boolean",
    "default": true,
    "examples": [
    false
    ]
    },
    "rowCollectionOnRequestCompletion": {
    "type": "boolean",
    "default": true,
    "examples": [
    false
    ]
    },
    "trustServerCertificate": {
    "type": "boolean",
    "default": true,
    "examples": [
    false
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "server",
    "database",
    "userName",
    "password"
    ]
    }
    + \ No newline at end of file diff --git a/adaptors/packages/mssql-docs.html b/adaptors/packages/mssql-docs.html index ec984d1bfef..0ce72e14aed 100644 --- a/adaptors/packages/mssql-docs.html +++ b/adaptors/packages/mssql-docs.html @@ -3,7 +3,7 @@ -mssql@5.0.3 | OpenFn/docs +mssql@5.0.4 | OpenFn/docs @@ -21,15 +21,15 @@ - +
    -
    Skip to main content

    mssql@5.0.3

    describeTable(tableName, options)
    findValue(filter)
    insert(table, record, options)
    insertMany(table, records, options)
    insertTable(tableName, columns, options)
    modifyTable(tableName, columns, options)
    sql(params)
    upsert(table, uuid, record, options)
    upsertIf(logical, table, uuid, record, options)
    upsertMany(table, uuid, records, options)

    This adaptor exports the following from common:

    alterState()
    combine()
    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    describeTable

    describeTable(tableName, options) ⇒ Operation

    List the columns of a table in a database.

    ParamTypeDescription
    tableNamestringThe name of the table to describe
    optionsobjectOptional options argument

    Example

    describeTable('clinic_visits')

    findValue

    findValue(filter) ⇒ Operation

    Fetch a uuid key given a condition

    ParamTypeDescription
    filterobjectA filter object with the lookup table, a uuid and the condition

    Example

    findValue({
    uuid: 'id',
    relation: 'users',
    where: { first_name: 'Mama%', last_name: 'Cisse'},
    operator: { first_name: 'like', last_name: '='}
    })

    insert

    insert(table, record, options) ⇒ Operation

    Insert a record

    ParamTypeDescription
    tablestringThe target table
    recordobjectPayload data for the record as a JS object
    optionsobjectOptional options argument

    Example

    insert(table, record, {setNull: ["'undefined'", "''"], logValues: false})

    insertMany

    insertMany(table, records, options) ⇒ Operation

    Insert many records, using the keys of the first as the column template

    ParamTypeDescription
    tablestringThe target table
    recordsfunctionA function that takes state and returns an array of records
    optionsobjectOptional options argument

    Example

    insertMany(table, records, { setNull: false, writeSql: true, logValues: false })

    insertTable

    insertTable(tableName, columns, options) ⇒ Operation

    Create a table in database when given an array of columns and a table_name.

    ParamTypeDescription
    tableNamestringThe name of the table to create
    columnsarrayAn array of form columns
    optionsobjectOptional options argument

    Example

    insertTable('table_name', state => state.data.map(
    column => ({
    name: column.name,
    type: column.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    modifyTable

    modifyTable(tableName, columns, options) ⇒ Operation

    Alter an existing table in the database.

    ParamTypeDescription
    tableNamestringThe name of the table to alter
    columnsarrayAn array of form columns
    optionsobjectOptional options argument

    Example

    modifyTable('table_name', state => state.data.map(
    newColumn => ({
    name: newColumn.name,
    type: newColumn.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    sql

    sql(params) ⇒ Operation

    Execute an SQL statement

    ParamTypeDescription
    paramsobjectPayload data for the message

    Example

    sql({ query, options })

    upsert

    upsert(table, uuid, record, options) ⇒ Operation

    Insert or update a record using SQL MERGE

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object
    optionsobjectOptional options argument

    Example

    upsert(table, uuid, record, { setNull: "'undefined'", logValues: false})
    upsert(table, [uuid1, uuid2], record, { setNull: "'undefined'", logValues: false})

    upsertIf

    upsertIf(logical, table, uuid, record, options) ⇒ Operation

    Insert or update a record based on a logical condition using ON CONFLICT UPDATE

    ParamTypeDescription
    logicalstringa data to check existing value for.
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object or function
    optionsobjectOptional options argument

    Example

    upsertIf(
    dataValue('name'),
    'users', // the DB table
    'uuid', // a DB column with a unique constraint
    { name: 'Elodie', id: 7 },
    { writeSql:true, execute: true, logValues: false }
    )

    upsertMany

    upsertMany(table, uuid, records, options) ⇒ Operation

    Insert or update multiple records using ON CONFLICT UPDATE and excluded

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordsfunctionA function that takes state and returns an array of records
    optionsobjectOptional options argument

    Example

    upsertMany(
    'users', 'email', records, { logValues: false }
    )
    upsertMany(
    'users', ['email', 'phone'], records, { logValues: false }
    )

    - +
    Skip to main content

    mssql@5.0.4

    describeTable(tableName, options)
    findValue(filter)
    insert(table, record, options)
    insertMany(table, records, options)
    insertTable(tableName, columns, options)
    modifyTable(tableName, columns, options)
    sql(params)
    upsert(table, uuid, record, options)
    upsertIf(logical, table, uuid, record, options)
    upsertMany(table, uuid, records, options)

    This adaptor exports the following from common:

    alterState()
    combine()
    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    describeTable

    describeTable(tableName, options) ⇒ Operation

    List the columns of a table in a database.

    ParamTypeDescription
    tableNamestringThe name of the table to describe
    optionsobjectOptional options argument

    Example

    describeTable('clinic_visits')

    findValue

    findValue(filter) ⇒ Operation

    Fetch a uuid key given a condition

    ParamTypeDescription
    filterobjectA filter object with the lookup table, a uuid and the condition

    Example

    findValue({
    uuid: 'id',
    relation: 'users',
    where: { first_name: 'Mama%', last_name: 'Cisse'},
    operator: { first_name: 'like', last_name: '='}
    })

    insert

    insert(table, record, options) ⇒ Operation

    Insert a record

    ParamTypeDescription
    tablestringThe target table
    recordobjectPayload data for the record as a JS object
    optionsobjectOptional options argument

    Example

    insert(table, record, {setNull: ["'undefined'", "''"], logValues: false})

    insertMany

    insertMany(table, records, options) ⇒ Operation

    Insert many records, using the keys of the first as the column template

    ParamTypeDescription
    tablestringThe target table
    recordsfunctionA function that takes state and returns an array of records
    optionsobjectOptional options argument

    Example

    insertMany(table, records, { setNull: false, writeSql: true, logValues: false })

    insertTable

    insertTable(tableName, columns, options) ⇒ Operation

    Create a table in database when given an array of columns and a table_name.

    ParamTypeDescription
    tableNamestringThe name of the table to create
    columnsarrayAn array of form columns
    optionsobjectOptional options argument

    Example

    insertTable('table_name', state => state.data.map(
    column => ({
    name: column.name,
    type: column.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    modifyTable

    modifyTable(tableName, columns, options) ⇒ Operation

    Alter an existing table in the database.

    ParamTypeDescription
    tableNamestringThe name of the table to alter
    columnsarrayAn array of form columns
    optionsobjectOptional options argument

    Example

    modifyTable('table_name', state => state.data.map(
    newColumn => ({
    name: newColumn.name,
    type: newColumn.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    sql

    sql(params) ⇒ Operation

    Execute an SQL statement

    ParamTypeDescription
    paramsobjectPayload data for the message

    Example

    sql({ query, options })

    upsert

    upsert(table, uuid, record, options) ⇒ Operation

    Insert or update a record using SQL MERGE

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object
    optionsobjectOptional options argument

    Example

    upsert(table, uuid, record, { setNull: "'undefined'", logValues: false})
    upsert(table, [uuid1, uuid2], record, { setNull: "'undefined'", logValues: false})

    upsertIf

    upsertIf(logical, table, uuid, record, options) ⇒ Operation

    Insert or update a record based on a logical condition using ON CONFLICT UPDATE

    ParamTypeDescription
    logicalstringa data to check existing value for.
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object or function
    optionsobjectOptional options argument

    Example

    upsertIf(
    dataValue('name'),
    'users', // the DB table
    'uuid', // a DB column with a unique constraint
    { name: 'Elodie', id: 7 },
    { writeSql:true, execute: true, logValues: false }
    )

    upsertMany

    upsertMany(table, uuid, records, options) ⇒ Operation

    Insert or update multiple records using ON CONFLICT UPDATE and excluded

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordsfunctionA function that takes state and returns an array of records
    optionsobjectOptional options argument

    Example

    upsertMany(
    'users', 'email', records, { logValues: false }
    )
    upsertMany(
    'users', ['email', 'phone'], records, { logValues: false }
    )

    + \ No newline at end of file diff --git a/adaptors/packages/mssql-readme.html b/adaptors/packages/mssql-readme.html index 6f0d51f4d3f..1aebec6c7f2 100644 --- a/adaptors/packages/mssql-readme.html +++ b/adaptors/packages/mssql-readme.html @@ -21,7 +21,7 @@ - + @@ -43,7 +43,7 @@ columns. The key identity can be use for a column to auto-generate a value.

    insertTable('users', state =>
    state.data.map(column => ({
    name: column.name,
    type: column.type,
    required: true, // optional
    unique: false, // optional - set to true for unique constraint
    }))
    );

    Alter a table in the database

    This function allows to add new columns to a table. Beware of the fact that you cannot add new columns with names that already exist in the table.

    modifyTable(
    'users',
    state =>
    state.data.map(newColumn => ({
    name: newColumn.name,
    type: newColumn.type,
    required: true, // optional
    unique: false, // optional - set to true for unique constraint
    })),
    { writeSql: false, execute: true }
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mysql-changelog.html b/adaptors/packages/mysql-changelog.html index 4f054ff3e5f..358b692c79a 100644 --- a/adaptors/packages/mysql-changelog.html +++ b/adaptors/packages/mysql-changelog.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.3.5

    Patch Changes

    1.3.4

    Patch Changes

    1.3.3

    Patch Changes

    1.3.2

    Patch Changes

    1.3.1

    Patch Changes

    1.3.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/mysql-configuration-schema.html b/adaptors/packages/mysql-configuration-schema.html index 8e8eec76dc1..1e54b08b8c3 100644 --- a/adaptors/packages/mysql-configuration-schema.html +++ b/adaptors/packages/mysql-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "some-host-url.compute-1.amazonaws.com",
    "database": "demo-db",
    "user": "admin-demo",
    "password": "@super(!)Secretpass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host URL",
    "type": "string",
    "description": "The database instance host URL",
    "format": "string",
    "minLength": 1,
    "examples": [
    "some-host-url.compute-1.amazonaws.com"
    ]
    },
    "port": {
    "title": "Port",
    "type": "integer",
    "default": 3306,
    "description": "Database instance port",
    "minLength": 1,
    "examples": [
    3306
    ]
    },
    "database": {
    "title": "Database",
    "type": "string",
    "description": "The database name",
    "minLength": 1,
    "examples": [
    "demo-db"
    ]
    },
    "user": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in the database",
    "minLength": 1,
    "examples": [
    "admin-demo"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in the database",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "database",
    "user",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mysql-docs.html b/adaptors/packages/mysql-docs.html index 528407f9e82..5caf17f1965 100644 --- a/adaptors/packages/mysql-docs.html +++ b/adaptors/packages/mysql-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    mysql@2.0.2

    insert(table, fields)
    query(options)
    sqlString(queryString)
    upsert(table, fields)
    upsertMany(table, data)

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    combine()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    insert

    insert(table, fields) ⇒ Operation

    Insert a record

    ParamTypeDescription
    tablestringThe target table
    fieldsobjectA fields object

    Example

    execute(
    insert('table', fields(
    field('name', dataValue('name'))
    ))
    )(state)

    query

    query(options) ⇒ Operation

    Execute a SQL statement

    ParamTypeDescription
    optionsobjectPayload data for the message

    Example

    execute(
    query({ sql: 'select * from users;' })
    )(state)

    sqlString

    sqlString(queryString) ⇒ Operation

    Execute a SQL statement

    ParamTypeDescription
    queryStringStringA query string (or function which takes state and returns a string)

    Example

    execute(
    sqlString(state => "select * from items;")
    )(state)

    upsert

    upsert(table, fields) ⇒ Operation

    Insert or Update a record if matched

    ParamTypeDescription
    tablestringThe target table
    fieldsobjectA fields object

    Example

    execute(
    upsert('table', fields(
    field('name', dataValue('name'))
    ))
    )(state)

    upsertMany

    upsertMany(table, data) ⇒ Operation

    Insert or update multiple records using ON DUPLICATE KEY

    ParamTypeDescription
    tablestringThe target table
    dataarrayAn array of objects or a function that returns an array

    Example

    upsertMany(
    'users', // the DB table
    [
    { name: 'one', email: 'one@openfn.org' },
    { name: 'two', email: 'two@openfn.org' },
    ]
    )

    - + \ No newline at end of file diff --git a/adaptors/packages/mysql-readme.html b/adaptors/packages/mysql-readme.html index 168fcdc4576..2ba4bd60179 100644 --- a/adaptors/packages/mysql-readme.html +++ b/adaptors/packages/mysql-readme.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ returns a string.

    sqlString(state => {
    return (
    `INSERT INTO untitled_table (name, the_geom) VALUES ('` +
    state.data.version +
    `', ` +
    dataValue('form.Choix_tache')(state) +
    `)`
    );
    });

    Insert a single record

    This function is used to insert a single record in a MySQL database.

    insert(
    'some_table',
    fields(
    field('firstname', dataValue('form.patient_firstname')),
    field('lastname', dataValue('form.patient_lastname'))
    )
    );

    Insert or update a single record

    This function is used to insert a single record in a MySQL database or update it if there is a match.

    upsert(
    'some_table',
    fields(
    field('firstname', dataValue('form.patient_firstname')),
    field('lastname', dataValue('form.patient_lastname'))
    )
    );

    Upsert many records

    This function allows the upsert of a set of records inside a table all at once.

    upsertMany(
    'users', // the DB table
    [
    { name: 'one', email: 'one@openfn.org' },
    { name: 'two', email: 'two@openfn.org' },
    ]
    );

    or

    upsertMany('users', state =>
    state.data.users.map(user => {
    name: user['name'],
    email: user['email']
    })
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/nexmo-changelog.html b/adaptors/packages/nexmo-changelog.html index 778fee0c8c9..df7023fbf25 100644 --- a/adaptors/packages/nexmo-changelog.html +++ b/adaptors/packages/nexmo-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/nexmo-configuration-schema.html b/adaptors/packages/nexmo-configuration-schema.html index ebfd688d7b8..474f675eab2 100644 --- a/adaptors/packages/nexmo-configuration-schema.html +++ b/adaptors/packages/nexmo-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiKey": "mYaP1K3y",
    "apiSecret": "supersecret"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "Your Nexmo API Key",
    "minLength": 1,
    "examples": [
    "mYaP1K3y"
    ]
    },
    "apiSecret": {
    "title": "API Secret",
    "type": "string",
    "description": "Your Nexmo API Secret key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "supersecret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiKey",
    "apiSecret"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/nexmo-docs.html b/adaptors/packages/nexmo-docs.html index 2b6df1ba468..69900b92ac1 100644 --- a/adaptors/packages/nexmo-docs.html +++ b/adaptors/packages/nexmo-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/nexmo-readme.html b/adaptors/packages/nexmo-readme.html index 0d5e57ac2da..afb91118bed 100644 --- a/adaptors/packages/nexmo-readme.html +++ b/adaptors/packages/nexmo-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    sendSMS

    sample expression

    sendSMS('OpenFn', '0123456789', 'HelloWorld!');

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/ocl-changelog.html b/adaptors/packages/ocl-changelog.html index 3c3b99b3149..8d7d274c983 100644 --- a/adaptors/packages/ocl-changelog.html +++ b/adaptors/packages/ocl-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.0

    Minor Changes

    0.2.6

    Patch Changes

    0.2.5

    Patch Changes

    0.2.4

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/ocl-configuration-schema.html b/adaptors/packages/ocl-configuration-schema.html index c393472f04c..c65358209f5 100644 --- a/adaptors/packages/ocl-configuration-schema.html +++ b/adaptors/packages/ocl-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "hostUrl": "https://api.openconceptlab.org/",
    "username": "usernmame",
    "password": "supersecretpassword"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "hostUrl": {
    "title": "Host URL",
    "type": "string",
    "description": "The OCL API URL",
    "default": "https://api.openconceptlab.org/",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://api.openconceptlab.org/"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to OCL",
    "minLength": 1,
    "examples": [
    "usernmame"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to OCL",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "supersecretpassword"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "hostUrl",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/ocl-docs.html b/adaptors/packages/ocl-docs.html index 0e2d531519f..55e7b9006f8 100644 --- a/adaptors/packages/ocl-docs.html +++ b/adaptors/packages/ocl-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    ocl@1.2.5

    get(path, query, callback)
    getMappings(ownerId, repositoryId, [options], callback)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, query, callback) ⇒ Operation

    Get a resource in OCL

    ParamTypeDescription
    pathstringPath to resource
    queryobjectA query object that will limit what resources are retrieved when converted into request params.
    callbackfunction(Optional) callback function

    Example

    get(
    "orgs/MSFOCG/collections/lime-demo/HEAD/mappings",
    {
    page: 1,
    exact_match: "off",
    limit: 200,
    verbose: false,
    sortDesc: "_score",
    },
    (state) => {
    // Add state oclMappings
    const oclMappings = state.data;
    return { ...state, data: {}, references: [], response: {}, oclMappings };
    }
    );

    getMappings

    getMappings(ownerId, repositoryId, [options], callback) ⇒ Operation

    Get a source repository in OCL

    ParamTypeDescription
    ownerIdstringAn OCL user or organization
    repositoryIdstringAn OCL collection id or source id
    [options]ObjectOptional. options which can be passed to See more on OCL swagger docs
    callbackfunction(Optional) callback function

    Example

    getMappings(
    "MSFOCG",
    "lime-demo",
    { page: 1, exact_match: "off", verbose: false },
    (state) => {
    // Add state oclMappings
    const oclMappings = state.data;
    return { ...state, data: {}, references: [], response: {}, oclMappings };
    }
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/ocl-readme.html b/adaptors/packages/ocl-readme.html index 52c6b7d5992..c7ec221d493 100644 --- a/adaptors/packages/ocl-readme.html +++ b/adaptors/packages/ocl-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Mapping source concepts to destination API

    Recieve form data from source application and convert data element keys to destination application.

    map(  "data": {
    "a": 1,
    "b": 2},
    {users:"haftamuk", sources: "eCHIS-CODES", concepts: "fp_new_at_10_to_14" }
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/odk-changelog.html b/adaptors/packages/odk-changelog.html index f9e9fdcb32a..2dcef1e1d09 100644 --- a/adaptors/packages/odk-changelog.html +++ b/adaptors/packages/odk-changelog.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    Changelog for the odk adaptor

    @openfn/language-odk

    3.0.4

    Patch Changes

    3.0.3

    Patch Changes

    3.0.2

    Patch Changes

    • f51c5d0: Enforce that absolute urls must not be passed to HTTP functions
    • Updated dependencies [4fe527c]

    3.0.1

    Patch Changes

    3.0.0

    Major Changes

    • 0b81f06: - getSubmissions() now returns submission data (not metadata)
      • getSubmissions() arguments can be references (functions)
      • getSubmissions() supports query parameters
      • HTTP helper APIs have been slightly streamlined and fixed
      • Documentation overhaul
      • All callback functions have been removed (use an fn() block instead)

    2.0.0

    Major Changes

    • 9234f83: - configuration-schema: rename username to email
      • Improve logging when authentication fails
      • Improve error reporting when requests fail

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.0.1

    Patch Changes

    1.0.0

    Initial release for odk adaptor with get, post, getForms and getSubmissions

    - + \ No newline at end of file diff --git a/adaptors/packages/odk-configuration-schema.html b/adaptors/packages/odk-configuration-schema.html index fb42f2c7fdb..d7daf66ad9b 100644 --- a/adaptors/packages/odk-configuration-schema.html +++ b/adaptors/packages/odk-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "email": "test@openfn.org",
    "baseUrl": "https://sandbox.getodk.cloud/"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "ODK base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://sandbox.getodk.cloud/"
    ]
    },
    "email": {
    "title": "Email",
    "type": "string",
    "description": "Email",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your ODK access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "the-long-access-token-from-your-auth"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "email",
    "baseUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/odk-docs.html b/adaptors/packages/odk-docs.html index c18d0ad4d2b..52de839a201 100644 --- a/adaptors/packages/odk-docs.html +++ b/adaptors/packages/odk-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    odk@3.0.4

    get(path, options)
    getForms(projectId)
    getSubmissions(projectId, xmlFormId, query)
    post(path, body, options)
    request(method, path, body, options)

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, options) ⇒ Operation

    Make a GET request against the ODK server.

    ParamTypeDescription
    pathstringPath to resource
    optionsRequestOptionsOptions to configure the HTTP request

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Get a list of available projects

    get("v1/projects");

    Example: Get projects with query parameters

    get("v1/projects", {
    query: { datasets: true }
    });

    getForms

    getForms(projectId) ⇒ Operation

    Fetch all forms for a project.

    ParamTypeDescription
    projectIdnumberId of the project

    This operation writes the following keys to state:

    State KeyDescription
    dataarray of form data objects
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Fetch all forms for project with id 22

    getForms(22);

    getSubmissions

    getSubmissions(projectId, xmlFormId, query) ⇒ Operation

    Fetch all submissions to a given form.

    ParamTypeDescription
    projectIdnumberId of the project the form belongs to
    xmlFormIdstringId of the form to fetch submissions for
    querystringQuery parameters to append to the request, see https://docs.getodk.org/central-api-odata-endpoints/#data-document

    This operation writes the following keys to state:

    State KeyDescription
    dataarray of form submission objects
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Get all submissions to a form called 'patient-follow-up'

    getSubmissions(22, 'patient-follow-up');

    Example: Filter submissions since a given date

    getSubmissions(22, 'patient-follow-up', { $filter: "$root/Submissions/__system/submissionDate gt 2020-01-31T23:59:59.999Z" });

    post

    post(path, body, options) ⇒ Operation

    Make a POST request against the ODK server.

    ParamTypeDescription
    pathstringPath to resource
    bodyobjectObject which will be attached to the POST body
    optionsRequestOptionsOptions to configure the HTTP request

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Create a new project

    post('v1/projects', { name: 'Project Name' });

    request

    request(method, path, body, options) ⇒ Operation

    Make a general HTTP request against the ODK server.

    ParamTypeDescription
    methodstringHTTP method to use
    pathstringPath to resource
    bodyobjectObject which will be attached to the body
    optionsRequestOptionsOptional request params

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Make a POST request to create a new project

    request("POST", 'v1/projects', { name: 'Project Name' });

    Interfaces

    RequestOptions

    Options provided to the HTTP request

    Properties

    NameTypeDescription
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.
    parseAsstringParse the response body as json, text or stream. By default will use the response headers.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.

    - + \ No newline at end of file diff --git a/adaptors/packages/odk-readme.html b/adaptors/packages/odk-readme.html index d80e7d346b6..9fba7003b0f 100644 --- a/adaptors/packages/odk-readme.html +++ b/adaptors/packages/odk-readme.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the post function

    post('v1/projects', { name: 'Project Name' });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/openfn-changelog.html b/adaptors/packages/openfn-changelog.html index 8165e3df5d3..7463e54a768 100644 --- a/adaptors/packages/openfn-changelog.html +++ b/adaptors/packages/openfn-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.2.6

    Patch Changes

    1.2.5

    Patch Changes

    1.2.4

    Patch Changes

    1.2.3

    Patch Changes

    1.2.2

    Patch Changes

    1.2.1

    Patch Changes

    1.2.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/openfn-configuration-schema.html b/adaptors/packages/openfn-configuration-schema.html index b10e9a6c606..66fd4a3c1d1 100644 --- a/adaptors/packages/openfn-configuration-schema.html +++ b/adaptors/packages/openfn-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "https://www.openfn.org",
    "username": "test@openfn.org",
    "password": "@super(!)Secretpass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host",
    "type": "string",
    "description": "The OpenFn host url",
    "format": "uri",
    "default": "https://www.openfn.org",
    "minLength": 1,
    "examples": [
    "https://www.openfn.org"
    ]
    },
    "projectId": {
    "title": "Project ID",
    "type": "string",
    "description": "Your OpenFn project ID",
    "minLength": 1,
    "examples": [
    "some-id"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to OpenFn",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to OpenFn",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openfn-docs.html b/adaptors/packages/openfn-docs.html index a4a1dde5701..d1d287ae139 100644 --- a/adaptors/packages/openfn-docs.html +++ b/adaptors/packages/openfn-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/openfn-readme.html b/adaptors/packages/openfn-readme.html index 0dae6516123..83e1fe77ac3 100644 --- a/adaptors/packages/openfn-readme.html +++ b/adaptors/packages/openfn-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/openhim-changelog.html b/adaptors/packages/openhim-changelog.html index 41ad6d10b05..c865affcb37 100644 --- a/adaptors/packages/openhim-changelog.html +++ b/adaptors/packages/openhim-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.1.4

    Patch Changes

    0.1.3

    Patch Changes

    0.1.2

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/openhim-configuration-schema.html b/adaptors/packages/openhim-configuration-schema.html index 9dc8d63a43d..67a22b9fbb0 100644 --- a/adaptors/packages/openhim-configuration-schema.html +++ b/adaptors/packages/openhim-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiUrl": "http://openhim.com/api"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiUrl": {
    "title": "API URL",
    "type": "string",
    "description": "The OpenHIM API url",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "http://openhim.com/api"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to OpenHIM",
    "minLength": 1,
    "examples": [
    "admin@openhim.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to OpenHIM",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openhim-docs.html b/adaptors/packages/openhim-docs.html index b8dd8641827..2a2b8a645dd 100644 --- a/adaptors/packages/openhim-docs.html +++ b/adaptors/packages/openhim-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/openhim-readme.html b/adaptors/packages/openhim-readme.html index 616e67dcb8b..ac76d205dbe 100644 --- a/adaptors/packages/openhim-readme.html +++ b/adaptors/packages/openhim-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/openimis-changelog.html b/adaptors/packages/openimis-changelog.html index f917d74dd89..03fae7c1d5b 100644 --- a/adaptors/packages/openimis-changelog.html +++ b/adaptors/packages/openimis-changelog.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Changelog for the openimis adaptor

    @openfn/language-openimis

    2.0.2

    Patch Changes

    2.0.1

    Patch Changes

    2.0.0

    Major Changes

    • Export new common http helpers (http namespace)

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.0.3

    Patch Changes

    1.0.2

    Patch Changes

    1.0.1

    Patch Changes

    • 6c588212: Fix configuration-schema and add baseUrl in required

    1.0.0

    Initial release.

    Includes a getFHIR() function and authorisation.

    - + \ No newline at end of file diff --git a/adaptors/packages/openimis-configuration-schema.html b/adaptors/packages/openimis-configuration-schema.html index 99ad118c9c3..20c7057da77 100644 --- a/adaptors/packages/openimis-configuration-schema.html +++ b/adaptors/packages/openimis-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://demo.openimis.org",
    "username": "test@openfn.org",
    "password": "@some(!)Str0ngp4ss0w0rd"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://demo.openimis.org"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openimis-docs.html b/adaptors/packages/openimis-docs.html index 445959861d7..d9d72e0e44c 100644 --- a/adaptors/packages/openimis-docs.html +++ b/adaptors/packages/openimis-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/openimis-readme.html b/adaptors/packages/openimis-readme.html index 02aceced459..473a84fc4bb 100644 --- a/adaptors/packages/openimis-readme.html +++ b/adaptors/packages/openimis-readme.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ configuration-schema definition.

    sample expression using operation

    post({
    "url": "api/v1/forms/data/wide/json/formId",
    "body": {"a":1}
    "headers": {}
    })

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/openlmis-changelog.html b/adaptors/packages/openlmis-changelog.html index 6599fe4bad7..863e4c2435a 100644 --- a/adaptors/packages/openlmis-changelog.html +++ b/adaptors/packages/openlmis-changelog.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Changelog for the openlmis adaptor

    @openfn/language-openlmis

    1.0.4

    Patch Changes

    1.0.3

    Patch Changes

    1.0.2

    Patch Changes

    • 940996b: Use common helper code to handle invalid absolute URLs
    • Updated dependencies [4fe527c]

    1.0.1

    Patch Changes

    1.0.0

    Add generic helpers. request(), post(), get() and put()

    - + \ No newline at end of file diff --git a/adaptors/packages/openlmis-configuration-schema.html b/adaptors/packages/openlmis-configuration-schema.html index 3d948d57b9d..60d9a1dc84c 100644 --- a/adaptors/packages/openlmis-configuration-schema.html +++ b/adaptors/packages/openlmis-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "administrator",
    "baseUrl": "https://test.openlmis.org"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (https://test.openlmis.org)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://test.openlmis.org"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "administrator"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your OpenLMIS API access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "4739f6c9-3b81-4176-98a1-bf001c8416ea"
    ]
    },
    "clientId": {
    "title": "Client ID",
    "type": "string",
    "description": "Your user based client id",
    "writeOnly": true,
    "minLength": 1,
    "default": "user-client"
    },
    "clientSecret": {
    "title": "Client Secret Token",
    "type": "string",
    "description": "Your user based client secret",
    "writeOnly": true,
    "minLength": 1,
    "default": "changeme"
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "username",
    "baseUrl",
    "clientId",
    "clientSecret"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openlmis-docs.html b/adaptors/packages/openlmis-docs.html index 6f647bb7523..9c294cbadc0 100644 --- a/adaptors/packages/openlmis-docs.html +++ b/adaptors/packages/openlmis-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    openlmis@1.0.4

    get(path, options, [callback])
    post(path, body, [callback])
    put(path, body, [callback])
    request(method, path, body, options, [callback])

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, options, [callback]) ⇒ Operation

    Send a GET request to OpenLMIS

    ParamTypeDescription
    pathstringPath to resource (relative to the base URL defined in configuration)
    optionsRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Get all supplyLines

    get("/supplyLines");

    post

    post(path, body, [callback]) ⇒ Operation

    Send a POST request to OpenLMIS

    ParamTypeDescription
    pathstringPath to resource (relative to the base URL defined in configuration)
    bodyobjectObject which will be attached to the POST body
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Creates new program

    post("/programs", { name: "Bukayo", code: "abc" });

    put

    put(path, body, [callback]) ⇒ Operation

    Send a PUT request to OpenLMIS

    ParamTypeDescription
    pathstringPath to resource (relative to the base URL defined in configuration)
    bodyobjectObject which will be attached to the PUT body
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Update existing program

    put("/programs/123", { name: "DigTalent", code: "123" });

    request

    request(method, path, body, options, [callback]) ⇒ Operation

    Send a HTTP request to OpenLMIS

    ParamTypeDescription
    methodstringHTTP method to use
    pathstringPath to resource (relative to the base URL defined in configuration)
    bodyobjectObject which will be attached to the POST body
    optionsRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    request("POST", "/programs", { name: "WSH", code: "123" });

    Interfaces

    RequestOptions

    Options provided to the HTTP request

    Properties

    NameTypeDescription
    bodyobjectbody data to append to the request.
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.

    - + \ No newline at end of file diff --git a/adaptors/packages/openlmis-readme.html b/adaptors/packages/openlmis-readme.html index 0a5561e64a1..1c4a8fdcfd7 100644 --- a/adaptors/packages/openlmis-readme.html +++ b/adaptors/packages/openlmis-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/openmrs-changelog.html b/adaptors/packages/openmrs-changelog.html index 76038d690e7..3f87bed0991 100644 --- a/adaptors/packages/openmrs-changelog.html +++ b/adaptors/packages/openmrs-changelog.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    1.0.1

    Patch Changes

    1.0.0

    Major Changes

    0.10.5

    Patch Changes

    0.10.4

    Patch Changes

    0.10.3

    Patch Changes

    0.10.2

    Patch Changes

    0.10.1

    Patch Changes

    0.10.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/openmrs-configuration-schema.html b/adaptors/packages/openmrs-configuration-schema.html index 7f3494e0723..5d353d6d6f0 100644 --- a/adaptors/packages/openmrs-configuration-schema.html +++ b/adaptors/packages/openmrs-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "instanceUrl": "http://openmrs.com/instance/url"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "instanceUrl": {
    "title": "Instance URL",
    "type": "string",
    "description": "The OpenMRS host url",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "http://openmrs.com/instance/url"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to OpenMRS",
    "minLength": 1,
    "examples": [
    "admin@openmrs.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to OpenMRS",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "instanceUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openmrs-docs.html b/adaptors/packages/openmrs-docs.html index fa3aab50d8d..1b658445b70 100644 --- a/adaptors/packages/openmrs-docs.html +++ b/adaptors/packages/openmrs-docs.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    openmrs@4.0.1

    create(resourceType, data, [callback])
    get(path, query, [callback])
    getEncounter(uuid, [callback])
    getEncounters(query, [callback])
    getPatient(uuid, [callback])
    post(path, data, [callback])
    searchPatient(query, [callback])
    searchPerson(query, [callback])
    update(resourceType, path, data, [callback])
    upsert(resourceType, query, data, [callback])

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    create

    create(resourceType, data, [callback]) ⇒ Operation

    Create a record

    ParamTypeDescription
    resourceTypestringType of resource to create. E.g. person, patient, encounter, ...
    dataOpenMRSDataObject which defines data that will be used to create a given instance of resource. To create a single instance of a resource, data must be a javascript object, and to create multiple instances of a resources, data must be an array of javascript objects.
    [callback]functionOptional callback to handle the response

    Example: Create a person

    create("person", {
    names: [
    {
    givenName: "Mohit",
    familyName: "Kumar",
    },
    ],
    gender: "M",
    birthdate: "1997-09-02",
    addresses: [
    {
    address1: "30, Vivekananda Layout, Munnekolal,Marathahalli",
    cityVillage: "Bengaluru",
    country: "India",
    postalCode: "560037",
    },
    ],
    });

    Example: Create an encounter

    create("encounter", {
    encounterDatetime: '2023-05-25T06:08:25.000+0000',
    patient: '1fdaa696-e759-4a7d-a066-f1ae557c151b',
    encounterType: 'dd528487-82a5-4082-9c72-ed246bd49591',
    location: 'ba685651-ed3b-4e63-9b35-78893060758a',
    encounterProviders: [],
    visit: {
    patient: '1fdaa696-e759-4a7d-a066-f1ae557c151b',
    visitType: '7b0f5697-27e3-40c4-8bae-f4049abfb4ed',
    startDatetime: '2023-05-25T06:08:25.000+0000',
    stopDatetime: '2023-05-25T06:09:25.000+0000',
    },
    })

    Example: Create a patient

    create("patient", {
    identifiers: [
    {
    identifier: '4023287',
    identifierType: '05a29f94-c0ed-11e2-94be-8c13b969e334',
    preferred: true,
    },
    ],
    person: {
    gender: 'M',
    age: 42,
    birthdate: '1970-01-01T00:00:00.000+0100',
    birthdateEstimated: false,
    names: [
    {
    givenName: 'Doe',
    familyName: 'John',
    },
    ],
    },
    })

    get

    get(path, query, [callback]) ⇒ Operation

    Make a get request to any OpenMRS endpoint

    ParamTypeDescription
    pathstringPath to resource
    queryobjectparameters for the request
    [callback]functionOptional callback to handle the response

    Example

    get("patient", {
    q: "Patient",
    limit: 1,
    });

    getEncounter

    getEncounter(uuid, [callback]) ⇒ Operation

    Gets encounter matching a uuid

    ParamTypeDescription
    uuidobjectA uuid for the encounter
    [callback]functionOptional callback to handle the response

    Example

    getEncounter("123")

    getEncounters

    getEncounters(query, [callback]) ⇒ Operation

    Gets encounters matching params

    ParamTypeDescription
    queryobjectObject for the patient
    [callback]functionOptional callback to handle the response

    Example

    getEncounters({ patient: "123", fromdate: "2023-05-18" })

    getPatient

    getPatient(uuid, [callback]) ⇒ Operation

    Gets patient matching a uuid

    ParamTypeDescription
    uuidstringA uuid for the patient
    [callback]functionOptional callback to handle the response

    Example: Get a patient by uuid

    getPatient('681f8785-c9ca-4dc8-a091-7b869316ff93')

    post

    post(path, data, [callback]) ⇒ Operation

    Make a post request to any OpenMRS endpoint

    ParamTypeDescription
    pathstringPath to resource
    dataobjectObject which defines data that will be used to create a given instance of resource
    [callback]functionOptional callback to handle the response

    Example

    post(
    "idgen/identifiersource/8549f706-7e85-4c1d-9424-217d50a2988b/identifier",
    {}
    );

    searchPatient

    searchPatient(query, [callback]) ⇒ Operation

    Fetch all non-retired patients that match any specified parameters

    ParamTypeDescription
    queryobjectObject with query for the patient.
    [callback]functionOptional callback to handle the response

    Example

    searchPatient({ q: "Sarah"})

    searchPerson

    searchPerson(query, [callback]) ⇒ Operation

    Fetch all non-retired persons that match any specified parameters

    ParamTypeDescription
    queryobjectobject with query for the person
    [callback]functionOptional callback to handle the response

    Example

    searchPerson({ q: "Sarah" })

    update

    update(resourceType, path, data, [callback]) ⇒ Operation

    Update data. A generic helper function to update a resource object of any type. Updating an object requires to send all required fields or the full body

    ParamTypeDescription
    resourceTypestringThe type of resource to be updated. E.g. person, patient, etc.
    pathstringThe id or path to the object to be updated. E.g. e739808f-f166-42ae-aaf3-8b3e8fa13fda or e739808f-f166-42ae-aaf3-8b3e8fa13fda/{collection-name}/{object-id}
    dataObjectData to update. It requires to send all required fields or the full body. If you want partial updates, use patch operation.
    [callback]functionOptional callback to handle the response

    Example: a person

    update("person", '3cad37ad-984d-4c65-a019-3eb120c9c373',{"gender":"M","birthdate":"1997-01-13"})

    upsert

    upsert(resourceType, query, data, [callback]) ⇒ Operation

    Upsert a record. A generic helper function used to atomically either insert a row, or on the basis of the row already existing, UPDATE that existing row instead.

    Throws:

    • RangeError - Throws range error
    ParamTypeDescription
    resourceTypestringThe type of a resource to upsert. E.g. trackedEntityInstances
    queryObjectA query object that allows to uniquely identify the resource to update. If no matches found, then the resource will be created.
    dataObjectThe data to use for update or create depending on the result of the query.
    [callback]functionOptional callback to handle the response

    Example: For an existing patient using upsert

    upsert('patient', { q: '10007JJ' }, { person: { age: 50 } });

    Example: For non existing patient creating a patient record using upsert

    upsert(
    "patient",
    { q: "1000EHE" },
    {
    identifiers: [
    {
    identifier: "1000EHE",
    identifierType: "05a29f94-c0ed-11e2-94be-8c13b969e334",
    location: "44c3efb0-2583-4c80-a79e-1f756a03c0a1",
    preferred: true,
    },
    ],
    person: {
    gender: "M",
    age: 42,
    },
    }
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/openmrs-readme.html b/adaptors/packages/openmrs-readme.html index 055c5b5408f..6e36412eae4 100644 --- a/adaptors/packages/openmrs-readme.html +++ b/adaptors/packages/openmrs-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Get a patient by some criteria

    // getPatient({ uuid: '516af9aa-0402-4e11-ad79-e394fdec0c91' });
    // getPatient({ uuid: dataValue('patientId')(state) });
    getPatient({
    uuid: state => state.data[0].uuid,
    });

    Example of searching for patients based on their EMR Id

    getPatients(
    {
    identifier: state => state.data.emrId,
    v: 'full',
    },
    {
    exactlyOne: true,
    }
    );

    Create an Encounter

    createEncounter({
    encounterDatetime: dataValue('visit_date'), //dynamically fill with source app data
    patient: dataValue('uuid'),
    encounterType: dataValue('visit_type'),
    location: dataValue('location.uuid'),
    encounterProviders: [
    {
    provider: dataValue('provider_name'),
    encounterRole: '240b26f9-dd88-4172-823d-4a8bfeb7841f', //hardcoded value
    },
    ],
    });

    Make a request to any OpenMRS endpoint

    get('/ws/rest/v1/patient', { q: 'mohammed' }, state => {
    console.log(JSON.stringify(state, null, 2));
    return state;
    });

    Create new patient

    createPatient(
    fields(
    field('gender', 'M'),
    field('names', function (state) {
    return [
    {
    patient_id: dataValue('form.patientId')(state),
    creator: dataValue('form.user')(state),
    },
    ];
    })
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/openspp-changelog.html b/adaptors/packages/openspp-changelog.html index b6c96332ce1..c142a1c9965 100644 --- a/adaptors/packages/openspp-changelog.html +++ b/adaptors/packages/openspp-changelog.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Changelog for the openspp adaptor

    @openfn/language-openspp

    2.0.2

    Patch Changes

    2.0.1

    Patch Changes

    2.0.0

    Major Changes

    • Export new common http helpers (http namespace)

    1.3.1

    Patch Changes

    1.3.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.2.1

    Patch Changes

    1.2.0

    Changes

    • 05defd2: add new functions, correcting docstring and add more examples
      • correcting docstring input parameters type
      • changing getServicePoint() from get by name into get by unique id
      • add more examples in docstring
      • getArea(): get existing area by id
      • searchArea(): search existing area by domain
      • searchServicePoint(): search existing service point by domain

    1.1.1

    Patch Changes

    • 48b4e97: update spp date time now string format

    1.1.0

    • Create OpenSPP adaptor with these functions:
      • getGroup(): get existing group information
      • getIndividual(): get existing individual information
      • searchGroup(): search existing group by domain
      • searchIndividual(): search existing individual by domain
      • getGroupMembers(): get members from group
      • getServicePoint(): get service points by name
      • getPrograms(): get single program
      • getPrograms(): get program list
      • getEnrolledPrograms(): get list of enrolled program for each beneficiary
      • enroll(): enroll beneficiary to a program
      • unenroll(): unenroll beneficiary from program
      • createIndividual(): create new individual
      • updateIndividual(): update existing individual
      • createGroup(): create new group
      • updateGroup(): update existing group
      • addToGroup(): add individual to group with(out) role
      • removeFromGroup(): end membership of individual to group
    - + \ No newline at end of file diff --git a/adaptors/packages/openspp-configuration-schema.html b/adaptors/packages/openspp-configuration-schema.html index 189e75c3685..ee607ce9a69 100644 --- a/adaptors/packages/openspp-configuration-schema.html +++ b/adaptors/packages/openspp-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "test@openfn.org",
    "database": "devel",
    "baseUrl": "https://dev.newlogic-demo.com"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "default": "http://localhost",
    "examples": [
    "https://dev.newlogic-demo.com"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "default": "admin",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "default": "admin",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "database": {
    "title": "Database Name",
    "type": "string",
    "default": "devel",
    "description": "Database Name",
    "examples": [
    "devel"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "username",
    "database",
    "baseUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openspp-docs.html b/adaptors/packages/openspp-docs.html index c4ab1aa7708..876575762a0 100644 --- a/adaptors/packages/openspp-docs.html +++ b/adaptors/packages/openspp-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    openspp@2.0.2

    addToGroup(group_id, individual_id, role)
    createGroup(data, callback)
    createIndividual(data, callback)
    enroll(spp_id, program_id)
    getArea(spp_id, callback)
    getEnrolledPrograms(spp_id, callback)
    getGroup(spp_id, callback)
    getGroupMembers(spp_id, [options], callback)
    getIndividual(spp_id, callback)
    getProgram(program_id, callback)
    getPrograms([options], callback)
    getServicePoint(spp_id, callback)
    removeFromGroup(group_id, individual_id)
    searchArea(domain, [options], callback)
    searchGroup(domain, [options], callback)
    searchIndividual(domain, [options], callback)
    searchServicePoint(domain, [options], callback)
    unenroll(spp_id, program_id)
    updateGroup(group_id, data)
    updateIndividual(individual_id, data)

    This adaptor exports the following from common:

    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    addToGroup

    addToGroup(group_id, individual_id, role) ⇒ Operation

    add individual to group in OpenSPP

    ParamTypeDescription
    group_idstringgroup registrant id
    individual_idstringindividual registrant id
    rolestringindividual role in group

    Example: create a new head for group

    addToGroup("GRP_B2BRHJN2", "IND_8DUQL4M4", "Head")

    Example: create a new ordinary member for group

    addToGroup("GRP_B2BRHJN2", "IND_8DUQL4M4")

    Example: create a new member with new role for group

    addToGroup("GRP_B2BRHJN2", "IND_8DUQL4M4", "new-role-name")

    createGroup

    createGroup(data, callback) ⇒ Operation

    create new group for OpenSPP

    ParamTypeDescription
    dataobjectregistrant create data
    callbackfunctionAn optional callback function

    Example

    createGroup({ name: "Group 1" })

    createIndividual

    createIndividual(data, callback) ⇒ Operation

    create new individual for OpenSPP

    ParamTypeDescription
    dataobjectregistrant create data
    callbackfunctionAn optional callback function

    Example

    createIndividual({ name: "Individual 1" })

    enroll

    enroll(spp_id, program_id)

    enroll registrant to program in OpenSPP

    ParamTypeDescription
    spp_idstringspp_id of group / individual wanted to enroll
    program_idstringprogram_id of program

    Example

    enroll("IND_Q4VGGZPF", "PROG_2023_00000001")

    getArea

    getArea(spp_id, callback) ⇒ Operation

    get area by id in OpenSPP

    ParamTypeDescription
    spp_idstringspp_id of area
    callbackfunctionAn optional callback function

    Example

    getArea("LOC_7M92NLDH")

    getEnrolledPrograms

    getEnrolledPrograms(spp_id, callback) ⇒ Operation

    get programs list for specific registrant from OpenSPP

    ParamTypeDescription
    spp_idstringspp_id of group / individual wanted to search
    callbackfunctionAn optional callback function

    Example

    getEnrolledPrograms("IND_Q4VGGZPF")

    getGroup

    getGroup(spp_id, callback) ⇒ Operation

    get group information from OpenSPP

    ParamTypeDescription
    spp_idstringThe spp_id of the group
    callbackfunctionAn optional callback function

    Example

    getGroup("GRP_Q4VGGZPF")

    getGroupMembers

    getGroupMembers(spp_id, [options], callback) ⇒ Operation

    get group members information from OpenSPP

    ParamTypeDefaultDescription
    spp_idstringThe name of the group
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records
    callbackfunctionAn optional callback function

    Example

    getGroupMembers("GRP_Q4VGGZPF")

    getIndividual

    getIndividual(spp_id, callback) ⇒ Operation

    get individual information from OpenSPP

    ParamTypeDescription
    spp_idstringThe spp_id of the individual
    callbackfunctionAn optional callback function

    Example

    getIndividual("IND_Q4VGGZPF")

    getProgram

    getProgram(program_id, callback) ⇒ Operation

    get program information from OpenSPP

    ParamTypeDescription
    program_idstringsearching domain
    callbackfunctionAn optional callback function

    Example

    getProgram("PROG_2023_00000001")

    getPrograms

    getPrograms([options], callback) ⇒ Operation

    get programs list from OpenSPP

    ParamTypeDefaultDescription
    [options]number{}offset from start
    callbackfunctionAn optional callback function

    Example

    getPrograms(100)

    getServicePoint

    getServicePoint(spp_id, callback) ⇒ Operation

    get service points information from OpenSPP

    ParamTypeDescription
    spp_idstringThe spp_id of the agent
    callbackfunctionAn optional callback function

    Example

    getServicePoint("SVP_8P4KP4RT")

    removeFromGroup

    removeFromGroup(group_id, individual_id) ⇒ Operation

    remove individual from group in OpenSPP

    ParamTypeDescription
    group_idstringgroup registrant id
    individual_idstringindividual registrant id

    Example

    removeFromGroup("GRP_B2BRHJN2", "IND_8DUQL4M4")

    searchArea

    searchArea(domain, [options], callback) ⇒ Operation

    searching for service point in OpenSPP

    ParamTypeDefaultDescription
    domainArraysearching domain
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records
    callbackfunctionAn optional callback function

    Example: search without offset

    searchArea([["code", "=", "10732"]])

    Example: search with offset

    searchArea([["kind", "=", 1]], { offset: 10 }})

    searchGroup

    searchGroup(domain, [options], callback) ⇒ Operation

    get groups from OpenSPP

    ParamTypeDefaultDescription
    domainArraysearching domain
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for ordering search, offset for skipping records
    callbackfunctionAn optional callback function

    Example: search group by domain

    searchGroup([["spp_id", "=", "GRP_Q4VGGZPF"]])

    Example: search group by domain with offset

    searchGroup([["spp_id", "ilike", "GRP"]], { offset: 100 }})

    Example: search group by complex domain for more accuracy

    searchGroup([["address", "!=", false], ["phone", "!=", false]])

    searchIndividual

    searchIndividual(domain, [options], callback) ⇒ Operation

    get individuals from OpenSPP

    ParamTypeDefaultDescription
    domainArraysearching domain
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records
    callbackfunctionAn optional callback function

    Example: search individual by domain

    searchIndividual([["spp_id", "=", "IND_Q4VGGZPF"]])

    Example: search individual by domain with offset

    searchIndividual([["spp_id", "ilike", "IND"]], { offset: 100 })

    Example: search individual by complex domain for more accuracy

    searchIndividual([["address", "!=", false], ["birthdate", "=", false]])

    searchServicePoint

    searchServicePoint(domain, [options], callback) ⇒ Operation

    searching for service point in OpenSPP

    ParamTypeDefaultDescription
    domainArraysearching domain
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records
    callbackfunctionAn optional callback function

    Example: search without offset

    searchServicePoint([["name", "ilike", "agent 1"]])

    Example: search with offset

    searchServicePoint([["name", "ilike", "agent 1"]], { offset: 100 })

    unenroll

    unenroll(spp_id, program_id)

    unenroll registrant from program in OpenSPP

    ParamTypeDescription
    spp_idstringspp_id of group / individual wanted to unenroll
    program_idstringprogram_id of program

    Example

    unenroll("IND_Q4VGGZPF", "PROG_2023_00000001")

    updateGroup

    updateGroup(group_id, data) ⇒ Operation

    update group for OpenSPP

    ParamTypeDescription
    group_idstringgroup registrant id
    dataobjectregistrant update data

    Example

    updateGroup("GRP_B2BRHJN2", { name: "Group 1" })

    updateIndividual

    updateIndividual(individual_id, data) ⇒ Operation

    update individual for OpenSPP

    ParamTypeDescription
    individual_idstringindividual registrant id
    dataobjectregistrant update data

    Example

    updateIndividual("IND_8DUQL4M4", { name: "Individual 1" })

    - + \ No newline at end of file diff --git a/adaptors/packages/openspp-readme.html b/adaptors/packages/openspp-readme.html index d3cb6421603..be13984beb2 100644 --- a/adaptors/packages/openspp-readme.html +++ b/adaptors/packages/openspp-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the getServicePoint function

    getServicePoint("newagentflour");

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/postgresql-changelog.html b/adaptors/packages/postgresql-changelog.html index 6aeba7db6ad..50dfa20bdb2 100644 --- a/adaptors/packages/postgresql-changelog.html +++ b/adaptors/packages/postgresql-changelog.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    4.0.0

    Major Changes

    3.4.6

    Patch Changes

    3.4.5

    Patch Changes

    3.4.4

    Patch Changes

    3.4.3

    Patch Changes

    3.4.2

    Patch Changes

    3.4.1

    Patch Changes

    3.4.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/postgresql-configuration-schema.html b/adaptors/packages/postgresql-configuration-schema.html index 3d9a67013bd..569f64c6161 100644 --- a/adaptors/packages/postgresql-configuration-schema.html +++ b/adaptors/packages/postgresql-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "some-host.compute-1.amazonaws.com",
    "user": "admin",
    "database": "demo-db",
    "password": "@super(!)Secretpass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host",
    "type": "string",
    "description": "Postgres instance host URL or IP address",
    "minLength": 1,
    "examples": [
    "some-host.compute-1.amazonaws.com",
    "201.220.61.246"
    ]
    },
    "port": {
    "title": "Port",
    "type": "integer",
    "default": 5432,
    "description": "Database instance port",
    "minLength": 1,
    "examples": [
    5432
    ]
    },
    "database": {
    "title": "Database",
    "type": "string",
    "description": "The database name",
    "minLength": 1,
    "examples": [
    "demo-db"
    ]
    },
    "user": {
    "title": "User",
    "type": "string",
    "description": "User name",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    },
    "ssl": {
    "title": "Use SSL",
    "type": "boolean",
    "examples": [
    true
    ]
    },
    "allowSelfSignedCert": {
    "title": "Allow self-signed certificate",
    "type": "boolean",
    "examples": [
    true
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "user",
    "database",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/postgresql-docs.html b/adaptors/packages/postgresql-docs.html index eedbbc5be13..1730e04cb3c 100644 --- a/adaptors/packages/postgresql-docs.html +++ b/adaptors/packages/postgresql-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    postgresql@6.0.2

    describeTable(tableName, [options], callback)
    findValue([filter])
    insert(table, record, [options], callback)
    insertMany(table, records, [options], callback)
    insertTable(tableName, columns, [options], callback)
    modifyTable(tableName, columns, [options], callback)
    sql(sqlQuery, [options], callback)
    upsert(table, uuid, record, [options], callback)
    upsertIf(logical, table, uuid, record, [options], callback)
    upsertMany(table, uuid, data, [options], callback)

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    combine()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    group()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    describeTable

    describeTable(tableName, [options], callback) ⇒ Operation

    List the columns of a table in a database.

    ParamTypeDescription
    tableNamestringThe name of the table to describe
    [options]objectOptional options argument
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    describeTable('clinic_visits')

    findValue

    findValue([filter]) ⇒ value

    Fetch a uuid key given a condition

    ParamTypeDescription
    [filter]objectA filter object with the lookup table, a uuid and the condition
    [filter.uuid]stringThe uuid value to search for in the specified relation.
    [filter.relation]stringThe name of the relation to search for the uuid value.
    [filter.where]objectAn object that contains key-value pairs to filter the search results.
    [filter.operator]objectAn object that contains key-value pairs to specify the type of comparison to perform on the where clause.

    Example

    findValue({
    uuid: 'id',
    relation: 'users',
    where: { first_name: 'Mamadou' },
    operator: { first_name: 'like' }
    })

    insert

    insert(table, record, [options], callback) ⇒ Operation

    Insert a record

    ParamTypeDescription
    tablestringThe target table
    recordobjectPayload data for the record as a JS object or function
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    insert('users', { name: 'Elodie', id: 7 }, { setNull: "'NaN'", logValues: true });

    insertMany

    insertMany(table, records, [options], callback) ⇒ Operation

    Insert many records, using the keys of the first as the column template

    ParamTypeDescription
    tablestringThe target table
    recordsarrayAn array or a function that takes state and returns an array
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    insertMany('users', state => state.data.recordArray, { setNull: "'undefined'", logValues: true });

    insertTable

    insertTable(tableName, columns, [options], callback) ⇒ Operation

    Create a table in database when given an array of columns and a table_name.

    ParamTypeDescription
    tableNamestringThe name of the table to create
    columnsarrayAn array of form columns
    [options]objectOptional options argument
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    insertTable('table_name', state => state.data.map(
    column => ({
    name: column.name,
    type: column.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    modifyTable

    modifyTable(tableName, columns, [options], callback) ⇒ Operation

    Alter an existing table in the database.

    ParamTypeDescription
    tableNamestringThe name of the table to alter
    columnsarrayAn array of form columns
    [options]objectOptional options argument
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    modifyTable('table_name', state => state.data.map(
    newColumn => ({
    name: newColumn.name,
    type: newColumn.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    sql

    sql(sqlQuery, [options], callback) ⇒ Operation

    Execute an SQL statement

    ParamTypeDescription
    sqlQuerystringThe SQL query as a string.
    [options]objectOptional options argument
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    sql(state => `select(*) from ${state.data.tableName};`, { writeSql: true })

    upsert

    upsert(table, uuid, record, [options], callback) ⇒ Operation

    Insert or update a record using ON CONFLICT UPDATE

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object or function
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    upsert(
    'users', // the DB table
    'ON CONSTRAINT users_pkey', // a DB column with a unique constraint OR a CONSTRAINT NAME
    { name: 'Elodie', id: 7 },
    { setNull: ["''", "'undefined'"], writeSql:true, execute: true, logValues: true }
    )

    upsertIf

    upsertIf(logical, table, uuid, record, [options], callback) ⇒ Operation

    Insert or update a record based on a logical condition using ON CONFLICT UPDATE

    ParamTypeDescription
    logicalstringa data to check existing value for.
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object or function
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    upsertIf(
    dataValue('name'),
    'users', // the DB table
    'ON CONSTRAINT users_pkey', // a DB column with a unique constraint OR a CONSTRAINT NAME
    { name: 'Elodie', id: 7 },
    { writeSql:true, execute: true }
    )

    upsertMany

    upsertMany(table, uuid, data, [options], callback) ⇒ Operation

    Insert or update multiple records using ON CONFLICT UPDATE and excluded

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    dataarrayAn array of objects or a function that returns an array
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    upsertMany(
    'users', // the DB table
    'email', // a DB column with a unique constraint OR a CONSTRAINT NAME
    [
    { name: 'one', email: 'one@openfn.org' },
    { name: 'two', email: 'two@openfn.org' },
    ]
    { logValues: true }
    )

    - + \ No newline at end of file diff --git a/adaptors/packages/postgresql-readme.html b/adaptors/packages/postgresql-readme.html index 73f693b9373..4ee7a74301f 100644 --- a/adaptors/packages/postgresql-readme.html +++ b/adaptors/packages/postgresql-readme.html @@ -21,7 +21,7 @@ - + @@ -40,7 +40,7 @@ columns. The key identity can be use for a column to auto-generate a value.

    insertTable('users', state =>
    state.data.map(column => ({
    name: column.name,
    type: column.type,
    required: true, // optional
    unique: false, // optional - set to true for unique constraint
    }))
    );

    Alter a table in the database

    This function allows to add new columns to a table. Beware of the fact that you cannot add new columns with names that already exist in the table.

    modifyTable(
    'users',
    state =>
    state.data.map(newColumn => ({
    name: newColumn.name,
    type: newColumn.type,
    required: true, // optional
    unique: false, // optional - set to true for unique constraint
    })),
    { writeSql: false, execute: true }
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/primero-changelog.html b/adaptors/packages/primero-changelog.html index df444ac52ba..37355545e51 100644 --- a/adaptors/packages/primero-changelog.html +++ b/adaptors/packages/primero-changelog.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ argument: the metadata from Primero's response.

    getCases will now not only return an array of cases in state.data, but metadata related to pagination in state.metadata.

    Patch Changes

    2.9.2

    Patch Changes

    2.9.1

    Patch Changes

    2.9.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/primero-configuration-schema.html b/adaptors/packages/primero-configuration-schema.html index 11910029631..65c1fdd0d4d 100644 --- a/adaptors/packages/primero-configuration-schema.html +++ b/adaptors/packages/primero-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "url": "https://primero.org/some-org"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "url": {
    "title": "URL",
    "type": "string",
    "description": "The Primero host url",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://primero.org/some-org"
    ]
    },
    "user": {
    "title": "User",
    "type": "string",
    "description": "The username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Superpass"
    ]
    },
    "basicAuth": {
    "title": "Use Basic Auth",
    "type": "boolean",
    "examples": [
    true
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "url"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/primero-docs.html b/adaptors/packages/primero-docs.html index 8a2718f344a..dfa84cd4383 100644 --- a/adaptors/packages/primero-docs.html +++ b/adaptors/packages/primero-docs.html @@ -21,7 +21,7 @@ - + @@ -45,7 +45,7 @@ keeping both the existing values and appending the new

    ParamTypeDescription
    idstringA case ID to use for the update.
    paramsobjectan object with some case data.
    callbackfunction(Optional) Callback function

    Example: Update case for a specific case id

    updateCase("6aeaa66a-5a92-4ff5-bf7a-e59cde07eaaz", {
    data: {
    age: 16,
    sex: "female",
    name: "Fiona Edgemont",
    },
    });

    updateReferral

    updateReferral(params, callback) ⇒ Operation

    Update a single referral for a specific case in Primero

    ParamTypeDescription
    paramsobjectan object with an caseExternalId value to use, the id and the referral id to update.
    callbackfunction(Optional) Callback function

    Example: Update referral by record id

    updateReferral({
    caseExternalId: "record_id",
    id: "749e9c6e-60db-45ec-8f5a-69da7c223a79",
    caseId: "dcea6052-07d9-4cfa-9abf-9a36987cdd25",
    data: (state) => state.data,
    });

    upsertCase

    upsertCase(params, callback) ⇒ Operation

    Upsert case to Primero

    Use this function to update an existing case from Primero or to create it otherwise. In this implementation, we first fetch the list of cases, then we check if the case exist before choosing the right operation to do.

    ParamTypeDescription
    paramsobjectan object with an externalIds and some case data.
    callbackfunction(Optional) Callback function

    Example: Upsert case for a specific case id

    upsertCase({
    externalIds: ["case_id"],
    data: state => ({
    age: 20,
    sex: "male",
    name: "Alex",
    status: "open",
    case_id: "6aeaa66a-5a92-4ff5-bf7a-e59cde07eaaz",
    }),
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/primero-readme.html b/adaptors/packages/primero-readme.html index d77e30448e4..73c53f4dd7e 100644 --- a/adaptors/packages/primero-readme.html +++ b/adaptors/packages/primero-readme.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ in our Microsoft Dynamics, Github, or Google Sheets adaptors, but we'll need to await final doucmentation for Primero's v2 API before making changes.

    Azure Active Directory B2C

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/progres-changelog.html b/adaptors/packages/progres-changelog.html index 83afa626986..b6552d2474a 100644 --- a/adaptors/packages/progres-changelog.html +++ b/adaptors/packages/progres-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.2.5

    Patch Changes

    1.2.4

    Patch Changes

    1.2.3

    Patch Changes

    1.2.2

    Patch Changes

    1.2.1

    Patch Changes

    1.2.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/progres-configuration-schema.html b/adaptors/packages/progres-configuration-schema.html index e4f1293d6c2..7f495d9b5ca 100644 --- a/adaptors/packages/progres-configuration-schema.html +++ b/adaptors/packages/progres-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "url": "https://endpoint/To/DTP",
    "key": "-----BEGIN PRIVATE KEY-----SOMETYPEOFPRIVATEVALUE-----END PRIVATE KEY-----",
    "cert": "-----BEGIN CERTIFICATE-----SOMETYPEOFVALUE-----END CERTIFICATE-----",
    "token": "[REDACTED]"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "url": {
    "title": "URL",
    "type": "string",
    "description": "The Progres URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://endpoint/To/DTP"
    ]
    },
    "key": {
    "title": "Private Key",
    "type": "string",
    "description": "Your Progres private key",
    "minLength": 1,
    "examples": [
    "-----BEGIN PRIVATE KEY-----SOMETYPEOFPRIVATEVALUE-----END PRIVATE KEY-----"
    ]
    },
    "cert": {
    "title": "Certificate",
    "type": "string",
    "description": "Your Progres certificate",
    "minLength": 1,
    "examples": [
    "-----BEGIN CERTIFICATE-----SOMETYPEOFVALUE-----END CERTIFICATE-----"
    ]
    },
    "token": {
    "title": "Token",
    "type": "string",
    "description": "Your Progres token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "[REDACTED]"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "url",
    "key",
    "cert",
    "token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/progres-docs.html b/adaptors/packages/progres-docs.html index e21701f5dcf..d26a84f2ce1 100644 --- a/adaptors/packages/progres-docs.html +++ b/adaptors/packages/progres-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    progres@1.4.4

    postData(params, callback)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    postData

    postData(params, callback) ⇒ Operation

    Make a POST request with a certificate

    ParamTypeDescription
    paramsobjectUrl, Headers and Body parameters
    callbackfunction(Optional) A callback function

    Example

    postData({
    url: urlDTP,
    body: obj,
    headers: {
    'Ocp-Apim-Subscription-Key': configuration['Ocp-Apim-Subscription-Key'],
    },
    agentOptions: {
    key,
    cert,
    },
    }, callback)(state)

    - + \ No newline at end of file diff --git a/adaptors/packages/progres-readme.html b/adaptors/packages/progres-readme.html index 972dc565af6..444d4b46775 100644 --- a/adaptors/packages/progres-readme.html +++ b/adaptors/packages/progres-readme.html @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ configuration-schema definition.

    Posting data to an endpoint with SSL cert authentication

    postData({
    url: urlDTP,
    body: { a: 1 },
    headers: {
    'Subscription-Key': configuration['token'],
    },
    agentOptions: {
    key,
    cert,
    },
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/rapidpro-changelog.html b/adaptors/packages/rapidpro-changelog.html index 2a92ed6dbaa..eb34885e268 100644 --- a/adaptors/packages/rapidpro-changelog.html +++ b/adaptors/packages/rapidpro-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.5.6

    Patch Changes

    0.5.5

    Patch Changes

    0.5.4

    Patch Changes

    0.5.3

    Patch Changes

    0.5.2

    Patch Changes

    0.5.1

    Patch Changes

    0.5.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/rapidpro-configuration-schema.html b/adaptors/packages/rapidpro-configuration-schema.html index 98666f61470..d03e4ccb931 100644 --- a/adaptors/packages/rapidpro-configuration-schema.html +++ b/adaptors/packages/rapidpro-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "https://app.rapidpro.io/",
    "token": "#Super-sSCrecrete-token"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host",
    "type": "string",
    "default": "https://app.rapidpro.io/",
    "description": "instance host URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://app.rapidpro.io/"
    ]
    },
    "token": {
    "title": "Token",
    "type": "string",
    "description": "instance access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "#Super-sSCrecrete-token"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "description": "API version to use. Leave this empty to use the default v2",
    "minLength": 1,
    "examples": [
    "v2"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/rapidpro-docs.html b/adaptors/packages/rapidpro-docs.html index 4fe66727551..f983e68d982 100644 --- a/adaptors/packages/rapidpro-docs.html +++ b/adaptors/packages/rapidpro-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    rapidpro@1.1.3

    addContact(params, callback)
    sendBroadcast(params, callback)
    startFlow(params, callback)
    upsertContact(params, callback)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    addContact

    addContact(params, callback) ⇒ Operation

    Adds a new contact to RapidPro

    ParamTypeDescription
    paramsobjectdata to create the new resource
    callbackfunction(Optional) callback function

    Example

    addContact({
    name: "Mamadou",
    language: "ENG",
    urns: ["tel:+250788123123"]
    });

    sendBroadcast

    sendBroadcast(params, callback) ⇒ Operation

    Sends a message to a list of contacts and/or URNs

    ParamTypeDescription
    paramsobjectdata to create the new resource
    callbackfunction(Optional) callback function

    Example

    sendBroadcast({
    text: "Hello world",
    urns: ["twitter:sirmixalot"],
    contacts: ["a052b00c-15b3-48e6-9771-edbaa277a353"]
    });

    startFlow

    startFlow(params, callback) ⇒ Operation

    Start a RapidPro flow for a number of contacts

    ParamTypeDescription
    paramsobjectdata to create the new resource
    callbackfunction(Optional) callback function

    Example

    startFlow({
    flow: "f5901b62-ba76-4003-9c62-72fdacc1b7b7",
    restart_participants: false,
    contacts: ["a052b00c-15b3-48e6-9771-edbaa277a353"]
    });

    upsertContact

    upsertContact(params, callback) ⇒ Operation

    Upserts a contact to RapidPro by URN

    ParamTypeDescription
    paramsobjectdata to upsert a contact
    callbackfunction(Optional) callback function

    Example

    upsertContact({
    name: "Mamadou",
    language: "ENG",
    urns: ["tel:+250788123123"]
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/rapidpro-readme.html b/adaptors/packages/rapidpro-readme.html index 5c4a39ea7fa..8c2cfed4099 100644 --- a/adaptors/packages/rapidpro-readme.html +++ b/adaptors/packages/rapidpro-readme.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ definition.

    sample job expression using operation

    sendBroadcast({
    "text": "Hello friends.",
    "urns": [],
    "contacts": [],
    "groups", [],
    });

    Key helper functions

    sendBroadcast(...) to send broadcast message to multiple contacts

    sendBroadcast({
    text: 'Hello world',
    urns: ['twitter:sirmixalot'],
    contacts: ['a052b00c-15b3-48e6-9771-edbaa277a353'],
    });

    startFlow(...) to trigger an automation flow in RapidPro

    startFlow({
    flow: 'f5901b62-ba76-4003-9c62-72fdacc1b7b7',
    restart_participants: false,
    contacts: ['a052b00c-15b3-48e6-9771-edbaa277a353'],
    });

    upsertContact(...) to update/insert a Contact (and check if exists using external identifiers)

    upsertContact({
    name: 'Mamadou',
    language: 'ENG',
    urns: ['tel:+250788123123'],
    });

    addContact(...) to insert a Contact

    addContact({
    name: 'Mamadou',
    language: 'ENG',
    urns: ['tel:+250788123123'],
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/redis-changelog.html b/adaptors/packages/redis-changelog.html index 85b50e0343f..c456c082bd7 100644 --- a/adaptors/packages/redis-changelog.html +++ b/adaptors/packages/redis-changelog.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Changelog for the redis adaptor

    @openfn/language-redis

    1.2.1

    Patch Changes

    1.2.0

    Minor Changes

    • c1e3221: - Add mGet() function
      • Remove console.log in hget()
      • Add logging to scan()

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    • 2b8ec34: - Update host type configuration-schema

    1.1.0

    Minor Changes

    • Add jGet() function
    • Add jSet() function
    • scan() now iterates the whole database
      • Removed cursor option from scan
      • Removed default value for type option
      • Mapped json data type to the redis internal type

    1.0.0

    First release. Designed as a low-level wrapper around npm redis client.

    • get(key)
    • hget(key, field)
    • hGetAll(key)
    • hset(key, value)
    • scan(pattern,options)
    • set(key, field)
    - + \ No newline at end of file diff --git a/adaptors/packages/redis-configuration-schema.html b/adaptors/packages/redis-configuration-schema.html index e330038e64a..c3a566c7536 100644 --- a/adaptors/packages/redis-configuration-schema.html +++ b/adaptors/packages/redis-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "redis.example.com",
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "test@openfn.org"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host",
    "type": "string",
    "minLength": 1,
    "description": "Redis server hostname",
    "format": "uri",
    "examples": [
    "redis.example.com"
    ]
    },
    "database": {
    "title": "Database Number",
    "type": "integer",
    "description": "Redis database number. New connections always use the database 0.",
    "examples": [
    0
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Redis Access Control username",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Redis Access Control password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "port": {
    "title": "Port",
    "type": "string",
    "description": "Redis server port",
    "writeOnly": true,
    "default": "6379",
    "examples": [
    "16652"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "password",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/redis-docs.html b/adaptors/packages/redis-docs.html index beb49e8f6ad..a7b1cd6708e 100644 --- a/adaptors/packages/redis-docs.html +++ b/adaptors/packages/redis-docs.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ existing value will be replaced by the new value.

    ParamTypeDescription
    keystringThe key to modify.
    valuestring | objectThe JSON object or string value to set.

    This operation writes the following keys to state:

    State KeyDescription
    referencesan array of all previous data objects used in the Job

    Example: Set a JSON object for the key `patient`

    jSet('patient', { name: 'victor', ihs_number: 12345  });

    mGet

    mGet(keys) ⇒ Operation

    Get the values at specified paths in JSON documents stored at multiple keys.

    ParamTypeDescription
    keysArray.<string>The keys at which the JSON documents are stored.

    This operation writes the following keys to state:

    State KeyDescription
    datathe result returned from Redis
    referencesan array of all previous data objects used in the Job

    Example: Get JSON document values of the patient and doctor keys

    mGet(["patient", "doctor"]);

    scan

    scan(pattern, options) ⇒ Operation

    Returns all keys which match the provided pattern. scan iterates the whole database to find the matching keys

    ParamTypeDescription
    patternstringA glob-style pattern
    optionsScanOptionsScan options

    This operation writes the following keys to state:

    State KeyDescription
    dataan array of keys which match the pattern
    referencesan array of all previous data objects used in the Job

    Example: Scan for matching keys

    scan('*:20240524T172736Z*');

    Example: Scan for keys and fetch the string values inside

    scan('*:20240524T172736Z*');
    each($.data, get($.data).then((state) => {
    state.results ??= [];
    state.results.push(state.data)
    return state;
    })

    set

    set(key, value) ⇒ Operation

    Set the string value of a key. If the key already exists, its value is updated. Otherwise, a new key-value pair is created.

    ParamTypeDescription
    keystringThe name of the key
    valuestringThe value to set

    This operation writes the following keys to state:

    State KeyDescription
    referencesan array of all previous data objects used in the Job

    Example: Set the "patient" key to value "mtuchi"

    set("patient", "mtuchi");

    Interfaces

    ScanOptions

    Options provided to the scan function

    Properties

    NameTypeDescription
    typestringLimits the keys returned to those of a specified type (e.g., string, list, set, hash, json, zset or stream).
    countintegerA hint to the server about how many elements to return in the call (default is 10).

    - + \ No newline at end of file diff --git a/adaptors/packages/redis-readme.html b/adaptors/packages/redis-readme.html index 395e7432b82..30c1568c659 100644 --- a/adaptors/packages/redis-readme.html +++ b/adaptors/packages/redis-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the hset function

    hset('patient', { name: 'Bukayo' });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/resourcemap-changelog.html b/adaptors/packages/resourcemap-changelog.html index 690ff302105..94765632dea 100644 --- a/adaptors/packages/resourcemap-changelog.html +++ b/adaptors/packages/resourcemap-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/resourcemap-configuration-schema.html b/adaptors/packages/resourcemap-configuration-schema.html index b9095f50211..b27a2675dd4 100644 --- a/adaptors/packages/resourcemap-configuration-schema.html +++ b/adaptors/packages/resourcemap-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "http://some-site-of-yours.com:8080"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "default": "http://some-site-of-yours.com:8080",
    "description": "ResourceMap base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "http://some-site-of-yours.com:8080"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Your ResourceMap username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your ResourceMap password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/resourcemap-docs.html b/adaptors/packages/resourcemap-docs.html index ad11293c0b4..88216f790ee 100644 --- a/adaptors/packages/resourcemap-docs.html +++ b/adaptors/packages/resourcemap-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/resourcemap-readme.html b/adaptors/packages/resourcemap-readme.html index 9d63c8355b1..e48ce9c5d73 100644 --- a/adaptors/packages/resourcemap-readme.html +++ b/adaptors/packages/resourcemap-readme.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ configuration-schema definition.

    Expressions

    submitSite(collectionId, fields)

    submitSite(
    303,
    fields(
    field('name', dataValue('sampleText')),
    field('lat', 48.86),
    field('lon', 2.35),
    field('properties', function (state) {
    return {
    Comment: state.data.sampleText,
    phone: '85512345678',
    };
    })
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/salesforce-changelog.html b/adaptors/packages/salesforce-changelog.html index df058d04c76..72367d5cf3e 100644 --- a/adaptors/packages/salesforce-changelog.html +++ b/adaptors/packages/salesforce-changelog.html @@ -21,7 +21,7 @@ - + @@ -40,7 +40,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    3.0.7

    Patch Changes

    3.0.6

    Patch Changes

    3.0.5

    Patch Changes

    3.0.4

    Patch Changes

    3.0.3

    Patch Changes

    3.0.2

    Patch Changes

    3.0.1

    Patch Changes

    3.0.0

    Major Changes

    2.12.3

    Patch Changes

    2.12.2

    Patch Changes

    2.12.1

    Patch Changes

    2.12.0

    Minor Changes

    Patch Changes

    2.11.1

    Patch Changes

    2.11.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/salesforce-configuration-schema.html b/adaptors/packages/salesforce-configuration-schema.html index eae47f803ee..e44879a13af 100644 --- a/adaptors/packages/salesforce-configuration-schema.html +++ b/adaptors/packages/salesforce-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "loginUrl": "https://somesalesforcelogin.url",
    "username": "someusername",
    "password": "@super(!)SecretPass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "loginUrl": {
    "title": "Login URL",
    "type": "string",
    "description": "The Salesforce instance login URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://somesalesforcelogin.url"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in the Salesforce instance",
    "minLength": 1,
    "examples": [
    "someusername"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in the Salesforce instance",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)SecretPass"
    ]
    },
    "securityToken": {
    "title": "Security Token",
    "type": "string",
    "description": "The security token to access the Salesforce instance",
    "minLength": 1,
    "examples": [
    "salesforcesecuritytoken"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "placeholder": "52.0",
    "description": "Salesforce API Version",
    "minLength": 1,
    "examples": [
    "59.0"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "loginUrl",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/salesforce-docs.html b/adaptors/packages/salesforce-docs.html index 563699d9b25..e43bf8248c8 100644 --- a/adaptors/packages/salesforce-docs.html +++ b/adaptors/packages/salesforce-docs.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ Note that in an event of a query error, error logs will be printed but the operation will not throw the error.

    The Salesforce query API is subject to rate limits, See for more details.

    ParamTypeDefaultDescription
    qsstringA query string. Must be less than 4000 characters in WHERE clause
    optionsobjectOptions passed to the bulk api.
    [options.autoFetch]booleanfalseFetch next records if available.
    callbackfunctionA callback to execute once the record is retrieved

    Example

    query(state=> `SELECT Id FROM Patient__c WHERE Health_ID__c = '${state.data.field1}'`);

    Example: Query more records if next records are available

    query(state=> `SELECT Id FROM Patient__c WHERE Health_ID__c = '${state.data.field1}'`, { autoFetch: true });

    reference

    reference(position) ⇒ State

    Get a reference ID by an index.

    ParamTypeDescription
    positionnumberPosition for references array.

    Example

    reference(0)

    relationship

    relationship(relationshipName, externalId, dataSource) ⇒ object

    Adds a lookup relation or 'dome insert' to a record.

    ParamTypeDescription
    relationshipNamestring__r relationship field on the record.
    externalIdstringSalesforce ExternalID field.
    dataSourcestringresolvable source.

    Example

    Data Sourced Value:
    relationship("relationship_name__r", "externalID on related object", dataSource("path"))
    Fixed Value:
    relationship("relationship_name__r", "externalID on related object", "hello world")

    retrieve

    retrieve(sObject, id, callback) ⇒ Operation

    Retrieves a Salesforce sObject(s).

    ParamTypeDescription
    sObjectstringThe sObject to retrieve
    idstringThe id of the record
    callbackfunctionA callback to execute once the record is retrieved

    Example

    retrieve('ContentVersion', '0684K0000020Au7QAE/VersionData');

    toUTF8

    toUTF8(input) ⇒ string

    Transliterates unicode characters to their best ASCII representation

    Returns: string - - ASCII representation of input string

    ParamTypeDescription
    inputstringA string with unicode characters

    Example

    fn((state) => {
    const s = toUTF8("άνθρωποι");
    console.log(s); // anthropoi
    return state;
    });

    update

    update(sObject, attrs) ⇒ Operation

    Update an sObject record or records.

    ParamTypeDescription
    sObjectstringAPI name of the sObject.
    attrsobject | Array.<object>Field attributes for the new object.

    Example: Single record update

    update("Account", {
    Id: "0010500000fxbcuAAA",
    Name: "Updated Account #1",
    });

    Example: Multiple records update

    update("Account", [
    { Id: "0010500000fxbcuAAA", Name: "Updated Account #1" },
    { Id: "0010500000fxbcvAAA", Name: "Updated Account #2" },
    ]);

    upsert

    upsert(sObject, externalId, attrs) ⇒ Operation

    Create a new sObject record, or updates it if it already exists External ID field name must be specified in second argument.

    ParamTypeDescription
    sObjectstringAPI name of the sObject.
    externalIdstringThe external ID of the sObject.
    attrsobject | Array.<object>Field attributes for the new object.

    Example: Single record upsert

    upsert("UpsertTable__c", "ExtId__c", { Name: "Record #1", ExtId__c : 'ID-0000001' });

    Example: Multiple record upsert

    upsert("UpsertTable__c", "ExtId__c", [
    { Name: "Record #1", ExtId__c : 'ID-0000001' },
    { Name: "Record #2", ExtId__c : 'ID-0000002' },
    ]);

    upsertIf

    upsertIf(logical, sObject, externalId, attrs) ⇒ Operation

    Conditionally create a new sObject record, or updates it if it already exists

    The upsertIf() function has been deprecated. Use fnIf(condition,upsert()) instead.

    ParamTypeDescription
    logicalbooleana logical statement that will be evaluated.
    sObjectstringAPI name of the sObject.
    externalIdstringID.
    attrsobject | Array.<object>Field attributes for the new object.

    Example

    upsertIf(true, 'obj_name', 'ext_id', {
    attr1: "foo",
    attr2: "bar"
    })

    - + \ No newline at end of file diff --git a/adaptors/packages/salesforce-readme.html b/adaptors/packages/salesforce-readme.html index 73402aa4e10..89647bb78c9 100644 --- a/adaptors/packages/salesforce-readme.html +++ b/adaptors/packages/salesforce-readme.html @@ -21,7 +21,7 @@ - + @@ -40,7 +40,7 @@ credentials or runtime environment.

    It's the responsibility of the build process to provide a wrapper that will inject the functions in.

    For example:

    describe('vera__Test_Event__c'),
    create('vera__Test_Event__c', {
    vera__Test_Event_Name_Unique__c: 'hello from jsforce',
    }),
    create('vera__Boat__c', {
    Name: 'Catatafish redux!',
    vera__Test_Event__c: reference(0),
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    ## Other

    Create SOAP session

    curl https://test.salesforce.com/services/Soap/u/47.0 -H "Content-Type: text/xml; charset=UTF-8" -H "SOAPAction: login" -d @tmp/login.txt | xmllint --format -

    Close jobs

    curl
    https://openfn.my.salesforce.com/services/async/47.0/job/some_id -H 'X-SFDC-Session: abc123sessionID456xyz' -H "Content-Type: application/xml; charset=UTF-8" -d @tmp/close_job.txt | xmllint --format -
    - + \ No newline at end of file diff --git a/adaptors/packages/satusehat-changelog.html b/adaptors/packages/satusehat-changelog.html index 9c2b19d7c6d..709ab3c9dd8 100644 --- a/adaptors/packages/satusehat-changelog.html +++ b/adaptors/packages/satusehat-changelog.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Changelog for the satusehat adaptor

    @openfn/language-satusehat

    2.0.2

    Patch Changes

    2.0.1

    Patch Changes

    2.0.0

    Major Changes

    • Export new common http helpers (http namespace)

    1.1.4

    Patch Changes

    • f51c5d0: Enforce that absolute urls must not be passed to HTTP functions
    • Updated dependencies [4fe527c]

    1.1.3

    Patch Changes

    • 73d0a02: Make documentation public
    • Updated dependencies [4c08444]
    • Updated dependencies [73d0a02]

    1.1.2

    Patch Changes

    • 218a582: Added extra logging around errors

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.0.1

    Patch Changes

    1.0.0

    Initial release.

    - + \ No newline at end of file diff --git a/adaptors/packages/satusehat-configuration-schema.html b/adaptors/packages/satusehat-configuration-schema.html index c00685c068b..1571730f386 100644 --- a/adaptors/packages/satusehat-configuration-schema.html +++ b/adaptors/packages/satusehat-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://www.satusehat.com",
    "clientId": "the-long-uuid-provided-by-satusehat-for-your-organization",
    "clientSecret": "the-long-secret-key-provided-by-satusehat"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "Satusehat base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://www.satusehat.com"
    ]
    },
    "clientId": {
    "title": "Client Id",
    "type": "string",
    "minLength": 1,
    "description": "Your Satusehat client id",
    "examples": [
    "the-long-uuid-provided-by-satusehat-for-your-organization"
    ]
    },
    "clientSecret": {
    "title": "Client Secret",
    "type": "string",
    "description": "Client Secret",
    "minLength": 1,
    "examples": [
    "the-long-secret-key-provided-by-satusehat"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Satusehat access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "the-long-access-token-from-your-auth"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl",
    "clientId",
    "clientSecret"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/satusehat-docs.html b/adaptors/packages/satusehat-docs.html index 6cb80b782fe..ffaadc47b9d 100644 --- a/adaptors/packages/satusehat-docs.html +++ b/adaptors/packages/satusehat-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    satusehat@2.0.2

    get(path, params, callback)
    patch(path, data, params, [callback])
    post(path, data, params, [callback])
    put(path, data, params, [callback])

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    combine()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, params, callback) ⇒ Operation

    Make a GET request to Satusehat

    ParamTypeDescription
    pathstringPath to resource
    paramsobjectOptional request params such as name.
    callbackfunctionAn optional callback to handle the response

    Example

    get("Organization", {"name": "somename"})

    patch

    patch(path, data, params, [callback]) ⇒ Operation

    Make a PATCH request to Satusehat

    ParamTypeDescription
    pathstringPath to resource and exact item to be partially updated
    dataArrayAn array of objects which defines data that will be used to partially update a given instance of resource
    paramsObjectOptional request params.
    [callback]functionOptional callback to handle the response

    Example

    patch(
    "Organization/123",
    [{
    "op": "replace", // Operation - `replace` is the only one used to change a specific property or element
    "path": "/language", // Path - The name of property/element of resource to be replaced
    "value": "id" // Value- The value to be replaced
    }]

    );

    post

    post(path, data, params, [callback]) ⇒ Operation

    Make a POST request to Satusehat

    ParamTypeDescription
    pathstringPath to resource
    dataobjectObject or JSON which defines data that will be used to create a given instance of resource
    paramsObjectOptional request params.
    [callback]functionOptional callback to handle the response

    Example

    post(
    "Organization",
    { "resourceType": "Organization", "active": true,
    }
    );

    put

    put(path, data, params, [callback]) ⇒ Operation

    Make a PUT request to Satusehat

    ParamTypeDescription
    pathstringPath to resource and exact item to be updated
    dataobjectObject or JSON which defines data that will be used to update a given instance of resource
    paramsObjectOptional request params.
    [callback]functionOptional callback to handle the response

    Example

    put(
    "Organization/123",
    { "resourceType": "Organization", "active": false,
    }
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/satusehat-readme.html b/adaptors/packages/satusehat-readme.html index d26ca25d5fc..a159b67c057 100644 --- a/adaptors/packages/satusehat-readme.html +++ b/adaptors/packages/satusehat-readme.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the post function

    post('Organization', {  "resourceType": "Organization" });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/sftp-changelog.html b/adaptors/packages/sftp-changelog.html index de71520024c..aeabfca8891 100644 --- a/adaptors/packages/sftp-changelog.html +++ b/adaptors/packages/sftp-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.7.3

    Patch Changes

    0.7.2

    Patch Changes

    0.7.1

    Patch Changes

    0.7.0

    Minor Changes

    0.6.9

    Patch Changes

    0.6.8

    Patch Changes

    0.6.7

    Patch Changes

    0.6.6

    Patch Changes

    0.6.5

    Patch Changes

    0.6.4

    Patch Changes

    0.6.3

    Patch Changes

    0.6.2

    Patch Changes

    0.6.1

    Patch Changes

    0.6.0

    Minor Changes

    0.5.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/sftp-configuration-schema.html b/adaptors/packages/sftp-configuration-schema.html index 41d40654e97..a4b2d725f60 100644 --- a/adaptors/packages/sftp-configuration-schema.html +++ b/adaptors/packages/sftp-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "191.173.128.88"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host URL",
    "type": "string",
    "description": "The SFTP server host url or ip address",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "191.173.128.88"
    ]
    },
    "port": {
    "title": "Port",
    "type": "integer",
    "default": 21,
    "description": "The SFTP server port",
    "minLength": 1,
    "examples": [
    22
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Strongpassword"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/sftp-docs.html b/adaptors/packages/sftp-docs.html index bd45d89a8b8..d4d632fec73 100644 --- a/adaptors/packages/sftp-docs.html +++ b/adaptors/packages/sftp-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    sftp@2.0.2

    getCSV(filePath, [parsingOptions])
    getJSON(filePath, encoding)
    list(dirPath, filter, [callback])
    normalizeCSVarray(options, callback)
    putCSV(localFilePath, remoteFilePath, parsingOptions)

    This adaptor exports the following from common:

    alterState()
    chunk()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    parseCsv()
    sourceValue()

    Functions

    getCSV

    getCSV(filePath, [parsingOptions]) ⇒ Operation

    Get a CSV and return a JSON array of strings for each item separated by the delimiter

    ParamTypeDescription
    filePathstringPath to resource
    [parsingOptions]ObjectOptional. parsingOptions Parsing options which can be passed to convert csv to json See more on csvtojson docs

    Example

    getCSV(
    '/some/path/to_file.csv',
    {delimiter: ";", flatKeys: true }
    );

    getJSON

    getJSON(filePath, encoding) ⇒ Operation

    Fetch a json file from an FTP server

    ParamTypeDescription
    filePathstringPath to resource
    encodingstringCharacter encoding for the json

    Example

    getJSON(
    '/path/To/File',
    'utf8',
    );

    list

    list(dirPath, filter, [callback]) ⇒ Operation

    List files present in a directory

    ParamTypeDescription
    dirPathstringPath to remote directory
    filterfunctiona filter function used to select return entries
    [callback]functionOptional callback to handle the response

    Example: basic files listing

    list('/some/path/')

    Example: list files with filters

    list('/some/path/', file=> {
    return /foo.\.txt/.test(file.name);
    })

    Example: list files with filters and use callback

    list(
    "/some/path/",
    (file) => /foo.\.txt/.test(file.name),
    (state) => {
    const latestFile = state.data.filter(
    (file) => file.modifyTime <= new Date()
    );
    return { ...state, latestFile };
    }
    );

    normalizeCSVarray

    normalizeCSVarray(options, callback) ⇒ Operation

    Convert JSON array of strings into a normalized object

    ParamTypeDescription
    optionsoptionsOptions passed to csvtojson parser
    callbackcallbackOptions passed to csvtojson parser

    Example

    normalizeCSVarray({ delimiter: ';', noheader: true });

    putCSV

    putCSV(localFilePath, remoteFilePath, parsingOptions) ⇒ Operation

    Convert JSON to CSV and upload to an FTP server

    ParamTypeDescription
    localFilePathstringData source for data to copy to the remote server.
    remoteFilePathstringPath to the remote file to be created on the server.
    parsingOptionsobjectOptions which can be passed to adjust the read and write stream used in sending the data to the remote server

    Example

    putCSV(
    '/some/path/to_local_file.csv',
    '/some/path/to_remove_file.csv',
    { delimiter: ';', noheader: true }
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/sftp-readme.html b/adaptors/packages/sftp-readme.html index 00b56c2f6ca..5c22d63e70d 100644 --- a/adaptors/packages/sftp-readme.html +++ b/adaptors/packages/sftp-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ definition.

    List the content of a directory

    alterState(state => {
    return list('/path/To/Directory')(state).then(response => {
    console.log(`There are ${response.data.length} files.`);
    return response;
    });
    });

    sample getCSV expression

    getCSV('path/to/file.csv', 'utf8', {
    quote: 'off',
    delimiter: ';',
    noheader: true,
    filter: {
    type: 'startsWith',
    key: 'field1',
    value: 'JO',
    },
    });

    A more complex example that breaks up the CSV file into multiple payloads for quicker processing.

    fn(state => {
    return list('/')(state).then(state => {
    const targetNames = [
    'exportContacts', //example fileName
    ];
    console.log(`Fetching files: ${targetNames}`);
    const files = state.data
    .filter(file => file.name.split('.')[1] === 'csv')
    .filter(file =>
    targetNames.some(targetName =>
    file.name.toLowerCase().includes(targetName)
    )
    );

    if (files.length === 0) console.log('No new CSV files found.');
    return { ...state, data: {}, files };
    });
    });

    each(
    '$.files[*]',
    fn(state => {
    const { configuration, data } = state;

    return getCSV(`/${data.name}`)(state).then(async state => {
    const headers = state.data
    .shift()
    .split(';')
    .map(h => (h = h.replace(/"/g, '')));

    function toObject(item) {
    const values = item.split(';');

    return Object.fromEntries(
    headers.map((k, i) => {
    return values[i]
    ? [k, values[i].replace(/"/g, '')]
    : [k, values[i]];
    })
    );
    }

    let countInbox = 0;

    //to post CSV data as individual Messages to OpenFn Inbox
    const postToInbox = async data => {
    countInbox++;

    console.log(`Sending request ${countInbox} to inbox`);

    await new Promise(resolve => setTimeout(resolve, 200));

    await http.post({
    url: configuration.openfnInboxUrl,
    data: data,
    maxContentLength: Infinity,
    maxBodyLength: Infinity,
    })(state);
    };

    //To split up into multiple, smaller payloads before send to OpenFn Inbox
    const chunkSize = 500;

    console.log(
    state.data.length,
    'rows will be sent in',
    Math.ceil(state.data.length / chunkSize),
    'requests of',
    chunkSize,
    'rows each.'
    );

    while (state.data.length > 0) {
    console.log('data.length', state.data.length);
    await postToInbox({
    fileName: data.name,
    fileType: data.name.split('-')[0],
    uploadDate: new Date(data.modifyTime).toISOString(),
    json: state.data.splice(0, chunkSize).map(toObject),
    });
    }

    return { configuration, references: [], data: {} };
    });
    })
    );

    sample putCSV expression

    This function converts JSON to CSV and post to a server

    putCSV('/some/path/to_file.csv', 'utf8', { delimiter: ';', noheader: true });

    Get JSON from FTP server

    getJSON('path/to/file.json', 'utf8');

    Custom request to an http endpoint

    This adaptor exports http from language-common. Here, we outline the usage in order to make custom requests to an endpoint. It returns a promise

    alterState(state => {
    return http
    .post({ url: 'yourURL', data: { name: 'Mamadou' } })(state)
    .then(response => {
    // do something with response;
    return response;
    });
    });

    Development

    Clone the repo, run pnpm install.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build the docs for this repo, pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/smpp-changelog.html b/adaptors/packages/smpp-changelog.html index 8be419dc4cb..916c25d25db 100644 --- a/adaptors/packages/smpp-changelog.html +++ b/adaptors/packages/smpp-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.2.3

    Patch Changes

    1.2.2

    Patch Changes

    1.2.1

    Patch Changes

    1.2.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/smpp-configuration-schema.html b/adaptors/packages/smpp-configuration-schema.html index 512eff2d41b..8aa893f966c 100644 --- a/adaptors/packages/smpp-configuration-schema.html +++ b/adaptors/packages/smpp-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "clientHost": "https://some-smpp.com:3000",
    "systemId": "some_smpp_client_name",
    "inboxId": "1c908151-8273-431c-b1d4-blah",
    "password": "@some(!)StrongPassword"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "clientHost": {
    "title": "Client host",
    "type": "string",
    "description": "Your SMPP client host URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://some-smpp.com:3000"
    ]
    },
    "systemId": {
    "title": "System ID",
    "type": "string",
    "description": "Your SMPP client name",
    "minLength": 1,
    "examples": [
    "some_smpp_client_name"
    ]
    },
    "inboxId": {
    "title": "Inbox ID",
    "type": "string",
    "description": "Your SMPP client inbox ID",
    "minLength": 1,
    "examples": [
    "1c908151-8273-431c-b1d4-blah"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your SMPP client password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)StrongPassword"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "clientHost",
    "systemId",
    "inboxId",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/smpp-docs.html b/adaptors/packages/smpp-docs.html index 57d4ea0a90b..744c16425e9 100644 --- a/adaptors/packages/smpp-docs.html +++ b/adaptors/packages/smpp-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/smpp-readme.html b/adaptors/packages/smpp-readme.html index cec24fc39d1..0b90130153e 100644 --- a/adaptors/packages/smpp-readme.html +++ b/adaptors/packages/smpp-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    sample send expression

    send({
    text: dataValue('text'),
    smsId: dataValue('messageId'),
    recipient: dataValue('to'),
    sender: dataValue('from'),
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-changelog.html b/adaptors/packages/surveycto-changelog.html index 5588894ab22..f25734d1ffc 100644 --- a/adaptors/packages/surveycto-changelog.html +++ b/adaptors/packages/surveycto-changelog.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.1.4

    Patch Changes

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-configuration-schema.html b/adaptors/packages/surveycto-configuration-schema.html index 75cf8a3b804..0f5ced1abef 100644 --- a/adaptors/packages/surveycto-configuration-schema.html +++ b/adaptors/packages/surveycto-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "servername": "openfn_test",
    "username": "someusername",
    "password": "@some(%)!Password"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "servername": {
    "title": "Server Name",
    "type": "string",
    "description": "Your Surveycto server name also known as instance name",
    "minLength": 1,
    "examples": [
    "openfn_test"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Your Surveycto server username",
    "minLength": 1,
    "examples": [
    "someusername"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your Surveycto server password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(%)!Password"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "description": "The API version",
    "default": "v1",
    "examples": [
    "v1",
    "v2"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "servername",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-docs.html b/adaptors/packages/surveycto-docs.html index 24a798f8977..d45f04fbf29 100644 --- a/adaptors/packages/surveycto-docs.html +++ b/adaptors/packages/surveycto-docs.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ This supports natural language dates like now, today, yesterday, n hours ago, n days ago, and start, which will be converted into timestamp strings. See the usage guide at https://docs.openfn.org/documentation/jobs/job-writing-guide#using-cursors

    ParamTypeDescription
    valueanythe cursor value. Usually an ISO date, natural language date, or page number
    optionsobjectoptions to control the cursor.
    options.keystringset the cursor key. Will persist through the whole run.
    options.defaultValueanythe value to use if value is falsy
    options.formatfunctioncustom formatter for the final cursor value

    Example: Use a cursor from state if present, or else use the default value

    cursor('today')
    fetchSubmissions('test', { date: $.cursor });

    fetchSubmissions

    fetchSubmissions(formId, options, callback) ⇒ Operation

    Fetch form submissions.

    If a date filter is provided, it will be converted internally to the surveyCTO MMM dd, yyy h:mm:ss format (in UTC time).

    ParamTypeDescription
    formIdstringForm id
    optionsFetchSubmissionOptionsForm submission date, format, status parameters
    callbackfunction(Optional) Callback function

    Example: Fetch all form submissions

    fetchSubmissions('test');

    Example: With SurveyCTO date format (UTC)

    fetchSubmissions('test', { date: 'Apr 18, 2024 6:26:21 AM' });

    Example: Using a rolling cursor

    cursor((state) => state.cursor, { defaultValue: 'today' });
    fetchSubmissions('test', { date: (state) => state.cursor, format: 'csv' });
    cursor('now');

    Example: Formatting the results to CSV String

    fetchSubmissions('test', { format: 'csv' });

    Example: With reviewStatus filter

    fetchSubmissions('test', { status: 'approved|rejected' });

    Example: With a callback function

    fetchSubmissions(
    'test',
    {
    date: 'Apr 18, 2024 6:26:21 AM',
    },
    state => {
    console.log('Hello from the callback!');
    return state;
    }
    );

    request

    request(path, params, callback) ⇒ Operation

    Make a request in SurveyCTO API

    ParamTypeDescription
    pathstringPath to resource
    paramsRequestOptionsQuery, body and method parameters
    callbackfunction(Optional) Callback function

    Example

    request("/anEndpoint", {
    method: "POST",
    query: { foo: "bar", a: 1 },
    });

    Interfaces

    FetchSubmissionOptions

    Options provided to fetchSubmissions()

    Properties

    NameTypeDefaultDescription
    [date]string0Fetch only submissions from this timestamp. Acccepts SuvreyCTO date strings, unix and epoch timestamps, and ISO dates. By default, all submissions will be retrieved.
    [format]string"json"Format the submission data type as csv or json.
    [status]stringReview status. Can be either, approved, rejected, pending or combine eg `approved

    RequestOptions

    Options provided to request()

    Properties

    NameTypeDefaultDescription
    [headers]objectAn object of headers parameters.
    [body]objectBody data to append to the request.
    [query]objectAn object of query parameters to be encoded into the URL.
    [method]string"GET"The HTTP method to use.

    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-readme.html b/adaptors/packages/surveycto-readme.html index 5d785ac87e8..4bcf87c577f 100644 --- a/adaptors/packages/surveycto-readme.html +++ b/adaptors/packages/surveycto-readme.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ the job, subsequent runs will only fetch NEW submissions.

  • the postUrl is where the wide-format JSON representation of each form submission should be sent. Note that a formId key will be added to each form submission for later filtering/routing.

  • sample fetchSubmissions expression

    fetchSubmissions(
    // formId on SurveyCTO server
    'household_survey',
    // initialAfterDate: this will only be accessed if "lastSubmissionDate" is empty in your job_state".
    // After the initial run of the job, OpenFn will only pull new submissions from SurveyCTO.
    'Aug 29, 2016 4:44:26 PM',
    // postUrl is where you want to send the JSON submissions, appended with a new "formId" key
    'https://www.openfn.org/inbox/secret-inbox-uuid'
    );

    Development

    Clone the repo, run npm install.

    Run tests using npm run test or npm run test:watch

    Build the project using make.

    - + \ No newline at end of file diff --git a/adaptors/packages/telerivet-changelog.html b/adaptors/packages/telerivet-changelog.html index e16e5356ad5..fbcdd672c0d 100644 --- a/adaptors/packages/telerivet-changelog.html +++ b/adaptors/packages/telerivet-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.1.4

    Patch Changes

    0.1.3

    Patch Changes

    0.1.2

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/telerivet-configuration-schema.html b/adaptors/packages/telerivet-configuration-schema.html index 7ec4c17a506..761facf26ae 100644 --- a/adaptors/packages/telerivet-configuration-schema.html +++ b/adaptors/packages/telerivet-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "projectId": "telerivet_project_id",
    "apiKey": "telerivet_api_key"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "projectId": {
    "title": "Project ID",
    "type": "string",
    "description": "Your Telerivet project id",
    "minLength": 1,
    "examples": [
    "telerivet_project_id"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "Your Telerivet API Key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "telerivet_api_key"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "projectId",
    "apiKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/telerivet-docs.html b/adaptors/packages/telerivet-docs.html index 293e2f29dd1..a3d24e39650 100644 --- a/adaptors/packages/telerivet-docs.html +++ b/adaptors/packages/telerivet-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/telerivet-readme.html b/adaptors/packages/telerivet-readme.html index db4ae62921c..e098858dc14 100644 --- a/adaptors/packages/telerivet-readme.html +++ b/adaptors/packages/telerivet-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Send message

    Current send expression:

    send(
    fields(
    field('to_number', dataValue('recipient_number')),
    field('content', dataValue('recipient_text')),
    // Lots of optional parameters...
    field('message_type', 'sms'),
    field('route_id', dataValue('some_route'))
    )
    );

    sendBulk messages - WIP

    Current sendBulk expression:

    send(fields(
    field("content", dataValue("recipient_text")),
    field("to_numbers", [
    "+14155550123",
    "+14255550234",
    "+16505550345"
    ]
    // Lots of optional parameters...
    field("message_type", "sms"),
    field("route_id", dataValue("some_route"))
    ))

    Note that "recipient_text" may be a concatenation like this:

    field('content', function (state) {
    return dataValue('salutation')(state).concat(
    '. ',
    dataValue('last_name')(state),
    ', )'
    );
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/testing-changelog.html b/adaptors/packages/testing-changelog.html index c8213f8fda8..949c9f394ab 100644 --- a/adaptors/packages/testing-changelog.html +++ b/adaptors/packages/testing-changelog.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/testing-configuration-schema.html b/adaptors/packages/testing-configuration-schema.html index eedb0eb6c57..5be658e02f2 100644 --- a/adaptors/packages/testing-configuration-schema.html +++ b/adaptors/packages/testing-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {}

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {},
    "type": "object",
    "additionalProperties": true,
    "required": []
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/testing-docs.html b/adaptors/packages/testing-docs.html index 07ca9dfa286..ca3367dfacc 100644 --- a/adaptors/packages/testing-docs.html +++ b/adaptors/packages/testing-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/testing-readme.html b/adaptors/packages/testing-readme.html index d8b14e781b7..ff0d40e608f 100644 --- a/adaptors/packages/testing-readme.html +++ b/adaptors/packages/testing-readme.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/twilio-changelog.html b/adaptors/packages/twilio-changelog.html index db7aff8ccc9..b2bababa678 100644 --- a/adaptors/packages/twilio-changelog.html +++ b/adaptors/packages/twilio-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/twilio-configuration-schema.html b/adaptors/packages/twilio-configuration-schema.html index 6a1eb7f752b..cee8242d86f 100644 --- a/adaptors/packages/twilio-configuration-schema.html +++ b/adaptors/packages/twilio-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "accountSid": "account_id",
    "authToken": "evenMoreSecret"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "accountSid": {
    "title": "Account ID",
    "type": "string",
    "description": "Your Twilio account id",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "account_id"
    ]
    },
    "authToken": {
    "title": "Auth Token",
    "type": "string",
    "description": "Your Twilio auth token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "evenMoreSecret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "accountSid",
    "authToken"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/twilio-docs.html b/adaptors/packages/twilio-docs.html index 0dc9867878a..b9f8759d2e4 100644 --- a/adaptors/packages/twilio-docs.html +++ b/adaptors/packages/twilio-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/twilio-readme.html b/adaptors/packages/twilio-readme.html index c609cf8f3c1..0d57a7f5c77 100644 --- a/adaptors/packages/twilio-readme.html +++ b/adaptors/packages/twilio-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    sendSMS

    sample expression, sending an sms

    sendSMS({
    body: dataValue('text'),
    from: '+15005550006',
    to: dataValue('recipient'),
    });

    local usage

    ~/devtools/core/bin/core execute \
    -l ~/devtools/adaptors/language-twilio \
    -s ./tmp/state.json \
    -o ./tmp/output.json \
    -e ./tmp/expression.js

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/vtiger-changelog.html b/adaptors/packages/vtiger-changelog.html index f612b2aa7b1..7fbbb44c6a6 100644 --- a/adaptors/packages/vtiger-changelog.html +++ b/adaptors/packages/vtiger-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/vtiger-configuration-schema.html b/adaptors/packages/vtiger-configuration-schema.html index 0302fd7909c..abb9b1ab2cb 100644 --- a/adaptors/packages/vtiger-configuration-schema.html +++ b/adaptors/packages/vtiger-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "hostUrl": "https://openfunction.od2.vtiger.com",
    "username": "test@openfn.org",
    "accessToken": "@some()!veryHugeToke"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "hostUrl": {
    "title": "Host URL",
    "type": "string",
    "description": "VTiger instance host URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://openfunction.od2.vtiger.com"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "VTiger instance username",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "accessToken": {
    "title": "Access Token",
    "type": "string",
    "description": "VTiger instance access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some()!veryHugeToke"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "hostUrl",
    "username",
    "accessToken"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/vtiger-docs.html b/adaptors/packages/vtiger-docs.html index 45bed47f826..80d06f03001 100644 --- a/adaptors/packages/vtiger-docs.html +++ b/adaptors/packages/vtiger-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/vtiger-readme.html b/adaptors/packages/vtiger-readme.html index e84a7b0dbd0..e0b080789a9 100644 --- a/adaptors/packages/vtiger-readme.html +++ b/adaptors/packages/vtiger-readme.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    sample listTypes expression

    listTypes();

    sample postElement expression

    postElement({
    operation: "create"
    elementType: "leads",
    element: {
    "name": dataValue("name")(state),
    "surname": dataValue("surname")(state),
    "email": dataValue("email")(state)
    }
    });


    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/zoho-changelog.html b/adaptors/packages/zoho-changelog.html index 88dd0731067..e613d915690 100644 --- a/adaptors/packages/zoho-changelog.html +++ b/adaptors/packages/zoho-changelog.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/zoho-configuration-schema.html b/adaptors/packages/zoho-configuration-schema.html index 8550fae854a..008202b87f0 100644 --- a/adaptors/packages/zoho-configuration-schema.html +++ b/adaptors/packages/zoho-configuration-schema.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "account": "yourzohoaccount",
    "authToken": "secreauthtoken",
    "apiVersion": "v2"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "account": {
    "title": "Account",
    "type": "string",
    "description": "Your Zoho account",
    "minLength": 1,
    "examples": [
    "yourzohoaccount"
    ]
    },
    "authToken": {
    "title": "Auth Token",
    "type": "string",
    "description": "Your Zoho authentication token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "secreauthtoken"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "default": "v2",
    "enum": [
    "v1",
    "v2"
    ],
    "description": "Zoho API version",
    "minLength": 1,
    "examples": [
    "v2",
    "v1"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "account",
    "authToken",
    "apiVersion"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/zoho-docs.html b/adaptors/packages/zoho-docs.html index d9c909985f7..940e67936a3 100644 --- a/adaptors/packages/zoho-docs.html +++ b/adaptors/packages/zoho-docs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/zoho-readme.html b/adaptors/packages/zoho-readme.html index 8068cbc3f9a..9ac13a34f4e 100644 --- a/adaptors/packages/zoho-readme.html +++ b/adaptors/packages/zoho-readme.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ following addRow function.

    addRow(
    'testing_openfn',
    'Customers',
    fields(field('Subject', dataValue('formId')), field('Status', 'Closed'))
    );

    updateRow

    Coming soon. Want to help? https://zohoreportsapi.wiki.zoho.com/Updating-Data.html

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/postgresql.html b/adaptors/postgresql.html index 2302f4a7071..ccfcd662029 100644 --- a/adaptors/postgresql.html +++ b/adaptors/postgresql.html @@ -21,7 +21,7 @@ - + @@ -58,7 +58,7 @@ PostgreSQL adaptor.

    Implementation Examples

    1. Wildlife Conservation Society Kobo < > Database: https://github.com/OpenFn/consosci
    2. Cambodia Primero < > ONA Database: https://github.com/OpenFn/primero-ona-dashboard
    - + \ No newline at end of file diff --git a/adaptors/powerbi.html b/adaptors/powerbi.html index f59ecff433e..0bca4f01fdb 100644 --- a/adaptors/powerbi.html +++ b/adaptors/powerbi.html @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ structured database from it using MySQL. Once the structured database is established, OpenFn assists the iNGO with connecting this data to Power BI.

    Refer to the diagram below for a visualization of the data flow cited in the above use case.

    Tableau Data Flow Visualization

    - + \ No newline at end of file diff --git a/adaptors/primero.html b/adaptors/primero.html index 6d26fd0d357..f12b156daca 100644 --- a/adaptors/primero.html +++ b/adaptors/primero.html @@ -21,7 +21,7 @@ - + @@ -64,7 +64,7 @@ https://github.com/OpenFn/primero-ona-dashboard/
  • Gambella: UNICEF Primero < > UNHCR Progres: https://github.com/OpenFn/primero-progres
  • Thailand: UNICEF Primero < > MoPH HIS: https://github.com/OpenFn/primero-thailand
  • - + \ No newline at end of file diff --git a/adaptors/salesforce.html b/adaptors/salesforce.html index bb098558d94..ce32ed8b878 100644 --- a/adaptors/salesforce.html +++ b/adaptors/salesforce.html @@ -21,7 +21,7 @@ - + @@ -161,7 +161,7 @@ with a range of helper functions for common CRUD & upsert operations, and for accessing the Salesforce bulk API.

    Example Implementations

    - + \ No newline at end of file diff --git a/adaptors/surveycto.html b/adaptors/surveycto.html index 9348702e798..f0c8dfcb259 100644 --- a/adaptors/surveycto.html +++ b/adaptors/surveycto.html @@ -21,7 +21,7 @@ - + @@ -73,7 +73,7 @@ forms and data from the server. See SurveyCTO docs on managing user roles.

    - + \ No newline at end of file diff --git a/adaptors/tableau.html b/adaptors/tableau.html index ccd3fc9b75c..3857cf0727a 100644 --- a/adaptors/tableau.html +++ b/adaptors/tableau.html @@ -21,7 +21,7 @@ - + @@ -42,7 +42,7 @@ structured database from it using MySQL. Once the structured database is established, OpenFn assists the iNGO with connecting this data to Tableau.

    Refer to the diagram below for a visualization of the data flow cited in the above use case.

    Tableau Data Flow Visualization

    - + \ No newline at end of file diff --git a/articles.html b/articles.html index 3f969e3cdfe..cf847b53a96 100644 --- a/articles.html +++ b/articles.html @@ -21,7 +21,7 @@ - + @@ -74,7 +74,7 @@ someone else’s servers (SaaS), or on her organization’s own servers (deployed locally). Before making a decision she outlines the basic, non-technical considerations for both options.

    - + \ No newline at end of file diff --git a/articles/2020/06/16/how-information-is-organized.html b/articles/2020/06/16/how-information-is-organized.html index b8f0bb92bcc..5140b1c19d6 100644 --- a/articles/2020/06/16/how-information-is-organized.html +++ b/articles/2020/06/16/how-information-is-organized.html @@ -21,7 +21,7 @@ - + @@ -103,7 +103,7 @@ might be better off than those operating a well defined assembly-line with interchangeable parts. Alas, the middle way is probably the best.

    That’s all for now. More soon.

    Need help organizing or scaling your organization's information or process flows? Contact our team of ICT4D specialists at support@openfn.org.

    - + \ No newline at end of file diff --git a/articles/2020/06/24/three-questions-to-ask.html b/articles/2020/06/24/three-questions-to-ask.html index 8b14acd75b0..aca841ee33b 100644 --- a/articles/2020/06/24/three-questions-to-ask.html +++ b/articles/2020/06/24/three-questions-to-ask.html @@ -21,7 +21,7 @@ - + @@ -64,7 +64,7 @@ admin@openfn.org for support. Our team is always happy to assist and help you evaluate the total cost of ownership of automation solutions.

    - + \ No newline at end of file diff --git a/articles/2020/07/02/allow-yourself-to-fail.html b/articles/2020/07/02/allow-yourself-to-fail.html index ff3d2b7d422..fe56b907a05 100644 --- a/articles/2020/07/02/allow-yourself-to-fail.html +++ b/articles/2020/07/02/allow-yourself-to-fail.html @@ -21,7 +21,7 @@ - + @@ -53,7 +53,7 @@ design for idempotence. It's common sense when you're passing messages between two different systems that are bound to evolve, go offline, have a bad day, etc

    — Taylor

    Sign up{: .btn} to set up a project today, absolutely free.

    Reach out{: .btn} for more information.

    - + \ No newline at end of file diff --git a/articles/2020/07/14/cron-is-better-than-a-timer.html b/articles/2020/07/14/cron-is-better-than-a-timer.html index 785c5b85cbe..ca93e19925c 100644 --- a/articles/2020/07/14/cron-is-better-than-a-timer.html +++ b/articles/2020/07/14/cron-is-better-than-a-timer.html @@ -21,7 +21,7 @@ - + @@ -50,7 +50,7 @@ sign up for free or mess around with cron expressions at crontab.guru, a brilliant site to quickly build complex cron expressions.

    That's all from product for today. Speak soon.

    Taylor

    - + \ No newline at end of file diff --git a/articles/2020/12/09/upsert-in-dhis2.html b/articles/2020/12/09/upsert-in-dhis2.html index c7d775fd17b..b48abbd9ba9 100644 --- a/articles/2020/12/09/upsert-in-dhis2.html +++ b/articles/2020/12/09/upsert-in-dhis2.html @@ -21,7 +21,7 @@ - + @@ -52,7 +52,7 @@ about it over here.

    Please don’t hesitate to reach out to one of OpenFn’s implementation specialists if you’d like to learn more.

    — Taylor

    Sign up{: .btn} to set up a project today, absolutely free.

    Reach out{: .btn} for more information.

    - + \ No newline at end of file diff --git a/articles/2021/02/03/hosted-or-local-deployment.html b/articles/2021/02/03/hosted-or-local-deployment.html index f9569be42cb..5a679b7c3a8 100644 --- a/articles/2021/02/03/hosted-or-local-deployment.html +++ b/articles/2021/02/03/hosted-or-local-deployment.html @@ -21,7 +21,7 @@ - + @@ -88,7 +88,7 @@ likely be in a better position to know if you want to continue using the software for 5-10 years.

    Should you need any help with your decision though please do not hesitate to contact OpenFn.

    - + \ No newline at end of file diff --git a/articles/2021/02/17/syncing-options.html b/articles/2021/02/17/syncing-options.html index 329699a17b6..341a2bcac83 100644 --- a/articles/2021/02/17/syncing-options.html +++ b/articles/2021/02/17/syncing-options.html @@ -21,7 +21,7 @@ - + @@ -77,7 +77,7 @@ eventual syncing was more important than having real-time syncing.

    Both Sync Options Have Their Pros and Cons

    Both options definitely have their use-cases and OpenFn's platform versatility enables your team to decide which type of sync is right for your project.

    As always, we are here to help with any questions as you think through which sync option makes the most sense for your project.

    - + \ No newline at end of file diff --git a/articles/2021/05/24/commcare-events.html b/articles/2021/05/24/commcare-events.html index 5b25cf8146c..9dc12ffac49 100644 --- a/articles/2021/05/24/commcare-events.html +++ b/articles/2021/05/24/commcare-events.html @@ -21,7 +21,7 @@ - + @@ -117,7 +117,7 @@ head directly to the Job Library to see how other OpenFn users are creating their jobs.

    Either way, keep the community posted on your progress in the forum—you'll find lots of helpful folks willing to lend you a hand in your integration journey.

    - + \ No newline at end of file diff --git a/articles/2021/07/05/wrapping-my-head-around-jobs.html b/articles/2021/07/05/wrapping-my-head-around-jobs.html index ea2fc9bc058..d523a809f5c 100644 --- a/articles/2021/07/05/wrapping-my-head-around-jobs.html +++ b/articles/2021/07/05/wrapping-my-head-around-jobs.html @@ -21,7 +21,7 @@ - + @@ -105,7 +105,7 @@ complex, and are pushing our new documentation regularly, so please do get in touch if you think there are ways we could improve this type of walk-through/helper article.

    Happy integrating,

    Taylor

    - + \ No newline at end of file diff --git a/articles/2021/10/08/improving-multistage-docker-builds-using-buildx.html b/articles/2021/10/08/improving-multistage-docker-builds-using-buildx.html index 9e8202a53cf..79da7b7fc56 100644 --- a/articles/2021/10/08/improving-multistage-docker-builds-using-buildx.html +++ b/articles/2021/10/08/improving-multistage-docker-builds-using-buildx.html @@ -21,7 +21,7 @@ - + @@ -98,7 +98,7 @@ hey!

    Buildx has given me what I 'expected' with docker multi-stage builds, and having the cache in a repository completely side-steps having to attach a shared volume or copying from a storage bucket.

    Resources

    - + \ No newline at end of file diff --git a/articles/2021/10/15/webpack-to-esbuild-part1.html b/articles/2021/10/15/webpack-to-esbuild-part1.html index e92035d840b..8d8d47058d4 100644 --- a/articles/2021/10/15/webpack-to-esbuild-part1.html +++ b/articles/2021/10/15/webpack-to-esbuild-part1.html @@ -21,7 +21,7 @@ - + @@ -81,7 +81,7 @@ minified and split production build takes about 34s with webpack and that's on my i7 desktop machine, and 197s (3+ mins) on CI/CD.

    What's next?

    So our 'can we actually do this' seems to have gone pretty well so far. I'm really excited about what this will give us in the end.

    But a shell command doth not a replacement for webpack make. We still need to:

    1. Get Phoenix to use esbuild and watch our files as we work.
    2. Ensure that our html templates serve the correct files in dev & production.
      Including our CSS that is no longer injected into the DOM.
    3. Split at least our vendored modules into their own bundle.
    4. Make sure sourcemaps generate correctly for when we upload them to Sentry.
    5. Have some kind of cache-busting naming scheme for production builds.

    Resources

    - + \ No newline at end of file diff --git a/articles/2021/10/22/testing-react-app-with-jest-hound.html b/articles/2021/10/22/testing-react-app-with-jest-hound.html index bf69800b7f0..93a455ac797 100644 --- a/articles/2021/10/22/testing-react-app-with-jest-hound.html +++ b/articles/2021/10/22/testing-react-app-with-jest-hound.html @@ -21,7 +21,7 @@ - + @@ -116,7 +116,7 @@ guarantee a maintainable codebase and a progressive software application.
    Still looking for the legend's advice?

    Gotcha, here you go...

    1. Swallow your pride and be humble: always do manual testing!
    2. Click test your way through the manual test cases for every new deployment, catching regressions.
    3. Lock in your fixes and new features as unit tests, integration tests, and end-to-end tests.

    Happy testing,

    Chaiwa

    - + \ No newline at end of file diff --git a/articles/2021/10/29/how-learning-javascript-helped-me-better-understand-jobs.html b/articles/2021/10/29/how-learning-javascript-helped-me-better-understand-jobs.html index 51af23f6df7..0ba58d36185 100644 --- a/articles/2021/10/29/how-learning-javascript-helped-me-better-understand-jobs.html +++ b/articles/2021/10/29/how-learning-javascript-helped-me-better-understand-jobs.html @@ -21,7 +21,7 @@ - + @@ -116,7 +116,7 @@ to store various keyed collections and more complex entities."

    Next steps

    I'm well on my way to becoming a better job reader and writer. Here are some next steps:

    1. Understand fn(state) and how state can be manipulated in OpenFn jobs.

    2. Explore what's available on the JavaScript docs site.

    3. Sign up for the next level JavaScript course.

    - + \ No newline at end of file diff --git a/articles/2022/06/07/workflow-automation.html b/articles/2022/06/07/workflow-automation.html index 0ee95b80984..df716ee7cfb 100644 --- a/articles/2022/06/07/workflow-automation.html +++ b/articles/2022/06/07/workflow-automation.html @@ -21,7 +21,7 @@ - + @@ -114,7 +114,7 @@ DPG, OpenFn’s core technology is free and open-source. If you want more information about the Toolkit or to sign up for a free plan on our associated SaaS application, visit https://www.openfn.org/.

    - + \ No newline at end of file diff --git a/articles/2022/09/19/auth-security.html b/articles/2022/09/19/auth-security.html index 985ea53cbf7..7560170d3aa 100644 --- a/articles/2022/09/19/auth-security.html +++ b/articles/2022/09/19/auth-security.html @@ -21,7 +21,7 @@ - + @@ -76,7 +76,7 @@ security experts and international standards, including GovStack, OpenHIE, OWASP, NIST, and more.

    The resource can be found here.

    - + \ No newline at end of file diff --git a/articles/archive.html b/articles/archive.html index bad358a5d6f..6a01fd9663d 100644 --- a/articles/archive.html +++ b/articles/archive.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content

    Archive

    Archive

    - + \ No newline at end of file diff --git a/articles/page/2.html b/articles/page/2.html index 8be80c34624..9c429944de9 100644 --- a/articles/page/2.html +++ b/articles/page/2.html @@ -21,7 +21,7 @@ - + @@ -46,7 +46,7 @@ a non-profit is organized. I thought I was getting into a technical discussion—I’ve been doing system architecture discussions for years—but what we ended up talking about was how this NGO thinks.

    - + \ No newline at end of file diff --git a/articles/tags.html b/articles/tags.html index 102257f46d2..75fad5aa9bf 100644 --- a/articles/tags.html +++ b/articles/tags.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/tags/annoucement.html b/articles/tags/annoucement.html index b6f4fde5abc..fb9ab85a680 100644 --- a/articles/tags/annoucement.html +++ b/articles/tags/annoucement.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/tags/authentication.html b/articles/tags/authentication.html index cb4d3c76f68..ba3a9d5969d 100644 --- a/articles/tags/authentication.html +++ b/articles/tags/authentication.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ Goods achieve just this. You can view and comment on the resource here, or read on to learn why.

    - + \ No newline at end of file diff --git a/articles/tags/authorization.html b/articles/tags/authorization.html index c5944bfc51a..d851ee8b75b 100644 --- a/articles/tags/authorization.html +++ b/articles/tags/authorization.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ Goods achieve just this. You can view and comment on the resource here, or read on to learn why.

    - + \ No newline at end of file diff --git a/articles/tags/automation.html b/articles/tags/automation.html index ce849cc164b..997314ddccb 100644 --- a/articles/tags/automation.html +++ b/articles/tags/automation.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ supply chain systems, tracking clinical visits, and helping plan vaccine rollouts. We support our partners’ work by lifting the burden of manual data transfers between platforms.

    - + \ No newline at end of file diff --git a/articles/tags/browser-testing.html b/articles/tags/browser-testing.html index fa1d3876a51..c9159d86857 100644 --- a/articles/tags/browser-testing.html +++ b/articles/tags/browser-testing.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ React/Redux app with a Phoenix/Elixir backend.

    - + \ No newline at end of file diff --git a/articles/tags/build.html b/articles/tags/build.html index 4cfb6bfb817..aaecdd2112a 100644 --- a/articles/tags/build.html +++ b/articles/tags/build.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ using it continuously for about 6 years - upgrades and all. Our front-end toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    - + \ No newline at end of file diff --git a/articles/tags/ci-cd.html b/articles/tags/ci-cd.html index 66546017f97..1369a806444 100644 --- a/articles/tags/ci-cd.html +++ b/articles/tags/ci-cd.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    · 6 min read

    So you're using docker's multi-stage builds and noticed that your build times aren't nearly as quick as you expected?

    - + \ No newline at end of file diff --git a/articles/tags/docker.html b/articles/tags/docker.html index 10c25462e41..b3b44395f38 100644 --- a/articles/tags/docker.html +++ b/articles/tags/docker.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/tags/elixir.html b/articles/tags/elixir.html index 3da7f95a838..aa2f1cc2476 100644 --- a/articles/tags/elixir.html +++ b/articles/tags/elixir.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ React/Redux app with a Phoenix/Elixir backend.

    - + \ No newline at end of file diff --git a/articles/tags/how-to.html b/articles/tags/how-to.html index 97b13e24bea..a9326484596 100644 --- a/articles/tags/how-to.html +++ b/articles/tags/how-to.html @@ -21,7 +21,7 @@ - + @@ -68,7 +68,7 @@ a non-profit is organized. I thought I was getting into a technical discussion—I’ve been doing system architecture discussions for years—but what we ended up talking about was how this NGO thinks.

    - + \ No newline at end of file diff --git a/articles/tags/javascript.html b/articles/tags/javascript.html index 7d078d31c1d..1ee90d69979 100644 --- a/articles/tags/javascript.html +++ b/articles/tags/javascript.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ your job writing on OpenFn to the next level. To improve my limited knowledge of JavaScript, I have been taking Codecademy's Introduction to JavaScript Course.

    - + \ No newline at end of file diff --git a/articles/tags/jobs.html b/articles/tags/jobs.html index da086819b7b..dba810a472f 100644 --- a/articles/tags/jobs.html +++ b/articles/tags/jobs.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ JavaScript, I have been taking Codecademy's Introduction to JavaScript Course.

    · 9 min read

    Jobs are business processes turned into functional-style scripts. What does that mean, how should you approach writing jobs?

    - + \ No newline at end of file diff --git a/articles/tags/js.html b/articles/tags/js.html index 74321bc3c5f..d83038512ce 100644 --- a/articles/tags/js.html +++ b/articles/tags/js.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ using it continuously for about 6 years - upgrades and all. Our front-end toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    - + \ No newline at end of file diff --git a/articles/tags/learning.html b/articles/tags/learning.html index 8cd38c8e668..8738c8430f3 100644 --- a/articles/tags/learning.html +++ b/articles/tags/learning.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ your job writing on OpenFn to the next level. To improve my limited knowledge of JavaScript, I have been taking Codecademy's Introduction to JavaScript Course.

    - + \ No newline at end of file diff --git a/articles/tags/phoenix.html b/articles/tags/phoenix.html index b8ff9ab57f5..dc1822028bb 100644 --- a/articles/tags/phoenix.html +++ b/articles/tags/phoenix.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ using it continuously for about 6 years - upgrades and all. Our front-end toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    - + \ No newline at end of file diff --git a/articles/tags/react.html b/articles/tags/react.html index 6c61769a377..9765bc9f3cd 100644 --- a/articles/tags/react.html +++ b/articles/tags/react.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ React/Redux app with a Phoenix/Elixir backend.

    - + \ No newline at end of file diff --git a/articles/tags/security.html b/articles/tags/security.html index c91ea449b7f..479c1699024 100644 --- a/articles/tags/security.html +++ b/articles/tags/security.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ Goods achieve just this. You can view and comment on the resource here, or read on to learn why.

    - + \ No newline at end of file diff --git a/articles/tags/solution.html b/articles/tags/solution.html index 3d61e99ee4c..1e354698c77 100644 --- a/articles/tags/solution.html +++ b/articles/tags/solution.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ supply chain systems, tracking clinical visits, and helping plan vaccine rollouts. We support our partners’ work by lifting the burden of manual data transfers between platforms.

    - + \ No newline at end of file diff --git a/articles/tags/testing.html b/articles/tags/testing.html index 0fbc70ef3b2..00d8a2b5b60 100644 --- a/articles/tags/testing.html +++ b/articles/tags/testing.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ React/Redux app with a Phoenix/Elixir backend.

    - + \ No newline at end of file diff --git a/articles/tags/tips.html b/articles/tags/tips.html index ba2579d0d0d..a37ea8e333d 100644 --- a/articles/tags/tips.html +++ b/articles/tags/tips.html @@ -21,7 +21,7 @@ - + @@ -69,7 +69,7 @@ "idempotence."

    · 3 min read

    Automation can save time, unlock critical resources, and enable scale–but it typically requires investment to set up. Wondering whether you should automate your processes? Ask yourself these 3 questions.

    - + \ No newline at end of file diff --git a/articles/tags/tips/page/2.html b/articles/tags/tips/page/2.html index 36128780b48..0c2f677db60 100644 --- a/articles/tags/tips/page/2.html +++ b/articles/tags/tips/page/2.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ a non-profit is organized. I thought I was getting into a technical discussion—I’ve been doing system architecture discussions for years—but what we ended up talking about was how this NGO thinks.

    - + \ No newline at end of file diff --git a/articles/tags/webpack.html b/articles/tags/webpack.html index 6267c9a613d..69fb4510af7 100644 --- a/articles/tags/webpack.html +++ b/articles/tags/webpack.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ using it continuously for about 6 years - upgrades and all. Our front-end toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    - + \ No newline at end of file diff --git a/assets/js/1a98f2d5.603daa6e.js b/assets/js/1a98f2d5.c4eda0e9.js similarity index 99% rename from assets/js/1a98f2d5.603daa6e.js rename to assets/js/1a98f2d5.c4eda0e9.js index af2441e8cb1..b22ebdbb2bb 100644 --- a/assets/js/1a98f2d5.603daa6e.js +++ b/assets/js/1a98f2d5.c4eda0e9.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_openfn_docs=self.webpackChunk_openfn_docs||[]).push([[49195],{25164:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>m,frontMatter:()=>o,metadata:()=>i,toc:()=>p});var a=t(58168),r=(t(96540),t(15680));const o={title:"Config for mssql",id:"mssql-configuration-schema",keywords:["adaptor","configuration-schema","mssql"]},s=void 0,i={unversionedId:"packages/mssql-configuration-schema",id:"packages/mssql-configuration-schema",title:"Config for mssql",description:"Jobs that use the mssql adaptor may require authentication. A",source:"@site/adaptors/packages/mssql-configuration-schema.md",sourceDirName:"packages",slug:"/packages/mssql-configuration-schema",permalink:"/adaptors/packages/mssql-configuration-schema",draft:!1,tags:[],version:"current",frontMatter:{title:"Config for mssql",id:"mssql-configuration-schema",keywords:["adaptor","configuration-schema","mssql"]},sidebar:"adaptors",previous:{title:"mssql@5.0.3",permalink:"/adaptors/packages/mssql-docs"},next:{title:"Extract Vitas Data",permalink:"/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11"}},l={},p=[{value:"Sample Configuration",id:"sample-configuration",level:2},{value:"Full Schema",id:"full-schema",level:2}],c={toc:p},u="wrapper";function m(e){let{components:n,...t}=e;return(0,r.yg)(u,(0,a.A)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"Jobs that use the ",(0,r.yg)("inlineCode",{parentName:"p"},"mssql"),' adaptor may require authentication. A\n"credential" for the ',(0,r.yg)("inlineCode",{parentName:"p"},"mssql")," adaptor will follow the schema below. When\nusing the CLI, you can set up your own ",(0,r.yg)("inlineCode",{parentName:"p"},"state.configuration")," by using the\nsample below."),(0,r.yg)("h2",{id:"sample-configuration"},"Sample Configuration"),(0,r.yg)("p",null," Paste this into the ",(0,r.yg)("inlineCode",{parentName:"p"},"configuration")," key of your ",(0,r.yg)("inlineCode",{parentName:"p"},"state.json")," file and\nmodify the values to run jobs locally."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "server": "something.database.windows.net",\n "database": "demo-db",\n "userName": "admin",\n "password": "@super(!)Password"\n}\n')),(0,r.yg)("h2",{id:"full-schema"},"Full Schema"),(0,r.yg)("p",null," The full configuration schema describes each attribute of the credential and\nnotes those that are required."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "$schema": "https://json-schema.org/draft-07/schema#",\n "properties": {\n "server": {\n "title": "Server URL",\n "description": "The database instance server URL or IP address",\n "type": "string",\n "minLength": 1,\n "examples": [\n "something.database.windows.net",\n "192.168.12.10"\n ]\n },\n "database": {\n "title": "Database",\n "type": "string",\n "description": "The database name",\n "minLength": 1,\n "examples": [\n "demo-db"\n ]\n },\n "userName": {\n "title": "Username",\n "type": "string",\n "description": "Username",\n "minLength": 1,\n "examples": [\n "admin"\n ]\n },\n "password": {\n "title": "Password",\n "type": "string",\n "description": "Password",\n "writeOnly": true,\n "minLength": 1,\n "examples": [\n "@super(!)Password"\n ]\n },\n "port": {\n "title": "Port",\n "description": "Database instance port",\n "type": "integer",\n "default": 1433,\n "examples": [\n 1432\n ]\n },\n "encrypt": {\n "type": "boolean",\n "default": true,\n "examples": [\n false\n ]\n },\n "rowCollectionOnRequestCompletion": {\n "type": "boolean",\n "default": true,\n "examples": [\n false\n ]\n },\n "trustServerCertificate": {\n "type": "boolean",\n "default": true,\n "examples": [\n false\n ]\n }\n },\n "type": "object",\n "additionalProperties": true,\n "required": [\n "server",\n "database",\n "userName",\n "password"\n ]\n}\n')))}m.isMDXComponent=!0},15680:(e,n,t)=>{t.d(n,{xA:()=>c,yg:()=>f});var a=t(96540);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function s(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=a.createContext({}),p=function(e){var n=a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):s(s({},n),e)),t},c=function(e){var n=p(e.components);return a.createElement(l.Provider,{value:n},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},d=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),u=p(t),d=r,f=u["".concat(l,".").concat(d)]||u[d]||m[d]||o;return t?a.createElement(f,s(s({ref:n},c),{},{components:t})):a.createElement(f,s({ref:n},c))}));function f(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,s=new Array(o);s[0]=d;var i={};for(var l in n)hasOwnProperty.call(n,l)&&(i[l]=n[l]);i.originalType=e,i[u]="string"==typeof e?e:r,s[1]=i;for(var p=2;p{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>m,frontMatter:()=>o,metadata:()=>i,toc:()=>p});var a=t(58168),r=(t(96540),t(15680));const o={title:"Config for mssql",id:"mssql-configuration-schema",keywords:["adaptor","configuration-schema","mssql"]},s=void 0,i={unversionedId:"packages/mssql-configuration-schema",id:"packages/mssql-configuration-schema",title:"Config for mssql",description:"Jobs that use the mssql adaptor may require authentication. A",source:"@site/adaptors/packages/mssql-configuration-schema.md",sourceDirName:"packages",slug:"/packages/mssql-configuration-schema",permalink:"/adaptors/packages/mssql-configuration-schema",draft:!1,tags:[],version:"current",frontMatter:{title:"Config for mssql",id:"mssql-configuration-schema",keywords:["adaptor","configuration-schema","mssql"]},sidebar:"adaptors",previous:{title:"mssql@5.0.4",permalink:"/adaptors/packages/mssql-docs"},next:{title:"Extract Vitas Data",permalink:"/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11"}},l={},p=[{value:"Sample Configuration",id:"sample-configuration",level:2},{value:"Full Schema",id:"full-schema",level:2}],c={toc:p},u="wrapper";function m(e){let{components:n,...t}=e;return(0,r.yg)(u,(0,a.A)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"Jobs that use the ",(0,r.yg)("inlineCode",{parentName:"p"},"mssql"),' adaptor may require authentication. A\n"credential" for the ',(0,r.yg)("inlineCode",{parentName:"p"},"mssql")," adaptor will follow the schema below. When\nusing the CLI, you can set up your own ",(0,r.yg)("inlineCode",{parentName:"p"},"state.configuration")," by using the\nsample below."),(0,r.yg)("h2",{id:"sample-configuration"},"Sample Configuration"),(0,r.yg)("p",null," Paste this into the ",(0,r.yg)("inlineCode",{parentName:"p"},"configuration")," key of your ",(0,r.yg)("inlineCode",{parentName:"p"},"state.json")," file and\nmodify the values to run jobs locally."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "server": "something.database.windows.net",\n "database": "demo-db",\n "userName": "admin",\n "password": "@super(!)Password"\n}\n')),(0,r.yg)("h2",{id:"full-schema"},"Full Schema"),(0,r.yg)("p",null," The full configuration schema describes each attribute of the credential and\nnotes those that are required."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "$schema": "https://json-schema.org/draft-07/schema#",\n "properties": {\n "server": {\n "title": "Server URL",\n "description": "The database instance server URL or IP address",\n "type": "string",\n "minLength": 1,\n "examples": [\n "something.database.windows.net",\n "192.168.12.10"\n ]\n },\n "database": {\n "title": "Database",\n "type": "string",\n "description": "The database name",\n "minLength": 1,\n "examples": [\n "demo-db"\n ]\n },\n "userName": {\n "title": "Username",\n "type": "string",\n "description": "Username",\n "minLength": 1,\n "examples": [\n "admin"\n ]\n },\n "password": {\n "title": "Password",\n "type": "string",\n "description": "Password",\n "writeOnly": true,\n "minLength": 1,\n "examples": [\n "@super(!)Password"\n ]\n },\n "port": {\n "title": "Port",\n "description": "Database instance port",\n "type": "integer",\n "default": 1433,\n "examples": [\n 1432\n ]\n },\n "encrypt": {\n "type": "boolean",\n "default": true,\n "examples": [\n false\n ]\n },\n "rowCollectionOnRequestCompletion": {\n "type": "boolean",\n "default": true,\n "examples": [\n false\n ]\n },\n "trustServerCertificate": {\n "type": "boolean",\n "default": true,\n "examples": [\n false\n ]\n }\n },\n "type": "object",\n "additionalProperties": true,\n "required": [\n "server",\n "database",\n "userName",\n "password"\n ]\n}\n')))}m.isMDXComponent=!0},15680:(e,n,t)=>{t.d(n,{xA:()=>c,yg:()=>f});var a=t(96540);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function s(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=a.createContext({}),p=function(e){var n=a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):s(s({},n),e)),t},c=function(e){var n=p(e.components);return a.createElement(l.Provider,{value:n},e.children)},u="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},d=a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),u=p(t),d=r,f=u["".concat(l,".").concat(d)]||u[d]||m[d]||o;return t?a.createElement(f,s(s({ref:n},c),{},{components:t})):a.createElement(f,s({ref:n},c))}));function f(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,s=new Array(o);s[0]=d;var i={};for(var l in n)hasOwnProperty.call(n,l)&&(i[l]=n[l]);i.originalType=e,i[u]="string"==typeof e?e:r,s[1]=i;for(var p=2;p{n.r(a),n.d(a,{assets:()=>h,contentTitle:()=>i,default:()=>o,frontMatter:()=>t,metadata:()=>c,toc:()=>p});var l=n(58168),g=(n(96540),n(15680));const t={title:"mssql changelog",id:"mssql-changelog",keywords:["adaptor","changelog","mssql"]},i="Changelog for the mssql adaptor",c={unversionedId:"packages/mssql-changelog",id:"packages/mssql-changelog",title:"mssql changelog",description:"5.0.3",source:"@site/adaptors/packages/mssql-changelog.md",sourceDirName:"packages",slug:"/packages/mssql-changelog",permalink:"/adaptors/packages/mssql-changelog",draft:!1,tags:[],version:"current",frontMatter:{title:"mssql changelog",id:"mssql-changelog",keywords:["adaptor","changelog","mssql"]},sidebar:"adaptors",previous:{title:"CommCare to Azure Sql",permalink:"/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27"},next:{title:"mssql developer readme",permalink:"/adaptors/packages/mssql-readme"}},h={},p=[{value:"5.0.3",id:"503",level:2},{value:"Patch Changes",id:"patch-changes",level:3},{value:"5.0.2",id:"502",level:2},{value:"Patch Changes",id:"patch-changes-1",level:3},{value:"5.0.1",id:"501",level:2},{value:"Patch Changes",id:"patch-changes-2",level:3},{value:"5.0.0",id:"500",level:2},{value:"Major Changes",id:"major-changes",level:3},{value:"4.3.4",id:"434",level:2},{value:"Patch Changes",id:"patch-changes-3",level:3},{value:"4.3.3",id:"433",level:2},{value:"Patch Changes",id:"patch-changes-4",level:3},{value:"4.3.2",id:"432",level:2},{value:"Patch Changes",id:"patch-changes-5",level:3},{value:"4.3.1",id:"431",level:2},{value:"Patch Changes",id:"patch-changes-6",level:3},{value:"4.3.0",id:"430",level:2},{value:"Minor Changes",id:"minor-changes",level:3},{value:"Patch Changes",id:"patch-changes-7",level:3},{value:"4.2.4",id:"424",level:2},{value:"Patch Changes",id:"patch-changes-8",level:3},{value:"4.2.3",id:"423",level:2},{value:"Patch Changes",id:"patch-changes-9",level:3},{value:"4.2.2",id:"422",level:2},{value:"Patch Changes",id:"patch-changes-10",level:3},{value:"4.2.1",id:"421",level:2},{value:"Patch Changes",id:"patch-changes-11",level:3},{value:"4.2.0",id:"420",level:2},{value:"Minor Changes",id:"minor-changes-1",level:3},{value:"4.1.10",id:"4110",level:2},{value:"Patch Changes",id:"patch-changes-12",level:3},{value:"4.1.9",id:"419",level:2},{value:"Patch Changes",id:"patch-changes-13",level:3},{value:"4.1.8",id:"418",level:2},{value:"Patch Changes",id:"patch-changes-14",level:3},{value:"4.1.7",id:"417",level:2},{value:"Patch Changes",id:"patch-changes-15",level:3},{value:"4.1.6",id:"416",level:2},{value:"Patch Changes",id:"patch-changes-16",level:3},{value:"4.1.5",id:"415",level:2},{value:"Patch Changes",id:"patch-changes-17",level:3},{value:"4.1.4",id:"414",level:2},{value:"Patch Changes",id:"patch-changes-18",level:3},{value:"4.1.3",id:"413",level:2},{value:"Patch Changes",id:"patch-changes-19",level:3},{value:"4.1.2",id:"412",level:2},{value:"Patch Changes",id:"patch-changes-20",level:3},{value:"4.1.1",id:"411",level:2},{value:"Patch Changes",id:"patch-changes-21",level:3},{value:"4.1.0",id:"410",level:2},{value:"Minor Changes",id:"minor-changes-2",level:3},{value:"Patch Changes",id:"patch-changes-22",level:3},{value:"4.0.8",id:"408",level:2},{value:"Patch Changes",id:"patch-changes-23",level:3},{value:"4.0.7",id:"407",level:2},{value:"Patch Changes",id:"patch-changes-24",level:3},{value:"4.0.6",id:"406",level:2},{value:"Patch Changes",id:"patch-changes-25",level:3},{value:"4.0.5",id:"405",level:2},{value:"Patch Changes",id:"patch-changes-26",level:3},{value:"4.0.4",id:"404",level:2},{value:"Patch Changes",id:"patch-changes-27",level:3},{value:"4.0.3",id:"403",level:2},{value:"Patch Changes",id:"patch-changes-28",level:3},{value:"4.0.2",id:"402",level:2},{value:"Patch Changes",id:"patch-changes-29",level:3},{value:"4.0.1",id:"401",level:2},{value:"Patch Changes",id:"patch-changes-30",level:3},{value:"4.0.0",id:"400",level:2},{value:"Major Changes",id:"major-changes-1",level:3},{value:"Patch Changes",id:"patch-changes-31",level:3},{value:"3.1.1",id:"311",level:2},{value:"Patch Changes",id:"patch-changes-32",level:3},{value:"3.1.0",id:"310",level:2},{value:"Minor Changes",id:"minor-changes-3",level:3},{value:"Patch Changes",id:"patch-changes-33",level:3}],r={toc:p},u="wrapper";function o(e){let{components:a,...n}=e;return(0,g.yg)(u,(0,l.A)({},r,n,{components:a,mdxType:"MDXLayout"}),(0,g.yg)("h1",{id:"changelog-for-the-mssql-adaptor"},"Changelog for the mssql adaptor"),(0,g.yg)("h1",{id:"openfnlanguage-mssql"},"@openfn/language-mssql"),(0,g.yg)("h2",{id:"503"},"5.0.3"),(0,g.yg)("h3",{id:"patch-changes"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"6d38a48: Removed process.exit(1) to prevent workflow crashes on errors")),(0,g.yg)("h2",{id:"502"},"5.0.2"),(0,g.yg)("h3",{id:"patch-changes-1"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[77a690f]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@2.0.2"},"language-common@2.0.2"))))),(0,g.yg)("h2",{id:"501"},"5.0.1"),(0,g.yg)("h3",{id:"patch-changes-2"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"8146c23: Fix typings in package.json"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[8146c23]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@2.0.1"},"language-common@2.0.1"))))),(0,g.yg)("h2",{id:"500"},"5.0.0"),(0,g.yg)("h3",{id:"major-changes"},"Major Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Export new common http helpers (http namespace)")),(0,g.yg)("h2",{id:"434"},"4.3.4"),(0,g.yg)("h3",{id:"patch-changes-3"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[4fe527c]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@2.0.0"},"language-common@2.0.0"))))),(0,g.yg)("h2",{id:"433"},"4.3.3"),(0,g.yg)("h3",{id:"patch-changes-4"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[4c08444]"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[73d0a02]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.15.1"},"language-common@1.15.1"))))),(0,g.yg)("h2",{id:"432"},"4.3.2"),(0,g.yg)("h3",{id:"patch-changes-5"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"bb5436c: Add title and description for ",(0,g.yg)("inlineCode",{parentName:"li"},"port")," configuration")),(0,g.yg)("h2",{id:"431"},"4.3.1"),(0,g.yg)("h3",{id:"patch-changes-6"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[5fb82f07]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.15.0"},"language-common@1.15.0"))))),(0,g.yg)("h2",{id:"430"},"4.3.0"),(0,g.yg)("h3",{id:"minor-changes"},"Minor Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"73433c20: Add ",(0,g.yg)("inlineCode",{parentName:"li"},"fnIf")," operation")),(0,g.yg)("h3",{id:"patch-changes-7"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[106ecf6d]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.14.0"},"language-common@1.14.0"))))),(0,g.yg)("h2",{id:"424"},"4.2.4"),(0,g.yg)("h3",{id:"patch-changes-8"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.5"},"language-common@1.13.5"))))),(0,g.yg)("h2",{id:"423"},"4.2.3"),(0,g.yg)("h3",{id:"patch-changes-9"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[12f02ed5]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.4"},"language-common@1.13.4"))))),(0,g.yg)("h2",{id:"422"},"4.2.2"),(0,g.yg)("h3",{id:"patch-changes-10"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[88f99a8f]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.3"},"language-common@1.13.3"))))),(0,g.yg)("h2",{id:"421"},"4.2.1"),(0,g.yg)("h3",{id:"patch-changes-11"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.2"},"language-common@1.13.2"))))),(0,g.yg)("h2",{id:"420"},"4.2.0"),(0,g.yg)("h3",{id:"minor-changes-1"},"Minor Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"2964fc8d: - Add ",(0,g.yg)("inlineCode",{parentName:"li"},"cursor()")," function",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"Update ",(0,g.yg)("inlineCode",{parentName:"li"},"configuration-schema.json"))))),(0,g.yg)("h2",{id:"4110"},"4.1.10"),(0,g.yg)("h3",{id:"patch-changes-12"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.1"},"language-common@1.13.1"))))),(0,g.yg)("h2",{id:"419"},"4.1.9"),(0,g.yg)("h3",{id:"patch-changes-13"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[1ad86651]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.0"},"language-common@1.13.0"))))),(0,g.yg)("h2",{id:"418"},"4.1.8"),(0,g.yg)("h3",{id:"patch-changes-14"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[c19efbe]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.11.1"},"language-common@1.11.1"))))),(0,g.yg)("h2",{id:"417"},"4.1.7"),(0,g.yg)("h3",{id:"patch-changes-15"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[85c35b8]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.11.0"},"language-common@1.11.0"))))),(0,g.yg)("h2",{id:"416"},"4.1.6"),(0,g.yg)("h3",{id:"patch-changes-16"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[df09270]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.10.3"},"language-common@1.10.3"))))),(0,g.yg)("h2",{id:"415"},"4.1.5"),(0,g.yg)("h3",{id:"patch-changes-17"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[26a303e]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.10.2"},"language-common@1.10.2"))))),(0,g.yg)("h2",{id:"414"},"4.1.4"),(0,g.yg)("h3",{id:"patch-changes-18"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[8c32eb3]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.10.1"},"language-common@1.10.1"))))),(0,g.yg)("h2",{id:"413"},"4.1.3"),(0,g.yg)("h3",{id:"patch-changes-19"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[aad9549]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.10.0"},"language-common@1.10.0"))))),(0,g.yg)("h2",{id:"412"},"4.1.2"),(0,g.yg)("h3",{id:"patch-changes-20"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[111807f]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.9.0"},"language-common@1.9.0"))))),(0,g.yg)("h2",{id:"411"},"4.1.1"),(0,g.yg)("h3",{id:"patch-changes-21"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Update lock files"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.8.1"},"language-common@1.8.1"))))),(0,g.yg)("h2",{id:"410"},"4.1.0"),(0,g.yg)("h3",{id:"minor-changes-2"},"Minor Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},(0,g.yg)("p",{parentName:"li"},"2c1d603: Remove parameter reassignment to ensure proper functioning inside an\n",(0,g.yg)("inlineCode",{parentName:"p"},"each")," block; add eslint"),(0,g.yg)("p",{parentName:"li"},"The packages receiving a major bump here exposed functions that didn't work as\nexpected inside ",(0,g.yg)("inlineCode",{parentName:"p"},"each")," blocks. Users were previously wrapping these functions\ninside their own custom ",(0,g.yg)("inlineCode",{parentName:"p"},"fn")," blocks, and this change will ensure that they can\nbe used inside a standard each."),(0,g.yg)("p",{parentName:"li"},"See ",(0,g.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/adaptors/issues/275"},"https://github.com/OpenFn/adaptors/issues/275")," for more details."))),(0,g.yg)("h3",{id:"patch-changes-22"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[2c1d603]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.8.0"},"language-common@1.8.0"))))),(0,g.yg)("h2",{id:"408"},"4.0.8"),(0,g.yg)("h3",{id:"patch-changes-23"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"57742d1: remove request dependency")),(0,g.yg)("h2",{id:"407"},"4.0.7"),(0,g.yg)("h3",{id:"patch-changes-24"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"04ed74f: update dependencies")),(0,g.yg)("h2",{id:"406"},"4.0.6"),(0,g.yg)("h3",{id:"patch-changes-25"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"43c3669: patch versions")),(0,g.yg)("h2",{id:"405"},"4.0.5"),(0,g.yg)("h3",{id:"patch-changes-26"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[929bca6]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.7"},"language-common@1.7.7"))))),(0,g.yg)("h2",{id:"404"},"4.0.4"),(0,g.yg)("h3",{id:"patch-changes-27"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"14f481e: mark execute as private"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[2b4c61a]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.6"},"language-common@1.7.6"))))),(0,g.yg)("h2",{id:"403"},"4.0.3"),(0,g.yg)("h3",{id:"patch-changes-28"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"f7ebd3c: remove sample configuration")),(0,g.yg)("h2",{id:"402"},"4.0.2"),(0,g.yg)("h3",{id:"patch-changes-29"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"f2aed32: add examples")),(0,g.yg)("h2",{id:"401"},"4.0.1"),(0,g.yg)("h3",{id:"patch-changes-30"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"6d8de03: change @constructor to @function and remove /","*",(0,g.yg)("em",{parentName:"li"}," @module Adaptor "),"/")),(0,g.yg)("h2",{id:"400"},"4.0.0"),(0,g.yg)("h3",{id:"major-changes-1"},"Major Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"3878624: Modify composeNextState function, to flattern all rows into an array\nof rows with their corresponding column names")),(0,g.yg)("h3",{id:"patch-changes-31"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"f2a91a4: Update package exports"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[f2a91a4]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.5"},"language-common@1.7.5"))))),(0,g.yg)("h2",{id:"311"},"3.1.1"),(0,g.yg)("h3",{id:"patch-changes-32"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"8566b26: Fix typings"),(0,g.yg)("li",{parentName:"ul"},"b3d45ff: Fix CJS export of npm package."),(0,g.yg)("li",{parentName:"ul"},"ecf5d30: remove sinon since it was not being used"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[8566b26]"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[b3d45ff]"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[b5eb665]"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[ecf5d30]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.4"},"language-common@1.7.4"))))),(0,g.yg)("h2",{id:"310"},"3.1.0"),(0,g.yg)("h3",{id:"minor-changes-3"},"Minor Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"c9b7ed7: Add language-mssql in monorepo")),(0,g.yg)("h3",{id:"patch-changes-33"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"e04aa28: Rename credential-schema to configuration-schema, update descriptions")))}o.isMDXComponent=!0},15680:(e,a,n)=>{n.d(a,{xA:()=>r,yg:()=>m});var l=n(96540);function g(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function t(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function i(e){for(var a=1;a=0||(g[n]=e[n]);return g}(e,a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(g[n]=e[n])}return g}var h=l.createContext({}),p=function(e){var a=l.useContext(h),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},r=function(e){var a=p(e.components);return l.createElement(h.Provider,{value:a},e.children)},u="mdxType",o={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},d=l.forwardRef((function(e,a){var n=e.components,g=e.mdxType,t=e.originalType,h=e.parentName,r=c(e,["components","mdxType","originalType","parentName"]),u=p(n),d=g,m=u["".concat(h,".").concat(d)]||u[d]||o[d]||t;return n?l.createElement(m,i(i({ref:a},r),{},{components:n})):l.createElement(m,i({ref:a},r))}));function m(e,a){var n=arguments,g=a&&a.mdxType;if("string"==typeof e||g){var t=n.length,i=new Array(t);i[0]=d;var c={};for(var h in a)hasOwnProperty.call(a,h)&&(c[h]=a[h]);c.originalType=e,c[u]="string"==typeof e?e:g,i[1]=c;for(var p=2;p{n.r(a),n.d(a,{assets:()=>c,contentTitle:()=>i,default:()=>d,frontMatter:()=>t,metadata:()=>h,toc:()=>p});var l=n(58168),g=(n(96540),n(15680));const t={title:"mssql changelog",id:"mssql-changelog",keywords:["adaptor","changelog","mssql"]},i="Changelog for the mssql adaptor",h={unversionedId:"packages/mssql-changelog",id:"packages/mssql-changelog",title:"mssql changelog",description:"5.0.4",source:"@site/adaptors/packages/mssql-changelog.md",sourceDirName:"packages",slug:"/packages/mssql-changelog",permalink:"/adaptors/packages/mssql-changelog",draft:!1,tags:[],version:"current",frontMatter:{title:"mssql changelog",id:"mssql-changelog",keywords:["adaptor","changelog","mssql"]},sidebar:"adaptors",previous:{title:"CommCare to Azure Sql",permalink:"/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27"},next:{title:"mssql developer readme",permalink:"/adaptors/packages/mssql-readme"}},c={},p=[{value:"5.0.4",id:"504",level:2},{value:"Patch Changes",id:"patch-changes",level:3},{value:"5.0.3",id:"503",level:2},{value:"Patch Changes",id:"patch-changes-1",level:3},{value:"5.0.2",id:"502",level:2},{value:"Patch Changes",id:"patch-changes-2",level:3},{value:"5.0.1",id:"501",level:2},{value:"Patch Changes",id:"patch-changes-3",level:3},{value:"5.0.0",id:"500",level:2},{value:"Major Changes",id:"major-changes",level:3},{value:"4.3.4",id:"434",level:2},{value:"Patch Changes",id:"patch-changes-4",level:3},{value:"4.3.3",id:"433",level:2},{value:"Patch Changes",id:"patch-changes-5",level:3},{value:"4.3.2",id:"432",level:2},{value:"Patch Changes",id:"patch-changes-6",level:3},{value:"4.3.1",id:"431",level:2},{value:"Patch Changes",id:"patch-changes-7",level:3},{value:"4.3.0",id:"430",level:2},{value:"Minor Changes",id:"minor-changes",level:3},{value:"Patch Changes",id:"patch-changes-8",level:3},{value:"4.2.4",id:"424",level:2},{value:"Patch Changes",id:"patch-changes-9",level:3},{value:"4.2.3",id:"423",level:2},{value:"Patch Changes",id:"patch-changes-10",level:3},{value:"4.2.2",id:"422",level:2},{value:"Patch Changes",id:"patch-changes-11",level:3},{value:"4.2.1",id:"421",level:2},{value:"Patch Changes",id:"patch-changes-12",level:3},{value:"4.2.0",id:"420",level:2},{value:"Minor Changes",id:"minor-changes-1",level:3},{value:"4.1.10",id:"4110",level:2},{value:"Patch Changes",id:"patch-changes-13",level:3},{value:"4.1.9",id:"419",level:2},{value:"Patch Changes",id:"patch-changes-14",level:3},{value:"4.1.8",id:"418",level:2},{value:"Patch Changes",id:"patch-changes-15",level:3},{value:"4.1.7",id:"417",level:2},{value:"Patch Changes",id:"patch-changes-16",level:3},{value:"4.1.6",id:"416",level:2},{value:"Patch Changes",id:"patch-changes-17",level:3},{value:"4.1.5",id:"415",level:2},{value:"Patch Changes",id:"patch-changes-18",level:3},{value:"4.1.4",id:"414",level:2},{value:"Patch Changes",id:"patch-changes-19",level:3},{value:"4.1.3",id:"413",level:2},{value:"Patch Changes",id:"patch-changes-20",level:3},{value:"4.1.2",id:"412",level:2},{value:"Patch Changes",id:"patch-changes-21",level:3},{value:"4.1.1",id:"411",level:2},{value:"Patch Changes",id:"patch-changes-22",level:3},{value:"4.1.0",id:"410",level:2},{value:"Minor Changes",id:"minor-changes-2",level:3},{value:"Patch Changes",id:"patch-changes-23",level:3},{value:"4.0.8",id:"408",level:2},{value:"Patch Changes",id:"patch-changes-24",level:3},{value:"4.0.7",id:"407",level:2},{value:"Patch Changes",id:"patch-changes-25",level:3},{value:"4.0.6",id:"406",level:2},{value:"Patch Changes",id:"patch-changes-26",level:3},{value:"4.0.5",id:"405",level:2},{value:"Patch Changes",id:"patch-changes-27",level:3},{value:"4.0.4",id:"404",level:2},{value:"Patch Changes",id:"patch-changes-28",level:3},{value:"4.0.3",id:"403",level:2},{value:"Patch Changes",id:"patch-changes-29",level:3},{value:"4.0.2",id:"402",level:2},{value:"Patch Changes",id:"patch-changes-30",level:3},{value:"4.0.1",id:"401",level:2},{value:"Patch Changes",id:"patch-changes-31",level:3},{value:"4.0.0",id:"400",level:2},{value:"Major Changes",id:"major-changes-1",level:3},{value:"Patch Changes",id:"patch-changes-32",level:3},{value:"3.1.1",id:"311",level:2},{value:"Patch Changes",id:"patch-changes-33",level:3},{value:"3.1.0",id:"310",level:2},{value:"Minor Changes",id:"minor-changes-3",level:3},{value:"Patch Changes",id:"patch-changes-34",level:3}],r={toc:p},u="wrapper";function d(e){let{components:a,...n}=e;return(0,g.yg)(u,(0,l.A)({},r,n,{components:a,mdxType:"MDXLayout"}),(0,g.yg)("h1",{id:"changelog-for-the-mssql-adaptor"},"Changelog for the mssql adaptor"),(0,g.yg)("h1",{id:"openfnlanguage-mssql"},"@openfn/language-mssql"),(0,g.yg)("h2",{id:"504"},"5.0.4"),(0,g.yg)("h3",{id:"patch-changes"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"d3ac969: use reject instead of throwwq")),(0,g.yg)("h2",{id:"503"},"5.0.3"),(0,g.yg)("h3",{id:"patch-changes-1"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"6d38a48: Removed process.exit(1) to prevent workflow crashes on errors")),(0,g.yg)("h2",{id:"502"},"5.0.2"),(0,g.yg)("h3",{id:"patch-changes-2"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[77a690f]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@2.0.2"},"language-common@2.0.2"))))),(0,g.yg)("h2",{id:"501"},"5.0.1"),(0,g.yg)("h3",{id:"patch-changes-3"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"8146c23: Fix typings in package.json"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[8146c23]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@2.0.1"},"language-common@2.0.1"))))),(0,g.yg)("h2",{id:"500"},"5.0.0"),(0,g.yg)("h3",{id:"major-changes"},"Major Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Export new common http helpers (http namespace)")),(0,g.yg)("h2",{id:"434"},"4.3.4"),(0,g.yg)("h3",{id:"patch-changes-4"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[4fe527c]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@2.0.0"},"language-common@2.0.0"))))),(0,g.yg)("h2",{id:"433"},"4.3.3"),(0,g.yg)("h3",{id:"patch-changes-5"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[4c08444]"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[73d0a02]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.15.1"},"language-common@1.15.1"))))),(0,g.yg)("h2",{id:"432"},"4.3.2"),(0,g.yg)("h3",{id:"patch-changes-6"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"bb5436c: Add title and description for ",(0,g.yg)("inlineCode",{parentName:"li"},"port")," configuration")),(0,g.yg)("h2",{id:"431"},"4.3.1"),(0,g.yg)("h3",{id:"patch-changes-7"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[5fb82f07]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.15.0"},"language-common@1.15.0"))))),(0,g.yg)("h2",{id:"430"},"4.3.0"),(0,g.yg)("h3",{id:"minor-changes"},"Minor Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"73433c20: Add ",(0,g.yg)("inlineCode",{parentName:"li"},"fnIf")," operation")),(0,g.yg)("h3",{id:"patch-changes-8"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[106ecf6d]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.14.0"},"language-common@1.14.0"))))),(0,g.yg)("h2",{id:"424"},"4.2.4"),(0,g.yg)("h3",{id:"patch-changes-9"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.5"},"language-common@1.13.5"))))),(0,g.yg)("h2",{id:"423"},"4.2.3"),(0,g.yg)("h3",{id:"patch-changes-10"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[12f02ed5]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.4"},"language-common@1.13.4"))))),(0,g.yg)("h2",{id:"422"},"4.2.2"),(0,g.yg)("h3",{id:"patch-changes-11"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[88f99a8f]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.3"},"language-common@1.13.3"))))),(0,g.yg)("h2",{id:"421"},"4.2.1"),(0,g.yg)("h3",{id:"patch-changes-12"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.2"},"language-common@1.13.2"))))),(0,g.yg)("h2",{id:"420"},"4.2.0"),(0,g.yg)("h3",{id:"minor-changes-1"},"Minor Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"2964fc8d: - Add ",(0,g.yg)("inlineCode",{parentName:"li"},"cursor()")," function",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"Update ",(0,g.yg)("inlineCode",{parentName:"li"},"configuration-schema.json"))))),(0,g.yg)("h2",{id:"4110"},"4.1.10"),(0,g.yg)("h3",{id:"patch-changes-13"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.1"},"language-common@1.13.1"))))),(0,g.yg)("h2",{id:"419"},"4.1.9"),(0,g.yg)("h3",{id:"patch-changes-14"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[1ad86651]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.0"},"language-common@1.13.0"))))),(0,g.yg)("h2",{id:"418"},"4.1.8"),(0,g.yg)("h3",{id:"patch-changes-15"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[c19efbe]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.11.1"},"language-common@1.11.1"))))),(0,g.yg)("h2",{id:"417"},"4.1.7"),(0,g.yg)("h3",{id:"patch-changes-16"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[85c35b8]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.11.0"},"language-common@1.11.0"))))),(0,g.yg)("h2",{id:"416"},"4.1.6"),(0,g.yg)("h3",{id:"patch-changes-17"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[df09270]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.10.3"},"language-common@1.10.3"))))),(0,g.yg)("h2",{id:"415"},"4.1.5"),(0,g.yg)("h3",{id:"patch-changes-18"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[26a303e]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.10.2"},"language-common@1.10.2"))))),(0,g.yg)("h2",{id:"414"},"4.1.4"),(0,g.yg)("h3",{id:"patch-changes-19"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[8c32eb3]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.10.1"},"language-common@1.10.1"))))),(0,g.yg)("h2",{id:"413"},"4.1.3"),(0,g.yg)("h3",{id:"patch-changes-20"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[aad9549]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.10.0"},"language-common@1.10.0"))))),(0,g.yg)("h2",{id:"412"},"4.1.2"),(0,g.yg)("h3",{id:"patch-changes-21"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[111807f]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.9.0"},"language-common@1.9.0"))))),(0,g.yg)("h2",{id:"411"},"4.1.1"),(0,g.yg)("h3",{id:"patch-changes-22"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Update lock files"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.8.1"},"language-common@1.8.1"))))),(0,g.yg)("h2",{id:"410"},"4.1.0"),(0,g.yg)("h3",{id:"minor-changes-2"},"Minor Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},(0,g.yg)("p",{parentName:"li"},"2c1d603: Remove parameter reassignment to ensure proper functioning inside an\n",(0,g.yg)("inlineCode",{parentName:"p"},"each")," block; add eslint"),(0,g.yg)("p",{parentName:"li"},"The packages receiving a major bump here exposed functions that didn't work as\nexpected inside ",(0,g.yg)("inlineCode",{parentName:"p"},"each")," blocks. Users were previously wrapping these functions\ninside their own custom ",(0,g.yg)("inlineCode",{parentName:"p"},"fn")," blocks, and this change will ensure that they can\nbe used inside a standard each."),(0,g.yg)("p",{parentName:"li"},"See ",(0,g.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/adaptors/issues/275"},"https://github.com/OpenFn/adaptors/issues/275")," for more details."))),(0,g.yg)("h3",{id:"patch-changes-23"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[2c1d603]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.8.0"},"language-common@1.8.0"))))),(0,g.yg)("h2",{id:"408"},"4.0.8"),(0,g.yg)("h3",{id:"patch-changes-24"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"57742d1: remove request dependency")),(0,g.yg)("h2",{id:"407"},"4.0.7"),(0,g.yg)("h3",{id:"patch-changes-25"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"04ed74f: update dependencies")),(0,g.yg)("h2",{id:"406"},"4.0.6"),(0,g.yg)("h3",{id:"patch-changes-26"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"43c3669: patch versions")),(0,g.yg)("h2",{id:"405"},"4.0.5"),(0,g.yg)("h3",{id:"patch-changes-27"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[929bca6]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.7"},"language-common@1.7.7"))))),(0,g.yg)("h2",{id:"404"},"4.0.4"),(0,g.yg)("h3",{id:"patch-changes-28"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"14f481e: mark execute as private"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[2b4c61a]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.6"},"language-common@1.7.6"))))),(0,g.yg)("h2",{id:"403"},"4.0.3"),(0,g.yg)("h3",{id:"patch-changes-29"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"f7ebd3c: remove sample configuration")),(0,g.yg)("h2",{id:"402"},"4.0.2"),(0,g.yg)("h3",{id:"patch-changes-30"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"f2aed32: add examples")),(0,g.yg)("h2",{id:"401"},"4.0.1"),(0,g.yg)("h3",{id:"patch-changes-31"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"6d8de03: change @constructor to @function and remove /","*",(0,g.yg)("em",{parentName:"li"}," @module Adaptor "),"/")),(0,g.yg)("h2",{id:"400"},"4.0.0"),(0,g.yg)("h3",{id:"major-changes-1"},"Major Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"3878624: Modify composeNextState function, to flattern all rows into an array\nof rows with their corresponding column names")),(0,g.yg)("h3",{id:"patch-changes-32"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"f2a91a4: Update package exports"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[f2a91a4]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.5"},"language-common@1.7.5"))))),(0,g.yg)("h2",{id:"311"},"3.1.1"),(0,g.yg)("h3",{id:"patch-changes-33"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"8566b26: Fix typings"),(0,g.yg)("li",{parentName:"ul"},"b3d45ff: Fix CJS export of npm package."),(0,g.yg)("li",{parentName:"ul"},"ecf5d30: remove sinon since it was not being used"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[8566b26]"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[b3d45ff]"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[b5eb665]"),(0,g.yg)("li",{parentName:"ul"},"Updated dependencies ","[ecf5d30]",(0,g.yg)("ul",{parentName:"li"},(0,g.yg)("li",{parentName:"ul"},"@openfn/",(0,g.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.4"},"language-common@1.7.4"))))),(0,g.yg)("h2",{id:"310"},"3.1.0"),(0,g.yg)("h3",{id:"minor-changes-3"},"Minor Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"c9b7ed7: Add language-mssql in monorepo")),(0,g.yg)("h3",{id:"patch-changes-34"},"Patch Changes"),(0,g.yg)("ul",null,(0,g.yg)("li",{parentName:"ul"},"e04aa28: Rename credential-schema to configuration-schema, update descriptions")))}d.isMDXComponent=!0},15680:(e,a,n)=>{n.d(a,{xA:()=>r,yg:()=>m});var l=n(96540);function g(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function t(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function i(e){for(var a=1;a=0||(g[n]=e[n]);return g}(e,a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(g[n]=e[n])}return g}var c=l.createContext({}),p=function(e){var a=l.useContext(c),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},r=function(e){var a=p(e.components);return l.createElement(c.Provider,{value:a},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},o=l.forwardRef((function(e,a){var n=e.components,g=e.mdxType,t=e.originalType,c=e.parentName,r=h(e,["components","mdxType","originalType","parentName"]),u=p(n),o=g,m=u["".concat(c,".").concat(o)]||u[o]||d[o]||t;return n?l.createElement(m,i(i({ref:a},r),{},{components:n})):l.createElement(m,i({ref:a},r))}));function m(e,a){var n=arguments,g=a&&a.mdxType;if("string"==typeof e||g){var t=n.length,i=new Array(t);i[0]=o;var h={};for(var c in a)hasOwnProperty.call(a,c)&&(h[c]=a[c]);h.originalType=e,h[u]="string"==typeof e?e:g,i[1]=h;for(var p=2;p{a.r(t),a.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>_,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var n=a(58168),r=(a(96540),a(15680));const i={title:"Upsert Register Participant",sidebar_label:"\u2728 Upsert Register Participant",id:"Upsert-Register-Participant-2021-04-28",keywords:["library","job","expression","salesforce","dataPath","dataValue","each","field","fields","lastReferenceValue","map","merge","query","relationship","upsert","Array"]},o=void 0,s={unversionedId:"library/jobs/auto/Upsert-Register-Participant-2021-04-28",id:"library/jobs/auto/Upsert-Register-Participant-2021-04-28",title:"Upsert Register Participant",description:"This job was provided by an OpenFn.org user via the job library API.",source:"@site/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.md",sourceDirName:"library/jobs/auto",slug:"/library/jobs/auto/Upsert-Register-Participant-2021-04-28",permalink:"/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28",draft:!1,tags:[],version:"current",frontMatter:{title:"Upsert Register Participant",sidebar_label:"\u2728 Upsert Register Participant",id:"Upsert-Register-Participant-2021-04-28",keywords:["library","job","expression","salesforce","dataPath","dataValue","each","field","fields","lastReferenceValue","map","merge","query","relationship","upsert","Array"]},sidebar:"adaptors",previous:{title:"\u2728 Attendance Non Skillz",permalink:"/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14"},next:{title:"Outcome Survey",permalink:"/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16"}},l={},c=[{value:"Metadata",id:"metadata",level:2},{value:"Key Functions",id:"key-functions",level:2},{value:"Expression",id:"expression",level:2}],d={toc:c},p="wrapper";function _(e){let{components:t,...a}=e;return(0,r.yg)(p,(0,n.A)({},d,a,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("em",null,"This job was provided by an OpenFn.org user via the job library API."),(0,r.yg)("h2",{id:"metadata"},"Metadata"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Name: Upsert Register Participant"),(0,r.yg)("li",{parentName:"ul"},"Adaptor: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce"},(0,r.yg)("inlineCode",{parentName:"a"},"@openfn/language-salesforce"))),(0,r.yg)("li",{parentName:"ul"},"Adaptor Version: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce/releases/tag/v4.3.0"},(0,r.yg)("inlineCode",{parentName:"a"},"v4.3.0"))),(0,r.yg)("li",{parentName:"ul"},"Created over 3 years ago"),(0,r.yg)("li",{parentName:"ul"},"Updated about 1 month ago"),(0,r.yg)("li",{parentName:"ul"},"Score: ",(0,r.yg)("b",null,"88")," (an ",(0,r.yg)("a",{parentName:"li",href:"/adaptors/library/#library-scores"},"indicator")," of how useful this job may be)")),(0,r.yg)("h2",{id:"key-functions"},"Key Functions"),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"dataPath"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"dataValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"each"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"field"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"fields"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"lastReferenceValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"map"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"merge"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"query"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"relationship"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"upsert"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"Array")),(0,r.yg)("h2",{id:"expression"},"Expression"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-js"},"query(\n `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`\n);\n\nfn(state => {\n // Note: lastReferenceValue selects the first item in the references array.\n state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);\n state.data.eventCase = dataValue('form.case.@case_id')(state);\n\n function objectToArray(object) {\n return !Array.isArray(object) ? [object] : object;\n }\n\n const { form } = state.data;\n if (form.question1) {\n console.log('Ensuring that \"question1\" is an array.');\n form.question1 = objectToArray(form.question1);\n } else if (!form.new_participants) {\n console.log('Nothing to upsert. No participants were registered');\n } else {\n console.log('Shifting \"new_participants\" to \"question1\" array.');\n form.question1 = objectToArray(form.new_participants);\n console.log('Creating a \"case\" object inside each item in that array.');\n form.question1 = form.question1.map(item => ({\n ...item,\n case: item.create_skillz_plus_participant.case,\n }));\n }\n\n console.log('Done with initial data manipulation.');\n const persons = merge(\n dataPath('form.question1[*]'),\n fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))\n )(state);\n\n const attendances = merge(\n dataPath('form.question1[*]'),\n fields(\n field('intervention_name', dataValue('form.intervention_name')),\n field('eventCase', dataValue('eventCase')),\n field('eventName', dataValue('eventName'))\n )\n )(state);\n\n return { ...state, persons, attendances };\n});\n\neach(\n 'persons[*]',\n upsert(\n 'Person__c',\n 'Participant_Identification_Number_PID__c',\n fields(\n field('Notes__c', dataValue('intervention_notes_to_save')),\n field('First_Name__c', dataValue('participant_first_name')),\n field('Surname__c', dataValue('participant_surname')),\n relationship('RecordType', 'Name', 'Participant'),\n relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),\n field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),\n field('Sex__c', dataValue('gender')),\n field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?\n field('School_name_person__c', dataValue('school_name')),\n field('Date_of_Birth__c', dataValue('date_of_birth')),\n field('School_name_person__c', dataValue('school_name')),\n field('Physical_Address__c', dataValue('participants_home_address'))\n //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map\n )\n )\n);\n\neach(\n 'attendances[*]',\n upsert(\n 'Attendance__c',\n 'CommCare_Ext_ID__c',\n fields(\n field('CommCare_Ext_ID__c', state => {\n const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;\n const personid = state.data.case['@case_id'];\n const value = personid + '-' + eventid.replace(/\\//gi, '');\n return scrubEmojis(value, '');\n }),\n relationship(\n //Attendance looks up to Persn via the case_id\n 'Person_Attendance__r',\n 'Participant_Identification_Number_PID__c',\n state => state.data.case['@case_id']\n ),\n relationship(\n //Attendance looks up to Event via the Event case_id\n 'Event__r',\n 'CommCare_Case_ID__c',\n state => `${state.data.eventCase}`\n ),\n // relationship(\n // //Attendance looks up to Event via the intervention_name\n // 'Event__r',\n // 'CommCare_Ext_ID__c',\n // state => `${state.data.intervention_name}` || `${state.data.eventName}`\n // ),\n field('Date_of_Birth__c', dataValue('date_of_birth'))\n )\n )\n);\n\n//First we insert Person record\n// fn(state => {\n// return upsert(\n// 'Person__c',\n// 'Participant_Identification_Number_PID__c',\n// fields(\n// field('Notes__c', dataValue('form.intervention_notes_to_save')),\n// field('First_Name__c', dataValue('form.question1.participant_first_name')),\n// field('Surname__c', dataValue('form.question1.participant_surname')),\n// relationship('RecordType', 'Name', 'Participant'),\n// field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),\n// field('Sex__c', dataValue('form.question1.gender')),\n// //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map\n// field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),\n// field('School_name_person__c', dataValue('form.question1.school_name'))\n// )\n// )(state);\n// });\n\n// fn(state => {\n// //Then we upsert related Attendance records\n// return upsert(\n// 'Attendance__c',\n// 'CommCare_Ext_ID__c',\n// fields(\n// field('CommCare_Ext_ID__c', state => {\n// var eventid = dataValue('form.intervention_name')(state);\n// var personid = dataValue('form.case.@case_id')(state);\n// return personid + '-' + eventid;\n// }),\n// relationship(\n// //Attendance looks up to Persn via the case_id\n// 'Person_Attendance__r',\n// 'Participant_Identification_Number_PID__c',\n// dataValue('form.case.@case_id')\n// ),\n// relationship(\n// //Attendance looks up to Event via the intervention_name\n// 'Event__r',\n// 'Name',\n// dataValue('form.intervention_name')\n// ),\n// field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))\n// )\n// )(state);\n// });\n\n")))}_.isMDXComponent=!0},15680:(e,t,a)=>{a.d(t,{xA:()=>d,yg:()=>m});var n=a(96540);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=n.createContext({}),c=function(e){var t=n.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},d=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},p="mdxType",_={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=c(a),u=r,m=p["".concat(l,".").concat(u)]||p[u]||_[u]||i;return a?n.createElement(m,o(o({ref:t},d),{},{components:a})):n.createElement(m,o({ref:t},d))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:r,o[1]=s;for(var c=2;c{a.r(t),a.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>_,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var n=a(58168),r=(a(96540),a(15680));const i={title:"Upsert Register Participant",sidebar_label:"\u2728 Upsert Register Participant",id:"Upsert-Register-Participant-2021-04-28",keywords:["library","job","expression","salesforce","dataPath","dataValue","each","field","fields","lastReferenceValue","map","merge","query","relationship","upsert","Array"]},o=void 0,s={unversionedId:"library/jobs/auto/Upsert-Register-Participant-2021-04-28",id:"library/jobs/auto/Upsert-Register-Participant-2021-04-28",title:"Upsert Register Participant",description:"This job was provided by an OpenFn.org user via the job library API.",source:"@site/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.md",sourceDirName:"library/jobs/auto",slug:"/library/jobs/auto/Upsert-Register-Participant-2021-04-28",permalink:"/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28",draft:!1,tags:[],version:"current",frontMatter:{title:"Upsert Register Participant",sidebar_label:"\u2728 Upsert Register Participant",id:"Upsert-Register-Participant-2021-04-28",keywords:["library","job","expression","salesforce","dataPath","dataValue","each","field","fields","lastReferenceValue","map","merge","query","relationship","upsert","Array"]},sidebar:"adaptors",previous:{title:"\u2728 Attendance Non Skillz",permalink:"/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14"},next:{title:"Outcome Survey",permalink:"/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16"}},l={},c=[{value:"Metadata",id:"metadata",level:2},{value:"Key Functions",id:"key-functions",level:2},{value:"Expression",id:"expression",level:2}],d={toc:c},p="wrapper";function _(e){let{components:t,...a}=e;return(0,r.yg)(p,(0,n.A)({},d,a,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("em",null,"This job was provided by an OpenFn.org user via the job library API."),(0,r.yg)("h2",{id:"metadata"},"Metadata"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Name: Upsert Register Participant"),(0,r.yg)("li",{parentName:"ul"},"Adaptor: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce"},(0,r.yg)("inlineCode",{parentName:"a"},"@openfn/language-salesforce"))),(0,r.yg)("li",{parentName:"ul"},"Adaptor Version: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce/releases/tag/v4.3.0"},(0,r.yg)("inlineCode",{parentName:"a"},"v4.3.0"))),(0,r.yg)("li",{parentName:"ul"},"Created over 3 years ago"),(0,r.yg)("li",{parentName:"ul"},"Updated about 1 month ago"),(0,r.yg)("li",{parentName:"ul"},"Score: ",(0,r.yg)("b",null,"85")," (an ",(0,r.yg)("a",{parentName:"li",href:"/adaptors/library/#library-scores"},"indicator")," of how useful this job may be)")),(0,r.yg)("h2",{id:"key-functions"},"Key Functions"),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"dataPath"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"dataValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"each"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"field"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"fields"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"lastReferenceValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"map"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"merge"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"query"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"relationship"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"upsert"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"Array")),(0,r.yg)("h2",{id:"expression"},"Expression"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-js"},"query(\n `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`\n);\n\nfn(state => {\n // Note: lastReferenceValue selects the first item in the references array.\n state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);\n state.data.eventCase = dataValue('form.case.@case_id')(state);\n\n function objectToArray(object) {\n return !Array.isArray(object) ? [object] : object;\n }\n\n const { form } = state.data;\n if (form.question1) {\n console.log('Ensuring that \"question1\" is an array.');\n form.question1 = objectToArray(form.question1);\n } else if (!form.new_participants) {\n console.log('Nothing to upsert. No participants were registered');\n } else {\n console.log('Shifting \"new_participants\" to \"question1\" array.');\n form.question1 = objectToArray(form.new_participants);\n console.log('Creating a \"case\" object inside each item in that array.');\n form.question1 = form.question1.map(item => ({\n ...item,\n case: item.create_skillz_plus_participant.case,\n }));\n }\n\n console.log('Done with initial data manipulation.');\n const persons = merge(\n dataPath('form.question1[*]'),\n fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))\n )(state);\n\n const attendances = merge(\n dataPath('form.question1[*]'),\n fields(\n field('intervention_name', dataValue('form.intervention_name')),\n field('eventCase', dataValue('eventCase')),\n field('eventName', dataValue('eventName'))\n )\n )(state);\n\n return { ...state, persons, attendances };\n});\n\neach(\n 'persons[*]',\n upsert(\n 'Person__c',\n 'Participant_Identification_Number_PID__c',\n fields(\n field('Notes__c', dataValue('intervention_notes_to_save')),\n field('First_Name__c', dataValue('participant_first_name')),\n field('Surname__c', dataValue('participant_surname')),\n relationship('RecordType', 'Name', 'Participant'),\n relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),\n field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),\n field('Sex__c', dataValue('gender')),\n field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?\n field('School_name_person__c', dataValue('school_name')),\n field('Date_of_Birth__c', dataValue('date_of_birth')),\n field('School_name_person__c', dataValue('school_name')),\n field('Physical_Address__c', dataValue('participants_home_address'))\n //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map\n )\n )\n);\n\neach(\n 'attendances[*]',\n upsert(\n 'Attendance__c',\n 'CommCare_Ext_ID__c',\n fields(\n field('CommCare_Ext_ID__c', state => {\n const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;\n const personid = state.data.case['@case_id'];\n const value = personid + '-' + eventid.replace(/\\//gi, '');\n return scrubEmojis(value, '');\n }),\n relationship(\n //Attendance looks up to Persn via the case_id\n 'Person_Attendance__r',\n 'Participant_Identification_Number_PID__c',\n state => state.data.case['@case_id']\n ),\n relationship(\n //Attendance looks up to Event via the Event case_id\n 'Event__r',\n 'CommCare_Case_ID__c',\n state => `${state.data.eventCase}`\n ),\n // relationship(\n // //Attendance looks up to Event via the intervention_name\n // 'Event__r',\n // 'CommCare_Ext_ID__c',\n // state => `${state.data.intervention_name}` || `${state.data.eventName}`\n // ),\n field('Date_of_Birth__c', dataValue('date_of_birth'))\n )\n )\n);\n\n//First we insert Person record\n// fn(state => {\n// return upsert(\n// 'Person__c',\n// 'Participant_Identification_Number_PID__c',\n// fields(\n// field('Notes__c', dataValue('form.intervention_notes_to_save')),\n// field('First_Name__c', dataValue('form.question1.participant_first_name')),\n// field('Surname__c', dataValue('form.question1.participant_surname')),\n// relationship('RecordType', 'Name', 'Participant'),\n// field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),\n// field('Sex__c', dataValue('form.question1.gender')),\n// //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map\n// field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),\n// field('School_name_person__c', dataValue('form.question1.school_name'))\n// )\n// )(state);\n// });\n\n// fn(state => {\n// //Then we upsert related Attendance records\n// return upsert(\n// 'Attendance__c',\n// 'CommCare_Ext_ID__c',\n// fields(\n// field('CommCare_Ext_ID__c', state => {\n// var eventid = dataValue('form.intervention_name')(state);\n// var personid = dataValue('form.case.@case_id')(state);\n// return personid + '-' + eventid;\n// }),\n// relationship(\n// //Attendance looks up to Persn via the case_id\n// 'Person_Attendance__r',\n// 'Participant_Identification_Number_PID__c',\n// dataValue('form.case.@case_id')\n// ),\n// relationship(\n// //Attendance looks up to Event via the intervention_name\n// 'Event__r',\n// 'Name',\n// dataValue('form.intervention_name')\n// ),\n// field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))\n// )\n// )(state);\n// });\n\n")))}_.isMDXComponent=!0},15680:(e,t,a)=>{a.d(t,{xA:()=>d,yg:()=>m});var n=a(96540);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=n.createContext({}),c=function(e){var t=n.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},d=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},p="mdxType",_={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=c(a),u=r,m=p["".concat(l,".").concat(u)]||p[u]||_[u]||i;return a?n.createElement(m,o(o({ref:t},d),{},{components:a})):n.createElement(m,o({ref:t},d))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:r,o[1]=s;for(var c=2;c{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>_,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var a=n(58168),r=(n(96540),n(15680));const i={title:"Upsert Home Visit Log Form",sidebar_label:"\u2728 Upsert Home Visit Log Form",id:"Upsert-Home-Visit-Log-Form-2021-05-03",keywords:["library","job","expression","salesforce","dataValue","field","fields","lastReferenceValue","query","relationship","upsert"]},o=void 0,s={unversionedId:"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03",id:"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03",title:"Upsert Home Visit Log Form",description:"This job was provided by an OpenFn.org user via the job library API.",source:"@site/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.md",sourceDirName:"library/jobs/auto",slug:"/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03",permalink:"/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03",draft:!1,tags:[],version:"current",frontMatter:{title:"Upsert Home Visit Log Form",sidebar_label:"\u2728 Upsert Home Visit Log Form",id:"Upsert-Home-Visit-Log-Form-2021-05-03",keywords:["library","job","expression","salesforce","dataValue","field","fields","lastReferenceValue","query","relationship","upsert"]},sidebar:"adaptors",previous:{title:"Upsert Coach Support Visit CSV",permalink:"/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28"},next:{title:"Q3 2022 Upsert Household & Household Visit in SF",permalink:"/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28"}},l={},c=[{value:"Metadata",id:"metadata",level:2},{value:"Key Functions",id:"key-functions",level:2},{value:"Expression",id:"expression",level:2}],d={toc:c},p="wrapper";function _(e){let{components:t,...n}=e;return(0,r.yg)(p,(0,a.A)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("em",null,"This job was provided by an OpenFn.org user via the job library API."),(0,r.yg)("h2",{id:"metadata"},"Metadata"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Name: Upsert Home Visit Log Form"),(0,r.yg)("li",{parentName:"ul"},"Adaptor: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce"},(0,r.yg)("inlineCode",{parentName:"a"},"@openfn/language-salesforce"))),(0,r.yg)("li",{parentName:"ul"},"Adaptor Version: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce/releases/tag/v2.7.4"},(0,r.yg)("inlineCode",{parentName:"a"},"v2.7.4"))),(0,r.yg)("li",{parentName:"ul"},"Created over 3 years ago"),(0,r.yg)("li",{parentName:"ul"},"Updated 5 months ago"),(0,r.yg)("li",{parentName:"ul"},"Score: ",(0,r.yg)("b",null,"93")," (an ",(0,r.yg)("a",{parentName:"li",href:"/adaptors/library/#library-scores"},"indicator")," of how useful this job may be)")),(0,r.yg)("h2",{id:"key-functions"},"Key Functions"),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"dataValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"field"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"fields"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"lastReferenceValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"query"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"relationship"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"upsert")),(0,r.yg)("h2",{id:"expression"},"Expression"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-js"},"// push to production\n\nquery(\n `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.case['@case_id']}'`\n);\n\nfn(state => {\n const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);\n if (!PID) {\n console.log(\n `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.case['@case_id']}`\n );\n return state;\n }\n\n return execute(\n fn(state => {\n const { form } = state.data;\n const { basic_information } = form;\n if (basic_information.intervention_hidden) {\n return query(\n `SELECT Id, Event__c, CreatedDate, Person_Attendance__c\n FROM Attendance__c\n WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'\n ORDER BY CreatedDate DESC LIMIT 1`\n )(state).then(state => {\n const { records } = state.references[0];\n const eventId = records[0].Event__c;\n state.data.eventField = [field('Event__c', eventId)];\n return state;\n });\n // state.data.eventField = [\n // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')(state)),\n // ];\n // return state;\n } else {\n return query(\n `SELECT Id, Event__c, CreatedDate, Person_Attendance__c\n FROM Attendance__c\n WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'\n ORDER BY CreatedDate DESC LIMIT 1`\n )(state).then(state => {\n const { records } = state.references[0];\n const eventId = records[0].Event__c;\n state.data.eventField = [field('Event__c', eventId)];\n return state;\n });\n }\n }),\n\n upsert('Home_Visit__c', 'CommCare_Ext_ID__c', state => ({\n ...fields(\n field('CommCare_Ext_ID__c', dataValue('id')),\n // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')),\n relationship('Person_visiting__r', 'Participant_Identification_Number_PID__c', dataValue('form.case.@case_id')),\n //=== NOTE: We do not need to map People information because Home Visit is related to Person. ======//\n //This info already lives on the Person-level.\n // field('First_Name__c', dataValue('form.basic_information.participant_first_name')),\n // field('Surname__c', dataValue('form.basic_information.participant_surname')),\n // field('Sex__c', dataValue('form.basic_information.gender')),\n // field('Date_of_Birth__c', dataValue('form.basic_information.date_of_birth')),\n // field('Physical Address Community City', dataValue('form.basic_information.participant_address')),\n //================\n field('Mobile_Number__c', dataValue('form.basic_information.Mobile_number')),\n field('Consent_Given__c', dataValue('form.basic_information.consent_received')),\n //field('Consent_Given__c', dataValue('form.participant_infomation.visit_information.consent_given')) //Repeated mapping\n //field('From_Venue__c', dataValue('form.basic_information.venue_hidden')),\n field('Reason_for_Home_Visit__c', dataValue('form.participant_infomation.reason_for_home_visit')),\n field('Visit_Date__c', dataValue('form.participant_infomation.visit_information.visit_date')),\n field('Additional_Comments__c', dataValue('form.administrative.visit_notes'))\n ),\n ...fields(...state.data.eventField),\n }))\n )(state);\n});\n\n")))}_.isMDXComponent=!0},15680:(e,t,n)=>{n.d(t,{xA:()=>d,yg:()=>u});var a=n(96540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},p="mdxType",_={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=c(n),m=r,u=p["".concat(l,".").concat(m)]||p[m]||_[m]||i;return n?a.createElement(u,o(o({ref:t},d),{},{components:n})):a.createElement(u,o({ref:t},d))}));function u(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:r,o[1]=s;for(var c=2;c{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>_,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var a=n(58168),r=(n(96540),n(15680));const i={title:"Upsert Home Visit Log Form",sidebar_label:"\u2728 Upsert Home Visit Log Form",id:"Upsert-Home-Visit-Log-Form-2021-05-03",keywords:["library","job","expression","salesforce","dataValue","field","fields","lastReferenceValue","query","relationship","upsert"]},o=void 0,s={unversionedId:"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03",id:"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03",title:"Upsert Home Visit Log Form",description:"This job was provided by an OpenFn.org user via the job library API.",source:"@site/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.md",sourceDirName:"library/jobs/auto",slug:"/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03",permalink:"/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03",draft:!1,tags:[],version:"current",frontMatter:{title:"Upsert Home Visit Log Form",sidebar_label:"\u2728 Upsert Home Visit Log Form",id:"Upsert-Home-Visit-Log-Form-2021-05-03",keywords:["library","job","expression","salesforce","dataValue","field","fields","lastReferenceValue","query","relationship","upsert"]},sidebar:"adaptors",previous:{title:"Upsert Coach Support Visit CSV",permalink:"/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28"},next:{title:"Q3 2022 Upsert Household & Household Visit in SF",permalink:"/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28"}},l={},c=[{value:"Metadata",id:"metadata",level:2},{value:"Key Functions",id:"key-functions",level:2},{value:"Expression",id:"expression",level:2}],d={toc:c},p="wrapper";function _(e){let{components:t,...n}=e;return(0,r.yg)(p,(0,a.A)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("em",null,"This job was provided by an OpenFn.org user via the job library API."),(0,r.yg)("h2",{id:"metadata"},"Metadata"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Name: Upsert Home Visit Log Form"),(0,r.yg)("li",{parentName:"ul"},"Adaptor: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce"},(0,r.yg)("inlineCode",{parentName:"a"},"@openfn/language-salesforce"))),(0,r.yg)("li",{parentName:"ul"},"Adaptor Version: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce/releases/tag/v2.7.4"},(0,r.yg)("inlineCode",{parentName:"a"},"v2.7.4"))),(0,r.yg)("li",{parentName:"ul"},"Created over 3 years ago"),(0,r.yg)("li",{parentName:"ul"},"Updated 5 months ago"),(0,r.yg)("li",{parentName:"ul"},"Score: ",(0,r.yg)("b",null,"92")," (an ",(0,r.yg)("a",{parentName:"li",href:"/adaptors/library/#library-scores"},"indicator")," of how useful this job may be)")),(0,r.yg)("h2",{id:"key-functions"},"Key Functions"),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"dataValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"field"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"fields"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"lastReferenceValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"query"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"relationship"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"upsert")),(0,r.yg)("h2",{id:"expression"},"Expression"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-js"},"// push to production\n\nquery(\n `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.case['@case_id']}'`\n);\n\nfn(state => {\n const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);\n if (!PID) {\n console.log(\n `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.case['@case_id']}`\n );\n return state;\n }\n\n return execute(\n fn(state => {\n const { form } = state.data;\n const { basic_information } = form;\n if (basic_information.intervention_hidden) {\n return query(\n `SELECT Id, Event__c, CreatedDate, Person_Attendance__c\n FROM Attendance__c\n WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'\n ORDER BY CreatedDate DESC LIMIT 1`\n )(state).then(state => {\n const { records } = state.references[0];\n const eventId = records[0].Event__c;\n state.data.eventField = [field('Event__c', eventId)];\n return state;\n });\n // state.data.eventField = [\n // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')(state)),\n // ];\n // return state;\n } else {\n return query(\n `SELECT Id, Event__c, CreatedDate, Person_Attendance__c\n FROM Attendance__c\n WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'\n ORDER BY CreatedDate DESC LIMIT 1`\n )(state).then(state => {\n const { records } = state.references[0];\n const eventId = records[0].Event__c;\n state.data.eventField = [field('Event__c', eventId)];\n return state;\n });\n }\n }),\n\n upsert('Home_Visit__c', 'CommCare_Ext_ID__c', state => ({\n ...fields(\n field('CommCare_Ext_ID__c', dataValue('id')),\n // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')),\n relationship('Person_visiting__r', 'Participant_Identification_Number_PID__c', dataValue('form.case.@case_id')),\n //=== NOTE: We do not need to map People information because Home Visit is related to Person. ======//\n //This info already lives on the Person-level.\n // field('First_Name__c', dataValue('form.basic_information.participant_first_name')),\n // field('Surname__c', dataValue('form.basic_information.participant_surname')),\n // field('Sex__c', dataValue('form.basic_information.gender')),\n // field('Date_of_Birth__c', dataValue('form.basic_information.date_of_birth')),\n // field('Physical Address Community City', dataValue('form.basic_information.participant_address')),\n //================\n field('Mobile_Number__c', dataValue('form.basic_information.Mobile_number')),\n field('Consent_Given__c', dataValue('form.basic_information.consent_received')),\n //field('Consent_Given__c', dataValue('form.participant_infomation.visit_information.consent_given')) //Repeated mapping\n //field('From_Venue__c', dataValue('form.basic_information.venue_hidden')),\n field('Reason_for_Home_Visit__c', dataValue('form.participant_infomation.reason_for_home_visit')),\n field('Visit_Date__c', dataValue('form.participant_infomation.visit_information.visit_date')),\n field('Additional_Comments__c', dataValue('form.administrative.visit_notes'))\n ),\n ...fields(...state.data.eventField),\n }))\n )(state);\n});\n\n")))}_.isMDXComponent=!0},15680:(e,t,n)=>{n.d(t,{xA:()=>d,yg:()=>u});var a=n(96540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),c=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=c(e.components);return a.createElement(l.Provider,{value:t},e.children)},p="mdxType",_={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,l=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=c(n),m=r,u=p["".concat(l,".").concat(m)]||p[m]||_[m]||i;return n?a.createElement(u,o(o({ref:t},d),{},{components:n})):a.createElement(u,o({ref:t},d))}));function u(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:r,o[1]=s;for(var c=2;c{a.exports=JSON.parse('{"pluginId":"adaptors","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"adaptors":[{"type":"link","label":"Introduction","href":"/adaptors/","docId":"adaptors-intro"},{"type":"link","label":"Library Examples","href":"/adaptors/library","docId":"library-intro"},{"type":"category","label":"asana","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/asana-docs","docId":"packages/asana-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/asana-configuration-schema","docId":"packages/asana-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Asana-test","href":"/adaptors/library/jobs/auto/Asana-test-2024-07-29","docId":"library/jobs/auto/Asana-test-2024-07-29"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/asana-changelog","docId":"packages/asana-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/asana-readme","docId":"packages/asana-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"azure-storage","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/azure-storage-docs","docId":"packages/azure-storage-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/azure-storage-configuration-schema","docId":"packages/azure-storage-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/azure-storage-changelog","docId":"packages/azure-storage-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/azure-storage-readme","docId":"packages/azure-storage-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"beyonic","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/beyonic-docs","docId":"packages/beyonic-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/beyonic-configuration-schema","docId":"packages/beyonic-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Pay CHW","href":"/adaptors/library/jobs/auto/Pay-CHW-2021-04-23","docId":"library/jobs/auto/Pay-CHW-2021-04-23"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/beyonic-changelog","docId":"packages/beyonic-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/beyonic-readme","docId":"packages/beyonic-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"bigquery","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/bigquery-docs","docId":"packages/bigquery-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/bigquery-configuration-schema","docId":"packages/bigquery-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/bigquery-changelog","docId":"packages/bigquery-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/bigquery-readme","docId":"packages/bigquery-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"cartodb","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/cartodb-docs","docId":"packages/cartodb-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/cartodb-configuration-schema","docId":"packages/cartodb-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/cartodb-changelog","docId":"packages/cartodb-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/cartodb-readme","docId":"packages/cartodb-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"cht","items":[{"type":"link","label":"Overview","href":"/adaptors/cht","docId":"cht"},{"type":"link","label":"Functions","href":"/adaptors/packages/cht-docs","docId":"packages/cht-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/cht-configuration-schema","docId":"packages/cht-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/cht-changelog","docId":"packages/cht-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/cht-readme","docId":"packages/cht-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"ckan","href":"/adaptors/ckan","docId":"ckan"},{"type":"category","label":"commcare","items":[{"type":"link","label":"Overview","href":"/adaptors/commcare","docId":"commcare"},{"type":"link","label":"Functions","href":"/adaptors/packages/commcare-docs","docId":"packages/commcare-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/commcare-configuration-schema","docId":"packages/commcare-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\u2728 Q3 2022 Update HH Name in CommCare","href":"/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27","docId":"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27"},{"type":"link","label":"Registration forms(new case)","href":"/adaptors/library/jobs/auto/Registration-forms-new-case-2023-06-22","docId":"library/jobs/auto/Registration-forms-new-case-2023-06-22"},{"type":"link","label":"nawiri","href":"/adaptors/library/jobs/auto/nawiri-2023-05-03","docId":"library/jobs/auto/nawiri-2023-05-03"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/commcare-changelog","docId":"packages/commcare-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/commcare-readme","docId":"packages/commcare-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"common","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/common-docs","docId":"packages/common-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/common-configuration-schema","docId":"packages/common-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/common-changelog","docId":"packages/common-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/common-readme","docId":"packages/common-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"dhis2","items":[{"type":"link","label":"Overview","href":"/adaptors/dhis2","docId":"dhis2"},{"type":"link","label":"Functions","href":"/adaptors/packages/dhis2-docs","docId":"packages/dhis2-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/dhis2-configuration-schema","docId":"packages/dhis2-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Add data values","href":"/adaptors/library/jobs/auto/DHIS2-DataValues-API","docId":"library/jobs/auto/DHIS2-DataValues-API"},{"type":"link","label":"\ud83d\udcdc Add events","href":"/adaptors/library/jobs/auto/DHIS2-Events-API","docId":"library/jobs/auto/DHIS2-Events-API"},{"type":"link","label":"Load to DHIS2","href":"/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17","docId":"library/jobs/auto/Load-to-DHIS2-2023-07-17"},{"type":"link","label":"DHIS2 Events","href":"/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27","docId":"library/jobs/auto/DHIS2-Events-2016-01-27"},{"type":"link","label":"Create TEI (dhis2)","href":"/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22","docId":"library/jobs/auto/Create-TEI-dhis2-2021-03-22"},{"type":"link","label":"CHW case to DHIS2","href":"/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27","docId":"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27"},{"type":"link","label":"0 - Get TEI data","href":"/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02","docId":"library/jobs/auto/0-Get-TEI-data-2021-06-02"},{"type":"link","label":"Add DHIS2 Data Value Sets","href":"/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28","docId":"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/dhis2-changelog","docId":"packages/dhis2-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/dhis2-readme","docId":"packages/dhis2-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"dynamics","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/dynamics-docs","docId":"packages/dynamics-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/dynamics-configuration-schema","docId":"packages/dynamics-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/dynamics-changelog","docId":"packages/dynamics-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/dynamics-readme","docId":"packages/dynamics-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"facebook","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/facebook-docs","docId":"packages/facebook-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/facebook-configuration-schema","docId":"packages/facebook-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/facebook-changelog","docId":"packages/facebook-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/facebook-readme","docId":"packages/facebook-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"fhir","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/fhir-docs","docId":"packages/fhir-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/fhir-configuration-schema","docId":"packages/fhir-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/fhir-changelog","docId":"packages/fhir-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/fhir-readme","docId":"packages/fhir-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"godata","items":[{"type":"link","label":"Overview","href":"/adaptors/godata","docId":"godata"},{"type":"link","label":"Functions","href":"/adaptors/packages/godata-docs","docId":"packages/godata-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/godata-configuration-schema","docId":"packages/godata-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/godata-changelog","docId":"packages/godata-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/godata-readme","docId":"packages/godata-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"googlehealthcare","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/googlehealthcare-docs","docId":"packages/googlehealthcare-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/googlehealthcare-configuration-schema","docId":"packages/googlehealthcare-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/googlehealthcare-changelog","docId":"packages/googlehealthcare-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/googlehealthcare-readme","docId":"packages/googlehealthcare-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"googlesheets","items":[{"type":"link","label":"Overview","href":"/adaptors/googlesheets","docId":"googlesheets"},{"type":"link","label":"Functions","href":"/adaptors/packages/googlesheets-docs","docId":"packages/googlesheets-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/googlesheets-configuration-schema","docId":"packages/googlesheets-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Kobo to sheets","href":"/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13","docId":"library/jobs/auto/Kobo-to-sheets-2023-10-13"},{"type":"link","label":"Register Patient","href":"/adaptors/library/jobs/auto/Register-Patient-2021-03-02","docId":"library/jobs/auto/Register-Patient-2021-03-02"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/googlesheets-changelog","docId":"packages/googlesheets-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/googlesheets-readme","docId":"packages/googlesheets-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"hive","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/hive-docs","docId":"packages/hive-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/hive-configuration-schema","docId":"packages/hive-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/hive-changelog","docId":"packages/hive-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/hive-readme","docId":"packages/hive-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"http","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/http-docs","docId":"packages/http-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/http-configuration-schema","docId":"packages/http-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Extract Kobo data from API to send to OpenFn Inbox","href":"/adaptors/library/jobs/auto/getKoboData","docId":"library/jobs/auto/getKoboData"},{"type":"link","label":"\ud83d\udcdc Using async and array.map","href":"/adaptors/library/jobs/auto/async-and-array-dot-map","docId":"library/jobs/auto/async-and-array-dot-map"},{"type":"link","label":"\ud83d\udcdc Chaining HTTP Requests","href":"/adaptors/library/jobs/auto/complex-http-request-chains","docId":"library/jobs/auto/complex-http-request-chains"},{"type":"link","label":"\ud83d\udcdc Promises and nested requests","href":"/adaptors/library/jobs/auto/promise-all-nested-requests","docId":"library/jobs/auto/promise-all-nested-requests"},{"type":"link","label":"\ud83d\udcdc Timeout to create a delay","href":"/adaptors/library/jobs/auto/timeout","docId":"library/jobs/auto/timeout"},{"type":"link","label":"\ud83d\udcdc Chaining synchronous http requests","href":"/adaptors/library/jobs/auto/synchronous-http-request","docId":"library/jobs/auto/synchronous-http-request"},{"type":"link","label":"Fetch Claims","href":"/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17","docId":"library/jobs/auto/Fetch-Claims-2023-07-17"},{"type":"link","label":"1 Get CommCare Forms Bulk Extract","href":"/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08","docId":"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08"},{"type":"link","label":"\u2728 WF3-1 Bulk get Person Visit cases","href":"/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19","docId":"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19"},{"type":"link","label":"\u2728 WF2-1 Bulk get Person cases","href":"/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19","docId":"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19"},{"type":"link","label":"\u2728 WF1-1 Bulk get HH cases","href":"/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19","docId":"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19"},{"type":"link","label":"\u2728 WF4-1 Bulk get Referral Cases","href":"/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19","docId":"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19"},{"type":"link","label":"no return","href":"/adaptors/library/jobs/auto/no-return-2023-01-06","docId":"library/jobs/auto/no-return-2023-01-06"},{"type":"link","label":"Catch Error in HTTP Request","href":"/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26","docId":"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26"},{"type":"link","label":"Get CommCare Forms (Bulk Extract)","href":"/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16","docId":"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16"},{"type":"link","label":"aleksa cron","href":"/adaptors/library/jobs/auto/aleksa-cron-2022-04-29","docId":"library/jobs/auto/aleksa-cron-2022-04-29"},{"type":"link","label":"Request Vitas Sync","href":"/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11","docId":"library/jobs/auto/Request-Vitas-Sync-2021-05-11"},{"type":"link","label":"Failed Payment Notification","href":"/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23","docId":"library/jobs/auto/Failed-Payment-Notification-2021-04-23"},{"type":"link","label":"02b/ Initiate Payments","href":"/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19","docId":"library/jobs/auto/02b-Initiate-Payments-2019-11-19"},{"type":"link","label":"01c/ Create person_position record","href":"/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13","docId":"library/jobs/auto/01c-Create-person_position-record-2019-12-13"},{"type":"link","label":"01a/ Create Registrants","href":"/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19","docId":"library/jobs/auto/01a-Create-Registrants-2019-11-19"},{"type":"link","label":"05b/Update ODK eval form","href":"/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19","docId":"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19"},{"type":"link","label":"05/ Submit employee evaluation","href":"/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03","docId":"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03"},{"type":"link","label":"04b/ Update ODK form","href":"/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03","docId":"library/jobs/auto/04b-Update-ODK-form-2019-12-03"},{"type":"link","label":"commcare reports api","href":"/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29","docId":"library/jobs/auto/commcare-reports-api-2016-08-29"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/http-changelog","docId":"packages/http-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/http-readme","docId":"packages/http-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"khanacademy","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/khanacademy-docs","docId":"packages/khanacademy-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/khanacademy-configuration-schema","docId":"packages/khanacademy-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/khanacademy-changelog","docId":"packages/khanacademy-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/khanacademy-readme","docId":"packages/khanacademy-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"kobotoolbox","items":[{"type":"link","label":"Overview","href":"/adaptors/kobotoolbox","docId":"kobotoolbox"},{"type":"link","label":"Functions","href":"/adaptors/packages/kobotoolbox-docs","docId":"packages/kobotoolbox-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/kobotoolbox-configuration-schema","docId":"packages/kobotoolbox-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"GET Data From KoboToolbox","href":"/adaptors/library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22","docId":"library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/kobotoolbox-changelog","docId":"packages/kobotoolbox-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/kobotoolbox-readme","docId":"packages/kobotoolbox-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"magpi","items":[{"type":"link","label":"Overview","href":"/adaptors/magpi","docId":"magpi"},{"type":"link","label":"Functions","href":"/adaptors/packages/magpi-docs","docId":"packages/magpi-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/magpi-configuration-schema","docId":"packages/magpi-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/magpi-changelog","docId":"packages/magpi-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/magpi-readme","docId":"packages/magpi-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mailchimp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mailchimp-docs","docId":"packages/mailchimp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mailchimp-configuration-schema","docId":"packages/mailchimp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mailchimp-changelog","docId":"packages/mailchimp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mailchimp-readme","docId":"packages/mailchimp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mailgun","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mailgun-docs","docId":"packages/mailgun-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mailgun-configuration-schema","docId":"packages/mailgun-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc send email","href":"/adaptors/library/jobs/auto/send-mail-in-mailgun","docId":"library/jobs/auto/send-mail-in-mailgun"},{"type":"link","label":"01 send mailgun email","href":"/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04","docId":"library/jobs/auto/01-send-mailgun-email-2018-12-04"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mailgun-changelog","docId":"packages/mailgun-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mailgun-readme","docId":"packages/mailgun-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"maximo","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/maximo-docs","docId":"packages/maximo-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/maximo-configuration-schema","docId":"packages/maximo-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/maximo-changelog","docId":"packages/maximo-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/maximo-readme","docId":"packages/maximo-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"medicmobile","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/medicmobile-docs","docId":"packages/medicmobile-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/medicmobile-configuration-schema","docId":"packages/medicmobile-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/medicmobile-changelog","docId":"packages/medicmobile-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/medicmobile-readme","docId":"packages/medicmobile-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mogli","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mogli-docs","docId":"packages/mogli-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mogli-configuration-schema","docId":"packages/mogli-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mogli-changelog","docId":"packages/mogli-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mogli-readme","docId":"packages/mogli-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mongodb","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mongodb-docs","docId":"packages/mongodb-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mongodb-configuration-schema","docId":"packages/mongodb-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mongodb-changelog","docId":"packages/mongodb-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mongodb-readme","docId":"packages/mongodb-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"moodle","href":"/adaptors/moodle","docId":"moodle"},{"type":"category","label":"msgraph","items":[{"type":"link","label":"Overview","href":"/adaptors/msgraph","docId":"msgraph"},{"type":"link","label":"Functions","href":"/adaptors/packages/msgraph-docs","docId":"packages/msgraph-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/msgraph-configuration-schema","docId":"packages/msgraph-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/msgraph-changelog","docId":"packages/msgraph-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/msgraph-readme","docId":"packages/msgraph-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mssql","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mssql-docs","docId":"packages/mssql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mssql-configuration-schema","docId":"packages/mssql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Extract Vitas Data","href":"/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11","docId":"library/jobs/auto/Extract-Vitas-Data-2021-05-11"},{"type":"link","label":"CommCare to Azure Sql","href":"/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27","docId":"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mssql-changelog","docId":"packages/mssql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mssql-readme","docId":"packages/mssql-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mysql","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mysql-docs","docId":"packages/mysql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mysql-configuration-schema","docId":"packages/mysql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"01b/ Query new person record","href":"/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13","docId":"library/jobs/auto/01b-Query-new-person-record-2019-12-13"},{"type":"link","label":"03/ Update Payment Status","href":"/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19","docId":"library/jobs/auto/03-Update-Payment-Status-2019-11-19"},{"type":"link","label":"05a/Query for new employees","href":"/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19","docId":"library/jobs/auto/05a-Query-for-new-employees-2019-12-19"},{"type":"link","label":"04a/Query for job changes","href":"/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12","docId":"library/jobs/auto/04a-Query-for-job-changes-2019-12-12"},{"type":"link","label":"02a/ Query DB for people to pay","href":"/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11","docId":"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mysql-changelog","docId":"packages/mysql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mysql-readme","docId":"packages/mysql-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"nexmo","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/nexmo-docs","docId":"packages/nexmo-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/nexmo-configuration-schema","docId":"packages/nexmo-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/nexmo-changelog","docId":"packages/nexmo-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/nexmo-readme","docId":"packages/nexmo-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"ocl","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/ocl-docs","docId":"packages/ocl-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/ocl-configuration-schema","docId":"packages/ocl-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/ocl-changelog","docId":"packages/ocl-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/ocl-readme","docId":"packages/ocl-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"odk","items":[{"type":"link","label":"Overview","href":"/adaptors/odk","docId":"odk"},{"type":"link","label":"Functions","href":"/adaptors/packages/odk-docs","docId":"packages/odk-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/odk-configuration-schema","docId":"packages/odk-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/odk-changelog","docId":"packages/odk-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/odk-readme","docId":"packages/odk-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"ona","href":"/adaptors/ona","docId":"ona"},{"type":"category","label":"openfn","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openfn-docs","docId":"packages/openfn-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openfn-configuration-schema","docId":"packages/openfn-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openfn-changelog","docId":"packages/openfn-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openfn-readme","docId":"packages/openfn-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openhim","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openhim-docs","docId":"packages/openhim-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openhim-configuration-schema","docId":"packages/openhim-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Create encounter in OpenHIM","href":"/adaptors/library/jobs/auto/CommCare-FHIR","docId":"library/jobs/auto/CommCare-FHIR"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/openhim-changelog","docId":"packages/openhim-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openhim-readme","docId":"packages/openhim-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openimis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openimis-docs","docId":"packages/openimis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openimis-configuration-schema","docId":"packages/openimis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openimis-changelog","docId":"packages/openimis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openimis-readme","docId":"packages/openimis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openlmis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openlmis-docs","docId":"packages/openlmis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openlmis-configuration-schema","docId":"packages/openlmis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openlmis-changelog","docId":"packages/openlmis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openlmis-readme","docId":"packages/openlmis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openmrs","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openmrs-docs","docId":"packages/openmrs-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openmrs-configuration-schema","docId":"packages/openmrs-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Create Person in OpenMRS","href":"/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12","docId":"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12"},{"type":"link","label":"Create Patient in OpenMRS","href":"/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24","docId":"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/openmrs-changelog","docId":"packages/openmrs-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openmrs-readme","docId":"packages/openmrs-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openspp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openspp-docs","docId":"packages/openspp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openspp-configuration-schema","docId":"packages/openspp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openspp-changelog","docId":"packages/openspp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openspp-readme","docId":"packages/openspp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"postgresql","items":[{"type":"link","label":"Overview","href":"/adaptors/postgresql","docId":"postgresql"},{"type":"link","label":"Functions","href":"/adaptors/packages/postgresql-docs","docId":"packages/postgresql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/postgresql-configuration-schema","docId":"packages/postgresql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Using findValue with an array of data","href":"/adaptors/library/jobs/auto/async-findValue","docId":"library/jobs/auto/async-findValue"},{"type":"link","label":"1. Get data from SLUHIS","href":"/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08","docId":"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08"},{"type":"link","label":"Load to DB","href":"/adaptors/library/jobs/auto/Load-to-DB-2022-05-16","docId":"library/jobs/auto/Load-to-DB-2022-05-16"},{"type":"link","label":"Load / Upsert Data into PostgreSQL","href":"/adaptors/library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22","docId":"library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22"},{"type":"link","label":"Upsert to mBrana","href":"/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11","docId":"library/jobs/auto/Upsert-to-mBrana-2021-05-11"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/postgresql-changelog","docId":"packages/postgresql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/postgresql-readme","docId":"packages/postgresql-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"powerbi","href":"/adaptors/powerbi","docId":"powerbi"},{"type":"category","label":"primero","items":[{"type":"link","label":"Overview","href":"/adaptors/primero","docId":"primero"},{"type":"link","label":"Functions","href":"/adaptors/packages/primero-docs","docId":"packages/primero-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/primero-configuration-schema","docId":"packages/primero-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Get cases from Primero","href":"/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23","docId":"library/jobs/auto/Get-cases-from-Primero-2021-09-23"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/primero-changelog","docId":"packages/primero-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/primero-readme","docId":"packages/primero-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"progres","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/progres-docs","docId":"packages/progres-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/progres-configuration-schema","docId":"packages/progres-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/progres-changelog","docId":"packages/progres-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/progres-readme","docId":"packages/progres-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"rapidpro","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/rapidpro-docs","docId":"packages/rapidpro-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/rapidpro-configuration-schema","docId":"packages/rapidpro-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/rapidpro-changelog","docId":"packages/rapidpro-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/rapidpro-readme","docId":"packages/rapidpro-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"redis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/redis-docs","docId":"packages/redis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/redis-configuration-schema","docId":"packages/redis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/redis-changelog","docId":"packages/redis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/redis-readme","docId":"packages/redis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"resourcemap","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/resourcemap-docs","docId":"packages/resourcemap-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/resourcemap-configuration-schema","docId":"packages/resourcemap-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/resourcemap-changelog","docId":"packages/resourcemap-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/resourcemap-readme","docId":"packages/resourcemap-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"salesforce","items":[{"type":"link","label":"Overview","href":"/adaptors/salesforce","docId":"salesforce"},{"type":"link","label":"Functions","href":"/adaptors/packages/salesforce-docs","docId":"packages/salesforce-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/salesforce-configuration-schema","docId":"packages/salesforce-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Pre-processing data","href":"/adaptors/library/jobs/auto/alter-state-before-operations","docId":"library/jobs/auto/alter-state-before-operations"},{"type":"link","label":"\ud83d\udcdc Using merge and each","href":"/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce","docId":"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce"},{"type":"link","label":"\ud83d\udcdc Using promises","href":"/adaptors/library/jobs/auto/complex-state-control","docId":"library/jobs/auto/complex-state-control"},{"type":"link","label":"\ud83d\udcdc Concat fields with nulls","href":"/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls","docId":"library/jobs/auto/concatenate-many-fields-with-nulls"},{"type":"link","label":"\ud83d\udcdc Create/update records if...","href":"/adaptors/library/jobs/auto/create-if-proposal","docId":"library/jobs/auto/create-if-proposal"},{"type":"link","label":"\ud83d\udcdc Create SMS linked to contact","href":"/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF","docId":"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF"},{"type":"link","label":"\ud83d\udcdc Handling multiple ODK repeat groups","href":"/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks","docId":"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks"},{"type":"link","label":"\ud83d\udcdc Merge data into child array then upsert","href":"/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array","docId":"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array"},{"type":"link","label":"\u2728 Coach Session Register","href":"/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03","docId":"library/jobs/auto/Coach-Session-Register-2021-05-03"},{"type":"link","label":"\u2728 Upsert Pre Challenges","href":"/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30","docId":"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30"},{"type":"link","label":"\u2728 Upsert Post Challenges","href":"/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30","docId":"library/jobs/auto/Upsert-Post-Challenges-2021-04-30"},{"type":"link","label":"Upsert User in Salesforce","href":"/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16","docId":"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16"},{"type":"link","label":"\u2728 Attendance Non Skillz","href":"/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14","docId":"library/jobs/auto/Attendance-Non-Skillz-2021-06-14"},{"type":"link","label":"\u2728 Upsert Register Participant","href":"/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28","docId":"library/jobs/auto/Upsert-Register-Participant-2021-04-28"},{"type":"link","label":"Outcome Survey","href":"/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16","docId":"library/jobs/auto/Outcome-Survey-2024-07-16"},{"type":"link","label":"\u2728 Create Intervention","href":"/adaptors/library/jobs/auto/Create-Intervention-2021-04-08","docId":"library/jobs/auto/Create-Intervention-2021-04-08"},{"type":"link","label":"WF3-2a Repeat Failed Person Visits","href":"/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31","docId":"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31"},{"type":"link","label":"Q4 2022 Upsert Supervision - Accompaniment","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22"},{"type":"link","label":"Upsert Team or Group Name","href":"/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28","docId":"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28"},{"type":"link","label":"\u2728 Upsert Risk and Vulnerability Assessment - Service Referral","href":"/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25","docId":"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25"},{"type":"link","label":"Upsert Register Participant Skillz","href":"/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30","docId":"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30"},{"type":"link","label":"Upsert Coach Support Visit CSV","href":"/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28","docId":"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28"},{"type":"link","label":"\u2728 Upsert Home Visit Log Form","href":"/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03","docId":"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03"},{"type":"link","label":"Q3 2022 Upsert Household & Household Visit in SF","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28","docId":"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28"},{"type":"link","label":"\u2728 Q3 2022 Create Distribution & Referral in SF","href":"/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19","docId":"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19"},{"type":"link","label":"Q3 2022 Upsert Person","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21","docId":"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21"},{"type":"link","label":"\u2728 WF4-2 Bulk upsert Services","href":"/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19","docId":"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19"},{"type":"link","label":"\u2728 WF3-2 Bulk upsert Person Visits","href":"/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19","docId":"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19"},{"type":"link","label":"\u2728 WF2-2 Bulk upsert Persons","href":"/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19","docId":"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19"},{"type":"link","label":"\u2728 WF1-2 Bulk upsert HHs and HH Visits","href":"/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19","docId":"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19"},{"type":"link","label":"Q4 2022 Upsert Supervision - Household Spot Check","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24"},{"type":"link","label":"Q4 2022 Upsert Supervision - Feedback","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19"},{"type":"link","label":"Q3 2022 Upsert Person Visit","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28","docId":"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28"},{"type":"link","label":"Create contact","href":"/adaptors/library/jobs/auto/Create-contact-2021-03-01","docId":"library/jobs/auto/Create-contact-2021-03-01"},{"type":"link","label":"HIV Testing Event Statistics","href":"/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03","docId":"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03"},{"type":"link","label":"Malaria Testing Event Statistics","href":"/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03","docId":"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03"},{"type":"link","label":"HIV Testing Event Snapshot","href":"/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03","docId":"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03"},{"type":"link","label":"Malaria Testing Event Snapshot","href":"/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03","docId":"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03"},{"type":"link","label":"PHQ9","href":"/adaptors/library/jobs/auto/PHQ9-2021-05-03","docId":"library/jobs/auto/PHQ9-2021-05-03"},{"type":"link","label":"Risk and Vulnerability Assessment","href":"/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27","docId":"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27"},{"type":"link","label":"Upsert Attendance Skillz Plus Club","href":"/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24","docId":"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24"},{"type":"link","label":"Upsert ART Adherence Self-Reporting Tool","href":"/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30","docId":"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30"},{"type":"link","label":"Upsert Aggregate Service Referrals","href":"/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30","docId":"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30"},{"type":"link","label":"Upsert Confirm Services Received","href":"/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14","docId":"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14"},{"type":"link","label":"Upsert Intervention Notes","href":"/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28","docId":"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28"},{"type":"link","label":"Upsert Register Event","href":"/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30","docId":"library/jobs/auto/Upsert-Register-Event-2021-04-30"},{"type":"link","label":"Upsert Register Skills plus Club","href":"/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30","docId":"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30"},{"type":"link","label":"Upsert Service Referral","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30","docId":"library/jobs/auto/Upsert-Service-Referral-2021-04-30"},{"type":"link","label":"Upsert Service Referral 2","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14","docId":"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14"},{"type":"link","label":"Upsert Service Referral Followup","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30","docId":"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30"},{"type":"link","label":"Register Participant - V2 Skillz","href":"/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02","docId":"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02"},{"type":"link","label":"Create Person in SF","href":"/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25","docId":"library/jobs/auto/Create-Person-in-SF-2019-02-25"},{"type":"link","label":"1. Create Payment in SF","href":"/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03","docId":"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/salesforce-changelog","docId":"packages/salesforce-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/salesforce-readme","docId":"packages/salesforce-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"satusehat","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/satusehat-docs","docId":"packages/satusehat-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/satusehat-configuration-schema","docId":"packages/satusehat-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/satusehat-changelog","docId":"packages/satusehat-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/satusehat-readme","docId":"packages/satusehat-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"sftp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/sftp-docs","docId":"packages/sftp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/sftp-configuration-schema","docId":"packages/sftp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/sftp-changelog","docId":"packages/sftp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/sftp-readme","docId":"packages/sftp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"smpp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/smpp-docs","docId":"packages/smpp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/smpp-configuration-schema","docId":"packages/smpp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/smpp-changelog","docId":"packages/smpp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/smpp-readme","docId":"packages/smpp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"surveycto","items":[{"type":"link","label":"Overview","href":"/adaptors/surveycto","docId":"surveycto"},{"type":"link","label":"Functions","href":"/adaptors/packages/surveycto-docs","docId":"packages/surveycto-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/surveycto-configuration-schema","docId":"packages/surveycto-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/surveycto-changelog","docId":"packages/surveycto-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/surveycto-readme","docId":"packages/surveycto-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"tableau","href":"/adaptors/tableau","docId":"tableau"},{"type":"category","label":"telerivet","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/telerivet-docs","docId":"packages/telerivet-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/telerivet-configuration-schema","docId":"packages/telerivet-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Send sms from Salesforce workflow action","href":"/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow","docId":"library/jobs/auto/send-sms-from-salesforce-workflow"},{"type":"link","label":"2. SMS Balance Update to Customer","href":"/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14","docId":"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/telerivet-changelog","docId":"packages/telerivet-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/telerivet-readme","docId":"packages/telerivet-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"testing","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/testing-docs","docId":"packages/testing-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/testing-configuration-schema","docId":"packages/testing-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/testing-changelog","docId":"packages/testing-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/testing-readme","docId":"packages/testing-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"twilio","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/twilio-docs","docId":"packages/twilio-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/twilio-configuration-schema","docId":"packages/twilio-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/twilio-changelog","docId":"packages/twilio-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/twilio-readme","docId":"packages/twilio-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"vtiger","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/vtiger-docs","docId":"packages/vtiger-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/vtiger-configuration-schema","docId":"packages/vtiger-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/vtiger-changelog","docId":"packages/vtiger-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/vtiger-readme","docId":"packages/vtiger-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"zoho","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/zoho-docs","docId":"packages/zoho-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/zoho-configuration-schema","docId":"packages/zoho-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/zoho-changelog","docId":"packages/zoho-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/zoho-readme","docId":"packages/zoho-readme"}],"collapsed":true,"collapsible":true}]},"docs":{"adaptors-intro":{"id":"adaptors-intro","title":"Adaptors","description":"Connect Anything.","sidebar":"adaptors"},"cht":{"id":"cht","title":"Community Health Toolkit","description":"1. To push data from CHT applications to OpenFn, leverage the","sidebar":"adaptors"},"ckan":{"id":"ckan","title":"CKAN","description":"App Overview","sidebar":"adaptors"},"commcare":{"id":"commcare","title":"CommCare","description":"App Overview","sidebar":"adaptors"},"dhis2":{"id":"dhis2","title":"DHIS2","description":"App Overview","sidebar":"adaptors"},"godata":{"id":"godata","title":"Go.Data","description":"Overview","sidebar":"adaptors"},"googlesheets":{"id":"googlesheets","title":"Google Forms/Google Sheets","description":"Google Sheets Adaptor Overview","sidebar":"adaptors"},"kobotoolbox":{"id":"kobotoolbox","title":"Kobo Toolbox","description":"App Overview","sidebar":"adaptors"},"library-intro":{"id":"library-intro","title":"The Community Job Library","description":"A growing knowledge base","sidebar":"adaptors"},"library/jobs/auto/0-Get-TEI-data-2021-06-02":{"id":"library/jobs/auto/0-Get-TEI-data-2021-06-02","title":"0 - Get TEI data","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01-send-mailgun-email-2018-12-04":{"id":"library/jobs/auto/01-send-mailgun-email-2018-12-04","title":"01 send mailgun email","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01a-Create-Registrants-2019-11-19":{"id":"library/jobs/auto/01a-Create-Registrants-2019-11-19","title":"01a/ Create Registrants","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01b-Query-new-person-record-2019-12-13":{"id":"library/jobs/auto/01b-Query-new-person-record-2019-12-13","title":"01b/ Query new person record","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01c-Create-person_position-record-2019-12-13":{"id":"library/jobs/auto/01c-Create-person_position-record-2019-12-13","title":"01c/ Create person_position record","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11":{"id":"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11","title":"02a/ Query DB for people to pay","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/02b-Initiate-Payments-2019-11-19":{"id":"library/jobs/auto/02b-Initiate-Payments-2019-11-19","title":"02b/ Initiate Payments","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/03-Update-Payment-Status-2019-11-19":{"id":"library/jobs/auto/03-Update-Payment-Status-2019-11-19","title":"03/ Update Payment Status","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/04a-Query-for-job-changes-2019-12-12":{"id":"library/jobs/auto/04a-Query-for-job-changes-2019-12-12","title":"04a/Query for job changes","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/04b-Update-ODK-form-2019-12-03":{"id":"library/jobs/auto/04b-Update-ODK-form-2019-12-03","title":"04b/ Update ODK form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03":{"id":"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03","title":"05/ Submit employee evaluation","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05a-Query-for-new-employees-2019-12-19":{"id":"library/jobs/auto/05a-Query-for-new-employees-2019-12-19","title":"05a/Query for new employees","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19":{"id":"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19","title":"05b/Update ODK eval form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03":{"id":"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03","title":"1. Create Payment in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08":{"id":"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08","title":"1 Get CommCare Forms Bulk Extract","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08":{"id":"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08","title":"1. Get data from SLUHIS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14":{"id":"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14","title":"2. SMS Balance Update to Customer","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28":{"id":"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28","title":"Add DHIS2 Data Value Sets","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/aleksa-cron-2022-04-29":{"id":"library/jobs/auto/aleksa-cron-2022-04-29","title":"aleksa cron","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/alter-state-before-operations":{"id":"library/jobs/auto/alter-state-before-operations","title":"Pre-processing data","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Asana-test-2024-07-29":{"id":"library/jobs/auto/Asana-test-2024-07-29","title":"Asana-test","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/async-and-array-dot-map":{"id":"library/jobs/auto/async-and-array-dot-map","title":"Using async and array.map","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/async-findValue":{"id":"library/jobs/auto/async-findValue","title":"Using findValue with an array of data","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Attendance-Non-Skillz-2021-06-14":{"id":"library/jobs/auto/Attendance-Non-Skillz-2021-06-14","title":"Attendance Non Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce":{"id":"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce","title":"Using merge and each","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26":{"id":"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26","title":"Catch Error in HTTP Request","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27":{"id":"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27","title":"CHW case to DHIS2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Coach-Session-Register-2021-05-03":{"id":"library/jobs/auto/Coach-Session-Register-2021-05-03","title":"Coach Session Register","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CommCare-FHIR":{"id":"library/jobs/auto/CommCare-FHIR","title":"Create encounter in OpenHIM","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/commcare-reports-api-2016-08-29":{"id":"library/jobs/auto/commcare-reports-api-2016-08-29","title":"commcare reports api","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27":{"id":"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27","title":"CommCare to Azure Sql","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/complex-http-request-chains":{"id":"library/jobs/auto/complex-http-request-chains","title":"Chaining HTTP Requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/complex-state-control":{"id":"library/jobs/auto/complex-state-control","title":"Using promises","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/concatenate-many-fields-with-nulls":{"id":"library/jobs/auto/concatenate-many-fields-with-nulls","title":"Concat fields with nulls","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-contact-2021-03-01":{"id":"library/jobs/auto/Create-contact-2021-03-01","title":"Create contact","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/create-if-proposal":{"id":"library/jobs/auto/create-if-proposal","title":"Create/update records if...","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-Intervention-2021-04-08":{"id":"library/jobs/auto/Create-Intervention-2021-04-08","title":"Create Intervention","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24":{"id":"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24","title":"Create Patient in OpenMRS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12":{"id":"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12","title":"Create Person in OpenMRS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Person-in-SF-2019-02-25":{"id":"library/jobs/auto/Create-Person-in-SF-2019-02-25","title":"Create Person in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF":{"id":"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF","title":"Create SMS linked to contact","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-TEI-dhis2-2021-03-22":{"id":"library/jobs/auto/Create-TEI-dhis2-2021-03-22","title":"Create TEI (dhis2)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-DataValues-API":{"id":"library/jobs/auto/DHIS2-DataValues-API","title":"Add data values","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-Events-2016-01-27":{"id":"library/jobs/auto/DHIS2-Events-2016-01-27","title":"DHIS2 Events","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-Events-API":{"id":"library/jobs/auto/DHIS2-Events-API","title":"Add events","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Extract-Vitas-Data-2021-05-11":{"id":"library/jobs/auto/Extract-Vitas-Data-2021-05-11","title":"Extract Vitas Data","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Failed-Payment-Notification-2021-04-23":{"id":"library/jobs/auto/Failed-Payment-Notification-2021-04-23","title":"Failed Payment Notification","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Fetch-Claims-2023-07-17":{"id":"library/jobs/auto/Fetch-Claims-2023-07-17","title":"Fetch Claims","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Get-cases-from-Primero-2021-09-23":{"id":"library/jobs/auto/Get-cases-from-Primero-2021-09-23","title":"Get cases from Primero","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16":{"id":"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16","title":"Get CommCare Forms (Bulk Extract)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22":{"id":"library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22","title":"GET Data From KoboToolbox","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/getKoboData":{"id":"library/jobs/auto/getKoboData","title":"Extract Kobo data from API to send to OpenFn Inbox","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03":{"id":"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03","title":"HIV Testing Event Snapshot","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03":{"id":"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03","title":"HIV Testing Event Statistics","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Kobo-to-sheets-2023-10-13":{"id":"library/jobs/auto/Kobo-to-sheets-2023-10-13","title":"Kobo to sheets","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-to-DB-2022-05-16":{"id":"library/jobs/auto/Load-to-DB-2022-05-16","title":"Load to DB","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-to-DHIS2-2023-07-17":{"id":"library/jobs/auto/Load-to-DHIS2-2023-07-17","title":"Load to DHIS2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22":{"id":"library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22","title":"Load / Upsert Data into PostgreSQL","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03":{"id":"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03","title":"Malaria Testing Event Snapshot","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03":{"id":"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03","title":"Malaria Testing Event Statistics","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/nawiri-2023-05-03":{"id":"library/jobs/auto/nawiri-2023-05-03","title":"nawiri","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/no-return-2023-01-06":{"id":"library/jobs/auto/no-return-2023-01-06","title":"no return","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks":{"id":"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks","title":"Handling multiple ODK repeat groups","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Outcome-Survey-2024-07-16":{"id":"library/jobs/auto/Outcome-Survey-2024-07-16","title":"Outcome Survey","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Pay-CHW-2021-04-23":{"id":"library/jobs/auto/Pay-CHW-2021-04-23","title":"Pay CHW","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/PHQ9-2021-05-03":{"id":"library/jobs/auto/PHQ9-2021-05-03","title":"PHQ9","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/promise-all-nested-requests":{"id":"library/jobs/auto/promise-all-nested-requests","title":"Promises and nested requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19":{"id":"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19","title":"Q3 2022 Create Distribution & Referral in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27":{"id":"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27","title":"Q3 2022 Update HH Name in CommCare","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28":{"id":"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28","title":"Q3 2022 Upsert Household & Household Visit in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21":{"id":"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21","title":"Q3 2022 Upsert Person","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28":{"id":"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28","title":"Q3 2022 Upsert Person Visit","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22","title":"Q4 2022 Upsert Supervision - Accompaniment","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19","title":"Q4 2022 Upsert Supervision - Feedback","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24","title":"Q4 2022 Upsert Supervision - Household Spot Check","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02":{"id":"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02","title":"Register Participant - V2 Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Register-Patient-2021-03-02":{"id":"library/jobs/auto/Register-Patient-2021-03-02","title":"Register Patient","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Registration-forms-new-case-2023-06-22":{"id":"library/jobs/auto/Registration-forms-new-case-2023-06-22","title":"Registration forms(new case)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Request-Vitas-Sync-2021-05-11":{"id":"library/jobs/auto/Request-Vitas-Sync-2021-05-11","title":"Request Vitas Sync","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27":{"id":"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27","title":"Risk and Vulnerability Assessment","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/send-mail-in-mailgun":{"id":"library/jobs/auto/send-mail-in-mailgun","title":"send email","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/send-sms-from-salesforce-workflow":{"id":"library/jobs/auto/send-sms-from-salesforce-workflow","title":"Send sms from Salesforce workflow action","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/synchronous-http-request":{"id":"library/jobs/auto/synchronous-http-request","title":"Chaining synchronous http requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/timeout":{"id":"library/jobs/auto/timeout","title":"Timeout to create a delay","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30":{"id":"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30","title":"Upsert Aggregate Service Referrals","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30":{"id":"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30","title":"Upsert ART Adherence Self-Reporting Tool","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24":{"id":"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24","title":"Upsert Attendance Skillz Plus Club","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28":{"id":"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28","title":"Upsert Coach Support Visit CSV","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14":{"id":"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14","title":"Upsert Confirm Services Received","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03":{"id":"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03","title":"Upsert Home Visit Log Form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28":{"id":"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28","title":"Upsert Intervention Notes","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array":{"id":"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array","title":"Merge data into child array then upsert","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Post-Challenges-2021-04-30":{"id":"library/jobs/auto/Upsert-Post-Challenges-2021-04-30","title":"Upsert Post Challenges","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30":{"id":"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30","title":"Upsert Pre Challenges","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Event-2021-04-30":{"id":"library/jobs/auto/Upsert-Register-Event-2021-04-30","title":"Upsert Register Event","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Participant-2021-04-28":{"id":"library/jobs/auto/Upsert-Register-Participant-2021-04-28","title":"Upsert Register Participant","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30":{"id":"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30","title":"Upsert Register Participant Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30":{"id":"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30","title":"Upsert Register Skills plus Club","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25":{"id":"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25","title":"Upsert Risk and Vulnerability Assessment - Service Referral","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14":{"id":"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14","title":"Upsert Service Referral 2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-2021-04-30":{"id":"library/jobs/auto/Upsert-Service-Referral-2021-04-30","title":"Upsert Service Referral","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30":{"id":"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30","title":"Upsert Service Referral Followup","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28":{"id":"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28","title":"Upsert Team or Group Name","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-to-mBrana-2021-05-11":{"id":"library/jobs/auto/Upsert-to-mBrana-2021-05-11","title":"Upsert to mBrana","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16":{"id":"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16","title":"Upsert User in Salesforce","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19":{"id":"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19","title":"WF1-1 Bulk get HH cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19":{"id":"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19","title":"WF1-2 Bulk upsert HHs and HH Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19":{"id":"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19","title":"WF2-1 Bulk get Person cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19":{"id":"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19","title":"WF2-2 Bulk upsert Persons","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19":{"id":"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19","title":"WF3-1 Bulk get Person Visit cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19":{"id":"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19","title":"WF3-2 Bulk upsert Person Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31":{"id":"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31","title":"WF3-2a Repeat Failed Person Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19":{"id":"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19","title":"WF4-1 Bulk get Referral Cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19":{"id":"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19","title":"WF4-2 Bulk upsert Services","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/triggers/xmlns":{"id":"library/triggers/xmlns","title":"Match a message with a fragment inside another object called `form`","description":""},"magpi":{"id":"magpi","title":"Magpi","description":"Magpi is not able to push data to external URLs. In order to fetch data from","sidebar":"adaptors"},"moodle":{"id":"moodle","title":"Moodle","description":"Overview","sidebar":"adaptors"},"msgraph":{"id":"msgraph","title":"Microsoft Graph","description":"Overview","sidebar":"adaptors"},"odk":{"id":"odk","title":"ODK","description":"ODK is a data collection platform used by researchers,","sidebar":"adaptors"},"ona":{"id":"ona","title":"Ona.io","description":"Webhooks to push form data to OpenFn","sidebar":"adaptors"},"packages/asana-changelog":{"id":"packages/asana-changelog","title":"asana changelog","description":"4.0.2","sidebar":"adaptors"},"packages/asana-configuration-schema":{"id":"packages/asana-configuration-schema","title":"Config for asana","description":"Jobs that use the asana adaptor may require authentication. A","sidebar":"adaptors"},"packages/asana-docs":{"id":"packages/asana-docs","title":"asana@4.0.2","description":"createTask(params, callback)","sidebar":"adaptors"},"packages/asana-readme":{"id":"packages/asana-readme","title":"asana developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/asana","sidebar":"adaptors"},"packages/azure-storage-changelog":{"id":"packages/azure-storage-changelog","title":"azure-storage changelog","description":"2.0.2","sidebar":"adaptors"},"packages/azure-storage-configuration-schema":{"id":"packages/azure-storage-configuration-schema","title":"Config for azure-storage","description":"Jobs that use the azure-storage adaptor may require authentication. A","sidebar":"adaptors"},"packages/azure-storage-docs":{"id":"packages/azure-storage-docs","title":"azure-storage@2.0.2","description":"downloadBlob(blobName, [options])","sidebar":"adaptors"},"packages/azure-storage-readme":{"id":"packages/azure-storage-readme","title":"azure-storage developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/azure-storage","sidebar":"adaptors"},"packages/beyonic-changelog":{"id":"packages/beyonic-changelog","title":"beyonic changelog","description":"0.3.4","sidebar":"adaptors"},"packages/beyonic-configuration-schema":{"id":"packages/beyonic-configuration-schema","title":"Config for beyonic","description":"Jobs that use the beyonic adaptor may require authentication. A","sidebar":"adaptors"},"packages/beyonic-docs":{"id":"packages/beyonic-docs","title":"beyonic@0.3.4","description":"createCollectionRequest(data)","sidebar":"adaptors"},"packages/beyonic-readme":{"id":"packages/beyonic-readme","title":"beyonic developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/beyonic","sidebar":"adaptors"},"packages/bigquery-changelog":{"id":"packages/bigquery-changelog","title":"bigquery changelog","description":"3.0.2","sidebar":"adaptors"},"packages/bigquery-configuration-schema":{"id":"packages/bigquery-configuration-schema","title":"Config for bigquery","description":"Jobs that use the bigquery adaptor may require authentication. A","sidebar":"adaptors"},"packages/bigquery-docs":{"id":"packages/bigquery-docs","title":"bigquery@3.0.2","description":"load(dirPath, projectId, datasetId, tableId, loadOptions, callback)","sidebar":"adaptors"},"packages/bigquery-readme":{"id":"packages/bigquery-readme","title":"bigquery developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/bigquery","sidebar":"adaptors"},"packages/cartodb-changelog":{"id":"packages/cartodb-changelog","title":"cartodb changelog","description":"0.4.4","sidebar":"adaptors"},"packages/cartodb-configuration-schema":{"id":"packages/cartodb-configuration-schema","title":"Config for cartodb","description":"Jobs that use the cartodb adaptor may require authentication. A","sidebar":"adaptors"},"packages/cartodb-docs":{"id":"packages/cartodb-docs","title":"cartodb@0.4.4","description":"addRow(table, rowData)","sidebar":"adaptors"},"packages/cartodb-readme":{"id":"packages/cartodb-readme","title":"cartodb developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/cartodb","sidebar":"adaptors"},"packages/cht-changelog":{"id":"packages/cht-changelog","title":"cht changelog","description":"1.0.2","sidebar":"adaptors"},"packages/cht-configuration-schema":{"id":"packages/cht-configuration-schema","title":"Config for cht","description":"Jobs that use the cht adaptor may require authentication. A","sidebar":"adaptors"},"packages/cht-docs":{"id":"packages/cht-docs","title":"cht@1.0.2","description":"get(path, options, [callback])","sidebar":"adaptors"},"packages/cht-readme":{"id":"packages/cht-readme","title":"cht developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/cht","sidebar":"adaptors"},"packages/commcare-changelog":{"id":"packages/commcare-changelog","title":"commcare changelog","description":"3.1.2","sidebar":"adaptors"},"packages/commcare-configuration-schema":{"id":"packages/commcare-configuration-schema","title":"Config for commcare","description":"Jobs that use the commcare adaptor may require authentication. A","sidebar":"adaptors"},"packages/commcare-docs":{"id":"packages/commcare-docs","title":"commcare@3.1.2","description":"fetchReportData(reportId, params, postUrl)","sidebar":"adaptors"},"packages/commcare-readme":{"id":"packages/commcare-readme","title":"commcare developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/commcare","sidebar":"adaptors"},"packages/common-changelog":{"id":"packages/common-changelog","title":"common changelog","description":"2.0.0","sidebar":"adaptors"},"packages/common-configuration-schema":{"id":"packages/common-configuration-schema","title":"Config for common","description":"No configuration schema has been defined for the common adaptor.","sidebar":"adaptors"},"packages/common-docs":{"id":"packages/common-docs","title":"common@2.0.2","description":"arrayToString(arr, separator)","sidebar":"adaptors"},"packages/common-readme":{"id":"packages/common-readme","title":"common developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/common","sidebar":"adaptors"},"packages/dhis2-changelog":{"id":"packages/dhis2-changelog","title":"dhis2 changelog","description":"5.0.2","sidebar":"adaptors"},"packages/dhis2-configuration-schema":{"id":"packages/dhis2-configuration-schema","title":"Config for dhis2","description":"Jobs that use the dhis2 adaptor may require authentication. A","sidebar":"adaptors"},"packages/dhis2-docs":{"id":"packages/dhis2-docs","title":"dhis2@5.0.2","description":"attr(attribute, value)","sidebar":"adaptors"},"packages/dhis2-readme":{"id":"packages/dhis2-readme","title":"dhis2 developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/dhis2","sidebar":"adaptors"},"packages/dynamics-changelog":{"id":"packages/dynamics-changelog","title":"dynamics changelog","description":"0.5.5","sidebar":"adaptors"},"packages/dynamics-configuration-schema":{"id":"packages/dynamics-configuration-schema","title":"Config for dynamics","description":"Jobs that use the dynamics adaptor may require authentication. A","sidebar":"adaptors"},"packages/dynamics-docs":{"id":"packages/dynamics-docs","title":"dynamics@0.5.5","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/dynamics-readme":{"id":"packages/dynamics-readme","title":"dynamics developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/dynamics","sidebar":"adaptors"},"packages/facebook-changelog":{"id":"packages/facebook-changelog","title":"facebook changelog","description":"0.4.3","sidebar":"adaptors"},"packages/facebook-configuration-schema":{"id":"packages/facebook-configuration-schema","title":"Config for facebook","description":"Jobs that use the facebook adaptor may require authentication. A","sidebar":"adaptors"},"packages/facebook-docs":{"id":"packages/facebook-docs","title":"facebook@0.4.3","description":"postMessage(params)","sidebar":"adaptors"},"packages/facebook-readme":{"id":"packages/facebook-readme","title":"facebook developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/facebook","sidebar":"adaptors"},"packages/fhir-changelog":{"id":"packages/fhir-changelog","title":"fhir changelog","description":"5.0.2","sidebar":"adaptors"},"packages/fhir-configuration-schema":{"id":"packages/fhir-configuration-schema","title":"Config for fhir","description":"Jobs that use the fhir adaptor may require authentication. A","sidebar":"adaptors"},"packages/fhir-docs":{"id":"packages/fhir-docs","title":"fhir@5.0.2","description":"create(resourceType, resource, params, callback)","sidebar":"adaptors"},"packages/fhir-readme":{"id":"packages/fhir-readme","title":"fhir developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/fhir","sidebar":"adaptors"},"packages/godata-changelog":{"id":"packages/godata-changelog","title":"godata changelog","description":"3.5.2","sidebar":"adaptors"},"packages/godata-configuration-schema":{"id":"packages/godata-configuration-schema","title":"Config for godata","description":"Jobs that use the godata adaptor may require authentication. A","sidebar":"adaptors"},"packages/godata-docs":{"id":"packages/godata-docs","title":"godata@3.5.2","description":"getCase(id, query, callback)","sidebar":"adaptors"},"packages/godata-readme":{"id":"packages/godata-readme","title":"godata developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/godata","sidebar":"adaptors"},"packages/googlehealthcare-changelog":{"id":"packages/googlehealthcare-changelog","title":"googlehealthcare changelog","description":"1.1.2","sidebar":"adaptors"},"packages/googlehealthcare-configuration-schema":{"id":"packages/googlehealthcare-configuration-schema","title":"Config for googlehealthcare","description":"Jobs that use the googlehealthcare adaptor may require authentication. A","sidebar":"adaptors"},"packages/googlehealthcare-docs":{"id":"packages/googlehealthcare-docs","title":"googlehealthcare@1.1.2","description":"createFhirResource([fhirStore], resource, callback)","sidebar":"adaptors"},"packages/googlehealthcare-readme":{"id":"packages/googlehealthcare-readme","title":"googlehealthcare developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/googlehealthcare","sidebar":"adaptors"},"packages/googlesheets-changelog":{"id":"packages/googlesheets-changelog","title":"googlesheets changelog","description":"3.0.2","sidebar":"adaptors"},"packages/googlesheets-configuration-schema":{"id":"packages/googlesheets-configuration-schema","title":"Config for googlesheets","description":"Jobs that use the googlesheets adaptor may require authentication. A","sidebar":"adaptors"},"packages/googlesheets-docs":{"id":"packages/googlesheets-docs","title":"googlesheets@3.0.2","description":"appendValues(params, callback)","sidebar":"adaptors"},"packages/googlesheets-readme":{"id":"packages/googlesheets-readme","title":"googlesheets developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/googlesheets","sidebar":"adaptors"},"packages/hive-changelog":{"id":"packages/hive-changelog","title":"hive changelog","description":"0.3.3","sidebar":"adaptors"},"packages/hive-configuration-schema":{"id":"packages/hive-configuration-schema","title":"Config for hive","description":"Jobs that use the hive adaptor may require authentication. A","sidebar":"adaptors"},"packages/hive-docs":{"id":"packages/hive-docs","title":"hive@0.3.3","description":"query(qs, options, callback)","sidebar":"adaptors"},"packages/hive-readme":{"id":"packages/hive-readme","title":"hive developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/hive","sidebar":"adaptors"},"packages/http-changelog":{"id":"packages/http-changelog","title":"http changelog","description":"6.4.4","sidebar":"adaptors"},"packages/http-configuration-schema":{"id":"packages/http-configuration-schema","title":"Config for http","description":"Jobs that use the http adaptor may require authentication. A","sidebar":"adaptors"},"packages/http-docs":{"id":"packages/http-docs","title":"http@6.4.4","description":"del(path, params, callback)","sidebar":"adaptors"},"packages/http-readme":{"id":"packages/http-readme","title":"http developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/http","sidebar":"adaptors"},"packages/khanacademy-changelog":{"id":"packages/khanacademy-changelog","title":"khanacademy changelog","description":"0.5.3","sidebar":"adaptors"},"packages/khanacademy-configuration-schema":{"id":"packages/khanacademy-configuration-schema","title":"Config for khanacademy","description":"Jobs that use the khanacademy adaptor may require authentication. A","sidebar":"adaptors"},"packages/khanacademy-docs":{"id":"packages/khanacademy-docs","title":"khanacademy@0.5.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/khanacademy-readme":{"id":"packages/khanacademy-readme","title":"khanacademy developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/khanacademy","sidebar":"adaptors"},"packages/kobotoolbox-changelog":{"id":"packages/kobotoolbox-changelog","title":"kobotoolbox changelog","description":"2.4.2","sidebar":"adaptors"},"packages/kobotoolbox-configuration-schema":{"id":"packages/kobotoolbox-configuration-schema","title":"Config for kobotoolbox","description":"Jobs that use the kobotoolbox adaptor may require authentication. A","sidebar":"adaptors"},"packages/kobotoolbox-docs":{"id":"packages/kobotoolbox-docs","title":"kobotoolbox@2.4.2","description":"getDeploymentInfo(params, callback)","sidebar":"adaptors"},"packages/kobotoolbox-readme":{"id":"packages/kobotoolbox-readme","title":"kobotoolbox developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/kobotoolbox","sidebar":"adaptors"},"packages/magpi-changelog":{"id":"packages/magpi-changelog","title":"magpi changelog","description":"1.2.2","sidebar":"adaptors"},"packages/magpi-configuration-schema":{"id":"packages/magpi-configuration-schema","title":"Config for magpi","description":"Jobs that use the magpi adaptor may require authentication. A","sidebar":"adaptors"},"packages/magpi-docs":{"id":"packages/magpi-docs","title":"magpi@1.2.2","description":"fetchSurveyData(params)","sidebar":"adaptors"},"packages/magpi-readme":{"id":"packages/magpi-readme","title":"magpi developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/magpi","sidebar":"adaptors"},"packages/mailchimp-changelog":{"id":"packages/mailchimp-changelog","title":"mailchimp changelog","description":"1.0.4","sidebar":"adaptors"},"packages/mailchimp-configuration-schema":{"id":"packages/mailchimp-configuration-schema","title":"Config for mailchimp","description":"Jobs that use the mailchimp adaptor may require authentication. A","sidebar":"adaptors"},"packages/mailchimp-docs":{"id":"packages/mailchimp-docs","title":"mailchimp@1.0.4","description":"addMember(params, [callback])","sidebar":"adaptors"},"packages/mailchimp-readme":{"id":"packages/mailchimp-readme","title":"mailchimp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mailchimp","sidebar":"adaptors"},"packages/mailgun-changelog":{"id":"packages/mailgun-changelog","title":"mailgun changelog","description":"0.5.3","sidebar":"adaptors"},"packages/mailgun-configuration-schema":{"id":"packages/mailgun-configuration-schema","title":"Config for mailgun","description":"Jobs that use the mailgun adaptor may require authentication. A","sidebar":"adaptors"},"packages/mailgun-docs":{"id":"packages/mailgun-docs","title":"mailgun@0.5.3","description":"send(params)","sidebar":"adaptors"},"packages/mailgun-readme":{"id":"packages/mailgun-readme","title":"mailgun developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mailgun","sidebar":"adaptors"},"packages/maximo-changelog":{"id":"packages/maximo-changelog","title":"maximo changelog","description":"0.5.4","sidebar":"adaptors"},"packages/maximo-configuration-schema":{"id":"packages/maximo-configuration-schema","title":"Config for maximo","description":"Jobs that use the maximo adaptor may require authentication. A","sidebar":"adaptors"},"packages/maximo-docs":{"id":"packages/maximo-docs","title":"maximo@0.5.4","description":"fetch(params)","sidebar":"adaptors"},"packages/maximo-readme":{"id":"packages/maximo-readme","title":"maximo developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/maximo","sidebar":"adaptors"},"packages/medicmobile-changelog":{"id":"packages/medicmobile-changelog","title":"medicmobile changelog","description":"0.5.3","sidebar":"adaptors"},"packages/medicmobile-configuration-schema":{"id":"packages/medicmobile-configuration-schema","title":"Config for medicmobile","description":"Jobs that use the medicmobile adaptor may require authentication. A","sidebar":"adaptors"},"packages/medicmobile-docs":{"id":"packages/medicmobile-docs","title":"medicmobile@0.5.3","description":"changesApi(params, callback)","sidebar":"adaptors"},"packages/medicmobile-readme":{"id":"packages/medicmobile-readme","title":"medicmobile developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/medicmobile","sidebar":"adaptors"},"packages/mogli-changelog":{"id":"packages/mogli-changelog","title":"mogli changelog","description":"v0.1.6","sidebar":"adaptors"},"packages/mogli-configuration-schema":{"id":"packages/mogli-configuration-schema","title":"Config for mogli","description":"Jobs that use the mogli adaptor may require authentication. A","sidebar":"adaptors"},"packages/mogli-docs":{"id":"packages/mogli-docs","title":"mogli@0.5.4","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/mogli-readme":{"id":"packages/mogli-readme","title":"mogli developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mogli","sidebar":"adaptors"},"packages/mongodb-changelog":{"id":"packages/mongodb-changelog","title":"mongodb changelog","description":"2.1.4","sidebar":"adaptors"},"packages/mongodb-configuration-schema":{"id":"packages/mongodb-configuration-schema","title":"Config for mongodb","description":"Jobs that use the mongodb adaptor may require authentication. A","sidebar":"adaptors"},"packages/mongodb-docs":{"id":"packages/mongodb-docs","title":"mongodb@2.1.4","description":"findDocuments(params)","sidebar":"adaptors"},"packages/mongodb-readme":{"id":"packages/mongodb-readme","title":"mongodb developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mongodb","sidebar":"adaptors"},"packages/msgraph-changelog":{"id":"packages/msgraph-changelog","title":"msgraph changelog","description":"0.7.4","sidebar":"adaptors"},"packages/msgraph-configuration-schema":{"id":"packages/msgraph-configuration-schema","title":"Config for msgraph","description":"Jobs that use the msgraph adaptor may require authentication. A","sidebar":"adaptors"},"packages/msgraph-docs":{"id":"packages/msgraph-docs","title":"msgraph@0.7.4","description":"create(resource, data, callback)","sidebar":"adaptors"},"packages/msgraph-readme":{"id":"packages/msgraph-readme","title":"msgraph developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/msgraph","sidebar":"adaptors"},"packages/mssql-changelog":{"id":"packages/mssql-changelog","title":"mssql changelog","description":"5.0.3","sidebar":"adaptors"},"packages/mssql-configuration-schema":{"id":"packages/mssql-configuration-schema","title":"Config for mssql","description":"Jobs that use the mssql adaptor may require authentication. A","sidebar":"adaptors"},"packages/mssql-docs":{"id":"packages/mssql-docs","title":"mssql@5.0.3","description":"describeTable(tableName, options)","sidebar":"adaptors"},"packages/mssql-readme":{"id":"packages/mssql-readme","title":"mssql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mssql","sidebar":"adaptors"},"packages/mysql-changelog":{"id":"packages/mysql-changelog","title":"mysql changelog","description":"2.0.2","sidebar":"adaptors"},"packages/mysql-configuration-schema":{"id":"packages/mysql-configuration-schema","title":"Config for mysql","description":"Jobs that use the mysql adaptor may require authentication. A","sidebar":"adaptors"},"packages/mysql-docs":{"id":"packages/mysql-docs","title":"mysql@2.0.2","description":"insert(table, fields)","sidebar":"adaptors"},"packages/mysql-readme":{"id":"packages/mysql-readme","title":"mysql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mysql","sidebar":"adaptors"},"packages/nexmo-changelog":{"id":"packages/nexmo-changelog","title":"nexmo changelog","description":"0.5.5","sidebar":"adaptors"},"packages/nexmo-configuration-schema":{"id":"packages/nexmo-configuration-schema","title":"Config for nexmo","description":"Jobs that use the nexmo adaptor may require authentication. A","sidebar":"adaptors"},"packages/nexmo-docs":{"id":"packages/nexmo-docs","title":"nexmo@0.5.5","description":"sendSMS(from, toNumber, message)","sidebar":"adaptors"},"packages/nexmo-readme":{"id":"packages/nexmo-readme","title":"nexmo developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/nexmo","sidebar":"adaptors"},"packages/ocl-changelog":{"id":"packages/ocl-changelog","title":"ocl changelog","description":"1.2.5","sidebar":"adaptors"},"packages/ocl-configuration-schema":{"id":"packages/ocl-configuration-schema","title":"Config for ocl","description":"Jobs that use the ocl adaptor may require authentication. A","sidebar":"adaptors"},"packages/ocl-docs":{"id":"packages/ocl-docs","title":"ocl@1.2.5","description":"get(path, query, callback)","sidebar":"adaptors"},"packages/ocl-readme":{"id":"packages/ocl-readme","title":"ocl developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/ocl","sidebar":"adaptors"},"packages/odk-changelog":{"id":"packages/odk-changelog","title":"odk changelog","description":"3.0.4","sidebar":"adaptors"},"packages/odk-configuration-schema":{"id":"packages/odk-configuration-schema","title":"Config for odk","description":"Jobs that use the odk adaptor may require authentication. A","sidebar":"adaptors"},"packages/odk-docs":{"id":"packages/odk-docs","title":"odk@3.0.4","description":"get(path, options)","sidebar":"adaptors"},"packages/odk-readme":{"id":"packages/odk-readme","title":"odk developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/odk","sidebar":"adaptors"},"packages/openfn-changelog":{"id":"packages/openfn-changelog","title":"openfn changelog","description":"2.0.2","sidebar":"adaptors"},"packages/openfn-configuration-schema":{"id":"packages/openfn-configuration-schema","title":"Config for openfn","description":"Jobs that use the openfn adaptor may require authentication. A","sidebar":"adaptors"},"packages/openfn-docs":{"id":"packages/openfn-docs","title":"openfn@2.0.2","description":"request(options, callback)","sidebar":"adaptors"},"packages/openfn-readme":{"id":"packages/openfn-readme","title":"openfn developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openfn","sidebar":"adaptors"},"packages/openhim-changelog":{"id":"packages/openhim-changelog","title":"openhim changelog","description":"0.3.3","sidebar":"adaptors"},"packages/openhim-configuration-schema":{"id":"packages/openhim-configuration-schema","title":"Config for openhim","description":"Jobs that use the openhim adaptor may require authentication. A","sidebar":"adaptors"},"packages/openhim-docs":{"id":"packages/openhim-docs","title":"openhim@0.3.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/openhim-readme":{"id":"packages/openhim-readme","title":"openhim developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openhim","sidebar":"adaptors"},"packages/openimis-changelog":{"id":"packages/openimis-changelog","title":"openimis changelog","description":"2.0.2","sidebar":"adaptors"},"packages/openimis-configuration-schema":{"id":"packages/openimis-configuration-schema","title":"Config for openimis","description":"Jobs that use the openimis adaptor may require authentication. A","sidebar":"adaptors"},"packages/openimis-docs":{"id":"packages/openimis-docs","title":"openimis@2.0.2","description":"getFHIR(path, params, callback)","sidebar":"adaptors"},"packages/openimis-readme":{"id":"packages/openimis-readme","title":"openimis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openimis","sidebar":"adaptors"},"packages/openlmis-changelog":{"id":"packages/openlmis-changelog","title":"openlmis changelog","description":"1.0.4","sidebar":"adaptors"},"packages/openlmis-configuration-schema":{"id":"packages/openlmis-configuration-schema","title":"Config for openlmis","description":"Jobs that use the openlmis adaptor may require authentication. A","sidebar":"adaptors"},"packages/openlmis-docs":{"id":"packages/openlmis-docs","title":"openlmis@1.0.4","description":"get(path, options, [callback])","sidebar":"adaptors"},"packages/openlmis-readme":{"id":"packages/openlmis-readme","title":"openlmis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openlmis","sidebar":"adaptors"},"packages/openmrs-changelog":{"id":"packages/openmrs-changelog","title":"openmrs changelog","description":"4.0.1","sidebar":"adaptors"},"packages/openmrs-configuration-schema":{"id":"packages/openmrs-configuration-schema","title":"Config for openmrs","description":"Jobs that use the openmrs adaptor may require authentication. A","sidebar":"adaptors"},"packages/openmrs-docs":{"id":"packages/openmrs-docs","title":"openmrs@4.0.1","description":"create(resourceType, data, [callback])","sidebar":"adaptors"},"packages/openmrs-readme":{"id":"packages/openmrs-readme","title":"openmrs developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openmrs","sidebar":"adaptors"},"packages/openspp-changelog":{"id":"packages/openspp-changelog","title":"openspp changelog","description":"2.0.2","sidebar":"adaptors"},"packages/openspp-configuration-schema":{"id":"packages/openspp-configuration-schema","title":"Config for openspp","description":"Jobs that use the openspp adaptor may require authentication. A","sidebar":"adaptors"},"packages/openspp-docs":{"id":"packages/openspp-docs","title":"openspp@2.0.2","description":"addToGroup(groupid, individualid, role)","sidebar":"adaptors"},"packages/openspp-readme":{"id":"packages/openspp-readme","title":"openspp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openspp","sidebar":"adaptors"},"packages/postgresql-changelog":{"id":"packages/postgresql-changelog","title":"postgresql changelog","description":"6.0.2","sidebar":"adaptors"},"packages/postgresql-configuration-schema":{"id":"packages/postgresql-configuration-schema","title":"Config for postgresql","description":"Jobs that use the postgresql adaptor may require authentication. A","sidebar":"adaptors"},"packages/postgresql-docs":{"id":"packages/postgresql-docs","title":"postgresql@6.0.2","description":"describeTable(tableName, [options], callback)","sidebar":"adaptors"},"packages/postgresql-readme":{"id":"packages/postgresql-readme","title":"postgresql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/postgresql","sidebar":"adaptors"},"packages/primero-changelog":{"id":"packages/primero-changelog","title":"primero changelog","description":"3.0.2","sidebar":"adaptors"},"packages/primero-configuration-schema":{"id":"packages/primero-configuration-schema","title":"Config for primero","description":"Jobs that use the primero adaptor may require authentication. A","sidebar":"adaptors"},"packages/primero-docs":{"id":"packages/primero-docs","title":"primero@3.0.2","description":"createCase(params, callback)","sidebar":"adaptors"},"packages/primero-readme":{"id":"packages/primero-readme","title":"primero developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/primero","sidebar":"adaptors"},"packages/progres-changelog":{"id":"packages/progres-changelog","title":"progres changelog","description":"1.4.4","sidebar":"adaptors"},"packages/progres-configuration-schema":{"id":"packages/progres-configuration-schema","title":"Config for progres","description":"Jobs that use the progres adaptor may require authentication. A","sidebar":"adaptors"},"packages/progres-docs":{"id":"packages/progres-docs","title":"progres@1.4.4","description":"postData(params, callback)","sidebar":"adaptors"},"packages/progres-readme":{"id":"packages/progres-readme","title":"progres developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/progres","sidebar":"adaptors"},"packages/rapidpro-changelog":{"id":"packages/rapidpro-changelog","title":"rapidpro changelog","description":"1.1.3","sidebar":"adaptors"},"packages/rapidpro-configuration-schema":{"id":"packages/rapidpro-configuration-schema","title":"Config for rapidpro","description":"Jobs that use the rapidpro adaptor may require authentication. A","sidebar":"adaptors"},"packages/rapidpro-docs":{"id":"packages/rapidpro-docs","title":"rapidpro@1.1.3","description":"addContact(params, callback)","sidebar":"adaptors"},"packages/rapidpro-readme":{"id":"packages/rapidpro-readme","title":"rapidpro developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/rapidpro","sidebar":"adaptors"},"packages/redis-changelog":{"id":"packages/redis-changelog","title":"redis changelog","description":"1.2.1","sidebar":"adaptors"},"packages/redis-configuration-schema":{"id":"packages/redis-configuration-schema","title":"Config for redis","description":"Jobs that use the redis adaptor may require authentication. A","sidebar":"adaptors"},"packages/redis-docs":{"id":"packages/redis-docs","title":"redis@1.2.1","description":"get(key)","sidebar":"adaptors"},"packages/redis-readme":{"id":"packages/redis-readme","title":"redis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/redis","sidebar":"adaptors"},"packages/resourcemap-changelog":{"id":"packages/resourcemap-changelog","title":"resourcemap changelog","description":"0.4.3","sidebar":"adaptors"},"packages/resourcemap-configuration-schema":{"id":"packages/resourcemap-configuration-schema","title":"Config for resourcemap","description":"Jobs that use the resourcemap adaptor may require authentication. A","sidebar":"adaptors"},"packages/resourcemap-docs":{"id":"packages/resourcemap-docs","title":"resourcemap@0.4.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/resourcemap-readme":{"id":"packages/resourcemap-readme","title":"resourcemap developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/resourcemap","sidebar":"adaptors"},"packages/salesforce-changelog":{"id":"packages/salesforce-changelog","title":"salesforce changelog","description":"4.8.3","sidebar":"adaptors"},"packages/salesforce-configuration-schema":{"id":"packages/salesforce-configuration-schema","title":"Config for salesforce","description":"Jobs that use the salesforce adaptor may require authentication. A","sidebar":"adaptors"},"packages/salesforce-docs":{"id":"packages/salesforce-docs","title":"salesforce@4.8.3","description":"bulk(sObject, operation, options, records)","sidebar":"adaptors"},"packages/salesforce-readme":{"id":"packages/salesforce-readme","title":"salesforce developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/salesforce","sidebar":"adaptors"},"packages/satusehat-changelog":{"id":"packages/satusehat-changelog","title":"satusehat changelog","description":"2.0.2","sidebar":"adaptors"},"packages/satusehat-configuration-schema":{"id":"packages/satusehat-configuration-schema","title":"Config for satusehat","description":"Jobs that use the satusehat adaptor may require authentication. A","sidebar":"adaptors"},"packages/satusehat-docs":{"id":"packages/satusehat-docs","title":"satusehat@2.0.2","description":"get(path, params, callback)","sidebar":"adaptors"},"packages/satusehat-readme":{"id":"packages/satusehat-readme","title":"satusehat developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/satusehat","sidebar":"adaptors"},"packages/sftp-changelog":{"id":"packages/sftp-changelog","title":"sftp changelog","description":"2.0.2","sidebar":"adaptors"},"packages/sftp-configuration-schema":{"id":"packages/sftp-configuration-schema","title":"Config for sftp","description":"Jobs that use the sftp adaptor may require authentication. A","sidebar":"adaptors"},"packages/sftp-docs":{"id":"packages/sftp-docs","title":"sftp@2.0.2","description":"getCSV(filePath, [parsingOptions])","sidebar":"adaptors"},"packages/sftp-readme":{"id":"packages/sftp-readme","title":"sftp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/sftp","sidebar":"adaptors"},"packages/smpp-changelog":{"id":"packages/smpp-changelog","title":"smpp changelog","description":"1.4.3","sidebar":"adaptors"},"packages/smpp-configuration-schema":{"id":"packages/smpp-configuration-schema","title":"Config for smpp","description":"Jobs that use the smpp adaptor may require authentication. A","sidebar":"adaptors"},"packages/smpp-docs":{"id":"packages/smpp-docs","title":"smpp@1.4.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/smpp-readme":{"id":"packages/smpp-readme","title":"smpp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/smpp","sidebar":"adaptors"},"packages/surveycto-changelog":{"id":"packages/surveycto-changelog","title":"surveycto changelog","description":"2.2.3","sidebar":"adaptors"},"packages/surveycto-configuration-schema":{"id":"packages/surveycto-configuration-schema","title":"Config for surveycto","description":"Jobs that use the surveycto adaptor may require authentication. A","sidebar":"adaptors"},"packages/surveycto-docs":{"id":"packages/surveycto-docs","title":"surveycto@2.2.3","description":"cursor(value, options)","sidebar":"adaptors"},"packages/surveycto-readme":{"id":"packages/surveycto-readme","title":"surveycto developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/surveycto","sidebar":"adaptors"},"packages/telerivet-changelog":{"id":"packages/telerivet-changelog","title":"telerivet changelog","description":"0.3.3","sidebar":"adaptors"},"packages/telerivet-configuration-schema":{"id":"packages/telerivet-configuration-schema","title":"Config for telerivet","description":"Jobs that use the telerivet adaptor may require authentication. A","sidebar":"adaptors"},"packages/telerivet-docs":{"id":"packages/telerivet-docs","title":"telerivet@0.3.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/telerivet-readme":{"id":"packages/telerivet-readme","title":"telerivet developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/telerivet","sidebar":"adaptors"},"packages/testing-changelog":{"id":"packages/testing-changelog","title":"testing changelog","description":"1.0.5","sidebar":"adaptors"},"packages/testing-configuration-schema":{"id":"packages/testing-configuration-schema","title":"Config for testing","description":"Jobs that use the testing adaptor may require authentication. A","sidebar":"adaptors"},"packages/testing-docs":{"id":"packages/testing-docs","title":"testing@1.0.5","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/testing-readme":{"id":"packages/testing-readme","title":"testing developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/testing","sidebar":"adaptors"},"packages/twilio-changelog":{"id":"packages/twilio-changelog","title":"twilio changelog","description":"0.5.1","sidebar":"adaptors"},"packages/twilio-configuration-schema":{"id":"packages/twilio-configuration-schema","title":"Config for twilio","description":"Jobs that use the twilio adaptor may require authentication. A","sidebar":"adaptors"},"packages/twilio-docs":{"id":"packages/twilio-docs","title":"twilio@0.5.1","description":"sendSMS(params)","sidebar":"adaptors"},"packages/twilio-readme":{"id":"packages/twilio-readme","title":"twilio developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/twilio","sidebar":"adaptors"},"packages/vtiger-changelog":{"id":"packages/vtiger-changelog","title":"vtiger changelog","description":"1.3.3","sidebar":"adaptors"},"packages/vtiger-configuration-schema":{"id":"packages/vtiger-configuration-schema","title":"Config for vtiger","description":"Jobs that use the vtiger adaptor may require authentication. A","sidebar":"adaptors"},"packages/vtiger-docs":{"id":"packages/vtiger-docs","title":"vtiger@1.3.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/vtiger-readme":{"id":"packages/vtiger-readme","title":"vtiger developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/vtiger","sidebar":"adaptors"},"packages/zoho-changelog":{"id":"packages/zoho-changelog","title":"zoho changelog","description":"0.4.3","sidebar":"adaptors"},"packages/zoho-configuration-schema":{"id":"packages/zoho-configuration-schema","title":"Config for zoho","description":"Jobs that use the zoho adaptor may require authentication. A","sidebar":"adaptors"},"packages/zoho-docs":{"id":"packages/zoho-docs","title":"zoho@0.4.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/zoho-readme":{"id":"packages/zoho-readme","title":"zoho developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/zoho","sidebar":"adaptors"},"postgresql":{"id":"postgresql","title":"PostgreSQL","description":"Overview","sidebar":"adaptors"},"powerbi":{"id":"powerbi","title":"Power BI","description":"(Work in progress)","sidebar":"adaptors"},"primero":{"id":"primero","title":"Primero","description":"Overview","sidebar":"adaptors"},"salesforce":{"id":"salesforce","title":"Salesforce","description":"App Overview","sidebar":"adaptors"},"surveycto":{"id":"surveycto","title":"SurveyCTO","description":"App Overview","sidebar":"adaptors"},"tableau":{"id":"tableau","title":"Tableau","description":"(Work in progress)","sidebar":"adaptors"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunk_openfn_docs=self.webpackChunk_openfn_docs||[]).push([[34270],{58673:a=>{a.exports=JSON.parse('{"pluginId":"adaptors","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"adaptors":[{"type":"link","label":"Introduction","href":"/adaptors/","docId":"adaptors-intro"},{"type":"link","label":"Library Examples","href":"/adaptors/library","docId":"library-intro"},{"type":"category","label":"asana","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/asana-docs","docId":"packages/asana-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/asana-configuration-schema","docId":"packages/asana-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Asana-test","href":"/adaptors/library/jobs/auto/Asana-test-2024-07-29","docId":"library/jobs/auto/Asana-test-2024-07-29"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/asana-changelog","docId":"packages/asana-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/asana-readme","docId":"packages/asana-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"azure-storage","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/azure-storage-docs","docId":"packages/azure-storage-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/azure-storage-configuration-schema","docId":"packages/azure-storage-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/azure-storage-changelog","docId":"packages/azure-storage-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/azure-storage-readme","docId":"packages/azure-storage-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"beyonic","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/beyonic-docs","docId":"packages/beyonic-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/beyonic-configuration-schema","docId":"packages/beyonic-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Pay CHW","href":"/adaptors/library/jobs/auto/Pay-CHW-2021-04-23","docId":"library/jobs/auto/Pay-CHW-2021-04-23"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/beyonic-changelog","docId":"packages/beyonic-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/beyonic-readme","docId":"packages/beyonic-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"bigquery","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/bigquery-docs","docId":"packages/bigquery-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/bigquery-configuration-schema","docId":"packages/bigquery-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/bigquery-changelog","docId":"packages/bigquery-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/bigquery-readme","docId":"packages/bigquery-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"cartodb","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/cartodb-docs","docId":"packages/cartodb-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/cartodb-configuration-schema","docId":"packages/cartodb-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/cartodb-changelog","docId":"packages/cartodb-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/cartodb-readme","docId":"packages/cartodb-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"cht","items":[{"type":"link","label":"Overview","href":"/adaptors/cht","docId":"cht"},{"type":"link","label":"Functions","href":"/adaptors/packages/cht-docs","docId":"packages/cht-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/cht-configuration-schema","docId":"packages/cht-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/cht-changelog","docId":"packages/cht-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/cht-readme","docId":"packages/cht-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"ckan","href":"/adaptors/ckan","docId":"ckan"},{"type":"category","label":"commcare","items":[{"type":"link","label":"Overview","href":"/adaptors/commcare","docId":"commcare"},{"type":"link","label":"Functions","href":"/adaptors/packages/commcare-docs","docId":"packages/commcare-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/commcare-configuration-schema","docId":"packages/commcare-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\u2728 Q3 2022 Update HH Name in CommCare","href":"/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27","docId":"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27"},{"type":"link","label":"Registration forms(new case)","href":"/adaptors/library/jobs/auto/Registration-forms-new-case-2023-06-22","docId":"library/jobs/auto/Registration-forms-new-case-2023-06-22"},{"type":"link","label":"nawiri","href":"/adaptors/library/jobs/auto/nawiri-2023-05-03","docId":"library/jobs/auto/nawiri-2023-05-03"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/commcare-changelog","docId":"packages/commcare-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/commcare-readme","docId":"packages/commcare-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"common","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/common-docs","docId":"packages/common-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/common-configuration-schema","docId":"packages/common-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/common-changelog","docId":"packages/common-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/common-readme","docId":"packages/common-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"dhis2","items":[{"type":"link","label":"Overview","href":"/adaptors/dhis2","docId":"dhis2"},{"type":"link","label":"Functions","href":"/adaptors/packages/dhis2-docs","docId":"packages/dhis2-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/dhis2-configuration-schema","docId":"packages/dhis2-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Add data values","href":"/adaptors/library/jobs/auto/DHIS2-DataValues-API","docId":"library/jobs/auto/DHIS2-DataValues-API"},{"type":"link","label":"\ud83d\udcdc Add events","href":"/adaptors/library/jobs/auto/DHIS2-Events-API","docId":"library/jobs/auto/DHIS2-Events-API"},{"type":"link","label":"Load to DHIS2","href":"/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17","docId":"library/jobs/auto/Load-to-DHIS2-2023-07-17"},{"type":"link","label":"DHIS2 Events","href":"/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27","docId":"library/jobs/auto/DHIS2-Events-2016-01-27"},{"type":"link","label":"Create TEI (dhis2)","href":"/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22","docId":"library/jobs/auto/Create-TEI-dhis2-2021-03-22"},{"type":"link","label":"CHW case to DHIS2","href":"/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27","docId":"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27"},{"type":"link","label":"0 - Get TEI data","href":"/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02","docId":"library/jobs/auto/0-Get-TEI-data-2021-06-02"},{"type":"link","label":"Add DHIS2 Data Value Sets","href":"/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28","docId":"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/dhis2-changelog","docId":"packages/dhis2-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/dhis2-readme","docId":"packages/dhis2-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"dynamics","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/dynamics-docs","docId":"packages/dynamics-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/dynamics-configuration-schema","docId":"packages/dynamics-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/dynamics-changelog","docId":"packages/dynamics-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/dynamics-readme","docId":"packages/dynamics-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"facebook","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/facebook-docs","docId":"packages/facebook-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/facebook-configuration-schema","docId":"packages/facebook-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/facebook-changelog","docId":"packages/facebook-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/facebook-readme","docId":"packages/facebook-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"fhir","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/fhir-docs","docId":"packages/fhir-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/fhir-configuration-schema","docId":"packages/fhir-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/fhir-changelog","docId":"packages/fhir-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/fhir-readme","docId":"packages/fhir-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"godata","items":[{"type":"link","label":"Overview","href":"/adaptors/godata","docId":"godata"},{"type":"link","label":"Functions","href":"/adaptors/packages/godata-docs","docId":"packages/godata-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/godata-configuration-schema","docId":"packages/godata-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/godata-changelog","docId":"packages/godata-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/godata-readme","docId":"packages/godata-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"googlehealthcare","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/googlehealthcare-docs","docId":"packages/googlehealthcare-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/googlehealthcare-configuration-schema","docId":"packages/googlehealthcare-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/googlehealthcare-changelog","docId":"packages/googlehealthcare-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/googlehealthcare-readme","docId":"packages/googlehealthcare-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"googlesheets","items":[{"type":"link","label":"Overview","href":"/adaptors/googlesheets","docId":"googlesheets"},{"type":"link","label":"Functions","href":"/adaptors/packages/googlesheets-docs","docId":"packages/googlesheets-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/googlesheets-configuration-schema","docId":"packages/googlesheets-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Kobo to sheets","href":"/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13","docId":"library/jobs/auto/Kobo-to-sheets-2023-10-13"},{"type":"link","label":"Register Patient","href":"/adaptors/library/jobs/auto/Register-Patient-2021-03-02","docId":"library/jobs/auto/Register-Patient-2021-03-02"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/googlesheets-changelog","docId":"packages/googlesheets-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/googlesheets-readme","docId":"packages/googlesheets-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"hive","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/hive-docs","docId":"packages/hive-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/hive-configuration-schema","docId":"packages/hive-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/hive-changelog","docId":"packages/hive-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/hive-readme","docId":"packages/hive-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"http","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/http-docs","docId":"packages/http-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/http-configuration-schema","docId":"packages/http-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Extract Kobo data from API to send to OpenFn Inbox","href":"/adaptors/library/jobs/auto/getKoboData","docId":"library/jobs/auto/getKoboData"},{"type":"link","label":"\ud83d\udcdc Using async and array.map","href":"/adaptors/library/jobs/auto/async-and-array-dot-map","docId":"library/jobs/auto/async-and-array-dot-map"},{"type":"link","label":"\ud83d\udcdc Chaining HTTP Requests","href":"/adaptors/library/jobs/auto/complex-http-request-chains","docId":"library/jobs/auto/complex-http-request-chains"},{"type":"link","label":"\ud83d\udcdc Promises and nested requests","href":"/adaptors/library/jobs/auto/promise-all-nested-requests","docId":"library/jobs/auto/promise-all-nested-requests"},{"type":"link","label":"\ud83d\udcdc Timeout to create a delay","href":"/adaptors/library/jobs/auto/timeout","docId":"library/jobs/auto/timeout"},{"type":"link","label":"\ud83d\udcdc Chaining synchronous http requests","href":"/adaptors/library/jobs/auto/synchronous-http-request","docId":"library/jobs/auto/synchronous-http-request"},{"type":"link","label":"Fetch Claims","href":"/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17","docId":"library/jobs/auto/Fetch-Claims-2023-07-17"},{"type":"link","label":"1 Get CommCare Forms Bulk Extract","href":"/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08","docId":"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08"},{"type":"link","label":"\u2728 WF3-1 Bulk get Person Visit cases","href":"/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19","docId":"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19"},{"type":"link","label":"\u2728 WF2-1 Bulk get Person cases","href":"/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19","docId":"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19"},{"type":"link","label":"\u2728 WF1-1 Bulk get HH cases","href":"/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19","docId":"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19"},{"type":"link","label":"\u2728 WF4-1 Bulk get Referral Cases","href":"/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19","docId":"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19"},{"type":"link","label":"no return","href":"/adaptors/library/jobs/auto/no-return-2023-01-06","docId":"library/jobs/auto/no-return-2023-01-06"},{"type":"link","label":"Catch Error in HTTP Request","href":"/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26","docId":"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26"},{"type":"link","label":"Get CommCare Forms (Bulk Extract)","href":"/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16","docId":"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16"},{"type":"link","label":"aleksa cron","href":"/adaptors/library/jobs/auto/aleksa-cron-2022-04-29","docId":"library/jobs/auto/aleksa-cron-2022-04-29"},{"type":"link","label":"Request Vitas Sync","href":"/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11","docId":"library/jobs/auto/Request-Vitas-Sync-2021-05-11"},{"type":"link","label":"Failed Payment Notification","href":"/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23","docId":"library/jobs/auto/Failed-Payment-Notification-2021-04-23"},{"type":"link","label":"02b/ Initiate Payments","href":"/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19","docId":"library/jobs/auto/02b-Initiate-Payments-2019-11-19"},{"type":"link","label":"01c/ Create person_position record","href":"/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13","docId":"library/jobs/auto/01c-Create-person_position-record-2019-12-13"},{"type":"link","label":"01a/ Create Registrants","href":"/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19","docId":"library/jobs/auto/01a-Create-Registrants-2019-11-19"},{"type":"link","label":"05b/Update ODK eval form","href":"/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19","docId":"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19"},{"type":"link","label":"05/ Submit employee evaluation","href":"/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03","docId":"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03"},{"type":"link","label":"04b/ Update ODK form","href":"/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03","docId":"library/jobs/auto/04b-Update-ODK-form-2019-12-03"},{"type":"link","label":"commcare reports api","href":"/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29","docId":"library/jobs/auto/commcare-reports-api-2016-08-29"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/http-changelog","docId":"packages/http-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/http-readme","docId":"packages/http-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"khanacademy","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/khanacademy-docs","docId":"packages/khanacademy-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/khanacademy-configuration-schema","docId":"packages/khanacademy-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/khanacademy-changelog","docId":"packages/khanacademy-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/khanacademy-readme","docId":"packages/khanacademy-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"kobotoolbox","items":[{"type":"link","label":"Overview","href":"/adaptors/kobotoolbox","docId":"kobotoolbox"},{"type":"link","label":"Functions","href":"/adaptors/packages/kobotoolbox-docs","docId":"packages/kobotoolbox-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/kobotoolbox-configuration-schema","docId":"packages/kobotoolbox-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"GET Data From KoboToolbox","href":"/adaptors/library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22","docId":"library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/kobotoolbox-changelog","docId":"packages/kobotoolbox-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/kobotoolbox-readme","docId":"packages/kobotoolbox-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"magpi","items":[{"type":"link","label":"Overview","href":"/adaptors/magpi","docId":"magpi"},{"type":"link","label":"Functions","href":"/adaptors/packages/magpi-docs","docId":"packages/magpi-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/magpi-configuration-schema","docId":"packages/magpi-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/magpi-changelog","docId":"packages/magpi-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/magpi-readme","docId":"packages/magpi-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mailchimp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mailchimp-docs","docId":"packages/mailchimp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mailchimp-configuration-schema","docId":"packages/mailchimp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mailchimp-changelog","docId":"packages/mailchimp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mailchimp-readme","docId":"packages/mailchimp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mailgun","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mailgun-docs","docId":"packages/mailgun-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mailgun-configuration-schema","docId":"packages/mailgun-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc send email","href":"/adaptors/library/jobs/auto/send-mail-in-mailgun","docId":"library/jobs/auto/send-mail-in-mailgun"},{"type":"link","label":"01 send mailgun email","href":"/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04","docId":"library/jobs/auto/01-send-mailgun-email-2018-12-04"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mailgun-changelog","docId":"packages/mailgun-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mailgun-readme","docId":"packages/mailgun-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"maximo","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/maximo-docs","docId":"packages/maximo-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/maximo-configuration-schema","docId":"packages/maximo-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/maximo-changelog","docId":"packages/maximo-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/maximo-readme","docId":"packages/maximo-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"medicmobile","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/medicmobile-docs","docId":"packages/medicmobile-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/medicmobile-configuration-schema","docId":"packages/medicmobile-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/medicmobile-changelog","docId":"packages/medicmobile-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/medicmobile-readme","docId":"packages/medicmobile-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mogli","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mogli-docs","docId":"packages/mogli-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mogli-configuration-schema","docId":"packages/mogli-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mogli-changelog","docId":"packages/mogli-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mogli-readme","docId":"packages/mogli-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mongodb","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mongodb-docs","docId":"packages/mongodb-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mongodb-configuration-schema","docId":"packages/mongodb-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mongodb-changelog","docId":"packages/mongodb-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mongodb-readme","docId":"packages/mongodb-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"moodle","href":"/adaptors/moodle","docId":"moodle"},{"type":"category","label":"msgraph","items":[{"type":"link","label":"Overview","href":"/adaptors/msgraph","docId":"msgraph"},{"type":"link","label":"Functions","href":"/adaptors/packages/msgraph-docs","docId":"packages/msgraph-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/msgraph-configuration-schema","docId":"packages/msgraph-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/msgraph-changelog","docId":"packages/msgraph-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/msgraph-readme","docId":"packages/msgraph-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mssql","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mssql-docs","docId":"packages/mssql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mssql-configuration-schema","docId":"packages/mssql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Extract Vitas Data","href":"/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11","docId":"library/jobs/auto/Extract-Vitas-Data-2021-05-11"},{"type":"link","label":"CommCare to Azure Sql","href":"/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27","docId":"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mssql-changelog","docId":"packages/mssql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mssql-readme","docId":"packages/mssql-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mysql","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mysql-docs","docId":"packages/mysql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mysql-configuration-schema","docId":"packages/mysql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"01b/ Query new person record","href":"/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13","docId":"library/jobs/auto/01b-Query-new-person-record-2019-12-13"},{"type":"link","label":"03/ Update Payment Status","href":"/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19","docId":"library/jobs/auto/03-Update-Payment-Status-2019-11-19"},{"type":"link","label":"05a/Query for new employees","href":"/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19","docId":"library/jobs/auto/05a-Query-for-new-employees-2019-12-19"},{"type":"link","label":"04a/Query for job changes","href":"/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12","docId":"library/jobs/auto/04a-Query-for-job-changes-2019-12-12"},{"type":"link","label":"02a/ Query DB for people to pay","href":"/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11","docId":"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mysql-changelog","docId":"packages/mysql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mysql-readme","docId":"packages/mysql-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"nexmo","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/nexmo-docs","docId":"packages/nexmo-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/nexmo-configuration-schema","docId":"packages/nexmo-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/nexmo-changelog","docId":"packages/nexmo-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/nexmo-readme","docId":"packages/nexmo-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"ocl","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/ocl-docs","docId":"packages/ocl-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/ocl-configuration-schema","docId":"packages/ocl-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/ocl-changelog","docId":"packages/ocl-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/ocl-readme","docId":"packages/ocl-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"odk","items":[{"type":"link","label":"Overview","href":"/adaptors/odk","docId":"odk"},{"type":"link","label":"Functions","href":"/adaptors/packages/odk-docs","docId":"packages/odk-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/odk-configuration-schema","docId":"packages/odk-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/odk-changelog","docId":"packages/odk-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/odk-readme","docId":"packages/odk-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"ona","href":"/adaptors/ona","docId":"ona"},{"type":"category","label":"openfn","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openfn-docs","docId":"packages/openfn-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openfn-configuration-schema","docId":"packages/openfn-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openfn-changelog","docId":"packages/openfn-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openfn-readme","docId":"packages/openfn-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openhim","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openhim-docs","docId":"packages/openhim-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openhim-configuration-schema","docId":"packages/openhim-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Create encounter in OpenHIM","href":"/adaptors/library/jobs/auto/CommCare-FHIR","docId":"library/jobs/auto/CommCare-FHIR"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/openhim-changelog","docId":"packages/openhim-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openhim-readme","docId":"packages/openhim-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openimis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openimis-docs","docId":"packages/openimis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openimis-configuration-schema","docId":"packages/openimis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openimis-changelog","docId":"packages/openimis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openimis-readme","docId":"packages/openimis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openlmis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openlmis-docs","docId":"packages/openlmis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openlmis-configuration-schema","docId":"packages/openlmis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openlmis-changelog","docId":"packages/openlmis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openlmis-readme","docId":"packages/openlmis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openmrs","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openmrs-docs","docId":"packages/openmrs-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openmrs-configuration-schema","docId":"packages/openmrs-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Create Person in OpenMRS","href":"/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12","docId":"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12"},{"type":"link","label":"Create Patient in OpenMRS","href":"/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24","docId":"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/openmrs-changelog","docId":"packages/openmrs-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openmrs-readme","docId":"packages/openmrs-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openspp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openspp-docs","docId":"packages/openspp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openspp-configuration-schema","docId":"packages/openspp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openspp-changelog","docId":"packages/openspp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openspp-readme","docId":"packages/openspp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"postgresql","items":[{"type":"link","label":"Overview","href":"/adaptors/postgresql","docId":"postgresql"},{"type":"link","label":"Functions","href":"/adaptors/packages/postgresql-docs","docId":"packages/postgresql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/postgresql-configuration-schema","docId":"packages/postgresql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Using findValue with an array of data","href":"/adaptors/library/jobs/auto/async-findValue","docId":"library/jobs/auto/async-findValue"},{"type":"link","label":"1. Get data from SLUHIS","href":"/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08","docId":"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08"},{"type":"link","label":"Load to DB","href":"/adaptors/library/jobs/auto/Load-to-DB-2022-05-16","docId":"library/jobs/auto/Load-to-DB-2022-05-16"},{"type":"link","label":"Load / Upsert Data into PostgreSQL","href":"/adaptors/library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22","docId":"library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22"},{"type":"link","label":"Upsert to mBrana","href":"/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11","docId":"library/jobs/auto/Upsert-to-mBrana-2021-05-11"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/postgresql-changelog","docId":"packages/postgresql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/postgresql-readme","docId":"packages/postgresql-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"powerbi","href":"/adaptors/powerbi","docId":"powerbi"},{"type":"category","label":"primero","items":[{"type":"link","label":"Overview","href":"/adaptors/primero","docId":"primero"},{"type":"link","label":"Functions","href":"/adaptors/packages/primero-docs","docId":"packages/primero-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/primero-configuration-schema","docId":"packages/primero-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Get cases from Primero","href":"/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23","docId":"library/jobs/auto/Get-cases-from-Primero-2021-09-23"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/primero-changelog","docId":"packages/primero-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/primero-readme","docId":"packages/primero-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"progres","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/progres-docs","docId":"packages/progres-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/progres-configuration-schema","docId":"packages/progres-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/progres-changelog","docId":"packages/progres-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/progres-readme","docId":"packages/progres-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"rapidpro","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/rapidpro-docs","docId":"packages/rapidpro-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/rapidpro-configuration-schema","docId":"packages/rapidpro-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/rapidpro-changelog","docId":"packages/rapidpro-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/rapidpro-readme","docId":"packages/rapidpro-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"redis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/redis-docs","docId":"packages/redis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/redis-configuration-schema","docId":"packages/redis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/redis-changelog","docId":"packages/redis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/redis-readme","docId":"packages/redis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"resourcemap","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/resourcemap-docs","docId":"packages/resourcemap-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/resourcemap-configuration-schema","docId":"packages/resourcemap-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/resourcemap-changelog","docId":"packages/resourcemap-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/resourcemap-readme","docId":"packages/resourcemap-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"salesforce","items":[{"type":"link","label":"Overview","href":"/adaptors/salesforce","docId":"salesforce"},{"type":"link","label":"Functions","href":"/adaptors/packages/salesforce-docs","docId":"packages/salesforce-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/salesforce-configuration-schema","docId":"packages/salesforce-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Pre-processing data","href":"/adaptors/library/jobs/auto/alter-state-before-operations","docId":"library/jobs/auto/alter-state-before-operations"},{"type":"link","label":"\ud83d\udcdc Using merge and each","href":"/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce","docId":"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce"},{"type":"link","label":"\ud83d\udcdc Using promises","href":"/adaptors/library/jobs/auto/complex-state-control","docId":"library/jobs/auto/complex-state-control"},{"type":"link","label":"\ud83d\udcdc Concat fields with nulls","href":"/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls","docId":"library/jobs/auto/concatenate-many-fields-with-nulls"},{"type":"link","label":"\ud83d\udcdc Create/update records if...","href":"/adaptors/library/jobs/auto/create-if-proposal","docId":"library/jobs/auto/create-if-proposal"},{"type":"link","label":"\ud83d\udcdc Create SMS linked to contact","href":"/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF","docId":"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF"},{"type":"link","label":"\ud83d\udcdc Handling multiple ODK repeat groups","href":"/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks","docId":"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks"},{"type":"link","label":"\ud83d\udcdc Merge data into child array then upsert","href":"/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array","docId":"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array"},{"type":"link","label":"\u2728 Coach Session Register","href":"/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03","docId":"library/jobs/auto/Coach-Session-Register-2021-05-03"},{"type":"link","label":"\u2728 Upsert Pre Challenges","href":"/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30","docId":"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30"},{"type":"link","label":"\u2728 Upsert Post Challenges","href":"/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30","docId":"library/jobs/auto/Upsert-Post-Challenges-2021-04-30"},{"type":"link","label":"Upsert User in Salesforce","href":"/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16","docId":"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16"},{"type":"link","label":"\u2728 Attendance Non Skillz","href":"/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14","docId":"library/jobs/auto/Attendance-Non-Skillz-2021-06-14"},{"type":"link","label":"\u2728 Upsert Register Participant","href":"/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28","docId":"library/jobs/auto/Upsert-Register-Participant-2021-04-28"},{"type":"link","label":"Outcome Survey","href":"/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16","docId":"library/jobs/auto/Outcome-Survey-2024-07-16"},{"type":"link","label":"\u2728 Create Intervention","href":"/adaptors/library/jobs/auto/Create-Intervention-2021-04-08","docId":"library/jobs/auto/Create-Intervention-2021-04-08"},{"type":"link","label":"WF3-2a Repeat Failed Person Visits","href":"/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31","docId":"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31"},{"type":"link","label":"Q4 2022 Upsert Supervision - Accompaniment","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22"},{"type":"link","label":"Upsert Team or Group Name","href":"/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28","docId":"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28"},{"type":"link","label":"\u2728 Upsert Risk and Vulnerability Assessment - Service Referral","href":"/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25","docId":"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25"},{"type":"link","label":"Upsert Register Participant Skillz","href":"/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30","docId":"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30"},{"type":"link","label":"Upsert Coach Support Visit CSV","href":"/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28","docId":"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28"},{"type":"link","label":"\u2728 Upsert Home Visit Log Form","href":"/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03","docId":"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03"},{"type":"link","label":"Q3 2022 Upsert Household & Household Visit in SF","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28","docId":"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28"},{"type":"link","label":"\u2728 Q3 2022 Create Distribution & Referral in SF","href":"/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19","docId":"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19"},{"type":"link","label":"Q3 2022 Upsert Person","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21","docId":"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21"},{"type":"link","label":"\u2728 WF4-2 Bulk upsert Services","href":"/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19","docId":"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19"},{"type":"link","label":"\u2728 WF3-2 Bulk upsert Person Visits","href":"/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19","docId":"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19"},{"type":"link","label":"\u2728 WF2-2 Bulk upsert Persons","href":"/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19","docId":"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19"},{"type":"link","label":"\u2728 WF1-2 Bulk upsert HHs and HH Visits","href":"/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19","docId":"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19"},{"type":"link","label":"Q4 2022 Upsert Supervision - Household Spot Check","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24"},{"type":"link","label":"Q4 2022 Upsert Supervision - Feedback","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19"},{"type":"link","label":"Q3 2022 Upsert Person Visit","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28","docId":"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28"},{"type":"link","label":"Create contact","href":"/adaptors/library/jobs/auto/Create-contact-2021-03-01","docId":"library/jobs/auto/Create-contact-2021-03-01"},{"type":"link","label":"HIV Testing Event Statistics","href":"/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03","docId":"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03"},{"type":"link","label":"Malaria Testing Event Statistics","href":"/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03","docId":"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03"},{"type":"link","label":"HIV Testing Event Snapshot","href":"/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03","docId":"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03"},{"type":"link","label":"Malaria Testing Event Snapshot","href":"/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03","docId":"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03"},{"type":"link","label":"PHQ9","href":"/adaptors/library/jobs/auto/PHQ9-2021-05-03","docId":"library/jobs/auto/PHQ9-2021-05-03"},{"type":"link","label":"Risk and Vulnerability Assessment","href":"/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27","docId":"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27"},{"type":"link","label":"Upsert Attendance Skillz Plus Club","href":"/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24","docId":"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24"},{"type":"link","label":"Upsert ART Adherence Self-Reporting Tool","href":"/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30","docId":"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30"},{"type":"link","label":"Upsert Aggregate Service Referrals","href":"/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30","docId":"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30"},{"type":"link","label":"Upsert Confirm Services Received","href":"/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14","docId":"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14"},{"type":"link","label":"Upsert Intervention Notes","href":"/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28","docId":"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28"},{"type":"link","label":"Upsert Register Event","href":"/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30","docId":"library/jobs/auto/Upsert-Register-Event-2021-04-30"},{"type":"link","label":"Upsert Register Skills plus Club","href":"/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30","docId":"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30"},{"type":"link","label":"Upsert Service Referral","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30","docId":"library/jobs/auto/Upsert-Service-Referral-2021-04-30"},{"type":"link","label":"Upsert Service Referral 2","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14","docId":"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14"},{"type":"link","label":"Upsert Service Referral Followup","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30","docId":"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30"},{"type":"link","label":"Register Participant - V2 Skillz","href":"/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02","docId":"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02"},{"type":"link","label":"Create Person in SF","href":"/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25","docId":"library/jobs/auto/Create-Person-in-SF-2019-02-25"},{"type":"link","label":"1. Create Payment in SF","href":"/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03","docId":"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/salesforce-changelog","docId":"packages/salesforce-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/salesforce-readme","docId":"packages/salesforce-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"satusehat","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/satusehat-docs","docId":"packages/satusehat-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/satusehat-configuration-schema","docId":"packages/satusehat-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/satusehat-changelog","docId":"packages/satusehat-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/satusehat-readme","docId":"packages/satusehat-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"sftp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/sftp-docs","docId":"packages/sftp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/sftp-configuration-schema","docId":"packages/sftp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/sftp-changelog","docId":"packages/sftp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/sftp-readme","docId":"packages/sftp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"smpp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/smpp-docs","docId":"packages/smpp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/smpp-configuration-schema","docId":"packages/smpp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/smpp-changelog","docId":"packages/smpp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/smpp-readme","docId":"packages/smpp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"surveycto","items":[{"type":"link","label":"Overview","href":"/adaptors/surveycto","docId":"surveycto"},{"type":"link","label":"Functions","href":"/adaptors/packages/surveycto-docs","docId":"packages/surveycto-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/surveycto-configuration-schema","docId":"packages/surveycto-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/surveycto-changelog","docId":"packages/surveycto-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/surveycto-readme","docId":"packages/surveycto-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"tableau","href":"/adaptors/tableau","docId":"tableau"},{"type":"category","label":"telerivet","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/telerivet-docs","docId":"packages/telerivet-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/telerivet-configuration-schema","docId":"packages/telerivet-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Send sms from Salesforce workflow action","href":"/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow","docId":"library/jobs/auto/send-sms-from-salesforce-workflow"},{"type":"link","label":"2. SMS Balance Update to Customer","href":"/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14","docId":"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/telerivet-changelog","docId":"packages/telerivet-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/telerivet-readme","docId":"packages/telerivet-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"testing","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/testing-docs","docId":"packages/testing-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/testing-configuration-schema","docId":"packages/testing-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/testing-changelog","docId":"packages/testing-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/testing-readme","docId":"packages/testing-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"twilio","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/twilio-docs","docId":"packages/twilio-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/twilio-configuration-schema","docId":"packages/twilio-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/twilio-changelog","docId":"packages/twilio-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/twilio-readme","docId":"packages/twilio-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"vtiger","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/vtiger-docs","docId":"packages/vtiger-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/vtiger-configuration-schema","docId":"packages/vtiger-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/vtiger-changelog","docId":"packages/vtiger-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/vtiger-readme","docId":"packages/vtiger-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"zoho","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/zoho-docs","docId":"packages/zoho-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/zoho-configuration-schema","docId":"packages/zoho-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/zoho-changelog","docId":"packages/zoho-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/zoho-readme","docId":"packages/zoho-readme"}],"collapsed":true,"collapsible":true}]},"docs":{"adaptors-intro":{"id":"adaptors-intro","title":"Adaptors","description":"Connect Anything.","sidebar":"adaptors"},"cht":{"id":"cht","title":"Community Health Toolkit","description":"1. To push data from CHT applications to OpenFn, leverage the","sidebar":"adaptors"},"ckan":{"id":"ckan","title":"CKAN","description":"App Overview","sidebar":"adaptors"},"commcare":{"id":"commcare","title":"CommCare","description":"App Overview","sidebar":"adaptors"},"dhis2":{"id":"dhis2","title":"DHIS2","description":"App Overview","sidebar":"adaptors"},"godata":{"id":"godata","title":"Go.Data","description":"Overview","sidebar":"adaptors"},"googlesheets":{"id":"googlesheets","title":"Google Forms/Google Sheets","description":"Google Sheets Adaptor Overview","sidebar":"adaptors"},"kobotoolbox":{"id":"kobotoolbox","title":"Kobo Toolbox","description":"App Overview","sidebar":"adaptors"},"library-intro":{"id":"library-intro","title":"The Community Job Library","description":"A growing knowledge base","sidebar":"adaptors"},"library/jobs/auto/0-Get-TEI-data-2021-06-02":{"id":"library/jobs/auto/0-Get-TEI-data-2021-06-02","title":"0 - Get TEI data","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01-send-mailgun-email-2018-12-04":{"id":"library/jobs/auto/01-send-mailgun-email-2018-12-04","title":"01 send mailgun email","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01a-Create-Registrants-2019-11-19":{"id":"library/jobs/auto/01a-Create-Registrants-2019-11-19","title":"01a/ Create Registrants","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01b-Query-new-person-record-2019-12-13":{"id":"library/jobs/auto/01b-Query-new-person-record-2019-12-13","title":"01b/ Query new person record","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01c-Create-person_position-record-2019-12-13":{"id":"library/jobs/auto/01c-Create-person_position-record-2019-12-13","title":"01c/ Create person_position record","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11":{"id":"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11","title":"02a/ Query DB for people to pay","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/02b-Initiate-Payments-2019-11-19":{"id":"library/jobs/auto/02b-Initiate-Payments-2019-11-19","title":"02b/ Initiate Payments","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/03-Update-Payment-Status-2019-11-19":{"id":"library/jobs/auto/03-Update-Payment-Status-2019-11-19","title":"03/ Update Payment Status","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/04a-Query-for-job-changes-2019-12-12":{"id":"library/jobs/auto/04a-Query-for-job-changes-2019-12-12","title":"04a/Query for job changes","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/04b-Update-ODK-form-2019-12-03":{"id":"library/jobs/auto/04b-Update-ODK-form-2019-12-03","title":"04b/ Update ODK form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03":{"id":"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03","title":"05/ Submit employee evaluation","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05a-Query-for-new-employees-2019-12-19":{"id":"library/jobs/auto/05a-Query-for-new-employees-2019-12-19","title":"05a/Query for new employees","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19":{"id":"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19","title":"05b/Update ODK eval form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03":{"id":"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03","title":"1. Create Payment in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08":{"id":"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08","title":"1 Get CommCare Forms Bulk Extract","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08":{"id":"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08","title":"1. Get data from SLUHIS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14":{"id":"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14","title":"2. SMS Balance Update to Customer","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28":{"id":"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28","title":"Add DHIS2 Data Value Sets","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/aleksa-cron-2022-04-29":{"id":"library/jobs/auto/aleksa-cron-2022-04-29","title":"aleksa cron","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/alter-state-before-operations":{"id":"library/jobs/auto/alter-state-before-operations","title":"Pre-processing data","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Asana-test-2024-07-29":{"id":"library/jobs/auto/Asana-test-2024-07-29","title":"Asana-test","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/async-and-array-dot-map":{"id":"library/jobs/auto/async-and-array-dot-map","title":"Using async and array.map","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/async-findValue":{"id":"library/jobs/auto/async-findValue","title":"Using findValue with an array of data","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Attendance-Non-Skillz-2021-06-14":{"id":"library/jobs/auto/Attendance-Non-Skillz-2021-06-14","title":"Attendance Non Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce":{"id":"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce","title":"Using merge and each","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26":{"id":"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26","title":"Catch Error in HTTP Request","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27":{"id":"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27","title":"CHW case to DHIS2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Coach-Session-Register-2021-05-03":{"id":"library/jobs/auto/Coach-Session-Register-2021-05-03","title":"Coach Session Register","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CommCare-FHIR":{"id":"library/jobs/auto/CommCare-FHIR","title":"Create encounter in OpenHIM","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/commcare-reports-api-2016-08-29":{"id":"library/jobs/auto/commcare-reports-api-2016-08-29","title":"commcare reports api","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27":{"id":"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27","title":"CommCare to Azure Sql","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/complex-http-request-chains":{"id":"library/jobs/auto/complex-http-request-chains","title":"Chaining HTTP Requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/complex-state-control":{"id":"library/jobs/auto/complex-state-control","title":"Using promises","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/concatenate-many-fields-with-nulls":{"id":"library/jobs/auto/concatenate-many-fields-with-nulls","title":"Concat fields with nulls","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-contact-2021-03-01":{"id":"library/jobs/auto/Create-contact-2021-03-01","title":"Create contact","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/create-if-proposal":{"id":"library/jobs/auto/create-if-proposal","title":"Create/update records if...","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-Intervention-2021-04-08":{"id":"library/jobs/auto/Create-Intervention-2021-04-08","title":"Create Intervention","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24":{"id":"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24","title":"Create Patient in OpenMRS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12":{"id":"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12","title":"Create Person in OpenMRS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Person-in-SF-2019-02-25":{"id":"library/jobs/auto/Create-Person-in-SF-2019-02-25","title":"Create Person in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF":{"id":"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF","title":"Create SMS linked to contact","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-TEI-dhis2-2021-03-22":{"id":"library/jobs/auto/Create-TEI-dhis2-2021-03-22","title":"Create TEI (dhis2)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-DataValues-API":{"id":"library/jobs/auto/DHIS2-DataValues-API","title":"Add data values","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-Events-2016-01-27":{"id":"library/jobs/auto/DHIS2-Events-2016-01-27","title":"DHIS2 Events","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-Events-API":{"id":"library/jobs/auto/DHIS2-Events-API","title":"Add events","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Extract-Vitas-Data-2021-05-11":{"id":"library/jobs/auto/Extract-Vitas-Data-2021-05-11","title":"Extract Vitas Data","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Failed-Payment-Notification-2021-04-23":{"id":"library/jobs/auto/Failed-Payment-Notification-2021-04-23","title":"Failed Payment Notification","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Fetch-Claims-2023-07-17":{"id":"library/jobs/auto/Fetch-Claims-2023-07-17","title":"Fetch Claims","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Get-cases-from-Primero-2021-09-23":{"id":"library/jobs/auto/Get-cases-from-Primero-2021-09-23","title":"Get cases from Primero","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16":{"id":"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16","title":"Get CommCare Forms (Bulk Extract)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22":{"id":"library/jobs/auto/GET-Data-From-KoboToolbox-2022-03-22","title":"GET Data From KoboToolbox","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/getKoboData":{"id":"library/jobs/auto/getKoboData","title":"Extract Kobo data from API to send to OpenFn Inbox","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03":{"id":"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03","title":"HIV Testing Event Snapshot","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03":{"id":"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03","title":"HIV Testing Event Statistics","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Kobo-to-sheets-2023-10-13":{"id":"library/jobs/auto/Kobo-to-sheets-2023-10-13","title":"Kobo to sheets","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-to-DB-2022-05-16":{"id":"library/jobs/auto/Load-to-DB-2022-05-16","title":"Load to DB","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-to-DHIS2-2023-07-17":{"id":"library/jobs/auto/Load-to-DHIS2-2023-07-17","title":"Load to DHIS2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22":{"id":"library/jobs/auto/Load-Upsert-Data-into-PostgreSQL-2022-03-22","title":"Load / Upsert Data into PostgreSQL","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03":{"id":"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03","title":"Malaria Testing Event Snapshot","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03":{"id":"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03","title":"Malaria Testing Event Statistics","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/nawiri-2023-05-03":{"id":"library/jobs/auto/nawiri-2023-05-03","title":"nawiri","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/no-return-2023-01-06":{"id":"library/jobs/auto/no-return-2023-01-06","title":"no return","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks":{"id":"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks","title":"Handling multiple ODK repeat groups","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Outcome-Survey-2024-07-16":{"id":"library/jobs/auto/Outcome-Survey-2024-07-16","title":"Outcome Survey","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Pay-CHW-2021-04-23":{"id":"library/jobs/auto/Pay-CHW-2021-04-23","title":"Pay CHW","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/PHQ9-2021-05-03":{"id":"library/jobs/auto/PHQ9-2021-05-03","title":"PHQ9","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/promise-all-nested-requests":{"id":"library/jobs/auto/promise-all-nested-requests","title":"Promises and nested requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19":{"id":"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19","title":"Q3 2022 Create Distribution & Referral in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27":{"id":"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27","title":"Q3 2022 Update HH Name in CommCare","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28":{"id":"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28","title":"Q3 2022 Upsert Household & Household Visit in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21":{"id":"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21","title":"Q3 2022 Upsert Person","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28":{"id":"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28","title":"Q3 2022 Upsert Person Visit","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22","title":"Q4 2022 Upsert Supervision - Accompaniment","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19","title":"Q4 2022 Upsert Supervision - Feedback","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24","title":"Q4 2022 Upsert Supervision - Household Spot Check","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02":{"id":"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02","title":"Register Participant - V2 Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Register-Patient-2021-03-02":{"id":"library/jobs/auto/Register-Patient-2021-03-02","title":"Register Patient","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Registration-forms-new-case-2023-06-22":{"id":"library/jobs/auto/Registration-forms-new-case-2023-06-22","title":"Registration forms(new case)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Request-Vitas-Sync-2021-05-11":{"id":"library/jobs/auto/Request-Vitas-Sync-2021-05-11","title":"Request Vitas Sync","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27":{"id":"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27","title":"Risk and Vulnerability Assessment","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/send-mail-in-mailgun":{"id":"library/jobs/auto/send-mail-in-mailgun","title":"send email","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/send-sms-from-salesforce-workflow":{"id":"library/jobs/auto/send-sms-from-salesforce-workflow","title":"Send sms from Salesforce workflow action","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/synchronous-http-request":{"id":"library/jobs/auto/synchronous-http-request","title":"Chaining synchronous http requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/timeout":{"id":"library/jobs/auto/timeout","title":"Timeout to create a delay","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30":{"id":"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30","title":"Upsert Aggregate Service Referrals","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30":{"id":"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30","title":"Upsert ART Adherence Self-Reporting Tool","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24":{"id":"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24","title":"Upsert Attendance Skillz Plus Club","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28":{"id":"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28","title":"Upsert Coach Support Visit CSV","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14":{"id":"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14","title":"Upsert Confirm Services Received","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03":{"id":"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03","title":"Upsert Home Visit Log Form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28":{"id":"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28","title":"Upsert Intervention Notes","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array":{"id":"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array","title":"Merge data into child array then upsert","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Post-Challenges-2021-04-30":{"id":"library/jobs/auto/Upsert-Post-Challenges-2021-04-30","title":"Upsert Post Challenges","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30":{"id":"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30","title":"Upsert Pre Challenges","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Event-2021-04-30":{"id":"library/jobs/auto/Upsert-Register-Event-2021-04-30","title":"Upsert Register Event","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Participant-2021-04-28":{"id":"library/jobs/auto/Upsert-Register-Participant-2021-04-28","title":"Upsert Register Participant","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30":{"id":"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30","title":"Upsert Register Participant Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30":{"id":"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30","title":"Upsert Register Skills plus Club","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25":{"id":"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25","title":"Upsert Risk and Vulnerability Assessment - Service Referral","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14":{"id":"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14","title":"Upsert Service Referral 2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-2021-04-30":{"id":"library/jobs/auto/Upsert-Service-Referral-2021-04-30","title":"Upsert Service Referral","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30":{"id":"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30","title":"Upsert Service Referral Followup","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28":{"id":"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28","title":"Upsert Team or Group Name","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-to-mBrana-2021-05-11":{"id":"library/jobs/auto/Upsert-to-mBrana-2021-05-11","title":"Upsert to mBrana","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16":{"id":"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16","title":"Upsert User in Salesforce","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19":{"id":"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19","title":"WF1-1 Bulk get HH cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19":{"id":"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19","title":"WF1-2 Bulk upsert HHs and HH Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19":{"id":"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19","title":"WF2-1 Bulk get Person cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19":{"id":"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19","title":"WF2-2 Bulk upsert Persons","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19":{"id":"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19","title":"WF3-1 Bulk get Person Visit cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19":{"id":"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19","title":"WF3-2 Bulk upsert Person Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31":{"id":"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31","title":"WF3-2a Repeat Failed Person Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19":{"id":"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19","title":"WF4-1 Bulk get Referral Cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19":{"id":"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19","title":"WF4-2 Bulk upsert Services","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/triggers/xmlns":{"id":"library/triggers/xmlns","title":"Match a message with a fragment inside another object called `form`","description":""},"magpi":{"id":"magpi","title":"Magpi","description":"Magpi is not able to push data to external URLs. In order to fetch data from","sidebar":"adaptors"},"moodle":{"id":"moodle","title":"Moodle","description":"Overview","sidebar":"adaptors"},"msgraph":{"id":"msgraph","title":"Microsoft Graph","description":"Overview","sidebar":"adaptors"},"odk":{"id":"odk","title":"ODK","description":"ODK is a data collection platform used by researchers,","sidebar":"adaptors"},"ona":{"id":"ona","title":"Ona.io","description":"Webhooks to push form data to OpenFn","sidebar":"adaptors"},"packages/asana-changelog":{"id":"packages/asana-changelog","title":"asana changelog","description":"4.0.2","sidebar":"adaptors"},"packages/asana-configuration-schema":{"id":"packages/asana-configuration-schema","title":"Config for asana","description":"Jobs that use the asana adaptor may require authentication. A","sidebar":"adaptors"},"packages/asana-docs":{"id":"packages/asana-docs","title":"asana@4.0.2","description":"createTask(params, callback)","sidebar":"adaptors"},"packages/asana-readme":{"id":"packages/asana-readme","title":"asana developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/asana","sidebar":"adaptors"},"packages/azure-storage-changelog":{"id":"packages/azure-storage-changelog","title":"azure-storage changelog","description":"2.0.2","sidebar":"adaptors"},"packages/azure-storage-configuration-schema":{"id":"packages/azure-storage-configuration-schema","title":"Config for azure-storage","description":"Jobs that use the azure-storage adaptor may require authentication. A","sidebar":"adaptors"},"packages/azure-storage-docs":{"id":"packages/azure-storage-docs","title":"azure-storage@2.0.2","description":"downloadBlob(blobName, [options])","sidebar":"adaptors"},"packages/azure-storage-readme":{"id":"packages/azure-storage-readme","title":"azure-storage developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/azure-storage","sidebar":"adaptors"},"packages/beyonic-changelog":{"id":"packages/beyonic-changelog","title":"beyonic changelog","description":"0.3.4","sidebar":"adaptors"},"packages/beyonic-configuration-schema":{"id":"packages/beyonic-configuration-schema","title":"Config for beyonic","description":"Jobs that use the beyonic adaptor may require authentication. A","sidebar":"adaptors"},"packages/beyonic-docs":{"id":"packages/beyonic-docs","title":"beyonic@0.3.4","description":"createCollectionRequest(data)","sidebar":"adaptors"},"packages/beyonic-readme":{"id":"packages/beyonic-readme","title":"beyonic developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/beyonic","sidebar":"adaptors"},"packages/bigquery-changelog":{"id":"packages/bigquery-changelog","title":"bigquery changelog","description":"3.0.2","sidebar":"adaptors"},"packages/bigquery-configuration-schema":{"id":"packages/bigquery-configuration-schema","title":"Config for bigquery","description":"Jobs that use the bigquery adaptor may require authentication. A","sidebar":"adaptors"},"packages/bigquery-docs":{"id":"packages/bigquery-docs","title":"bigquery@3.0.2","description":"load(dirPath, projectId, datasetId, tableId, loadOptions, callback)","sidebar":"adaptors"},"packages/bigquery-readme":{"id":"packages/bigquery-readme","title":"bigquery developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/bigquery","sidebar":"adaptors"},"packages/cartodb-changelog":{"id":"packages/cartodb-changelog","title":"cartodb changelog","description":"0.4.4","sidebar":"adaptors"},"packages/cartodb-configuration-schema":{"id":"packages/cartodb-configuration-schema","title":"Config for cartodb","description":"Jobs that use the cartodb adaptor may require authentication. A","sidebar":"adaptors"},"packages/cartodb-docs":{"id":"packages/cartodb-docs","title":"cartodb@0.4.4","description":"addRow(table, rowData)","sidebar":"adaptors"},"packages/cartodb-readme":{"id":"packages/cartodb-readme","title":"cartodb developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/cartodb","sidebar":"adaptors"},"packages/cht-changelog":{"id":"packages/cht-changelog","title":"cht changelog","description":"1.0.2","sidebar":"adaptors"},"packages/cht-configuration-schema":{"id":"packages/cht-configuration-schema","title":"Config for cht","description":"Jobs that use the cht adaptor may require authentication. A","sidebar":"adaptors"},"packages/cht-docs":{"id":"packages/cht-docs","title":"cht@1.0.2","description":"get(path, options, [callback])","sidebar":"adaptors"},"packages/cht-readme":{"id":"packages/cht-readme","title":"cht developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/cht","sidebar":"adaptors"},"packages/commcare-changelog":{"id":"packages/commcare-changelog","title":"commcare changelog","description":"3.1.2","sidebar":"adaptors"},"packages/commcare-configuration-schema":{"id":"packages/commcare-configuration-schema","title":"Config for commcare","description":"Jobs that use the commcare adaptor may require authentication. A","sidebar":"adaptors"},"packages/commcare-docs":{"id":"packages/commcare-docs","title":"commcare@3.1.2","description":"fetchReportData(reportId, params, postUrl)","sidebar":"adaptors"},"packages/commcare-readme":{"id":"packages/commcare-readme","title":"commcare developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/commcare","sidebar":"adaptors"},"packages/common-changelog":{"id":"packages/common-changelog","title":"common changelog","description":"2.0.0","sidebar":"adaptors"},"packages/common-configuration-schema":{"id":"packages/common-configuration-schema","title":"Config for common","description":"No configuration schema has been defined for the common adaptor.","sidebar":"adaptors"},"packages/common-docs":{"id":"packages/common-docs","title":"common@2.0.2","description":"arrayToString(arr, separator)","sidebar":"adaptors"},"packages/common-readme":{"id":"packages/common-readme","title":"common developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/common","sidebar":"adaptors"},"packages/dhis2-changelog":{"id":"packages/dhis2-changelog","title":"dhis2 changelog","description":"5.0.2","sidebar":"adaptors"},"packages/dhis2-configuration-schema":{"id":"packages/dhis2-configuration-schema","title":"Config for dhis2","description":"Jobs that use the dhis2 adaptor may require authentication. A","sidebar":"adaptors"},"packages/dhis2-docs":{"id":"packages/dhis2-docs","title":"dhis2@5.0.2","description":"attr(attribute, value)","sidebar":"adaptors"},"packages/dhis2-readme":{"id":"packages/dhis2-readme","title":"dhis2 developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/dhis2","sidebar":"adaptors"},"packages/dynamics-changelog":{"id":"packages/dynamics-changelog","title":"dynamics changelog","description":"0.5.5","sidebar":"adaptors"},"packages/dynamics-configuration-schema":{"id":"packages/dynamics-configuration-schema","title":"Config for dynamics","description":"Jobs that use the dynamics adaptor may require authentication. A","sidebar":"adaptors"},"packages/dynamics-docs":{"id":"packages/dynamics-docs","title":"dynamics@0.5.5","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/dynamics-readme":{"id":"packages/dynamics-readme","title":"dynamics developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/dynamics","sidebar":"adaptors"},"packages/facebook-changelog":{"id":"packages/facebook-changelog","title":"facebook changelog","description":"0.4.3","sidebar":"adaptors"},"packages/facebook-configuration-schema":{"id":"packages/facebook-configuration-schema","title":"Config for facebook","description":"Jobs that use the facebook adaptor may require authentication. A","sidebar":"adaptors"},"packages/facebook-docs":{"id":"packages/facebook-docs","title":"facebook@0.4.3","description":"postMessage(params)","sidebar":"adaptors"},"packages/facebook-readme":{"id":"packages/facebook-readme","title":"facebook developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/facebook","sidebar":"adaptors"},"packages/fhir-changelog":{"id":"packages/fhir-changelog","title":"fhir changelog","description":"5.0.2","sidebar":"adaptors"},"packages/fhir-configuration-schema":{"id":"packages/fhir-configuration-schema","title":"Config for fhir","description":"Jobs that use the fhir adaptor may require authentication. A","sidebar":"adaptors"},"packages/fhir-docs":{"id":"packages/fhir-docs","title":"fhir@5.0.2","description":"create(resourceType, resource, params, callback)","sidebar":"adaptors"},"packages/fhir-readme":{"id":"packages/fhir-readme","title":"fhir developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/fhir","sidebar":"adaptors"},"packages/godata-changelog":{"id":"packages/godata-changelog","title":"godata changelog","description":"3.5.2","sidebar":"adaptors"},"packages/godata-configuration-schema":{"id":"packages/godata-configuration-schema","title":"Config for godata","description":"Jobs that use the godata adaptor may require authentication. A","sidebar":"adaptors"},"packages/godata-docs":{"id":"packages/godata-docs","title":"godata@3.5.2","description":"getCase(id, query, callback)","sidebar":"adaptors"},"packages/godata-readme":{"id":"packages/godata-readme","title":"godata developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/godata","sidebar":"adaptors"},"packages/googlehealthcare-changelog":{"id":"packages/googlehealthcare-changelog","title":"googlehealthcare changelog","description":"1.1.2","sidebar":"adaptors"},"packages/googlehealthcare-configuration-schema":{"id":"packages/googlehealthcare-configuration-schema","title":"Config for googlehealthcare","description":"Jobs that use the googlehealthcare adaptor may require authentication. A","sidebar":"adaptors"},"packages/googlehealthcare-docs":{"id":"packages/googlehealthcare-docs","title":"googlehealthcare@1.1.2","description":"createFhirResource([fhirStore], resource, callback)","sidebar":"adaptors"},"packages/googlehealthcare-readme":{"id":"packages/googlehealthcare-readme","title":"googlehealthcare developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/googlehealthcare","sidebar":"adaptors"},"packages/googlesheets-changelog":{"id":"packages/googlesheets-changelog","title":"googlesheets changelog","description":"3.0.2","sidebar":"adaptors"},"packages/googlesheets-configuration-schema":{"id":"packages/googlesheets-configuration-schema","title":"Config for googlesheets","description":"Jobs that use the googlesheets adaptor may require authentication. A","sidebar":"adaptors"},"packages/googlesheets-docs":{"id":"packages/googlesheets-docs","title":"googlesheets@3.0.2","description":"appendValues(params, callback)","sidebar":"adaptors"},"packages/googlesheets-readme":{"id":"packages/googlesheets-readme","title":"googlesheets developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/googlesheets","sidebar":"adaptors"},"packages/hive-changelog":{"id":"packages/hive-changelog","title":"hive changelog","description":"0.3.3","sidebar":"adaptors"},"packages/hive-configuration-schema":{"id":"packages/hive-configuration-schema","title":"Config for hive","description":"Jobs that use the hive adaptor may require authentication. A","sidebar":"adaptors"},"packages/hive-docs":{"id":"packages/hive-docs","title":"hive@0.3.3","description":"query(qs, options, callback)","sidebar":"adaptors"},"packages/hive-readme":{"id":"packages/hive-readme","title":"hive developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/hive","sidebar":"adaptors"},"packages/http-changelog":{"id":"packages/http-changelog","title":"http changelog","description":"6.4.4","sidebar":"adaptors"},"packages/http-configuration-schema":{"id":"packages/http-configuration-schema","title":"Config for http","description":"Jobs that use the http adaptor may require authentication. A","sidebar":"adaptors"},"packages/http-docs":{"id":"packages/http-docs","title":"http@6.4.4","description":"del(path, params, callback)","sidebar":"adaptors"},"packages/http-readme":{"id":"packages/http-readme","title":"http developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/http","sidebar":"adaptors"},"packages/khanacademy-changelog":{"id":"packages/khanacademy-changelog","title":"khanacademy changelog","description":"0.5.3","sidebar":"adaptors"},"packages/khanacademy-configuration-schema":{"id":"packages/khanacademy-configuration-schema","title":"Config for khanacademy","description":"Jobs that use the khanacademy adaptor may require authentication. A","sidebar":"adaptors"},"packages/khanacademy-docs":{"id":"packages/khanacademy-docs","title":"khanacademy@0.5.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/khanacademy-readme":{"id":"packages/khanacademy-readme","title":"khanacademy developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/khanacademy","sidebar":"adaptors"},"packages/kobotoolbox-changelog":{"id":"packages/kobotoolbox-changelog","title":"kobotoolbox changelog","description":"2.4.2","sidebar":"adaptors"},"packages/kobotoolbox-configuration-schema":{"id":"packages/kobotoolbox-configuration-schema","title":"Config for kobotoolbox","description":"Jobs that use the kobotoolbox adaptor may require authentication. A","sidebar":"adaptors"},"packages/kobotoolbox-docs":{"id":"packages/kobotoolbox-docs","title":"kobotoolbox@2.4.2","description":"getDeploymentInfo(params, callback)","sidebar":"adaptors"},"packages/kobotoolbox-readme":{"id":"packages/kobotoolbox-readme","title":"kobotoolbox developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/kobotoolbox","sidebar":"adaptors"},"packages/magpi-changelog":{"id":"packages/magpi-changelog","title":"magpi changelog","description":"1.2.2","sidebar":"adaptors"},"packages/magpi-configuration-schema":{"id":"packages/magpi-configuration-schema","title":"Config for magpi","description":"Jobs that use the magpi adaptor may require authentication. A","sidebar":"adaptors"},"packages/magpi-docs":{"id":"packages/magpi-docs","title":"magpi@1.2.2","description":"fetchSurveyData(params)","sidebar":"adaptors"},"packages/magpi-readme":{"id":"packages/magpi-readme","title":"magpi developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/magpi","sidebar":"adaptors"},"packages/mailchimp-changelog":{"id":"packages/mailchimp-changelog","title":"mailchimp changelog","description":"1.0.4","sidebar":"adaptors"},"packages/mailchimp-configuration-schema":{"id":"packages/mailchimp-configuration-schema","title":"Config for mailchimp","description":"Jobs that use the mailchimp adaptor may require authentication. A","sidebar":"adaptors"},"packages/mailchimp-docs":{"id":"packages/mailchimp-docs","title":"mailchimp@1.0.4","description":"addMember(params, [callback])","sidebar":"adaptors"},"packages/mailchimp-readme":{"id":"packages/mailchimp-readme","title":"mailchimp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mailchimp","sidebar":"adaptors"},"packages/mailgun-changelog":{"id":"packages/mailgun-changelog","title":"mailgun changelog","description":"0.5.3","sidebar":"adaptors"},"packages/mailgun-configuration-schema":{"id":"packages/mailgun-configuration-schema","title":"Config for mailgun","description":"Jobs that use the mailgun adaptor may require authentication. A","sidebar":"adaptors"},"packages/mailgun-docs":{"id":"packages/mailgun-docs","title":"mailgun@0.5.3","description":"send(params)","sidebar":"adaptors"},"packages/mailgun-readme":{"id":"packages/mailgun-readme","title":"mailgun developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mailgun","sidebar":"adaptors"},"packages/maximo-changelog":{"id":"packages/maximo-changelog","title":"maximo changelog","description":"0.5.4","sidebar":"adaptors"},"packages/maximo-configuration-schema":{"id":"packages/maximo-configuration-schema","title":"Config for maximo","description":"Jobs that use the maximo adaptor may require authentication. A","sidebar":"adaptors"},"packages/maximo-docs":{"id":"packages/maximo-docs","title":"maximo@0.5.4","description":"fetch(params)","sidebar":"adaptors"},"packages/maximo-readme":{"id":"packages/maximo-readme","title":"maximo developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/maximo","sidebar":"adaptors"},"packages/medicmobile-changelog":{"id":"packages/medicmobile-changelog","title":"medicmobile changelog","description":"0.5.3","sidebar":"adaptors"},"packages/medicmobile-configuration-schema":{"id":"packages/medicmobile-configuration-schema","title":"Config for medicmobile","description":"Jobs that use the medicmobile adaptor may require authentication. A","sidebar":"adaptors"},"packages/medicmobile-docs":{"id":"packages/medicmobile-docs","title":"medicmobile@0.5.3","description":"changesApi(params, callback)","sidebar":"adaptors"},"packages/medicmobile-readme":{"id":"packages/medicmobile-readme","title":"medicmobile developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/medicmobile","sidebar":"adaptors"},"packages/mogli-changelog":{"id":"packages/mogli-changelog","title":"mogli changelog","description":"v0.1.6","sidebar":"adaptors"},"packages/mogli-configuration-schema":{"id":"packages/mogli-configuration-schema","title":"Config for mogli","description":"Jobs that use the mogli adaptor may require authentication. A","sidebar":"adaptors"},"packages/mogli-docs":{"id":"packages/mogli-docs","title":"mogli@0.5.4","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/mogli-readme":{"id":"packages/mogli-readme","title":"mogli developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mogli","sidebar":"adaptors"},"packages/mongodb-changelog":{"id":"packages/mongodb-changelog","title":"mongodb changelog","description":"2.1.4","sidebar":"adaptors"},"packages/mongodb-configuration-schema":{"id":"packages/mongodb-configuration-schema","title":"Config for mongodb","description":"Jobs that use the mongodb adaptor may require authentication. A","sidebar":"adaptors"},"packages/mongodb-docs":{"id":"packages/mongodb-docs","title":"mongodb@2.1.4","description":"findDocuments(params)","sidebar":"adaptors"},"packages/mongodb-readme":{"id":"packages/mongodb-readme","title":"mongodb developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mongodb","sidebar":"adaptors"},"packages/msgraph-changelog":{"id":"packages/msgraph-changelog","title":"msgraph changelog","description":"0.7.4","sidebar":"adaptors"},"packages/msgraph-configuration-schema":{"id":"packages/msgraph-configuration-schema","title":"Config for msgraph","description":"Jobs that use the msgraph adaptor may require authentication. A","sidebar":"adaptors"},"packages/msgraph-docs":{"id":"packages/msgraph-docs","title":"msgraph@0.7.4","description":"create(resource, data, callback)","sidebar":"adaptors"},"packages/msgraph-readme":{"id":"packages/msgraph-readme","title":"msgraph developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/msgraph","sidebar":"adaptors"},"packages/mssql-changelog":{"id":"packages/mssql-changelog","title":"mssql changelog","description":"5.0.4","sidebar":"adaptors"},"packages/mssql-configuration-schema":{"id":"packages/mssql-configuration-schema","title":"Config for mssql","description":"Jobs that use the mssql adaptor may require authentication. A","sidebar":"adaptors"},"packages/mssql-docs":{"id":"packages/mssql-docs","title":"mssql@5.0.4","description":"describeTable(tableName, options)","sidebar":"adaptors"},"packages/mssql-readme":{"id":"packages/mssql-readme","title":"mssql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mssql","sidebar":"adaptors"},"packages/mysql-changelog":{"id":"packages/mysql-changelog","title":"mysql changelog","description":"2.0.2","sidebar":"adaptors"},"packages/mysql-configuration-schema":{"id":"packages/mysql-configuration-schema","title":"Config for mysql","description":"Jobs that use the mysql adaptor may require authentication. A","sidebar":"adaptors"},"packages/mysql-docs":{"id":"packages/mysql-docs","title":"mysql@2.0.2","description":"insert(table, fields)","sidebar":"adaptors"},"packages/mysql-readme":{"id":"packages/mysql-readme","title":"mysql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mysql","sidebar":"adaptors"},"packages/nexmo-changelog":{"id":"packages/nexmo-changelog","title":"nexmo changelog","description":"0.5.5","sidebar":"adaptors"},"packages/nexmo-configuration-schema":{"id":"packages/nexmo-configuration-schema","title":"Config for nexmo","description":"Jobs that use the nexmo adaptor may require authentication. A","sidebar":"adaptors"},"packages/nexmo-docs":{"id":"packages/nexmo-docs","title":"nexmo@0.5.5","description":"sendSMS(from, toNumber, message)","sidebar":"adaptors"},"packages/nexmo-readme":{"id":"packages/nexmo-readme","title":"nexmo developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/nexmo","sidebar":"adaptors"},"packages/ocl-changelog":{"id":"packages/ocl-changelog","title":"ocl changelog","description":"1.2.5","sidebar":"adaptors"},"packages/ocl-configuration-schema":{"id":"packages/ocl-configuration-schema","title":"Config for ocl","description":"Jobs that use the ocl adaptor may require authentication. A","sidebar":"adaptors"},"packages/ocl-docs":{"id":"packages/ocl-docs","title":"ocl@1.2.5","description":"get(path, query, callback)","sidebar":"adaptors"},"packages/ocl-readme":{"id":"packages/ocl-readme","title":"ocl developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/ocl","sidebar":"adaptors"},"packages/odk-changelog":{"id":"packages/odk-changelog","title":"odk changelog","description":"3.0.4","sidebar":"adaptors"},"packages/odk-configuration-schema":{"id":"packages/odk-configuration-schema","title":"Config for odk","description":"Jobs that use the odk adaptor may require authentication. A","sidebar":"adaptors"},"packages/odk-docs":{"id":"packages/odk-docs","title":"odk@3.0.4","description":"get(path, options)","sidebar":"adaptors"},"packages/odk-readme":{"id":"packages/odk-readme","title":"odk developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/odk","sidebar":"adaptors"},"packages/openfn-changelog":{"id":"packages/openfn-changelog","title":"openfn changelog","description":"2.0.2","sidebar":"adaptors"},"packages/openfn-configuration-schema":{"id":"packages/openfn-configuration-schema","title":"Config for openfn","description":"Jobs that use the openfn adaptor may require authentication. A","sidebar":"adaptors"},"packages/openfn-docs":{"id":"packages/openfn-docs","title":"openfn@2.0.2","description":"request(options, callback)","sidebar":"adaptors"},"packages/openfn-readme":{"id":"packages/openfn-readme","title":"openfn developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openfn","sidebar":"adaptors"},"packages/openhim-changelog":{"id":"packages/openhim-changelog","title":"openhim changelog","description":"0.3.3","sidebar":"adaptors"},"packages/openhim-configuration-schema":{"id":"packages/openhim-configuration-schema","title":"Config for openhim","description":"Jobs that use the openhim adaptor may require authentication. A","sidebar":"adaptors"},"packages/openhim-docs":{"id":"packages/openhim-docs","title":"openhim@0.3.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/openhim-readme":{"id":"packages/openhim-readme","title":"openhim developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openhim","sidebar":"adaptors"},"packages/openimis-changelog":{"id":"packages/openimis-changelog","title":"openimis changelog","description":"2.0.2","sidebar":"adaptors"},"packages/openimis-configuration-schema":{"id":"packages/openimis-configuration-schema","title":"Config for openimis","description":"Jobs that use the openimis adaptor may require authentication. A","sidebar":"adaptors"},"packages/openimis-docs":{"id":"packages/openimis-docs","title":"openimis@2.0.2","description":"getFHIR(path, params, callback)","sidebar":"adaptors"},"packages/openimis-readme":{"id":"packages/openimis-readme","title":"openimis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openimis","sidebar":"adaptors"},"packages/openlmis-changelog":{"id":"packages/openlmis-changelog","title":"openlmis changelog","description":"1.0.4","sidebar":"adaptors"},"packages/openlmis-configuration-schema":{"id":"packages/openlmis-configuration-schema","title":"Config for openlmis","description":"Jobs that use the openlmis adaptor may require authentication. A","sidebar":"adaptors"},"packages/openlmis-docs":{"id":"packages/openlmis-docs","title":"openlmis@1.0.4","description":"get(path, options, [callback])","sidebar":"adaptors"},"packages/openlmis-readme":{"id":"packages/openlmis-readme","title":"openlmis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openlmis","sidebar":"adaptors"},"packages/openmrs-changelog":{"id":"packages/openmrs-changelog","title":"openmrs changelog","description":"4.0.1","sidebar":"adaptors"},"packages/openmrs-configuration-schema":{"id":"packages/openmrs-configuration-schema","title":"Config for openmrs","description":"Jobs that use the openmrs adaptor may require authentication. A","sidebar":"adaptors"},"packages/openmrs-docs":{"id":"packages/openmrs-docs","title":"openmrs@4.0.1","description":"create(resourceType, data, [callback])","sidebar":"adaptors"},"packages/openmrs-readme":{"id":"packages/openmrs-readme","title":"openmrs developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openmrs","sidebar":"adaptors"},"packages/openspp-changelog":{"id":"packages/openspp-changelog","title":"openspp changelog","description":"2.0.2","sidebar":"adaptors"},"packages/openspp-configuration-schema":{"id":"packages/openspp-configuration-schema","title":"Config for openspp","description":"Jobs that use the openspp adaptor may require authentication. A","sidebar":"adaptors"},"packages/openspp-docs":{"id":"packages/openspp-docs","title":"openspp@2.0.2","description":"addToGroup(groupid, individualid, role)","sidebar":"adaptors"},"packages/openspp-readme":{"id":"packages/openspp-readme","title":"openspp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openspp","sidebar":"adaptors"},"packages/postgresql-changelog":{"id":"packages/postgresql-changelog","title":"postgresql changelog","description":"6.0.2","sidebar":"adaptors"},"packages/postgresql-configuration-schema":{"id":"packages/postgresql-configuration-schema","title":"Config for postgresql","description":"Jobs that use the postgresql adaptor may require authentication. A","sidebar":"adaptors"},"packages/postgresql-docs":{"id":"packages/postgresql-docs","title":"postgresql@6.0.2","description":"describeTable(tableName, [options], callback)","sidebar":"adaptors"},"packages/postgresql-readme":{"id":"packages/postgresql-readme","title":"postgresql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/postgresql","sidebar":"adaptors"},"packages/primero-changelog":{"id":"packages/primero-changelog","title":"primero changelog","description":"3.0.2","sidebar":"adaptors"},"packages/primero-configuration-schema":{"id":"packages/primero-configuration-schema","title":"Config for primero","description":"Jobs that use the primero adaptor may require authentication. A","sidebar":"adaptors"},"packages/primero-docs":{"id":"packages/primero-docs","title":"primero@3.0.2","description":"createCase(params, callback)","sidebar":"adaptors"},"packages/primero-readme":{"id":"packages/primero-readme","title":"primero developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/primero","sidebar":"adaptors"},"packages/progres-changelog":{"id":"packages/progres-changelog","title":"progres changelog","description":"1.4.4","sidebar":"adaptors"},"packages/progres-configuration-schema":{"id":"packages/progres-configuration-schema","title":"Config for progres","description":"Jobs that use the progres adaptor may require authentication. A","sidebar":"adaptors"},"packages/progres-docs":{"id":"packages/progres-docs","title":"progres@1.4.4","description":"postData(params, callback)","sidebar":"adaptors"},"packages/progres-readme":{"id":"packages/progres-readme","title":"progres developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/progres","sidebar":"adaptors"},"packages/rapidpro-changelog":{"id":"packages/rapidpro-changelog","title":"rapidpro changelog","description":"1.1.3","sidebar":"adaptors"},"packages/rapidpro-configuration-schema":{"id":"packages/rapidpro-configuration-schema","title":"Config for rapidpro","description":"Jobs that use the rapidpro adaptor may require authentication. A","sidebar":"adaptors"},"packages/rapidpro-docs":{"id":"packages/rapidpro-docs","title":"rapidpro@1.1.3","description":"addContact(params, callback)","sidebar":"adaptors"},"packages/rapidpro-readme":{"id":"packages/rapidpro-readme","title":"rapidpro developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/rapidpro","sidebar":"adaptors"},"packages/redis-changelog":{"id":"packages/redis-changelog","title":"redis changelog","description":"1.2.1","sidebar":"adaptors"},"packages/redis-configuration-schema":{"id":"packages/redis-configuration-schema","title":"Config for redis","description":"Jobs that use the redis adaptor may require authentication. A","sidebar":"adaptors"},"packages/redis-docs":{"id":"packages/redis-docs","title":"redis@1.2.1","description":"get(key)","sidebar":"adaptors"},"packages/redis-readme":{"id":"packages/redis-readme","title":"redis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/redis","sidebar":"adaptors"},"packages/resourcemap-changelog":{"id":"packages/resourcemap-changelog","title":"resourcemap changelog","description":"0.4.3","sidebar":"adaptors"},"packages/resourcemap-configuration-schema":{"id":"packages/resourcemap-configuration-schema","title":"Config for resourcemap","description":"Jobs that use the resourcemap adaptor may require authentication. A","sidebar":"adaptors"},"packages/resourcemap-docs":{"id":"packages/resourcemap-docs","title":"resourcemap@0.4.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/resourcemap-readme":{"id":"packages/resourcemap-readme","title":"resourcemap developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/resourcemap","sidebar":"adaptors"},"packages/salesforce-changelog":{"id":"packages/salesforce-changelog","title":"salesforce changelog","description":"4.8.3","sidebar":"adaptors"},"packages/salesforce-configuration-schema":{"id":"packages/salesforce-configuration-schema","title":"Config for salesforce","description":"Jobs that use the salesforce adaptor may require authentication. A","sidebar":"adaptors"},"packages/salesforce-docs":{"id":"packages/salesforce-docs","title":"salesforce@4.8.3","description":"bulk(sObject, operation, options, records)","sidebar":"adaptors"},"packages/salesforce-readme":{"id":"packages/salesforce-readme","title":"salesforce developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/salesforce","sidebar":"adaptors"},"packages/satusehat-changelog":{"id":"packages/satusehat-changelog","title":"satusehat changelog","description":"2.0.2","sidebar":"adaptors"},"packages/satusehat-configuration-schema":{"id":"packages/satusehat-configuration-schema","title":"Config for satusehat","description":"Jobs that use the satusehat adaptor may require authentication. A","sidebar":"adaptors"},"packages/satusehat-docs":{"id":"packages/satusehat-docs","title":"satusehat@2.0.2","description":"get(path, params, callback)","sidebar":"adaptors"},"packages/satusehat-readme":{"id":"packages/satusehat-readme","title":"satusehat developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/satusehat","sidebar":"adaptors"},"packages/sftp-changelog":{"id":"packages/sftp-changelog","title":"sftp changelog","description":"2.0.2","sidebar":"adaptors"},"packages/sftp-configuration-schema":{"id":"packages/sftp-configuration-schema","title":"Config for sftp","description":"Jobs that use the sftp adaptor may require authentication. A","sidebar":"adaptors"},"packages/sftp-docs":{"id":"packages/sftp-docs","title":"sftp@2.0.2","description":"getCSV(filePath, [parsingOptions])","sidebar":"adaptors"},"packages/sftp-readme":{"id":"packages/sftp-readme","title":"sftp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/sftp","sidebar":"adaptors"},"packages/smpp-changelog":{"id":"packages/smpp-changelog","title":"smpp changelog","description":"1.4.3","sidebar":"adaptors"},"packages/smpp-configuration-schema":{"id":"packages/smpp-configuration-schema","title":"Config for smpp","description":"Jobs that use the smpp adaptor may require authentication. A","sidebar":"adaptors"},"packages/smpp-docs":{"id":"packages/smpp-docs","title":"smpp@1.4.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/smpp-readme":{"id":"packages/smpp-readme","title":"smpp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/smpp","sidebar":"adaptors"},"packages/surveycto-changelog":{"id":"packages/surveycto-changelog","title":"surveycto changelog","description":"2.2.3","sidebar":"adaptors"},"packages/surveycto-configuration-schema":{"id":"packages/surveycto-configuration-schema","title":"Config for surveycto","description":"Jobs that use the surveycto adaptor may require authentication. A","sidebar":"adaptors"},"packages/surveycto-docs":{"id":"packages/surveycto-docs","title":"surveycto@2.2.3","description":"cursor(value, options)","sidebar":"adaptors"},"packages/surveycto-readme":{"id":"packages/surveycto-readme","title":"surveycto developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/surveycto","sidebar":"adaptors"},"packages/telerivet-changelog":{"id":"packages/telerivet-changelog","title":"telerivet changelog","description":"0.3.3","sidebar":"adaptors"},"packages/telerivet-configuration-schema":{"id":"packages/telerivet-configuration-schema","title":"Config for telerivet","description":"Jobs that use the telerivet adaptor may require authentication. A","sidebar":"adaptors"},"packages/telerivet-docs":{"id":"packages/telerivet-docs","title":"telerivet@0.3.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/telerivet-readme":{"id":"packages/telerivet-readme","title":"telerivet developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/telerivet","sidebar":"adaptors"},"packages/testing-changelog":{"id":"packages/testing-changelog","title":"testing changelog","description":"1.0.5","sidebar":"adaptors"},"packages/testing-configuration-schema":{"id":"packages/testing-configuration-schema","title":"Config for testing","description":"Jobs that use the testing adaptor may require authentication. A","sidebar":"adaptors"},"packages/testing-docs":{"id":"packages/testing-docs","title":"testing@1.0.5","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/testing-readme":{"id":"packages/testing-readme","title":"testing developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/testing","sidebar":"adaptors"},"packages/twilio-changelog":{"id":"packages/twilio-changelog","title":"twilio changelog","description":"0.5.1","sidebar":"adaptors"},"packages/twilio-configuration-schema":{"id":"packages/twilio-configuration-schema","title":"Config for twilio","description":"Jobs that use the twilio adaptor may require authentication. A","sidebar":"adaptors"},"packages/twilio-docs":{"id":"packages/twilio-docs","title":"twilio@0.5.1","description":"sendSMS(params)","sidebar":"adaptors"},"packages/twilio-readme":{"id":"packages/twilio-readme","title":"twilio developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/twilio","sidebar":"adaptors"},"packages/vtiger-changelog":{"id":"packages/vtiger-changelog","title":"vtiger changelog","description":"1.3.3","sidebar":"adaptors"},"packages/vtiger-configuration-schema":{"id":"packages/vtiger-configuration-schema","title":"Config for vtiger","description":"Jobs that use the vtiger adaptor may require authentication. A","sidebar":"adaptors"},"packages/vtiger-docs":{"id":"packages/vtiger-docs","title":"vtiger@1.3.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/vtiger-readme":{"id":"packages/vtiger-readme","title":"vtiger developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/vtiger","sidebar":"adaptors"},"packages/zoho-changelog":{"id":"packages/zoho-changelog","title":"zoho changelog","description":"0.4.3","sidebar":"adaptors"},"packages/zoho-configuration-schema":{"id":"packages/zoho-configuration-schema","title":"Config for zoho","description":"Jobs that use the zoho adaptor may require authentication. A","sidebar":"adaptors"},"packages/zoho-docs":{"id":"packages/zoho-docs","title":"zoho@0.4.3","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/zoho-readme":{"id":"packages/zoho-readme","title":"zoho developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/zoho","sidebar":"adaptors"},"postgresql":{"id":"postgresql","title":"PostgreSQL","description":"Overview","sidebar":"adaptors"},"powerbi":{"id":"powerbi","title":"Power BI","description":"(Work in progress)","sidebar":"adaptors"},"primero":{"id":"primero","title":"Primero","description":"Overview","sidebar":"adaptors"},"salesforce":{"id":"salesforce","title":"Salesforce","description":"App Overview","sidebar":"adaptors"},"surveycto":{"id":"surveycto","title":"SurveyCTO","description":"App Overview","sidebar":"adaptors"},"tableau":{"id":"tableau","title":"Tableau","description":"(Work in progress)","sidebar":"adaptors"}}}')}}]); \ No newline at end of file diff --git a/assets/js/d1e2a1e4.901c7010.js b/assets/js/d1e2a1e4.9c1c55c9.js similarity index 99% rename from assets/js/d1e2a1e4.901c7010.js rename to assets/js/d1e2a1e4.9c1c55c9.js index afbeb90ba56..c5ebf51f9e5 100644 --- a/assets/js/d1e2a1e4.901c7010.js +++ b/assets/js/d1e2a1e4.9c1c55c9.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_openfn_docs=self.webpackChunk_openfn_docs||[]).push([[182],{4153:(e,a,t)=>{t.r(a),t.d(a,{assets:()=>p,contentTitle:()=>g,default:()=>d,frontMatter:()=>r,metadata:()=>o,toc:()=>u});var n=t(58168),l=(t(96540),t(15680));const r={title:"mssql@5.0.3",id:"mssql-docs",keywords:["adaptor","mssql","describeTable","findValue","insert","insertMany","insertTable","modifyTable","sql","upsert","upsertIf","upsertMany"]},g=void 0,o={unversionedId:"packages/mssql-docs",id:"packages/mssql-docs",title:"mssql@5.0.3",description:"describeTable(tableName, options)",source:"@site/adaptors/packages/mssql-docs.md",sourceDirName:"packages",slug:"/packages/mssql-docs",permalink:"/adaptors/packages/mssql-docs",draft:!1,tags:[],version:"current",frontMatter:{title:"mssql@5.0.3",id:"mssql-docs",keywords:["adaptor","mssql","describeTable","findValue","insert","insertMany","insertTable","modifyTable","sql","upsert","upsertIf","upsertMany"]},sidebar:"adaptors",previous:{title:"msgraph developer readme",permalink:"/adaptors/packages/msgraph-readme"},next:{title:"Config for mssql",permalink:"/adaptors/packages/mssql-configuration-schema"}},p={},u=[{value:"Functions",id:"functions",level:2},{value:"describeTable",id:"describetable",level:3},{value:"findValue",id:"findvalue",level:3},{value:"insert",id:"insert",level:3},{value:"insertMany",id:"insertmany",level:3},{value:"insertTable",id:"inserttable",level:3},{value:"modifyTable",id:"modifytable",level:3},{value:"sql",id:"sql",level:3},{value:"upsert",id:"upsert",level:3},{value:"upsertIf",id:"upsertif",level:3},{value:"upsertMany",id:"upsertmany",level:3}],y={toc:u},i="wrapper";function d(e){let{components:a,...t}=e;return(0,l.yg)(i,(0,n.A)({},y,t,{components:a,mdxType:"MDXLayout"}),(0,l.yg)("dl",null,(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#describetable"},"describeTable(tableName, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#findvalue"},"findValue(filter)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#insert"},"insert(table, record, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#insertmany"},"insertMany(table, records, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#inserttable"},"insertTable(tableName, columns, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#modifytable"},"modifyTable(tableName, columns, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#sql"},"sql(params)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#upsert"},"upsert(table, uuid, record, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#upsertif"},"upsertIf(logical, table, uuid, record, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#upsertmany"},"upsertMany(table, uuid, records, options)"))),(0,l.yg)("p",null,"This adaptor exports the following from common:"),(0,l.yg)("dl",null,(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#alterstate"},"alterState()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#combine"},"combine()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#cursor"},"cursor()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#datapath"},"dataPath()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#datavalue"},"dataValue()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#datefns"},"dateFns")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#each"},"each()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#field"},"field()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#fields"},"fields()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#fn"},"fn()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#fnif"},"fnIf()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#http"},"http")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#lastreferencevalue"},"lastReferenceValue()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#merge"},"merge()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#sourcevalue"},"sourceValue()"))),(0,l.yg)("h2",{id:"functions"},"Functions"),(0,l.yg)("h3",{id:"describetable"},"describeTable"),(0,l.yg)("p",null,(0,l.yg)("code",null,"describeTable(tableName, options) \u21d2 Operation")),(0,l.yg)("p",null,"List the columns of a table in a database."),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"tableName"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The name of the table to describe")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"describeTable('clinic_visits')\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"findvalue"},"findValue"),(0,l.yg)("p",null,(0,l.yg)("code",null,"findValue(filter) \u21d2 Operation")),(0,l.yg)("p",null,"Fetch a uuid key given a condition"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"filter"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"A filter object with the lookup table, a uuid and the condition")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"findValue({\n uuid: 'id',\n relation: 'users',\n where: { first_name: 'Mama%', last_name: 'Cisse'},\n operator: { first_name: 'like', last_name: '='}\n })\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"insert"},"insert"),(0,l.yg)("p",null,(0,l.yg)("code",null,"insert(table, record, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert a record"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"record"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Payload data for the record as a JS object")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"insert(table, record, {setNull: [\"'undefined'\", \"''\"], logValues: false})\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"insertmany"},"insertMany"),(0,l.yg)("p",null,(0,l.yg)("code",null,"insertMany(table, records, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert many records, using the keys of the first as the column template"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"records"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"function")),(0,l.yg)("td",{parentName:"tr",align:null},"A function that takes state and returns an array of records")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"insertMany(table, records, { setNull: false, writeSql: true, logValues: false })\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"inserttable"},"insertTable"),(0,l.yg)("p",null,(0,l.yg)("code",null,"insertTable(tableName, columns, options) \u21d2 Operation")),(0,l.yg)("p",null,"Create a table in database when given an array of columns and a table_name."),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"tableName"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The name of the table to create")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"columns"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"array")),(0,l.yg)("td",{parentName:"tr",align:null},"An array of form columns")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"insertTable('table_name', state => state.data.map(\n column => ({\n name: column.name,\n type: column.type,\n required: true, // optional\n unique: false, // optional - to be set to true for unique constraint\n })\n));\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"modifytable"},"modifyTable"),(0,l.yg)("p",null,(0,l.yg)("code",null,"modifyTable(tableName, columns, options) \u21d2 Operation")),(0,l.yg)("p",null,"Alter an existing table in the database."),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"tableName"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The name of the table to alter")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"columns"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"array")),(0,l.yg)("td",{parentName:"tr",align:null},"An array of form columns")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"modifyTable('table_name', state => state.data.map(\n newColumn => ({\n name: newColumn.name,\n type: newColumn.type,\n required: true, // optional\n unique: false, // optional - to be set to true for unique constraint\n })\n));\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"sql"},"sql"),(0,l.yg)("p",null,(0,l.yg)("code",null,"sql(params) \u21d2 Operation")),(0,l.yg)("p",null,"Execute an SQL statement"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"params"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Payload data for the message")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"sql({ query, options })\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"upsert"},"upsert"),(0,l.yg)("p",null,(0,l.yg)("code",null,"upsert(table, uuid, record, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert or update a record using SQL MERGE"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"uuid"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The uuid column to determine a matching/existing record")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"record"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Payload data for the record as a JS object")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"upsert(table, uuid, record, { setNull: \"'undefined'\", logValues: false})\nupsert(table, [uuid1, uuid2], record, { setNull: \"'undefined'\", logValues: false})\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"upsertif"},"upsertIf"),(0,l.yg)("p",null,(0,l.yg)("code",null,"upsertIf(logical, table, uuid, record, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert or update a record based on a logical condition using ON CONFLICT UPDATE"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"logical"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"a data to check existing value for.")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"uuid"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The uuid column to determine a matching/existing record")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"record"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Payload data for the record as a JS object or function")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"upsertIf(\n dataValue('name'),\n 'users', // the DB table\n 'uuid', // a DB column with a unique constraint\n { name: 'Elodie', id: 7 },\n { writeSql:true, execute: true, logValues: false }\n)\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"upsertmany"},"upsertMany"),(0,l.yg)("p",null,(0,l.yg)("code",null,"upsertMany(table, uuid, records, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert or update multiple records using ON CONFLICT UPDATE and excluded"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"uuid"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The uuid column to determine a matching/existing record")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"records"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"function")),(0,l.yg)("td",{parentName:"tr",align:null},"A function that takes state and returns an array of records")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"upsertMany(\n 'users', 'email', records, { logValues: false }\n)\nupsertMany(\n 'users', ['email', 'phone'], records, { logValues: false }\n)\n")),(0,l.yg)("hr",null))}d.isMDXComponent=!0},15680:(e,a,t)=>{t.d(a,{xA:()=>y,yg:()=>m});var n=t(96540);function l(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function r(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function g(e){for(var a=1;a=0||(l[t]=e[t]);return l}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(l[t]=e[t])}return l}var p=n.createContext({}),u=function(e){var a=n.useContext(p),t=a;return e&&(t="function"==typeof e?e(a):g(g({},a),e)),t},y=function(e){var a=u(e.components);return n.createElement(p.Provider,{value:a},e.children)},i="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},s=n.forwardRef((function(e,a){var t=e.components,l=e.mdxType,r=e.originalType,p=e.parentName,y=o(e,["components","mdxType","originalType","parentName"]),i=u(t),s=l,m=i["".concat(p,".").concat(s)]||i[s]||d[s]||r;return t?n.createElement(m,g(g({ref:a},y),{},{components:t})):n.createElement(m,g({ref:a},y))}));function m(e,a){var t=arguments,l=a&&a.mdxType;if("string"==typeof e||l){var r=t.length,g=new Array(r);g[0]=s;var o={};for(var p in a)hasOwnProperty.call(a,p)&&(o[p]=a[p]);o.originalType=e,o[i]="string"==typeof e?e:l,g[1]=o;for(var u=2;u{t.r(a),t.d(a,{assets:()=>p,contentTitle:()=>g,default:()=>d,frontMatter:()=>r,metadata:()=>o,toc:()=>u});var n=t(58168),l=(t(96540),t(15680));const r={title:"mssql@5.0.4",id:"mssql-docs",keywords:["adaptor","mssql","describeTable","findValue","insert","insertMany","insertTable","modifyTable","sql","upsert","upsertIf","upsertMany"]},g=void 0,o={unversionedId:"packages/mssql-docs",id:"packages/mssql-docs",title:"mssql@5.0.4",description:"describeTable(tableName, options)",source:"@site/adaptors/packages/mssql-docs.md",sourceDirName:"packages",slug:"/packages/mssql-docs",permalink:"/adaptors/packages/mssql-docs",draft:!1,tags:[],version:"current",frontMatter:{title:"mssql@5.0.4",id:"mssql-docs",keywords:["adaptor","mssql","describeTable","findValue","insert","insertMany","insertTable","modifyTable","sql","upsert","upsertIf","upsertMany"]},sidebar:"adaptors",previous:{title:"msgraph developer readme",permalink:"/adaptors/packages/msgraph-readme"},next:{title:"Config for mssql",permalink:"/adaptors/packages/mssql-configuration-schema"}},p={},u=[{value:"Functions",id:"functions",level:2},{value:"describeTable",id:"describetable",level:3},{value:"findValue",id:"findvalue",level:3},{value:"insert",id:"insert",level:3},{value:"insertMany",id:"insertmany",level:3},{value:"insertTable",id:"inserttable",level:3},{value:"modifyTable",id:"modifytable",level:3},{value:"sql",id:"sql",level:3},{value:"upsert",id:"upsert",level:3},{value:"upsertIf",id:"upsertif",level:3},{value:"upsertMany",id:"upsertmany",level:3}],y={toc:u},i="wrapper";function d(e){let{components:a,...t}=e;return(0,l.yg)(i,(0,n.A)({},y,t,{components:a,mdxType:"MDXLayout"}),(0,l.yg)("dl",null,(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#describetable"},"describeTable(tableName, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#findvalue"},"findValue(filter)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#insert"},"insert(table, record, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#insertmany"},"insertMany(table, records, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#inserttable"},"insertTable(tableName, columns, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#modifytable"},"modifyTable(tableName, columns, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#sql"},"sql(params)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#upsert"},"upsert(table, uuid, record, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#upsertif"},"upsertIf(logical, table, uuid, record, options)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#upsertmany"},"upsertMany(table, uuid, records, options)"))),(0,l.yg)("p",null,"This adaptor exports the following from common:"),(0,l.yg)("dl",null,(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#alterstate"},"alterState()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#combine"},"combine()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#cursor"},"cursor()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#datapath"},"dataPath()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#datavalue"},"dataValue()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#datefns"},"dateFns")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#each"},"each()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#field"},"field()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#fields"},"fields()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#fn"},"fn()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#fnif"},"fnIf()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#http"},"http")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#lastreferencevalue"},"lastReferenceValue()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#merge"},"merge()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#sourcevalue"},"sourceValue()"))),(0,l.yg)("h2",{id:"functions"},"Functions"),(0,l.yg)("h3",{id:"describetable"},"describeTable"),(0,l.yg)("p",null,(0,l.yg)("code",null,"describeTable(tableName, options) \u21d2 Operation")),(0,l.yg)("p",null,"List the columns of a table in a database."),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"tableName"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The name of the table to describe")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"describeTable('clinic_visits')\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"findvalue"},"findValue"),(0,l.yg)("p",null,(0,l.yg)("code",null,"findValue(filter) \u21d2 Operation")),(0,l.yg)("p",null,"Fetch a uuid key given a condition"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"filter"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"A filter object with the lookup table, a uuid and the condition")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"findValue({\n uuid: 'id',\n relation: 'users',\n where: { first_name: 'Mama%', last_name: 'Cisse'},\n operator: { first_name: 'like', last_name: '='}\n })\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"insert"},"insert"),(0,l.yg)("p",null,(0,l.yg)("code",null,"insert(table, record, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert a record"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"record"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Payload data for the record as a JS object")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"insert(table, record, {setNull: [\"'undefined'\", \"''\"], logValues: false})\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"insertmany"},"insertMany"),(0,l.yg)("p",null,(0,l.yg)("code",null,"insertMany(table, records, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert many records, using the keys of the first as the column template"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"records"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"function")),(0,l.yg)("td",{parentName:"tr",align:null},"A function that takes state and returns an array of records")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"insertMany(table, records, { setNull: false, writeSql: true, logValues: false })\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"inserttable"},"insertTable"),(0,l.yg)("p",null,(0,l.yg)("code",null,"insertTable(tableName, columns, options) \u21d2 Operation")),(0,l.yg)("p",null,"Create a table in database when given an array of columns and a table_name."),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"tableName"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The name of the table to create")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"columns"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"array")),(0,l.yg)("td",{parentName:"tr",align:null},"An array of form columns")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"insertTable('table_name', state => state.data.map(\n column => ({\n name: column.name,\n type: column.type,\n required: true, // optional\n unique: false, // optional - to be set to true for unique constraint\n })\n));\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"modifytable"},"modifyTable"),(0,l.yg)("p",null,(0,l.yg)("code",null,"modifyTable(tableName, columns, options) \u21d2 Operation")),(0,l.yg)("p",null,"Alter an existing table in the database."),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"tableName"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The name of the table to alter")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"columns"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"array")),(0,l.yg)("td",{parentName:"tr",align:null},"An array of form columns")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"modifyTable('table_name', state => state.data.map(\n newColumn => ({\n name: newColumn.name,\n type: newColumn.type,\n required: true, // optional\n unique: false, // optional - to be set to true for unique constraint\n })\n));\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"sql"},"sql"),(0,l.yg)("p",null,(0,l.yg)("code",null,"sql(params) \u21d2 Operation")),(0,l.yg)("p",null,"Execute an SQL statement"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"params"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Payload data for the message")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"sql({ query, options })\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"upsert"},"upsert"),(0,l.yg)("p",null,(0,l.yg)("code",null,"upsert(table, uuid, record, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert or update a record using SQL MERGE"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"uuid"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The uuid column to determine a matching/existing record")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"record"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Payload data for the record as a JS object")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"upsert(table, uuid, record, { setNull: \"'undefined'\", logValues: false})\nupsert(table, [uuid1, uuid2], record, { setNull: \"'undefined'\", logValues: false})\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"upsertif"},"upsertIf"),(0,l.yg)("p",null,(0,l.yg)("code",null,"upsertIf(logical, table, uuid, record, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert or update a record based on a logical condition using ON CONFLICT UPDATE"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"logical"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"a data to check existing value for.")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"uuid"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The uuid column to determine a matching/existing record")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"record"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Payload data for the record as a JS object or function")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"upsertIf(\n dataValue('name'),\n 'users', // the DB table\n 'uuid', // a DB column with a unique constraint\n { name: 'Elodie', id: 7 },\n { writeSql:true, execute: true, logValues: false }\n)\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"upsertmany"},"upsertMany"),(0,l.yg)("p",null,(0,l.yg)("code",null,"upsertMany(table, uuid, records, options) \u21d2 Operation")),(0,l.yg)("p",null,"Insert or update multiple records using ON CONFLICT UPDATE and excluded"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"table"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The target table")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"uuid"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"The uuid column to determine a matching/existing record")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"records"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"function")),(0,l.yg)("td",{parentName:"tr",align:null},"A function that takes state and returns an array of records")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"options"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional options argument")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"upsertMany(\n 'users', 'email', records, { logValues: false }\n)\nupsertMany(\n 'users', ['email', 'phone'], records, { logValues: false }\n)\n")),(0,l.yg)("hr",null))}d.isMDXComponent=!0},15680:(e,a,t)=>{t.d(a,{xA:()=>y,yg:()=>m});var n=t(96540);function l(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function r(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function g(e){for(var a=1;a=0||(l[t]=e[t]);return l}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(l[t]=e[t])}return l}var p=n.createContext({}),u=function(e){var a=n.useContext(p),t=a;return e&&(t="function"==typeof e?e(a):g(g({},a),e)),t},y=function(e){var a=u(e.components);return n.createElement(p.Provider,{value:a},e.children)},i="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},s=n.forwardRef((function(e,a){var t=e.components,l=e.mdxType,r=e.originalType,p=e.parentName,y=o(e,["components","mdxType","originalType","parentName"]),i=u(t),s=l,m=i["".concat(p,".").concat(s)]||i[s]||d[s]||r;return t?n.createElement(m,g(g({ref:a},y),{},{components:t})):n.createElement(m,g({ref:a},y))}));function m(e,a){var t=arguments,l=a&&a.mdxType;if("string"==typeof e||l){var r=t.length,g=new Array(r);g[0]=s;var o={};for(var p in a)hasOwnProperty.call(a,p)&&(o[p]=a[p]);o.originalType=e,o[i]="string"==typeof e?e:l,g[1]=o;for(var u=2;u{t.r(r),t.d(r,{assets:()=>s,contentTitle:()=>p,default:()=>m,frontMatter:()=>o,metadata:()=>i,toc:()=>c});var n=t(58168),a=(t(96540),t(15680));const o={title:"msgraph developer readme",id:"msgraph-readme",keywords:["adaptor","readme","msgraph"]},p="msgraph Adaptor developer README.md",i={unversionedId:"packages/msgraph-readme",id:"packages/msgraph-readme",title:"msgraph developer readme",description:"Source//github.com/OpenFn/adaptors/tree/main/packages/msgraph",source:"@site/adaptors/packages/msgraph-readme.md",sourceDirName:"packages",slug:"/packages/msgraph-readme",permalink:"/adaptors/packages/msgraph-readme",draft:!1,tags:[],version:"current",frontMatter:{title:"msgraph developer readme",id:"msgraph-readme",keywords:["adaptor","readme","msgraph"]},sidebar:"adaptors",previous:{title:"msgraph changelog",permalink:"/adaptors/packages/msgraph-changelog"},next:{title:"mssql@5.0.3",permalink:"/adaptors/packages/mssql-docs"}},s={},c=[{value:"Documentation",id:"documentation",level:2},{value:"Configuration",id:"configuration",level:3},{value:"Development",id:"development",level:2}],g={toc:c},l="wrapper";function m(e){let{components:r,...t}=e;return(0,a.yg)(l,(0,n.A)({},g,t,{components:r,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"msgraph-adaptor-developer-readmemd"},"msgraph Adaptor developer README.md"),(0,a.yg)("p",null,"Source: ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/adaptors/tree/main/packages/msgraph"},"https://github.com/OpenFn/adaptors/tree/main/packages/msgraph")),(0,a.yg)("h1",{id:"language-msgraph-"},"language-msgraph ",(0,a.yg)("img",{src:"assets/sq-256x256.png",width:"30",height:"30"})),(0,a.yg)("p",null,"An OpenFn ",(0,a.yg)("strong",{parentName:"p"},(0,a.yg)("em",{parentName:"strong"},"adaptor"))," for building integration jobs for use with the\n",(0,a.yg)("a",{parentName:"p",href:"https://learn.microsoft.com/en-us/graph/use-the-api"},"Microsoft Graph API"),"."),(0,a.yg)("h2",{id:"documentation"},"Documentation"),(0,a.yg)("p",null,"View the ",(0,a.yg)("a",{parentName:"p",href:"https://docs.openfn.org/adaptors/packages/msgraph-docs"},"docs site")," for\nfull technical documentation."),(0,a.yg)("h3",{id:"configuration"},"Configuration"),(0,a.yg)("p",null,"View the\n",(0,a.yg)("a",{parentName:"p",href:"https://docs.openfn.org/adaptors/packages/msgraph-configuration-schema/"},"configuration-schema"),"\nfor required and optional ",(0,a.yg)("inlineCode",{parentName:"p"},"configuration")," properties."),(0,a.yg)("h2",{id:"development"},"Development"),(0,a.yg)("p",null,"Clone the ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/adaptors"},"adaptors monorepo"),'. Follow the\n"Getting Started" guide inside to get set up.'),(0,a.yg)("p",null,"Run tests using ",(0,a.yg)("inlineCode",{parentName:"p"},"pnpm run test")," or ",(0,a.yg)("inlineCode",{parentName:"p"},"pnpm run test:watch")),(0,a.yg)("p",null,"Build the project using ",(0,a.yg)("inlineCode",{parentName:"p"},"pnpm build"),"."),(0,a.yg)("p",null,"To build ",(0,a.yg)("em",{parentName:"p"},"only")," the docs run ",(0,a.yg)("inlineCode",{parentName:"p"},"pnpm build docs"),"."))}m.isMDXComponent=!0},15680:(e,r,t)=>{t.d(r,{xA:()=>g,yg:()=>u});var n=t(96540);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function p(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),c=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):p(p({},r),e)),t},g=function(e){var r=c(e.components);return n.createElement(s.Provider,{value:r},e.children)},l="mdxType",m={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},d=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,g=i(e,["components","mdxType","originalType","parentName"]),l=c(t),d=a,u=l["".concat(s,".").concat(d)]||l[d]||m[d]||o;return t?n.createElement(u,p(p({ref:r},g),{},{components:t})):n.createElement(u,p({ref:r},g))}));function u(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var o=t.length,p=new Array(o);p[0]=d;var i={};for(var s in r)hasOwnProperty.call(r,s)&&(i[s]=r[s]);i.originalType=e,i[l]="string"==typeof e?e:a,p[1]=i;for(var c=2;c{t.r(r),t.d(r,{assets:()=>s,contentTitle:()=>p,default:()=>m,frontMatter:()=>o,metadata:()=>i,toc:()=>c});var n=t(58168),a=(t(96540),t(15680));const o={title:"msgraph developer readme",id:"msgraph-readme",keywords:["adaptor","readme","msgraph"]},p="msgraph Adaptor developer README.md",i={unversionedId:"packages/msgraph-readme",id:"packages/msgraph-readme",title:"msgraph developer readme",description:"Source//github.com/OpenFn/adaptors/tree/main/packages/msgraph",source:"@site/adaptors/packages/msgraph-readme.md",sourceDirName:"packages",slug:"/packages/msgraph-readme",permalink:"/adaptors/packages/msgraph-readme",draft:!1,tags:[],version:"current",frontMatter:{title:"msgraph developer readme",id:"msgraph-readme",keywords:["adaptor","readme","msgraph"]},sidebar:"adaptors",previous:{title:"msgraph changelog",permalink:"/adaptors/packages/msgraph-changelog"},next:{title:"mssql@5.0.4",permalink:"/adaptors/packages/mssql-docs"}},s={},c=[{value:"Documentation",id:"documentation",level:2},{value:"Configuration",id:"configuration",level:3},{value:"Development",id:"development",level:2}],g={toc:c},l="wrapper";function m(e){let{components:r,...t}=e;return(0,a.yg)(l,(0,n.A)({},g,t,{components:r,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"msgraph-adaptor-developer-readmemd"},"msgraph Adaptor developer README.md"),(0,a.yg)("p",null,"Source: ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/adaptors/tree/main/packages/msgraph"},"https://github.com/OpenFn/adaptors/tree/main/packages/msgraph")),(0,a.yg)("h1",{id:"language-msgraph-"},"language-msgraph ",(0,a.yg)("img",{src:"assets/sq-256x256.png",width:"30",height:"30"})),(0,a.yg)("p",null,"An OpenFn ",(0,a.yg)("strong",{parentName:"p"},(0,a.yg)("em",{parentName:"strong"},"adaptor"))," for building integration jobs for use with the\n",(0,a.yg)("a",{parentName:"p",href:"https://learn.microsoft.com/en-us/graph/use-the-api"},"Microsoft Graph API"),"."),(0,a.yg)("h2",{id:"documentation"},"Documentation"),(0,a.yg)("p",null,"View the ",(0,a.yg)("a",{parentName:"p",href:"https://docs.openfn.org/adaptors/packages/msgraph-docs"},"docs site")," for\nfull technical documentation."),(0,a.yg)("h3",{id:"configuration"},"Configuration"),(0,a.yg)("p",null,"View the\n",(0,a.yg)("a",{parentName:"p",href:"https://docs.openfn.org/adaptors/packages/msgraph-configuration-schema/"},"configuration-schema"),"\nfor required and optional ",(0,a.yg)("inlineCode",{parentName:"p"},"configuration")," properties."),(0,a.yg)("h2",{id:"development"},"Development"),(0,a.yg)("p",null,"Clone the ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/adaptors"},"adaptors monorepo"),'. Follow the\n"Getting Started" guide inside to get set up.'),(0,a.yg)("p",null,"Run tests using ",(0,a.yg)("inlineCode",{parentName:"p"},"pnpm run test")," or ",(0,a.yg)("inlineCode",{parentName:"p"},"pnpm run test:watch")),(0,a.yg)("p",null,"Build the project using ",(0,a.yg)("inlineCode",{parentName:"p"},"pnpm build"),"."),(0,a.yg)("p",null,"To build ",(0,a.yg)("em",{parentName:"p"},"only")," the docs run ",(0,a.yg)("inlineCode",{parentName:"p"},"pnpm build docs"),"."))}m.isMDXComponent=!0},15680:(e,r,t)=>{t.d(r,{xA:()=>g,yg:()=>u});var n=t(96540);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function p(e){for(var r=1;r=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=n.createContext({}),c=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):p(p({},r),e)),t},g=function(e){var r=c(e.components);return n.createElement(s.Provider,{value:r},e.children)},l="mdxType",m={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},d=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,g=i(e,["components","mdxType","originalType","parentName"]),l=c(t),d=a,u=l["".concat(s,".").concat(d)]||l[d]||m[d]||o;return t?n.createElement(u,p(p({ref:r},g),{},{components:t})):n.createElement(u,p({ref:r},g))}));function u(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var o=t.length,p=new Array(o);p[0]=d;var i={};for(var s in r)hasOwnProperty.call(r,s)&&(i[s]=r[s]);i.originalType=e,i[l]="string"==typeof e?e:a,p[1]=i;for(var c=2;c{"use strict";var e,f,c,a,b,d={},r={};function t(e){var f=r[e];if(void 0!==f)return f.exports;var c=r[e]={id:e,loaded:!1,exports:{}};return d[e].call(c.exports,c,c.exports,t),c.loaded=!0,c.exports}t.m=d,t.c=r,e=[],t.O=(f,c,a,b)=>{if(!c){var d=1/0;for(n=0;n=b)&&Object.keys(t.O).every((e=>t.O[e](c[o])))?c.splice(o--,1):(r=!1,b0&&e[n-1][2]>b;n--)e[n]=e[n-1];e[n]=[c,a,b]},t.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return t.d(f,{a:f}),f},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var b=Object.create(null);t.r(b);var d={};f=f||[null,c({}),c([]),c(c)];for(var r=2&a&&e;"object"==typeof r&&!~f.indexOf(r);r=c(r))Object.getOwnPropertyNames(r).forEach((f=>d[f]=()=>e[f]));return d.default=()=>e,t.d(b,d),b},t.d=(e,f)=>{for(var c in f)t.o(f,c)&&!t.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:f[c]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce(((f,c)=>(t.f[c](e,f),f)),[])),t.u=e=>"assets/js/"+({182:"d1e2a1e4",185:"56b2a431",414:"6af54863",535:"5153790b",825:"8fa4918e",1100:"fec351f2",1101:"d04fedb5",1102:"1ef0096b",1104:"5f0cc255",1212:"734563d5",1281:"dc62dd6c",1356:"e967512d",1372:"e480871d",1511:"b1be30d1",1705:"cd8c9fbc",1905:"9d4548fb",2280:"e51254c6",2782:"0e04b402",2928:"125cb29e",2959:"33fb6ca4",3181:"a9d16e82",3237:"b987a5c1",3296:"a555a233",3336:"f98b80b4",3392:"reactPlayerVidyard",3430:"cee49d1f",3482:"186444dd",3663:"def6dfb9",3704:"d9a6c9f9",3970:"133b4df0",4207:"81eac5d3",4212:"e866f873",4343:"419e73d5",4501:"8dc27084",4711:"81e594d4",5387:"4c2772ab",5456:"d4e06cde",5661:"5d42a18a",5731:"5610898c",5843:"e6102057",5931:"998a3ebe",5933:"fe66a3bc",6014:"babb54f3",6308:"af1b4014",6379:"cd910537",6463:"reactPlayerKaltura",6580:"fae4f913",6615:"e3a6d1ec",6914:"2c828998",6947:"898d2911",7031:"ffa0c411",7129:"ce5aebf3",7284:"0918a7cd",7408:"b31fa192",7658:"bb8cf488",7684:"193bf152",7727:"92e661e4",7795:"20501ae4",8035:"89ebc8eb",8041:"d44f5d69",8063:"ea0d3e91",8094:"77faeb23",8132:"c4429c79",8209:"01a85c17",8229:"a13b9d31",8275:"e2548c92",8580:"f7d07906",8890:"4cd34504",8945:"4ba520f6",9246:"9bb632fa",9455:"6e9a1c5f",9604:"3035a8de",9669:"277d517a",10037:"14ee1fe9",10211:"524c9166",10278:"5385774b",10373:"5f0700c5",10390:"7356945f",10588:"f93f95da",10711:"85f847a7",10909:"60ab92b2",11084:"75270caf",11133:"a20e070a",11430:"0564f87a",11662:"2bf9c0b5",11681:"74ea6b63",11840:"5fb0ec3e",11841:"fe1d477d",11845:"da184dc1",11991:"b2b675dd",12042:"reactPlayerTwitch",12095:"9e96f049",12236:"f50ed874",12287:"acfb9a5e",12384:"22ef07eb",12417:"c6fe0741",12693:"c333ed9f",12865:"3f2ad086",12893:"e4a50065",13067:"81ce5e0c",13278:"a2e81b6d",13388:"5f6910fd",13446:"d015beca",13708:"09b23959",13755:"a3efb982",13949:"eb4eb408",14102:"2a413a18",14167:"aacecf0a",14340:"2dcd28d2",14382:"5f87d652",14690:"44ea6f94",14712:"db759789",14736:"330b8ea1",14833:"46bd2088",15045:"14ad7d65",15388:"fe5f889f",15476:"14709bd0",15548:"247783bb",16055:"7b9ab678",16145:"58cbfb5a",16328:"reactPlayerDailyMotion",16458:"a14a2602",16476:"3a03215d",16680:"2bb14bf0",17051:"6738a51a",17150:"6cb21577",17357:"1140a058",17363:"6310fd48",17434:"9e1f7384",17464:"7fdc0c84",17572:"3947b16e",17794:"f5ff4ddf",18042:"36ded102",18401:"17896441",18446:"reactPlayerYouTube",18509:"48052ce1",18583:"60b808f2",18613:"ece86388",18756:"1ee9c635",18790:"92999a1c",19053:"82092fc0",19121:"3a574a7f",19290:"9afa6cde",19520:"f2ca2c55",19523:"deb190e6",19672:"203262b0",19702:"8f8e3a33",19724:"b1f7255a",19873:"aa1b4e53",20041:"81c93763",20097:"e7b8679f",20118:"90377122",20212:"5f16d91a",20341:"11e6d144",20363:"63eaaafc",20420:"e2c3bc5f",20446:"5e1dea11",20562:"853ddb5d",20574:"126d2d8d",20774:"fc5ff77a",21058:"ea369cdd",21157:"abb76970",21300:"2e5976f3",21528:"6556faa5",21596:"a54058d6",22362:"5e95c167",22598:"1f86786a",22708:"8d1ec4c5",22749:"471dcc6f",22805:"e310b146",22869:"374427da",22874:"d8d13bad",23060:"7a801707",23475:"0a6f29e5",23476:"239ea6cd",23558:"68cedfd5",23597:"1a848321",23673:"5f1113d5",23686:"97a69baf",23717:"3a06bd86",24029:"11451be3",24066:"2f4b7a65",24144:"406b186f",24165:"07e96687",24285:"507e1a4c",24490:"06b1e92d",24724:"823f7700",24785:"853164ef",24880:"20f8de15",24981:"db6367fb",24998:"dfd4abb8",25275:"cb128a98",25474:"4aa43dae",25596:"122cd6da",25789:"ef4e0518",25908:"9ee43f4e",25948:"febd0338",25960:"341bd61f",26025:"e56b7427",26173:"reactPlayerVimeo",26529:"30ddeb5e",26933:"89594773",27098:"3874af3e",27153:"f77b4e82",27431:"0a61bc2e",27570:"070789e7",27572:"207ee67a",27721:"c0daf1e6",28109:"e0c8a1d6",28356:"4f0c7b96",28505:"d879ea04",28681:"1abd0bca",28968:"59b068d1",29010:"8e37cc44",29214:"f3954950",29225:"29cfecd2",29263:"36a143db",29286:"20a7d97c",29632:"7ee80f24",29664:"60a00565",29780:"7b20acf0",29891:"45b3f811",30044:"e1d93203",30165:"437618c4",30312:"614beed4",30491:"0c8b9afa",30521:"45b0764f",30650:"d6bd25e1",31136:"960d9980",31153:"1c091541",31472:"fa811662",31586:"8e97cc15",31805:"5e450bcf",31863:"caaf01d4",31883:"421999d2",32349:"a1b695db",32450:"c302b7f6",32452:"bd83a8c8",32736:"3bc428dc",32840:"3cf47477",32909:"c6cf652c",32946:"4aaa0f44",33015:"5575e2a8",33188:"bfb1735a",33656:"31d20e13",34037:"f6525c87",34149:"b69843a1",34270:"cc826739",34290:"a6a264d3",34446:"b1212599",34465:"fcdeb347",34467:"9b3efc75",34483:"b5efef1d",34533:"d6247adb",34720:"0452e1bb",35080:"af4b7be4",35448:"7b2e7fac",35491:"a7ce3f25",35502:"565d3b3a",35580:"d4c834e8",35632:"dff30c03",35634:"c6dfd94e",35635:"ecfe8209",35659:"4646a8a4",35739:"f2f7c8b6",36138:"bebb13e1",36192:"85c49f6d",36353:"reactPlayerPreview",36496:"12ebab0f",36638:"25057d02",36659:"e0ecd9df",36729:"96781795",36732:"3cc638e0",36904:"ffecbc46",36949:"ab0b43f0",37068:"4ef2e3ea",37109:"8ee77415",37119:"bd6858b9",37146:"22885a83",37507:"e4608243",37555:"e202e776",37643:"a6aa9e1f",37762:"89f741ca",37878:"845a8f5b",37943:"512d8cfa",38012:"274548c6",38193:"741a738c",38368:"b3022338",38389:"50711b5c",38440:"27e17dc0",38456:"c4643d70",38588:"f9dcbd56",38916:"cab54053",38991:"2db499ae",38992:"903c4f6f",38999:"53371809",39143:"186b492d",39311:"b85e9339",39646:"c7bf2a3a",39839:"e150ab3e",39928:"9b770ac0",39954:"8f102ef9",40069:"70b40441",40200:"d40361ad",40810:"0475f9cc",40817:"c0908e63",40953:"5b5d0fd6",40960:"bd8e6ec6",41015:"eec2ee36",41305:"1de77d44",41309:"6620b2c9",41738:"28411ba4",41811:"e7db057b",41829:"1f704a03",41838:"d98b9f83",41857:"37c880e2",42007:"4b75119c",42068:"9997aecf",42518:"c968f1a3",42717:"77e868d9",42795:"cc8c6322",42869:"6850cfb6",42919:"09a69b27",43067:"1e5c0d86",43181:"519cbeed",43318:"554f4bd3",43478:"3f85e7e0",43514:"dc72610b",43895:"073713d1",44146:"f24f0ea5",44502:"069211c5",44570:"d493c3e8",44596:"8256726e",45197:"6f69b847",45501:"da6f85e6",45612:"62b71d38",45747:"1ddde2c7",45826:"783bde4f",45894:"61428574",45966:"5426ac11",46084:"e5e83212",46105:"7778b814",46160:"216be533",46244:"771488fd",46447:"0210b704",46610:"20a5a532",46646:"88b398be",46666:"c08d79e7",46708:"32723a2e",46878:"56d56511",46985:"fcfb247d",46995:"c831614b",47055:"36788d15",47627:"reactPlayerStreamable",47752:"661132b8",47946:"e3450ac4",48035:"708cde07",48099:"10647879",48131:"4cff7ce2",48155:"ced1473c",48253:"ba11d205",48402:"097f4186",48543:"34bbb05d",48612:"cce9ad1c",48684:"9f91e03b",48721:"1074bb26",48806:"479e2d15",48965:"6d0c6131",49076:"208114e0",49183:"256aaf6c",49195:"1a98f2d5",49359:"984b8319",49440:"f30a3d1e",49471:"c77a0576",49534:"d2227473",49635:"33e1509d",49724:"a9bffa51",49733:"de4aaf36",49942:"bae79ca1",49945:"459956dd",50074:"5dfb628f",50213:"2158648d",50370:"1d48afb9",50371:"f08e269d",50685:"c2367e06",50739:"aa9c90f7",50816:"b198cec2",51093:"2f48bebc",51725:"890759ea",51739:"12f62dc2",51845:"c4fd3761",52074:"33844ff3",52165:"94c68899",52634:"c4f5d8e4",52711:"9e4087bc",52723:"reactPlayerMux",52761:"28a6a789",53434:"90d535c2",53440:"5efe417b",53446:"1bf956b0",54366:"1a43e018",54374:"bab68f7e",54386:"45062c3f",54422:"ec576a8b",54522:"14a767b9",54535:"1e27a2df",54602:"954fe712",54708:"2f989304",54770:"9e339b71",54785:"3c41cfdf",54829:"444d5ed4",54880:"1e26ddab",54986:"6a3a4a87",55169:"a3f9e536",55420:"fa746f0e",55528:"77354108",55580:"665c23b8",55603:"7d5cf9fd",55621:"d5e8cc91",55662:"bc4d6fc9",55673:"9d36e504",55938:"669b0b95",55939:"2e7fdd6f",56188:"a12f1ef9",56359:"e57c1bef",56444:"f76e6047",56683:"82453b48",56787:"c2d7f837",56886:"283e63f8",56918:"10eaf6bf",57062:"6c5c20d6",57277:"050638ff",57396:"cd7cc5b2",57436:"c85c4b26",57532:"8e0ad159",58236:"55ac83aa",58290:"e4f4dec4",58319:"45a8dc52",58382:"3e1cef53",58419:"4e3d1533",58424:"6bf3b56c",58548:"c64ebc62",58565:"e8b14a65",58581:"b3198ac5",58694:"d3433875",58700:"6fa39f86",59154:"6a6b8e69",59289:"eae3fa10",59569:"10915d97",59584:"776f5947",59612:"c3c79e6c",59644:"677d6777",59783:"450c527f",59919:"b973dcfd",60383:"2fd22369",60439:"acf97486",60473:"c1a814bd",60680:"1d970e9f",60785:"1b3816a8",60830:"9915a91d",61153:"08e43170",61316:"92bdb8f4",61321:"d3b3aab8",61377:"7a8aa347",61517:"5c7af219",61556:"39e9cb37",61611:"a6748c3f",61806:"3d5c28b0",61990:"f13ea377",62071:"1af9c7d3",62138:"1a4e3797",62224:"cce23dfc",62318:"24a5cb68",62590:"6ee59393",62608:"83170ae2",62630:"271f7228",62684:"f615a51d",62864:"60194cf2",62959:"3685f909",62998:"fba9f625",63267:"2127c55a",63288:"1c7cc376",63380:"4f989fdc",63399:"cc3db60c",63493:"608d3bbe",63720:"291e387f",63761:"500fb0e6",63817:"ede583c5",63877:"699a47d0",63924:"fe36bf36",63993:"cfc8229c",64078:"aea1a378",64196:"ed03f5d4",64293:"b0055554",64455:"861bd1f8",64534:"7d8e4827",64542:"97bb0f58",64604:"c3a6b316",64631:"237f254e",64678:"99d25280",64917:"b50d6289",64922:"e19908fc",64972:"d5bc6e48",65250:"6479f562",65541:"f5d5b73d",65664:"12f94a3a",65767:"8eb4e46b",65856:"15d749b5",65872:"3e171e78",65958:"e709bacf",66227:"8977ff65",66248:"4549cb79",66290:"0018b769",66352:"89c724a9",66435:"34298da9",66455:"964386c1",66578:"342f32a4",66814:"8660c4b6",66886:"8ed61535",66939:"4f8f7d74",67109:"a8faecbd",67351:"39906be8",67472:"814f3328",67570:"reactPlayerMixcloud",67714:"7f0b639b",67796:"afbc2852",67882:"8d6bb331",68063:"e2c66a78",68074:"13a2a5ae",68371:"29bb06c8",68495:"747a690f",68670:"b6379448",68749:"c2be96f9",68773:"55bb925b",68795:"b083e7a6",68831:"7f2f79c2",68951:"1ff7f4b8",69445:"6de65b44",69693:"1385f2e4",69738:"acd02317",69979:"reactPlayerSoundCloud",69987:"dbbfaad4",70001:"723d2f26",70092:"afd0cb1b",70131:"22ff6767",70321:"029e4dc3",70612:"4980c4fa",70804:"03cd8e1c",70806:"ef9227ec",70897:"a8c84974",71298:"bc07532a",71317:"6d30ac0a",71333:"94b64e1c",71494:"4224ef00",71500:"1e9ef283",71659:"f2b4d23e",71753:"57fbf2bd",71760:"0d1eeea0",71886:"0f427d40",72211:"30995fb4",72482:"5ffd6909",72637:"b37711b1",72700:"869c9c27",72795:"4bff3e73",72825:"31b72ec5",72844:"dd13b434",72920:"a22153eb",72969:"385718d4",73609:"83218c8a",73718:"fb5b11b0",73765:"5bcd0da1",73889:"868893ac",73936:"7f6bbd73",74276:"fd5d515c",74307:"8b77e1a5",74391:"352bf367",74484:"035d0344",74661:"c942fcda",74673:"5ede04c0",74801:"8b0d3319",74944:"006fd865",75055:"c3a5a911",75120:"f77d5673",75132:"4256eaf4",76023:"cb759659",76073:"a5fe4d7b",76152:"78469ba2",76206:"9da9a498",76354:"aae0663e",76777:"4649e1c2",76829:"8328e7f1",76903:"cabfe087",76939:"05e78500",77751:"69802526",77759:"e802237a",77800:"68987ad2",77849:"4b2ec4d2",78131:"3062d10d",78207:"f9ed4079",78417:"cc135780",78564:"a5bc4f28",78682:"916b8fda",78959:"f13d29f3",78960:"40fd761e",78997:"de387681",79074:"6f4af312",79156:"b1ecb9ed",79234:"1954649e",79566:"b2b9b866",79709:"4a487c7d",79957:"f5fdaecd",79985:"d776f897",80218:"bb40a730",80375:"ea07b8e0",80495:"ed48b979",80614:"73578edf",80665:"3124230e",80722:"fa9fb131",80878:"c76eb7d5",81057:"f5466782",81084:"16aa9458",81202:"c3b63204",81271:"84810683",81397:"75d9ae63",81470:"199fcd36",81471:"02371d76",81678:"a7434565",81707:"4ef508e9",81784:"97feb4e9",81820:"31c4e4e2",81844:"bfbf9dff",81886:"9eb4e0db",81930:"8310c4f6",81948:"dc14f0c4",82214:"f64a2f66",82230:"2f06f2be",82277:"0b31129f",82284:"8435c5ad",82402:"c275b7b1",82646:"4cbb880b",82698:"75ae40a4",82925:"78b226dc",83071:"a817f8e6",83164:"e19d86f2",83249:"ccc49370",83261:"5cecf783",83331:"c2d56c21",83556:"7b81a468",83855:"67c4a832",84164:"ffc1986f",84190:"1d01589c",84398:"1cd349ba",84778:"4f3e32ec",84813:"6875c492",84877:"833f2ec0",85159:"4be7e5d0",85186:"5653e10f",85196:"86b52bb0",85247:"e175f9f3",85732:"60f1bcf9",85864:"3d8bf3ab",86398:"0c6d1616",86537:"d9cb599e",86595:"55cceff7",86757:"326c0af7",86887:"reactPlayerFacebook",86944:"3f45f80c",86963:"d523bad7",87118:"c541efc4",87251:"6bb55549",87284:"460d220e",87592:"5fa25c43",87683:"879bb888",87733:"6aa8733e",87791:"cfba059f",87817:"5c0c3c72",87970:"403863d9",88007:"d1c7c525",88021:"9bf3c520",88199:"5e1c9ef2",88318:"b6997bf2",88462:"fca34444",88501:"d40de319",88572:"43f8b4ce",88714:"1be78505",88963:"f5f1347d",89267:"a7023ddc",89588:"376ff700",89729:"c0f0637e",89737:"87d0342b",89816:"5de53f8e",89831:"919ee986",89840:"fbcdd0ee",89915:"f7c12f45",89963:"f7765531",90023:"f38541c0",90575:"e436cfad",90776:"64ec14d2",90892:"92af7f04",91045:"192eff61",91195:"7a35092c",91288:"6536e94a",91384:"5a047bf8",91772:"b942cf8e",92058:"8446e86b",92273:"65e8e75e",92275:"6c8cf0bf",92282:"7cb85c78",92648:"d88d25ac",93019:"8e10bb86",93040:"60e9e07a",93133:"6680323d",93255:"29a36bd7",93488:"b5bd7f9b",93639:"f3f3787d",93744:"6ccb7d3e",93963:"8e40e0a9",94082:"d060dfa6",94183:"54e91ab5",94248:"07987921",94328:"9c1835bf",94381:"26c54994",94395:"c98ac358",94603:"fa56ac42",94617:"a9d6ad8a",95088:"1578031d",95155:"233cd645",95182:"92009f0a",95183:"ef4780b0",95406:"d80cee7e",95638:"96ecf107",95894:"b2f554cd",95919:"87a2f1fc",95924:"9f0412f1",96039:"f48233a1",96092:"bd16d6fd",96095:"f259cf74",96296:"3fa9568c",96431:"dc819e53",96632:"371b21cb",96752:"f7f75c2e",96886:"a0799a2b",96998:"21b56577",97026:"285ad496",97061:"ea642db2",97202:"a9808524",97215:"80a6599d",97342:"ceb3f8e5",97450:"c260b9a0",97458:"reactPlayerFilePlayer",97543:"c5495231",97788:"38eccbde",97823:"2d52fc42",97891:"a03f8b02",97902:"d0ac1c30",98196:"bcf9457e",98197:"2d68e16b",98230:"13c3e084",98581:"935f2afb",98632:"84c1f0c8",98952:"c1dc13d0",98982:"0f438a70",99017:"0a451647",99340:"reactPlayerWistia",99426:"d61e8580",99687:"5ad12221",99762:"a69ebe5f",99924:"c4816122",99965:"1280552c"}[e]||e)+"."+{182:"901c7010",185:"c3151af5",414:"4bac948a",535:"2c29b462",825:"62089cb8",1100:"0d6eafb4",1101:"83e3b7a6",1102:"df8651a8",1104:"d4a6bf4c",1212:"a4bb5879",1281:"198643f3",1356:"aaffa684",1372:"afac1084",1468:"a90a2be2",1511:"968319a4",1705:"68cbc15a",1905:"7dd3f501",2280:"0532f8f9",2782:"0909c8f8",2928:"a3c25052",2959:"96e1a6c0",3181:"0b13f711",3237:"db39c0e1",3296:"f106e1ad",3336:"55759329",3392:"090f5cb6",3430:"28e262ec",3482:"de7091dd",3663:"fb3a8aa4",3704:"761ae3ae",3970:"a07332e7",4207:"979cb569",4212:"55743104",4343:"0d8d5955",4501:"f1e3909f",4711:"5b0e777a",5387:"713cacd0",5456:"e9f5e759",5661:"cb663b51",5731:"d86813b9",5843:"856df5f6",5931:"2f753b36",5933:"d3ce1ef1",6014:"280eb338",6308:"1849bc06",6379:"02aafd26",6463:"600fc725",6580:"191e9ee5",6615:"959436a5",6914:"f3614784",6947:"3e234339",7031:"fcec0565",7129:"64959eb0",7284:"7f61149c",7408:"8098b950",7658:"6d443338",7684:"15bfc5ba",7727:"0239a7e9",7795:"8c050ec9",7996:"d3ea57ae",8035:"30e98b35",8041:"88220dec",8063:"ae462a39",8094:"2b951bdc",8132:"9b5f7c95",8209:"78a1e894",8229:"4d7d71b8",8275:"fd21aea9",8580:"0e33ef3c",8890:"c4ca3394",8945:"4806a4d1",9246:"8e33cef9",9455:"9a43ddcc",9462:"ed135407",9604:"56339883",9669:"4cd569f6",10037:"698cd8b5",10211:"e5af0d39",10278:"3d3d8e45",10373:"72cceb56",10390:"a5559a92",10588:"0701f71e",10711:"9965b635",10909:"67d6828f",11084:"34d8112e",11133:"3db1a60c",11430:"561dab91",11662:"08a9e529",11681:"ab1994e7",11840:"75e3b2e5",11841:"8c44669d",11845:"e026f204",11991:"fb8f2570",12042:"40a52000",12095:"fe86f6d0",12236:"7601beeb",12287:"139db6f6",12384:"1d7e20ac",12417:"f6b99e2c",12693:"bcc69a5b",12865:"ce5cfb7d",12893:"032f5b52",13067:"f5959e16",13278:"0b313f64",13388:"ddc87a0b",13446:"7fc32915",13554:"8de4bc13",13708:"d405ec00",13755:"5a024e0e",13949:"c1dbd82a",14102:"e057b44b",14167:"a4e3e000",14340:"21174714",14382:"93b0fe8d",14690:"9fa7696a",14712:"a9de602d",14736:"3c71c766",14833:"27b3a807",15045:"500a4bec",15388:"e0acaafc",15476:"dbef7ee6",15548:"e6e9b142",16055:"9591f7e8",16145:"76ff302b",16328:"ace8180a",16458:"21be0e7e",16476:"33196d6c",16680:"961eee10",17051:"b63b3f75",17150:"67eaf742",17357:"45918ae3",17363:"c9312210",17434:"83a32858",17464:"7812b09f",17572:"4660801d",17794:"a7dc3b22",18042:"ae379aee",18401:"09ef5d0b",18446:"c190a89e",18509:"f6fd2866",18583:"6a786408",18613:"5d6a7566",18756:"5bbe6e79",18790:"ca3f42d8",19053:"9cb67ee4",19121:"a87c1dcc",19290:"68e5b2cf",19520:"c6241a2e",19523:"e294e885",19672:"486fa936",19702:"c8619971",19724:"bc6f4b20",19873:"13e39441",20041:"0227e04a",20097:"0c44bf26",20118:"0c64e7d9",20212:"16de87f1",20341:"4d1b74f3",20363:"49be902c",20420:"b9254497",20446:"a7cdf3fa",20562:"1f40df70",20574:"a848397f",20774:"61e0df28",21058:"8012b015",21157:"27af1036",21300:"44e728ae",21528:"8c05941c",21596:"0cc9ea5d",22362:"b8b4dfb4",22598:"5b89e810",22708:"7c266a47",22749:"28ee1c1c",22805:"f83c1949",22869:"1d7b6624",22874:"966b32b9",23060:"c9d70fe2",23475:"d2fec848",23476:"152acddc",23558:"b1ec159b",23597:"d29c0544",23673:"5b040202",23686:"7429ef3e",23717:"e082fa62",24029:"d86f9cbd",24066:"659d6e01",24144:"e9e9ae6d",24165:"83609be0",24285:"2af9d774",24490:"8f773dfe",24724:"14c8490e",24785:"a1efa451",24880:"b5196068",24981:"3f1d4f26",24998:"23f34fda",25275:"03385785",25474:"10b1d6f3",25596:"f4af5570",25789:"dc3a6ded",25908:"6fc246fd",25948:"e011dc7d",25960:"d1865fc4",26025:"88c91062",26173:"9f478156",26529:"3bc171fb",26933:"d30ca425",27098:"fed509cb",27153:"04f4033a",27431:"d43a197b",27570:"6bfc0922",27572:"a8f468f6",27721:"f8c32166",28109:"8be4ad20",28356:"a7767872",28505:"92ac1e16",28681:"4a0d0fa7",28968:"bf2c88db",29010:"57920b38",29214:"92183d16",29225:"d623d89b",29263:"330945ac",29286:"83d822eb",29632:"e48a2412",29664:"38da7c7f",29780:"730513ec",29891:"a6d3b23c",30044:"900e44df",30165:"c0feefa8",30312:"85aeb6b4",30491:"ad672914",30521:"1bf47862",30650:"8533893c",31136:"6ebc5513",31153:"c58b2dc5",31472:"7e0b8226",31586:"7ee588d2",31805:"d44f5a5f",31863:"0bcf475e",31883:"f5f387b6",32349:"cfd6d2bd",32450:"40e4f827",32452:"67edf930",32736:"c59a7304",32840:"e32cf151",32909:"f517fcc0",32946:"ce4eaf4a",33015:"e5771962",33188:"d4f06d9d",33656:"0e128a6f",34037:"fb561a9e",34149:"d11d23b8",34270:"abb3b2a6",34290:"8c34df1a",34446:"13b978b3",34465:"4fca7a5e",34467:"655d1e48",34483:"3aeaa7fd",34533:"752a6f47",34720:"853bbaf1",35080:"d62df70d",35448:"8da844a9",35491:"df38d157",35502:"c1456b15",35580:"7b743866",35632:"07156903",35634:"3fa29cda",35635:"d0a39215",35659:"e233b89d",35739:"e64ecaf5",36138:"966b634c",36192:"840704fe",36353:"8391fcd4",36496:"3697a370",36638:"0936fff9",36659:"3337aa9c",36729:"6d80d127",36732:"5d47f1ee",36904:"bd4efb4b",36949:"778a1b41",37068:"39844a38",37109:"cce35bcd",37119:"9bc1f8e6",37146:"e8db795c",37507:"694c9141",37555:"894ce0e5",37643:"8e023d46",37762:"7b05b140",37878:"d2f56ed9",37943:"e0ef4754",38012:"72d977ed",38193:"910a0b33",38368:"86585837",38389:"45446d1f",38440:"501913ea",38456:"a6b4f291",38588:"c25d28a7",38916:"2af91dae",38991:"c3806475",38992:"eec5aea5",38999:"59b5ba01",39143:"b5756612",39311:"aad4b13d",39646:"c40bc534",39839:"4770d6bf",39928:"3d07bd92",39954:"9daccfff",40069:"7ed52e05",40200:"d9ede400",40810:"061c37d4",40817:"9dbc424c",40953:"559cc0a3",40960:"b6627816",41015:"90c248ab",41305:"3b1fece8",41309:"166154e1",41738:"24fd2060",41811:"9cf426e4",41829:"6a7ea047",41838:"c78e3d82",41857:"68880f11",42007:"cb317052",42068:"d9edbc1c",42518:"86a08b41",42717:"b7425ae4",42795:"3e028652",42869:"b9ba3760",42919:"31b11c0a",43067:"8ddbbfa2",43181:"ae14d176",43318:"dba7aebc",43478:"68b3dcfb",43514:"da6222a3",43895:"68160b04",44146:"816b0446",44502:"1d4ae577",44570:"6cf951f6",44596:"a6d39f88",44839:"9ce9935a",45197:"3ec21f78",45501:"9ba51a07",45612:"37d3537a",45747:"192792b5",45826:"62f4f316",45894:"bfb88519",45966:"53075fe5",46084:"1c4682ef",46105:"86de2c9b",46160:"aa960b7d",46244:"cd1d2f2c",46447:"5a47951a",46610:"531d4e24",46646:"d354548e",46666:"921bf04d",46708:"4dc9772f",46878:"b509f7f7",46985:"a8cfbd6f",46995:"b1858733",47055:"7236f4a9",47113:"65880b18",47627:"61fd1f01",47752:"f8048057",47946:"2d6afe3b",48035:"ac895284",48099:"77305b62",48131:"75035205",48155:"35b5054d",48253:"5eb32af3",48402:"9606b387",48543:"b0d87d42",48612:"88bab5bf",48684:"b013ecd0",48721:"e685b14f",48806:"bd148f5a",48965:"a6828336",49076:"57a5b447",49183:"7b9c94bb",49195:"603daa6e",49359:"64d1c0fe",49440:"0721c498",49471:"920de758",49534:"cbc2049f",49635:"eb7438a7",49724:"8c523b28",49733:"172a3ddb",49942:"4cae2a11",49945:"b7753dbd",50074:"1a67a021",50213:"e912fa36",50370:"e8e09d25",50371:"0205d406",50685:"90c425f7",50739:"7212b433",50816:"57dfbb8f",51093:"41879319",51725:"b3b484c8",51739:"0b6d5daf",51845:"eacd4b98",52074:"9cdf105b",52165:"5cca0c54",52634:"8f185e78",52711:"d34e3f47",52723:"303ed67a",52761:"ea708a59",53434:"69dc6fef",53440:"ffbc7a5c",53446:"26189ee8",54366:"650f8f6c",54374:"c6f26add",54386:"879d6f49",54422:"a91b7973",54522:"af414017",54535:"77dac830",54602:"c50f3eaf",54708:"da2c9c90",54770:"a3c2c2c2",54785:"4ea84da4",54829:"b72b01b8",54880:"acdd1572",54986:"2c5cc9eb",55169:"9d782db9",55420:"2aa6d9d4",55528:"30911308",55580:"64ff5123",55603:"2c5aa5fb",55621:"3f9a5c5f",55662:"0637450d",55673:"2937a0f7",55938:"47a5ee51",55939:"2b5ab75a",56188:"454cb07b",56359:"0c4dc962",56444:"8fdf39e0",56683:"1b13998b",56787:"765073a2",56886:"1b672b06",56918:"c9463b4b",57062:"42dac777",57277:"53ab8e7a",57396:"8ffb1e99",57436:"75faecb8",57532:"822a19a5",58236:"a8d3be3b",58290:"88af57aa",58319:"e81eac6b",58382:"edc77b5b",58419:"dec2fff0",58424:"c78f2ff2",58548:"4114122d",58565:"3b680e25",58581:"eeb3ab8a",58694:"1b0a3abf",58700:"30b5efa5",58913:"ad6fc8d2",59154:"8ccd37ed",59289:"051cfb11",59569:"382b4067",59584:"d6a86576",59612:"b7c57060",59644:"ca771ba3",59783:"87fd0d82",59919:"eece923f",60383:"c44153a4",60439:"0fb59c60",60473:"e68ba11c",60680:"cf67bc26",60785:"64dca330",60830:"a2892113",61153:"5d8b3042",61316:"af9b26bb",61321:"ea3eafd1",61377:"48db1f76",61517:"1088e74e",61556:"4853cb23",61611:"fd586ef6",61806:"3f9c98fe",61990:"0a3e34ef",62071:"374b5717",62138:"4fc12286",62224:"eae39005",62318:"a02e8326",62590:"e6546c21",62608:"e640ce41",62630:"e172ac19",62684:"6e673e62",62864:"7a9d7aaa",62959:"2b6e92c3",62998:"94754958",63267:"cccfec41",63288:"d30aac63",63380:"79a4373a",63399:"d653a0d6",63493:"6275ef97",63720:"70f50862",63761:"d4260b12",63817:"33aa1df6",63877:"8ce7ea27",63924:"5459631c",63993:"56082fd1",64078:"6f8b52e8",64196:"73acb3c7",64293:"002f5ba8",64455:"1446f731",64534:"c04413c5",64542:"15bd8f93",64604:"413a66a5",64631:"e00e4962",64678:"5502d8aa",64917:"bba8dbb4",64922:"fae43783",64972:"0e224a16",65250:"fc035a3b",65541:"84de84ff",65664:"c055b652",65767:"757b7ddc",65856:"918827ad",65872:"54281de8",65958:"a6e9b260",66227:"339ab67a",66248:"b738dbdd",66290:"1b95d1d8",66352:"631b03f2",66435:"b19c736b",66455:"4d531664",66578:"f55f5147",66814:"8d9c4c49",66886:"fe2fb3c0",66939:"0323bfe6",67109:"6b39c98c",67351:"7db56a57",67472:"82394f90",67570:"4ce54898",67714:"9317435e",67796:"425a1c9c",67882:"83407aa9",68063:"254796f8",68074:"7de94275",68371:"c5024786",68495:"d5c9ec21",68670:"a8fd2c4c",68749:"32739393",68773:"4cb4d536",68795:"fbd00dee",68831:"f2b75a8e",68951:"b530ac8f",69445:"0e6a6934",69693:"0a5b1e6f",69738:"52baffda",69979:"0b5349be",69987:"ae3d4421",70001:"08613bf7",70092:"6caeb39b",70131:"80ac857e",70321:"37cf6250",70612:"f16baee4",70804:"025e7aca",70806:"b5d96fe8",70897:"1193f50d",71298:"b008b038",71317:"ec407eb8",71333:"3c2af055",71494:"0afc3b29",71500:"c9776aa7",71659:"222a3580",71753:"eab0d9fb",71760:"576fb43c",71866:"6f58dc76",71886:"bc09dd50",72211:"fae06709",72482:"a5e01698",72637:"5d377ab2",72700:"3cb63417",72795:"a1b7b87c",72825:"c302d543",72844:"1d3decab",72920:"5f451553",72969:"adf5cd25",73609:"dc28a46f",73718:"cee23dbc",73765:"78942fb5",73889:"c1409c78",73936:"02247d11",74276:"bb38dd22",74307:"e0f87d20",74391:"f8983db3",74484:"90146d25",74661:"eaa43db6",74673:"418f2299",74801:"f09a6583",74944:"7d683ad2",75055:"9848b7da",75120:"7e223bcc",75132:"4fda19a1",76023:"f6f4bb14",76073:"23dd006f",76152:"4f90dddb",76206:"138c8900",76354:"fa2e5e59",76777:"eee3eed7",76829:"097ab0c2",76903:"4f1205a9",76939:"0e253952",77751:"5090b4be",77759:"ed24674d",77800:"64aa277c",77849:"fb9ad6b4",78131:"bf90d51e",78207:"6c0dd001",78417:"1770b5fb",78564:"222d02de",78682:"3cf80e26",78959:"a5dc87ee",78960:"fb3edd33",78997:"9e7109d8",79074:"fafec232",79156:"0a2e12ab",79234:"87b75812",79566:"33ed3463",79709:"bdbb5ac0",79957:"4acb1a2e",79985:"96b89907",80218:"161f176b",80375:"6c7c80b9",80495:"712fd7c1",80614:"796f513a",80665:"0ae1c229",80722:"8aefd0fe",80878:"4813ccff",81057:"654e2063",81084:"db7e93e0",81202:"d987ce13",81271:"108c3c8f",81397:"5f111be5",81470:"891008c7",81471:"45ae7b3e",81678:"a16fd3c0",81707:"79b083f1",81784:"b260457c",81820:"adbfa883",81844:"3c03d2af",81886:"4020e581",81930:"d675ceaf",81948:"05a3a5dc",82214:"398ad0db",82230:"0688234e",82277:"294672c7",82284:"ad167894",82402:"7644e779",82646:"f317fec6",82698:"f3049d6d",82925:"b9350213",83071:"819ea0a3",83164:"b58a1003",83249:"ae142aec",83261:"0867c1ef",83331:"0728eec1",83556:"12aaf92a",83855:"cbdf093c",84164:"a704db3f",84190:"a782d704",84398:"4aab6c0b",84778:"f4a63b10",84813:"92b08a79",84877:"8a851d06",85159:"7ee5ee37",85186:"4ad9caeb",85196:"9c9d48a2",85247:"07374c58",85732:"50e237ec",85864:"e7d1e32b",86398:"ca51d8e4",86537:"e9d2c290",86595:"42d5b548",86757:"d34315db",86887:"9c552f79",86944:"9d080dab",86963:"2d7e53b1",87118:"9d4dc3e5",87251:"92feef5e",87284:"88c2fb53",87592:"21a28f16",87683:"83aeb9c4",87733:"8aa975fe",87791:"7b2300a4",87817:"db975395",87970:"06d85d62",88007:"089421a7",88021:"b780e14d",88199:"97fc7f25",88318:"43bca794",88462:"4775e794",88501:"ce0052bd",88572:"9ef5a9ac",88714:"4a261334",88963:"2bc62970",89267:"a61489e7",89588:"dafadf7b",89729:"aaf31325",89737:"221b96aa",89816:"e6a8799f",89831:"2f10e678",89840:"3c683391",89915:"7c367d61",89963:"ef6ec695",90023:"5147a39f",90329:"097040f5",90416:"ba76a62b",90575:"b8f10625",90776:"3f8963d1",90892:"24f98e28",91045:"937a544a",91195:"004e48b7",91288:"6e5dd106",91384:"aa6ea9a0",91772:"fa72fd6b",92058:"6bb08a4f",92273:"dc77db14",92275:"6878af12",92282:"a1e9b3c3",92648:"8f4ff553",93019:"b08ed4de",93040:"dc33c940",93133:"10e86767",93255:"3ef1ddd9",93488:"961ee555",93639:"5a61d02f",93744:"ea3cf319",93963:"d7176885",94082:"fd7b597c",94183:"0109e060",94248:"7da08bee",94328:"9eea0742",94381:"fb078950",94395:"962cd93c",94603:"2d2d3ce0",94617:"6fc511a0",95088:"cad11947",95155:"0f612903",95182:"424502af",95183:"d8afe4ab",95406:"d053099d",95638:"85d617da",95894:"50e9599f",95919:"a96189a6",95924:"0e4a38a2",96039:"d2d42582",96092:"4a335e4a",96095:"76c37447",96296:"465ed963",96431:"a9f6501e",96632:"ce0b342e",96752:"50780fc2",96886:"b34fb898",96998:"59d07b35",97026:"de39be31",97061:"51307200",97202:"e7f836e8",97215:"9fb5a9d9",97342:"87dcc389",97450:"749f8f23",97458:"8795f2db",97543:"37b4a1ba",97788:"4813b5b9",97823:"23a8a58c",97891:"f92536bb",97902:"97ca5b7e",98055:"131b4810",98196:"143d8e20",98197:"47aad54f",98230:"0a540df5",98581:"ee3d7a6f",98632:"950740b9",98952:"9c4deea1",98982:"9d0c575c",99017:"00d06eee",99340:"101b7b13",99426:"c9334111",99687:"4555de3a",99740:"9355cb55",99762:"4bc0eb76",99831:"8f1df9f6",99924:"6ed07fae",99965:"358b28d0"}[e]+".js",t.miniCssF=e=>{},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),a={},b="@openfn/docs:",t.l=(e,f,c,d)=>{if(a[e])a[e].push(f);else{var r,o;if(void 0!==c)for(var l=document.getElementsByTagName("script"),n=0;n{r.onerror=r.onload=null,clearTimeout(s);var b=a[e];if(delete a[e],r.parentNode&&r.parentNode.removeChild(r),b&&b.forEach((e=>e(c))),f)return f(c)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),o&&document.head.appendChild(r)}},t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.p="/",t.gca=function(e){return e={10647879:"48099",17896441:"18401",53371809:"38999",61428574:"45894",69802526:"77751",77354108:"55528",84810683:"81271",89594773:"26933",90377122:"20118",96781795:"36729",d1e2a1e4:"182","56b2a431":"185","6af54863":"414","5153790b":"535","8fa4918e":"825",fec351f2:"1100",d04fedb5:"1101","1ef0096b":"1102","5f0cc255":"1104","734563d5":"1212",dc62dd6c:"1281",e967512d:"1356",e480871d:"1372",b1be30d1:"1511",cd8c9fbc:"1705","9d4548fb":"1905",e51254c6:"2280","0e04b402":"2782","125cb29e":"2928","33fb6ca4":"2959",a9d16e82:"3181",b987a5c1:"3237",a555a233:"3296",f98b80b4:"3336",reactPlayerVidyard:"3392",cee49d1f:"3430","186444dd":"3482",def6dfb9:"3663",d9a6c9f9:"3704","133b4df0":"3970","81eac5d3":"4207",e866f873:"4212","419e73d5":"4343","8dc27084":"4501","81e594d4":"4711","4c2772ab":"5387",d4e06cde:"5456","5d42a18a":"5661","5610898c":"5731",e6102057:"5843","998a3ebe":"5931",fe66a3bc:"5933",babb54f3:"6014",af1b4014:"6308",cd910537:"6379",reactPlayerKaltura:"6463",fae4f913:"6580",e3a6d1ec:"6615","2c828998":"6914","898d2911":"6947",ffa0c411:"7031",ce5aebf3:"7129","0918a7cd":"7284",b31fa192:"7408",bb8cf488:"7658","193bf152":"7684","92e661e4":"7727","20501ae4":"7795","89ebc8eb":"8035",d44f5d69:"8041",ea0d3e91:"8063","77faeb23":"8094",c4429c79:"8132","01a85c17":"8209",a13b9d31:"8229",e2548c92:"8275",f7d07906:"8580","4cd34504":"8890","4ba520f6":"8945","9bb632fa":"9246","6e9a1c5f":"9455","3035a8de":"9604","277d517a":"9669","14ee1fe9":"10037","524c9166":"10211","5385774b":"10278","5f0700c5":"10373","7356945f":"10390",f93f95da:"10588","85f847a7":"10711","60ab92b2":"10909","75270caf":"11084",a20e070a:"11133","0564f87a":"11430","2bf9c0b5":"11662","74ea6b63":"11681","5fb0ec3e":"11840",fe1d477d:"11841",da184dc1:"11845",b2b675dd:"11991",reactPlayerTwitch:"12042","9e96f049":"12095",f50ed874:"12236",acfb9a5e:"12287","22ef07eb":"12384",c6fe0741:"12417",c333ed9f:"12693","3f2ad086":"12865",e4a50065:"12893","81ce5e0c":"13067",a2e81b6d:"13278","5f6910fd":"13388",d015beca:"13446","09b23959":"13708",a3efb982:"13755",eb4eb408:"13949","2a413a18":"14102",aacecf0a:"14167","2dcd28d2":"14340","5f87d652":"14382","44ea6f94":"14690",db759789:"14712","330b8ea1":"14736","46bd2088":"14833","14ad7d65":"15045",fe5f889f:"15388","14709bd0":"15476","247783bb":"15548","7b9ab678":"16055","58cbfb5a":"16145",reactPlayerDailyMotion:"16328",a14a2602:"16458","3a03215d":"16476","2bb14bf0":"16680","6738a51a":"17051","6cb21577":"17150","1140a058":"17357","6310fd48":"17363","9e1f7384":"17434","7fdc0c84":"17464","3947b16e":"17572",f5ff4ddf:"17794","36ded102":"18042",reactPlayerYouTube:"18446","48052ce1":"18509","60b808f2":"18583",ece86388:"18613","1ee9c635":"18756","92999a1c":"18790","82092fc0":"19053","3a574a7f":"19121","9afa6cde":"19290",f2ca2c55:"19520",deb190e6:"19523","203262b0":"19672","8f8e3a33":"19702",b1f7255a:"19724",aa1b4e53:"19873","81c93763":"20041",e7b8679f:"20097","5f16d91a":"20212","11e6d144":"20341","63eaaafc":"20363",e2c3bc5f:"20420","5e1dea11":"20446","853ddb5d":"20562","126d2d8d":"20574",fc5ff77a:"20774",ea369cdd:"21058",abb76970:"21157","2e5976f3":"21300","6556faa5":"21528",a54058d6:"21596","5e95c167":"22362","1f86786a":"22598","8d1ec4c5":"22708","471dcc6f":"22749",e310b146:"22805","374427da":"22869",d8d13bad:"22874","7a801707":"23060","0a6f29e5":"23475","239ea6cd":"23476","68cedfd5":"23558","1a848321":"23597","5f1113d5":"23673","97a69baf":"23686","3a06bd86":"23717","11451be3":"24029","2f4b7a65":"24066","406b186f":"24144","07e96687":"24165","507e1a4c":"24285","06b1e92d":"24490","823f7700":"24724","853164ef":"24785","20f8de15":"24880",db6367fb:"24981",dfd4abb8:"24998",cb128a98:"25275","4aa43dae":"25474","122cd6da":"25596",ef4e0518:"25789","9ee43f4e":"25908",febd0338:"25948","341bd61f":"25960",e56b7427:"26025",reactPlayerVimeo:"26173","30ddeb5e":"26529","3874af3e":"27098",f77b4e82:"27153","0a61bc2e":"27431","070789e7":"27570","207ee67a":"27572",c0daf1e6:"27721",e0c8a1d6:"28109","4f0c7b96":"28356",d879ea04:"28505","1abd0bca":"28681","59b068d1":"28968","8e37cc44":"29010",f3954950:"29214","29cfecd2":"29225","36a143db":"29263","20a7d97c":"29286","7ee80f24":"29632","60a00565":"29664","7b20acf0":"29780","45b3f811":"29891",e1d93203:"30044","437618c4":"30165","614beed4":"30312","0c8b9afa":"30491","45b0764f":"30521",d6bd25e1:"30650","960d9980":"31136","1c091541":"31153",fa811662:"31472","8e97cc15":"31586","5e450bcf":"31805",caaf01d4:"31863","421999d2":"31883",a1b695db:"32349",c302b7f6:"32450",bd83a8c8:"32452","3bc428dc":"32736","3cf47477":"32840",c6cf652c:"32909","4aaa0f44":"32946","5575e2a8":"33015",bfb1735a:"33188","31d20e13":"33656",f6525c87:"34037",b69843a1:"34149",cc826739:"34270",a6a264d3:"34290",b1212599:"34446",fcdeb347:"34465","9b3efc75":"34467",b5efef1d:"34483",d6247adb:"34533","0452e1bb":"34720",af4b7be4:"35080","7b2e7fac":"35448",a7ce3f25:"35491","565d3b3a":"35502",d4c834e8:"35580",dff30c03:"35632",c6dfd94e:"35634",ecfe8209:"35635","4646a8a4":"35659",f2f7c8b6:"35739",bebb13e1:"36138","85c49f6d":"36192",reactPlayerPreview:"36353","12ebab0f":"36496","25057d02":"36638",e0ecd9df:"36659","3cc638e0":"36732",ffecbc46:"36904",ab0b43f0:"36949","4ef2e3ea":"37068","8ee77415":"37109",bd6858b9:"37119","22885a83":"37146",e4608243:"37507",e202e776:"37555",a6aa9e1f:"37643","89f741ca":"37762","845a8f5b":"37878","512d8cfa":"37943","274548c6":"38012","741a738c":"38193",b3022338:"38368","50711b5c":"38389","27e17dc0":"38440",c4643d70:"38456",f9dcbd56:"38588",cab54053:"38916","2db499ae":"38991","903c4f6f":"38992","186b492d":"39143",b85e9339:"39311",c7bf2a3a:"39646",e150ab3e:"39839","9b770ac0":"39928","8f102ef9":"39954","70b40441":"40069",d40361ad:"40200","0475f9cc":"40810",c0908e63:"40817","5b5d0fd6":"40953",bd8e6ec6:"40960",eec2ee36:"41015","1de77d44":"41305","6620b2c9":"41309","28411ba4":"41738",e7db057b:"41811","1f704a03":"41829",d98b9f83:"41838","37c880e2":"41857","4b75119c":"42007","9997aecf":"42068",c968f1a3:"42518","77e868d9":"42717",cc8c6322:"42795","6850cfb6":"42869","09a69b27":"42919","1e5c0d86":"43067","519cbeed":"43181","554f4bd3":"43318","3f85e7e0":"43478",dc72610b:"43514","073713d1":"43895",f24f0ea5:"44146","069211c5":"44502",d493c3e8:"44570","8256726e":"44596","6f69b847":"45197",da6f85e6:"45501","62b71d38":"45612","1ddde2c7":"45747","783bde4f":"45826","5426ac11":"45966",e5e83212:"46084","7778b814":"46105","216be533":"46160","771488fd":"46244","0210b704":"46447","20a5a532":"46610","88b398be":"46646",c08d79e7:"46666","32723a2e":"46708","56d56511":"46878",fcfb247d:"46985",c831614b:"46995","36788d15":"47055",reactPlayerStreamable:"47627","661132b8":"47752",e3450ac4:"47946","708cde07":"48035","4cff7ce2":"48131",ced1473c:"48155",ba11d205:"48253","097f4186":"48402","34bbb05d":"48543",cce9ad1c:"48612","9f91e03b":"48684","1074bb26":"48721","479e2d15":"48806","6d0c6131":"48965","208114e0":"49076","256aaf6c":"49183","1a98f2d5":"49195","984b8319":"49359",f30a3d1e:"49440",c77a0576:"49471",d2227473:"49534","33e1509d":"49635",a9bffa51:"49724",de4aaf36:"49733",bae79ca1:"49942","459956dd":"49945","5dfb628f":"50074","2158648d":"50213","1d48afb9":"50370",f08e269d:"50371",c2367e06:"50685",aa9c90f7:"50739",b198cec2:"50816","2f48bebc":"51093","890759ea":"51725","12f62dc2":"51739",c4fd3761:"51845","33844ff3":"52074","94c68899":"52165",c4f5d8e4:"52634","9e4087bc":"52711",reactPlayerMux:"52723","28a6a789":"52761","90d535c2":"53434","5efe417b":"53440","1bf956b0":"53446","1a43e018":"54366",bab68f7e:"54374","45062c3f":"54386",ec576a8b:"54422","14a767b9":"54522","1e27a2df":"54535","954fe712":"54602","2f989304":"54708","9e339b71":"54770","3c41cfdf":"54785","444d5ed4":"54829","1e26ddab":"54880","6a3a4a87":"54986",a3f9e536:"55169",fa746f0e:"55420","665c23b8":"55580","7d5cf9fd":"55603",d5e8cc91:"55621",bc4d6fc9:"55662","9d36e504":"55673","669b0b95":"55938","2e7fdd6f":"55939",a12f1ef9:"56188",e57c1bef:"56359",f76e6047:"56444","82453b48":"56683",c2d7f837:"56787","283e63f8":"56886","10eaf6bf":"56918","6c5c20d6":"57062","050638ff":"57277",cd7cc5b2:"57396",c85c4b26:"57436","8e0ad159":"57532","55ac83aa":"58236",e4f4dec4:"58290","45a8dc52":"58319","3e1cef53":"58382","4e3d1533":"58419","6bf3b56c":"58424",c64ebc62:"58548",e8b14a65:"58565",b3198ac5:"58581",d3433875:"58694","6fa39f86":"58700","6a6b8e69":"59154",eae3fa10:"59289","10915d97":"59569","776f5947":"59584",c3c79e6c:"59612","677d6777":"59644","450c527f":"59783",b973dcfd:"59919","2fd22369":"60383",acf97486:"60439",c1a814bd:"60473","1d970e9f":"60680","1b3816a8":"60785","9915a91d":"60830","08e43170":"61153","92bdb8f4":"61316",d3b3aab8:"61321","7a8aa347":"61377","5c7af219":"61517","39e9cb37":"61556",a6748c3f:"61611","3d5c28b0":"61806",f13ea377:"61990","1af9c7d3":"62071","1a4e3797":"62138",cce23dfc:"62224","24a5cb68":"62318","6ee59393":"62590","83170ae2":"62608","271f7228":"62630",f615a51d:"62684","60194cf2":"62864","3685f909":"62959",fba9f625:"62998","2127c55a":"63267","1c7cc376":"63288","4f989fdc":"63380",cc3db60c:"63399","608d3bbe":"63493","291e387f":"63720","500fb0e6":"63761",ede583c5:"63817","699a47d0":"63877",fe36bf36:"63924",cfc8229c:"63993",aea1a378:"64078",ed03f5d4:"64196",b0055554:"64293","861bd1f8":"64455","7d8e4827":"64534","97bb0f58":"64542",c3a6b316:"64604","237f254e":"64631","99d25280":"64678",b50d6289:"64917",e19908fc:"64922",d5bc6e48:"64972","6479f562":"65250",f5d5b73d:"65541","12f94a3a":"65664","8eb4e46b":"65767","15d749b5":"65856","3e171e78":"65872",e709bacf:"65958","8977ff65":"66227","4549cb79":"66248","0018b769":"66290","89c724a9":"66352","34298da9":"66435","964386c1":"66455","342f32a4":"66578","8660c4b6":"66814","8ed61535":"66886","4f8f7d74":"66939",a8faecbd:"67109","39906be8":"67351","814f3328":"67472",reactPlayerMixcloud:"67570","7f0b639b":"67714",afbc2852:"67796","8d6bb331":"67882",e2c66a78:"68063","13a2a5ae":"68074","29bb06c8":"68371","747a690f":"68495",b6379448:"68670",c2be96f9:"68749","55bb925b":"68773",b083e7a6:"68795","7f2f79c2":"68831","1ff7f4b8":"68951","6de65b44":"69445","1385f2e4":"69693",acd02317:"69738",reactPlayerSoundCloud:"69979",dbbfaad4:"69987","723d2f26":"70001",afd0cb1b:"70092","22ff6767":"70131","029e4dc3":"70321","4980c4fa":"70612","03cd8e1c":"70804",ef9227ec:"70806",a8c84974:"70897",bc07532a:"71298","6d30ac0a":"71317","94b64e1c":"71333","4224ef00":"71494","1e9ef283":"71500",f2b4d23e:"71659","57fbf2bd":"71753","0d1eeea0":"71760","0f427d40":"71886","30995fb4":"72211","5ffd6909":"72482",b37711b1:"72637","869c9c27":"72700","4bff3e73":"72795","31b72ec5":"72825",dd13b434:"72844",a22153eb:"72920","385718d4":"72969","83218c8a":"73609",fb5b11b0:"73718","5bcd0da1":"73765","868893ac":"73889","7f6bbd73":"73936",fd5d515c:"74276","8b77e1a5":"74307","352bf367":"74391","035d0344":"74484",c942fcda:"74661","5ede04c0":"74673","8b0d3319":"74801","006fd865":"74944",c3a5a911:"75055",f77d5673:"75120","4256eaf4":"75132",cb759659:"76023",a5fe4d7b:"76073","78469ba2":"76152","9da9a498":"76206",aae0663e:"76354","4649e1c2":"76777","8328e7f1":"76829",cabfe087:"76903","05e78500":"76939",e802237a:"77759","68987ad2":"77800","4b2ec4d2":"77849","3062d10d":"78131",f9ed4079:"78207",cc135780:"78417",a5bc4f28:"78564","916b8fda":"78682",f13d29f3:"78959","40fd761e":"78960",de387681:"78997","6f4af312":"79074",b1ecb9ed:"79156","1954649e":"79234",b2b9b866:"79566","4a487c7d":"79709",f5fdaecd:"79957",d776f897:"79985",bb40a730:"80218",ea07b8e0:"80375",ed48b979:"80495","73578edf":"80614","3124230e":"80665",fa9fb131:"80722",c76eb7d5:"80878",f5466782:"81057","16aa9458":"81084",c3b63204:"81202","75d9ae63":"81397","199fcd36":"81470","02371d76":"81471",a7434565:"81678","4ef508e9":"81707","97feb4e9":"81784","31c4e4e2":"81820",bfbf9dff:"81844","9eb4e0db":"81886","8310c4f6":"81930",dc14f0c4:"81948",f64a2f66:"82214","2f06f2be":"82230","0b31129f":"82277","8435c5ad":"82284",c275b7b1:"82402","4cbb880b":"82646","75ae40a4":"82698","78b226dc":"82925",a817f8e6:"83071",e19d86f2:"83164",ccc49370:"83249","5cecf783":"83261",c2d56c21:"83331","7b81a468":"83556","67c4a832":"83855",ffc1986f:"84164","1d01589c":"84190","1cd349ba":"84398","4f3e32ec":"84778","6875c492":"84813","833f2ec0":"84877","4be7e5d0":"85159","5653e10f":"85186","86b52bb0":"85196",e175f9f3:"85247","60f1bcf9":"85732","3d8bf3ab":"85864","0c6d1616":"86398",d9cb599e:"86537","55cceff7":"86595","326c0af7":"86757",reactPlayerFacebook:"86887","3f45f80c":"86944",d523bad7:"86963",c541efc4:"87118","6bb55549":"87251","460d220e":"87284","5fa25c43":"87592","879bb888":"87683","6aa8733e":"87733",cfba059f:"87791","5c0c3c72":"87817","403863d9":"87970",d1c7c525:"88007","9bf3c520":"88021","5e1c9ef2":"88199",b6997bf2:"88318",fca34444:"88462",d40de319:"88501","43f8b4ce":"88572","1be78505":"88714",f5f1347d:"88963",a7023ddc:"89267","376ff700":"89588",c0f0637e:"89729","87d0342b":"89737","5de53f8e":"89816","919ee986":"89831",fbcdd0ee:"89840",f7c12f45:"89915",f7765531:"89963",f38541c0:"90023",e436cfad:"90575","64ec14d2":"90776","92af7f04":"90892","192eff61":"91045","7a35092c":"91195","6536e94a":"91288","5a047bf8":"91384",b942cf8e:"91772","8446e86b":"92058","65e8e75e":"92273","6c8cf0bf":"92275","7cb85c78":"92282",d88d25ac:"92648","8e10bb86":"93019","60e9e07a":"93040","6680323d":"93133","29a36bd7":"93255",b5bd7f9b:"93488",f3f3787d:"93639","6ccb7d3e":"93744","8e40e0a9":"93963",d060dfa6:"94082","54e91ab5":"94183","07987921":"94248","9c1835bf":"94328","26c54994":"94381",c98ac358:"94395",fa56ac42:"94603",a9d6ad8a:"94617","1578031d":"95088","233cd645":"95155","92009f0a":"95182",ef4780b0:"95183",d80cee7e:"95406","96ecf107":"95638",b2f554cd:"95894","87a2f1fc":"95919","9f0412f1":"95924",f48233a1:"96039",bd16d6fd:"96092",f259cf74:"96095","3fa9568c":"96296",dc819e53:"96431","371b21cb":"96632",f7f75c2e:"96752",a0799a2b:"96886","21b56577":"96998","285ad496":"97026",ea642db2:"97061",a9808524:"97202","80a6599d":"97215",ceb3f8e5:"97342",c260b9a0:"97450",reactPlayerFilePlayer:"97458",c5495231:"97543","38eccbde":"97788","2d52fc42":"97823",a03f8b02:"97891",d0ac1c30:"97902",bcf9457e:"98196","2d68e16b":"98197","13c3e084":"98230","935f2afb":"98581","84c1f0c8":"98632",c1dc13d0:"98952","0f438a70":"98982","0a451647":"99017",reactPlayerWistia:"99340",d61e8580:"99426","5ad12221":"99687",a69ebe5f:"99762",c4816122:"99924","1280552c":"99965"}[e]||e,t.p+t.u(e)},(()=>{var e={45354:0,71869:0};t.f.j=(f,c)=>{var a=t.o(e,f)?e[f]:void 0;if(0!==a)if(a)c.push(a[2]);else if(/^(45354|71869)$/.test(f))e[f]=0;else{var b=new Promise(((c,b)=>a=e[f]=[c,b]));c.push(a[2]=b);var d=t.p+t.u(f),r=new Error;t.l(d,(c=>{if(t.o(e,f)&&(0!==(a=e[f])&&(e[f]=void 0),a)){var b=c&&("load"===c.type?"missing":c.type),d=c&&c.target&&c.target.src;r.message="Loading chunk "+f+" failed.\n("+b+": "+d+")",r.name="ChunkLoadError",r.type=b,r.request=d,a[1](r)}}),"chunk-"+f,f)}},t.O.j=f=>0===e[f];var f=(f,c)=>{var a,b,d=c[0],r=c[1],o=c[2],l=0;if(d.some((f=>0!==e[f]))){for(a in r)t.o(r,a)&&(t.m[a]=r[a]);if(o)var n=o(t)}for(f&&f(c);l{"use strict";var e,f,c,a,b,d={},r={};function t(e){var f=r[e];if(void 0!==f)return f.exports;var c=r[e]={id:e,loaded:!1,exports:{}};return d[e].call(c.exports,c,c.exports,t),c.loaded=!0,c.exports}t.m=d,t.c=r,e=[],t.O=(f,c,a,b)=>{if(!c){var d=1/0;for(n=0;n=b)&&Object.keys(t.O).every((e=>t.O[e](c[o])))?c.splice(o--,1):(r=!1,b0&&e[n-1][2]>b;n--)e[n]=e[n-1];e[n]=[c,a,b]},t.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return t.d(f,{a:f}),f},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var b=Object.create(null);t.r(b);var d={};f=f||[null,c({}),c([]),c(c)];for(var r=2&a&&e;"object"==typeof r&&!~f.indexOf(r);r=c(r))Object.getOwnPropertyNames(r).forEach((f=>d[f]=()=>e[f]));return d.default=()=>e,t.d(b,d),b},t.d=(e,f)=>{for(var c in f)t.o(f,c)&&!t.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:f[c]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce(((f,c)=>(t.f[c](e,f),f)),[])),t.u=e=>"assets/js/"+({182:"d1e2a1e4",185:"56b2a431",414:"6af54863",535:"5153790b",825:"8fa4918e",1100:"fec351f2",1101:"d04fedb5",1102:"1ef0096b",1104:"5f0cc255",1212:"734563d5",1281:"dc62dd6c",1356:"e967512d",1372:"e480871d",1511:"b1be30d1",1705:"cd8c9fbc",1905:"9d4548fb",2280:"e51254c6",2782:"0e04b402",2928:"125cb29e",2959:"33fb6ca4",3181:"a9d16e82",3237:"b987a5c1",3296:"a555a233",3336:"f98b80b4",3392:"reactPlayerVidyard",3430:"cee49d1f",3482:"186444dd",3663:"def6dfb9",3704:"d9a6c9f9",3970:"133b4df0",4207:"81eac5d3",4212:"e866f873",4343:"419e73d5",4501:"8dc27084",4711:"81e594d4",5387:"4c2772ab",5456:"d4e06cde",5661:"5d42a18a",5731:"5610898c",5843:"e6102057",5931:"998a3ebe",5933:"fe66a3bc",6014:"babb54f3",6308:"af1b4014",6379:"cd910537",6463:"reactPlayerKaltura",6580:"fae4f913",6615:"e3a6d1ec",6914:"2c828998",6947:"898d2911",7031:"ffa0c411",7129:"ce5aebf3",7284:"0918a7cd",7408:"b31fa192",7658:"bb8cf488",7684:"193bf152",7727:"92e661e4",7795:"20501ae4",8035:"89ebc8eb",8041:"d44f5d69",8063:"ea0d3e91",8094:"77faeb23",8132:"c4429c79",8209:"01a85c17",8229:"a13b9d31",8275:"e2548c92",8580:"f7d07906",8890:"4cd34504",8945:"4ba520f6",9246:"9bb632fa",9455:"6e9a1c5f",9604:"3035a8de",9669:"277d517a",10037:"14ee1fe9",10211:"524c9166",10278:"5385774b",10373:"5f0700c5",10390:"7356945f",10588:"f93f95da",10711:"85f847a7",10909:"60ab92b2",11084:"75270caf",11133:"a20e070a",11430:"0564f87a",11662:"2bf9c0b5",11681:"74ea6b63",11840:"5fb0ec3e",11841:"fe1d477d",11845:"da184dc1",11991:"b2b675dd",12042:"reactPlayerTwitch",12095:"9e96f049",12236:"f50ed874",12287:"acfb9a5e",12384:"22ef07eb",12417:"c6fe0741",12693:"c333ed9f",12865:"3f2ad086",12893:"e4a50065",13067:"81ce5e0c",13278:"a2e81b6d",13388:"5f6910fd",13446:"d015beca",13708:"09b23959",13755:"a3efb982",13949:"eb4eb408",14102:"2a413a18",14167:"aacecf0a",14340:"2dcd28d2",14382:"5f87d652",14690:"44ea6f94",14712:"db759789",14736:"330b8ea1",14833:"46bd2088",15045:"14ad7d65",15388:"fe5f889f",15476:"14709bd0",15548:"247783bb",16055:"7b9ab678",16145:"58cbfb5a",16328:"reactPlayerDailyMotion",16458:"a14a2602",16476:"3a03215d",16680:"2bb14bf0",17051:"6738a51a",17150:"6cb21577",17357:"1140a058",17363:"6310fd48",17434:"9e1f7384",17464:"7fdc0c84",17572:"3947b16e",17794:"f5ff4ddf",18042:"36ded102",18401:"17896441",18446:"reactPlayerYouTube",18509:"48052ce1",18583:"60b808f2",18613:"ece86388",18756:"1ee9c635",18790:"92999a1c",19053:"82092fc0",19121:"3a574a7f",19290:"9afa6cde",19520:"f2ca2c55",19523:"deb190e6",19672:"203262b0",19702:"8f8e3a33",19724:"b1f7255a",19873:"aa1b4e53",20041:"81c93763",20097:"e7b8679f",20118:"90377122",20212:"5f16d91a",20341:"11e6d144",20363:"63eaaafc",20420:"e2c3bc5f",20446:"5e1dea11",20562:"853ddb5d",20574:"126d2d8d",20774:"fc5ff77a",21058:"ea369cdd",21157:"abb76970",21300:"2e5976f3",21528:"6556faa5",21596:"a54058d6",22362:"5e95c167",22598:"1f86786a",22708:"8d1ec4c5",22749:"471dcc6f",22805:"e310b146",22869:"374427da",22874:"d8d13bad",23060:"7a801707",23475:"0a6f29e5",23476:"239ea6cd",23558:"68cedfd5",23597:"1a848321",23673:"5f1113d5",23686:"97a69baf",23717:"3a06bd86",24029:"11451be3",24066:"2f4b7a65",24144:"406b186f",24165:"07e96687",24285:"507e1a4c",24490:"06b1e92d",24724:"823f7700",24785:"853164ef",24880:"20f8de15",24981:"db6367fb",24998:"dfd4abb8",25275:"cb128a98",25474:"4aa43dae",25596:"122cd6da",25789:"ef4e0518",25908:"9ee43f4e",25948:"febd0338",25960:"341bd61f",26025:"e56b7427",26173:"reactPlayerVimeo",26529:"30ddeb5e",26933:"89594773",27098:"3874af3e",27153:"f77b4e82",27431:"0a61bc2e",27570:"070789e7",27572:"207ee67a",27721:"c0daf1e6",28109:"e0c8a1d6",28356:"4f0c7b96",28505:"d879ea04",28681:"1abd0bca",28968:"59b068d1",29010:"8e37cc44",29214:"f3954950",29225:"29cfecd2",29263:"36a143db",29286:"20a7d97c",29632:"7ee80f24",29664:"60a00565",29780:"7b20acf0",29891:"45b3f811",30044:"e1d93203",30165:"437618c4",30312:"614beed4",30491:"0c8b9afa",30521:"45b0764f",30650:"d6bd25e1",31136:"960d9980",31153:"1c091541",31472:"fa811662",31586:"8e97cc15",31805:"5e450bcf",31863:"caaf01d4",31883:"421999d2",32349:"a1b695db",32450:"c302b7f6",32452:"bd83a8c8",32736:"3bc428dc",32840:"3cf47477",32909:"c6cf652c",32946:"4aaa0f44",33015:"5575e2a8",33188:"bfb1735a",33656:"31d20e13",34037:"f6525c87",34149:"b69843a1",34270:"cc826739",34290:"a6a264d3",34446:"b1212599",34465:"fcdeb347",34467:"9b3efc75",34483:"b5efef1d",34533:"d6247adb",34720:"0452e1bb",35080:"af4b7be4",35448:"7b2e7fac",35491:"a7ce3f25",35502:"565d3b3a",35580:"d4c834e8",35632:"dff30c03",35634:"c6dfd94e",35635:"ecfe8209",35659:"4646a8a4",35739:"f2f7c8b6",36138:"bebb13e1",36192:"85c49f6d",36353:"reactPlayerPreview",36496:"12ebab0f",36638:"25057d02",36659:"e0ecd9df",36729:"96781795",36732:"3cc638e0",36904:"ffecbc46",36949:"ab0b43f0",37068:"4ef2e3ea",37109:"8ee77415",37119:"bd6858b9",37146:"22885a83",37507:"e4608243",37555:"e202e776",37643:"a6aa9e1f",37762:"89f741ca",37878:"845a8f5b",37943:"512d8cfa",38012:"274548c6",38193:"741a738c",38368:"b3022338",38389:"50711b5c",38440:"27e17dc0",38456:"c4643d70",38588:"f9dcbd56",38916:"cab54053",38991:"2db499ae",38992:"903c4f6f",38999:"53371809",39143:"186b492d",39311:"b85e9339",39646:"c7bf2a3a",39839:"e150ab3e",39928:"9b770ac0",39954:"8f102ef9",40069:"70b40441",40200:"d40361ad",40810:"0475f9cc",40817:"c0908e63",40953:"5b5d0fd6",40960:"bd8e6ec6",41015:"eec2ee36",41305:"1de77d44",41309:"6620b2c9",41738:"28411ba4",41811:"e7db057b",41829:"1f704a03",41838:"d98b9f83",41857:"37c880e2",42007:"4b75119c",42068:"9997aecf",42518:"c968f1a3",42717:"77e868d9",42795:"cc8c6322",42869:"6850cfb6",42919:"09a69b27",43067:"1e5c0d86",43181:"519cbeed",43318:"554f4bd3",43478:"3f85e7e0",43514:"dc72610b",43895:"073713d1",44146:"f24f0ea5",44502:"069211c5",44570:"d493c3e8",44596:"8256726e",45197:"6f69b847",45501:"da6f85e6",45612:"62b71d38",45747:"1ddde2c7",45826:"783bde4f",45894:"61428574",45966:"5426ac11",46084:"e5e83212",46105:"7778b814",46160:"216be533",46244:"771488fd",46447:"0210b704",46610:"20a5a532",46646:"88b398be",46666:"c08d79e7",46708:"32723a2e",46878:"56d56511",46985:"fcfb247d",46995:"c831614b",47055:"36788d15",47627:"reactPlayerStreamable",47752:"661132b8",47946:"e3450ac4",48035:"708cde07",48099:"10647879",48131:"4cff7ce2",48155:"ced1473c",48253:"ba11d205",48402:"097f4186",48543:"34bbb05d",48612:"cce9ad1c",48684:"9f91e03b",48721:"1074bb26",48806:"479e2d15",48965:"6d0c6131",49076:"208114e0",49183:"256aaf6c",49195:"1a98f2d5",49359:"984b8319",49440:"f30a3d1e",49471:"c77a0576",49534:"d2227473",49635:"33e1509d",49724:"a9bffa51",49733:"de4aaf36",49942:"bae79ca1",49945:"459956dd",50074:"5dfb628f",50213:"2158648d",50370:"1d48afb9",50371:"f08e269d",50685:"c2367e06",50739:"aa9c90f7",50816:"b198cec2",51093:"2f48bebc",51725:"890759ea",51739:"12f62dc2",51845:"c4fd3761",52074:"33844ff3",52165:"94c68899",52634:"c4f5d8e4",52711:"9e4087bc",52723:"reactPlayerMux",52761:"28a6a789",53434:"90d535c2",53440:"5efe417b",53446:"1bf956b0",54366:"1a43e018",54374:"bab68f7e",54386:"45062c3f",54422:"ec576a8b",54522:"14a767b9",54535:"1e27a2df",54602:"954fe712",54708:"2f989304",54770:"9e339b71",54785:"3c41cfdf",54829:"444d5ed4",54880:"1e26ddab",54986:"6a3a4a87",55169:"a3f9e536",55420:"fa746f0e",55528:"77354108",55580:"665c23b8",55603:"7d5cf9fd",55621:"d5e8cc91",55662:"bc4d6fc9",55673:"9d36e504",55938:"669b0b95",55939:"2e7fdd6f",56188:"a12f1ef9",56359:"e57c1bef",56444:"f76e6047",56683:"82453b48",56787:"c2d7f837",56886:"283e63f8",56918:"10eaf6bf",57062:"6c5c20d6",57277:"050638ff",57396:"cd7cc5b2",57436:"c85c4b26",57532:"8e0ad159",58236:"55ac83aa",58290:"e4f4dec4",58319:"45a8dc52",58382:"3e1cef53",58419:"4e3d1533",58424:"6bf3b56c",58548:"c64ebc62",58565:"e8b14a65",58581:"b3198ac5",58694:"d3433875",58700:"6fa39f86",59154:"6a6b8e69",59289:"eae3fa10",59569:"10915d97",59584:"776f5947",59612:"c3c79e6c",59644:"677d6777",59783:"450c527f",59919:"b973dcfd",60383:"2fd22369",60439:"acf97486",60473:"c1a814bd",60680:"1d970e9f",60785:"1b3816a8",60830:"9915a91d",61153:"08e43170",61316:"92bdb8f4",61321:"d3b3aab8",61377:"7a8aa347",61517:"5c7af219",61556:"39e9cb37",61611:"a6748c3f",61806:"3d5c28b0",61990:"f13ea377",62071:"1af9c7d3",62138:"1a4e3797",62224:"cce23dfc",62318:"24a5cb68",62590:"6ee59393",62608:"83170ae2",62630:"271f7228",62684:"f615a51d",62864:"60194cf2",62959:"3685f909",62998:"fba9f625",63267:"2127c55a",63288:"1c7cc376",63380:"4f989fdc",63399:"cc3db60c",63493:"608d3bbe",63720:"291e387f",63761:"500fb0e6",63817:"ede583c5",63877:"699a47d0",63924:"fe36bf36",63993:"cfc8229c",64078:"aea1a378",64196:"ed03f5d4",64293:"b0055554",64455:"861bd1f8",64534:"7d8e4827",64542:"97bb0f58",64604:"c3a6b316",64631:"237f254e",64678:"99d25280",64917:"b50d6289",64922:"e19908fc",64972:"d5bc6e48",65250:"6479f562",65541:"f5d5b73d",65664:"12f94a3a",65767:"8eb4e46b",65856:"15d749b5",65872:"3e171e78",65958:"e709bacf",66227:"8977ff65",66248:"4549cb79",66290:"0018b769",66352:"89c724a9",66435:"34298da9",66455:"964386c1",66578:"342f32a4",66814:"8660c4b6",66886:"8ed61535",66939:"4f8f7d74",67109:"a8faecbd",67351:"39906be8",67472:"814f3328",67570:"reactPlayerMixcloud",67714:"7f0b639b",67796:"afbc2852",67882:"8d6bb331",68063:"e2c66a78",68074:"13a2a5ae",68371:"29bb06c8",68495:"747a690f",68670:"b6379448",68749:"c2be96f9",68773:"55bb925b",68795:"b083e7a6",68831:"7f2f79c2",68951:"1ff7f4b8",69445:"6de65b44",69693:"1385f2e4",69738:"acd02317",69979:"reactPlayerSoundCloud",69987:"dbbfaad4",70001:"723d2f26",70092:"afd0cb1b",70131:"22ff6767",70321:"029e4dc3",70612:"4980c4fa",70804:"03cd8e1c",70806:"ef9227ec",70897:"a8c84974",71298:"bc07532a",71317:"6d30ac0a",71333:"94b64e1c",71494:"4224ef00",71500:"1e9ef283",71659:"f2b4d23e",71753:"57fbf2bd",71760:"0d1eeea0",71886:"0f427d40",72211:"30995fb4",72482:"5ffd6909",72637:"b37711b1",72700:"869c9c27",72795:"4bff3e73",72825:"31b72ec5",72844:"dd13b434",72920:"a22153eb",72969:"385718d4",73609:"83218c8a",73718:"fb5b11b0",73765:"5bcd0da1",73889:"868893ac",73936:"7f6bbd73",74276:"fd5d515c",74307:"8b77e1a5",74391:"352bf367",74484:"035d0344",74661:"c942fcda",74673:"5ede04c0",74801:"8b0d3319",74944:"006fd865",75055:"c3a5a911",75120:"f77d5673",75132:"4256eaf4",76023:"cb759659",76073:"a5fe4d7b",76152:"78469ba2",76206:"9da9a498",76354:"aae0663e",76777:"4649e1c2",76829:"8328e7f1",76903:"cabfe087",76939:"05e78500",77751:"69802526",77759:"e802237a",77800:"68987ad2",77849:"4b2ec4d2",78131:"3062d10d",78207:"f9ed4079",78417:"cc135780",78564:"a5bc4f28",78682:"916b8fda",78959:"f13d29f3",78960:"40fd761e",78997:"de387681",79074:"6f4af312",79156:"b1ecb9ed",79234:"1954649e",79566:"b2b9b866",79709:"4a487c7d",79957:"f5fdaecd",79985:"d776f897",80218:"bb40a730",80375:"ea07b8e0",80495:"ed48b979",80614:"73578edf",80665:"3124230e",80722:"fa9fb131",80878:"c76eb7d5",81057:"f5466782",81084:"16aa9458",81202:"c3b63204",81271:"84810683",81397:"75d9ae63",81470:"199fcd36",81471:"02371d76",81678:"a7434565",81707:"4ef508e9",81784:"97feb4e9",81820:"31c4e4e2",81844:"bfbf9dff",81886:"9eb4e0db",81930:"8310c4f6",81948:"dc14f0c4",82214:"f64a2f66",82230:"2f06f2be",82277:"0b31129f",82284:"8435c5ad",82402:"c275b7b1",82646:"4cbb880b",82698:"75ae40a4",82925:"78b226dc",83071:"a817f8e6",83164:"e19d86f2",83249:"ccc49370",83261:"5cecf783",83331:"c2d56c21",83556:"7b81a468",83855:"67c4a832",84164:"ffc1986f",84190:"1d01589c",84398:"1cd349ba",84778:"4f3e32ec",84813:"6875c492",84877:"833f2ec0",85159:"4be7e5d0",85186:"5653e10f",85196:"86b52bb0",85247:"e175f9f3",85732:"60f1bcf9",85864:"3d8bf3ab",86398:"0c6d1616",86537:"d9cb599e",86595:"55cceff7",86757:"326c0af7",86887:"reactPlayerFacebook",86944:"3f45f80c",86963:"d523bad7",87118:"c541efc4",87251:"6bb55549",87284:"460d220e",87592:"5fa25c43",87683:"879bb888",87733:"6aa8733e",87791:"cfba059f",87817:"5c0c3c72",87970:"403863d9",88007:"d1c7c525",88021:"9bf3c520",88199:"5e1c9ef2",88318:"b6997bf2",88462:"fca34444",88501:"d40de319",88572:"43f8b4ce",88714:"1be78505",88963:"f5f1347d",89267:"a7023ddc",89588:"376ff700",89729:"c0f0637e",89737:"87d0342b",89816:"5de53f8e",89831:"919ee986",89840:"fbcdd0ee",89915:"f7c12f45",89963:"f7765531",90023:"f38541c0",90575:"e436cfad",90776:"64ec14d2",90892:"92af7f04",91045:"192eff61",91195:"7a35092c",91288:"6536e94a",91384:"5a047bf8",91772:"b942cf8e",92058:"8446e86b",92273:"65e8e75e",92275:"6c8cf0bf",92282:"7cb85c78",92648:"d88d25ac",93019:"8e10bb86",93040:"60e9e07a",93133:"6680323d",93255:"29a36bd7",93488:"b5bd7f9b",93639:"f3f3787d",93744:"6ccb7d3e",93963:"8e40e0a9",94082:"d060dfa6",94183:"54e91ab5",94248:"07987921",94328:"9c1835bf",94381:"26c54994",94395:"c98ac358",94603:"fa56ac42",94617:"a9d6ad8a",95088:"1578031d",95155:"233cd645",95182:"92009f0a",95183:"ef4780b0",95406:"d80cee7e",95638:"96ecf107",95894:"b2f554cd",95919:"87a2f1fc",95924:"9f0412f1",96039:"f48233a1",96092:"bd16d6fd",96095:"f259cf74",96296:"3fa9568c",96431:"dc819e53",96632:"371b21cb",96752:"f7f75c2e",96886:"a0799a2b",96998:"21b56577",97026:"285ad496",97061:"ea642db2",97202:"a9808524",97215:"80a6599d",97342:"ceb3f8e5",97450:"c260b9a0",97458:"reactPlayerFilePlayer",97543:"c5495231",97788:"38eccbde",97823:"2d52fc42",97891:"a03f8b02",97902:"d0ac1c30",98196:"bcf9457e",98197:"2d68e16b",98230:"13c3e084",98581:"935f2afb",98632:"84c1f0c8",98952:"c1dc13d0",98982:"0f438a70",99017:"0a451647",99340:"reactPlayerWistia",99426:"d61e8580",99687:"5ad12221",99762:"a69ebe5f",99924:"c4816122",99965:"1280552c"}[e]||e)+"."+{182:"9c1c55c9",185:"c3151af5",414:"4bac948a",535:"2c29b462",825:"62089cb8",1100:"0d6eafb4",1101:"83e3b7a6",1102:"df8651a8",1104:"d4a6bf4c",1212:"a4bb5879",1281:"198643f3",1356:"aaffa684",1372:"afac1084",1468:"a90a2be2",1511:"968319a4",1705:"68cbc15a",1905:"7dd3f501",2280:"0532f8f9",2782:"0909c8f8",2928:"a3c25052",2959:"96e1a6c0",3181:"0b13f711",3237:"db39c0e1",3296:"f106e1ad",3336:"55759329",3392:"090f5cb6",3430:"28e262ec",3482:"de7091dd",3663:"fb3a8aa4",3704:"761ae3ae",3970:"a07332e7",4207:"979cb569",4212:"55743104",4343:"0d8d5955",4501:"f1e3909f",4711:"5b0e777a",5387:"713cacd0",5456:"e9f5e759",5661:"cb663b51",5731:"d86813b9",5843:"856df5f6",5931:"2f753b36",5933:"d3ce1ef1",6014:"280eb338",6308:"1849bc06",6379:"02aafd26",6463:"600fc725",6580:"191e9ee5",6615:"959436a5",6914:"f3614784",6947:"3e234339",7031:"fcec0565",7129:"64959eb0",7284:"7f61149c",7408:"8098b950",7658:"6d443338",7684:"15bfc5ba",7727:"0239a7e9",7795:"8c050ec9",7996:"d3ea57ae",8035:"30e98b35",8041:"88220dec",8063:"ae462a39",8094:"2b951bdc",8132:"9b5f7c95",8209:"78a1e894",8229:"4d7d71b8",8275:"fd21aea9",8580:"0e33ef3c",8890:"c4ca3394",8945:"4806a4d1",9246:"8e33cef9",9455:"9a43ddcc",9462:"ed135407",9604:"56339883",9669:"4cd569f6",10037:"698cd8b5",10211:"e5af0d39",10278:"3d3d8e45",10373:"72cceb56",10390:"a5559a92",10588:"0701f71e",10711:"9965b635",10909:"67d6828f",11084:"34d8112e",11133:"3db1a60c",11430:"561dab91",11662:"08a9e529",11681:"ab1994e7",11840:"75e3b2e5",11841:"8c44669d",11845:"e026f204",11991:"fb8f2570",12042:"40a52000",12095:"fe86f6d0",12236:"7601beeb",12287:"139db6f6",12384:"1d7e20ac",12417:"f6b99e2c",12693:"bcc69a5b",12865:"ce5cfb7d",12893:"032f5b52",13067:"f5959e16",13278:"0b313f64",13388:"ddc87a0b",13446:"7fc32915",13554:"8de4bc13",13708:"d405ec00",13755:"5a024e0e",13949:"c1dbd82a",14102:"e057b44b",14167:"a4e3e000",14340:"21174714",14382:"93b0fe8d",14690:"9fa7696a",14712:"a9de602d",14736:"3c71c766",14833:"27b3a807",15045:"500a4bec",15388:"e0acaafc",15476:"dbef7ee6",15548:"e6e9b142",16055:"9591f7e8",16145:"76ff302b",16328:"ace8180a",16458:"21be0e7e",16476:"33196d6c",16680:"961eee10",17051:"b63b3f75",17150:"67eaf742",17357:"45918ae3",17363:"c9312210",17434:"83a32858",17464:"7812b09f",17572:"4660801d",17794:"a7dc3b22",18042:"ae379aee",18401:"09ef5d0b",18446:"c190a89e",18509:"f6fd2866",18583:"6a786408",18613:"5d6a7566",18756:"5bbe6e79",18790:"ca3f42d8",19053:"9cb67ee4",19121:"a87c1dcc",19290:"68e5b2cf",19520:"c6241a2e",19523:"e294e885",19672:"486fa936",19702:"c8619971",19724:"bc6f4b20",19873:"13e39441",20041:"0227e04a",20097:"0c44bf26",20118:"0c64e7d9",20212:"16de87f1",20341:"4d1b74f3",20363:"49be902c",20420:"b9254497",20446:"a7cdf3fa",20562:"1f40df70",20574:"a848397f",20774:"61e0df28",21058:"8012b015",21157:"27af1036",21300:"44e728ae",21528:"8c05941c",21596:"0cc9ea5d",22362:"b8b4dfb4",22598:"5b89e810",22708:"7c266a47",22749:"28ee1c1c",22805:"f83c1949",22869:"1d7b6624",22874:"966b32b9",23060:"c9d70fe2",23475:"d2fec848",23476:"152acddc",23558:"b1ec159b",23597:"d29c0544",23673:"5b040202",23686:"7429ef3e",23717:"e082fa62",24029:"d86f9cbd",24066:"659d6e01",24144:"e9e9ae6d",24165:"83609be0",24285:"2af9d774",24490:"8f773dfe",24724:"14c8490e",24785:"a1efa451",24880:"b5196068",24981:"3f1d4f26",24998:"23f34fda",25275:"03385785",25474:"10b1d6f3",25596:"f4af5570",25789:"dc3a6ded",25908:"6fc246fd",25948:"e011dc7d",25960:"d1865fc4",26025:"88c91062",26173:"9f478156",26529:"3bc171fb",26933:"d30ca425",27098:"fed509cb",27153:"04f4033a",27431:"d43a197b",27570:"6bfc0922",27572:"a8f468f6",27721:"f8c32166",28109:"8be4ad20",28356:"a7767872",28505:"92ac1e16",28681:"4a0d0fa7",28968:"bf2c88db",29010:"57920b38",29214:"92183d16",29225:"d623d89b",29263:"330945ac",29286:"83d822eb",29632:"e48a2412",29664:"1616ab82",29780:"730513ec",29891:"a6d3b23c",30044:"900e44df",30165:"c0feefa8",30312:"85aeb6b4",30491:"ad672914",30521:"1bf47862",30650:"8533893c",31136:"6ebc5513",31153:"c58b2dc5",31472:"7e0b8226",31586:"7ee588d2",31805:"d44f5a5f",31863:"0bcf475e",31883:"f5f387b6",32349:"cfd6d2bd",32450:"40e4f827",32452:"67edf930",32736:"c59a7304",32840:"e32cf151",32909:"f517fcc0",32946:"ce4eaf4a",33015:"e5771962",33188:"d4f06d9d",33656:"0e128a6f",34037:"fb561a9e",34149:"d11d23b8",34270:"752cfd6e",34290:"8c34df1a",34446:"13b978b3",34465:"4fca7a5e",34467:"655d1e48",34483:"3aeaa7fd",34533:"752a6f47",34720:"853bbaf1",35080:"d62df70d",35448:"8da844a9",35491:"df38d157",35502:"c1456b15",35580:"7b743866",35632:"07156903",35634:"3fa29cda",35635:"d0a39215",35659:"e233b89d",35739:"e64ecaf5",36138:"966b634c",36192:"840704fe",36353:"8391fcd4",36496:"3697a370",36638:"0936fff9",36659:"3337aa9c",36729:"6d80d127",36732:"5d47f1ee",36904:"bd4efb4b",36949:"778a1b41",37068:"39844a38",37109:"cce35bcd",37119:"9bc1f8e6",37146:"e8db795c",37507:"694c9141",37555:"894ce0e5",37643:"8e023d46",37762:"7b05b140",37878:"d2f56ed9",37943:"e0ef4754",38012:"72d977ed",38193:"910a0b33",38368:"86585837",38389:"45446d1f",38440:"501913ea",38456:"a6b4f291",38588:"c25d28a7",38916:"2af91dae",38991:"c3806475",38992:"eec5aea5",38999:"59b5ba01",39143:"b5756612",39311:"aad4b13d",39646:"c40bc534",39839:"4770d6bf",39928:"3d07bd92",39954:"9daccfff",40069:"7ed52e05",40200:"d9ede400",40810:"061c37d4",40817:"9dbc424c",40953:"559cc0a3",40960:"b6627816",41015:"90c248ab",41305:"3b1fece8",41309:"166154e1",41738:"24fd2060",41811:"9cf426e4",41829:"6a7ea047",41838:"c78e3d82",41857:"68880f11",42007:"cb317052",42068:"d9edbc1c",42518:"86a08b41",42717:"b7425ae4",42795:"3e028652",42869:"b9ba3760",42919:"31b11c0a",43067:"8ddbbfa2",43181:"ae14d176",43318:"dba7aebc",43478:"68b3dcfb",43514:"da6222a3",43895:"68160b04",44146:"816b0446",44502:"1d4ae577",44570:"6cf951f6",44596:"a6d39f88",44839:"9ce9935a",45197:"3ec21f78",45501:"9ba51a07",45612:"37d3537a",45747:"192792b5",45826:"62f4f316",45894:"bfb88519",45966:"53075fe5",46084:"1c4682ef",46105:"86de2c9b",46160:"aa960b7d",46244:"cd1d2f2c",46447:"5a47951a",46610:"531d4e24",46646:"d354548e",46666:"921bf04d",46708:"4dc9772f",46878:"b509f7f7",46985:"a8cfbd6f",46995:"b1858733",47055:"7236f4a9",47113:"65880b18",47627:"61fd1f01",47752:"f8048057",47946:"2d6afe3b",48035:"ac895284",48099:"77305b62",48131:"75035205",48155:"35b5054d",48253:"5eb32af3",48402:"9606b387",48543:"b0d87d42",48612:"88bab5bf",48684:"b013ecd0",48721:"e685b14f",48806:"bd148f5a",48965:"a6828336",49076:"57a5b447",49183:"7b9c94bb",49195:"c4eda0e9",49359:"64d1c0fe",49440:"0721c498",49471:"920de758",49534:"cbc2049f",49635:"eb7438a7",49724:"8c523b28",49733:"172a3ddb",49942:"4cae2a11",49945:"b7753dbd",50074:"1a67a021",50213:"e912fa36",50370:"e8e09d25",50371:"0205d406",50685:"90c425f7",50739:"7212b433",50816:"57dfbb8f",51093:"41879319",51725:"b3b484c8",51739:"0b6d5daf",51845:"eacd4b98",52074:"9cdf105b",52165:"5cca0c54",52634:"8f185e78",52711:"d34e3f47",52723:"303ed67a",52761:"ea708a59",53434:"69dc6fef",53440:"ffbc7a5c",53446:"26189ee8",54366:"650f8f6c",54374:"c6f26add",54386:"879d6f49",54422:"a91b7973",54522:"af414017",54535:"77dac830",54602:"c50f3eaf",54708:"da2c9c90",54770:"a3c2c2c2",54785:"4ea84da4",54829:"b72b01b8",54880:"acdd1572",54986:"2c5cc9eb",55169:"9d782db9",55420:"2aa6d9d4",55528:"30911308",55580:"64ff5123",55603:"2c5aa5fb",55621:"3f9a5c5f",55662:"0637450d",55673:"2937a0f7",55938:"47a5ee51",55939:"2b5ab75a",56188:"454cb07b",56359:"0c4dc962",56444:"8fdf39e0",56683:"1b13998b",56787:"765073a2",56886:"1b672b06",56918:"c9463b4b",57062:"42dac777",57277:"53ab8e7a",57396:"8ffb1e99",57436:"75faecb8",57532:"822a19a5",58236:"a8d3be3b",58290:"88af57aa",58319:"e81eac6b",58382:"edc77b5b",58419:"dec2fff0",58424:"c78f2ff2",58548:"4114122d",58565:"3b680e25",58581:"eeb3ab8a",58694:"1b0a3abf",58700:"30b5efa5",58913:"ad6fc8d2",59154:"8ccd37ed",59289:"051cfb11",59569:"382b4067",59584:"d6a86576",59612:"b7c57060",59644:"ca771ba3",59783:"87fd0d82",59919:"eece923f",60383:"c44153a4",60439:"0fb59c60",60473:"e68ba11c",60680:"cf67bc26",60785:"64dca330",60830:"a2892113",61153:"5d8b3042",61316:"af9b26bb",61321:"ea3eafd1",61377:"48db1f76",61517:"1088e74e",61556:"4853cb23",61611:"fd586ef6",61806:"3f9c98fe",61990:"0a3e34ef",62071:"374b5717",62138:"4fc12286",62224:"eae39005",62318:"a02e8326",62590:"e6546c21",62608:"e640ce41",62630:"e172ac19",62684:"6e673e62",62864:"7a9d7aaa",62959:"2b6e92c3",62998:"94754958",63267:"cccfec41",63288:"d30aac63",63380:"79a4373a",63399:"d653a0d6",63493:"6275ef97",63720:"70f50862",63761:"d4260b12",63817:"33aa1df6",63877:"8ce7ea27",63924:"5459631c",63993:"56082fd1",64078:"6f8b52e8",64196:"73acb3c7",64293:"002f5ba8",64455:"1446f731",64534:"c04413c5",64542:"15bd8f93",64604:"413a66a5",64631:"e00e4962",64678:"5502d8aa",64917:"bba8dbb4",64922:"fae43783",64972:"0e224a16",65250:"fc035a3b",65541:"84de84ff",65664:"c055b652",65767:"757b7ddc",65856:"918827ad",65872:"54281de8",65958:"a6e9b260",66227:"339ab67a",66248:"b738dbdd",66290:"1b95d1d8",66352:"631b03f2",66435:"b19c736b",66455:"4d531664",66578:"f55f5147",66814:"8d9c4c49",66886:"fe2fb3c0",66939:"0323bfe6",67109:"6b39c98c",67351:"7db56a57",67472:"82394f90",67570:"4ce54898",67714:"9317435e",67796:"4f1224e1",67882:"83407aa9",68063:"254796f8",68074:"7de94275",68371:"c5024786",68495:"d5c9ec21",68670:"a8fd2c4c",68749:"32739393",68773:"4cb4d536",68795:"fbd00dee",68831:"f2b75a8e",68951:"b530ac8f",69445:"0e6a6934",69693:"0a5b1e6f",69738:"52baffda",69979:"0b5349be",69987:"ae3d4421",70001:"08613bf7",70092:"6caeb39b",70131:"80ac857e",70321:"37cf6250",70612:"f16baee4",70804:"025e7aca",70806:"b5d96fe8",70897:"1193f50d",71298:"b008b038",71317:"ec407eb8",71333:"3c2af055",71494:"0afc3b29",71500:"c9776aa7",71659:"222a3580",71753:"eab0d9fb",71760:"576fb43c",71866:"6f58dc76",71886:"bc09dd50",72211:"fae06709",72482:"bcf8204d",72637:"5d377ab2",72700:"3cb63417",72795:"a1b7b87c",72825:"c302d543",72844:"1d3decab",72920:"5f451553",72969:"adf5cd25",73609:"dc28a46f",73718:"cee23dbc",73765:"78942fb5",73889:"c1409c78",73936:"02247d11",74276:"bb38dd22",74307:"e0f87d20",74391:"f8983db3",74484:"90146d25",74661:"eaa43db6",74673:"418f2299",74801:"f09a6583",74944:"7d683ad2",75055:"9848b7da",75120:"7e223bcc",75132:"4fda19a1",76023:"f6f4bb14",76073:"23dd006f",76152:"4f90dddb",76206:"138c8900",76354:"fa2e5e59",76777:"eee3eed7",76829:"097ab0c2",76903:"4f1205a9",76939:"0e253952",77751:"5090b4be",77759:"ed24674d",77800:"64aa277c",77849:"fb9ad6b4",78131:"bf90d51e",78207:"6c0dd001",78417:"1770b5fb",78564:"222d02de",78682:"3cf80e26",78959:"a5dc87ee",78960:"fb3edd33",78997:"9e7109d8",79074:"fafec232",79156:"0a2e12ab",79234:"87b75812",79566:"33ed3463",79709:"bdbb5ac0",79957:"4acb1a2e",79985:"96b89907",80218:"161f176b",80375:"6c7c80b9",80495:"712fd7c1",80614:"796f513a",80665:"0ae1c229",80722:"8aefd0fe",80878:"4813ccff",81057:"654e2063",81084:"db7e93e0",81202:"d987ce13",81271:"108c3c8f",81397:"5f111be5",81470:"891008c7",81471:"45ae7b3e",81678:"a16fd3c0",81707:"79b083f1",81784:"b260457c",81820:"adbfa883",81844:"3c03d2af",81886:"4020e581",81930:"d675ceaf",81948:"05a3a5dc",82214:"398ad0db",82230:"0688234e",82277:"294672c7",82284:"ad167894",82402:"7644e779",82646:"f317fec6",82698:"f3049d6d",82925:"b9350213",83071:"819ea0a3",83164:"b58a1003",83249:"ae142aec",83261:"0867c1ef",83331:"0728eec1",83556:"12aaf92a",83855:"cbdf093c",84164:"a704db3f",84190:"a782d704",84398:"4aab6c0b",84778:"f4a63b10",84813:"92b08a79",84877:"8a851d06",85159:"7ee5ee37",85186:"4ad9caeb",85196:"9c9d48a2",85247:"07374c58",85732:"50e237ec",85864:"e7d1e32b",86398:"ca51d8e4",86537:"983f845a",86595:"42d5b548",86757:"d34315db",86887:"9c552f79",86944:"9d080dab",86963:"2d7e53b1",87118:"9d4dc3e5",87251:"92feef5e",87284:"88c2fb53",87592:"21a28f16",87683:"83aeb9c4",87733:"8aa975fe",87791:"7b2300a4",87817:"db975395",87970:"06d85d62",88007:"089421a7",88021:"b780e14d",88199:"97fc7f25",88318:"43bca794",88462:"4775e794",88501:"ce0052bd",88572:"9ef5a9ac",88714:"4a261334",88963:"2bc62970",89267:"a61489e7",89588:"dafadf7b",89729:"aaf31325",89737:"221b96aa",89816:"e6a8799f",89831:"2f10e678",89840:"3c683391",89915:"7c367d61",89963:"ef6ec695",90023:"5147a39f",90329:"097040f5",90416:"ba76a62b",90575:"b8f10625",90776:"3f8963d1",90892:"24f98e28",91045:"937a544a",91195:"004e48b7",91288:"6e5dd106",91384:"aa6ea9a0",91772:"fa72fd6b",92058:"6bb08a4f",92273:"dc77db14",92275:"6878af12",92282:"a1e9b3c3",92648:"8f4ff553",93019:"b08ed4de",93040:"dc33c940",93133:"10e86767",93255:"3ef1ddd9",93488:"961ee555",93639:"5a61d02f",93744:"ea3cf319",93963:"d7176885",94082:"fd7b597c",94183:"0109e060",94248:"7da08bee",94328:"9eea0742",94381:"fb078950",94395:"962cd93c",94603:"2d2d3ce0",94617:"6fc511a0",95088:"cad11947",95155:"0f612903",95182:"424502af",95183:"d8afe4ab",95406:"d053099d",95638:"85d617da",95894:"50e9599f",95919:"a96189a6",95924:"0e4a38a2",96039:"d2d42582",96092:"4a335e4a",96095:"76c37447",96296:"465ed963",96431:"a9f6501e",96632:"ce0b342e",96752:"50780fc2",96886:"b34fb898",96998:"59d07b35",97026:"de39be31",97061:"51307200",97202:"e7f836e8",97215:"9fb5a9d9",97342:"87dcc389",97450:"749f8f23",97458:"8795f2db",97543:"37b4a1ba",97788:"4813b5b9",97823:"23a8a58c",97891:"f92536bb",97902:"97ca5b7e",98055:"131b4810",98196:"143d8e20",98197:"47aad54f",98230:"0a540df5",98581:"ee3d7a6f",98632:"950740b9",98952:"9c4deea1",98982:"9d0c575c",99017:"00d06eee",99340:"101b7b13",99426:"c9334111",99687:"4555de3a",99740:"9355cb55",99762:"4bc0eb76",99831:"8f1df9f6",99924:"6ed07fae",99965:"358b28d0"}[e]+".js",t.miniCssF=e=>{},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),a={},b="@openfn/docs:",t.l=(e,f,c,d)=>{if(a[e])a[e].push(f);else{var r,o;if(void 0!==c)for(var l=document.getElementsByTagName("script"),n=0;n{r.onerror=r.onload=null,clearTimeout(s);var b=a[e];if(delete a[e],r.parentNode&&r.parentNode.removeChild(r),b&&b.forEach((e=>e(c))),f)return f(c)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),o&&document.head.appendChild(r)}},t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.p="/",t.gca=function(e){return e={10647879:"48099",17896441:"18401",53371809:"38999",61428574:"45894",69802526:"77751",77354108:"55528",84810683:"81271",89594773:"26933",90377122:"20118",96781795:"36729",d1e2a1e4:"182","56b2a431":"185","6af54863":"414","5153790b":"535","8fa4918e":"825",fec351f2:"1100",d04fedb5:"1101","1ef0096b":"1102","5f0cc255":"1104","734563d5":"1212",dc62dd6c:"1281",e967512d:"1356",e480871d:"1372",b1be30d1:"1511",cd8c9fbc:"1705","9d4548fb":"1905",e51254c6:"2280","0e04b402":"2782","125cb29e":"2928","33fb6ca4":"2959",a9d16e82:"3181",b987a5c1:"3237",a555a233:"3296",f98b80b4:"3336",reactPlayerVidyard:"3392",cee49d1f:"3430","186444dd":"3482",def6dfb9:"3663",d9a6c9f9:"3704","133b4df0":"3970","81eac5d3":"4207",e866f873:"4212","419e73d5":"4343","8dc27084":"4501","81e594d4":"4711","4c2772ab":"5387",d4e06cde:"5456","5d42a18a":"5661","5610898c":"5731",e6102057:"5843","998a3ebe":"5931",fe66a3bc:"5933",babb54f3:"6014",af1b4014:"6308",cd910537:"6379",reactPlayerKaltura:"6463",fae4f913:"6580",e3a6d1ec:"6615","2c828998":"6914","898d2911":"6947",ffa0c411:"7031",ce5aebf3:"7129","0918a7cd":"7284",b31fa192:"7408",bb8cf488:"7658","193bf152":"7684","92e661e4":"7727","20501ae4":"7795","89ebc8eb":"8035",d44f5d69:"8041",ea0d3e91:"8063","77faeb23":"8094",c4429c79:"8132","01a85c17":"8209",a13b9d31:"8229",e2548c92:"8275",f7d07906:"8580","4cd34504":"8890","4ba520f6":"8945","9bb632fa":"9246","6e9a1c5f":"9455","3035a8de":"9604","277d517a":"9669","14ee1fe9":"10037","524c9166":"10211","5385774b":"10278","5f0700c5":"10373","7356945f":"10390",f93f95da:"10588","85f847a7":"10711","60ab92b2":"10909","75270caf":"11084",a20e070a:"11133","0564f87a":"11430","2bf9c0b5":"11662","74ea6b63":"11681","5fb0ec3e":"11840",fe1d477d:"11841",da184dc1:"11845",b2b675dd:"11991",reactPlayerTwitch:"12042","9e96f049":"12095",f50ed874:"12236",acfb9a5e:"12287","22ef07eb":"12384",c6fe0741:"12417",c333ed9f:"12693","3f2ad086":"12865",e4a50065:"12893","81ce5e0c":"13067",a2e81b6d:"13278","5f6910fd":"13388",d015beca:"13446","09b23959":"13708",a3efb982:"13755",eb4eb408:"13949","2a413a18":"14102",aacecf0a:"14167","2dcd28d2":"14340","5f87d652":"14382","44ea6f94":"14690",db759789:"14712","330b8ea1":"14736","46bd2088":"14833","14ad7d65":"15045",fe5f889f:"15388","14709bd0":"15476","247783bb":"15548","7b9ab678":"16055","58cbfb5a":"16145",reactPlayerDailyMotion:"16328",a14a2602:"16458","3a03215d":"16476","2bb14bf0":"16680","6738a51a":"17051","6cb21577":"17150","1140a058":"17357","6310fd48":"17363","9e1f7384":"17434","7fdc0c84":"17464","3947b16e":"17572",f5ff4ddf:"17794","36ded102":"18042",reactPlayerYouTube:"18446","48052ce1":"18509","60b808f2":"18583",ece86388:"18613","1ee9c635":"18756","92999a1c":"18790","82092fc0":"19053","3a574a7f":"19121","9afa6cde":"19290",f2ca2c55:"19520",deb190e6:"19523","203262b0":"19672","8f8e3a33":"19702",b1f7255a:"19724",aa1b4e53:"19873","81c93763":"20041",e7b8679f:"20097","5f16d91a":"20212","11e6d144":"20341","63eaaafc":"20363",e2c3bc5f:"20420","5e1dea11":"20446","853ddb5d":"20562","126d2d8d":"20574",fc5ff77a:"20774",ea369cdd:"21058",abb76970:"21157","2e5976f3":"21300","6556faa5":"21528",a54058d6:"21596","5e95c167":"22362","1f86786a":"22598","8d1ec4c5":"22708","471dcc6f":"22749",e310b146:"22805","374427da":"22869",d8d13bad:"22874","7a801707":"23060","0a6f29e5":"23475","239ea6cd":"23476","68cedfd5":"23558","1a848321":"23597","5f1113d5":"23673","97a69baf":"23686","3a06bd86":"23717","11451be3":"24029","2f4b7a65":"24066","406b186f":"24144","07e96687":"24165","507e1a4c":"24285","06b1e92d":"24490","823f7700":"24724","853164ef":"24785","20f8de15":"24880",db6367fb:"24981",dfd4abb8:"24998",cb128a98:"25275","4aa43dae":"25474","122cd6da":"25596",ef4e0518:"25789","9ee43f4e":"25908",febd0338:"25948","341bd61f":"25960",e56b7427:"26025",reactPlayerVimeo:"26173","30ddeb5e":"26529","3874af3e":"27098",f77b4e82:"27153","0a61bc2e":"27431","070789e7":"27570","207ee67a":"27572",c0daf1e6:"27721",e0c8a1d6:"28109","4f0c7b96":"28356",d879ea04:"28505","1abd0bca":"28681","59b068d1":"28968","8e37cc44":"29010",f3954950:"29214","29cfecd2":"29225","36a143db":"29263","20a7d97c":"29286","7ee80f24":"29632","60a00565":"29664","7b20acf0":"29780","45b3f811":"29891",e1d93203:"30044","437618c4":"30165","614beed4":"30312","0c8b9afa":"30491","45b0764f":"30521",d6bd25e1:"30650","960d9980":"31136","1c091541":"31153",fa811662:"31472","8e97cc15":"31586","5e450bcf":"31805",caaf01d4:"31863","421999d2":"31883",a1b695db:"32349",c302b7f6:"32450",bd83a8c8:"32452","3bc428dc":"32736","3cf47477":"32840",c6cf652c:"32909","4aaa0f44":"32946","5575e2a8":"33015",bfb1735a:"33188","31d20e13":"33656",f6525c87:"34037",b69843a1:"34149",cc826739:"34270",a6a264d3:"34290",b1212599:"34446",fcdeb347:"34465","9b3efc75":"34467",b5efef1d:"34483",d6247adb:"34533","0452e1bb":"34720",af4b7be4:"35080","7b2e7fac":"35448",a7ce3f25:"35491","565d3b3a":"35502",d4c834e8:"35580",dff30c03:"35632",c6dfd94e:"35634",ecfe8209:"35635","4646a8a4":"35659",f2f7c8b6:"35739",bebb13e1:"36138","85c49f6d":"36192",reactPlayerPreview:"36353","12ebab0f":"36496","25057d02":"36638",e0ecd9df:"36659","3cc638e0":"36732",ffecbc46:"36904",ab0b43f0:"36949","4ef2e3ea":"37068","8ee77415":"37109",bd6858b9:"37119","22885a83":"37146",e4608243:"37507",e202e776:"37555",a6aa9e1f:"37643","89f741ca":"37762","845a8f5b":"37878","512d8cfa":"37943","274548c6":"38012","741a738c":"38193",b3022338:"38368","50711b5c":"38389","27e17dc0":"38440",c4643d70:"38456",f9dcbd56:"38588",cab54053:"38916","2db499ae":"38991","903c4f6f":"38992","186b492d":"39143",b85e9339:"39311",c7bf2a3a:"39646",e150ab3e:"39839","9b770ac0":"39928","8f102ef9":"39954","70b40441":"40069",d40361ad:"40200","0475f9cc":"40810",c0908e63:"40817","5b5d0fd6":"40953",bd8e6ec6:"40960",eec2ee36:"41015","1de77d44":"41305","6620b2c9":"41309","28411ba4":"41738",e7db057b:"41811","1f704a03":"41829",d98b9f83:"41838","37c880e2":"41857","4b75119c":"42007","9997aecf":"42068",c968f1a3:"42518","77e868d9":"42717",cc8c6322:"42795","6850cfb6":"42869","09a69b27":"42919","1e5c0d86":"43067","519cbeed":"43181","554f4bd3":"43318","3f85e7e0":"43478",dc72610b:"43514","073713d1":"43895",f24f0ea5:"44146","069211c5":"44502",d493c3e8:"44570","8256726e":"44596","6f69b847":"45197",da6f85e6:"45501","62b71d38":"45612","1ddde2c7":"45747","783bde4f":"45826","5426ac11":"45966",e5e83212:"46084","7778b814":"46105","216be533":"46160","771488fd":"46244","0210b704":"46447","20a5a532":"46610","88b398be":"46646",c08d79e7:"46666","32723a2e":"46708","56d56511":"46878",fcfb247d:"46985",c831614b:"46995","36788d15":"47055",reactPlayerStreamable:"47627","661132b8":"47752",e3450ac4:"47946","708cde07":"48035","4cff7ce2":"48131",ced1473c:"48155",ba11d205:"48253","097f4186":"48402","34bbb05d":"48543",cce9ad1c:"48612","9f91e03b":"48684","1074bb26":"48721","479e2d15":"48806","6d0c6131":"48965","208114e0":"49076","256aaf6c":"49183","1a98f2d5":"49195","984b8319":"49359",f30a3d1e:"49440",c77a0576:"49471",d2227473:"49534","33e1509d":"49635",a9bffa51:"49724",de4aaf36:"49733",bae79ca1:"49942","459956dd":"49945","5dfb628f":"50074","2158648d":"50213","1d48afb9":"50370",f08e269d:"50371",c2367e06:"50685",aa9c90f7:"50739",b198cec2:"50816","2f48bebc":"51093","890759ea":"51725","12f62dc2":"51739",c4fd3761:"51845","33844ff3":"52074","94c68899":"52165",c4f5d8e4:"52634","9e4087bc":"52711",reactPlayerMux:"52723","28a6a789":"52761","90d535c2":"53434","5efe417b":"53440","1bf956b0":"53446","1a43e018":"54366",bab68f7e:"54374","45062c3f":"54386",ec576a8b:"54422","14a767b9":"54522","1e27a2df":"54535","954fe712":"54602","2f989304":"54708","9e339b71":"54770","3c41cfdf":"54785","444d5ed4":"54829","1e26ddab":"54880","6a3a4a87":"54986",a3f9e536:"55169",fa746f0e:"55420","665c23b8":"55580","7d5cf9fd":"55603",d5e8cc91:"55621",bc4d6fc9:"55662","9d36e504":"55673","669b0b95":"55938","2e7fdd6f":"55939",a12f1ef9:"56188",e57c1bef:"56359",f76e6047:"56444","82453b48":"56683",c2d7f837:"56787","283e63f8":"56886","10eaf6bf":"56918","6c5c20d6":"57062","050638ff":"57277",cd7cc5b2:"57396",c85c4b26:"57436","8e0ad159":"57532","55ac83aa":"58236",e4f4dec4:"58290","45a8dc52":"58319","3e1cef53":"58382","4e3d1533":"58419","6bf3b56c":"58424",c64ebc62:"58548",e8b14a65:"58565",b3198ac5:"58581",d3433875:"58694","6fa39f86":"58700","6a6b8e69":"59154",eae3fa10:"59289","10915d97":"59569","776f5947":"59584",c3c79e6c:"59612","677d6777":"59644","450c527f":"59783",b973dcfd:"59919","2fd22369":"60383",acf97486:"60439",c1a814bd:"60473","1d970e9f":"60680","1b3816a8":"60785","9915a91d":"60830","08e43170":"61153","92bdb8f4":"61316",d3b3aab8:"61321","7a8aa347":"61377","5c7af219":"61517","39e9cb37":"61556",a6748c3f:"61611","3d5c28b0":"61806",f13ea377:"61990","1af9c7d3":"62071","1a4e3797":"62138",cce23dfc:"62224","24a5cb68":"62318","6ee59393":"62590","83170ae2":"62608","271f7228":"62630",f615a51d:"62684","60194cf2":"62864","3685f909":"62959",fba9f625:"62998","2127c55a":"63267","1c7cc376":"63288","4f989fdc":"63380",cc3db60c:"63399","608d3bbe":"63493","291e387f":"63720","500fb0e6":"63761",ede583c5:"63817","699a47d0":"63877",fe36bf36:"63924",cfc8229c:"63993",aea1a378:"64078",ed03f5d4:"64196",b0055554:"64293","861bd1f8":"64455","7d8e4827":"64534","97bb0f58":"64542",c3a6b316:"64604","237f254e":"64631","99d25280":"64678",b50d6289:"64917",e19908fc:"64922",d5bc6e48:"64972","6479f562":"65250",f5d5b73d:"65541","12f94a3a":"65664","8eb4e46b":"65767","15d749b5":"65856","3e171e78":"65872",e709bacf:"65958","8977ff65":"66227","4549cb79":"66248","0018b769":"66290","89c724a9":"66352","34298da9":"66435","964386c1":"66455","342f32a4":"66578","8660c4b6":"66814","8ed61535":"66886","4f8f7d74":"66939",a8faecbd:"67109","39906be8":"67351","814f3328":"67472",reactPlayerMixcloud:"67570","7f0b639b":"67714",afbc2852:"67796","8d6bb331":"67882",e2c66a78:"68063","13a2a5ae":"68074","29bb06c8":"68371","747a690f":"68495",b6379448:"68670",c2be96f9:"68749","55bb925b":"68773",b083e7a6:"68795","7f2f79c2":"68831","1ff7f4b8":"68951","6de65b44":"69445","1385f2e4":"69693",acd02317:"69738",reactPlayerSoundCloud:"69979",dbbfaad4:"69987","723d2f26":"70001",afd0cb1b:"70092","22ff6767":"70131","029e4dc3":"70321","4980c4fa":"70612","03cd8e1c":"70804",ef9227ec:"70806",a8c84974:"70897",bc07532a:"71298","6d30ac0a":"71317","94b64e1c":"71333","4224ef00":"71494","1e9ef283":"71500",f2b4d23e:"71659","57fbf2bd":"71753","0d1eeea0":"71760","0f427d40":"71886","30995fb4":"72211","5ffd6909":"72482",b37711b1:"72637","869c9c27":"72700","4bff3e73":"72795","31b72ec5":"72825",dd13b434:"72844",a22153eb:"72920","385718d4":"72969","83218c8a":"73609",fb5b11b0:"73718","5bcd0da1":"73765","868893ac":"73889","7f6bbd73":"73936",fd5d515c:"74276","8b77e1a5":"74307","352bf367":"74391","035d0344":"74484",c942fcda:"74661","5ede04c0":"74673","8b0d3319":"74801","006fd865":"74944",c3a5a911:"75055",f77d5673:"75120","4256eaf4":"75132",cb759659:"76023",a5fe4d7b:"76073","78469ba2":"76152","9da9a498":"76206",aae0663e:"76354","4649e1c2":"76777","8328e7f1":"76829",cabfe087:"76903","05e78500":"76939",e802237a:"77759","68987ad2":"77800","4b2ec4d2":"77849","3062d10d":"78131",f9ed4079:"78207",cc135780:"78417",a5bc4f28:"78564","916b8fda":"78682",f13d29f3:"78959","40fd761e":"78960",de387681:"78997","6f4af312":"79074",b1ecb9ed:"79156","1954649e":"79234",b2b9b866:"79566","4a487c7d":"79709",f5fdaecd:"79957",d776f897:"79985",bb40a730:"80218",ea07b8e0:"80375",ed48b979:"80495","73578edf":"80614","3124230e":"80665",fa9fb131:"80722",c76eb7d5:"80878",f5466782:"81057","16aa9458":"81084",c3b63204:"81202","75d9ae63":"81397","199fcd36":"81470","02371d76":"81471",a7434565:"81678","4ef508e9":"81707","97feb4e9":"81784","31c4e4e2":"81820",bfbf9dff:"81844","9eb4e0db":"81886","8310c4f6":"81930",dc14f0c4:"81948",f64a2f66:"82214","2f06f2be":"82230","0b31129f":"82277","8435c5ad":"82284",c275b7b1:"82402","4cbb880b":"82646","75ae40a4":"82698","78b226dc":"82925",a817f8e6:"83071",e19d86f2:"83164",ccc49370:"83249","5cecf783":"83261",c2d56c21:"83331","7b81a468":"83556","67c4a832":"83855",ffc1986f:"84164","1d01589c":"84190","1cd349ba":"84398","4f3e32ec":"84778","6875c492":"84813","833f2ec0":"84877","4be7e5d0":"85159","5653e10f":"85186","86b52bb0":"85196",e175f9f3:"85247","60f1bcf9":"85732","3d8bf3ab":"85864","0c6d1616":"86398",d9cb599e:"86537","55cceff7":"86595","326c0af7":"86757",reactPlayerFacebook:"86887","3f45f80c":"86944",d523bad7:"86963",c541efc4:"87118","6bb55549":"87251","460d220e":"87284","5fa25c43":"87592","879bb888":"87683","6aa8733e":"87733",cfba059f:"87791","5c0c3c72":"87817","403863d9":"87970",d1c7c525:"88007","9bf3c520":"88021","5e1c9ef2":"88199",b6997bf2:"88318",fca34444:"88462",d40de319:"88501","43f8b4ce":"88572","1be78505":"88714",f5f1347d:"88963",a7023ddc:"89267","376ff700":"89588",c0f0637e:"89729","87d0342b":"89737","5de53f8e":"89816","919ee986":"89831",fbcdd0ee:"89840",f7c12f45:"89915",f7765531:"89963",f38541c0:"90023",e436cfad:"90575","64ec14d2":"90776","92af7f04":"90892","192eff61":"91045","7a35092c":"91195","6536e94a":"91288","5a047bf8":"91384",b942cf8e:"91772","8446e86b":"92058","65e8e75e":"92273","6c8cf0bf":"92275","7cb85c78":"92282",d88d25ac:"92648","8e10bb86":"93019","60e9e07a":"93040","6680323d":"93133","29a36bd7":"93255",b5bd7f9b:"93488",f3f3787d:"93639","6ccb7d3e":"93744","8e40e0a9":"93963",d060dfa6:"94082","54e91ab5":"94183","07987921":"94248","9c1835bf":"94328","26c54994":"94381",c98ac358:"94395",fa56ac42:"94603",a9d6ad8a:"94617","1578031d":"95088","233cd645":"95155","92009f0a":"95182",ef4780b0:"95183",d80cee7e:"95406","96ecf107":"95638",b2f554cd:"95894","87a2f1fc":"95919","9f0412f1":"95924",f48233a1:"96039",bd16d6fd:"96092",f259cf74:"96095","3fa9568c":"96296",dc819e53:"96431","371b21cb":"96632",f7f75c2e:"96752",a0799a2b:"96886","21b56577":"96998","285ad496":"97026",ea642db2:"97061",a9808524:"97202","80a6599d":"97215",ceb3f8e5:"97342",c260b9a0:"97450",reactPlayerFilePlayer:"97458",c5495231:"97543","38eccbde":"97788","2d52fc42":"97823",a03f8b02:"97891",d0ac1c30:"97902",bcf9457e:"98196","2d68e16b":"98197","13c3e084":"98230","935f2afb":"98581","84c1f0c8":"98632",c1dc13d0:"98952","0f438a70":"98982","0a451647":"99017",reactPlayerWistia:"99340",d61e8580:"99426","5ad12221":"99687",a69ebe5f:"99762",c4816122:"99924","1280552c":"99965"}[e]||e,t.p+t.u(e)},(()=>{var e={45354:0,71869:0};t.f.j=(f,c)=>{var a=t.o(e,f)?e[f]:void 0;if(0!==a)if(a)c.push(a[2]);else if(/^(45354|71869)$/.test(f))e[f]=0;else{var b=new Promise(((c,b)=>a=e[f]=[c,b]));c.push(a[2]=b);var d=t.p+t.u(f),r=new Error;t.l(d,(c=>{if(t.o(e,f)&&(0!==(a=e[f])&&(e[f]=void 0),a)){var b=c&&("load"===c.type?"missing":c.type),d=c&&c.target&&c.target.src;r.message="Loading chunk "+f+" failed.\n("+b+": "+d+")",r.name="ChunkLoadError",r.type=b,r.request=d,a[1](r)}}),"chunk-"+f,f)}},t.O.j=f=>0===e[f];var f=(f,c)=>{var a,b,d=c[0],r=c[1],o=c[2],l=0;if(d.some((f=>0!==e[f]))){for(a in r)t.o(r,a)&&(t.m[a]=r[a]);if(o)var n=o(t)}for(f&&f(c);l - + @@ -73,7 +73,7 @@ re-victimization. Children might have to recount their whole case history, reliving their traumas time and time again in order to register and access each critical support service they needed.

    - + \ No newline at end of file diff --git a/blog/2020/05/31/the-new-openfn-blog.html b/blog/2020/05/31/the-new-openfn-blog.html index d9efcc3f8d1..2ee509ae61f 100644 --- a/blog/2020/05/31/the-new-openfn-blog.html +++ b/blog/2020/05/31/the-new-openfn-blog.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ scale, and all of the contributors to the OpenFn blog can post in the same place. You can still follow us and receive notifications by subscribing below, and we hope you'll do so.

    For now, happy integrating!

    — Taylor

    - + \ No newline at end of file diff --git a/blog/2020/06/04/Building-Integrated-Systems-That-Just-Work.html b/blog/2020/06/04/Building-Integrated-Systems-That-Just-Work.html index cbc305f3ce3..4459ab9e127 100644 --- a/blog/2020/06/04/Building-Integrated-Systems-That-Just-Work.html +++ b/blog/2020/06/04/Building-Integrated-Systems-That-Just-Work.html @@ -21,7 +21,7 @@ - + @@ -96,7 +96,7 @@ Solution Overviews - OpenFn. To get all the latest OpenFn updates, like us on Facebook and follow us on Twitter.

    - + \ No newline at end of file diff --git a/blog/2020/06/04/Technology-Isnt-The-Answer.html b/blog/2020/06/04/Technology-Isnt-The-Answer.html index 05f1a45fbc8..15e10d477b3 100644 --- a/blog/2020/06/04/Technology-Isnt-The-Answer.html +++ b/blog/2020/06/04/Technology-Isnt-The-Answer.html @@ -21,7 +21,7 @@ - + @@ -74,7 +74,7 @@ programs, and impact. So far, different organizations have integrated more than X number of technologies, including Open Data Kit (ODK), Kobo Toolbox, DHIS2, CommCare, Salesforce, custom databases, and more.

    - + \ No newline at end of file diff --git a/blog/2020/06/09/enabling-scale-at-myagro.html b/blog/2020/06/09/enabling-scale-at-myagro.html index 69740fdd33f..0ff1c3eabff 100644 --- a/blog/2020/06/09/enabling-scale-at-myagro.html +++ b/blog/2020/06/09/enabling-scale-at-myagro.html @@ -21,7 +21,7 @@ - + @@ -63,7 +63,7 @@ Mali.
  • With the help of OpenFn, myAgro worked with 120,000 farmers in 2019, and plans to scale towards its goal of reaching 1 million farmers by 2025.
  • myagro

    Read more about myAgro’s mission here, and stay tuned as myAgro continues to scale its OpenFn implementation.

    - + \ No newline at end of file diff --git a/blog/2020/06/10/iKapaData-Case-Study.html b/blog/2020/06/10/iKapaData-Case-Study.html index 2e0218c130a..5ff88abfb89 100644 --- a/blog/2020/06/10/iKapaData-Case-Study.html +++ b/blog/2020/06/10/iKapaData-Case-Study.html @@ -21,7 +21,7 @@ - + @@ -54,7 +54,7 @@ on CartoDB to display the locations already visited by enumerators.

    The real-time connection enabled live data monitoring for the team as iKapaData survey enumerators were conducting the survey.

    Learn more about OpenFn and SurveyCTO integrations here.

    - + \ No newline at end of file diff --git a/blog/2020/06/25/SwissTPH-case-study.html b/blog/2020/06/25/SwissTPH-case-study.html index cc72fd7fc04..6339f602fae 100644 --- a/blog/2020/06/25/SwissTPH-case-study.html +++ b/blog/2020/06/25/SwissTPH-case-study.html @@ -21,7 +21,7 @@ - + @@ -55,7 +55,7 @@ The Almanach tablet-based decision support tool supports health workers in diagnosing and treating sick children. OpenFn integrates this data with DHIS2 for real-time reporting.

    - + \ No newline at end of file diff --git a/blog/2020/07/01/KGVK-case-study.html b/blog/2020/07/01/KGVK-case-study.html index 81ec8415676..7d0c6576d01 100644 --- a/blog/2020/07/01/KGVK-case-study.html +++ b/blog/2020/07/01/KGVK-case-study.html @@ -21,7 +21,7 @@ - + @@ -45,7 +45,7 @@ access, KGVK can more regularly evaluate and adjust its programs to better serve the needs of the Jharkhand communities it serves.

    The photo above was originally posted on the KGVK Achievements site.

    - + \ No newline at end of file diff --git a/blog/2020/07/01/african-school-of-excellence-case-study.html b/blog/2020/07/01/african-school-of-excellence-case-study.html index f3fc6505fe3..511885bf15d 100644 --- a/blog/2020/07/01/african-school-of-excellence-case-study.html +++ b/blog/2020/07/01/african-school-of-excellence-case-study.html @@ -21,7 +21,7 @@ - + @@ -51,7 +51,7 @@ contact our team.

    The photo above was originally posted on the Wikimedia site under "WikiAfrica Schools training Africa School of Excellence."

    - + \ No newline at end of file diff --git a/blog/2020/07/01/airport-case-study.html b/blog/2020/07/01/airport-case-study.html index 25bba4d17a7..c869a340d59 100644 --- a/blog/2020/07/01/airport-case-study.html +++ b/blog/2020/07/01/airport-case-study.html @@ -21,7 +21,7 @@ - + @@ -53,7 +53,7 @@ staff.
  • HQ staff then use a leading industry tool (IBM Maximo) to store asset data, schedule maintenance, and perform performance analysis.
  • With real-time data syncs, OpenFn helps this airport ensure top-quality assets and service for its workers and passengers.

    - + \ No newline at end of file diff --git a/blog/2020/07/08/caris-foundation-case-study.html b/blog/2020/07/08/caris-foundation-case-study.html index 4022d398201..67b45c0dbb6 100644 --- a/blog/2020/07/08/caris-foundation-case-study.html +++ b/blog/2020/07/08/caris-foundation-case-study.html @@ -21,7 +21,7 @@ - + @@ -68,7 +68,7 @@ agent, and for external reporting.” Read our interview with Jennifer here.

    The photo above was originally posted on the Caris Foundation site.

    - + \ No newline at end of file diff --git a/blog/2020/07/13/x-runner-case-study.html b/blog/2020/07/13/x-runner-case-study.html index 5c1358c155e..e198e8cec9f 100644 --- a/blog/2020/07/13/x-runner-case-study.html +++ b/blog/2020/07/13/x-runner-case-study.html @@ -21,7 +21,7 @@ - + @@ -52,7 +52,7 @@ services and track customer issues. Salesforce reports help to easily identify issues for X-runner staff to immediately address.

    With this integrated service system, X-runner can deliver high quality customer service and technical assistance to their customers, with no time lag.

    - + \ No newline at end of file diff --git a/blog/2020/07/26/sinapis-case-study.html b/blog/2020/07/26/sinapis-case-study.html index 4d99081843d..caf1915be40 100644 --- a/blog/2020/07/26/sinapis-case-study.html +++ b/blog/2020/07/26/sinapis-case-study.html @@ -21,7 +21,7 @@ - + @@ -58,7 +58,7 @@ to learn more about their impact.

    The photo above was originally posted on the The Star. It features female entrepreneurs in Kenya undergoing Sinapis's finance training.

    - + \ No newline at end of file diff --git a/blog/2020/07/27/nalibali-case-study.html b/blog/2020/07/27/nalibali-case-study.html index e8cdffa89c6..75efdc8699d 100644 --- a/blog/2020/07/27/nalibali-case-study.html +++ b/blog/2020/07/27/nalibali-case-study.html @@ -21,7 +21,7 @@ - + @@ -61,7 +61,7 @@ their main website.

    The photo above was originally posted on the Nal'ibali Facebook page. It features children doing role play in order to practice conversation.

    - + \ No newline at end of file diff --git a/blog/2021/02/09/interoperability_for_case_referrals.html b/blog/2021/02/09/interoperability_for_case_referrals.html index 648ae65656b..ea4bbad8c5d 100644 --- a/blog/2021/02/09/interoperability_for_case_referrals.html +++ b/blog/2021/02/09/interoperability_for_case_referrals.html @@ -21,7 +21,7 @@ - + @@ -90,7 +90,7 @@ includes supporting the efforts of social workers across the country.

    About OpenFn Group: Open Function Group (“OFG”) helps health and humanitarian interventions in 40+ countries achieve scale and improve service delivery through automation, data integration, and interoperability solutions.

    - + \ No newline at end of file diff --git a/blog/2021/03/30/digital-global-good.html b/blog/2021/03/30/digital-global-good.html index 27c60e59a06..1bf8828357f 100644 --- a/blog/2021/03/30/digital-global-good.html +++ b/blog/2021/03/30/digital-global-good.html @@ -21,7 +21,7 @@ - + @@ -142,7 +142,7 @@ services@openfn.org for a free consultation.

    Also, be sure to stay tuned to our blog, or subscribe to our newsletter to stay up to date with all ICT4D integration related news.

    - + \ No newline at end of file diff --git a/blog/2021/07/30/processes-and-open-source-as-choice.html b/blog/2021/07/30/processes-and-open-source-as-choice.html index 97bed2d2b36..3d62e57ac78 100644 --- a/blog/2021/07/30/processes-and-open-source-as-choice.html +++ b/blog/2021/07/30/processes-and-open-source-as-choice.html @@ -21,7 +21,7 @@ - + @@ -118,7 +118,7 @@ services@openfn.org for a free consultation.

    Also, be sure to stay tuned to our blog, or subscribe to our newsletter to stay up to date with all ICT4D integration related news.

    - + \ No newline at end of file diff --git a/blog/2021/10/20/the-case-for-health-information-exchange.html b/blog/2021/10/20/the-case-for-health-information-exchange.html index 403c742ccca..74766880538 100644 --- a/blog/2021/10/20/the-case-for-health-information-exchange.html +++ b/blog/2021/10/20/the-case-for-health-information-exchange.html @@ -21,7 +21,7 @@ - + @@ -62,7 +62,7 @@ resources and learnings from dozens of implementations to deliver a suite of open-source documentation, implementation tools, and a templates library that fast-tracks interoperability and automation projects.

    For more information visit the links below:

    — Aicha

    - + \ No newline at end of file diff --git "a/blog/2022/06/28/Data-Integration-to-better-safeguard-the-world\342\200\231s-wildlife.html" "b/blog/2022/06/28/Data-Integration-to-better-safeguard-the-world\342\200\231s-wildlife.html" index 7a613de1f01..25d499d0227 100644 --- "a/blog/2022/06/28/Data-Integration-to-better-safeguard-the-world\342\200\231s-wildlife.html" +++ "b/blog/2022/06/28/Data-Integration-to-better-safeguard-the-world\342\200\231s-wildlife.html" @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@

    Data Integration to better safeguard the world’s wildlife

    · 4 min read

    Since 2020, the Wildlife Conservation Society (“WCS”) has leveraged the OpenFn Integration Toolkit to collect, clean, and integrate critical data for critical conservation programs targeting the world's largest wild places. WCS and its partners work at the frontline of conservation, and with support from OpenFn, they can automatically and seamlessly integrate and quickly analyse the masses of data collected across dozens of countries.

    WCS saves wildlife and wild places worldwide through science, conservation action, and collaborating with local communities and indigenous people.

    Climate change is happening right before our eyes. The 2019 Union Nations SDG Report found that as many as one million animal and plant species are in danger of extinction. Ergo, this also puts the people who highly depend on them at great risk. The earth’s demolition statistics are alarming, with “greenhouse gas emissions [having] doubled, raising average global temperatures by at least 0.7 degrees Celsius.” Less than 25% of the world can still be considered “wilderness”, urging that we must mitigate and avert these disasters without hesitation. Wilderness areas act as critical buffers against climate change, and as time goes on, these areas are diminishing due to global warming, leaving us vulnerable to climate disasters.

    WCS works with multiple data platforms and dozens of partners worldwide and needs an integration solution to enable interoperability and scale.

    With projects in nearly 60 countries and across oceans, WCS aims to re-establish a world where wildlife and people thrive in healthy lands and seas. WCS partners work on the frontline of conservation, ranging from Indigenous and local communities to national and local governments. Using mobile survey tools like KoBo Toolbox, WCS field staff can complete and submit data collection forms to track the well-being of local communities they support, local governance, reforestation activities, natural resource use, and other conservation and social science research data. WCS sought out OpenFN to integrate its data collection sources with one database for centralised analysis of all this information.

    OpenFn automates data pipelines from field to office, ensuring WCS decision-makers and researchers can access timely, accurate information.

    WCS implemented OpenFn to automate a standardised data flow between numerous wild meat consumption surveys and an MSSQL database to enable cross-partner data sharing and critical data analysis for a €45 million initiative. The initiative aims to curb unsustainable wildlife hunting, conserve biodiversity and improve food security.

    Since then, WCS has implemented OpenFn to support its partners from Conservation Social Science Partnership (“ConSoSci”). ConSoSci uses OpenFn to deploy and analyse research data collected in the field rapidly. One OpenFn solution auto-scans social science Kobo ToolBox surveys to then automatically:

    1. Build PostgreSQL and MSSQL databases and
    2. Integrate the databases, making the field data quickly available for analysis and eliminating multiple manual configurations and data integration steps typically handled by a software engineer.

    OpenFn integration

    OpenFn’s solution saves ConSoSci partners time and money, enabling researchers to access reliable data from multiple sources more quickly and effectively. They can then analyse this information to help address critical gaps in social science capacity, implementation, and accessibility in conservation.

    Thanks to the OpenFn Integration Toolkit, WCS has the digital infrastructure to efficiently scale its data collection, analysis, and sharing solutions to enhance interoperability across its programs and partners. OpenFn automatically syncs hundreds of records across dozens of WCS sites daily, enabling the WCS Conservation Technology Team to redirect its focus to its core work–empowering researchers working to mitigate continued environmental damage. WCS believes that “by discovering how to save nature, we can inspire the world to protect it”, and OpenFn is committed to helping conservation stakeholders automate this discovery process worldwide.

    To explore WCS and ConSoSci OpenFn solutions, check out the open-source code on GitHub (github.com/OpenFn/consosci). Next up for WCS are integrations between Kobo ToolBox and Asana. Stay tuned for more!

    Call to Action

    If you have questions about our WCS partnership or integration toolkit, head to community.openfn.org to connect and talk to like-minded social-sector integrators and OpenFn staff. We hope to see you soon!

    - + \ No newline at end of file diff --git a/blog/2022/10/06/Monitoring-program-enrollment-in-Brazil.html b/blog/2022/10/06/Monitoring-program-enrollment-in-Brazil.html index a935bc852b8..16a41410ce6 100644 --- a/blog/2022/10/06/Monitoring-program-enrollment-in-Brazil.html +++ b/blog/2022/10/06/Monitoring-program-enrollment-in-Brazil.html @@ -21,7 +21,7 @@ - + @@ -75,7 +75,7 @@ your questions on OpenFn Community. To learn more about Amp Impact for enhanced impact measurement and portfolio management see verasolutions.org.

    - + \ No newline at end of file diff --git a/blog/2023/03/01/open-human.html b/blog/2023/03/01/open-human.html index ca7db6bd5e1..3299c85f984 100644 --- a/blog/2023/03/01/open-human.html +++ b/blog/2023/03/01/open-human.html @@ -21,7 +21,7 @@ - + @@ -81,7 +81,7 @@ miss the company of my colleagues more than the comforts of home.

    Somewhere during this long pandemic, between fleeing an unsafe office and thriving in isolation, I Iost something. I forgot something important, something about connecting to people, something about society, the world, my place in it.

    In Cape Town, and with the humans of Open Function, I found it once more.

    An OpenHuman at Camps Bay Beach

    - + \ No newline at end of file diff --git a/blog/2023/04/13/lightning-beta.html b/blog/2023/04/13/lightning-beta.html index 1c2f01bac08..d998f09c7f9 100644 --- a/blog/2023/04/13/lightning-beta.html +++ b/blog/2023/04/13/lightning-beta.html @@ -21,7 +21,7 @@ - + @@ -56,7 +56,7 @@ deleted once viewed please state so in the email.

    If you would rather give your feedback in person, or have questions around using Lightning, please book office hours with our product manager Amber via the following link: https://calendly.com/amber-openfn/30min.

    - + \ No newline at end of file diff --git a/blog/2023/06/01/open-function-group.html b/blog/2023/06/01/open-function-group.html index 07ca75ac934..42d76e58682 100644 --- a/blog/2023/06/01/open-function-group.html +++ b/blog/2023/06/01/open-function-group.html @@ -21,7 +21,7 @@ - + @@ -92,7 +92,7 @@ delight... they have driven the product forward for the last 9 years and we can’t tell you how grateful we are for your continued support and willingness to contribute. Thank you.

    — Taylor

    - + \ No newline at end of file diff --git a/blog/2023/08/14/OS4H-case-study.html b/blog/2023/08/14/OS4H-case-study.html index 4838109d2b8..67f1551324e 100644 --- a/blog/2023/08/14/OS4H-case-study.html +++ b/blog/2023/08/14/OS4H-case-study.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@

    Open Solutions for Health delivers workflow automation for the St. Lucia Ministry of Health

    · 7 min read

    Open Solutions for Health (“OS4H”) is an Integrated Systems for Health collaborator and implementer specializing in providing enterprise support for free and open-source systems (FOSS). They customize small, mid-range and large open source health applications for Ministries of Health, medical councils, medical doctor practices, health groups and hospitals in the Caribbean. OS4H is also our first certified OpenFn implementation partner in the Caribbean, trained to deliver workflow automation projects to help their regional partners achieve health systems interoperability.

    Peter Ricketts, CEO at OS4H, says the Dominica-based team provides sustainable solutions designed to meet the needs of organizations in small island developing states (SIDS) that will strengthen their health management operations. While OS4H specializes in digital health implementations for the Caribbean, their team of IT specialists also works across other sectors, including education and agriculture.

    “At OS4H, our mission is to improve health outcomes by matching the right technologies to the problems and build the supporting framework around it to ensure it is implemented and sustained over the long run. We believe in making high quality data and information available to those who need it, where they need it, and when they need it in a sustainable manner.” - Peter Ricketts

    osh4h-team
    Above: Members of the Open Solutions for Health team based in Roseau, Dominica.

    This year, OS4H has been working with partners at the St. Lucia Ministry of Health (MOH) to expand their in-country DHIS2 implementation to monitor key immunization indicators so that they can strengthen management operations against vaccine preventable diseases. Check out this press release to learn more about the project supported by the Pan American Health Organization (PAHO).

    DHIS2 offers robust dashboard and data visualization options, but St. Lucia’s immunization data was collected in a separate database, along with sensitive patient information that should only be accessed by authorized users. Therefore, to (i) avoid manual data entry and indicators calculations, and (ii) minimize access to sensitive patient data, OS4H sought to automate the reporting of key immunization indicators to DHIS2. After researching secure, open source, and OpenHIE-compliant options for data integration, OS4H decided to deliver this solution using the OpenFn workflow automation platform.

    In less than 1 month, OS4H successfully designed and implemented workflow automation on OpenFn that integrates the St. Lucia Health Information System (“SLUHIS”) database with DHIS2, enabling regular, nation-wide monitoring of key immunization indicators for MOH staff and epidemiologists.

    This OS4H implementation consisted of two phases: (1) training on the OpenFn platform and(2) implementation of the automated workflow for St. Lucia.

    OS4H is now a certified OpenFn implementer

    At OpenFn, we have a small implementation team that cannot meet the rising demand for workflow automation we’re seeing worldwide. Therefore, we are investing more in partner enablement to help develop the automation expertise and OpenFn implementation capacity of local IT teams solving local problems–like OS4H in the Caribbean. Earlier this year, our core team launched the OpenFn Implementation Partner Program to offer training on the OpenFn Digital Public Good, as well as on our implementation process.

    To quickly learn how to implement OpenFn, the OS4H team completed the OpenFn Partner Onboarding Training to learn about the OpenFn product suite, as well as how to successfully design and deliver workflow automation implementations end-to-end. Over the course of 2 weeks, OS4H team members attended online training sessions and completed “homework” exercises to practice OpenFn fundamentals and prepare for their upcoming, real-world projects. At the end of the training, the OS4H team officially joined the OpenFn Community, received “OpenFn Essentials” badges for OpenFn administration and development, and were prepared to kick off their first implementation with the St. Lucia Ministry of Health.

    "After adopting the OpenHIE reference architecture, we began exploring the various referenced technologies. Upon review of the interoperability layer technologies, we quickly appreciated the versatility and ease of use of OpenFn.

    When data transformation is needed, OpenFn utilizes JavaScript, a scripting language that is familiar to most developers in the Caribbean. This meant a lower learning curve, enabling us to get up and running relatively quickly. Furthermore, the support from the OpenFn core team allowed us to build in-house capacity for the full delivery cycle of an OpenFn project." - Peter Ricketts

    Automating indicators reporting for the MOH

    Following the OpenFn training, the OS4H team successfully led the design and implementation of a solution which integrates SLUHIS, the St. Lucia MOH's health information system built on a PostgreSQL database, with their DHIS2 reporting system.

    This process involved consultations with St. Lucia MOH partners to understand the SLUHIS data structure and how to map SLUHIS data points to the DHIS2 data model. Once the data mapping requirements and workflow steps were clearly defined, then OS4H was able to configure the workflow on OpenFn and schedule the automation to run hourly.

    osh4h-flow

    How the workflow automation works:

    1. On an hourly basis, OpenFn executes complex SQL queries to extract and aggregate immunization data from the SLUHIS PostgreSQL database.
    2. OpenFn next fetches a list of “data mapping rules” from SLUHIS, which inform how municipalities should be reassigned to organization units in the DHIS2 location hierarchy.
    3. OpenFn then maps the SLUHIS aggregated indicators results to related DHIS2 data elements to prepare the data for import.
    4. Finally, using the DHIS2 adaptor, OpenFn imports data values to DHIS2, updating linked indicators and dashboards.

    As the workflow runs, all activity history can be centrally monitored in the OpenFn platform, and alerts are configured to notify St. Lucia MOH partners if any errors are thrown.

    osh4h-dashboard
    Above: Screenshot of the test DHIS2 dashboard for key immunization indicators, which displays data from SLUHIS that is aggregated and updated by OpenFn daily. This image contains test data only.

    For the MOH staff and epidemiologist end users, the DHIS2 immunization dashboards are updated automatically and regularly, ensuring access to timely and accurate information. MOH dashboard users don't need to worry about manual reporting and data analysis tasks. Automation enables MOH staff to focus on identifying trends and patterns in the administration of vaccines to improve program management operations.

    These users might not even be aware that OpenFn is engine powering the workflow automation under the hood—for them, the dashboard just works.

    osh4h-meet
    Above: Screenshot from online meeting with Taylor Downs (OpenFn) and Clem Francis (Developer, OS4H) celebrating the successful setup of an OpenFn workflow that automates calculating and reporting aggregated data values for key indicators to DHIS2.

    What's next?

    In April 2023, OS4H successfully launched the DHIS2 dashboard solution and handed over the monitoring of the OpenFn automation to the St. Lucia MOH team for the duration of the pilot. In the coming months, the St. Lucia MOH and OS4H will consider adding functionality and deploying the solution on a local, ministry-managed server, using OpenFn Lightning (the OpenFn “v2” fully open-source web app) for continued use at a greater scale.

    In the meantime, the OS4H team is continuing to deliver transformative digital solutions for partners across the Caribbean and is lining up its next OpenFn project.

    info

    If your organization, like OS4H, is hoping to develop in-house workflow automation expertise, contact partnerships@openfn.org to learn more about the OpenFn Partner Program and training options. Also check out OpenFn Community and OpenFn Documentation to learn from other OpenFn partners and implementers from our open source community.

    - + \ No newline at end of file diff --git a/blog/2023/11/07/Monitoring-child-protection-in-Cambodia.html b/blog/2023/11/07/Monitoring-child-protection-in-Cambodia.html index 8a5364be97e..e0b777e6d7c 100644 --- a/blog/2023/11/07/Monitoring-child-protection-in-Cambodia.html +++ b/blog/2023/11/07/Monitoring-child-protection-in-Cambodia.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@

    Monitoring child protection in Cambodia with automated data sharing and reporting

    · 4 min read

    In Cambodia, 66 per cent of children experienced physical punishment and/or psychological aggression by caregivers in the past month (CDHS, 2021-2022), and 11 per cent experienced online child sexual exploitation and abuse (Disruptive Harm Study, 2022). To strengthen Cambodia’s child protection system so that children are sheltered from harm, UNICEF works with the Ministry of Social Affairs, Veterans & Youth Rehabilitation (MoSVY), the Ministry of Interior, other Ministries, and in-country NGO partners. This year, thanks to OpenFn-powered automation, these partners have released a new child protection monitoring dashboard that can keep up-to-date with the latest case management information.

    Launching the Child Protection Information Management dashboard

    In 2021, the MoSVY, with support from UNICEF Cambodia, launched the Child Protection Information Management System (CPIMS) dashboard to visualize 50 child protection indicators. For the first time, the dashboard provided key child protection related data in one platform, enabling policy makers and service providers to more effectively monitor and evaluate child protection programmes as well as supporting planning and decision making.

    This project was a culmination of work that started in 2018, which included the configuration of CPIMS and development of the monitoring framework for child protection. As part of the CPIMS initiative, UNICEF Cambodia also supported the MoSVY to establish and implement the Primero case management system, a tool that supports government social service workers to facilitate case management for children who are at risk of or experience violence and other child protection concerns in any setting.

    cambodia child
    Knowledge E, 2020

    OpenFn automation keeps the dashboard in-sync

    When the CPIMS dashboard was first launched, it was not connected directly to Primero (the system where case information is managed). This meant that the dashboard was not always up-to-date with the case information and “out-of-sync” with what was actually happening in the field.

    To ensure this dashboard is always “in-sync”, UNICEF Cambodia collaborated with OpenFn to implement automated data exchange between Primero and the database feeding the CPIMS dashboard. This automated Primero-to-dashboard workflow runs on a regular basis (according to MoSVY’s reporting cycles), ensuring the latest case management and services data are reflected in the dashboard and eliminating the need for manual data entry or tedious calculation of indicator results.

    ona_integration
    The current Cambodia implementation integrates Primero and a central PostgreSQL database, which feeds the CPIMS dashboard (built on Canopy analytics tooling).

    This solution empowers MoSVY to:

    1. Securely share cleaned, anonymized, reporting-ready data extracts publicly for better monitoring, trend analysis, programming and planning;
    2. Make indicator results automatically available for further visualization and analysis by caseworkers, donors, and partners;
    3. Analyze its impact across provinces in Cambodia;
    4. Easily scale and expand its reporting by implementing this solution in other countries or integrating data from other partner systems into one database for centralized analysis.
    ona_dashboard
    Snapshot from the MoSVY Child Protection Information Management System supported by UNICEF Cambodia. The CPIMS dashboard includes data on indicator 4.11a on the number of children supported with case management services, one of the sources of which is Primero.

    After the reporting requirements were finalized, this OpenFn integration was configured in less than one day, leveraging the existing open-source Primero adaptor. The current implementation integrates one Primero instance and a PostgreSQL database (which feeds the dashboard), but future implementations might integrate data from multiple systems into one database for centralized analysis.

    If your organization is interested in automating its reporting processes, you can check out this project’s GitHub documentation page and post your questions on OpenFn Community.

    “We are going to share this brilliant piece of work internally within UNICEF as well as Government partners through MoSVY to promote data use and strengthen case management,” said Phanneth Khauv, Child Protection Officer at UNICEF Cambodia.

    - + \ No newline at end of file diff --git a/blog/2024/03/21/kenya-travelogue.html b/blog/2024/03/21/kenya-travelogue.html index 6ffd6c51e8d..492a4566cf2 100644 --- a/blog/2024/03/21/kenya-travelogue.html +++ b/blog/2024/03/21/kenya-travelogue.html @@ -21,7 +21,7 @@ - + @@ -118,7 +118,7 @@ considerate technology — they can chart their own futures.

    Just like AkiraChix and Vijana Amani Pamoja are doing today.

    The more we can enable organisations like these, the faster we get there. I can't wait until my next family dinner in a healthier, safer, more equitable, and even more inspiring Kenya.

    Tuko pamoja.

    Your writer in a silly hat
    Your writer in a silly hat
    - + \ No newline at end of file diff --git a/blog/archive.html b/blog/archive.html index ab7a1dbc2a4..f096bb0fca9 100644 --- a/blog/archive.html +++ b/blog/archive.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@

    Archive

    Archive

    - + \ No newline at end of file diff --git a/blog/page/2.html b/blog/page/2.html index 449505a0bbb..6763c490eec 100644 --- a/blog/page/2.html +++ b/blog/page/2.html @@ -21,7 +21,7 @@ - + @@ -63,7 +63,7 @@ reporting system for the ALMANACH health initiative, OpenFn provided SwissTPH with an automated, real-time connection that enables live disease monitoring in 2019.

    - + \ No newline at end of file diff --git a/blog/page/3.html b/blog/page/3.html index 21679ae8389..c483c187dce 100644 --- a/blog/page/3.html +++ b/blog/page/3.html @@ -21,7 +21,7 @@ - + @@ -42,7 +42,7 @@ over at Medium. I'm still going to write there from time to time as part of the OpenFn Founder's Blog, but today, I'm excited to announce the launch of our own, new, more tightly integrated blog.

    - + \ No newline at end of file diff --git a/blog/tags.html b/blog/tags.html index 9f74540be7b..a4dc7a83367 100644 --- a/blog/tags.html +++ b/blog/tags.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@ - + \ No newline at end of file diff --git a/blog/tags/african-school-of-excellence.html b/blog/tags/african-school-of-excellence.html index aed2461d59a..a74b6a41209 100644 --- a/blog/tags/african-school-of-excellence.html +++ b/blog/tags/african-school-of-excellence.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + \ No newline at end of file diff --git a/blog/tags/agriculture.html b/blog/tags/agriculture.html index f70cc7593b1..fdd837ebda1 100644 --- a/blog/tags/agriculture.html +++ b/blog/tags/agriculture.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ to traditional banks and financing. In this post, we highlight our partner myAgro, an organization leveraging OpenFn automation to help scale its programs towards its goal of serving 1 million farmers in 2025.

    - + \ No newline at end of file diff --git a/blog/tags/airport.html b/blog/tags/airport.html index e01f4eb4066..a0445afe0c8 100644 --- a/blog/tags/airport.html +++ b/blog/tags/airport.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ and service for its workers and passengers. This integrated asset management system saves time and money, and prevents errors by reducing manual, paper-based data transfer between systems.

    - + \ No newline at end of file diff --git a/blog/tags/amp-impact.html b/blog/tags/amp-impact.html index 825299bee2c..21002a35377 100644 --- a/blog/tags/amp-impact.html +++ b/blog/tags/amp-impact.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ society, offer online education to students, and conduct search in the education sector. Itaú Social has trained 112,000 professionals and benefited 7.6 million students across Brazil, according to Itaú's 2021 integrated annual report.

    - + \ No newline at end of file diff --git a/blog/tags/announcement.html b/blog/tags/announcement.html index b63b7b42cb9..4393eff6e5f 100644 --- a/blog/tags/announcement.html +++ b/blog/tags/announcement.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ management information system (HMIS) used in over 40 countries, and OpenLMIS, a popular logistics system, are digital global goods. OpenFn is proud to now be officially joining them on this list.

    - + \ No newline at end of file diff --git a/blog/tags/automated-reporting.html b/blog/tags/automated-reporting.html index 6313aef2128..068f594b740 100644 --- a/blog/tags/automated-reporting.html +++ b/blog/tags/automated-reporting.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ and service for its workers and passengers. This integrated asset management system saves time and money, and prevents errors by reducing manual, paper-based data transfer between systems.

    - + \ No newline at end of file diff --git a/blog/tags/brazil.html b/blog/tags/brazil.html index be12611a189..041d4716bee 100644 --- a/blog/tags/brazil.html +++ b/blog/tags/brazil.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ society, offer online education to students, and conduct search in the education sector. Itaú Social has trained 112,000 professionals and benefited 7.6 million students across Brazil, according to Itaú's 2021 integrated annual report.

    - + \ No newline at end of file diff --git a/blog/tags/cambodia.html b/blog/tags/cambodia.html index 8df5cb2deae..fe2259f0217 100644 --- a/blog/tags/cambodia.html +++ b/blog/tags/cambodia.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ secure OpenFn project space with the automated data sharing workflows required to allow for the Cambodian government and their partner NGO caseworkers to communicate with one another seamlessly.

    - + \ No newline at end of file diff --git a/blog/tags/caris-foundation.html b/blog/tags/caris-foundation.html index d5f8f574721..a08ed82e250 100644 --- a/blog/tags/caris-foundation.html +++ b/blog/tags/caris-foundation.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/carto.html b/blog/tags/carto.html index e4b722fb5cc..1d688c20319 100644 --- a/blog/tags/carto.html +++ b/blog/tags/carto.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ manual data entry and cleaning processes.The real-time connection has enabled live data monitoring for the team as iKapaData survey enumerators were conducting the survey.

    - + \ No newline at end of file diff --git a/blog/tags/case-management.html b/blog/tags/case-management.html index 04805f6fc09..95374b7f4b9 100644 --- a/blog/tags/case-management.html +++ b/blog/tags/case-management.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ secure OpenFn project space with the automated data sharing workflows required to allow for the Cambodian government and their partner NGO caseworkers to communicate with one another seamlessly.

    - + \ No newline at end of file diff --git a/blog/tags/case-study.html b/blog/tags/case-study.html index 19a5fab2933..7cc1bb36227 100644 --- a/blog/tags/case-study.html +++ b/blog/tags/case-study.html @@ -21,7 +21,7 @@ - + @@ -56,7 +56,7 @@ better experience for the patient, for the agent, and for external reporting."

    - + \ No newline at end of file diff --git a/blog/tags/case-study/page/2.html b/blog/tags/case-study/page/2.html index a001a697823..33288f7e2fd 100644 --- a/blog/tags/case-study/page/2.html +++ b/blog/tags/case-study/page/2.html @@ -21,7 +21,7 @@ - + @@ -45,7 +45,7 @@ to traditional banks and financing. In this post, we highlight our partner myAgro, an organization leveraging OpenFn automation to help scale its programs towards its goal of serving 1 million farmers in 2025.

    - + \ No newline at end of file diff --git a/blog/tags/child-protection.html b/blog/tags/child-protection.html index 67dcb81162b..4e179e1e0c2 100644 --- a/blog/tags/child-protection.html +++ b/blog/tags/child-protection.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@

    One post tagged with "child protection"

    View All Tags

    · 4 min read

    In Cambodia, 66 per cent of children experienced physical punishment and/or psychological aggression by caregivers in the past month (CDHS, 2021-2022), and 11 per cent experienced online child sexual exploitation and abuse (Disruptive Harm Study, 2022). To strengthen Cambodia’s child protection system so that children are sheltered from harm, UNICEF works with the Ministry of Social Affairs, Veterans & Youth Rehabilitation (MoSVY), the Ministry of Interior, other Ministries, and in-country NGO partners. This year, thanks to OpenFn-powered automation, these partners have released a new child protection monitoring dashboard that can keep up-to-date with the latest case management information.

    Launching the Child Protection Information Management dashboard

    In 2021, the MoSVY, with support from UNICEF Cambodia, launched the Child Protection Information Management System (CPIMS) dashboard to visualize 50 child protection indicators. For the first time, the dashboard provided key child protection related data in one platform, enabling policy makers and service providers to more effectively monitor and evaluate child protection programmes as well as supporting planning and decision making.

    This project was a culmination of work that started in 2018, which included the configuration of CPIMS and development of the monitoring framework for child protection. As part of the CPIMS initiative, UNICEF Cambodia also supported the MoSVY to establish and implement the Primero case management system, a tool that supports government social service workers to facilitate case management for children who are at risk of or experience violence and other child protection concerns in any setting.

    cambodia child
    Knowledge E, 2020

    OpenFn automation keeps the dashboard in-sync

    When the CPIMS dashboard was first launched, it was not connected directly to Primero (the system where case information is managed). This meant that the dashboard was not always up-to-date with the case information and “out-of-sync” with what was actually happening in the field.

    To ensure this dashboard is always “in-sync”, UNICEF Cambodia collaborated with OpenFn to implement automated data exchange between Primero and the database feeding the CPIMS dashboard. This automated Primero-to-dashboard workflow runs on a regular basis (according to MoSVY’s reporting cycles), ensuring the latest case management and services data are reflected in the dashboard and eliminating the need for manual data entry or tedious calculation of indicator results.

    ona_integration
    The current Cambodia implementation integrates Primero and a central PostgreSQL database, which feeds the CPIMS dashboard (built on Canopy analytics tooling).

    This solution empowers MoSVY to:

    1. Securely share cleaned, anonymized, reporting-ready data extracts publicly for better monitoring, trend analysis, programming and planning;
    2. Make indicator results automatically available for further visualization and analysis by caseworkers, donors, and partners;
    3. Analyze its impact across provinces in Cambodia;
    4. Easily scale and expand its reporting by implementing this solution in other countries or integrating data from other partner systems into one database for centralized analysis.
    ona_dashboard
    Snapshot from the MoSVY Child Protection Information Management System supported by UNICEF Cambodia. The CPIMS dashboard includes data on indicator 4.11a on the number of children supported with case management services, one of the sources of which is Primero.

    After the reporting requirements were finalized, this OpenFn integration was configured in less than one day, leveraging the existing open-source Primero adaptor. The current implementation integrates one Primero instance and a PostgreSQL database (which feeds the dashboard), but future implementations might integrate data from multiple systems into one database for centralized analysis.

    If your organization is interested in automating its reporting processes, you can check out this project’s GitHub documentation page and post your questions on OpenFn Community.

    “We are going to share this brilliant piece of work internally within UNICEF as well as Government partners through MoSVY to promote data use and strengthen case management,” said Phanneth Khauv, Child Protection Officer at UNICEF Cambodia.

    - + \ No newline at end of file diff --git a/blog/tags/comm-care.html b/blog/tags/comm-care.html index e095c6725de..9e6724d5965 100644 --- a/blog/tags/comm-care.html +++ b/blog/tags/comm-care.html @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ to traditional banks and financing. In this post, we highlight our partner myAgro, an organization leveraging OpenFn automation to help scale its programs towards its goal of serving 1 million farmers in 2025.

    - + \ No newline at end of file diff --git a/blog/tags/data-monitoring.html b/blog/tags/data-monitoring.html index ae5dd84472e..265d2ae907b 100644 --- a/blog/tags/data-monitoring.html +++ b/blog/tags/data-monitoring.html @@ -21,7 +21,7 @@ - + @@ -42,7 +42,7 @@ to traditional banks and financing. In this post, we highlight our partner myAgro, an organization leveraging OpenFn automation to help scale its programs towards its goal of serving 1 million farmers in 2025.

    - + \ No newline at end of file diff --git a/blog/tags/data-warehouse.html b/blog/tags/data-warehouse.html index 13e4440cc21..0858fc7f185 100644 --- a/blog/tags/data-warehouse.html +++ b/blog/tags/data-warehouse.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + \ No newline at end of file diff --git a/blog/tags/deployment.html b/blog/tags/deployment.html index 0da809365cf..a3b2e680aa2 100644 --- a/blog/tags/deployment.html +++ b/blog/tags/deployment.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ re-victimization. Children might have to recount their whole case history, reliving their traumas time and time again in order to register and access each critical support service they needed.

    - + \ No newline at end of file diff --git a/blog/tags/development.html b/blog/tags/development.html index 007fea67d25..808d3137cce 100644 --- a/blog/tags/development.html +++ b/blog/tags/development.html @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ and service for its workers and passengers. This integrated asset management system saves time and money, and prevents errors by reducing manual, paper-based data transfer between systems.

    - + \ No newline at end of file diff --git a/blog/tags/dhis-2.html b/blog/tags/dhis-2.html index e8add1cd4aa..9bc2bfe4810 100644 --- a/blog/tags/dhis-2.html +++ b/blog/tags/dhis-2.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ reporting system for the ALMANACH health initiative, OpenFn provided SwissTPH with an automated, real-time connection that enables live disease monitoring in 2019.

    - + \ No newline at end of file diff --git a/blog/tags/education.html b/blog/tags/education.html index a119fa6696f..0dc456cfd34 100644 --- a/blog/tags/education.html +++ b/blog/tags/education.html @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ data in near real-time and better serve the needs of its communities.

    - + \ No newline at end of file diff --git a/blog/tags/global-goods.html b/blog/tags/global-goods.html index ec5cb2dab40..321fa84a41a 100644 --- a/blog/tags/global-goods.html +++ b/blog/tags/global-goods.html @@ -21,7 +21,7 @@ - + @@ -44,7 +44,7 @@ management information system (HMIS) used in over 40 countries, and OpenLMIS, a popular logistics system, are digital global goods. OpenFn is proud to now be officially joining them on this list.

    - + \ No newline at end of file diff --git a/blog/tags/health.html b/blog/tags/health.html index 7bdb35825a8..4a2151a678e 100644 --- a/blog/tags/health.html +++ b/blog/tags/health.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@

    One post tagged with "health"

    View All Tags

    · 7 min read

    Open Solutions for Health (“OS4H”) is an Integrated Systems for Health collaborator and implementer specializing in providing enterprise support for free and open-source systems (FOSS). They customize small, mid-range and large open source health applications for Ministries of Health, medical councils, medical doctor practices, health groups and hospitals in the Caribbean. OS4H is also our first certified OpenFn implementation partner in the Caribbean, trained to deliver workflow automation projects to help their regional partners achieve health systems interoperability.

    Peter Ricketts, CEO at OS4H, says the Dominica-based team provides sustainable solutions designed to meet the needs of organizations in small island developing states (SIDS) that will strengthen their health management operations. While OS4H specializes in digital health implementations for the Caribbean, their team of IT specialists also works across other sectors, including education and agriculture.

    “At OS4H, our mission is to improve health outcomes by matching the right technologies to the problems and build the supporting framework around it to ensure it is implemented and sustained over the long run. We believe in making high quality data and information available to those who need it, where they need it, and when they need it in a sustainable manner.” - Peter Ricketts

    osh4h-team
    Above: Members of the Open Solutions for Health team based in Roseau, Dominica.

    This year, OS4H has been working with partners at the St. Lucia Ministry of Health (MOH) to expand their in-country DHIS2 implementation to monitor key immunization indicators so that they can strengthen management operations against vaccine preventable diseases. Check out this press release to learn more about the project supported by the Pan American Health Organization (PAHO).

    DHIS2 offers robust dashboard and data visualization options, but St. Lucia’s immunization data was collected in a separate database, along with sensitive patient information that should only be accessed by authorized users. Therefore, to (i) avoid manual data entry and indicators calculations, and (ii) minimize access to sensitive patient data, OS4H sought to automate the reporting of key immunization indicators to DHIS2. After researching secure, open source, and OpenHIE-compliant options for data integration, OS4H decided to deliver this solution using the OpenFn workflow automation platform.

    In less than 1 month, OS4H successfully designed and implemented workflow automation on OpenFn that integrates the St. Lucia Health Information System (“SLUHIS”) database with DHIS2, enabling regular, nation-wide monitoring of key immunization indicators for MOH staff and epidemiologists.

    This OS4H implementation consisted of two phases: (1) training on the OpenFn platform and(2) implementation of the automated workflow for St. Lucia.

    OS4H is now a certified OpenFn implementer

    At OpenFn, we have a small implementation team that cannot meet the rising demand for workflow automation we’re seeing worldwide. Therefore, we are investing more in partner enablement to help develop the automation expertise and OpenFn implementation capacity of local IT teams solving local problems–like OS4H in the Caribbean. Earlier this year, our core team launched the OpenFn Implementation Partner Program to offer training on the OpenFn Digital Public Good, as well as on our implementation process.

    To quickly learn how to implement OpenFn, the OS4H team completed the OpenFn Partner Onboarding Training to learn about the OpenFn product suite, as well as how to successfully design and deliver workflow automation implementations end-to-end. Over the course of 2 weeks, OS4H team members attended online training sessions and completed “homework” exercises to practice OpenFn fundamentals and prepare for their upcoming, real-world projects. At the end of the training, the OS4H team officially joined the OpenFn Community, received “OpenFn Essentials” badges for OpenFn administration and development, and were prepared to kick off their first implementation with the St. Lucia Ministry of Health.

    "After adopting the OpenHIE reference architecture, we began exploring the various referenced technologies. Upon review of the interoperability layer technologies, we quickly appreciated the versatility and ease of use of OpenFn.

    When data transformation is needed, OpenFn utilizes JavaScript, a scripting language that is familiar to most developers in the Caribbean. This meant a lower learning curve, enabling us to get up and running relatively quickly. Furthermore, the support from the OpenFn core team allowed us to build in-house capacity for the full delivery cycle of an OpenFn project." - Peter Ricketts

    Automating indicators reporting for the MOH

    Following the OpenFn training, the OS4H team successfully led the design and implementation of a solution which integrates SLUHIS, the St. Lucia MOH's health information system built on a PostgreSQL database, with their DHIS2 reporting system.

    This process involved consultations with St. Lucia MOH partners to understand the SLUHIS data structure and how to map SLUHIS data points to the DHIS2 data model. Once the data mapping requirements and workflow steps were clearly defined, then OS4H was able to configure the workflow on OpenFn and schedule the automation to run hourly.

    osh4h-flow

    How the workflow automation works:

    1. On an hourly basis, OpenFn executes complex SQL queries to extract and aggregate immunization data from the SLUHIS PostgreSQL database.
    2. OpenFn next fetches a list of “data mapping rules” from SLUHIS, which inform how municipalities should be reassigned to organization units in the DHIS2 location hierarchy.
    3. OpenFn then maps the SLUHIS aggregated indicators results to related DHIS2 data elements to prepare the data for import.
    4. Finally, using the DHIS2 adaptor, OpenFn imports data values to DHIS2, updating linked indicators and dashboards.

    As the workflow runs, all activity history can be centrally monitored in the OpenFn platform, and alerts are configured to notify St. Lucia MOH partners if any errors are thrown.

    osh4h-dashboard
    Above: Screenshot of the test DHIS2 dashboard for key immunization indicators, which displays data from SLUHIS that is aggregated and updated by OpenFn daily. This image contains test data only.

    For the MOH staff and epidemiologist end users, the DHIS2 immunization dashboards are updated automatically and regularly, ensuring access to timely and accurate information. MOH dashboard users don't need to worry about manual reporting and data analysis tasks. Automation enables MOH staff to focus on identifying trends and patterns in the administration of vaccines to improve program management operations.

    These users might not even be aware that OpenFn is engine powering the workflow automation under the hood—for them, the dashboard just works.

    osh4h-meet
    Above: Screenshot from online meeting with Taylor Downs (OpenFn) and Clem Francis (Developer, OS4H) celebrating the successful setup of an OpenFn workflow that automates calculating and reporting aggregated data values for key indicators to DHIS2.

    What's next?

    In April 2023, OS4H successfully launched the DHIS2 dashboard solution and handed over the monitoring of the OpenFn automation to the St. Lucia MOH team for the duration of the pilot. In the coming months, the St. Lucia MOH and OS4H will consider adding functionality and deploying the solution on a local, ministry-managed server, using OpenFn Lightning (the OpenFn “v2” fully open-source web app) for continued use at a greater scale.

    In the meantime, the OS4H team is continuing to deliver transformative digital solutions for partners across the Caribbean and is lining up its next OpenFn project.

    info

    If your organization, like OS4H, is hoping to develop in-house workflow automation expertise, contact partnerships@openfn.org to learn more about the OpenFn Partner Program and training options. Also check out OpenFn Community and OpenFn Documentation to learn from other OpenFn partners and implementers from our open source community.

    - + \ No newline at end of file diff --git a/blog/tags/healthcare.html b/blog/tags/healthcare.html index dd7d40569be..92d1909d420 100644 --- a/blog/tags/healthcare.html +++ b/blog/tags/healthcare.html @@ -21,7 +21,7 @@ - + @@ -39,7 +39,7 @@ reporting system for the ALMANACH health initiative, OpenFn provided SwissTPH with an automated, real-time connection that enables live disease monitoring in 2019.

    - + \ No newline at end of file diff --git a/blog/tags/i-kapa-data.html b/blog/tags/i-kapa-data.html index 69e04279a06..6a156014d4b 100644 --- a/blog/tags/i-kapa-data.html +++ b/blog/tags/i-kapa-data.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ manual data entry and cleaning processes.The real-time connection has enabled live data monitoring for the team as iKapaData survey enumerators were conducting the survey.

    - + \ No newline at end of file diff --git a/blog/tags/ibm-maximo.html b/blog/tags/ibm-maximo.html index d69089642c1..1ce3845aef8 100644 --- a/blog/tags/ibm-maximo.html +++ b/blog/tags/ibm-maximo.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ and service for its workers and passengers. This integrated asset management system saves time and money, and prevents errors by reducing manual, paper-based data transfer between systems.

    - + \ No newline at end of file diff --git a/blog/tags/kgvk.html b/blog/tags/kgvk.html index db377aa398b..b5cd4c78571 100644 --- a/blog/tags/kgvk.html +++ b/blog/tags/kgvk.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + \ No newline at end of file diff --git a/blog/tags/kobo-toolbox.html b/blog/tags/kobo-toolbox.html index cf25fa0f534..47acd6da69e 100644 --- a/blog/tags/kobo-toolbox.html +++ b/blog/tags/kobo-toolbox.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@

    One post tagged with "Kobo Toolbox"

    View All Tags

    · 4 min read

    Since 2020, the Wildlife Conservation Society (“WCS”) has leveraged the OpenFn Integration Toolkit to collect, clean, and integrate critical data for critical conservation programs targeting the world's largest wild places. WCS and its partners work at the frontline of conservation, and with support from OpenFn, they can automatically and seamlessly integrate and quickly analyse the masses of data collected across dozens of countries.

    - + \ No newline at end of file diff --git a/blog/tags/kopo-kopo.html b/blog/tags/kopo-kopo.html index baea7d15e3e..c2421a5c81d 100644 --- a/blog/tags/kopo-kopo.html +++ b/blog/tags/kopo-kopo.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + \ No newline at end of file diff --git a/blog/tags/learning-management-system.html b/blog/tags/learning-management-system.html index f3b467a935d..f8393d6b341 100644 --- a/blog/tags/learning-management-system.html +++ b/blog/tags/learning-management-system.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ reading-for-enjoyment initiative, which promotes reading and writing in mother tongue languages. To effectively monitor program activities and children reached across the country, Nal’ibali needed to integrate multiple data platforms.

    - + \ No newline at end of file diff --git a/blog/tags/m-e.html b/blog/tags/m-e.html index bfe86547d1f..8dd091a0d1d 100644 --- a/blog/tags/m-e.html +++ b/blog/tags/m-e.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ society, offer online education to students, and conduct search in the education sector. Itaú Social has trained 112,000 professionals and benefited 7.6 million students across Brazil, according to Itaú's 2021 integrated annual report.

    - + \ No newline at end of file diff --git a/blog/tags/m-pesa.html b/blog/tags/m-pesa.html index 459dd9023a9..c9ad8f1381a 100644 --- a/blog/tags/m-pesa.html +++ b/blog/tags/m-pesa.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + \ No newline at end of file diff --git a/blog/tags/moh.html b/blog/tags/moh.html index fa72af64d1a..3b9837e466a 100644 --- a/blog/tags/moh.html +++ b/blog/tags/moh.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@

    One post tagged with "MOH"

    View All Tags

    · 7 min read

    Open Solutions for Health (“OS4H”) is an Integrated Systems for Health collaborator and implementer specializing in providing enterprise support for free and open-source systems (FOSS). They customize small, mid-range and large open source health applications for Ministries of Health, medical councils, medical doctor practices, health groups and hospitals in the Caribbean. OS4H is also our first certified OpenFn implementation partner in the Caribbean, trained to deliver workflow automation projects to help their regional partners achieve health systems interoperability.

    Peter Ricketts, CEO at OS4H, says the Dominica-based team provides sustainable solutions designed to meet the needs of organizations in small island developing states (SIDS) that will strengthen their health management operations. While OS4H specializes in digital health implementations for the Caribbean, their team of IT specialists also works across other sectors, including education and agriculture.

    “At OS4H, our mission is to improve health outcomes by matching the right technologies to the problems and build the supporting framework around it to ensure it is implemented and sustained over the long run. We believe in making high quality data and information available to those who need it, where they need it, and when they need it in a sustainable manner.” - Peter Ricketts

    osh4h-team
    Above: Members of the Open Solutions for Health team based in Roseau, Dominica.

    This year, OS4H has been working with partners at the St. Lucia Ministry of Health (MOH) to expand their in-country DHIS2 implementation to monitor key immunization indicators so that they can strengthen management operations against vaccine preventable diseases. Check out this press release to learn more about the project supported by the Pan American Health Organization (PAHO).

    DHIS2 offers robust dashboard and data visualization options, but St. Lucia’s immunization data was collected in a separate database, along with sensitive patient information that should only be accessed by authorized users. Therefore, to (i) avoid manual data entry and indicators calculations, and (ii) minimize access to sensitive patient data, OS4H sought to automate the reporting of key immunization indicators to DHIS2. After researching secure, open source, and OpenHIE-compliant options for data integration, OS4H decided to deliver this solution using the OpenFn workflow automation platform.

    In less than 1 month, OS4H successfully designed and implemented workflow automation on OpenFn that integrates the St. Lucia Health Information System (“SLUHIS”) database with DHIS2, enabling regular, nation-wide monitoring of key immunization indicators for MOH staff and epidemiologists.

    This OS4H implementation consisted of two phases: (1) training on the OpenFn platform and(2) implementation of the automated workflow for St. Lucia.

    OS4H is now a certified OpenFn implementer

    At OpenFn, we have a small implementation team that cannot meet the rising demand for workflow automation we’re seeing worldwide. Therefore, we are investing more in partner enablement to help develop the automation expertise and OpenFn implementation capacity of local IT teams solving local problems–like OS4H in the Caribbean. Earlier this year, our core team launched the OpenFn Implementation Partner Program to offer training on the OpenFn Digital Public Good, as well as on our implementation process.

    To quickly learn how to implement OpenFn, the OS4H team completed the OpenFn Partner Onboarding Training to learn about the OpenFn product suite, as well as how to successfully design and deliver workflow automation implementations end-to-end. Over the course of 2 weeks, OS4H team members attended online training sessions and completed “homework” exercises to practice OpenFn fundamentals and prepare for their upcoming, real-world projects. At the end of the training, the OS4H team officially joined the OpenFn Community, received “OpenFn Essentials” badges for OpenFn administration and development, and were prepared to kick off their first implementation with the St. Lucia Ministry of Health.

    "After adopting the OpenHIE reference architecture, we began exploring the various referenced technologies. Upon review of the interoperability layer technologies, we quickly appreciated the versatility and ease of use of OpenFn.

    When data transformation is needed, OpenFn utilizes JavaScript, a scripting language that is familiar to most developers in the Caribbean. This meant a lower learning curve, enabling us to get up and running relatively quickly. Furthermore, the support from the OpenFn core team allowed us to build in-house capacity for the full delivery cycle of an OpenFn project." - Peter Ricketts

    Automating indicators reporting for the MOH

    Following the OpenFn training, the OS4H team successfully led the design and implementation of a solution which integrates SLUHIS, the St. Lucia MOH's health information system built on a PostgreSQL database, with their DHIS2 reporting system.

    This process involved consultations with St. Lucia MOH partners to understand the SLUHIS data structure and how to map SLUHIS data points to the DHIS2 data model. Once the data mapping requirements and workflow steps were clearly defined, then OS4H was able to configure the workflow on OpenFn and schedule the automation to run hourly.

    osh4h-flow

    How the workflow automation works:

    1. On an hourly basis, OpenFn executes complex SQL queries to extract and aggregate immunization data from the SLUHIS PostgreSQL database.
    2. OpenFn next fetches a list of “data mapping rules” from SLUHIS, which inform how municipalities should be reassigned to organization units in the DHIS2 location hierarchy.
    3. OpenFn then maps the SLUHIS aggregated indicators results to related DHIS2 data elements to prepare the data for import.
    4. Finally, using the DHIS2 adaptor, OpenFn imports data values to DHIS2, updating linked indicators and dashboards.

    As the workflow runs, all activity history can be centrally monitored in the OpenFn platform, and alerts are configured to notify St. Lucia MOH partners if any errors are thrown.

    osh4h-dashboard
    Above: Screenshot of the test DHIS2 dashboard for key immunization indicators, which displays data from SLUHIS that is aggregated and updated by OpenFn daily. This image contains test data only.

    For the MOH staff and epidemiologist end users, the DHIS2 immunization dashboards are updated automatically and regularly, ensuring access to timely and accurate information. MOH dashboard users don't need to worry about manual reporting and data analysis tasks. Automation enables MOH staff to focus on identifying trends and patterns in the administration of vaccines to improve program management operations.

    These users might not even be aware that OpenFn is engine powering the workflow automation under the hood—for them, the dashboard just works.

    osh4h-meet
    Above: Screenshot from online meeting with Taylor Downs (OpenFn) and Clem Francis (Developer, OS4H) celebrating the successful setup of an OpenFn workflow that automates calculating and reporting aggregated data values for key indicators to DHIS2.

    What's next?

    In April 2023, OS4H successfully launched the DHIS2 dashboard solution and handed over the monitoring of the OpenFn automation to the St. Lucia MOH team for the duration of the pilot. In the coming months, the St. Lucia MOH and OS4H will consider adding functionality and deploying the solution on a local, ministry-managed server, using OpenFn Lightning (the OpenFn “v2” fully open-source web app) for continued use at a greater scale.

    In the meantime, the OS4H team is continuing to deliver transformative digital solutions for partners across the Caribbean and is lining up its next OpenFn project.

    info

    If your organization, like OS4H, is hoping to develop in-house workflow automation expertise, contact partnerships@openfn.org to learn more about the OpenFn Partner Program and training options. Also check out OpenFn Community and OpenFn Documentation to learn from other OpenFn partners and implementers from our open source community.

    - + \ No newline at end of file diff --git a/blog/tags/mssql.html b/blog/tags/mssql.html index b6c4adbf1a9..51decaf0b72 100644 --- a/blog/tags/mssql.html +++ b/blog/tags/mssql.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@

    One post tagged with "MSSQL"

    View All Tags

    · 4 min read

    Since 2020, the Wildlife Conservation Society (“WCS”) has leveraged the OpenFn Integration Toolkit to collect, clean, and integrate critical data for critical conservation programs targeting the world's largest wild places. WCS and its partners work at the frontline of conservation, and with support from OpenFn, they can automatically and seamlessly integrate and quickly analyse the masses of data collected across dozens of countries.

    - + \ No newline at end of file diff --git a/blog/tags/my-agro.html b/blog/tags/my-agro.html index 20f887936ad..2ec6933eaef 100644 --- a/blog/tags/my-agro.html +++ b/blog/tags/my-agro.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ to traditional banks and financing. In this post, we highlight our partner myAgro, an organization leveraging OpenFn automation to help scale its programs towards its goal of serving 1 million farmers in 2025.

    - + \ No newline at end of file diff --git a/blog/tags/my-sql.html b/blog/tags/my-sql.html index 1d9ad200dd6..3e8e5f419f4 100644 --- a/blog/tags/my-sql.html +++ b/blog/tags/my-sql.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/odk.html b/blog/tags/odk.html index e40fead4da6..5a44459315f 100644 --- a/blog/tags/odk.html +++ b/blog/tags/odk.html @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ time lag.

    - + \ No newline at end of file diff --git a/blog/tags/open-solutions-for-health.html b/blog/tags/open-solutions-for-health.html index 16464f4c365..73f7e7da622 100644 --- a/blog/tags/open-solutions-for-health.html +++ b/blog/tags/open-solutions-for-health.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@

    One post tagged with "Open Solutions for Health"

    View All Tags

    · 7 min read

    Open Solutions for Health (“OS4H”) is an Integrated Systems for Health collaborator and implementer specializing in providing enterprise support for free and open-source systems (FOSS). They customize small, mid-range and large open source health applications for Ministries of Health, medical councils, medical doctor practices, health groups and hospitals in the Caribbean. OS4H is also our first certified OpenFn implementation partner in the Caribbean, trained to deliver workflow automation projects to help their regional partners achieve health systems interoperability.

    Peter Ricketts, CEO at OS4H, says the Dominica-based team provides sustainable solutions designed to meet the needs of organizations in small island developing states (SIDS) that will strengthen their health management operations. While OS4H specializes in digital health implementations for the Caribbean, their team of IT specialists also works across other sectors, including education and agriculture.

    “At OS4H, our mission is to improve health outcomes by matching the right technologies to the problems and build the supporting framework around it to ensure it is implemented and sustained over the long run. We believe in making high quality data and information available to those who need it, where they need it, and when they need it in a sustainable manner.” - Peter Ricketts

    osh4h-team
    Above: Members of the Open Solutions for Health team based in Roseau, Dominica.

    This year, OS4H has been working with partners at the St. Lucia Ministry of Health (MOH) to expand their in-country DHIS2 implementation to monitor key immunization indicators so that they can strengthen management operations against vaccine preventable diseases. Check out this press release to learn more about the project supported by the Pan American Health Organization (PAHO).

    DHIS2 offers robust dashboard and data visualization options, but St. Lucia’s immunization data was collected in a separate database, along with sensitive patient information that should only be accessed by authorized users. Therefore, to (i) avoid manual data entry and indicators calculations, and (ii) minimize access to sensitive patient data, OS4H sought to automate the reporting of key immunization indicators to DHIS2. After researching secure, open source, and OpenHIE-compliant options for data integration, OS4H decided to deliver this solution using the OpenFn workflow automation platform.

    In less than 1 month, OS4H successfully designed and implemented workflow automation on OpenFn that integrates the St. Lucia Health Information System (“SLUHIS”) database with DHIS2, enabling regular, nation-wide monitoring of key immunization indicators for MOH staff and epidemiologists.

    This OS4H implementation consisted of two phases: (1) training on the OpenFn platform and(2) implementation of the automated workflow for St. Lucia.

    OS4H is now a certified OpenFn implementer

    At OpenFn, we have a small implementation team that cannot meet the rising demand for workflow automation we’re seeing worldwide. Therefore, we are investing more in partner enablement to help develop the automation expertise and OpenFn implementation capacity of local IT teams solving local problems–like OS4H in the Caribbean. Earlier this year, our core team launched the OpenFn Implementation Partner Program to offer training on the OpenFn Digital Public Good, as well as on our implementation process.

    To quickly learn how to implement OpenFn, the OS4H team completed the OpenFn Partner Onboarding Training to learn about the OpenFn product suite, as well as how to successfully design and deliver workflow automation implementations end-to-end. Over the course of 2 weeks, OS4H team members attended online training sessions and completed “homework” exercises to practice OpenFn fundamentals and prepare for their upcoming, real-world projects. At the end of the training, the OS4H team officially joined the OpenFn Community, received “OpenFn Essentials” badges for OpenFn administration and development, and were prepared to kick off their first implementation with the St. Lucia Ministry of Health.

    "After adopting the OpenHIE reference architecture, we began exploring the various referenced technologies. Upon review of the interoperability layer technologies, we quickly appreciated the versatility and ease of use of OpenFn.

    When data transformation is needed, OpenFn utilizes JavaScript, a scripting language that is familiar to most developers in the Caribbean. This meant a lower learning curve, enabling us to get up and running relatively quickly. Furthermore, the support from the OpenFn core team allowed us to build in-house capacity for the full delivery cycle of an OpenFn project." - Peter Ricketts

    Automating indicators reporting for the MOH

    Following the OpenFn training, the OS4H team successfully led the design and implementation of a solution which integrates SLUHIS, the St. Lucia MOH's health information system built on a PostgreSQL database, with their DHIS2 reporting system.

    This process involved consultations with St. Lucia MOH partners to understand the SLUHIS data structure and how to map SLUHIS data points to the DHIS2 data model. Once the data mapping requirements and workflow steps were clearly defined, then OS4H was able to configure the workflow on OpenFn and schedule the automation to run hourly.

    osh4h-flow

    How the workflow automation works:

    1. On an hourly basis, OpenFn executes complex SQL queries to extract and aggregate immunization data from the SLUHIS PostgreSQL database.
    2. OpenFn next fetches a list of “data mapping rules” from SLUHIS, which inform how municipalities should be reassigned to organization units in the DHIS2 location hierarchy.
    3. OpenFn then maps the SLUHIS aggregated indicators results to related DHIS2 data elements to prepare the data for import.
    4. Finally, using the DHIS2 adaptor, OpenFn imports data values to DHIS2, updating linked indicators and dashboards.

    As the workflow runs, all activity history can be centrally monitored in the OpenFn platform, and alerts are configured to notify St. Lucia MOH partners if any errors are thrown.

    osh4h-dashboard
    Above: Screenshot of the test DHIS2 dashboard for key immunization indicators, which displays data from SLUHIS that is aggregated and updated by OpenFn daily. This image contains test data only.

    For the MOH staff and epidemiologist end users, the DHIS2 immunization dashboards are updated automatically and regularly, ensuring access to timely and accurate information. MOH dashboard users don't need to worry about manual reporting and data analysis tasks. Automation enables MOH staff to focus on identifying trends and patterns in the administration of vaccines to improve program management operations.

    These users might not even be aware that OpenFn is engine powering the workflow automation under the hood—for them, the dashboard just works.

    osh4h-meet
    Above: Screenshot from online meeting with Taylor Downs (OpenFn) and Clem Francis (Developer, OS4H) celebrating the successful setup of an OpenFn workflow that automates calculating and reporting aggregated data values for key indicators to DHIS2.

    What's next?

    In April 2023, OS4H successfully launched the DHIS2 dashboard solution and handed over the monitoring of the OpenFn automation to the St. Lucia MOH team for the duration of the pilot. In the coming months, the St. Lucia MOH and OS4H will consider adding functionality and deploying the solution on a local, ministry-managed server, using OpenFn Lightning (the OpenFn “v2” fully open-source web app) for continued use at a greater scale.

    In the meantime, the OS4H team is continuing to deliver transformative digital solutions for partners across the Caribbean and is lining up its next OpenFn project.

    info

    If your organization, like OS4H, is hoping to develop in-house workflow automation expertise, contact partnerships@openfn.org to learn more about the OpenFn Partner Program and training options. Also check out OpenFn Community and OpenFn Documentation to learn from other OpenFn partners and implementers from our open source community.

    - + \ No newline at end of file diff --git a/blog/tags/os-4-h.html b/blog/tags/os-4-h.html index 164107c0baf..13387dee312 100644 --- a/blog/tags/os-4-h.html +++ b/blog/tags/os-4-h.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@

    One post tagged with "OS4H"

    View All Tags

    · 7 min read

    Open Solutions for Health (“OS4H”) is an Integrated Systems for Health collaborator and implementer specializing in providing enterprise support for free and open-source systems (FOSS). They customize small, mid-range and large open source health applications for Ministries of Health, medical councils, medical doctor practices, health groups and hospitals in the Caribbean. OS4H is also our first certified OpenFn implementation partner in the Caribbean, trained to deliver workflow automation projects to help their regional partners achieve health systems interoperability.

    Peter Ricketts, CEO at OS4H, says the Dominica-based team provides sustainable solutions designed to meet the needs of organizations in small island developing states (SIDS) that will strengthen their health management operations. While OS4H specializes in digital health implementations for the Caribbean, their team of IT specialists also works across other sectors, including education and agriculture.

    “At OS4H, our mission is to improve health outcomes by matching the right technologies to the problems and build the supporting framework around it to ensure it is implemented and sustained over the long run. We believe in making high quality data and information available to those who need it, where they need it, and when they need it in a sustainable manner.” - Peter Ricketts

    osh4h-team
    Above: Members of the Open Solutions for Health team based in Roseau, Dominica.

    This year, OS4H has been working with partners at the St. Lucia Ministry of Health (MOH) to expand their in-country DHIS2 implementation to monitor key immunization indicators so that they can strengthen management operations against vaccine preventable diseases. Check out this press release to learn more about the project supported by the Pan American Health Organization (PAHO).

    DHIS2 offers robust dashboard and data visualization options, but St. Lucia’s immunization data was collected in a separate database, along with sensitive patient information that should only be accessed by authorized users. Therefore, to (i) avoid manual data entry and indicators calculations, and (ii) minimize access to sensitive patient data, OS4H sought to automate the reporting of key immunization indicators to DHIS2. After researching secure, open source, and OpenHIE-compliant options for data integration, OS4H decided to deliver this solution using the OpenFn workflow automation platform.

    In less than 1 month, OS4H successfully designed and implemented workflow automation on OpenFn that integrates the St. Lucia Health Information System (“SLUHIS”) database with DHIS2, enabling regular, nation-wide monitoring of key immunization indicators for MOH staff and epidemiologists.

    This OS4H implementation consisted of two phases: (1) training on the OpenFn platform and(2) implementation of the automated workflow for St. Lucia.

    OS4H is now a certified OpenFn implementer

    At OpenFn, we have a small implementation team that cannot meet the rising demand for workflow automation we’re seeing worldwide. Therefore, we are investing more in partner enablement to help develop the automation expertise and OpenFn implementation capacity of local IT teams solving local problems–like OS4H in the Caribbean. Earlier this year, our core team launched the OpenFn Implementation Partner Program to offer training on the OpenFn Digital Public Good, as well as on our implementation process.

    To quickly learn how to implement OpenFn, the OS4H team completed the OpenFn Partner Onboarding Training to learn about the OpenFn product suite, as well as how to successfully design and deliver workflow automation implementations end-to-end. Over the course of 2 weeks, OS4H team members attended online training sessions and completed “homework” exercises to practice OpenFn fundamentals and prepare for their upcoming, real-world projects. At the end of the training, the OS4H team officially joined the OpenFn Community, received “OpenFn Essentials” badges for OpenFn administration and development, and were prepared to kick off their first implementation with the St. Lucia Ministry of Health.

    "After adopting the OpenHIE reference architecture, we began exploring the various referenced technologies. Upon review of the interoperability layer technologies, we quickly appreciated the versatility and ease of use of OpenFn.

    When data transformation is needed, OpenFn utilizes JavaScript, a scripting language that is familiar to most developers in the Caribbean. This meant a lower learning curve, enabling us to get up and running relatively quickly. Furthermore, the support from the OpenFn core team allowed us to build in-house capacity for the full delivery cycle of an OpenFn project." - Peter Ricketts

    Automating indicators reporting for the MOH

    Following the OpenFn training, the OS4H team successfully led the design and implementation of a solution which integrates SLUHIS, the St. Lucia MOH's health information system built on a PostgreSQL database, with their DHIS2 reporting system.

    This process involved consultations with St. Lucia MOH partners to understand the SLUHIS data structure and how to map SLUHIS data points to the DHIS2 data model. Once the data mapping requirements and workflow steps were clearly defined, then OS4H was able to configure the workflow on OpenFn and schedule the automation to run hourly.

    osh4h-flow

    How the workflow automation works:

    1. On an hourly basis, OpenFn executes complex SQL queries to extract and aggregate immunization data from the SLUHIS PostgreSQL database.
    2. OpenFn next fetches a list of “data mapping rules” from SLUHIS, which inform how municipalities should be reassigned to organization units in the DHIS2 location hierarchy.
    3. OpenFn then maps the SLUHIS aggregated indicators results to related DHIS2 data elements to prepare the data for import.
    4. Finally, using the DHIS2 adaptor, OpenFn imports data values to DHIS2, updating linked indicators and dashboards.

    As the workflow runs, all activity history can be centrally monitored in the OpenFn platform, and alerts are configured to notify St. Lucia MOH partners if any errors are thrown.

    osh4h-dashboard
    Above: Screenshot of the test DHIS2 dashboard for key immunization indicators, which displays data from SLUHIS that is aggregated and updated by OpenFn daily. This image contains test data only.

    For the MOH staff and epidemiologist end users, the DHIS2 immunization dashboards are updated automatically and regularly, ensuring access to timely and accurate information. MOH dashboard users don't need to worry about manual reporting and data analysis tasks. Automation enables MOH staff to focus on identifying trends and patterns in the administration of vaccines to improve program management operations.

    These users might not even be aware that OpenFn is engine powering the workflow automation under the hood—for them, the dashboard just works.

    osh4h-meet
    Above: Screenshot from online meeting with Taylor Downs (OpenFn) and Clem Francis (Developer, OS4H) celebrating the successful setup of an OpenFn workflow that automates calculating and reporting aggregated data values for key indicators to DHIS2.

    What's next?

    In April 2023, OS4H successfully launched the DHIS2 dashboard solution and handed over the monitoring of the OpenFn automation to the St. Lucia MOH team for the duration of the pilot. In the coming months, the St. Lucia MOH and OS4H will consider adding functionality and deploying the solution on a local, ministry-managed server, using OpenFn Lightning (the OpenFn “v2” fully open-source web app) for continued use at a greater scale.

    In the meantime, the OS4H team is continuing to deliver transformative digital solutions for partners across the Caribbean and is lining up its next OpenFn project.

    info

    If your organization, like OS4H, is hoping to develop in-house workflow automation expertise, contact partnerships@openfn.org to learn more about the OpenFn Partner Program and training options. Also check out OpenFn Community and OpenFn Documentation to learn from other OpenFn partners and implementers from our open source community.

    - + \ No newline at end of file diff --git a/blog/tags/os-ca-r.html b/blog/tags/os-ca-r.html index 6f9e7f3c310..ae67f8ed156 100644 --- a/blog/tags/os-ca-r.html +++ b/blog/tags/os-ca-r.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ secure OpenFn project space with the automated data sharing workflows required to allow for the Cambodian government and their partner NGO caseworkers to communicate with one another seamlessly.

    - + \ No newline at end of file diff --git a/blog/tags/payments.html b/blog/tags/payments.html index 865a23c4fc0..14de19d9cc5 100644 --- a/blog/tags/payments.html +++ b/blog/tags/payments.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + \ No newline at end of file diff --git a/blog/tags/postgre-sql.html b/blog/tags/postgre-sql.html index 66dc6cfc75c..7786815a576 100644 --- a/blog/tags/postgre-sql.html +++ b/blog/tags/postgre-sql.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@

    2 posts tagged with "PostgreSQL"

    View All Tags

    · 4 min read

    Since 2020, the Wildlife Conservation Society (“WCS”) has leveraged the OpenFn Integration Toolkit to collect, clean, and integrate critical data for critical conservation programs targeting the world's largest wild places. WCS and its partners work at the frontline of conservation, and with support from OpenFn, they can automatically and seamlessly integrate and quickly analyse the masses of data collected across dozens of countries.

    - + \ No newline at end of file diff --git a/blog/tags/primero.html b/blog/tags/primero.html index 2e2201f1fc6..5fe2b4aa9b4 100644 --- a/blog/tags/primero.html +++ b/blog/tags/primero.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ secure OpenFn project space with the automated data sharing workflows required to allow for the Cambodian government and their partner NGO caseworkers to communicate with one another seamlessly.

    - + \ No newline at end of file diff --git a/blog/tags/redash.html b/blog/tags/redash.html index d4177ab6b8c..c2b1d582bf9 100644 --- a/blog/tags/redash.html +++ b/blog/tags/redash.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + \ No newline at end of file diff --git a/blog/tags/salesforce.html b/blog/tags/salesforce.html index 9c7cd084e53..6c4d20a293d 100644 --- a/blog/tags/salesforce.html +++ b/blog/tags/salesforce.html @@ -21,7 +21,7 @@ - + @@ -50,7 +50,7 @@ to traditional banks and financing. In this post, we highlight our partner myAgro, an organization leveraging OpenFn automation to help scale its programs towards its goal of serving 1 million farmers in 2025.

    - + \ No newline at end of file diff --git a/blog/tags/sftp.html b/blog/tags/sftp.html index 1eb626e637d..261478d7030 100644 --- a/blog/tags/sftp.html +++ b/blog/tags/sftp.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ society, offer online education to students, and conduct search in the education sector. Itaú Social has trained 112,000 professionals and benefited 7.6 million students across Brazil, according to Itaú's 2021 integrated annual report.

    - + \ No newline at end of file diff --git a/blog/tags/sms.html b/blog/tags/sms.html index 21f4d31460c..b09a24bf97e 100644 --- a/blog/tags/sms.html +++ b/blog/tags/sms.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ to traditional banks and financing. In this post, we highlight our partner myAgro, an organization leveraging OpenFn automation to help scale its programs towards its goal of serving 1 million farmers in 2025.

    - + \ No newline at end of file diff --git a/blog/tags/st-lucia.html b/blog/tags/st-lucia.html index 78bc03d642a..6bc70a8e459 100644 --- a/blog/tags/st-lucia.html +++ b/blog/tags/st-lucia.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@

    One post tagged with "St. Lucia"

    View All Tags

    · 7 min read

    Open Solutions for Health (“OS4H”) is an Integrated Systems for Health collaborator and implementer specializing in providing enterprise support for free and open-source systems (FOSS). They customize small, mid-range and large open source health applications for Ministries of Health, medical councils, medical doctor practices, health groups and hospitals in the Caribbean. OS4H is also our first certified OpenFn implementation partner in the Caribbean, trained to deliver workflow automation projects to help their regional partners achieve health systems interoperability.

    Peter Ricketts, CEO at OS4H, says the Dominica-based team provides sustainable solutions designed to meet the needs of organizations in small island developing states (SIDS) that will strengthen their health management operations. While OS4H specializes in digital health implementations for the Caribbean, their team of IT specialists also works across other sectors, including education and agriculture.

    “At OS4H, our mission is to improve health outcomes by matching the right technologies to the problems and build the supporting framework around it to ensure it is implemented and sustained over the long run. We believe in making high quality data and information available to those who need it, where they need it, and when they need it in a sustainable manner.” - Peter Ricketts

    osh4h-team
    Above: Members of the Open Solutions for Health team based in Roseau, Dominica.

    This year, OS4H has been working with partners at the St. Lucia Ministry of Health (MOH) to expand their in-country DHIS2 implementation to monitor key immunization indicators so that they can strengthen management operations against vaccine preventable diseases. Check out this press release to learn more about the project supported by the Pan American Health Organization (PAHO).

    DHIS2 offers robust dashboard and data visualization options, but St. Lucia’s immunization data was collected in a separate database, along with sensitive patient information that should only be accessed by authorized users. Therefore, to (i) avoid manual data entry and indicators calculations, and (ii) minimize access to sensitive patient data, OS4H sought to automate the reporting of key immunization indicators to DHIS2. After researching secure, open source, and OpenHIE-compliant options for data integration, OS4H decided to deliver this solution using the OpenFn workflow automation platform.

    In less than 1 month, OS4H successfully designed and implemented workflow automation on OpenFn that integrates the St. Lucia Health Information System (“SLUHIS”) database with DHIS2, enabling regular, nation-wide monitoring of key immunization indicators for MOH staff and epidemiologists.

    This OS4H implementation consisted of two phases: (1) training on the OpenFn platform and(2) implementation of the automated workflow for St. Lucia.

    OS4H is now a certified OpenFn implementer

    At OpenFn, we have a small implementation team that cannot meet the rising demand for workflow automation we’re seeing worldwide. Therefore, we are investing more in partner enablement to help develop the automation expertise and OpenFn implementation capacity of local IT teams solving local problems–like OS4H in the Caribbean. Earlier this year, our core team launched the OpenFn Implementation Partner Program to offer training on the OpenFn Digital Public Good, as well as on our implementation process.

    To quickly learn how to implement OpenFn, the OS4H team completed the OpenFn Partner Onboarding Training to learn about the OpenFn product suite, as well as how to successfully design and deliver workflow automation implementations end-to-end. Over the course of 2 weeks, OS4H team members attended online training sessions and completed “homework” exercises to practice OpenFn fundamentals and prepare for their upcoming, real-world projects. At the end of the training, the OS4H team officially joined the OpenFn Community, received “OpenFn Essentials” badges for OpenFn administration and development, and were prepared to kick off their first implementation with the St. Lucia Ministry of Health.

    "After adopting the OpenHIE reference architecture, we began exploring the various referenced technologies. Upon review of the interoperability layer technologies, we quickly appreciated the versatility and ease of use of OpenFn.

    When data transformation is needed, OpenFn utilizes JavaScript, a scripting language that is familiar to most developers in the Caribbean. This meant a lower learning curve, enabling us to get up and running relatively quickly. Furthermore, the support from the OpenFn core team allowed us to build in-house capacity for the full delivery cycle of an OpenFn project." - Peter Ricketts

    Automating indicators reporting for the MOH

    Following the OpenFn training, the OS4H team successfully led the design and implementation of a solution which integrates SLUHIS, the St. Lucia MOH's health information system built on a PostgreSQL database, with their DHIS2 reporting system.

    This process involved consultations with St. Lucia MOH partners to understand the SLUHIS data structure and how to map SLUHIS data points to the DHIS2 data model. Once the data mapping requirements and workflow steps were clearly defined, then OS4H was able to configure the workflow on OpenFn and schedule the automation to run hourly.

    osh4h-flow

    How the workflow automation works:

    1. On an hourly basis, OpenFn executes complex SQL queries to extract and aggregate immunization data from the SLUHIS PostgreSQL database.
    2. OpenFn next fetches a list of “data mapping rules” from SLUHIS, which inform how municipalities should be reassigned to organization units in the DHIS2 location hierarchy.
    3. OpenFn then maps the SLUHIS aggregated indicators results to related DHIS2 data elements to prepare the data for import.
    4. Finally, using the DHIS2 adaptor, OpenFn imports data values to DHIS2, updating linked indicators and dashboards.

    As the workflow runs, all activity history can be centrally monitored in the OpenFn platform, and alerts are configured to notify St. Lucia MOH partners if any errors are thrown.

    osh4h-dashboard
    Above: Screenshot of the test DHIS2 dashboard for key immunization indicators, which displays data from SLUHIS that is aggregated and updated by OpenFn daily. This image contains test data only.

    For the MOH staff and epidemiologist end users, the DHIS2 immunization dashboards are updated automatically and regularly, ensuring access to timely and accurate information. MOH dashboard users don't need to worry about manual reporting and data analysis tasks. Automation enables MOH staff to focus on identifying trends and patterns in the administration of vaccines to improve program management operations.

    These users might not even be aware that OpenFn is engine powering the workflow automation under the hood—for them, the dashboard just works.

    osh4h-meet
    Above: Screenshot from online meeting with Taylor Downs (OpenFn) and Clem Francis (Developer, OS4H) celebrating the successful setup of an OpenFn workflow that automates calculating and reporting aggregated data values for key indicators to DHIS2.

    What's next?

    In April 2023, OS4H successfully launched the DHIS2 dashboard solution and handed over the monitoring of the OpenFn automation to the St. Lucia MOH team for the duration of the pilot. In the coming months, the St. Lucia MOH and OS4H will consider adding functionality and deploying the solution on a local, ministry-managed server, using OpenFn Lightning (the OpenFn “v2” fully open-source web app) for continued use at a greater scale.

    In the meantime, the OS4H team is continuing to deliver transformative digital solutions for partners across the Caribbean and is lining up its next OpenFn project.

    info

    If your organization, like OS4H, is hoping to develop in-house workflow automation expertise, contact partnerships@openfn.org to learn more about the OpenFn Partner Program and training options. Also check out OpenFn Community and OpenFn Documentation to learn from other OpenFn partners and implementers from our open source community.

    - + \ No newline at end of file diff --git a/blog/tags/supply-chain-system.html b/blog/tags/supply-chain-system.html index c69f9efefef..1b016498b72 100644 --- a/blog/tags/supply-chain-system.html +++ b/blog/tags/supply-chain-system.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ activities. With this integrated service system, X-runner can deliver high quality customer service and technical assistance to their customers, with no time lag.

    - + \ No newline at end of file diff --git a/blog/tags/survey-cto.html b/blog/tags/survey-cto.html index 09704a14030..ecbd17691f4 100644 --- a/blog/tags/survey-cto.html +++ b/blog/tags/survey-cto.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ manual data entry and cleaning processes.The real-time connection has enabled live data monitoring for the team as iKapaData survey enumerators were conducting the survey.

    - + \ No newline at end of file diff --git a/blog/tags/swiss-tph.html b/blog/tags/swiss-tph.html index 7a9d00b03c7..0a43a4e5fd6 100644 --- a/blog/tags/swiss-tph.html +++ b/blog/tags/swiss-tph.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ reporting system for the ALMANACH health initiative, OpenFn provided SwissTPH with an automated, real-time connection that enables live disease monitoring in 2019.

    - + \ No newline at end of file diff --git a/blog/tags/telerivet.html b/blog/tags/telerivet.html index 45cc58d0d2d..97b3390c040 100644 --- a/blog/tags/telerivet.html +++ b/blog/tags/telerivet.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ to traditional banks and financing. In this post, we highlight our partner myAgro, an organization leveraging OpenFn automation to help scale its programs towards its goal of serving 1 million farmers in 2025.

    - + \ No newline at end of file diff --git a/blog/tags/tips.html b/blog/tags/tips.html index 973fcabdd07..f4ce9ea5616 100644 --- a/blog/tags/tips.html +++ b/blog/tags/tips.html @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + \ No newline at end of file diff --git a/blog/tags/unicef.html b/blog/tags/unicef.html index 0ebaf20a24b..c4688e0f53c 100644 --- a/blog/tags/unicef.html +++ b/blog/tags/unicef.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ secure OpenFn project space with the automated data sharing workflows required to allow for the Cambodian government and their partner NGO caseworkers to communicate with one another seamlessly.

    - + \ No newline at end of file diff --git a/blog/tags/wash.html b/blog/tags/wash.html index bb19169d413..0dd2475133f 100644 --- a/blog/tags/wash.html +++ b/blog/tags/wash.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ activities. With this integrated service system, X-runner can deliver high quality customer service and technical assistance to their customers, with no time lag.

    - + \ No newline at end of file diff --git a/blog/tags/wcs.html b/blog/tags/wcs.html index 4f4602f3983..3c9c9ed286f 100644 --- a/blog/tags/wcs.html +++ b/blog/tags/wcs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@

    One post tagged with "WCS"

    View All Tags

    · 4 min read

    Since 2020, the Wildlife Conservation Society (“WCS”) has leveraged the OpenFn Integration Toolkit to collect, clean, and integrate critical data for critical conservation programs targeting the world's largest wild places. WCS and its partners work at the frontline of conservation, and with support from OpenFn, they can automatically and seamlessly integrate and quickly analyse the masses of data collected across dozens of countries.

    - + \ No newline at end of file diff --git a/blog/tags/wildlife.html b/blog/tags/wildlife.html index 7765d488e77..45445123b50 100644 --- a/blog/tags/wildlife.html +++ b/blog/tags/wildlife.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@

    One post tagged with "wildlife"

    View All Tags

    · 4 min read

    Since 2020, the Wildlife Conservation Society (“WCS”) has leveraged the OpenFn Integration Toolkit to collect, clean, and integrate critical data for critical conservation programs targeting the world's largest wild places. WCS and its partners work at the frontline of conservation, and with support from OpenFn, they can automatically and seamlessly integrate and quickly analyse the masses of data collected across dozens of countries.

    - + \ No newline at end of file diff --git a/blog/tags/workflow-automation.html b/blog/tags/workflow-automation.html index 688b373e6c6..21201d83a12 100644 --- a/blog/tags/workflow-automation.html +++ b/blog/tags/workflow-automation.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ society, offer online education to students, and conduct search in the education sector. Itaú Social has trained 112,000 professionals and benefited 7.6 million students across Brazil, according to Itaú's 2021 integrated annual report.

    - + \ No newline at end of file diff --git a/blog/tags/x-runner.html b/blog/tags/x-runner.html index 45b29eb9a1b..8daee836eda 100644 --- a/blog/tags/x-runner.html +++ b/blog/tags/x-runner.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ activities. With this integrated service system, X-runner can deliver high quality customer service and technical assistance to their customers, with no time lag.

    - + \ No newline at end of file diff --git a/blog/tags/zoho.html b/blog/tags/zoho.html index 0abf194a9a2..adbc5932bee 100644 --- a/blog/tags/zoho.html +++ b/blog/tags/zoho.html @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ manual data entry and cleaning processes.The real-time connection has enabled live data monitoring for the team as iKapaData survey enumerators were conducting the survey.

    - + \ No newline at end of file diff --git a/documentation.html b/documentation.html index bb3fb2de752..3fd6f18f00c 100644 --- a/documentation.html +++ b/documentation.html @@ -21,7 +21,7 @@ - + @@ -87,7 +87,7 @@ been built by and for the growing community of NGOs, governments, "tech-for-good" partners, and open-source contributors working on the health and humanitarian interventions in Low- and Middle-income Countries (LMICs).

    - + \ No newline at end of file diff --git a/documentation/api-tokens.html b/documentation/api-tokens.html index a9eaa68cf8b..c600ccd8a21 100644 --- a/documentation/api-tokens.html +++ b/documentation/api-tokens.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ on OpenFn (for example, if your profile has Admin level access, your API user will also have Admin permissions).

    Creating an API token

    You can manage your tokens in your User Profile.

    API Tokens Profile

    API Tokens

    1. Click Generate New Token to create a new one.

    New Token

    1. Make sure you copy your new token right away. You won't be able to view or copy it later.
    - + \ No newline at end of file diff --git a/documentation/build-for-developers/build-compliant-apps.html b/documentation/build-for-developers/build-compliant-apps.html index dc3bb519941..b1ef7759504 100644 --- a/documentation/build-for-developers/build-compliant-apps.html +++ b/documentation/build-for-developers/build-compliant-apps.html @@ -21,7 +21,7 @@ - + @@ -70,7 +70,7 @@ must allow either basic, token, or digest authenticated POST, PUT, or GET requests. (Though it is not advisable to create an API that requires GET requests to create or update data.)

    - + \ No newline at end of file diff --git a/documentation/build-with-api.html b/documentation/build-with-api.html index 7bf32a5d082..0aaf89e2385 100644 --- a/documentation/build-with-api.html +++ b/documentation/build-with-api.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Version: v2 ⚡

    Build Projects via the OpenFn API

    OpenFn offers the ability to configure projects via HTTP requests sent to the REST API. See the OpenFn/Lightning GitHub repo for detailed developer documentation.

    - + \ No newline at end of file diff --git a/documentation/build/credentials.html b/documentation/build/credentials.html index 95d1df633cd..7bad6056cfc 100644 --- a/documentation/build/credentials.html +++ b/documentation/build/credentials.html @@ -21,7 +21,7 @@ - + @@ -74,7 +74,7 @@ limiting attack vectors.

  • Ensuring the principle of least privilege: Each integration user need only have access to the subset of data supporting its specific use case.

  • Check out the docs on Security Best Practices to learn more.

    - + \ No newline at end of file diff --git a/documentation/build/editing-locally.html b/documentation/build/editing-locally.html index 65bb54b9f68..23cb5c6edde 100644 --- a/documentation/build/editing-locally.html +++ b/documentation/build/editing-locally.html @@ -21,7 +21,7 @@ - + @@ -55,7 +55,7 @@ git docs).

    From there, the version control integration will update changed steps in your OpenFn Project and you can test those changes on the platform.

    Once you're ready to start running steps and testing your changes locally, head over to the The CLI docs for guidance.

    - + \ No newline at end of file diff --git a/documentation/build/limits.html b/documentation/build/limits.html index f71c644dadb..43720e98f9b 100644 --- a/documentation/build/limits.html +++ b/documentation/build/limits.html @@ -21,7 +21,7 @@ - + @@ -48,7 +48,7 @@ dataclips. You will see an ERROR: DataClip too large for storage error in your attempt logs.

    Instance superusers can control this limit via the MAX_DATACLIP_SIZE environment variable.

    - + \ No newline at end of file diff --git a/documentation/build/paths.html b/documentation/build/paths.html index 6411ce476ad..31af5bbc810 100644 --- a/documentation/build/paths.html +++ b/documentation/build/paths.html @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ Step will be executed.

    Custom Conditions

    Examples of valid conditions include:

    • Run if there are no errors: !state.errors
    • Run if some value exists on state: state.has_valid_email_address
    • Run if a data array contains any items: state.data.length > 0
    • Run if data includes one item which matches criteria: state.data.includes(item => item.age > 18)
    • Run if the last Step received a HTTP error: state.response.statusCode >= 400

    In a custom expression you cannot do any of the following:

    • Use adaptor functions
    • Use Lazy State references ($).
    • Use control statements like if, while, for, etc

    Disabling Paths

    Disabling a path will prevent any of the downstream Steps from running, regardless of the condition or state.

    This can be a useful way of temporarily deactivating part of your workflow.

    To disable a path:

    1. Click on the Path you want to deactive
    2. Select the Disable this path checkbox
    - + \ No newline at end of file diff --git a/documentation/build/steps.html b/documentation/build/steps.html index 6446a5929be..e91e89a7c8a 100644 --- a/documentation/build/steps.html +++ b/documentation/build/steps.html @@ -21,7 +21,7 @@ - + @@ -80,7 +80,7 @@ edit a Job expression to define the "rules" or the specific tasks to be completed by your Step. See the pages on the Inspector and writing Jobs to learn more.

    - + \ No newline at end of file diff --git a/documentation/build/steps/step-design-intro.html b/documentation/build/steps/step-design-intro.html index 7f28790d72f..a9314f6db88 100644 --- a/documentation/build/steps/step-design-intro.html +++ b/documentation/build/steps/step-design-intro.html @@ -21,7 +21,7 @@ - + @@ -50,7 +50,7 @@ Instances (TEI)
  • updateTEI(...)
  • upsertTEI(...)
  • See the below example Job expression for a Step that will "upsert" (update or insert) records in a SQL database.

    upsert('mainDataTable', 'AnswerId', {
      AnswerId: dataValue('\_id'), //external Id for upsert
      column: dataValue('firstQuestion)'),
      LastUpdate: new Date().toISOString(),
      Participant: dataValue('participant'),
      Surveyor: dataValue('surveyor'),
      ...
    });

    See Job Writing Guide for further information.

    - + \ No newline at end of file diff --git a/documentation/build/steps/step-editor.html b/documentation/build/steps/step-editor.html index 71403514af3..988fbbcbed5 100644 --- a/documentation/build/steps/step-editor.html +++ b/documentation/build/steps/step-editor.html @@ -21,7 +21,7 @@ - + @@ -44,7 +44,7 @@ activities performed when running a Workflow or individual Step.

    See Writing Jobs docs for more on writing custom logic, and see this article for more on the concept of "state" when writing Jobs and building OpenFn Workflows.

    - + \ No newline at end of file diff --git a/documentation/build/triggers.html b/documentation/build/triggers.html index 4350873cc3a..fdd3cb6acb5 100644 --- a/documentation/build/triggers.html +++ b/documentation/build/triggers.html @@ -21,7 +21,7 @@ - + @@ -86,7 +86,7 @@ messages, check the Disable this trigger checkbox at the bottom of the trigger configuration modal.

    Learn how the initial state (and Input) for Kafka-triggered Workflows gets built here.

    - + \ No newline at end of file diff --git a/documentation/build/troubleshooting.html b/documentation/build/troubleshooting.html index fe1d3253d3e..53711af3a29 100644 --- a/documentation/build/troubleshooting.html +++ b/documentation/build/troubleshooting.html @@ -21,7 +21,7 @@ - + @@ -80,7 +80,7 @@ and enable a better "OK, how should we solve this given the current chronological and commercial constraints" conversation between the Implementation Team and the Engineering Team.

    - + \ No newline at end of file diff --git a/documentation/build/workflows.html b/documentation/build/workflows.html index cd5846c3a03..e8b8ec90a08 100644 --- a/documentation/build/workflows.html +++ b/documentation/build/workflows.html @@ -21,7 +21,7 @@ - + @@ -57,7 +57,7 @@ start. (No more than 2-at-a-time.)

    Setting Concurrency for a workflow

    Concurrency limits can be set via the workflow settings modal on the workflow canvas.

    1. Click on the settings icon beside the save button on your workflow to open the workflow settings
    2. In the modal, enter the maximum concurrency limit
    3. Click save.

    Configuring Concurrency

    - + \ No newline at end of file diff --git a/documentation/build/working-with-branches.html b/documentation/build/working-with-branches.html index a6f8f403661..184c4c9ead5 100644 --- a/documentation/build/working-with-branches.html +++ b/documentation/build/working-with-branches.html @@ -21,7 +21,7 @@ - + @@ -51,7 +51,7 @@ updated remotely and want integrate the remote changes, use git checkout main, then git pull, then git checkout {working_branch_name} followed by git merge main to merge changes from main into your working branch.

    - + \ No newline at end of file diff --git a/documentation/cli-challenges.html b/documentation/cli-challenges.html index 3fa60eb38da..ff13dc557e7 100644 --- a/documentation/cli-challenges.html +++ b/documentation/cli-challenges.html @@ -21,7 +21,7 @@ - + @@ -55,7 +55,7 @@ that fetch and filter posts by user ID.

    Objective:

    Write a job that retrieves posts by a specified user ID 1

    Requirements:

    1. Utilize JSONPlaceholder API https://jsonplaceholder.typicode.com.
    2. Install the latest version of http adaptor.
    openfn repo install @openfn/language-http

    Tasks:

    1. Create File:

      • Create a file named getPosts.js for your job.
    2. Get All Posts:

      • Add the first operation to fetch all posts. Use the provided API or any other source of your choice that provides a list of posts.
    3. Filter Posts by ID:

      • Add a second operation with a function that filters posts by user ID. You can use Array.filter or any other suitable method for this task.
    4. Fetch Posts for User ID 1:

      • Use the function from the second operation to filter posts for user ID 1.

    Review Checklist:

    • Created getPosts.js file.
    • Successfully fetched all posts.
    • Implemented a function to filter posts by user ID.
    • Retrieved posts for user ID 1.
    - + \ No newline at end of file diff --git a/documentation/cli-usage.html b/documentation/cli-usage.html index 1c2d6151c1f..e7b6048461d 100644 --- a/documentation/cli-usage.html +++ b/documentation/cli-usage.html @@ -21,7 +21,7 @@ - + @@ -43,7 +43,7 @@ running workflows via the CLI.


    Load adaptor documentation

    The CLI can list adaptor documentation in the terminal. Note that it has to download the adaptor to the repo (if it's not already there), which can take a moment.

    Print a list of adaptor functions

    openfn docs http

    Show docs for a specific function

    openfn docs http post
    - + \ No newline at end of file diff --git a/documentation/cli-walkthrough.html b/documentation/cli-walkthrough.html index 0e23c8157af..1e96e4caf52 100644 --- a/documentation/cli-walkthrough.html +++ b/documentation/cli-walkthrough.html @@ -21,7 +21,7 @@ - + @@ -106,7 +106,7 @@ ignored configuration file that will contain necessary credentials that will be used to access the destination system. For example:

    {
    ...
    "configuration": "tmp/openMRS-credentials.json"
    },
  • Data Key: In case you need to pass initial data to your job, specify a path to a gitignored data file

    {
    ...
    "state": {
    "data": "tmp/initial-data.json",
    }
    }
  • - + \ No newline at end of file diff --git a/documentation/cli.html b/documentation/cli.html index 67067a87509..d42af7a23c8 100644 --- a/documentation/cli.html +++ b/documentation/cli.html @@ -21,7 +21,7 @@ - + @@ -45,7 +45,7 @@ command.

    Expand to see the expected output.
    [CLI] ♦ Versions:
    ▸ node.js 18.12.1
    ▸ cli 1.0.0
    [CLI] ℹ Running test workflow...

    [CLI] ℹ Execution plan:
    [CLI] ℹ {
    "options": {
    "start": "start"
    },
    "workflow": {
    "steps": [
    {
    "id": "start",
    "state": {
    "data": {
    "defaultAnswer": 42
    }
    },
    "expression": "const fn = () => (state) => { console.log('Starting computer...'); return state; }; fn()",
    "next": {
    "calculate": "!state.error"
    }
    },
    {
    "id": "calculate",
    "expression": "const fn = () => (state) => { console.log('Calculating to life, the universe, and everything..'); return state }; fn()",
    "next": {
    "result": true
    }
    },
    {
    "id": "result",
    "expression": "const fn = () => (state) => ({ data: { answer: state.data.answer || state.data.defaultAnswer } }); fn()"
    }
    ]
    }
    }

    [CLI] ✔ Compiled all expressions in workflow
    [R/T] ℹ Executing undefined
    [R/T] ℹ Starting step start
    [JOB] ℹ Starting computer...
    [R/T] ✔ Completed step start in 1ms
    [R/T] ℹ Starting step calculate
    [JOB] ℹ Calculating to life, the universe, and everything..
    [R/T] ✔ Completed step calculate in 1ms
    [R/T] ℹ Starting step result
    [R/T] ✔ Completed step result in 0ms
    [CLI] ✔ Result: 42

    All other output is the CLI telling us what it is doing internally.

    Check the version

    openfn -v

    Get help

    openfn help

    Updating the CLI

    To install a new version straight on top of your current installation, run the following command.

    npm install -g @openfn/cli

    Troubleshooting

    If you encounter installation issues, try uninstalling the current version first and then re-installing.

    npm uninstall -g @openfn/cli
    npm install -g @openfn/cli
    - + \ No newline at end of file diff --git a/documentation/collaboration.html b/documentation/collaboration.html index 3669c18f399..78c2d03a416 100644 --- a/documentation/collaboration.html +++ b/documentation/collaboration.html @@ -21,7 +21,7 @@ - + @@ -50,7 +50,7 @@ Remove Collaborator button on the Collaboration page and confirm the removal through the pop up window. The owner of a project cannot be removed.

    The project collaborators page is also where you can configure failure

    alerts and digests for your projects. Learn more about it in this guide. :::

    - + \ No newline at end of file diff --git a/documentation/contribute/openfn-roadmap.html b/documentation/contribute/openfn-roadmap.html index e20adaa1dc4..25d1b8f1b26 100644 --- a/documentation/contribute/openfn-roadmap.html +++ b/documentation/contribute/openfn-roadmap.html @@ -21,7 +21,7 @@ - + @@ -77,7 +77,7 @@ issues for bugs via product repository. You can also independetly start contributing to the OpenFn software, adaptors, or documentation by getting started here.

    - + \ No newline at end of file diff --git a/documentation/contribute/writing-code.html b/documentation/contribute/writing-code.html index cb068837db8..12a49bd41bb 100644 --- a/documentation/contribute/writing-code.html +++ b/documentation/contribute/writing-code.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ tools themselves. (The more feedback the better!). If you want to propose some new language for the documentation, you can make those changes by clicking the "Edit this page" link at the bottom of any page and submit a pull request!

    - + \ No newline at end of file diff --git a/documentation/contribute/writing-docs.html b/documentation/contribute/writing-docs.html index 1db2e65b7b1..fbc8ef4f642 100644 --- a/documentation/contribute/writing-docs.html +++ b/documentation/contribute/writing-docs.html @@ -21,7 +21,7 @@ - + @@ -47,7 +47,7 @@ reviewers judge whether the doc fix solves the stated problem.

    Get prompt and good quality reviews from team members

    Trust team members to value docs, ensure technical accuracy and consistency, respect end users’ needs, and advocate for the best doc deliverables for consumers.

    Make beautiful docs

    Design is important. Create beautiful and modern looking docs.

    Use developer tools and workflows

    Automate the process as much as possible, so we can focus on content creation.

    - + \ No newline at end of file diff --git a/documentation/converting-triggers.html b/documentation/converting-triggers.html index 2abfeee652e..9f93b88b1bf 100644 --- a/documentation/converting-triggers.html +++ b/documentation/converting-triggers.html @@ -21,7 +21,7 @@ - + @@ -48,7 +48,7 @@ configured your Webhook, you can use a custom Path Condition that matches a JavaScript expression to decide whether a subsequent job should be executed or not.

    For example, if on v1 you had a Message Filter trigger that looked like this:

    Trigger Example

    The matching v2 JavaScript Path Condition would look like this:

    Path Condition Example

    - + \ No newline at end of file diff --git a/documentation/deploy/options.html b/documentation/deploy/options.html index 0629031a1dd..a8cd2562224 100644 --- a/documentation/deploy/options.html +++ b/documentation/deploy/options.html @@ -21,7 +21,7 @@ - + @@ -67,7 +67,7 @@ the export).
  • Test your locally deployed project.
  • Technical Guidelines

    For detailed deployment documentation instructions, head to the Lightning developer docs page, paying special attention to several sections:

    1. Getting Started
    2. Deployment Considerations
    3. Benchmarking
    - + \ No newline at end of file diff --git a/documentation/deploy/portability-versions.html b/documentation/deploy/portability-versions.html index 5a65bb3c3d1..ec033906ea2 100644 --- a/documentation/deploy/portability-versions.html +++ b/documentation/deploy/portability-versions.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Version: v2 ⚡

    Versions of the Portability Proposal

    OpenFn is currently designing a portable project configuration schema that can be used to import or export projects between OpenFn/platform and OpenFn/engine.

    Current

    See the current specification here.

    v2

    Used for export from the legacy platform.

    jobs:
    job-1:
    expression: >
    registerPatient({
    patient-id: state.data.id,
    dob: state.data.birth
    })
    adaptor: '@openfn/language-openmrs'
    trigger: trigger-1
    credential: my-secret-credential
    recurring-job:
    expression: >
    fn(state => {
    console.log("Hi there!")
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: every-minute
    flow-job:
    expression: >
    fn(state => {
    state.data.number = state.data.number * 3
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: after-j1
    catch-job:
    expression: >
    fn(state => {
    state.message = "handled it."
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: j1-fails

    triggers:
    trigger-1:
    criteria: '{"number":2}'
    every-minute:
    cron: '* * * * *'
    after-j1:
    success: job-1
    j1-fails:
    failure: job-1

    # Note that credential keys get copied, but values must be manually entered
    # after the export is completed.
    credentials:
    my-secret-credential:
    username: '******'
    password: '******'

    v1

    Initial portability proposal

    const project = {
    async: true,
    triggers: {
    uniqueTriggerId: {
    // trigger properties
    },
    otherTrigger: {
    // other trigger properties
    },
    },
    credentials: {
    // for now, credentials will not be synced //
    // secret1: {
    // username: 'mamadou',
    // pass: 'shhh',
    },
    staticData: {
    // static objects that can be accessed from any job
    },
    jobs: {
    payHealthWorker: { trigger: 'otherTrigger' },
    syncToSalesforce: {
    expression: 'uri://github.com/jobs/expresion.js',
    trigger: 'uniqueTriggerId',
    credential: 'secret1',
    },
    },
    };
    - + \ No newline at end of file diff --git a/documentation/deploy/portability.html b/documentation/deploy/portability.html index 8ae88209803..3a2a2501dd2 100644 --- a/documentation/deploy/portability.html +++ b/documentation/deploy/portability.html @@ -21,7 +21,7 @@ - + @@ -77,7 +77,7 @@ between IDs of workflows in your projectSpec and your OpenFn instance. When this occurs, the error will be written out in an error object as shown below:

    [CLI] ✘ Failed to deploy project openfn-data-buffers-prototype:
    {
    "errors": {
    "workflows": {
    "1-ingest-messages": {
    "base": [
    "extraneous parameters: workflow_id"
    ]
    },
    "2-calculate-indicators": {
    "base": [
    "extraneous parameters: workflow_id"
    ]
    }
    }
    }

    Solution

    Run openfn pull to update your local instance and keep IDs in sync, incorporate your changes and run openfn deploy again.

    Other Versions

    - + \ No newline at end of file diff --git a/documentation/deploy/requirements.html b/documentation/deploy/requirements.html index 6198fc25f9b..b0225acd6d9 100644 --- a/documentation/deploy/requirements.html +++ b/documentation/deploy/requirements.html @@ -21,7 +21,7 @@ - + @@ -75,7 +75,7 @@ specialist, the following sample configurations may provide useful starting points.

    (a) Simple

    Deploy the application and database on the same machine.

    Deploy the application and database on separate machines.

    (c) Ideal

    Auto-scale different optimized node pools in a Kubernetes cluster for the Erlang orchestration app and the Javascript worker app.

    Consider high-availability Postgres-as-a-service, or also run it in a cluster.

    - + \ No newline at end of file diff --git a/documentation/design/api-discovery.html b/documentation/design/api-discovery.html index 57d7ce50101..aca358c2762 100644 --- a/documentation/design/api-discovery.html +++ b/documentation/design/api-discovery.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Version: v2 ⚡

    Discovering APIs to inform your workflow automation design

    This article explains how to analyze API documentation and draft a technical workflow diagram.

    What is an API?

    APIs tell applications how to communicate. An API is the “messenger” that:

    1. Tells you how to form a request,
    2. Delivers your request to the provider that you’re requesting it from, and then
    3. Delivers the response back to you
    Workflow
    Source

    OpenFn connects with APIs via http requests sent via the web. OpenFn can automate any tasks supported by the APIs of the applications it integrates with (e.g., if an app’s API supports sending payments, then OpenFn can automate sending payments).

    How to analyze API documentation

    In the beginning of the design process, you should explore the target system’s API documentation to determine the options for integration.

    Determine integration options

    Consider these questions to determine your integration options–even if an API is not available. :

    1. Is there a RESTful API?
      • If yes, OpenFn can connect out-of-box! REST API is the gold standard for most modern web apps, and typically supports JSON data format.
    2. Is there a webhook?
      • Most mobile data collection apps offer this feature. Some call it “data forwarding”, “web callback”, or “HTTP push API”.
      • Webhooks automatically send messages or notifications when something happens (e.g., when a new form is submitted, notify external services like OpenFn). These event-based notifications enable real-time data integration or automated actions.
    3. Otherwise, what are other options for importing/exporting data from the target applications?
      • Can you connect directly to a database?
      • Is there a way to import/export files? (JSON, CSV, XLS, or XML)
      • Is there a legacy API (e.g., SOAP) that we can communicate with via HTTP requests?
    tip

    OpenFn can connect any app, even if an API is not supported. See the “Adaptors” section to learn more.

    Authentication

    API documentation will typically have a section dedicated to authentication options. Look for this to discover which authentication methods are supported, and whether configuration work will be required to set up a new user or API credential.

    Consider that authentication methods that leverage API Keys or OAuth are typically more secure than basic authentication (username/password).

    tip

    As early as possible, request an API credential from the system administrator of the app you’re trying to integrate with. This way, you can test authentication with a developer/test environment to verify that you’re able to connect.

    API Endpoints

    Analyze the documentation to see which resources/entities and features are supported by the API. For example, if you want to register Patient records via the API, search for reference to the “/patients” endpoint (or whatever this resource is called in your target application).

    This section of the documentation will include an overview of which HTTP request methods (i.e., POST, GET, etc.) and request parameters are supported, as well as example HTTP requests you can send to the API.

    HTTP request methods will inform you which operations are supported by the API.

    1. Create → POST
    2. Read → GET
    3. Update → PUT or PATCH
    4. Delete → DELETE

    For example, if you want to query Patient records from an app, see if the API documentation supports GET ‘/patients’.

    Limits

    Be on the lookout for API limits. Documentation will often have a dedicated section that will describe if there are any limits or considerations for API requests and rates, concurrency, and record limits. Understanding these limits upfront can inform your integration design to ensure high-performing, scalable automation.

    Technical Workflow Diagramming

    The output of API discovery should be a “technical” workflow diagram. This diagram is different from the functional workflow diagram produced during “Discovery” in that it captures the technical specifications for how to integrate with target applications. These specifications include the specific methods/operations (e.g., GET, POST) and the database/API names of the target resources (i.e., specific API endpoints or database tables).

    Workflow

    When drafting your technical specifications, consider the following:

    1. Plan for failure. Your workflows will fail. Consider what happens when they do…
      • Should individuals be notified?
      • How can the workflow be re-processed safely?
      • How to ensure no duplicate data is created?
    2. Where possible, use unique identifiers to build idempotent automation. Check for existing records in the target system using an available unique identifier:
      • System record UUIDs (e.g., record_id: asjd2910-b8zy1s0a),
      • Unique codes (e.g., HOUSEHOLD-10013) and
      • Unique combination of attributes (e.g., familyName + phoneNumber + village + districtCode)
    3. If the target system does not have native “upsert” operation or built-in duplicate-checking before insert, implement an upsert (“update or insert”) pattern to…
      • Check if a record exists using a unique identifier…
      • If yes, update the record.
      • If not, insert a new record.
    4. Don’t forget to consider data volumes. Depending on whether you need to handle 1, 10000, or 1M+ records, your workflow approach may need change.
      • Estimate the file size of the data to be extracted
      • Consider API limits (records returned per page, request rate limits)
      • Consider bulk operations & batching requests

    Check out the technical workflow diagram below for syncing forms submissions from KoboToolBox to DHIS2. The original functional diagram can be found here.

    Workflow

    - + \ No newline at end of file diff --git a/documentation/design/design-overview.html b/documentation/design/design-overview.html index f5e1450521e..1c4149d21d0 100644 --- a/documentation/design/design-overview.html +++ b/documentation/design/design-overview.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Version: v2 ⚡

    Design Process Overview

    This article outlines the high-level steps to design automated workflows, inspired by the OpenFn core team’s standard implementation process.

    Typically the design process happens outside of OpenFn, in conversation and collaboration with relevant business/program and technical stakeholders. Then, once the design is finalized, the workflow configuration, testing, monitoring, and management is handled in OpenFn.

    Key Terms

    Before you dive in, make sure you have a clear understanding of these key terms we’ll reference throughout this documentation:

    Workflow

    The set of instructions that determine how to solve a problem or accomplish a task. They are often broken down into smaller, independent tasks.

    Workflow

    Workflow Automation

    The use of software to perform these tasks independently, in accordance with predefined business rules, and without the need for human input.

    Workflow Automation

    Data Integration

    The process of combining data from different sources into a centralized view. Data integration is a means of achieving workflow automation. Its tasks may be streamlined, automated, and managed by a workflow automation tool.

    Data Integration

    Introduction

    Workflow automation design features 5 main steps that are covered in depth in other articles:

    1. Discovery & Scoping
    2. Workflow Design
    3. API Discovery and Technical Design
    4. Data Element Mapping Specifications
    5. Workflow Specifications

    Example Use Case

    Throughout the design documentation we will reference the fictional data collection & workflow automation scenario below:

    PatientCare is a health NGO that runs a network of community health workers who provide care to patients in remote areas in Guinea. PatientCare workers collect patient data in KoboToolBox. The Guinean government uses DHIS2 as its national health information system (HIS) and requires PatientCare to register all patient data in the HIS.

    - + \ No newline at end of file diff --git a/documentation/design/design-workflow.html b/documentation/design/design-workflow.html index dc624c268f4..18d0ba1ee2a 100644 --- a/documentation/design/design-workflow.html +++ b/documentation/design/design-workflow.html @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ instances") from my country's DHIS2 system, so that I can enroll them as contacts in my SMS campaign configured on RapidPro to send them automated alerts and program updates.

    - + \ No newline at end of file diff --git a/documentation/design/discovery.html b/documentation/design/discovery.html index 5037ab9cd1f..94a612799c6 100644 --- a/documentation/design/discovery.html +++ b/documentation/design/discovery.html @@ -21,7 +21,7 @@ - + @@ -76,7 +76,7 @@ organization and between third party services)
  • Types of data exchanged
  • Authentication/access points
  • Such diagrams promote transparency, help to identify potential data exposure risks, and provide documentation of compliance with data protection requirements. Check out the example solution architecture diagrams below.

    Example 1:

    Workflow

    Example 2:

    Workflow
    Source
    - + \ No newline at end of file diff --git a/documentation/design/mapping-specs.html b/documentation/design/mapping-specs.html index 6b0c87a04d9..c062bfcd3d2 100644 --- a/documentation/design/mapping-specs.html +++ b/documentation/design/mapping-specs.html @@ -21,7 +21,7 @@ - + @@ -93,7 +93,7 @@ to start. For example, you might collect individual patient records in KoboToolBox, but want to send an aggregated count of patients to DHIS2 for key indicator results reporting (e.g. the number of patients under 18 years old).

    - + \ No newline at end of file diff --git a/documentation/design/overview.html b/documentation/design/overview.html index d29e8369b59..cee2d624d35 100644 --- a/documentation/design/overview.html +++ b/documentation/design/overview.html @@ -21,7 +21,7 @@ - + @@ -108,7 +108,7 @@ implementing partners.

    Share this documentation with any technical implementation team, or check out the Build documentation section to learn how to implement these design specifications using OpenFn.

    - + \ No newline at end of file diff --git a/documentation/design/workflow-specs.html b/documentation/design/workflow-specs.html index a0c315f2c12..59aa4804c29 100644 --- a/documentation/design/workflow-specs.html +++ b/documentation/design/workflow-specs.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Version: v2 ⚡

    Writing specifications for workflow automation solutions

    The key outputs of the the design process are:

    1. Functional Workflow diagram
    2. Technical Workflow diagram
    3. Solution Architecture Diagram
    4. Data element mapping specifications

    Given these, you’ll be ready to finalize your workflow specifications and hand-off to developers for job-writing!

    Each “task” or “step” in the OpenFn swimlane of your technical diagram can be implemented as a distinct operation in your workflow configuration. In the example diagram below, you might implement 1 job with 3 chained operations, or 3 jobs with 1 operation each.

    workflow

    The workflow specifications should link to all of the design artifacts and highlight the following:

    1. The required number of OpenFn jobs and the function of each
    2. Links to sample input/output and API documentation
    3. Unique identifiers
    4. Expected data volumes
    5. Authentication requirements
    - + \ No newline at end of file diff --git a/documentation/get-help/support.html b/documentation/get-help/support.html index 7aacdd0ebc5..4392bea9a7e 100644 --- a/documentation/get-help/support.html +++ b/documentation/get-help/support.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Version: v2 ⚡

    Support for OpenFn Implementations

    Ask the Community!

    If you need help getting started, have questions, or product feedback, first check out our Community. Our core team and other OpenFn implementers monitor all posts to help each other out, share examples, and circulate product updates.

    Have a question about your project on OpenFn.org?

    If you're using the hosted OpenFn platform SaaS, and have a private question about your project, account, or billing, contact our core team at support@openfn.org.

    Need helping hands?

    The OpenFn core team and our certified partners offer enterprise support, implementation & developer services, and training to jump-start your team. Check out our website:

    - + \ No newline at end of file diff --git a/documentation/get-started/glossary.html b/documentation/get-started/glossary.html index 71c1daa02c8..526ea390b4f 100644 --- a/documentation/get-started/glossary.html +++ b/documentation/get-started/glossary.html @@ -21,7 +21,7 @@ - + @@ -103,7 +103,7 @@ accordance with predefined business rules, and without the need for human input.

    Writeback

    Refers to a destination system making a change in a data source. When my destination application receives information from a data source and wants to do something back to the source in response, that's writeback.

    - + \ No newline at end of file diff --git a/documentation/get-started/implementation-checklist.html b/documentation/get-started/implementation-checklist.html index fb0cf4ec6ec..c8648dc5eac 100644 --- a/documentation/get-started/implementation-checklist.html +++ b/documentation/get-started/implementation-checklist.html @@ -21,7 +21,7 @@ - + @@ -40,7 +40,7 @@ openfn.github.io/unicef-cambodia/

    (1) Preparing for the Implementation

    Set the project up for success by creating a project plan, defining roles responsibilities, documenting the business value of the implementation, and confirming the technical feasibility of the implementation.

    Key Outputs:

    • Business Value Assessment
    • High-level workflow requirements
    • Technical Feasibility Assessment
    • Capacity Assessment

    (2) Discovery & Design - Functional Workflow Requirements

    Gather and document user stories and functional workflow requirements.

    Key Outputs:

    • Solution Architecture Diagram
    • Workflow Diagrams (functional)
    • Data Element Mapping Specifications (functional)

    (3) Discovery & Design - Technical Specifications

    Iterate on workflow requirements to define technical specifications for how the workflow will be implemented. For instance, consider specific API endpoints to access and HTTP methods/operations to use for each.

    Key Outputs:

    • Solution Architecture Diagram
    • Workflow Diagrams (technical)
    • Data Element Mapping Specifications (technical)

    (4) Build

    Configure the workflow on OpenFn.org and develop and test the jobs and adaptors to be used in the workflow.

    Key Outputs:

    • OpenFn Project configuration
    • Jobs
    • Adaptors - new/updated (if needed)
    • Drafted “Project Security Configuration Checklist” to document config settings implemented

    (5) Testing

    Create a test suite and conduct UAT. After UAT, Incorporate any feedback and iterate on the testing process.

    Key Outputs:

    • Completed test suite
    • Backlog of new requests (if feedback identified for future phases)
    • Completed “Project Security Configuration Checklist”

    (6) Training & Prep for Go-Live

    Train OpenFn administrators and target system end users and document what was implemented. This is also the phase where the configuration and code is migrated to production environments.

    Key Outputs:

    • Published documentation
    • Training video recording
    • Signed-off “Project Security Configuration Checklist”
    • Ready-to-go OpenFn project

    (7) Rollout & Support

    Turn “on” OpenFn workflows to go-live and establish support structures & a governance model for change management.

    Key Outputs:

    • “Live” OpenFn project
    • Documented support model

    Questions or feedback?

    If you have any inputs, comments, or questions—please contribute! Submit a pull request to this documentation page on GitHub or leave a comment in OpenFn Community.

    Interested in receiving training on the OpenFn implementation process? Contact partnerships@openfn.org.

    - + \ No newline at end of file diff --git a/documentation/get-started/security-compliance.html b/documentation/get-started/security-compliance.html index 4c536d34adf..5cb8ee7d02c 100644 --- a/documentation/get-started/security-compliance.html +++ b/documentation/get-started/security-compliance.html @@ -21,7 +21,7 @@ - + @@ -43,7 +43,7 @@ partners to rapidly configure and pilot projects using the turnkey OpenFn cloud-hosted platform, before migrating to a local deployment when they’re ready to scale.

    Sample Architecture

    - + \ No newline at end of file diff --git a/documentation/get-started/security.html b/documentation/get-started/security.html index 7308800119f..7598ac5b248 100644 --- a/documentation/get-started/security.html +++ b/documentation/get-started/security.html @@ -21,7 +21,7 @@ - + @@ -50,7 +50,7 @@ openfn.org/trust and openfn.org/compliance.

    Here are the key OpenFn templates and resources referenced in the Guidebook:

    Communities of practice & other experts

    Here are some other communities you may consider following for more security guidance.

    1. OpenHIE Privacy & Security Working Group
    2. GovStack
    3. DHIS2 Security Team & Community of Practice
    4. Asia eHealth Information Network (AeHIN) Communities of Practice
    - + \ No newline at end of file diff --git a/documentation/get-started/standards.html b/documentation/get-started/standards.html index a029b68d78b..084bf4e620a 100644 --- a/documentation/get-started/standards.html +++ b/documentation/get-started/standards.html @@ -21,7 +21,7 @@ - + @@ -76,7 +76,7 @@ quickly develop automation that reformats data received from CommCare and maps it to the DHIS2 data model.

    swisstph

    GovStack

    OpenFn is compliant with GovStack's standard specification for workflow engines.

    Pricinciples for Digital Development

    OpenFn was designed for the social sector and has been actively prioritizing the Principles of Digital Development since its inception.

    OpenFn solutions are:

    • interoperable (connect any application);
    • reusable (utilize existing OpenFn configurations as templates, or easily share, copy, and modify your own configurations; see docs.openfn.org/library);
    • sustainable (flexible implementation options with no lock-in);
    • scalable (OpenFn leverages enterprise-grade tech to handle high data volumes and provides a range of deployment options to ensure total solution ownership on any server);
    • promote open standards and open access (through our open-source software, documentation, and features to help users implement open standards in their information exchange solutions), and
    • address privacy & security.

    FHIR for health data exchange

    FHIR (pronounced "fire" 🔥) is a standard for health care data exchange, published by HL7®.

    OpenFn is used by health organizations to connect multiple FHIR- and non-FHIR compliant systems in a secure, stable, and scalable manner. OpenFn can facilitate 2 categories of FHIR workflows:

    1. Non-FHIR to FHIR

    OpenFn users can configure Workflows to convert non-FHIR data to FHIR-compliant formats, and then route to FHIR systems.

    For example, get data from CommCare mobile app, convert to FHIR, and send to national health system's FHIR store. nonFHIR Workflow

    2.FHIR to FHIR

    OpenFn users can also configure Workflows to automate the exchange and routing of already FHIR-compliant data to other FHIR-compliant systems.

    For example, get data from OpenMRS's FHIR API, and forward to the national health system's FHIR store (no data transformation needed).

    FHIR Workflow

    Other Data Standards

    OpenFn Workflows can automate data transformation, cleaning, and formatting rules to ensure compliance with your organization's specific standards.

    Ask on the community to explore how OpenFn can be leverage to help automate application and enforcement of other data standards.

    - + \ No newline at end of file diff --git a/documentation/get-started/terminology.html b/documentation/get-started/terminology.html index f18bfa83b05..fc21dd4ad54 100644 --- a/documentation/get-started/terminology.html +++ b/documentation/get-started/terminology.html @@ -21,7 +21,7 @@ - + @@ -117,7 +117,7 @@ are either passed to the next Step in the workflow and/or to the connected destination app.

    Example Output if that form submission example (see above section) was mapped to a connected case management app:

    {
    "data": {
    "patient": {
    "full_name": "John Doe",
    "age_at_enrollment": 16,
    "type": "new",
    "source": "mobile-app"
    }
    }
    }
    - + \ No newline at end of file diff --git a/documentation/get-started/try-out.html b/documentation/get-started/try-out.html index 8512c2988ad..23949d80b92 100644 --- a/documentation/get-started/try-out.html +++ b/documentation/get-started/try-out.html @@ -21,7 +21,7 @@ - + @@ -43,7 +43,7 @@ github.com/OpenFn/lightning.

    Questions?

    Check out these docs for more details on specific features (see menu sidebar), browse the main docs page, or post your questions on Community.

    - + \ No newline at end of file diff --git a/documentation/hosted/overview.html b/documentation/hosted/overview.html index 3639ffa5ca3..808d892affa 100644 --- a/documentation/hosted/overview.html +++ b/documentation/hosted/overview.html @@ -21,7 +21,7 @@ - + @@ -52,7 +52,7 @@ cycle ends as you have already pre-paid for usage during that cycle. When the cycle ends, the lower limits will be applied and your next charge will be for the price of your new plan.

    - + \ No newline at end of file diff --git a/documentation/jobs/javascript.html b/documentation/jobs/javascript.html index 838893d7002..39ce3c63a33 100644 --- a/documentation/jobs/javascript.html +++ b/documentation/jobs/javascript.html @@ -21,7 +21,7 @@ - + @@ -83,7 +83,7 @@ expression. See the documentation on mapping specifications for more information on globals.

    //Workflow step 1
    //First we use fn() to tranform, map & clean our data
    fn(state => {

    //Global mapping rules you want to implement in your workflow
    const locationMap = {
    //location_id from source app: location value in destination app
    01: 'Western Cape',
    02: 'Eastern Cape',
    03: 'Gauteng'
    }

    // Here we build the payload of our http request body...
    // We assume the input is an array of records
    const payload = state.data.map(record => ({
    location: locationMap[record.location_id] //translate location_id to the mapped value
    external_id: record.case_id
    }));

    return {...state, payload};
    });

    //Workflow step 2
    //Then we post the payload built in the prior operation to create a record
    post('/api/myEndpoint', {
    headers: {
    'Content-Type': 'application/json',
    },
    body: (state) => state.payload
    });
    - + \ No newline at end of file diff --git a/documentation/jobs/job-examples.html b/documentation/jobs/job-examples.html index e3dde1d1e2f..501c057cba6 100644 --- a/documentation/jobs/job-examples.html +++ b/documentation/jobs/job-examples.html @@ -21,7 +21,7 @@ - + @@ -44,7 +44,7 @@ language-common: combine

    Create many child records WITHOUT a repeat group in ODK

    beta.each(
    '$.data.data[*]',
    upsert(
    'Outlet__c',
    'Outlet_Code__c',
    fields(
    field('Outlet_Code__c', dataValue('outlet_code')),
    field('Location__Latitude__s', dataValue('gps:Latitude')),
    field('Location__Longitude__s', dataValue('gps:Longitude'))
    )
    )
    ),
    beta.each(
    '$.data.data[*]',
    upsert(
    'Outlet_Call__c',
    'Invoice_Number__c',
    fields(
    field('Invoice_Number__c', dataValue('invoice_number')),
    relationship('Outlet__r', 'Outlet_Code__c', dataValue('outlet_code')),
    relationship('RecordType', 'name', 'No Call Card'),
    field('Trip__c', 'a0FN0000008jPue'),
    relationship(
    'Sales_Person__r',
    'Sales_Rep_Code__c',
    dataValue('sales_rep_code')
    ),
    field('Date__c', dataValue('date')),
    field('Comments__c', dataValue('comments'))
    )
    )
    );

    Salesforce: perform an update

    update("Patient__c", fields(
    field("Id", dataValue("pathToSalesforceId")),
    field("Name__c", dataValue("patient.first_name")),
    field(...)
    ));

    Salesforce: Set record type using 'relationship(...)'

    create(
    'custom_obj__c',
    fields(
    relationship(
    'RecordType',
    'name',
    dataValue('submission_type'),
    field('name', dataValue('Name'))
    )
    )
    );

    Salesforce: Set record type using record Type ID

    each(
    '$.data.data[*]',
    create(
    'fancy_object__c',
    fields(
    field('RecordTypeId', '012110000008s19'),
    field('site_size', dataValue('size'))
    )
    )
    );

    Telerivet: Send SMS based on Salesforce workflow alert

    send(
    fields(
    field(
    'to_number',
    dataValue(
    'Envelope.Body.notifications.Notification.sObject.phone_number__c'
    )
    ),
    field('message_type', 'sms'),
    field('route_id', ''),
    field('content', function (state) {
    return 'Hey there. Your name is '.concat(
    dataValue('Envelope.Body.notifications.Notification.sObject.name__c')(
    state
    ),
    '.'
    );
    })
    )
    );

    HTTP: fetch but don't fail!

    // =============
    // We use "fetchWithErrors(...)" so that when the
    // SMS gateway returns an error the run does not "fail".
    // It "succeeds" and then delivers that error message
    // back to Salesforce with the "Update SMS Status" job.
    // =============
    fetchWithErrors({
    getEndpoint: 'send_to_contact',
    query: function (state) {
    return {
    msisdn:
    state.data.Envelope.Body.notifications.Notification.sObject
    .SMS__Phone_Number__c,
    message:
    state.data.Envelope.Body.notifications.Notification.sObject
    .SMS__Message__c,
    api_key: 'some-secret-key',
    };
    },
    externalId: state.data.Envelope.Body.notifications.Notification.sObject.Id,
    postUrl: 'https://www.openfn.org/inbox/another-secret-key',
    });

    Sample DHIS2 events API job:

    event(
    fields(
    field('program', 'eBAyeGv0exc'),
    field('orgUnit', 'DiszpKrYNg8'),
    field('eventDate', dataValue('properties.date')),
    field('status', 'COMPLETED'),
    field('storedBy', 'admin'),
    field('coordinate', {
    latitude: '59.8',
    longitude: '10.9',
    }),
    field('dataValues', function (state) {
    return [
    {
    dataElement: 'qrur9Dvnyt5',
    value: dataValue('properties.prop_a')(state),
    },
    {
    dataElement: 'oZg33kd9taw',
    value: dataValue('properties.prop_b')(state),
    },
    {
    dataElement: 'msodh3rEMJa',
    value: dataValue('properties.prop_c')(state),
    },
    ];
    })
    )
    );

    Sample DHIS2 data value sets API job:

    dataValueSet(
    fields(
    field('dataSet', 'pBOMPrpg1QX'),
    field('orgUnit', 'DiszpKrYNg8'),
    field('period', '201401'),
    field('completeData', dataValue('date')),
    field('dataValues', function (state) {
    return [
    { dataElement: 'f7n9E0hX8qk', value: dataValue('prop_a')(state) },
    { dataElement: 'Ix2HsbDMLea', value: dataValue('prop_b')(state) },
    { dataElement: 'eY5ehpbEsB7', value: dataValue('prop_c')(state) },
    ];
    })
    )
    );

    sample openMRS expression, creates a person and then a patient

    person(
    fields(
    field('gender', 'F'),
    field('names', function (state) {
    return [
    {
    givenName: dataValue('form.first_name')(state),
    familyName: dataValue('form.last_name')(state),
    },
    ];
    })
    )
    ),
    patient(
    fields(
    field('person', lastReferenceValue('uuid')),
    field('identifiers', function (state) {
    return [
    {
    identifier: '1234',
    identifierType: '8d79403a-c2cc-11de-8d13-0010c6dffd0f',
    location: '8d6c993e-c2cc-11de-8d13-0010c6dffd0f',
    preferred: true,
    },
    ];
    })
    )
    );

    merge many values into a child path

    each(
    merge(
    dataPath("CHILD_ARRAY[*]"),
    fields(
    field("metaId", dataValue("*meta-instance-id*")),
    field("parentId", lastReferenceValue("id"))
    )
    ),
    create(...)
    )

    arrayToString

    arrayToString(arr, separator_string);

    access an image URL from an ODK submission

    // In ODK the image URL is inside an image object...
    field("Photo_URL_text__c", dataValue("image.url")),

    alterState (alter state) to make sure data is in an array

    // Here, we make sure CommCare gives us an array to use in each(merge(...), ...)
    fn(state => {
    const idCards = state.data.form.ID_cards_given_to_vendor;
    if (!Array.isArray(idCards)) {
    state.data.form.ID_cards_given_to_vendor = [idCards];
    }
    return state;
    });

    // Now state has been changed, and we carry on...
    each(
    merge(
    dataPath('form.ID_cards_given_to_vendor[*]'),
    fields(
    field('Vendor_Id', dataValue('form.ID_vendor')),
    field('form_finished_time', dataValue('form.meta.timeEnd'))
    )
    ),
    upsert(
    'Small_Packet__c',
    'sp_id__c',
    fields(
    field('sp_id__c', dataValue('ID_cards_given_to_vendor')),
    relationship('Vendor__r', 'Badge_Code__c', dataValue('Vendor_Id')),
    field(
    'Small_Packet_Distribution_Date__c',
    dataValue('form_finished_time')
    )
    )
    )
    );

    Login in to a server with a custom SSL Certificate

    This snippet describes how you would connect to a secure server ignoring SSL certificate verification. Set strictSSL: false in the options argument of the post function in language-http.

    post(
    `${state.configuration.url}/${path}`,
    {
    headers: { 'content-type': 'application/json' },
    body: {
    email: 'Luka',
    password: 'somethingSecret',
    },
    strictSSL: false,
    },
    callback
    );
    - + \ No newline at end of file diff --git a/documentation/jobs/job-snippets.html b/documentation/jobs/job-snippets.html index c78bbe37eaf..3220d3829dc 100644 --- a/documentation/jobs/job-snippets.html +++ b/documentation/jobs/job-snippets.html @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ Salesforce, you're taking the id of the 1st thing, or 2nd thing if you replace "length-1" with "length-2".

    Salesforce

    Convert date string to standard ISO date for Salesforce

    field('Payment_Date__c', function (state) {
    return new Date(dataValue('payment_date')(state)).toISOString();
    });

    NOTE: The output of this function will always be formatted according to GMT time-zone.

    Use external ID fields for relationships during a bulk load in Salesforce

    array.map(item => {
    return {
    Patient_Name__c: item.fullName,
    'Account.Account_External_ID__c': item.account
    'Clinic__r.Unique_Clinic_Identifier__c': item.clinicId,
    'RecordType.Name': item.type,
    };
    });

    Bulk upsert with an external ID in Salesforce

    bulk(
    'Visit_new__c',
    'upsert',
    {
    extIdField: 'commcare_case_id__c',
    failOnError: true,
    allowNoOp: true,
    },
    dataValue('patients')
    );
    - + \ No newline at end of file diff --git a/documentation/jobs/job-writing-guide.html b/documentation/jobs/job-writing-guide.html index a2a7d897926..75d471304c0 100644 --- a/documentation/jobs/job-writing-guide.html +++ b/documentation/jobs/job-writing-guide.html @@ -21,7 +21,7 @@ - + @@ -294,7 +294,7 @@ Workflow Design Process docs.

    Questions?

    If you have any job-writing questions, ask on Community to seek assistance from the OpenFn core team and other implementers.

    - + \ No newline at end of file diff --git a/documentation/jobs/state.html b/documentation/jobs/state.html index a17121e6661..7a442b0e7b9 100644 --- a/documentation/jobs/state.html +++ b/documentation/jobs/state.html @@ -21,7 +21,7 @@ - + @@ -59,7 +59,7 @@ operation.

    {
    data: { patients: [] },
    references: [1, 2, 3]
    }

    On failure

    When a step in a workflow fails, the error will be added to an errors object on state, keyed by the ID of the job that failed.

    {
    data: { patients: [] },
    references: [1, 2, 3],
    errors: {
    jobId: { /* error details */ }
    }
    }

    See the below diagram for a visual description of how state might be passed between Steps in a Workflow.

    Passing State

    - + \ No newline at end of file diff --git a/documentation/kobo-to-dhis2.html b/documentation/kobo-to-dhis2.html index a68c762b3d3..4290be3c65e 100644 --- a/documentation/kobo-to-dhis2.html +++ b/documentation/kobo-to-dhis2.html @@ -21,7 +21,7 @@ - + @@ -75,7 +75,7 @@ Introduction to Workflows and History tutorial or post your questions on the Community to get help!

    - + \ No newline at end of file diff --git a/documentation/legacy.html b/documentation/legacy.html index 7607b684d3a..fb823879adf 100644 --- a/documentation/legacy.html +++ b/documentation/legacy.html @@ -21,7 +21,7 @@ - + @@ -74,7 +74,7 @@ community.openfn.org. Sign up and join the conversation. Usually, that's the quickest way to get help if you've got questions that aren't answered here.

    - + \ No newline at end of file diff --git a/documentation/legacy/about-lightning.html b/documentation/legacy/about-lightning.html index aed915ff60a..5c03c3357ce 100644 --- a/documentation/legacy/about-lightning.html +++ b/documentation/legacy/about-lightning.html @@ -21,7 +21,7 @@ - + @@ -142,7 +142,7 @@ OpenFn Community.

    When will Lightning Beta be ready?

    Lightning is currently in Beta. You can register for an account on app.openfn.org. Lightning will be released in Q4 2023.

    - + \ No newline at end of file diff --git a/documentation/legacy/about.html b/documentation/legacy/about.html index 6005254f1ba..84db45095a3 100644 --- a/documentation/legacy/about.html +++ b/documentation/legacy/about.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ and a huge number of open-source workflow automation, data integration, and "ETL" tools which you can find on our GitHub.

    The platform is trusted by some of the leading development organizations in the world, including UNICEF, the WHO, the IRC, and Population Council.

    You can learn more about the people at Open Function Group here.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/credentials.html b/documentation/legacy/build/credentials.html index 5856d916908..6216267642a 100644 --- a/documentation/legacy/build/credentials.html +++ b/documentation/legacy/build/credentials.html @@ -21,7 +21,7 @@ - + @@ -42,7 +42,7 @@ and checking for the value of a predetermined identifier. Based on that value, present in the data for a given source message, for example, another credential will be selected and applied for that particular job run.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/example-build.html b/documentation/legacy/build/example-build.html index 679ed531430..72f7626af74 100644 --- a/documentation/legacy/build/example-build.html +++ b/documentation/legacy/build/example-build.html @@ -21,7 +21,7 @@ - + @@ -99,7 +99,7 @@ every time a message matches the trigger inclusion criteria, turn on auto-process.

    autoprocess

    You're all set! Try out your job by submitting another form response to see the data automatically populate your google sheet.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/inbox.html b/documentation/legacy/build/inbox.html index a1bc43b6202..4add8d5b9bf 100644 --- a/documentation/legacy/build/inbox.html +++ b/documentation/legacy/build/inbox.html @@ -21,7 +21,7 @@ - + @@ -65,7 +65,7 @@ 5XX. This is not recommended for high volume systems, but may be a requirement for some implementations; the sprit of OpenFn/microservice is to give as much control as possible to whoever is deploying it on their servers.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/jobs.html b/documentation/legacy/build/jobs.html index 8c117705841..ff11b79689a 100644 --- a/documentation/legacy/build/jobs.html +++ b/documentation/legacy/build/jobs.html @@ -21,7 +21,7 @@ - + @@ -144,7 +144,7 @@ Salesforce, you're taking the id of the 1st thing, or 2nd thing if you replace "length-1" with "length-2".

    Convert date string to standard ISO date for Salesforce

    field('Payment_Date__c', function (state) {
    return new Date(dataValue('payment_date')(state)).toISOString();
    });

    NOTE: The output of this function will always be formatted according to GMT time-zone.

    Use external ID fields for relationships during a bulk load in Salesforce

    array.map(item => {
    return {
    Patient_Name__c: item.fullName,
    'Account.Account_External_ID__c': item.account
    'Clinic__r.Unique_Clinic_Identifier__c': item.clinicId,
    'RecordType.Name': item.type,
    };
    });

    Bulk upsert with an external ID in salesforce

    bulk(
    'Visit_new__c',
    'upsert',
    {
    extIdField: 'commcare_case_id__c',
    failOnError: true,
    allowNoOp: true,
    },
    dataValue('patients')
    );
    - + \ No newline at end of file diff --git a/documentation/legacy/build/lightning-quick-start.html b/documentation/legacy/build/lightning-quick-start.html index b97bbfd07b6..acb47f17c2b 100644 --- a/documentation/legacy/build/lightning-quick-start.html +++ b/documentation/legacy/build/lightning-quick-start.html @@ -21,7 +21,7 @@ - + @@ -98,7 +98,7 @@ Give it a go, and don't forget to post on our community forum if you get stuck - or to let us know what you built.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/triggers.html b/documentation/legacy/build/triggers.html index 16aeb6b5049..fcb322a55ae 100644 --- a/documentation/legacy/build/triggers.html +++ b/documentation/legacy/build/triggers.html @@ -21,7 +21,7 @@ - + @@ -82,7 +82,7 @@ but we then want to start excluding those that have body.survey_type == 'practice'. Our filter trigger would look need to like this:

    inclusionexclusion
    { "form": "bns_survey" }{"body": {"survey_type": "practice"}}

    We'd set it up from the trigger form like this:

    img

    And verify the result on the inbox:

    img

    - + \ No newline at end of file diff --git a/documentation/legacy/build/troubleshooting.html b/documentation/legacy/build/troubleshooting.html index 0c056f29402..7bf03a720f6 100644 --- a/documentation/legacy/build/troubleshooting.html +++ b/documentation/legacy/build/troubleshooting.html @@ -21,7 +21,7 @@ - + @@ -79,7 +79,7 @@ and enable a better "OK, how should we solve this given the current chronological and commercial constraints" conversation between the Implementation Team and the Engineering Team.

    - + \ No newline at end of file diff --git a/documentation/legacy/cli.html b/documentation/legacy/cli.html index e8d28e15502..92b6ba7984a 100644 --- a/documentation/legacy/cli.html +++ b/documentation/legacy/cli.html @@ -21,7 +21,7 @@ - + @@ -165,7 +165,7 @@ will do a number of things to make your code robust, portable, and easier to debug from a pure JS perspective.

    openfn compile [path]

    Will compile the openfn job and print or save the resulting js.

    Learn more about CLI github.com/OpenFn/kit/

    - + \ No newline at end of file diff --git a/documentation/legacy/core.html b/documentation/legacy/core.html index 8aa48164c3c..090774874fb 100644 --- a/documentation/legacy/core.html +++ b/documentation/legacy/core.html @@ -21,7 +21,7 @@ - + @@ -39,7 +39,7 @@ be incredibly helpful for debugging.

    Using the new CLI.

    If you're a new OpenFn user and want to build or test jobs for Lighting (v2) and beyond in 2023, use the new CLI instead!

    How do I use it?

    Check out the official documentation on GitHub.

    The tl;dr: is that you execute jobs from the command line by passing in an expression, state, and the path to an adaptor.

    npm install @openfn/core
    core execute -l ../language-http.Adaptor -e ./some-exprsesion.js -s ./some-state.json

    The full options are:

    -l, --language    resolvable language/adaptor path                [required]
    -e, --expression target expression to execute [required]
    -s, --state Path to initial state file. [required]
    -o, --output Path to write result from expression
    -t, --test Intercepts and logs all HTTP requests to console
    - + \ No newline at end of file diff --git a/documentation/legacy/deploy/options.html b/documentation/legacy/deploy/options.html index 9ee23b7e15f..f7661c625df 100644 --- a/documentation/legacy/deploy/options.html +++ b/documentation/legacy/deploy/options.html @@ -21,7 +21,7 @@ - + @@ -67,7 +67,7 @@ the export).
  • Test your locally deployed project.
  • Technical Guidelines

    For detailed deployment documentation instructions, head to the Lightning developer docs page, paying special attention to several sections:

    1. Getting Started
    2. Deployment Considerations
    3. Benchmarking
    - + \ No newline at end of file diff --git a/documentation/legacy/deploy/requirements.html b/documentation/legacy/deploy/requirements.html index 306395e3c12..281f41faa61 100644 --- a/documentation/legacy/deploy/requirements.html +++ b/documentation/legacy/deploy/requirements.html @@ -21,7 +21,7 @@ - + @@ -75,7 +75,7 @@ specialist, the following sample configurations may provide useful starting points.

    (a) Simple

    Deploy the application and database on the same machine.

    Deploy the application and database on separate machines.

    (c) Ideal

    Auto-scale different optimized node pools in a Kubernetes cluster for the Erlang orchestration app and the Javascript worker app.

    Consider high-availability Postgres-as-a-service, or also run it in a cluster.

    - + \ No newline at end of file diff --git a/documentation/legacy/design/design-quickstart.html b/documentation/legacy/design/design-quickstart.html index c8e047dd3b5..9d5d7239dae 100644 --- a/documentation/legacy/design/design-quickstart.html +++ b/documentation/legacy/design/design-quickstart.html @@ -21,7 +21,7 @@ - + @@ -108,7 +108,7 @@ implementing partners.

    Share this documentation with any technical implementation team, or check out the Build documentation section to learn how to implement these design specifications using OpenFn.

    - + \ No newline at end of file diff --git a/documentation/legacy/design/when-to-integrate.html b/documentation/legacy/design/when-to-integrate.html index 7f8c79be443..2189f130ed7 100644 --- a/documentation/legacy/design/when-to-integrate.html +++ b/documentation/legacy/design/when-to-integrate.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    - + \ No newline at end of file diff --git a/documentation/legacy/devtools/home.html b/documentation/legacy/devtools/home.html index 562aef5bc2c..16bfc26a50b 100644 --- a/documentation/legacy/devtools/home.html +++ b/documentation/legacy/devtools/home.html @@ -21,7 +21,7 @@ - + @@ -116,7 +116,7 @@ access token in GitHub.

    In your ~/.bash_profile or ~/.zshrc file, export the newly created token by adding this line:

    export GH_TOKEN=<TOKEN>

    Using a new adaptor in an OpenFn/platform instance

    1. Add your release to the scripts/install-lp script.
    2. Add the version number to priv/adaptors.json.
    3. Add the bodySchema to CredentialView.js.
    - + \ No newline at end of file diff --git a/documentation/legacy/faqs.html b/documentation/legacy/faqs.html index c11e626bcd3..5039d818541 100644 --- a/documentation/legacy/faqs.html +++ b/documentation/legacy/faqs.html @@ -21,7 +21,7 @@ - + @@ -167,7 +167,7 @@ this page to talk now. Or Email our team at admin@openfn.org, chat us on OpenFn.org, or post a question in our Community Forum.

    - + \ No newline at end of file diff --git a/documentation/legacy/for-devs.html b/documentation/legacy/for-devs.html index deaddd144cc..066f0c44023 100644 --- a/documentation/legacy/for-devs.html +++ b/documentation/legacy/for-devs.html @@ -21,7 +21,7 @@ - + @@ -70,7 +70,7 @@ must allow either basic, token, or digest authenticated POST, PUT, or GET requests. (Though it is not advisable to create an API that requires GET requests to create or update data.)

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/commcare-project-walkthrough.html b/documentation/legacy/getting-started/commcare-project-walkthrough.html index ef60b31bc56..eaaf28e58d3 100644 --- a/documentation/legacy/getting-started/commcare-project-walkthrough.html +++ b/documentation/legacy/getting-started/commcare-project-walkthrough.html @@ -21,7 +21,7 @@ - + @@ -100,7 +100,7 @@ follow these same steps for other database types (e.g., MS SQL or MySQL)—simply leverage a different adaptor in your job configuration.

    Other resources to check out:

    1. OpenFn Job Library
    2. OpenFn Docs ‘App’ pages for CommCare and Postgres

    Any questions? Comments? New configuration ideas? Please reach out to us with a post on the OpenFn Community forum.

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/glossary.html b/documentation/legacy/getting-started/glossary.html index a697080bee7..e4321715a73 100644 --- a/documentation/legacy/getting-started/glossary.html +++ b/documentation/legacy/getting-started/glossary.html @@ -21,7 +21,7 @@ - + @@ -97,7 +97,7 @@ data type, field size, and so on.

    Writeback

    Refers to a destination system making a change in a data source. When my destination application receives information from a data source and wants to do something back to the source in response, that's writeback.

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/implementation-checklist.html b/documentation/legacy/getting-started/implementation-checklist.html index a063193713a..a30c1c159c8 100644 --- a/documentation/legacy/getting-started/implementation-checklist.html +++ b/documentation/legacy/getting-started/implementation-checklist.html @@ -21,7 +21,7 @@ - + @@ -43,7 +43,7 @@ Read about mapping specs here..
  • Data element mapping specifications finalized (functional/business-friendly version)
  • Client sign-offs on workflow diagram & mapping specs
  • Workflow assumptions documented (e.g., what human, manual steps does the workflow rely on; what are the unique identifiers)
  • Testing scenarios drafted
  • (3) Discovery & Design - Technical Specifications

    • Documentation on APIs or target connection points secured
    • Connection points & authentication methods confirmed
    • Access secured to developer/sandbox environments for testing
    • Authentication and authorization methods & credentials tested
    • Target API endpoints determined based on functional specifications & review of API docs
    • Target API endpoints tested to validate the functional data element specifications can be delivered
    • Workflow BPMN diagram capturing the technical steps of the workflow finalized
    • Technical version of data element mapping specifications created
    • Workflow assumptions updated to include any technical considerations
    • Test scenarios updated to include any technical considerations
    • Project Security Configuration Checklist drafted to capture data security & compliance considerations
    • GitHub repository created
    • Job specifications written for developers

    (4) Build

    • OpenFn platform: project space created & relevant users invited
    • OpenFn platform: Jobs, triggers, and credentials configured
    • OpenFn platform: Version control configured to connect GitHub repo
    • Jobs written & pushed to branch on GitHub
    • Job code review complete and merged to main branch on GitHub
    • OpenFn platform: GitHub paths updated on each job to link to source file
    • Test data created (if needed)
    • Engineer updates mapping specifications (if needed)

    (5) Testing

    • Testing Round 1: Developers run jobs locally with sample data provided
    • Testing Round 2: Analysts complete Test Scenarios & run jobs on platform
    • Iteration: Analysts submit feedback to developers & re-test
    • UAT Round 1: Client completes Test Scenarios
    • Iteration: Analysts submit feedback to developers & re-test
    • UAT Round 2 (if needed): Client completes Test Scenarios
    • Iteration: Analysts submit feedback to developers & re-test

    (6) Training & Prep for Go-Live

    • Training materials drafted for client administrators
    • Documentation drafted, and all project artefacts/docs linked
    • Project Security Configuration Checklist reviewed to determine if any configuration changes or settings need to be implemented post-testing
    • Confirm that production system(s) have been configured
    • Production credentials secured & tested (authentication & authorization)
    • OpenFn platform: "production" project created (cloned from "staging" project), job configuration migrated, & jobs connected to production credentials
    • OpenFn administrator users & access levels confirmed and granted?
    • Support POCs identified for each target system?
    • Establish support structures & governance model for change management
    • Training session delivered to designated OpenFn and target system administrators and any other ToTs

    Rollout & Support

    • Go Live: Turn "on" OpenFn jobs in production platform project so that the workflow is now live in production systems
    • Confirm administrators have OpenFn notifications turned on to "Each Time" so that they will receive failure notifications (see OpenFn Account Settings)
    • Communicate to end users as needed about the go-live and its implications

    Questions or feedback?

    If you have any inputs, comments, or questions–please contribute! Submit a pull request to this documentation page or leave a comment in OpenFn Community.

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/integrating-using-openfn.html b/documentation/legacy/getting-started/integrating-using-openfn.html index 9ddb40c0881..4032c6c0001 100644 --- a/documentation/legacy/getting-started/integrating-using-openfn.html +++ b/documentation/legacy/getting-started/integrating-using-openfn.html @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ Why->not our problem/data mapping How->All of this stuff How safely->Credentials

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/integration-toolkit.html b/documentation/legacy/getting-started/integration-toolkit.html index c1e23d52096..07601364fc3 100644 --- a/documentation/legacy/getting-started/integration-toolkit.html +++ b/documentation/legacy/getting-started/integration-toolkit.html @@ -21,7 +21,7 @@ - + @@ -73,7 +73,7 @@ changes.

    The OSSC's membership and decision making process are defined in the OSSC's internal governance policy if if you're interested in joining, we'd love to hear from you!

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/security.html b/documentation/legacy/getting-started/security.html index 811f5edaa3b..5f4f708127c 100644 --- a/documentation/legacy/getting-started/security.html +++ b/documentation/legacy/getting-started/security.html @@ -21,7 +21,7 @@ - + @@ -50,7 +50,7 @@ openfn.org/trust and openfn.org/compliance.

    Here are the key OpenFn templates and resources referenced in the Guidebook:

    Communities of practice & other experts

    Here are some other communities you may consider following for more security guidance.

    1. OpenHIE Privacy & Security Working Group
    2. GovStack
    3. DHIS2 Security Team & Community of Practice
    4. Asia eHealth Information Network (AeHIN) Communities of Practice
    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/so-you-want-to-integrate.html b/documentation/legacy/getting-started/so-you-want-to-integrate.html index f9d14bae38f..cd61fdc8450 100644 --- a/documentation/legacy/getting-started/so-you-want-to-integrate.html +++ b/documentation/legacy/getting-started/so-you-want-to-integrate.html @@ -21,7 +21,7 @@ - + @@ -37,7 +37,7 @@ it is you really want before you start writing (or borrowing) a job.

    There are plenty of different reasons to integrate your data systems. Maybe you -want one "master" view that you or your clients can trust as a source of truth.

    Maybe you want to automate some data viz that you currently have to do manually.

    Or maybe you just want to expose a small slice of data from one user group to a +want one "master" view that you or your clients can trust as a source of truth.

    Maybe you want to automate some data viz that you currently have to do manually.

    Or maybe you just want to expose a small slice of data from one user group to a different app used exclusively by some other part of your company.

    Regardless of the reason, what every integration boils down to is connecting two or more disconnected applications. But as you can see, not all integrations look alike. This basic structure comes in many shapes and sizes. There's plenty of @@ -46,7 +46,7 @@ any integration and weigh potential outcomes of design decisions against that ultimate goal.

    1. When you move the data.

    Usually, you can articulate the best case scenario here in plain English pretty easily.

    I want Salesforce to ___ when one of our field workers submits a new -CommCare form.

    or

    I want Postgres to ___ every two weeks.

    A crucial difference between these two whens is that the first turns on an +CommCare form.

    or

    I want Postgres to ___ every two weeks.

    A crucial difference between these two whens is that the first turns on an action, whereas the second is based on a set period of time, regardless of what happens in that window.

    1. How you move the data, namely whether the destination system is pulling or the source system is pushing (or some other pattern), what format the data @@ -67,7 +67,7 @@ this slice of the world as authentication.

      These are all very important questions to consider when designing an integration. Check out our docs on integration design to learn more about how we begin to answer these questions and more:

      - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/terminology.html b/documentation/legacy/getting-started/terminology.html index 00760ab8635..a9aab624685 100644 --- a/documentation/legacy/getting-started/terminology.html +++ b/documentation/legacy/getting-started/terminology.html @@ -21,7 +21,7 @@ - + @@ -102,7 +102,7 @@ for that message, and this third run succeeded, you'd still only see 2 "job-states" in the inbox, but they'd both be successful:

      1. Referral (success - run 1)
      2. Payment (success - run 3)

      Browsing to the receipt inspector would show all three runs for this single message.

      - + \ No newline at end of file diff --git a/documentation/legacy/gsoc.html b/documentation/legacy/gsoc.html index 12a4d2a5d65..77df148dc74 100644 --- a/documentation/legacy/gsoc.html +++ b/documentation/legacy/gsoc.html @@ -21,7 +21,7 @@ - + @@ -68,7 +68,7 @@ community.openfn.org for more information.

      Difficulty level: medium

      You'll be working in NodeJs and Typescript.

      - + \ No newline at end of file diff --git a/documentation/legacy/instant-openhie.html b/documentation/legacy/instant-openhie.html index 72adbe84cf5..dfce6e47678 100644 --- a/documentation/legacy/instant-openhie.html +++ b/documentation/legacy/instant-openhie.html @@ -21,7 +21,7 @@ - + @@ -181,7 +181,7 @@ the microservice endpoint (localhost:4001/inbox) and checking to see that resources are created in HAPI FHIR.
    2. Note how the test.js file handles this verification with the sample project.yaml
    3. - + \ No newline at end of file diff --git a/documentation/legacy/jobs/each.html b/documentation/legacy/jobs/each.html index bc06b1e1bc4..04f2738c672 100644 --- a/documentation/legacy/jobs/each.html +++ b/documentation/legacy/jobs/each.html @@ -21,7 +21,7 @@ - + @@ -53,7 +53,7 @@ the data, and then create new records for each item in the second repeat group. Using beta.each(...) lets you enter the first array, create your records, then return to the top level and be able to enter the second array.

      // create some schools from the state.data.form.schools array...
      beta.each(
      dataPath('form.schools[*]'),
      upsert(
      'School__c',
      'School_ID__c',
      fields(
      field('School_ID__c', dataValue('schoolId')),
      field('School_Name__c', dataValue('schoolName')),
      )
      )
      );

      // back up at the top level, we scope the next array with each...
      beta.each(
      dataPath('form.participants[*]'),
      upsert(
      'Person__c',
      'Participant_Identification_Number_PID__c',
      fields(
      field('Participant_Identification_Number_PID__c', dataValue('pid')),
      relationship('RecordType', 'Name', 'Participant'),
      field('First_Name__c', dataValue('participant_first_name')),
      field('Surname__c', dataValue('participant_surname')),
      field('Mobile_Number_1__c', dataValue('mobile_number'))
      field('Sex__c', dataValue('gender')),
      )
      )
      );
      - + \ No newline at end of file diff --git a/documentation/legacy/jobs/editing_locally.html b/documentation/legacy/jobs/editing_locally.html index 185a20b32a3..fc474c8c6fd 100644 --- a/documentation/legacy/jobs/editing_locally.html +++ b/documentation/legacy/jobs/editing_locally.html @@ -21,7 +21,7 @@ - + @@ -54,7 +54,7 @@ git docs).

    From there, the version control integration will update changed jobs in your OpenFn project and you can test those changes on the platform.

    Once you're ready to start running jobs and testing your changes locally, head over to the The CLI docs for guidance.

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/errors.html b/documentation/legacy/jobs/errors.html index 74c9084709b..586df139c60 100644 --- a/documentation/legacy/jobs/errors.html +++ b/documentation/legacy/jobs/errors.html @@ -21,7 +21,7 @@ - + @@ -54,7 +54,7 @@ subsequently aborted by request of an administrator or owner of that project.

    11: Node.js Error

    Exit code 11 means that there was an error in the NodeVM execution but the exit code itself couldn't be captured by our application.

    Limits

    We've shifted this content to a dedicated limits page.

    NodeVM memory limits

    Job state limits

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/job-design-intro.html b/documentation/legacy/jobs/job-design-intro.html index 75afbd34c87..9d7d6715d39 100644 --- a/documentation/legacy/jobs/job-design-intro.html +++ b/documentation/legacy/jobs/job-design-intro.html @@ -21,7 +21,7 @@ - + @@ -45,7 +45,7 @@ doesn’t; references an external Id b. Example from language-dhis2 using Tracked Entity Instances (TEI)
  • updateTEI(...)
  • upsertTEI(...)
  • Example upsert job:

    upsert('mainDataTable', 'AnswerId', {
      AnswerId: dataValue('\_id'), //external Id for upsert
      column: dataValue('firstQuestion)'),
      LastUpdate: new Date().toISOString(),
      Participant: dataValue('participant'),
      Surveyor: dataValue('surveyor'),
      ...
    });
    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/job-studio.html b/documentation/legacy/jobs/job-studio.html index eb185ba022d..6b221d9139b 100644 --- a/documentation/legacy/jobs/job-studio.html +++ b/documentation/legacy/jobs/job-studio.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ paste it as a dataValue in your job.

    You can find a list of avaible helper functions for your chosen adaptor in the job writing panel heading. Clicking the function name copies the function code that you can directly paste into the job.

    Job_Studio_Edit

    By clicking "Save and Run" run logs are shown real-time in the Output panel.

    Stream

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/limits.html b/documentation/legacy/jobs/limits.html index f56208b241b..6740aa45285 100644 --- a/documentation/legacy/jobs/limits.html +++ b/documentation/legacy/jobs/limits.html @@ -21,7 +21,7 @@ - + @@ -50,7 +50,7 @@ a CRON job, remains below 10MB.

    Sometimes, this necessitates streaming data from A -> B in the same job. Other times it will necessitate storing data as local variables and then posting data to your inbox in chunks before cleaning up state.

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/multiple-operations.html b/documentation/legacy/jobs/multiple-operations.html index 41d759a3989..6b7a92485c2 100644 --- a/documentation/legacy/jobs/multiple-operations.html +++ b/documentation/legacy/jobs/multiple-operations.html @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ job be triggered by a message filter.

    get('somePath', { query: { after: '2020-10-12' } }, post('my-inbox-uuid'));
    • You'd like to store the result of the first operation for later use or inspection and not have to retry that operation in order to reproduce the data.
    • You don't care about small delays between the first and second job being run.
    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/operations.html b/documentation/legacy/jobs/operations.html index ada0b02004b..1304479a75f 100644 --- a/documentation/legacy/jobs/operations.html +++ b/documentation/legacy/jobs/operations.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ credentials, or any dynamic data that you may be available at runtime.

    function create(objectName, data) {
    return function (state) {
    // expand the data argument using state
    // actually do the work
    };
    }

    In this snippet is a simple example of what most functions in OpenFn look like. The create function returns a function that takes state, this is an Operation. The runtime using execute will call all Operations with state.

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/state.html b/documentation/legacy/jobs/state.html index a2531fcdbe6..17ab15a7ea3 100644 --- a/documentation/legacy/jobs/state.html +++ b/documentation/legacy/jobs/state.html @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ will instead receive the initial state of the previous (failed) run, plus a new error key that contains the stringified logs from the previous run. See below for details.

    States by job trigger type

    Triggering EventInitial State
    http request{ data: httpRequest.body, configuration: job.credential.body }
    cron{ ...finalStateOfLastSuccessfulRun, configuration: job.credential.body }
    flow: success{ ...finalStateOfTriggeringRun, configuration: job.credential.body }
    flow: failure{ ...initialStateOfTriggeringRun, error: logsFromTriggeringRun, configuration: job.credential.body }
    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/understanding.html b/documentation/legacy/jobs/understanding.html index 7728a4d15f4..21c0155126b 100644 --- a/documentation/legacy/jobs/understanding.html +++ b/documentation/legacy/jobs/understanding.html @@ -21,7 +21,7 @@ - + @@ -44,7 +44,7 @@ inside an alterState operation, but WAIT for those functions to resolve before moving on to your next operation. If execute doesn't work for your use case, you could use Promise.all and return an async function.

    fn(state => {
    console.log('Here we will await the result of a LOT of async operations.');
    console.log('First we define a bunch of different async functions.');
    const postClinics = async c => {
    return post(state.configuration.inboxUrl, {
    body: { clinics: c },
    })(state);
    };

    const postPatients = async p => {
    return post(state.configuration.inboxUrl, {
    body: { patients: p },
    })(state);
    };

    const postVisits = async v => {
    return post(state.configuration.inboxUrl, {
    body: { visits: v },
    })(state);
    };

    console.log(
    'Then we define a single function that wraps them all up and waits for all the individual functions to resolve.'
    );
    async function makePosts() {
    return Promise.all([
    ...state.data.clinicSets.map(item => postClinics(item)),
    ...state.data.patientSets.map(item => postPatients(item)),
    ...state.data.visitSets.map(item => postVisits(item)),
    ]);
    }

    console.log(
    'Then we return that function, forcing our next operation to await the result of this one.'
    );
    return makePosts();
    });

    fn(state => {
    console.log('I get called AFTER those async functions are resolved.');
    return state;
    });
    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/working_with_branches.html b/documentation/legacy/jobs/working_with_branches.html index b9c032a7691..8bbc49a0e1a 100644 --- a/documentation/legacy/jobs/working_with_branches.html +++ b/documentation/legacy/jobs/working_with_branches.html @@ -21,7 +21,7 @@ - + @@ -49,7 +49,7 @@ with git checkout main and hit git pull to pull any changes.

  • If you're still working on your separate branch while main has been updated, use git checkout {branch_name} followed by git merge main to copy over new changes from main to your branch.

  • - + \ No newline at end of file diff --git a/documentation/legacy/manage/platform-mgmt.html b/documentation/legacy/manage/platform-mgmt.html index d3133c125cc..3565ba4bad7 100644 --- a/documentation/legacy/manage/platform-mgmt.html +++ b/documentation/legacy/manage/platform-mgmt.html @@ -21,7 +21,7 @@ - + @@ -374,7 +374,7 @@ selecting that version (by its commit date and SHA) on the job view page. A new commit will be made, updating the job to the state it was in at the time of the old commit.

    - + \ No newline at end of file diff --git a/documentation/legacy/manage/troubleshooting-tips-on-platform.html b/documentation/legacy/manage/troubleshooting-tips-on-platform.html index ef1ff42518d..446741e8ad0 100644 --- a/documentation/legacy/manage/troubleshooting-tips-on-platform.html +++ b/documentation/legacy/manage/troubleshooting-tips-on-platform.html @@ -21,7 +21,7 @@ - + @@ -117,7 +117,7 @@ editing and re-submission of data. You can use OpenFn to edit the source data before retrying the attempt.

    Common Error Messages

    The most common error messages with English explanations are:

    DUPLICATE_VALUE: duplicate value found: ODK_uuid__c duplicates value on record with id: a0524000005wNw0
    The insert is blocked because you are attempting to create a new record with a
    unique field with the same value as an existing record.
    Required value missing
    ExternalId not found
    { INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: Contact__c.
    Please check the security settings of this field and verify that it is
    read/write for your profile or permission set. }

    This last one may arise if a master-detail relationship in Salesforce is not set as reparentable and the user attempts to run an upsert.

    - + \ No newline at end of file diff --git a/documentation/legacy/microservice/home.html b/documentation/legacy/microservice/home.html index d98f4de0e16..0af2433a8b7 100644 --- a/documentation/legacy/microservice/home.html +++ b/documentation/legacy/microservice/home.html @@ -21,7 +21,7 @@ - + @@ -81,7 +81,7 @@ Development Up and Running Guide.

  • If you export as microservice.zip, you'll get your microservice folder ready to run with docker, containing

    • a docker-compose.yaml config file
    • a project folder containing project.yaml
    • .env file with the default environment variables for docker
    • a Readme file

    cd into the folder and run the project with docker-compose up. If you don't have the docker image, it will be auto-pulled from hub.docker.com.

    Export Microservice Zip

    - + \ No newline at end of file diff --git a/documentation/legacy/openfn-roadmap.html b/documentation/legacy/openfn-roadmap.html index 0de87b68f7d..658b1cb01c1 100644 --- a/documentation/legacy/openfn-roadmap.html +++ b/documentation/legacy/openfn-roadmap.html @@ -21,7 +21,7 @@ - + @@ -39,7 +39,7 @@ community.openfn.org, or consider contributing to the OpenFn software, adaptors, or documentation (learn more in the Contributing section).

    - + \ No newline at end of file diff --git a/documentation/legacy/portability-versions.html b/documentation/legacy/portability-versions.html index 41f9c7bfc0a..20b3844efbc 100644 --- a/documentation/legacy/portability-versions.html +++ b/documentation/legacy/portability-versions.html @@ -21,7 +21,7 @@ - + @@ -40,7 +40,7 @@ Digital Square Global Goods grant.

    The project.zip structure and files:

    /globals
    sample-clinic-map.json
    sample-translations.json
    /workflow-a
    job-1.js
    job-2.js
    job-3.js
    /workflow-b
    job-4.js
    project.yaml
    project.state.yaml

    The project.yaml:

    name: "My Project" # The project name

    globals: # All global constants accessible to this project
    clinic-map: file://./globals/clinic-map.json
    project-expense-codes: file://./globals/project-expense-codes.json
    service-codes:
    body:
    m126: Medical Referral
    g01: General Checkup
    ps: Psycho-social Support

    workflows: # All workflows in a project
    CommCare-to-OpenMRS: #The workflow name. Workflow names won't have spaces
    jobs: # All jobs/steps in a workflow
    Coerce-to-FHIR: # The job/step name
    trigger: webhook #webhook urls are uids so are not included
    adaptor: language-fhir
    enabled: true
    credential: my-fihr-credential #looks up credential in state by its name
    # when running locally, the credentials values are taken from the overrides file
    # cli run workflow "CommCare-to-OpenMRS" --overrides ./keys-and-values.yaml
    body: "file://./CommCare-to-OpenMRS/Coerce-to-FHIR.js" # each job job-body is stored in a separate file, within a folder for the whole workflow

    Load-to-openmrs:
    trigger:
    on-success: Coerce-to-FHIR
    adaptor: language-openmrs
    credential: my-other-credential
    enabled: true
    body:
    # no "include", but pathlike doesn't work: if you're doing a uri you need to be explicit about it
    # default to local fs -- no numbering because too complicated if users change the order
    "file://./CommCare-to-OpenMRS/Load-to-openmrs.js"

    Send-Wrap-Up-Reports:
    trigger:
    on-success: Load-to-openmrs
    enabled: true
    adaptor: language-mailgun
    globals:
    - service-codes
    - clinic-map
    body: >
    # this triggers a new workflow
    fn(state => state)
    sendEmail(state => state.emailContent)

    Kobo-to-DHIS2: #This is a second workflow
    Fetch-Kobo-Submissions:
    trigger:
    cron: * 5 * * *
    enabled: true
    adaptor: language-kobotoolbox
    body: "file://./Kobo-to-DHIS2/Fetch-Kobo-Submissions.js"

    Upload-to-DHIS2:
    trigger:
    on-success: Fetch-Kobo-Submissions
    adaptor: language-kobotoolbox
    enabled: false
    body: "file://./Kobo-to-DHIS2/Upload-to-DHIS2.js"

    The project.state.yaml:

    project:
    - id: '45bffee'
    key: 'My Project'

    globals:
    - id: 'sj23n36'
    key: 'clinic-map'
    - id: 'bss522g'
    key: 'project-expense-codes'
    - id: '22aa4st'
    key: 'service-codes'

    workflows:
    - id: 'cfd7c68'
    key: 'CommCare-to-OpenMRS' # this is the NAME and the KEY
    - id: 'd1ecc4f'
    key: 'Kobo-to-DHIS2'

    jobs:
    - id: 'ns6yw54'
    key: 'Coerce-to-FHIR'
    - id: '12bs52j'
    key: 'Load-to-openmrs'
    - id: 'lk81hs6'
    key: 'Send-Wrap-Up-Reports'

    - id: 'sn26sh2'
    key: 'Fetch-Kobo-Submissions'
    - id: 'sk1722h'
    key: 'Upload-to-DHIS2'

    credentials:
    - id: '12ms62y'
    key: 'My FHIR Credential'

    Proposal v3

    v3 introduces URI schemes file://, https://, gcs://

    jobs:
    job-1:
    expression: 'file://my-job.js' # URIs may be used (e.g., https://raw.githubusercontent.com/org/repo/my-job.js)
    adaptor: '@openfn/language-common'
    trigger: trigger-1
    credential: my-secret-credential
    recurring-job:
    expression: >
    fn(state => {
    console.log("Hi there!")
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: every-minute
    flow-job:
    expression: >
    fn(state => {
    state.data.number = state.data.number * 3
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: after-j1
    catch-job:
    expression: >
    fn(state => {
    state.message = "handled it."
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: j1-fails

    triggers:
    trigger-1:
    criteria: '{"number":2}'
    every-minute:
    cron: '* * * * *'
    after-j1:
    success: job-1
    j1-fails:
    failure: job-1

    credentials:
    my-secret-credential:
    username: '******' # Credential keys get exported, but values must be manually reentered
    password: '******'
    my-other-credential: 'file://gcp_credential.json' # And URIs may be specified directly for the credential body

    Proposal v2

    jobs:
    job-1:
    expression: >
    registerPatient({
    patient-id: state.data.id,
    dob: state.data.birth
    })
    adaptor: '@openfn/language-openmrs'
    trigger: trigger-1
    credential: my-secret-credential
    recurring-job:
    expression: >
    fn(state => {
    console.log("Hi there!")
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: every-minute
    flow-job:
    expression: >
    fn(state => {
    state.data.number = state.data.number * 3
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: after-j1
    catch-job:
    expression: >
    fn(state => {
    state.message = "handled it."
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: j1-fails

    triggers:
    trigger-1:
    criteria: '{"number":2}'
    every-minute:
    cron: '* * * * *'
    after-j1:
    success: job-1
    j1-fails:
    failure: job-1

    # Note that credential keys get copied, but values must be manually entered
    # after the export is completed.
    credentials:
    my-secret-credential:
    username: '******'
    password: '******'

    Proposal v1

    const project = {
    async: true,
    triggers: {
    uniqueTriggerId: {
    // trigger properties
    },
    otherTrigger: {
    // other trigger properties
    },
    },
    credentials: {
    // for now, credentials will not be synced //
    // secret1: {
    // username: 'mamadou',
    // pass: 'shhh',
    },
    staticData: {
    // static objects that can be accessed from any job
    },
    jobs: {
    payHealthWorker: { trigger: 'otherTrigger' },
    syncToSalesforce: {
    expression: 'uri://github.com/jobs/expresion.js',
    trigger: 'uniqueTriggerId',
    credential: 'secret1',
    },
    },
    };
    - + \ No newline at end of file diff --git a/documentation/legacy/portability.html b/documentation/legacy/portability.html index 45ed8ecd212..f75f7a91b26 100644 --- a/documentation/legacy/portability.html +++ b/documentation/legacy/portability.html @@ -21,7 +21,7 @@ - + @@ -83,7 +83,7 @@ as openfn deploy --help will result in a help message describing the command and the options available when using this command. See an example below

    openfn deploy --help
    openfn deploy

    Deploy a project's config to a remote Lightning instance

    Options:
    --version Show version number [boolean]
    --help Show help [boolean]
    -c, --config, --config-path The location of your config file [default: "./.config.json"]
    --no-confirm Skip confirmation prompts (e.g. 'Are you sure?') [boolean]
    --describe Downloads the project yaml from the specified instance [boolean]
    -l, --log Set the log level [string]
    --log-json Output all logs as JSON objects [boolean]
    -p, --project-path The location of your project.yaml file [string]
    -s, --state-path Path to the state file

    Other Versions

    - + \ No newline at end of file diff --git a/documentation/legacy/release-notes.html b/documentation/legacy/release-notes.html index 1bdcae84f16..1d63dcce184 100644 --- a/documentation/legacy/release-notes.html +++ b/documentation/legacy/release-notes.html @@ -21,7 +21,7 @@ - + @@ -195,7 +195,7 @@ takes a url and a body object. At the end, the user is setting state.lastSubmissionDate to submissions[submissions.length-1].SubmissionDate.

    See the functions themselves at language-http.

    get('forms/data/wide/json/someForm', {
    query: function (state) {
    return { date: state.lastSubmissionDate || 'Aug 29, 2016 4:44:26 PM' };
    },
    callback: function (state) {
    // Pick submissions out in order to avoid `post` overwriting `response`.
    var submissions = state.response.body;
    // return submissions
    return submissions
    .reduce(function (acc, item) {
    // tag submissions as part of the "someForm" form
    item.formId = 'someForm';
    return acc.then(
    post('https://www.openfn.org/inbox/some-inbox-uuid', { body: item })
    );
    }, Promise.resolve(state))
    .then(function (state) {
    if (submissions.length) {
    state.lastSubmissionDate =
    submissions[submissions.length - 1].SubmissionDate;
    }
    return state;
    })
    .then(function (state) {
    delete state.response;
    return state;
    });
    },
    });
    - + \ No newline at end of file diff --git a/documentation/legacy/roadmap.html b/documentation/legacy/roadmap.html index 9ee0f67e56c..6e64d8217e4 100644 --- a/documentation/legacy/roadmap.html +++ b/documentation/legacy/roadmap.html @@ -21,7 +21,7 @@ - + @@ -45,7 +45,7 @@ walkthrough

    Creation of documentation/tutorial “pathways”

    Presenting guides and for new users and new devs from existing documentation resources to flatten the learning curve

    Quickstart

    Rewrite to be dev-centered; should read as a page for users who understand the above already and are ready to dive into technical setup

    Project walk-through

    Revise to incorporate the below app-specific tutorials in a cohesive manner

    How to integrate CommCare with Salesforce

    The Project walkthrough, but specific to these two tools.

    How to integrate DHIS2 and CommCare

    How to integrate Kobo Toolbox and a custom Postgres database

    - + \ No newline at end of file diff --git a/documentation/legacy/source-apps.html b/documentation/legacy/source-apps.html index d5bf4350d44..5cac65a184d 100644 --- a/documentation/legacy/source-apps.html +++ b/documentation/legacy/source-apps.html @@ -21,7 +21,7 @@ - + @@ -56,7 +56,7 @@ the user to control which fields (and even which related resources) are sent in a given payload, but often the default is to send everything and let them pick and choose what they want to use.

    - + \ No newline at end of file diff --git a/documentation/legacy/standards/digital-public-goods.html b/documentation/legacy/standards/digital-public-goods.html index c848ffc3b6d..9ca97c729a4 100644 --- a/documentation/legacy/standards/digital-public-goods.html +++ b/documentation/legacy/standards/digital-public-goods.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ by design and are of high relevance for attainment of the United Nations 2030 Sustainable Development Goals (SDGs)

    You can read more about the DPG standard here.

    - + \ No newline at end of file diff --git a/documentation/legacy/standards/global-goods.html b/documentation/legacy/standards/global-goods.html index 9c88fa6eb5c..8adaaaa2a72 100644 --- a/documentation/legacy/standards/global-goods.html +++ b/documentation/legacy/standards/global-goods.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ effectiveness, is designed to be interoperable, and is an emergent standard application.

    You can read more about Global Goods for Health here.

    - + \ No newline at end of file diff --git a/documentation/legacy/standards/openhie.html b/documentation/legacy/standards/openhie.html index a29c036242b..e2f3bb0285e 100644 --- a/documentation/legacy/standards/openhie.html +++ b/documentation/legacy/standards/openhie.html @@ -21,7 +21,7 @@ - + @@ -62,7 +62,7 @@ leveraging OpenFn’s out-of-box DHIS2 adaptor and reusable workflow templates to quickly develop automation that reformats data received from CommCare and maps it to the DHIS2 data model.

    swisstph

    - + \ No newline at end of file diff --git a/documentation/legacy/style-guide.html b/documentation/legacy/style-guide.html index 0707d2e7ad2..caa5db44037 100644 --- a/documentation/legacy/style-guide.html +++ b/documentation/legacy/style-guide.html @@ -21,7 +21,7 @@ - + @@ -44,7 +44,7 @@ everyone. Oh, you can put Markdown into a blockquote.


    Inline HTML

    Definition list
    Is something people use sometimes.
    Markdown in HTML
    Does *not* work **very** well. Use HTML tags.

    Line Breaks

    Here's a line for us to start with.

    This line is separated from the one above by two newlines, so it will be a separate paragraph.

    This line is also a separate paragraph, but... This line is only separated by a single newline, so it's a separate line in the same paragraph.


    Admonitions

    note

    This is a note

    tip

    This is a tip

    info

    This is important

    caution

    This is a caution

    danger

    This is a warning

    Tabs

    Note how we import tabs first, then use them as below:

    import Tabs from '@theme/Tabs';
    import TabItem from '@theme/TabItem';

    <Tabs
    defaultValue="apple"
    values={[
    { label: 'Apple', value: 'apple' },
    { label: 'Orange', value: 'orange' },
    { label: 'Banana', value: 'banana' },
    ]}
    >
    <TabItem value="apple">This is an apple 🍎</TabItem>
    <TabItem value="orange">This is an orange 🍊</TabItem>
    <TabItem value="banana">This is a banana 🍌</TabItem>
    </Tabs>;
    This is an apple 🍎
    - + \ No newline at end of file diff --git a/documentation/legacy/writing-code.html b/documentation/legacy/writing-code.html index 39ac82549c2..20277375d60 100644 --- a/documentation/legacy/writing-code.html +++ b/documentation/legacy/writing-code.html @@ -21,7 +21,7 @@ - + @@ -34,7 +34,7 @@ tools themselves. (The more feedback the better!). If you want to propose some new language for the documentation, you can make those changes by clicking the "Edit this page" link at the bottom of any page and submit a pull request!

    - + \ No newline at end of file diff --git a/documentation/legacy/writing-docs.html b/documentation/legacy/writing-docs.html index 37459428fde..b146dc5387e 100644 --- a/documentation/legacy/writing-docs.html +++ b/documentation/legacy/writing-docs.html @@ -21,7 +21,7 @@ - + @@ -47,7 +47,7 @@ reviewers judge whether the doc fix solves the stated problem.

    Get prompt and good quality reviews from team members

    Trust team members to value docs, ensure technical accuracy and consistency, respect end users’ needs, and advocate for the best doc deliverables for consumers.

    Make beautiful docs

    Design is important. Create beautiful and modern looking docs.

    Use developer tools and workflows

    Automate the process as much as possible, so we can focus on content creation.

    - + \ No newline at end of file diff --git a/documentation/link-to-GitHub.html b/documentation/link-to-GitHub.html index e52ccc66920..a06c8416624 100644 --- a/documentation/link-to-GitHub.html +++ b/documentation/link-to-GitHub.html @@ -21,7 +21,7 @@ - + @@ -109,7 +109,7 @@ one branch to another. You might choose to sync:

    • Your production project with the main branch
    • Your test project with the staging branch

    After a merge, your repo would look like this:

    your-git-repo
    ├── projectSpec.yaml ## works both

    ├── prod-config.json
    ├── prod-projectState.json

    ├── test-config.json
    └── test-projectState.json

    Monorepo

    Sometimes, it's helpful to have multiple OpenFn projects all stored in the same repo, even if they don't use the same workflows (i.e., even if they don't share a project.yaml file.)

    your-git-monorepo
    ├── project-a
    │ ├── config.json
    │ ├── projectState.json
    │ └── projectSpec.yaml
    └── project-b
    ├── config.json
    ├── projectState.json
    └── projectSpec.yaml

    Troubleshooting

    Github Sync Error: Unexpected inputs provided: ["snapshots"]

    If you installed GitHub sync before July 17th, 2024 you may need to update your .github/workflows/openfn-pull.yml file to match:

    on:
    workflow_dispatch:
    inputs:
    projectId:
    description: 'OpenFN Project ID'
    required: true
    apiSecretName:
    description: 'OpenFN API Key secret name i.e OPENFN_project_API_KEY'
    required: true
    pathToConfig:
    description: 'Path to config.json'
    required: true
    branch:
    description: 'Branch to commit the project state and spec'
    required: true
    commitMessage:
    description: 'Commit message for project state and spec'
    required: true
    snapshots:
    description: 'IDs of snapshots separated by spaces'
    required: false

    jobs:
    pull-from-lightning:
    runs-on: ubuntu-latest
    permissions:
    contents: write
    name: A job to pull changes from Lightning
    steps:
    - name: openfn pull and commit
    uses: openfn/cli-pull-action@v1.1.0
    with:
    secret_input: ${{ secrets[inputs.apiSecretName] }}
    project_id_input: ${{ inputs.projectId }}
    config_path_input: ${{ inputs.pathToConfig }}
    branch_input: ${{ inputs.branch }}
    commit_message_input: ${{ inputs.commitMessage }}
    snapshots_input: ${{ inputs.snapshots }}
    - + \ No newline at end of file diff --git a/documentation/manage-projects/io-data-storage.html b/documentation/manage-projects/io-data-storage.html index a9597769bc8..0b1a9a79e75 100644 --- a/documentation/manage-projects/io-data-storage.html +++ b/documentation/manage-projects/io-data-storage.html @@ -21,7 +21,7 @@ - + @@ -70,7 +70,7 @@ filename, date of export, user who requested the export and the status.

    List of history exports

    Configuring storage for exports

    OpenFn instance administrators can configure the storage for work order exports for local deployments. OpenFn currently supports local storage and Google Cloud Storage as destinations for exporting work orders.

    - + \ No newline at end of file diff --git a/documentation/manage-projects/manage-credentials.html b/documentation/manage-projects/manage-credentials.html index 5099d26c0cd..9f9c4ee03d9 100644 --- a/documentation/manage-projects/manage-credentials.html +++ b/documentation/manage-projects/manage-credentials.html @@ -21,7 +21,7 @@ - + @@ -43,7 +43,7 @@ use it across the Project when building and running Workflows.

    New Credential Ready

    Share Credentials

    If you own a Credential, you can choose which Project has access to it. To update which Projects your Credential is shared with, follow the steps on the User Credentials docs page.

    - + \ No newline at end of file diff --git a/documentation/manage-projects/platform-mgmt.html b/documentation/manage-projects/platform-mgmt.html index e6d6ff42cdc..f8af75a4bd7 100644 --- a/documentation/manage-projects/platform-mgmt.html +++ b/documentation/manage-projects/platform-mgmt.html @@ -21,7 +21,7 @@ - + @@ -39,7 +39,7 @@ sidebar). Setup allows you to view or edit the project name and description.

    Project Overview

    You can also export your entire project "as code" - either to save it, or to edit your project locally. You can learn more about this feature on our Portability page.

    - + \ No newline at end of file diff --git a/documentation/manage-projects/retention-periods.html b/documentation/manage-projects/retention-periods.html index 118166132cf..c9e77d6105c 100644 --- a/documentation/manage-projects/retention-periods.html +++ b/documentation/manage-projects/retention-periods.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ month or 90-days) to reduce data storage costs or to limit their data footprint.

    What happens when old work orders, runs, logs, or dataclips get removed?

    If you've configured any automatic data exports or archiving, you can still access your history in those CSVs, but all history will be removed from the OpenFn platform.

    - + \ No newline at end of file diff --git a/documentation/manage-projects/user-roles-permissions.html b/documentation/manage-projects/user-roles-permissions.html index c85bca47585..ea05d66bbcd 100644 --- a/documentation/manage-projects/user-roles-permissions.html +++ b/documentation/manage-projects/user-roles-permissions.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ projects, audit trail, and third-party authentication, with the below Super User privileges:

    AspectDescriptionFeatures/Permissions
    User ManagementThe management of users on an OpenFn instanceCreating, editing, removing users
    Project ManagementHow projects are created and managed on the instanceCreate, delete, edit a project, assign users
    AuthenticationThird-party access management for users on the instanceSet up OpenID Auth for the instance
    Audit TrailingAuditability and change managementView history of relevant user actions on the instance for audits

    If you're using the hosted OpenFn platform (e.g., app.openfn.org), contact support@openfn.org if you need to get in touch with the super user to request new projects or configuration changes.

    - + \ No newline at end of file diff --git a/documentation/migration-steps.html b/documentation/migration-steps.html index eea46627613..bf21266874e 100644 --- a/documentation/migration-steps.html +++ b/documentation/migration-steps.html @@ -21,7 +21,7 @@ - + @@ -103,7 +103,7 @@ your project, post on Community or contact support@openfn.org for paid support options and private queries.

    - + \ No newline at end of file diff --git a/documentation/migration/automated-migration.html b/documentation/migration/automated-migration.html index 4927bab7ae3..8368b8051e8 100644 --- a/documentation/migration/automated-migration.html +++ b/documentation/migration/automated-migration.html @@ -21,7 +21,7 @@ - + @@ -71,7 +71,7 @@ above.
    More on local deployment

    To learn more about OpenFn deployment, be sure to check out our planning guide and technical guidelines.

    - + \ No newline at end of file diff --git a/documentation/monitor-history/activity-history.html b/documentation/monitor-history/activity-history.html index 32c54514a66..dc0ab73fb47 100644 --- a/documentation/monitor-history/activity-history.html +++ b/documentation/monitor-history/activity-history.html @@ -21,7 +21,7 @@ - + @@ -56,7 +56,7 @@ orders. If the output dataclips of the third step in the first run of work order "123" matches your text search, you'll see work order "123" in your results.

    - + \ No newline at end of file diff --git a/documentation/monitor-history/inspect-runs.html b/documentation/monitor-history/inspect-runs.html index f5cec1dc9a6..63b25b32b7a 100644 --- a/documentation/monitor-history/inspect-runs.html +++ b/documentation/monitor-history/inspect-runs.html @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ through on inspecting Runs via the History page.

    Search History and Runs

    To learn how to search and filter Work Order and Run history via the History page, check out the below video tutorial (or see link).

    - + \ No newline at end of file diff --git a/documentation/monitor-history/rerunning-workflow.html b/documentation/monitor-history/rerunning-workflow.html index aa7dee786dd..4796e3a8e92 100644 --- a/documentation/monitor-history/rerunning-workflow.html +++ b/documentation/monitor-history/rerunning-workflow.html @@ -21,7 +21,7 @@ - + @@ -43,7 +43,7 @@ completed the Work Order.
  • If you prefer to create a new Work Order (instead of retrying the same Work Order), you can click the dropdown next to "Rerun from here" and instead choose Create New Work Order.
  • - + \ No newline at end of file diff --git a/documentation/monitor-history/status-codes.html b/documentation/monitor-history/status-codes.html index 67992d6f5a9..dcbc13c1eeb 100644 --- a/documentation/monitor-history/status-codes.html +++ b/documentation/monitor-history/status-codes.html @@ -21,7 +21,7 @@ - + @@ -40,7 +40,7 @@ the OpenFn worker will continue processing the workflow as there may be error handling rules in downstream edges. (E.g., "If step 3 fails, execute step 4.")

    If a step fails with a crash (e.g., Syntax Error) the worker won't be able to execute any downstream logic and the whole attempt will be aborted.

    - + \ No newline at end of file diff --git a/documentation/monitor-history/troubleshooting.html b/documentation/monitor-history/troubleshooting.html index cd3fccbc517..01a5955f4b0 100644 --- a/documentation/monitor-history/troubleshooting.html +++ b/documentation/monitor-history/troubleshooting.html @@ -21,7 +21,7 @@ - + @@ -73,7 +73,7 @@ editing and re-submission of data. You can use OpenFn to edit the source data before retrying the attempt.

    Common Error Messages

    The most common error messages with explanations are:

    DUPLICATE_VALUE: duplicate value found: ODK_uuid__c duplicates value on record with id: a0524000005wNw0
    The insert is blocked because you are attempting to create a new record with a
    unique field with the same value as an existing record.
    Required value missing
    ExternalId not found
    { INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: Contact__c.
    Please check the security settings of this field and verify that it is
    read/write for your profile or permission set. }

    This last one may arise if a master-detail relationship in Salesforce is not set as reparentable and the user attempts to run an upsert.

    - + \ No newline at end of file diff --git a/documentation/monitoring-workflows.html b/documentation/monitoring-workflows.html index aa200400cf3..025dd71940b 100644 --- a/documentation/monitoring-workflows.html +++ b/documentation/monitoring-workflows.html @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ are the 7 Work Orders in a failed state:

    Failed Work Orders

    Check out our History docs for more on managing and monitoring Runs and Work Orders.

    - + \ No newline at end of file diff --git a/documentation/notifications.html b/documentation/notifications.html index 0401411cc8d..157e1711ecf 100644 --- a/documentation/notifications.html +++ b/documentation/notifications.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ can inspect and begin troubleshooting.

    Failure Email

    Failure Run

    Email Digests

    Also in Project Settings > Collaboration, you can choose to receive daily, weekly or monthly email digests from a project, summarizing successful and failed runs for each of your workflows.

    Digest Email Setting

    Digest Email

    note

    If you want to adjust your notifications settings and you are a Collaborator on more than 1 Project, then you will need to go to the Project Settings > Collaboration page for each Project you belong to.

    - + \ No newline at end of file diff --git a/documentation/oauth.html b/documentation/oauth.html index 8c0a26e486d..75645670aaf 100644 --- a/documentation/oauth.html +++ b/documentation/oauth.html @@ -21,7 +21,7 @@ - + @@ -89,7 +89,7 @@ managing user credentials to learn more about credential management for the applications you are integrating with on OpenFn.

    - + \ No newline at end of file diff --git a/documentation/release-notes.html b/documentation/release-notes.html index 715e2a7935b..c375f99484f 100644 --- a/documentation/release-notes.html +++ b/documentation/release-notes.html @@ -21,7 +21,7 @@ - + @@ -195,7 +195,7 @@ takes a url and a body object. At the end, the user is setting state.lastSubmissionDate to submissions[submissions.length-1].SubmissionDate.

    See the functions themselves at language-http.

    get('forms/data/wide/json/someForm', {
    query: function (state) {
    return { date: state.lastSubmissionDate || 'Aug 29, 2016 4:44:26 PM' };
    },
    callback: function (state) {
    // Pick submissions out in order to avoid `post` overwriting `response`.
    var submissions = state.response.body;
    // return submissions
    return submissions
    .reduce(function (acc, item) {
    // tag submissions as part of the "someForm" form
    item.formId = 'someForm';
    return acc.then(
    post('https://www.openfn.org/inbox/some-inbox-uuid', { body: item })
    );
    }, Promise.resolve(state))
    .then(function (state) {
    if (submissions.length) {
    state.lastSubmissionDate =
    submissions[submissions.length - 1].SubmissionDate;
    }
    return state;
    })
    .then(function (state) {
    delete state.response;
    return state;
    });
    },
    });
    - + \ No newline at end of file diff --git a/documentation/security-for-devs.html b/documentation/security-for-devs.html index 720cc5ec7e1..3c61237f75a 100644 --- a/documentation/security-for-devs.html +++ b/documentation/security-for-devs.html @@ -21,7 +21,7 @@ - + @@ -95,7 +95,7 @@ (not just developers), be sure to check out the complete OpenFn Security Guidebook. For more on job-writing, see the job-writing guide.

    - + \ No newline at end of file diff --git a/documentation/style-guide.html b/documentation/style-guide.html index 3cf911f6fa8..cb7b58dac53 100644 --- a/documentation/style-guide.html +++ b/documentation/style-guide.html @@ -21,7 +21,7 @@ - + @@ -44,7 +44,7 @@ everyone. Oh, you can put Markdown into a blockquote.


    Inline HTML

    Definition list
    Is something people use sometimes.
    Markdown in HTML
    Does *not* work **very** well. Use HTML tags.

    Line Breaks

    Here's a line for us to start with.

    This line is separated from the one above by two newlines, so it will be a separate paragraph.

    This line is also a separate paragraph, but... This line is only separated by a single newline, so it's a separate line in the same paragraph.


    Admonitions

    note

    This is a note

    tip

    This is a tip

    info

    This is important

    caution

    This is a caution

    danger

    This is a warning

    - + \ No newline at end of file diff --git a/documentation/tutorials/commcare-to-db.html b/documentation/tutorials/commcare-to-db.html index 121260d704a..fb2d6a86bbe 100644 --- a/documentation/tutorials/commcare-to-db.html +++ b/documentation/tutorials/commcare-to-db.html @@ -21,7 +21,7 @@ - + @@ -76,7 +76,7 @@ follow these same steps for other database types (e.g., MS SQL or MySQL)—simply leverage a different adaptor in your step configuration.

    Other resources to check out:

    1. OpenFn Job Library
    2. OpenFn Docs ‘App’ pages for CommCare and Postgres

    Any questions? Comments? New configuration ideas? Please reach out to us with a post on the OpenFn Community forum.

    - + \ No newline at end of file diff --git a/documentation/tutorials/http-to-googlesheets.html b/documentation/tutorials/http-to-googlesheets.html index 2273b26aac7..4c6eb668146 100644 --- a/documentation/tutorials/http-to-googlesheets.html +++ b/documentation/tutorials/http-to-googlesheets.html @@ -21,7 +21,7 @@ - + @@ -61,7 +61,7 @@ Workflow or Troubleshooting docs.

    Are you blocked? Have questions?

    Reminder to watch the video or post on the Community to ask for help!

    - + \ No newline at end of file diff --git a/documentation/tutorials/tutorial.html b/documentation/tutorials/tutorial.html index bb4a2403ba9..c62023da4cc 100644 --- a/documentation/tutorials/tutorial.html +++ b/documentation/tutorials/tutorial.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Version: v2 ⚡

    Tutorial: Creating your first workflow

    QuickStart: Creating your first workflow

    1. Go to your OpenFn Project > Workflows
    2. Create a new Workflow
    3. Choose your Trigger type: Webhook Event (for real-time integration) or Cron Expression (for timer/scheduled-based integration)
    4. Name your first Step (e.g., "Import form submission") and open it to choose the Adaptor, Adaptor Version, and Credential
    5. Click the </> code button to open the Inspector and add job code to the Editor panel to define the specific business logic or transformation rules for this workflow
    6. In the Input panel on the left, add a custom input (e.g., a payload from a webhook request) or simply add empty brackets ({}) to run a Workflow with a cron trigger. See the Workflow docs for help with running and testing Workflow.
    7. If the Step suceeds, navigate back to the Canvase view and click the + icon to add a second Step.
    8. If you want to define conditions for if/when this second Step should execute, update the Path condition.
    9. Then repeat the instruction steps #3-6 to finishing configuring this next Step, until the Workflow is complete.
    tip

    Check out the video and docs on the Workflows page in the Build docs for in-depth help, or ask your questions on Community!

    - + \ No newline at end of file diff --git a/documentation/user-credentials.html b/documentation/user-credentials.html index 8a716f390ea..41d6d7075ec 100644 --- a/documentation/user-credentials.html +++ b/documentation/user-credentials.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@
    Version: v2 ⚡

    Manage User Credentials

    You can manage all the Credentials you own under the Credentials page of your profile. This article, we'll walk you through how to manage and share the Credentials you own across projects.

    All your Credentials in one place

    The Credentials page of your User Settings allows you to add, view, edit or delete the Credentials you own. It is the central place to manage your Credentials across all projects you collaborate on.

    User Credential

    User Credentials List

    For guidance on how to set up a new Credential, head over to our Manage Credentials page.

    You can update the name and login details of a Credential after clicking Edit.

    User Credential Edit View

    Share Credentials

    You can also allow multiple projects to have access to a Credential you own.

    To add or remove project access, click Edit on the Credential you want to share, and choose the project from the dropdown under Project Access.

    Update Project Access

    Shared Credentials remain secret

    If you share a Credential with a Project, Collaborators of that Project can use the Credential in their Workflows, but they won't be able to see the login details contained.

    tip

    If you want to share the login details contained in the Credential, use a secure sharing protocol like a password manager or an encrypted messaging platform.

    - + \ No newline at end of file diff --git a/documentation/user-profile.html b/documentation/user-profile.html index 9b91499e13c..c27525154e1 100644 --- a/documentation/user-profile.html +++ b/documentation/user-profile.html @@ -21,7 +21,7 @@ - + @@ -36,7 +36,7 @@ for you to provide during sign-in to verify your identity at each login.

    To configure multi-factor authentication, use an authenticator app or browser extension to scan the QR code found on your profile.

    Alternatively, you can provide the secret key generated on your profile to the app to set it up.

    Account Deletion

    Your User Profile is also the place where you can delete your OpenFn account.

    Delete Account

    - + \ No newline at end of file diff --git a/documentation/webhook-security.html b/documentation/webhook-security.html index c70cf701ea9..9140cc7a31d 100644 --- a/documentation/webhook-security.html +++ b/documentation/webhook-security.html @@ -21,7 +21,7 @@ - + @@ -47,7 +47,7 @@ these.

    Once you've added an auth method, it will show up in your Webhook Trigger configuration.

    Linked Triggers

    Only requests using these required auth details will be able to send data to your Workflow.

    - + \ No newline at end of file diff --git a/documentation/workflow-snapshots.html b/documentation/workflow-snapshots.html index c03409a6509..0384da822ad 100644 --- a/documentation/workflow-snapshots.html +++ b/documentation/workflow-snapshots.html @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@
    Version: v2 ⚡

    Workflow Snapshots

    Workflow snapshots capture and store a state/version of a workflow (a combination of input, workflow configuration and job code) at a specific point in time when a workflow was updated or run. Snapshots are helpful with debugging, auditing, and improving overall workflow performance.

    When is a snapshot made?

    Snapshots are created in 2 ways:

    1. When a user saves changes to their workflow either through the canvas or the Inspector
    2. When a run is made either by creating a new work order or retrying a run

    How can I view a snapshot?

    To view a snapshot, go to the History page. Expand a work order to see the runs included.

    Snapshot1

    From the expanded history view, there are two ways to visualize snapshots:

    1. By inspecting a step in the run
    2. From the Run view

    Viewing a snapshot by inspecting a step in the run

    Click on the inspect icon in front of the step you would like to view.

    Inspect

    This will open the inspector screen for that step in the run with all associated artifacts: logs and input/output data. On the inspector, you'll notice that you're in a read-only mode, and hovering on the workflow snapshot ID chip, you’ll see a message that reads “You are viewing a snapshot of this workflow that was taken on ….”

    Snapshot2

    To view the corresponding canvas for this snapshot, close this inspector view by clicking the X on the top right corner of the page. This will open the associated canvas with the step selected as shown below.

    Snapshot3

    From the canvas, you can inspect any step by clicking on the step and opening the inspector for the run associated with the step and snapshot.

    Viewing a snapshot from the Run view

    From the expanded history view, click on the run ID to open the run view.

    Snapshot4

    From this view, click on the Workflow name (Simple Flow) to open the workflow canvas for this snapshot. Similar to viewing a snapshot by inspecting a step, you can click the inspect icon in front of the steps to open the inspector for the step.

    Editing a Snapshot

    Snapshots are read-only and serve as a reference for the state of a workflow when saved or a run is executed. As only the latest version can be edited, in order to edit the workflow you can click on the Switch to latest version on the canvas or use the toggle at the bottom right of the inspector page to switch to the latest version of the workflow.

    When you switch to the latest version, the snapshot ID tag will change to blue colour and the text will be latest.

    Snapshot5

    Snapshot6

    Retrying a Snapshot

    When retrying a run with a snapshot, the retry will be executed with the latest version of the workflow and job code. You cannot retry a workflow with an earlier snapshot, only with the latest version.

    Snapshots and Version Control

    As they save a workflow as a particular set of configuration, input data and job code, snapshots are mainly tools to help administrators with auditing and dealing with errors (such as, for example, why a case hasn't been updated correctly in a database).

    OpenFn offers dedicated tools for version control that allows you and your team to manage changes in job code for faster and safer development, debugging and revision.

    - + \ No newline at end of file diff --git a/index.html b/index.html index 23ee84263a0..fbf694d4274 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@ - + \ No newline at end of file diff --git a/search.html b/search.html index 98082a74cf3..e4ad4054b46 100644 --- a/search.html +++ b/search.html @@ -21,7 +21,7 @@ - + @@ -29,7 +29,7 @@

    Search the documentation

    - + \ No newline at end of file