Stream: cds hooks
Topic: Challenge with "no more than one" suggestion
Lloyd McKenzie (Aug 09 2018 at 05:19):
The spec says (about suggestions): If used, the user MUST BE allowed to choose no more than one suggestion.
That's a problem in at least a couple of ways:
1. Some hooks trigger on a collection of resources - e.g. order-review. If there are changes to propose for more than one of the orders, how is that done? It's possible some changes could propose deltas to multiple orders to be selected as a group, but in other cases you might want to allow the provider to make certain changes/additions and not make other ones.
2. Sometimes the recommendation isn't to change the resource that triggered the hook, but to add something else to accompany it. And there might be both changes and accompanyments or multiple accompanyments. There needs to be a way to do that
I absolutely understand the need to say "of this set of choices, pick 1", but there will also be situations where you can reasonably pick multiple things - sometimes those things will be interdependent (must do them all or none) and sometimes they'll be independent.
Lloyd McKenzie (Aug 09 2018 at 05:23):
My recommendation would be to have a nested structure of suggestion contains 1..* alternatives and allow alternative to support transaction. Suggestions would be independent. Alternatives would be "pick at most 1".
Lloyd McKenzie (Aug 09 2018 at 08:47):
What's the correct way to propose a change to one of the existing hooks? I'd like order-review to include support for DeviceRequest and SupplyRequest as well, but those aren't listed. Do I raise a github issue? Submit a pull request? Submit a proposal for the existing ones on the "proposed hooks" project the same as all the others and incidentally add the new stuff I want?
Isaac Vetter (Aug 09 2018 at 15:29):
Lloyd,
Re: no more than one suggestion
Do you understand the card->suggestion->action hierarchy? A service can return multiple cards. Each card can contain multiple suggestions which are XOR'd. Each suggestion can contain multiple actions, which are AND'd.
Isaac Vetter (Aug 09 2018 at 15:32):
I'd like order-review to include support for DeviceRequest and SupplyRequest as well, but those aren't listed.
This seems pretty reasonable. I'm sure that I missed stuff when I wrote up this list of possible order-type resources. In practive, DeviceRequest and SupplyRequest aren't widely implemented yet, so we haven't heard this request yet.
Will you create a gh issue to add these two resources to the list of possible STU3 resources on the order-review hook page? Are there additional DSTU2 resources that should also be added?
Isaac Vetter (Aug 09 2018 at 15:40):
Lloyd, would you mind creating an additional gh issue to update the med-prescribe and order-review hooks to specify their R4 resources (once those resources are final). Even if we defer the issue, it would be nice to have the issue logged.
Lloyd McKenzie (Aug 09 2018 at 15:52):
Doh!. Yup, that makes sense. (re card->suggestion-action)
I'll write up the proposal for the STU2/STU3/R4 resources
Lloyd McKenzie (Aug 09 2018 at 15:56):
I still think we're going to need Transaction and that multiple actions within a suggestion is not sufficient. That's because Transaction will give us access to th conditional headers and will allow linkage across resources. If I want to create a Task that says "please complete Questionnaire X", the Questionnaire will be a conditional create based on canonical URL and version and the Task will be a create that contains a reference to the Questionnaire. I don't think I can do that using the 'action' framework. (Though if we added support for conditional creates/updates to Action and expressed rules for identifier references across actions, that might be sufficient)
Isaac Vetter (Aug 09 2018 at 15:57):
that sounds really complicated.
Task -> Questionnaire needs to be tested and implemented ...
Lloyd McKenzie (Aug 09 2018 at 16:15):
Absolutely. So is your preference extension for purposes of connectathon and then see about pushing it into core?
Last updated: Apr 12 2022 at 19:14 UTC