fhir-data-pipes: Fix Debezium events to FHIR mapping where uuid is missing for specific tables

We put a strong assumption that all tables use UUID, however, it has been reported that some tables don’t have a UUID column.

There are 18 tables in the RefApp that don’t have a uuid column. Most of these are Hibernate child tables (e.g., concept_numeric shares ids with concept, but adds a few fields). Here’s the list from @ibacher :

  • concept_complex
  • concept_name_tag_map
  • concept_numeric
  • concept_proposal_tag_map
  • drug_order
  • liquibasechangelog
  • liquibasechangeloglock
  • location_tag_map
  • logic_rule_token_tag
  • logic_token_registration_tag
  • order_type_class_map
  • patient
  • role_privilege
  • role_role
  • scheduler_task_config_property
  • test_order
  • user_property
  • user_role

select T.TABLE_NAME
from information_schema.TABLES T
where TABLE_SCHEMA = 'core' and not exists (
 select *
 from information_schema.COLUMNS C
 where C.TABLE_CATALOG = T.TABLE_CATALOG
 and C.TABLE_SCHEMA = T.TABLE_SCHEMA
 and C.TABLE_NAME = T.TABLE_NAME
 and C.COLUMN_NAME = 'uuid'
)


About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18

Most upvoted comments

@gitcliff for the missing tables, as @ibacher mentioned I don’t think we need to care. In general, we only care about tables that have some effect on FHIR resources.

Re patient and person, yes I did not mean that the name of the key column should match too; what we care is a foreign key relationship. In the example of person_name the foreign key happens to have the same name as the key in the parent table. In the case of patient the attribute names differ but still patient_id is a foreign key for person.person_id.

@gitcliff I wouldn’t worry about those tables. They most likely don’t have any data, never mind data we would care about for the purposes of analytics.

But we do have some secondary tables missing uuids. There are 18 tables in the RefApp that don’t have a uuid column. Most of these are Hibernate child tables (e.g., concept_numeric shares ids with concept, but adds a few fields). Here’s the list from @ibacher :

  • concept_complex
  • concept_name_tag_map
  • concept_numeric
  • concept_proposal_tag_map
  • drug_order
  • liquibasechangelog
  • liquibasechangeloglock
  • location_tag_map
  • logic_rule_token_tag
  • logic_token_registration_tag
  • order_type_class_map
  • patient
  • role_privilege
  • role_role
  • scheduler_task_config_property
  • test_order
  • user_property
  • user_role

select T.TABLE_NAME
from information_schema.TABLES T
where TABLE_SCHEMA = 'core' and not exists (
 select *
 from information_schema.COLUMNS C
 where C.TABLE_CATALOG = T.TABLE_CATALOG
 and C.TABLE_SCHEMA = T.TABLE_SCHEMA
 and C.TABLE_NAME = T.TABLE_NAME
 and C.COLUMN_NAME = 'uuid'
)


I have updated the issue appropriately!