R中的队列定义应用程序编程
概览
Capr(发音为“kay-pr”)的目标是提供一种语言,用R代码表达OHDSI队列定义。OHDSI将队列定义为“在一定时间内满足一个或多个纳入标准的人”,并提供了标准化的方法来定义他们(Circe)。Capr通过R语言中的程序界面揭示了这一标准化方法,使构建、版本化和复用队列定义变得更方便——尤其是在创建大量相似队列时。Capr代码设计为人类可读,同时可直接对OMOP通用数据模型执行。 在《OHDSI之书》的队列章节中,了解更多关于OHDSI队列构建方法的信息。 用户可以通过以下方式从GitHub安装当前开发版本的Capr: 相关文档可在包装官网上找到。 文档的PDF版本也可在软件包网站上获取。
概述(AI 翻译)
Capr 是 HADES 的一部分
引言
Capr(发音为“kay-pr”)的目标是提供一种语言,用R代码表达OHDSI队列定义。OHDSI将队列定义为“在一定时间内满足一个或多个纳入标准的人”,并提供了标准化的方法来定义他们(Circe)。Capr通过R语言中的程序界面揭示了这一标准化方法,使构建、版本化和复用队列定义变得更方便——尤其是在创建大量相似队列时。Capr代码设计为人类可读,同时可直接对OMOP通用数据模型执行。
在《OHDSI之书》的队列章节中,了解更多关于OHDSI队列构建方法的信息。
安装
用户可以通过以下方式从GitHub安装当前开发版本的Capr:
用户文档
相关文档可在包装官网上找到。
从这里开始,基于你的目标:
| 进球 | 小插曲 |
|---|---|
| 组建你的第一个军团 | 使用 Capr |
| 理解查询、标准和组 | Capr 组件 |
| 概念集工作 | 概念集工作 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Capr
Capr is part of HADES
Introduction
The goal of Capr, pronounced ‘kay-pr’ like the edible flower, is to provide a language for expressing OHDSI cohort definitions in R code. OHDSI defines a cohort as “a set of persons who satisfy one or more inclusion criteria for a duration of time” and provides a standardized approach for defining them (Circe). Capr exposes that standardized approach through a programmatic interface in R, making it easier to build, version, and reuse cohort definitions — particularly when creating a large number of similar cohorts. Capr code is designed to be human-readable while remaining directly executable against an OMOP Common Data Model.
Learn more about the OHDSI approach to cohort building in the cohorts chapter of the Book of OHDSI.
Installation
Users can install the current development version of Capr from GitHub with:
# install.packages("devtools")
devtools::install_github("ohdsi/Capr")
User Documentation
Documentation can be found on the package website.
Start here based on your goal:
| Goal | Vignette |
|---|---|
| Build your first cohort | Using Capr |
| Understand queries, criteria, and groups | Capr components |
| Work with concept sets | Working with Concept Sets |
| Convert Atlas JSON to Capr code | Decompiling Atlas JSON |
| Build many cohorts from a template | Capr for Templating |
| See clinical cohort examples | Cohort Definition Examples |
PDF versions of the documentation are also available on the package website.
Using Capr with LLM Coding Agents
Capr ships with a self-contained skill bundle for LLM coding agents (Claude Code, GitHub Copilot, Cursor, etc.) that generates validated cohort definitions from natural-language descriptions — no MCP servers, no network infrastructure, no database connection. The bundle
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add ohdsi/capr