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

Access Index Value as a Data Element

 

Do you ever find that you've been looking at something one way; only to have the light bulb come on and see things in a different light? I do.

What I am about to share is one of the basest of concepts. And yet I'd missed it until modifying another programmer's NPR report. That is the fun in keeping your eyes open while you work. You find you're always learning and fine tweaking what you know.

room.bed.index
[facility,room,bed] = urn
?(A)AARB[gqb,ggr,ggrB]

schedule.index
[facility,status.type,date,urn] = 1
?(A)AASI[gqb,aaST,aaDT,aa]

Consider both indexes above. Until now, I would loop thru the @room.bed.index using a DO LOOP and then assign the value to a variable and go on my way:

"MAIN.FAC"^facility,""^/Q,
DO{>?(A)AARB[@facility,/Q],/X)^/Q /Q#0S^/ROOM,/Q#1S^BED,/X^urn,@DO.SOMETHING}

What I never thought about is using the name of the structure like this: @room.bed.index^urn.

"MAIN.FAC"^facility,""^room^bed,
DO{+?(A)AARB[@facility,@room,@bed]^bed @room.bed.index^urn,@DO.SOMETHING;
+?(A)AARB[@facility,@room]^room ""^bed}

Until today, it hadn't occurred to me to use the index @room.bed.index to get the value for @urn. You could even use this principle with the @schedule.index to check for the existence of a record.

IF{@schedule.index @DO.SOMETHING;@DO.SOMETHING.ELSE}

Want an alert when the next post is published? Click the phone and Subscribe to the MEDITECH Reports Blog!

Subscribe to the Meditech Blog     

                                                                                                                                                                                                          

Comments

Currently, there are no comments. Be the first to post one!
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics