Matcher rule
same-code-key-joined-first
Two records of one kind match when their current versions share a code under one property: an allergen's code, or a procedure's or a condition's SNOMED CT code. Any dates are ignored. Each ordered pair is a row.
The query
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX pav: <http://purl.org/pav/>
SELECT DISTINCT ?record ?other
WHERE {
?record pav:hasCurrentVersion ?version .
?version ?property ?code .
FILTER (?property IN (cascade:conditionCode, cascade:procedureCode, cascade:allergenCode) &&
(?property = cascade:allergenCode || STRSTARTS(STR(?code), "http://snomed.info/id/")))
?otherVersion ?property ?code .
?other pav:hasCurrentVersion ?otherVersion .
?record cascade:recordKind ?kind .
?other cascade:recordKind ?otherKind .
FILTER (?record != ?other && sameTerm(?kind, ?otherKind))
}
Terms it reads
cascade:allergenCode · cascade:conditionCode · cascade:procedureCode · cascade:recordKind · pav:hasCurrentVersion
Rules and decision notes that name it
- M4d. Each version of the rule list names, for each of its rules from R1 to R21, the query that rule's row runs runtime/matcher.feature
- The IRI of every code decisions/code-iris.md