with_type() temporarily sets the active code type so that query functions
inside code use it without needing an explicit type = argument. It works
with any code type present in the database.
Arguments
- type
A string naming the code type (e.g.
"ICD-10","SNOMED CT"). This corresponds to thetypeargument accepted by query functions such asCODES(),CHILDREN(), andMAP().- code
The expression to evaluate within the code type context.
Examples
if (FALSE) { # \dontrun{
with_type("ICD-10", DESCRIPTION("diabetes"))
with_type("BNF", CODES("0204 << Beta-Adrenoceptor Blocking Drugs >>"))
with_type(
"SNOMED CT",
CHILDREN(
"770765001 << Proliferative retinopathy of right eye due to diabetes mellitus (disorder) >>"
)
)
} # }