Skip to content
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

Configurable "Special Character" to allow JSON fieldnames beginning with underscore "_" #4907

Closed
larrachecoeur opened this issue Dec 9, 2023 · 3 comments

Comments

@larrachecoeur
Copy link

Summary

The usage of the underscore character as a prefix for system fields to makes it impossible to store native JSON-Fhir Documents in CouchDb.
In FHIR someone decided to use the "_" as a prefix for field-extensions.

 "birthDate" : "1974-12-25",
  "_birthDate" : {
    "extension" : [{
      "url" : "http:https://hl7.org/fhir/StructureDefinition/patient-birthTime",
      "valueDateTime" : "1974-12-25T14:35:45-05:00"
    }]
  },

Desired Behaviour

It should be possible to store any valid JSON Object in CouchDb

Possible Solution

Configurable "Special Character(s)" to allow JSON fieldnames beginning with underscore "_" .
So each user can decide what chars to avoid in it's datadefinitions.
Or perhaps a kind of internal masking for such keys

Additional context

It would be great to store JSON-Fhir objects natively in CouchDb because I think it could be the coolest thinkable storage engine for it

@rnewson
Copy link
Member

rnewson commented Dec 9, 2023

The restriction only applies at the top-level, so if it's possible to put your FHIR object in a subobject you'll be fine.

Unfortunately it will not be possible to make this configurable for a bunch of reason, not least replication compatibility but also security aspects. The underscore prefix in couchdb is well-established and used for a variety of features.

@larrachecoeur
Copy link
Author

larrachecoeur commented Dec 9, 2023 via email

@big-r81
Copy link
Contributor

big-r81 commented Jan 27, 2024

Closing this, because a workaround was given.

@big-r81 big-r81 closed this as completed Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants