Harry,
here's a copy of a KB article that should help.
Alan Miller
=======================================
Article ID: 17231
Date: 9/25/2003
Published: 1/26/2004 Application: RW
Subject: Report Writer
Platform: MAGIC
Strip Trailing Zeros
To strip trailing zeros from field output you should employ the Z program
Z.strip.trailing.zeros in a computed field where VALUE represents an argument
field, calculation, or variable:
DAT=FREE
LEN=10
VAL=%Z.strip.trailing.zeros(VALUE)
IF VALUE: RETURNS:
345.0900 345.09
88.000 88
79.50 79.5
62.00003 62.00003
43,000 43,
2000 2000
NOTE: The Z.strip.trailing.zeros program will NOT strip trailing zeros from
whole numbers (see 2000 above) but will do so if the value stored is of
DAT=FREE and the comma is in place for thousandths (see 43,000 above). This
utility is intended mostly for stripping excess zeros in decimal values. This
program will also strip decimal points that are only followed by zero (see
88.000 above).
>>> "Rianto, Harry" <[EMAIL PROTECTED]> 10/17/2006 11:50 >>>
All messages should be posted in plain text. HTML will be converted to
attachments. The meditech-l web site is MTUsers.com
======================================
We are planning to use KB#16328 (Dose Calculation for Amount to
Administer) for our Pharmacy label but we have an issue as the result of
the printout has decimal zero which can cause read error on the
interpretation fo the label. Anyone know how to suppress this zero?
eg. 3.00 MLS should be 3 MLS
3.50 MLS should be 3.5 MLS
3.25 MLS should be 3.25 MLS
Thanks you for all help.
Harry Rianto
Bluewaterheatlh.
The macro and the explanation is as below (from the KB):
Recently, we had a request from a hospital to display the dose
calculation on their MAR (Medical Administration Record) of the amount
of a drug to be given. For example, Furosemide 10 MG/ML. If the
patient is to get 40 MG, then the amount to be calculated is to be 4 ML
(that will be displayed on the MAR). In addition, if we have a drug
(for example Acetazolamide 250 MG Tab) and we order 250 MG, the MAR will
need to display 1 TAB. Or, for the same drug, if we ordered 500 MG,
then the MAR will need to display 2 TABS.
In 4.9, the standard field "combo.dose.and.unit" can be used to convert
those drugs with the ratio of MG/ML as their strength. However, this
standard field will not convert for drugs that are not built that way in
the Drug Dictionary (such as Acetazolamide 250 MG Tab). To carry this
further, we must reproduce the standard program in a macro and add our
own code to do the additional conversion.
In this example, we will call our macro "get". The code would be setup
as:
A^urn,
@med^MED,
""^CNV,
[EMAIL PROTECTED] @CONVERT.COMBO},
IF{(@order.type's.type="MED")&('CNV) @GET.DOSE}, CNV;
SHOULD.CONVERT.COMBO
[EMAIL PROTECTED]'s.type'="MED" "";
@NOT.COMBO "";
@SAME.DISPENSE.FORM "";1}
NOT.COMBO
L(@PHA.DRUG.strength[MED]^XX,"/")=L(XX)
SAME.DISPENSE.FORM
@[EMAIL PROTECTED]
CONVERT.COMBO
(@dose:6D/@[EMAIL PROTECTED]:4D+0
):2D^XX,
(XX_" "[EMAIL PROTECTED]'=1:2D "S"})^CNV
GET.DOSE
(@dose:6D/@PHA.DRUG.strength.amt1[MED]:4D+0):2D^XX,
(XX_" "[EMAIL PROTECTED]'<1.01 "S"})^CNV
Like the standard program, we first check to see if a conversion can be
done in the submacro "SHOULD.CONVERT.COMBO". If the conversion can be
done, then we perform the calculation in "CONVERT.COMBO" (converting 40
MG/4 ML to 4MLS). If the conversion cannot be done (i.e., the variable
CNV does not have a value), then we check to see if the order type's
type is set to "MED". If it is set to "MED" and CNV is set to nill,
then we call the sub-macro "GET.DOSE" to do that conversion (creating 1
TAB or 2 TABS).
We can then call our macro from a computed field. In this example, our
report's name is "PHA.RX.zcus.npr.example.dose". The computed field
would be setup as:
DAT=FREE
LEN=10
VAL=%PHA.RX.zcus.npr.example.dose.M.get(urn)
_______________________________________________
meditech-l mailing list
[email protected]
http://mtusers.com/mailman/listinfo/meditech-l
======================================
All messages should be posted in plain text.
HTML will be converted to attachments.
The meditech-l web site is MTUsers.com
______________________________________
meditech-l mailing list
[email protected]
http://mtusers.com/mailman/listinfo/meditech-l