Hi, This is a great start to the solution... But the problem is my chart is based on the solid .x0 or .x5 rounding's... This will help me to boost the number but not round to these ranges which are stored in my table.
For Example... My R calculation is .14 if I add 0.005 to it and then truncate to 2 digits I get .15, which is good... But if I have .18 and Add 0.0005 I and round to 2 digits I get 0.19 which is not a valid lookup... I now need to boost this number from the .19 value either up or down to my table chart of .15 or .20 (which in this scenario would be .20). Anyone out there have any other neat math tricks or MEDITECH routines (NPR Z or $T programs - since we are a Magic Site) to get me rounded up correctly to the next hundredth position? Thanks for anything you can offer! Damian A Shepard Systems Analyst Information Systems Telephone: (802) 447-5165 -----Original Message----- From: McGaw, Douglas [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 03, 2007 12:40 PM To: Shepard, Damian; MeditechL Subject: RE: [MEDITECH-L] Mathematical Rounding in NPR My recommendation: Take the numbers that you get in 2 decimals and use a computed variable to recompute them. You'll need to add .05 to adust for rounding up and then show only the 1 decimal number. Let's say you have @variable that produces 0.49; you'll want to do this to it: xx.var1 DAT=DEC1 LEN=4 [EMAIL PROTECTED] The result will be 0.54, but - since you only see one decimal - you'll get 0.5. An original number of 0.52 will end up as 0.57, but will still show as 0.5. As for passing the rounded result into an array, I'd think you want to take the original values and compute on them, and then use the above logic to bring the result down to one decimal. I may be wrong on this, and I'll defer to Joe Cocuzzo or another guru to answer that. Douglas B. McGaw Newman Regional Health 1201 W. 12th Ave. Emporia, KS 66801 [EMAIL PROTECTED] 620-343-6800 x 1130 fax: 620-340-6799 -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shepard, Damian Sent: Tuesday, July 03, 2007 10:22 AM To: MeditechL Subject: [MEDITECH-L] Mathematical Rounding in NPR Hi Folks, It's been a while since I've needed to do some mathematical rounding with NPR, but I'm hoping folks can help... Right now I have a matrix that I built in a NPR Macro that looks like the following visually: | |MIN) (MAX) |40.0 45.0 50.0 ... 110.0 ------------+-------------------------------- (MIN) 0.20 |0.8 0.9 1.0 ... 1.9 0.25 |0.8 0.8 0.9 ... 1.8 0.30 |0.7 0.8 0.9 ... 1.7 .... |... ... ... ... ... (MAX) 0.80 |0.3 0.4 0.4 ... 0.6 | (For those of you who recognize this it is the PCR conversion table for Renal Dialysis...) What I need to do is from data on my report, where the left hand column reads 0.20, 0.25, etc I need to convert number which presently list out on the report like: 0.17, 0.29, 0.22, 0.14, 0.4 etc Up to meet one of these numbers... So rounding up or down to match doesn't really matter as long as we can get to one of the numbers that I have stored based on the human logic chart above. Similarly, I need to take a different number and so that it matches the logic to one of the ones across the top... Once I have the rounding done, I can pass these rounded values into my matrix via and get out the associated value... So If I can get my regular report values rounded I can then pass them into the system like: /PCR[ROUND1,ROUND2]^/DISPLAY Anyone have any neat rounding tips lying around that you might be able to send along to me? Damian A Shepard Systems Analyst Information Systems Southwestern Vermont Medical Center 100 Hospital Drive Bennington, VT 05201 Phone: (802) 447-5165 DISCLAIMER: The information contained in this electronic message is legally privileged and confidential under applicable law and is intended for a particular addressee(s). If it is not clear that you are the intended recipient, you are hereby notified that you have received this transmittal in error; any review, copying or distribution or dissemination is strictly prohibited. If you suspect that you have received this transmittal in error, please notify Southwestern VT Health Care Corporation immediately by return email reply to ([EMAIL PROTECTED]), and immediately delete the transmittal and any attachments without making any copy or distribution. Thank you. =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= To subscribe or unsubscribe to the meditech-l, visit http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com To check the status of the meditech-l, visit MTUsers.NET For help, email [EMAIL PROTECTED] Please visit and add information to the MTUsers WikiPedia at MTUsers.NET/mwiki ______________________________________ meditech-l mailing list [email protected] http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com DISCLAIMER: The information contained in this electronic message is legally privileged and confidential under applicable law and is intended for a particular addressee(s). If it is not clear that you are the intended recipient, you are hereby notified that you have received this transmittal in error; any review, copying or distribution or dissemination is strictly prohibited. If you suspect that you have received this transmittal in error, please notify Southwestern VT Health Care Corporation immediately by return email reply to ([EMAIL PROTECTED]), and immediately delete the transmittal and any attachments without making any copy or distribution. Thank you. =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= To subscribe or unsubscribe to the meditech-l, visit http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com To check the status of the meditech-l, visit MTUsers.NET For help, email [EMAIL PROTECTED] Please visit and add information to the MTUsers WikiPedia at MTUsers.NET/mwiki ______________________________________ meditech-l mailing list [email protected] http://mtusers.com/mailman/listinfo/meditech-l_mtusers.com
