5 Replies Latest reply on Sep 15, 2014 7:03 AM by philmodjunk

# Calculation Help- Corrected Age in small children

### Title

Calculation Help- Corrected Age in small children

### Post

Hi all,

I am developing a database for operations in children.  I need to define a calculation field for "Corrected Age".  This is the age of a child born prematurely and is derived from Gestation at birth (no of weeks in utero out of 40) the date of birth (DOB) and the CurrentDate (Date of Operation).  Corrected age is less than the actual age by the number of weeks premature i.e. IF a baby is born at 32 weeks (8 weeks premature) and is now 6 months (24 weeks) old, the Corrected Age is 24-8=16 weeks.

I have defined a calculation field for Age in months and another for age in days, based on the CurrentDate and the Date of the Operation (DateOp)

Age in months

Unstored, = Mod ( Month ( Get ( CurrentDate ) ) - Month ( DOB ) + 12 - If ( Day ( Get ( CurrentDate ) ) < Day ( DOB ) ; 1 ; 0 ) ;12 )

Age in days
Unstored, = Day ( Get ( CurrentDate ) ) - Day ( DOB ) + If ( Day ( Get ( CurrentDate ) ) ≥ Day ( DOB ) ; 0 ; If ( Day ( Get (CurrentDate ) - Day ( Get ( CurrentDate ) ) ) < Day ( DOB ) ; Day ( DOB ) ; Day ( Get( CurrentDate )- Day ( Get ( CurrentDate ) ) ) ) )

I defined a Calculation field for Corrected age thus  Unstored, = AgeMonths - ( 40 - GestationBirth / 4 )
(GestationBirth is the number of weeks)
I hoped this would return a number in months.  What I end up with is a negative in weeks.  I have attached a screen shot of a fictitious patient.

What do I need to do to make the Calculation work.  I am happy with a Calculation in weeks or months, Although ideally, if age < 6 months, the calculation should return a value in weeks and if > 6 months old, the value should be in months.
Ram

• ###### 1. Re: Calculation Help- Corrected Age in small children

Your calc needs to subtract before dividing by 4.

AgeMonths - ( ( 40 - GestationBirth ) / 4 )

This brings back memories. Middle child was very premature and the neonatologist and the obstetrician never could agree on the adjusted age for my kid as he was much larger than typical for his adjusted age (but then progressed in very typical fashion of what my wife and her OB insisted was the correct gestation figure.)

• ###### 2. Re: Calculation Help- Corrected Age in small children

Thanks Phil!  The issue of what is the "real" age remains somewhat debated.  Presuming your boy is fine today,

• ###### 3. Re: Calculation Help- Corrected Age in small children

He's about to become bigger than me, get's straight A's including Japanese and when I can't get a jar opened, I hand it to him...

• ###### 4. Re: Calculation Help- Corrected Age in small children

Hi.  Further on that last calculation.

I would like to modify the calculation as follows

If the age in years is ≥1  the Corrected Age calculation should be disabled and the field should be hidden.  (This last because over the age of 1, the concept of corrected age does not matter)

I tried a script as follows

If [Operations::AgeYears ≥ 1]

Clear [Select; Operations::CorrectedAge]

End if

I set this to be triggered On object enter on the field CorrectedAge (which is a calculation field as above)