MDM API Operations

 
Applies to: the Golden Record strategies (MDM in EID mode and Probabilistic MDM). $match, $mdm-match, $mdm-evaluate and $sdh.mdm-bundle-match also work in MATCH_ONLY mode for Deduplication on ingestion.

This page is a reference for the FHIR operations exposed by the MDM module.

$match

This operation finds and returns any Patient records that match a provided resource according to the configured matching rules.

POST /Patient/$match

Input Parameters

Parameter Name Parameter Type Notes and Comments
resource Resource A Patient resource that should be compared against existing resources to find matches.

Output Format

This operation returns a Bundle resource. Each entry in the Bundle contains a matching Patient resource.

FHIRPath Notes and Comments
entry.resource A Patient resource that may match the input resource.
entry.search.extension.where(url='http://hl7.org/fhir/StructureDefinition/match-grade') An extension containing a coded representation of the likelihood that this resource matches the input resource.
entry.search.score A numeric score indicating the closeness of the match.

$mdm-match

This operation finds and returns any records of a requested type that match a provided resource according to the configured matching rules. Unlike $match, this operation does not require the provided resource to be a Patient.

POST /$mdm-match

Input Parameters

Parameter Name Parameter Type Notes and Comments
resource Resource A resource that should be compared against existing resources to find matches.
resourceType String The type of resource that the provided resource should be compared against.

Output Format

This operation returns a Bundle resource. Each entry in the Bundle contains a matching resource of the requested type.

FHIRPath Notes and Comments
entry.resource A resource that may match the input resource.
entry.search.extension.where(url='http://hl7.org/fhir/StructureDefinition/match-grade') An extension containing a coded representation of the likelihood that this resource matches the input resource.
entry.search.score A numeric score indicating the closeness of the match.

$mdm-submit

This operation triggers MDM processing for existing resources. It can target all resources of the configured MDM types, a specific resource type (optionally filtered by a FHIR search criteria string), or individual resource instances. By default the operation runs synchronously and returns a count of submitted resources. To run asynchronously, include a Prefer: respond-async HTTP header.

POST /$mdm-submit
POST /Patient/$mdm-submit
POST /Practitioner/$mdm-submit
POST /Patient/{id}/$mdm-submit
POST /Practitioner/{id}/$mdm-submit

Input Parameters

Parameter Name Parameter Type Notes and Comments
resourceType String The FHIR resource type to submit for MDM processing. If omitted at the server level, all MDM-configured resource types are submitted. Not applicable when invoking on a type or instance.
criteria String A FHIR search parameter string (e.g. birthDate=2000-01-01) used to filter which resources are submitted. Applied in addition to the resource type filter.
batchSize Decimal The number of resources to process per batch when running asynchronously.

Output Format

This operation returns a Parameters resource containing the number of resources submitted, or the batch job ID when running asynchronously.

Parameter Name Parameter Type Notes and Comments
submitted Long The number of resources submitted for MDM processing. Present in synchronous mode.
jobId String The ID of the batch job that was started. Present in asynchronous mode.

$sdh.mdm-bundle-match

This operation accepts a Bundle of resources and matches each entry against the repository using the configured MDM rules, removing or merging duplicate resources before the bundle is stored. It is the basis of the deduplication on ingestion strategy.

POST /Bundle/$sdh.mdm-bundle-match

This operation is documented in detail, including its parameters, permissions and examples, in $sdh.mdm-bundle-match Operation.

$mdm-create-link

This operation manually creates a new MDM link between a golden resource and a source resource.

A single source resource may not have links with match result MATCH targeting multiple golden resources. If the source resource already has such a link, any attempt to create a second one is rejected.

POST /$mdm-create-link

Input Parameters

Parameter Name Parameter Type Notes and Comments
goldenResourceId String The FHIR ID of the golden resource to link.
resourceId String The FHIR ID of the source resource to link.
matchResult String [Optional] The match result to assign to the new link. Allowed values: MATCH, NO_MATCH, POSSIBLE_MATCH. Defaults to MATCH if omitted.

Output Format

This operation returns the golden resource associated with the newly created link.

$mdm-update-link

This operation manually sets the match result on an existing MDM link between a golden resource and a source resource. The match result must be either MATCH or NO_MATCH.

A single source resource may not have links with match result MATCH targeting multiple golden resources. If the source resource already has such a link, any attempt to update another link to MATCH is rejected.

POST /$mdm-update-link

Input Parameters

Parameter Name Parameter Type Notes and Comments
goldenResourceId String The FHIR ID of the golden resource in the link to update.
resourceId String The FHIR ID of the source resource in the link to update.
matchResult String The new match result to apply to the link. Must be MATCH or NO_MATCH.

Output Format

This operation returns the updated golden resource.

$mdm-query-links

This operation queries and returns MDM links, optionally filtered by golden resource ID, source resource ID, match result, link source, or resource type. Results are paginated.

GET /$mdm-query-links

Input Parameters

Parameter Name Parameter Type Notes and Comments
goldenResourceId String [Optional] The FHIR ID of the golden resource to filter links by.
resourceId String [Optional] The FHIR ID of the source resource to filter links by.
matchResult String [Optional] Filter links to those with this match result. Allowed values: MATCH, POSSIBLE_MATCH, NO_MATCH, POSSIBLE_DUPLICATE.
linkSource String [Optional] Filter links to those with this link source. Allowed values: AUTO, MANUAL.
resourceType String [Optional] Filter links to those involving resources of this FHIR resource type (e.g. Patient).
_offset Integer [Optional] The index of the first result to return. Used for pagination. Defaults to 0.
_count Integer [Optional] The maximum number of results to return per page. Defaults to 20, maximum 100.
_sort String [Optional] The field to sort results by.

Output Format

This operation returns a Parameters resource containing pagination links, a total count, and one link part per matching MDM link.

Parameter Name Parameter Type Notes and Comments
link parameter BackboneElement A link from the search results.
prev Uri URL of the previous result page. Absent when on the first page.
self Uri URL of the current result page.
next Uri URL of the next result page. Absent when on the last page.
total Long Total number of links matching the query.

link Output Format

Parameter Name Parameter Type Notes and Comments
goldenResourceId String The FHIR ID of the golden resource in this link.
sourceResourceId String The FHIR ID of the source resource in this link.
matchResult String The match result for this link (e.g. MATCH, NO_MATCH).
linkSource String Whether the link was created automatically (AUTO) or manually (MANUAL).
eidMatch Boolean Whether this link was created as a result of an EID match.
hadToCreateNewResource Boolean Whether a new golden resource had to be created when this link was established.
score Decimal The numeric match score for this link. A value between 0.0 (completely unrelated) and 1.0 (perfect match).
linkCreated Decimal The timestamp (milliseconds since epoch) when this link was created.
linkUpdated Decimal The timestamp (milliseconds since epoch) when this link was last updated.

$mdm-link-history

This operation returns the historical record of changes made to MDM links associated with specified golden resource IDs or source resource IDs. At least one of goldenResourceId or resourceId must be provided.

GET /$mdm-link-history

Input Parameters

Parameter Name Parameter Type Notes and Comments
goldenResourceId String [Optional] The FHIR ID of a golden resource whose link history should be returned. At least one of goldenResourceId or resourceId must be supplied. Multiple values may be supplied as comma-delimited entries within a single parameter repetition.
resourceId String [Optional] The FHIR ID of a source resource whose link history should be returned. At least one of goldenResourceId or resourceId must be supplied. Multiple values may be supplied as comma-delimited entries within a single parameter repetition.

Output Format

This operation returns a Parameters resource containing one historical link part per revision of each matching MDM link.

Parameter Name Parameter Type Notes and Comments
historical link parameter BackboneElement A repeating parameter with one repetition per revision of each matching MDM link. Its parts are described in the following table.

historical link Output Format

Parameter Name Parameter Type Notes and Comments
goldenResourceId String The FHIR ID of the golden resource in this revision.
sourceResourceId String The FHIR ID of the source resource in this revision.
matchResult String The match result recorded in this revision.
linkSource String The link source recorded in this revision (AUTO or MANUAL).
revisionTimestamp String The timestamp at which this revision was recorded.
eidMatch Boolean Whether the link was created as a result of an EID match at the time of this revision.
hadToCreateNewResource Boolean Whether a new golden resource was created when the link in this revision was established.
score Decimal The numeric match score recorded in this revision.
linkCreated Decimal The timestamp (milliseconds since epoch) when the link was originally created.
linkUpdated Decimal The timestamp (milliseconds since epoch) when the link was last updated.
matchResultMap parameter BackboneElement Details of the link revision.

matchResultMap Output Format

Parameter Name Parameter Type Notes and Comments
matchedRules parameter BackboneElement A collection of parts, each of which contains a rule designating the name of an MDM rule that evaluated true for this link revision.
initialMatchResult String The match result that was assigned when this link revision was created.

$mdm-clear

This operation removes MDM links and their associated golden resources for the specified resource types, resetting the MDM state. This is an asynchronous operation by default. To request synchronous execution, include a Prefer: wait=<seconds> HTTP header; the response will be synchronous if it completes within the specified time, or asynchronous otherwise.

POST /$mdm-clear

Input Parameters

Parameter Name Parameter Type Notes and Comments
resourceType String [Optional] The FHIR resource type(s) for which MDM links and golden resources should be cleared. If omitted, all MDM-managed resource types are cleared.
batchSize Decimal [Optional] The number of resources to process per batch in asynchronous mode. Not compatible with the Prefer: wait=n synchronous path.

Output Format

This operation returns a Parameters resource containing the ID of the asynchronous batch job that was started. In synchronous mode (via Prefer: wait=n), the result is returned directly without a job ID.

Parameter Name Parameter Type Notes and Comments
jobId String The ID of the batch job started to perform the clear operation. Present only in asynchronous mode.

$mdm-duplicate-golden-resources

This operation returns pairs of golden resources that the MDM system has identified as potential duplicates. Results are paginated.

GET /$mdm-duplicate-golden-resources

Input Parameters

Parameter Name Parameter Type Notes and Comments
resourceType String Filter results to duplicate pairs involving this FHIR resource type (e.g. Patient).
_offset Integer The index of the first result to return. Used for pagination. Defaults to 0.
_count Integer The maximum number of results to return per page. Defaults to 20, maximum 100.

Output Format

This operation returns a Parameters resource containing pagination links, a total count, and one link part per potential duplicate pair.

Parameter Name Parameter Type Notes and Comments
link parameter BackboneElement A potential duplicate pair of golden resources.
prev Uri URL of the previous result page. Absent when on the first page.
self Uri URL of the current result page.
next Uri URL of the next result page. Absent when on the last page.
total Long Total number of potential duplicate pairs.

link Output Structure

Parameter Name Parameter Type Notes and Comments
goldenResourceId String The FHIR ID of one golden resource in the potential duplicate pair.
sourceResourceId String The FHIR ID of the other golden resource in the potential duplicate pair.

$mdm-not-duplicate

This operation marks two golden resources as intentionally not duplicates of each other. After this operation the pair will no longer appear in $mdm-duplicate-golden-resources results.

POST /$mdm-not-duplicate

Input Parameters

Parameter Name Parameter Type Notes and Comments
goldenResourceId String The FHIR ID of one golden resource in the potential duplicate pair.
resourceId String The FHIR ID of the other golden resource in the potential duplicate pair.

Output Format

This operation returns a Parameters resource indicating success.

Parameter Name Parameter Type Notes and Comments
success Boolean Returns true when the operation completes successfully.

$mdm-merge-golden-resources

This operation merges two golden resources into one. The source golden resource (fromGoldenResourceId) is deactivated and all of its MDM links are transferred to the target golden resource (toGoldenResourceId). An optional merged resource body may be supplied to control survivorship of field values on the resulting golden resource.

This operation acts on Golden Resources and their links; the source records themselves are not modified. To merge the underlying source records, use the repository-level $merge and $hapi.fhir.merge operations described in Working with Duplicates.

POST /$mdm-merge-golden-resources

Input Parameters

Parameter Name Parameter Type Notes and Comments
fromGoldenResourceId String The FHIR ID of the golden resource that will be deactivated and merged into the target.
toGoldenResourceId String The FHIR ID of the golden resource that will survive the merge and receive all links.
resource Resource [Optional] A FHIR resource whose field values will be applied to the surviving golden resource, allowing manual control of survivorship.

Output Format

This operation returns the surviving golden resource after the merge is complete.

$mdm-evaluate

This operation tests a single MDM matching or similarity algorithm against two input values and returns whether they match and, for similarity algorithms, a numeric score. This is useful for tuning MDM rules.

GET /$mdm-evaluate

This operation is documented in detail, including its parameters, permissions and examples, in $mdm-evaluate Operation.