Golden Record Discussion-Options

Would an alternative (perhaps) preferable approach be to add another rule to our filter, so the rules would be:

1) Return the Ubedehe record for each unique patient matching the search criteria, OR

2) for those records that lack an Ubedehe record, but match the search criteria, return the most recent record per unique patient.

---Does that help or make the process more complicated?

Shaun

____________________________________________________

I have no objection to adding support in OpenEMPI for the single best record functionality, I am just trying to find a way to support it that aligns with the architecture of OpenEMPI and allows us to add this functionality in a generic way that will be appropriate for all users of OpenEMPI and not just the RHEA project. Let me try to explain why I see this as a two step process. Unfortunately, I will need to describe in some detail how OpenEMPI works and how the existing interface operates in order to explain the issue I see so, please bare with me.

The current query mechanism that we have decided to use for the integration returns patient records that match the query criteria specified in the request. In this response OpenEMPI will not return additional records that are linked with the records that matched the query criteria. Here is an example to help explain what I mean:

Say that the repository has the following records:

1. Mary Smith, 1234 Some Road, Someplace, Washington 11111, OpenMRS ID: 1122
2. Miry Smith, 1234 Some Road, Someplace, Washington 11111, OpenMRS ID: 1133, Ubedehe ID: 12345678
3. Mary Smith 2345 Another Road, Another Place, New York 22222, OpenMRS ID: 1144, Ubedehe ID: 23456789

Records 1 and 2 have been linked because they are similar to each other.

We do a query using the query criteria: Mary Smith. OpenEMPI will return all the records that have a first name of Mary and last name of Smith but will not return the second record since it did not match the query criteria. The records that will be returned using the example query criteria are:

1. Mary Smith, 1234 Some Road, Someplace, Washington 11111, OpenMRS ID: 1122
3. Mary Smith 2345 Another Road, Another Place, New York 22222, OpenMRS ID: 1144, Ubedehe ID: 23456789

The first record does have a linked record and based on the requirements that we are discussing regarding the implementation of the single best record, the records that should be returned are 2 and 3, since it is the second record that has the Ubedehe ID and not the first one.

2. Miry Smith, 1234 Some Road, Someplace, Washington 11111, OpenMRS ID: 1133, Ubedehe ID: 12345678
3. Mary Smith 2345 Another Road, Another Place, New York 22222, OpenMRS ID: 1144, Ubedehe ID: 23456789

As a result, OpenEMPI is returning records to a query that did not really match the query criteria. Furthermore, in order for OpenEMPI to return the desired results, for each record that matched the query criteria, it has to query the system for records that are linked to each record and then apply the filtering criteria we have identified.

I see two ways in which we can support the desired functionality:
1. OpenEMPI will return all the records that matched the query criteria to the interoperability layer. The interoperability layer will then make calls to OpenEMPI using the existing interface for retrieving linked records to a record, and filter the results based on the filtering criteria we have identified before returning them back to OpenMRS for presentation

2. We can add an new method to OpenEMPI that in addition to the records that match the query criteria, it also returns the associated linked records. The interoperability layer can then filter out the additional linked records that don't match the criteria we defined before returning the results back to OpenMRS for presentation to the user.

Both of these approaches seem consistent with the OpenEMPI architecture and provide generic interfaces , leaving it up to the interoperability layer to make the transformations to the data that I see as more project specific.

I look forward to any questions or comments regarding this. I will also be happy to discuss this more on tomorrow's Client Registry call and hopefully we can come to an agreement so that we can move forward with the implementation.

I am attaching below an email string that summarizes a discussion we had with Ryan and Wayne regarding the interaction between the interoperability layer and OpenEMPI and how the single-best-record functionality will be implemented into the integration.

--------------------------------------------------------

Thanks Odysseas, this is my understanding of our discussion as well.

Ryan

On Fri, Jul 27, 2012 at 3:55 PM, Wayne Chelliah <wayne@jembi.org> wrote:
Hi Odysseas,

Thanks for summarizing our discussion and I believe you have captured this correctly.
Regards

Wayne
On Fri, Jul 27, 2012 at 3:46 PM, Odysseas Pentakalos, Ph.D. <odysseas@sysnetint.com> wrote:

Wayne and Ryan,

Thanks for staying on to discuss the technical approach to implementing the filtering of the records. I believe we came up with a great solution that adheres to Shaun's goal of being pragmatic about the time available to get things done and Liz and Richard's goal of not returning too many records to the client.

I am summarizing below the approach we decided upon but feel free to correct any mistakes I may have made.

There are two search scenarios between the interoperability layer and OpenEMPI:

- In the first scenario the OpenMRS client has obtained an ID from the patient and the interoperability layer will submit a query by identifier to OpenEMPI to retrieve the record (if one exists) with that ID and return it to the user. In this case there is only one record involved, so there is no filtering needed.

- In the second scenario, the OpenMRS client has obtained a number of demographic attributes from the patient. We can rely on family name, gender, and date of birth to always be there but additional fields may be available. The interoperability layer will submit a query to locate records based on the search criteria specified. OpenEMPI will return to the interoperability layer the records that match the query criteria. The interoperability layer will extract the key identifiers for each of the records in this set and submit them to OpenEMPI using a second call.  In response to this request, OpenEMPI will filter out the single best record associated with each cluster of records from the pool of records identified by the list of identifiers submitted in the request. The single best record functionality will be implemented in a flexible approach so that the rules used in selecting the best record can be modified in the future without impacting the rest of the system.

Please let me know if I captured our discussion accurately.

Thanks,
Odysseas