Skip to content

Update templates to use database variables#36

Merged
csafreen merged 1 commit into
mainfrom
csafreen/update_templates
Jun 19, 2026
Merged

Update templates to use database variables#36
csafreen merged 1 commit into
mainfrom
csafreen/update_templates

Conversation

@csafreen

Copy link
Copy Markdown
Contributor

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_cachedb flag

Merge 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

  • Import the flow as a .json file and successfully run the flow

Test if the flow runs successfully as template

  • Switch DATAFLOW_TEMPLATE_BRANCH environment variable in docker-compose.yaml to the branch being reviewed and successfully run the flow

Inspect the nodes in the flow (either as a template or imported json file):

  • Each node has a short description that helps the user understand what the node does
  • Added documentation and type hints for embedded Python functions in flow templates (code in the Python node)
  • Result and error are removed in node data i.e. there should be no result or error visible for the nodes

[Currently not visible in UI]

  • Added a description for the flow template, including the OMOP CDM version and supported database(s)

Copilot AI review requested due to automatic review settings June 16, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/schemas mappings in flows.
  • Adjusted OMOP CDM loader templates’ embedded Python to initialize DBDao without the previously provided use_cache_db flag.
  • 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,
Comment thread flows/nodestest.json
"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."
Comment thread flows/nodestest.json
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\"",
@csafreen csafreen merged commit b4ec4c4 into main Jun 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants