Jump to content
Macro Express Forums

Copy variables in column into program


Recommended Posts

<TEXT TYPE Action="0" Text="%T[3]%"/>
<TEXT TYPE Action="0" Text="STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF" _ENABLED="FALSE"/>
<REPEAT UNTIL Variable="%T[3]%" Condition="\x00"/>
<END REPEAT/>
<DELAY Flags="\x01" Time="2"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x01" Time="1"/>
<ASCII FILE END PROCESS/>

 

T[3] has multiple rows.  I'm trying to copy these into Meditech.  I can get the first variable to copy over but cannot get it to copy down the list.  The kicker is I need it to <ENTER> after each variable in the column for it work with Meditech.  Basically like this:

 

<TEXT TYPE Action="0" Text="STUFF<ENTER>STUFF<ENTER>FIGHT<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF"/>

 

But without having to type it out by hand.   How could I accomplish this?  Any thoughts?
 

Link to comment
Share on other sites

I assume you have posted only an extract from your macro, because it makes no sense to have END REPEAT immediately after REPEAT UNTIL.  Likewise makes no sense to have ASCII FILE END PROCESS without a preceding BEGIN PROCESS. 

How does data get into T[3], and what separates one item from the next?

 

Need more info ....

Link to comment
Share on other sites

Ok here is a portion of it.  There are three sections but they are all basically the same.  I wrote it out the long way because I could not figure out how to make it work.

 

I work for a hospital.  So there is terminology that i have removed because it might not be appropriate.  What i'm doing here is building what is called a Chief Complaint.  So I create the mnemonic "VOAS", then the "if" yes/no is looking for a potential pop up that asks if this is new or not.  Then I put in a description in another field "victims of stuff."  Unfortunately the programming of the EHR then puts additional verbiage in a field which I have to remove with the up arrows and F10s.  This is the point I run into trouble.  I need to pull the info from the third column below into the now empty field.  Each STUFF entry must have an <ENTER> after it or it won't go into the field correctly.  Then once i enter those "stuff" variables I move onto another field and need to enter the variables from the 4th column plus an <ENTER> then the Y or N, then onto the next variable.  So **RAPASMT <ENTER> Y <ENTER>; *DETASMT etc.

 

Hopefully some of this made sense.  Thank you in advance for any help you can offer!  I think my main issue is I don't know how to do a loop within a loop.....

 

image.png.40611baf439c9e142ebdd31f9010d7cf.png

 

<ASCII FILE BEGIN PROCESS Filename="C:\\Users\\cki8358\\Desktop\\2019.2\\EDM.CC.Build.csv" Format="CSV" Start_Record="1" Process_All="TRUE" Records="1" Variable="%T%" Start_Index="1" Parse_Blank_Lines="FALSE" Clear_Array="TRUE"/>
<WINDOW ACTIVATE Title="EDM.COC" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
<COMMENT Value="CC #1"/>
<TEXT TYPE Action="0" Text="VOAS<ENTER>"/>
<DELAY Flags="\x01" Time="1"/>
<IF WINDOW Option="\x01" Title="Yes/No Confirmation" Partial="TRUE" Wildcards="FALSE"/>
<DELAY Flags="\x02" Time="500"/>
<TEXT TYPE Action="0" Text="Y"/>
<DELAY Flags="\x02" Time="500"/>
<TEXT TYPE Action="0" Text="<F12>"/>
<END IF/>
<DELAY Flags="\x01" Time="1"/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="<F10>"/>
<TEXT TYPE Action="0" Text="N"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="Victims of STUFF"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="<F8>"/>
<TEXT TYPE Action="0" Text="<ARROW UP>"/>
<TEXT TYPE Action="0" Text="<F10>"/>
<TEXT TYPE Action="0" Text="<ARROW UP>"/>
<TEXT TYPE Action="0" Text="<F10>"/>
<TEXT TYPE Action="0" Text="<ARROW UP>"/>
<TEXT TYPE Action="0" Text="<F10>"/>
<TEXT TYPE Action="0" Text="<ARROW UP>"/>
<TEXT TYPE Action="0" Text="<F10>"/>
<TEXT TYPE Action="0" Text="<ARROW UP>"/>
<TEXT TYPE Action="0" Text="<F10>"/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF<ENTER>STUFF"/>
<DELAY Flags="\x01" Time="2"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x01" Time="1"/>
<TEXT TYPE Action="0" Text="**RAPASMT"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="Y"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="*DETASMT"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="Y"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="VOAS"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="Y"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="VOASR"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="Y"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="MAN-RE-CON"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="N"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="FLOWSHEET"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="N"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="PAINASMT"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="N"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="PHYSFIND"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="Y"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="PREFPHARM"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="N"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="SEPSISSCRN"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="Y"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="TEACHEDUC"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="Y"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="TRIAGER"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="N"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<TEXT TYPE Action="0" Text="MEDHISTORY"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>

<MACRO STOP/>
<ASCII FILE END PROCESS/>

Link to comment
Share on other sites

First off, get rid of the MACRO STOP which is the second-to-last line of the macro.  The macro will stop when the ASCII FILE processing loop is done, without your telling it to stop.  

 

The loop that is repeated in your macro begins with ASCII FILE BEGIN PROCESS and ends with ASCII FILE END PROCESS.      Each time through the loop, only a SINGLE LINE from the file is made available in the %T% set of variables.  So you should do all the initial typing, including the ARROW UP and F10 to remove the system-inserted data.  

THEN you can have the sequence
ASCII FILE BEGIN
TYPE T[3] (stuff)
TYPE <ENTER>
ASCII FILE END
That loop will feed you all the T[3] entries one after another and type them.  
Actually, since some of the third column entries are empty, this might work better:  
ASCII FILE BEGIN
IF T[3] NOT EQUAL “”
    TYPE T[3] (stuff)
    TYPE <ENTER>
END IF
ASCII FILE END

 

Once all of the third column is typed, position on the screen and repeat the entire loop to type in the fourth column:
ASCII FILE BEGIN
IF T[4] NOT EQUAL “”
    TYPE T[4]
    TYPE <ENTER>
END IF
ASCII FILE END

 

I don’t think anything prevents your repeating the ASCII FILE BEGIN through ASCII FILE END as often as you want in the macro.  Each time it will process the whole file from beginning to end, and you can pick off whatever column(s) you want during each pass.  For example, since columns 1 and 2 are only in the first line of the file, you could have a separate BEGIN through END just to pick up that line and type those two columns.  (I think there is an option with ASCII FILE BEGIN to process only a single line, so you wouldn’t have to read through and ignore all the other lines just to get line 1.)    

 

So one ASCII BEGIN / END loop to handle the two columns of the first line.
A second BEGIN/END loop to handle as many third column entries as there are.
A third BEGIN/END loop to handle as many fourth column entries as there are.  

 

Good luck!

 

 

Link to comment
Share on other sites

Thanks for the feedback.  Glad you have been successful.  I used to work for a hospital, too. We used the Eclipsys SCM system.  Sometimes I would have to apply identical maintenance to dozens or even hundreds of database entries.  We weren't permitted to do direct table maintenance via SQL, so we had to use the application maintenance screens, and macros saved me HUGE amounts of time clicking through screens and typing.  It takes some effort to set up the macros, but often much of the code is reusable for similar functions. 

Link to comment
Share on other sites

2 hours ago, rberq said:

Thanks for the feedback.  Glad you have been successful.  I used to work for a hospital, too. We used the Eclipsys SCM system.  Sometimes I would have to apply identical maintenance to dozens or even hundreds of database entries.  We weren't permitted to do direct table maintenance via SQL, so we had to use the application maintenance screens, and macros saved me HUGE amounts of time clicking through screens and typing.  It takes some effort to set up the macros, but often much of the code is reusable for similar functions. 

 

That is what I do most of the time.  Update, update,update or change,change,change.  And now I'm doing many of the mass edits for all of the hospitals in our division.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...