textRuleDevelop compileConcept

Adverse Event Detection Model Compilation

Scénario de test & Cas d'usage

Business Context

A pharmaceutical company analyzes patient feedback forms to automatically detect adverse events. They require a custom LITI model that combines specific internal drug names (custom concepts) with standard biological entities (like 'Person' or 'Location') provided by SAS to ensure context is preserved.
Data Preparation

Creation of a CAS table containing specific rules for drug names and adverse symptoms.

Copied!
1DATA casuser.pharma_rules; LENGTH rule_id $32 rule_def $200; INFILE DATALINES delimiter='|'; INPUT rule_id $ rule_def $; DATALINES;
2DRUG_A|CONCEPT_RULE:(C_CONCEPT){Panadol}
3SYMPTOM_1|CONCEPT:headache
4SYMPTOM_2|CONCEPT:nausea
5CONTEXT_1|PREDICATE_RULE:(patient, took, medicine)
6;
7RUN;

Étapes de réalisation

1
Compiling the model with Predefined Entities enabled to capture standard NLP tags along with custom drugs.
Copied!
1PROC CAS;
2 textRuleDevelop.compileConcept /
3 TABLE={caslib="casuser", name="pharma_rules"},
4 ruleId="rule_id",
5 config="rule_def",
6 enablePredefined=TRUE,
7 language="ENGLISH",
8 casOut={caslib="casuser", name="pharma_model_bin", replace=TRUE};
9RUN;

Expected Result


The action should successfully create the 'pharma_model_bin' table. The log should indicate that the model includes both the custom concepts (Panadol, headache) and standard English entities, ready for use in `tpParse`.