hapifhir / hapi-fhir-jpaserver-starter

Apache License 2.0
375 stars 1.01k forks source link

Uploading Multiple Versions of the Same CodeSystem #706

Open tayeb83 opened 2 months ago

tayeb83 commented 2 months ago

I am using Hapi FHIR and I need to manage multiple versions of the same CodeSystem. I would appreciate some guidance on how can I upload multiple versions of the same CodeSystem using the JPA HAPI FHIR server.

Currently, when I try to upload a new version of a codeSystem with same ID/URL the old one is deleted.

XcrigX commented 2 months ago

How are you uploading them, via an HTTP PUT? The Resource.id value in FHIR is like a primary key. When you PUT a resource it will overwrite the existing resource (if it exists) with the new content. You'd need to use distinct IDs for the two CodeSystems, or HTTP POST them and let the server assign IDs to them.

tayeb83 commented 2 months ago

Thanks.

And it's not possible to have one ID that have multiple version ? I know that in OntoServer for example, they offer this possibility to use : URI/ID with multiple versions ?

The problem is when a CodeSystem is created (using PUT) with same ID, the old one is deleted.