NEWS.md
This release focuses on making Capr easier to integrate into real cohort-development workflows.
New: Atlas JSON to Capr code (jsonToCapr) Convert Atlas/Circe cohort JSON into executable Capr R code using jsonToCapr() and jsonToCaprFile(). This makes it easier to move existing Atlas definitions into version-controlled Capr pipelines.
Expanded attribute support and Circe alignment Added broader attribute coverage (including key-value and type-exclude style attributes), plus improved serialization behavior to better match Circe expectations and support reliable round-trip workflows.
Improved round-trip fidelity Added includeConceptSets support in toCohortJson() and multiple decompilation fixes to better preserve concept set handling and generated JSON fidelity.
Cleaner JSON serialization API Added toCohortJson() and toConceptSetJson() as the primary user-facing serialization functions. compile() is soft-deprecated in favor of these explicit replacements.
Human-readable console printing and summaries Added compact show() methods for every user-facing class and a new summary() S4 method that expands the cohort structure, including nested correlated criteria. summary(x, listConceptSets = TRUE) appends a concept-set section showing each set’s id and descendants/excluded/mapped logic, with concept names and domains once the cohort is hydrated via getConceptSetDetails().
Robust concept-set collection in nested criteria Fixed listConceptSets() so multi-layer nested criteria where an outer nested group has a single element no longer return an empty list (OHDSI/Capr#123). The recursion now follows a flat-list invariant with unconditional flattening instead of shape-based guessing, and regression tests guard the previously failing scenarios.
Concept set identity is now always content-derived Removed the id parameter from cs(). Concept set IDs are always an md5 hash of the concept set contents, decoupling them from any specific cohort definition or Atlas context.
Vocabulary concept search functions Added searchConcepts(), rankedSearchConcepts(), getConceptDescendants(), mapSourceToStandard(), and getConceptInfo() for interactive vocabulary exploration from any OMOP CDM connection. rankedSearchConcepts() automatically uses dialect-specific similarity ranking (pg_trgm on PostgreSQL, Jarowinkler on Snowflake, Levenshtein on Spark) with a universal fallback. SQL lives in inst/sql/sql_server/ following the HADES convention.
Expanded Circe attribute coverage Added many previously missing attributes including ageAtStart(), ageAtEnd(), visitLength(), periodLength(), raceConcepts(), ethnicityConcepts(), quantityValue(), stopReason(), uniqueDeviceId(), specimenSourceId(), and the full set of *TypeCS() concept-set-selection variants for every domain. Added payerPlanPeriod() query domain.
LLM skills bundle included and improved Expanded the bundled LLM guidance under inst/llm to support validated local generation of Capr cohort definitions, including workflow instructions, API reference content, and validation helpers.
Quality and reliability improvements Added substantial test coverage for jsonToCapr, round-trip conversion, and edge cases to improve stability of the new workflow features.
makeCohortSet() function to pipe into CohortGenerator (from Issue #79)dateAdjustment() function to deploy new circe attribute to a query (from Issue #77)cs()
New user interface for cohort construction - cs() function to build and combine concept ids into sets - improved readability code to build cohort definition - coercion of Capr object to json to save as file for study - maintained support for Capr templates
Initial version of Capr package to functionalize the creation of cohort definitions of OMOP CDM mapped data. Features include:
Lookup functions to browse and identify concepts from OMOP Vocabularies
Creation functions of cohort definitions sub-components (concept set expressions, queries, counts, groups) and main-components (primary criteria, additional criteria, inclusion rules, censoring criteria and cohort eras).
Save and load component parts of cohort definition
Import circe json and convert into Capr objects
Print Capr R script that produces equivalent cohort definitions in Capr
Show functions for Capr objects