About MEDITECH Reports

 

View John Sharpe's profile on LinkedInI'm your host, John Sharpe, a MEDITECH Consultant living in Spokane, WA. Read more ...

Connect ...

Expand your network by connecting on these social media sites:

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

 

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

 

/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

 

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

 

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

 

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

 

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

MEDITECH Magic Case Conversion

 

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