cds-hooks / sandbox

CDS Hooks Sandbox
http://sandbox.cds-hooks.org
Apache License 2.0
34 stars 32 forks source link

cds-hooks specification & examples mismatch #63

Closed accessshashank closed 5 years ago

accessshashank commented 6 years ago

Hello,

I am doing some proof of concept on cds-hooks. Here is what i found some issues.

  1. As per API specification (http://editor.swagger.io/?url=https://raw.githubusercontent.com/cds-hooks/docs/master/docs/specification/1.0-api.yaml ), to invoke a cds-service the “context” should be passed as array of objects but as per examples “context” is just an object. You can refer the examples here https://cds-hooks.org/specification/1.0/
  2. As per API specification “patient” and “encounter” defined outside the “context” but in examples “patient” and “encounter” is defined inside “context” object. Also the names have been changed to “patientId” and “encounterId” in examples.

Similarly there are lots of other discrepancies which I don’t want to put else it will be a long mail. There are also discrepancies with respect to HL7 standard https://www.hl7.org/FHIR/medicationrequest.html

Is the specification outdated or the examples outdated ?

kpshek commented 6 years ago

@accessshashank -

  1. The OpenAPI / Swagger API is out of date in the master branch. See this branch https://github.com/cds-hooks/api/tree/connectathon-updates for a more up-to-date doc. We have two outstanding ballot issues that will resolve this for our impending 1.0 release (see docs/issues/211 and docs/issues/354).

  2. patientId and encounterId were moved into the context object as they only apply to certain hooks. See docs/issues/119 for more background.

My apologies for the OpenAPI doc being out of date. We'll get it in line with the current 1.0 plans very soon.

Can you elaborate on the discrepancies with the MedicationRequest resource? One thing to keep in mind is that CDS Hooks is not tied to a particular version of FHIR. In other words, you can write a complaint CDS Hooks implementation on FHIR DSTU2, STU3, R4, etc.

jitendrasahu007 commented 6 years ago

I have few questions related to CDS specification. As per our requirement we need fields in request object like dispenserequest object (https://www.hl7.org/FHIR/medicationrequest.html) which is not listed in cds specification. So shall we add few fields which is specific to our requirement into context object?

Also again same questions for card response. Can we add few customize fields into cards?

jitendrasahu007 commented 6 years ago

I found some link where dispenseRequest has added into Context object. http://cds-hooks.hl7.org/ballots/2018May/hooks/medication-prescribe/#example-dstu2

kpshek commented 6 years ago

Hi @jitendrasahu007 and thanks for the question. The context object relates to a particular hook and as such, each hook will define what fields are valid for the context object in the request. For instance, for the patient-view hook, the only context fields defined are patientId, encounterId, and user. However, for the medication-prescribe hook, the aforementioned context fields are defined along with a medications field.

So, if you are defining a new hook you should define whatever required and optional fields are needed for that particular hook in the context object. Check out this page for more information: https://cds-hooks.org/hooks/

As an aside, unless your question is related to an existing issue, please open a new issue so we can keep them distinct. 😄

jitendrasahu007 commented 6 years ago

thanks @kpshek for the info. If we create our own context object based on our hook, then I just wonder how it follows the specifications.

kpshek commented 6 years ago

This documentation outlines how to create a new hook and have it abide by the specification:

jitendrasahu007 commented 5 years ago

Thanks a lot @kpshek , we are pretty clear on Request structure and context object. Still few questions related to Card response.

  1. Is there any way to send price information (price resource type) of the drug inside cards object. 1.i. We could not find resource related to price information of the prescribed drug in Hl7.
  2. Can we add our own custom object inside suggestions/inside card ( I could not find it from documentation)

thanks again for your time and feedback.

kpshek commented 5 years ago

Is there any way to send price information (price resource type) of the drug inside cards object. 1.i. We could not find resource related to price information of the prescribed drug in Hl7.

This is probably a question best posed to the HL7 FHIR community. I'd ask this on the implementers stream on Zulip. With that being said, I found this draft valueset that may be of interest.

  1. Can we add our own custom object inside suggestions/inside card ( I could not find it from documentation)

Extensions are how you can include custom content outside of the CDS Hooks specification. Being outside the spec, both the CDS client (aka, EHR) and CDS Service would need to understand these custom fields so YMMV. 😄

jitendrasahu007 commented 5 years ago

thanks @kpshek , yes probably we may need to use Extension in Card response as we need to share more information to EHR. Anyways we'll discuss internally more on this and comeback to you.

kpshek commented 5 years ago

Great! I'm going to close this issue then. Feel free to open a new one or ask further questions on our cds hooks Zulip stream at https://chat.fhir.org