November 3, 2021

How to Access NPR Segments that are not available as Detail Segments

Sometimes MEDITECH does not make a segment available as a Detail Segment in their NPR Report Writer. The NPR Segments are stored in their own DPM called NPR.SEG. There is a field attached to each segment called cust.rw.access which determines whether or not the segment will be available as a Detail Segment.

We can still access these segments but in a less user-friendly manner. Here is an example showing how to print out a list of all of these segments. They come from a DPM called NPR.SEG:

1) Create a report with Report DPM NPR.SEG (Do not select a Detail DPM, Detail Segment, Index DPM, or Index File)
2) Add the following Line Attributes to your Detail Line:

ECB=""^dpm,
ECB=DO{@Next(dpm) ""^name,
ECB=DO{@Next(name) IF{"Y"'=@cust.rw.access 1,
ECE=1}}},

3) Create two fields with the following attributes and put them on your Detail Line:

xx.dpm
DAT=FREE
LEN=30
VAL=dpm
 
xx.name
DAT=FREE
LEN=30
VAL=name

4) File and translate your report. It is now ready to be run.

ECB is a Line Attribute that stands for Extra Code Beginning. It allows users to run whatever code they like before the current line begins printing. ECE stands for Extra Code Ending and allows code to be run after the current line finishes printing.

In this case, the ECB performs what is called a DO Loop through the Subscripts of the segment. This particular segment has two subscripts: DPM and name. Also, an IF statement is performed so that only those records whose cust.rw.access field is not equal to "Y" are included on the report.

Topics: MEDITECH, Report Writing, Magic System, NPR Report, CS System

You Might Also Enjoy

After pressing for a lookup for either Detail Segments or Index Files, press the number ...

Suppose you want to produce a list of RXs for all current Inpatients. This example will ...

When picking Select Fields, Sort Fields, or Report Fields, users can press for a lookup ...

NPR.SEG.id.editor is a very useful routine in MEDITECH's C/S software that provides handy ...

Sometimes a field from a Child Segment has multiple lines of free text. Let's assume the ...