textRuleDevelop compileCategory

Advanced Pharma Adverse Event Coding with Concepts

Scénario de test & Cas d'usage

Business Context

A pharmaceutical company analyzes clinical trial notes. They use a two-step process: first, extract specific drug entities (Concepts), then categorize the notes based on the presence of these concepts combined with other terms (e.g., 'DrugX' AND 'Headache'). This tests the integration of an existing Concept model into the Category compilation.
Data Preparation

Creation of concept rules (Drug definitions) and category rules that reference those concepts.

Copied!
1 
2DATA mycas.concept_defs;
3LENGTH config $200;
4INFILE DATALINES dsd;
5INPUT config $;
6DATALINES;
7"CONCEPT:DrugA,(OR, 'Aspirin', 'Acetylsalicylic')" "CONCEPT:DrugB,(OR, 'Ibuprofen', 'Advil')" ;
8 
9RUN;
10 
11DATA mycas.category_complex_rules;
12LENGTH config $200;
13INFILE DATALINES dsd;
14INPUT config $;
15DATALINES;
16"CATEGORY:AdverseEvent_A,(AND, C_CONCEPT:DrugA, 'nausea')" "CATEGORY:AdverseEvent_B,(AND, C_CONCEPT:DrugB, 'dizziness')" ;
17 
18RUN;
19 

Étapes de réalisation

1
Step 1: Compile the Concept Model first (Prerequisite).
Copied!
1 
2PROC CAS;
3textRuleDevelop.compileConcept / TABLE={name='concept_defs'} config='config' casOut={name='drug_concepts_li', replace=true};
4 
5RUN;
6 
2
Step 2: Compile the Category Model using the previously created Concept Model as input.
Copied!
1 
2PROC CAS;
3textRuleDevelop.compileCategory / TABLE={name='category_complex_rules'} config='config' concept={name='drug_concepts_li'} casOut={name='adverse_event_model', replace=true};
4 
5RUN;
6 

Expected Result


The action should successfully link the 'drug_concepts_li' binary model with the text rules. The final 'adverse_event_model' will contain logic that depends on the successful detection of the underlying concepts.