WANT the MEDITECH Reports BLOG via EMAIL?

Your email:

About MEDITECH Reports

MEDITECH Reports is an online reference for NPR Report Writing and not affiliated with MEDITECH, Inc @ http://meditech.com. To learn more about NPR report development using the Meditech Report Writer read more here.

View John Sharpe's profile on LinkedInI'm your host, John Sharpe, a MEDITECH Report Writing Consultant living in Spokane, WA. More about me.

Email John


Sign up for the MEDITECH Reports Blog; details to attend MEDITECH workshops are sent out 1 week in advance to all MEDITECH Report blog subscribers.

These MEDITECH Workshops are sponsored by Donna Carroll at the MEDITECH Community Bulletin

MEDITECH NPR & RW RESOURCES:

Ascii Table: For NPR Report Writer
Loop Builder: For NPR Macros
Key Codes: For CDS Attributes
List Builder: For NPR Macros
MT Report Names: For NPR Reports
MT Structure Viewer: For Physicals
Strings: Format & Sort

HIT Topics

MEDITECH Reports

Current Articles | RSS Feed RSS Feed

Stripping a Dash - MEDITECH String Manipulation

  | Share on Twitter Twitter | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon |  Share on LinkedIn LinkedIn |  Share On Technorati Technorati | Submit to Reddit reddit 

You've added the dashes '-' to a field; but what about removing them?

To remove the dashes from a MEDITECH field (social security number, or phone number), you can use tokens and the NOT operator like this:

"123-45-6789"^/SSN,
/SSN'#1A'#1A^/SSN
Result: /SSN = 123456789

OR

/SSN'#1A^/SSN
Result: /SSN = 12345-6789

/SSN'#1A^/SSN
Result: /SSN = 123456789

OR

DO{/SSN#L(/SSN,"-") /SSN'#1A^/SSN}
Result: /SSN = 123456789


Removing a Space

  | Share on Twitter Twitter | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon |  Share on LinkedIn LinkedIn |  Share On Technorati Technorati | Submit to Reddit reddit 

/VARIABLE:0S^/VARIABLE trims the LEADING & TRAILING spaces from a variable. But what if that last character looks like a space? And /VARIABLE still appears to have a space at the end of it?

Try /VARIABLE:0XS^/VARIABLE. The :0X will replace non-printable characters with a space. Adding the 'S' to :0X trims the space added by :0X.

Next time you're trying to remove spaces from the beginning or end of a value in NPR, try something like this: /VARIABLE:0XS^/VARIABLE.

Example 1: VAL=(@pt.first.name:0XS)_" "_(@pt.last.name:0XS)

Example 2: IF{@rich.text.line:0XS^/REPORT.LINE_.'=. /REPORT.LINE;"NO TEXT FOUND"}


Using Find and Replace to Reformat Output

  | Share on Twitter Twitter | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon |  Share on LinkedIn LinkedIn |  Share On Technorati Technorati | Submit to Reddit reddit 

The billing extract you’ve just sent to a payer has been rejected. There are quotes in the data, and they must be removed in order for your file to be processed.



You update the NPR extract and resend. This time everything goes through.

Read the rest here in the latest issue of the Meditech Bulletin: Reformatting NPR Report Output Using Find & Replace.


Find And Replace String

  | Share on Twitter Twitter | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon |  Share on LinkedIn LinkedIn |  Share On Technorati Technorati | Submit to Reddit reddit 

Ever needed to replace a character in a report's output?

Next time you do, try something like this:

{";",":",/TXT}^@STRING.FIND.REPLACE^/TXT

STRING.FIND.REPLACE
; Input(s): /PARAMS
; Output(s): /STRING
; Author: John Sharpe
; Usage: {@QUOTE,"`",/TXT}^@STRING.FIND.REPLACE^/TXT
/PARAMS,/PARAMS|0^FIND,/PARAMS|1^REPLACE,/PARAMS|2^STRING,
DO{STRING#(L(STRING,FIND)^P) (STRING$P)_REPLACE_(STRING%P)^STRING},
STRING^/STRING

QUOTE
D(34)


Upper Casing NPR Selects

  | Share on Twitter Twitter | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon |  Share on LinkedIn LinkedIn |  Share On Technorati Technorati | Submit to Reddit reddit 

When users of an NPR report need to enter a known free text value in a select and you want to make sure the value is always upper-cased:

MAGIC: c.xx.type~$L.TO.U^c.xx.type
CS: c.xx.type@Tr.l2u^c.xx.type


Formatting MEDITECH Time as HHMMSS

  | Share on Twitter Twitter | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon |  Share on LinkedIn LinkedIn |  Share On Technorati Technorati | Submit to Reddit reddit 

$TIME(@.sd)^TIME,(TIME$2^HH)_((TIME%2)$2^MM)_(TIME%5^SS)^TIME


MEDITECH Magic Case Conversion

  | Share on Twitter Twitter | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon |  Share on LinkedIn LinkedIn |  Share On Technorati Technorati | Submit to Reddit reddit 

The MEDITECH System does not have regular expressions, but it does have translation strings which function much like regular expressions.

Upper Case Conversion: "Alphabet"~$L.TO.U results in "ALPHABET"

Lower Case Conversion: "Alphabet"~$U.TO.L results in "alphabet"


All Posts