Report Writing

Interoperability and HIE

Regulatory and Compliance

Medical Device Integration

Patient Privacy

Perspectives

SQL Tip: How to Strip Repeating Delimiters from String

Written by Thomas Harlan, Data Repository Technical Team Lead for Reporting Services, Iatric Systems

This is a small tip, but could be quite useful on the days you need it.

Particularly when you work with MEDITECH 6.x PCS data, you will often encounter query response values that look like this:

{|||,30+3/40 Emergency|||||LSCS|Apgar 4/1 7/5}

You can use IatricPiece() to pick out chunks of the delimited data, but you might find too many extra delimiters in place, particularly leading delimiters. So you want to process the string first, to take those out.

Thus IatricStripRepeats()!

Which converts the above string example, via this code:

DECLARE @char char(1) = '|' ;
DECLARE @str varchar(max) = '{|||,30+3/40
Emergency|||||LSCS|Apgar 4/1 7/5}' ;

SELECT zcus.dbo.IatricStripRepeats( @char,@str );

Into...

{|,30+3/40 Emergency|LSCS|Apgar 4/1 7/5}

Which is starting to get you somewhere.

If you need more help…

Our Report Writing team can help you fix reports, create new ones, make old ones faster, and much more. Simply reach out to your Iatric Systems Account Executive or Karen Roemer (karen.roemer@iatric.com) to discuss how we can help support your team!

RW-HELP-Button-Blue.png

Topics: Report Writing Services, Data Repository, SQL Tip, Report Writing Tips and Tricks

Subscribe to the Report Writing blog.

Receive the latest articles directly in your inbox.
Enter your email address and click SUBSCRIBE:

Comments

0 COMMENTS