From e79e1e15d92c7bcb8aef4e3077083598b1076989 Mon Sep 17 00:00:00 2001 From: gh-actions Date: Wed, 29 Nov 2023 06:19:12 +0000 Subject: [PATCH] Deploy website - based on 38f7fcbb71999f65dbadf8fffe820253b063630c --- 404.html | 4 ++-- adaptors.html | 4 ++-- adaptors/cht.html | 4 ++-- adaptors/ckan.html | 4 ++-- adaptors/commcare.html | 4 ++-- adaptors/dhis2.html | 4 ++-- adaptors/godata.html | 4 ++-- adaptors/googlesheets.html | 4 ++-- adaptors/kobotoolbox.html | 4 ++-- adaptors/library.html | 4 ++-- .../jobs/auto/0-Get-TEI-data-2021-06-02.html | 4 ++-- .../auto/01-send-mailgun-email-2018-12-04.html | 4 ++-- .../auto/01a-Create-Registrants-2019-11-19.html | 4 ++-- .../01b-Query-new-person-record-2019-12-13.html | 4 ++-- ...c-Create-person_position-record-2019-12-13.html | 4 ++-- .../02a-Query-DB-for-people-to-pay-2019-12-11.html | 4 ++-- .../auto/02b-Initiate-Payments-2019-11-19.html | 4 ++-- .../auto/03-Update-Payment-Status-2019-11-19.html | 4 ++-- .../auto/04a-Query-for-job-changes-2019-12-12.html | 4 ++-- .../jobs/auto/04b-Update-ODK-form-2019-12-03.html | 4 ++-- .../05-Submit-employee-evaluation-2019-12-03.html | 4 ++-- .../05a-Query-for-new-employees-2019-12-19.html | 4 ++-- .../auto/05b-Update-ODK-eval-form-2019-12-19.html | 4 ++-- .../auto/1-Create-Payment-in-SF-2018-09-03.html | 4 ++-- ...Get-CommCare-Forms-Bulk-Extract-2021-04-08.html | 4 ++-- .../auto/1-Get-data-from-SLUHIS-2023-03-08.html | 4 ++-- ...-SMS-Balance-Update-to-Customer-2018-12-14.html | 4 ++-- .../auto/Add-DHIS2-Data-Value-Sets-2016-03-28.html | 4 ++-- .../auto/Attendance-Non-Skillz-2021-06-14.html | 4 ++-- .../jobs/auto/CHW-case-to-DHIS2-2023-04-27.html | 4 ++-- .../Catch-Error-in-HTTP-Request-2016-08-26.html | 4 ++-- .../auto/Coach-Session-Register-2021-05-03.html | 4 ++-- adaptors/library/jobs/auto/CommCare-FHIR.html | 4 ++-- .../auto/CommCare-to-Azure-Sql-2020-01-27.html | 4 ++-- .../jobs/auto/Create-Intervention-2021-04-08.html | 4 ++-- .../auto/Create-Patient-in-OpenMRS-2019-10-24.html | 4 ++-- .../auto/Create-Person-in-OpenMRS-2016-02-12.html | 4 ++-- .../jobs/auto/Create-Person-in-SF-2019-02-25.html | 4 ++-- .../auto/Create-SMS-Linked-to-Contact-in-SF.html | 4 ++-- .../jobs/auto/Create-TEI-dhis2-2021-03-22.html | 4 ++-- .../jobs/auto/Create-contact-2021-03-01.html | 4 ++-- .../library/jobs/auto/DHIS2-DataValues-API.html | 4 ++-- .../library/jobs/auto/DHIS2-Events-2016-01-27.html | 4 ++-- adaptors/library/jobs/auto/DHIS2-Events-API.html | 4 ++-- .../jobs/auto/Extract-Vitas-Data-2021-05-11.html | 4 ++-- .../Failed-Payment-Notification-2021-04-23.html | 4 ++-- .../library/jobs/auto/Fetch-Claims-2023-07-17.html | 4 ++-- .../auto/GET-Data-From-KoboToolbox-2022-03-22.html | 4 ++-- ...Get-CommCare-Forms-Bulk-Extract-2022-05-16.html | 4 ++-- .../auto/Get-cases-from-Primero-2021-09-23.html | 4 ++-- .../HIV-Testing-Event-Snapshot-2021-05-03.html | 4 ++-- .../HIV-Testing-Event-Statistics-2021-05-03.html | 4 ++-- .../jobs/auto/Kobo-to-sheets-2023-10-13.html | 4 ++-- ...oad-Upsert-Data-into-PostgreSQL-2022-03-22.html | 4 ++-- .../library/jobs/auto/Load-to-DB-2022-05-16.html | 4 ++-- .../jobs/auto/Load-to-DHIS2-2023-07-17.html | 4 ++-- .../Malaria-Testing-Event-Snapshot-2021-05-03.html | 4 ++-- ...alaria-Testing-Event-Statistics-2021-05-03.html | 4 ++-- ...Records-Moving-In-And-Out-Of-Repeat-Blocks.html | 4 ++-- adaptors/library/jobs/auto/PHQ9-2021-05-03.html | 4 ++-- adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html | 4 ++-- ...ate-Distribution-Referral-in-SF-2020-06-19.html | 4 ++-- ...2022-Update-HH-Name-in-CommCare-2021-09-27.html | 4 ++-- ...Household-Household-Visit-in-SF-2022-06-28.html | 4 ++-- .../auto/Q3-2022-Upsert-Person-2022-04-21.html | 4 ++-- .../Q3-2022-Upsert-Person-Visit-2022-06-28.html | 4 ++-- ...psert-Supervision-Accompaniment-2022-08-22.html | 4 ++-- ...022-Upsert-Supervision-Feedback-2022-08-19.html | 4 ++-- ...upervision-Household-Spot-Check-2022-08-24.html | 4 ++-- .../Register-Participant-V2-Skillz-2021-06-02.html | 4 ++-- .../jobs/auto/Register-Patient-2021-03-02.html | 4 ++-- .../Registration-forms-new-case-2023-06-22.html | 4 ++-- .../jobs/auto/Request-Vitas-Sync-2021-05-11.html | 4 ++-- ...sk-and-Vulnerability-Assessment-2021-05-27.html | 4 ++-- ...T-Adherence-Self-Reporting-Tool-2021-04-30.html | 4 ++-- ...ert-Aggregate-Service-Referrals-2021-04-30.html | 4 ++-- ...ert-Attendance-Skillz-Plus-Club-2021-05-24.html | 4 ++-- .../Upsert-Coach-Support-Visit-CSV-2021-04-28.html | 4 ++-- ...psert-Confirm-Services-Received-2021-06-14.html | 4 ++-- .../Upsert-Home-Visit-Log-Form-2021-05-03.html | 4 ++-- .../auto/Upsert-Intervention-Notes-2021-04-28.html | 4 ++-- .../auto/Upsert-Post-Challenges-2021-04-30.html | 4 ++-- .../auto/Upsert-Pre-Challenges-2021-04-30.html | 4 ++-- .../auto/Upsert-Register-Event-2021-04-30.html | 4 ++-- .../Upsert-Register-Participant-2021-04-28.html | 4 ++-- ...ert-Register-Participant-Skillz-2021-08-30.html | 4 ++-- ...psert-Register-Skills-plus-Club-2021-04-30.html | 4 ++-- ...ity-Assessment-Service-Referral-2021-05-25.html | 4 ++-- .../auto/Upsert-Service-Referral-2-2021-06-14.html | 4 ++-- .../auto/Upsert-Service-Referral-2021-04-30.html | 4 ++-- ...psert-Service-Referral-Followup-2021-04-30.html | 4 ++-- .../auto/Upsert-Team-Group-Name-2021-04-28.html | 4 ++-- .../auto/Upsert-User-in-Salesforce-2021-04-16.html | 4 ++-- .../jobs/auto/Upsert-to-mBrana-2021-05-11.html | 4 ++-- .../auto/WF1-1-Bulk-get-HH-cases-2023-05-19.html | 4 ++-- ...2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19.html | 4 ++-- .../WF2-1-Bulk-get-Person-cases-2023-05-19.html | 4 ++-- .../auto/WF2-2-Bulk-upsert-Persons-2023-05-19.html | 4 ++-- ...3-1-Bulk-get-Person-Visit-cases-2023-05-19.html | 4 ++-- ...WF3-2-Bulk-upsert-Person-Visits-2023-05-19.html | 4 ++-- ...-2a-Repeat-Failed-Person-Visits-2023-05-31.html | 4 ++-- .../WF4-1-Bulk-get-Referral-Cases-2023-05-19.html | 4 ++-- .../WF4-2-Bulk-upsert-Services-2023-05-19.html | 4 ++-- .../library/jobs/auto/aleksa-cron-2022-04-29.html | 4 ++-- .../jobs/auto/alter-state-before-operations.html | 4 ++-- .../library/jobs/auto/async-and-array-dot-map.html | 4 ++-- adaptors/library/jobs/auto/async-findValue.html | 4 ++-- ...n-create-parent-and-children-in-salesforce.html | 4 ++-- .../jobs/auto/commcare-reports-api-2016-08-29.html | 4 ++-- .../jobs/auto/complex-http-request-chains.html | 4 ++-- .../library/jobs/auto/complex-state-control.html | 4 ++-- .../auto/concatenate-many-fields-with-nulls.html | 4 ++-- adaptors/library/jobs/auto/create-if-proposal.html | 4 ++-- adaptors/library/jobs/auto/getKoboData.html | 4 ++-- adaptors/library/jobs/auto/nawiri-2023-05-03.html | 4 ++-- .../library/jobs/auto/no-return-2023-01-06.html | 4 ++-- .../jobs/auto/promise-all-nested-requests.html | 4 ++-- .../library/jobs/auto/send-mail-in-mailgun.html | 4 ++-- .../auto/send-sms-from-salesforce-workflow.html | 4 ++-- .../jobs/auto/synchronous-http-request.html | 4 ++-- adaptors/library/jobs/auto/timeout.html | 4 ++-- ...ny-items-in-array-with-value-outside-array.html | 4 ++-- adaptors/library/triggers/xmlns.html | 4 ++-- adaptors/magpi.html | 4 ++-- adaptors/moodle.html | 4 ++-- adaptors/odk.html | 4 ++-- adaptors/ona.html | 4 ++-- adaptors/packages/asana-changelog.html | 4 ++-- adaptors/packages/asana-configuration-schema.html | 4 ++-- adaptors/packages/asana-docs.html | 4 ++-- adaptors/packages/asana-readme.html | 4 ++-- adaptors/packages/beyonic-changelog.html | 4 ++-- .../packages/beyonic-configuration-schema.html | 4 ++-- adaptors/packages/beyonic-docs.html | 4 ++-- adaptors/packages/beyonic-readme.html | 4 ++-- adaptors/packages/bigquery-changelog.html | 4 ++-- .../packages/bigquery-configuration-schema.html | 4 ++-- adaptors/packages/bigquery-docs.html | 4 ++-- adaptors/packages/bigquery-readme.html | 4 ++-- adaptors/packages/commcare-changelog.html | 4 ++-- .../packages/commcare-configuration-schema.html | 4 ++-- adaptors/packages/commcare-docs.html | 4 ++-- adaptors/packages/commcare-readme.html | 4 ++-- adaptors/packages/common-changelog.html | 4 ++-- adaptors/packages/common-configuration-schema.html | 4 ++-- adaptors/packages/common-docs.html | 4 ++-- adaptors/packages/common-readme.html | 4 ++-- adaptors/packages/dhis2-changelog.html | 4 ++-- adaptors/packages/dhis2-configuration-schema.html | 4 ++-- adaptors/packages/dhis2-docs.html | 4 ++-- adaptors/packages/dhis2-readme.html | 4 ++-- adaptors/packages/dynamics-changelog.html | 4 ++-- .../packages/dynamics-configuration-schema.html | 4 ++-- adaptors/packages/dynamics-docs.html | 4 ++-- adaptors/packages/dynamics-readme.html | 4 ++-- adaptors/packages/facebook-changelog.html | 4 ++-- .../packages/facebook-configuration-schema.html | 4 ++-- adaptors/packages/facebook-docs.html | 4 ++-- adaptors/packages/facebook-readme.html | 4 ++-- adaptors/packages/fhir-changelog.html | 4 ++-- adaptors/packages/fhir-configuration-schema.html | 4 ++-- adaptors/packages/fhir-docs.html | 4 ++-- adaptors/packages/fhir-readme.html | 4 ++-- adaptors/packages/godata-changelog.html | 4 ++-- adaptors/packages/godata-configuration-schema.html | 4 ++-- adaptors/packages/godata-docs.html | 4 ++-- adaptors/packages/godata-readme.html | 4 ++-- adaptors/packages/googlehealthcare-changelog.html | 4 ++-- .../googlehealthcare-configuration-schema.html | 4 ++-- adaptors/packages/googlehealthcare-docs.html | 4 ++-- adaptors/packages/googlehealthcare-readme.html | 4 ++-- adaptors/packages/googlesheets-changelog.html | 4 ++-- .../googlesheets-configuration-schema.html | 4 ++-- adaptors/packages/googlesheets-docs.html | 4 ++-- adaptors/packages/googlesheets-readme.html | 4 ++-- adaptors/packages/hive-changelog.html | 4 ++-- adaptors/packages/hive-configuration-schema.html | 4 ++-- adaptors/packages/hive-docs.html | 4 ++-- adaptors/packages/hive-readme.html | 4 ++-- adaptors/packages/http-changelog.html | 4 ++-- adaptors/packages/http-configuration-schema.html | 4 ++-- adaptors/packages/http-docs.html | 4 ++-- adaptors/packages/http-readme.html | 4 ++-- adaptors/packages/khanacademy-changelog.html | 4 ++-- .../packages/khanacademy-configuration-schema.html | 4 ++-- adaptors/packages/khanacademy-docs.html | 4 ++-- adaptors/packages/khanacademy-readme.html | 4 ++-- adaptors/packages/kobotoolbox-changelog.html | 4 ++-- .../packages/kobotoolbox-configuration-schema.html | 4 ++-- adaptors/packages/kobotoolbox-docs.html | 4 ++-- adaptors/packages/kobotoolbox-readme.html | 4 ++-- adaptors/packages/magpi-changelog.html | 4 ++-- adaptors/packages/magpi-configuration-schema.html | 4 ++-- adaptors/packages/magpi-docs.html | 4 ++-- adaptors/packages/magpi-readme.html | 4 ++-- adaptors/packages/mailchimp-changelog.html | 4 ++-- .../packages/mailchimp-configuration-schema.html | 4 ++-- adaptors/packages/mailchimp-docs.html | 4 ++-- adaptors/packages/mailchimp-readme.html | 4 ++-- adaptors/packages/mailgun-changelog.html | 4 ++-- .../packages/mailgun-configuration-schema.html | 4 ++-- adaptors/packages/mailgun-docs.html | 4 ++-- adaptors/packages/mailgun-readme.html | 4 ++-- adaptors/packages/maximo-changelog.html | 4 ++-- adaptors/packages/maximo-configuration-schema.html | 4 ++-- adaptors/packages/maximo-docs.html | 4 ++-- adaptors/packages/maximo-readme.html | 4 ++-- adaptors/packages/medicmobile-changelog.html | 4 ++-- .../packages/medicmobile-configuration-schema.html | 4 ++-- adaptors/packages/medicmobile-docs.html | 4 ++-- adaptors/packages/medicmobile-readme.html | 4 ++-- adaptors/packages/mogli-changelog.html | 4 ++-- adaptors/packages/mogli-configuration-schema.html | 4 ++-- adaptors/packages/mogli-docs.html | 4 ++-- adaptors/packages/mogli-readme.html | 4 ++-- adaptors/packages/mongodb-changelog.html | 4 ++-- .../packages/mongodb-configuration-schema.html | 4 ++-- adaptors/packages/mongodb-docs.html | 4 ++-- adaptors/packages/mongodb-readme.html | 4 ++-- adaptors/packages/msgraph-changelog.html | 4 ++-- .../packages/msgraph-configuration-schema.html | 4 ++-- adaptors/packages/msgraph-docs.html | 4 ++-- adaptors/packages/msgraph-readme.html | 4 ++-- adaptors/packages/mssql-changelog.html | 4 ++-- adaptors/packages/mssql-configuration-schema.html | 4 ++-- adaptors/packages/mssql-docs.html | 4 ++-- adaptors/packages/mssql-readme.html | 4 ++-- adaptors/packages/mysql-changelog.html | 4 ++-- adaptors/packages/mysql-configuration-schema.html | 4 ++-- adaptors/packages/mysql-docs.html | 4 ++-- adaptors/packages/mysql-readme.html | 4 ++-- adaptors/packages/nexmo-changelog.html | 4 ++-- adaptors/packages/nexmo-configuration-schema.html | 4 ++-- adaptors/packages/nexmo-docs.html | 4 ++-- adaptors/packages/nexmo-readme.html | 4 ++-- adaptors/packages/ocl-changelog.html | 4 ++-- adaptors/packages/ocl-configuration-schema.html | 4 ++-- adaptors/packages/ocl-docs.html | 4 ++-- adaptors/packages/ocl-readme.html | 4 ++-- adaptors/packages/openfn-changelog.html | 4 ++-- adaptors/packages/openfn-configuration-schema.html | 4 ++-- adaptors/packages/openfn-docs.html | 4 ++-- adaptors/packages/openfn-readme.html | 4 ++-- adaptors/packages/openhim-changelog.html | 4 ++-- .../packages/openhim-configuration-schema.html | 4 ++-- adaptors/packages/openhim-docs.html | 4 ++-- adaptors/packages/openhim-readme.html | 4 ++-- adaptors/packages/openmrs-changelog.html | 4 ++-- .../packages/openmrs-configuration-schema.html | 4 ++-- adaptors/packages/openmrs-docs.html | 4 ++-- adaptors/packages/openmrs-readme.html | 4 ++-- adaptors/packages/openspp-changelog.html | 4 ++-- .../packages/openspp-configuration-schema.html | 4 ++-- adaptors/packages/openspp-docs.html | 4 ++-- adaptors/packages/openspp-readme.html | 4 ++-- adaptors/packages/postgresql-changelog.html | 4 ++-- .../packages/postgresql-configuration-schema.html | 4 ++-- adaptors/packages/postgresql-docs.html | 4 ++-- adaptors/packages/postgresql-readme.html | 4 ++-- adaptors/packages/primero-changelog.html | 4 ++-- .../packages/primero-configuration-schema.html | 4 ++-- adaptors/packages/primero-docs.html | 4 ++-- adaptors/packages/primero-readme.html | 4 ++-- adaptors/packages/progres-changelog.html | 4 ++-- .../packages/progres-configuration-schema.html | 4 ++-- adaptors/packages/progres-docs.html | 4 ++-- adaptors/packages/progres-readme.html | 4 ++-- adaptors/packages/rapidpro-changelog.html | 4 ++-- .../packages/rapidpro-configuration-schema.html | 4 ++-- adaptors/packages/rapidpro-docs.html | 4 ++-- adaptors/packages/rapidpro-readme.html | 4 ++-- adaptors/packages/resourcemap-changelog.html | 4 ++-- .../packages/resourcemap-configuration-schema.html | 4 ++-- adaptors/packages/resourcemap-docs.html | 4 ++-- adaptors/packages/resourcemap-readme.html | 4 ++-- adaptors/packages/salesforce-changelog.html | 4 ++-- .../packages/salesforce-configuration-schema.html | 4 ++-- adaptors/packages/salesforce-docs.html | 4 ++-- adaptors/packages/salesforce-readme.html | 4 ++-- adaptors/packages/sftp-changelog.html | 4 ++-- adaptors/packages/sftp-configuration-schema.html | 4 ++-- adaptors/packages/sftp-docs.html | 4 ++-- adaptors/packages/sftp-readme.html | 4 ++-- adaptors/packages/smpp-changelog.html | 4 ++-- adaptors/packages/smpp-configuration-schema.html | 4 ++-- adaptors/packages/smpp-docs.html | 4 ++-- adaptors/packages/smpp-readme.html | 4 ++-- adaptors/packages/surveycto-changelog.html | 4 ++-- .../packages/surveycto-configuration-schema.html | 4 ++-- adaptors/packages/surveycto-docs.html | 4 ++-- adaptors/packages/surveycto-readme.html | 4 ++-- adaptors/packages/telerivet-changelog.html | 4 ++-- .../packages/telerivet-configuration-schema.html | 4 ++-- adaptors/packages/telerivet-docs.html | 4 ++-- adaptors/packages/telerivet-readme.html | 4 ++-- adaptors/packages/template-changelog.html | 4 ++-- .../packages/template-configuration-schema.html | 4 ++-- adaptors/packages/template-docs.html | 4 ++-- adaptors/packages/template-readme.html | 4 ++-- adaptors/packages/twilio-changelog.html | 4 ++-- adaptors/packages/twilio-configuration-schema.html | 4 ++-- adaptors/packages/twilio-docs.html | 4 ++-- adaptors/packages/twilio-readme.html | 4 ++-- adaptors/packages/vtiger-changelog.html | 4 ++-- adaptors/packages/vtiger-configuration-schema.html | 4 ++-- adaptors/packages/vtiger-docs.html | 4 ++-- adaptors/packages/vtiger-readme.html | 4 ++-- adaptors/packages/zoho-changelog.html | 4 ++-- adaptors/packages/zoho-configuration-schema.html | 4 ++-- adaptors/packages/zoho-docs.html | 4 ++-- adaptors/packages/zoho-readme.html | 4 ++-- adaptors/postgresql.html | 4 ++-- adaptors/powerbi.html | 4 ++-- adaptors/primero.html | 4 ++-- adaptors/salesforce.html | 4 ++-- adaptors/surveycto.html | 4 ++-- adaptors/tableau.html | 4 ++-- articles.html | 4 ++-- .../2020/06/16/how-information-is-organized.html | 4 ++-- articles/2020/06/24/three-questions-to-ask.html | 4 ++-- articles/2020/07/02/allow-yourself-to-fail.html | 4 ++-- .../2020/07/14/cron-is-better-than-a-timer.html | 4 ++-- articles/2020/12/09/upsert-in-dhis2.html | 4 ++-- .../2021/02/03/hosted-or-local-deployment.html | 4 ++-- articles/2021/02/17/syncing-options.html | 4 ++-- articles/2021/05/24/commcare-events.html | 4 ++-- .../2021/07/05/wrapping-my-head-around-jobs.html | 4 ++-- ...ving-multistage-docker-builds-using-buildx.html | 4 ++-- articles/2021/10/15/webpack-to-esbuild-part1.html | 4 ++-- .../10/22/testing-react-app-with-jest-hound.html | 4 ++-- ...avascript-helped-me-better-understand-jobs.html | 4 ++-- articles/2022/06/07/workflow-automation.html | 4 ++-- articles/2022/09/19/auth-security.html | 4 ++-- articles/archive.html | 4 ++-- articles/page/2.html | 4 ++-- articles/tags.html | 4 ++-- articles/tags/annoucement.html | 4 ++-- articles/tags/authentication.html | 4 ++-- articles/tags/authorization.html | 4 ++-- articles/tags/automation.html | 4 ++-- articles/tags/browser-testing.html | 4 ++-- articles/tags/build.html | 4 ++-- articles/tags/ci-cd.html | 4 ++-- articles/tags/docker.html | 4 ++-- articles/tags/elixir.html | 4 ++-- articles/tags/how-to.html | 4 ++-- articles/tags/javascript.html | 4 ++-- articles/tags/jobs.html | 4 ++-- articles/tags/js.html | 4 ++-- articles/tags/learning.html | 4 ++-- articles/tags/phoenix.html | 4 ++-- articles/tags/react.html | 4 ++-- articles/tags/security.html | 4 ++-- articles/tags/solution.html | 4 ++-- articles/tags/testing.html | 4 ++-- articles/tags/tips.html | 4 ++-- articles/tags/tips/page/2.html | 4 ++-- articles/tags/webpack.html | 4 ++-- assets/js/fe36bf36.322752a6.js | 1 + assets/js/fe36bf36.d171ca39.js | 1 - ...e~main.3b158498.js => runtime~main.e11dbdde.js} | 2 +- blog.html | 4 ++-- blog/2020/05/31/the-new-openfn-blog.html | 4 ++-- ...Building-Integrated-Systems-That-Just-Work.html | 4 ++-- blog/2020/06/04/Technology-Isnt-The-Answer.html | 4 ++-- blog/2020/06/09/enabling-scale-at-myagro.html | 4 ++-- blog/2020/06/10/iKapaData-Case-Study.html | 4 ++-- blog/2020/06/25/SwissTPH-case-study.html | 4 ++-- blog/2020/07/01/KGVK-case-study.html | 4 ++-- .../african-school-of-excellence-case-study.html | 4 ++-- blog/2020/07/01/airport-case-study.html | 4 ++-- blog/2020/07/08/caris-foundation-case-study.html | 4 ++-- blog/2020/07/13/x-runner-case-study.html | 4 ++-- blog/2020/07/26/sinapis-case-study.html | 4 ++-- blog/2020/07/27/nalibali-case-study.html | 4 ++-- .../02/09/interoperability_for_case_referrals.html | 4 ++-- blog/2021/03/30/digital-global-good.html | 4 ++-- .../07/30/processes-and-open-source-as-choice.html | 4 ++-- .../the-case-for-health-information-exchange.html | 4 ++-- ...safeguard-the-world\342\200\231s-wildlife.html" | 4 ++-- .../Monitoring-program-enrollment-in-Brazil.html | 4 ++-- blog/2023/03/01/open-human.html | 4 ++-- blog/2023/04/13/lightning-beta.html | 4 ++-- blog/2023/06/01/open-function-group.html | 4 ++-- blog/2023/08/14/OS4H-case-study.html | 4 ++-- .../Monitoring-child-protection-in-Cambodia.html | 4 ++-- blog/archive.html | 4 ++-- blog/page/2.html | 4 ++-- blog/page/3.html | 4 ++-- blog/tags.html | 4 ++-- blog/tags/african-school-of-excellence.html | 4 ++-- blog/tags/agriculture.html | 4 ++-- blog/tags/airport.html | 4 ++-- blog/tags/amp-impact.html | 4 ++-- blog/tags/announcement.html | 4 ++-- blog/tags/automated-reporting.html | 4 ++-- blog/tags/brazil.html | 4 ++-- blog/tags/cambodia.html | 4 ++-- blog/tags/caris-foundation.html | 4 ++-- blog/tags/carto.html | 4 ++-- blog/tags/case-management.html | 4 ++-- blog/tags/case-study.html | 4 ++-- blog/tags/case-study/page/2.html | 4 ++-- blog/tags/child-protection.html | 4 ++-- blog/tags/comm-care.html | 4 ++-- blog/tags/data-monitoring.html | 4 ++-- blog/tags/data-warehouse.html | 4 ++-- blog/tags/deployment.html | 4 ++-- blog/tags/development.html | 4 ++-- blog/tags/dhis-2.html | 4 ++-- blog/tags/education.html | 4 ++-- blog/tags/global-goods.html | 4 ++-- blog/tags/health.html | 4 ++-- blog/tags/healthcare.html | 4 ++-- blog/tags/i-kapa-data.html | 4 ++-- blog/tags/ibm-maximo.html | 4 ++-- blog/tags/kgvk.html | 4 ++-- blog/tags/kobo-toolbox.html | 4 ++-- blog/tags/kopo-kopo.html | 4 ++-- blog/tags/learning-management-system.html | 4 ++-- blog/tags/m-e.html | 4 ++-- blog/tags/m-pesa.html | 4 ++-- blog/tags/moh.html | 4 ++-- blog/tags/mssql.html | 4 ++-- blog/tags/my-agro.html | 4 ++-- blog/tags/my-sql.html | 4 ++-- blog/tags/odk.html | 4 ++-- blog/tags/open-solutions-for-health.html | 4 ++-- blog/tags/os-4-h.html | 4 ++-- blog/tags/os-ca-r.html | 4 ++-- blog/tags/payments.html | 4 ++-- blog/tags/postgre-sql.html | 4 ++-- blog/tags/primero.html | 4 ++-- blog/tags/redash.html | 4 ++-- blog/tags/salesforce.html | 4 ++-- blog/tags/sftp.html | 4 ++-- blog/tags/sms.html | 4 ++-- blog/tags/st-lucia.html | 4 ++-- blog/tags/supply-chain-system.html | 4 ++-- blog/tags/survey-cto.html | 4 ++-- blog/tags/swiss-tph.html | 4 ++-- blog/tags/telerivet.html | 4 ++-- blog/tags/tips.html | 4 ++-- blog/tags/unicef.html | 4 ++-- blog/tags/wash.html | 4 ++-- blog/tags/wcs.html | 4 ++-- blog/tags/wildlife.html | 4 ++-- blog/tags/workflow-automation.html | 4 ++-- blog/tags/x-runner.html | 4 ++-- blog/tags/zoho.html | 4 ++-- documentation.html | 4 ++-- documentation/about-lightning.html | 14 +++++++------- documentation/about.html | 4 ++-- documentation/build/credentials.html | 4 ++-- documentation/build/example-build.html | 4 ++-- documentation/build/inbox.html | 4 ++-- documentation/build/jobs.html | 4 ++-- documentation/build/lightning-quick-start.html | 4 ++-- documentation/build/triggers.html | 4 ++-- documentation/build/troubleshooting.html | 4 ++-- documentation/cli.html | 4 ++-- documentation/core.html | 4 ++-- documentation/deploy/options.html | 4 ++-- documentation/deploy/requirements.html | 4 ++-- documentation/design/design-quickstart.html | 4 ++-- documentation/design/when-to-integrate.html | 4 ++-- documentation/devtools/home.html | 4 ++-- documentation/faqs.html | 4 ++-- documentation/for-devs.html | 4 ++-- .../commcare-project-walkthrough.html | 4 ++-- documentation/getting-started/glossary.html | 4 ++-- .../getting-started/implementation-checklist.html | 4 ++-- .../getting-started/integrating-using-openfn.html | 4 ++-- .../getting-started/integration-toolkit.html | 4 ++-- documentation/getting-started/security.html | 4 ++-- .../getting-started/so-you-want-to-integrate.html | 8 ++++---- documentation/getting-started/terminology.html | 4 ++-- documentation/gsoc.html | 4 ++-- documentation/instant-openhie.html | 4 ++-- documentation/jobs/each.html | 4 ++-- documentation/jobs/editing_locally.html | 4 ++-- documentation/jobs/errors.html | 4 ++-- documentation/jobs/job-design-intro.html | 4 ++-- documentation/jobs/job-studio.html | 4 ++-- documentation/jobs/limits.html | 4 ++-- documentation/jobs/multiple-operations.html | 4 ++-- documentation/jobs/operations.html | 4 ++-- documentation/jobs/state.html | 4 ++-- documentation/jobs/understanding.html | 4 ++-- documentation/jobs/working_with_branches.html | 4 ++-- documentation/manage/platform-mgmt.html | 4 ++-- .../manage/troubleshooting-tips-on-platform.html | 4 ++-- documentation/microservice/home.html | 4 ++-- documentation/next.html | 4 ++-- documentation/next/build-with-api.html | 4 ++-- documentation/next/build/credentials.html | 4 ++-- documentation/next/build/triggers-cron.html | 4 ++-- documentation/next/build/triggers-webhook.html | 4 ++-- documentation/next/build/triggers.html | 4 ++-- documentation/next/build/troubleshooting.html | 4 ++-- documentation/next/build/tutorial.html | 4 ++-- documentation/next/build/workflows.html | 4 ++-- documentation/next/cli.html | 4 ++-- .../next/contributing/openfn-roadmap.html | 4 ++-- documentation/next/contributing/roadmap.html | 4 ++-- documentation/next/contributing/writing-code.html | 4 ++-- documentation/next/contributing/writing-docs.html | 4 ++-- documentation/next/deploy/options.html | 4 ++-- .../next/deploy/portability-versions.html | 4 ++-- documentation/next/deploy/portability.html | 4 ++-- documentation/next/deploy/requirements.html | 4 ++-- documentation/next/design/api-discovery.html | 4 ++-- documentation/next/design/design-workflow.html | 4 ++-- documentation/next/design/discovery.html | 4 ++-- documentation/next/design/mapping-specs.html | 4 ++-- documentation/next/design/overview.html | 4 ++-- documentation/next/design/workflow-specs.html | 4 ++-- documentation/next/developers/each.html | 4 ++-- documentation/next/developers/editing-locally.html | 4 ++-- documentation/next/developers/errors.html | 4 ++-- documentation/next/developers/for-devs.html | 4 ++-- .../next/developers/job-design-intro.html | 4 ++-- documentation/next/developers/job-studio.html | 4 ++-- documentation/next/developers/limits.html | 4 ++-- .../next/developers/multiple-operations.html | 4 ++-- documentation/next/developers/operations.html | 4 ++-- documentation/next/developers/state.html | 4 ++-- documentation/next/developers/understanding.html | 4 ++-- .../next/developers/working-with-branches.html | 4 ++-- documentation/next/history/activity-history.html | 4 ++-- .../next/intro/implementation-checklist.html | 4 ++-- documentation/next/intro/security-compliance.html | 4 ++-- documentation/next/intro/security.html | 4 ++-- documentation/next/intro/standards.html | 4 ++-- documentation/next/intro/terminology.html | 4 ++-- documentation/next/projects/platform-mgmt.html | 4 ++-- .../projects/troubleshooting-tips-on-platform.html | 4 ++-- documentation/next/release-notes.html | 4 ++-- documentation/next/style-guide.html | 4 ++-- documentation/next/support.html | 4 ++-- documentation/next/tutorials/kobo-to-dhis2.html | 4 ++-- documentation/next/users/user-profile.html | 4 ++-- documentation/openfn-roadmap.html | 4 ++-- documentation/portability-versions.html | 4 ++-- documentation/portability.html | 4 ++-- documentation/release-notes.html | 4 ++-- documentation/roadmap.html | 4 ++-- documentation/source-apps.html | 4 ++-- documentation/standards/digital-public-goods.html | 4 ++-- documentation/standards/global-goods.html | 4 ++-- documentation/standards/openhie.html | 4 ++-- documentation/style-guide.html | 4 ++-- documentation/writing-code.html | 4 ++-- documentation/writing-docs.html | 4 ++-- index.html | 4 ++-- search.html | 4 ++-- 556 files changed, 1115 insertions(+), 1115 deletions(-) create mode 100644 assets/js/fe36bf36.322752a6.js delete mode 100644 assets/js/fe36bf36.d171ca39.js rename assets/js/{runtime~main.3b158498.js => runtime~main.e11dbdde.js} (99%) diff --git a/404.html b/404.html index d53a2dc9961..bc3923a6043 100644 --- a/404.html +++ b/404.html @@ -22,13 +22,13 @@ - +
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 832f40c7a26..fae4ef6815a 100644 --- a/adaptors.html +++ b/adaptors.html @@ -22,7 +22,7 @@ - + @@ -57,7 +57,7 @@ via the Select Unreleased Adaptor dialog.

Building and extending adaptors​

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

- + \ No newline at end of file diff --git a/adaptors/cht.html b/adaptors/cht.html index 0956255bbb6..cfa61b300cd 100644 --- a/adaptors/cht.html +++ b/adaptors/cht.html @@ -22,7 +22,7 @@ - + @@ -37,7 +37,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 2e438fa52f2..59171766594 100644 --- a/adaptors/ckan.html +++ b/adaptors/ckan.html @@ -22,7 +22,7 @@ - + @@ -91,7 +91,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 9491186a448..af660af7769 100644 --- a/adaptors/commcare.html +++ b/adaptors/commcare.html @@ -22,7 +22,7 @@ - + @@ -83,7 +83,7 @@ with the CommCare API.

Implementation Examples​

- + \ No newline at end of file diff --git a/adaptors/dhis2.html b/adaptors/dhis2.html index e8d62570080..fd8ff235464 100644 --- a/adaptors/dhis2.html +++ b/adaptors/dhis2.html @@ -22,7 +22,7 @@ - + @@ -64,7 +64,7 @@ DHIS2 Integration Scenarios

4 Interoperable DHIS2-LMIS in Senegal, Tanzania and Ghana

5 CRVS Fellowship report SmartVA and DHIS2 integration in Sri Lanka

Integration Options​

  1. Data integration via DHIS2 Web API: https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-235/web-api.html

  2. 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 562441e428f..d676b8f6ac2 100644 --- a/adaptors/godata.html +++ b/adaptors/godata.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,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 a560ffbb045..84ff4a06708 100644 --- a/adaptors/googlesheets.html +++ b/adaptors/googlesheets.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,7 @@ example when a new submission is made to a Google Form. Below is some sample code you may add to your Google Sheet to make it push data to OpenFn whenever new rows are added.

function sendToOpenFn(e) {
var payload = JSON.stringify(e);
var url = 'https://www.openfn.org/inbox/your-id-here';
var options = {
method: 'post',
contentType: 'application/json',
payload: payload,
};
var response = UrlFetchApp.fetch(url, options);
}

function isDate(v) {
if (Object.prototype.toString.call(v) === '[object Date]') {
if (isNaN(v.getTime())) {
return false;
} else {
return true;
}
} else {
return false;
}
}

function isNumber(v) {
if (Object.prototype.toString.call(v) === '[object Number]') {
return true;
} else {
return false;
}
}

function getReportData() {
var bookReportData = { formId: 'bookReport', data: [] };
var data = SpreadsheetApp.getActiveSheet().getDataRange().getValues();

var pageCount = 0;
var bookRating = 0;

for (i in data) {
if (isDate(data[i][0])) {
// ignore header line
if (isNumber(data[i][3])) {
pageCount = data[i][3];
}

if (isNumber(data[i][6])) {
bookRating = data[i][6];
}

bookReportData.data.push({
Timestamp: data[i][0],
Title: data[i][1],
Author: data[i][2],
NumberOfPages: pageCount,
Summary: data[i][4],
Protagonist: data[i][5],
Rating: bookRating,
EmailTeacher: data[i][7],
EmailStudent: data[i][8],
SendStatus: data[i][9],
});
}
}

// Logger.log(bookReportData);

sendToOpenFn(bookReportData);
}
- + \ No newline at end of file diff --git a/adaptors/kobotoolbox.html b/adaptors/kobotoolbox.html index 79c6f7f167d..3af000ac7fc 100644 --- a/adaptors/kobotoolbox.html +++ b/adaptors/kobotoolbox.html @@ -22,7 +22,7 @@ - + @@ -89,7 +89,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 5aa5129d6da..22e68428146 100644 --- a/adaptors/library.html +++ b/adaptors/library.html @@ -22,7 +22,7 @@ - + @@ -61,7 +61,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 566d8e7de7d..4b58c210d58 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 @@ -22,13 +22,13 @@ - +
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 e65fdf64aaa..66d62aa31b5 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 @@ -22,13 +22,13 @@ - +
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 6577260944d..2cee1230a7a 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 @@ -22,13 +22,13 @@ - +
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 about 4 years ago
  • Updated over 3 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 afca6e52082..66fb511e73c 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 @@ -22,13 +22,13 @@ - +
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 4 years ago
  • Updated over 3 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 c54590ae3b6..de660ebe5dd 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 @@ -22,13 +22,13 @@ - +
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 4 years ago
  • Updated over 3 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 955f3529557..497cfb78434 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 @@ -22,13 +22,13 @@ - +
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 4 years ago
  • Updated over 3 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 79c49e95f0f..6454573e182 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 @@ -22,13 +22,13 @@ - +
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 about 4 years ago
  • Updated over 3 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 107e7300629..023655cf6e4 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 @@ -22,13 +22,13 @@ - +
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 about 4 years ago
  • Updated over 3 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 05219c455c7..c0d1c37117b 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 @@ -22,13 +22,13 @@ - +
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 4 years ago
  • Updated over 3 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 4d50633a062..a48588d1dbc 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 @@ -22,13 +22,13 @@ - +
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 4 years ago
  • Updated over 3 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 3547871d067..27df7c56b85 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 @@ -22,13 +22,13 @@ - +
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 4 years ago
  • Updated over 3 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 2f63886f4b4..2fe558751b4 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 @@ -22,13 +22,13 @@ - +
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 4 years ago
  • Updated over 3 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 8193ff898e3..672ce62c4db 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 @@ -22,13 +22,13 @@ - +
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 4 years ago
  • Updated over 3 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 1d407b71c24..eee3435a297 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 @@ -22,13 +22,13 @@ - +
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 fba77b25cd7..751a33c34c3 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 @@ -22,13 +22,13 @@ - +
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 2 years ago
  • Updated almost 2 years 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: '2022-02-16',
received_on_end: '2022-02-18',
xmlns: 'http://openrosa.org/formdesigner/D771417E-354E-4906-A686-DF0BA230F16A',
},
},
state => {
const { meta, objects } = state.data;
const { openfnInboxUrl } = state.configuration;
const xmlnsList = [
// '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 d455dbcca95..0d2838ad5f1 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 @@ -22,13 +22,13 @@ - +
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 b6df0ec5a69..0bef72e204b 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 @@ -22,13 +22,13 @@ - +
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 47d0a098471..694d1b926d6 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 @@ -22,13 +22,13 @@ - +
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 7 years ago
  • Updated about 6 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/Attendance-Non-Skillz-2021-06-14.html b/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14.html index aab4d1f38f3..f99f812fc7e 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 @@ -22,13 +22,13 @@ - +
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);

function replaceAccents(input) {
return input
.replace(/[ÑÒãà]/g, 'a')
.replace(/[ÁÂÃÀ]/g, 'A')
.replace(/[Γ§]/g, 'c')
.replace(/[Γ©Γͺ]/g, 'e')
.replace(/[Γ‰ΓŠ]/g, 'E')
.replace(/[Γ­]/g, 'i')
.replace(/[Í]/g, 'I')
.replace(/[óôá]/g, 'o')
.replace(/[ÓÔÕ]/g, 'O')
.replace(/[ΓΊ]/g, 'u')
.replace(/[Ú]/g, 'U');
}
// 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
);

const sessionText = dataValue('form.attendance_list.session')(state);
const sessionId = getSessionId(sessionText);

// @aleksa-krolls confirm the path for the session date
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']}-${replaceAccents(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 4e0d70ad470..4a360387320 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 @@ -22,13 +22,13 @@ - +
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 2028f1302c0..500525f83c9 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 @@ -22,13 +22,13 @@ - +
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 over 7 years ago
  • Updated about 1 year 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 cf29f686b56..4e497736e01 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 @@ -22,13 +22,13 @@ - +
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);

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))];

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 4fee2f53db0..94948b85e01 100644 --- a/adaptors/library/jobs/auto/CommCare-FHIR.html +++ b/adaptors/library/jobs/auto/CommCare-FHIR.html @@ -22,13 +22,13 @@ - +
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 3b3d94b768e..fe24071ef78 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 @@ -22,13 +22,13 @@ - +
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 451f531b3bc..113ed03f98e 100644 --- a/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html +++ b/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html @@ -22,13 +22,13 @@ - +
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')
),
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 f98dda4a43e..c5ffbe2b298 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 @@ -22,13 +22,13 @@ - +
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 7735a98fc6e..07c7edc7e1b 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 @@ -22,13 +22,13 @@ - +
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 22e3b0e78e7..7238e744cbd 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 @@ -22,13 +22,13 @@ - +
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 94a5387a49b..06d770b94fd 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 @@ -22,13 +22,13 @@ - +
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 34681be1776..9552f698f0a 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 @@ -22,13 +22,13 @@ - +
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 67ed8ee6714..39297a70086 100644 --- a/adaptors/library/jobs/auto/Create-contact-2021-03-01.html +++ b/adaptors/library/jobs/auto/Create-contact-2021-03-01.html @@ -22,13 +22,13 @@ - +
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 f1aab10c71b..0d4bcc23b0a 100644 --- a/adaptors/library/jobs/auto/DHIS2-DataValues-API.html +++ b/adaptors/library/jobs/auto/DHIS2-DataValues-API.html @@ -22,13 +22,13 @@ - +
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 04dda586c93..6f9946b670b 100644 --- a/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html +++ b/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html @@ -22,13 +22,13 @@ - +
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 239a6207589..478190001f1 100644 --- a/adaptors/library/jobs/auto/DHIS2-Events-API.html +++ b/adaptors/library/jobs/auto/DHIS2-Events-API.html @@ -22,13 +22,13 @@ - +
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 b3eff6513e2..e42dc629365 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 @@ -22,13 +22,13 @@ - +
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 1030c548bf7..359fac998fc 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 @@ -22,13 +22,13 @@ - +
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 2 years ago
  • Updated over 2 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 6895be575ea..2b0172ca158 100644 --- a/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html +++ b/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html @@ -22,13 +22,13 @@ - +
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 c8f5659f186..68a4ecf4a47 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 @@ -22,13 +22,13 @@ - +
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 06791f860bc..95e74738467 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 @@ -22,13 +22,13 @@ - +
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 1 year ago
  • Updated over 1 year 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 789509f002a..a22d4497273 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 @@ -22,13 +22,13 @@ - +
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 15005b4e1c3..9d93e6aa9b6 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 @@ -22,13 +22,13 @@ - +
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 335ab51809d..0745e430420 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 @@ -22,13 +22,13 @@ - +
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 44e177ae0b0..1165adc1bd5 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 @@ -22,13 +22,13 @@ - +
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 3924d57b66d..514b90a07bf 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 @@ -22,13 +22,13 @@ - +
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 8e8190dba5a..2a537e7e04c 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 @@ -22,13 +22,13 @@ - +
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 6fcae73fc82..45a83033582 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 @@ -22,13 +22,13 @@ - +
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 4db1e24b60b..8a52a6f6c1a 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 @@ -22,13 +22,13 @@ - +
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 b0fbd506c08..aabc52c4cdd 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 @@ -22,13 +22,13 @@ - +
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 6ee5b42b1d8..a12e1c395b9 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 @@ -22,13 +22,13 @@ - +
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/PHQ9-2021-05-03.html b/adaptors/library/jobs/auto/PHQ9-2021-05-03.html index d2583008dcd..d5541fd8e66 100644 --- a/adaptors/library/jobs/auto/PHQ9-2021-05-03.html +++ b/adaptors/library/jobs/auto/PHQ9-2021-05-03.html @@ -22,13 +22,13 @@ - +
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 d83d995ef10..4d7595e58f4 100644 --- a/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html +++ b/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html @@ -22,13 +22,13 @@ - +
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 0e44017ba36..36dc2273698 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 @@ -22,13 +22,13 @@ - +
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 747850a1539..987caa701e4 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 @@ -22,13 +22,13 @@ - +
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 a471cddecf4..f66b12003e6 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 @@ -22,13 +22,13 @@ - +
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 over 1 year 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 80b99364472..e69dd65b8a2 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 @@ -22,13 +22,13 @@ - +
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 e2824224264..f30fbf4421a 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 @@ -22,13 +22,13 @@ - +
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 ed1293b58f1..fcd15db13de 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 @@ -22,13 +22,13 @@ - +
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 12b2ae43279..ea17b593d82 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 @@ -22,13 +22,13 @@ - +
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 5a077ff32b3..183a730e706 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 @@ -22,13 +22,13 @@ - +
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 over 1 year ago
  • Updated 5 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 3056321ea56..166f9e839ba 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 @@ -22,13 +22,13 @@ - +
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 e90bf8d9f4f..b4a7a358d75 100644 --- a/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html +++ b/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html @@ -22,13 +22,13 @@ - +
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 de57f351427..bed5ea090e1 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 @@ -22,13 +22,13 @@ - +
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 1e70d32c5ef..7adb339cd4b 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 @@ -22,13 +22,13 @@ - +
Skip to main content

Request Vitas Sync

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

Metadata​

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 2e53c59494b..12e0ddedbae 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 @@ -22,13 +22,13 @@ - +
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 b73f2646726..7c3708ba6d4 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 @@ -22,13 +22,13 @@ - +
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 1ab534c7ead..05858ba463a 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 @@ -22,13 +22,13 @@ - +
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 388ce7d04eb..dfd2dee3e39 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 @@ -22,13 +22,13 @@ - +
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 78aae1e64e9..86502373c7b 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 @@ -22,13 +22,13 @@ - +
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 eecd51d8d2e..65ed765393e 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 @@ -22,13 +22,13 @@ - +
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 d9307c90130..cc71155a495 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 @@ -22,13 +22,13 @@ - +
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('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 acfe7386a73..f1a08a6798f 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 @@ -22,13 +22,13 @@ - +
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 7176adf9122..9807927955b 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 @@ -22,13 +22,13 @@ - +
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':
return 1;
case 'false':
case 'no':
case 'disagree':
case 'discordo':
case 'falso':
case 'copy-1-of-no':
return 2;
case 'i_dont_know':
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',
},
};

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;
}

function replaceAccents(input) {
return input
.replace(/[ÑÒãà]/g, 'a')
.replace(/[ÁÂÃÀ]/g, 'A')
.replace(/[Γ§]/g, 'c')
.replace(/[Γ©Γͺ]/g, 'e')
.replace(/[Γ‰ΓŠ]/g, 'E')
.replace(/[Γ­]/g, 'i')
.replace(/[Í]/g, 'I')
.replace(/[óôá]/g, 'o')
.replace(/[ÓÔÕ]/g, 'O')
.replace(/[ΓΊ]/g, 'u')
.replace(/[Ú]/g, 'U');
}

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) +
'-' +
replaceAccents(dataValue('form.hidden_properties.intervention_name')(state)).replace(/\//gi, '');
return scrubEmojis(value, '');
}),

//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);
})
)
)(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 f35cafb26ae..20ed1e74108 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 @@ -22,13 +22,13 @@ - +
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':
return 1;
case 'false':
case 'no':
case 'disagree':
case 'discorda':
case 'discordo':
case 'falso':
return 2;
case 'i_dont_know':
case `not_sexually_active`:
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'));

if (formVersion == 'pre_challenge_ecap_-_pre_-_season_survey_for_athletes') {
console.log('Skipping upsert for ECAP data');
return { ...state, formVersion };
}

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',
},
};

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

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

fn(state => {
console.log('here', state.formVersion);
if (state.formVersion == 'pre_challenge_ecap_-_pre_-_season_survey_for_athletes') {
console.log('Skipping upsert for ECAP data');
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;
}

function replaceAccents(input) {
return input
.replace(/[ÑÒãà]/g, 'a')
.replace(/[ÁÂÃÀ]/g, 'A')
.replace(/[Γ§]/g, 'c')
.replace(/[Γ©Γͺ]/g, 'e')
.replace(/[Γ‰ΓŠ]/g, 'E')
.replace(/[Γ­]/g, 'i')
.replace(/[Í]/g, 'I')
.replace(/[óôá]/g, 'o')
.replace(/[ÓÔÕ]/g, 'O')
.replace(/[ΓΊ]/g, 'u')
.replace(/[Ú]/g, 'U');
}

return upsert(
'Attendance__c',
'CommCare_Ext_ID__c',
fields(
//field('Event__c', replaceAccents(dataValue('form.hidden_properties.intervention_name')(state))),
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(
replaceAccents(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);
})
)
)(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 794ae4fac86..3829e419f6b 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 @@ -22,13 +22,13 @@ - +
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 6a66f0c4fc8..0078caaf6b1 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 @@ -22,13 +22,13 @@ - +
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 replaceAccents(input) {
return input
.replace(/[ÑÒãà]/g, 'a')
.replace(/[ÁÂÃÀ]/g, 'A')
.replace(/[Γ§]/g, 'c')
.replace(/[Γ©Γͺ]/g, 'e')
.replace(/[Γ‰ΓŠ]/g, 'E')
.replace(/[Γ­]/g, 'i')
.replace(/[Í]/g, 'I')
.replace(/[óôá]/g, 'o')
.replace(/[ÓÔÕ]/g, 'O')
.replace(/[ΓΊ]/g, 'u')
.replace(/[Ú]/g, 'U');
}

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, replaceAccents };
});

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 = state.replaceAccents(`${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 c4570b0ce0e..0f84c8f9e2c 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 @@ -22,13 +22,13 @@ - +
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 replaceAccents(input) {
return input
.replace(/[ÑÒãà]/g, 'a')
.replace(/[ÁÂÃÀ]/g, 'A')
.replace(/[Γ§]/g, 'c')
.replace(/[Γ©Γͺ]/g, 'e')
.replace(/[Γ‰ΓŠ]/g, 'E')
.replace(/[Γ­]/g, 'i')
.replace(/[Í]/g, 'I')
.replace(/[óôá]/g, 'o')
.replace(/[ÓÔÕ]/g, 'O')
.replace(/[ΓΊ]/g, 'u')
.replace(/[Ú]/g, 'U');
}

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, replaceAccents };
});

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 = state.replaceAccents(`${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 03386a091cf..e166bad1917 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 @@ -22,13 +22,13 @@ - +
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-Vulnerability-Assessment-Service-Referral-2021-05-25.html b/adaptors/library/jobs/auto/Upsert-Risk-Vulnerability-Assessment-Service-Referral-2021-05-25.html index bda17c905e5..6f9787aa572 100644 --- a/adaptors/library/jobs/auto/Upsert-Risk-Vulnerability-Assessment-Service-Referral-2021-05-25.html +++ b/adaptors/library/jobs/auto/Upsert-Risk-Vulnerability-Assessment-Service-Referral-2021-05-25.html @@ -22,13 +22,13 @@ - +
Skip to main content

Upsert Risk & Vulnerability Assessment | Service Referral

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

Metadata​

  • Name: Upsert Risk & Vulnerability Assessment | Service Referral
  • Adaptor: @openfn/language-salesforce
  • Adaptor Version: v2.7.4
  • Created over 2 years ago
  • Updated over 1 year ago
  • Score: 3 (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('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 b2bac3d4526..42ee3611ba7 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 @@ -22,13 +22,13 @@ - +
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 867888675e1..07b15e7b2e2 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 @@ -22,13 +22,13 @@ - +
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 4afa740001d..59de44b0a92 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 @@ -22,13 +22,13 @@ - +
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-Group-Name-2021-04-28.html b/adaptors/library/jobs/auto/Upsert-Team-Group-Name-2021-04-28.html index 8d3382f3066..9e06af835af 100644 --- a/adaptors/library/jobs/auto/Upsert-Team-Group-Name-2021-04-28.html +++ b/adaptors/library/jobs/auto/Upsert-Team-Group-Name-2021-04-28.html @@ -22,13 +22,13 @@ - +
Skip to main content

Upsert Team/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 753675c76e2..285330d0058 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 @@ -22,13 +22,13 @@ - +
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 a5d6fb06767..71277396295 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 @@ -22,13 +22,13 @@ - +
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 4c64b7ff067..4313c5f44bd 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 @@ -22,13 +22,13 @@ - +
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 = '2023-11-06T14: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=2023-07-06T16:00:00&limit=${limit}&indexed_on_end=2023-07-06T16:30:00`
);

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 a91b06b3c43..34c1310bd21 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 @@ -22,13 +22,13 @@ - +
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.server_modified_on
: 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 8464510eb65..17f7213dc60 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 @@ -22,13 +22,13 @@ - +
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 6 months ago
  • Updated 23 days ago
  • Score: 92 (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 = '2023-11-06T14: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=2023-10-20T16:00:00&limit=${limit}&indexed_on_end=2023-10-20T17:02:00`
);

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 aa0bbcdcf2e..cb94b0b78c6 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 @@ -22,13 +22,13 @@ - +
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 534cb4d2f61..b6e1fa5a148 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 @@ -22,13 +22,13 @@ - +
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 6 months ago
  • Updated 23 days ago
  • Score: 92 (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 = '2023-11-06T14: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=2023-11-02T01:00:00&limit=${limit}&indexed_on_end=2023-11-02T21: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 16d8f733b3a..0785acadeb0 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 @@ -22,13 +22,13 @@ - +
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 b9967b480c4..558bf7717ee 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 @@ -22,13 +22,13 @@ - +
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 = '2023-11-06T14: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=2023-11-02T01:00:00&limit=${limit}&indexed_on_end=2023-11-02T21: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 06edeeec3d0..3abb1d5e126 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 @@ -22,13 +22,13 @@ - +
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 6 months ago
  • Updated 23 days ago
  • Score: 92 (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 = '2023-11-06T14: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=2023-10-20T03:00:00&limit=${limit}&indexed_on_end=2023-10-20T19: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 6e8f459d8ae..bcb160fa858 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 @@ -22,13 +22,13 @@ - +
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 95668618736..935354bd8e2 100644 --- a/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html +++ b/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html @@ -22,13 +22,13 @@ - +
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 7b3da2b8414..730600b454d 100644 --- a/adaptors/library/jobs/auto/alter-state-before-operations.html +++ b/adaptors/library/jobs/auto/alter-state-before-operations.html @@ -22,13 +22,13 @@ - +
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 c90e9224c85..e25e4e7d922 100644 --- a/adaptors/library/jobs/auto/async-and-array-dot-map.html +++ b/adaptors/library/jobs/auto/async-and-array-dot-map.html @@ -22,13 +22,13 @@ - +
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 11a852b416f..3d0a4dd29b5 100644 --- a/adaptors/library/jobs/auto/async-findValue.html +++ b/adaptors/library/jobs/auto/async-findValue.html @@ -22,13 +22,13 @@ - +
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 39d68fc37cd..4b14bac4b00 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 @@ -22,13 +22,13 @@ - +
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 92b25b0aa04..394e42c4854 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 @@ -22,13 +22,13 @@ - +
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 7 years ago
  • Updated about 7 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 a167472875a..223c384736a 100644 --- a/adaptors/library/jobs/auto/complex-http-request-chains.html +++ b/adaptors/library/jobs/auto/complex-http-request-chains.html @@ -22,13 +22,13 @@ - +
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 631c82715c2..51d8fe092f9 100644 --- a/adaptors/library/jobs/auto/complex-state-control.html +++ b/adaptors/library/jobs/auto/complex-state-control.html @@ -22,13 +22,13 @@ - +
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 27a7e578da9..56c8d4abbb7 100644 --- a/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html +++ b/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html @@ -22,13 +22,13 @@ - +
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 b014117b605..25826227248 100644 --- a/adaptors/library/jobs/auto/create-if-proposal.html +++ b/adaptors/library/jobs/auto/create-if-proposal.html @@ -22,13 +22,13 @@ - +
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 f91d4e66521..b2a8045e5a7 100644 --- a/adaptors/library/jobs/auto/getKoboData.html +++ b/adaptors/library/jobs/auto/getKoboData.html @@ -22,13 +22,13 @@ - +
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 1d6fca64231..b2bcb44f57a 100644 --- a/adaptors/library/jobs/auto/nawiri-2023-05-03.html +++ b/adaptors/library/jobs/auto/nawiri-2023-05-03.html @@ -22,13 +22,13 @@ - +
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 2fea4f858af..3c55cf50b8f 100644 --- a/adaptors/library/jobs/auto/no-return-2023-01-06.html +++ b/adaptors/library/jobs/auto/no-return-2023-01-06.html @@ -22,13 +22,13 @@ - +
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 482154a9ef5..716e734bc28 100644 --- a/adaptors/library/jobs/auto/promise-all-nested-requests.html +++ b/adaptors/library/jobs/auto/promise-all-nested-requests.html @@ -22,13 +22,13 @@ - +
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 50b2f1bf047..e2c164374f0 100644 --- a/adaptors/library/jobs/auto/send-mail-in-mailgun.html +++ b/adaptors/library/jobs/auto/send-mail-in-mailgun.html @@ -22,13 +22,13 @@ - +
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 94e06f05c5e..5f026d175f1 100644 --- a/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html +++ b/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html @@ -22,13 +22,13 @@ - +
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 91fca1d76b0..d5441ea936c 100644 --- a/adaptors/library/jobs/auto/synchronous-http-request.html +++ b/adaptors/library/jobs/auto/synchronous-http-request.html @@ -22,13 +22,13 @@ - +
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 da4ed6a5727..93c976cafae 100644 --- a/adaptors/library/jobs/auto/timeout.html +++ b/adaptors/library/jobs/auto/timeout.html @@ -22,13 +22,13 @@ - +
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 29efc191f3c..7d74f009ab8 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 @@ -22,13 +22,13 @@ - +
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 128a503e09e..83a3c451c07 100644 --- a/adaptors/library/triggers/xmlns.html +++ b/adaptors/library/triggers/xmlns.html @@ -22,13 +22,13 @@ - +
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 7f625ef40dc..707d38fcc75 100644 --- a/adaptors/magpi.html +++ b/adaptors/magpi.html @@ -22,14 +22,14 @@ - +
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 19066054dec..301e5cea1e8 100644 --- a/adaptors/moodle.html +++ b/adaptors/moodle.html @@ -22,7 +22,7 @@ - + @@ -48,7 +48,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/odk.html b/adaptors/odk.html index 02cb0f0ef20..af4d907f235 100644 --- a/adaptors/odk.html +++ b/adaptors/odk.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,7 @@ https://www.openfn.org/inbox/8ad63a29-mUCh-sEcRET-cODes-wOW)
  • Leave "Authorization token:" blank.
  • Leave "Include Media as:" set to "Links(URLs) to Media".
  • Click "Publish" and enter your email address in the dialogue box.
  • Click the "Published Data" tab under "Form Management" and select your form to view the status of your publisher. You can also now check your OpenFn inbox to see ODK submissions arrive.
  • - + \ No newline at end of file diff --git a/adaptors/ona.html b/adaptors/ona.html index 90aff722d0a..9685d17c17d 100644 --- a/adaptors/ona.html +++ b/adaptors/ona.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 9de84cec825..dab8cee1dc5 100644 --- a/adaptors/packages/asana-changelog.html +++ b/adaptors/packages/asana-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 7e9dac456d3..1682b603df1 100644 --- a/adaptors/packages/asana-configuration-schema.html +++ b/adaptors/packages/asana-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 ef216ce6f19..4d26e0fd66b 100644 --- a/adaptors/packages/asana-docs.html +++ b/adaptors/packages/asana-docs.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,7 @@ Access: public

    ParamTypeDescription
    taskGidstringGlobally unique identifier for the task
    paramsobjectBody parameters
    callbackfunction(Optional) callback function

    Example

    updateTask("taskGid",
    {
    name: 'test', "approval_status": "pending", "assignee": "12345"
    }
    )

    upsertTask​

    upsertTask(projectGid, params, callback) β‡’ Operation Update or create a task.

    Kind: global function
    Access: public

    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", "assignee": "12345"
    }

    }
    )

    - + \ No newline at end of file diff --git a/adaptors/packages/asana-readme.html b/adaptors/packages/asana-readme.html index 0680ef58f71..92da7df4e9e 100644 --- a/adaptors/packages/asana-readme.html +++ b/adaptors/packages/asana-readme.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,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/beyonic-changelog.html b/adaptors/packages/beyonic-changelog.html index db132e66b4f..e7287d51d17 100644 --- a/adaptors/packages/beyonic-changelog.html +++ b/adaptors/packages/beyonic-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 ce1125e2105..72ef99d3895 100644 --- a/adaptors/packages/beyonic-configuration-schema.html +++ b/adaptors/packages/beyonic-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 bd25c65c349..0ce4424c120 100644 --- a/adaptors/packages/beyonic-docs.html +++ b/adaptors/packages/beyonic-docs.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,7 @@ Create a collection request

    Kind: global function

    ParamTypeDescription
    dataobjectPayload data for the collection request

    Example

    execute(
    createCollectionRequest(data)
    )(state)

    createContact​

    createContact(data) β‡’ Operation Create a contact

    Kind: global function

    ParamTypeDescription
    dataobjectPayload data for the contact

    Example

    execute(
    createContact(data)
    )(state)

    createPayment​

    createPayment(data) β‡’ Operation Create a payment

    Kind: global function

    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 92112811724..870fe74c1c9 100644 --- a/adaptors/packages/beyonic-readme.html +++ b/adaptors/packages/beyonic-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 32be7b965af..a2e86277394 100644 --- a/adaptors/packages/bigquery-changelog.html +++ b/adaptors/packages/bigquery-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 423f93161c2..ccdd4908b4a 100644 --- a/adaptors/packages/bigquery-configuration-schema.html +++ b/adaptors/packages/bigquery-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 23e849587df..2768e1c3a6a 100644 --- a/adaptors/packages/bigquery-docs.html +++ b/adaptors/packages/bigquery-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    bigquery@2.0.4

    load​

    load(dirPath, projectId, datasetId, tableId, loadOptions, callback) β‡’ Operation Load files to BigQuery

    Kind: global function
    Access: public

    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 ff16ac6cfb2..ef7a89249a9 100644 --- a/adaptors/packages/bigquery-readme.html +++ b/adaptors/packages/bigquery-readme.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,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/commcare-changelog.html b/adaptors/packages/commcare-changelog.html index 1fe5ff2e248..26c0b454d36 100644 --- a/adaptors/packages/commcare-changelog.html +++ b/adaptors/packages/commcare-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 5da2cd468fe..0d53e444fa9 100644 --- a/adaptors/packages/commcare-configuration-schema.html +++ b/adaptors/packages/commcare-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "applicationName": "some-proof-of-concept",
    "appId": "the-long-uuid-in-the-url-that-designates-a-unique-commcare-project",
    "username": "test@openfn.org",
    "password": "superscretepassword"
    }

    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"
    ]
    },
    "applicationName": {
    "title": "Application Name",
    "type": "string",
    "description": "The CommCare application name",
    "minLength": 1,
    "examples": [
    "some-proof-of-concept"
    ]
    },
    "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",
    "applicationName",
    "appId"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/commcare-docs.html b/adaptors/packages/commcare-docs.html index f727211aaa5..d9d5f05c62f 100644 --- a/adaptors/packages/commcare-docs.html +++ b/adaptors/packages/commcare-docs.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,7 @@ Access: public

    ParamTypeDescription
    formDataObjectObject including form data.

    Example

    submit(
    fields(
    field("@", function(state) {
    return {
    "xmlns": "http://openrosa.org/formdesigner/form-id-here"
    };
    }),
    field("question1", dataValue("answer1")),
    field("question2", "Some answer here.")
    )
    )

    submitXls​

    submitXls(formData, params) β‡’ Operation Convert form data to xls then submit.

    Kind: global function
    Access: public

    ParamTypeDescription
    formDataObjectObject including form data.
    paramsObjectRequest params including case type and external id.

    Example

    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 cf0a45e8d9a..b8b9cb00119 100644 --- a/adaptors/packages/commcare-readme.html +++ b/adaptors/packages/commcare-readme.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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 dfd374a4473..6d40f1b4cd4 100644 --- a/adaptors/packages/common-changelog.html +++ b/adaptors/packages/common-changelog.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,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 306e84a08d7..01af63ed47e 100644 --- a/adaptors/packages/common-configuration-schema.html +++ b/adaptors/packages/common-configuration-schema.html @@ -22,13 +22,13 @@ - +
    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 7780985cdd7..48be56d44c5 100644 --- a/adaptors/packages/common-docs.html +++ b/adaptors/packages/common-docs.html @@ -22,7 +22,7 @@ - + @@ -146,7 +146,7 @@ Data can be passed directly or loaded as a JSON path from state. By default, schema is loaded from state.schema and data from state.data.

    Kind: global function

    ParamTypeDescription
    schemastring | objectThe schema, path or URL to validate against
    datastring | objectThe data or path to validate

    Example (Validate `state.data` with `state.schema`)

    validate()

    Example (Validate form data at `state.form` with a schema from a URL)

    validate("https://www.example.com/schema/record", "form")

    Example (Validate the each item in `state.records` with a schema from a URL)

    each("records[*]", validate("https://www.example.com/schema/record"))

    withAgent​

    withAgent(params) β‡’ Operation Creates an https agent for axios from the agentOptions key passed in params.

    Kind: global function

    ParamTypeDescription
    paramsobjectdata

    - + \ No newline at end of file diff --git a/adaptors/packages/common-readme.html b/adaptors/packages/common-readme.html index b1c0e3150dd..5d1feb3086a 100644 --- a/adaptors/packages/common-readme.html +++ b/adaptors/packages/common-readme.html @@ -22,14 +22,14 @@ - +
    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 16761f60f12..84d483c289c 100644 --- a/adaptors/packages/dhis2-changelog.html +++ b/adaptors/packages/dhis2-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 0055a77c801..8a604a46a9b 100644 --- a/adaptors/packages/dhis2-configuration-schema.html +++ b/adaptors/packages/dhis2-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "username": "admin",
    "password": "@some(!)Password",
    "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": {
    "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 52576b318fa..65b491a733a 100644 --- a/adaptors/packages/dhis2-docs.html +++ b/adaptors/packages/dhis2-docs.html @@ -22,7 +22,7 @@ - + @@ -59,7 +59,7 @@ Access: public

    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.

    Kind: global function
    Throws:

    Access: public

    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 cf475cd790e..cebe1d5fe83 100644 --- a/adaptors/packages/dhis2-readme.html +++ b/adaptors/packages/dhis2-readme.html @@ -22,7 +22,7 @@ - + @@ -65,7 +65,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 b7c91dbedde..613fafb54e3 100644 --- a/adaptors/packages/dynamics-changelog.html +++ b/adaptors/packages/dynamics-changelog.html @@ -22,7 +22,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​

    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 f15f9595b3b..7b5429e2062 100644 --- a/adaptors/packages/dynamics-configuration-schema.html +++ b/adaptors/packages/dynamics-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 e2792349314..625f9fa9d01 100644 --- a/adaptors/packages/dynamics-docs.html +++ b/adaptors/packages/dynamics-docs.html @@ -22,13 +22,13 @@ - +
    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 78826476079..b597dda2769 100644 --- a/adaptors/packages/dynamics-readme.html +++ b/adaptors/packages/dynamics-readme.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,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 7c34d6d9fb5..c766e023c51 100644 --- a/adaptors/packages/facebook-changelog.html +++ b/adaptors/packages/facebook-changelog.html @@ -22,7 +22,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/facebook-configuration-schema.html b/adaptors/packages/facebook-configuration-schema.html index 6dbad9f0800..06f6049c2f4 100644 --- a/adaptors/packages/facebook-configuration-schema.html +++ b/adaptors/packages/facebook-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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": false
    }

    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
    }
    },
    "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 4b51e5edc36..a47afd954ee 100644 --- a/adaptors/packages/facebook-docs.html +++ b/adaptors/packages/facebook-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,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 c677b63bd71..5f96c680978 100644 --- a/adaptors/packages/facebook-readme.html +++ b/adaptors/packages/facebook-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 8a39b281b39..f4f89f2efae 100644 --- a/adaptors/packages/fhir-changelog.html +++ b/adaptors/packages/fhir-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 a6876823bb8..c1a4119965b 100644 --- a/adaptors/packages/fhir-configuration-schema.html +++ b/adaptors/packages/fhir-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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/baseR4",
    "apiPath": "baseR4",
    "authType": "Basic",
    "token": "@super!scretetoken"
    }

    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/baseR4"
    ]
    },
    "apiPath": {
    "title": "API Path",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "placeholder": "R4",
    "description": "FHIR api path",
    "minLength": 1,
    "examples": [
    "baseR4",
    "R3",
    "R4"
    ]
    },
    "authType": {
    "title": "Auth Type",
    "type": "string",
    "description": "The type of authentication used to authenticate into the destination system",
    "examples": [
    "Basic"
    ]
    },
    "token": {
    "title": "Token",
    "type": "string",
    "description": "The token used to authenticate into the destination system",
    "examples": [
    "@super!scretetoken"
    ]
    }
    },
    "required": [
    "resource",
    "authType",
    "token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-docs.html b/adaptors/packages/fhir-docs.html index a8e05c37513..004ac6249e1 100644 --- a/adaptors/packages/fhir-docs.html +++ b/adaptors/packages/fhir-docs.html @@ -22,7 +22,7 @@ - + @@ -41,7 +41,7 @@ Returns: The request function is returning the parsed JSON data from the response of the HTTP request made to the specified url with the given params and method. If there is an error in the response, the function will throw an error.

    ParamTypeDefaultDescription
    urlstringThe URL of the API endpoint that the request is being made to.
    [params]objectAn object containing any additional parameters to be sent with the request, such as query parameters or request body data. It is an optional parameter and defaults to an empty object if not provided.
    [method]string"GET"The HTTP method to be used for the request. It defaults to 'GET' if not specified.

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-readme.html b/adaptors/packages/fhir-readme.html index 17bcfc09214..88912141c93 100644 --- a/adaptors/packages/fhir-readme.html +++ b/adaptors/packages/fhir-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 377d899b20c..5e8345b1031 100644 --- a/adaptors/packages/godata-changelog.html +++ b/adaptors/packages/godata-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 c86c0fcab00..f6100fd30e6 100644 --- a/adaptors/packages/godata-configuration-schema.html +++ b/adaptors/packages/godata-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "writeOnly": true,
    "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 05cc2d688e3..c0cfd1f7cdb 100644 --- a/adaptors/packages/godata-docs.html +++ b/adaptors/packages/godata-docs.html @@ -22,7 +22,7 @@ - + @@ -58,7 +58,7 @@ Access: public

    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

    Kind: global function
    Access: public

    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 d30a83749ae..1c57e00cdb2 100644 --- a/adaptors/packages/godata-readme.html +++ b/adaptors/packages/godata-readme.html @@ -22,7 +22,7 @@ - + @@ -54,7 +54,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 a582283d01b..b64d5788b9b 100644 --- a/adaptors/packages/googlehealthcare-changelog.html +++ b/adaptors/packages/googlehealthcare-changelog.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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 93452d836c9..0ab575d68ff 100644 --- a/adaptors/packages/googlehealthcare-configuration-schema.html +++ b/adaptors/packages/googlehealthcare-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "apiVersion": "v1"
    }

    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 bbebd6e5671..20b4dad7d0c 100644 --- a/adaptors/packages/googlehealthcare-docs.html +++ b/adaptors/packages/googlehealthcare-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    googlehealthcare@1.0.0

    createFhirResource​

    createFhirResource([fhirStore], resource, callback) β‡’ Operation Create some resource in Google Cloud Healthcare

    Kind: global function
    Access: public

    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 6a148e0d369..f748a263166 100644 --- a/adaptors/packages/googlehealthcare-readme.html +++ b/adaptors/packages/googlehealthcare-readme.html @@ -22,7 +22,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/googlesheets-changelog.html b/adaptors/packages/googlesheets-changelog.html index 01a7d425f7a..0ae29fe79e2 100644 --- a/adaptors/packages/googlesheets-changelog.html +++ b/adaptors/packages/googlesheets-changelog.html @@ -22,7 +22,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​

    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 d5dfa998414..bb5c7206718 100644 --- a/adaptors/packages/googlesheets-configuration-schema.html +++ b/adaptors/packages/googlesheets-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 f9d4e209001..6e8203a7461 100644 --- a/adaptors/packages/googlesheets-docs.html +++ b/adaptors/packages/googlesheets-docs.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,7 @@ Add an array of rows to the spreadsheet. https://developers.google.com/sheets/api/samples/writing#append_values

    Kind: global function
    Access: public

    ParamTypeDescription
    paramsObjectData object to add to the spreadsheet.

    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'],
    ],
    })

    - + \ No newline at end of file diff --git a/adaptors/packages/googlesheets-readme.html b/adaptors/packages/googlesheets-readme.html index d9e30f12a8b..0141f642ddf 100644 --- a/adaptors/packages/googlesheets-readme.html +++ b/adaptors/packages/googlesheets-readme.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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 b72393930db..a75000fd0bc 100644 --- a/adaptors/packages/hive-changelog.html +++ b/adaptors/packages/hive-changelog.html @@ -22,13 +22,13 @@ - +
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/hive-configuration-schema.html b/adaptors/packages/hive-configuration-schema.html index 65550625244..6265c3e4d8a 100644 --- a/adaptors/packages/hive-configuration-schema.html +++ b/adaptors/packages/hive-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "port": "10001",
    "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": "uri",
    "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",
    "port",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/hive-docs.html b/adaptors/packages/hive-docs.html index 92b6cc5d7ec..01552cb1e07 100644 --- a/adaptors/packages/hive-docs.html +++ b/adaptors/packages/hive-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    hive@0.2.0

    query​

    query(qs, options, callback) β‡’ Operation Execute an SQL statement

    Kind: global function
    Access: public

    ParamTypeDescription
    qsstringSQL statement
    optionsobject(Optional) options for executing sql statement
    callbackfunctionAn optional callback function

    Example (Get patient count from hive database)

    query("select count(*) from patient");

    - + \ No newline at end of file diff --git a/adaptors/packages/hive-readme.html b/adaptors/packages/hive-readme.html index d2fe54901c3..45ceec52f7b 100644 --- a/adaptors/packages/hive-readme.html +++ b/adaptors/packages/hive-readme.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 dc7f579528d..0159be9b2da 100644 --- a/adaptors/packages/http-changelog.html +++ b/adaptors/packages/http-changelog.html @@ -22,7 +22,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​

    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 3005b64ff64..fa7cbd21e53 100644 --- a/adaptors/packages/http-configuration-schema.html +++ b/adaptors/packages/http-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "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"
    ]
    },
    "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,
    "required": [
    "password",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/http-docs.html b/adaptors/packages/http-docs.html index 833cf1a1071..75c74ce9ee4 100644 --- a/adaptors/packages/http-docs.html +++ b/adaptors/packages/http-docs.html @@ -22,7 +22,7 @@ - + @@ -41,7 +41,7 @@ Make a PUT request

    Kind: global function
    Access: public

    ParamTypeDescription
    pathstringPath to resource
    paramsobjectBody, Query, Headers and Auth parameters
    callbackfunction(Optional) Callback function

    Example

    put('/myEndpoint', {
    body: {'foo': 'bar'},
    headers: {'content-type': 'application/json'},
    authentication: {username: 'user', password: 'pass'}
    })

    request​

    request(params) β‡’ Operation Make a request using the 'request' node module. This module is deprecated.

    Kind: global function

    ParamTypeDescription
    paramsobjectQuery, Headers and Authentication parameters

    Example

    request(params);

    - + \ No newline at end of file diff --git a/adaptors/packages/http-readme.html b/adaptors/packages/http-readme.html index aa4dacbb549..567707558c3 100644 --- a/adaptors/packages/http-readme.html +++ b/adaptors/packages/http-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 22f28d8df4b..7e2c20dacb6 100644 --- a/adaptors/packages/khanacademy-changelog.html +++ b/adaptors/packages/khanacademy-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 774f22f7320..47c6218de71 100644 --- a/adaptors/packages/khanacademy-configuration-schema.html +++ b/adaptors/packages/khanacademy-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "consumerKey": "somEThINGkeyish",
    "secretKey": "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": {
    "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 a96881376a2..30ea0cc75ac 100644 --- a/adaptors/packages/khanacademy-docs.html +++ b/adaptors/packages/khanacademy-docs.html @@ -22,14 +22,14 @@ - +
    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 e74826f8377..742ca755ed4 100644 --- a/adaptors/packages/khanacademy-readme.html +++ b/adaptors/packages/khanacademy-readme.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 3e0ffebce8f..1b1a0a4b5aa 100644 --- a/adaptors/packages/kobotoolbox-changelog.html +++ b/adaptors/packages/kobotoolbox-changelog.html @@ -22,7 +22,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.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 6365ed65d39..f8b041b0ad0 100644 --- a/adaptors/packages/kobotoolbox-configuration-schema.html +++ b/adaptors/packages/kobotoolbox-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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://kf.kobotoolbox.org",
    "username": "test@openfn.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 02fe099c72c..8a5ac25f5a5 100644 --- a/adaptors/packages/kobotoolbox-docs.html +++ b/adaptors/packages/kobotoolbox-docs.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,7 @@ Make a request to get the list of forms

    Kind: global function
    Access: public

    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

    Kind: global function

    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 a0e93cce0f0..f5a71567a32 100644 --- a/adaptors/packages/kobotoolbox-readme.html +++ b/adaptors/packages/kobotoolbox-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 7c6c718d565..ab938e469ae 100644 --- a/adaptors/packages/magpi-changelog.html +++ b/adaptors/packages/magpi-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 2d4d31161bb..38b21dd7d30 100644 --- a/adaptors/packages/magpi-configuration-schema.html +++ b/adaptors/packages/magpi-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 737e5f59509..0e0cf3303b1 100644 --- a/adaptors/packages/magpi-docs.html +++ b/adaptors/packages/magpi-docs.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,7 @@ Access: public

    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

    Kind: global function
    Access: public

    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 89088338b4e..172c4542733 100644 --- a/adaptors/packages/magpi-readme.html +++ b/adaptors/packages/magpi-readme.html @@ -22,7 +22,7 @@ - + @@ -42,7 +42,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 414c46c99a3..63dcc312cb1 100644 --- a/adaptors/packages/mailchimp-changelog.html +++ b/adaptors/packages/mailchimp-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 03cd8430289..a7336bde2f9 100644 --- a/adaptors/packages/mailchimp-configuration-schema.html +++ b/adaptors/packages/mailchimp-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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": 3,
    "examples": [
    "us11",
    "uk8",
    "in10"
    ],
    "pattern": "^[a-zA-Z]{2}\\d{1,2}$"
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "Mailchimp API Key",
    "minLength": 32,
    "examples": [
    "0eb22c7b4a1c5bcd789379bf8a92902d-us13"
    ],
    "pattern": "^[a-zA-Z0-9]{20}-[a-zA-Z]{2}\\d{1,2}$"
    }
    },
    "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 31f93b4e35e..d231f30a7ac 100644 --- a/adaptors/packages/mailchimp-docs.html +++ b/adaptors/packages/mailchimp-docs.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,7 @@ updateMember

    Kind: global function

    ParamTypeDescription
    paramsobjecta listId,subscriberHash and member
    [callback]functionOptional callback to handle the response

    updateMemberTags​

    updateMemberTags(params, [callback]) β‡’ Operation updateMemberTags

    Kind: global function

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    upsertMembers​

    upsertMembers(params, [callback]) β‡’ Operation Add or update a list members

    Kind: global function

    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 c457d6dd1b4..5c914a359f7 100644 --- a/adaptors/packages/mailchimp-readme.html +++ b/adaptors/packages/mailchimp-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 9b74033abf5..ef95a6febd9 100644 --- a/adaptors/packages/mailgun-changelog.html +++ b/adaptors/packages/mailgun-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 c1ea37f4f3d..c3d5532df1b 100644 --- a/adaptors/packages/mailgun-configuration-schema.html +++ b/adaptors/packages/mailgun-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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": "https://mailgun.com/api/example",
    "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 URL",
    "type": "string",
    "description": "Mailgun API domain URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://mailgun.com/api/example"
    ]
    },
    "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 7a7ad74f01c..944458ecfd9 100644 --- a/adaptors/packages/mailgun-docs.html +++ b/adaptors/packages/mailgun-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    mailgun@0.4.3

    send​

    send(params) Create an event

    Kind: global function
    Access: public

    ParamTypeDescription
    paramsobjectParams for sending an email

    Example

    send({
    from: 'from_email',
    to: 'to_email',
    subject: 'Your Subject',
    text: 'Your message goes here',
    attachment: {
    url: 'www.google.com/doodle.png',
    filename: 'forYou.png',
    },
    })

    - + \ No newline at end of file diff --git a/adaptors/packages/mailgun-readme.html b/adaptors/packages/mailgun-readme.html index 0914aea6c5f..00c2836d123 100644 --- a/adaptors/packages/mailgun-readme.html +++ b/adaptors/packages/mailgun-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 69c27442989..3948a62ca25 100644 --- a/adaptors/packages/maximo-changelog.html +++ b/adaptors/packages/maximo-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 971c78db742..1935fc895fd 100644 --- a/adaptors/packages/maximo-configuration-schema.html +++ b/adaptors/packages/maximo-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 2486c2b0790..3f7b3de11dd 100644 --- a/adaptors/packages/maximo-docs.html +++ b/adaptors/packages/maximo-docs.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,7 @@ Make a GET request and POST it somewhere else

    Kind: global function

    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

    Kind: global function

    ParamTypeDescription
    paramsobjectdata to make the update

    Example

    execute(
    update(params)
    )(state)

    update75​

    update75(params) β‡’ Operation Make an upadte in Maximo 7.5

    Kind: global function

    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 2ce4dc57a94..c8c5b22b9fe 100644 --- a/adaptors/packages/maximo-readme.html +++ b/adaptors/packages/maximo-readme.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 18497769b15..07262789193 100644 --- a/adaptors/packages/medicmobile-changelog.html +++ b/adaptors/packages/medicmobile-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 722083bea46..9b15d9b08e5 100644 --- a/adaptors/packages/medicmobile-configuration-schema.html +++ b/adaptors/packages/medicmobile-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "db": "medic",
    "username": "admin",
    "password": "@super(!)Secret"
    }

    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 b33fdeecb77..ce87e4959c0 100644 --- a/adaptors/packages/medicmobile-docs.html +++ b/adaptors/packages/medicmobile-docs.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,7 @@ Access: public

    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

    Kind: global function
    Access: public

    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 6bf12421d0c..0e53f8fefd5 100644 --- a/adaptors/packages/medicmobile-readme.html +++ b/adaptors/packages/medicmobile-readme.html @@ -22,7 +22,7 @@ - + @@ -39,7 +39,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 a65a6729ded..2b592bfa6be 100644 --- a/adaptors/packages/mogli-changelog.html +++ b/adaptors/packages/mogli-changelog.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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 91ea4ba7bb1..a20411c4a81 100644 --- a/adaptors/packages/mogli-configuration-schema.html +++ b/adaptors/packages/mogli-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 ae802cd1192..f8af7eca976 100644 --- a/adaptors/packages/mogli-docs.html +++ b/adaptors/packages/mogli-docs.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,7 @@ Removes unserializable keys from the state.

    Kind: global function

    ParamType
    stateState

    lookup​

    lookup(relationshipName, externalID, path) β‡’ object Adds a lookup or 'dome insert' to a record.

    Kind: global function

    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")

    relationship​

    relationship(relationshipName, externalID, dataSource) β‡’ object Adds a lookup or 'dome insert' to a record.

    Kind: global function

    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 4976cf92b23..45f2a4ee9ed 100644 --- a/adaptors/packages/mogli-readme.html +++ b/adaptors/packages/mogli-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 5841e5b6e0a..e714bdcd8ff 100644 --- a/adaptors/packages/mongodb-changelog.html +++ b/adaptors/packages/mongodb-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 468ded61b2f..698cf78362f 100644 --- a/adaptors/packages/mongodb-configuration-schema.html +++ b/adaptors/packages/mongodb-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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": "hostname",
    "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 896a1f7f03b..b733dfa1ed2 100644 --- a/adaptors/packages/mongodb-docs.html +++ b/adaptors/packages/mongodb-docs.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,7 @@ Find documents in a mongoDb collection

    Kind: global function

    ParamTypeDescription
    paramsobjectConfiguration for mongo

    Example

    findDocuments({
    database: 'str',
    collection: 'cases',
    query: {a:3}
    });

    insertDocuments​

    insertDocuments(params) β‡’ State Inserts documents into a mongoDb collection

    Kind: global function

    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

    Kind: global function

    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 a0c3897c91d..3f9b7565578 100644 --- a/adaptors/packages/mongodb-readme.html +++ b/adaptors/packages/mongodb-readme.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 3c5d49fb1c1..aef98711c7f 100644 --- a/adaptors/packages/msgraph-changelog.html +++ b/adaptors/packages/msgraph-changelog.html @@ -22,14 +22,14 @@ - +
    Skip to main content

    Changelog for the msgraph adaptor

    @openfn/language-msgraph

    0.4.0​

    Minor Changes​

    • 4cd6587: Add uploadFile and sheetToBuffer function

    Patch Changes​

    0.3.5​

    Patch Changes​

    0.3.4​

    Patch Changes​

    • 1c183e9: Fix getFile unit tests

    0.3.3​

    Patch Changes​

    0.3.2​

    Patch Changes​

    • 9cc4952: fix url in request util

    0.3.1​

    Patch Changes​

    • f45f477: Clean-up state before throwing an error

    0.3.0​

    Minor Changes​

    • 9366e53: - Switch from nodejs default fetch to undici fetch
      • Added the following sharepoint functions
        • getDrive()
        • getFolder()
        • getFile()

    0.2.0​

    Minor Changes​

    • d33c0ee: export parseCsv from common

    Patch Changes​

    0.1.1​

    Patch Changes​

    • aad9549: Ensure that standard OAuth2 credentials with snake-cased "access_token" keys can be used for OAuth2-reliant adaptors
    • Updated dependencies [aad9549]

    0.1.0​

    Minor Changes​

    • 93d82a8: Add msgraph adaptor with get() and create() functions

    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 8778c1822d2..ec98d6dbdab 100644 --- a/adaptors/packages/msgraph-configuration-schema.html +++ b/adaptors/packages/msgraph-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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": "v1.0",
    "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 baf798ba460..1a845649ca7 100644 --- a/adaptors/packages/msgraph-docs.html +++ b/adaptors/packages/msgraph-docs.html @@ -22,7 +22,7 @@ - + @@ -53,7 +53,7 @@ Access: public

    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',
    });

    uploadFile​

    uploadFile(resource, data, callback) β‡’ Operation Upload a file to a drive

    Kind: global function
    Access: public

    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
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/msgraph-readme.html b/adaptors/packages/msgraph-readme.html index 40b3e21abf0..08a10d30cf3 100644 --- a/adaptors/packages/msgraph-readme.html +++ b/adaptors/packages/msgraph-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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/mssql-changelog.html b/adaptors/packages/mssql-changelog.html index a98793f78eb..ace66c40956 100644 --- a/adaptors/packages/mssql-changelog.html +++ b/adaptors/packages/mssql-changelog.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ 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.8​

    Patch Changes​

    4.0.7​

    Patch Changes​

    4.0.6​

    Patch Changes​

    4.0.5​

    Patch Changes​

    4.0.4​

    Patch Changes​

    4.0.3​

    Patch Changes​

    4.0.2​

    Patch Changes​

    4.0.1​

    Patch Changes​

    4.0.0​

    Major Changes​

    Patch Changes​

    3.1.1​

    Patch Changes​

    3.1.0​

    Minor Changes​

    Patch Changes​

    - + \ No newline at end of file diff --git a/adaptors/packages/mssql-configuration-schema.html b/adaptors/packages/mssql-configuration-schema.html index 78d59f2b822..681bd7e3cbe 100644 --- a/adaptors/packages/mssql-configuration-schema.html +++ b/adaptors/packages/mssql-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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": "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": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "server": {
    "title": "Server URL",
    "type": "string",
    "description": "The database instance server URL or IP address",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "something.database.windows.net"
    ]
    },
    "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"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "server",
    "database"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mssql-docs.html b/adaptors/packages/mssql-docs.html index 380d1e164f4..d9d31a9ed15 100644 --- a/adaptors/packages/mssql-docs.html +++ b/adaptors/packages/mssql-docs.html @@ -22,7 +22,7 @@ - + @@ -53,7 +53,7 @@ Access: public

    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

    Kind: global function
    Access: public

    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 245b7cef15c..8cd365d634d 100644 --- a/adaptors/packages/mssql-readme.html +++ b/adaptors/packages/mssql-readme.html @@ -22,7 +22,7 @@ - + @@ -42,7 +42,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 7f6e09b2ffb..2c2f1ce8728 100644 --- a/adaptors/packages/mysql-changelog.html +++ b/adaptors/packages/mysql-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 0e583a6c35d..97c6fa0bf43 100644 --- a/adaptors/packages/mysql-configuration-schema.html +++ b/adaptors/packages/mysql-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "port": "3306",
    "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": "uri",
    "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"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mysql-docs.html b/adaptors/packages/mysql-docs.html index c9f8f6442f3..89002d8512b 100644 --- a/adaptors/packages/mysql-docs.html +++ b/adaptors/packages/mysql-docs.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,7 @@ Insert or Update a record if matched

    Kind: global function

    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

    Kind: global function
    Access: public

    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 a835f849e6f..7bb3caa9681 100644 --- a/adaptors/packages/mysql-readme.html +++ b/adaptors/packages/mysql-readme.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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 81689d7a907..e54492c26d2 100644 --- a/adaptors/packages/nexmo-changelog.html +++ b/adaptors/packages/nexmo-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 abe71adc539..5b967175cd3 100644 --- a/adaptors/packages/nexmo-configuration-schema.html +++ b/adaptors/packages/nexmo-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 36b416cfe27..1f525aa5215 100644 --- a/adaptors/packages/nexmo-docs.html +++ b/adaptors/packages/nexmo-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    nexmo@0.4.3

    sendSMS​

    sendSMS(from, toNumber, message) β‡’ Operation Sends an SMS message to a specific phone number

    Kind: global function
    Access: public

    ParamTypeDescription
    fromStringName or number the message should be sent from.
    toNumberStringDestination phone number.
    messageStringText message

    Example

    sendSMS("OpenFn", "phoneNumber", "Hello World!")

    - + \ No newline at end of file diff --git a/adaptors/packages/nexmo-readme.html b/adaptors/packages/nexmo-readme.html index a3d558795e8..639699f340b 100644 --- a/adaptors/packages/nexmo-readme.html +++ b/adaptors/packages/nexmo-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 406753cb21a..f275e7440a1 100644 --- a/adaptors/packages/ocl-changelog.html +++ b/adaptors/packages/ocl-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 f07f44d9e43..c201dff85dc 100644 --- a/adaptors/packages/ocl-configuration-schema.html +++ b/adaptors/packages/ocl-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 4d1157c21e2..c0bbe8728b3 100644 --- a/adaptors/packages/ocl-docs.html +++ b/adaptors/packages/ocl-docs.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,7 @@ Access: public

    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

    Kind: global function
    Access: public

    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 af353ddd035..1867637cfd3 100644 --- a/adaptors/packages/ocl-readme.html +++ b/adaptors/packages/ocl-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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/openfn-changelog.html b/adaptors/packages/openfn-changelog.html index 54d00ac44e9..0ec09da0e0b 100644 --- a/adaptors/packages/openfn-changelog.html +++ b/adaptors/packages/openfn-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 0f0981c6f7c..53753831c61 100644 --- a/adaptors/packages/openfn-configuration-schema.html +++ b/adaptors/packages/openfn-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "projectId": "some-id",
    "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 f1a28fc950c..49321e1924d 100644 --- a/adaptors/packages/openfn-docs.html +++ b/adaptors/packages/openfn-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    openfn@1.3.8

    request​

    request(options, callback) β‡’ Operation Make a POST request

    Kind: global function
    Access: public

    ParamTypeDescription
    optionsobjectBody, Query, Headers and Authentication parameters
    callbackfunction(Optional) Callback function

    Example

    request({method: 'get', path: '/jobs/});

    - + \ No newline at end of file diff --git a/adaptors/packages/openfn-readme.html b/adaptors/packages/openfn-readme.html index 1e6e887e7ac..aea6d8f2997 100644 --- a/adaptors/packages/openfn-readme.html +++ b/adaptors/packages/openfn-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 50ed9a6270d..a179478b913 100644 --- a/adaptors/packages/openhim-changelog.html +++ b/adaptors/packages/openhim-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 10a509c9d79..5dbf147315f 100644 --- a/adaptors/packages/openhim-configuration-schema.html +++ b/adaptors/packages/openhim-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "username": "admin@openhim.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": {
    "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 83b9bca6f59..3096a893794 100644 --- a/adaptors/packages/openhim-docs.html +++ b/adaptors/packages/openhim-docs.html @@ -22,14 +22,14 @@ - +
    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 752f5130567..c823515c43c 100644 --- a/adaptors/packages/openhim-readme.html +++ b/adaptors/packages/openhim-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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/openmrs-changelog.html b/adaptors/packages/openmrs-changelog.html index 8178b812055..51a9437bbcb 100644 --- a/adaptors/packages/openmrs-changelog.html +++ b/adaptors/packages/openmrs-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 254e0003175..984198f874d 100644 --- a/adaptors/packages/openmrs-configuration-schema.html +++ b/adaptors/packages/openmrs-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "username": "admin@openmrs.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": {
    "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 a6058f3eca9..ce295fa86a8 100644 --- a/adaptors/packages/openmrs-docs.html +++ b/adaptors/packages/openmrs-docs.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,7 @@ Access: public

    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.

    Kind: global function
    Throws:

    Access: public

    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 55d379efea0..f0fa858d214 100644 --- a/adaptors/packages/openmrs-readme.html +++ b/adaptors/packages/openmrs-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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​

    req({ method: 'GET', url: '/ws/rest/v1/concept' }, state => {
    console.log(JSON.stringify(state, null, 2));
    return state;
    });

    Create new patient​

    patient(
    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 722edad87e9..e490f55cdad 100644 --- a/adaptors/packages/openspp-changelog.html +++ b/adaptors/packages/openspp-changelog.html @@ -22,13 +22,13 @@ - +
    Skip to main content

    Changelog for the openspp adaptor

    @openfn/language-openspp

    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 00a1cc44464..fd84412e148 100644 --- a/adaptors/packages/openspp-configuration-schema.html +++ b/adaptors/packages/openspp-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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://dev.newlogic-demo.com",
    "username": "test@openfn.org",
    "password": "@some(!)Str0ngp4ss0w0rd",
    "database": "devel"
    }

    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 65e8cb355d5..8e9ad0998fb 100644 --- a/adaptors/packages/openspp-docs.html +++ b/adaptors/packages/openspp-docs.html @@ -22,7 +22,7 @@ - + @@ -62,7 +62,7 @@ Access: public

    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

    Kind: global function
    Access: public

    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 1017c93b8cd..e502cfbc3a8 100644 --- a/adaptors/packages/openspp-readme.html +++ b/adaptors/packages/openspp-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 a7c7fc8b69d..0929cd29962 100644 --- a/adaptors/packages/postgresql-changelog.html +++ b/adaptors/packages/postgresql-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 fbb49e35f38..f9c0ea727f7 100644 --- a/adaptors/packages/postgresql-configuration-schema.html +++ b/adaptors/packages/postgresql-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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://some-host.compute-1.amazonaws.com",
    "port": "5432",
    "database": "demo-db",
    "user": "admin",
    "password": "@super(!)Secretpass",
    "ssl": "true",
    "allowSelfSignedCert": "true"
    }

    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,
    "anyOf": [
    {
    "format": "uri"
    },
    {
    "format": "ipv4"
    }
    ],
    "examples": [
    "https://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",
    "port",
    "database"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/postgresql-docs.html b/adaptors/packages/postgresql-docs.html index 343e92ae109..d39a5e063cd 100644 --- a/adaptors/packages/postgresql-docs.html +++ b/adaptors/packages/postgresql-docs.html @@ -22,7 +22,7 @@ - + @@ -48,7 +48,7 @@ Access: public

    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

    Kind: global function
    Access: public

    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 32d763521c2..c460f1e5a07 100644 --- a/adaptors/packages/postgresql-readme.html +++ b/adaptors/packages/postgresql-readme.html @@ -22,7 +22,7 @@ - + @@ -39,7 +39,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 d8629954eb1..86b52d5202d 100644 --- a/adaptors/packages/primero-changelog.html +++ b/adaptors/packages/primero-changelog.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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 ed273973ed8..865aee4bdb7 100644 --- a/adaptors/packages/primero-configuration-schema.html +++ b/adaptors/packages/primero-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "user": "admin",
    "password": "@super(!)Superpass",
    "basicAuth": "true"
    }

    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 28c7ae99d66..db4e749f2ce 100644 --- a/adaptors/packages/primero-docs.html +++ b/adaptors/packages/primero-docs.html @@ -22,7 +22,7 @@ - + @@ -68,7 +68,7 @@ In this implementation, we first fetch the list of cases, then we check if the case exist before choosing the right operation to do.

    Kind: global function
    Access: public

    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 bd26f8d3a52..9a771ba6f09 100644 --- a/adaptors/packages/primero-readme.html +++ b/adaptors/packages/primero-readme.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,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 57d50e58383..20f17d4ebeb 100644 --- a/adaptors/packages/progres-changelog.html +++ b/adaptors/packages/progres-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 a32ec590124..a1b5007c0b0 100644 --- a/adaptors/packages/progres-configuration-schema.html +++ b/adaptors/packages/progres-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 d0c5a93e0c4..e9faa1397bf 100644 --- a/adaptors/packages/progres-docs.html +++ b/adaptors/packages/progres-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    progres@1.3.8

    postData​

    postData(params, callback) β‡’ Operation Make a POST request with a certificate

    Kind: global function
    Access: public

    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 82493157472..679b62bd6dd 100644 --- a/adaptors/packages/progres-readme.html +++ b/adaptors/packages/progres-readme.html @@ -22,7 +22,7 @@ - + @@ -37,7 +37,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 620a8733682..289e5a95b47 100644 --- a/adaptors/packages/rapidpro-changelog.html +++ b/adaptors/packages/rapidpro-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 b9aa57bc261..54bd2b201a2 100644 --- a/adaptors/packages/rapidpro-configuration-schema.html +++ b/adaptors/packages/rapidpro-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "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": {
    "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 2816745cef4..5a1ce81e0ff 100644 --- a/adaptors/packages/rapidpro-docs.html +++ b/adaptors/packages/rapidpro-docs.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,7 @@ Access: public

    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

    Kind: global function
    Access: public

    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 2e003d8b68e..d4d1522776c 100644 --- a/adaptors/packages/rapidpro-readme.html +++ b/adaptors/packages/rapidpro-readme.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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/resourcemap-changelog.html b/adaptors/packages/resourcemap-changelog.html index 1dc78e1b920..e4f8f78f519 100644 --- a/adaptors/packages/resourcemap-changelog.html +++ b/adaptors/packages/resourcemap-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 d38f6a9256f..ffe532151e0 100644 --- a/adaptors/packages/resourcemap-configuration-schema.html +++ b/adaptors/packages/resourcemap-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "username": "admin",
    "password": "@super(!)Secret"
    }

    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 1d2a01b48ab..6d397bbfe55 100644 --- a/adaptors/packages/resourcemap-docs.html +++ b/adaptors/packages/resourcemap-docs.html @@ -22,14 +22,14 @@ - +
    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 7cb74e90502..12d26c8c9e4 100644 --- a/adaptors/packages/resourcemap-readme.html +++ b/adaptors/packages/resourcemap-readme.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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 c0152be7e8b..6801fb3efe1 100644 --- a/adaptors/packages/salesforce-changelog.html +++ b/adaptors/packages/salesforce-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 ec90457ba8f..f42c9c7133d 100644 --- a/adaptors/packages/salesforce-configuration-schema.html +++ b/adaptors/packages/salesforce-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "securityToken": "salesforcesecuritytoken",
    "apiVersion": "59.0"
    }

    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",
    "pattern": "^[0-9]{2}\\.[0-9]$",
    "placeholder": "52.0",
    "description": "Salesforce API Version",
    "minLength": 1,
    "examples": [
    "59.0"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "loginUrl",
    "username",
    "password",
    "securityToken"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/salesforce-docs.html b/adaptors/packages/salesforce-docs.html index 3045ba1fd19..9cd3c2abdcd 100644 --- a/adaptors/packages/salesforce-docs.html +++ b/adaptors/packages/salesforce-docs.html @@ -22,7 +22,7 @@ - + @@ -71,7 +71,7 @@ Magic: attrs - $.children[?(@.name=="{{args.sObject}}")].children[?(!@.meta.externalId)]

    ParamTypeDescription
    sObjectStringAPI name of the sObject.
    externalIdStringID.
    attrsObjectField attributes for the new object.

    Example

    upsert('obj_name', 'ext_id', {
    attr1: "foo",
    attr2: "bar"
    })

    upsertIf​

    upsertIf(logical, sObject, externalId, attrs) β‡’ Operation Upsert if conditions are met.

    Kind: global function
    Access: public

    ParamTypeDescription
    logicalbooleana logical statement that will be evaluated.
    sObjectStringAPI name of the sObject.
    externalIdStringID.
    attrsObjectField 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 9cfa5798f4d..fe124e04df5 100644 --- a/adaptors/packages/salesforce-readme.html +++ b/adaptors/packages/salesforce-readme.html @@ -22,7 +22,7 @@ - + @@ -39,7 +39,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/sftp-changelog.html b/adaptors/packages/sftp-changelog.html index d54677412b7..0a0ba333ed2 100644 --- a/adaptors/packages/sftp-changelog.html +++ b/adaptors/packages/sftp-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 ea545fc972c..e824653e44a 100644 --- a/adaptors/packages/sftp-configuration-schema.html +++ b/adaptors/packages/sftp-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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",
    "port": "22",
    "username": "admin",
    "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": {
    "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 7f96d3ac630..b79a3602fbc 100644 --- a/adaptors/packages/sftp-docs.html +++ b/adaptors/packages/sftp-docs.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,7 @@ Access: public

    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

    Kind: global function
    Access: public

    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 93178ed1b7c..a4da21992cf 100644 --- a/adaptors/packages/sftp-readme.html +++ b/adaptors/packages/sftp-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 2859b5a3d72..b1c094427a5 100644 --- a/adaptors/packages/smpp-changelog.html +++ b/adaptors/packages/smpp-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 c94e41c9dd2..f2c41c71008 100644 --- a/adaptors/packages/smpp-configuration-schema.html +++ b/adaptors/packages/smpp-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 eb4c39c4764..8873033f24b 100644 --- a/adaptors/packages/smpp-docs.html +++ b/adaptors/packages/smpp-docs.html @@ -22,13 +22,13 @@ - +
    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 6093d34b0fc..c0fabf20675 100644 --- a/adaptors/packages/smpp-readme.html +++ b/adaptors/packages/smpp-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 e446b803784..3148bcc3d43 100644 --- a/adaptors/packages/surveycto-changelog.html +++ b/adaptors/packages/surveycto-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 6d069076d4e..2e400a33764 100644 --- a/adaptors/packages/surveycto-configuration-schema.html +++ b/adaptors/packages/surveycto-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ sample below.

    Sample Configuration​

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "instanceName": "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": {
    "instanceName": {
    "title": "Instance name",
    "type": "string",
    "description": "Your Surveycto instance name",
    "minLength": 1,
    "examples": [
    "openfn_test"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Your Surveycto instance username",
    "minLength": 1,
    "examples": [
    "someusername"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your Surveycto instance password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(%)!Password"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "instanceName",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-docs.html b/adaptors/packages/surveycto-docs.html index 530292fd8b9..8da1747b0e7 100644 --- a/adaptors/packages/surveycto-docs.html +++ b/adaptors/packages/surveycto-docs.html @@ -22,14 +22,14 @@ - +
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-readme.html b/adaptors/packages/surveycto-readme.html index f1f99cc794d..883ae18a42b 100644 --- a/adaptors/packages/surveycto-readme.html +++ b/adaptors/packages/surveycto-readme.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,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 cce8c75b808..9090e9a345d 100644 --- a/adaptors/packages/telerivet-changelog.html +++ b/adaptors/packages/telerivet-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 668c47b9496..ba194bf84b8 100644 --- a/adaptors/packages/telerivet-configuration-schema.html +++ b/adaptors/packages/telerivet-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 17237ae1417..690b7a7d611 100644 --- a/adaptors/packages/telerivet-docs.html +++ b/adaptors/packages/telerivet-docs.html @@ -22,14 +22,14 @@ - +
    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 7b5f14f817a..f5996367e85 100644 --- a/adaptors/packages/telerivet-readme.html +++ b/adaptors/packages/telerivet-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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/template-changelog.html b/adaptors/packages/template-changelog.html index 0e63527e4d8..fb7d45d090b 100644 --- a/adaptors/packages/template-changelog.html +++ b/adaptors/packages/template-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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​

    Minor Changes​

    1.7.8​

    Patch Changes​

    1.7.7​

    Patch Changes​

    1.7.6​

    Patch Changes​

    1.7.5​

    Patch Changes​

    1.7.4​

    Patch Changes​

    1.7.3​

    Patch Changes​

    1.7.2​

    Patch Changes​

    1.7.1​

    Patch Changes​

    1.7.0​

    Minor Changes​

    - + \ No newline at end of file diff --git a/adaptors/packages/template-configuration-schema.html b/adaptors/packages/template-configuration-schema.html index bd6c9c2db73..e1f0c2db667 100644 --- a/adaptors/packages/template-configuration-schema.html +++ b/adaptors/packages/template-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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://example.com",
    "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://example.com"
    ]
    },
    "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": [
    "password",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/template-docs.html b/adaptors/packages/template-docs.html index 0178c86bf7a..830fc2e460a 100644 --- a/adaptors/packages/template-docs.html +++ b/adaptors/packages/template-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    template@3.0.1

    create​

    create(resource, data, callback) β‡’ Operation Create some resource in some system

    Kind: global function
    Access: public

    ParamTypeDescription
    resourcestringThe type of entity that will be created
    dataobjectThe data to create the new resource
    callbackfunctionAn optional callback function

    Example

    create("patient", {"name": "Bukayo"})

    - + \ No newline at end of file diff --git a/adaptors/packages/template-readme.html b/adaptors/packages/template-readme.html index 08320309802..c69daaeca94 100644 --- a/adaptors/packages/template-readme.html +++ b/adaptors/packages/template-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the create function​

    create('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/twilio-changelog.html b/adaptors/packages/twilio-changelog.html index 2bd7078b9eb..b72d37a8fa5 100644 --- a/adaptors/packages/twilio-changelog.html +++ b/adaptors/packages/twilio-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 8bfa6756b1d..5b7a0d949a8 100644 --- a/adaptors/packages/twilio-configuration-schema.html +++ b/adaptors/packages/twilio-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 652604458bd..b07a28b945a 100644 --- a/adaptors/packages/twilio-docs.html +++ b/adaptors/packages/twilio-docs.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content

    twilio@0.4.1

    sendSMS​

    sendSMS(params) β‡’ Operation Sends an SMS message to a specific phone number

    Kind: global function
    Access: public

    ParamTypeDescription
    paramsObjectan object containing 'body', 'from', and 'to' keys.

    Example

    sendSMS({
    body: dataValue('sampleText'),
    from: dataValue('myFromNumber'),
    to: dataValue('ukMobile'),
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/twilio-readme.html b/adaptors/packages/twilio-readme.html index 4c961bd407c..daf957884da 100644 --- a/adaptors/packages/twilio-readme.html +++ b/adaptors/packages/twilio-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 06b3c8788ef..9ac3c81be90 100644 --- a/adaptors/packages/vtiger-changelog.html +++ b/adaptors/packages/vtiger-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 b07b94b6e45..a6e362c8914 100644 --- a/adaptors/packages/vtiger-configuration-schema.html +++ b/adaptors/packages/vtiger-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 33ca086be60..61f6da0fc26 100644 --- a/adaptors/packages/vtiger-docs.html +++ b/adaptors/packages/vtiger-docs.html @@ -22,13 +22,13 @@ - +
    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 e6eccdbea9d..c2d4a365f26 100644 --- a/adaptors/packages/vtiger-readme.html +++ b/adaptors/packages/vtiger-readme.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 1b3ad30ac54..80fc8d534c6 100644 --- a/adaptors/packages/zoho-changelog.html +++ b/adaptors/packages/zoho-changelog.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 451a934d9fe..84ba59e3dec 100644 --- a/adaptors/packages/zoho-configuration-schema.html +++ b/adaptors/packages/zoho-configuration-schema.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 0d633366d7c..536b56c36ab 100644 --- a/adaptors/packages/zoho-docs.html +++ b/adaptors/packages/zoho-docs.html @@ -22,14 +22,14 @@ - +
    Skip to main content

    zoho@0.3.1

    addRow​

    addRow(db, table, rowData) β‡’ Operation To add a row data to a database table

    Kind: global function

    ParamTypeDescription
    dbstringDatabase
    tablestringDatabase table
    rowDataobjectrow data to be added into the database

    Example

    addRow(
    'testing_openfn',
    'Customers',
    fields(field('Subject', dataValue('formId')), field('Status', 'Closed'))
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/zoho-readme.html b/adaptors/packages/zoho-readme.html index 566c7a83ce2..5e64bb3fdca 100644 --- a/adaptors/packages/zoho-readme.html +++ b/adaptors/packages/zoho-readme.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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 d36970005ab..f6af35fb684 100644 --- a/adaptors/postgresql.html +++ b/adaptors/postgresql.html @@ -22,7 +22,7 @@ - + @@ -57,7 +57,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 4d0be41c1d0..e89de331039 100644 --- a/adaptors/powerbi.html +++ b/adaptors/powerbi.html @@ -22,7 +22,7 @@ - + @@ -40,7 +40,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 87811f71cfc..084270e063f 100644 --- a/adaptors/primero.html +++ b/adaptors/primero.html @@ -22,7 +22,7 @@ - + @@ -63,7 +63,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 a3dc8a97dce..29734c209e5 100644 --- a/adaptors/salesforce.html +++ b/adaptors/salesforce.html @@ -22,7 +22,7 @@ - + @@ -139,7 +139,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 d95232c5902..4f688c3594f 100644 --- a/adaptors/surveycto.html +++ b/adaptors/surveycto.html @@ -22,7 +22,7 @@ - + @@ -39,7 +39,7 @@ Configure option for that form, and then click Add Webhook in the panel that appears.

    Periodic​

    In order to fetch data from SurveyCTO periodically, you can use language-surveycto:

    fetchSubmissions(
    'form_id', // the form id
    'Sep 1, 2016 3:56:02 PM', // the initial "after" date
    // after the first run, OpenFn will only fetch new submissions
    'https://www.openfn.org/inbox/something-secret' // 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/tableau.html b/adaptors/tableau.html index b00c1ea23d1..bae9a60b5ed 100644 --- a/adaptors/tableau.html +++ b/adaptors/tableau.html @@ -22,7 +22,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 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 d5114b303c0..82a3432368a 100644 --- a/articles.html +++ b/articles.html @@ -22,7 +22,7 @@ - + @@ -73,7 +73,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 8c2d34edafe..1d9061bb815 100644 --- a/articles/2020/06/16/how-information-is-organized.html +++ b/articles/2020/06/16/how-information-is-organized.html @@ -22,7 +22,7 @@ - + @@ -102,7 +102,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 0a4e7d0f13a..3afcd1a1866 100644 --- a/articles/2020/06/24/three-questions-to-ask.html +++ b/articles/2020/06/24/three-questions-to-ask.html @@ -22,7 +22,7 @@ - + @@ -63,7 +63,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 c5be15a68df..137eb124fab 100644 --- a/articles/2020/07/02/allow-yourself-to-fail.html +++ b/articles/2020/07/02/allow-yourself-to-fail.html @@ -22,7 +22,7 @@ - + @@ -52,7 +52,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 9ac8c20711d..966c1e2a928 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 @@ -22,7 +22,7 @@ - + @@ -49,7 +49,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 daf5e7c3afd..95fdbbe336f 100644 --- a/articles/2020/12/09/upsert-in-dhis2.html +++ b/articles/2020/12/09/upsert-in-dhis2.html @@ -22,7 +22,7 @@ - + @@ -51,7 +51,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 d327fd29f4c..b83405cc518 100644 --- a/articles/2021/02/03/hosted-or-local-deployment.html +++ b/articles/2021/02/03/hosted-or-local-deployment.html @@ -22,7 +22,7 @@ - + @@ -87,7 +87,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 3d5256e2e54..c383e36157e 100644 --- a/articles/2021/02/17/syncing-options.html +++ b/articles/2021/02/17/syncing-options.html @@ -22,7 +22,7 @@ - + @@ -76,7 +76,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 4f58465283f..e4a2dd80e84 100644 --- a/articles/2021/05/24/commcare-events.html +++ b/articles/2021/05/24/commcare-events.html @@ -22,7 +22,7 @@ - + @@ -116,7 +116,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 09944573880..4769110cd1a 100644 --- a/articles/2021/07/05/wrapping-my-head-around-jobs.html +++ b/articles/2021/07/05/wrapping-my-head-around-jobs.html @@ -22,7 +22,7 @@ - + @@ -104,7 +104,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 d8b50212151..38141566c70 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 @@ -22,7 +22,7 @@ - + @@ -97,7 +97,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 6ecd406b9f0..ae6243e49a1 100644 --- a/articles/2021/10/15/webpack-to-esbuild-part1.html +++ b/articles/2021/10/15/webpack-to-esbuild-part1.html @@ -22,7 +22,7 @@ - + @@ -80,7 +80,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 ab1e6ffca58..632dc13ec08 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 @@ -22,7 +22,7 @@ - + @@ -115,7 +115,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 93c542ed1b1..ecfe195d45a 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 @@ -22,7 +22,7 @@ - + @@ -115,7 +115,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 33515a16d78..92400c31a30 100644 --- a/articles/2022/06/07/workflow-automation.html +++ b/articles/2022/06/07/workflow-automation.html @@ -22,7 +22,7 @@ - + @@ -113,7 +113,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 65033f30342..2e3783dcbbe 100644 --- a/articles/2022/09/19/auth-security.html +++ b/articles/2022/09/19/auth-security.html @@ -22,7 +22,7 @@ - + @@ -75,7 +75,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 f65a44e1fc6..f6b2b753f6d 100644 --- a/articles/archive.html +++ b/articles/archive.html @@ -22,13 +22,13 @@ - +
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/page/2.html b/articles/page/2.html index 24545b0e589..abf981ac3cd 100644 --- a/articles/page/2.html +++ b/articles/page/2.html @@ -22,7 +22,7 @@ - + @@ -45,7 +45,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 b99e37e5c7f..f3cf2f1e7b3 100644 --- a/articles/tags.html +++ b/articles/tags.html @@ -22,13 +22,13 @@ - +
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/tags/annoucement.html b/articles/tags/annoucement.html index cabbef4d149..3b25b1a1f2b 100644 --- a/articles/tags/annoucement.html +++ b/articles/tags/annoucement.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/tags/authentication.html b/articles/tags/authentication.html index 4c95f4c2bfa..c1b0a0593d3 100644 --- a/articles/tags/authentication.html +++ b/articles/tags/authentication.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 b39df59c1f6..8cf6e28a35d 100644 --- a/articles/tags/authorization.html +++ b/articles/tags/authorization.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 a9a55502450..c9349dcbd37 100644 --- a/articles/tags/automation.html +++ b/articles/tags/automation.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,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 41ce998f1a5..ac09cde5413 100644 --- a/articles/tags/browser-testing.html +++ b/articles/tags/browser-testing.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 1380c653ab8..65affa77624 100644 --- a/articles/tags/build.html +++ b/articles/tags/build.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 8fe29deb41f..909894b4a79 100644 --- a/articles/tags/ci-cd.html +++ b/articles/tags/ci-cd.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 e458a2d8526..84051628c9f 100644 --- a/articles/tags/docker.html +++ b/articles/tags/docker.html @@ -22,14 +22,14 @@ - +
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/tags/elixir.html b/articles/tags/elixir.html index 15c674dd720..23bccf3f2cf 100644 --- a/articles/tags/elixir.html +++ b/articles/tags/elixir.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 8cb7fb3c36c..c914a79b225 100644 --- a/articles/tags/how-to.html +++ b/articles/tags/how-to.html @@ -22,7 +22,7 @@ - + @@ -67,7 +67,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 9cef9df97a4..b2d63287e1d 100644 --- a/articles/tags/javascript.html +++ b/articles/tags/javascript.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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 547991b3ac2..47f9cf83d64 100644 --- a/articles/tags/jobs.html +++ b/articles/tags/jobs.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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 992c332d014..e9256e1bfe5 100644 --- a/articles/tags/js.html +++ b/articles/tags/js.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 3785fb66557..84b361d0e9d 100644 --- a/articles/tags/learning.html +++ b/articles/tags/learning.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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 ca919604820..63f6fbad626 100644 --- a/articles/tags/phoenix.html +++ b/articles/tags/phoenix.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 66064da810b..8f3ccbab692 100644 --- a/articles/tags/react.html +++ b/articles/tags/react.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 3dce78ea494..d6301a779ca 100644 --- a/articles/tags/security.html +++ b/articles/tags/security.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 3bce793d36f..bed64d39133 100644 --- a/articles/tags/solution.html +++ b/articles/tags/solution.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,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 dda63463f90..7fa6665bb7d 100644 --- a/articles/tags/testing.html +++ b/articles/tags/testing.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 7a6f22fafba..782334db3cb 100644 --- a/articles/tags/tips.html +++ b/articles/tags/tips.html @@ -22,7 +22,7 @@ - + @@ -68,7 +68,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 8b82f72aba0..3a472d67f5c 100644 --- a/articles/tags/tips/page/2.html +++ b/articles/tags/tips/page/2.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 affaf8abda2..c87cac311d8 100644 --- a/articles/tags/webpack.html +++ b/articles/tags/webpack.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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/fe36bf36.322752a6.js b/assets/js/fe36bf36.322752a6.js new file mode 100644 index 00000000000..29a6cdcc6eb --- /dev/null +++ b/assets/js/fe36bf36.322752a6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_openfn_docs=self.webpackChunk_openfn_docs||[]).push([[74986],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>g});var a=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(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||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=a.createContext({}),u=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=u(n),h=i,g=d["".concat(s,".").concat(h)]||d[h]||c[h]||r;return n?a.createElement(g,o(o({ref:t},p),{},{components:n})):a.createElement(g,o({ref:t},p))}));function g(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,o=new Array(r);o[0]=h;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:i,o[1]=l;for(var u=2;u{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>c,frontMatter:()=>r,metadata:()=>l,toc:()=>u});var a=n(87462),i=(n(67294),n(3905));const r={title:"Lightning (Beta)",sidebar_label:"Lightning"},o=void 0,l={unversionedId:"about-lightning",id:"version-legacy/about-lightning",title:"Lightning (Beta)",description:"Introducing Lightning",source:"@site/versioned_docs/version-legacy/about-lightning.md",sourceDirName:".",slug:"/about-lightning",permalink:"/documentation/about-lightning",draft:!1,editUrl:"https://github.com/openfn/docs/edit/main/versioned_docs/version-legacy/about-lightning.md",tags:[],version:"legacy",frontMatter:{title:"Lightning (Beta)",sidebar_label:"Lightning"},sidebar:"docs",previous:{title:"The Integration Toolkit",permalink:"/documentation/getting-started/integration-toolkit"},next:{title:"So, what is an integration? \ud83e\udd14",permalink:"/documentation/getting-started/so-you-want-to-integrate"}},s={},u=[{value:"Introducing Lightning",id:"introducing-lightning",level:2},{value:"Leveraging the tech powering the field-tested enterprise OpenFn platform...",id:"leveraging-the-tech-powering-the-field-tested-enterprise-openfn-platform",level:5},{value:"...and providing a fully open source web app with a user-friendly web interface.",id:"and-providing-a-fully-open-source-web-app-with-a-user-friendly-web-interface",level:5},{value:"Build",id:"build",level:3},{value:"Audit",id:"audit",level:3},{value:"Features",id:"features",level:2},{value:"General",id:"general",level:5},{value:"Workflow builder",id:"workflow-builder",level:5},{value:"Runs history",id:"runs-history",level:5},{value:"Project settings",id:"project-settings",level:5},{value:"Roadmap",id:"roadmap",level:2},{value:"Try it out",id:"try-it-out",level:2},{value:"Guiding principles",id:"guiding-principles",level:2},{value:"1. Standards and compliance matter",id:"1-standards-and-compliance-matter",level:3},{value:"2. Interoperability is an ongoing process",id:"2-interoperability-is-an-ongoing-process",level:3},{value:"3. Collaboration is key",id:"3-collaboration-is-key",level:3},{value:"4. It\u2019s not "just" a request or a piece of data, it\u2019s a person",id:"4-its-not-just-a-request-or-a-piece-of-data-its-a-person",level:3},{value:"Security",id:"security",level:2},{value:"Organizational security practices",id:"organizational-security-practices",level:3},{value:"DevSecOps",id:"devsecops",level:3},{value:"Roles and permissions",id:"roles-and-permissions",level:3},{value:"Application security",id:"application-security",level:3},{value:"Data residency",id:"data-residency",level:3},{value:"Implementation guidance and recommendations",id:"implementation-guidance-and-recommendations",level:3},{value:"Get involved",id:"get-involved",level:2},{value:"Lightning FAQ",id:"lightning-faq",level:2},{value:"I can see that Lightning was built recently, is it new? And if so, how can I trust it?",id:"i-can-see-that-lightning-was-built-recently-is-it-new-and-if-so-how-can-i-trust-it",level:4},{value:"If Lightning was built by open-sourcing code from the OpenFn platform, how is it different?",id:"if-lightning-was-built-by-open-sourcing-code-from-the-openfn-platform-how-is-it-different",level:4},{value:"Can I run anything from the OpenFn platform in Lightning?",id:"can-i-run-anything-from-the-openfn-platform-in-lightning",level:4},{value:"Who is Lightning for?",id:"who-is-lightning-for",level:4},{value:"What will I lose by switching from platform to Lightning?",id:"what-will-i-lose-by-switching-from-platform-to-lightning",level:4},{value:"When will Lightning Beta be ready?",id:"when-will-lightning-beta-be-ready",level:4}],p={toc:u},d="wrapper";function c(e){let{components:t,...r}=e;return(0,i.kt)(d,(0,a.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"introducing-lightning"},"Introducing Lightning"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/OpenFn/lightning/"},"OpenFn/Lightning")," is the v2 of the OpenFn\nintegration software: a ",(0,i.kt)("em",{parentName:"p"},"fully open source")," workflow automation platform\ndesigned for governments and NGOs who need a flexible solution to integrate and\nconnect ",(0,i.kt)("em",{parentName:"p"},"any system"),"."),(0,i.kt)("h5",{id:"leveraging-the-tech-powering-the-field-tested-enterprise-openfn-platform"},"Leveraging the tech powering the field-tested enterprise OpenFn platform..."),(0,i.kt)("p",null,"Lightning brings together the tried and tested technology which we have been\nusing since 2015 (the OpenFn\n",(0,i.kt)("a",{parentName:"p",href:"/documentation/getting-started/integration-toolkit"},"Integration Toolkit"),") to\nmanage the orchestration and execution of integrations in a stable, scalable and\nsecure way."),(0,i.kt)("h5",{id:"and-providing-a-fully-open-source-web-app-with-a-user-friendly-web-interface"},"...and providing a fully open source web app with a user-friendly web interface."),(0,i.kt)("p",null,"A fully open source web app, it can be deployed anywhere through Docker and\ncomes with a user-friendly, low-code interface with the full functionality\nneeded for organizations to build, run and audit their workflows all in one\nplace."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Lightning",src:n(56919).Z,width:"702",height:"307"})),(0,i.kt)("h3",{id:"build"},"Build"),(0,i.kt)("p",null,"Empower more users in your organization to have a say in what gets automated and\nhow. Lightning\u2019s visual interface makes workflows more intelligible to\nnon-technical users, bridging the gap between the IT specialists that build out\nautomations and program managers that are the real business/ program experts on\nthe processes that need automating."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Lightning build interface",src:n(96813).Z,width:"885",height:"729"})),(0,i.kt)("h3",{id:"audit"},"Audit"),(0,i.kt)("p",null,"Treat every workflow run with the care and attention it deserves. In OpenFn,\neach incoming request or transaction that gets processed is more than a piece of\ndata - it represents a vulnerable child in need of critical support, a farmer\nmanaging their savings to make sure they can afford the next harvest. Lightning\nprovides users with a dashboard that allows them to monitor the health of their\nintegrations to make sure no request goes unprocessed."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Lightning audit interface",src:n(32734).Z,width:"1434",height:"898"})),(0,i.kt)("h2",{id:"features"},"Features"),(0,i.kt)("h5",{id:"general"},"General"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Deploy Lightning via docker"),(0,i.kt)("li",{parentName:"ul"},"Create and delete user accounts"),(0,i.kt)("li",{parentName:"ul"},"Create new projects and assign users with different access levels to these\nprojects (owner/admin/editor/viewer)"),(0,i.kt)("li",{parentName:"ul"},"Transfer credential ownership to another user"),(0,i.kt)("li",{parentName:"ul"},"View an audit trail of all credential changes (superuser role)"),(0,i.kt)("li",{parentName:"ul"},"Set up SSO via an identity provider"),(0,i.kt)("li",{parentName:"ul"},"Generate and revoke API tokens"),(0,i.kt)("li",{parentName:"ul"},"List projects, jobs and runs via JSON API")),(0,i.kt)("h5",{id:"workflow-builder"},"Workflow builder"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Create a new workflow with a webhook or cron trigger"),(0,i.kt)("li",{parentName:"ul"},"Create and configure jobs for a workflow with any OpenFn adaptor and operation"),(0,i.kt)("li",{parentName:"ul"},"Create credentials through a form"),(0,i.kt)("li",{parentName:"ul"},"View all available operations for a given adaptor"),(0,i.kt)("li",{parentName:"ul"},"View the metadata from your external system (DHIS2 and Salesforce)"),(0,i.kt)("li",{parentName:"ul"},"View the input and output from the last run of each job in a workflow"),(0,i.kt)("li",{parentName:"ul"},"Run a job manually")),(0,i.kt)("h5",{id:"runs-history"},"Runs history"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"View all runs grouped by workflow"),(0,i.kt)("li",{parentName:"ul"},"Search and filter runs by status, workflow and run logs"),(0,i.kt)("li",{parentName:"ul"},"Retry a workflow run from the start (first job)")),(0,i.kt)("h5",{id:"project-settings"},"Project settings"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Get notified via email on run failure"),(0,i.kt)("li",{parentName:"ul"},"Receive a daily, weekly or monthly digest of project activity"),(0,i.kt)("li",{parentName:"ul"},"View collaborators for a project"),(0,i.kt)("li",{parentName:"ul"},"Update a project name and description")),(0,i.kt)("h2",{id:"roadmap"},"Roadmap"),(0,i.kt)("p",null,"See the ",(0,i.kt)("a",{parentName:"p",href:"/documentation/openfn-roadmap"},"Lightning Roadmap")," for a detailed list\nof features that are in the backlog, planned, and/or in development for the\nOpenFn Digital Public Good."),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"You can follow our progress and track delivered features in our\n",(0,i.kt)("a",{parentName:"em",href:"https://github.com/OpenFn/Lightning/blob/main/CHANGELOG.md"},"changelog"),".")),(0,i.kt)("h2",{id:"try-it-out"},"Try it out"),(0,i.kt)("admonition",{title:"Please note",type:"danger"},(0,i.kt)("p",{parentName:"admonition"},"Lightning is still in Beta. Full release planned for Q4 2023.")),(0,i.kt)("p",null,"You have 3 options for exploring OpenFn/Lightning:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"For quick viewing, visit ",(0,i.kt)("a",{parentName:"li",href:"https://demo.openfn.org/"},"demo.openfn.org")," and log\ninto our demo account with username: ",(0,i.kt)("inlineCode",{parentName:"li"},"demo@openfn.org")," password:\n",(0,i.kt)("inlineCode",{parentName:"li"},"welcome123"),". (NOTE that any changes made here are lost when the demo resets\nevery 24 hours. I.e., don't build things you'd like to keep.)"),(0,i.kt)("li",{parentName:"ol"},"To get your own account and start building non-production workflows, register\nfor an account at ",(0,i.kt)("a",{parentName:"li",href:"https://app.openfn.org/"},"app.openfn.org"),"."),(0,i.kt)("li",{parentName:"ol"},"To install and run Lightning locally follow the instructions in the\n",(0,i.kt)("a",{parentName:"li",href:"https://github.com/OpenFn/Lightning"},"github README"),".")),(0,i.kt)("p",null,"Go through the\n",(0,i.kt)("a",{parentName:"p",href:"/blog/2023/04/13/lightning-beta#take-15-minutes-to-carry-out-our-user-test"},"self-paced user interview"),"\nto learn how OpenFn Lightning works ",(0,i.kt)("em",{parentName:"p"},"and")," help us out with feedback in just 15\nminutes."),(0,i.kt)("h2",{id:"guiding-principles"},"Guiding principles"),(0,i.kt)("p",null,"Lightning is developed in line with the\n",(0,i.kt)("a",{parentName:"p",href:"https://digitalprinciples.org/principles/"},"principles for digital development"),"\nand under the guidance of it's Open Source Steering Committee which you can read\nabout ",(0,i.kt)("a",{parentName:"p",href:"https://openfn.github.io/governance/OSSC.html"},"here"),"."),(0,i.kt)("p",null,"On top of this, Lightning follows 4 key principles which determine how it should\nbe developed:"),(0,i.kt)("h3",{id:"1-standards-and-compliance-matter"},"1. Standards and compliance matter"),(0,i.kt)("p",null,"Lightning is part of the OpenFn Integration Toolkit which is a certified Digital\nPublic Good. It is fully open source and even has an Open Source Steering\nCommittee to make sure our users can influence the roadmap."),(0,i.kt)("p",null,"Lightning workflows can be used to automatically enforce and apply data exchange\nstandards, such as FHIR and ADX. Lightning's design and roadmap are driven by\nopen standards, and will therefore provide a GovStack- and OpenHIE-compliant\nworkflow engine. Learn more via the following resources:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://youtu.be/PTRRZBYtqyc"},"Watch this video")," to learn how OpenFn is an\nOpenHIE-compliant workflow engine."),(0,i.kt)("li",{parentName:"ul"},"Check out OpenFn's entry in the\n",(0,i.kt)("a",{parentName:"li",href:"https://wiki.ohie.org/display/documents/Reference+Technologies"},"OpenHIE Reference Technologies page"),"."),(0,i.kt)("li",{parentName:"ul"},"Explore the OpenFn-Instant OpenHIE\n",(0,i.kt)("a",{parentName:"li",href:"/documentation/instant-openhie"},"reference demo implementation"),"."),(0,i.kt)("li",{parentName:"ul"},"Learn more about the GovStack\n",(0,i.kt)("a",{parentName:"li",href:"https://govstack.gitbook.io/bb-workflow/2-description"},"Workflow Building Block"),"\nspecification.")),(0,i.kt)("h3",{id:"2-interoperability-is-an-ongoing-process"},"2. Interoperability is an ongoing process"),(0,i.kt)("p",null,"Anyone that has worked on integration projects in the past is well aware that\nintegrations do break. No matter how well designed they are, the fact is that\n",(0,i.kt)("strong",{parentName:"p"},"they connect multiple systems that all change over time"),": new API versions\nget released, data models change, IDs, codes and mappings change, data standards\nare updated and the processes themselves evolve. This is why Lightning will\ninclude:"),(0,i.kt)("p",null,"Enhanced testing and debugging:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Save data from workflow runs as test data for robust workflow testing of edge\ncases"),(0,i.kt)("li",{parentName:"ul"},"View the input and output for each step in a workflow to easily identify where\nan error occurred"),(0,i.kt)("li",{parentName:"ul"},"Throw custom errors to improve API messages (adaptors)"),(0,i.kt)("li",{parentName:"ul"},"Add custom logic to handle a workflow step failure (fail triggers)")),(0,i.kt)("p",null,"First of class monitoring:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Get notified on run failures"),(0,i.kt)("li",{parentName:"ul"},"View the status of every run"),(0,i.kt)("li",{parentName:"ul"},"Search workflow runs by input/output data and logs"),(0,i.kt)("li",{parentName:"ul"},"Filter workflow runs by status, workflow name and date")),(0,i.kt)("p",null,"Re-processing functionality:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Bulk reprocess workflow runs after updating workflow steps to course-correct\nif a workflow has been running with flawed logic")),(0,i.kt)("h3",{id:"3-collaboration-is-key"},"3. Collaboration is key"),(0,i.kt)("p",null,"On one hand, the users that understand what processes need automating are (more\noften than not) business analysts, not developers. They\u2019re the experts on what\nneeds to happen when and where, and they\u2019re very capable of planning out\nintegrations and putting together mapping specifications and bpmn flows."),(0,i.kt)("p",null,"On the other hand, integrations often require custom logic that cannot be\nsimplified through low-code and therefore must be implemented by software\nengineers."),(0,i.kt)("p",null,"That\u2019s why ",(0,i.kt)("strong",{parentName:"p"},"the best integrations are built when non-technical users and\ndevelopers collaborate"),". Lightning is being developed to bridge the gap between\nnon-technical and technical users through:"),(0,i.kt)("p",null,"Intuitive, user-friendly user interface for non-technical users:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Understand a workflow in a visual, human-readable format (abstract away from\ncode to make workflows understandable to non-technical users)"),(0,i.kt)("li",{parentName:"ul"},"Build credentials through a form interface (remove the need to read through\nconfusing API documentation)"),(0,i.kt)("li",{parentName:"ul"},"Build API requests through a form interface"),(0,i.kt)("li",{parentName:"ul"},"Save mappings used in workflows as constants so they can be easily viewed and\nedited without needing to read code"),(0,i.kt)("li",{parentName:"ul"},"Clear documentation for users to learn how to plan and build integrations")),(0,i.kt)("p",null,"Projects-as-code and CLI for a developer interface:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Export, import and configure projects as code in the code editor of your\nchoice"),(0,i.kt)("li",{parentName:"ul"},"Run, test and deploy projects through a command line interface"),(0,i.kt)("li",{parentName:"ul"},"Review and track changes through version control")),(0,i.kt)("p",null,"Collaboration functionality:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Track changes through version control"),(0,i.kt)("li",{parentName:"ul"},"Rollback to a previous version"),(0,i.kt)("li",{parentName:"ul"},"Get notified when a workflow is changed"),(0,i.kt)("li",{parentName:"ul"},"Share a link to a specific workflow error on the runs history page"),(0,i.kt)("li",{parentName:"ul"},"Share a link to a specific workflow step within the builder"),(0,i.kt)("li",{parentName:"ul"},"Add collaborators as view-only user or editor to a project"),(0,i.kt)("li",{parentName:"ul"},"Audit all changes made to credentials")),(0,i.kt)("h3",{id:"4-its-not-just-a-request-or-a-piece-of-data-its-a-person"},'4. It\u2019s not "just" a request or a piece of data, it\u2019s a person'),(0,i.kt)("p",null,"OpenFn specializes in integration tooling for the health and humanitarian\nsector. This means that behind every piece of data which comes in through a\nrequest lies a person in need of critical services. This is why Lightning\nfocusses on:"),(0,i.kt)("p",null,"Accountability:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Credential audit trail"),(0,i.kt)("li",{parentName:"ul"},"Version control")),(0,i.kt)("p",null,"Security:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Secure credential management (encrypted at REST, credential secrets are\nscrubbed from logs, secure credential sharing"),(0,i.kt)("li",{parentName:"ul"},"Zero-retention pipelines"),(0,i.kt)("li",{parentName:"ul"},"Role-based project access"),(0,i.kt)("li",{parentName:"ul"},"Additional authentication rules for webhooks")),(0,i.kt)("h2",{id:"security"},"Security"),(0,i.kt)("p",null,"OpenFn treats security as a top priority, and is trusted to handle information\nof the most sensitive nature (for example UNICEF\u2019s child case data)."),(0,i.kt)("p",null,"To increase transparency and accountability around security, as well to help\nother digital public goods think through key aspects of their own organizations\u2019\nsecurity postures, below is a list of the ",(0,i.kt)("strong",{parentName:"p"},"key aspects of our own security\nprogram"),"."),(0,i.kt)("h3",{id:"organizational-security-practices"},"Organizational security practices"),(0,i.kt)("p",null,"To ensure a positive security posture at OpenFn, we:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Conduct Employee IT security onboarding training & policy"),(0,i.kt)("li",{parentName:"ul"},"Run monthly security standups with the whole team"),(0,i.kt)("li",{parentName:"ul"},"Conduct an annual security review informed by the OWASP ASVS")),(0,i.kt)("h3",{id:"devsecops"},"DevSecOps"),(0,i.kt)("p",null,"To ensure best practices in our code we:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Monitor dependency vulnerabilities via Github\u2019s\n",(0,i.kt)("a",{parentName:"li",href:"https://github.com/features/security"},"dependabot")),(0,i.kt)("li",{parentName:"ul"},"Perform static code analysis on each commit with\n",(0,i.kt)("a",{parentName:"li",href:"https://sobelow.io/"},"Sobelow")),(0,i.kt)("li",{parentName:"ul"},"Ensure code is clean and standardised through preflight checks"),(0,i.kt)("li",{parentName:"ul"},"Monitor code coverage of unit tests and integration tests with Codecov")),(0,i.kt)("h3",{id:"roles-and-permissions"},"Roles and permissions"),(0,i.kt)("p",null,"Lightning provides identity and access management for users via various roles\nand permissions which determine what level of access they have for resources\nacross projects and instances (i.e., deployments)."),(0,i.kt)("p",null,"Lightning has 2 types of access levels:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Instance-wide access levels are managed via an attribute on the ",(0,i.kt)("inlineCode",{parentName:"li"},"user"),"\nobject:")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Superusers")," are the administrator of the Lightning instance. They can\nmanage projects and users, configure authentication providers and view the\naudit trail."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Users")," are normal Lightning users. They can manage their own account and\ncredentials, and have access to projects they are added to.")),(0,i.kt)("ol",{start:2},(0,i.kt)("li",{parentName:"ol"},"Project-wide access levels")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"A project ",(0,i.kt)("strong",{parentName:"li"},"viewer")," can view the resources of a project in read-only mode and\nconfigure their own project digest and failure alerts."),(0,i.kt)("li",{parentName:"ul"},"A project ",(0,i.kt)("strong",{parentName:"li"},"editor")," can view, create and edit the jobs and workflows of a\nproject they have access to, as well as run and rerun jobs."),(0,i.kt)("li",{parentName:"ul"},"A project ",(0,i.kt)("strong",{parentName:"li"},"admin")," has administration access to project members. They can\nedit the name and description as well as delete a project."),(0,i.kt)("li",{parentName:"ul"},"A project ",(0,i.kt)("strong",{parentName:"li"},"owner")," can delete a project.")),(0,i.kt)("h3",{id:"application-security"},"Application security"),(0,i.kt)("p",null,"Lightning is designed to:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Scrub credential data from run logs"),(0,i.kt)("li",{parentName:"ul"},"Encrypt credentials at REST"),(0,i.kt)("li",{parentName:"ul"},"Track credential changes through an audit trail"),(0,i.kt)("li",{parentName:"ul"},"Encrypt passwords"),(0,i.kt)("li",{parentName:"ul"},"Enforce access controls with deny by default"),(0,i.kt)("li",{parentName:"ul"},"Allow users to differentiate between staging and production credentials"),(0,i.kt)("li",{parentName:"ul"},"Enable secure credential transfer across users"),(0,i.kt)("li",{parentName:"ul"},"Purge credentials and user data on account deletion"),(0,i.kt)("li",{parentName:"ul"},"Allow administrators to configure SSO through an identity provider")),(0,i.kt)("h3",{id:"data-residency"},"Data residency"),(0,i.kt)("p",null,"OpenFn Lightning is fully open source and can be deployed in any country. We\noffer high-availability managed deployments that are localized to any GCP or AWS\nlocation\u2014guaranteeing that no data ever leaves the selected country."),(0,i.kt)("h3",{id:"implementation-guidance-and-recommendations"},"Implementation guidance and recommendations"),(0,i.kt)("p",null,"To help our users adopt best practices when it comes to the design of their\nintegrations, we\u2019ve published a\n",(0,i.kt)("a",{parentName:"p",href:"/documentation/getting-started/security"},"Security Guidebook for data integration implementations"),"."),(0,i.kt)("h2",{id:"get-involved"},"Get involved"),(0,i.kt)("p",null,"We are building out in the open, follow our progress on\n",(0,i.kt)("a",{parentName:"p",href:"https://github.com/OpenFn/lightning"},"Github")," by clicking \u2018Watch\u2019 to track\nupdates and new releases. Ongoing discussions with our Open Source Steering\nCommittee about Lightning are documented on our\n",(0,i.kt)("a",{parentName:"p",href:"https://community.openfn.org/c/ossc/15"},"community forum"),". Your feedback and\ncomments are welcome there. If you would like to become a beta user or learn\nmore about Lightning, book in a call with our product manager here:\n",(0,i.kt)("a",{parentName:"p",href:"https://calendly.com/amber-openfn/short-call"},"https://calendly.com/amber-openfn/short-call"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Lightning preview",src:n(66070).Z,width:"960",height:"540"})),(0,i.kt)("h2",{id:"lightning-faq"},"Lightning FAQ"),(0,i.kt)("h4",{id:"i-can-see-that-lightning-was-built-recently-is-it-new-and-if-so-how-can-i-trust-it"},"I can see that Lightning was built recently, is it new? And if so, how can I trust it?"),(0,i.kt)("p",null,"The Lightning repository may be new, but the technology isn\u2019t. We\u2019ve built out\nLightning by porting the tried and tested code from our proprietary platform. In\nother words, Lightning is built with code that has been used in production by\ngovernments and NGOs since 2015 and already handles tens of millions of\ntransactions a year. Software becomes more robust over time - the more it\u2019s\nused, the more edge cases are uncovered and bugs fixed. Over the past 7 years,\nevery time a bug has come up in our platform, we\u2019ve fixed it and added a test\nfor it. By bringing over the same tests from platform to Lightning, we\u2019re\nessentially guaranteeing the same level of robustness by taking into account\nevery single edge case or bug that we have ever encountered."),(0,i.kt)("h4",{id:"if-lightning-was-built-by-open-sourcing-code-from-the-openfn-platform-how-is-it-different"},"If Lightning was built by open-sourcing code from the OpenFn platform, how is it different?"),(0,i.kt)("p",null,"Under the hood, Lightning is the same as the OpenFn platform. Integrations are\nmade up of the same building blocks of triggers, adaptors and job expressions;\nrequests are executed, retried and reprocessed in exactly the same way."),(0,i.kt)("p",null,"What changes in Lightning is how users ",(0,i.kt)("em",{parentName:"p"},"build and monitor")," their integrations."),(0,i.kt)("h4",{id:"can-i-run-anything-from-the-openfn-platform-in-lightning"},"Can I run anything from the OpenFn platform in Lightning?"),(0,i.kt)("p",null,"Yes, integrations built out on the OpenFn platform are fully compatible with\nLightning."),(0,i.kt)("h4",{id:"who-is-lightning-for"},"Who is Lightning for?"),(0,i.kt)("p",null,"Lightning is for anyone in the government or NGO space that needs to integrate\ndifferent systems."),(0,i.kt)("h4",{id:"what-will-i-lose-by-switching-from-platform-to-lightning"},"What will I lose by switching from platform to Lightning?"),(0,i.kt)("p",null,"Right now: version control, authentication rules on webhooks, and the other\nfeatures in our roadmap (we\u2019re still in beta)."),(0,i.kt)("p",null,"Later: nothing - if a feature has proven important to our platform users, it\nwill be available in Lightning. If there is any feature you require in Lightning\nto be able to switch over to it, speak up! You can reach out to our team via the\n",(0,i.kt)("a",{parentName:"p",href:"https://community.openfn.org/"},"OpenFn Community"),"."),(0,i.kt)("h4",{id:"when-will-lightning-beta-be-ready"},"When will Lightning Beta be ready?"),(0,i.kt)("p",null,"Lightning is currently in Beta. You can register for an account on\n",(0,i.kt)("a",{parentName:"p",href:"https://app.openfn.org/"},"app.openfn.org"),". Lightning will be released\nin Q4 2023."))}c.isMDXComponent=!0},32734:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/lightning_audit-3ecad9c86dc91480cdb784ad4f03e297.png"},96813:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/lightning_build-647b9f0fb320532fb89efbe021072612.png"},56919:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/lightning_build_run_audit-dc67705b19e28d302e0adcc3cf79e2a1.png"},66070:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/lightning_preview-e305632545af55695045469f7d6eb4a3.png"}}]); \ No newline at end of file diff --git a/assets/js/fe36bf36.d171ca39.js b/assets/js/fe36bf36.d171ca39.js deleted file mode 100644 index d548c5493a2..00000000000 --- a/assets/js/fe36bf36.d171ca39.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_openfn_docs=self.webpackChunk_openfn_docs||[]).push([[74986],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>g});var a=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(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||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=a.createContext({}),u=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},d="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},h=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=u(n),h=i,g=d["".concat(s,".").concat(h)]||d[h]||c[h]||r;return n?a.createElement(g,o(o({ref:t},p),{},{components:n})):a.createElement(g,o({ref:t},p))}));function g(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,o=new Array(r);o[0]=h;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[d]="string"==typeof e?e:i,o[1]=l;for(var u=2;u{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>o,default:()=>c,frontMatter:()=>r,metadata:()=>l,toc:()=>u});var a=n(87462),i=(n(67294),n(3905));const r={title:"Lightning (Beta)",sidebar_label:"Lightning"},o=void 0,l={unversionedId:"about-lightning",id:"version-legacy/about-lightning",title:"Lightning (Beta)",description:"Introducing Lightning",source:"@site/versioned_docs/version-legacy/about-lightning.md",sourceDirName:".",slug:"/about-lightning",permalink:"/documentation/about-lightning",draft:!1,editUrl:"https://github.com/openfn/docs/edit/main/versioned_docs/version-legacy/about-lightning.md",tags:[],version:"legacy",frontMatter:{title:"Lightning (Beta)",sidebar_label:"Lightning"},sidebar:"docs",previous:{title:"The Integration Toolkit",permalink:"/documentation/getting-started/integration-toolkit"},next:{title:"So, what is an integration? \ud83e\udd14",permalink:"/documentation/getting-started/so-you-want-to-integrate"}},s={},u=[{value:"Introducing Lightning",id:"introducing-lightning",level:2},{value:"Leveraging the tech powering the field-tested enterprise OpenFn platform...",id:"leveraging-the-tech-powering-the-field-tested-enterprise-openfn-platform",level:5},{value:"...and providing a fully open source web app with a user-friendly web interface.",id:"and-providing-a-fully-open-source-web-app-with-a-user-friendly-web-interface",level:5},{value:"Build",id:"build",level:3},{value:"Audit",id:"audit",level:3},{value:"Features",id:"features",level:2},{value:"General",id:"general",level:5},{value:"Workflow builder",id:"workflow-builder",level:5},{value:"Runs history",id:"runs-history",level:5},{value:"Project settings",id:"project-settings",level:5},{value:"Roadmap",id:"roadmap",level:2},{value:"Try it out",id:"try-it-out",level:2},{value:"Guiding principles",id:"guiding-principles",level:2},{value:"1. Standards and compliance matter",id:"1-standards-and-compliance-matter",level:3},{value:"2. Interoperability is an ongoing process",id:"2-interoperability-is-an-ongoing-process",level:3},{value:"3. Collaboration is key",id:"3-collaboration-is-key",level:3},{value:"4. It\u2019s not "just" a request or a piece of data, it\u2019s a person",id:"4-its-not-just-a-request-or-a-piece-of-data-its-a-person",level:3},{value:"Security",id:"security",level:2},{value:"Organizational security practices",id:"organizational-security-practices",level:3},{value:"DevSecOps",id:"devsecops",level:3},{value:"Roles and permissions",id:"roles-and-permissions",level:3},{value:"Application security",id:"application-security",level:3},{value:"Data residency",id:"data-residency",level:3},{value:"Implementation guidance and recommendations",id:"implementation-guidance-and-recommendations",level:3},{value:"Get involved",id:"get-involved",level:2},{value:"Lightning FAQ",id:"lightning-faq",level:2},{value:"I can see that Lightning was built recently, is it new? And if so, how can I trust it?",id:"i-can-see-that-lightning-was-built-recently-is-it-new-and-if-so-how-can-i-trust-it",level:4},{value:"If Lightning was built by open-sourcing code from the OpenFn platform, how is it different?",id:"if-lightning-was-built-by-open-sourcing-code-from-the-openfn-platform-how-is-it-different",level:4},{value:"Can I run anything from the OpenFn platform in Lightning?",id:"can-i-run-anything-from-the-openfn-platform-in-lightning",level:4},{value:"Who is Lightning for?",id:"who-is-lightning-for",level:4},{value:"What will I lose by switching from platform to Lightning?",id:"what-will-i-lose-by-switching-from-platform-to-lightning",level:4},{value:"When will Lightning Beta be ready?",id:"when-will-lightning-beta-be-ready",level:4}],p={toc:u},d="wrapper";function c(e){let{components:t,...r}=e;return(0,i.kt)(d,(0,a.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"introducing-lightning"},"Introducing Lightning"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/OpenFn/lightning/"},"OpenFn/Lightning")," is the v2 of the OpenFn\nintegration software: a ",(0,i.kt)("em",{parentName:"p"},"fully open source")," workflow automation platform\ndesigned for governments and NGOs who need a flexible solution to integrate and\nconnect ",(0,i.kt)("em",{parentName:"p"},"any system"),"."),(0,i.kt)("h5",{id:"leveraging-the-tech-powering-the-field-tested-enterprise-openfn-platform"},"Leveraging the tech powering the field-tested enterprise OpenFn platform..."),(0,i.kt)("p",null,"Lightning brings together the tried and tested technology which we have been\nusing since 2015 (the OpenFn\n",(0,i.kt)("a",{parentName:"p",href:"/documentation/getting-started/integration-toolkit"},"Integration Toolkit"),") to\nmanage the orchestration and execution of integrations in a stable, scalable and\nsecure way."),(0,i.kt)("h5",{id:"and-providing-a-fully-open-source-web-app-with-a-user-friendly-web-interface"},"...and providing a fully open source web app with a user-friendly web interface."),(0,i.kt)("p",null,"A fully open source web app, it can be deployed anywhere through Docker and\ncomes with a user-friendly, low-code interface with the full functionality\nneeded for organizations to build, run and audit their workflows all in one\nplace."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Lightning",src:n(56919).Z,width:"702",height:"307"})),(0,i.kt)("h3",{id:"build"},"Build"),(0,i.kt)("p",null,"Empower more users in your organization to have a say in what gets automated and\nhow. Lightning\u2019s visual interface makes workflows more intelligible to\nnon-technical users, bridging the gap between the IT specialists that build out\nautomations and program managers that are the real business/ program experts on\nthe processes that need automating."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Lightning build interface",src:n(96813).Z,width:"885",height:"729"})),(0,i.kt)("h3",{id:"audit"},"Audit"),(0,i.kt)("p",null,"Treat every workflow run with the care and attention it deserves. In OpenFn,\neach incoming request or transaction that gets processed is more than a piece of\ndata - it represents a vulnerable child in need of critical support, a farmer\nmanaging their savings to make sure they can afford the next harvest. Lightning\nprovides users with a dashboard that allows them to monitor the health of their\nintegrations to make sure no request goes unprocessed."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Lightning audit interface",src:n(32734).Z,width:"1434",height:"898"})),(0,i.kt)("h2",{id:"features"},"Features"),(0,i.kt)("h5",{id:"general"},"General"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Deploy Lightning via docker"),(0,i.kt)("li",{parentName:"ul"},"Create and delete user accounts"),(0,i.kt)("li",{parentName:"ul"},"Create new projects and assign users with different access levels to these\nprojects (owner/admin/editor/viewer)"),(0,i.kt)("li",{parentName:"ul"},"Transfer credential ownership to another user"),(0,i.kt)("li",{parentName:"ul"},"View an audit trail of all credential changes (superuser role)"),(0,i.kt)("li",{parentName:"ul"},"Set up SSO via an identity provider"),(0,i.kt)("li",{parentName:"ul"},"Generate and revoke API tokens"),(0,i.kt)("li",{parentName:"ul"},"List projects, jobs and runs via JSON API")),(0,i.kt)("h5",{id:"workflow-builder"},"Workflow builder"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Create a new workflow with a webhook or cron trigger"),(0,i.kt)("li",{parentName:"ul"},"Create and configure jobs for a workflow with any OpenFn adaptor and operation"),(0,i.kt)("li",{parentName:"ul"},"Create credentials through a form"),(0,i.kt)("li",{parentName:"ul"},"View all available operations for a given adaptor"),(0,i.kt)("li",{parentName:"ul"},"View the metadata from your external system (DHIS2 and Salesforce)"),(0,i.kt)("li",{parentName:"ul"},"View the input and output from the last run of each job in a workflow"),(0,i.kt)("li",{parentName:"ul"},"Run a job manually")),(0,i.kt)("h5",{id:"runs-history"},"Runs history"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"View all runs grouped by workflow"),(0,i.kt)("li",{parentName:"ul"},"Search and filter runs by status, workflow and run logs"),(0,i.kt)("li",{parentName:"ul"},"Retry a workflow run from the start (first job)")),(0,i.kt)("h5",{id:"project-settings"},"Project settings"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Get notified via email on run failure"),(0,i.kt)("li",{parentName:"ul"},"Receive a daily, weekly or monthly digest of project activity"),(0,i.kt)("li",{parentName:"ul"},"View collaborators for a project"),(0,i.kt)("li",{parentName:"ul"},"Update a project name and description")),(0,i.kt)("h2",{id:"roadmap"},"Roadmap"),(0,i.kt)("p",null,"See the ",(0,i.kt)("a",{parentName:"p",href:"/documentation/openfn-roadmap"},"Lightning Roadmap")," for a detailed list\nof features that are in the backlog, planned, and/or in development for the\nOpenFn Digital Public Good."),(0,i.kt)("p",null,(0,i.kt)("em",{parentName:"p"},"You can follow our progress and track delivered features in our\n",(0,i.kt)("a",{parentName:"em",href:"https://github.com/OpenFn/Lightning/blob/main/CHANGELOG.md"},"changelog"),".")),(0,i.kt)("h2",{id:"try-it-out"},"Try it out"),(0,i.kt)("admonition",{title:"Please note",type:"danger"},(0,i.kt)("p",{parentName:"admonition"},"Lightning is still in Beta.")),(0,i.kt)("p",null,"You have 3 options for exploring OpenFn/Lightning:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"For quick viewing, visit ",(0,i.kt)("a",{parentName:"li",href:"https://demo.openfn.org/"},"demo.openfn.org")," and log\ninto our demo account with username: ",(0,i.kt)("inlineCode",{parentName:"li"},"demo@openfn.org")," password:\n",(0,i.kt)("inlineCode",{parentName:"li"},"welcome123"),". (NOTE that any changes made here are lost when the demo resets\nevery 24 hours. I.e., don't build things you'd like to keep.)"),(0,i.kt)("li",{parentName:"ol"},"To get your own account and start building non-production workflows, register\nfor an account at ",(0,i.kt)("a",{parentName:"li",href:"https://app.openfn.org/"},"app.openfn.org"),"."),(0,i.kt)("li",{parentName:"ol"},"To install and run Lightning locally follow the instructions in the\n",(0,i.kt)("a",{parentName:"li",href:"https://github.com/OpenFn/Lightning"},"github README"),".")),(0,i.kt)("p",null,"Go through the\n",(0,i.kt)("a",{parentName:"p",href:"/blog/2023/04/13/lightning-beta#take-15-minutes-to-carry-out-our-user-test"},"self-paced user interview"),"\nto learn how OpenFn Lightning works ",(0,i.kt)("em",{parentName:"p"},"and")," help us out with feedback in just 15\nminutes."),(0,i.kt)("h2",{id:"guiding-principles"},"Guiding principles"),(0,i.kt)("p",null,"Lightning is developed in line with the\n",(0,i.kt)("a",{parentName:"p",href:"https://digitalprinciples.org/principles/"},"principles for digital development"),"\nand under the guidance of it's Open Source Steering Committee which you can read\nabout ",(0,i.kt)("a",{parentName:"p",href:"https://openfn.github.io/governance/OSSC.html"},"here"),"."),(0,i.kt)("p",null,"On top of this, Lightning follows 4 key principles which determine how it should\nbe developed:"),(0,i.kt)("h3",{id:"1-standards-and-compliance-matter"},"1. Standards and compliance matter"),(0,i.kt)("p",null,"Lightning is part of the OpenFn Integration Toolkit which is a certified Digital\nPublic Good. It is fully open source and even has an Open Source Steering\nCommittee to make sure our users can influence the roadmap."),(0,i.kt)("p",null,"Lightning workflows can be used to automatically enforce and apply data exchange\nstandards, such as FHIR and ADX. Lightning's design and roadmap are driven by\nopen standards, and will therefore provide a GovStack- and OpenHIE-compliant\nworkflow engine. Learn more via the following resources:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"https://youtu.be/PTRRZBYtqyc"},"Watch this video")," to learn how OpenFn is an\nOpenHIE-compliant workflow engine."),(0,i.kt)("li",{parentName:"ul"},"Check out OpenFn's entry in the\n",(0,i.kt)("a",{parentName:"li",href:"https://wiki.ohie.org/display/documents/Reference+Technologies"},"OpenHIE Reference Technologies page"),"."),(0,i.kt)("li",{parentName:"ul"},"Explore the OpenFn-Instant OpenHIE\n",(0,i.kt)("a",{parentName:"li",href:"/documentation/instant-openhie"},"reference demo implementation"),"."),(0,i.kt)("li",{parentName:"ul"},"Learn more about the GovStack\n",(0,i.kt)("a",{parentName:"li",href:"https://govstack.gitbook.io/bb-workflow/2-description"},"Workflow Building Block"),"\nspecification.")),(0,i.kt)("h3",{id:"2-interoperability-is-an-ongoing-process"},"2. Interoperability is an ongoing process"),(0,i.kt)("p",null,"Anyone that has worked on integration projects in the past is well aware that\nintegrations do break. No matter how well designed they are, the fact is that\n",(0,i.kt)("strong",{parentName:"p"},"they connect multiple systems that all change over time"),": new API versions\nget released, data models change, IDs, codes and mappings change, data standards\nare updated and the processes themselves evolve. This is why Lightning will\ninclude:"),(0,i.kt)("p",null,"Enhanced testing and debugging:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Save data from workflow runs as test data for robust workflow testing of edge\ncases"),(0,i.kt)("li",{parentName:"ul"},"View the input and output for each step in a workflow to easily identify where\nan error occurred"),(0,i.kt)("li",{parentName:"ul"},"Throw custom errors to improve API messages (adaptors)"),(0,i.kt)("li",{parentName:"ul"},"Add custom logic to handle a workflow step failure (fail triggers)")),(0,i.kt)("p",null,"First of class monitoring:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Get notified on run failures"),(0,i.kt)("li",{parentName:"ul"},"View the status of every run"),(0,i.kt)("li",{parentName:"ul"},"Search workflow runs by input/output data and logs"),(0,i.kt)("li",{parentName:"ul"},"Filter workflow runs by status, workflow name and date")),(0,i.kt)("p",null,"Re-processing functionality:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Bulk reprocess workflow runs after updating workflow steps to course-correct\nif a workflow has been running with flawed logic")),(0,i.kt)("h3",{id:"3-collaboration-is-key"},"3. Collaboration is key"),(0,i.kt)("p",null,"On one hand, the users that understand what processes need automating are (more\noften than not) business analysts, not developers. They\u2019re the experts on what\nneeds to happen when and where, and they\u2019re very capable of planning out\nintegrations and putting together mapping specifications and bpmn flows."),(0,i.kt)("p",null,"On the other hand, integrations often require custom logic that cannot be\nsimplified through low-code and therefore must be implemented by software\nengineers."),(0,i.kt)("p",null,"That\u2019s why ",(0,i.kt)("strong",{parentName:"p"},"the best integrations are built when non-technical users and\ndevelopers collaborate"),". Lightning is being developed to bridge the gap between\nnon-technical and technical users through:"),(0,i.kt)("p",null,"Intuitive, user-friendly user interface for non-technical users:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Understand a workflow in a visual, human-readable format (abstract away from\ncode to make workflows understandable to non-technical users)"),(0,i.kt)("li",{parentName:"ul"},"Build credentials through a form interface (remove the need to read through\nconfusing API documentation)"),(0,i.kt)("li",{parentName:"ul"},"Build API requests through a form interface"),(0,i.kt)("li",{parentName:"ul"},"Save mappings used in workflows as constants so they can be easily viewed and\nedited without needing to read code"),(0,i.kt)("li",{parentName:"ul"},"Clear documentation for users to learn how to plan and build integrations")),(0,i.kt)("p",null,"Projects-as-code and CLI for a developer interface:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Export, import and configure projects as code in the code editor of your\nchoice"),(0,i.kt)("li",{parentName:"ul"},"Run, test and deploy projects through a command line interface"),(0,i.kt)("li",{parentName:"ul"},"Review and track changes through version control")),(0,i.kt)("p",null,"Collaboration functionality:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Track changes through version control"),(0,i.kt)("li",{parentName:"ul"},"Rollback to a previous version"),(0,i.kt)("li",{parentName:"ul"},"Get notified when a workflow is changed"),(0,i.kt)("li",{parentName:"ul"},"Share a link to a specific workflow error on the runs history page"),(0,i.kt)("li",{parentName:"ul"},"Share a link to a specific workflow step within the builder"),(0,i.kt)("li",{parentName:"ul"},"Add collaborators as view-only user or editor to a project"),(0,i.kt)("li",{parentName:"ul"},"Audit all changes made to credentials")),(0,i.kt)("h3",{id:"4-its-not-just-a-request-or-a-piece-of-data-its-a-person"},'4. It\u2019s not "just" a request or a piece of data, it\u2019s a person'),(0,i.kt)("p",null,"OpenFn specializes in integration tooling for the health and humanitarian\nsector. This means that behind every piece of data which comes in through a\nrequest lies a person in need of critical services. This is why Lightning\nfocusses on:"),(0,i.kt)("p",null,"Accountability:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Credential audit trail"),(0,i.kt)("li",{parentName:"ul"},"Version control")),(0,i.kt)("p",null,"Security:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Secure credential management (encrypted at REST, credential secrets are\nscrubbed from logs, secure credential sharing"),(0,i.kt)("li",{parentName:"ul"},"Zero-retention pipelines"),(0,i.kt)("li",{parentName:"ul"},"Role-based project access"),(0,i.kt)("li",{parentName:"ul"},"Additional authentication rules for webhooks")),(0,i.kt)("h2",{id:"security"},"Security"),(0,i.kt)("p",null,"OpenFn treats security as a top priority, and is trusted to handle information\nof the most sensitive nature (for example UNICEF\u2019s child case data)."),(0,i.kt)("p",null,"To increase transparency and accountability around security, as well to help\nother digital public goods think through key aspects of their own organizations\u2019\nsecurity postures, below is a list of the ",(0,i.kt)("strong",{parentName:"p"},"key aspects of our own security\nprogram"),"."),(0,i.kt)("h3",{id:"organizational-security-practices"},"Organizational security practices"),(0,i.kt)("p",null,"To ensure a positive security posture at OpenFn, we:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Conduct Employee IT security onboarding training & policy"),(0,i.kt)("li",{parentName:"ul"},"Run monthly security standups with the whole team"),(0,i.kt)("li",{parentName:"ul"},"Conduct an annual security review informed by the OWASP ASVS")),(0,i.kt)("h3",{id:"devsecops"},"DevSecOps"),(0,i.kt)("p",null,"To ensure best practices in our code we:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Monitor dependency vulnerabilities via Github\u2019s\n",(0,i.kt)("a",{parentName:"li",href:"https://github.com/features/security"},"dependabot")),(0,i.kt)("li",{parentName:"ul"},"Perform static code analysis on each commit with\n",(0,i.kt)("a",{parentName:"li",href:"https://sobelow.io/"},"Sobelow")),(0,i.kt)("li",{parentName:"ul"},"Ensure code is clean and standardised through preflight checks"),(0,i.kt)("li",{parentName:"ul"},"Monitor code coverage of unit tests and integration tests with Codecov")),(0,i.kt)("h3",{id:"roles-and-permissions"},"Roles and permissions"),(0,i.kt)("p",null,"Lightning provides identity and access management for users via various roles\nand permissions which determine what level of access they have for resources\nacross projects and instances (i.e., deployments)."),(0,i.kt)("p",null,"Lightning has 2 types of access levels:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"Instance-wide access levels are managed via an attribute on the ",(0,i.kt)("inlineCode",{parentName:"li"},"user"),"\nobject:")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Superusers")," are the administrator of the Lightning instance. They can\nmanage projects and users, configure authentication providers and view the\naudit trail."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Users")," are normal Lightning users. They can manage their own account and\ncredentials, and have access to projects they are added to.")),(0,i.kt)("ol",{start:2},(0,i.kt)("li",{parentName:"ol"},"Project-wide access levels")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"A project ",(0,i.kt)("strong",{parentName:"li"},"viewer")," can view the resources of a project in read-only mode and\nconfigure their own project digest and failure alerts."),(0,i.kt)("li",{parentName:"ul"},"A project ",(0,i.kt)("strong",{parentName:"li"},"editor")," can view, create and edit the jobs and workflows of a\nproject they have access to, as well as run and rerun jobs."),(0,i.kt)("li",{parentName:"ul"},"A project ",(0,i.kt)("strong",{parentName:"li"},"admin")," has administration access to project members. They can\nedit the name and description as well as delete a project."),(0,i.kt)("li",{parentName:"ul"},"A project ",(0,i.kt)("strong",{parentName:"li"},"owner")," can delete a project.")),(0,i.kt)("h3",{id:"application-security"},"Application security"),(0,i.kt)("p",null,"Lightning is designed to:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Scrub credential data from run logs"),(0,i.kt)("li",{parentName:"ul"},"Encrypt credentials at REST"),(0,i.kt)("li",{parentName:"ul"},"Track credential changes through an audit trail"),(0,i.kt)("li",{parentName:"ul"},"Encrypt passwords"),(0,i.kt)("li",{parentName:"ul"},"Enforce access controls with deny by default"),(0,i.kt)("li",{parentName:"ul"},"Allow users to differentiate between staging and production credentials"),(0,i.kt)("li",{parentName:"ul"},"Enable secure credential transfer across users"),(0,i.kt)("li",{parentName:"ul"},"Purge credentials and user data on account deletion"),(0,i.kt)("li",{parentName:"ul"},"Allow administrators to configure SSO through an identity provider")),(0,i.kt)("h3",{id:"data-residency"},"Data residency"),(0,i.kt)("p",null,"OpenFn Lightning is fully open source and can be deployed in any country. We\noffer high-availability managed deployments that are localized to any GCP or AWS\nlocation\u2014guaranteeing that no data ever leaves the selected country."),(0,i.kt)("h3",{id:"implementation-guidance-and-recommendations"},"Implementation guidance and recommendations"),(0,i.kt)("p",null,"To help our users adopt best practices when it comes to the design of their\nintegrations, we\u2019ve published a\n",(0,i.kt)("a",{parentName:"p",href:"/documentation/getting-started/security"},"Security Guidebook for data integration implementations"),"."),(0,i.kt)("h2",{id:"get-involved"},"Get involved"),(0,i.kt)("p",null,"We are building out in the open, follow our progress on\n",(0,i.kt)("a",{parentName:"p",href:"https://github.com/OpenFn/lightning"},"Github")," by clicking \u2018Watch\u2019 to track\nupdates and new releases. Ongoing discussions with our Open Source Steering\nCommittee about Lightning are documented on our\n",(0,i.kt)("a",{parentName:"p",href:"https://community.openfn.org/c/ossc/15"},"community forum"),". Your feedback and\ncomments are welcome there. If you would like to become a beta user or learn\nmore about Lightning, book in a call with our product manager here:\n",(0,i.kt)("a",{parentName:"p",href:"https://calendly.com/amber-openfn/short-call"},"https://calendly.com/amber-openfn/short-call"),"."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Lightning preview",src:n(66070).Z,width:"960",height:"540"})),(0,i.kt)("h2",{id:"lightning-faq"},"Lightning FAQ"),(0,i.kt)("h4",{id:"i-can-see-that-lightning-was-built-recently-is-it-new-and-if-so-how-can-i-trust-it"},"I can see that Lightning was built recently, is it new? And if so, how can I trust it?"),(0,i.kt)("p",null,"The Lightning repository may be new, but the technology isn\u2019t. We\u2019ve built out\nLightning by porting the tried and tested code from our proprietary platform. In\nother words, Lightning is built with code that has been used in production by\ngovernments and NGOs since 2015 and already handles tens of millions of\ntransactions a year. Software becomes more robust over time - the more it\u2019s\nused, the more edge cases are uncovered and bugs fixed. Over the past 7 years,\nevery time a bug has come up in our platform, we\u2019ve fixed it and added a test\nfor it. By bringing over the same tests from platform to Lightning, we\u2019re\nessentially guaranteeing the same level of robustness by taking into account\nevery single edge case or bug that we have ever encountered."),(0,i.kt)("h4",{id:"if-lightning-was-built-by-open-sourcing-code-from-the-openfn-platform-how-is-it-different"},"If Lightning was built by open-sourcing code from the OpenFn platform, how is it different?"),(0,i.kt)("p",null,"Under the hood, Lightning is the same as the OpenFn platform. Integrations are\nmade up of the same building blocks of triggers, adaptors and job expressions;\nrequests are executed, retried and reprocessed in exactly the same way."),(0,i.kt)("p",null,"What changes in Lightning is how users ",(0,i.kt)("em",{parentName:"p"},"build and monitor")," their integrations."),(0,i.kt)("h4",{id:"can-i-run-anything-from-the-openfn-platform-in-lightning"},"Can I run anything from the OpenFn platform in Lightning?"),(0,i.kt)("p",null,"Yes, integrations built out on the OpenFn platform are fully compatible with\nLightning."),(0,i.kt)("h4",{id:"who-is-lightning-for"},"Who is Lightning for?"),(0,i.kt)("p",null,"Lightning is for anyone in the government or NGO space that needs to integrate\ndifferent systems."),(0,i.kt)("h4",{id:"what-will-i-lose-by-switching-from-platform-to-lightning"},"What will I lose by switching from platform to Lightning?"),(0,i.kt)("p",null,"Right now: version control, authentication rules on webhooks, and the other\nfeatures in our roadmap (we\u2019re still in beta)."),(0,i.kt)("p",null,"Later: nothing - if a feature has proven important to our platform users, it\nwill be available in Lightning. If there is any feature you require in Lightning\nto be able to switch over to it, speak up ! You can reach out to our product\nmanager Amber via ",(0,i.kt)("a",{parentName:"p",href:"mailto:amber@openfn.org"},"email")," or even better book some time\nwith her through her ",(0,i.kt)("a",{parentName:"p",href:"https://koalendar.com/e/amber-rignell-openfn"},"calendar"),"."),(0,i.kt)("h4",{id:"when-will-lightning-beta-be-ready"},"When will Lightning Beta be ready?"),(0,i.kt)("p",null,"Lightning is currently in private Beta. You can register for an account on\n",(0,i.kt)("a",{parentName:"p",href:"https://app.openfn.org/"},"app.openfn.org"),"."))}c.isMDXComponent=!0},32734:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/lightning_audit-3ecad9c86dc91480cdb784ad4f03e297.png"},96813:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/lightning_build-647b9f0fb320532fb89efbe021072612.png"},56919:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/lightning_build_run_audit-dc67705b19e28d302e0adcc3cf79e2a1.png"},66070:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/lightning_preview-e305632545af55695045469f7d6eb4a3.png"}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.3b158498.js b/assets/js/runtime~main.e11dbdde.js similarity index 99% rename from assets/js/runtime~main.3b158498.js rename to assets/js/runtime~main.e11dbdde.js index ed9c2075454..0a7f85e24a6 100644 --- a/assets/js/runtime~main.3b158498.js +++ b/assets/js/runtime~main.e11dbdde.js @@ -1 +1 @@ -(()=>{"use strict";var e,f,c,d,b,a={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return a[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=a,r.c=t,e=[],r.O=(f,c,d,b)=>{if(!c){var a=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[c,d,b]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var a={};f=f||[null,c({}),c([]),c(c)];for(var t=2&d&&e;"object"==typeof t&&!~f.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((f=>a[f]=()=>e[f]));return a.default=()=>e,r.d(b,a),b},r.d=(e,f)=>{for(var c in f)r.o(f,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:f[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((f,c)=>(r.f[c](e,f),f)),[])),r.u=e=>"assets/js/"+({75:"1ef0096b",160:"6f69b847",640:"c85c4b26",740:"fa811662",977:"b973dcfd",1080:"16aa9458",1140:"2bb14bf0",1177:"ceb3f8e5",1434:"fa9fb131",1589:"3e1cef53",1610:"e3a6d1ec",1685:"2f06f2be",1958:"6479f562",2110:"bd16d6fd",2232:"c64ebc62",2365:"f38541c0",3112:"97bb0f58",3132:"9915a91d",3673:"aae0663e",3812:"9d4548fb",3818:"a22153eb",4100:"c6cf652c",4213:"12ebab0f",4268:"f13ea377",4474:"f615a51d",4804:"60a00565",4825:"2d52fc42",4832:"ece86388",4993:"81c93763",5099:"f30a3d1e",5195:"c7bf2a3a",5332:"d3433875",5484:"4cd34504",5547:"da184dc1",5566:"1578031d",5670:"fcdeb347",6136:"9da9a498",6148:"ea0d3e91",6249:"0564f87a",6286:"e19908fc",6367:"6de65b44",6441:"bfb1735a",6450:"5ede04c0",6513:"7b81a468",6536:"f2ca2c55",6819:"39906be8",6895:"dd13b434",6905:"13a70009",7127:"cfc8229c",7330:"d9cb599e",7332:"1a848321",7432:"954fe712",7463:"21b56577",7483:"a6a264d3",7567:"f77d5673",7694:"aa1b4e53",7779:"89594773",7911:"54e91ab5",8012:"c0f0637e",8043:"823f7700",8076:"035d0344",8097:"20501ae4",8549:"b06371b7",8631:"0210b704",8697:"cb759659",8765:"4aaa0f44",8773:"da6f85e6",8985:"48052ce1",9084:"0a6f29e5",9112:"f93f95da",9260:"e150ab3e",9368:"d5cbae08",9562:"45b0764f",9938:"babb54f3",9955:"c582042f",9966:"60ab92b2",9985:"237f254e",10001:"8eb4e46b",10099:"f5f1347d",10301:"d5bc6e48",10309:"60f1bcf9",10324:"fe5f889f",10660:"437618c4",10810:"24f9e5ab",10924:"5e450bcf",10996:"caaf01d4",11168:"11e6d144",11258:"d40361ad",11439:"33e1509d",11477:"b2f554cd",11483:"5b5d0fd6",11509:"d5b44e8d",11702:"ced1473c",11713:"a7023ddc",11953:"1e9ef283",11990:"30ddeb5e",12229:"964386c1",12306:"3d5c28b0",12402:"466eff7a",12573:"5dfb628f",12620:"274548c6",12706:"d4c834e8",12831:"3062d10d",13208:"afaa1b56",13633:"5e1c9ef2",13812:"207ee67a",13834:"c4643d70",13986:"55cceff7",14050:"2e7fdd6f",14074:"bd6858b9",14419:"8c2c25e6",14583:"d04fedb5",14601:"81eac5d3",14641:"7cb85c78",14687:"5610898c",14694:"29a36bd7",14753:"ce5aebf3",14807:"d1c7c525",14817:"6aa8733e",15015:"2158648d",15160:"e709bacf",15288:"0452e1bb",15795:"5a047bf8",15847:"f6525c87",16057:"b083e7a6",16385:"f113023d",16611:"ffa0c411",16748:"a3f0333e",16785:"a7ce3f25",16819:"9ee43f4e",17191:"89f741ca",17238:"45b3f811",17371:"44ea6f94",17388:"97feb4e9",17466:"7d5cf9fd",17470:"1abd0bca",17753:"6680323d",17773:"285ad496",18047:"9997aecf",18073:"92009f0a",18141:"febd0338",18308:"83170ae2",18384:"614beed4",18442:"92999a1c",18527:"83218c8a",18902:"0e04b402",18918:"24a5cb68",18934:"d988931a",18967:"7a801707",19014:"50711b5c",19262:"80a6599d",19571:"29cfecd2",19624:"8f8e3a33",19692:"ea07b8e0",19761:"8f6fb258",19835:"e202e776",19873:"14ee1fe9",19881:"853164ef",19923:"006fd865",20183:"421999d2",20396:"7ee80f24",20512:"5f265cf4",20859:"c2367e06",20868:"3d8bf3ab",21111:"fba9f625",21151:"14ad7d65",21271:"8310c4f6",21317:"4a487c7d",21356:"0d1eeea0",21384:"32723a2e",21481:"919ee986",21665:"e56b7427",21685:"03cd8e1c",22226:"f5466782",22235:"3947b16e",22409:"5e1dea11",22605:"55bb925b",22623:"ecfe8209",22740:"e436cfad",22881:"e175f9f3",23024:"665c23b8",23046:"192eff61",23067:"57fbf2bd",23145:"84c1f0c8",23679:"12f62dc2",23872:"b5bd7f9b",23913:"3874af3e",24067:"8660c4b6",24219:"5e95c167",24378:"de4aaf36",24649:"89c724a9",24685:"a0799a2b",24742:"833f2ec0",24857:"cc3db60c",24869:"90d535c2",24883:"9eb4e0db",25035:"1af9c7d3",25048:"a20e070a",25188:"74ea6b63",25294:"73578edf",25315:"e310b146",25857:"5f0700c5",25903:"2c828998",25920:"cce9ad1c",26090:"d9a6c9f9",26191:"28a6a789",26723:"60194cf2",26920:"d98b9f83",27102:"e8b14a65",27385:"96ecf107",27747:"1e27a2df",27800:"b1ecb9ed",27865:"bc07532a",27918:"17896441",28283:"d776f897",28573:"233cd645",28698:"c77a0576",28761:"0a61bc2e",28924:"de176c41",29172:"8d5bb253",29308:"3a5ec158",29354:"c2d56c21",29514:"1be78505",29814:"db6367fb",29889:"471dcc6f",30117:"385718d4",30636:"747a690f",30674:"1140a058",31109:"dff30c03",31114:"f13d29f3",31150:"6536e94a",31158:"f2b4d23e",31262:"2dcd28d2",31326:"7a35092c",31350:"5fb0ec3e",31552:"4aa43dae",31800:"c1dc13d0",31883:"3c41cfdf",31955:"ba11d205",32039:"fb5b11b0",32107:"916b8fda",32567:"dc14f0c4",32661:"e1d93203",32672:"85f847a7",32674:"6cb21577",32737:"afbc2852",32921:"723d2f26",33089:"20a5a532",33731:"20f8de15",33871:"5c0c3c72",33889:"5de53f8e",33926:"c4429c79",33937:"d4ef9144",33947:"c6dfd94e",34050:"3fa9568c",34154:"768ed1d7",34211:"f2720a78",34229:"199fcd36",34490:"33844ff3",34509:"cce23dfc",34737:"31b72ec5",34925:"3add1ba9",35097:"def6dfb9",35257:"1f86786a",35304:"1e26ddab",35349:"ef4e0518",35477:"c0908e63",35506:"6738a51a",35738:"f474b5ba",35755:"c275b7b1",36027:"7a8aa347",36046:"ea642db2",36425:"984b8319",36555:"a03f8b02",37120:"669b0b95",37181:"deb190e6",37209:"4980c4fa",37274:"02371d76",37435:"b942cf8e",37456:"cab54053",37638:"fa746f0e",37737:"2db499ae",37799:"b50d6289",37874:"8e97cc15",38137:"5d42a18a",38360:"c3a6b316",38574:"1b3816a8",38887:"e967512d",38968:"512d8cfa",39210:"75270caf",39527:"afd0cb1b",39626:"8b77e1a5",39652:"b0055554",39799:"330b8ea1",39843:"3f45f80c",39856:"e0c8a1d6",40268:"1de77d44",40280:"07e96687",40332:"cd8c9fbc",40381:"050638ff",40548:"67c4a832",40556:"1ee9c635",40597:"2d68e16b",40804:"84810683",41661:"1280552c",41856:"2f989304",42251:"55ac83aa",42349:"81ce5e0c",42404:"9f91e03b",42412:"8328e7f1",42531:"4f8f7d74",42541:"868893ac",42958:"14a767b9",42966:"315415ca",43086:"bb40a730",43521:"8d1ec4c5",43559:"0d529baa",43699:"186444dd",43760:"459956dd",43905:"5653e10f",43996:"277d517a",44010:"db759789",44157:"283e63f8",44232:"8256726e",44663:"f76e6047",44911:"677d6777",44953:"78b226dc",44988:"4be7e5d0",45112:"31d20e13",45190:"1d970e9f",45452:"5bcd0da1",45566:"8fa4918e",45702:"1074bb26",45939:"b1212599",45977:"acfb9a5e",45980:"ffecbc46",46074:"b198cec2",46103:"ccc49370",46131:"f259cf74",46343:"ea369cdd",46353:"77faeb23",46526:"7f6bbd73",46667:"ed03f5d4",46858:"e2c3bc5f",46940:"d4e06cde",46953:"58cbfb5a",46989:"e802237a",47077:"554f4bd3",47214:"326c0af7",47642:"741a738c",47974:"6c8cf0bf",48104:"c333ed9f",48338:"4f3e32ec",48610:"6875c492",48632:"a555a233",48690:"5ffd6909",49158:"f50ed874",49517:"6af54863",49558:"ef9227ec",49808:"d0ac1c30",50003:"6850cfb6",50103:"65e8e75e",50258:"5575e2a8",50298:"a5fe4d7b",50339:"cb128a98",50403:"de387681",50481:"af4b7be4",50533:"e19d86f2",50758:"853ddb5d",50813:"f77b4e82",50988:"186b492d",51035:"9c1835bf",51149:"cd910537",51161:"2127c55a",51296:"f7765531",51456:"bfbf9dff",51652:"708cde07",51818:"75ae40a4",51904:"c260b9a0",51917:"3f2ad086",52025:"4649e1c2",52409:"5cecf783",52535:"814f3328",52592:"d56f97cb",52610:"1d48afb9",52739:"734563d5",52765:"933a49e7",52853:"1c7cc376",52943:"a9bffa51",53003:"10647879",53202:"68987ad2",53244:"869c9c27",53608:"9e4087bc",53695:"87a2f1fc",53787:"bc4d6fc9",53962:"3a574a7f",54096:"b987a5c1",54239:"77354108",54246:"c942fcda",54442:"61106173",54980:"e57c1bef",55191:"bb8cf488",55494:"38eccbde",55501:"7f2f79c2",55547:"45062c3f",55606:"b1be30d1",55776:"341bd61f",55797:"e4608243",55870:"c302b7f6",56123:"4ef508e9",56147:"92e661e4",56522:"406b186f",56757:"fbcdd0ee",56852:"30995fb4",57019:"479e2d15",57276:"59e1a395",57463:"f2f7c8b6",57684:"86b52bb0",57698:"8b0d3319",58193:"aacecf0a",58290:"cc8c6322",58509:"507e1a4c",58701:"4e3d1533",58974:"60b808f2",59139:"5153790b",59334:"247783bb",59424:"133b4df0",59650:"4646a8a4",59891:"3124230e",60330:"13a2a5ae",60379:"271f7228",60595:"a9d6ad8a",60712:"699a47d0",60771:"22ef07eb",60992:"352bf367",61484:"20a7d97c",61624:"4ef2e3ea",61887:"f9ed4079",62126:"c3a5a911",62405:"a8faecbd",62425:"d80cee7e",62650:"0f427d40",62921:"906ba10e",63232:"9708a852",63253:"a69ebe5f",63445:"92af7f04",63792:"bd83a8c8",63812:"45a8dc52",63816:"0475f9cc",63870:"0b31129f",63952:"d493c3e8",64013:"01a85c17",64195:"c4f5d8e4",64477:"3cf47477",64693:"1e5c0d86",64709:"f3954950",64880:"6a3a4a87",64887:"a8c84974",64947:"460d220e",65146:"069211c5",65341:"0a451647",65442:"444d5ed4",65688:"9afa6cde",65826:"203262b0",66070:"25057d02",66102:"36ded102",66385:"59b068d1",66449:"029e4dc3",66526:"e6102057",66609:"0c8b9afa",66618:"802db911",66640:"ec576a8b",66766:"9e339b71",66833:"f24f0ea5",66863:"1cd349ba",67086:"f63f75e6",67492:"aa9c90f7",67544:"aea1a378",67547:"9b3efc75",67560:"36a143db",68165:"d44f5d69",68175:"c831614b",68271:"1c091541",68359:"d88d25ac",68538:"9f0412f1",68618:"5f16d91a",69048:"7b2e7fac",69081:"97a69baf",69104:"acd02317",69276:"4c2772ab",69279:"776f5947",69962:"8e10bb86",69972:"d40de319",70289:"b2b9b866",70351:"c6fe0741",70363:"6f4af312",70486:"6d30ac0a",70970:"77e868d9",71061:"c968f1a3",71153:"7fdc0c84",71592:"3685f909",71760:"371b21cb",72054:"f64a2f66",72099:"eae3fa10",72514:"6c5c20d6",72543:"61428574",72937:"193bf152",72978:"56b2a431",73032:"13c3e084",73446:"450c527f",73641:"fe1d477d",73745:"1954649e",74002:"9bb632fa",74083:"68cedfd5",74113:"89ebc8eb",74134:"d5e8cc91",74198:"b3198ac5",74300:"419e73d5",74697:"26c54994",74888:"1a43e018",74927:"9e96f049",74986:"fe36bf36",75558:"3cc638e0",75693:"4f688289",75878:"c08d79e7",76045:"a13b9d31",76126:"d060dfa6",76130:"6ccb7d3e",76575:"6d0c6131",76660:"c76eb7d5",76786:"8e37cc44",76791:"06b1e92d",76874:"771488fd",76967:"e2548c92",77012:"9e1f7384",77055:"f5d5b73d",77159:"374427da",77169:"e4f4dec4",77217:"af1b4014",77431:"dc819e53",77645:"a7434565",78046:"2fd22369",78082:"fcfb247d",78314:"10915d97",78436:"c541efc4",78489:"c98ac358",78659:"890759ea",78823:"c0daf1e6",78914:"1a98f2d5",78941:"88b398be",78985:"99d25280",79495:"62b71d38",79559:"7356945f",79697:"fae4f913",79993:"fa56ac42",80053:"935f2afb",80448:"d1e2a1e4",80505:"342f32a4",80546:"a1b695db",80867:"6620b2c9",81022:"4f989fdc",81027:"4549cb79",81155:"5f6910fd",81186:"e5e83212",81312:"6bb55549",81475:"1ddde2c7",81487:"70b40441",81511:"208114e0",81649:"92bdb8f4",81757:"5fa25c43",81938:"6310fd48",82024:"8ed61535",82133:"4cff7ce2",82251:"d080e3b1",82276:"46bd2088",82461:"dfd4abb8",82818:"5f1113d5",82838:"cd7cc5b2",82863:"eb4eb408",83006:"87d0342b",83054:"b85e9339",83278:"09b23959",83834:"07987921",83897:"500fb0e6",83988:"e0ecd9df",84022:"2eb941a5",84568:"3e171e78",84726:"08e43170",84728:"903c4f6f",84761:"ab0b43f0",84784:"f7f75c2e",84935:"bab68f7e",85040:"f5ff4ddf",85528:"69802526",85586:"5f0cc255",85627:"63b377ca",85634:"a6748c3f",85744:"c4816122",85960:"cc826739",86179:"22ff6767",86236:"565d3b3a",86565:"4224ef00",86621:"519cbeed",86719:"4256eaf4",86904:"fec351f2",86984:"2bf9c0b5",87070:"3bc428dc",87233:"1ff7f4b8",87339:"53371809",87393:"ede583c5",87494:"90377122",87557:"4cbb880b",87644:"81e594d4",87746:"6fa39f86",87802:"4f0c7b96",88180:"eec2ee36",88529:"879bb888",88652:"39e9cb37",88743:"376ff700",88795:"27e17dc0",88945:"9bf3c520",89007:"e4a50065",89364:"96781795",89501:"f48233a1",89642:"36788d15",89903:"ffc1986f",89931:"122cd6da",89959:"8435c5ad",90076:"c5495231",90111:"073713d1",90288:"82092fc0",90295:"845a8f5b",90451:"e7db057b",90500:"cc135780",90533:"b2b675dd",90558:"a12f1ef9",90560:"5426ac11",90713:"403863d9",90794:"b5efef1d",91374:"c2be96f9",91552:"b3022338",91637:"a3f9e536",91705:"524c9166",91878:"e866f873",91910:"d879ea04",92079:"3f85e7e0",92133:"bebb13e1",92544:"a9d16e82",92648:"fca34444",92755:"9d36e504",92778:"ef4780b0",93089:"a6aa9e1f",93233:"998a3ebe",94218:"216be533",94349:"09a69b27",94498:"10eaf6bf",94610:"dc62dd6c",94780:"4b2ec4d2",94814:"8d6bb331",94831:"4b75119c",95358:"7f0b639b",95520:"608d3bbe",95676:"a54058d6",95697:"c4fd3761",95752:"7b20acf0",95960:"dbbfaad4",95990:"ed48b979",95997:"8977ff65",96168:"2f4b7a65",96218:"a9808524",96505:"f08e269d",96545:"40fd761e",96705:"3035a8de",96857:"5f87d652",97092:"661132b8",97126:"8f102ef9",97470:"783bde4f",97595:"960d9980",97847:"f7d07906",97901:"60e9e07a",97920:"1a4e3797",97963:"22885a83",98074:"97db7bb8",98216:"15d749b5",98418:"28411ba4",98510:"61dbd605",98772:"a5bc4f28",99217:"6bf3b56c",99295:"fc5ff77a",99748:"9f45eacd",99914:"b37711b1"}[e]||e)+"."+{75:"ba209844",160:"e5da974a",640:"66ba63be",740:"f8fe0687",977:"37a66585",1080:"75839613",1140:"f6d14862",1177:"082777f8",1434:"c824973e",1589:"281acca6",1610:"ce7b58c6",1685:"99feb5c1",1958:"85f702b2",2110:"0f784096",2232:"9658d2f9",2365:"49f92594",3112:"02619aa3",3132:"1f45356a",3473:"1483dcde",3673:"bc92d771",3812:"93a67fef",3818:"957afbad",4100:"22290676",4213:"73eaaf1d",4268:"3fd08826",4474:"de961bc6",4804:"04f2f7c6",4825:"81761ece",4832:"52c1e025",4972:"4be77f28",4993:"1cf962f5",5099:"57e37f03",5195:"160f7aa9",5332:"1cb5798a",5484:"07e4fd90",5547:"67f73252",5566:"92629b9f",5670:"c10c0fba",6136:"1161390f",6148:"e9eb81a4",6249:"a265052e",6286:"11710a8b",6367:"d9135d74",6441:"e1869af8",6450:"36add7bd",6513:"f024e403",6536:"31011f4a",6819:"f4f5903f",6895:"dcda0488",6905:"d4e00027",7127:"dd68e17d",7330:"4ef4ab4a",7332:"b857ce44",7432:"f8a6fc8e",7463:"d6f0a042",7483:"e7d12318",7567:"23918f0c",7694:"4e9066f1",7779:"b93e0e59",7911:"331b7672",8012:"32969560",8043:"8935a4bf",8076:"0a4bf576",8097:"ef3d21b7",8549:"0df3e3cf",8631:"b7382975",8697:"8ca7c083",8765:"0a76d68f",8773:"4d81694a",8985:"cb5697e6",9084:"69bd52e7",9112:"28ce530c",9260:"b001f541",9368:"f7459553",9562:"b89eeffa",9938:"e85ae0fe",9955:"0bf9d7ad",9966:"1e880894",9985:"e4b65888",10001:"72a963cf",10099:"fb91e017",10301:"2eef4727",10309:"ca3e9203",10324:"c2de2339",10660:"4b112633",10810:"693cdd37",10924:"3dea7a77",10996:"417dd662",11080:"a9a57c7f",11168:"6332c429",11258:"7ba63cf4",11439:"ec1f41be",11477:"96e255f9",11483:"f700070c",11509:"c1c793e8",11702:"36348560",11713:"4f831e89",11953:"ac2774dc",11990:"6f1e152a",12229:"a1555f6a",12306:"45f74160",12402:"92eb79ce",12573:"7f8af31d",12620:"6708a580",12706:"0e38d741",12831:"1c8512de",13208:"889e2bee",13633:"e10e3a7d",13812:"fdd71593",13834:"a3cd23ee",13986:"75337b20",14050:"fd1f6f94",14074:"e47f1d04",14419:"03102f22",14583:"3239a51d",14601:"9db1b629",14641:"ac02a688",14687:"6c5cdfd7",14694:"00f4a86d",14753:"2a30d1e8",14807:"bb356517",14817:"45c09681",15015:"c4993e25",15160:"8b2e1e0d",15288:"7666a3a7",15795:"d77e68a6",15847:"0e0140ca",16057:"3e3243a8",16385:"d0c54ce2",16611:"b662c302",16748:"7a3cebee",16785:"959cb550",16819:"e9bbabd5",17191:"d56d1632",17238:"c392ec24",17371:"7b3ae9c2",17388:"9854912e",17466:"4baea993",17470:"955454d6",17753:"fcd1093c",17773:"e83467c4",18047:"14fe704d",18073:"37fd2b33",18141:"86ccdae3",18308:"dd57902b",18384:"a31beba8",18442:"9c8def0e",18527:"4cab4fe6",18894:"d7313338",18902:"33bfb34f",18918:"bbc62c4f",18934:"49ec3c3e",18967:"de7564ae",19014:"a07ef9b7",19262:"772e85d3",19487:"378cff79",19571:"23cc0e8e",19624:"4ea75e07",19692:"96e8d169",19761:"e4477491",19835:"7ce8fcaa",19873:"fdfeacc6",19881:"9f8eef5f",19923:"b28cdacc",20183:"b9f04346",20396:"00139995",20512:"6b4c3c2e",20859:"983d2f46",20868:"0bdb5763",21111:"748e813f",21151:"17b7cefb",21271:"9738f32d",21317:"06716597",21356:"50058654",21384:"5ead3faf",21481:"c2468aba",21665:"01838e5d",21685:"af219096",22004:"8a0a8205",22226:"58eec50e",22235:"605b8183",22409:"fcfa855e",22605:"c23a1523",22623:"f9089edc",22740:"941548a5",22881:"a5c0fdf9",23024:"ea55a397",23046:"baec1de5",23067:"38984a4e",23145:"2bb4b601",23679:"c52bebdb",23872:"64f3f6c3",23913:"38adccf3",24067:"e7fa4d24",24219:"4f178d44",24378:"8dbbcf7f",24649:"29c6bcb6",24685:"e912586b",24742:"cfc45767",24857:"68f07ba6",24869:"63acd6ab",24883:"0cb8c08d",25035:"3f669cd3",25048:"86669071",25188:"e05119d5",25294:"8957ac63",25315:"99020981",25857:"40b1b5e0",25903:"7b117143",25920:"3819e594",26090:"bf670a25",26191:"0491cf3b",26723:"85c42d3d",26920:"fac27bc2",27102:"e72af470",27385:"0fff7ec2",27747:"7aa0b2a4",27800:"9abc5834",27865:"e9de5791",27918:"3f116c42",28283:"5d99ae9a",28573:"9795bb36",28698:"4489cbf4",28761:"c9a24612",28924:"56872f5a",29172:"7b317bcd",29308:"066b3654",29354:"8dcfc928",29514:"efc67b9d",29814:"5aeec07a",29889:"36ef29d6",30117:"28998c3f",30636:"d18def78",30674:"706dc5fa",31109:"a4dece73",31114:"2d583c5a",31150:"225e67c0",31158:"be3a3ab8",31262:"561bbfb1",31326:"e5cd2764",31350:"797cdcb4",31466:"0024b86f",31552:"47e94f50",31800:"500713fd",31883:"b11a41ca",31955:"78afdeb8",32039:"b07cc17c",32107:"f73206d0",32567:"3e10a887",32661:"fd96ce67",32672:"ad43de1f",32674:"10a168e7",32737:"4575b3cc",32921:"7ac0616d",33089:"3cd29263",33731:"8f426541",33871:"bf7d6434",33889:"b8a30553",33926:"dfb69ee5",33937:"20b5bb65",33947:"471b3468",34050:"6bd370e5",34154:"db98b20d",34211:"d6e150af",34229:"4ac390cb",34490:"e831d01d",34509:"be3de52c",34737:"9587808b",34925:"3e8bdb78",35097:"046756fd",35257:"e473e94c",35304:"41e6617c",35349:"23860a86",35477:"920c5501",35506:"28c13d96",35738:"1cbe4cc0",35755:"b0a98bd4",36027:"66c825d4",36046:"992ab4eb",36425:"5231b7ba",36555:"ed577aba",37120:"21c8837f",37181:"539e1b97",37209:"3f6b1eb8",37274:"64a56fee",37435:"1541074d",37456:"f438cb45",37638:"f294dc4b",37737:"7cddc5e5",37799:"4f98a08b",37874:"3a138488",38137:"7d2cdf24",38360:"4e90aa50",38574:"56c59737",38887:"8c09d6b0",38968:"050053fd",39210:"21d024e6",39527:"5533e988",39626:"4b6e93e1",39652:"23da6524",39799:"c2010732",39843:"3023fb36",39856:"4dee8915",40268:"305dab81",40280:"dfc9e302",40332:"2464db9c",40381:"1df00230",40548:"e713df2d",40556:"73785032",40597:"b079b4ae",40804:"5648c776",41661:"198a6972",41856:"c044cdf9",42251:"6c41ce9d",42349:"1ed3bd3f",42404:"ef580adc",42412:"afac3f8f",42531:"1f74be30",42541:"d19f7810",42958:"251ffce9",42966:"4e74d8c8",43086:"01e6fa8b",43521:"cbd9d642",43559:"9fb4bf18",43699:"623b825d",43760:"35880526",43905:"97a6cfcf",43996:"8a577e88",44010:"ca1e5778",44157:"fd2b5e94",44232:"7750fdda",44663:"d9b7bc27",44911:"1b3c5761",44953:"c9430191",44988:"ecb11f1d",45112:"2790a97e",45190:"f923059f",45452:"678c3dbc",45566:"d808e99d",45702:"b535f50d",45939:"bf514601",45977:"c86c9d46",45980:"21d4c72d",46048:"991a2a40",46074:"6b765fde",46103:"ffd73f5c",46131:"e9a1de90",46343:"e257bec0",46353:"97e9bfd6",46526:"71795cd9",46667:"03fb924e",46858:"cc97ccbe",46940:"ea33e3bb",46945:"a8617603",46953:"00fb7ea2",46989:"a46da357",47077:"e53f90f4",47214:"cbb1d2df",47642:"ade194dc",47724:"d962b239",47974:"d2c0d692",48104:"24c25af1",48338:"320ec0e2",48610:"9abf5873",48632:"85628934",48690:"bc3070bc",49158:"71fb8b88",49517:"46b2802e",49558:"8baf268e",49808:"2ecf26cf",50003:"08ea7e4a",50103:"48c3fcb1",50258:"11a82076",50298:"b0e0f93a",50339:"01a76df1",50403:"ed7faa9b",50481:"79ba5b89",50533:"62019771",50758:"d9924384",50813:"c77088e5",50988:"559e5ae8",51035:"d24439d0",51149:"d18cce62",51161:"71d23e39",51296:"09b058e6",51456:"713257bf",51652:"e6ecc0bc",51818:"87dad8e4",51904:"6487b1c8",51917:"df2bde5d",52025:"cb7bfba1",52409:"48c2215f",52535:"990ee279",52592:"503cc687",52610:"174e1fb1",52739:"80299de6",52765:"76c3c387",52853:"7f427d82",52943:"7c53cd0f",53003:"24731806",53202:"74d11ff9",53244:"559e1188",53608:"58cce4c5",53695:"7eea39ef",53787:"22734071",53962:"38d46a2d",54096:"f368feb4",54239:"7ddd28a4",54246:"8b0f306b",54442:"95972f5c",54980:"0df5011c",55191:"b060dc5a",55494:"0b379f9c",55501:"7bc602e1",55547:"6a2eb3d8",55606:"aa0d9394",55776:"95897bd5",55797:"73992098",55870:"07e6e2d2",56123:"0451191d",56147:"aded2add",56522:"2875452c",56757:"92b72a3c",56852:"a9f9e0e8",57019:"8611871f",57276:"c2270dd4",57463:"27ee395d",57684:"994e50b0",57698:"406ba3c5",58193:"54edadad",58290:"0d6d8221",58509:"e4cfc3cb",58701:"6355db4b",58974:"d00193cf",59139:"5f57b417",59334:"bc97b4af",59424:"63b50aef",59650:"d3e21286",59891:"a6c6b226",60330:"4ddc6504",60379:"37f65d99",60595:"33d164e1",60712:"9ba741e0",60771:"806bb9bb",60992:"ebd41dd6",61426:"b005faab",61484:"9070572a",61624:"e2e0b33e",61887:"370bfec7",62126:"2e6842cc",62405:"fb708fd1",62425:"935db492",62650:"baeae442",62921:"90d90ce0",63232:"d4165657",63253:"032ad655",63445:"738dfd73",63792:"f4a5b04e",63812:"520bf9a1",63816:"cfdfa4e6",63870:"5ddc4883",63952:"56dca9b6",64013:"599e8d04",64195:"37467830",64477:"880366e2",64693:"3591a451",64709:"0a02c2db",64880:"5483943f",64887:"93acfbce",64947:"a84b1560",65146:"5284aa98",65341:"074c1878",65442:"4b462267",65688:"c39dea2f",65826:"d0deea04",66070:"30b7f98a",66102:"f562315c",66385:"a981a7d1",66449:"1175abd2",66526:"a30fc757",66609:"a83f3bad",66618:"9e6de4b0",66640:"ca9dd737",66766:"cf3324fc",66833:"9539154b",66863:"a6456680",67086:"2a606fb9",67492:"7b1b3da8",67544:"44f25981",67547:"6aa55282",67560:"70abe5ee",68165:"cfc2184b",68175:"8e5c2bc6",68271:"b6fb9f60",68359:"c3e05124",68538:"04919a88",68618:"1b792ae9",69048:"a6d8ee91",69081:"1cbe58f2",69104:"434ddf10",69276:"79546110",69279:"2c16191a",69962:"407e25af",69972:"6a472a11",70289:"087dc897",70351:"1fbf6b6d",70363:"213a673d",70486:"d1979806",70970:"899290ee",71061:"aa73d1fe",71153:"c06434c4",71592:"ea4b6e59",71760:"f1820339",72054:"3beef3e6",72099:"8b5339a0",72514:"30c2305a",72543:"8a095fb6",72937:"bc79a7be",72978:"5b5fb654",73032:"d4406492",73446:"fbe9c3a0",73641:"2e7f1c57",73745:"a1b09a88",74002:"3c96ec89",74083:"51c6b576",74113:"534e16f6",74134:"62cb2464",74198:"0c6a28c2",74300:"90208db5",74697:"ec35cd16",74888:"e296f855",74927:"ecbed9ff",74986:"d171ca39",75558:"46fcfd6b",75693:"60775094",75878:"6106dfbb",76045:"7150d692",76126:"caff1910",76130:"3cebd4b0",76575:"0d031bbc",76660:"c0edfa51",76786:"c01123e3",76791:"98c2ecbb",76874:"8a860019",76967:"2b7b93c5",77012:"424136c5",77055:"52d64481",77159:"fb637f1b",77169:"c85f7414",77217:"73da5c9e",77431:"488fbdaa",77645:"0d9ea538",78046:"b61f3e11",78082:"bb2abd1d",78314:"fc30bb20",78436:"bad65e65",78489:"07d0924a",78659:"5a1a8dd3",78823:"ca7a733a",78914:"ee403c7d",78941:"be3ab0f3",78985:"3babf463",79134:"2cb1d474",79495:"e788506f",79559:"c43d5cea",79697:"662c6265",79993:"28e7c668",80053:"59f1c35d",80448:"7bbda511",80505:"88574b97",80546:"5c09c361",80867:"97008892",81022:"9595b1a5",81027:"73d7e3c8",81155:"210ab5cf",81186:"97190397",81312:"57fce437",81475:"7ff082cb",81487:"ff495c77",81511:"8c18480e",81649:"2b9a813c",81757:"a6e99358",81938:"c77cdb8f",82024:"a9006cb4",82133:"de0c7c56",82251:"2789faaf",82276:"7b5e03b1",82461:"260515dd",82818:"c1d7836d",82838:"552dc70e",82863:"91149d10",83006:"91c44e75",83054:"1d15a998",83278:"82732e22",83834:"68361e02",83897:"345be9af",83988:"37c462d0",84022:"aa6e49d3",84568:"ec209866",84726:"1207266a",84728:"c0f72c02",84761:"6ca4b680",84784:"5e119fa7",84935:"bc522665",85040:"0020a767",85528:"2f3d83b3",85586:"cb2a9a88",85627:"123f3850",85634:"05248a84",85744:"6d83ff55",85960:"e8726691",86179:"bf6d094e",86236:"be8b499c",86565:"93c3b976",86621:"7000eb75",86719:"4d003468",86904:"148fb722",86984:"33aa1a23",87070:"563e9013",87233:"bfc96bfb",87339:"f970cade",87393:"e7c135d0",87494:"cb111aa8",87557:"708c5610",87644:"89b134ce",87746:"17adf1d7",87802:"f2a62bb2",88180:"b4f95828",88529:"90290f03",88652:"3fc6ee75",88743:"6b86988f",88795:"ee1fe83a",88945:"3a5752a3",89007:"e5688e55",89364:"b1698349",89501:"45b3f8b8",89642:"92e1f794",89903:"a08599c5",89931:"72aaf3f8",89959:"26fa247a",90076:"8ad4604b",90111:"01869f8f",90288:"a23779d5",90295:"a7b094cb",90451:"f8fb81e0",90500:"419e0882",90533:"ee8a8c85",90558:"f40c67ff",90560:"7bc975ec",90713:"b0fec256",90794:"673dbef2",91374:"15386fc1",91552:"87f75dd0",91637:"5add28d0",91705:"6ba4ccb5",91878:"795bfb68",91910:"9131b612",92079:"04ae30b0",92133:"1737bce4",92544:"1774cafd",92648:"3ee0cca8",92755:"332a5792",92778:"ed35f612",93089:"65e2c549",93233:"9a491502",94218:"6304aed3",94349:"46b52a8a",94498:"a0e25775",94610:"9f88de9e",94780:"5a2cf565",94814:"2616195a",94831:"979e575e",95358:"ad3493d9",95520:"f8165fd1",95676:"8d617ccd",95697:"c3b383d2",95752:"8a1e51fb",95960:"69129f52",95990:"879fe54a",95997:"afa624f5",96168:"6fb0b8f0",96218:"88e79e1b",96316:"e60530d6",96505:"ee8f3356",96545:"f9862151",96705:"a073cca6",96857:"4dc55093",97092:"1a30c487",97126:"10a39818",97470:"b3ded8b0",97595:"87836ff0",97847:"faf7274f",97901:"0a8cc66e",97920:"d35141b1",97963:"5ac2d968",98074:"573b406d",98216:"c6441497",98418:"268a13fc",98510:"a5da12a0",98772:"4cae51aa",99217:"78769dc1",99295:"61a5d491",99748:"8658188f",99914:"b4809dd8"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),d={},b="@openfn/docs:",r.l=(e,f,c,a)=>{if(d[e])d[e].push(f);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(c))),f)return f(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={10647879:"53003",17896441:"27918",53371809:"87339",61106173:"54442",61428574:"72543",69802526:"85528",77354108:"54239",84810683:"40804",89594773:"7779",90377122:"87494",96781795:"89364","1ef0096b":"75","6f69b847":"160",c85c4b26:"640",fa811662:"740",b973dcfd:"977","16aa9458":"1080","2bb14bf0":"1140",ceb3f8e5:"1177",fa9fb131:"1434","3e1cef53":"1589",e3a6d1ec:"1610","2f06f2be":"1685","6479f562":"1958",bd16d6fd:"2110",c64ebc62:"2232",f38541c0:"2365","97bb0f58":"3112","9915a91d":"3132",aae0663e:"3673","9d4548fb":"3812",a22153eb:"3818",c6cf652c:"4100","12ebab0f":"4213",f13ea377:"4268",f615a51d:"4474","60a00565":"4804","2d52fc42":"4825",ece86388:"4832","81c93763":"4993",f30a3d1e:"5099",c7bf2a3a:"5195",d3433875:"5332","4cd34504":"5484",da184dc1:"5547","1578031d":"5566",fcdeb347:"5670","9da9a498":"6136",ea0d3e91:"6148","0564f87a":"6249",e19908fc:"6286","6de65b44":"6367",bfb1735a:"6441","5ede04c0":"6450","7b81a468":"6513",f2ca2c55:"6536","39906be8":"6819",dd13b434:"6895","13a70009":"6905",cfc8229c:"7127",d9cb599e:"7330","1a848321":"7332","954fe712":"7432","21b56577":"7463",a6a264d3:"7483",f77d5673:"7567",aa1b4e53:"7694","54e91ab5":"7911",c0f0637e:"8012","823f7700":"8043","035d0344":"8076","20501ae4":"8097",b06371b7:"8549","0210b704":"8631",cb759659:"8697","4aaa0f44":"8765",da6f85e6:"8773","48052ce1":"8985","0a6f29e5":"9084",f93f95da:"9112",e150ab3e:"9260",d5cbae08:"9368","45b0764f":"9562",babb54f3:"9938",c582042f:"9955","60ab92b2":"9966","237f254e":"9985","8eb4e46b":"10001",f5f1347d:"10099",d5bc6e48:"10301","60f1bcf9":"10309",fe5f889f:"10324","437618c4":"10660","24f9e5ab":"10810","5e450bcf":"10924",caaf01d4:"10996","11e6d144":"11168",d40361ad:"11258","33e1509d":"11439",b2f554cd:"11477","5b5d0fd6":"11483",d5b44e8d:"11509",ced1473c:"11702",a7023ddc:"11713","1e9ef283":"11953","30ddeb5e":"11990","964386c1":"12229","3d5c28b0":"12306","466eff7a":"12402","5dfb628f":"12573","274548c6":"12620",d4c834e8:"12706","3062d10d":"12831",afaa1b56:"13208","5e1c9ef2":"13633","207ee67a":"13812",c4643d70:"13834","55cceff7":"13986","2e7fdd6f":"14050",bd6858b9:"14074","8c2c25e6":"14419",d04fedb5:"14583","81eac5d3":"14601","7cb85c78":"14641","5610898c":"14687","29a36bd7":"14694",ce5aebf3:"14753",d1c7c525:"14807","6aa8733e":"14817","2158648d":"15015",e709bacf:"15160","0452e1bb":"15288","5a047bf8":"15795",f6525c87:"15847",b083e7a6:"16057",f113023d:"16385",ffa0c411:"16611",a3f0333e:"16748",a7ce3f25:"16785","9ee43f4e":"16819","89f741ca":"17191","45b3f811":"17238","44ea6f94":"17371","97feb4e9":"17388","7d5cf9fd":"17466","1abd0bca":"17470","6680323d":"17753","285ad496":"17773","9997aecf":"18047","92009f0a":"18073",febd0338:"18141","83170ae2":"18308","614beed4":"18384","92999a1c":"18442","83218c8a":"18527","0e04b402":"18902","24a5cb68":"18918",d988931a:"18934","7a801707":"18967","50711b5c":"19014","80a6599d":"19262","29cfecd2":"19571","8f8e3a33":"19624",ea07b8e0:"19692","8f6fb258":"19761",e202e776:"19835","14ee1fe9":"19873","853164ef":"19881","006fd865":"19923","421999d2":"20183","7ee80f24":"20396","5f265cf4":"20512",c2367e06:"20859","3d8bf3ab":"20868",fba9f625:"21111","14ad7d65":"21151","8310c4f6":"21271","4a487c7d":"21317","0d1eeea0":"21356","32723a2e":"21384","919ee986":"21481",e56b7427:"21665","03cd8e1c":"21685",f5466782:"22226","3947b16e":"22235","5e1dea11":"22409","55bb925b":"22605",ecfe8209:"22623",e436cfad:"22740",e175f9f3:"22881","665c23b8":"23024","192eff61":"23046","57fbf2bd":"23067","84c1f0c8":"23145","12f62dc2":"23679",b5bd7f9b:"23872","3874af3e":"23913","8660c4b6":"24067","5e95c167":"24219",de4aaf36:"24378","89c724a9":"24649",a0799a2b:"24685","833f2ec0":"24742",cc3db60c:"24857","90d535c2":"24869","9eb4e0db":"24883","1af9c7d3":"25035",a20e070a:"25048","74ea6b63":"25188","73578edf":"25294",e310b146:"25315","5f0700c5":"25857","2c828998":"25903",cce9ad1c:"25920",d9a6c9f9:"26090","28a6a789":"26191","60194cf2":"26723",d98b9f83:"26920",e8b14a65:"27102","96ecf107":"27385","1e27a2df":"27747",b1ecb9ed:"27800",bc07532a:"27865",d776f897:"28283","233cd645":"28573",c77a0576:"28698","0a61bc2e":"28761",de176c41:"28924","8d5bb253":"29172","3a5ec158":"29308",c2d56c21:"29354","1be78505":"29514",db6367fb:"29814","471dcc6f":"29889","385718d4":"30117","747a690f":"30636","1140a058":"30674",dff30c03:"31109",f13d29f3:"31114","6536e94a":"31150",f2b4d23e:"31158","2dcd28d2":"31262","7a35092c":"31326","5fb0ec3e":"31350","4aa43dae":"31552",c1dc13d0:"31800","3c41cfdf":"31883",ba11d205:"31955",fb5b11b0:"32039","916b8fda":"32107",dc14f0c4:"32567",e1d93203:"32661","85f847a7":"32672","6cb21577":"32674",afbc2852:"32737","723d2f26":"32921","20a5a532":"33089","20f8de15":"33731","5c0c3c72":"33871","5de53f8e":"33889",c4429c79:"33926",d4ef9144:"33937",c6dfd94e:"33947","3fa9568c":"34050","768ed1d7":"34154",f2720a78:"34211","199fcd36":"34229","33844ff3":"34490",cce23dfc:"34509","31b72ec5":"34737","3add1ba9":"34925",def6dfb9:"35097","1f86786a":"35257","1e26ddab":"35304",ef4e0518:"35349",c0908e63:"35477","6738a51a":"35506",f474b5ba:"35738",c275b7b1:"35755","7a8aa347":"36027",ea642db2:"36046","984b8319":"36425",a03f8b02:"36555","669b0b95":"37120",deb190e6:"37181","4980c4fa":"37209","02371d76":"37274",b942cf8e:"37435",cab54053:"37456",fa746f0e:"37638","2db499ae":"37737",b50d6289:"37799","8e97cc15":"37874","5d42a18a":"38137",c3a6b316:"38360","1b3816a8":"38574",e967512d:"38887","512d8cfa":"38968","75270caf":"39210",afd0cb1b:"39527","8b77e1a5":"39626",b0055554:"39652","330b8ea1":"39799","3f45f80c":"39843",e0c8a1d6:"39856","1de77d44":"40268","07e96687":"40280",cd8c9fbc:"40332","050638ff":"40381","67c4a832":"40548","1ee9c635":"40556","2d68e16b":"40597","1280552c":"41661","2f989304":"41856","55ac83aa":"42251","81ce5e0c":"42349","9f91e03b":"42404","8328e7f1":"42412","4f8f7d74":"42531","868893ac":"42541","14a767b9":"42958","315415ca":"42966",bb40a730:"43086","8d1ec4c5":"43521","0d529baa":"43559","186444dd":"43699","459956dd":"43760","5653e10f":"43905","277d517a":"43996",db759789:"44010","283e63f8":"44157","8256726e":"44232",f76e6047:"44663","677d6777":"44911","78b226dc":"44953","4be7e5d0":"44988","31d20e13":"45112","1d970e9f":"45190","5bcd0da1":"45452","8fa4918e":"45566","1074bb26":"45702",b1212599:"45939",acfb9a5e:"45977",ffecbc46:"45980",b198cec2:"46074",ccc49370:"46103",f259cf74:"46131",ea369cdd:"46343","77faeb23":"46353","7f6bbd73":"46526",ed03f5d4:"46667",e2c3bc5f:"46858",d4e06cde:"46940","58cbfb5a":"46953",e802237a:"46989","554f4bd3":"47077","326c0af7":"47214","741a738c":"47642","6c8cf0bf":"47974",c333ed9f:"48104","4f3e32ec":"48338","6875c492":"48610",a555a233:"48632","5ffd6909":"48690",f50ed874:"49158","6af54863":"49517",ef9227ec:"49558",d0ac1c30:"49808","6850cfb6":"50003","65e8e75e":"50103","5575e2a8":"50258",a5fe4d7b:"50298",cb128a98:"50339",de387681:"50403",af4b7be4:"50481",e19d86f2:"50533","853ddb5d":"50758",f77b4e82:"50813","186b492d":"50988","9c1835bf":"51035",cd910537:"51149","2127c55a":"51161",f7765531:"51296",bfbf9dff:"51456","708cde07":"51652","75ae40a4":"51818",c260b9a0:"51904","3f2ad086":"51917","4649e1c2":"52025","5cecf783":"52409","814f3328":"52535",d56f97cb:"52592","1d48afb9":"52610","734563d5":"52739","933a49e7":"52765","1c7cc376":"52853",a9bffa51:"52943","68987ad2":"53202","869c9c27":"53244","9e4087bc":"53608","87a2f1fc":"53695",bc4d6fc9:"53787","3a574a7f":"53962",b987a5c1:"54096",c942fcda:"54246",e57c1bef:"54980",bb8cf488:"55191","38eccbde":"55494","7f2f79c2":"55501","45062c3f":"55547",b1be30d1:"55606","341bd61f":"55776",e4608243:"55797",c302b7f6:"55870","4ef508e9":"56123","92e661e4":"56147","406b186f":"56522",fbcdd0ee:"56757","30995fb4":"56852","479e2d15":"57019","59e1a395":"57276",f2f7c8b6:"57463","86b52bb0":"57684","8b0d3319":"57698",aacecf0a:"58193",cc8c6322:"58290","507e1a4c":"58509","4e3d1533":"58701","60b808f2":"58974","5153790b":"59139","247783bb":"59334","133b4df0":"59424","4646a8a4":"59650","3124230e":"59891","13a2a5ae":"60330","271f7228":"60379",a9d6ad8a:"60595","699a47d0":"60712","22ef07eb":"60771","352bf367":"60992","20a7d97c":"61484","4ef2e3ea":"61624",f9ed4079:"61887",c3a5a911:"62126",a8faecbd:"62405",d80cee7e:"62425","0f427d40":"62650","906ba10e":"62921","9708a852":"63232",a69ebe5f:"63253","92af7f04":"63445",bd83a8c8:"63792","45a8dc52":"63812","0475f9cc":"63816","0b31129f":"63870",d493c3e8:"63952","01a85c17":"64013",c4f5d8e4:"64195","3cf47477":"64477","1e5c0d86":"64693",f3954950:"64709","6a3a4a87":"64880",a8c84974:"64887","460d220e":"64947","069211c5":"65146","0a451647":"65341","444d5ed4":"65442","9afa6cde":"65688","203262b0":"65826","25057d02":"66070","36ded102":"66102","59b068d1":"66385","029e4dc3":"66449",e6102057:"66526","0c8b9afa":"66609","802db911":"66618",ec576a8b:"66640","9e339b71":"66766",f24f0ea5:"66833","1cd349ba":"66863",f63f75e6:"67086",aa9c90f7:"67492",aea1a378:"67544","9b3efc75":"67547","36a143db":"67560",d44f5d69:"68165",c831614b:"68175","1c091541":"68271",d88d25ac:"68359","9f0412f1":"68538","5f16d91a":"68618","7b2e7fac":"69048","97a69baf":"69081",acd02317:"69104","4c2772ab":"69276","776f5947":"69279","8e10bb86":"69962",d40de319:"69972",b2b9b866:"70289",c6fe0741:"70351","6f4af312":"70363","6d30ac0a":"70486","77e868d9":"70970",c968f1a3:"71061","7fdc0c84":"71153","3685f909":"71592","371b21cb":"71760",f64a2f66:"72054",eae3fa10:"72099","6c5c20d6":"72514","193bf152":"72937","56b2a431":"72978","13c3e084":"73032","450c527f":"73446",fe1d477d:"73641","1954649e":"73745","9bb632fa":"74002","68cedfd5":"74083","89ebc8eb":"74113",d5e8cc91:"74134",b3198ac5:"74198","419e73d5":"74300","26c54994":"74697","1a43e018":"74888","9e96f049":"74927",fe36bf36:"74986","3cc638e0":"75558","4f688289":"75693",c08d79e7:"75878",a13b9d31:"76045",d060dfa6:"76126","6ccb7d3e":"76130","6d0c6131":"76575",c76eb7d5:"76660","8e37cc44":"76786","06b1e92d":"76791","771488fd":"76874",e2548c92:"76967","9e1f7384":"77012",f5d5b73d:"77055","374427da":"77159",e4f4dec4:"77169",af1b4014:"77217",dc819e53:"77431",a7434565:"77645","2fd22369":"78046",fcfb247d:"78082","10915d97":"78314",c541efc4:"78436",c98ac358:"78489","890759ea":"78659",c0daf1e6:"78823","1a98f2d5":"78914","88b398be":"78941","99d25280":"78985","62b71d38":"79495","7356945f":"79559",fae4f913:"79697",fa56ac42:"79993","935f2afb":"80053",d1e2a1e4:"80448","342f32a4":"80505",a1b695db:"80546","6620b2c9":"80867","4f989fdc":"81022","4549cb79":"81027","5f6910fd":"81155",e5e83212:"81186","6bb55549":"81312","1ddde2c7":"81475","70b40441":"81487","208114e0":"81511","92bdb8f4":"81649","5fa25c43":"81757","6310fd48":"81938","8ed61535":"82024","4cff7ce2":"82133",d080e3b1:"82251","46bd2088":"82276",dfd4abb8:"82461","5f1113d5":"82818",cd7cc5b2:"82838",eb4eb408:"82863","87d0342b":"83006",b85e9339:"83054","09b23959":"83278","07987921":"83834","500fb0e6":"83897",e0ecd9df:"83988","2eb941a5":"84022","3e171e78":"84568","08e43170":"84726","903c4f6f":"84728",ab0b43f0:"84761",f7f75c2e:"84784",bab68f7e:"84935",f5ff4ddf:"85040","5f0cc255":"85586","63b377ca":"85627",a6748c3f:"85634",c4816122:"85744",cc826739:"85960","22ff6767":"86179","565d3b3a":"86236","4224ef00":"86565","519cbeed":"86621","4256eaf4":"86719",fec351f2:"86904","2bf9c0b5":"86984","3bc428dc":"87070","1ff7f4b8":"87233",ede583c5:"87393","4cbb880b":"87557","81e594d4":"87644","6fa39f86":"87746","4f0c7b96":"87802",eec2ee36:"88180","879bb888":"88529","39e9cb37":"88652","376ff700":"88743","27e17dc0":"88795","9bf3c520":"88945",e4a50065:"89007",f48233a1:"89501","36788d15":"89642",ffc1986f:"89903","122cd6da":"89931","8435c5ad":"89959",c5495231:"90076","073713d1":"90111","82092fc0":"90288","845a8f5b":"90295",e7db057b:"90451",cc135780:"90500",b2b675dd:"90533",a12f1ef9:"90558","5426ac11":"90560","403863d9":"90713",b5efef1d:"90794",c2be96f9:"91374",b3022338:"91552",a3f9e536:"91637","524c9166":"91705",e866f873:"91878",d879ea04:"91910","3f85e7e0":"92079",bebb13e1:"92133",a9d16e82:"92544",fca34444:"92648","9d36e504":"92755",ef4780b0:"92778",a6aa9e1f:"93089","998a3ebe":"93233","216be533":"94218","09a69b27":"94349","10eaf6bf":"94498",dc62dd6c:"94610","4b2ec4d2":"94780","8d6bb331":"94814","4b75119c":"94831","7f0b639b":"95358","608d3bbe":"95520",a54058d6:"95676",c4fd3761:"95697","7b20acf0":"95752",dbbfaad4:"95960",ed48b979:"95990","8977ff65":"95997","2f4b7a65":"96168",a9808524:"96218",f08e269d:"96505","40fd761e":"96545","3035a8de":"96705","5f87d652":"96857","661132b8":"97092","8f102ef9":"97126","783bde4f":"97470","960d9980":"97595",f7d07906:"97847","60e9e07a":"97901","1a4e3797":"97920","22885a83":"97963","97db7bb8":"98074","15d749b5":"98216","28411ba4":"98418","61dbd605":"98510",a5bc4f28:"98772","6bf3b56c":"99217",fc5ff77a:"99295","9f45eacd":"99748",b37711b1:"99914"}[e]||e,r.p+r.u(e)},(()=>{var e={51303:0,40532:0};r.f.j=(f,c)=>{var d=r.o(e,f)?e[f]:void 0;if(0!==d)if(d)c.push(d[2]);else if(/^(40532|51303)$/.test(f))e[f]=0;else{var b=new Promise(((c,b)=>d=e[f]=[c,b]));c.push(d[2]=b);var a=r.p+r.u(f),t=new Error;r.l(a,(c=>{if(r.o(e,f)&&(0!==(d=e[f])&&(e[f]=void 0),d)){var b=c&&("load"===c.type?"missing":c.type),a=c&&c.target&&c.target.src;t.message="Loading chunk "+f+" failed.\n("+b+": "+a+")",t.name="ChunkLoadError",t.type=b,t.request=a,d[1](t)}}),"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,c)=>{var d,b,a=c[0],t=c[1],o=c[2],n=0;if(a.some((f=>0!==e[f]))){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(f&&f(c);n{"use strict";var e,f,c,d,b,a={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return a[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=a,r.c=t,e=[],r.O=(f,c,d,b)=>{if(!c){var a=1/0;for(i=0;i=b)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,b0&&e[i-1][2]>b;i--)e[i]=e[i-1];e[i]=[c,d,b]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var b=Object.create(null);r.r(b);var a={};f=f||[null,c({}),c([]),c(c)];for(var t=2&d&&e;"object"==typeof t&&!~f.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((f=>a[f]=()=>e[f]));return a.default=()=>e,r.d(b,a),b},r.d=(e,f)=>{for(var c in f)r.o(f,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:f[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((f,c)=>(r.f[c](e,f),f)),[])),r.u=e=>"assets/js/"+({75:"1ef0096b",160:"6f69b847",640:"c85c4b26",740:"fa811662",977:"b973dcfd",1080:"16aa9458",1140:"2bb14bf0",1177:"ceb3f8e5",1434:"fa9fb131",1589:"3e1cef53",1610:"e3a6d1ec",1685:"2f06f2be",1958:"6479f562",2110:"bd16d6fd",2232:"c64ebc62",2365:"f38541c0",3112:"97bb0f58",3132:"9915a91d",3673:"aae0663e",3812:"9d4548fb",3818:"a22153eb",4100:"c6cf652c",4213:"12ebab0f",4268:"f13ea377",4474:"f615a51d",4804:"60a00565",4825:"2d52fc42",4832:"ece86388",4993:"81c93763",5099:"f30a3d1e",5195:"c7bf2a3a",5332:"d3433875",5484:"4cd34504",5547:"da184dc1",5566:"1578031d",5670:"fcdeb347",6136:"9da9a498",6148:"ea0d3e91",6249:"0564f87a",6286:"e19908fc",6367:"6de65b44",6441:"bfb1735a",6450:"5ede04c0",6513:"7b81a468",6536:"f2ca2c55",6819:"39906be8",6895:"dd13b434",6905:"13a70009",7127:"cfc8229c",7330:"d9cb599e",7332:"1a848321",7432:"954fe712",7463:"21b56577",7483:"a6a264d3",7567:"f77d5673",7694:"aa1b4e53",7779:"89594773",7911:"54e91ab5",8012:"c0f0637e",8043:"823f7700",8076:"035d0344",8097:"20501ae4",8549:"b06371b7",8631:"0210b704",8697:"cb759659",8765:"4aaa0f44",8773:"da6f85e6",8985:"48052ce1",9084:"0a6f29e5",9112:"f93f95da",9260:"e150ab3e",9368:"d5cbae08",9562:"45b0764f",9938:"babb54f3",9955:"c582042f",9966:"60ab92b2",9985:"237f254e",10001:"8eb4e46b",10099:"f5f1347d",10301:"d5bc6e48",10309:"60f1bcf9",10324:"fe5f889f",10660:"437618c4",10810:"24f9e5ab",10924:"5e450bcf",10996:"caaf01d4",11168:"11e6d144",11258:"d40361ad",11439:"33e1509d",11477:"b2f554cd",11483:"5b5d0fd6",11509:"d5b44e8d",11702:"ced1473c",11713:"a7023ddc",11953:"1e9ef283",11990:"30ddeb5e",12229:"964386c1",12306:"3d5c28b0",12402:"466eff7a",12573:"5dfb628f",12620:"274548c6",12706:"d4c834e8",12831:"3062d10d",13208:"afaa1b56",13633:"5e1c9ef2",13812:"207ee67a",13834:"c4643d70",13986:"55cceff7",14050:"2e7fdd6f",14074:"bd6858b9",14419:"8c2c25e6",14583:"d04fedb5",14601:"81eac5d3",14641:"7cb85c78",14687:"5610898c",14694:"29a36bd7",14753:"ce5aebf3",14807:"d1c7c525",14817:"6aa8733e",15015:"2158648d",15160:"e709bacf",15288:"0452e1bb",15795:"5a047bf8",15847:"f6525c87",16057:"b083e7a6",16385:"f113023d",16611:"ffa0c411",16748:"a3f0333e",16785:"a7ce3f25",16819:"9ee43f4e",17191:"89f741ca",17238:"45b3f811",17371:"44ea6f94",17388:"97feb4e9",17466:"7d5cf9fd",17470:"1abd0bca",17753:"6680323d",17773:"285ad496",18047:"9997aecf",18073:"92009f0a",18141:"febd0338",18308:"83170ae2",18384:"614beed4",18442:"92999a1c",18527:"83218c8a",18902:"0e04b402",18918:"24a5cb68",18934:"d988931a",18967:"7a801707",19014:"50711b5c",19262:"80a6599d",19571:"29cfecd2",19624:"8f8e3a33",19692:"ea07b8e0",19761:"8f6fb258",19835:"e202e776",19873:"14ee1fe9",19881:"853164ef",19923:"006fd865",20183:"421999d2",20396:"7ee80f24",20512:"5f265cf4",20859:"c2367e06",20868:"3d8bf3ab",21111:"fba9f625",21151:"14ad7d65",21271:"8310c4f6",21317:"4a487c7d",21356:"0d1eeea0",21384:"32723a2e",21481:"919ee986",21665:"e56b7427",21685:"03cd8e1c",22226:"f5466782",22235:"3947b16e",22409:"5e1dea11",22605:"55bb925b",22623:"ecfe8209",22740:"e436cfad",22881:"e175f9f3",23024:"665c23b8",23046:"192eff61",23067:"57fbf2bd",23145:"84c1f0c8",23679:"12f62dc2",23872:"b5bd7f9b",23913:"3874af3e",24067:"8660c4b6",24219:"5e95c167",24378:"de4aaf36",24649:"89c724a9",24685:"a0799a2b",24742:"833f2ec0",24857:"cc3db60c",24869:"90d535c2",24883:"9eb4e0db",25035:"1af9c7d3",25048:"a20e070a",25188:"74ea6b63",25294:"73578edf",25315:"e310b146",25857:"5f0700c5",25903:"2c828998",25920:"cce9ad1c",26090:"d9a6c9f9",26191:"28a6a789",26723:"60194cf2",26920:"d98b9f83",27102:"e8b14a65",27385:"96ecf107",27747:"1e27a2df",27800:"b1ecb9ed",27865:"bc07532a",27918:"17896441",28283:"d776f897",28573:"233cd645",28698:"c77a0576",28761:"0a61bc2e",28924:"de176c41",29172:"8d5bb253",29308:"3a5ec158",29354:"c2d56c21",29514:"1be78505",29814:"db6367fb",29889:"471dcc6f",30117:"385718d4",30636:"747a690f",30674:"1140a058",31109:"dff30c03",31114:"f13d29f3",31150:"6536e94a",31158:"f2b4d23e",31262:"2dcd28d2",31326:"7a35092c",31350:"5fb0ec3e",31552:"4aa43dae",31800:"c1dc13d0",31883:"3c41cfdf",31955:"ba11d205",32039:"fb5b11b0",32107:"916b8fda",32567:"dc14f0c4",32661:"e1d93203",32672:"85f847a7",32674:"6cb21577",32737:"afbc2852",32921:"723d2f26",33089:"20a5a532",33731:"20f8de15",33871:"5c0c3c72",33889:"5de53f8e",33926:"c4429c79",33937:"d4ef9144",33947:"c6dfd94e",34050:"3fa9568c",34154:"768ed1d7",34211:"f2720a78",34229:"199fcd36",34490:"33844ff3",34509:"cce23dfc",34737:"31b72ec5",34925:"3add1ba9",35097:"def6dfb9",35257:"1f86786a",35304:"1e26ddab",35349:"ef4e0518",35477:"c0908e63",35506:"6738a51a",35738:"f474b5ba",35755:"c275b7b1",36027:"7a8aa347",36046:"ea642db2",36425:"984b8319",36555:"a03f8b02",37120:"669b0b95",37181:"deb190e6",37209:"4980c4fa",37274:"02371d76",37435:"b942cf8e",37456:"cab54053",37638:"fa746f0e",37737:"2db499ae",37799:"b50d6289",37874:"8e97cc15",38137:"5d42a18a",38360:"c3a6b316",38574:"1b3816a8",38887:"e967512d",38968:"512d8cfa",39210:"75270caf",39527:"afd0cb1b",39626:"8b77e1a5",39652:"b0055554",39799:"330b8ea1",39843:"3f45f80c",39856:"e0c8a1d6",40268:"1de77d44",40280:"07e96687",40332:"cd8c9fbc",40381:"050638ff",40548:"67c4a832",40556:"1ee9c635",40597:"2d68e16b",40804:"84810683",41661:"1280552c",41856:"2f989304",42251:"55ac83aa",42349:"81ce5e0c",42404:"9f91e03b",42412:"8328e7f1",42531:"4f8f7d74",42541:"868893ac",42958:"14a767b9",42966:"315415ca",43086:"bb40a730",43521:"8d1ec4c5",43559:"0d529baa",43699:"186444dd",43760:"459956dd",43905:"5653e10f",43996:"277d517a",44010:"db759789",44157:"283e63f8",44232:"8256726e",44663:"f76e6047",44911:"677d6777",44953:"78b226dc",44988:"4be7e5d0",45112:"31d20e13",45190:"1d970e9f",45452:"5bcd0da1",45566:"8fa4918e",45702:"1074bb26",45939:"b1212599",45977:"acfb9a5e",45980:"ffecbc46",46074:"b198cec2",46103:"ccc49370",46131:"f259cf74",46343:"ea369cdd",46353:"77faeb23",46526:"7f6bbd73",46667:"ed03f5d4",46858:"e2c3bc5f",46940:"d4e06cde",46953:"58cbfb5a",46989:"e802237a",47077:"554f4bd3",47214:"326c0af7",47642:"741a738c",47974:"6c8cf0bf",48104:"c333ed9f",48338:"4f3e32ec",48610:"6875c492",48632:"a555a233",48690:"5ffd6909",49158:"f50ed874",49517:"6af54863",49558:"ef9227ec",49808:"d0ac1c30",50003:"6850cfb6",50103:"65e8e75e",50258:"5575e2a8",50298:"a5fe4d7b",50339:"cb128a98",50403:"de387681",50481:"af4b7be4",50533:"e19d86f2",50758:"853ddb5d",50813:"f77b4e82",50988:"186b492d",51035:"9c1835bf",51149:"cd910537",51161:"2127c55a",51296:"f7765531",51456:"bfbf9dff",51652:"708cde07",51818:"75ae40a4",51904:"c260b9a0",51917:"3f2ad086",52025:"4649e1c2",52409:"5cecf783",52535:"814f3328",52592:"d56f97cb",52610:"1d48afb9",52739:"734563d5",52765:"933a49e7",52853:"1c7cc376",52943:"a9bffa51",53003:"10647879",53202:"68987ad2",53244:"869c9c27",53608:"9e4087bc",53695:"87a2f1fc",53787:"bc4d6fc9",53962:"3a574a7f",54096:"b987a5c1",54239:"77354108",54246:"c942fcda",54442:"61106173",54980:"e57c1bef",55191:"bb8cf488",55494:"38eccbde",55501:"7f2f79c2",55547:"45062c3f",55606:"b1be30d1",55776:"341bd61f",55797:"e4608243",55870:"c302b7f6",56123:"4ef508e9",56147:"92e661e4",56522:"406b186f",56757:"fbcdd0ee",56852:"30995fb4",57019:"479e2d15",57276:"59e1a395",57463:"f2f7c8b6",57684:"86b52bb0",57698:"8b0d3319",58193:"aacecf0a",58290:"cc8c6322",58509:"507e1a4c",58701:"4e3d1533",58974:"60b808f2",59139:"5153790b",59334:"247783bb",59424:"133b4df0",59650:"4646a8a4",59891:"3124230e",60330:"13a2a5ae",60379:"271f7228",60595:"a9d6ad8a",60712:"699a47d0",60771:"22ef07eb",60992:"352bf367",61484:"20a7d97c",61624:"4ef2e3ea",61887:"f9ed4079",62126:"c3a5a911",62405:"a8faecbd",62425:"d80cee7e",62650:"0f427d40",62921:"906ba10e",63232:"9708a852",63253:"a69ebe5f",63445:"92af7f04",63792:"bd83a8c8",63812:"45a8dc52",63816:"0475f9cc",63870:"0b31129f",63952:"d493c3e8",64013:"01a85c17",64195:"c4f5d8e4",64477:"3cf47477",64693:"1e5c0d86",64709:"f3954950",64880:"6a3a4a87",64887:"a8c84974",64947:"460d220e",65146:"069211c5",65341:"0a451647",65442:"444d5ed4",65688:"9afa6cde",65826:"203262b0",66070:"25057d02",66102:"36ded102",66385:"59b068d1",66449:"029e4dc3",66526:"e6102057",66609:"0c8b9afa",66618:"802db911",66640:"ec576a8b",66766:"9e339b71",66833:"f24f0ea5",66863:"1cd349ba",67086:"f63f75e6",67492:"aa9c90f7",67544:"aea1a378",67547:"9b3efc75",67560:"36a143db",68165:"d44f5d69",68175:"c831614b",68271:"1c091541",68359:"d88d25ac",68538:"9f0412f1",68618:"5f16d91a",69048:"7b2e7fac",69081:"97a69baf",69104:"acd02317",69276:"4c2772ab",69279:"776f5947",69962:"8e10bb86",69972:"d40de319",70289:"b2b9b866",70351:"c6fe0741",70363:"6f4af312",70486:"6d30ac0a",70970:"77e868d9",71061:"c968f1a3",71153:"7fdc0c84",71592:"3685f909",71760:"371b21cb",72054:"f64a2f66",72099:"eae3fa10",72514:"6c5c20d6",72543:"61428574",72937:"193bf152",72978:"56b2a431",73032:"13c3e084",73446:"450c527f",73641:"fe1d477d",73745:"1954649e",74002:"9bb632fa",74083:"68cedfd5",74113:"89ebc8eb",74134:"d5e8cc91",74198:"b3198ac5",74300:"419e73d5",74697:"26c54994",74888:"1a43e018",74927:"9e96f049",74986:"fe36bf36",75558:"3cc638e0",75693:"4f688289",75878:"c08d79e7",76045:"a13b9d31",76126:"d060dfa6",76130:"6ccb7d3e",76575:"6d0c6131",76660:"c76eb7d5",76786:"8e37cc44",76791:"06b1e92d",76874:"771488fd",76967:"e2548c92",77012:"9e1f7384",77055:"f5d5b73d",77159:"374427da",77169:"e4f4dec4",77217:"af1b4014",77431:"dc819e53",77645:"a7434565",78046:"2fd22369",78082:"fcfb247d",78314:"10915d97",78436:"c541efc4",78489:"c98ac358",78659:"890759ea",78823:"c0daf1e6",78914:"1a98f2d5",78941:"88b398be",78985:"99d25280",79495:"62b71d38",79559:"7356945f",79697:"fae4f913",79993:"fa56ac42",80053:"935f2afb",80448:"d1e2a1e4",80505:"342f32a4",80546:"a1b695db",80867:"6620b2c9",81022:"4f989fdc",81027:"4549cb79",81155:"5f6910fd",81186:"e5e83212",81312:"6bb55549",81475:"1ddde2c7",81487:"70b40441",81511:"208114e0",81649:"92bdb8f4",81757:"5fa25c43",81938:"6310fd48",82024:"8ed61535",82133:"4cff7ce2",82251:"d080e3b1",82276:"46bd2088",82461:"dfd4abb8",82818:"5f1113d5",82838:"cd7cc5b2",82863:"eb4eb408",83006:"87d0342b",83054:"b85e9339",83278:"09b23959",83834:"07987921",83897:"500fb0e6",83988:"e0ecd9df",84022:"2eb941a5",84568:"3e171e78",84726:"08e43170",84728:"903c4f6f",84761:"ab0b43f0",84784:"f7f75c2e",84935:"bab68f7e",85040:"f5ff4ddf",85528:"69802526",85586:"5f0cc255",85627:"63b377ca",85634:"a6748c3f",85744:"c4816122",85960:"cc826739",86179:"22ff6767",86236:"565d3b3a",86565:"4224ef00",86621:"519cbeed",86719:"4256eaf4",86904:"fec351f2",86984:"2bf9c0b5",87070:"3bc428dc",87233:"1ff7f4b8",87339:"53371809",87393:"ede583c5",87494:"90377122",87557:"4cbb880b",87644:"81e594d4",87746:"6fa39f86",87802:"4f0c7b96",88180:"eec2ee36",88529:"879bb888",88652:"39e9cb37",88743:"376ff700",88795:"27e17dc0",88945:"9bf3c520",89007:"e4a50065",89364:"96781795",89501:"f48233a1",89642:"36788d15",89903:"ffc1986f",89931:"122cd6da",89959:"8435c5ad",90076:"c5495231",90111:"073713d1",90288:"82092fc0",90295:"845a8f5b",90451:"e7db057b",90500:"cc135780",90533:"b2b675dd",90558:"a12f1ef9",90560:"5426ac11",90713:"403863d9",90794:"b5efef1d",91374:"c2be96f9",91552:"b3022338",91637:"a3f9e536",91705:"524c9166",91878:"e866f873",91910:"d879ea04",92079:"3f85e7e0",92133:"bebb13e1",92544:"a9d16e82",92648:"fca34444",92755:"9d36e504",92778:"ef4780b0",93089:"a6aa9e1f",93233:"998a3ebe",94218:"216be533",94349:"09a69b27",94498:"10eaf6bf",94610:"dc62dd6c",94780:"4b2ec4d2",94814:"8d6bb331",94831:"4b75119c",95358:"7f0b639b",95520:"608d3bbe",95676:"a54058d6",95697:"c4fd3761",95752:"7b20acf0",95960:"dbbfaad4",95990:"ed48b979",95997:"8977ff65",96168:"2f4b7a65",96218:"a9808524",96505:"f08e269d",96545:"40fd761e",96705:"3035a8de",96857:"5f87d652",97092:"661132b8",97126:"8f102ef9",97470:"783bde4f",97595:"960d9980",97847:"f7d07906",97901:"60e9e07a",97920:"1a4e3797",97963:"22885a83",98074:"97db7bb8",98216:"15d749b5",98418:"28411ba4",98510:"61dbd605",98772:"a5bc4f28",99217:"6bf3b56c",99295:"fc5ff77a",99748:"9f45eacd",99914:"b37711b1"}[e]||e)+"."+{75:"ba209844",160:"e5da974a",640:"66ba63be",740:"f8fe0687",977:"37a66585",1080:"75839613",1140:"f6d14862",1177:"082777f8",1434:"c824973e",1589:"281acca6",1610:"ce7b58c6",1685:"99feb5c1",1958:"85f702b2",2110:"0f784096",2232:"9658d2f9",2365:"49f92594",3112:"02619aa3",3132:"1f45356a",3473:"1483dcde",3673:"bc92d771",3812:"93a67fef",3818:"957afbad",4100:"22290676",4213:"73eaaf1d",4268:"3fd08826",4474:"de961bc6",4804:"04f2f7c6",4825:"81761ece",4832:"52c1e025",4972:"4be77f28",4993:"1cf962f5",5099:"57e37f03",5195:"160f7aa9",5332:"1cb5798a",5484:"07e4fd90",5547:"67f73252",5566:"92629b9f",5670:"c10c0fba",6136:"1161390f",6148:"e9eb81a4",6249:"a265052e",6286:"11710a8b",6367:"d9135d74",6441:"e1869af8",6450:"36add7bd",6513:"f024e403",6536:"31011f4a",6819:"f4f5903f",6895:"dcda0488",6905:"d4e00027",7127:"dd68e17d",7330:"4ef4ab4a",7332:"b857ce44",7432:"f8a6fc8e",7463:"d6f0a042",7483:"e7d12318",7567:"23918f0c",7694:"4e9066f1",7779:"b93e0e59",7911:"331b7672",8012:"32969560",8043:"8935a4bf",8076:"0a4bf576",8097:"ef3d21b7",8549:"0df3e3cf",8631:"b7382975",8697:"8ca7c083",8765:"0a76d68f",8773:"4d81694a",8985:"cb5697e6",9084:"69bd52e7",9112:"28ce530c",9260:"b001f541",9368:"f7459553",9562:"b89eeffa",9938:"e85ae0fe",9955:"0bf9d7ad",9966:"1e880894",9985:"e4b65888",10001:"72a963cf",10099:"fb91e017",10301:"2eef4727",10309:"ca3e9203",10324:"c2de2339",10660:"4b112633",10810:"693cdd37",10924:"3dea7a77",10996:"417dd662",11080:"a9a57c7f",11168:"6332c429",11258:"7ba63cf4",11439:"ec1f41be",11477:"96e255f9",11483:"f700070c",11509:"c1c793e8",11702:"36348560",11713:"4f831e89",11953:"ac2774dc",11990:"6f1e152a",12229:"a1555f6a",12306:"45f74160",12402:"92eb79ce",12573:"7f8af31d",12620:"6708a580",12706:"0e38d741",12831:"1c8512de",13208:"889e2bee",13633:"e10e3a7d",13812:"fdd71593",13834:"a3cd23ee",13986:"75337b20",14050:"fd1f6f94",14074:"e47f1d04",14419:"03102f22",14583:"3239a51d",14601:"9db1b629",14641:"ac02a688",14687:"6c5cdfd7",14694:"00f4a86d",14753:"2a30d1e8",14807:"bb356517",14817:"45c09681",15015:"c4993e25",15160:"8b2e1e0d",15288:"7666a3a7",15795:"d77e68a6",15847:"0e0140ca",16057:"3e3243a8",16385:"d0c54ce2",16611:"b662c302",16748:"7a3cebee",16785:"959cb550",16819:"e9bbabd5",17191:"d56d1632",17238:"c392ec24",17371:"7b3ae9c2",17388:"9854912e",17466:"4baea993",17470:"955454d6",17753:"fcd1093c",17773:"e83467c4",18047:"14fe704d",18073:"37fd2b33",18141:"86ccdae3",18308:"dd57902b",18384:"a31beba8",18442:"9c8def0e",18527:"4cab4fe6",18894:"d7313338",18902:"33bfb34f",18918:"bbc62c4f",18934:"49ec3c3e",18967:"de7564ae",19014:"a07ef9b7",19262:"772e85d3",19487:"378cff79",19571:"23cc0e8e",19624:"4ea75e07",19692:"96e8d169",19761:"e4477491",19835:"7ce8fcaa",19873:"fdfeacc6",19881:"9f8eef5f",19923:"b28cdacc",20183:"b9f04346",20396:"00139995",20512:"6b4c3c2e",20859:"983d2f46",20868:"0bdb5763",21111:"748e813f",21151:"17b7cefb",21271:"9738f32d",21317:"06716597",21356:"50058654",21384:"5ead3faf",21481:"c2468aba",21665:"01838e5d",21685:"af219096",22004:"8a0a8205",22226:"58eec50e",22235:"605b8183",22409:"fcfa855e",22605:"c23a1523",22623:"f9089edc",22740:"941548a5",22881:"a5c0fdf9",23024:"ea55a397",23046:"baec1de5",23067:"38984a4e",23145:"2bb4b601",23679:"c52bebdb",23872:"64f3f6c3",23913:"38adccf3",24067:"e7fa4d24",24219:"4f178d44",24378:"8dbbcf7f",24649:"29c6bcb6",24685:"e912586b",24742:"cfc45767",24857:"68f07ba6",24869:"63acd6ab",24883:"0cb8c08d",25035:"3f669cd3",25048:"86669071",25188:"e05119d5",25294:"8957ac63",25315:"99020981",25857:"40b1b5e0",25903:"7b117143",25920:"3819e594",26090:"bf670a25",26191:"0491cf3b",26723:"85c42d3d",26920:"fac27bc2",27102:"e72af470",27385:"0fff7ec2",27747:"7aa0b2a4",27800:"9abc5834",27865:"e9de5791",27918:"3f116c42",28283:"5d99ae9a",28573:"9795bb36",28698:"4489cbf4",28761:"c9a24612",28924:"56872f5a",29172:"7b317bcd",29308:"066b3654",29354:"8dcfc928",29514:"efc67b9d",29814:"5aeec07a",29889:"36ef29d6",30117:"28998c3f",30636:"d18def78",30674:"706dc5fa",31109:"a4dece73",31114:"2d583c5a",31150:"225e67c0",31158:"be3a3ab8",31262:"561bbfb1",31326:"e5cd2764",31350:"797cdcb4",31466:"0024b86f",31552:"47e94f50",31800:"500713fd",31883:"b11a41ca",31955:"78afdeb8",32039:"b07cc17c",32107:"f73206d0",32567:"3e10a887",32661:"fd96ce67",32672:"ad43de1f",32674:"10a168e7",32737:"4575b3cc",32921:"7ac0616d",33089:"3cd29263",33731:"8f426541",33871:"bf7d6434",33889:"b8a30553",33926:"dfb69ee5",33937:"20b5bb65",33947:"471b3468",34050:"6bd370e5",34154:"db98b20d",34211:"d6e150af",34229:"4ac390cb",34490:"e831d01d",34509:"be3de52c",34737:"9587808b",34925:"3e8bdb78",35097:"046756fd",35257:"e473e94c",35304:"41e6617c",35349:"23860a86",35477:"920c5501",35506:"28c13d96",35738:"1cbe4cc0",35755:"b0a98bd4",36027:"66c825d4",36046:"992ab4eb",36425:"5231b7ba",36555:"ed577aba",37120:"21c8837f",37181:"539e1b97",37209:"3f6b1eb8",37274:"64a56fee",37435:"1541074d",37456:"f438cb45",37638:"f294dc4b",37737:"7cddc5e5",37799:"4f98a08b",37874:"3a138488",38137:"7d2cdf24",38360:"4e90aa50",38574:"56c59737",38887:"8c09d6b0",38968:"050053fd",39210:"21d024e6",39527:"5533e988",39626:"4b6e93e1",39652:"23da6524",39799:"c2010732",39843:"3023fb36",39856:"4dee8915",40268:"305dab81",40280:"dfc9e302",40332:"2464db9c",40381:"1df00230",40548:"e713df2d",40556:"73785032",40597:"b079b4ae",40804:"5648c776",41661:"198a6972",41856:"c044cdf9",42251:"6c41ce9d",42349:"1ed3bd3f",42404:"ef580adc",42412:"afac3f8f",42531:"1f74be30",42541:"d19f7810",42958:"251ffce9",42966:"4e74d8c8",43086:"01e6fa8b",43521:"cbd9d642",43559:"9fb4bf18",43699:"623b825d",43760:"35880526",43905:"97a6cfcf",43996:"8a577e88",44010:"ca1e5778",44157:"fd2b5e94",44232:"7750fdda",44663:"d9b7bc27",44911:"1b3c5761",44953:"c9430191",44988:"ecb11f1d",45112:"2790a97e",45190:"f923059f",45452:"678c3dbc",45566:"d808e99d",45702:"b535f50d",45939:"bf514601",45977:"c86c9d46",45980:"21d4c72d",46048:"991a2a40",46074:"6b765fde",46103:"ffd73f5c",46131:"e9a1de90",46343:"e257bec0",46353:"97e9bfd6",46526:"71795cd9",46667:"03fb924e",46858:"cc97ccbe",46940:"ea33e3bb",46945:"a8617603",46953:"00fb7ea2",46989:"a46da357",47077:"e53f90f4",47214:"cbb1d2df",47642:"ade194dc",47724:"d962b239",47974:"d2c0d692",48104:"24c25af1",48338:"320ec0e2",48610:"9abf5873",48632:"85628934",48690:"bc3070bc",49158:"71fb8b88",49517:"46b2802e",49558:"8baf268e",49808:"2ecf26cf",50003:"08ea7e4a",50103:"48c3fcb1",50258:"11a82076",50298:"b0e0f93a",50339:"01a76df1",50403:"ed7faa9b",50481:"79ba5b89",50533:"62019771",50758:"d9924384",50813:"c77088e5",50988:"559e5ae8",51035:"d24439d0",51149:"d18cce62",51161:"71d23e39",51296:"09b058e6",51456:"713257bf",51652:"e6ecc0bc",51818:"87dad8e4",51904:"6487b1c8",51917:"df2bde5d",52025:"cb7bfba1",52409:"48c2215f",52535:"990ee279",52592:"503cc687",52610:"174e1fb1",52739:"80299de6",52765:"76c3c387",52853:"7f427d82",52943:"7c53cd0f",53003:"24731806",53202:"74d11ff9",53244:"559e1188",53608:"58cce4c5",53695:"7eea39ef",53787:"22734071",53962:"38d46a2d",54096:"f368feb4",54239:"7ddd28a4",54246:"8b0f306b",54442:"95972f5c",54980:"0df5011c",55191:"b060dc5a",55494:"0b379f9c",55501:"7bc602e1",55547:"6a2eb3d8",55606:"aa0d9394",55776:"95897bd5",55797:"73992098",55870:"07e6e2d2",56123:"0451191d",56147:"aded2add",56522:"2875452c",56757:"92b72a3c",56852:"a9f9e0e8",57019:"8611871f",57276:"c2270dd4",57463:"27ee395d",57684:"994e50b0",57698:"406ba3c5",58193:"54edadad",58290:"0d6d8221",58509:"e4cfc3cb",58701:"6355db4b",58974:"d00193cf",59139:"5f57b417",59334:"bc97b4af",59424:"63b50aef",59650:"d3e21286",59891:"a6c6b226",60330:"4ddc6504",60379:"37f65d99",60595:"33d164e1",60712:"9ba741e0",60771:"806bb9bb",60992:"ebd41dd6",61426:"b005faab",61484:"9070572a",61624:"e2e0b33e",61887:"370bfec7",62126:"2e6842cc",62405:"fb708fd1",62425:"935db492",62650:"baeae442",62921:"90d90ce0",63232:"d4165657",63253:"032ad655",63445:"738dfd73",63792:"f4a5b04e",63812:"520bf9a1",63816:"cfdfa4e6",63870:"5ddc4883",63952:"56dca9b6",64013:"599e8d04",64195:"37467830",64477:"880366e2",64693:"3591a451",64709:"0a02c2db",64880:"5483943f",64887:"93acfbce",64947:"a84b1560",65146:"5284aa98",65341:"074c1878",65442:"4b462267",65688:"c39dea2f",65826:"d0deea04",66070:"30b7f98a",66102:"f562315c",66385:"a981a7d1",66449:"1175abd2",66526:"a30fc757",66609:"a83f3bad",66618:"9e6de4b0",66640:"ca9dd737",66766:"cf3324fc",66833:"9539154b",66863:"a6456680",67086:"2a606fb9",67492:"7b1b3da8",67544:"44f25981",67547:"6aa55282",67560:"70abe5ee",68165:"cfc2184b",68175:"8e5c2bc6",68271:"b6fb9f60",68359:"c3e05124",68538:"04919a88",68618:"1b792ae9",69048:"a6d8ee91",69081:"1cbe58f2",69104:"434ddf10",69276:"79546110",69279:"2c16191a",69962:"407e25af",69972:"6a472a11",70289:"087dc897",70351:"1fbf6b6d",70363:"213a673d",70486:"d1979806",70970:"899290ee",71061:"aa73d1fe",71153:"c06434c4",71592:"ea4b6e59",71760:"f1820339",72054:"3beef3e6",72099:"8b5339a0",72514:"30c2305a",72543:"8a095fb6",72937:"bc79a7be",72978:"5b5fb654",73032:"d4406492",73446:"fbe9c3a0",73641:"2e7f1c57",73745:"a1b09a88",74002:"3c96ec89",74083:"51c6b576",74113:"534e16f6",74134:"62cb2464",74198:"0c6a28c2",74300:"90208db5",74697:"ec35cd16",74888:"e296f855",74927:"ecbed9ff",74986:"322752a6",75558:"46fcfd6b",75693:"60775094",75878:"6106dfbb",76045:"7150d692",76126:"caff1910",76130:"3cebd4b0",76575:"0d031bbc",76660:"c0edfa51",76786:"c01123e3",76791:"98c2ecbb",76874:"8a860019",76967:"2b7b93c5",77012:"424136c5",77055:"52d64481",77159:"fb637f1b",77169:"c85f7414",77217:"73da5c9e",77431:"488fbdaa",77645:"0d9ea538",78046:"b61f3e11",78082:"bb2abd1d",78314:"fc30bb20",78436:"bad65e65",78489:"07d0924a",78659:"5a1a8dd3",78823:"ca7a733a",78914:"ee403c7d",78941:"be3ab0f3",78985:"3babf463",79134:"2cb1d474",79495:"e788506f",79559:"c43d5cea",79697:"662c6265",79993:"28e7c668",80053:"59f1c35d",80448:"7bbda511",80505:"88574b97",80546:"5c09c361",80867:"97008892",81022:"9595b1a5",81027:"73d7e3c8",81155:"210ab5cf",81186:"97190397",81312:"57fce437",81475:"7ff082cb",81487:"ff495c77",81511:"8c18480e",81649:"2b9a813c",81757:"a6e99358",81938:"c77cdb8f",82024:"a9006cb4",82133:"de0c7c56",82251:"2789faaf",82276:"7b5e03b1",82461:"260515dd",82818:"c1d7836d",82838:"552dc70e",82863:"91149d10",83006:"91c44e75",83054:"1d15a998",83278:"82732e22",83834:"68361e02",83897:"345be9af",83988:"37c462d0",84022:"aa6e49d3",84568:"ec209866",84726:"1207266a",84728:"c0f72c02",84761:"6ca4b680",84784:"5e119fa7",84935:"bc522665",85040:"0020a767",85528:"2f3d83b3",85586:"cb2a9a88",85627:"123f3850",85634:"05248a84",85744:"6d83ff55",85960:"e8726691",86179:"bf6d094e",86236:"be8b499c",86565:"93c3b976",86621:"7000eb75",86719:"4d003468",86904:"148fb722",86984:"33aa1a23",87070:"563e9013",87233:"bfc96bfb",87339:"f970cade",87393:"e7c135d0",87494:"cb111aa8",87557:"708c5610",87644:"89b134ce",87746:"17adf1d7",87802:"f2a62bb2",88180:"b4f95828",88529:"90290f03",88652:"3fc6ee75",88743:"6b86988f",88795:"ee1fe83a",88945:"3a5752a3",89007:"e5688e55",89364:"b1698349",89501:"45b3f8b8",89642:"92e1f794",89903:"a08599c5",89931:"72aaf3f8",89959:"26fa247a",90076:"8ad4604b",90111:"01869f8f",90288:"a23779d5",90295:"a7b094cb",90451:"f8fb81e0",90500:"419e0882",90533:"ee8a8c85",90558:"f40c67ff",90560:"7bc975ec",90713:"b0fec256",90794:"673dbef2",91374:"15386fc1",91552:"87f75dd0",91637:"5add28d0",91705:"6ba4ccb5",91878:"795bfb68",91910:"9131b612",92079:"04ae30b0",92133:"1737bce4",92544:"1774cafd",92648:"3ee0cca8",92755:"332a5792",92778:"ed35f612",93089:"65e2c549",93233:"9a491502",94218:"6304aed3",94349:"46b52a8a",94498:"a0e25775",94610:"9f88de9e",94780:"5a2cf565",94814:"2616195a",94831:"979e575e",95358:"ad3493d9",95520:"f8165fd1",95676:"8d617ccd",95697:"c3b383d2",95752:"8a1e51fb",95960:"69129f52",95990:"879fe54a",95997:"afa624f5",96168:"6fb0b8f0",96218:"88e79e1b",96316:"e60530d6",96505:"ee8f3356",96545:"f9862151",96705:"a073cca6",96857:"4dc55093",97092:"1a30c487",97126:"10a39818",97470:"b3ded8b0",97595:"87836ff0",97847:"faf7274f",97901:"0a8cc66e",97920:"d35141b1",97963:"5ac2d968",98074:"573b406d",98216:"c6441497",98418:"268a13fc",98510:"a5da12a0",98772:"4cae51aa",99217:"78769dc1",99295:"61a5d491",99748:"8658188f",99914:"b4809dd8"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),d={},b="@openfn/docs:",r.l=(e,f,c,a)=>{if(d[e])d[e].push(f);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var b=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),b&&b.forEach((e=>e(c))),f)return f(c)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={10647879:"53003",17896441:"27918",53371809:"87339",61106173:"54442",61428574:"72543",69802526:"85528",77354108:"54239",84810683:"40804",89594773:"7779",90377122:"87494",96781795:"89364","1ef0096b":"75","6f69b847":"160",c85c4b26:"640",fa811662:"740",b973dcfd:"977","16aa9458":"1080","2bb14bf0":"1140",ceb3f8e5:"1177",fa9fb131:"1434","3e1cef53":"1589",e3a6d1ec:"1610","2f06f2be":"1685","6479f562":"1958",bd16d6fd:"2110",c64ebc62:"2232",f38541c0:"2365","97bb0f58":"3112","9915a91d":"3132",aae0663e:"3673","9d4548fb":"3812",a22153eb:"3818",c6cf652c:"4100","12ebab0f":"4213",f13ea377:"4268",f615a51d:"4474","60a00565":"4804","2d52fc42":"4825",ece86388:"4832","81c93763":"4993",f30a3d1e:"5099",c7bf2a3a:"5195",d3433875:"5332","4cd34504":"5484",da184dc1:"5547","1578031d":"5566",fcdeb347:"5670","9da9a498":"6136",ea0d3e91:"6148","0564f87a":"6249",e19908fc:"6286","6de65b44":"6367",bfb1735a:"6441","5ede04c0":"6450","7b81a468":"6513",f2ca2c55:"6536","39906be8":"6819",dd13b434:"6895","13a70009":"6905",cfc8229c:"7127",d9cb599e:"7330","1a848321":"7332","954fe712":"7432","21b56577":"7463",a6a264d3:"7483",f77d5673:"7567",aa1b4e53:"7694","54e91ab5":"7911",c0f0637e:"8012","823f7700":"8043","035d0344":"8076","20501ae4":"8097",b06371b7:"8549","0210b704":"8631",cb759659:"8697","4aaa0f44":"8765",da6f85e6:"8773","48052ce1":"8985","0a6f29e5":"9084",f93f95da:"9112",e150ab3e:"9260",d5cbae08:"9368","45b0764f":"9562",babb54f3:"9938",c582042f:"9955","60ab92b2":"9966","237f254e":"9985","8eb4e46b":"10001",f5f1347d:"10099",d5bc6e48:"10301","60f1bcf9":"10309",fe5f889f:"10324","437618c4":"10660","24f9e5ab":"10810","5e450bcf":"10924",caaf01d4:"10996","11e6d144":"11168",d40361ad:"11258","33e1509d":"11439",b2f554cd:"11477","5b5d0fd6":"11483",d5b44e8d:"11509",ced1473c:"11702",a7023ddc:"11713","1e9ef283":"11953","30ddeb5e":"11990","964386c1":"12229","3d5c28b0":"12306","466eff7a":"12402","5dfb628f":"12573","274548c6":"12620",d4c834e8:"12706","3062d10d":"12831",afaa1b56:"13208","5e1c9ef2":"13633","207ee67a":"13812",c4643d70:"13834","55cceff7":"13986","2e7fdd6f":"14050",bd6858b9:"14074","8c2c25e6":"14419",d04fedb5:"14583","81eac5d3":"14601","7cb85c78":"14641","5610898c":"14687","29a36bd7":"14694",ce5aebf3:"14753",d1c7c525:"14807","6aa8733e":"14817","2158648d":"15015",e709bacf:"15160","0452e1bb":"15288","5a047bf8":"15795",f6525c87:"15847",b083e7a6:"16057",f113023d:"16385",ffa0c411:"16611",a3f0333e:"16748",a7ce3f25:"16785","9ee43f4e":"16819","89f741ca":"17191","45b3f811":"17238","44ea6f94":"17371","97feb4e9":"17388","7d5cf9fd":"17466","1abd0bca":"17470","6680323d":"17753","285ad496":"17773","9997aecf":"18047","92009f0a":"18073",febd0338:"18141","83170ae2":"18308","614beed4":"18384","92999a1c":"18442","83218c8a":"18527","0e04b402":"18902","24a5cb68":"18918",d988931a:"18934","7a801707":"18967","50711b5c":"19014","80a6599d":"19262","29cfecd2":"19571","8f8e3a33":"19624",ea07b8e0:"19692","8f6fb258":"19761",e202e776:"19835","14ee1fe9":"19873","853164ef":"19881","006fd865":"19923","421999d2":"20183","7ee80f24":"20396","5f265cf4":"20512",c2367e06:"20859","3d8bf3ab":"20868",fba9f625:"21111","14ad7d65":"21151","8310c4f6":"21271","4a487c7d":"21317","0d1eeea0":"21356","32723a2e":"21384","919ee986":"21481",e56b7427:"21665","03cd8e1c":"21685",f5466782:"22226","3947b16e":"22235","5e1dea11":"22409","55bb925b":"22605",ecfe8209:"22623",e436cfad:"22740",e175f9f3:"22881","665c23b8":"23024","192eff61":"23046","57fbf2bd":"23067","84c1f0c8":"23145","12f62dc2":"23679",b5bd7f9b:"23872","3874af3e":"23913","8660c4b6":"24067","5e95c167":"24219",de4aaf36:"24378","89c724a9":"24649",a0799a2b:"24685","833f2ec0":"24742",cc3db60c:"24857","90d535c2":"24869","9eb4e0db":"24883","1af9c7d3":"25035",a20e070a:"25048","74ea6b63":"25188","73578edf":"25294",e310b146:"25315","5f0700c5":"25857","2c828998":"25903",cce9ad1c:"25920",d9a6c9f9:"26090","28a6a789":"26191","60194cf2":"26723",d98b9f83:"26920",e8b14a65:"27102","96ecf107":"27385","1e27a2df":"27747",b1ecb9ed:"27800",bc07532a:"27865",d776f897:"28283","233cd645":"28573",c77a0576:"28698","0a61bc2e":"28761",de176c41:"28924","8d5bb253":"29172","3a5ec158":"29308",c2d56c21:"29354","1be78505":"29514",db6367fb:"29814","471dcc6f":"29889","385718d4":"30117","747a690f":"30636","1140a058":"30674",dff30c03:"31109",f13d29f3:"31114","6536e94a":"31150",f2b4d23e:"31158","2dcd28d2":"31262","7a35092c":"31326","5fb0ec3e":"31350","4aa43dae":"31552",c1dc13d0:"31800","3c41cfdf":"31883",ba11d205:"31955",fb5b11b0:"32039","916b8fda":"32107",dc14f0c4:"32567",e1d93203:"32661","85f847a7":"32672","6cb21577":"32674",afbc2852:"32737","723d2f26":"32921","20a5a532":"33089","20f8de15":"33731","5c0c3c72":"33871","5de53f8e":"33889",c4429c79:"33926",d4ef9144:"33937",c6dfd94e:"33947","3fa9568c":"34050","768ed1d7":"34154",f2720a78:"34211","199fcd36":"34229","33844ff3":"34490",cce23dfc:"34509","31b72ec5":"34737","3add1ba9":"34925",def6dfb9:"35097","1f86786a":"35257","1e26ddab":"35304",ef4e0518:"35349",c0908e63:"35477","6738a51a":"35506",f474b5ba:"35738",c275b7b1:"35755","7a8aa347":"36027",ea642db2:"36046","984b8319":"36425",a03f8b02:"36555","669b0b95":"37120",deb190e6:"37181","4980c4fa":"37209","02371d76":"37274",b942cf8e:"37435",cab54053:"37456",fa746f0e:"37638","2db499ae":"37737",b50d6289:"37799","8e97cc15":"37874","5d42a18a":"38137",c3a6b316:"38360","1b3816a8":"38574",e967512d:"38887","512d8cfa":"38968","75270caf":"39210",afd0cb1b:"39527","8b77e1a5":"39626",b0055554:"39652","330b8ea1":"39799","3f45f80c":"39843",e0c8a1d6:"39856","1de77d44":"40268","07e96687":"40280",cd8c9fbc:"40332","050638ff":"40381","67c4a832":"40548","1ee9c635":"40556","2d68e16b":"40597","1280552c":"41661","2f989304":"41856","55ac83aa":"42251","81ce5e0c":"42349","9f91e03b":"42404","8328e7f1":"42412","4f8f7d74":"42531","868893ac":"42541","14a767b9":"42958","315415ca":"42966",bb40a730:"43086","8d1ec4c5":"43521","0d529baa":"43559","186444dd":"43699","459956dd":"43760","5653e10f":"43905","277d517a":"43996",db759789:"44010","283e63f8":"44157","8256726e":"44232",f76e6047:"44663","677d6777":"44911","78b226dc":"44953","4be7e5d0":"44988","31d20e13":"45112","1d970e9f":"45190","5bcd0da1":"45452","8fa4918e":"45566","1074bb26":"45702",b1212599:"45939",acfb9a5e:"45977",ffecbc46:"45980",b198cec2:"46074",ccc49370:"46103",f259cf74:"46131",ea369cdd:"46343","77faeb23":"46353","7f6bbd73":"46526",ed03f5d4:"46667",e2c3bc5f:"46858",d4e06cde:"46940","58cbfb5a":"46953",e802237a:"46989","554f4bd3":"47077","326c0af7":"47214","741a738c":"47642","6c8cf0bf":"47974",c333ed9f:"48104","4f3e32ec":"48338","6875c492":"48610",a555a233:"48632","5ffd6909":"48690",f50ed874:"49158","6af54863":"49517",ef9227ec:"49558",d0ac1c30:"49808","6850cfb6":"50003","65e8e75e":"50103","5575e2a8":"50258",a5fe4d7b:"50298",cb128a98:"50339",de387681:"50403",af4b7be4:"50481",e19d86f2:"50533","853ddb5d":"50758",f77b4e82:"50813","186b492d":"50988","9c1835bf":"51035",cd910537:"51149","2127c55a":"51161",f7765531:"51296",bfbf9dff:"51456","708cde07":"51652","75ae40a4":"51818",c260b9a0:"51904","3f2ad086":"51917","4649e1c2":"52025","5cecf783":"52409","814f3328":"52535",d56f97cb:"52592","1d48afb9":"52610","734563d5":"52739","933a49e7":"52765","1c7cc376":"52853",a9bffa51:"52943","68987ad2":"53202","869c9c27":"53244","9e4087bc":"53608","87a2f1fc":"53695",bc4d6fc9:"53787","3a574a7f":"53962",b987a5c1:"54096",c942fcda:"54246",e57c1bef:"54980",bb8cf488:"55191","38eccbde":"55494","7f2f79c2":"55501","45062c3f":"55547",b1be30d1:"55606","341bd61f":"55776",e4608243:"55797",c302b7f6:"55870","4ef508e9":"56123","92e661e4":"56147","406b186f":"56522",fbcdd0ee:"56757","30995fb4":"56852","479e2d15":"57019","59e1a395":"57276",f2f7c8b6:"57463","86b52bb0":"57684","8b0d3319":"57698",aacecf0a:"58193",cc8c6322:"58290","507e1a4c":"58509","4e3d1533":"58701","60b808f2":"58974","5153790b":"59139","247783bb":"59334","133b4df0":"59424","4646a8a4":"59650","3124230e":"59891","13a2a5ae":"60330","271f7228":"60379",a9d6ad8a:"60595","699a47d0":"60712","22ef07eb":"60771","352bf367":"60992","20a7d97c":"61484","4ef2e3ea":"61624",f9ed4079:"61887",c3a5a911:"62126",a8faecbd:"62405",d80cee7e:"62425","0f427d40":"62650","906ba10e":"62921","9708a852":"63232",a69ebe5f:"63253","92af7f04":"63445",bd83a8c8:"63792","45a8dc52":"63812","0475f9cc":"63816","0b31129f":"63870",d493c3e8:"63952","01a85c17":"64013",c4f5d8e4:"64195","3cf47477":"64477","1e5c0d86":"64693",f3954950:"64709","6a3a4a87":"64880",a8c84974:"64887","460d220e":"64947","069211c5":"65146","0a451647":"65341","444d5ed4":"65442","9afa6cde":"65688","203262b0":"65826","25057d02":"66070","36ded102":"66102","59b068d1":"66385","029e4dc3":"66449",e6102057:"66526","0c8b9afa":"66609","802db911":"66618",ec576a8b:"66640","9e339b71":"66766",f24f0ea5:"66833","1cd349ba":"66863",f63f75e6:"67086",aa9c90f7:"67492",aea1a378:"67544","9b3efc75":"67547","36a143db":"67560",d44f5d69:"68165",c831614b:"68175","1c091541":"68271",d88d25ac:"68359","9f0412f1":"68538","5f16d91a":"68618","7b2e7fac":"69048","97a69baf":"69081",acd02317:"69104","4c2772ab":"69276","776f5947":"69279","8e10bb86":"69962",d40de319:"69972",b2b9b866:"70289",c6fe0741:"70351","6f4af312":"70363","6d30ac0a":"70486","77e868d9":"70970",c968f1a3:"71061","7fdc0c84":"71153","3685f909":"71592","371b21cb":"71760",f64a2f66:"72054",eae3fa10:"72099","6c5c20d6":"72514","193bf152":"72937","56b2a431":"72978","13c3e084":"73032","450c527f":"73446",fe1d477d:"73641","1954649e":"73745","9bb632fa":"74002","68cedfd5":"74083","89ebc8eb":"74113",d5e8cc91:"74134",b3198ac5:"74198","419e73d5":"74300","26c54994":"74697","1a43e018":"74888","9e96f049":"74927",fe36bf36:"74986","3cc638e0":"75558","4f688289":"75693",c08d79e7:"75878",a13b9d31:"76045",d060dfa6:"76126","6ccb7d3e":"76130","6d0c6131":"76575",c76eb7d5:"76660","8e37cc44":"76786","06b1e92d":"76791","771488fd":"76874",e2548c92:"76967","9e1f7384":"77012",f5d5b73d:"77055","374427da":"77159",e4f4dec4:"77169",af1b4014:"77217",dc819e53:"77431",a7434565:"77645","2fd22369":"78046",fcfb247d:"78082","10915d97":"78314",c541efc4:"78436",c98ac358:"78489","890759ea":"78659",c0daf1e6:"78823","1a98f2d5":"78914","88b398be":"78941","99d25280":"78985","62b71d38":"79495","7356945f":"79559",fae4f913:"79697",fa56ac42:"79993","935f2afb":"80053",d1e2a1e4:"80448","342f32a4":"80505",a1b695db:"80546","6620b2c9":"80867","4f989fdc":"81022","4549cb79":"81027","5f6910fd":"81155",e5e83212:"81186","6bb55549":"81312","1ddde2c7":"81475","70b40441":"81487","208114e0":"81511","92bdb8f4":"81649","5fa25c43":"81757","6310fd48":"81938","8ed61535":"82024","4cff7ce2":"82133",d080e3b1:"82251","46bd2088":"82276",dfd4abb8:"82461","5f1113d5":"82818",cd7cc5b2:"82838",eb4eb408:"82863","87d0342b":"83006",b85e9339:"83054","09b23959":"83278","07987921":"83834","500fb0e6":"83897",e0ecd9df:"83988","2eb941a5":"84022","3e171e78":"84568","08e43170":"84726","903c4f6f":"84728",ab0b43f0:"84761",f7f75c2e:"84784",bab68f7e:"84935",f5ff4ddf:"85040","5f0cc255":"85586","63b377ca":"85627",a6748c3f:"85634",c4816122:"85744",cc826739:"85960","22ff6767":"86179","565d3b3a":"86236","4224ef00":"86565","519cbeed":"86621","4256eaf4":"86719",fec351f2:"86904","2bf9c0b5":"86984","3bc428dc":"87070","1ff7f4b8":"87233",ede583c5:"87393","4cbb880b":"87557","81e594d4":"87644","6fa39f86":"87746","4f0c7b96":"87802",eec2ee36:"88180","879bb888":"88529","39e9cb37":"88652","376ff700":"88743","27e17dc0":"88795","9bf3c520":"88945",e4a50065:"89007",f48233a1:"89501","36788d15":"89642",ffc1986f:"89903","122cd6da":"89931","8435c5ad":"89959",c5495231:"90076","073713d1":"90111","82092fc0":"90288","845a8f5b":"90295",e7db057b:"90451",cc135780:"90500",b2b675dd:"90533",a12f1ef9:"90558","5426ac11":"90560","403863d9":"90713",b5efef1d:"90794",c2be96f9:"91374",b3022338:"91552",a3f9e536:"91637","524c9166":"91705",e866f873:"91878",d879ea04:"91910","3f85e7e0":"92079",bebb13e1:"92133",a9d16e82:"92544",fca34444:"92648","9d36e504":"92755",ef4780b0:"92778",a6aa9e1f:"93089","998a3ebe":"93233","216be533":"94218","09a69b27":"94349","10eaf6bf":"94498",dc62dd6c:"94610","4b2ec4d2":"94780","8d6bb331":"94814","4b75119c":"94831","7f0b639b":"95358","608d3bbe":"95520",a54058d6:"95676",c4fd3761:"95697","7b20acf0":"95752",dbbfaad4:"95960",ed48b979:"95990","8977ff65":"95997","2f4b7a65":"96168",a9808524:"96218",f08e269d:"96505","40fd761e":"96545","3035a8de":"96705","5f87d652":"96857","661132b8":"97092","8f102ef9":"97126","783bde4f":"97470","960d9980":"97595",f7d07906:"97847","60e9e07a":"97901","1a4e3797":"97920","22885a83":"97963","97db7bb8":"98074","15d749b5":"98216","28411ba4":"98418","61dbd605":"98510",a5bc4f28:"98772","6bf3b56c":"99217",fc5ff77a:"99295","9f45eacd":"99748",b37711b1:"99914"}[e]||e,r.p+r.u(e)},(()=>{var e={51303:0,40532:0};r.f.j=(f,c)=>{var d=r.o(e,f)?e[f]:void 0;if(0!==d)if(d)c.push(d[2]);else if(/^(40532|51303)$/.test(f))e[f]=0;else{var b=new Promise(((c,b)=>d=e[f]=[c,b]));c.push(d[2]=b);var a=r.p+r.u(f),t=new Error;r.l(a,(c=>{if(r.o(e,f)&&(0!==(d=e[f])&&(e[f]=void 0),d)){var b=c&&("load"===c.type?"missing":c.type),a=c&&c.target&&c.target.src;t.message="Loading chunk "+f+" failed.\n("+b+": "+a+")",t.name="ChunkLoadError",t.type=b,t.request=a,d[1](t)}}),"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,c)=>{var d,b,a=c[0],t=c[1],o=c[2],n=0;if(a.some((f=>0!==e[f]))){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(f&&f(c);n - + @@ -72,7 +72,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/2020/05/31/the-new-openfn-blog.html b/blog/2020/05/31/the-new-openfn-blog.html index ea08f7732a1..307079c39b7 100644 --- a/blog/2020/05/31/the-new-openfn-blog.html +++ b/blog/2020/05/31/the-new-openfn-blog.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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 a9fd14bbd08..b28cdc94da2 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 @@ -22,7 +22,7 @@ - + @@ -95,7 +95,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 13bdb51e765..0e7a75a34ef 100644 --- a/blog/2020/06/04/Technology-Isnt-The-Answer.html +++ b/blog/2020/06/04/Technology-Isnt-The-Answer.html @@ -22,7 +22,7 @@ - + @@ -73,7 +73,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 9105c3260c6..3f5afcd125a 100644 --- a/blog/2020/06/09/enabling-scale-at-myagro.html +++ b/blog/2020/06/09/enabling-scale-at-myagro.html @@ -22,7 +22,7 @@ - + @@ -62,7 +62,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 ae64939d46d..bb778c8a233 100644 --- a/blog/2020/06/10/iKapaData-Case-Study.html +++ b/blog/2020/06/10/iKapaData-Case-Study.html @@ -22,7 +22,7 @@ - + @@ -53,7 +53,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 33613ac26a4..ebbb9864ac9 100644 --- a/blog/2020/06/25/SwissTPH-case-study.html +++ b/blog/2020/06/25/SwissTPH-case-study.html @@ -22,7 +22,7 @@ - + @@ -54,7 +54,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 96eb40db58c..ea47c8f8bc7 100644 --- a/blog/2020/07/01/KGVK-case-study.html +++ b/blog/2020/07/01/KGVK-case-study.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,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 c5a287f9401..4464ca780e9 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 @@ -22,7 +22,7 @@ - + @@ -50,7 +50,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 28de06dd1a9..d7e196c9389 100644 --- a/blog/2020/07/01/airport-case-study.html +++ b/blog/2020/07/01/airport-case-study.html @@ -22,7 +22,7 @@ - + @@ -52,7 +52,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 a6c12b8f38d..80656f00c24 100644 --- a/blog/2020/07/08/caris-foundation-case-study.html +++ b/blog/2020/07/08/caris-foundation-case-study.html @@ -22,7 +22,7 @@ - + @@ -67,7 +67,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 628f7633a2a..083d09be67a 100644 --- a/blog/2020/07/13/x-runner-case-study.html +++ b/blog/2020/07/13/x-runner-case-study.html @@ -22,7 +22,7 @@ - + @@ -51,7 +51,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 53b9f0c65ad..38988d9ca9f 100644 --- a/blog/2020/07/26/sinapis-case-study.html +++ b/blog/2020/07/26/sinapis-case-study.html @@ -22,7 +22,7 @@ - + @@ -57,7 +57,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 86644ab9c27..28287dd45d5 100644 --- a/blog/2020/07/27/nalibali-case-study.html +++ b/blog/2020/07/27/nalibali-case-study.html @@ -22,7 +22,7 @@ - + @@ -60,7 +60,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 b8ede8f7132..89c190cff2b 100644 --- a/blog/2021/02/09/interoperability_for_case_referrals.html +++ b/blog/2021/02/09/interoperability_for_case_referrals.html @@ -22,7 +22,7 @@ - + @@ -89,7 +89,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 6dc003471a4..99b05a4c098 100644 --- a/blog/2021/03/30/digital-global-good.html +++ b/blog/2021/03/30/digital-global-good.html @@ -22,7 +22,7 @@ - + @@ -141,7 +141,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 c1240fd5b8e..afac63fd196 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 @@ -22,7 +22,7 @@ - + @@ -117,7 +117,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 da244e852c8..d57b8da6bf5 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 @@ -22,7 +22,7 @@ - + @@ -61,7 +61,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 5c457cea419..b7b50f5e9d4 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" @@ -22,13 +22,13 @@ - +

    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 c6f18b4c16c..d156efb1c5f 100644 --- a/blog/2022/10/06/Monitoring-program-enrollment-in-Brazil.html +++ b/blog/2022/10/06/Monitoring-program-enrollment-in-Brazil.html @@ -22,7 +22,7 @@ - + @@ -74,7 +74,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 3e1c7cb4d5c..4af32b710e2 100644 --- a/blog/2023/03/01/open-human.html +++ b/blog/2023/03/01/open-human.html @@ -22,7 +22,7 @@ - + @@ -80,7 +80,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 d2f31e46e8f..127d690a3a0 100644 --- a/blog/2023/04/13/lightning-beta.html +++ b/blog/2023/04/13/lightning-beta.html @@ -22,7 +22,7 @@ - + @@ -55,7 +55,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 bf09cfd2797..0f37676f44a 100644 --- a/blog/2023/06/01/open-function-group.html +++ b/blog/2023/06/01/open-function-group.html @@ -22,7 +22,7 @@ - + @@ -91,7 +91,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 1eb01303ea9..a151d83b23b 100644 --- a/blog/2023/08/14/OS4H-case-study.html +++ b/blog/2023/08/14/OS4H-case-study.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,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 731ddbfecbc..6acf3357cb1 100644 --- a/blog/2023/11/07/Monitoring-child-protection-in-Cambodia.html +++ b/blog/2023/11/07/Monitoring-child-protection-in-Cambodia.html @@ -22,14 +22,14 @@ - +

    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/archive.html b/blog/archive.html index e2365262f4c..bde97ecbb92 100644 --- a/blog/archive.html +++ b/blog/archive.html @@ -22,13 +22,13 @@ - +

    Archive

    Archive

    - + \ No newline at end of file diff --git a/blog/page/2.html b/blog/page/2.html index d184cdb408f..34f2b0dbdeb 100644 --- a/blog/page/2.html +++ b/blog/page/2.html @@ -22,7 +22,7 @@ - + @@ -58,7 +58,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/page/3.html b/blog/page/3.html index 31b4554963f..579caab6b59 100644 --- a/blog/page/3.html +++ b/blog/page/3.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,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 72809208ffb..7a50dff9834 100644 --- a/blog/tags.html +++ b/blog/tags.html @@ -22,13 +22,13 @@ - + - + \ 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 07ee3eec31f..8ead411895b 100644 --- a/blog/tags/african-school-of-excellence.html +++ b/blog/tags/african-school-of-excellence.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/agriculture.html b/blog/tags/agriculture.html index 8f4a1aa7e37..c3c666fed7d 100644 --- a/blog/tags/agriculture.html +++ b/blog/tags/agriculture.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 d7a84c4c554..cf344d06dfe 100644 --- a/blog/tags/airport.html +++ b/blog/tags/airport.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 01dd13f1e1e..d36f086ab77 100644 --- a/blog/tags/amp-impact.html +++ b/blog/tags/amp-impact.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 3649cc2a35e..5db6eccb1da 100644 --- a/blog/tags/announcement.html +++ b/blog/tags/announcement.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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 5e73cef9a9e..58dc5a5c29d 100644 --- a/blog/tags/automated-reporting.html +++ b/blog/tags/automated-reporting.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,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 8b9065f3c1c..f7b6602c287 100644 --- a/blog/tags/brazil.html +++ b/blog/tags/brazil.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 ab46c845299..e7f03fb01ae 100644 --- a/blog/tags/cambodia.html +++ b/blog/tags/cambodia.html @@ -22,7 +22,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/caris-foundation.html b/blog/tags/caris-foundation.html index d98deb186aa..b4840478bed 100644 --- a/blog/tags/caris-foundation.html +++ b/blog/tags/caris-foundation.html @@ -22,14 +22,14 @@ - + - + \ No newline at end of file diff --git a/blog/tags/carto.html b/blog/tags/carto.html index fea78b7ccf9..d992d6df2f2 100644 --- a/blog/tags/carto.html +++ b/blog/tags/carto.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 8d726cd0d9f..aa7413af379 100644 --- a/blog/tags/case-management.html +++ b/blog/tags/case-management.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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 c867a4ddd47..c1785e5ab21 100644 --- a/blog/tags/case-study.html +++ b/blog/tags/case-study.html @@ -22,7 +22,7 @@ - + @@ -55,7 +55,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 891b68599e9..50524430803 100644 --- a/blog/tags/case-study/page/2.html +++ b/blog/tags/case-study/page/2.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,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 a1187e196de..b3aa0721a19 100644 --- a/blog/tags/child-protection.html +++ b/blog/tags/child-protection.html @@ -22,14 +22,14 @@ - +

    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 1a3c7503c6a..d92d6748572 100644 --- a/blog/tags/comm-care.html +++ b/blog/tags/comm-care.html @@ -22,7 +22,7 @@ - + @@ -40,7 +40,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 a42f2534ac9..71b8b02c5a2 100644 --- a/blog/tags/data-monitoring.html +++ b/blog/tags/data-monitoring.html @@ -22,7 +22,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-warehouse.html b/blog/tags/data-warehouse.html index 71d583b16d4..f1f7a778328 100644 --- a/blog/tags/data-warehouse.html +++ b/blog/tags/data-warehouse.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/deployment.html b/blog/tags/deployment.html index 72797d4613e..15bc1bdd4ef 100644 --- a/blog/tags/deployment.html +++ b/blog/tags/deployment.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,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 be658ce380a..886b0a7102f 100644 --- a/blog/tags/development.html +++ b/blog/tags/development.html @@ -22,7 +22,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/dhis-2.html b/blog/tags/dhis-2.html index 23e4f945143..ba86f3b3646 100644 --- a/blog/tags/dhis-2.html +++ b/blog/tags/dhis-2.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 85537e47cb6..4c8fc9207f6 100644 --- a/blog/tags/education.html +++ b/blog/tags/education.html @@ -22,7 +22,7 @@ - + @@ -40,7 +40,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 730dc10e7e0..463a8a0e523 100644 --- a/blog/tags/global-goods.html +++ b/blog/tags/global-goods.html @@ -22,7 +22,7 @@ - + @@ -43,7 +43,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 3f7c30943a1..d73d845e766 100644 --- a/blog/tags/health.html +++ b/blog/tags/health.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,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 9e3614434f3..6efea657dad 100644 --- a/blog/tags/healthcare.html +++ b/blog/tags/healthcare.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,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 bce3432cf85..2f25fe63c92 100644 --- a/blog/tags/i-kapa-data.html +++ b/blog/tags/i-kapa-data.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 d27b0593ac3..9fa8a3a2873 100644 --- a/blog/tags/ibm-maximo.html +++ b/blog/tags/ibm-maximo.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 afa6f3739dd..f8571269d72 100644 --- a/blog/tags/kgvk.html +++ b/blog/tags/kgvk.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/kobo-toolbox.html b/blog/tags/kobo-toolbox.html index 17d38a9f9b1..b58cfa3dc56 100644 --- a/blog/tags/kobo-toolbox.html +++ b/blog/tags/kobo-toolbox.html @@ -22,13 +22,13 @@ - +

    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 10c548d217a..880782ebfa4 100644 --- a/blog/tags/kopo-kopo.html +++ b/blog/tags/kopo-kopo.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/learning-management-system.html b/blog/tags/learning-management-system.html index af1733513c6..ecea3388d86 100644 --- a/blog/tags/learning-management-system.html +++ b/blog/tags/learning-management-system.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 3bc4f4fd693..fc2900feacb 100644 --- a/blog/tags/m-e.html +++ b/blog/tags/m-e.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 9c56859baf4..2624911fbf6 100644 --- a/blog/tags/m-pesa.html +++ b/blog/tags/m-pesa.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/moh.html b/blog/tags/moh.html index 63fbb31a515..7ea3b474bc8 100644 --- a/blog/tags/moh.html +++ b/blog/tags/moh.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,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 c29e52fcc98..5c58d923b5d 100644 --- a/blog/tags/mssql.html +++ b/blog/tags/mssql.html @@ -22,13 +22,13 @@ - +

    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 df693b4f903..07087cf254b 100644 --- a/blog/tags/my-agro.html +++ b/blog/tags/my-agro.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 1693e4d94e3..0aaf9f9f906 100644 --- a/blog/tags/my-sql.html +++ b/blog/tags/my-sql.html @@ -22,14 +22,14 @@ - + - + \ No newline at end of file diff --git a/blog/tags/odk.html b/blog/tags/odk.html index 504452ae494..0ee11a451ac 100644 --- a/blog/tags/odk.html +++ b/blog/tags/odk.html @@ -22,7 +22,7 @@ - + @@ -37,7 +37,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 ada14ec3985..f18b8452c11 100644 --- a/blog/tags/open-solutions-for-health.html +++ b/blog/tags/open-solutions-for-health.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,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 80e7963f401..58f6ce7f1f0 100644 --- a/blog/tags/os-4-h.html +++ b/blog/tags/os-4-h.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,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 547fba6e3ae..746d3926095 100644 --- a/blog/tags/os-ca-r.html +++ b/blog/tags/os-ca-r.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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 7f36787a768..f48972cb3aa 100644 --- a/blog/tags/payments.html +++ b/blog/tags/payments.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/postgre-sql.html b/blog/tags/postgre-sql.html index 810079553f2..5c6c62dcf54 100644 --- a/blog/tags/postgre-sql.html +++ b/blog/tags/postgre-sql.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,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 47af38e9bf8..2299751b4d9 100644 --- a/blog/tags/primero.html +++ b/blog/tags/primero.html @@ -22,7 +22,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/redash.html b/blog/tags/redash.html index 08313c52a8d..2d886e0ebd7 100644 --- a/blog/tags/redash.html +++ b/blog/tags/redash.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/salesforce.html b/blog/tags/salesforce.html index 0f384a76ee9..a057a366c4f 100644 --- a/blog/tags/salesforce.html +++ b/blog/tags/salesforce.html @@ -22,7 +22,7 @@ - + @@ -49,7 +49,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 935393837c3..eead6464f83 100644 --- a/blog/tags/sftp.html +++ b/blog/tags/sftp.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 5fc72be4cad..75a1fbb78e5 100644 --- a/blog/tags/sms.html +++ b/blog/tags/sms.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,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 13b3b2c58b1..43bad292ab5 100644 --- a/blog/tags/st-lucia.html +++ b/blog/tags/st-lucia.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,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 5e3ebb5de67..5241f472d83 100644 --- a/blog/tags/supply-chain-system.html +++ b/blog/tags/supply-chain-system.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 5a3670dffef..6de2b6f9384 100644 --- a/blog/tags/survey-cto.html +++ b/blog/tags/survey-cto.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 2f77d801b5e..8cb880ce2ff 100644 --- a/blog/tags/swiss-tph.html +++ b/blog/tags/swiss-tph.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 82078cfae32..74b5782a7ea 100644 --- a/blog/tags/telerivet.html +++ b/blog/tags/telerivet.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 d858bac2be8..2ff0ce42fce 100644 --- a/blog/tags/tips.html +++ b/blog/tags/tips.html @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/blog/tags/unicef.html b/blog/tags/unicef.html index 895312aa10d..a3b3306ebed 100644 --- a/blog/tags/unicef.html +++ b/blog/tags/unicef.html @@ -22,7 +22,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/wash.html b/blog/tags/wash.html index 6eae1d4f931..851ececbc57 100644 --- a/blog/tags/wash.html +++ b/blog/tags/wash.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 b6d3a04f0e3..dcde77e653a 100644 --- a/blog/tags/wcs.html +++ b/blog/tags/wcs.html @@ -22,13 +22,13 @@ - +

    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 c5c1d7d9465..4891cb56987 100644 --- a/blog/tags/wildlife.html +++ b/blog/tags/wildlife.html @@ -22,13 +22,13 @@ - +

    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 7dc48c38b02..f825e746dda 100644 --- a/blog/tags/workflow-automation.html +++ b/blog/tags/workflow-automation.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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 9e30c76ef21..162ae177e9a 100644 --- a/blog/tags/x-runner.html +++ b/blog/tags/x-runner.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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 bd8f37b5e84..f6b393359de 100644 --- a/blog/tags/zoho.html +++ b/blog/tags/zoho.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,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 b9997978da3..f80750472b7 100644 --- a/documentation.html +++ b/documentation.html @@ -22,7 +22,7 @@ - + @@ -73,7 +73,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/about-lightning.html b/documentation/about-lightning.html index 34f0b49f068..a06c9343c2e 100644 --- a/documentation/about-lightning.html +++ b/documentation/about-lightning.html @@ -22,7 +22,7 @@ - + @@ -50,7 +50,7 @@ projects (owner/admin/editor/viewer)
  • Transfer credential ownership to another user
  • View an audit trail of all credential changes (superuser role)
  • Set up SSO via an identity provider
  • Generate and revoke API tokens
  • List projects, jobs and runs via JSON API
  • Workflow builder​
    • Create a new workflow with a webhook or cron trigger
    • Create and configure jobs for a workflow with any OpenFn adaptor and operation
    • Create credentials through a form
    • View all available operations for a given adaptor
    • View the metadata from your external system (DHIS2 and Salesforce)
    • View the input and output from the last run of each job in a workflow
    • Run a job manually
    Runs history​
    • View all runs grouped by workflow
    • Search and filter runs by status, workflow and run logs
    • Retry a workflow run from the start (first job)
    Project settings​
    • Get notified via email on run failure
    • Receive a daily, weekly or monthly digest of project activity
    • View collaborators for a project
    • Update a project name and description

    Roadmap​

    See the Lightning Roadmap for a detailed list of features that are in the backlog, planned, and/or in development for the OpenFn Digital Public Good.

    You can follow our progress and track delivered features in our -changelog.

    Try it out​

    Please note

    Lightning is still in Beta.

    You have 3 options for exploring OpenFn/Lightning:

    1. For quick viewing, visit demo.openfn.org and log +changelog.

      Try it out​

      Please note

      Lightning is still in Beta. Full release planned for Q4 2023.

      You have 3 options for exploring OpenFn/Lightning:

      1. For quick viewing, visit demo.openfn.org and log into our demo account with username: demo@openfn.org password: welcome123. (NOTE that any changes made here are lost when the demo resets every 24 hours. I.e., don't build things you'd like to keep.)
      2. To get your own account and start building non-production workflows, register @@ -137,11 +137,11 @@ different systems.

        What will I lose by switching from platform to Lightning?​

        Right now: version control, authentication rules on webhooks, and the other features in our roadmap (we’re still in beta).

        Later: nothing - if a feature has proven important to our platform users, it will be available in Lightning. If there is any feature you require in Lightning -to be able to switch over to it, speak up ! You can reach out to our product -manager Amber via email or even better book some time -with her through her calendar.

        When will Lightning Beta be ready?​

        Lightning is currently in private Beta. You can register for an account on -app.openfn.org.

        - +to be able to switch over to it, speak up! You can reach out to our team via the +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/about.html b/documentation/about.html index 243693809ee..a31e3583e14 100644 --- a/documentation/about.html +++ b/documentation/about.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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/build/credentials.html b/documentation/build/credentials.html index 87346c082b5..bb1aea0acf6 100644 --- a/documentation/build/credentials.html +++ b/documentation/build/credentials.html @@ -22,7 +22,7 @@ - + @@ -41,7 +41,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/build/example-build.html b/documentation/build/example-build.html index 929b7ca59cf..029e06376e9 100644 --- a/documentation/build/example-build.html +++ b/documentation/build/example-build.html @@ -22,7 +22,7 @@ - + @@ -98,7 +98,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/build/inbox.html b/documentation/build/inbox.html index 03e2c22057a..c19ffb95022 100644 --- a/documentation/build/inbox.html +++ b/documentation/build/inbox.html @@ -22,7 +22,7 @@ - + @@ -64,7 +64,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/build/jobs.html b/documentation/build/jobs.html index 97aabd8ebb5..ccb6a93286c 100644 --- a/documentation/build/jobs.html +++ b/documentation/build/jobs.html @@ -22,7 +22,7 @@ - + @@ -143,7 +143,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/build/lightning-quick-start.html b/documentation/build/lightning-quick-start.html index 3970492e834..60a24a88dec 100644 --- a/documentation/build/lightning-quick-start.html +++ b/documentation/build/lightning-quick-start.html @@ -22,7 +22,7 @@ - + @@ -97,7 +97,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/build/triggers.html b/documentation/build/triggers.html index 394c74edc26..086ff8d9bef 100644 --- a/documentation/build/triggers.html +++ b/documentation/build/triggers.html @@ -22,7 +22,7 @@ - + @@ -81,7 +81,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/build/troubleshooting.html b/documentation/build/troubleshooting.html index 512fccf6ffa..aa6d0428795 100644 --- a/documentation/build/troubleshooting.html +++ b/documentation/build/troubleshooting.html @@ -22,7 +22,7 @@ - + @@ -78,7 +78,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/cli.html b/documentation/cli.html index 24419964fd2..2f0b4d1042c 100644 --- a/documentation/cli.html +++ b/documentation/cli.html @@ -22,7 +22,7 @@ - + @@ -163,7 +163,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/core.html b/documentation/core.html index 183c7f630ba..14de54e1bf6 100644 --- a/documentation/core.html +++ b/documentation/core.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,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/deploy/options.html b/documentation/deploy/options.html index c6a058cc828..1f4978a1730 100644 --- a/documentation/deploy/options.html +++ b/documentation/deploy/options.html @@ -22,7 +22,7 @@ - + @@ -66,7 +66,7 @@ the export).
      3. 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/requirements.html b/documentation/deploy/requirements.html index e0f2a938e09..bbd9dee63d6 100644 --- a/documentation/deploy/requirements.html +++ b/documentation/deploy/requirements.html @@ -22,7 +22,7 @@ - + @@ -74,7 +74,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 for the Erlang orchestration app and the Javascript worker app.

      - + \ No newline at end of file diff --git a/documentation/design/design-quickstart.html b/documentation/design/design-quickstart.html index 4b85ec36976..6673506f090 100644 --- a/documentation/design/design-quickstart.html +++ b/documentation/design/design-quickstart.html @@ -22,7 +22,7 @@ - + @@ -107,7 +107,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/when-to-integrate.html b/documentation/design/when-to-integrate.html index c93336f0687..b292c1ec878 100644 --- a/documentation/design/when-to-integrate.html +++ b/documentation/design/when-to-integrate.html @@ -22,14 +22,14 @@ - +
      - + \ No newline at end of file diff --git a/documentation/devtools/home.html b/documentation/devtools/home.html index 8f79edcc061..70c20200b8a 100644 --- a/documentation/devtools/home.html +++ b/documentation/devtools/home.html @@ -22,7 +22,7 @@ - + @@ -115,7 +115,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/faqs.html b/documentation/faqs.html index 7fe8c0dfd55..59f74ef25c3 100644 --- a/documentation/faqs.html +++ b/documentation/faqs.html @@ -22,7 +22,7 @@ - + @@ -166,7 +166,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/for-devs.html b/documentation/for-devs.html index 2a569da724e..d23667d227b 100644 --- a/documentation/for-devs.html +++ b/documentation/for-devs.html @@ -22,7 +22,7 @@ - + @@ -69,7 +69,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/getting-started/commcare-project-walkthrough.html b/documentation/getting-started/commcare-project-walkthrough.html index d1f6ce6bc89..de63de64e0c 100644 --- a/documentation/getting-started/commcare-project-walkthrough.html +++ b/documentation/getting-started/commcare-project-walkthrough.html @@ -22,7 +22,7 @@ - + @@ -99,7 +99,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/getting-started/glossary.html b/documentation/getting-started/glossary.html index 69230fa9895..7b26ca70295 100644 --- a/documentation/getting-started/glossary.html +++ b/documentation/getting-started/glossary.html @@ -22,7 +22,7 @@ - + @@ -96,7 +96,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/getting-started/implementation-checklist.html b/documentation/getting-started/implementation-checklist.html index c7f96aaf7e8..18528e78b55 100644 --- a/documentation/getting-started/implementation-checklist.html +++ b/documentation/getting-started/implementation-checklist.html @@ -22,7 +22,7 @@ - + @@ -42,7 +42,7 @@ Read about mapping specs here..
    2. Data element mapping specifications finalized (functional/business-friendly version)
    3. Client sign-offs on workflow diagram & mapping specs
    4. Workflow assumptions documented (e.g., what human, manual steps does the workflow rely on; what are the unique identifiers)
    5. Testing scenarios drafted
    6. (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/getting-started/integrating-using-openfn.html b/documentation/getting-started/integrating-using-openfn.html index 20b2e4178ac..79cfab26ce7 100644 --- a/documentation/getting-started/integrating-using-openfn.html +++ b/documentation/getting-started/integrating-using-openfn.html @@ -22,7 +22,7 @@ - + @@ -32,7 +32,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/getting-started/integration-toolkit.html b/documentation/getting-started/integration-toolkit.html index c2b403be9ef..88962893db3 100644 --- a/documentation/getting-started/integration-toolkit.html +++ b/documentation/getting-started/integration-toolkit.html @@ -22,7 +22,7 @@ - + @@ -71,7 +71,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/getting-started/security.html b/documentation/getting-started/security.html index 42fba5832f0..d82882abbcc 100644 --- a/documentation/getting-started/security.html +++ b/documentation/getting-started/security.html @@ -22,7 +22,7 @@ - + @@ -49,7 +49,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/getting-started/so-you-want-to-integrate.html b/documentation/getting-started/so-you-want-to-integrate.html index a33ada6410c..28ada01029f 100644 --- a/documentation/getting-started/so-you-want-to-integrate.html +++ b/documentation/getting-started/so-you-want-to-integrate.html @@ -22,7 +22,7 @@ - + @@ -36,7 +36,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 @@ -45,7 +45,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 @@ -66,7 +66,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/getting-started/terminology.html b/documentation/getting-started/terminology.html index 9380a08f0f7..892d548cb94 100644 --- a/documentation/getting-started/terminology.html +++ b/documentation/getting-started/terminology.html @@ -22,7 +22,7 @@ - + @@ -101,7 +101,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/gsoc.html b/documentation/gsoc.html index 530e5741874..a30e550cef2 100644 --- a/documentation/gsoc.html +++ b/documentation/gsoc.html @@ -22,7 +22,7 @@ - + @@ -67,7 +67,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/instant-openhie.html b/documentation/instant-openhie.html index b54bbfa4d99..028adbff385 100644 --- a/documentation/instant-openhie.html +++ b/documentation/instant-openhie.html @@ -22,7 +22,7 @@ - + @@ -178,7 +178,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/jobs/each.html b/documentation/jobs/each.html index baeb19c2b23..547d645a8ee 100644 --- a/documentation/jobs/each.html +++ b/documentation/jobs/each.html @@ -22,7 +22,7 @@ - + @@ -52,7 +52,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/jobs/editing_locally.html b/documentation/jobs/editing_locally.html index 90418cc2d09..1bc2f24fc59 100644 --- a/documentation/jobs/editing_locally.html +++ b/documentation/jobs/editing_locally.html @@ -22,7 +22,7 @@ - + @@ -53,7 +53,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/jobs/errors.html b/documentation/jobs/errors.html index 03f81b4aec2..e805ba2a5ce 100644 --- a/documentation/jobs/errors.html +++ b/documentation/jobs/errors.html @@ -22,7 +22,7 @@ - + @@ -53,7 +53,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/jobs/job-design-intro.html b/documentation/jobs/job-design-intro.html index 7ceee062404..7a2f6f9690a 100644 --- a/documentation/jobs/job-design-intro.html +++ b/documentation/jobs/job-design-intro.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,7 @@ doesn’t; references an external Id b. Example from language-dhis2 using Tracked Entity Instances (TEI)
    7. updateTEI(...)
    8. 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/jobs/job-studio.html b/documentation/jobs/job-studio.html index 249d3e1cc8b..13659775032 100644 --- a/documentation/jobs/job-studio.html +++ b/documentation/jobs/job-studio.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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/jobs/limits.html b/documentation/jobs/limits.html index 167c80d6c27..0dc65b15146 100644 --- a/documentation/jobs/limits.html +++ b/documentation/jobs/limits.html @@ -22,7 +22,7 @@ - + @@ -49,7 +49,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/jobs/multiple-operations.html b/documentation/jobs/multiple-operations.html index 41c90145652..b2757478b50 100644 --- a/documentation/jobs/multiple-operations.html +++ b/documentation/jobs/multiple-operations.html @@ -22,7 +22,7 @@ - + @@ -40,7 +40,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/jobs/operations.html b/documentation/jobs/operations.html index aa38069344e..fdc50fcefd8 100644 --- a/documentation/jobs/operations.html +++ b/documentation/jobs/operations.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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/jobs/state.html b/documentation/jobs/state.html index 67f36c69c77..4bd3bbf481f 100644 --- a/documentation/jobs/state.html +++ b/documentation/jobs/state.html @@ -22,7 +22,7 @@ - + @@ -40,7 +40,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/jobs/understanding.html b/documentation/jobs/understanding.html index f1bdb2f321c..044ed3e8d06 100644 --- a/documentation/jobs/understanding.html +++ b/documentation/jobs/understanding.html @@ -22,7 +22,7 @@ - + @@ -43,7 +43,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/jobs/working_with_branches.html b/documentation/jobs/working_with_branches.html index ca98a2365c5..86fa8ffe68c 100644 --- a/documentation/jobs/working_with_branches.html +++ b/documentation/jobs/working_with_branches.html @@ -22,7 +22,7 @@ - + @@ -48,7 +48,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/manage/platform-mgmt.html b/documentation/manage/platform-mgmt.html index b7924694be0..c59a10598dd 100644 --- a/documentation/manage/platform-mgmt.html +++ b/documentation/manage/platform-mgmt.html @@ -22,7 +22,7 @@ - + @@ -373,7 +373,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/manage/troubleshooting-tips-on-platform.html b/documentation/manage/troubleshooting-tips-on-platform.html index 3a8e6b5b2f4..d539cab4906 100644 --- a/documentation/manage/troubleshooting-tips-on-platform.html +++ b/documentation/manage/troubleshooting-tips-on-platform.html @@ -22,7 +22,7 @@ - + @@ -116,7 +116,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/microservice/home.html b/documentation/microservice/home.html index 2ef4ec38c00..a3a26f5d188 100644 --- a/documentation/microservice/home.html +++ b/documentation/microservice/home.html @@ -22,7 +22,7 @@ - + @@ -80,7 +80,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/next.html b/documentation/next.html index 2b125db553d..69e89aeee06 100644 --- a/documentation/next.html +++ b/documentation/next.html @@ -22,7 +22,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/next/build-with-api.html b/documentation/next/build-with-api.html index 9e5e2149623..8b776a36150 100644 --- a/documentation/next/build-with-api.html +++ b/documentation/next/build-with-api.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Build with the OpenFn API

    Build with API (link to Github) / Build an Adaptor

    - + \ No newline at end of file diff --git a/documentation/next/build/credentials.html b/documentation/next/build/credentials.html index 29e6da07595..bb1d7fb4a89 100644 --- a/documentation/next/build/credentials.html +++ b/documentation/next/build/credentials.html @@ -22,7 +22,7 @@ - + @@ -41,7 +41,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/next/build/triggers-cron.html b/documentation/next/build/triggers-cron.html index d458b6c95b1..bf8088e41b7 100644 --- a/documentation/next/build/triggers-cron.html +++ b/documentation/next/build/triggers-cron.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Cron Triggers

    Incl. cron expressions

    - + \ No newline at end of file diff --git a/documentation/next/build/triggers-webhook.html b/documentation/next/build/triggers-webhook.html index 44a7e800384..f6016367226 100644 --- a/documentation/next/build/triggers-webhook.html +++ b/documentation/next/build/triggers-webhook.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Webhook Triggers

    Incl. authentication methods

    - + \ No newline at end of file diff --git a/documentation/next/build/triggers.html b/documentation/next/build/triggers.html index c6fd3f5ca1a..cf155284461 100644 --- a/documentation/next/build/triggers.html +++ b/documentation/next/build/triggers.html @@ -22,7 +22,7 @@ - + @@ -80,7 +80,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/next/build/troubleshooting.html b/documentation/next/build/troubleshooting.html index 40562707245..3d0676ce327 100644 --- a/documentation/next/build/troubleshooting.html +++ b/documentation/next/build/troubleshooting.html @@ -22,7 +22,7 @@ - + @@ -78,7 +78,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/next/build/tutorial.html b/documentation/next/build/tutorial.html index 045ba3ec78c..64acd103ecc 100644 --- a/documentation/next/build/tutorial.html +++ b/documentation/next/build/tutorial.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Tutorial: Creating your first workflow

    Under construction

    This docs page is under construction. Check back later for the complete docs, or check out the Docs Version "Platform (v1)".

    - + \ No newline at end of file diff --git a/documentation/next/build/workflows.html b/documentation/next/build/workflows.html index 5048ebb995d..5cb2000dad7 100644 --- a/documentation/next/build/workflows.html +++ b/documentation/next/build/workflows.html @@ -22,7 +22,7 @@ - + @@ -143,7 +143,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/next/cli.html b/documentation/next/cli.html index 1e775d198a5..de5f50544ee 100644 --- a/documentation/next/cli.html +++ b/documentation/next/cli.html @@ -22,7 +22,7 @@ - + @@ -163,7 +163,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/next/contributing/openfn-roadmap.html b/documentation/next/contributing/openfn-roadmap.html index 5be8e969090..4a8aa938be5 100644 --- a/documentation/next/contributing/openfn-roadmap.html +++ b/documentation/next/contributing/openfn-roadmap.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,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/next/contributing/roadmap.html b/documentation/next/contributing/roadmap.html index b0ad04572aa..ce16f4dd167 100644 --- a/documentation/next/contributing/roadmap.html +++ b/documentation/next/contributing/roadmap.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,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/next/contributing/writing-code.html b/documentation/next/contributing/writing-code.html index aa9c3ec8ac9..a4729a91019 100644 --- a/documentation/next/contributing/writing-code.html +++ b/documentation/next/contributing/writing-code.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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/next/contributing/writing-docs.html b/documentation/next/contributing/writing-docs.html index 70cd3238f28..9e544b193ce 100644 --- a/documentation/next/contributing/writing-docs.html +++ b/documentation/next/contributing/writing-docs.html @@ -22,7 +22,7 @@ - + @@ -46,7 +46,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/next/deploy/options.html b/documentation/next/deploy/options.html index e92fe6a79a2..f02c0439f70 100644 --- a/documentation/next/deploy/options.html +++ b/documentation/next/deploy/options.html @@ -22,7 +22,7 @@ - + @@ -66,7 +66,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/next/deploy/portability-versions.html b/documentation/next/deploy/portability-versions.html index edf8be2c73b..07dbeae6206 100644 --- a/documentation/next/deploy/portability-versions.html +++ b/documentation/next/deploy/portability-versions.html @@ -22,7 +22,7 @@ - + @@ -39,7 +39,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/next/deploy/portability.html b/documentation/next/deploy/portability.html index 9fbd822e8a3..9a5bc11ac30 100644 --- a/documentation/next/deploy/portability.html +++ b/documentation/next/deploy/portability.html @@ -22,7 +22,7 @@ - + @@ -82,7 +82,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/next/deploy/requirements.html b/documentation/next/deploy/requirements.html index 76c786cad0d..2d0afcb5046 100644 --- a/documentation/next/deploy/requirements.html +++ b/documentation/next/deploy/requirements.html @@ -22,7 +22,7 @@ - + @@ -74,7 +74,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 for the Erlang orchestration app and the Javascript worker app.

    - + \ No newline at end of file diff --git a/documentation/next/design/api-discovery.html b/documentation/next/design/api-discovery.html index 0ab1ebf22f1..ec6c38086eb 100644 --- a/documentation/next/design/api-discovery.html +++ b/documentation/next/design/api-discovery.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Discovering APIs to inform your workflow automation design

    How to analyze API docs and draft technical diagrams (technical WF diagram, update your solution architecture diagram)

    - + \ No newline at end of file diff --git a/documentation/next/design/design-workflow.html b/documentation/next/design/design-workflow.html index abeaa0f7a7b..548c1083c88 100644 --- a/documentation/next/design/design-workflow.html +++ b/documentation/next/design/design-workflow.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Designing your first OpenFn workflow

    How to diagram; intro to BPMN standard & links to resources

    - + \ No newline at end of file diff --git a/documentation/next/design/discovery.html b/documentation/next/design/discovery.html index 47f44d5526a..d278bf9a7c5 100644 --- a/documentation/next/design/discovery.html +++ b/documentation/next/design/discovery.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Discovery & Scoping for OpenFn Projects

    Share key scoping questions and introduce solution architecture diagram

    - + \ No newline at end of file diff --git a/documentation/next/design/mapping-specs.html b/documentation/next/design/mapping-specs.html index 409aa1a7b3f..49c182b2eb4 100644 --- a/documentation/next/design/mapping-specs.html +++ b/documentation/next/design/mapping-specs.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Mapping data elements to define data integration & automation rules

    Mapping template & process overview

    - + \ No newline at end of file diff --git a/documentation/next/design/overview.html b/documentation/next/design/overview.html index 05d9d27d9ce..87c74ce1b69 100644 --- a/documentation/next/design/overview.html +++ b/documentation/next/design/overview.html @@ -22,7 +22,7 @@ - + @@ -107,7 +107,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/next/design/workflow-specs.html b/documentation/next/design/workflow-specs.html index 3aec9cd3e36..bc14e2219cc 100644 --- a/documentation/next/design/workflow-specs.html +++ b/documentation/next/design/workflow-specs.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Writing specifications for workflow automation solutions

    Specifications checklist; hand off to implementers

    - + \ No newline at end of file diff --git a/documentation/next/developers/each.html b/documentation/next/developers/each.html index 87631ccff4b..84cd1fa38a7 100644 --- a/documentation/next/developers/each.html +++ b/documentation/next/developers/each.html @@ -22,7 +22,7 @@ - + @@ -52,7 +52,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/next/developers/editing-locally.html b/documentation/next/developers/editing-locally.html index 77547916577..c11ac620487 100644 --- a/documentation/next/developers/editing-locally.html +++ b/documentation/next/developers/editing-locally.html @@ -22,7 +22,7 @@ - + @@ -53,7 +53,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/next/developers/errors.html b/documentation/next/developers/errors.html index 2f9857bd539..aa3d02eb6ff 100644 --- a/documentation/next/developers/errors.html +++ b/documentation/next/developers/errors.html @@ -22,7 +22,7 @@ - + @@ -53,7 +53,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/next/developers/for-devs.html b/documentation/next/developers/for-devs.html index 9c0d0a4e618..33b54767f5a 100644 --- a/documentation/next/developers/for-devs.html +++ b/documentation/next/developers/for-devs.html @@ -22,7 +22,7 @@ - + @@ -69,7 +69,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/next/developers/job-design-intro.html b/documentation/next/developers/job-design-intro.html index f3ad275756b..40caae0c632 100644 --- a/documentation/next/developers/job-design-intro.html +++ b/documentation/next/developers/job-design-intro.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,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/next/developers/job-studio.html b/documentation/next/developers/job-studio.html index 96a1542afd3..d3bf5e4c27a 100644 --- a/documentation/next/developers/job-studio.html +++ b/documentation/next/developers/job-studio.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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/next/developers/limits.html b/documentation/next/developers/limits.html index 4c33fe3a3b0..387839b1c35 100644 --- a/documentation/next/developers/limits.html +++ b/documentation/next/developers/limits.html @@ -22,7 +22,7 @@ - + @@ -45,7 +45,7 @@ message. If the dataclips produced by the final state of runs and attempts are too large, you will no be able to access them and instead see:

    { "__lightning": "Run result too large to save" }

    Instance superusers can control this limit via the MAX_DATACLIP_SIZE environment variable.

    - + \ No newline at end of file diff --git a/documentation/next/developers/multiple-operations.html b/documentation/next/developers/multiple-operations.html index 09906531297..b887015961f 100644 --- a/documentation/next/developers/multiple-operations.html +++ b/documentation/next/developers/multiple-operations.html @@ -22,7 +22,7 @@ - + @@ -40,7 +40,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/next/developers/operations.html b/documentation/next/developers/operations.html index 89cff219b6a..14393c2c50f 100644 --- a/documentation/next/developers/operations.html +++ b/documentation/next/developers/operations.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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/next/developers/state.html b/documentation/next/developers/state.html index b23676f44aa..e622f878057 100644 --- a/documentation/next/developers/state.html +++ b/documentation/next/developers/state.html @@ -22,7 +22,7 @@ - + @@ -40,7 +40,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/next/developers/understanding.html b/documentation/next/developers/understanding.html index 04bcf1b957c..2451304d8d3 100644 --- a/documentation/next/developers/understanding.html +++ b/documentation/next/developers/understanding.html @@ -22,7 +22,7 @@ - + @@ -43,7 +43,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/next/developers/working-with-branches.html b/documentation/next/developers/working-with-branches.html index abfbd08aa72..d24030059fc 100644 --- a/documentation/next/developers/working-with-branches.html +++ b/documentation/next/developers/working-with-branches.html @@ -22,7 +22,7 @@ - + @@ -48,7 +48,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/next/history/activity-history.html b/documentation/next/history/activity-history.html index 45028ad7c1b..06084ea9be1 100644 --- a/documentation/next/history/activity-history.html +++ b/documentation/next/history/activity-history.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Activity History Overview

    Under construction

    This docs page is under construction. Check back later for the complete docs, or check out the Docs Version "Platform (v1)".

    - + \ No newline at end of file diff --git a/documentation/next/intro/implementation-checklist.html b/documentation/next/intro/implementation-checklist.html index ebf376ff5ca..27a73b6d3d0 100644 --- a/documentation/next/intro/implementation-checklist.html +++ b/documentation/next/intro/implementation-checklist.html @@ -22,7 +22,7 @@ - + @@ -42,7 +42,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/next/intro/security-compliance.html b/documentation/next/intro/security-compliance.html index 4a095f9f4ea..15b745a7241 100644 --- a/documentation/next/intro/security-compliance.html +++ b/documentation/next/intro/security-compliance.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Security and Compliance in your OpenFn Projects

    General OpenFn security language; link to website for SaaS-relevant info?

    - + \ No newline at end of file diff --git a/documentation/next/intro/security.html b/documentation/next/intro/security.html index ac2d7fa096c..a28feb35129 100644 --- a/documentation/next/intro/security.html +++ b/documentation/next/intro/security.html @@ -22,7 +22,7 @@ - + @@ -49,7 +49,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/next/intro/standards.html b/documentation/next/intro/standards.html index 45b3a27e9c7..0071bc44b54 100644 --- a/documentation/next/intro/standards.html +++ b/documentation/next/intro/standards.html @@ -22,7 +22,7 @@ - + @@ -74,7 +74,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/next/intro/terminology.html b/documentation/next/intro/terminology.html index 17b48db48cd..2114bdb5d12 100644 --- a/documentation/next/intro/terminology.html +++ b/documentation/next/intro/terminology.html @@ -22,7 +22,7 @@ - + @@ -101,7 +101,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/next/projects/platform-mgmt.html b/documentation/next/projects/platform-mgmt.html index 630467aec5b..b6be06e4d8d 100644 --- a/documentation/next/projects/platform-mgmt.html +++ b/documentation/next/projects/platform-mgmt.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Project Management

    Under construction

    This docs page is under construction. Check back later for the complete docs, or check out the Docs Version "Platform (v1)".

    - + \ No newline at end of file diff --git a/documentation/next/projects/troubleshooting-tips-on-platform.html b/documentation/next/projects/troubleshooting-tips-on-platform.html index 5947295a424..8cf124ba35a 100644 --- a/documentation/next/projects/troubleshooting-tips-on-platform.html +++ b/documentation/next/projects/troubleshooting-tips-on-platform.html @@ -22,7 +22,7 @@ - + @@ -116,7 +116,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/next/release-notes.html b/documentation/next/release-notes.html index 7939de85369..4bd5e9ba96f 100644 --- a/documentation/next/release-notes.html +++ b/documentation/next/release-notes.html @@ -22,7 +22,7 @@ - + @@ -194,7 +194,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/next/style-guide.html b/documentation/next/style-guide.html index e909dfaaccb..8a72de3fda4 100644 --- a/documentation/next/style-guide.html +++ b/documentation/next/style-guide.html @@ -22,7 +22,7 @@ - + @@ -43,7 +43,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/next/support.html b/documentation/next/support.html index 30839babc8d..40f9e50922d 100644 --- a/documentation/next/support.html +++ b/documentation/next/support.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Support for OpenFn Implementations

    Under construction

    This docs page is under construction. Check back later for the complete docs, or check out the Docs Version "Platform (v1)".

    - + \ No newline at end of file diff --git a/documentation/next/tutorials/kobo-to-dhis2.html b/documentation/next/tutorials/kobo-to-dhis2.html index b811c1cb4bf..36ddc7f7e81 100644 --- a/documentation/next/tutorials/kobo-to-dhis2.html +++ b/documentation/next/tutorials/kobo-to-dhis2.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Kobo to DHIS2 Reporting Workflow

    Under construction

    This docs page is under construction. Check back later for the complete docs, or check out the Docs Version "Platform (v1)".

    Tutorial: Kobo to DHIS2 Reporting Workflow

    - + \ No newline at end of file diff --git a/documentation/next/users/user-profile.html b/documentation/next/users/user-profile.html index 8045f5182b2..b0b0374392b 100644 --- a/documentation/next/users/user-profile.html +++ b/documentation/next/users/user-profile.html @@ -22,13 +22,13 @@ - +
    Version: Lightning 🚧

    Update User Profile

    Under construction

    This docs page is under construction. Check back later for the complete docs, or check out the Docs Version "Platform (v1)".

    - + \ No newline at end of file diff --git a/documentation/openfn-roadmap.html b/documentation/openfn-roadmap.html index 22b37407b86..c6244c4b631 100644 --- a/documentation/openfn-roadmap.html +++ b/documentation/openfn-roadmap.html @@ -22,7 +22,7 @@ - + @@ -38,7 +38,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/portability-versions.html b/documentation/portability-versions.html index 65dd96a8054..40052fc84d8 100644 --- a/documentation/portability-versions.html +++ b/documentation/portability-versions.html @@ -22,7 +22,7 @@ - + @@ -39,7 +39,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/portability.html b/documentation/portability.html index dfe5734c423..22f259eebc9 100644 --- a/documentation/portability.html +++ b/documentation/portability.html @@ -22,7 +22,7 @@ - + @@ -82,7 +82,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/release-notes.html b/documentation/release-notes.html index 542eeee0dde..bc719969c65 100644 --- a/documentation/release-notes.html +++ b/documentation/release-notes.html @@ -22,7 +22,7 @@ - + @@ -194,7 +194,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/roadmap.html b/documentation/roadmap.html index 6ea9ba231d2..707e342649a 100644 --- a/documentation/roadmap.html +++ b/documentation/roadmap.html @@ -22,7 +22,7 @@ - + @@ -44,7 +44,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/source-apps.html b/documentation/source-apps.html index 69db4dd5856..304c769b152 100644 --- a/documentation/source-apps.html +++ b/documentation/source-apps.html @@ -22,7 +22,7 @@ - + @@ -55,7 +55,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/standards/digital-public-goods.html b/documentation/standards/digital-public-goods.html index 29d45700e21..f49218f4c3c 100644 --- a/documentation/standards/digital-public-goods.html +++ b/documentation/standards/digital-public-goods.html @@ -22,7 +22,7 @@ - + @@ -34,7 +34,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/standards/global-goods.html b/documentation/standards/global-goods.html index 2a61810e634..dbc96f9ed43 100644 --- a/documentation/standards/global-goods.html +++ b/documentation/standards/global-goods.html @@ -22,7 +22,7 @@ - + @@ -35,7 +35,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/standards/openhie.html b/documentation/standards/openhie.html index 7b7436285fb..c22d4301f64 100644 --- a/documentation/standards/openhie.html +++ b/documentation/standards/openhie.html @@ -22,7 +22,7 @@ - + @@ -61,7 +61,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/style-guide.html b/documentation/style-guide.html index 0dba597be47..d94206841f2 100644 --- a/documentation/style-guide.html +++ b/documentation/style-guide.html @@ -22,7 +22,7 @@ - + @@ -43,7 +43,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/writing-code.html b/documentation/writing-code.html index 53b1ed1e6e4..2bbd46fea30 100644 --- a/documentation/writing-code.html +++ b/documentation/writing-code.html @@ -22,7 +22,7 @@ - + @@ -33,7 +33,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/writing-docs.html b/documentation/writing-docs.html index b218dc59665..17a2384a5c6 100644 --- a/documentation/writing-docs.html +++ b/documentation/writing-docs.html @@ -22,7 +22,7 @@ - + @@ -46,7 +46,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/index.html b/index.html index 10dbbb73790..e98807592c6 100644 --- a/index.html +++ b/index.html @@ -22,13 +22,13 @@ - + - + \ No newline at end of file diff --git a/search.html b/search.html index c69ceae733d..d7c0e56fbf6 100644 --- a/search.html +++ b/search.html @@ -22,13 +22,13 @@ - + - + \ No newline at end of file