-
Notifications
You must be signed in to change notification settings - Fork 4
disable referential integrity in hapi-loader #723
Comments
@tevariou are you sure we want this in every situation ? |
@simonvadee I just think it's totally impracticable during the ETL. A resource can link another of the same profile (eg. an organization linking another). So even if we manage to build a graph of the mappings (and it will be potentially cyclic), we will still encounter this issue. And that's not counting the performance issue. DBT can test a relationship (https://docs.getdbt.com/docs/building-a-dbt-project/tests#generic-tests). I agree It won't solve an error in the mapping though with Pyrog. Another way would be to add a constraint in Pyrog, inputing a column in Reference.Identifier.value that is not a foreign key would be forbidden and the column has to be the pk of the linked mapping. But Elena works on a db that has relationships but no declared foreign keys (we can add this constraint in the datalake though praying it has been enforced in some way in the source db)... |
your points make sense, I agree. However I'm worried that resource indexing will be broken if we disable this, cf the doc:
nice, if referential integrity can be tested in the datalake, we can be confident that it will be reflected into hapi-fhir database (except if our pg functions
yes we could but I don't think we should add more code to river right now. I we want to be sure that referential integrity is respected in hapi-fhir db, we can leave |
yep we should and maybe we can call |
mhh I don't know it's not just indexing, it's about foreign key constraints. I'm not sure hapi can add foreign key constraints a-posteriori after data exists in the db. |
seet hapi setting
enforce_referential_integrity_on_write
https://smilecdr.com/docs/configuration_categories/fhir_configuration.html
The text was updated successfully, but these errors were encountered: