AnsweredAssumed Answered

re date calculation

Question asked by mark_d2x on Aug 5, 2009
Latest reply on Aug 5, 2009 by mark_d2x

Title

re date calculation

Post

Hi

 

I am trying to use a calculation to work out if a patient died within 7 days or 30 days of surgery and am using the following formulas:

 

For within 7 days of surgery:

If((IsEmpty(PATIENT::DATE_OF_DEATH) or IsEmpty(DATE_OF_SURGERY)); ""; If((PATIENT::DATE_OF_DEATH-DATE_OF_SURGERY) ≤ 7; "Yes" ; "No"))

 

and within 30:

 If((IsEmpty(PATIENT::DATE_OF_DEATH) or IsEmpty(DATE_OF_SURGERY)); ""; If(7 < (PATIENT::DATE_OF_DEATH-DATE_OF_SURGERY) ≤ 31; "Yes" ; "No")) 

 

However it also gives a true result if the patient dies say a year and 6 days after the surgery etc

 

I am lost as to what to add in to get the calculation correct 

 

Many thanks in anticipation 

Outcomes