Hi Community, excited to see what you think up!
BLUF: How can I analyze what nurse saw a patient prior to a surgery or a non-surgery?
See my simplified dataset below. My hope is to be able to see which nurses saw which patients/customers that led to a surgery (or not).
- My current thought is a CASE WHEN to create a label for "surgical patients", but this doesn't capture pre-operative testing and evaluations. For instance:
CASE
WHEN Treatment = 'Surgery' THEN 'Surgical Patient'
ELSE 'Non-surgical Patient'
This logic missed the Consult, the testing, the evals, etc. that lead up to the surgery.
2. If I take all Patients that had a surgery and then do a large "CASE WHEN" on them, then I get duplicates downstream, which also isn't ideal. For instance:
CASE
WHEN Patient = 1, 2, OR 4 THEN 'Surgical Patient'
ELSE 'Non surgical patient'
This fails because then it shows FIVE "Surgical Patients" for Patient 1, even though only 1 surgery was performed.
I feel as though I'm very close but just need someone to get me across the finish line 😊🏁🏁