Calculations Basic James R Pomicter BS MLSASCP jamesposoftcomputer
Calculations - Basic James R. Pomicter, BS, MLS(ASCP) jamespo@softcomputer. com
This presentation will address the following: What Can Calculations Do Where To Write Calculations How To Write Basic Calculations
What Can Calculations Do Automatically result a test using results from other tests BUN/CREAT ratio Calculate corrected WBC based on NRBC’s Cancel a test ". " Attach interpretive comment to a result " @MESG"
Where To Write Calculations Individual test 240 characters RBS 255 characters Multiple time frames Can be used conditionally Canned messages >240 characters ID entered in individual test or RBS as <<CMSG>>
How To Write Basic Calculations Use Only Individual Tests when evaluating result level All tests included in calculation must be in the same order number [Except RBS rules] Best Practice: Do NOT use special characters in Test ID
Calculations Basic Math – Algebra Level
Syntax - Operators
Follow the Syntax @ = Numeric result Example: @GLU reads as “Numeric result of test GLU” BUN/CREAT Ratio @BUN/@CREAT Use Parenthesis when needed @LYMPT - (@WBCX/100) Straight quote marks Only - typically used to specify alphanumeric characters in a result field. "POSITIVE" " @CANN" Should use straight "quotes" Not “quotes” or “quotes” Be careful when Copying and Pasting from Word or e-mails because these will use a different style of quotation marks, e. g. , - “quotes”. Write the Calculations inside the application or use Notepad if you want to Copy/Paste
Calculations - Common 1. True/False ? = If this is true : = Otherwise do this If this happens ? Then do this : Otherwise do this Condition ? Command if true : Command if false @DIG<0. 2? "NONE DETECTED": @DIG<0. 2? "<0. 2": @DIG If the numeric value of DIG test is less than 0. 2, and that is True, result NONE DETECTED. Otherwise result the numeric value of DIG.
Numeric Test With An Alphanumeric Result @DIG<0. 2? "<0. 2 " : @DIG What if DIG results >5 also need to be converted to report as ">5" ?
We Need More Syntax We need to string together “If This is True/Otherwise Do This” expressions Keep in mind: For every true statement we MUST have and Otherwise statement ? = If this is true : = Otherwise do this @DIG<0. 2 ? "<0. 2" : (@DIG>5. 0? ">5" : $@DIG) $@DIG = the Alphanumeric result of DIG at the end of the calculation ensures that any alphanumeric result in the result field will be maintained e. g. 2. 2 @CONF
String Multiple True/False Conditions 1 1 2 @SWEAT=40? @SWEAT+" @SWTN": (@SWEAT=60? @SWEAT+" 2 3 3 @SWTP": (@SWEAT=80? @SWEAT+" @SWTQ": @SWEAT+" @SWTB")) TIP Count all of your Open Parentheses and make sure you have the EXACT same number of Closing Parenthesis @FHGBR>=0. 0000&&@FHGBR<=0. 0045? "1": (@FHGBR>=0. 0046&&@FHGBR<0. 0091? "3": (@FHGBR>=0. 0091&&@FHGBR<0. 0136? "4": (@FHGBR>=0. 0136&&@FHGBR<0. 0181? "5": (@FHGBR>=0. 0181&&@FHGBR<0. 0226? "6": (@FHGBR>=0. 0226&&@FHGBR<0. 0271? "7": (@FHGBR>=0. 0271&&@FHGBR<0. 0315? "8": "Not Indicated"))))))
Need More than 1 Condition to be True && = AND = expressions/ conditions on Both sides of the && symbols must be met for the expression to be True @HGB<5 && @HCT<20? "BAD" : "GOOD“ Only if the result of the HGB is less than 5 AND the result of the HCT is less than 20 will the word BAD be placed in the result field of this test. Otherwise, if either of these are not true, will the word GOOD be placed in the result field.
Need Only 1 Condition to be True || = expression/ condition on Either side of the || symbols must be met for the expression to be True $@UCOLR=="Brown" || $@UCOLR=="Red" || $@UBLD == "Trace-intact" || $@UBLD == "Trace-Intact" || $@UBLD == "TRACE-INTACT" || $@UBLD == "Trace-lysed" || $@UBLD == "Trace-LYSED" || $@UBLD == "1+" || $@UBLD == "2+" || $@UBLD == "3+" || $@ULEU == "Trace" || $@ULEU == "1+" || $@ULEU == "2+" || $@ULEU == "3+" || $@UNIT == "Positive" ? "See Microscopic" : "Not Indicated"
Is the Test ID Resulted On The Order? ANY() or # = Looking to see if test has been resulted ANY(@AUER)? @BLAST +" @LEUK": @BLAST Same as #@AUER? @BLAST + " @LEUK" : @BLAST Creatinine Clearance with no correction for BSA and assuming a 24 hour collection #@CREAO? ((@UCRE 1*@UVOL)/(@CREAO*1440)): ((@UCRE 1*@UVOL)/(@CREAN*1440))
Serial Tests – Lactic Acid Setup a Series test to include as many Lactic Acid draws as needed and set them to be drawn X hours apart. My example is set to have a subsequent LA drawn 3 hours after the first. You must build a unique Test ID for each Lactic Acid you want to order/draw e. g. LA, LA 3 • LA = Already built Lactic Acid test ID • LA 3 = new test created for 3 hour Lactic Acid. [MUST be assigned a different Tube type built/assigned to this test from the original LA] • Calculation on new LA 3 test should be @LA<=2. 0? ". ": @LA 3
Serial Tests – Lactic Acid Combine those individual test ID’s into a Group test. (SERIES TEST must be checked)
Examples Calculated Osmolality 9+(1. 86*@NA)+(@GLU/18)+(@BUN/2. 8) [Used on UBIL Test ID] $@ICTO=="Negative"? "Negative"+" @CNF": (@ICTO=="Result Required"? "Result Required": @UBIL) [Used on ICTO Test ID] $@UBIL != "Negative"? "Result Required": $@ICTO [Used on OVERD Test ID] ( (@ACETM > 50) && (@H > 500) ) || ( (@ACETM > 30 && @ACETM < 50) && (@H > 250) ) || ( (@ACETM > 15 && @ACETM < 30) && (@H > 40))
Calculation Addition and/or Modification In a post-live environment, it becomes important to protect historical data. Care must be taken when modifying calculations so that old results are not affected. There are three options to preserving historical information:
Calculation Addition and/or Modification Option #1 1. Create a new test and inactivate the old test.
Calculation - Addition Option # 2 With a command, tell the system to only perform the calculation before or after a specified date. The GETDBF function works well in this situation. Example: 1. Because of a new methodology, all Vitamin D (VITD) instrument results must be multiplied by. 04 2. The new methodology will take place on December 1, 2010 3. It was been decided to retain the original test ID, so a calculation will be entered in VITD to only perform the calculation after the specific date. GETDBF("ACCDATE")<20180101? $@VITD: @VITD*0. 04 In the calculation the date format must follow YYYYMMDD TIP – Build your Calculation as a Canned Message…you’ll be glad you did if you ever need to change it . Place the following in the Calculation field of the Individual Test. <<CANMG>> This calculation looks at the order collection date (ACCDATE) and if it’s before 01/01/2018, the result will stay the same. If it’s after that date, the result will be multiplied by. 04
Calculation - Modification Option #3 Use the expiration date functionality in the Canned Message setup file. Once the calculation is entered into a Canned Message then the Canned Message ID is entered in the Individual Test calculation field. When the Canned Message ID is entered into the calculation field, it must be in a specific syntax so that the individual test evaluates the expiration date field of the Canned Message. MESEXPDATE("CMID", GETDBF("ACCDATE")); <<CMID>>
Preserve Historical Data MESEXPDATE(<expr 1>, <expr 2>) Checks the expiration date for the canned messages used in the calculation where <expr 1>returns the code of the message <expr 2> returns the date according which program will search for the message. Example: MESEXPDATE("MES", GETDBF(ACCDATE")); <<MES>> This calculation is using function MESEXPDATE, which is looking at the canned message expiration date for message “MES” and comparing it to the order collection date (ACCDATE).
Easy Steps To Follow 1. Create a Canned Message (Type=Other) with the OLD calculation. 2. Expire this Canned Message. 3. Create a NEW Canned Message calculation, using the OLD canned message ID (The Canned Message ID’s will be the Same) 4. Enter the new calculation. This Canned Message will NOT be expired as the old one was. Save the message. 5. Place the new canned message ID in the calculation box of the Individual test following the format below. MESEXPDATE("MES", GETDBF(ACCDATE")); <<MES>>
Create a Canned Message (Type=Other) with the OLD calculation. Expire this Canned Message
1. 2. 3. Create a NEW Canned Message calculation, using the OLD canned message ID (The Canned Message ID’s will be the Same) Enter the new calculation. This Canned Message will NOT be expired as the old one was. Save the message
Don’t Forget About The Translation Table
Test Maintenance
Don’t Forget About The Values Tab
Questions ? ?
- Slides: 30