withClause
A join-style inclusion clause that restricts the primary query to rows for which at least one row from the secondary source satisfies the such that condition. Equivalent to a semi-join.
Examples
Semi-join on encounter/condition overlap
from [Encounter: "Inpatient Encounter"] E
with [Condition: "Diabetes Mellitus"] C
such that C.onset during E.periodSemi-join filtering by medication start date
from [Encounter] E
with [MedicationRequest] M
such that M.authoredOn during E.period
and M.status = 'active'EBNF
withClause : 'with' aliasedQuerySource 'such that' expression ;