mrcm
SNOMED CT MRCM (Machine Readable Concept Model) rules.
Loads the RF2 MRCM refset snapshots (Domain, AttributeDomain, AttributeRange) for the
domains and content types configured in hierarchy.mrcm and exposes them keyed by the
pipeline's attribute keys (finding_site, associated_morphology, ...) configured in
hierarchy.attributes.
Only pre-coordinated rules are used: rows whose contentTypeId is not listed in
hierarchy.mrcm.content_types are ignored.
Cardinality
dataclass
MRCM cardinality such as 0..* or 1..1. max is None means unbounded.
Source code in src/ariadne/hierarchy/mrcm.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
MrcmRules
dataclass
MRCM rules for the configured domains, addressable by pipeline attribute key.
Source code in src/ariadne/hierarchy/mrcm.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
domain_chain(domain_name)
The domain followed by its configured MRCM ancestors (nearest first).
Source code in src/ariadne/hierarchy/mrcm.py
203 204 205 206 207 208 209 210 | |
in_range(attribute_key, concept_code, is_a)
Whether concept_code satisfies any range rule of the attribute.
Returns None when no range rule could be evaluated (unsupported ECL).
Source code in src/ariadne/hierarchy/mrcm.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
load(settings, attributes)
classmethod
Load MRCM rules from the RF2 refset files in settings.folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
MrcmSettings
|
|
required |
attributes
|
Mapping[str, AttributeConfig]
|
|
required |
Source code in src/ariadne/hierarchy/mrcm.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
rules_for_domain(domain_name)
Attribute rules (own + inherited) of a domain keyed by pipeline attribute key.
Attributes allowed by the MRCM but without a pipeline key are keyed "<id>".
Source code in src/ariadne/hierarchy/mrcm.py
212 213 214 215 216 217 218 219 220 | |
select_domain(attribute_keys)
Pick the configured domain that allows the most of attribute_keys.
Ties go to default_domain and then to the most specific (deepest) domain.
Source code in src/ariadne/hierarchy/mrcm.py
222 223 224 225 226 227 228 229 230 231 232 233 234 | |
Rf2IsAIndex
Transitive is a lookups built from an RF2 relationship snapshot (inferred, active).
Source code in src/ariadne/hierarchy/mrcm.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | |
__contains__(concept_code)
True if the concept has an active inferred is a (i.e. is active, non-root).
Source code in src/ariadne/hierarchy/mrcm.py
293 294 295 | |
build_grouping_prompt_section(settings)
Human-readable role-grouping rules injected into the hierarchy prompts.
Source code in src/ariadne/hierarchy/mrcm.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | |
parse_simple_ecl(constraint)
Parse an ECL disjunction of <<id, <id or id terms.
Returns None for anything more complex (refinements, MINUS, AND, nesting),
in which case range checks are skipped for that rule.
Source code in src/ariadne/hierarchy/mrcm.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |