MDM Operations
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:
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 |
---|---|---|---|
inputBundle | 1..1 | Bundle | The input bundle to process for MDM matching. |
The operation returns a FHIR transaction Bundle with matched resources removed and references updated.
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": "inputBundle",
"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"
}
}
]
}
}
]
}
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 returns a reconciled IBaseBundle (FHIR Bundle) with matched resources removed 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>
You are about to leave the Smile Digital Health documentation and navigate to the Open Source HAPI-FHIR Documentation.