Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presented by Nick Felts

Similar presentations


Presentation on theme: "Presented by Nick Felts"— Presentation transcript:

1 Presented by Nick Felts
Advanced Calculations Presented by Nick Felts

2 Objectives This presentation cover some more advanced calculation Syntax such as: Functions Time Frames Variables Preservation of historical results Looping Suggested pre-requisite Calculations for beginners Coffee!

3 I have experience with... GETDBF or “->” RBS Time Frames
Changing Calculations Stopping Looping Putting in tasks for calculations because they scare me!

4 Functions Pre-defined commands that are used to perform a designated operation POW ANY MATCH GETDBF Follow the Syntax! Each Function is unique.

5 POW POW(.45*@WT,.425)*POW(2.54*@HT,.725) POW( base , exponent )

6 ANY ANY(@TEST) or #@TEST Looking to see if test has been resulted
+" +

7 MATCH MATCH( "what" , where ) Can use wild card *
MATCH("< ? :

8 GETDBF GETDBF("field") Available fields ->
DBFLD (stop using this on 4.0 lines!) Available fields Sex Race Age Doctor Ward Many more...

9 GETDBF("SEX")=="F"? @TESTO+" @CM":@TESTO

10 -> (Test Access Operator)
                               

11 Variables $N:=@FISH+10; @FISH>30?@FISH:
$N+ One letter code to represent a calculation Useful in long calculations or when the same expression is used multiple times

12 Variables + ($A>=1 && Pommegrannite

13 When can Calculations look at previous results from different orders?
When written in Canned Messages When written in Test Setup When written in RBS Rules Never

14 Time Frames Calculation can only look back in time if written in a Post Result RBS rule. Syntax @TEST[2] Search back 2 days for numeric result of TEST starting with the current order. @TEST[-2] Search back 2 hours for numeric result of TEST starting with the current order. @TEST{1}[2] Search back 2 days for numeric result of TEST skipping the current order.

15 Time Frames @PTI)

16 Preserving Historical Data
Every time you go into Edit Mode, calculated results will RECALCULATE! Verified results that Recalculate, will generate an RMOD (corrected result)!

17 Preserving Historical Data
2 ways to keep historical data safe! GETDBF GETDBF("ACCDATE") MESEXPDATE

18 GETDBF GETDBF("ACCDATE")<20140905? $@TEST :"New Calculation"
"Old Calculation":"New Calculation"

19 MESEXPDATE

20 Looping Occurs when trying to calculate a test based on its own results...

21 Looping 4 Types Cyclic dependencies Change precision
Absolute Expression Keep adding canned message

22 Cyclic dependencies Problem Test HGB contains calculation... @HGB/3

23 Cyclic dependencies Solutions Build a new test Add @L HGBI
HGB (reportable) @HGBI/3 @L"

24 Changing Precision Problem Alphanumeric Test contains calculation .25 becomes

25 Changing Precision Build the test as Numeric Add @L Solution

26 Absolute Expression Numeric Results changed to Alphanumeric
Problem Numeric Results changed to Alphanumeric @TST>5?"POSITIVE": "NEGATIVE" Result will always be NEGATIVE

27 Absolute Expression Solutions TSTI TST (reportable)
Build a new test TSTI TST (reportable) @TSTI>5?"POSITIVE": "NEGATIVE"

28 Continuously Adding Canned Messages
Problem @HEPA":

29 Continuously Adding Canned Messages
Solution MATCH @COUM": STRSTR ==

30 When does looping occur?
When a test in the calculation isn’t on the current order. When adding canned messages to results. When a test is calculated based on its own result. When using Whenever I try to write a calculation!!!

31 Complex Examples

32 GFR $F:=GETDBF("SEX")=="F"?0.742:1; $B:=GETDBF("RACE")=="B"?1.21:1); *$F*$B; $X>60?">60":$X

33 More complex GFR $F:=(GETDBF("SEX")=="F"?0.742:1); $B:=(GETDBF("RACE")=="B"?1.21:1); $V:=186* $X:=$V>60?">60":$V; $A<20?$X: (($A>=20 && $A<30) ? $X + : (($A>=30 && $A<40) ? $X + : (($A>=40 && $A<50) ? $X + : (($A>=50 && $A<60) ? $X + : (($A>=60 && $A<70) ? $X + : (($A>=70) ? $X + :$X)))))),$X

34 Tips… Test ALL possible answers Combat looping
Don’t cut and paste from s or Word - Use Notepad

35 Questions?


Download ppt "Presented by Nick Felts"

Similar presentations


Ads by Google