FHIR Chat · setting _id · dotnet

Stream: dotnet

Topic: setting _id


view this post on Zulip Dennis Brox (Feb 12 2022 at 08:19):

Using Mongodb I could set resource.Id and the _id field would be set with what I wanted to use to find the resource. Setting Id that way with SDK and using client.create doesn't work. I can't seem to set resource.meta.elementid either. How do you override the client generating it's own values for _ variables? I think searching the identifier class to locate things when they have a unique id in the real world is too slow.

view this post on Zulip Brian Postlethwaite (Feb 12 2022 at 09:42):

Use update instead of create, that's the operation to let the client specify the id to create.

view this post on Zulip Dennis Brox (Feb 12 2022 at 16:07):

Many thanks !

view this post on Zulip Dennis Brox (Feb 15 2022 at 06:46):

Using Mongodb from SDK was no problem with using create - - it set _id nicely using the Mongodb driver. We switched to AWS FHIR works and use a FHIR client now. AWS doesn't allow Id to set _id with client.create and client.update, with no resource already present, kicks out. I've asked AWS support if they have an option to allow updates when the resource is not present - - no answer, don't know why I'm paying them if their support is so poor. I can't believe this is a problem that is new to them. C# should be such a basic thing talking to them I don't understand what is going on.

view this post on Zulip Michele Mottini (Feb 15 2022 at 16:15):

Not all server would (could) support setting the id of new resources. There is even a flag in CapabilityStatement to advertise if it is supported or not: http://hl7.org/fhir/capabilitystatement-definitions.html#CapabilityStatement.rest.resource.updateCreate

view this post on Zulip Dennis Brox (Feb 15 2022 at 17:06):

Interesting. It seems that flag in elementid is telling the server how to behave in a PUT situation. x.update will obviously issue a PUT. Do you know if x.create does a POST or a PUT? I can't seem to set x.Meta.ElementId with anything other than a string (which does work at runtime). How do you set the capability flags? Thanks.

view this post on Zulip Michele Mottini (Feb 15 2022 at 17:13):

x.create should be a POST

view this post on Zulip Michele Mottini (Feb 15 2022 at 17:13):

That capability flag tells you what the server can / cannot do, not sure wat you mean by 'set it'

view this post on Zulip Dennis Brox (Feb 15 2022 at 22:35):

You know what the server is doing if you do an update and it kicks out because the item isn't found. I thought that flag would be something you can set to tell the server what logic should be implemented i.e. if you want the server to kick out or not on an update when the item isn't there. If you can't set _id on a POST (by definition) and you can't set it on a PUT (because the server is not coded to do it) , you've got a problem setting the unique ids you want to use to efficiently search for resources i.e. _id is defined in FHIR for a really valid purpose.

view this post on Zulip Michele Mottini (Feb 15 2022 at 23:35):

Some sever just cannot set the id (and they advertise it in their capability statement), client have to live with that

view this post on Zulip Michele Mottini (Feb 15 2022 at 23:36):

Just use create (post) and the server tells you what id the new resource got

view this post on Zulip Michele Mottini (Feb 15 2022 at 23:36):

and this works across all servers

view this post on Zulip Dennis Brox (Feb 16 2022 at 06:09):

All Persons in our population have a unique id assigned by the government. All pharmacies, the Organizations I deal with, have registration ids assigned by the govt. All Practitioners have unique registration numbers assigned by their colleges. I want to be able to reference resources directly and fast. Keeping a guid type of id may work for transmitting data but using it in a database is just unnecessary technical gibberish here. All I want is a FHIR server that does everything the specification states is available and works with both C# and Python.

view this post on Zulip Mirjam Baltus (Feb 16 2022 at 09:29):

@Dennis Brox Imho such an identifier should never be the technical id of a resource. The technical id will be visible on requests for the resource on the URL, and also in the references to that resource. This could potentially leak identifiable/sensitive data about the person. You can use the identifier field within Patient/Practitioner/etc for storing that government assigned id, so it will be better protected. You may need to do a search on that identifier to be able to retrieve the data later on, but that's a minor inconvenience when compared to leaking sensitive data.

view this post on Zulip Dennis Brox (Feb 16 2022 at 17:27):

Practitioners buy my system because it is fast and it works. The govt has a privacy and security group that monitors everything we do. So, tell you what, you give me a system where measured response of search time over millions of records is in milliseconds not seconds and I'll deal with privacy.

view this post on Zulip Mirjam Baltus (Feb 16 2022 at 17:39):

No worries, it was just my opinion. Maybe I'm more concerned about privacy than speed. So, tell you what, do what you want until you do get in trouble or the govt decides your approach needs to be changed and you'll have to rework everything, and I'll not tell you I told you so.

view this post on Zulip Michele Mottini (Feb 16 2022 at 20:15):

(deleted)


Last updated: Apr 12 2022 at 19:14 UTC