Skip to the content.

UNICEF Thailand Primero Interoperability Phases 1 & 2

Repository to manage OpenFn jobs to integrate the UNICEF Primero and Thailand MoPH HIS and Child Shield systems for secure case referrals exchange.

Note! Commits to ‘master’ branch will deploy automatically to live integration on OpenFn.org.

(1) Functional Requirements

The Interoperability Solution enables Primero case workers to consult historical patient information stored in the MOPH HIS system by fetching the information and sending it to Primero for display. The solution has also been extended to fetch risk model data and home service questionnaire data for better case understanding and management. Solution

Workflow 1: Primero –> Child Shield

An automated workflow has been configured to fetch primero cases and then either create or update the cases’ intervention status and additional data in Child Shield, for both existing and previously closed cases without this information.

Workflow 2: HIS/Child Shield –> Primero

When a case worker refreshes case data in Primero by using the Primero Sync button, any available forms (E.g. home service questionnaire, physical check assessment and risk data) for this person saved under the HIS or Child Shield systems are synced back to Primero.

(2) System APIs

APIs implemented:

Sample Data:

  1. When a record is found: sample record
  2. When no records are found: no record found

OpenFn language-packages (API adaptors) implemented:

(3) Data & Workflows

The business process flow diagram can be found here. The Technical workflow diagrams describing the integration logic can be found here:

Workflow 1: Primero –> Child Shield

The various integration jobs for this workflow are listed below, and illustrated in the Functional Workflow (Figure 1) below.

  1. Get Primero Cases from HIS fetches patient information from HIS based on national_id received in Primero sync notification.
  2. Get Translations from Primero fetches field translations in Primero and posts them to the OpenFn Inbox
  3. Map data & sync to ChildShield maps translated case data & syncs with Child Shield by either creating or updating intervention.

Integration Flow 1 Figure 1 - Functional Workflow 1: Primero –> Child Shield

Workflow 2: HIS/Child Shield –> Primero

The various integration jobs for this workflow are listed below, and illustrated in the Functional Workflow (Figure 2) below.

  1. Get Patient Data from HIS fetches additional patient information such as risk data and home service information from HIS based on national_id received in Primero sync notification.
  2. Sync Data to Cases in Primero sends the fetched HIS patient information to be displayed in Primero along with status information to re-enable the Sync button.
  3. Upsert Failed Cases with Failed Sync Status re-enables the Sync button in Primero without updating the case, in a situation where no matching patient is found in HIS. If any other error occured during the HIS sync, it will send fail status to re-enable the sync button with a Sync failed message.
  4. Send Primero Failure Status re-enables the Sync button in Primero and updates the case, in a situation where a matching patient record was found in HIS but the sync failed.

Integration Flow 2 Figure 2 - Functional Workflow 2: HIS/Child Shield –> Primero

(4) Flow Triggers

Trigger Type: Event

For both flows, HIS <> Primero sync is launched when OpenFn receives a sync request notification from Primero.

Integration Assumptions

  1. This integration was configured according to the mapping specifications finalized in January 2023.
  2. Every case will have a National Id that will be used to search for patient records in the HIS.
  3. The “sync” transaction will be initiated (1) automatically after create of new cases, and (2) whenever a user clicks the Sync button in Primero.

(5) Data Element Mappings & Transformations

  1. For Flow 1, See this sheet for the integration mapping specifications.
  2. For Flow 2, See these sheets for the integration mapping specifications.

Note

  1. If data synced from HIS is edited in Primero, it will be overwritten with the original value (or blank if there was no value in HIS) at the next sync.
  2. Physical examination subforms are uniquely identified by intervention ID + patient cid.
  3. Unexpected pregnancy subforms are uniquely identified by date and position of subform in list of pregnancy subforms.
  4. The Child Shield Forms that are updated in Flow 2 are:
    • Child’s Quality of Life Questionnaire (CQ1)
    • Child’s Quality of Life Questionnaire (CQ2 - AUQUEI1)
    • Caregiver Survey form - PSu1 and PSu2 file
    • Parent-Child Conflict Tactics Scale (CC-CTSPC-R)
    • Risk Model

(6) Change Management

System administrators are responsible for identifying if changes may impact the OpenFn integration.

  1. If login credentials are changed for either system, the relevant Credential must be updated in OpenFn.org.
  2. If system changes are made to any of the fields referenced in the field mappings, the OpenFn jobs should be reviewed and tested to confirm no impact on the integration.
  3. If the list of available Forms in either system changes, then the mapping should be reviewed in the mapping document to confirm no updates are required in the OpenFn jobs.
  4. The Flow 2 jobs are confirgured to detect exact keyword matches of the relevant fields in the Child Shield API response. Changes to any of these field names, as well as structure of the JSON response can cause the Primero updates to fail entirely or result in those modified fields not being updated in Primero.

(7) Administration

Provisioning, Hosting, & Maintenance

This integration is hosted on OpenFn.org with Primero SaaS. OpenFn will provide ongoing maintenance support.

Error handling

The sync can have 3 statutes in Primero:

  1. Synced: the data transfer was successful and HIS data is displayed in Primero
  2. Not found: the national ID was not found in HIS, no data is added to Primero
  3. Failed: an error occured during the process, no data is added to Primero

Support

Primero system administrators will be responsible for ongoing integration monitoring and management.

Primero System Administrators: Mohan Masarangi Magar mmmagar@unicef.org, Panat Jongsamakkeethaworn pjong@unicef.org, and Nakul Pannoy npannoy@unicef.org

MOPH System Administrators: Kumpha Brohmsena king.nkp@gmail.com, Watcharawan Teerawat pinklotus1818@hotmail.com, Choorug Lao-Akra choorug@yahoo.co.uk

Contact support@openfn.org with any questions or troubleshooting support.

Training Materials

  1. Open Function - Thailand Primero IO Flow 1 Training for Administrators (English/Thai) slides
  2. Open Function - Thailand Primero IO Training for Administrators Video
  3. Primero End User Training - English
  4. Open Function - Thailand Primero IO Flow 2 Training for Administrators (English)
  5. OpenFn Administation - End user Training (with Thai translation)

Support Checklist