Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

getSingleBestRecord

...

Here is an example configuration of the Single Best Record module below. The "entity-name" attribute specifies which entity this configuration module applies to and is especially important when hosting multiple entities on a single instance of OpenEMPI. The "ruleset" section consists of a sequence of rules, each of which specifies the field to which the rule applies and the condition that is being evaluated. In the example below, there is one rule, indicating that the service should return the first record in the cluster that has a non-null value for the postal code field. The configuration section should be inserted after the matching algorithm configuration section. Also, you will need to add the definition of the new namespace at the top of the mpi-config.xml file, as shown in the example below.

Code Block
languagexml
<mpi-config
	xsi:schemaLocation="http://configuration.openempi.openhie.org/mpiconfig mpi-config.xsd
	http://configuration.openempi.openhie.org/file-loader file-loader.xsd
	http://configuration.openempi.openhie.org/basic-blocking-hp basic-blocking-hp.xsd
	http://configuration.openempi.openhie.org/exact-matching exact-matching.xsd
	http://configuration.openempi.openhie.org/single-best-record single-best-record.xsd"
	xmlns="http://configuration.openempi.openhie.org/mpiconfig"
	xmlns:bb="http://configuration.openempi.openhie.org/basic-blocking-hp"
	xmlns:em="http://configuration.openempi.openhie.org/exact-matching"
	xmlns:fl="http://configuration.openempi.openhie.org/file-loader"
	xmlns:mpi="http://configuration.openempi.openhie.org/mpiconfig"
	xmlns:pm="http://configuration.openempi.openhie.org/probabilistic-matching"
	xmlns:sbr="http://configuration.openempi.openhie.org/single-best-record"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     ...
 
	<sbr:single-best-record entity-name="person">
		<sbr:implementation-name>singleBestRecord</sbr:implementation-name>
		<sbr:implementation-description>Rule-based Single Best Record Implementation</sbr:implementation-description>
		<sbr:ruleset>
			<sbr:rule>
				<sbr:field-name>postalCode</sbr:field-name>
				<sbr:condition>not-null</sbr:condition>
			</sbr:rule>
		</sbr:ruleset>
	</sbr:single-best-record>

...

In this scenario we have two records that have been linked together by the matching algorithm. The Single Best Record module has been configured using the section shown above. We use the findPersonsByAttributes method to return the sample records for the example.

http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/findPersonsByAttributes

Input:

Code Block
languagejs
{
  "givenName": "James",
  "familyName": "Dedicoat"
}

Output

Code Block
languagejs
{
    "person": [
        {
            "address1": "12 Sheaffe Street",
            "address2": "Herbert River",
            "city": "Houston",
            "dateCreated": "2018-03-08T13:00:00.249-05:00",
            "dateOfBirth": "1948-02-24T00:00:00-05:00",
            "familyName": "Dedicoat",
            "givenName": "James",
            "personId": "3727",
            "personIdentifiers": {
                "dateCreated": "2018-03-08T13:00:00.249-05:00",
                "identifier": "rec-3044-dup-0",
                "identifierDomain": {
                    "identifierDomainId": "14",
                    "identifierDomainName": "IHENA",
                    "namespaceIdentifier": "IHENA",
                    "universalIdentifier": "1.3.6.1.4.1.21367.2010.1.2.300",
                    "universalIdentifierTypeCode": "ISO"
                },
                "personIdentifierId": "3728"
            },
            "phoneNumber": "6534628928",
            "ssn": "868066233",
            "state": "MI"
        },
        {
            "address1": "12 Sheaffe Street",
            "address2": "Herbert River",
            "city": "Houston",
            "dateCreated": "2018-03-08T12:59:54.402-05:00",
            "dateOfBirth": "1948-02-24T00:00:00-05:00",
            "familyName": "Dedicoat",
            "gender": {
                "genderCd": "2",
                "genderCode": "M",
                "genderDescription": "Male",
                "genderName": "Male"
            },
            "givenName": "James",
            "personId": "1806",
            "personIdentifiers": {
                "dateCreated": "2018-03-08T12:59:54.402-05:00",
                "identifier": "rec-3044-org",
                "identifierDomain": {
                    "identifierDomainId": "14",
                    "identifierDomainName": "IHENA",
                    "namespaceIdentifier": "IHENA",
                    "universalIdentifier": "1.3.6.1.4.1.21367.2010.1.2.300",
                    "universalIdentifierTypeCode": "ISO"
                },
                "personIdentifierId": "1807"
            },
            "phoneNumber": "6534628928",
            "postalCode": "60618",
            "ssn": "868066233",
            "state": "MI"
        }
    ]
} 

We now submit a getSingleBestRecord request using the personId of the first record. Note that the record specified has a null value for the postalCode field.

http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/loadSingleBestRecord?personId=3727

The service returns the second record in the cluster since this is the record that satisfied the single best record rule of having a value for the postalCode field.

...