Stream: cds hooks
Topic: Format for a delete
Lloyd McKenzie (Aug 12 2018 at 23:08):
What does a "delete" action look like? There are no examples in the spec. "resource" is noted as being of type object
, so it's not clear if I should say this: "resource" : "someId"
or this "resource":{"id": "someId"}
Lloyd McKenzie (Aug 14 2018 at 02:21):
bump
Isaac Vetter (Aug 14 2018 at 02:58):
For my system, at least, I'd prefer:
`"resource": {"resourceType": "MedicationRequest", "id": "someId" }
Mind creating another gh issue? At the least, we could include this in the examples. It'd be good to get other's feedback as well.
Lloyd McKenzie (Aug 14 2018 at 03:06):
Done
Dennis Patterson (Jan 15 2021 at 18:04):
Bumping this since it came up again today. Lloyd had logged https://github.com/cds-hooks/docs/issues/400 around how suggested deletes are represented. The short version is that the spec defines suggestion.action.resource as a json object, but the field description and example show that for deletes, resource is a FHIR relative reference (string). https://cds-hooks.org/specification/current/#action
Dennis Patterson (Jan 15 2021 at 18:06):
Couple approaches being discussed on the issue + an open pull request. Either we make a breaking change to the spec to represent resources consistently as an object (bare resource with resourceType and id fields on a delete), or swizzle some of the data models to more explicitly flex by type, somewhat analogous to FHIR resource definitions flexing by resourceType. Again, refer to the issue and PR for details. Please weigh in with thoughts!
Isaac Vetter (Jan 15 2021 at 21:08):
To consider a breaking change, we should understand how many people it would impact. If you're using a resource delete in a suggestion (or systemAction) right now, will you please weigh in and, if comfortable, share your opinion and use-case?
Matt Varghese (Jan 15 2021 at 21:35):
Just want to note here that I got MedicationRequest.delete to work against @Steve Millard's endpoint using the method Steve was already using, and which I've written up in the PR.
image.png
Matt Varghese (Jan 16 2021 at 18:49):
@Dennis Patterson , I updated my comment on GitHub issue https://github.com/cds-hooks/docs/issues/400 to say
image.png
I think this is really the problem with the existing model. Resource is an Object per CDS Hooks because CDS Hooks belligerently refuses to explicitly reference FHIR Types. But in reality, resource is a FHIR Object in any typed implementation.
So having resource be object or string requires FHIR Objects to have a place for "string" type in it's inheritance model, which IMO is bad programming practice. So I'm going to request that we don't go that route.
Also, in implementations where they rely on a library to bring in FHIR resources, they may not even have the ability to make such changes..
Last updated: Apr 12 2022 at 19:14 UTC