This course will attempt to cram the following subjects into your brain Functions Time Frames Variables Preservation of historical results Looping Suggested prerequisite Calculations for beginners ID: 1000725
Download Presentation The PPT/PDF document "Advanced Calculations Presented by Nicho..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
1. Advanced CalculationsPresented by Nicholas Felts
2. This course will attempt to cram the following subjects into your brain...FunctionsTime FramesVariablesPreservation of historical resultsLoopingSuggested pre-requisiteCalculations for beginnersCoffee!Objectives
3. I have experience with…GETDBF or “->”RBS Time FramesChanging CalculationsStopping LoopingPutting in tasks for calculations because they scare me!
4. Pre-defined commands that are used to perform a designated operationPOWANYMATCHGETDBFFollow the Syntax!Each Function is unique. Functions
5. POW( base , exponent )POW(5,2) POW(.45*@WT,.425)*POW(2.54*@HT,.725)POW
6. ANY(@TEST) or #@TESTLooking to see if test has been resulted ANY(@AUER)?@BLAST +" @LEUK":@BLAST Same as #@AUER?@BLAST + " @LEUK" :@BLASTANY
7. MATCH( "what" , where )Can use wild card *MATCH("< *",$@NA)||MATCH("<*",$@CL)||MATCH("<*",$@CO2)||MATCH(">*",$@CO2) ? "@GAP" : @NA-(@CL+@CO2)MATCH
8. GETDBF("field")->DBFLD (stop using this on 4.0 lines!)Available fieldsSexRaceAgeFlags (Received, Verified, Panic etc.)Many more...GETDBF
9. GETDBF("SEX")=="F"? @TESTO+" @CM":@TESTO GETDBF
10. (@CREAT->"AGE")/365.25) -> (Test Access Operator)
11. “->” can be used in conjunction with “FLG” function to look at Result FlagsFLG("PHXH") & @NA->"AFLAGS2"?@NA + " @LINE" : $@NAFLG
12. FLG("PHXH") & @NA->"AFLAGS2"?@NA + " @LINE" : $@NAFLGFlagRE codePanic lowPLPanic highPHPanic (alpha results)combination of panic low and highPAbnormal lowLAbnormal highHAbnormal (alpha results)combination of low/highABFlagRE codeDelta, percent%DDelta, absoluteaDAbsurd lowXLAbsurd highXHAbsurd (alpha results)combination of low/highXAll but normal
13. (@@NA&130) ? @NA + " @LINE" : $@NAResult Flags using @@TSTFlagValuePanic low1Panic high2Panic (alpha results)combination of panic low and high3Abnormal low4Abnormal high8Abnormal (alpha results)combination of low/high12FlagValueDelta, percent16Delta, absolute32Absurd low64Absurd high128Absurd (alpha results)combination of low/high192All but normal207
14. $N:=@FISH+10; @FISH>30?@FISH: (@FISH<10? $N*2+" @LIE": $N+ " @LIE“)One letter code to represent a calculationUseful in long calculations or when the same expression is used multiple timesVariables
15. $A:=(@CREAT->"AGE")/365.25);$A<1? @TST + " @CM1":($A>=1 && $A<18? @TST + " @CM2": @TST)Variables
16. When can Calculations look at previous results from different orders?When written in Canned MessagesWhen written in Test SetupWhen written in RBS RulesNever
17. 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 (includes current order)@TEST[-2]Search back 2 hours for numeric result of TEST (includes current order)@TEST{1}[2]Search back 2 days for numeric result of TEST but skip current orderTime Frames
18. $@ACOAG[2]=="HEPARIN"? @PTI+" @HEP":($@ACOAG[0]=="COUMADIN"? @PTI+" @COUM": @PTI)Time Frames
19. Every time you go into Edit Mode, calculated results will RECALCULATE!Verified results that Recalculate, will generate an RMOD (corrected result)!Preserving Historical Data
20. 2 ways to keep historical data safe!GETDBFGETDBF("ACCDATE")MESEXPDATEPreserving Historical Data
21. GETDBF("ACCDATE")<20060905? $@TEST :"New Calculation"GETDBF("ACCDATE")<20070830? "Old Calculation":"New Calculation"GETDBF
22. MESEXPDATE
23. Occurs when trying to calculate a test based on its own results...Looping
24. 4 TypesCyclic dependenciesChange precision Absolute Expression Keep adding canned messageLooping
25. ProblemTest HGB contains calculation... @HGB/3Cyclic dependencies
26. SolutionsBuild a new testHGBIHGB (reportable)@HGBI/3Add @L(@HGB/3)+" @L"Cyclic dependencies
27. ProblemAlphanumeric Test contains calculation@VZV>0.8 && @VZV<1.1? @VZV+"@EQU": @VZV .25 becomes 0.250000 Changing Precision
28. SolutionBuild the test as NumericAdd @L@VZV>0.8&& @VZV<1.1? @VZV+" @EQU" +" @L":$@VZV+" @L"Changing Precision
29. ProblemNumeric Results changed to Alphanumeric @TST>5?"POSITIVE": "NEGATIVE" Result will always be NEGATIVE Absolute Expression
30. SolutionsBuild a new testTSTITST (reportable)@TSTI>5?"POSITIVE": "NEGATIVE"Add @L@TSTI>5?"POSITIVE"+" @L": "NEGATIVE"+" @L"Absolute Expression
31. Problem$@ACOAG=="COUMADIN“? $@PTI+"@COUM": ($@ACOAG=="HEPARIN"?$@PTI+“ @HEPA": $@PTI)Continuously Adding Canned Messages
32. SolutionMATCH MATCH("*@*",$@PTI)? $@PTI: ($@ACOAG=="COUMADIN"?$@PTI+" @COUM": ($@ACOAG== "HEPARIN"?$@PTI+" @HEPA":$@PTI))STRSTR STRSTR($@PTI,"@")>0?$@PTI: ($@ACOAG == "COUMADIN"?$@PTI+"@COUM": ($@ACOAG =="HEPARIN"?$@PTI+"@HEPA":$@PTI))Continuously Adding Canned Messages
33. 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!!!
34. Complex Examples
35. $F:=GETDBF("SEX")=="F"?0.742:1; $B:=GETDBF("RACE")=="B"?1.21:1);$X:=186*POW(@CREAT,1.154)*POW((@CREAT->"AGE"/365.25),-0.203) *$F*$B;$X>60?">60":$XGFR
36. $F:=(GETDBF("SEX")=="F"?0.742:1); $B:=(GETDBF("RACE")=="B"?1.21:1);$A:=(@CREAT->"AGE"/365.25);$V:=186* POW(@CREAT,-1.154)*POW($A,-0.203)*$F*$B;$X:=$V>60?">60":$V;$A<20?$X:(($A>=20 && $A<30) ? $X + " @AV20" : (($A>=30 && $A<40) ? $X + " @AV30" : (($A>=40 && $A<50) ? $X + " @AV40" : (($A>=50 && $A<60) ? $X + " @AV50" : (($A>=60 && $A<70) ? $X + " @AV60" : (($A>=70) ? $X + " @AV70" :$X)))))),$XMore complex GFR
37. Test ALL possible answersCombat loopingDon’t cut and paste from emails or Word - Use NotepadTips…
38. Questions?nicholas@softcomputer.com