defining-cohort-phenotypes
하는 일
이 스킬은 어떤 환자가 특정 질환을 가졌는지 설명하는 계산 가능한 표현형 정의를 OMOP 형식의 데이터베이스용으로 작성하도록 돕습니다. 재현 가능한 환자 코호트가 필요한 연구자와 분석가를 위한 스킬입니다.
사용하는 경우
- ✓OMOP 데이터로 분석이나 연구를 하며 재현 가능한 환자 코호트가 필요할 때.
- ✓기존 OHDSI 또는 PheKB 표현형을 재사용하고 맞게 바꾸고 싶을 때.
- ✓흡연 상태처럼 노트에만 있는 사실에 코호트가 의존할 때.
스킬 링크
https://github.com/maziyarpanahi/openmed/blob/master/skills/defining-cohort-phenotypes/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 OMOP 데이터베이스에서 제2형 당뇨 환자의 코호트 정의를 작성하고, 흡연 상태를 위한 텍스트 기반 특징을 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 표준 JSON 형식으로 개념 집합과 포함 규칙을 만들고, 코드만으로는 놓칠 노트 유래 특징을 추가합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Defining cohort phenotypes (OHDSI / OMOP CDM)
A computable phenotype is a portable, executable definition of "which patients have condition X" — concept sets plus inclusion logic that runs against any OMOP CDM-compliant database. In the OHDSI stack, ATLAS authors these visually, CIRCE serializes them to a standardized JSON representation, and that JSON compiles to database-specific SQL. This skill helps you author such definitions and augment them with NLP features that OpenMed extracts from clinical text — exactly the signals that structured codes miss.
OMOP CDM, ATLAS, CIRCE, and the OHDSI Phenotype Library are open source. The vocabulary content you reference (SNOMED CT, CPT4, ICD) is user-supplied — do not bundle restricted terminologies; load them into your own OMOP vocabulary tables with your own licenses.
When to use
- You need a reproducible cohort definition for analytics or research.
- You want to reuse an existing PheKB or OHDSI Phenotype Library definition and adapt it.
- A phenotype depends on facts that live only in free text (e.g. smoking status, symptom severity, social context) and code-based logic alone is weak.
For terminology grounding of individual entities, see coding-icd10,
normalizing-rxnorm, mapping-loinc; this skill is about composing them into a
cohort.
Anatomy of a CIRCE cohort definition
A CIRCE cohort definition JSON has two parts: ConceptSets (the code lists) and an expression (entry event + inclusion rules). Shape (abridged):
{
"ConceptSets": [{
"id": 0, "name": "Type 2 diabetes",
"expression": { "items": [{
"concept": { "CONCEPT_ID": 201826, // OMOP standard concept
"CONCEPT_CODE": "44054006", // SNOMED (user vocab)
"VOCABULARY_ID": "SNOMED" },
"includeDescendants": true // pull the hierarchy
}] }
}],
"PrimaryCriteria": { // entry event
"CriteriaList": [{ "ConditionOccurrence": { "CodesetId": 0 } }],
"ObservationWindow": { "PriorDays": 0, "PostDays": 0 },
"PrimaryCriteriaLimit": { "Type": "First" }
},
"InclusionRules": [{
"name": "Adult at index",
"expression": { "Type": "ALL", "CriteriaList": [{
"Criteria": { "ConditionEra": { "AgeAtStart": { "Value": 18, "Op": "gte" } } }
}] }
}]
}
You author this in ATLAS (recommended) or by hand. The OHDSI Phenotype Library ships hundreds of vetted definitions as exactly this JSON; reuse before you write.
Augmenting with OpenMed NLP features
Code-based phenotypes are blind to facts that only appear in notes. The pattern is materialize an NLP feature as OMOP rows, then reference it like any concept set.
import openmed
# 1) Extract the text feature OpenMed is good at (e.g. tobacco use, symptom)
note = "Patient is a current smoker, ~1 pack/day, with worsening dyspnea."
res = openmed.analyze_text(note, model_name="disease_detection_superclinical",
output_format="dict")
# 2) Write a derived OBSERVATION (or a custom cohort attribute) per patient,
# mapping each extracted entity to a standard concept (grounded out-of-process).
# e.g. Observation: "Current smoker" -> a SNOMED concept in your vocab.
# 3) Reference that concept in a CIRCE ConceptSet, so the phenotype combines
# structured codes AND the NLP-derived flag in one inclusion rule.
This mirrors how eMERGE and PheKB phenotypes mix structured codes with NLP: the NLP step contributes high-recall flags for concepts that ICD/CPT capture poorly, and CIRCE composes them with the rest of the logic.
Workflow
- Start from a library definition if one exists (OHDSI Phenotype Library / PheKB) and adapt; otherwise design entry event + inclusion rules.
- Build concept sets from standard OMOP concepts; set
includeDescendantsto capture hierarchies. Vocabulary content comes from your own licensed tables. - Identify text-only criteria the codes miss; extract them with
openmed.analyze_textand materialize as OMOP rows / cohort attributes. - Assemble the CIRCE JSON (concept sets + expression) — in ATLAS or directly.
- Validate against OMOP CDM: generate SQL, run on a (synthetic/de-identified) database, review cohort counts; iterate with PheValuator-style checks.
- Document human-readable logic alongside the JSON for portability.
Hand-off to / from
자주 묻는 질문
어휘 코드가 포함되나요?
아니요. 어휘 내용은 사용자가 자신의 라이선스로 제공해야 합니다.
기존 표현형을 재사용할 수 있나요?
네. OHDSI Phenotype Library나 PheKB의 정의를 맞게 바꿀 수 있습니다.
어떤 형식을 만드나요?
OHDSI 도구가 데이터베이스 쿼리로 컴파일하는 표준 JSON 표현을 사용합니다.
상세 정보
작성자의 원본 설명
Authors computable phenotype and cohort definitions in the OHDSI ATLAS / CIRCE style over the OMOP CDM, combining standard concept sets with NLP-derived features that OpenMed extracts. Use when the user wants to define a patient cohort, write a computable phenotype, reuse PheKB or OHDSI Phenotype Library logic, build concept sets, or augment code-based criteria with text features. Trigger keywords: phenotype, cohort definition, OHDSI, ATLAS, CIRCE, OMOP CDM, concept set, PheKB, Phenotype Library, eMERGE, computable phenotype. Pairs adjacent to OpenMed: NLP features from openmed.analyze_text au
repo: maziyarpanahi/openmed
인기도
- GitHub 스타
- 5.8k
- 순위
- #14687
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
annotating-variants
5.8k에이전트가 유전 변이의 효과를 예측하고, HGVS 이름을 게놈 위치로 바꾸고, 무료 공개 주석 도구를 사용해 인구 빈도를 붙이도록 돕습니다.
ask-openmed
5.8k에이전트가 임상 텍스트 요청에 맞는 OpenMed 워크플로를 고르도록 돕되, 환자 데이터가 있을 수 있으면 먼저 개인 정보 확인을 거치게 합니다.
assembling-fhir-bundles
5.8k여러 FHIR 건강 기록을 EHR로 보낼 수 있도록 하나의 트랜잭션 Bundle로 묶고, 내부 참조를 올바르게 연결하도록 에이전트를 돕습니다.
auditing-deid-leakage
5.8k비식별화된 임상 텍스트에 남은 SSN, 카드 번호, 이메일, 날짜 같은 식별자를 검사하고, 남은 것이 있으면 공개를 막도록 돕습니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.