openHIM Patient Python Mediator

MTCCL development team has used a dummy Patient endpoint as a proof of concept to demonstrate
the integration of openIMIS and MIFOS X through openHIM. The implementation was guided by the
workflow in Figure 1 shared by the Healthix Team.

Figure 1: Integrating openIMIS with MIFOS X through 0penHIM

The following is a summary of deliverables from MTCCL development Team (Stephen and Doreen):
Performed a complete functional transformation of Patient/Insuree Resource into MIFOS Client. For the
time being, I have used a dummy payload that mimics required openIMIS fields as shown by the sample
JSON payload of Figure 2.

Figure 2: Dummy openIMIS Patient Payload

Figure 3 shows source code for Patient Mediator (transformer/adapter) that grabs a POST request such as
shown in Figure 2 and maps Patient attributes onto matching but dissimilar MIFOS client attributes. The
unmapped attributes that do not exist on /fineract-provider/api/v1/clients are ignored.

Figure 3: OpenIMIS to MIFOS Transformer Mediator written in Python (Django)

The client registration workload is logged into openHIM transactions as shown in Figure 4. Note the
payload attributes have been transformed to match that of MIFOS client endpoint with clientID being the
primary key

Figure 4: OpenHIM Console showing successful registration of Patient as MIFOS Client

Finally, the newly registered client is inserted into the MIFOS clients list as shown in Figure 5 (a and b).
Please note that the openIMIS insureeID is mapped onto externalID attribute that holds a unique key from
source systems; in this case openIMIS.

Figure 5 (a): Registered MIFOS client with metadata extracted from dummy openIMIS Patient/Insuree

Figure 5 (b) Clients registered from dummy openIMIS Patient/Insuree endpoint