Primero Interoperability & Workflow Automation | System Administrator Training
UNICEF Thailand �December 2022
Confidential Open Function Group Thailand Primero Interoperability
Agenda
Confidential Open Function Group Thailand Primero Interoperability
Intro to OpenFn & the Primero Interoperability Solution
Confidential Open Function Group Thailand Primero Interoperability
OpenFn is the Digital Public Good for workflow automation
With 8M transactions per year
and approximately 40M records across 40+ countries��we enable secure data integration and interoperability for�governments and NGOs worldwide.
Pandemic preparedness interventions require�multiple technologies and organizations
OpenFn automates workflows and data exchange processes�to enable secure, stable, and scalable interoperability.
Connect anything with open-source OpenFn adaptors.
Choose from 60+ existing adaptors or build your own. �Integrate applications, databases, and file sources (e.g., CSV, XML, JSON). �If there is a REST API, OpenFn will work out of box.
Automating case information sync with OpenFn...
OpenFn automates the on-demand data syncs between the Thailand MOPH Systems (HIS and Child Shield) and Primero CPIMS, securely sharing children’s medical history & risk profile with caseworkers .
Confidential Open Function Group Thailand Primero Interoperability
(Administrators’ user experience)
Now let’s monitor the flow end-to-end...
Confidential Open Function Group Thailand Primero Interoperability
OpenFn Platform: Key Concepts
Projects
Who can access your OpenFn integration setup?
Jobs
What should OpenFn do with the message data?
Triggers
When should OpenFn perform the job?
Credentials
How does OpenFn access your secure systems?
Messages
What data was should OpenFn process?
Runs
How does OpenFn record and report on everything it does?
1
3
4
5
2
6
Confidential Open Function Group Thailand Primero Interoperability
Thailand Primero Jobs View
Workflow 1:
Primero ⇒ ChildShield
Creating & Updating Interventions, Syncing closed cases.
*NEW Workflow*
Workflow 1: Primero-to-Childshield Data Flow
Business workflow name: “Sync Primero cases to Child Shield for daily reporting”�Add simplified diagram to capture high-level steps from a business POV…�1. Get all cases from Primero
2. Check case status & check case assessment date & close status (this should be 1 step in the diagram)
3. Sync cases that match criteria to Child Shield
Workflow 1: Sync Primero cases to Child Shield for daily reporting
Workflow 1: Primero-to-Childshield Data Flow
“Flow 1-1” job fetches case records from Primero on a timer basis
OpenFn Workflow 1 Jobs: Primero ⇒ ChildShield
Cron job
(we can adjust this timer as you wish)
“Flow 1-2” job looks up actual values (translations) for externally Defined Option Sets
“Flow 1-3” job maps, transforms and syncs data to ChildShield
Single-select questions
NOTE: OpenFn maps option value codes and Thai translated labels
Option values fields (single-select questions)
FORMAT: �question_key: {“value_key”: “value_label”}
Multi select fields
NOTE: OpenFn maps option value codes and Thai translated labels
"chronic_illness",
"disability"
],
{“chronic_illness”: "ความเจ็บป่วยเรื้อรัง"},
{“disability”: "ความพิการ"}
],
FORMAT: �question_key: [{“value1_key”: “value1_label_thai”}, {“value2_key”: “value2_label_thai”}]
WORKFLOW 2:
HIS/ChildShield ⇒ Primero
Updating Primero Cases with Risk Model, PLH, and other HIS data
*Updated Workflow implemented in Phase 1*
Workflow 2: ChildShield-to-Primero Data Flow
Add Business workflow name: “On-demand sync of HIS and Child Shield risk data to inform case plans”�Add simplified diagram to capture high-level steps from a business POV… �1. Case worker enters national id no
2. Case worker saves to create new case or clicks “Sync” button on-demand
3. OpenFn checks HIS for patient history and Child Shield risk profile data
4. If data found, synced back to Primero. Case “Sync Status” = “Success”
5. If data not found or if error, case “Sync Status” = “Failure”, admin notified
Workflow 2: On-demand sync of HIS and Child Shield risk data to inform case plans
Workflow 2: ChildShield-to-Primero Data Flow
“Workflow 2-1” job sends a Sync request (triggered from Primero button in UI) to HIS API
“Workflow 1-2” job fetches, maps and loads the data retrieved to Primero (PLH, RiskModel, and other HIS Data)
OpenFn Workflow 2 Jobs: ChildShield ⇒ Primero (1/2)
“Workflow 2-3” job runs only if Job 2-1 fails. It sends a Sync failure message to the OpenFn Inbox, indicating the list of affected cases.
“Workflow 2-4” job runs only if Job 2-2 fails. It sets a “Sync failed” status in Primero, if the sync request fails
OpenFn Workflow 2 Jobs: ChildShield ⇒ Primero (2/2)
Sample question label
NOTE: Changes to Child Shield Question Labels affects the sync
OpenFn Platform Administration
Confidential Open Function Group Thailand Primero Interoperability
Let’s log in...
Confidential Open Function Group Thailand Primero Interoperability
Managing jobs...
Confidential Open Function Group Thailand Primero Interoperability
Snapshot of OpenFn jobs for both Workflow 1 and Workflow 2.
Managing Jobs�
If you need to edit a job or update field mappings → contact support@openfn.org for support
Confidential Open Function Group Thailand Primero Interoperability
How to not break the Jobs…�
�If you need to edit a job or update field mappings → contact support@openfn.org for support
Confidential Open Function Group Thailand Primero Interoperability
Monitoring Job Runs &�Activity History...
Confidential Open Function Group Thailand Primero Interoperability
OpenFn logs every transaction in Activity History...
Confidential Open Function Group Thailand Primero Interoperability
Review run failures to troubleshoot integration errors...
⚠️ Job run failed…?
Confidential Open Function Group Thailand Primero Interoperability
Click into the run to review the logs...
Exit codes...�0. Success�1. Error (Sync error)�2-5. above (contact OpenFn support)
Confidential Open Function Group Thailand Primero Interoperability
Read the logs to understand the error...
HTTP Status Code: 400s → client errors
The request contains bad syntax and cannot be fulfilled, record conflict, authentication error, etc.
HTTP Status Code
Confidential Open Function Group Thailand Primero Interoperability
Read the logs to understand the error...
HTTP Status Code: 500s → server errors
The server failed to fill OpenFn’s request. Need to contact destination system administrator (Primero) to determine the reason.
Confidential Open Function Group Thailand Primero Interoperability
Turn on notifications to receive email alerts...
Managing Credentials
If the system login details change, you may need to update or create a new “Credential” in OpenFn.
Confidential Open Function Group Thailand Primero Interoperability
Confidential Open Function Group Thailand Primero Interoperability
View all available Credentials …
Note that every Credential has an “Owner”.
Confidential Open Function Group Thailand Primero Interoperability
Link jobs to Credentials to define the systems synced ...
Every Job is linked to 1 credential �
Note: You will have different credentials for different environments (production, staging, etc.)
If authentication details change...
*We recommend you determine which administrator(s) will be the credential owners.
Confidential Open Function Group Thailand Primero Interoperability
Managing Users
Administrators can add/remove users to the OpenFn project to support with integration monitoring.
Only designated IT administrators should have access. This is not an end-user application.
Confidential Open Function Group Thailand Primero Interoperability
Admin users can add/remove other OpenFn users….
Monitor Activity History to view the status of job runs...
Troubleshooting Basics & �Support
Confidential Open Function Group Thailand Primero Interoperability
Confidential Open Function Group Thailand Primero Interoperability
Monitor Activity History to view the status of job runs...
When you receive an error email…
�
Confidential Open Function Group Thailand Primero Interoperability
3. Run this job now ▷
Run the job again to re-try the sync...
Click “play” next to �job `1. Get Patient Data from HIS`�to re-try the sync…��This will re-try jobs the set of flow jobs.
Does the run fail again in ‘Activity History’?
�
Confidential Open Function Group Thailand Primero Interoperability
Support Contacts
UNICEF: �Tippawan Yaiya�(tyaiya@unicef.org)��MOPH: �K. King�king.nkp@gmail.com �
Confidential Open Function Group Thailand Primero Interoperability
Questions? Forget something? �
Github: github.com/OpenFn/primero-thailand�
Confidential Open Function Group Thailand Primero Interoperability
Next Steps, odds & ends�
Confidential Open Function Group Thailand Primero Interoperability
Note; OFG consultants offline from Dec 24-Jan 1st. �Email support@openfn.org for anything urgent.