From 34f5ccff637f848d625412ff25bb6a2cbc452daf Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Mon, 12 Oct 2026 13:47:00 +0200 Subject: [PATCH 1/4] remove job library --- .agents/skills/translate/SKILL.md | 4 +- .agents/skills/update-content/SKILL.md | 1 - .github/workflows/deploy.yml | 1 - .github/workflows/test-deploy.yml | 1 - .gitignore | 1 - AGENTS.md | 7 +- README.md | 14 +- adaptors/library-intro.md | 90 --- adaptors/library/jobs/CommCare-FHIR.js | 108 --- .../Create-SMS-Linked-to-Contact-in-SF.js | 12 - adaptors/library/jobs/DHIS2-DataValues-API.js | 25 - adaptors/library/jobs/DHIS2-Events-API.js | 30 - ...ords-Moving-In-And-Out-Of-Repeat-Blocks.js | 55 -- .../jobs/alter-state-before-operations.js | 31 - .../library/jobs/async-and-array-dot-map.js | 63 -- adaptors/library/jobs/async-findValue.js | 35 - ...reate-parent-and-children-in-salesforce.js | 78 --- .../library/jobs/commcare-asri-bulk-upload.js | 59 -- adaptors/library/jobs/commcare-create-user.js | 18 - .../jobs/complex-http-request-chains.js | 25 - .../library/jobs/complex-state-control.js | 23 - .../concatenate-many-fields-with-nulls.js | 646 ------------------ adaptors/library/jobs/create-if-proposal.js | 28 - .../jobs/fetch-all-events-with-pagination.js | 28 - adaptors/library/jobs/fetch-all-events.js | 4 - adaptors/library/jobs/fetch-default-events.js | 3 - adaptors/library/jobs/generate-pdf.js | 26 - adaptors/library/jobs/getKoboData.js | 60 -- .../jobs/kobotoolbox-get-submissions.js | 12 - .../kobotoolbox-get-suspected-patients.js | 13 - .../opencrvs-create-birth-notification.js | 566 --------------- .../library/jobs/opencrvs-query-events.js | 20 - .../jobs/promise-all-nested-requests.js | 60 -- .../jobs/satusehat-create-condition.js | 91 --- .../jobs/satusehat-create-encounter.js | 102 --- .../jobs/satusehat-create-medication.js | 71 -- .../jobs/satusehat-create-observations.js | 136 ---- adaptors/library/jobs/send-mail-in-mailgun.js | 8 - .../jobs/send-sms-from-salesforce-workflow.js | 20 - .../library/jobs/stripe-get-subscriptions.js | 14 - .../library/jobs/stripe-list-customers.js | 6 - .../library/jobs/synchronous-http-request.js | 56 -- adaptors/library/jobs/timeout.js | 13 - ...items-in-array-with-value-outside-array.js | 21 - .../jobs/workWithIdAfterInsertOrUpsert.js | 35 - adaptors/library/staticExamples.json | 187 ----- adaptors/library/triggers/xmlns.md | 11 - adaptors/postgresql.md | 2 +- adaptors/primero.md | 7 +- articles/2021-05-24-commcare-events.md | 3 +- docs/build/steps/steps.md | 4 +- docs/get-started/standards.md | 2 +- docs/jobs/job-examples.md | 5 +- docusaurus.config.js | 6 - generate-library/index.js | 183 ----- generate-library/master.temp.json | 106 --- generate-library/populate-master.temp.js | 71 -- .../current/build/steps/steps.md | 2 +- .../current/get-started/standards.md | 2 +- .../current/jobs/job-examples.md | 6 +- package.json | 4 +- sidebars-adaptors.js | 46 +- yarn.lock | 8 - 63 files changed, 23 insertions(+), 3352 deletions(-) delete mode 100644 adaptors/library-intro.md delete mode 100644 adaptors/library/jobs/CommCare-FHIR.js delete mode 100644 adaptors/library/jobs/Create-SMS-Linked-to-Contact-in-SF.js delete mode 100644 adaptors/library/jobs/DHIS2-DataValues-API.js delete mode 100644 adaptors/library/jobs/DHIS2-Events-API.js delete mode 100644 adaptors/library/jobs/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.js delete mode 100644 adaptors/library/jobs/alter-state-before-operations.js delete mode 100644 adaptors/library/jobs/async-and-array-dot-map.js delete mode 100644 adaptors/library/jobs/async-findValue.js delete mode 100644 adaptors/library/jobs/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.js delete mode 100644 adaptors/library/jobs/commcare-asri-bulk-upload.js delete mode 100644 adaptors/library/jobs/commcare-create-user.js delete mode 100644 adaptors/library/jobs/complex-http-request-chains.js delete mode 100644 adaptors/library/jobs/complex-state-control.js delete mode 100644 adaptors/library/jobs/concatenate-many-fields-with-nulls.js delete mode 100644 adaptors/library/jobs/create-if-proposal.js delete mode 100644 adaptors/library/jobs/fetch-all-events-with-pagination.js delete mode 100644 adaptors/library/jobs/fetch-all-events.js delete mode 100644 adaptors/library/jobs/fetch-default-events.js delete mode 100644 adaptors/library/jobs/generate-pdf.js delete mode 100644 adaptors/library/jobs/getKoboData.js delete mode 100644 adaptors/library/jobs/kobotoolbox-get-submissions.js delete mode 100644 adaptors/library/jobs/kobotoolbox-get-suspected-patients.js delete mode 100644 adaptors/library/jobs/opencrvs-create-birth-notification.js delete mode 100644 adaptors/library/jobs/opencrvs-query-events.js delete mode 100644 adaptors/library/jobs/promise-all-nested-requests.js delete mode 100644 adaptors/library/jobs/satusehat-create-condition.js delete mode 100644 adaptors/library/jobs/satusehat-create-encounter.js delete mode 100644 adaptors/library/jobs/satusehat-create-medication.js delete mode 100644 adaptors/library/jobs/satusehat-create-observations.js delete mode 100644 adaptors/library/jobs/send-mail-in-mailgun.js delete mode 100644 adaptors/library/jobs/send-sms-from-salesforce-workflow.js delete mode 100644 adaptors/library/jobs/stripe-get-subscriptions.js delete mode 100644 adaptors/library/jobs/stripe-list-customers.js delete mode 100644 adaptors/library/jobs/synchronous-http-request.js delete mode 100644 adaptors/library/jobs/timeout.js delete mode 100644 adaptors/library/jobs/upsert-many-items-in-array-with-value-outside-array.js delete mode 100644 adaptors/library/jobs/workWithIdAfterInsertOrUpsert.js delete mode 100644 adaptors/library/staticExamples.json delete mode 100644 adaptors/library/triggers/xmlns.md delete mode 100644 generate-library/index.js delete mode 100644 generate-library/master.temp.json delete mode 100755 generate-library/populate-master.temp.js diff --git a/.agents/skills/translate/SKILL.md b/.agents/skills/translate/SKILL.md index 1540a55a9678..b2d37caf3dcf 100644 --- a/.agents/skills/translate/SKILL.md +++ b/.agents/skills/translate/SKILL.md @@ -31,8 +31,7 @@ need. If you are not told which task, work out which ones are needed from what has changed in English, say so, and ask before starting. -Never translate the generated adaptor pages, the job library, or articles and -blog posts. +Never translate the generated adaptor pages, or articles and blog posts. ## Before you start @@ -73,7 +72,6 @@ These apply to both tasks. Build the site and make sure it passes: ```bash -yarn generate-library yarn generate-adaptors yarn build ``` diff --git a/.agents/skills/update-content/SKILL.md b/.agents/skills/update-content/SKILL.md index 88dd9cf8cc76..49e439c92523 100644 --- a/.agents/skills/update-content/SKILL.md +++ b/.agents/skills/update-content/SKILL.md @@ -37,7 +37,6 @@ the PR for the next run. Format the files you changed with broken links: ```bash -yarn generate-library yarn generate-adaptors yarn build ``` diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fac7be1d3a3c..667a0e53f8e0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -42,7 +42,6 @@ jobs: git config --global user.email "actions@gihub.com" git config --global user.name "gh-actions" yarn install - yarn generate-library yarn generate-adaptors yarn build npx docusaurus deploy diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 5065c351e24b..5320ff8cb44a 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -23,6 +23,5 @@ jobs: run: yarn install - name: Test build website run: | - yarn generate-library yarn generate-adaptors yarn build diff --git a/.gitignore b/.gitignore index d9c0121e7425..d7e5c2ac8855 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ # these directories are built automatically and overwritten /adaptors/packages/ -/adaptors/library/jobs/auto/ # Generated files .docusaurus diff --git a/AGENTS.md b/AGENTS.md index de1f6ed59856..f8a2dcc36f2e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,9 +18,9 @@ you need. **Do not edit** -- Anything in `adaptors/packages/` or `adaptors/library/`. These pages are built - automatically from code comments in the `OpenFn/adaptors` repo. If something - is wrong there, the fix belongs in that repo, not here. +- Anything in `adaptors/packages/`. These pages are built automatically from + code comments in the `OpenFn/adaptors` repo. If something is wrong there, the + fix belongs in that repo, not here. **Ask before editing** @@ -92,7 +92,6 @@ change only, so it stays quick to review. Before opening any PR, build the site as CI does. It fails on broken links: ```bash -yarn generate-library yarn generate-adaptors yarn build ``` diff --git a/README.md b/README.md index be5e93e4198b..ae8c2be6dba7 100644 --- a/README.md +++ b/README.md @@ -71,17 +71,8 @@ yarn start --locale es ``` The development server shows one language at a time. This serves the Spanish -site at the root, with English wherever a page isn't translated yet. To see -both languages together at `/` and `/es/`, build and serve the site as below. - -### Building the job library - -``` -yarn generate-library -``` - -This command pulls public job data from OpenFn.org to create a local "job -library". +site at the root, with English wherever a page isn't translated yet. To see both +languages together at `/` and `/es/`, build and serve the site as below. ### Building the adaptors docs from the monorepo @@ -117,7 +108,6 @@ for more details ```console yarn generate-adaptors -yarn generate-library yarn build yarn serve ``` diff --git a/adaptors/library-intro.md b/adaptors/library-intro.md deleted file mode 100644 index 31e0de61903d..000000000000 --- a/adaptors/library-intro.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -id: library-intro -title: The Community Job Library -sidebar_label: Library Examples -slug: library ---- - -## A growing knowledge base - -There have been **over 3,000 distinct jobs written** for the OpenFn platform, -driving efficiency across the social sector. These jobs have run millions of -times, connecting and automating critical technologies like CommCare, DHIS2, -Salesforce, Kobo Toolbox, and more. - -**90% of at-scale OpenFn customers make their jobs publicly available** so that -other organizations can learn from their implementations, yet we’re still -constantly asked to find examples of jobs that “create DHIS2 entities from -CommCare cases” or “initiate payments when Kobo submissions arrive”. - -The Job Library is our attempt to make this vast pool of real-world experience -available to everyone, automatically collecting and organizing non-sensitive job -scripts from this diverse community of social sector integration experts to make -data integration safer, faster, and more scalable than ever before. - -## How can you contribute? - -In the **Project Settings** page for one of your OpenFn.org projects, select -flip the **"Job library sharing"** switch and you're good to go! There will be a -slight delay between the time you share your jobs and the time the appear on -this site, but in about half an hour, at most, you'll be able to find your -published jobs here. - -N.B.: If you want to share a project, but **keep certain jobs private**, you can -do that too. Navigate to the job in question and click the administrative -settings cog in the top right corner (the same place you'd disable "console.log" -statements) and select "Make this job private." - -## Library "scores" - -Jobs published to the library from OpenFn.org users may be well-written and -clearly documented. They may serve as very useful templates for other users to -write their own jobs, or copy and paste them entirely. Or... they may not! - -In order to help members of the community get a sense of whether or not a -particular job in the library is a "good example", we provide a **score** that's -calculated based on some job metadata from the OpenFn platform. It takes into -account many factors, including things like how recently the job was written. In -addition to the scores, we also provide two quick visual indicators: - -### Scrolls 📜 are from core contributors - -Jobs with scrolls next to them have been manually added or edited by a core -contributor to this repo. Think of them as official examples. In _most cases_ -this means that the spells... errr, scripts you see in there are great places to -start. - -### Sparkles ✨ are scoring over 75 - -Jobs with sparkles next to them are currently scoring over 75. That's all. We -can't vouch for them, but they might be more useful than jobs without sparkles. - -### How to interpret a score - -Everything you see here has been shared because _someone_ thought it might help -the broader community. If a job has a high score it's because our model thinks -it might be helpful, too! This might be a good time to review rule #1 and rule -#2 about models/algorithms. - -1. All models are wrong. -2. But some models are useful. - -We hope this one is useful. In conclusion, **the higher the score, the more -useful the job _might_ be.** - -## What's next? - -We're planning to expand both the API and the library searching/browsing -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! - -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? - -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! - -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). diff --git a/adaptors/library/jobs/CommCare-FHIR.js b/adaptors/library/jobs/CommCare-FHIR.js deleted file mode 100644 index e4671535353f..000000000000 --- a/adaptors/library/jobs/CommCare-FHIR.js +++ /dev/null @@ -1,108 +0,0 @@ -// 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', - }, - ]; - }) - ) -); diff --git a/adaptors/library/jobs/Create-SMS-Linked-to-Contact-in-SF.js b/adaptors/library/jobs/Create-SMS-Linked-to-Contact-in-SF.js deleted file mode 100644 index 5c46f9602e6c..000000000000 --- a/adaptors/library/jobs/Create-SMS-Linked-to-Contact-in-SF.js +++ /dev/null @@ -1,12 +0,0 @@ -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')) - ) -); diff --git a/adaptors/library/jobs/DHIS2-DataValues-API.js b/adaptors/library/jobs/DHIS2-DataValues-API.js deleted file mode 100644 index ef582f0a7c03..000000000000 --- a/adaptors/library/jobs/DHIS2-DataValues-API.js +++ /dev/null @@ -1,25 +0,0 @@ -// ---- -// Add data to data value sets in DHIS2 using a generic JSON message, submitted -// by Taylor Downs @ OpenFn. Co-authored by @mtuchi -// --- - -create('dataValueSets', { - dataSet: 'pBOMPrpg1QX', - completeDate: $.form.date, - period: '201401', - orgUnit: 'DiszpKrYNg8', - dataValues: [ - { - dataElement: 'f7n9E0hX8qk', - value: $.form.prop_a, - }, - { - dataElement: 'Ix2HsbDMLea', - value: $.form.prop_b, - }, - { - dataElement: 'eY5ehpbEsB7', - value: $.form.prop_c, - }, - ], -}); diff --git a/adaptors/library/jobs/DHIS2-Events-API.js b/adaptors/library/jobs/DHIS2-Events-API.js deleted file mode 100644 index ff5175fdddcf..000000000000 --- a/adaptors/library/jobs/DHIS2-Events-API.js +++ /dev/null @@ -1,30 +0,0 @@ -// ---- -// Create new events in DHIS2 using a generic JSON message, submitted by -// Taylor Downs @ OpenFn, Co-authored by @mtuchi -// --- - -create('events', { - program: 'eBAyeGv0exc', - orgUnit: 'DiszpKrYNg8', - occurredAt: $.meta.date, - status: 'COMPLETED', - storedBy: 'admin', - geometry: { - type: 'POINT', - coordinates: [59.8, 10.9], - }, - dataValues: [ - { - dataElement: 'qrur9Dvnyt5', - value: $.form.prop_a, - }, - { - dataElement: 'oZg33kd9taw', - value: $.form.prop_b, - }, - { - dataElement: 'msodh3rEMJa', - value: $.form.prop_c, - }, - ], -}); diff --git a/adaptors/library/jobs/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.js b/adaptors/library/jobs/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.js deleted file mode 100644 index 1a16d46e4c3b..000000000000 --- a/adaptors/library/jobs/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - 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')) - ) - ) -); diff --git a/adaptors/library/jobs/alter-state-before-operations.js b/adaptors/library/jobs/alter-state-before-operations.js deleted file mode 100644 index 9b3c103c583b..000000000000 --- a/adaptors/library/jobs/alter-state-before-operations.js +++ /dev/null @@ -1,31 +0,0 @@ -// 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') - ) - ) - ) -); diff --git a/adaptors/library/jobs/async-and-array-dot-map.js b/adaptors/library/jobs/async-and-array-dot-map.js deleted file mode 100644 index 22c482c0cfe4..000000000000 --- a/adaptors/library/jobs/async-and-array-dot-map.js +++ /dev/null @@ -1,63 +0,0 @@ -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; -}); diff --git a/adaptors/library/jobs/async-findValue.js b/adaptors/library/jobs/async-findValue.js deleted file mode 100644 index a680b9aed1dc..000000000000 --- a/adaptors/library/jobs/async-findValue.js +++ /dev/null @@ -1,35 +0,0 @@ -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); -}); diff --git a/adaptors/library/jobs/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.js b/adaptors/library/jobs/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.js deleted file mode 100644 index 1fc698a9bdee..000000000000 --- a/adaptors/library/jobs/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.js +++ /dev/null @@ -1,78 +0,0 @@ -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), ')'); - }) - ) - ) - ); diff --git a/adaptors/library/jobs/commcare-asri-bulk-upload.js b/adaptors/library/jobs/commcare-asri-bulk-upload.js deleted file mode 100644 index 0745e42a2bff..000000000000 --- a/adaptors/library/jobs/commcare-asri-bulk-upload.js +++ /dev/null @@ -1,59 +0,0 @@ - -// Bulk update obat lookup-table -fn(state => { - const { medication_ids, visit, obat } = state.data - state.medication_ids = medication_ids; - state.visit = visit - state.obat = obat - return state - }) - - fn(state => { - - const properties = state.visit.properties; - - const data = state.medication_ids - .flatMap(medicine => { - const medicineName = properties[Object.keys(medicine)[0]]; - return state.obat.filter( - item => item.fields['Nama'] === medicineName - ).map(item => ({ ...item, fields: { ...item.fields, satusehat_id: Object.values(medicine)[0] } })) - }).map(obat => { - const data = { - UID: obat.id, - 'DELETE(Y/N)': 'N', - 'field:Nama': obat.fields['Nama'], - 'field:Satuan': obat.fields['Satuan'], - 'field:Harga': obat.fields['Harga'], - 'field:kfa_codes': obat.fields['kfa_codes'], - 'field:satusehat_id': obat.fields['satusehat_id'], - 'field:strength': obat.fields['strength'], - 'field:strength_unit': obat.fields['strength_unit'], - } - return data - }) - - state.medicationMappedData = { - types: [{ - 'DELETE(Y/N)': 'N', - table_id: 'test_obat', - 'is_global?': 'yes', - 'field 1': 'Nama', - 'field 2': 'Satuan', - 'field 3': 'Harga', - 'field 4': 'kfa_codes', - 'field 5': 'satusehat_id', - 'field 6': 'strength', - 'field 7': 'strength_unit', - }], - test_obat: data, - } - - return state - }) - - bulk( - 'lookup-table', - state => state.medicationMappedData, - { replace: false } - ) diff --git a/adaptors/library/jobs/commcare-create-user.js b/adaptors/library/jobs/commcare-create-user.js deleted file mode 100644 index 1112e6e119ad..000000000000 --- a/adaptors/library/jobs/commcare-create-user.js +++ /dev/null @@ -1,18 +0,0 @@ -// Create a user and submit their case to commcare - -post('user', { - username: 'janedoe42', - password: 'qwer12345', - first_name: 'Jane', - last_name: 'Doe', - default_phone_number: '+50253311399', - email: 'jdoe@example.org', -}); - -submitXls([{ name: $.data.username, feeling_sick: 'No' }], { - case_type: 'pregnancy', - search_field: 'case_id', - search_column: 'case_id', - name_column: 'name', - create_new_cases: 'on', -}); diff --git a/adaptors/library/jobs/complex-http-request-chains.js b/adaptors/library/jobs/complex-http-request-chains.js deleted file mode 100644 index eb81b091d2e5..000000000000 --- a/adaptors/library/jobs/complex-http-request-chains.js +++ /dev/null @@ -1,25 +0,0 @@ -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; - } - ) -); diff --git a/adaptors/library/jobs/complex-state-control.js b/adaptors/library/jobs/complex-state-control.js deleted file mode 100644 index 205e047ae3ae..000000000000 --- a/adaptors/library/jobs/complex-state-control.js +++ /dev/null @@ -1,23 +0,0 @@ -// 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; -}); diff --git a/adaptors/library/jobs/concatenate-many-fields-with-nulls.js b/adaptors/library/jobs/concatenate-many-fields-with-nulls.js deleted file mode 100644 index b5f266e7989c..000000000000 --- a/adaptors/library/jobs/concatenate-many-fields-with-nulls.js +++ /dev/null @@ -1,646 +0,0 @@ -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')) - ) - ) -); diff --git a/adaptors/library/jobs/create-if-proposal.js b/adaptors/library/jobs/create-if-proposal.js deleted file mode 100644 index 08f90c5dcce5..000000000000 --- a/adaptors/library/jobs/create-if-proposal.js +++ /dev/null @@ -1,28 +0,0 @@ -// 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') - ) - ) -); diff --git a/adaptors/library/jobs/fetch-all-events-with-pagination.js b/adaptors/library/jobs/fetch-all-events-with-pagination.js deleted file mode 100644 index a26adfd511ed..000000000000 --- a/adaptors/library/jobs/fetch-all-events-with-pagination.js +++ /dev/null @@ -1,28 +0,0 @@ -// Fetching all events with pagination -// Requires DHIS2 server v2.41+ - -// First call fetches page 1 (up to 10,000 records) and, via totalPages: true, -// returns pagination details (state.data.pager) describing how many pages remain. -tracker.export('events', { totalPages: true, pageSize: 1e4 }); - -fn(state => { - state.results = state.data.events; - const { page, pageSize, pageCount, total } = state.data.pager; - const remainingPages = pageCount - page; - - state.pages = Array.from({ length: remainingPages }, (_, i) => page + i + 1); - state.pageSize = pageSize; - return state; -}); - -// Second call uses the remaining page numbers computed above to fetch the -// rest of the records in batches, one tracker.export per page. -each( - $.pages, - tracker - .export('events', { pageSize: $.pageSize, page: $.data }) - .then(state => { - state.results = state.results.concat(state.data.events); - return state; - }) -); diff --git a/adaptors/library/jobs/fetch-all-events.js b/adaptors/library/jobs/fetch-all-events.js deleted file mode 100644 index 448c2cdeecb6..000000000000 --- a/adaptors/library/jobs/fetch-all-events.js +++ /dev/null @@ -1,4 +0,0 @@ -// Fetching all events without pagination -// Be cautious: This can degrade performance if you have a lot of events, use with caution -// Requires DHIS2 server v2.41+, for older version `skipPaging: true` -tracker.export('events', { paging: false }); diff --git a/adaptors/library/jobs/fetch-default-events.js b/adaptors/library/jobs/fetch-default-events.js deleted file mode 100644 index 19db18f4bfb5..000000000000 --- a/adaptors/library/jobs/fetch-default-events.js +++ /dev/null @@ -1,3 +0,0 @@ -// DHIS2 Defaults: pageSize: 50 -// Requires DHIS2 server v2.41+, -tracker.export('events'); diff --git a/adaptors/library/jobs/generate-pdf.js b/adaptors/library/jobs/generate-pdf.js deleted file mode 100644 index 6205e25c9389..000000000000 --- a/adaptors/library/jobs/generate-pdf.js +++ /dev/null @@ -1,26 +0,0 @@ -// Generate a PDF document from a HTML string - -fn(state => { - const { data } = state; - - state.pdfHTMLContent = ` - -

Sales Report

-

Date: ${data.date}

-

Total Sales: $${data.totalSales}

- - `; - - return state; -}); - -generatePDF($.pdfHTMLContent, { - sandbox: true, - filename: 'trials.pdf', -}); - -fn(state => { - const { data } = state; - console.log(`Download PDF in 48 hours from ${data.url}`); - return { ...state, pdfData: data }; -}); diff --git a/adaptors/library/jobs/getKoboData.js b/adaptors/library/jobs/getKoboData.js deleted file mode 100644 index 33443e6aea13..000000000000 --- a/adaptors/library/jobs/getKoboData.js +++ /dev/null @@ -1,60 +0,0 @@ -//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: [] - }; -}); diff --git a/adaptors/library/jobs/kobotoolbox-get-submissions.js b/adaptors/library/jobs/kobotoolbox-get-submissions.js deleted file mode 100644 index 777d609699a6..000000000000 --- a/adaptors/library/jobs/kobotoolbox-get-submissions.js +++ /dev/null @@ -1,12 +0,0 @@ -//Get all Kobo forms/projects, and then get form submissions -//that were submitted after a specific time -cursor($.cursor, { defaultValue: 'today' }); - -getForms(); - -each( - $.data, - getSubmissions($.data.uid, { - query: `{"_submission_time":{"$gte":"${$.cursor}"}}`, - }) -); diff --git a/adaptors/library/jobs/kobotoolbox-get-suspected-patients.js b/adaptors/library/jobs/kobotoolbox-get-suspected-patients.js deleted file mode 100644 index 489168832751..000000000000 --- a/adaptors/library/jobs/kobotoolbox-get-suspected-patients.js +++ /dev/null @@ -1,13 +0,0 @@ -// Get all submissions of a specific form/asset and get the percentage of patients suspected of having covid-19 -getSubmissions('aDReHdA7UuNBYsiCXQBr43'); - -fn(state => { - const results = state.data?.results; - - const suspectedPatients = results.filter( - item => item['Please_select_sample_type'] === 'suspected_covid_19' - ); - const suspectedCovidPatientsPercentage = - (suspectedPatients.length / results.length) * 100; - return { ...state, suspectedCovidPatientsPercentage }; -}); diff --git a/adaptors/library/jobs/opencrvs-create-birth-notification.js b/adaptors/library/jobs/opencrvs-create-birth-notification.js deleted file mode 100644 index 45773e45d600..000000000000 --- a/adaptors/library/jobs/opencrvs-create-birth-notification.js +++ /dev/null @@ -1,566 +0,0 @@ -// Create a birth notification in OpenCRVS - -fn(state => { - const motherId = util.uuid(); - const comparisonId = util.uuid(); - const childId = util.uuid(); - const encounterId = util.uuid(); - const fatherId = util.uuid(); - const informantId = util.uuid(); - - state.birthNotificationEntryData = [ - { - fullUrl: `urn:uuid:${comparisonId}`, - resource: { - identifier: { - system: 'urn:ietf:rfc:3986', - value: '8f793c5a-3d53-4c9b-898b-1c04759716c6', - }, - resourceType: 'Composition', - status: 'final', - type: { - coding: [ - { - system: 'http://opencrvs.org/doc-types', - code: 'birth-notification', - }, - ], - text: 'Birth Notification', - }, - class: { - coding: [ - { - system: 'http://opencrvs.org/specs/classes', - code: 'crvs-document', - }, - ], - text: 'CRVS Document', - }, - subject: { - reference: `urn:uuid:${childId}`, - }, - date: '2022-08-14T14:43:47.000Z', - author: [], - title: 'Birth Notification', - section: [ - { - title: 'Child details', - code: { - coding: [ - { - system: 'http://opencrvs.org/specs/sections', - code: 'child-details', - }, - ], - text: 'Child details', - }, - entry: [ - { - reference: `urn:uuid:${childId}`, - }, - ], - }, - { - title: 'Birth encounter', - code: { - coding: [ - { - system: 'http://opencrvs.org/specs/sections', - code: 'birth-encounter', - }, - ], - text: 'Birth encounter', - }, - entry: [ - { - reference: `urn:uuid:${encounterId}`, - }, - ], - }, - { - title: "Mother's details", - code: { - coding: [ - { - system: 'http://opencrvs.org/specs/sections', - code: 'mother-details', - }, - ], - text: "Mother's details", - }, - entry: [ - { - reference: `urn:uuid:${motherId}`, - }, - ], - }, - { - title: "Informant's details", - code: { - coding: [ - { - system: 'http://opencrvs.org/specs/sections', - code: 'informant-details', - }, - ], - text: "Informant's details", - }, - entry: [ - { - reference: `urn:uuid:${informantId}`, - }, - ], - }, - { - title: "Father's details", - code: { - coding: [ - { - system: 'http://opencrvs.org/doc-sections', - code: 'father-details', - }, - ], - text: "Father's details", - }, - entry: [ - { - reference: `urn:uuid:${fatherId}`, - }, - ], - }, - ], - }, - }, - { - fullUrl: `urn:uuid:${util.uuid()}`, - resource: { - resourceType: 'Task', - status: 'draft', - intent: 'unknown', - identifier: [], - code: { - coding: [ - { - system: 'http://opencrvs.org/specs/types', - code: 'BIRTH', - }, - ], - }, - focus: { - reference: `urn:uuid:${comparisonId}`, - }, - extension: [ - { - url: 'http://opencrvs.org/specs/extension/contact-person', - valueString: 'MOTHER', - }, - { - url: 'http://opencrvs.org/specs/extension/contact-person-phone-number', - valueString: '+260759205190', - }, - { - url: 'http://opencrvs.org/specs/extension/contact-person-email', - valueString: 'axon@gmail.com', - }, - { - url: 'http://opencrvs.org/specs/extension/timeLoggedMS', - valueInteger: 0, - }, - { - url: 'http://opencrvs.org/specs/extension/in-complete-fields', - valueString: 'N/A', - }, - { - url: 'http://opencrvs.org/specs/extension/regLastOffice', - valueReference: { - reference: 'Location/178e21a9-60ad-4283-bd49-f576f61a5648', - }, - }, - ], - }, - }, - { - fullUrl: `urn:uuid:${childId}`, - resource: { - resourceType: 'Patient', - active: true, - name: [ - { - use: 'en', - family: 'Tatke', - given: ['Harney'], - }, - ], - gender: 'male', - birthDate: '2022-06-29', - deceasedBoolean: false, - multipleBirthBoolean: false, - }, - }, - { - fullUrl: `urn:uuid:${motherId}`, - resource: { - resourceType: 'Patient', - active: true, - identifier: [ - { - use: 'official', - type: { - coding: [ - { - system: 'http://opencrvs.org/specs/identifier-type', - code: 'NATIONAL_ID', - }, - ], - }, - value: '3624667568', - }, - ], - name: [ - { - use: 'en', - family: 'Ratke', - given: ['Mom'], - }, - ], - gender: 'female', - telecom: [ - { - use: 'mobile', - system: 'phone', - value: '+260759205190', - }, - ], - birthDate: '2002-06-29', - deceasedBoolean: false, - multipleBirthInteger: 2, - maritalStatus: { - coding: [ - { - system: 'http://hl7.org/fhir/StructureDefinition/marital-status', - code: 'M', - }, - ], - text: 'MARRIED', - }, - address: [ - { - type: 'PRIMARY_ADDRESS', - line: [ - '12', - 'Usual Street', - 'Usual Residental Area', - '', - '', - 'URBAN', - ], - city: 'Meghanland', - district: 'c51ea274-8ffa-4b0b-b3d3-12991e9f0630', - state: 'c5d7a275-3638-41a3-bd53-145bd9410fd6', - postalCode: '52275', - country: 'FAR', - }, - ], - extension: [ - { - url: 'http://opencrvs.org/specs/extension/patient-occupation', - valueString: 'Housewife', - }, - { - url: 'http://hl7.org/fhir/StructureDefinition/patient-nationality', - extension: [ - { - url: 'code', - valueCodeableConcept: { - coding: [ - { - system: 'urn:iso:std:iso:3166', - code: 'FAR', - }, - ], - }, - }, - { - url: 'period', - valuePeriod: { - start: '', - end: '', - }, - }, - ], - }, - { - url: 'http://opencrvs.org/specs/extension/educational-attainment', - valueString: 'POST_SECONDARY_ISCED_4', - }, - ], - }, - }, - { - fullUrl: `urn:uuid:${informantId}`, - resource: { - resourceType: 'RelatedPerson', - relationship: { - coding: [ - { - system: - 'http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype', - code: 'MOTHER', - }, - ], - }, - patient: { - reference: `urn:uuid:${motherId}`, - }, - }, - }, - { - fullUrl: `urn:uuid:${fatherId}`, - resource: { - resourceType: 'Patient', - active: true, - identifier: [ - { - use: 'official', - type: { - coding: [ - { - system: 'http://opencrvs.org/specs/identifier-type', - code: 'NATIONAL_ID', - }, - ], - }, - value: '6848901132', - }, - ], - name: [ - { - use: 'en', - family: 'Ratke', - given: ['Dad'], - }, - ], - gender: 'male', - telecom: [ - { - use: 'mobile', - system: 'phone', - value: '+260759205190', - }, - ], - birthDate: '2002-06-29', - deceasedBoolean: false, - multipleBirthInteger: 2, - maritalStatus: { - coding: [ - { - system: 'http://hl7.org/fhir/StructureDefinition/marital-status', - code: 'M', - }, - ], - text: 'MARRIED', - }, - address: [ - { - type: 'PRIMARY_ADDRESS', - line: [ - '12', - 'Usual Street', - 'Usual Residental Area', - '', - '', - 'URBAN', - ], - city: 'Madgeland', - district: 'c51ea274-8ffa-4b0b-b3d3-12991e9f0630', - state: 'c5d7a275-3638-41a3-bd53-145bd9410fd6', - postalCode: '52275', - country: 'FAR', - }, - ], - extension: [ - { - url: 'http://opencrvs.org/specs/extension/patient-occupation', - valueString: 'Businessman', - }, - { - url: 'http://hl7.org/fhir/StructureDefinition/patient-nationality', - extension: [ - { - url: 'code', - valueCodeableConcept: { - coding: [ - { - system: 'urn:iso:std:iso:3166', - code: 'FAR', - }, - ], - }, - }, - { - url: 'period', - valuePeriod: { - start: '', - end: '', - }, - }, - ], - }, - { - url: 'http://opencrvs.org/specs/extension/educational-attainment', - valueString: 'POST_SECONDARY_ISCED_4', - }, - ], - }, - }, - { - fullUrl: `urn:uuid:${encounterId}`, - resource: { - resourceType: 'Encounter', - status: 'finished', - location: [ - { - location: { - reference: 'Location/704b9706-d729-4834-8656-05b562065deb', - }, - }, - ], - }, - }, - { - fullUrl: `urn:uuid:${util.uuid()}`, - resource: { - resourceType: 'Observation', - status: 'final', - context: { - reference: `urn:uuid:${encounterId}`, - }, - category: [ - { - coding: [ - { - system: 'http://hl7.org/fhir/observation-category', - code: 'procedure', - display: 'Procedure', - }, - ], - }, - ], - code: { - coding: [ - { - system: 'http://loinc.org', - code: '57722-1', - display: 'Birth plurality of Pregnancy', - }, - ], - }, - valueQuantity: { - value: 'SINGLE', - }, - }, - }, - { - fullUrl: `urn:uuid:${util.uuid()}`, - resource: { - resourceType: 'Observation', - status: 'final', - context: { - reference: `urn:uuid:${encounterId}`, - }, - category: [ - { - coding: [ - { - system: 'http://hl7.org/fhir/observation-category', - code: 'vital-signs', - display: 'Vital Signs', - }, - ], - }, - ], - code: { - coding: [ - { - system: 'http://loinc.org', - code: '3141-9', - display: 'Body weight Measured', - }, - ], - }, - valueQuantity: { - value: 4, - unit: 'kg', - system: 'http://unitsofmeasure.org', - code: 'kg', - }, - }, - }, - { - fullUrl: `urn:uuid:${util.uuid()}`, - resource: { - resourceType: 'Observation', - status: 'final', - context: { - reference: `urn:uuid:${encounterId}`, - }, - category: [ - { - coding: [ - { - system: 'http://hl7.org/fhir/observation-category', - code: 'procedure', - display: 'Procedure', - }, - ], - }, - ], - code: { - coding: [ - { - system: 'http://loinc.org', - code: '73764-3', - display: 'Birth attendant title', - }, - ], - }, - valueString: 'PHYSICIAN', - }, - }, - { - fullUrl: `urn:uuid:${util.uuid()}`, - resource: { - resourceType: 'QuestionnaireResponse', - extension: [], - status: 'completed', - subject: { - reference: `urn:uuid:${encounterId}`, - }, - item: [ - { - text: 'birth.mother.mother-view-group.motherIdType', - linkId: '', - answer: [ - { - valueString: 'NATIONAL_ID', - }, - ], - }, - { - text: 'birth.father.father-view-group.fatherIdType', - linkId: '', - answer: [ - { - valueString: 'NATIONAL_ID', - }, - ], - }, - ], - }, - }, - ]; - - return state; -}); - -createBirthNotification($.birthNotificationEntryData); diff --git a/adaptors/library/jobs/opencrvs-query-events.js b/adaptors/library/jobs/opencrvs-query-events.js deleted file mode 100644 index 31db943e6516..000000000000 --- a/adaptors/library/jobs/opencrvs-query-events.js +++ /dev/null @@ -1,20 +0,0 @@ -// Get a birth record from OpenCRVS - -fn(state => { - const { data } = state; - state.birthQuery = { - event: 'birth', - registrationStatuses: ['REGISTERED'], - fatherFirstNames: data.fatherFirstNames, - motherFirstNames: data.motherFirstNames, - childGender: data.childGender, - dateOfRegistrationStart: data.dateOfRegistrationStart, - dateOfRegistrationEnd: data.dateOfRegistrationEnd, - declarationJurisdictionId: data.declarationJurisdictionId, - eventLocationId: data.eventLocationId, - }; - - return state; -}); - -queryEvents($.birthQuery, { count: 10, skip: 0 }); diff --git a/adaptors/library/jobs/promise-all-nested-requests.js b/adaptors/library/jobs/promise-all-nested-requests.js deleted file mode 100644 index a7164957d12e..000000000000 --- a/adaptors/library/jobs/promise-all-nested-requests.js +++ /dev/null @@ -1,60 +0,0 @@ -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); - }) -); diff --git a/adaptors/library/jobs/satusehat-create-condition.js b/adaptors/library/jobs/satusehat-create-condition.js deleted file mode 100644 index 14481165e8a1..000000000000 --- a/adaptors/library/jobs/satusehat-create-condition.js +++ /dev/null @@ -1,91 +0,0 @@ -// Map diagnosis objects from commcare into Condition resources - -fn(state => { - state.conditions = state.visit.diagnosis.map(diagnosis => { - const diagnosisName = diagnosis.fields.name; - const code = diagnosis.fields['icd_10_code']; - - return { - resourceType: 'Condition', - clinicalStatus: { - coding: [ - { - system: 'http://terminology.hl7.org/CodeSystem/condition-clinical', - code: 'active', - display: 'Active', - }, - ], - }, - verificationStatus: { - coding: [ - { - system: - 'http://terminology.hl7.org/CodeSystem/condition-ver-status', - code: 'confirmed', - display: 'Confirmed', - }, - ], - }, - category: [ - { - coding: [ - { - system: - 'http://terminology.hl7.org/CodeSystem/condition-category', - code: 'encounter-diagnosis', - display: 'Encounter Diagnosis', - }, - ], - }, - ], - subject: { - reference: `Patient/${state.patient.ihs_number}`, - display: state.patient.full_name, - }, - encounter: { - reference: `Encounter/${state.encounterId}`, - display: - state.patient.full_name + - "'s " + - state.visit.properties.visit_type + - ' on ' + - state.visit.properties.visit_date, - }, - code: { - coding: [ - { - system: 'http://hl7.org/fhir/sid/icd-10', - code: code, - display: diagnosisName, - }, - ], - }, - bodySite: [ - { - coding: [ - { - system: 'http://snomed.info/sct', - code: '74262004', - display: 'Oral cavity structure', - }, - ], - }, - ], - recorder: { - reference: state.encounter.resource.participant[0].individual.reference, - }, - onsetDateTime: state.visit.visit_date, - recordedDate: state.visit.visit_date, - }; - }); - return state; -}); - -// Post our condition resources to Satusehat -post('Condition', $.conditions); - -fn(state => { - // Store the newly created resources, created by the server, into state for the next step - state.conditions = state.data; - return state; -}); diff --git a/adaptors/library/jobs/satusehat-create-encounter.js b/adaptors/library/jobs/satusehat-create-encounter.js deleted file mode 100644 index c597a8176a37..000000000000 --- a/adaptors/library/jobs/satusehat-create-encounter.js +++ /dev/null @@ -1,102 +0,0 @@ -// Create an encounter in Satusehat based on an incoming Commcare visit - -fn(state => { - state.encounterId = util.uuid(); - - state.encounter = { - id: state.encounterId, - resourceType: 'Encounter', - identifier: [ - { - system: `http://sys-ids.kemkes.go.id/encounter/${state.visit.organizationId}`, - value: state.visit.case_id, - }, - ], - status: 'arrived', - class: { - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode', - code: 'AMB', - display: 'ambulatory', - }, - subject: { - reference: 'Patient/P00805884304', - display: 'Elizabeth Dior', - }, - participant: [ - { - type: [ - { - coding: [ - { - system: - 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType', - code: 'ATND', - display: 'attender', - }, - ], - }, - ], - individual: { - reference: `Practitioner/N10000001`, - display: 'Voigt', - }, - }, - ], - period: { - start: state.visit.visit_date, - end: state.visit.visit_date, - }, - - location: [ - { - location: { - reference: `Location/574d5ffd-2dc2-453b-a787-d1c63cc89ae4`, - display: `PLKB`, - }, - extension: [ - { - url: 'https://fhir.kemkes.go.id/r4/StructureDefinition/ServiceClass', - extension: [ - { - url: 'value', - valueCodeableConcept: { - coding: [ - { - system: - 'http://terminology.kemkes.go.id/CodeSystem/locationServiceClass-Outpatient', - code: 'reguler', - display: 'Kelas Reguler', - }, - ], - }, - }, - ], - }, - ], - }, - ], - statusHistory: [ - { - status: 'arrived', - period: { - start: state.visit.visit_date, - end: state.visit.visit_date, - }, - }, - ], - serviceProvider: { - reference: `Organization/${state.visit.organizationId}`, - }, - }; - - return state; -}); - -// Post our encounter resources to Satusehat -post('Encounter', $.encounter); - -fn(state => { - // Store the newly created resources, created by the server, into state for the next step - state.encounter = state.data; - return state; -}); diff --git a/adaptors/library/jobs/satusehat-create-medication.js b/adaptors/library/jobs/satusehat-create-medication.js deleted file mode 100644 index 851ded15dac9..000000000000 --- a/adaptors/library/jobs/satusehat-create-medication.js +++ /dev/null @@ -1,71 +0,0 @@ -// Create medication in Satusehat based on an incoming Commcare visit - -fn(state => { - // state.visit is a Commcare Visit record - const properties = state.visit.properties; - const medicineKeys = Object.keys(properties).filter( - key => - key.startsWith('prescription_') && - !key.includes('_amount') && - !key.includes('_instruction') && - !key.includes('_dose') - ); - - const medicationId = util.uuid(); - - // Map medication data for each relevant key - state.medication = medicineKeys.map(item => { - return { - resourceType: 'Medication', - id: state => medicationId, - meta: { - profile: [ - 'https://fhir.kemkes.go.id/r4/StructureDefinition/Medication', - ], - }, - identifier: [ - { - system: `http://sys-ids.kemkes.go.id/medication/${state.visit.satusehatId}`, - use: 'usual', - value: item.fields['Nama'], - }, - ], - code: { - coding: [ - { - system: 'http://sys-ids.kemkes.go.id/kfa', - code: item.fields['kfa_codes'], - display: item.fields['Nama'], - }, - ], - }, - status: 'active', - extension: [ - { - url: 'https://fhir.kemkes.go.id/r4/StructureDefinition/MedicationType', - valueCodeableConcept: { - coding: [ - { - system: - 'http://terminology.kemkes.go.id/CodeSystem/medication-type', - code: 'NC', - display: 'Non-compound', - }, - ], - }, - }, - ], - }; - }); - - return state; -}); - -// Post our medication resources to Satusehat -post('Medication', $.medication); - -fn(state => { - // Store the newly created resources, created by the server, into state for the next step - state.medication = state.data; - return state; -}); diff --git a/adaptors/library/jobs/satusehat-create-observations.js b/adaptors/library/jobs/satusehat-create-observations.js deleted file mode 100644 index 384f83270a1c..000000000000 --- a/adaptors/library/jobs/satusehat-create-observations.js +++ /dev/null @@ -1,136 +0,0 @@ -// Create observation in Satusehat based on an incoming Commcare visit - -function createObservationData(item, state, result) { - const patientReference = `Patient/${state.patient.ihs_number}`; - const encounterReference = `Encounter/${state.encounterId}`; - const encounterDisplay = `${state.patient.full_name}'s ${state.visit.properties.visit_type} on ${state.visit.properties.visit_date}`; - return { - resourceType: 'Observation', - status: 'final', - category: [ - { - coding: item.category, - }, - ], - code: { - coding: item.code, - }, - subject: { - reference: patientReference, - }, - performer: [ - { - reference: `Practitioner/N10000001`, - display: 'Voigt', - }, - ], - encounter: { - reference: encounterReference, - display: encounterDisplay, - }, - effectiveDateTime: state.visit.visit_date, - ...result, - }; -} - -fn(state => { - // Filtering and mapping observations based on the visit. - state.observations = state.visit.observations.map(item => { - const { value_type: valueType, value } = item; - const dataObjects = []; - - if (valueType === 'valueCodeableConcept') { - value.forEach(value => { - const result = { - [valueType]: { - coding: [JSON.parse(value.snomed_code)], - value: JSON.parse(value.value), - }, - }; - const data = createObservationData( - { ...item, id: value.id }, - state, - result - ); - dataObjects.push(data); - }); - } else if (valueType === 'valueQuantity') { - const result = { - [valueType]: { - coding: [value.snomed_code], - value: value.value, - }, - }; - const data = createObservationData( - { ...item, id: value.id }, - state, - result - ); - dataObjects.push(data); - } else if (valueType === 'valueInteger') { - const result = { - [valueType]: { - coding: value.snomed_code, - value: value.value, - }, - }; - const data = createObservationData( - { ...item, id: value.id }, - state, - result - ); - dataObjects.push(data); - } else if (valueType === 'valueDateTime') { - const result = { - [valueType]: { - coding: [JSON.parse(value.snomed_code)], - value: new Date(JSON.parse(value.value)).toISOString(), - }, - }; - const data = createObservationData( - { ...item, id: value.id }, - state, - result - ); - dataObjects.push(data); - } else if (valueType === 'valueBoolean') { - const result = { - [valueType]: { - coding: [JSON.parse(value.snomed_code)], - value: JSON.parse(value.value) === 'never' ? false : true, - }, - }; - const data = createObservationData( - { ...item, id: value.id }, - state, - result - ); - dataObjects.push(data); - } else { - const result = { - [valueType]: { - coding: [value.snomed_code], - value: value.value, - }, - }; - - if (result) { - const data = createObservationData(item, state, result); - dataObjects.push(data); - } - } - - return dataObjects; - }); - - return state; -}); - -// Post our observation resources to Satusehat -post('Observation', $.observations); - -// Store the newly created resources, created by the server, into state for the next step -fn(state => { - state.observations = state.data; - return state; -}); diff --git a/adaptors/library/jobs/send-mail-in-mailgun.js b/adaptors/library/jobs/send-mail-in-mailgun.js deleted file mode 100644 index a257406a5154..000000000000 --- a/adaptors/library/jobs/send-mail-in-mailgun.js +++ /dev/null @@ -1,8 +0,0 @@ -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.') - ) -); diff --git a/adaptors/library/jobs/send-sms-from-salesforce-workflow.js b/adaptors/library/jobs/send-sms-from-salesforce-workflow.js deleted file mode 100644 index 4326810afe8e..000000000000 --- a/adaptors/library/jobs/send-sms-from-salesforce-workflow.js +++ /dev/null @@ -1,20 +0,0 @@ -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 - ), - '.' - ); - }) - ) -); diff --git a/adaptors/library/jobs/stripe-get-subscriptions.js b/adaptors/library/jobs/stripe-get-subscriptions.js deleted file mode 100644 index 568bb6332a63..000000000000 --- a/adaptors/library/jobs/stripe-get-subscriptions.js +++ /dev/null @@ -1,14 +0,0 @@ -// Get subscription data -fn(state => { - state.subscriptions = state.data; - state.subscriptionsData = []; - return state; -}); - -each( - '$.subscriptions', - get('subscriptions', $.data).then(state => { - state.subscriptionsData.push(state.data.data); - return state; - }) -); diff --git a/adaptors/library/jobs/stripe-list-customers.js b/adaptors/library/jobs/stripe-list-customers.js deleted file mode 100644 index 7107cfc552c5..000000000000 --- a/adaptors/library/jobs/stripe-list-customers.js +++ /dev/null @@ -1,6 +0,0 @@ -// List customers in Stripe - -list('customers').then(state => { - state.customers = state.data.data; - return state; -}); diff --git a/adaptors/library/jobs/synchronous-http-request.js b/adaptors/library/jobs/synchronous-http-request.js deleted file mode 100644 index 918bd457297f..000000000000 --- a/adaptors/library/jobs/synchronous-http-request.js +++ /dev/null @@ -1,56 +0,0 @@ -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 }; -}); diff --git a/adaptors/library/jobs/timeout.js b/adaptors/library/jobs/timeout.js deleted file mode 100644 index 2623931f9ec2..000000000000 --- a/adaptors/library/jobs/timeout.js +++ /dev/null @@ -1,13 +0,0 @@ -// 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'); diff --git a/adaptors/library/jobs/upsert-many-items-in-array-with-value-outside-array.js b/adaptors/library/jobs/upsert-many-items-in-array-with-value-outside-array.js deleted file mode 100644 index 6e828a8bb6c5..000000000000 --- a/adaptors/library/jobs/upsert-many-items-in-array-with-value-outside-array.js +++ /dev/null @@ -1,21 +0,0 @@ -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') - ) - ) - ) -); diff --git a/adaptors/library/jobs/workWithIdAfterInsertOrUpsert.js b/adaptors/library/jobs/workWithIdAfterInsertOrUpsert.js deleted file mode 100644 index 107844a12866..000000000000 --- a/adaptors/library/jobs/workWithIdAfterInsertOrUpsert.js +++ /dev/null @@ -1,35 +0,0 @@ -create('Patient__c', fields( - field('Name', 'John Doe'), - field('Age__c', state.data.age) -)); - -// NOTE: After inserts, Salesforce will return an sfID and it will be kept in -// references. I'm using alterState here simply to log the output. It's not -// necessary. -fn(state => { - console.log(state.references); - // References is an array: - // references: [ { id: 'a0J0B00000QY9TbUAL', success: true, errors: [] } ], -}); - -//NOTE: We've even got some helper functions for accessing that last reference ID. -create('Visit__c', fields( - field('Date__c', state.data.date) - field('Patient__c', lastReferenceValue('id')) - // Or write it like this... - // field(Patient__c, state.references[0].id) -)); - -// NOTE: You can't work directly with sfIDs on upserts, but you don't need to! -upsert('Patient__c', 'My_Ext_ID__c', fields( - field('Name', 'John Doe'), - field('Age__c', state.data.age), - field('My_Ext_ID__c', state.data.patientNumber) - // THIS unique ID is how you work with the record in SF. -)); - -create('Visit__c', fields( - field('Date__c', state.data.date), - // Related to the patient you just upserted... - relationship('Patient__r', 'My_Ext_ID__c', state.data.patientNumber) -)); diff --git a/adaptors/library/staticExamples.json b/adaptors/library/staticExamples.json deleted file mode 100644 index 42ff78f99691..000000000000 --- a/adaptors/library/staticExamples.json +++ /dev/null @@ -1,187 +0,0 @@ -[ - { - "expressionPath": "jobs/fetch-all-events", - "adaptor": "dhis2", - "adaptor_version": "v8.1.1", - "name": "Fetch all events without pagination" - }, - { - "expressionPath": "jobs/fetch-default-events", - "adaptor": "dhis2", - "adaptor_version": "v8.1.1", - "name": "Fetch default events" - }, - { - "expressionPath": "jobs/fetch-all-events-with-pagination", - "adaptor": "dhis2", - "adaptor_version": "v8.1.1", - "name": "Fetch all events with pagination" - }, - { - "expressionPath": "jobs/commcare-asri-bulk-upload", - "adaptor": "commcare", - "name": "Bulk upload obat lookup-table" - }, - { - "expressionPath": "jobs/commcare-create-user", - "adaptor": "commcare", - "name": "Create user" - }, - { - "expressionPath": "jobs/getKoboData", - "adaptor": "http", - "adaptor_version": "v3.1.7", - "name": "Extract Kobo data from API to send to OpenFn Inbox" - }, - { - "expressionPath": "jobs/alter-state-before-operations", - "adaptor": "salesforce", - "name": "Pre-processing data" - }, - { - "expressionPath": "jobs/async-and-array-dot-map", - "adaptor": "http", - "name": "Using async and array.map" - }, - { - "expressionPath": "jobs/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce", - "adaptor": "salesforce", - "name": "Using merge and each" - }, - { - "expressionPath": "jobs/CommCare-FHIR", - "adaptor": "openhim", - "name": "Create encounter in OpenHIM" - }, - { - "expressionPath": "jobs/opencrvs-create-birth-notification", - "adaptor": "opencrvs", - "name": "Create birth notification in OpenCRVS" - }, - { - "expressionPath": "jobs/opencrvs-query-events", - "adaptor": "opencrvs", - "name": "Query an event in OpenCRVS" - }, - { - "expressionPath": "jobs/complex-http-request-chains", - "adaptor": "http", - "name": "Chaining HTTP Requests" - }, - { - "expressionPath": "jobs/complex-state-control", - "adaptor": "salesforce", - "name": "Using promises" - }, - { - "expressionPath": "jobs/concatenate-many-fields-with-nulls", - "adaptor": "salesforce", - "name": "Concat fields with nulls" - }, - { - "expressionPath": "jobs/create-if-proposal", - "adaptor": "salesforce", - "name": "Create/update records if...", - "adaptor_version": "v2.1.0" - }, - { - "expressionPath": "jobs/Create-SMS-Linked-to-Contact-in-SF", - "adaptor": "salesforce", - "name": "Create SMS linked to contact" - }, - { - "expressionPath": "jobs/satusehat-create-condition", - "adaptor": "satusehat", - "name": "Create a condition Record" - }, - { - "expressionPath": "jobs/satusehat-create-encounter", - "adaptor": "satusehat", - "name": "Create an Encounter Record" - }, - { - "expressionPath": "jobs/satusehat-create-observations", - "adaptor": "satusehat", - "name": "Create an Observation" - }, - { - "expressionPath": "jobs/satusehat-create-medication", - "adaptor": "satusehat", - "name": "Create a Medication Record" - }, - { - "expressionPath": "jobs/DHIS2-DataValues-API", - "adaptor": "dhis2", - "name": "Create data values" - }, - { - "expressionPath": "jobs/DHIS2-Events-API", - "adaptor": "dhis2", - "name": "Create new events" - }, - { - "expressionPath": "jobs/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks", - "adaptor": "salesforce", - "name": "Handling multiple ODK repeat groups" - }, - { - "expressionPath": "jobs/promise-all-nested-requests", - "adaptor": "http", - "name": "Promises and nested requests" - }, - { - "expressionPath": "jobs/send-mail-in-mailgun", - "adaptor": "mailgun", - "name": "send email" - }, - { - "expressionPath": "jobs/send-sms-from-salesforce-workflow", - "adaptor": "telerivet", - "name": "Send sms from Salesforce workflow action" - }, - { - "expressionPath": "jobs/timeout", - "adaptor": "http", - "name": "Timeout to create a delay" - }, - { - "expressionPath": "jobs/upsert-many-items-in-array-with-value-outside-array", - "adaptor": "salesforce", - "name": "Merge data into child array then upsert" - }, - { - "expressionPath": "jobs/synchronous-http-request", - "adaptor": "http", - "name": "Chaining synchronous http requests" - }, - { - "expressionPath": "jobs/stripe-get-subscriptions", - "adaptor": "stripe", - "name": "Get subscriptions in Stripe" - }, - { - "expressionPath": "jobs/stripe-list-customers", - "adaptor": "stripe", - "name": "List customers in Stripe" - }, - { - "expressionPath": "jobs/async-findValue", - "adaptor": "postgresql", - "name": "Using findValue with an array of data" - }, - { - "expressionPath": "jobs/generate-pdf", - "adaptor": "pdfshift", - "name": "Generate a PDF from a HTML string" - }, - { - "expressionPath": "jobs/kobotoolbox-get-suspected-patients", - "adaptor": "kobotoolbox", - "name": "Create an asset in KoboToolbox" - }, - { - "expressionPath": "jobs/kobotoolbox-get-submissions", - "adaptor": "kobotoolbox", - "name": "Extract submissions from KoboToolbox" - } -] diff --git a/adaptors/library/triggers/xmlns.md b/adaptors/library/triggers/xmlns.md deleted file mode 100644 index e5c904e31e07..000000000000 --- a/adaptors/library/triggers/xmlns.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Match a message with a fragment inside another object called `form` ---- - -```json -{ - "form": { - "@xmlns": "http://openrosa.org/formdesigner/F732194-3278-nota-ReAL-one" - } -} -``` diff --git a/adaptors/postgresql.md b/adaptors/postgresql.md index c52a7b87a9b4..4c3d62a9d01a 100644 --- a/adaptors/postgresql.md +++ b/adaptors/postgresql.md @@ -79,7 +79,7 @@ insert( ); ``` -See the [Job Library](/adaptors/library) for more sample jobs. +See [Job Code Examples](/documentation/jobs/job-examples) for more sample code. ### Integration tips diff --git a/adaptors/primero.md b/adaptors/primero.md index 69733c9bd7e2..605e42e5941d 100644 --- a/adaptors/primero.md +++ b/adaptors/primero.md @@ -73,11 +73,8 @@ See the examples section more sample Primero jobs. identifier in the destination system. - Each Primero case also has a `record_id` which is the id in the URL for each case -- It is helpful to set up a job that only fetches a case from Primero like the - one - [here](/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23/#expression). - This job can come in handy when it's time to test and troubleshoot your - solution and validate any test data that was setup in Primero. +- It is helpful to set up a job that only fetches a case from Primero, using + `getCases()`. ## Common Errors diff --git a/articles/2021-05-24-commcare-events.md b/articles/2021-05-24-commcare-events.md index 7f74705119ae..5aca88f275bb 100644 --- a/articles/2021-05-24-commcare-events.md +++ b/articles/2021-05-24-commcare-events.md @@ -373,8 +373,7 @@ Read through the ["What is an integration"](/documentation/tutorials/tutorial), ["OpenFn Concepts"](/documentation/get-started/terminology), and ["Build"](/documentation/build/workflows) sections if you're a thorough, background-first kind of learner. If you crave snippets and sample job code, -head directly to the [Job Library](/adaptors/library) to see how other OpenFn -users are creating their jobs. +head directly to the [Job Code Examples](/documentation/jobs/job-examples). 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. diff --git a/docs/build/steps/steps.md b/docs/build/steps/steps.md index f3b468fed875..388ffbf59f27 100644 --- a/docs/build/steps/steps.md +++ b/docs/build/steps/steps.md @@ -34,8 +34,8 @@ A Step includes these key components: Writing Jobs to add custom logic for business or data transformation rules typically requires basic knowledge of JavaScript. See the -[Job-writing docs](/jobs/job-writing-guide.md) for a detailed overview and the -[Library Examples](/adaptors/library) for sample code. +[Job-writing docs](/jobs/job-writing-guide.md) for a detailed overview and +[Job Code Examples](/jobs/job-examples.md) for sample code. ::: diff --git a/docs/get-started/standards.md b/docs/get-started/standards.md index c37d116cea5e..d1780d669aef 100644 --- a/docs/get-started/standards.md +++ b/docs/get-started/standards.md @@ -143,7 +143,7 @@ OpenFn solutions are: - **interoperable** (connect any application); - **reusable** (utilize existing OpenFn configurations as templates, or easily - share, copy, and modify your own configurations; see docs.openfn.org/library); + share, copy, and modify your own configurations); - **sustainable** (flexible implementation options with no lock-in); - **scalable** (OpenFn leverages enterprise-grade tech to handle high data volumes and provides a range of deployment options to ensure total solution diff --git a/docs/jobs/job-examples.md b/docs/jobs/job-examples.md index e6b804b61b64..5fa11631cfef 100644 --- a/docs/jobs/job-examples.md +++ b/docs/jobs/job-examples.md @@ -8,9 +8,8 @@ contexts to use in your Jobs. :::tip -For example Jobs written by the OpenFn core team and other users, check out the -[Library](/adaptors/library) or other project repositories under -[GitHub.com/OpenFn](https://github.com/OpenFn). +For complete example Jobs written by the OpenFn core team, check out the project +repositories under [GitHub.com/OpenFn](https://github.com/OpenFn). ::: diff --git a/docusaurus.config.js b/docusaurus.config.js index c3704a7d8b77..1d868565a7d2 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -190,12 +190,6 @@ module.exports = { ], ], plugins: [ - [ - path.resolve(__dirname, 'generate-library'), - { - apiUrl: 'https://v1.openfn.org/api/public', - }, - ], [path.resolve(__dirname, 'generate-adaptors'), {}], [ '@docusaurus/plugin-content-docs', diff --git a/generate-library/index.js b/generate-library/index.js deleted file mode 100644 index a54a89e1d8da..000000000000 --- a/generate-library/index.js +++ /dev/null @@ -1,183 +0,0 @@ -const fs = require('fs'); -const axios = require('axios'); - -var formatDistanceToNow = require('date-fns/formatDistanceToNow'); -var parseISO = require('date-fns/parseISO'); - -async function loadPublicLibrary(apiUrl) { - console.log('Loading job library from OpenFn...'); - return await axios.get(`${apiUrl}/jobs`).then(function (response) { - console.log('Done ✓'); - const jobs = response.data; - return jobs; - }); -} - -function hDate(str) { - if (str) { - return str.substring(0, 10); - } - return 'unknown'; -} - -function relative(str) { - if (str) { - return `${formatDistanceToNow(parseISO(str))} ago`; - } - return 'date unknown'; -} - -const otherKeywords = ['async', 'await']; -const jsGlobals = ['Math', 'Array', 'String', 'Promise', 'Number', 'JSON']; - -function getKeywords(expression) { - return [ - ...masterKeywords.filter(word => expression.includes(`${word}(`)), - ...otherKeywords.filter(word => expression.includes(`${word}`)), - ...jsGlobals.filter(word => expression.includes(`${word}.`)), - ]; -} - -function generateBody(j, uniqueName, keywords, official) { - const title = official ? `📜 ${j.name}` : j.name; - const score = Math.round(j.score); - const githubLink = `https://www.github.com/openfn/language-${j.adaptor}`; - const versionLink = j.adaptor_version - ? `https://www.github.com/openfn/language-${j.adaptor}/releases/tag/${j.adaptor_version}` - : githubLink; - - return `--- -title: ${j.name} -sidebar_label: ${score > 75 ? '✨ ' : ''}${title} -id: ${uniqueName} -keywords: - - library - - job - - expression - - ${j.adaptor} -${keywords.map(kw => ` - ${kw}\n`).join('')}--- - -${ - official - ? '📜 This job is an official example from OpenFn.' - : 'This job was provided by an OpenFn.org user via the job library API.' -} - -## Metadata - -- Name: ${j.name} -- Adaptor: [\`@openfn/language-${j.adaptor}\`](${githubLink}) -- Adaptor Version: [\`${j.adaptor_version || 'latest'}\`](${versionLink}) -- Created ${relative(j.inserted_at)} -- Updated ${relative(j.updated_at)} -- Score: ${ - isNaN(score) ? 100 : score - } (an [indicator](/adaptors/library/#library-scores) of how useful this job may be) - -## Key Functions - -${keywords.map(kw => `\`${kw}\``).join(', ')} - -## Expression - -\`\`\`js -${j.expression} -\`\`\``; -} - -function pushToPaths(j, uniqueName) { - filePaths.push({ - adaptor: j.adaptor, - id: `jobs/auto/${uniqueName}`, - name: j.name, - }); -} - -const masterKeywords = JSON.parse( - fs.readFileSync('./generate-library/master.temp.json') -); - -const filePaths = []; - -const cleanUp = string => { - return string - .trim() - .replace(':', '/') - .replace(/^[-,\[]/, ''); -}; - -module.exports = function (context, { apiUrl }) { - return { - name: 'library', - extendCli(cli) { - cli - .command('generate-library') - .description('Generate OpenFn.org Public Job Library') - .action(async () => { - fs.existsSync('./adaptors/library/jobs/auto') || - fs.mkdirSync('./adaptors/library/jobs/auto'); - - const jobs = (await loadPublicLibrary(apiUrl)).map(j => { - const name = cleanUp(j.name); - - return { - ...j, - name, - }; - }); - - console.log('Parsing static examples...'); - const staticExamples = JSON.parse( - fs.readFileSync('./adaptors/library/staticExamples.json') - ) - .map(j => ({ - ...j, - expression: fs.readFileSync( - `./adaptors/library/${j.expressionPath}.js` - ), - })) - .map(j => { - const keywords = getKeywords(j.expression); - const uniqueName = j.expressionPath.substring(5); - const body = generateBody(j, uniqueName, keywords, true); - - pushToPaths(j, uniqueName); - fs.writeFileSync( - `./adaptors/library/jobs/auto/${uniqueName}.md`, - body - ); - }); - console.log('Done ✓'); - - console.log('Parsing public jobs API data...'); - jobs - .filter(j => { - return j.expression && j.expression !== '// Your job goes here.'; - }) - .map(j => { - const uniqueName = `${j.name.trim()}-${hDate(j.inserted_at)}` - .replace(/[^a-z0-9_-]/gi, '-') - .replace(/-{2,}/g, '-') - .replace(/^[-,\[]/, ''); - - const keywords = getKeywords(j.expression); - const body = generateBody(j, uniqueName, keywords); - - pushToPaths(j, uniqueName); - fs.writeFileSync( - `./adaptors/library/jobs/auto/${uniqueName}.md`, - body - ); - }); - console.log('Done ✓'); - - console.log('Creating sidebar paths...'); - fs.writeFileSync( - './adaptors/library/jobs/auto/publicPaths.json', - JSON.stringify(filePaths, null, 2) - ); - console.log('Done ✓'); - }); - }, - }; -}; diff --git a/generate-library/master.temp.json b/generate-library/master.temp.json deleted file mode 100644 index b751132c2409..000000000000 --- a/generate-library/master.temp.json +++ /dev/null @@ -1,106 +0,0 @@ -[ - "alterState", - "appendValues", - "arrayToString", - "bulk", - "cancelEnrollment", - "combine", - "completeEnrollment", - "create", - "createCase", - "createDataValues", - "createEvents", - "createIf", - "createPrograms", - "createReferrals", - "createTEI", - "dataPath", - "dataValue", - "del", - "describe", - "describeTable", - "discover", - "each", - "enrollTEI", - "fetchReportData", - "field", - "fields", - "findValue", - "generateDhis2UID", - "get", - "getAnalytics", - "getCSV", - "getCase", - "getCases", - "getContact", - "getData", - "getDataValues", - "getEnrollments", - "getEvents", - "getForms", - "getJSON", - "getLocation", - "getMetadata", - "getOutbreak", - "getPrograms", - "getReferenceData", - "getReferrals", - "getRelationships", - "getResources", - "getSchema", - "getTEIs", - "humanProper", - "index", - "insert", - "insertMany", - "insertTable", - "join", - "lastReferenceValue", - "list", - "listCases", - "listContacts", - "listLocations", - "listOutbreaks", - "listReferenceData", - "lookup", - "map", - "merge", - "modifyTable", - "parseCSV", - "parseXML", - "patch", - "post", - "postData", - "put", - "putCSV", - "query", - "reference", - "referencePath", - "relationship", - "request", - "retrieve", - "send", - "source", - "sourceValue", - "sql", - "steps", - "submit", - "submitXls", - "toArray", - "update", - "updateCase", - "updateEnrollments", - "updateEvents", - "updatePrograms", - "updateTEI", - "upsert", - "upsertCase", - "upsertContact", - "upsertIf", - "upsertLocation", - "upsertMany", - "upsertOutbreak", - "upsertReferenceData", - "upsertTEI", - null -] \ No newline at end of file diff --git a/generate-library/populate-master.temp.js b/generate-library/populate-master.temp.js deleted file mode 100755 index c2ddf2d33fe2..000000000000 --- a/generate-library/populate-master.temp.js +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env node - -// TODO: replace this with an ast.json lookup from npm or github. - -const fs = require('fs'); -const homedir = require('os').homedir(); - -const adaptors = [ - 'beyonic', - 'cartodb', - 'commcare', - 'dhis2', - 'dynamics', - 'googlesheets', - 'facebook', - 'godata', - 'http', - 'khanacademy', - 'kobotoolbox', - 'magpi', - 'mailchimp', - 'mailgun', - 'maximo', - 'medicmobile', - 'mogli', - 'mongodb', - 'mssql', - 'mysql', - 'nexmo', - 'openfn', - 'openhim', - 'openmrs', - 'postgresql', - 'primero', - 'progres', - 'resourcemap', - 'salesforce', - 'sftp', - 'smpp', - 'surveycto', - 'telerivet', - 'vtiger', - 'zoho', -]; - -const functions = adaptors - .map(a => { - try { - const ast = JSON.parse( - fs.readFileSync( - `${homedir}/platform-app/priv/language_packs/language-${a}/ast.json` - ) - ); - return [ - ...ast.operations.map(o => o.name), - ...ast.common.map(o => o.name), - ...ast.exports.map(o => o.name), - 'relationship', - 'lookup', - ]; - } catch (error) {} - }) - .flat() - .sort(); - -const unique = [...new Set(functions)]; - -fs.writeFileSync( - './generate-library/master.temp.json', - JSON.stringify(unique, null, 2) -); diff --git a/i18n/es/docusaurus-plugin-content-docs/current/build/steps/steps.md b/i18n/es/docusaurus-plugin-content-docs/current/build/steps/steps.md index f12cbd4ce8a7..115482517b27 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/build/steps/steps.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/build/steps/steps.md @@ -41,7 +41,7 @@ Escribir jobs para agregar lógica personalizada con reglas de negocio o de transformación de datos suele requerir conocimientos básicos de JavaScript. Consulta la [documentación sobre cómo escribir jobs](/jobs/job-writing-guide.md) para ver una descripción detallada, y los -[ejemplos de la biblioteca](/adaptors/library) para ver código de muestra. +[ejemplos de código de jobs](/jobs/job-examples.md) para ver código de muestra. ::: diff --git a/i18n/es/docusaurus-plugin-content-docs/current/get-started/standards.md b/i18n/es/docusaurus-plugin-content-docs/current/get-started/standards.md index ddb57cd8e53b..45feb62c6a44 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/get-started/standards.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/get-started/standards.md @@ -154,7 +154,7 @@ Las soluciones de OpenFn: - **son interoperables** (conectan cualquier aplicación); - **son reutilizables** (usa configuraciones de OpenFn existentes como plantillas, o comparte, copia y modifica fácilmente tus propias - configuraciones; consulta docs.openfn.org/library); + configuraciones); - **son sostenibles** (opciones de implementación flexibles, sin dependencia de un proveedor); - **son escalables** (OpenFn usa tecnología de nivel empresarial para gestionar diff --git a/i18n/es/docusaurus-plugin-content-docs/current/jobs/job-examples.md b/i18n/es/docusaurus-plugin-content-docs/current/jobs/job-examples.md index 9a0755c17d63..757e6321b000 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/jobs/job-examples.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/jobs/job-examples.md @@ -10,9 +10,9 @@ datos que puedes usar en tus jobs. :::tip -Para ver jobs de ejemplo escritos por el equipo principal de OpenFn y otros -usuarios, consulta la [biblioteca](/adaptors/library) u otros repositorios de -proyectos en [GitHub.com/OpenFn](https://github.com/OpenFn). +Para ver jobs de ejemplo completos escritos por el equipo principal de OpenFn, +consulta los repositorios de proyectos en +[GitHub.com/OpenFn](https://github.com/OpenFn). ::: diff --git a/package.json b/package.json index 424e342c5099..8c1c00784959 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,9 @@ "private": true, "scripts": { "docusaurus": "docusaurus", - "generate-library": "docusaurus generate-library", "generate-adaptors": "docusaurus generate-adaptors", "start": "docusaurus generate-adaptors & docusaurus start", - "start:dev": "docusaurus generate-adaptors -m && docusaurus generate-library && docusaurus start", + "start:dev": "docusaurus generate-adaptors -m && docusaurus start", "start-offline": "docusaurus start", "build": "docusaurus build", "swizzle": "docusaurus swizzle", @@ -29,7 +28,6 @@ "axios": "1.20.0", "clsx": "^1.1.1", "compare-versions": "^5.0.1", - "date-fns": "2.21.3", "form-data": "4.0.6", "mermaid": "11.16.1", "prism-react-renderer": "^2.1.0", diff --git a/sidebars-adaptors.js b/sidebars-adaptors.js index b94e3b8b5614..6caa7e07bd31 100644 --- a/sidebars-adaptors.js +++ b/sidebars-adaptors.js @@ -4,27 +4,10 @@ const fs = require('fs'); // generate-adaptors code has not yet been run. This if/else is not very elegent // but does the trick. let list = []; -if ( - fs.existsSync('./adaptors/packages/publicPaths.json') && - fs.existsSync('./adaptors/library/jobs/auto/publicPaths.json') -) { +if (fs.existsSync('./adaptors/packages/publicPaths.json')) { const adaptorsFile = fs.readFileSync('./adaptors/packages/publicPaths.json'); const adaptors = JSON.parse(adaptorsFile); - const publicFile = fs.readFileSync( - './adaptors/library/jobs/auto/publicPaths.json' - ); - const publicJobs = JSON.parse(publicFile); - - // Note: we can include out own examples here. - const jobs = [...publicJobs]; - - const groupedJobs = jobs.reduce((r, a) => { - r[a.adaptor] = r[a.adaptor] || []; - r[a.adaptor].push(a); - return r; - }, Object.create(null)); - // Every adaptor repeats the same item labels ('Functions', 'Overview', ...). // Docusaurus derives a sidebar item's translation key from `key ?? label`, // so without an explicit `key` those labels collide and the build throws @@ -48,19 +31,6 @@ if ( key: `${a.name}-configuration`, id: a.configurationSchemaId, }, - groupedJobs[a.name] && groupedJobs[a.name].length > 0 - ? { - type: 'category', - label: 'Examples', - key: `${a.name}-examples`, - items: groupedJobs[a.name].map(j => ({ - type: 'doc', - label: j.name, - key: `library/${j.id}`, - id: `library/${j.id}`, - })), - } - : {}, { type: 'doc', label: 'Changelog', @@ -95,8 +65,6 @@ if ( .map(file => file.replace(/\.[^/.]+$/, '')) .filter(id => id !== 'intro') .filter(id => id !== 'adaptors') - .filter(id => id !== 'library') - .filter(id => id !== 'library-intro') .filter(id => id !== 'packages'); const extras = overviews @@ -112,19 +80,9 @@ if ( ? 'found' : 'NOT FOUND! (Maybe `yarn generate-adaptors` failed.)' ); - console.log( - " Job Library 'publicPaths.json':", - fs.existsSync('./adaptors/library/jobs/auto/publicPaths.json') - ? 'found' - : 'NOT FOUND! (Maybe `yarn generate-library` failed or has not been run.)' - ); list = []; } module.exports = { - adaptors: [ - { type: 'doc', id: 'adaptors-intro' }, - { type: 'doc', id: 'library-intro' }, - ...list, - ], + adaptors: [{ type: 'doc', id: 'adaptors-intro' }, ...list], }; diff --git a/yarn.lock b/yarn.lock index 735121fedb77..5864ecaf60f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5198,7 +5198,6 @@ __metadata: chokidar: ^3.6.0 clsx: ^1.1.1 compare-versions: ^5.0.1 - date-fns: 2.21.3 form-data: 4.0.6 glob: ^11.1.0 mermaid: 11.16.1 @@ -8662,13 +8661,6 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:2.21.3": - version: 2.21.3 - resolution: "date-fns@npm:2.21.3" - checksum: 00dc783af23ab1ca686ea9a21acd9572733ca9544c40a26e3061fc190bb0663c638c88f35d7719553279ad08c787eae816eaa0043d141563efc8394235f6c857 - languageName: node - linkType: hard - "dayjs@npm:^1.11.20": version: 1.11.21 resolution: "dayjs@npm:1.11.21" From 079bf6a7afcb1f97ab28d1e344046fde1ad45809 Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Mon, 12 Oct 2026 13:51:53 +0200 Subject: [PATCH 2/4] spanish hashes --- .../docusaurus-plugin-content-docs/current/build/steps/steps.md | 2 +- .../current/get-started/standards.md | 2 +- .../docusaurus-plugin-content-docs/current/jobs/job-examples.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/build/steps/steps.md b/i18n/es/docusaurus-plugin-content-docs/current/build/steps/steps.md index 115482517b27..0992bb9f8cae 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/build/steps/steps.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/build/steps/steps.md @@ -1,6 +1,6 @@ --- title: Configurar steps -translation_source_hash: f3b468fed875c666bcf0648dfc5959c97beb923c +translation_source_hash: 388ffbf59f27959950b3b8c2a091c1f336d09c78 translation_review_status: machine --- diff --git a/i18n/es/docusaurus-plugin-content-docs/current/get-started/standards.md b/i18n/es/docusaurus-plugin-content-docs/current/get-started/standards.md index 45feb62c6a44..4286b17df06d 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/get-started/standards.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/get-started/standards.md @@ -1,7 +1,7 @@ --- sidebar_label: Estándares title: Estándares y OpenFn -translation_source_hash: c37d116cea5e898bc435f82f866ce7f417e9d185 +translation_source_hash: d1780d669aef33d173ebd71502e8da2856b6ff49 translation_review_status: machine --- diff --git a/i18n/es/docusaurus-plugin-content-docs/current/jobs/job-examples.md b/i18n/es/docusaurus-plugin-content-docs/current/jobs/job-examples.md index 757e6321b000..6f5422fdee9f 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/jobs/job-examples.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/jobs/job-examples.md @@ -1,7 +1,7 @@ --- title: Ejemplos de código de jobs sidebar_label: Ejemplos de jobs -translation_source_hash: e6b804b61b644b95048adfce67db6c76a4519068 +translation_source_hash: 5fa11631cfef9fe91371e070567ff39cdb6fb2a0 translation_review_status: machine --- From 56700dbe2bce8fd074cc0b1fb9eab13cb3bc5a8d Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Mon, 12 Oct 2026 14:00:13 +0200 Subject: [PATCH 3/4] examples --- package.json | 2 +- sidebars-adaptors.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8c1c00784959..d0d48aa2ffea 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "docusaurus": "docusaurus", "generate-adaptors": "docusaurus generate-adaptors", - "start": "docusaurus generate-adaptors & docusaurus start", + "start": "docusaurus generate-adaptors && docusaurus start", "start:dev": "docusaurus generate-adaptors -m && docusaurus start", "start-offline": "docusaurus start", "build": "docusaurus build", diff --git a/sidebars-adaptors.js b/sidebars-adaptors.js index 6caa7e07bd31..becd2ae7ddda 100644 --- a/sidebars-adaptors.js +++ b/sidebars-adaptors.js @@ -21,7 +21,7 @@ if (fs.existsSync('./adaptors/packages/publicPaths.json')) { items: [ { type: 'doc', - label: 'Functions', + label: 'Functions & Examples', key: `${a.name}-functions`, id: a.docsId, }, From f744fcfa31cd8d2b509253a406c7d8c51b6c63b8 Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Mon, 12 Oct 2026 14:51:36 +0200 Subject: [PATCH 4/4] update with examples --- adaptors/asana.md | 13 +- adaptors/azure-storage.md | 13 +- adaptors/beyonic.md | 13 +- adaptors/bigquery.md | 13 +- adaptors/cartodb.md | 13 +- adaptors/chatgpt.md | 13 +- adaptors/cht.md | 13 +- adaptors/ckan.md | 13 +- adaptors/claude.md | 13 +- adaptors/collections.md | 9 + adaptors/commcare.md | 40 ++- adaptors/common.md | 13 +- adaptors/dagu.md | 13 +- adaptors/dhis2.md | 81 ++++- adaptors/divoc.md | 13 +- adaptors/dynamics.md | 13 +- adaptors/eapts.md | 13 +- adaptors/et-mfr.md | 13 +- adaptors/facebook.md | 13 +- adaptors/fhir-4.md | 13 +- adaptors/fhir-eswatini.md | 13 +- adaptors/fhir-fr.md | 13 +- adaptors/fhir-ndr-et.md | 13 +- adaptors/fhir.md | 13 +- adaptors/formsg.md | 13 +- adaptors/ghana-bdr.md | 13 +- adaptors/ghana-nia.md | 13 +- adaptors/gmail.md | 13 +- adaptors/godata.md | 13 +- adaptors/googledrive.md | 13 +- adaptors/googlehealthcare.md | 13 +- adaptors/googlesheets.md | 13 +- adaptors/hive.md | 13 +- adaptors/http.md | 13 +- adaptors/hubtel.md | 13 +- adaptors/ihris.md | 13 +- adaptors/inform.md | 13 +- adaptors/intuit.md | 13 +- adaptors/khanacademy.md | 13 +- adaptors/kobotoolbox.md | 56 +++- adaptors/magpi.md | 13 +- adaptors/mailchimp.md | 13 +- adaptors/mailgun.md | 13 +- adaptors/maximo.md | 13 +- adaptors/medicmobile.md | 13 +- adaptors/memento.md | 13 +- adaptors/mogli.md | 13 +- adaptors/mojatax.md | 13 +- adaptors/mongodb.md | 13 +- adaptors/moodle.md | 13 +- adaptors/motherduck.md | 13 +- adaptors/mpesa.md | 13 +- adaptors/msgraph.md | 13 +- adaptors/mssql.md | 13 +- adaptors/msupply.md | 13 +- adaptors/mtn-momo.md | 13 +- adaptors/mysql.md | 13 +- adaptors/nexmo.md | 13 +- adaptors/ocl.md | 13 +- adaptors/odk.md | 13 +- adaptors/odoo.md | 13 +- adaptors/ona.md | 13 +- adaptors/openboxes.md | 13 +- adaptors/opencrvs.md | 623 ++++++++++++++++++++++++++++++++++- adaptors/openelis.md | 13 +- adaptors/openfn.md | 13 +- adaptors/openhim.md | 13 +- adaptors/openimis.md | 13 +- adaptors/openlmis.md | 13 +- adaptors/openmrs.md | 13 +- adaptors/openspp.md | 13 +- adaptors/pdfshift.md | 49 ++- adaptors/pesapal.md | 13 +- adaptors/postgresql.md | 13 +- adaptors/powerbi.md | 13 +- adaptors/primero.md | 13 +- adaptors/progres.md | 13 +- adaptors/rapidpro.md | 13 +- adaptors/redis.md | 13 +- adaptors/resourcemap.md | 13 +- adaptors/salesforce.md | 13 +- adaptors/satusehat.md | 470 +++++++++++++++++++++++++- adaptors/senaite.md | 13 +- adaptors/sftp.md | 13 +- adaptors/siuben-rd.md | 13 +- adaptors/stripe.md | 50 ++- adaptors/surveycto.md | 13 +- adaptors/tableau.md | 13 +- adaptors/telerivet.md | 13 +- adaptors/twilio.md | 13 +- adaptors/varo.md | 13 +- adaptors/vtiger.md | 13 +- adaptors/whatsapp.md | 13 +- adaptors/wigal-sms.md | 13 +- adaptors/zata.md | 13 +- adaptors/zoho.md | 13 +- 96 files changed, 1855 insertions(+), 667 deletions(-) diff --git a/adaptors/asana.md b/adaptors/asana.md index 49c1b5d7901a..6a0a4aff38f7 100644 --- a/adaptors/asana.md +++ b/adaptors/asana.md @@ -61,12 +61,11 @@ JSON credential type, then your configuration will look something like this: Asana sync: [https://openfn.github.io/ConSoSci/asana/](https://openfn.github.io/ConSoSci/asana/) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/azure-storage.md b/adaptors/azure-storage.md index 7b8033a2ef18..793e2c0df8b5 100644 --- a/adaptors/azure-storage.md +++ b/adaptors/azure-storage.md @@ -54,12 +54,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/beyonic.md b/adaptors/beyonic.md index 533688a4de1e..b68524c25bfb 100644 --- a/adaptors/beyonic.md +++ b/adaptors/beyonic.md @@ -53,12 +53,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/bigquery.md b/adaptors/bigquery.md index 9ea0252481e5..556f009eab82 100644 --- a/adaptors/bigquery.md +++ b/adaptors/bigquery.md @@ -61,12 +61,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/cartodb.md b/adaptors/cartodb.md index 0b007f346a13..789bd78d6138 100644 --- a/adaptors/cartodb.md +++ b/adaptors/cartodb.md @@ -50,12 +50,11 @@ section. - [CARTO API Reference](https://api-docs.carto.com/) - [OpenFn CartoDB Adaptor](https://docs.openfn.org/adaptors/packages/cartodb-readme) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/chatgpt.md b/adaptors/chatgpt.md index 18fa0ef5e3fe..5fa46ac74c55 100644 --- a/adaptors/chatgpt.md +++ b/adaptors/chatgpt.md @@ -63,12 +63,11 @@ technical docs on the authentication parameters required. - API docs: https://platform.openai.com/docs/overview - API Intro: https://www.chatbase.co/blog/chatgpt-api -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/cht.md b/adaptors/cht.md index 1a033624f878..e60a8e7232e1 100644 --- a/adaptors/cht.md +++ b/adaptors/cht.md @@ -100,12 +100,11 @@ this: - CHT Docs: https://docs.communityhealthtoolkit.org/ - CHT Community: https://forum.communityhealthtoolkit.org/ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/ckan.md b/adaptors/ckan.md index a43cd36cc291..3828b9dfdeeb 100644 --- a/adaptors/ckan.md +++ b/adaptors/ckan.md @@ -222,12 +222,11 @@ CKAN has been implemented in [catalog.data.gov](https://catalog.data.gov), [open.canada.ca/data](https://open.canada.ca/data), and [data.humdata.org](https://data.humdata.org). -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/claude.md b/adaptors/claude.md index e5023cf5694d..f5e55bd675ae 100644 --- a/adaptors/claude.md +++ b/adaptors/claude.md @@ -61,12 +61,11 @@ technical docs on the authentication parameters required. - About Claude: https://claude.ai/ - API docs: https://www.anthropic.com/api -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/collections.md b/adaptors/collections.md index 7957ccecf33b..ad80b0180ec8 100644 --- a/adaptors/collections.md +++ b/adaptors/collections.md @@ -400,3 +400,12 @@ more information on how you can update Adaptors! Or, you can always reach out to the Community through our [Community Forum here](https://community.openfn.org/). + +:::info Report or fix a problem with this adaptor + +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). + +::: diff --git a/adaptors/commcare.md b/adaptors/commcare.md index cff3b1819bb5..04130d737bda 100644 --- a/adaptors/commcare.md +++ b/adaptors/commcare.md @@ -165,6 +165,33 @@ learn more about the data export tool, see the ::: +## Examples + +### Create a user and submit a case + +This job creates a mobile worker, then uploads a case for them with `submitXls`. + +```js +// Create a user and submit their case to commcare + +post('user', { + username: 'janedoe42', + password: 'change-me-on-first-login', + first_name: 'Jane', + last_name: 'Doe', + default_phone_number: '+50253311399', + email: 'jdoe@example.org', +}); + +submitXls([{ name: $.data.username, feeling_sick: 'No' }], { + case_type: 'pregnancy', + search_field: 'case_id', + search_column: 'case_id', + name_column: 'name', + create_new_cases: 'on', +}); +``` + ## Authentication [See CommCare docs](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143946031/Authentication) @@ -396,12 +423,11 @@ CommCare has different APIs for reading vs. modifying data. Some helpful links: - Lwala (CommCare-Salesforce 2-way sync): https://github.com/OpenFn/lwala - myAgro (CommCare-Salesforce): https://github.com/OpenFn/myagro-commcare-sf -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/common.md b/adaptors/common.md index bd446c5e1467..deb70ef5e0e9 100644 --- a/adaptors/common.md +++ b/adaptors/common.md @@ -32,12 +32,11 @@ each( ); ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/dagu.md b/adaptors/dagu.md index ffae72ec400c..d536caeacfee 100644 --- a/adaptors/dagu.md +++ b/adaptors/dagu.md @@ -39,12 +39,11 @@ configuration will look something like this: } ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/dhis2.md b/adaptors/dhis2.md index d6ee32ec080d..6848db608e84 100644 --- a/adaptors/dhis2.md +++ b/adaptors/dhis2.md @@ -137,12 +137,75 @@ useful. In the following sections, special systems will be described. 2. Lesotho Integration connecting two DHIS2 instances: https://github.com/OpenFn/lesotho-dhis2 -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? - -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! - -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +### Job code examples + +These examples were written for `@openfn/language-dhis2@8.1.1` and need DHIS2 +server v2.41 or later. + +#### Fetch default events + +Without options, DHIS2 returns the first page of 50 events. + +```js +// DHIS2 Defaults: pageSize: 50 +// Requires DHIS2 server v2.41+, +tracker.export('events'); +``` + +#### Fetch all events without pagination + +Turning paging off returns every event in one response. This can be slow on a +large instance. On servers older than v2.41, use `skipPaging: true` instead. + +```js +// Fetching all events without pagination +// Be cautious: This can degrade performance if you have a lot of events, use with caution +// Requires DHIS2 server v2.41+, for older version `skipPaging: true` +tracker.export('events', { paging: false }); +``` + +#### Fetch all events with pagination + +This job fetches the first page with `totalPages: true` to learn how many pages +there are, then fetches the remaining pages one by one and collects the events +in `state.results`. + +```js +// Fetching all events with pagination +// Requires DHIS2 server v2.41+ + +// First call fetches page 1 (up to 10,000 records) and, via totalPages: true, +// returns pagination details (state.data.pager) describing how many pages remain. +tracker.export('events', { totalPages: true, pageSize: 1e4 }); + +fn(state => { + state.results = state.data.events; + const { page, pageSize, pageCount, total } = state.data.pager; + const remainingPages = pageCount - page; + + state.pages = Array.from({ length: remainingPages }, (_, i) => page + i + 1); + state.pageSize = pageSize; + return state; +}); + +// Second call uses the remaining page numbers computed above to fetch the +// rest of the records in batches, one tracker.export per page. +each( + $.pages, + tracker + .export('events', { pageSize: $.pageSize, page: $.data }) + .then(state => { + state.results = state.results.concat(state.data.events); + return state; + }) +); +``` + +:::info Report or fix a problem with this adaptor + +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). + +::: diff --git a/adaptors/divoc.md b/adaptors/divoc.md index e78121803e26..ffd8b6295b47 100644 --- a/adaptors/divoc.md +++ b/adaptors/divoc.md @@ -54,12 +54,11 @@ To connect to DIVOC, you need to provide authentication credentials: - [OpenFn DIVOC Adaptor](https://docs.openfn.org/adaptors/packages/divoc-readme) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/dynamics.md b/adaptors/dynamics.md index fd10ee3ebd3d..cc1ee59a3a13 100644 --- a/adaptors/dynamics.md +++ b/adaptors/dynamics.md @@ -54,12 +54,11 @@ JSON credential type, then your configuration will look something like this: _Comming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/eapts.md b/adaptors/eapts.md index 4f21ef9a4da9..4d094d1d8405 100644 --- a/adaptors/eapts.md +++ b/adaptors/eapts.md @@ -65,12 +65,11 @@ configuration will look something like this: 2. [OpenFn EAPTS Adaptor](https://docs.openfn.org/adaptors/packages/eapts-readme) 3. [EAPTS Configuration Schema](https://docs.openfn.org/adaptors/packages/eapts-configuration-schema) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/wiki) for more information on -how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/et-mfr.md b/adaptors/et-mfr.md index 9c3930e710ca..c636c92317e1 100644 --- a/adaptors/et-mfr.md +++ b/adaptors/et-mfr.md @@ -40,12 +40,11 @@ configuration will look something like this: } ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/facebook.md b/adaptors/facebook.md index 3085b68edc29..1292d182e643 100644 --- a/adaptors/facebook.md +++ b/adaptors/facebook.md @@ -47,12 +47,11 @@ app permissions and page access granted. - [OpenFn Facebook Adaptor Configuration](https://docs.openfn.org/adaptors/packages/facebook-configuration-schema) - [OpenFn Facebook Adaptor Docs](https://docs.openfn.org/adaptors/packages/facebook-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/fhir-4.md b/adaptors/fhir-4.md index 7d5e5db41451..e08ed64db62d 100644 --- a/adaptors/fhir-4.md +++ b/adaptors/fhir-4.md @@ -726,12 +726,11 @@ b.patient({ }); ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/fhir-eswatini.md b/adaptors/fhir-eswatini.md index 35ceeb02febd..845c82f32a24 100644 --- a/adaptors/fhir-eswatini.md +++ b/adaptors/fhir-eswatini.md @@ -473,12 +473,11 @@ code is comprehensive and accurate. But bugs in the generation process can result in errors, and the sheer scale of code generated means that test coverage can be lacking. -## I've noticed a problem with this adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/fhir-fr.md b/adaptors/fhir-fr.md index 82c94bc28a31..e549890368e1 100644 --- a/adaptors/fhir-fr.md +++ b/adaptors/fhir-fr.md @@ -24,12 +24,11 @@ fhir-adaptor-generator (which is a new tool still in testing). Please share any questions or feedback on [community.openfn.org](https://community.openfn.org). -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/wiki) for more information on -how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/fhir-ndr-et.md b/adaptors/fhir-ndr-et.md index c09f02eef2ef..00b1dfc85e17 100644 --- a/adaptors/fhir-ndr-et.md +++ b/adaptors/fhir-ndr-et.md @@ -26,12 +26,11 @@ fhir-adaptor-generator (which is a new tool still in testing). Please share any questions or feedback on [community.openfn.org](https://community.openfn.org). -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/wiki) for more information on -how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/fhir.md b/adaptors/fhir.md index 4478636eadfb..d97f101f58d2 100644 --- a/adaptors/fhir.md +++ b/adaptors/fhir.md @@ -77,12 +77,11 @@ define your target endpoint and FHIR version: Have resources or links to share? Submit a PR to edit this page or post on [community.openfn.org](https://community.openfn.org). -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/wiki) for more information on -how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/formsg.md b/adaptors/formsg.md index ed7d76150871..30b37cc601b1 100644 --- a/adaptors/formsg.md +++ b/adaptors/formsg.md @@ -51,12 +51,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -#### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/ghana-bdr.md b/adaptors/ghana-bdr.md index f6d6ccfe2974..4e6586bdc1bd 100644 --- a/adaptors/ghana-bdr.md +++ b/adaptors/ghana-bdr.md @@ -45,12 +45,11 @@ To connect to Ghana BDR, you need to provide authentication credentials: - [Ghana BDR Official Website](https://bdr.gov.gh/) - [OpenFn Ghana BDR Adaptor](https://docs.openfn.org/adaptors/packages/ghana-bdr-readme) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/ghana-nia.md b/adaptors/ghana-nia.md index 5f59cddcb2a5..44d7a721a5b7 100644 --- a/adaptors/ghana-nia.md +++ b/adaptors/ghana-nia.md @@ -45,12 +45,11 @@ To connect to Ghana NIA, you need to provide authentication credentials: - [Ghana NIA Official Website](https://nia.gov.gh/) - [OpenFn Ghana NIA Adaptor](https://docs.openfn.org/adaptors/packages/ghana-nia-readme) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/gmail.md b/adaptors/gmail.md index 63c9244319c5..d7df62500f20 100644 --- a/adaptors/gmail.md +++ b/adaptors/gmail.md @@ -58,12 +58,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/godata.md b/adaptors/godata.md index 3ebacfc43714..c0249feaacc6 100644 --- a/adaptors/godata.md +++ b/adaptors/godata.md @@ -43,12 +43,11 @@ supported by `language-godata`. See Go.Data docs site: https://worldhealthorganization.github.io/godata/integration-scripts/ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/googledrive.md b/adaptors/googledrive.md index e11a2a0fbe66..c9a4c1d6aa94 100644 --- a/adaptors/googledrive.md +++ b/adaptors/googledrive.md @@ -88,12 +88,11 @@ must be manually refreshed. - [OpenFn Google Drive Adaptor Configuration](https://docs.openfn.org/adaptors/packages/googledrive-configuration-schema) - [OpenFn Google Drive Adaptor Docs](https://docs.openfn.org/adaptors/packages/googledrive-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/googlehealthcare.md b/adaptors/googlehealthcare.md index c91a9864f758..49093f5487a8 100644 --- a/adaptors/googlehealthcare.md +++ b/adaptors/googlehealthcare.md @@ -84,12 +84,11 @@ recommended for all OpenFn workflows. _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/googlesheets.md b/adaptors/googlesheets.md index a9f53ede7ddf..34a447dd1165 100644 --- a/adaptors/googlesheets.md +++ b/adaptors/googlesheets.md @@ -171,12 +171,11 @@ that shows us how to get data via a REST API and push it to Google Sheet. - OpenFn Workflow Tutorial: [HTTP-to-GoogleSheets](https://docs.openfn.org/documentation/tutorials/http-to-googlesheets) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/hive.md b/adaptors/hive.md index 72d1907b7a18..54223a3c7239 100644 --- a/adaptors/hive.md +++ b/adaptors/hive.md @@ -44,12 +44,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/http.md b/adaptors/http.md index 147295aa790e..d2373b503e70 100644 --- a/adaptors/http.md +++ b/adaptors/http.md @@ -47,12 +47,11 @@ JSON credential type, then your configuration will look something like this: 2. UNICEF Thailand Primero Interoperability: [https://openfn.github.io/primero-thailand/](https://openfn.github.io/primero-thailand/) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/hubtel.md b/adaptors/hubtel.md index acc53f808680..146a33163b30 100644 --- a/adaptors/hubtel.md +++ b/adaptors/hubtel.md @@ -56,12 +56,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/ihris.md b/adaptors/ihris.md index b5e9d123e538..228fa3fe166b 100644 --- a/adaptors/ihris.md +++ b/adaptors/ihris.md @@ -41,12 +41,11 @@ configuration will look something like this: } ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/inform.md b/adaptors/inform.md index 9d2b28cc8364..d7abad1db7b6 100644 --- a/adaptors/inform.md +++ b/adaptors/inform.md @@ -50,12 +50,11 @@ JSON credential type, then your configuration will look something like this: 1. [Inform Platform](https://inform.unicef.org/) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/intuit.md b/adaptors/intuit.md index 62acd5b9b47f..d5d5a278708e 100644 --- a/adaptors/intuit.md +++ b/adaptors/intuit.md @@ -55,12 +55,11 @@ JSON credential type, then your configuration will look something like this: 1. [API Documentation](https://developer.intuit.com/) 2. [Webhook Configuration Documentation](https://developer.intuit.com/app/developer/qbo/docs/api/webhooks) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/khanacademy.md b/adaptors/khanacademy.md index fbf8eeec694c..d082cf9980c5 100644 --- a/adaptors/khanacademy.md +++ b/adaptors/khanacademy.md @@ -53,12 +53,11 @@ maintaining user privacy and data protection. - [OpenFn Khan Academy Adaptor Configuration](https://docs.openfn.org/adaptors/packages/khanacademy-configuration-schema) - [OpenFn Khan Academy Adaptor Docs](https://docs.openfn.org/adaptors/packages/khanacademy-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/kobotoolbox.md b/adaptors/kobotoolbox.md index b744c8113b8d..e4f54fdc6a2a 100644 --- a/adaptors/kobotoolbox.md +++ b/adaptors/kobotoolbox.md @@ -229,12 +229,54 @@ also be implemented to send GET/POST/PUT requests to the Kobo APIs. See the `ConSoSci` GitHub repo for several example Kobo-to-database jobs: https://github.com/OpenFn/consosci -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +### Job code examples -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +#### Extract new submissions from every form -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +This job lists all forms, then fetches the submissions each one received since +the last run. It uses a cursor that starts from today. + +```js +//Get all Kobo forms/projects, and then get form submissions +//that were submitted after a specific time +cursor($.cursor, { defaultValue: 'today' }); + +getForms(); + +each( + $.data, + getSubmissions($.data.uid, { + query: `{"_submission_time":{"$gte":"${$.cursor}"}}`, + }) +); +``` + +#### Calculate a share of submissions + +This job fetches the submissions for one form and works out what percentage of +them are suspected COVID-19 cases. + +```js +// Get all submissions of a specific form/asset and get the percentage of patients suspected of having covid-19 +getSubmissions('aDReHdA7UuNBYsiCXQBr43'); + +fn(state => { + const results = state.data?.results; + + const suspectedPatients = results.filter( + item => item['Please_select_sample_type'] === 'suspected_covid_19' + ); + const suspectedCovidPatientsPercentage = + (suspectedPatients.length / results.length) * 100; + return { ...state, suspectedCovidPatientsPercentage }; +}); +``` + +:::info Report or fix a problem with this adaptor + +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). + +::: diff --git a/adaptors/magpi.md b/adaptors/magpi.md index e6f34d69d693..d6507210ba5c 100644 --- a/adaptors/magpi.md +++ b/adaptors/magpi.md @@ -16,12 +16,11 @@ fetchSurveyData({ Every time this job runs it will only fetch new data, by default. -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/mailchimp.md b/adaptors/mailchimp.md index f4388672ce21..e2411d8ed42b 100644 --- a/adaptors/mailchimp.md +++ b/adaptors/mailchimp.md @@ -56,12 +56,11 @@ JSON credential type, then your configuration will look something like this: 1. GIFE Project - Mailchimp -> Salesforce sync: [https://github.com/OpenFn/gife](https://github.com/OpenFn/gife) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/mailgun.md b/adaptors/mailgun.md index c3866220b70e..088a9139c095 100644 --- a/adaptors/mailgun.md +++ b/adaptors/mailgun.md @@ -50,12 +50,11 @@ JSON credential type, then your configuration will look something like this: 2. [Event Webhooks](https://documentation.mailgun.com/en/latest/api-events.html#event-webhooks) 3. [Support and Community](https://help.mailgun.com/) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/maximo.md b/adaptors/maximo.md index 2cb053396019..9679f5452b2a 100644 --- a/adaptors/maximo.md +++ b/adaptors/maximo.md @@ -46,12 +46,11 @@ Maximo uses HTTP basic authentication for API access: - [OpenFn Maximo Adaptor Configuration](https://docs.openfn.org/adaptors/packages/maximo-configuration-schema) - [OpenFn Maximo Adaptor Docs](https://docs.openfn.org/adaptors/packages/maximo-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/medicmobile.md b/adaptors/medicmobile.md index 7c85bbd97500..00e41944f815 100644 --- a/adaptors/medicmobile.md +++ b/adaptors/medicmobile.md @@ -42,12 +42,11 @@ JSON credential type, then your configuration will look something like this: ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/memento.md b/adaptors/memento.md index 9e70086aa8e0..1aef3529a080 100644 --- a/adaptors/memento.md +++ b/adaptors/memento.md @@ -46,12 +46,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -#### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/mogli.md b/adaptors/mogli.md index 5d7743acbf53..7d6e48baad51 100644 --- a/adaptors/mogli.md +++ b/adaptors/mogli.md @@ -52,12 +52,11 @@ secure message transmission. - [OpenFn Mogli Adaptor Configuration](https://docs.openfn.org/adaptors/packages/mogli-configuration-schema) - [OpenFn Mogli Adaptor Docs](https://docs.openfn.org/adaptors/packages/mogli-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/mojatax.md b/adaptors/mojatax.md index 48406052cab2..9d67a88a0493 100644 --- a/adaptors/mojatax.md +++ b/adaptors/mojatax.md @@ -49,12 +49,11 @@ something like this: - Mojatax API documentation on Postman: https://documenter.getpostman.com/view/5385860/2s93RMVao6#intro -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/mongodb.md b/adaptors/mongodb.md index ca883d3b564f..b5480801cd87 100644 --- a/adaptors/mongodb.md +++ b/adaptors/mongodb.md @@ -40,12 +40,11 @@ JSON credential type, then your configuration will look something like this: 1. [MongoDB documentation](https://www.mongodb.com/docs/) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/moodle.md b/adaptors/moodle.md index 0445cd9867e9..135c63b8e803 100644 --- a/adaptors/moodle.md +++ b/adaptors/moodle.md @@ -116,12 +116,11 @@ fn(state => { }); ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/motherduck.md b/adaptors/motherduck.md index a7887804cf01..2614c2f029e0 100644 --- a/adaptors/motherduck.md +++ b/adaptors/motherduck.md @@ -52,12 +52,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -#### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/mpesa.md b/adaptors/mpesa.md index 373ffd14f431..314f8c07e2b2 100644 --- a/adaptors/mpesa.md +++ b/adaptors/mpesa.md @@ -43,12 +43,11 @@ JSON credential type, then your configuration will look something like this: 1. [Mpesa Documentation](https://developer.safaricom.co.ke/) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/msgraph.md b/adaptors/msgraph.md index ace10938b7c1..22306a59a307 100644 --- a/adaptors/msgraph.md +++ b/adaptors/msgraph.md @@ -97,12 +97,11 @@ and/or consult with your system administrator.** - [MS Graph Overview](https://learn.microsoft.com/en-us/graph/overview) - [MS Graph OAuth Scopes](https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/mssql.md b/adaptors/mssql.md index 8ad0208fd0d2..dc6fec17a591 100644 --- a/adaptors/mssql.md +++ b/adaptors/mssql.md @@ -43,12 +43,11 @@ JSON credential type, then your configuration will look something like this: 1. [MSSQL documentation](https://learn.microsoft.com/en-us/sql/?view=sql-server-ver16) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/msupply.md b/adaptors/msupply.md index 434fce1a4c70..ac8331539380 100644 --- a/adaptors/msupply.md +++ b/adaptors/msupply.md @@ -41,12 +41,11 @@ JSON credential type, then your configuration will look something like this: 1. [Msupply Documentation](https://docs.msupply.foundation/docs/introduction/introduction/) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/mtn-momo.md b/adaptors/mtn-momo.md index 74ba40852a5e..d421a44be10b 100644 --- a/adaptors/mtn-momo.md +++ b/adaptors/mtn-momo.md @@ -49,12 +49,11 @@ JSON credential type, then your configuration will look something like this: 1. [Mtn-Momo Documentation](https://momodeveloper.mtn.com/api-documentation) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/mysql.md b/adaptors/mysql.md index 014ca8c137ec..f4d5f1671dda 100644 --- a/adaptors/mysql.md +++ b/adaptors/mysql.md @@ -39,12 +39,11 @@ JSON credential type, then your configuration will look something like this: 1. [MySQL documentation](https://dev.mysql.com/doc/) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/nexmo.md b/adaptors/nexmo.md index 23b2e61a6884..20ccf404522d 100644 --- a/adaptors/nexmo.md +++ b/adaptors/nexmo.md @@ -49,12 +49,11 @@ all Nexmo communication services. - [OpenFn Nexmo Adaptor Configuration](https://docs.openfn.org/adaptors/packages/nexmo-configuration-schema) - [OpenFn Nexmo Adaptor Docs](https://docs.openfn.org/adaptors/packages/nexmo-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/ocl.md b/adaptors/ocl.md index 7d3b702958c4..084f9dcf1ae8 100644 --- a/adaptors/ocl.md +++ b/adaptors/ocl.md @@ -65,12 +65,11 @@ JSON credential type, then your configuration will look something like this: 1. OpenFn Prototype for Médecins Sans Frontières (MSF) LIME Project - OpenMRS -> OCL -> DHIS2 sync: https://github.com/OpenFn/openfn-lime -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/odk.md b/adaptors/odk.md index b0d7b58afe28..ccda25b8b68a 100644 --- a/adaptors/odk.md +++ b/adaptors/odk.md @@ -48,12 +48,11 @@ Every time this job runs it will get of all submissions and write them to } ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/odoo.md b/adaptors/odoo.md index cc0ae201e253..43187f084702 100644 --- a/adaptors/odoo.md +++ b/adaptors/odoo.md @@ -63,12 +63,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/ona.md b/adaptors/ona.md index 7fb4ac1c8db3..4014c781ebbf 100644 --- a/adaptors/ona.md +++ b/adaptors/ona.md @@ -18,12 +18,11 @@ that walks users through webhook creation. 6. Check to see that, once a form is submitted, it is forwarded to your OpenFn inbox. -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/openboxes.md b/adaptors/openboxes.md index aba54a427413..741de0d45437 100644 --- a/adaptors/openboxes.md +++ b/adaptors/openboxes.md @@ -44,12 +44,11 @@ JSON credential type, then your configuration will look something like this: 1. [OpenBoxes Documentation](https://momodeveloper.mtn.com/api-documentation) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/opencrvs.md b/adaptors/opencrvs.md index e4921e655542..0654ebe1ea06 100644 --- a/adaptors/opencrvs.md +++ b/adaptors/opencrvs.md @@ -26,6 +26,616 @@ OpenCRVS supports 2 primary integration options with OpenFn: [docs](https://documentation.opencrvs.org/technology/interoperability/webhook-clients)). This option is suited for real-time, event-based data integration. +## Examples + +### Query birth records + +This job builds a search from the incoming data and returns up to 10 registered +births that match. + +```js +// Get a birth record from OpenCRVS + +fn(state => { + const { data } = state; + state.birthQuery = { + event: 'birth', + registrationStatuses: ['REGISTERED'], + fatherFirstNames: data.fatherFirstNames, + motherFirstNames: data.motherFirstNames, + childGender: data.childGender, + dateOfRegistrationStart: data.dateOfRegistrationStart, + dateOfRegistrationEnd: data.dateOfRegistrationEnd, + declarationJurisdictionId: data.declarationJurisdictionId, + eventLocationId: data.eventLocationId, + }; + + return state; +}); + +queryEvents($.birthQuery, { count: 10, skip: 0 }); +``` + +### Create a birth notification + +This job builds the FHIR bundle for a birth notification (composition, child, +mother, father, informant and encounter) and sends it with +`createBirthNotification`. The identifiers and values are sample data. + +
+Show code + +```js +// Create a birth notification in OpenCRVS + +fn(state => { + const motherId = util.uuid(); + const comparisonId = util.uuid(); + const childId = util.uuid(); + const encounterId = util.uuid(); + const fatherId = util.uuid(); + const informantId = util.uuid(); + + state.birthNotificationEntryData = [ + { + fullUrl: `urn:uuid:${comparisonId}`, + resource: { + identifier: { + system: 'urn:ietf:rfc:3986', + value: '8f793c5a-3d53-4c9b-898b-1c04759716c6', + }, + resourceType: 'Composition', + status: 'final', + type: { + coding: [ + { + system: 'http://opencrvs.org/doc-types', + code: 'birth-notification', + }, + ], + text: 'Birth Notification', + }, + class: { + coding: [ + { + system: 'http://opencrvs.org/specs/classes', + code: 'crvs-document', + }, + ], + text: 'CRVS Document', + }, + subject: { + reference: `urn:uuid:${childId}`, + }, + date: '2022-08-14T14:43:47.000Z', + author: [], + title: 'Birth Notification', + section: [ + { + title: 'Child details', + code: { + coding: [ + { + system: 'http://opencrvs.org/specs/sections', + code: 'child-details', + }, + ], + text: 'Child details', + }, + entry: [ + { + reference: `urn:uuid:${childId}`, + }, + ], + }, + { + title: 'Birth encounter', + code: { + coding: [ + { + system: 'http://opencrvs.org/specs/sections', + code: 'birth-encounter', + }, + ], + text: 'Birth encounter', + }, + entry: [ + { + reference: `urn:uuid:${encounterId}`, + }, + ], + }, + { + title: "Mother's details", + code: { + coding: [ + { + system: 'http://opencrvs.org/specs/sections', + code: 'mother-details', + }, + ], + text: "Mother's details", + }, + entry: [ + { + reference: `urn:uuid:${motherId}`, + }, + ], + }, + { + title: "Informant's details", + code: { + coding: [ + { + system: 'http://opencrvs.org/specs/sections', + code: 'informant-details', + }, + ], + text: "Informant's details", + }, + entry: [ + { + reference: `urn:uuid:${informantId}`, + }, + ], + }, + { + title: "Father's details", + code: { + coding: [ + { + system: 'http://opencrvs.org/doc-sections', + code: 'father-details', + }, + ], + text: "Father's details", + }, + entry: [ + { + reference: `urn:uuid:${fatherId}`, + }, + ], + }, + ], + }, + }, + { + fullUrl: `urn:uuid:${util.uuid()}`, + resource: { + resourceType: 'Task', + status: 'draft', + intent: 'unknown', + identifier: [], + code: { + coding: [ + { + system: 'http://opencrvs.org/specs/types', + code: 'BIRTH', + }, + ], + }, + focus: { + reference: `urn:uuid:${comparisonId}`, + }, + extension: [ + { + url: 'http://opencrvs.org/specs/extension/contact-person', + valueString: 'MOTHER', + }, + { + url: 'http://opencrvs.org/specs/extension/contact-person-phone-number', + valueString: '+260759205190', + }, + { + url: 'http://opencrvs.org/specs/extension/contact-person-email', + valueString: 'axon@gmail.com', + }, + { + url: 'http://opencrvs.org/specs/extension/timeLoggedMS', + valueInteger: 0, + }, + { + url: 'http://opencrvs.org/specs/extension/in-complete-fields', + valueString: 'N/A', + }, + { + url: 'http://opencrvs.org/specs/extension/regLastOffice', + valueReference: { + reference: 'Location/178e21a9-60ad-4283-bd49-f576f61a5648', + }, + }, + ], + }, + }, + { + fullUrl: `urn:uuid:${childId}`, + resource: { + resourceType: 'Patient', + active: true, + name: [ + { + use: 'en', + family: 'Tatke', + given: ['Harney'], + }, + ], + gender: 'male', + birthDate: '2022-06-29', + deceasedBoolean: false, + multipleBirthBoolean: false, + }, + }, + { + fullUrl: `urn:uuid:${motherId}`, + resource: { + resourceType: 'Patient', + active: true, + identifier: [ + { + use: 'official', + type: { + coding: [ + { + system: 'http://opencrvs.org/specs/identifier-type', + code: 'NATIONAL_ID', + }, + ], + }, + value: '3624667568', + }, + ], + name: [ + { + use: 'en', + family: 'Ratke', + given: ['Mom'], + }, + ], + gender: 'female', + telecom: [ + { + use: 'mobile', + system: 'phone', + value: '+260759205190', + }, + ], + birthDate: '2002-06-29', + deceasedBoolean: false, + multipleBirthInteger: 2, + maritalStatus: { + coding: [ + { + system: 'http://hl7.org/fhir/StructureDefinition/marital-status', + code: 'M', + }, + ], + text: 'MARRIED', + }, + address: [ + { + type: 'PRIMARY_ADDRESS', + line: [ + '12', + 'Usual Street', + 'Usual Residental Area', + '', + '', + 'URBAN', + ], + city: 'Meghanland', + district: 'c51ea274-8ffa-4b0b-b3d3-12991e9f0630', + state: 'c5d7a275-3638-41a3-bd53-145bd9410fd6', + postalCode: '52275', + country: 'FAR', + }, + ], + extension: [ + { + url: 'http://opencrvs.org/specs/extension/patient-occupation', + valueString: 'Housewife', + }, + { + url: 'http://hl7.org/fhir/StructureDefinition/patient-nationality', + extension: [ + { + url: 'code', + valueCodeableConcept: { + coding: [ + { + system: 'urn:iso:std:iso:3166', + code: 'FAR', + }, + ], + }, + }, + { + url: 'period', + valuePeriod: { + start: '', + end: '', + }, + }, + ], + }, + { + url: 'http://opencrvs.org/specs/extension/educational-attainment', + valueString: 'POST_SECONDARY_ISCED_4', + }, + ], + }, + }, + { + fullUrl: `urn:uuid:${informantId}`, + resource: { + resourceType: 'RelatedPerson', + relationship: { + coding: [ + { + system: + 'http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype', + code: 'MOTHER', + }, + ], + }, + patient: { + reference: `urn:uuid:${motherId}`, + }, + }, + }, + { + fullUrl: `urn:uuid:${fatherId}`, + resource: { + resourceType: 'Patient', + active: true, + identifier: [ + { + use: 'official', + type: { + coding: [ + { + system: 'http://opencrvs.org/specs/identifier-type', + code: 'NATIONAL_ID', + }, + ], + }, + value: '6848901132', + }, + ], + name: [ + { + use: 'en', + family: 'Ratke', + given: ['Dad'], + }, + ], + gender: 'male', + telecom: [ + { + use: 'mobile', + system: 'phone', + value: '+260759205190', + }, + ], + birthDate: '2002-06-29', + deceasedBoolean: false, + multipleBirthInteger: 2, + maritalStatus: { + coding: [ + { + system: 'http://hl7.org/fhir/StructureDefinition/marital-status', + code: 'M', + }, + ], + text: 'MARRIED', + }, + address: [ + { + type: 'PRIMARY_ADDRESS', + line: [ + '12', + 'Usual Street', + 'Usual Residental Area', + '', + '', + 'URBAN', + ], + city: 'Madgeland', + district: 'c51ea274-8ffa-4b0b-b3d3-12991e9f0630', + state: 'c5d7a275-3638-41a3-bd53-145bd9410fd6', + postalCode: '52275', + country: 'FAR', + }, + ], + extension: [ + { + url: 'http://opencrvs.org/specs/extension/patient-occupation', + valueString: 'Businessman', + }, + { + url: 'http://hl7.org/fhir/StructureDefinition/patient-nationality', + extension: [ + { + url: 'code', + valueCodeableConcept: { + coding: [ + { + system: 'urn:iso:std:iso:3166', + code: 'FAR', + }, + ], + }, + }, + { + url: 'period', + valuePeriod: { + start: '', + end: '', + }, + }, + ], + }, + { + url: 'http://opencrvs.org/specs/extension/educational-attainment', + valueString: 'POST_SECONDARY_ISCED_4', + }, + ], + }, + }, + { + fullUrl: `urn:uuid:${encounterId}`, + resource: { + resourceType: 'Encounter', + status: 'finished', + location: [ + { + location: { + reference: 'Location/704b9706-d729-4834-8656-05b562065deb', + }, + }, + ], + }, + }, + { + fullUrl: `urn:uuid:${util.uuid()}`, + resource: { + resourceType: 'Observation', + status: 'final', + context: { + reference: `urn:uuid:${encounterId}`, + }, + category: [ + { + coding: [ + { + system: 'http://hl7.org/fhir/observation-category', + code: 'procedure', + display: 'Procedure', + }, + ], + }, + ], + code: { + coding: [ + { + system: 'http://loinc.org', + code: '57722-1', + display: 'Birth plurality of Pregnancy', + }, + ], + }, + valueQuantity: { + value: 'SINGLE', + }, + }, + }, + { + fullUrl: `urn:uuid:${util.uuid()}`, + resource: { + resourceType: 'Observation', + status: 'final', + context: { + reference: `urn:uuid:${encounterId}`, + }, + category: [ + { + coding: [ + { + system: 'http://hl7.org/fhir/observation-category', + code: 'vital-signs', + display: 'Vital Signs', + }, + ], + }, + ], + code: { + coding: [ + { + system: 'http://loinc.org', + code: '3141-9', + display: 'Body weight Measured', + }, + ], + }, + valueQuantity: { + value: 4, + unit: 'kg', + system: 'http://unitsofmeasure.org', + code: 'kg', + }, + }, + }, + { + fullUrl: `urn:uuid:${util.uuid()}`, + resource: { + resourceType: 'Observation', + status: 'final', + context: { + reference: `urn:uuid:${encounterId}`, + }, + category: [ + { + coding: [ + { + system: 'http://hl7.org/fhir/observation-category', + code: 'procedure', + display: 'Procedure', + }, + ], + }, + ], + code: { + coding: [ + { + system: 'http://loinc.org', + code: '73764-3', + display: 'Birth attendant title', + }, + ], + }, + valueString: 'PHYSICIAN', + }, + }, + { + fullUrl: `urn:uuid:${util.uuid()}`, + resource: { + resourceType: 'QuestionnaireResponse', + extension: [], + status: 'completed', + subject: { + reference: `urn:uuid:${encounterId}`, + }, + item: [ + { + text: 'birth.mother.mother-view-group.motherIdType', + linkId: '', + answer: [ + { + valueString: 'NATIONAL_ID', + }, + ], + }, + { + text: 'birth.father.father-view-group.fatherIdType', + linkId: '', + answer: [ + { + valueString: 'NATIONAL_ID', + }, + ], + }, + ], + }, + }, + ]; + + return state; +}); + +createBirthNotification($.birthNotificationEntryData); +``` + +
+ ## Authentication See [OpenCRVS docs](https://documentation.opencrvs.org/) for the latest on @@ -61,12 +671,11 @@ JSON credential type, then your configuration will look something like this: 1. [OpenCRVS Documentation](https://documentation.opencrvs.org/) 2. [OpenCRVS API Reference](https://documentation.opencrvs.org/technology/interoperability) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/openelis.md b/adaptors/openelis.md index a7affda94553..19bb1156aa8c 100644 --- a/adaptors/openelis.md +++ b/adaptors/openelis.md @@ -40,12 +40,11 @@ configuration will look something like this: } ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/openfn.md b/adaptors/openfn.md index 142ae46a167a..1fab5e39a545 100644 --- a/adaptors/openfn.md +++ b/adaptors/openfn.md @@ -68,12 +68,11 @@ request({ - [OpenFn Adaptor Configuration](https://docs.openfn.org/adaptors/packages/openfn-configuration-schema) - [OpenFn Adaptor Docs](https://docs.openfn.org/adaptors/packages/openfn-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/openhim.md b/adaptors/openhim.md index 30d2f97190c6..43e6cd3cbffe 100644 --- a/adaptors/openhim.md +++ b/adaptors/openhim.md @@ -53,12 +53,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/openimis.md b/adaptors/openimis.md index 66d4efd37e49..522cb43a4964 100644 --- a/adaptors/openimis.md +++ b/adaptors/openimis.md @@ -59,12 +59,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/openlmis.md b/adaptors/openlmis.md index a1ddef893a30..df3e53bfc037 100644 --- a/adaptors/openlmis.md +++ b/adaptors/openlmis.md @@ -65,12 +65,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/openmrs.md b/adaptors/openmrs.md index 75b5f1686ba8..c8bbe541af36 100644 --- a/adaptors/openmrs.md +++ b/adaptors/openmrs.md @@ -180,12 +180,11 @@ fhir.get('Encounter', { DHIS2 sync: [https://github.com/OpenFn/openfn-lime](https://github.com/OpenFn/openfn-lime) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/openspp.md b/adaptors/openspp.md index c8d5a66886b5..dea24d17d0c8 100644 --- a/adaptors/openspp.md +++ b/adaptors/openspp.md @@ -57,12 +57,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/pdfshift.md b/adaptors/pdfshift.md index c914f8faa2f1..3d8bab8a2de0 100644 --- a/adaptors/pdfshift.md +++ b/adaptors/pdfshift.md @@ -15,6 +15,42 @@ suited for scheduled, bulk syncs or workflows that must update data in PDFShift with external information. See [functions](/adaptors/packages/pdfshift-docs) for more on how to use this adaptor to work with the API. +## Examples + +### Generate a PDF from an HTML string + +This job builds an HTML sales report from the input data, converts it to a PDF, +and logs the download link. PDFShift keeps the file for 48 hours. + +```js +// Generate a PDF document from a HTML string + +fn(state => { + const { data } = state; + + state.pdfHTMLContent = ` + +

Sales Report

+

Date: ${data.date}

+

Total Sales: $${data.totalSales}

+ + `; + + return state; +}); + +generatePDF($.pdfHTMLContent, { + sandbox: true, + filename: 'trials.pdf', +}); + +fn(state => { + const { data } = state; + console.log(`Download PDF in 48 hours from ${data.url}`); + return { ...state, pdfData: data }; +}); +``` + ## Authentication See [PDFShift docs](https://docs.pdfshift.io/#authentication) for the latest on @@ -40,12 +76,11 @@ JSON credential type, then your configuration will look something like this: 1. [PDFShift Documentation](https://docs.pdfshift.io/#introduction) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/pesapal.md b/adaptors/pesapal.md index 8cee1f608de2..506a2f7727db 100644 --- a/adaptors/pesapal.md +++ b/adaptors/pesapal.md @@ -94,12 +94,11 @@ how to configure a credential in OpenFn. _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/postgresql.md b/adaptors/postgresql.md index 4c3d62a9d01a..03bfbe680edf 100644 --- a/adaptors/postgresql.md +++ b/adaptors/postgresql.md @@ -121,12 +121,11 @@ OpenFn implementations can leverage the 2. Cambodia Primero < > ONA Database: https://github.com/OpenFn/primero-ona-dashboard -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/powerbi.md b/adaptors/powerbi.md index c32b7cf1e150..6603f74176ea 100644 --- a/adaptors/powerbi.md +++ b/adaptors/powerbi.md @@ -36,12 +36,11 @@ above use case. -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/primero.md b/adaptors/primero.md index 605e42e5941d..bfde9c949c95 100644 --- a/adaptors/primero.md +++ b/adaptors/primero.md @@ -106,12 +106,11 @@ Primero API V1 (to be deprecated). 4. Thailand: UNICEF Primero < > MoPH HIS: https://github.com/OpenFn/primero-thailand -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/progres.md b/adaptors/progres.md index dbf56ee480af..7dc3584ad38f 100644 --- a/adaptors/progres.md +++ b/adaptors/progres.md @@ -51,12 +51,11 @@ certificate authentication for secure data transfer. - [OpenFn ProGres Adaptor Configuration](https://docs.openfn.org/adaptors/packages/progres-configuration-schema) - [OpenFn ProGres Adaptor Docs](https://docs.openfn.org/adaptors/packages/progres-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/rapidpro.md b/adaptors/rapidpro.md index 7085ebdd958b..215ff157135c 100644 --- a/adaptors/rapidpro.md +++ b/adaptors/rapidpro.md @@ -55,12 +55,11 @@ JSON credential type, then your configuration will look something like this: 1. Sample RapidPro -> DHIS2 sync: [https://github.com/OpenFn/rapidpro-dhis2](https://github.com/OpenFn/rapidpro-dhis2) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/redis.md b/adaptors/redis.md index 2b9dc7427b5f..ca282466e3c0 100644 --- a/adaptors/redis.md +++ b/adaptors/redis.md @@ -44,12 +44,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/resourcemap.md b/adaptors/resourcemap.md index a5ce575b0779..366cd987e027 100644 --- a/adaptors/resourcemap.md +++ b/adaptors/resourcemap.md @@ -46,12 +46,11 @@ For public collections, only the `baseUrl` is required. - [OpenFn ResourceMap Adaptor Configuration](https://docs.openfn.org/adaptors/packages/resourcemap-configuration-schema) - [OpenFn ResourceMap Adaptor Docs](https://docs.openfn.org/adaptors/packages/resourcemap-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/salesforce.md b/adaptors/salesforce.md index 405d29daf27e..43d9702b9b0c 100644 --- a/adaptors/salesforce.md +++ b/adaptors/salesforce.md @@ -276,12 +276,11 @@ accessing the Salesforce bulk API. - GRS CommCare - Salesforce sync: https://github.com/OpenFn/grassroot-soccer - MailChimp-Salesforce sync: https://github.com/OpenFn/gife -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/satusehat.md b/adaptors/satusehat.md index 3a3d478afb0d..ab892bdbcf28 100644 --- a/adaptors/satusehat.md +++ b/adaptors/satusehat.md @@ -148,6 +148,463 @@ To fetch data from Satusehat via OpenFn, you can: See [platform docs](/documentation/build/workflows) for more guidance on building workflows. +## Examples + +These jobs come from an integration that sends CommCare visits to Satusehat. +Each one expects the visit in `state.visit` and the patient in `state.patient`, +and saves what Satusehat returns for the next step. + +### Create an Encounter + +This job maps a visit to an Encounter resource and posts it. + +
+Show code + +```js +// Create an encounter in Satusehat based on an incoming Commcare visit + +fn(state => { + state.encounterId = util.uuid(); + + state.encounter = { + id: state.encounterId, + resourceType: 'Encounter', + identifier: [ + { + system: `http://sys-ids.kemkes.go.id/encounter/${state.visit.organizationId}`, + value: state.visit.case_id, + }, + ], + status: 'arrived', + class: { + system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode', + code: 'AMB', + display: 'ambulatory', + }, + subject: { + reference: 'Patient/P00805884304', + display: 'Elizabeth Dior', + }, + participant: [ + { + type: [ + { + coding: [ + { + system: + 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType', + code: 'ATND', + display: 'attender', + }, + ], + }, + ], + individual: { + reference: `Practitioner/N10000001`, + display: 'Voigt', + }, + }, + ], + period: { + start: state.visit.visit_date, + end: state.visit.visit_date, + }, + + location: [ + { + location: { + reference: `Location/574d5ffd-2dc2-453b-a787-d1c63cc89ae4`, + display: `PLKB`, + }, + extension: [ + { + url: 'https://fhir.kemkes.go.id/r4/StructureDefinition/ServiceClass', + extension: [ + { + url: 'value', + valueCodeableConcept: { + coding: [ + { + system: + 'http://terminology.kemkes.go.id/CodeSystem/locationServiceClass-Outpatient', + code: 'reguler', + display: 'Kelas Reguler', + }, + ], + }, + }, + ], + }, + ], + }, + ], + statusHistory: [ + { + status: 'arrived', + period: { + start: state.visit.visit_date, + end: state.visit.visit_date, + }, + }, + ], + serviceProvider: { + reference: `Organization/${state.visit.organizationId}`, + }, + }; + + return state; +}); + +// Post our encounter resources to Satusehat +post('Encounter', $.encounter); + +fn(state => { + // Store the newly created resources, created by the server, into state for the next step + state.encounter = state.data; + return state; +}); +``` + +
+ +### Create Conditions + +This job maps each diagnosis on the visit to a Condition resource with its +ICD-10 code. + +
+Show code + +```js +// Map diagnosis objects from commcare into Condition resources + +fn(state => { + state.conditions = state.visit.diagnosis.map(diagnosis => { + const diagnosisName = diagnosis.fields.name; + const code = diagnosis.fields['icd_10_code']; + + return { + resourceType: 'Condition', + clinicalStatus: { + coding: [ + { + system: 'http://terminology.hl7.org/CodeSystem/condition-clinical', + code: 'active', + display: 'Active', + }, + ], + }, + verificationStatus: { + coding: [ + { + system: + 'http://terminology.hl7.org/CodeSystem/condition-ver-status', + code: 'confirmed', + display: 'Confirmed', + }, + ], + }, + category: [ + { + coding: [ + { + system: + 'http://terminology.hl7.org/CodeSystem/condition-category', + code: 'encounter-diagnosis', + display: 'Encounter Diagnosis', + }, + ], + }, + ], + subject: { + reference: `Patient/${state.patient.ihs_number}`, + display: state.patient.full_name, + }, + encounter: { + reference: `Encounter/${state.encounterId}`, + display: + state.patient.full_name + + "'s " + + state.visit.properties.visit_type + + ' on ' + + state.visit.properties.visit_date, + }, + code: { + coding: [ + { + system: 'http://hl7.org/fhir/sid/icd-10', + code: code, + display: diagnosisName, + }, + ], + }, + bodySite: [ + { + coding: [ + { + system: 'http://snomed.info/sct', + code: '74262004', + display: 'Oral cavity structure', + }, + ], + }, + ], + recorder: { + reference: state.encounter.resource.participant[0].individual.reference, + }, + onsetDateTime: state.visit.visit_date, + recordedDate: state.visit.visit_date, + }; + }); + return state; +}); + +// Post our condition resources to Satusehat +post('Condition', $.conditions); + +fn(state => { + // Store the newly created resources, created by the server, into state for the next step + state.conditions = state.data; + return state; +}); +``` + +
+ +### Create Observations + +This job maps each observation on the visit to an Observation resource, handling +each FHIR value type. + +
+Show code + +```js +// Create observation in Satusehat based on an incoming Commcare visit + +function createObservationData(item, state, result) { + const patientReference = `Patient/${state.patient.ihs_number}`; + const encounterReference = `Encounter/${state.encounterId}`; + const encounterDisplay = `${state.patient.full_name}'s ${state.visit.properties.visit_type} on ${state.visit.properties.visit_date}`; + return { + resourceType: 'Observation', + status: 'final', + category: [ + { + coding: item.category, + }, + ], + code: { + coding: item.code, + }, + subject: { + reference: patientReference, + }, + performer: [ + { + reference: `Practitioner/N10000001`, + display: 'Voigt', + }, + ], + encounter: { + reference: encounterReference, + display: encounterDisplay, + }, + effectiveDateTime: state.visit.visit_date, + ...result, + }; +} + +fn(state => { + // Filtering and mapping observations based on the visit. + state.observations = state.visit.observations.map(item => { + const { value_type: valueType, value } = item; + const dataObjects = []; + + if (valueType === 'valueCodeableConcept') { + value.forEach(value => { + const result = { + [valueType]: { + coding: [JSON.parse(value.snomed_code)], + value: JSON.parse(value.value), + }, + }; + const data = createObservationData( + { ...item, id: value.id }, + state, + result + ); + dataObjects.push(data); + }); + } else if (valueType === 'valueQuantity') { + const result = { + [valueType]: { + coding: [value.snomed_code], + value: value.value, + }, + }; + const data = createObservationData( + { ...item, id: value.id }, + state, + result + ); + dataObjects.push(data); + } else if (valueType === 'valueInteger') { + const result = { + [valueType]: { + coding: value.snomed_code, + value: value.value, + }, + }; + const data = createObservationData( + { ...item, id: value.id }, + state, + result + ); + dataObjects.push(data); + } else if (valueType === 'valueDateTime') { + const result = { + [valueType]: { + coding: [JSON.parse(value.snomed_code)], + value: new Date(JSON.parse(value.value)).toISOString(), + }, + }; + const data = createObservationData( + { ...item, id: value.id }, + state, + result + ); + dataObjects.push(data); + } else if (valueType === 'valueBoolean') { + const result = { + [valueType]: { + coding: [JSON.parse(value.snomed_code)], + value: JSON.parse(value.value) === 'never' ? false : true, + }, + }; + const data = createObservationData( + { ...item, id: value.id }, + state, + result + ); + dataObjects.push(data); + } else { + const result = { + [valueType]: { + coding: [value.snomed_code], + value: value.value, + }, + }; + + if (result) { + const data = createObservationData(item, state, result); + dataObjects.push(data); + } + } + + return dataObjects; + }); + + return state; +}); + +// Post our observation resources to Satusehat +post('Observation', $.observations); + +// Store the newly created resources, created by the server, into state for the next step +fn(state => { + state.observations = state.data; + return state; +}); +``` + +
+ +### Create Medications + +This job finds the prescriptions on the visit and posts a Medication resource +for each, using its KFA code. + +
+Show code + +```js +// Create medication in Satusehat based on an incoming Commcare visit + +fn(state => { + // state.visit is a Commcare Visit record + const properties = state.visit.properties; + const medicineKeys = Object.keys(properties).filter( + key => + key.startsWith('prescription_') && + !key.includes('_amount') && + !key.includes('_instruction') && + !key.includes('_dose') + ); + + const medicationId = util.uuid(); + + // Map medication data for each relevant key + state.medication = medicineKeys.map(item => { + return { + resourceType: 'Medication', + id: state => medicationId, + meta: { + profile: [ + 'https://fhir.kemkes.go.id/r4/StructureDefinition/Medication', + ], + }, + identifier: [ + { + system: `http://sys-ids.kemkes.go.id/medication/${state.visit.satusehatId}`, + use: 'usual', + value: item.fields['Nama'], + }, + ], + code: { + coding: [ + { + system: 'http://sys-ids.kemkes.go.id/kfa', + code: item.fields['kfa_codes'], + display: item.fields['Nama'], + }, + ], + }, + status: 'active', + extension: [ + { + url: 'https://fhir.kemkes.go.id/r4/StructureDefinition/MedicationType', + valueCodeableConcept: { + coding: [ + { + system: + 'http://terminology.kemkes.go.id/CodeSystem/medication-type', + code: 'NC', + display: 'Non-compound', + }, + ], + }, + }, + ], + }; + }); + + return state; +}); + +// Post our medication resources to Satusehat +post('Medication', $.medication); + +fn(state => { + // Store the newly created resources, created by the server, into state for the next step + state.medication = state.data; + return state; +}); +``` + +
+ ## Authentication [See Satusehat docs](https://satusehat.kemkes.go.id/platform/docs/id/api-catalogue/authentication/) @@ -183,12 +640,11 @@ this: } ``` -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/senaite.md b/adaptors/senaite.md index 8e7fad5217b9..7d9ff658d684 100644 --- a/adaptors/senaite.md +++ b/adaptors/senaite.md @@ -46,12 +46,11 @@ request("GET", "catalogs", { - [OpenFn Senaite Adaptor Configuration](https://docs.openfn.org/adaptors/packages/senaite-configuration-schema) - [OpenFn Senaite Adaptor Docs](https://docs.openfn.org/adaptors/packages/senaite-docs) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/sftp.md b/adaptors/sftp.md index 3c21e0aa4727..942be2d970cd 100644 --- a/adaptors/sftp.md +++ b/adaptors/sftp.md @@ -48,12 +48,11 @@ JSON credential type, then your configuration will look something like this: 1. Women for Women International - SFTP -> Salesforce sync: [https://github.com/OpenFn/women-for-women](https://github.com/OpenFn/women-for-women) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/siuben-rd.md b/adaptors/siuben-rd.md index 5ddbc7419995..a70f665d7636 100644 --- a/adaptors/siuben-rd.md +++ b/adaptors/siuben-rd.md @@ -12,12 +12,11 @@ EN: This is an adaptor prototyped for the Dominican Republic government to connect with the Single System of Beneficiaries (Sistema Único de Beneficiarios - SIUBEN) to automate related social services workflows. -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/stripe.md b/adaptors/stripe.md index cf4894afd543..4796781d0a0e 100644 --- a/adaptors/stripe.md +++ b/adaptors/stripe.md @@ -15,6 +15,43 @@ for scheduled, bulk syncs or workflows that must update data in Stripe with external information. See [functions](/adaptors/packages/stripe-docs) for more on how to use this adaptor to work with the API. +## Examples + +### List customers + +This job lists customers and saves them to `state.customers`. + +```js +// List customers in Stripe + +list('customers').then(state => { + state.customers = state.data.data; + return state; +}); +``` + +### Get subscriptions + +This job takes a list of subscription IDs from the input and fetches each +subscription. + +```js +// Get subscription data +fn(state => { + state.subscriptions = state.data; + state.subscriptionsData = []; + return state; +}); + +each( + '$.subscriptions', + get('subscriptions', $.data).then(state => { + state.subscriptionsData.push(state.data.data); + return state; + }) +); +``` + ## Authentication See [Stripe docs](https://docs.stripe.com/api/authentication) for the latest on @@ -39,12 +76,11 @@ JSON credential type, then your configuration will look something like this: 1. [Stripe Documentation](https://docs.stripe.com/get-started) -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/surveycto.md b/adaptors/surveycto.md index 5116ab615460..4853de6439a2 100644 --- a/adaptors/surveycto.md +++ b/adaptors/surveycto.md @@ -112,12 +112,11 @@ forms and data from the server. [See SurveyCTO docs](https://docs.surveycto.com/04-monitoring-and-management/01-the-basics/00b.managing-user-roles.html) on managing user roles. -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/tableau.md b/adaptors/tableau.md index 14d5f304d71e..7199e402ddd1 100644 --- a/adaptors/tableau.md +++ b/adaptors/tableau.md @@ -37,12 +37,11 @@ above use case. -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/telerivet.md b/adaptors/telerivet.md index 6d3045230add..02b6fcb4c5b4 100644 --- a/adaptors/telerivet.md +++ b/adaptors/telerivet.md @@ -54,12 +54,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/twilio.md b/adaptors/twilio.md index bb30c80290d2..8f482840aac8 100644 --- a/adaptors/twilio.md +++ b/adaptors/twilio.md @@ -52,12 +52,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/varo.md b/adaptors/varo.md index 26ea40bf1ce7..533210602ee2 100644 --- a/adaptors/varo.md +++ b/adaptors/varo.md @@ -29,12 +29,11 @@ connection to the Varo app. See note in above section. - WHO documentation on EMS standard: https://extranet.who.int/prequal/immunization-devices/e006-temperature-monitoring-devices -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/vtiger.md b/adaptors/vtiger.md index aa74c5320e1b..6c7c7e0787fb 100644 --- a/adaptors/vtiger.md +++ b/adaptors/vtiger.md @@ -63,12 +63,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/whatsapp.md b/adaptors/whatsapp.md index 35f5ab147000..52cedacf6414 100644 --- a/adaptors/whatsapp.md +++ b/adaptors/whatsapp.md @@ -66,12 +66,11 @@ configuration will look something like this - Webhook payload examples: https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/payload-examples -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/wigal-sms.md b/adaptors/wigal-sms.md index 41b981029eac..2d7aba901542 100644 --- a/adaptors/wigal-sms.md +++ b/adaptors/wigal-sms.md @@ -60,12 +60,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/zata.md b/adaptors/zata.md index 53e62c5b68f1..5120f153199b 100644 --- a/adaptors/zata.md +++ b/adaptors/zata.md @@ -74,12 +74,11 @@ JSON credential type, then your configuration will look something like this: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +::: diff --git a/adaptors/zoho.md b/adaptors/zoho.md index aa1cf618d0cc..3e5c7710a5c9 100644 --- a/adaptors/zoho.md +++ b/adaptors/zoho.md @@ -74,12 +74,11 @@ database table in Zoho Analytics. This function enables you to: _Coming soon!_ -### I've noticed a problem with this Adaptor, or something is out of date, what can I do? +:::info Report or fix a problem with this adaptor -Thanks for asking! We are a fully Open Source Digital Public Good, and we -welcome contributions from our community. Check out our -[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) for -more information on how you can update Adaptors! +OpenFn adaptors are open source and we welcome contributions. See the +[Adaptors Wiki](https://github.com/OpenFn/adaptors/blob/main/wiki/index.md) to +learn how to update an adaptor, or ask on the +[OpenFn Community Forum](https://community.openfn.org/). -Or, you can always reach out to the Community through our -[Community Forum here](https://community.openfn.org/). +:::