-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go - Task_Output encoded REST message does not match FHIR Store model #43
Comments
I see that you're using the To generate FHIR conformant JSON you'll want to use the default
prints
|
Hey @nikklassen, thank you, that solved the issue with the marshalling!
|
Did you use the |
It looks like our version of the library has to be updated because we can't see a reference to |
Intro
Hello, I'm using the Go package to help compose a PATCH call to our FHIR Store on GCP. I'm trying to update a Task's Output field with a reference to a
QuestionnaireResponseId
and I'm having trouble composing a correct PATCH call using the providedfhir/go/proto/google/fhir/proto/r4/core/resources/task_go_proto/
package. SpecificallyTask_Output
.Context
[]proto.Message
, which in this case contains a singleTask_Output
entry[]proto.Message
using ajsonformatter.AnalyticsMarshaller
, afterwards we marshall the entire message into bytes using Go'sjson
libraryTask
endpoint using the relevant payload, API parameters and headers and make the requestREST Call Message Mismatch
The issue I am encountering is a key mismatch between what the FHIR Store is expecting and the message generated by encoding the
proto.Message
.The FHIR store expects a message like this, I have tested calls to our FHIR Store with the message format below using Postman and a
200 Success
message is returned and the entries are updated (Given a proper FHIRQuestionnaireResponseId
is passed rather than Q...1234...):The message generated by our backend is like this, notice the
value
key and the tworeference
entries, testing these calls to our FHIR Store using Postman returns a400 Bad Request
error:Issue
Essentially, the FHIR Store is expecting the key
valueReference
but the message generated by our backend using theTask_Output
model found infhir/go/proto/google/fhir/proto/r4/core/resources/task_go_proto/task.pb.go
is returning the key asvalue
. I believe this is because the proto and json names are set tovalue
in the provided library. ThevalueReference
field aligns with the following Task Output example.For more context, here is the structure of the
Task_Output
value payload that is being used in the PATCH call:I've tried multiple variations of the
Task_Output_ValueX
field but they all return thevalue
key. I've tried extending theTask_Output
class as well using a struct of my own but the fields outsideTask_Output
get ignored by thejsonformatter.Marshaller
Any insight into possible solutions for this problem would be greatly appreciated. Any more information or context that you may need, I will be happy to provide. Thank you!
The text was updated successfully, but these errors were encountered: