For our pilot partners (Philly) using SQL Server, we need to implement being able to read the metadata from SQL Server for the eCR Library. This ticket should ensure that the data from the ecr_data, ecr_rr_conditions, and ecr_rr_rule_summaries tables can populate the eCR Library table from SQL Server in the same way it currently works with Postgres.
We need to:
[ ] Modify listEcrData service to retrieve the necessary metadata from SQL Server to populate the eCR Library table (from ecr_data, ecr_rr_conditions, ecr_rr_rule_summaries) (the same way it does for Postgres)
[ ] Add logic to select the correct db source (Postgres or SQL Server) based on the env var MEATADATA_DATABASE_TYPE
[ ] Add tests
Why it needs to be done
Currently, the endpoint is only written using Postgres, so Philly isn't able to use/see anything in their eCR Library.
Acceptance Criteria
[ ] The listEcrData service can retrieve metadata from SQL Server tables for the eCR Library
[ ] The appropriate db source (Postgres or SQL Server) is selected based on the METADATA_DATABASE_TYPE
[ ] Existing functionality with Postgres is unchanged.
What needs to be done
For our pilot partners (Philly) using SQL Server, we need to implement being able to read the metadata from SQL Server for the eCR Library. This ticket should ensure that the data from the
ecr_data
,ecr_rr_conditions
, andecr_rr_rule_summaries
tables can populate the eCR Library table from SQL Server in the same way it currently works with Postgres.We need to:
listEcrData
service to retrieve the necessary metadata from SQL Server to populate the eCR Library table (fromecr_data
,ecr_rr_conditions
,ecr_rr_rule_summaries
) (the same way it does for Postgres)MEATADATA_DATABASE_TYPE
Why it needs to be done
Currently, the endpoint is only written using Postgres, so Philly isn't able to use/see anything in their eCR Library.
Acceptance Criteria
listEcrData
service can retrieve metadata from SQL Server tables for the eCR LibraryMETADATA_DATABASE_TYPE
Technical Notes
Additional context
See #2675 (PR that implemented saving the extended metadata to SQL Server)