-
Setting up a resource with SDK , setting the resource Id property to a string, and calling the MongoDB driver with the class as an argument, the result set _id properly. I don't know how to do this with the sdk client.create method. Id doesn't work. Setting resource.meta.elementid to a string doesn't work at run time. Setting that to a fhirstring object doesn't compile, the value has to be a string. This shouldn't be that complicated !! How do you set _id ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This was recently asked on the FHIR community platform in this discussion: https://chat.fhir.org/#narrow/stream/179171-dotnet/topic/setting.20_id. |
Beta Was this translation helpful? Give feedback.
This was recently asked on the FHIR community platform in this discussion: https://chat.fhir.org/#narrow/stream/179171-dotnet/topic/setting.20_id.
The correct way to set the technical id is to use client.Update instead of client.Create. FHIR Rest does not allow setting your own id on the create interaction, but does describe this on the update - update as create, see http://hl7.org/fhir/http.html#upsert. Note that a server may not support upserts, as was detailed in the discussion.