Skip to content

Commit f704649

Browse files
committed
Document FHIR operation routes and match modes
Update API docs for /api/fhir operation paths, R4/R6 match route behavior, TEFCA mode, and default FHIR release. Point Aidbox subscription links to the Health Samurai docs site and keep absolute-link lint focused on the legacy docs domain.
1 parent 0352297 commit f704649

6 files changed

Lines changed: 67 additions & 23 deletions

File tree

docs-lint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ checks:
66
warn_only:
77
- title-mismatch
88
- absolute-links
9+
absolute-links:
10+
domains:
11+
- docs.aidbox.app

docs/api-reference.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,36 @@ so any valid authenticated `User` or `Client` can call them. Responses omit
5757
| --- | --- | --- |
5858
| `POST` | `/api/fhir/:resource/$match` | Match a resource (FHIR Parameters body) |
5959
| `POST` | `/api/fhir/:resource/:id/$match` | Match existing resource by ID |
60+
| `POST` | `/api/fhir/r4/:resource/$match` | Match a resource using the R4 operation implementation |
61+
| `POST` | `/api/fhir/r4/:resource/:id/$match` | Match an existing resource by ID using the R4 operation implementation |
62+
| `POST` | `/api/fhir/r6/:resource/$match` | Match a resource using the R6 operation implementation |
63+
| `POST` | `/api/fhir/r6/:resource/:id/$match` | Match an existing resource by ID using the R6 operation implementation |
64+
65+
The unversioned routes use the release selected by
66+
`MDMBOX_DEFAULT_FHIR_RELEASE`.
6067

6168
See [Find duplicates: $match](match-operation.md).
6269

6370
### $merge
6471

6572
| Method | Path | Description |
6673
| --- | --- | --- |
67-
| `POST` | `/api/$merge` | Execute or preview a merge |
74+
| `POST` | `/api/fhir/$merge` | Execute or preview a merge |
6875

6976
See [Merge operation](merge-operation.md).
7077

78+
### $unmerge
79+
80+
| Method | Path | Description |
81+
| --- | --- | --- |
82+
| `POST` | `/api/fhir/$unmerge` | Reverse a previous merge from its merge Task |
83+
84+
### $mark-not-a-match
85+
86+
| Method | Path | Description |
87+
| --- | --- | --- |
88+
| `POST` | `/api/fhir/$mark-not-a-match` | Record that two resources are not the same real-world entity |
89+
7190
### $referencing
7291

7392
| Method | Path | Description |

docs/config-reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ endpoints and the Admin UI:
4040
| Variable | Description | Default |
4141
| --- | --- | --- |
4242
| `MDMBOX_MATCH_DEFAULT_COUNT` | Default maximum number of `$match` results when the request omits `count`. | `10` |
43+
| `MDMBOX_TEFCA_MODE` | Enable R4 TEFCA `$match` behavior. When enabled, potential-match responses (`onlyCertainMatches=false`) return no more than 100 entries. | unset (`false`) |
44+
| `MDMBOX_DEFAULT_FHIR_RELEASE` | FHIR release used by unversioned `/api/fhir/:resource/...` routes. Accepted values: `4.0.1` and `6.0.0`. | `6.0.0` |
4345

4446
## Database
4547

docs/match-operation.md

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ type `searchset`. MDMbox generalizes the operation to any configured FHIR
1515
resource type and adds `modelId` and `threshold` parameters so callers can choose
1616
the matching model and score cutoff.
1717

18+
Unversioned routes such as `/api/fhir/Patient/$match` use the FHIR release
19+
selected by `MDMBOX_DEFAULT_FHIR_RELEASE`. Versioned routes are also available
20+
as `/api/fhir/r4/:resource/$match` and `/api/fhir/r6/:resource/$match`.
21+
Instance-level matching is available at
22+
`/api/fhir/r4/:resource/:id/$match` and `/api/fhir/r6/:resource/:id/$match`.
23+
1824
## Match a resource
1925

2026
Send a FHIR Parameters resource containing the record to match:
@@ -66,36 +72,50 @@ will not be returned as its own match.
6672

6773
## Parameters
6874

69-
### Request body parameters (FHIR Parameters)
75+
### Common request body parameters
7076

7177
| Name | Type | Required | Description |
7278
| --- | --- | --- | --- |
7379
| `modelId` | valueString | Yes | ID of the MatchingModel to use |
7480
| `resource` | resource | Only for `/api/fhir/:resource/$match` | The FHIR resource to find matches for. Omit this parameter when matching an existing resource by ID. |
75-
| `threshold` | valueDecimal | No | Override the model's `probable` threshold |
76-
| `onlyCertainMatches` | valueBoolean | No | Only return matches above the `certain` threshold |
77-
| `onlySingleMatch` | valueBoolean | No | Return the single most appropriate match |
78-
| `count` | valueInteger | No | Maximum number of results (default: 10) |
81+
| `threshold` | valueDecimal | No | Override the model's `probable` threshold in normal potential-match mode. Cannot be combined with `onlyCertainMatches`. |
82+
| `count` | valueInteger | No | Maximum number of returned entries (default: 10). `Bundle.total` still reports the full number of matches above the effective threshold. |
7983

8084
The default `count` is controlled by `MDMBOX_MATCH_DEFAULT_COUNT` and is `10`
81-
unless configured otherwise. When `onlyCertainMatches=false`, MDMbox returns no
82-
more than 100 potential matches.
85+
unless configured otherwise.
86+
87+
### R6 flag behavior
88+
89+
| Name | Type | Description |
90+
| --- | --- | --- |
91+
| `onlyCertainMatches` | valueBoolean | Sets the effective threshold to the model's `certain` threshold. Cannot be combined with `threshold` or `onlySingleMatch`. `count` still applies. |
92+
| `onlySingleMatch` | valueBoolean | Returns one best candidate. Cannot be combined with `threshold`, `count`, or `onlyCertainMatches`. |
93+
94+
In normal R6 mode, MDMbox uses `threshold` when supplied, otherwise the model's
95+
`probable` threshold. There is no 100-entry TEFCA cap for R6.
96+
97+
In R6 `onlySingleMatch=true` mode, MDMbox asks the server-side matching
98+
algorithm to designate one best candidate. If several candidates are eligible,
99+
MDMbox returns the highest-scored one; if scores are tied, MDMbox uses resource
100+
ID as a stable tie-breaker. If no candidate is eligible, the response is an
101+
empty searchset.
102+
103+
### R4 flag behavior
83104

84-
### Flag behavior
105+
| Name | Type | Description |
106+
| --- | --- | --- |
107+
| `onlyCertainMatches` | valueBoolean | Sets the effective threshold to the model's `certain` threshold. Cannot be combined with `threshold`. `count` still applies. |
85108

86-
`onlyCertainMatches=true` returns only candidates above the model's `certain`
87-
threshold. If `threshold` is also provided, MDMbox uses the stricter of the two
88-
values.
109+
R4 routes do not implement `onlySingleMatch`; use an R6 route when that behavior
110+
is required.
89111

90-
`onlySingleMatch=true` returns the single most appropriate candidate above the
91-
effective `certain` threshold. If more than one candidate passes, MDMbox returns
92-
the highest-scored candidate. If scores are tied, MDMbox uses resource ID as a
93-
stable tie-breaker. If no candidate passes, the response is an empty searchset.
94-
`onlySingleMatch` ignores `count`.
112+
In normal R4 potential-match mode (`onlyCertainMatches` omitted or `false`),
113+
MDMbox uses `threshold` when supplied, otherwise the model's `probable`
114+
threshold.
95115

96-
`count` limits the number of returned entries for normal matching and
97-
`onlyCertainMatches=true`. In normal potential-match mode, MDMbox also applies a
98-
100-result safety cap even when `count` is larger.
116+
When `MDMBOX_TEFCA_MODE=true`, R4 potential-match responses return no more than
117+
100 entries, even when `count` is larger. The TEFCA cap is not applied when
118+
`onlyCertainMatches=true`.
99119

100120
## Response
101121

docs/merge-operation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The `$merge` operation merges two FHIR resources by executing a client-provided
1616
## Request
1717

1818
```http
19-
POST https://<mdmbox-host>/api/$merge
19+
POST https://<mdmbox-host>/api/fhir/$merge
2020
Content-Type: application/json
2121
```
2222

docs/notifications.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Subscribe to merge and unmerge events using Aidbox Topic-Based Subs
44

55
# Notifications
66

7-
After a `$merge` or `$unmerge` operation completes, external systems often need to react — update search indexes, sync to a data warehouse, trigger workflows. MDMbox supports this via [Aidbox Topic-Based Subscriptions](https://docs.aidbox.app/modules/topic-based-subscriptions/aidbox-topic-based-subscriptions), a built-in publish/subscribe mechanism that delivers events to webhooks, Kafka, GCP Pub/Sub, and other destinations.
7+
After a `$merge` or `$unmerge` operation completes, external systems often need to react — update search indexes, sync to a data warehouse, trigger workflows. MDMbox supports this via [Aidbox Topic-Based Subscriptions](https://www.health-samurai.io/docs/aidbox/modules/topic-based-subscriptions/aidbox-topic-based-subscriptions), a built-in publish/subscribe mechanism that delivers events to webhooks, Kafka, GCP Pub/Sub, and other destinations.
88

99
## How it works
1010

@@ -93,4 +93,4 @@ Defines the delivery target and parameters. Example using a webhook with at-leas
9393
| `topic` | Canonical URL of the AidboxSubscriptionTopic to subscribe to |
9494
| `parameter` | Destination-specific settings (endpoint URL, batch size, timeout, etc.) |
9595

96-
See [Aidbox Topic-Based Subscriptions docs](https://docs.aidbox.app/modules/topic-based-subscriptions/aidbox-topic-based-subscriptions) for the full list of destination kinds and their parameters.
96+
See [Aidbox Topic-Based Subscriptions docs](https://www.health-samurai.io/docs/aidbox/modules/topic-based-subscriptions/aidbox-topic-based-subscriptions) for the full list of destination kinds and their parameters.

0 commit comments

Comments
 (0)