cds-hooks / docs

CDS Hooks website & specification
http://cds-hooks.org
Apache License 2.0
166 stars 62 forks source link

Are hookInstances ever repeated across calls? #499

Open jmandel opened 4 years ago

jmandel commented 4 years ago

We currently say:

Note: the hookInstance is globally unique and should contain enough entropy to be un-guessable. But also: While working in the CDS Client, a user can perform multiple actions in series or in parallel. For example, a clinician might prescribe two drugs in a row; each prescription action would be assigned a unique hookInstance.

Is hookInstance the same across multiple API calls for the same prescription? I think the answer is "no -- always unique", in which case we should probably delete the sentence that starts with "For example," because (to me!) it implies there are other circumstances (like, an iteration / loop of adjustments to a single rx) where the hookInstance would be the same across calls.

dennispatterson commented 4 years ago

In that example of multiple adjustments to a single rx, I'd agree that those are distinct order-select hook events each deserving their own hookInstance.

Since the question here is around repetition across calls, I've also heard the question whether the hook instance is unique per CDS Service request per hook, given that the description of the field is "A UUID for this particular hook call" [emphasis mine]. My inclination is that hook instance is more to identify the event itself, given the additional explanation that "each prescription action would be assigned a unique hookInstance". Over all, I'm not certain how much this matters to the CDS Service unless there are multiple services coordinating with one another, but figured I'd mention it.

There have also been questions (e.g. Zulip) as to what the hookInstance is used for anyway...