Conversation
…and-system-prompt-update Address issue #43 CLI messages and system prompt
only listen to relevant inputs
patient designer changes gui, triangle, tooltips, etc
Merge branch 'issue51' into dev-ger # Conflicts: # tests/testthat/helper-internals.R
add table
add action: uses table_concept_id if available
add chat tab
cebarboza
marked this pull request as ready for review
July 22, 2026 16:21
Collaborator
|
Hi @ginberg I will review and send it by Monday. |
There was a problem hiding this comment.
Pull request overview
This PR updates PatientGenerator for the 0.2.x release line by expanding supported CDM tables and enhancing the Shiny designer (including timeline rendering), while adding new tests and refreshing fixtures/lockfiles.
Changes:
- Expanded supported CDM tables (adds
observationanddeath) and updated JSON loading/exporting behavior. - Enhanced
patientDesigner()UX (publishable app export, optional chat tab, xlsx upload/download hooks, improved timeline formatting/rendering). - Added/updated test coverage and updated test fixtures +
renv.lockfor the new behaviors.
Reviewed changes
Copilot reviewed 31 out of 112 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/testCases/test_diabetes_patients.json | Updates diabetes fixture data (people, observation periods, events, drug exposures, procedures, measurements). |
| tests/testthat/testCases/patient_chat_ovarian_stages.json | Normalizes fixture values (e.g., gender labels, dates, observation period type). |
| tests/testthat/test-xlsx-upload.R | Adds tests for xlsx import/export round-tripping. |
| tests/testthat/test-timelineHelpers.R | Adds unit tests for timeline date formatting and end-date normalization helpers. |
| tests/testthat/test-prompts.R | Updates diabetes workflow prompt expectation. |
| tests/testthat/test-patientDesigner.R | Adds tests for publishable designer directory creation. |
| tests/testthat/test-patientChat.R | Adjusts model initialization test to avoid unsupported model id. |
| tests/testthat/test-conceptSearchModule.R | Adds tests for concept-id-to-label helper behavior. |
| tests/testthat/test-cdmTableModules.R | Adds tests for label display logic and server behaviors (dates, concepts, death handling). |
| tests/testthat/test-cdmTableClass.R | Adds coverage for cdmTable$add() accepting explicit date values. |
| tests/testthat/test-cdmConstructor.R | Expands constructor tests to include observation/death and end-date backfilling. |
| tests/testthat/helper-internals.R | Exposes additional internal helpers for testing. |
| renv.lock | Updates R version and dependency lock entries for the new release state. |
| R/updateFunctions.R | Adds inputDisplayLabel() and improves module input rendering + selector/date update behavior. |
| R/timelineHelpers.R | Introduces normalizeBarEndUpdate() and date formatting helpers for timeline/table display. |
| R/patientsDesigner.R | Expands patientDesigner() options (publishable export, chat tab, xlsx hooks) and adds observation/death plumbing. |
| R/patientChat.R | Improves system prompt and adds CLI progress/success messaging. |
| R/conceptSearchModule.R | Adds hecateConceptLabel() helper to resolve concept ids to display labels. |
| R/cdmTableModules.R | Enhances CDM table module behavior (concept label UI, add/update handling, date sync). |
| R/cdmTableClass.R | Adjusts table id/concept/date column resolution for death/observation. |
| R/cdmConstructor.R | Adds observation/death, xlsx import/export, more robust JSON loading, and timeline shaping. |
| R/cdm54data.R | Introduces supportedCdmTables() and switches table-spec reading from parquet to rds. |
| NEWS.md | Adds release notes for 0.2.0–0.2.3. |
| NAMESPACE | Adds cli imports for new console messaging. |
| man/patientDesigner.Rd | Documents new patientDesigner() parameters. |
| man/patientChat.Rd | Reflows/updates generated Rd content for patientChat. |
| inst/shiny/app.R | Adds minimal packaged Shiny template entrypoint. |
| inst/d3/cdm_timeline.js | Improves timeline rendering (tooltips, labels, measurement markers, observation support). |
| gui-crash.md | Adds a proposal document describing the GUI crash/end-date behavior and suggested approach. |
| DESCRIPTION | Updates package version and dependencies for the new release line. |
Comments suppressed due to low confidence (1)
R/cdmTableModules.R:241
- The field-update observer currently excludes all inputs whose name contains "date". That prevents non-start/end date fields (e.g.,
verbatim_end_dateindrug_exposure) from ever being persisted viacdm[[id]]$update(), because only the start/end date inputs are handled byupdateDates().
no_date_inputs <- table_inputs[grep(
"date",
names(table_inputs),
invert = TRUE
)]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+139
to
+144
| tabPanel( | ||
| "Observation", | ||
| cdmTableUI(id = "observation"), | ||
| value = "observation_module" | ||
| ) | ||
| ), |
Comment on lines
+155
to
+165
| tabPanel( | ||
| "Test Data", | ||
| tableOutput("cdmData"), | ||
| tableOutput("personDataTable"), | ||
| tableOutput("observationPeriodTable"), | ||
| tableOutput("drugExposureTable"), | ||
| tableOutput("conditionOccurrenceTable"), | ||
| tableOutput("measurementTable"), | ||
| tableOutput("procedureOccurrenceTable"), | ||
| tableOutput("observationTable") | ||
| ) |
|
|
||
| # PatientGenerator 0.2.2 | ||
|
|
||
| * Fix for concept ids not being maintained when we try to create patients/conditions/prcoedures. |
| Type: Package | ||
| Title: Generator of Synthetic Patient Data for the OMOP Common Data Model | ||
| Version: 0.1.4 | ||
| Version: 0.2.3 |
Comment on lines
+85
to
+87
| \subsection{Returns}{ | ||
| A new \code{Person} object. | ||
| } |
Comment on lines
+5
to
+8
| This is a proposal only. It does not change package code. | ||
|
|
||
| The focus is the test-data case in [mod_test_file_updated.json](/Users/cbarboza/Documents/mi-erasmusmc/PatientGenerator/tests/testthat/testCases/mod_test_file_updated.json), where many `condition_occurrence` rows have: | ||
|
|
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.
see milestone