Update templates to use database variables#36
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates several flow templates to use the newer database variable mechanism (e.g., source_db / dest_db and dest_schema) and adjusts embedded Python nodes that initialize DBDao, alongside some template JSON restructuring (nodes/edges ordering, IDs).
Changes:
- Updated DbReader/DbWriter template configuration to use database/schema variables and added
databases/schemasmappings in flows. - Adjusted OMOP CDM loader templates’ embedded Python to initialize
DBDaowithout the previously provideduse_cache_dbflag. - Restructured and refreshed template JSON metadata (IDs, ordering, node fields).
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| flows/nodestest.json | Switches DB nodes to dest_db/dest_schema variables and adds database/schema mappings. |
| flows/Load_OMOP_CDM_v54.json | Updates the ingest Python node to construct DBDao without use_cache_db=False. |
| flows/Load_OMOP_CDM_v53.json | Same as v5.4: updates DBDao initialization in ingest Python node. |
| flows/etlQuestionnaireResponseEQ-5D-5L.json | Migrates DB nodes to variables and adds mappings, but currently contains template-breaking issues (JSON + query/error-state fields). |
| flows/etlPatientToOMOPPerson.json | Migrates DB nodes to variables and adds database/schema mappings; reorders edges and variables. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "dbtablename": "measurement", | ||
| "description": "Insert the records into omop measurement table" | ||
| "description": "Insert the records into omop measurement table", |
| "dataframe": "get_fhir_data", | ||
| "description": "Transforms fhir data to omop measurement using structure map", | ||
| "errorMessage": null, | ||
| "errorMessage": "No input data: the incoming dataframe from 'get_fhir_data' is empty", |
Comment on lines
176
to
+180
| "name": "fhir_mapping_node_0", | ||
| "error": false, | ||
| "description": "Describe the task of node fhir_mapping_node_0", | ||
| "schema_name": "demo_cdm", | ||
| "database_code": "demo_database", | ||
| "schema_name": "dest_schema", | ||
| "errorMessage": null, |
| "dataframe": "sql_node_0", | ||
| "schemaname": "dest_schema", | ||
| "dbtablename": "nodetest", | ||
| "description": "Write the dataframe from sql_node_0 to database demo_database, schema demo_cdm_results, table nodetest." |
| 36 | ||
| ] | ||
| ], | ||
| "description": "Read from database demo_database, table demo_cdm_results.nodetest to get the cohort members with person_id and cohort_id." |
| "database": "d2e_fhir", | ||
| "sqlquery": "select qr.content\nfrom fhir.\"QuestionnaireResponse\" qr \njoin fhir.\"Project\" p \non qr.\"projectId\" = p.\"projectId\" \nwhere p.\"name\" = '73e16c3e-55f5-46ca-9a0f-888d6b5019f0'", | ||
| "database": "source_db", | ||
| "sqlquery": "select * from \"860c3790_89bb_411c_8f21_09f28ea3c322\".\"patient\"", |
Zhimin-arya
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the templates using DbReader and DbWriter nodes to use database variables that was added for the task - OHDSI/Data2Evidence#2372 and PR - OHDSI/Data2Evidence#2685
Also fixes some bugs related to
use_cachedbflagMerge Checklist
Please review this list and check any items that require additions or modifications beyond your core changes. Reviewers can also use it to help confirm that nothing was missed.
Test if the flow runs successfully as an imported json file
Test if the flow runs successfully as template
DATAFLOW_TEMPLATE_BRANCHenvironment variable in docker-compose.yaml to the branch being reviewed and successfully run the flowInspect the nodes in the flow (either as a template or imported json file):
[Currently not visible in UI]