Highlighted

## Interdependent calculations- how to? nkhgupta

Total Posts

10

Likes

0

0

nkhgupta

Total Posts

10

Likes

0

0
nkhgupta

17-03-2012

Can you help in designing actions in the attached form (Designed with Live

Cycle ES)

1) When the weight in pounds is entered, it should change into Wt (BW) in

Kg by using formula : Wt. in pounds/2.2

2) When Ht in inches and weight in pound is entered, it should calculate

BSA (in meter sq) by applying the following formula:

BSA (m²) = ( / 3131 )½

3) After weight in Kg is calculated by above action, It should calculate a)

Ideal Body weight by the formula

Ideal Body Weight (men) in Kg = 50 + 2.3 ( Height(in) - 60 )

Ideal Body Weight (women) in Kg = 45.5 + 2.3 ( Height(in) - 60 )

and after Ideal Body weight is calculated it should be able to calculate

Ajusted Body Weight by formula

Adjusted BW in Kg = Ideal BW in Kg + 0.4 (Actual BW in Kg- Ideal BW in Kg)

4) Ajusted BSA is calculated using the formula above for BSA calculation

using height in inches and Adjusted BW in pounds.

5) Creatinine Clearence is calculated by

CrCl = (in Kg) / (Scr x 72) . If sex is selected as F,

the Cr.Cl would be

CrCl = (in Kg) / (Scr x 72) (x 0.85)

6) AUC is calculated by Cr cl + 25

7) Is it possible to calculate total dose based on dose x dose per whatever

unit is selected from the dropdown list?

I am a novice and have designed this but have no knowledge of java or any

language. If you or someone you know can help?

It will be higly appreciated.

Naresh Gupta

### Replies

Highlighted whyisthisme

Total Posts

324

Likes

41

59

whyisthisme

Total Posts

324

Likes

41

59
whyisthisme

19-03-2012

For any formula you need to put the calculations in the calculate event of the field where you want the answers to show. So for example, to multiply 2 fields together you could do (in formcalc):

\$ = NumericField1 * NumericField2

You would obviously need to rename the fields to whatever yours are called and adjust the formula to what you actually want it to do.

Hope that helps.

Highlighted nkhgupta

Total Posts

10

Likes

0

0

nkhgupta

Total Posts

10

Likes

0

0
nkhgupta

21-03-2012

Thanks a lot.

I have another question

How do I incorporate a different formulas for calculation of Ideal BW when

field in the form indicates that the subject is Female.

Ideal Body Weight (men) = 50 + 2.3 ( Height(in) - 60 ) ( Devine formula)

Ideal Body Weight (women) = 45.5 + 2.3 ( Height(in) - 60 ) (Robinson

formula)

Naresh

Highlighted whyisthisme

Total Posts

324

Likes

41

59

whyisthisme

Total Posts

324

Likes

41

59
whyisthisme

21-03-2012

you would use an if statement. So it would go something like this (in formcalc):

if (gender == "female") then

\$ = ....

else \$ = .....

endif

Again the bit within the () would be renamed depending on how the user says their gender eg. textfield, radio buttons etc.

Highlighted nkhgupta

Total Posts

10

Likes

0

0

nkhgupta

Total Posts

10

Likes

0

0
nkhgupta

22-03-2012

I tried this for Creatinine Clearance.

form1.#subform.Paragraph.NumericField6::calculate - (FormCalc,

client)

if(DropdownList16 == M)then

NumericField6 = (140 - NumericField15) * (NumericField5) /

(NumericField14 * 72)

else NumericField6 = NumericField6 * 0.85

endif

If I just calculate creatinine clearance based on the above formula, with

no if , else or end issues, it works fine.

Suggestions?

You have been a big help, I must say.

Naresh

Highlighted whyisthisme

Total Posts

324

Likes

41

59

whyisthisme

Total Posts

324

Likes

41

59
whyisthisme

22-03-2012

you need to put the M into "" so it should be:

if (DropdownList16 == "M") then ....

Highlighted nkhgupta

Total Posts

10

Likes

0

0

nkhgupta

Total Posts

10

Likes

0

0
nkhgupta

22-03-2012

I am making a great progress, guided by you.

i want to ask if the following expression is correct?

if(Dropdownlist15 == "M2")then

NumericField10 = NumericField16 * NumericField8

if(Dropdownlist15 == "KG")then

NumericField10 = NumericField16 * NumericField5[0}

else

endif

where M2 and KG, NumericField 8 and NumericField5 belong to paragraph

1 and NumericField10 and NumericField16 belong to a table in the same form.

Should it matter?

Thanks a bunch again.

Highlighted whyisthisme

Total Posts

324

Likes

41

59

whyisthisme

Total Posts

324

Likes

41

59
whyisthisme

22-03-2012

Well firstly you code above is incorrect.

It either has to be:

if(Dropdownlist15 == "M2")then

NumericField10 = NumericField16 * NumericField8

elseif(Dropdownlist15 == "KG") then

NumericField10 = NumericField16 * NumericField5[0}

endif

OR

if(Dropdownlist15 == "M2")then

NumericField10 = NumericField16 * NumericField8

endif

if(Dropdownlist15 == "KG")then

NumericField10 = NumericField16 * NumericField5[0}

endif

depending on what you want to do.

In regards to certain fields being in a table you will need to reference them properly, so something like Table1.Row1.NumericField10.

Highlighted nkhgupta

Total Posts

10

Likes

0

0

nkhgupta

Total Posts

10

Likes

0

0
nkhgupta

23-03-2012

I have come a long way. I really appreciate your support. I am going to try

this.

BTW

how will I write

BMI= Weight in KG /(Height in M2)2

I dont know how to give expression to "square", e.g I learnt squareroot is

written as "Sqrt"

and where can I find these expressions

Thanks.

Highlighted nkhgupta

Total Posts

10

Likes

0

0

nkhgupta

Total Posts

10

Likes

0