FHIR Chat · Batch mode · cds hooks

Stream: cds hooks

Topic: Batch mode


view this post on Zulip Rong Chen (Feb 01 2021 at 12:49):

Hi all,
Has anyone encountered the need to have some kind of batch mode? In our use case, we have a cds-hooks service to give warning using drug-specific dosing ranges during prescribing process. Sometimes, multiple drugs are being prescribed at same time using templates, so instead of asking the client to call remote cds-services multiple times we would need some kind of batch mode to send several requests for each drug in one call.
Appreciate any feedback!

view this post on Zulip Dennis Patterson (Feb 01 2021 at 18:38):

Hi Rong! Both order-select and order-sign contain a Bundle of orders. If multiple drugs are part of a template, would you foresee during selection of that template, an order-select hook triggered by the CDS Client such that all drugs in the template are sent to a given CDS Service as part of the selection?

view this post on Zulip Rong Chen (Feb 02 2021 at 16:15):

Hi Dennis! The Bundle is useful for use cases like drug-to-drug interactions, but in our renal warning use case it's single drug based. So if the cds service receives a Bundle (list of medication requests), how can the client know from the cds response which drug in the list triggered a warning? We consider to use the Card.source in the response to indicate which medication triggered the warning, but it feels somewhat fragile.

Of course the client could loop through individual medicationRequest in a list and call the remote cds-service with a single drug each time but the performance will be terrible. So a compromise could be to batch these requests in order to get the responses in one go. Please let me know if it's unclear.

view this post on Zulip Rong Chen (Feb 02 2021 at 16:21):

Besides the above use case, we have another use case to run some kind of treatment compliance check or risk assessment of a small patient cohort selected within a given EHR client. Typically the cds response is rendered as part of existing patient or unit overview (e.g. as a table). Again in this use case, it seems suboptimal to call the remove cds service in a loop due to performance concerns. A batch mode to execute multiple requests seems to be desirable here. Any thoughts are welcome!

view this post on Zulip Dennis Patterson (Feb 02 2021 at 21:16):

"...how can the client know from the cds response which drug in the list triggered a warning?"

I'd expect the textual fields of the card (summary/detail) to focus on the drug that triggered the warning, and if a suggestion was included, it would focus on that drug, as well. The request's hook context will tell you the user action (which could include multiple orders), but the service's card(s) in the response can focus in on particular orders.

view this post on Zulip Matt Varghese (Feb 03 2021 at 02:24):

@Rong Chen , isn't the Bundle essentially the "batch" mode you are asking?
You have the ability to return multiple cards, as Dennis describes above. Doing this another way would be onerous for the client?

view this post on Zulip Rong Chen (Feb 03 2021 at 13:22):

Using textual fields to keep the link between the drug that triggered the warning and the card seems weak, it's up to the client to implement how to process the textual fields. It feels more robust to distinctive request/response pairs (in a loop) to make such association unambiguous.

@Matt Varghese the Bundle doesn't really solve our use cases for the reason stated above. For use case 2, risk assessment in a small patient cohort, I suppose Bundle can't be the solution. Seems bad idea to bundle data from different patients into one request mainly due to patient mix-up risk.

view this post on Zulip Rong Chen (Feb 03 2021 at 13:24):

To explain the batch mode we have in mind, instead of the standard single request/response specified, the batch mode will look like the following:
Example json request

{
 "batch_input": [
     { .. input 1 },
     { .. input 2 },
     { .. input 3 }
 ]
}

Example json response

{
 "batch_output": [
     [ .. cards for input 1 ],
     [ .. cards for input 2 ],
     [ .. cards for input 3 ]
 ]
}

view this post on Zulip Dennis Patterson (Feb 03 2021 at 18:05):

I'm definitely not suggesting that textual fields contain anything for a machine to parse. Those fields are for humans. :) A suggestion would, however, be able to point to a specific order in a parseable manner. Perhaps you can flesh out an example for what guidance you'd want to return where multiple cards with suggestions is insufficient.

I did see in your use case 2 the mention of evaluating a cohort of patients... current hooks are definitely single-patient focused, so we'd have to hear more about that use-case or even consider a SMART app as an option for evaluating a group of patients.

view this post on Zulip Rong Chen (Feb 17 2021 at 06:12):

The use case is about drug prescribing and more specifically to support prescribing a package of multiple drug treatments (up to 20) at same time. A common requirement is to check if a given drug requires dose adjustment when patient has reduced kidney function, and from the UI/UX point of view it's important to place CDS recommendation next to the drug that needs dose reduction so the EHR client needs to know which drug causes a specific Card to be returned.

It seems sub-optimal for the client to call cds services one drug a time in a loop. On the other hand, if the client call the cds services with a bundle of drugs, how would the ehr client knows which card is caused by which drug? I hope the example is clear enough. Any feedback is appreciated!

view this post on Zulip Alex Goel (Aug 18 2021 at 14:11):

Hi, I'm wondering if this was ever addressed?
I also noticed this issue: https://chat.fhir.org/#narrow/stream/179276-cds-hooks.2Fgithub/topic/docs.20.2F.20Issue.20.23365.20Batch-mode.3A.20Retrieve.20multiple.20CDS-cards.2E.2E.2E


Last updated: Apr 12 2022 at 19:14 UTC