Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi everyone,
I am trying to find the number of patients who were readmitted to the hospital within 30 days after they were discharged previously. I have The admissions table with the columns (Patient No, admission date, discharge date, bed, ward... etc) Do you guys have any idea about how to do that?
Tank you.
Solved! Go to Solution.
try this code for calculated column - it returns true whenever the admission date for a patient is less than 30 vs their last discharge date
Column = VAR CurrentPatientNo = 'Table'[Patient No] VAR CurrentAdmissionDate = 'Table'[Admission date] VAR PreviousDischargeDate = CALCULATE ( MAX ( 'Table'[Discharge date] ), FILTER ( 'Table', 'Table'[Admission date] < CurrentAdmissionDate && 'Table'[Patient No] = CurrentPatientNo ) ) RETURN IF ( PreviousDischargeDate = 0, FALSE (), IF ( CurrentAdmissionDate - PreviousDischargeDate <= 30, TRUE, FALSE () ) )
try this code for calculated column - it returns true whenever the admission date for a patient is less than 30 vs their last discharge date
Column = VAR CurrentPatientNo = 'Table'[Patient No] VAR CurrentAdmissionDate = 'Table'[Admission date] VAR PreviousDischargeDate = CALCULATE ( MAX ( 'Table'[Discharge date] ), FILTER ( 'Table', 'Table'[Admission date] < CurrentAdmissionDate && 'Table'[Patient No] = CurrentPatientNo ) ) RETURN IF ( PreviousDischargeDate = 0, FALSE (), IF ( CurrentAdmissionDate - PreviousDischargeDate <= 30, TRUE, FALSE () ) )
This solution is not working for me, any reasons why?
Thank you for this! I am needing to find the index/initial visit, any advice on how I would do that? Thanks in advance
thank you, it works!
What about if I wanted to add a condition to calcuate this only for patients re-admitted through Emergeny? where Admission Method= Emergengy Patient (to calculate Unplanned Readmissons)
P.S. No restriction on discharge date.
Thanks in advance!
@OhoodK that would be something like this:
Column = VAR __CurrentPatientNo = 'Table'[Patient No] VAR __CurrentAdmissionDate = 'Table'[Admission date] VAR __PreviousAdmissionDate = CALCULATE ( MAX ( 'Table'[Admission date] ), FILTER ( 'Table', 'Table'[Admission date] < __CurrentAdmissionDate && 'Table'[Patient No] = __CurrentPatientNo ) ) RETURN IF ( 'Table'[Admission Method] <> "Emergency Patient", FALSE (), IF ( __PreviousAdmissionDate <> 0, TRUE (), FALSE () ) )
Hi, I tried to use the above code to estimate the readmission > 28 days, but it only gave me true/ false response. The code I used is below:
Many thanks!
This is great! Thank you for solving.
It's working thanks a lot!
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |