Smile CDR provides several custom operations for working with Master Data Management (MDM).
$mdm-evaluate
is a custom Smile CDR operation, which you can use to test out different MDM algorithms available and get match results based on the input values.
This operation is only available when a FHIR persistence module is configured to use MDM. This operation will be available on the base FHIR endpoint url.
This operation takes in Parameters
FHIR resource for inputs and responds with a Parameters
resource with the match results.
$mdm-evaluate
in order to execute this operation.DSTU3
and FHIR versions released after.matcher
type algorithms:
IDENTIFIER
EXTENSION_ANY_ORDER
Parameter name | Cardinality | Type | Description |
---|---|---|---|
compareTo | 1..1 | String | The input string to compare. |
compareWith | 1..1 | String | The input string to compare against. |
algorithmType | 1..1 | String | The algorithm type matcher or similarity . |
algorithm | 1..1 | String | The algorithm name to use for evaluation. |
threshold | 0..1 | Decimal | The match threshold to check with. Note: This is not required for matcher type but required for similarity type algorithm. |
Parameter name | Cardinality | Type | Description |
---|---|---|---|
match | 1..1 | Boolean | true or false based on the evaluation. |
score | 0..1 | String | The match score based on the evaluation. Note: This is only returned for similarity type evaluation. |
Below is a sample request and response when using $mdm-evaluate
for similarity
type algorithm.
POST http://fhir.example.com/baseR4/$mdm-evaluate
Sample request body
{
"resourceType":"Parameters",
"parameter":[
{
"name":"compareTo",
"valueString":"My tsring"
},
{
"name":"compareWith",
"valueString":"My string"
},
{
"name":"algorithmType",
"valueString":"similarity"
},
{
"name":"algorithm",
"valueString":"JARO_WINKLER"
},
{
"name":"threshold",
"valueDecimal":0.5
}
]
}
Sample response body
{
"resourceType": "Parameters",
"parameter": [
{
"name": "match",
"valueBoolean": true
},
{
"name": "score",
"valueDecimal": 0.974
}
]
}
Below is a sample request and response when using $mdm-evaluate
for matcher
type algorithm.
POST http://fhir.example.com/baseR4/$mdm-evaluate
Sample request body
{
"resourceType":"Parameters",
"parameter":[
{
"name":"compareTo",
"valueString":"Gail"
},
{
"name":"compareWith",
"valueString":"Gael"
},
{
"name":"algorithmType",
"valueString":"matcher"
},
{
"name":"algorithm",
"valueString":"CAVERPHONE1"
}
]
}
Sample response body
{
"resourceType": "Parameters",
"parameter": [
{
"name": "match",
"valueBoolean": true
}
]
}
$sdh.mdm-bundle-match
is a custom Smile CDR operation that processes a FHIR Bundle to match resources against existing resources in the repository using MDM rules. This operation helps prevent duplicate resources by identifying and removing resources in the input Bundle that match existing resources in the repository before persisting the bundle.
This Bundle operation is only available when a FHIR persistence module is configured to use MDM. Similar to Patient/$match,
this operation does not require the heavier MATCH_AND_LINK
MDM mode to use; It is also available in lightweight MATCH_ONLY
MDM mode.
For each resource in the input bundle:
merge=true
): It applies survivorship rules to merge the bundle resource with the repository resource, then includes the merged resource as an UPDATE operation in the bundle 3. If a resource matches more than one resource in the repository:In addition to the above rules, if the input Bundle is a Document bundle and the first entry in the Bundle is a Composition resource, the Composition resource is removed. The operation returns a new transaction Bundle with matched resources removed and references updated. This bundle can then be submitted to the repository to create only the non-duplicate resources as determined by the MDM Rules.
$sdh.mdm-bundle-match
for the Bundle
resource type in order to execute this operation.DSTU3
and FHIR versions released after.Parameter name | Cardinality | Type | Description |
---|---|---|---|
bundle | 1..1 | Bundle | The input bundle to process for MDM matching. |
merge | 0..1 | Boolean | If true, apply survivorship rules when resources match and include them as UPDATE operations instead of removing them from the bundle. Defaults to false if not specified. |
The operation returns a FHIR transaction Bundle with matched resources processed according to the survivorship setting and references updated.
When the merge
parameter is set to true
, the operation applies MDM survivorship rules to matched resources. This allows you to merge data from incoming bundle resources with existing repository resources according to your configured survivorship script.
Key behaviors with survivorship enabled:
Use cases for survivorship:
For more information on configuring survivorship rules, see MDM Survivorship documentation.
Below is a sample request when using $sdh.mdm-bundle-match
:
POST http://fhir.example.com/baseR4/Bundle/$sdh.mdm-bundle-match
Sample request body
{
"resourceType": "Parameters",
"parameter": [
{
"name": "bundle",
"resource": {
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"fullUrl": "urn:uuid:1",
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Smith",
"given": ["John"]
}
],
"birthDate": "1970-01-01"
},
"request": {
"method": "POST",
"url": "Patient"
}
},
{
"fullUrl": "urn:uuid:2",
"resource": {
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8480-6",
"display": "Systolic blood pressure"
}
]
},
"subject": {
"reference": "urn:uuid:1"
},
"valueQuantity": {
"value": 120,
"unit": "mmHg",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
},
"request": {
"method": "POST",
"url": "Observation"
}
}
]
}
}
]
}
Below is a sample request when using $sdh.mdm-bundle-match
with survivorship enabled:
POST http://fhir.example.com/baseR4/Bundle/$sdh.mdm-bundle-match
Sample request body with survivorship:
{
"resourceType": "Parameters",
"parameter": [
{
"name": "bundle",
"resource": {
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"fullUrl": "urn:uuid:1",
"resource": {
"resourceType": "Organization",
"name": "Updated Hospital Name",
"identifier": [
{
"system": "http://example.org/hospital-ids",
"value": "12345"
}
],
"telecom": [
{
"system": "phone",
"value": "+1-555-NEW-PHONE"
}
]
},
"request": {
"method": "POST",
"url": "Organization"
}
}
]
}
},
{
"name": "merge",
"valueBoolean": true
}
]
}
The MDM Bundle Match Processor is a Camel processor that provides access to the $sdh.mdm-bundle-match
operation functionality within a Camel route.
<to uri="smile:mdm/mdmBundleMatchProcessor"/>
The processor takes an IBaseBundle (FHIR Bundle) as input.
The processor supports the following optional parameters:
Parameter name | Type | Description |
---|---|---|
merge | Boolean | If true, apply survivorship rules when resources match and include them as UPDATE operations instead of removing them from the bundle. Defaults to false if not specified. |
The processor returns a reconciled IBaseBundle (FHIR Bundle) with matched resources processed according to the survivorship setting and references updated.
The following example shows a route that reads a FHIR Bundle from a file, processes it with the MDM Bundle Match Processor, and then stores the reconciled bundle in a FHIR repository:
<route>
<from uri="file:input/bundles?noop=true"/>
<to uri="smile:mdm/mdmBundleMatchProcessor"/>
<to uri="smile:persistence/bundleProcessor"/>
</route>
The following example shows how to use the processor with survivorship enabled by setting the merge
parameter:
<route>
<from uri="file:input/bundles?noop=true"/>
<to uri="smile:mdm/mdmBundleMatchProcessor?merge=true"/>
<to uri="smile:persistence/bundleProcessor"/>
</route>