Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to calculate the total doses of medication a patient was given within 24 hours of being admitted to the hospital. I have two fields, AdmissionInstant and MedicationAdministrationInstant, which return a date and timestamp in the form MM/DD/YY hh:mm:ss. I need to calculate the sum of the medication dose where MedicationAdministrationInstant- AdmissionInstant <= 24 hours. I know how to use interval to calculate the number of hours between the time stamps but I think I need to use set analysis in order to make my calculation of sum(MedicationDose) work. It didn't seem to like an if statement where the interval was less than 25 hours.
I have accomplished similar things when looking at an entire month. I use this, for instance, to return the data for the same month in the prior year. I know this example isn't doing the same thing I'm trying to do but this at least shows what I think I need to do. I just can't get it to work.
AdmitDate={"=inmonth(AdmitDate,Date(vCurrentDateCutoff, 'M/D/YY'),-12)='-1'"}
Does anyone know how I would make this work for looking at a period of 24 hours after a time stamped event?
Thanks for any and all help!
Do you have an id for each admission? If you do (let's call it AdmissionID), you can do this...
{<AdmissionID = {"=MedicationAdministrationInstant - AdmissionInstant <= 1"}>}I am assuming that both MedicationAdministrationInstant and AdmissionInstant are both time stamps
Do you have an id for each admission? If you do (let's call it AdmissionID), you can do this...
{<AdmissionID = {"=MedicationAdministrationInstant - AdmissionInstant <= 1"}>}I am assuming that both MedicationAdministrationInstant and AdmissionInstant are both time stamps
Thank you this worked! I used the MedicationAdministrationKey which is unique to each time a patient is given any medication. Can you help me understand why the calculation below doesn't work to make sure I'm using hours vs. days?
MedicationAdministrationKey={"=Interval(AdministrationInstant-AdmissionInstant,'h')<25"}
This returns the total of all medication dosage, not just the values less than 25 hours.
Although you are designating a format to the difference, the underlying value of the difference is still in decimals.... so, 1 hour = 1/24, 2 hours = 2/24.... so, up until 599 hours, your statement will still be true.... 599 hours = (24 days and 23 hours)
Does that make sense?
Yes that makes sense. Thanks for your help!