Skip Headers
Oracle® Healthcare Master Person Index Working With IHE Profiles User's Guide
Release 2.0.5

E25244-04
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
PDF · Mobi · ePub

B Adding IHE Profile Support to User-defined MPI Object Model

IHE Project comes with a pre-packaged MPI Project which has a fixed Object Model. This fixed MPI Object Model is not very useful in the real world. OHMPI 2.0 added capability to allow a user to add IHE Profile support to any user-defined MPI Object Model. However, before the 2.0.5 release, the process to add IHE Profile support to user-defined MPI Object Model requires a lot of manual re-packaging work after the IHE project is built. This issue has been addressed in the 2.0.5 release (#16719490).

In order to add IHE Profile support to user-defined MPI Object Model, user needs to do the following:

In the following example, we will use a simplified Person Object Model as the user-defined MPI Object Model to illustrate the process.

Creating MPI Project

  1. Start from the Person Template.

  2. Remove all attributes on the primary Person object except FirstName, LastName, SSN, DOB, and Gender.

  3. Remove the Alias and Address child objects.

    Figure B-1 shows the Object Model of the user-defined MPI Project:

  4. Generate Master Index Files.

  5. Build the Person MPI Project.

Creating Java Mapper Project

The purpose of the Mapper Project is to provide two-way mapping between the user-defined MPI Object Model and the fixed IHE Object Model.

Figure B-2 displays a side-by-side comparison between the user-defined MPI Model and the fixed IHE Model:

Figure B-2 Comparison Between user-defined MPI Model and Fixed IHE Model

Description of Figure B-2 follows
Description of "Figure B-2 Comparison Between user-defined MPI Model and Fixed IHE Model"

Table B-1 lists the field mapping.

Note:

The unformattedTelephoneNumber in the fixed IHE Model only gets populated from HL7v3 feed. To support data coming from HL7 v2 feed, you need to check the other fields under the IHE Model's PhoneNumber object as well when doing the mapping. We skip that part here for simplicity.

Table B-1 Field Mapping

User-defined MPI Model Fixed IHE Model

FirstName

givenName

LastName

familyName

SSN

SSN

DOB

dateOfBirth

Gender

sex

Phone.PhoneType

PhoneNumber.telecomUseCode

Phone.Phone

PhoneNumber.unformattedTelephoneNumber

Phone.PhoneExt

PhoneNumber.extension


  1. Create a new Java Class Library Project, say, MyMapper.

  2. Add index-core.jar and mpi-client-person.jar from Person/lib into the library (Library -> Add Jar/Folder…).

  3. Create a new IHE Project. For example, MyIHE.

    An embedded MPI project (MyIHE-mpi) gets automatically generated.

  4. Build the IHE Project.

    The ihe-mpi-commons.jar file is generated in the MyIHE/lib directory.

  5. Add ihe-mpi-commons.jar from the MyIHE/lib directory into the library.

  6. Create a new Java class. For example, com.example.MyMapperImpl, that implements IMapperService:

    package com.example;public class MyMapperImpl implements IMapperService {}
    
  7. Use IDE hint (or CTRL+SHIFT+I) to fix import.

    Description of image005.gif follows
    Description of the illustration image005.gif

    Description of image007.gif follows
    Description of the illustration image007.gif

  8. Use IDE hint to provide a skeleton implementation of the mapper service.

    Description of image009.gif follows
    Description of the illustration image009.gif

    Description of image011.gif follows
    Description of the illustration image011.gif

  9. Take a look at the following Java Doc for the oracle.hsgbu.ohmpi.services.IMapperService Interface and understand the methods you need to implement:

    oracle.hsgbu.ohmpi.services Interface IMapperService

    public interface IMapperService
    

    Interface to provide two-way mapping between the fixed IHE Patient Object Model and the user-defined MPI Patient Object Model.

    Method Summary
    IHEPatientObject getIHEPatientObject(java.lang.Object mpiPatientObject)

    Converts an MPI Patient Object instance to an IHE Patient Object instance.

    java.lang.Object getMPIPatientObject(IHEPatientObjectihePatientObject)

    Converts an IHE Patient Object instance to an MPI Patient Object instance.

    PatientName getPatientName(java.lang.Object mpiPatientObject)

    Convenience method to retrieve patient name information from an MPI Patient Object instance.


    Method Details

    getIHEPatientObject
    IHEPatientObject getIHEPatientObject(java.lang.Object mpiPatientObject)
    
    Converts an MPI Patient Object instance to an IHE Patient Object instance.
    Parameter mpiPatientObject: A user-defined MPI Patient Object instance. This parameter is guaranteed to be an instance of MPI's ObjectNode. The service provider can safely cast it to the user-defined MPI Object Model's primary object in the implementation.
    Return An IHE Patient Object instance

    getMPIPatientObject
    java.lang.Object getMPIPatientObject(IHEPatientObject ihePatientObject)
    
    Converts an IHE Patient Object instance to an MPI Patient Object instance.
    Parameter ihePatientObject: An IHE Patient Object instance.
    Return A user-defined MPI Patient Object instance. This has to be an instance of the user-defined MPI Object Model's primary object.

    getPatientName
    PatientName getPatientName(java.lang.Object mpiPatientObject)
    
    Convenience method to retrieve patient name information from an MPI Patient Object instance. This is to avoid a full-blown mapping from MPI Patient Object to IHE Patient Object under some circumstances.
    Parameter mpiPatientObject: A user-defined MPI patient object instance. This is guaranteed to be an instance of MPI's ObjectNode.
    Return Patient name

  10. Provide your customized implementation of the mapper service. For this example, copy and paste the following content into MyMapperImpl.java:

    package com.example;import com.sun.mdm.index.objects.exception.ObjectException;import com.sun.mdm.index.objects.person.PersonObject;import com.sun.mdm.index.objects.person.PhoneObject;import java.text.DateFormat;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Collection;import java.util.Date;import java.util.logging.Logger;import oracle.hsgbu.ohmpi.commons.PatientName;import oracle.hsgbu.ohmpi.model.IHEPatientObject;import oracle.hsgbu.ohmpi.model.IHEPhoneNumberObject;import oracle.hsgbu.ohmpi.services.IMapperService;/** * Customized mapper implementation to bridge the standard IHE Object Model and customized MPI Object Model. */public class MyMapperImpl implements IMapperService {    private static final Logger logger = Logger.getLogger(MyMapperImpl.class.getName());    private DateFormat dateFormatter = new SimpleDateFormat("yyyyMMdd");    public IHEPatientObject getIHEPatientObject(Object mpiPatientObject) {        IHEPatientObject ihePO = new IHEPatientObject();        try {            PersonObject mpiPO = (PersonObject) mpiPatientObject;            ihePO.setGivenName(mpiPO.getFirstName());            ihePO.setFamilyName(mpiPO.getLastName());            ihePO.setSex(mpiPO.getGender());            ihePO.setSSN(mpiPO.getSSN());            Date dob = mpiPO.getDOB();            String dateOfBirthString = dateFormatter.format(dob);            ihePO.setDateOfBirth(dateOfBirthString);            if (mpiPO.getPhone() != null) {                for (PhoneObject mpiPhone : (Collection<PhoneObject>) mpiPO.getPhone()) {                    IHEPhoneNumberObject ihePhone = new IHEPhoneNumberObject();                    ihePhone.setExtension(mpiPhone.getPhoneExt());                    ihePhone.setTelecomUseCode(mpiPhone.getPhoneType());                    ihePhone.setUnformattedTelephoneNumber(mpiPhone.getPhone());                    ihePO.addPhoneNumber(ihePhone);                }            }        } catch (ObjectException ex) {           logger.severe("Failed to convert MPI patient object to IHE patient object.");        }        return ihePO;    }    public Object getMPIPatientObject(IHEPatientObject ihePO) {        PersonObject mpiPO = null;        try {            mpiPO = new PersonObject();            mpiPO.setFirstName(ihePO.getGivenName());            mpiPO.setLastName(ihePO.getFamilyName());            mpiPO.setGender(ihePO.getSex());            mpiPO.setSSN(ihePO.getSSN());           // SSN is required in user-defined Object Model            if (ihePO.getDateOfBirth() != null) {                try {                    Date date = (Date) dateFormatter.parse(ihePO.getDateOfBirth());                    mpiPO.setDOB(date);                } catch (ParseException ex) {                    logger.warning("Failed to parse date string " + ihePO.getDateOfBirth());                }            }            if (ihePO.getPhoneNumbers() != null) {                for (IHEPhoneNumberObject ihePhone : ihePO.getPhoneNumbers()) {                    PhoneObject mpiPhone = new PhoneObject();                    mpiPhone.setPhoneExt(ihePhone.getExtension());                    mpiPhone.setPhoneType(ihePhone.getTelecomUseCode());                    mpiPhone.setPhone(ihePhone.getUnformattedTelephoneNumber());                    mpiPO.addPhone(mpiPhone);                }            }        } catch (ObjectException ex) {            logger.severe("Failed to convert IHE patient object to MPI patient object.");        }        return mpiPO;    }    // Convenience method to avoid a full-blown mapping from MPI PO to IHE PO    public PatientName getPatientName(Object mpiPatientObject) {        try {            PersonObject po = (PersonObject) mpiPatientObject;            return new PatientName(                    po.getLastName(), po.getFirstName(), null, null);        } catch (ObjectException ex) {            logger.severe("Failed to retrieve patient name from MPI patient object.");        }        return null;    }}
    
  11. Build the Java Mapper Project.

Creating All-in-one IHE Project

  1. Update the following MPI Project references in the IHE project's nbproject/project.properties file:

    From

    • mpi.project.name=MyIHE-mpi

    • project.MyIHE-mpi=MyIHE-mpi

    • reference.MyIHE-mpi.dist=${project.MyIHE-mpi}/dist/MyIHE-mpi.ear

    To

    • mpi.project.name=Person

    • project.MyIHE-mpi=../Person

    • reference.MyIHE-mpi.dist=${project.MyIHE-mpi}/dist/Person.ear

    These three properties link the IHE Project to the MPI Project. The first one specifies the name of the MPI Project. The second one specifies the relative path of the MPI Project to the IHE Project. (Here, we are assuming the Person MPI Project is created at the same directory level as the IHE Project.) The third one specifies the build artifact of the MPI Project.

    Note:

    When you are updating the MPI Project references, do not change the property names. In the case of the third property, do not change the first part of the property value either.
  2. Add a new property called project.mapper into the IHE project's nbproject/project.properties file. This is the relative path of the Java Mapper Project to the IHE project. (Here, we are assuming the Java Mapper Project is created at the same directory level as the IHE Project.)

    project.mapper=../MyMapper

  3. Build the IHE project. This will package the user-defined MPI project instead of the embedded MPI project. It will also package the user-defined Java Mapper Project.

  4. Under the application server's domain configuration directory, say, domains/domain1/config for GlassFish, or user_projects/domains/base-domain/config for WebLogic, create a new sub-directory called ohmpi and create an ohmpi-ihe.properties file under it. Add the following properties:

    • # MPI Object Model's Primary Object Name

      mpi/primary_object/name=Person

    • # MPI Object Model's Primary Object Class Name

      mpi/primary_object/class_name=com.sun.mdm.index.objects.person.PersonObject

    • # IHE-MPI Mapper Service Implementation Class Name

      service/mapper/class_name=com.example.MyMapperImpl

    Adjust the above property values accordingly if you are not following the names used in this document.

  5. Create MPI and IHE database tables. For information, see Chapter 3, "Creating MPI and IHE Databases and Tables."

  6. Configure application server resources. For information, see Chapter 4, "Configuring an Application Server."

    Note:

    Instead of using Patient as the name for JDBC and JMS Resource configuration, use the actual name of the Custom Object Model, say, Person. For example, jdbc/PersonDataSource, jms/PersonOutBoundSender and jms/PersonTopic. The same applies to the MIDM access.
  7. Deploy the IHE project. For information, see Chapter 6, "Deploying the IHE Profiles Application."