Footnote:AL D IF{'DATE @pay.date^DATE}
Computed field: xx.first.date
DAT=DATE
LEN=8
VAL=DATE
Line attribute on the line with the computed field: ECE=""^DATE
@acct.number^/R.ACN,
%Z.rw.fragment("ABS.PAT.zcus.jfb.ss02.frag.get.pdx.R","ABS.NCH"), MOVE(/R.FRAG.VAL,/MUSE),
@acct.number^/R.ACN,
%Z.rw.fragment("BAR.PAT.zcus.jfb.ss02.frag.get.bal.R","BAR.NCH")
Explanation of macro - Notice comma after each line except last line.
1) /R. Recommended format to store info.
2) @acct.number^/R.ACN, - Takes account number and stores it into /R.ACN
3) Calling Frag %Z.rw.fragment("ABS.PAT.zcus.jfb.ss02.frag.get.pdx.R","ABS.NCH"),
%Z.rw.fragment = Z routine to call fragment4) MOVE(/R.FRAG.VAL,/MUSE), Very important - Note the macro starts another fragment. Within each fragment is the code /R.FRAG.VAL. When another fragment is started, any previous value stored in /R.FRAG.VAL is erased. The above code saves that value into /MUSE[SUBSCRIPT]. In this example it ends up being VAL=/MUSE["PDX"]
%Z.rw.fragment("ABS.PAT.zcus.jfb.ss02.frag.get.pdx.R","ABS.NCH") = Name of report that is a fragment and database where info is stored.
Note: Report name and data base both in quotes
Note: ".R" at the end of report name
Note: "," used to separate report from database
Note: Parenthesis enclose ("reportname.r","database")
** If desired ** Instead of using MOVE command, could use: /R.FRAG.VAL["PDX"]^/PDX (Value in computed field would be: VAL=/PDX
5) 2nd Fragment: Second fragment is started. note, last line - no comma.
| xx.balance | = [COMMA=Y, DAT=SMONEY, JFY=R, LEN=10, VAL=/R.FRAG.VAL["BAL"]] |
| xx.total | = [COMMA=Y, DAT=SMONEY, JFY=R, LEN=10, VAL=/R.FRAG.VAL["TOT"]] |
| xx.bar.adt | =[DAT=DATE, JFY=L, LEN=8, VAL=/R.FRAG.VAL["ADT"]] |
| xx.pdx | =[DAT=FREE, JFY=L, LEN=6, VAL=/MUSE["PDX"]] |
IF{XX;
1^XX,
%Z.rw.fragment("PP.PER.zcus.hab.frag.mis.user.fast.R","PP.NCH")}
Note: The report also needs to be modified. It has an extra select and custom field
xx.flag
xx.flag EQ
"Y"
Note- Fragment report select contains a LI !!
1 xx.emp.initials LI
/R.INIT
Macro in fragment - The values are then stored into a value that is subscripted.
@sort.name^/R.FRAG.VAL[@cd.response["MIS.USER"],"NAME"]REG 0---------1---------2---------3---------4---------5---------6---------7----- TK2 dept___________ dept.name_____________________ txn. __txn.amount TK1 txn. __txn.amount
REG A 0---------1---------2---------3---------4---------5---------6---------7----- D dx_____ dx.name__________________________________________
1. version LS
"99"
2. xx.count GE
Minimum count
3 xx.date1 IG
Discharge Dates from
4 xx.date2 IG
Discharge Dates thru
Note: LS operator is last value in list. Current version in May 2002 is 19. Therefore, the report takes the last number
in the list that is less than 99.
1 pt.status EQ
"IN"
2 dis.date GE
/R.DATE1
3 dis.date LE
/R.DATE2
| Footnote | Function |
| AL | The AL footnote is used to incorporate logic into report object code at a point specified by a keyword. Format: {footnote}{space}{keyword}{space}{expression} |
| RC | The RC footnote is used to specify a condition which must be met in order for a record to be printed on the report.
This works similar to a select condition. Example 1: PBR.MPI.VIS.zcus.hab.dup.visits Full Report This report checks to see if a patient appears on a list more than once. It uses the code: xx.select EQ 1 and a footnote: RC /PT[@mpi.urn]. xx.select=VAL=IF{'/PAT[@mpi.urn] 1^/PAT[@mpi.urn];1^/PT[@mpi.urn];1} Example 2: NUR.RAI.zcus.hab.frag.last.mds.sch. Since client server, report not uploaded Report loops through all the patient's MDS reports. However, it returns the last one that meets the specified criteria. In this case, the last one that is not any of the values listed below. xx.last VAL=IF{""^AA8AF^AA8BF,@aa8a.primary.reason^AA8AF, VAL=@aa8b.special.code.reason^AA8BF=8 1; VAL=(AA8AF=4)!(AA8AF=6)!(AA8AF=7)!(AA8AF=8)!(AA8AF=9)!(AA8AF=10) 1; VAL=urn^/PAT[patient],1} urn is the MDS specific #. The code keeps looping through and replacing the urn value for the /PAT[patient] In the Selects, xx.last EQ 1 (Based on code, all patients return a value of 1). However, the footnote has a record check: RC urn=/PAT[patient] Therefore, the line only prints if the urn is the same as the last urn processed which was stored in the variable (met the criteria). Key points for example 2 1) The sort order must be changed. It can not be the index default sort order. This causes the report writer to process all the records before it starts to print. 2) The xx.last can not be placed on the detail line. Example 3: BAR.PAT.zcus.hab.hab.frag.ins.cov.dates.mds This report looks and find the last date that is less than the user inputed dated (brought from another report as /R.DATE xx.keep: VAL=IF{@zcus.l.ic.eff.date'>/R.DATE zcus.l.ic.eff.date^/DATE[account],1;1} Footnote: RC zcus.l.ic.eff.date=/DATE[account] Select: xx.keep EQ 1 If the date (zcus.l.ic.eff.date) is less than or equal to the /R.DATE, then put the date into an array with the account number as the subscript. Then output a value of 1. If the date isn't less, output a value of 1. Key point, the array is continually being overwritten by the next date that meets the criteria. If a patient does not meet the criteria, then the date isn't stored into the array. The RC in the footnote checks what is stored. The select is xx.keep EQ 1 is a way to keep the field and not print it on the report. The RC reads: if the zcus.l.ic.eff.date is the one that is stored in the array, print. |
| EFF | The EFF footnote is used to suppress the ending form feed on a report. This is used when downloading a report. The default is YES. Using EFF NO will suppress the formfeed. |
| SFF | The SFF footnote is used to suppress the starting form feed on a report. This is used when downloading a report. The default is YES. Using SFF NO will suppress the formfeed. The starting form feed can also be suppressed for all reports by setting N in the R/W STARTING FF parameter within MIS. |
| RL | The RL footnote is used set the record length on a report. This is used when downloading a report in conjunction with the new line (NL) line attribute. Allows for record lengths longer than the standard 200 CPL limit within NPR Report Writer. |
| FD | The FD footnote is used to define a field delimiter when downloading a report whose records are of variable length. The expression is the numeric value associated with the ASCII character. FD 59 will produce a record in which each field is delimited by a semi-colon. |
| MSEL | The MSEL footnote is used to specify select criteria for a multiple (a field from a child segment of the detail segment). Format:{footnote}{space}{data field}{space}{keyword}. See MEDITECH KB#4628 Footnote Format: MSEL @child.segment.field test.method.keyword Example: MSEL @allergy NONE Choices for keywords are either: ANY, NONE, ALL In the selects on page 2, the same field as after MSEL would appear (i.e. @allergy EQ "WORK" ANY - the parent record is selected if ANY of its child records pass. - Any have work NONE - the parent record is selected if NONE of its child records pass. - Non have work ALL - The parent record is selected if ALL of its child records pass. |
| GR | The GR footnote is used to establish a graphics template for the report. This footnote is not needed as graphics are defined within the line attributes. |
| Keyword | Where Macro Code is Inserted |
| START | At the beginning of the program, prior to any selections being performed. |
| After the printer has been opened. Must be at the 4.6 release and have NPR Change 89. | |
| SKn | (e.g. SK1 = Sort Key 1) After the looping code has been generated for the specified sort key. Note the difference between HKn (region.name) and SKn. With HKn, if no detail records are found for a sort key, the HKn region is not printed and the macro logic is not performed. Alternatively, with SKn, the macro logic is performed for every occurrence of the sort key, regardless of whether any detail records exist. |
| AFTER.GET.MAIN | After the detail segment has been processed, but before multiples have been processed. |
| BEFORE.PRINT | After all data has been gathered, records have been selected and multiples have been processed. |
| region.name | (e.g. D, HK1, TR, etc.) Just before the lines in the associated region are printed. |
| AFTER.region.name | (e.g. AFTER.D, AFTER.HK1, AFTER.TR, etc.) After the lines in the associated region are printed. |
| CLOSE.UP | After the report has been printed, but before Z.rw.close.up has been executed, and the prefixes are closed. |
| Detail DPM | PHA.RX | Detail Segment | pha.rx.file | |
| Index DPM | PHA.RX | Index File | pha.rx.start.date.x |
| Detail DPM | BAR.PAT | Detail Segment | bar.acct | |
| Index DPM | BAR.PAT | Index File | bar.acct.discharge.date.index |
| Detail DPM | PHA.RX | Detail Segment | pha.rx.file | |
| Index DPM | PHA.RX | Index File | pha.rx.start.date.x |
| Attribute | Description | Function | Format |
| LC | Line Check | Conditional Printing of Line | LC=expression |
| LCR | Line Check Range | Conditional Printing of Range of Lines | LCR=expression |
| LS | Line Space | Generate Blank Line(s) | LS=number of blank lines (1-50) |
| NL | New Line | Suppresses the Generation of a New Line | NL=NO |
| PG | Page Break | Generates a Page Break when the number is greater than the number of lines left on the page | PG=number |
| MCON | Multiple Condition | Conditional Printing of Multiples | MCON=segment,expression If all multiple data fields exist in the same segment, an asterisk (*) can be used for the segment. Otherwise, the internal name of the segment should be specified. |
| MWM | Multiples-Within-Multiples | Allows the Printing of Multiples from Grandchild Segments | MWM=data field from grandchild multiple |
| ECB | Extra Code Beginning | Inserts a Line of Code Before the Printing of a Line | ECB=expression |
| ECE | Extra Code End | Inserts a Line of Code After the Printing of a Line | ECE=expression |
| MV | MV Array | Used in the Printing of Values from a /MV Array | MV=mv name The mv name is the first subscript of the MV array |
| BX | Box | Draws Boxes Around Portions of the Report | BX=argument The arguments are W - WHITE, G - GRAY and END. The box will begin in the middle of the line it is placed and therefore should be placed on a blank line. Boxes begin one character to the left of the left margin and end one character to the right of the right margin. If you begin a second box without ending the current box, the current box is automatically closed before the new box begins. | ||||||||
| FF | Field Font | Defines the Font in which Data Fields Print | FF=font type The font types are:
| ||||||||
| GB | Gray Bar | Establishes Alternating Gray Bars on a single report picture line. | GB=first color The colors are W - WHITE and G - GRAY | ||||||||
| GBR Gray | Bar Range | Establishes Alternating Gray Bars for a Range of Lines | GBR=first color The colors are W - WHITE and G - GRAY. END is also valid to end the gray bar range | ||||||||
| GH | Gray Highlights | Highlights a Portion of a Report Line | GH=Bn,Dn,column,length,Bn,Dn,column,length,...
| ||||||||
| HL | Horizontal Line | Draws a Horizontal Line Across the Report | HL=density (an integer, 1 being the thinnest) | ||||||||
| PF | Prompt Font | Defines the Font in which Free Text Prints | PF=font type The font types are:
| ||||||||
| US | Underscore | Underscores a Portion of a Report Line | US=column,length,column,length
| ||||||||
| VL | Vertical Line | Draws a Vertical Line(s) | VL=density,column,column,.... density (an integer, 1 being the thinnest), the columns define where the vertical line will be placed (decimals are allowed). This attribute can only be used if a BX attribute is defined on the same line. VL=END is used to end the vertical line. |
| Field Attributes | Description | Function |
| DAT | Data Type | Defines the output format of the field. |
| DEC | Decimal | Overrides the default number of decimal places of the Data Type. |
| JFY | Justify | Indicates the justification within the field length (L, R, or C). |
| LEN | Length | Defines the length of the field's output. |
| FONT | Font Graphics | Defines the graphic font (bold, italic, etc.) of the field's output. MEDITECH Standards: B (bold underlined), b (bold), I (italics underlined), i (italics), N (normal underlined), n (normal) Note The values B, b I, i, are variables. User can overwrite those variables or make own variable. The key is the system knows when user puts FONT=b, It is interpreted as /R.F["b"] Example - Print medication schedule as bold if med's control schedule = 2 DAT=FREE FONT=BOLD LEN=4 VAL=IF{@med's.schedule="2" /R.F["b"]^/R.F["BOLD"],@med's.schedule; VAL=/R.F["n"]^/R.F["BOLD"],@med's.schedule} In this example. FONT=BOLD is a variable. If the med's schedule = 2, then /R.F["b"] is written into the variable BOLD, otherwise the normal font is written into the variable BOLD. |
| SIZE | Font Size | Defines the characters per inch in which the field is displayed. |
| COMMA | Comma | Adds commas to numeric fields: COMMA=Y |
| Field Attribute | Description | Function | |||||||||||||||||||||||||||
| CON | Condition | Defines a condition which must be met in order for the fields value to print. | |||||||||||||||||||||||||||
| FNC | Function | Specifies the function of the field.
| |||||||||||||||||||||||||||
| RLOG | Report Logic | Used to perform logic at the time a standard field is retrieved from the database. | |||||||||||||||||||||||||||
| VAL | Value | A computed/virtual field's output value. | |||||||||||||||||||||||||||
| WITH | With | Changes the region in which a statistical field gets evaluated. Example 1 PBR.MPI.VIS.zcus.hab.charges.by.visit.type.no.d Full Report
DAT=SMONEY, FNC=TOT, JFY=R, LEN=10
VAL=IF{0^TOT,""^vt.urn,DO{@Next(vt.urn) @vt.total.amount+TOT^TOT},TOT}
WITH=D
Example 2 LAB.L.SPEC.zcus.hab.glucose.er.sdc.rad Full ReportThis report looks glucose lab results > 160. However, it only counts 1 per person (even if they had multiple results >160). Uses WITH=HK2 because the 2nd sort is patient's.name. Note FNC=TOT FLD=xx.patients, DSP=xx.pa ,DAT=INT, FNC=TOT, JFY=R, LEN=7, VAL=1, WITH=HK2 | |||||||||||||||||||||||||||
| PRT | Print (Y/N) | Used to suppress the printing of a computed field on a report: PRT=N | |||||||||||||||||||||||||||
| GRP | MIS Group Response | Gives the ability to use a MIS group response to limit possible entries
a user can enter. Computed field: xx.room.bed - This field compares patient room to users desired room. Also see select DAT=FREE GRP=ROOM.BED (This is from the MIS Group Response Dictionary. In that dictionary each room is listed as a mnemonic: 203-1, 204-1) JFY=L LEN=10 VAL=@patient's.room.bed Select
xx.room.bed LI
Room-bed (Example: 203-1)
When user runs report, they can press the F9 key and get a lookup of all rooms and beds that were make in the MIS Group Response Dictionary. |
+ Steps forward through data structure (Logical Next), - Steps backwards through data structure
*** Need to use "internal name" ***
Index Name/Internal Name/Detail Seg Physical Base/Subscripts/Detail Segment Internal Name
------------------------------------ ---------------------------------------------------
pha.drug.dict.generic.index &TFG[tdg,tf] = active
generic.x [generic,mnemonic]
pha.drug.dictionary main
Code:
VAL=IF{+@PHA.DRUG.generic.x[mnemonic,XXX] "Y"}
Important: The [mnemonic] above is referencing the Generic Name mnemonic in PHA.GENERIC dictionary
(mnemonic in PHA.Generic = generic in PHA.DRUG).
mnemonic 10 FREE L tdg
It is being used to seed the [generic,mnemonic] subscripts in the pha.drug.dict.generic.index.
Report: BAR.PROC.zcus.hab.proc.exploded.chgs.by.mnemonic
DAT=SMONEY
FNC=TOT
JFY=R
LEN=10
VAL=IF{0^TOT,""^vt.urn,DO{@Next(vt.urn) @vt.total.amount+TOT^TOT},TOT}
WITH=D
IF{@enter.user^EU,""^PHA.ACCESS.mnemonic^P,
DO{@Next(PHA.ACCESS.mnemonic,PHA.ACCESS.main) ""^PHA.ACCESS.user,
DO{@Next(PHA.ACCESS.user,PHA.ACCESS.users) 1,
IF{@PHA.ACCESS.user=EU @PHA.ACCESS.pharmacist^P}}},P}
Above is formated as macro editor format places text.
""^PSC^IMM^DCVS^DCPS^DCRN^DCMD^DCUN^DCVS^TRRN^TRANS,
IF{""^ta.intervention,
DO{@Next(ta.intervention) 1,
""^ta.date,DO{@Next(ta.date) 1,
""^ta.time,DO{@Next(ta.time) 1,
""^ta.ctr,DO{@Next(ta.ctr) 1,
""^ta.query,DO{@Next(ta.query) IF{ta.query="EDMPS" @ta.value^PSC;
ta.query="EDMIMM" @ta.value^IMM;
ta.query="NURT" "T:"_@ta.value^DCVS;
ta.query="NURBP" DCVS_" BP:"_@ta.value^DCVS;
ta.query="NURP" DCVS_" P:"_@ta.value^DCVS;
ta.query="NURSAO2" DCVS_" O2:"_@ta.value^DCVS;
ta.query="EDMDCPAINS" @ta.value^DCPS;
ta.query="EDMINSTRN" @ta.value^DCRN;
ta.query="EDMINSTMD" @ta.value^DCMD;
ta.query="EDMINSTUN" @ta.value^DCUN;
ta.query="EDMNDCTRA" @ta.value^TRANS}}}}}}},
IF{"AATRIAGE4"^ta.intervention,
""^ta.date,DO{@Next(ta.date) 1,
""^ta.time,DO{@Next(ta.time) 1,
""^ta.ctr,DO{@Next(ta.ctr) @MIS.USER.name[@ta.user]^TRRN}}}}
Detail DPM BAR.PROC Detail Segment bar.proc.dict
Index DPM BAR.PROC Index File bar.proc.dict.dept.index
VAL=IF{@.today+1^std.effective.date,@Prev(std.effective.date),
VAL=@std.effective.date.charge}
Note: @std.effective.date and @std.effective.date.charge are multiples in a child segment of bar.proc.dict
@Prev Example 2
VAL=IF{"CPT-W/MOD"^alt.code.type,@.today+1^alt.code.eff.date,@Prev
VAL=(alt.code.eff.date),@alt.code}
Same report as above, however, this code looks into a grandchild segment:
SEGMENT: bar.proc.dict.alt.cd.eff.dates
SUBSCRIPTS: [mnemonic,alt.code.type,alt.code.eff.date]
Seeding is done with "CPT-W/MOD" - for the 2nd subscript (mnemonic is in the sort fields)
Date is also seeded (to look for the most recent date).
Detail DPM PHA.RX Detail Segment pha.rx.file
Index DPM PHA.RX Index File pha.rx.start.date.x
Data desired is in Child segment:
SEGMENT: pha.rx.transactions
SUBSCRIPTS: [urn,txn.date,txn.q]
VAL=IF{@First(txn.date)^txn.date,@First(txn.q)^txn.q,@txn.type.out}
(Field pulls the txn type name for 1st rx txn)
@First Example 2 | Keyword | Where macro is inserted |
| START | At the beginning of the program, prior to any slections being performed. |
| After the printer has been opened. | |
| SKn | (e.g., Sort Key 1) After the looping code has been generated for the specified sort key. Note the difference between HKn (region.name) and SKn. With HKn, if no detail records are found for the sort key, the HKn region is not printed and the macro logic isnot performed. Alternatively, the SKn, the macro logic is performed for every occurrence of the sort key, regardless of whether any detail records exist. |
| AFTER.GET.MAIN | After the detail segment ahs been processed, but before multiples have been processed. |
| BEFORE.PRINT | After all daata has been gathered, records have been selected and multiples have been processed. |
| region.name | (e.g., D, HK1, TR, etc.) Just before the lines in that region are printed. |
| AFTER.region.name | |
| CLOSE.UP | After the report has been printed, but before Z.rw.close up has been executed, and the prefixes are closed. |
Sort Field Order Header Traile 1 xx.name.form ASC NONE Y 2 mnemonic ASC NONE NPage 3
TK1 L xx.name.form______________________________________nt: count TR TR L xx.name_______________________ xx.cou TR L xx.name_______________________ xx.cou
Line Checks 1 LC="" 3 LC=1^NUM MV=TR 4 LC=NUM+1^NUM'>100 Explanation: Line 1, keeps the TK1 from printing, therefore only sorted summary prints Line 3 - Setting up name of MV array (TR) Line 4 - Limiting to 100 items (top 100)Fields Field #1 xx.name.form DAT=FREE JFY=L LEN=50 VAL=@name_" "_@dispense.form
IF{/V[2]>5 /V[2]^COUNT,
999999-COUNT_@name_@dispense.form^SRT,
/V[1]^/MV["TR",SRT,3],
COUNT^/MV["TR",SRT,4];""}
Macro Explanation: /V[2] is the 2nd field in the report (Z.count) The code says if count >5,
then proceed with rest of MV array, or else no data is processed in the MV array.
This works nice if you only want to see items that meet certain criteria.
The 999999-COUNT is a way of sorting from descending (highest to lowest)
This number will cause the sort. However, in case two drugs have the same
Z.count, the data overwrites. Therefore, concatonating data to make it unique is necessary.
This unique value is store in SRT.| Examples | Results | Explanation |
| 3+5.2 | 8.2 | 8.2 returned because 5.2 has most decimal places |
| 3.0-4.00 | -1.00 | 1.00 returned because 4.00 has most decimal places |
| 5.1*3.3 | 16.83 | 2 places returned because each had decimal point |
| 6.2/1.3 | 4 | 6.2 (1 place)/1.3(1 place) (1-1) = answer to 0 places (4) |
| 6.200/1.3 | 4.76 | 6.200(3 places)/1.3 (1 place) (3-1)= answer to 2 places (4.76) |
| 10\3 | 1 | 10/3 =3 With 1 left over |
| A | B | Logical Value | Logical Result | Physical Value | Physical Result |
| value | value | true&true | true | value&value | minimum value |
| value | nil | true&false | false | value&nil | nil |
| nil | value | false&true | false | nil&value | nil |
| nil | nil | false&false | false | nil&nil | nil |
| A | B | Logical Value | Logical Result | Physical Value | Physical Result |
| value | value | true!true | true | value!value | maximum value |
| value | nil | true!false | true value!nil | value | |
| nil | value | false!true | true | nil!value | value |
| nil | nil | false!false | false | nil!nil | nil |
| Example | Result | Explanation |
| 1<2 | 1 | The relationship is true since 1 is less than 2. |
| ""<2 | "" | (nil) Nil on the left always returns nil |
| 2'<1 | 2 | The relationship is true since 2 is greater than or equal to 1. |
| 1'<2 | "" | The relationship is false since1 is less than 2. |
| "B">"A" | B | The relationship is true since B is greater than A |
| Example | Result | Explanation |
| 123?3N | 123 | 123 has 3 digits and is being matched to 3 digits. Condition is true. |
| 123?4N | "" (nil) | 123 has 3 digits and is being matched to 4 digits. Condition is false. |
| 123?0N | 123 | 123 is made up of only digits and is being matched to digits. Condition is true. |
| 123.45?6M | 123.45 | 123.45 has 6 characters in the money format and is being matched to 6 characters in the money format. Condition is true. |
| 123.45?6A | "" (nil) | 123.45 has 6 characters in the money format and is being matched to alphabetic characters. Condition is true. |
| 123.?4D | 123. | 123. has 4 characters in decimal format and is being matched to 4 characters in decimal format. Condition is true. |
| "-123.45"?7D | -123.45 | -123.45 has 7 characters in decimal format and is being matched to 7 characters in decimal format. Condition is true. |
| 123.45?2NM | 123.45 | 123.45 has 6 characters in money format and matches 2 digits followed by any number of characters in money format. Condition is true. |
| 123.45?0NM | "" (nil) | 123.45 has 6 characters in money format is being matched to all digits followed by any number of characters in money format. After the pattern matches all digits, it does not leave any characters in money format. Condition is false. |
| Code | Definition |
| n | Repeat the left operand n times |
| nR | Right justify the left operand in a field of n spaces |
| nL | Left justify the left operand in a field of n spaces |
| nC | Center the left operand in a field of n spaces |
| nT | Truncate the left operand to n characters |
| nM | If the length of the left-hand operand is less than three, append leading zeroes to make the length equal to three. Then insert a decimal point before the right-most two characters and right-justify the result in a field of n spaces. |
| nD | Round a numeric value to n decimal places (if the value has greater than n decimal places) or append n decimal places to a numeric value (if the value has less than n decimal places). |
| nP | Round a numeric value to n significant digits (if the value has greater than n significant digits) or append a decimal point and n significant digits to a numeric value (if the value has less than n significant digits). Leading zeroes are not significant digits. Trailing zeroes are significant digits if there is a decimal point. |
| S | Strip the leading and trailing spaces from the left operand |
| X | Replace any non-printing characters (e.g., controls characters) found in the left operand with spaces. |
| nA | Add commas to a numeric value where appropriate. If the value is negative, move the negative sign to the right of the value. Right justify the field in n spaces. |
| Example | Result | Explanation |
| 123:3 | 123123123 | 123 is repeated three times. |
| 123:4R | b123 | 123 is right justified in a field of 4 characters. |
| 123:4L | 123b | 123 is left justified in a field of 4 characters. |
| 1234567:5T | 12345 | 1234567 is truncated to 5 characters. |
| 12345:7M | b123.45 | 12345 is transformed to a money format and right justified in a field of 7 characters. |
| 123:5C | b123b | 123 is centered in a field of 5 characters. |
| 123:4D | 123.0000 | 123 is transformed to include four decimal places. |
| 12345:4P | 12350 | 12345 is transformed to include four significant digits and is rounded accordingly. |
| " 123 ":"S" | 123 | The leading and trailing spaces are removed. |
| ^&A[1]A:"X" | 3A 1 A | The embedded control characters are transformed into spaces. |
| 1234.56:10A | b1,234.56b | A comma is added as well as a blank space at the end. The number is right justified in a field of 10 characters. |
| -1234.56:10A | b1,234.56- | A comma is added and the minus sign is moved to the right of the number. The number is right justified in a field of 10 characters. |
| Select Operator | Function | Special properties: | Used primarily with a prompt |
| EQ | Equal to | ||
| NE | Not Equal to | ||
| IG | Ignore | Does not affect select conditions. | * |
| GE | Greater than or equal to | ||
| LE | Less than or equal to | ||
| GT | Greater than | ||
| LT | Less than | ||
| LI | List | Select based on a value from a list. Note To see an example how to list user selects on a report see ECE/ECBs | * |
| NL | Not in List | * | |
| RL | Range List | Select based on a list of ranges, enter the name of the prompt and the FROM and THRU will automatically default on the screen. | * |
| CO | Contains | Used to select records if the value is contained within the data field. | |
| NC | Not Contains | ||
| CL | Contains List | * | |
| FS | First value greater than or equal to | ||
| LS | Last value less than or equal to |
| Variable | Explanation |
| /R.CPI | The characters per inch defined on page one of the Enter/Edit Report routine. |
| /R.LPI | The lines per inch defined on page one of the Enter/Edit Report routine. |
| /R.CPL | The characters per line defined on page one of the Enter/Edit Report routine. |
| /R.PS | The page size defined on page one of the Enter/Edit Report routine. |
| /R.DATE | The date the user began running the report. |
| /R.TIME | The time the user began running the report. |
| /R.FOUND | This variable will have a value of one if the current record passed the report select criteria. |
| /R.HOSP | The application database report title as defined in the MIS Toolbox configuration. |
| /R.NEW.PAGE.PGM | The name of the new page program associated with the report. (.RP suffix on report name). |
| /R.PAGE.NUM | The current page number. |
| /R.TITLE | The report title defined on page one of the Enter/Edit Report routine. |
| /RW.URN | The name of the report. (Only set up on reports run from Report writer.) |
| /R.FRAGMENT | This variable will have a value of one if the report is being executed as a report fragment. |
| /temp | The temporary sort array based on user defined sort criteria. |
PHA RULE: ED.DUP.MED - Data fields from RX, evaluate at MED
IF{[f pt location]="ER"&([f pt status]="REG ER") 1,
IF{[f z user mis office]="INFO SYS"!([f z user mis office]="PHARMACY") 1,
[f rx win init],
[f z chk.med.mnem.dup],
[f rx win disp],1;[f rx ok]};1};
Custom Keyword:
{@Z.rpt.fragment}^SV.F,{1}^{@Z.rpt.fragment},
@PHA.DRUG.mnemonic^/ZRPT.MED,
%PHA.RX.zcus.hab.frag.rule.edm.dup.mnem.R("")X,
""^/ZRPT.MED,
SV.F^{@Z.rpt.fragment},""^SV.F
System Variables Main NPR Menu
| @.appl | /.APPL | Name of Application |
| @.country | /.CNTRY | Country of MIS (US, CANADA, OTHER) |
| @.db | /.DB | Name of Application Database |
| @.device | /.DEV | User's Input Terminal |
| @.dir | /.DIR | Current Directory |
| @.facility | /.FAC | Current Facility in Multi-Facility System |
| @.job | /.JOB | Job Number of Process |
| @.logical.device | /.LOC | Location of User's Terminal |
| @.lookup | /.LK | # of Entries to Display in Lookup |
| @.menu.arg | /.MENU.ARG | Used by Menus to Pass Arguments |
| @.mis | /.MIS | Name of MIS Database |
| @.now | %Z.time.out(S(0)) | Current Time in HHMM Format. |
| @.mri.pfx | /.MPX | Medical Records Prefix |
| @.on.device | /.PRT | Last Response to "ON DEVICE" Prompt |
| @.today | /.DAT | Current Date in YYYYMMDD Format |
| @.user | /.USR | User's Mnemonic |