IPeople Blog

MEDITECH CS NPR utility program for changing the length of a multiple field

Written by Gary | May 2, 2022 5:00:00 AM

Sometimes a field from a Child Segment has multiple lines of free text. Let's assume the length of the Child Field is 40 but you would like it to be reformatted to print a length of 30.  The following example converts the text stored in the Child Segment into another table called /GMOD but with a length of 30 instead of 40.  Then the contents of /GMOD are put into an MV Array:

 ""^TEMP,
 DO{>/GMOD[TEMP]^TEMP ""^/GMOD[TEMP]},
 %NUR.TOOL.BOX.convert.length(^@Root(@child.segment),^/GMOD,30),
 ""^TEMP,
 DO{+(/GMOD[TEMP],LN)^TEMP "  "_LN^@Z.rpt.mv[MARKER,TEMP,FIELD]}

MARKER would need to be replaced with whatever value used in your MV Line Attribute.  FIELD would be replaced by the field # on your Report Picture.