defining-cohort-phenotypes
O que ela faz
Esta skill ajuda a escrever definições computáveis de fenótipo, que descrevem quais pacientes têm uma condição, para bancos de dados no formato OMOP. É para pesquisadores e analistas que precisam de coortes de pacientes reproduzíveis.
Quando usar
- ✓Quando você precisa de uma coorte de pacientes reproduzível para análises ou pesquisas com dados OMOP.
- ✓Quando você quer reutilizar um fenótipo existente do OHDSI ou do PheKB e adaptá-lo.
- ✓Quando uma coorte depende de fatos que aparecem apenas nas notas clínicas, como o status de tabagismo.
Link da skill
https://github.com/maziyarpanahi/openmed/blob/master/skills/defining-cohort-phenotypes/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Escreva uma definição de coorte para pacientes com diabetes tipo 2 no nosso banco OMOP e adicione uma característica baseada em texto para o status de tabagismo.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente monta os conjuntos de conceitos e as regras de inclusão no formato JSON padrão e depois acrescenta características derivadas das notas que os códigos sozinhos não captariam.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
Ela inclui códigos de vocabulário?
Não. Você fornece o conteúdo do vocabulário sob suas próprias licenças.
Posso reutilizar fenótipos existentes?
Sim. Ela pode adaptar definições da OHDSI Phenotype Library ou do PheKB.
Qual formato ela produz?
Ela usa a representação JSON padrão que as ferramentas do OHDSI compilam em consultas ao banco de dados.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 5,8 mil
- Posição no ranking
- #14687
- Licença
- Apache-2.0
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
annotating-variants
5,8 milAjuda seu agente a prever o efeito de variantes genéticas, converter nomes HGVS em posições do genoma e incluir frequências populacionais, com anotadores gratuitos.
ask-openmed
5,8 milAjuda seu agente a escolher o fluxo de trabalho certo do OpenMed para um pedido de texto clínico, começando por uma verificação de privacidade sempre que houver dados de pacientes.
assembling-fhir-bundles
5,8 milAgrupa vários registros de saúde FHIR em um único Bundle de transação pronto para ser enviado a um prontuário eletrônico, com as referências internas ligadas corretamente.
auditing-deid-leakage
5,8 milProcura em textos clínicos desidentificados identificadores que sobraram, como SSN, números de cartão, e-mails e datas, e bloqueia a liberação se restar algum.
Skills parecidas
gitcrawl
394 milPermite que seu agente pesquise um arquivo salvo de issues e pull requests do GitHub, agrupe os duplicados e verifique o status atual deles no GitHub.
slacrawl
394 milPermite que seu agente pesquise e conte mensagens em um arquivo local do Slack, verifique quão atualizado ele está e o atualize quando necessário.
goplaces
394 milAjuda seu agente a buscar lugares, obter detalhes e avaliações e identificar nomes de lugares usando o Google Places, com saída em JSON para scripts.