You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CasePastPresent as (
select distinct
CaseDef.subject_ref, CaseDef.encounter_ref,
CaseDef.dx_suicidality, CaseDef.dx_subtype, CaseDef.dx_code,
case
when dx_code in ('Z91.5', 'Z91.51', 'Z91.52') then 'action-past' -- history of self harm
when (dx_code like 'T%D') or (dx_code like 'X%D') then 'action-past-present' -- subsequent suicide attempt, and other codes for subsequent encounter
when (dx_code like 'T%S') or (dx_code like 'X%S') then 'action-past-present' -- subsequent encounter
else concat(CaseDef.label, '-present') end as label
from CaseDef
)
The text was updated successfully, but these errors were encountered:
Example logic:
CasePastPresent as (
select distinct
CaseDef.subject_ref, CaseDef.encounter_ref,
CaseDef.dx_suicidality, CaseDef.dx_subtype, CaseDef.dx_code,
case
when dx_code in ('Z91.5', 'Z91.51', 'Z91.52') then 'action-past' -- history of self harm
when (dx_code like 'T%D') or (dx_code like 'X%D') then 'action-past-present' -- subsequent suicide attempt, and other codes for subsequent encounter
when (dx_code like 'T%S') or (dx_code like 'X%S') then 'action-past-present' -- subsequent encounter
else concat(CaseDef.label, '-present') end as label
from CaseDef
)
The text was updated successfully, but these errors were encountered: