Medication search returns FDB-only codings that don't resolve when used to create a MedicationStatement #1728
Replies: 2 comments 4 replies
|
Need inputs on this ASAP. I have similar issue for Allergen. Logged as a separate ticket. Need response on both |
|
Hi @jayant-walvekar-falconeer — Thanks for the detailed write-up. A couple of clarifying questions firstWhen we tested this on our end, the symptoms you describe didn't fully reproduce — so we want to make sure we're looking at the same thing before pointing you in the wrong direction:
Two FHIR payload paths, by designWhen using FHIR
So the create endpoint isn't "silently failing" on the If you're using the SDK command module insteadIf you're authoring these from a plugin via
So if you've been passing a string This is the most likely path on which "MedicationStatement created, medication field null/blank in the chart" would consistently reproduce — which is why we'd like to confirm whether you're going through FHIR or the SDK. Either way, the fix is the same: look the code up against the chart's catalog before submitting, so you only ever pass FDB codes the resolver can bind; or use the UNSTRUCTURED system if you specifically want to capture something not in the picklist. Recommended path forward: use the chart's catalog directlyThe cleanest fix is to bypass FHIR Once installed, the medication-search endpoint is: It also accepts Response is a clean {
"count": 1,
"results": [
{
"text": "levothyroxine 50 mcg tablet",
"value": 237361,
"coding": [
{"code": 237361, "display": "levothyroxine 50 mcg tablet", "system": "http://www.fdbhealth.com/"},
{"code": "966224", "display": "levothyroxine 50 mcg tablet", "system": "http://www.nlm.nih.gov/research/umls/rxnorm"}
]
}
]
}Under the hoodThe plugin is a thin wrapper around our SDK's pre-authenticated ontologies HTTP client, from urllib.parse import urlencode
from canvas_sdk.utils.http import ontologies_http
# text search → equivalent of /medication_search?text=…
ontologies_http.get_json(
f"/fdb/grouped-medication/?{urlencode({'search': 'levothyroxine 50 mcg tablet'})}"
).json()
# rxnorm lookup → equivalent of /medication_search?rxnorm_code=…
ontologies_http.get_json(
f"/fdb/grouped-medication/?{urlencode({'rxnorm_rxcui': '966225'})}"
).json()
So you have two equivalent options:
Either way, the underlying lookup is the same, and the results will match what the chart's medication picker shows. Summary
And please share what you're seeing on your end (payload + chart screenshot) — we couldn't reproduce the blank-medication-name symptom with the THSC code in our testing, so we want to make sure we're solving the same problem you're hitting. |
Uh oh!
There was an error while loading. Please reload this page.
We are integrating against the Medication FHIR search and then creating MedicationStatements from the returned FDB code, and we've hit two related behaviors we'd like guidance on.
A text search on the Medication endpoint returns a mix of two kinds of results:
Entries whose coding[] contains both an FDB system (http://www.fdbhealth.com/) and an RxNorm system (http://www.nlm.nih.gov/research/umls/rxnorm) code.
Entries whose coding[] contains only the FDB system code (no RxNorm pairing), often with a display prefixed THSC ….
Example for "levothyroxine 50 mcg":
237361 → "levothyroxine 50 mcg tablet" — has FDB and RxNorm codings.
216187 → "THSC Levothyroxine Sodium 50 mcg tablet" — FDB coding only.
(Same pattern for HCTZ: 207776 "THSC Hydrochlorothiazide 25 mg tablet" is FDB-only.)
Questions:
Are the FDB-only / THSC-prefixed entries intended to be selectable search results, or should they be filtered out?
Is the presence of an RxNorm pairing the right signal for "this is a usable, resolvable medication"? If not, what's the recommended way to tell, from the search response, which entries are safe to use?
If DB-only / THSC-prefixed entries are to be ignored then is that documented anywhere? And what is the purpose of those entries in the search result?
When we create a MedicationStatement using one of these FDB-only codes (e.g. 216187):
The create call returns success (HTTP 200/202).
The resulting command stays in state: staged (never committed).
The medication field comes back null.
In the chart, the row renders with a blank medication name (SIG/label present, no drug name).
With a paired code (e.g. 237361) the same flow commits and renders correctly.
Questions:
Is there a way to have the create API validate the fdb_code against the catalog and return an error, rather than accepting it and leaving the command staged with a null medication?
Is state: staged + medication: null the documented signal an integrator should poll for to detect this failure after a 200? Is there a more direct error/validation response we should be using?
More broadly: what's the recommended pattern to avoid submitting a code that Medication search itself returned but that the chart can't resolve?
It is consistently reproducible on the dev sandbox and in production using above mentioned sample medicines.
All reactions