Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove double quotes - regular expression
#7
I'm not sure why this is working now, but it seems to be working despite all the double quotes in the string. I'm new to macros and modern programming. I programmed a little, many years ago in Pascal and Fortran and Turbo Basic but have no training in Visual Basic, C++, etc.. I'm not sure what you mean by using the Text Dialog.

I am trying to improve a poor user interface of a medical software application that I must use by making my own interface. Once completed, I want my interface to drive the built-in application interface. This is primarily a browser-based application that can be manipulated by the HTML element menu commands. There are also some standard windows that also pop up and these must be manipulated with Window/control actions menu instead of the HTML element menu.

In this example below, I get a list of the Html code for the medication section. I have shown part of this code that pertains to the medication Nexium. The actual Quick Macros code is shown below:

Htm el=htm("BODY" "" "" win("gCare2 - Microsoft Internet Explorer" "IEFrame") "3/2/7/1" 0 0x20)
str s=el.HTML

the string s actually contains the following text -- this string is a lot larger than the extracted part shown below. Note

all the double quotes:

<TD vAlign=center><SELECT class=actionBoxdb id=s2 style="WIDTH: 75px" onchange=parent.DoFunction(event.srcElement)

LeafletPath="" PrescriptionID="c1a8624a-5b23-4703-9d63-829294ad7bc0" scriptid="c1a8624a-5b23-4703-9d63-829294ad7bc0"

statustask="" statusnotes="" status="0" Quantity="30" Refills="10" SIG="1 po qd" Dose="40 mg" Prescription="Nexium"><OPTION

value=details selected>details</OPTION><OPTION value=stop>stop</OPTION><OPTION value=refill>refill</OPTION><OPTION

value=medhis>med history</OPTION><OPTION value=modify>modify</OPTION><OPTION value=void>void</OPTION><OPTION

value=voidlastrefill>void last refill</OPTION></SELECT>&nbsp;<IMG onclick=parent.DoFunction(s2);

src="https://gmed.ganapc.net/gcare2/images/go.gif" align=absMiddle></TD></TR>

In this example, I need to find s2 which is seen on the first line just after id=

str subject=s ;; as above, s=el.HTML
str StringThatisFound
str FirstRegularExpressionToLookFor="(?<=id=)\bs\d{1,2}(?=.*Nexium)" ;; find a string such as s1 or s2 or s12 or s20 that is preceeded by id= and is followed at some point by Nexium.

if(findrx(subject FirstRegularExpressionToLookFor 0 0 StringThatisFound)>=0)
out StringThatisFound ;; output of StringThatisFound = s2

I then use s2 to access a different area of the program to refill or stop this prescription.

el=htm("SELECT" StringThatisFound "" win("gCare2 - Microsoft Internet Explorer" "IEFrame") "3/2/7/1" 1 0x121)
el.SetFocus
el.Mouse(1)
key s ;; to type the s choice in the application menus that means "stop" or discontinue the Nexium prescription.

I have been looking at Excel as a way to display a large amount of data at one time and use this to add data to the application that is being driven by Quick Macros. For example: If Cell A1 contains "Nexium 40 mg,one PO daily, #30" then by typing "3r" (which represents "3 refills") into cell B1, I could use Quick Macros to enter 3 refills of Nexium into the application. I'm trying to decide if I should: 1. trigger VBA macros from Quick Macros first and then send the final results to Quick Macros for driving the application, or 2. if I should use Quick Macros exclusively to manipulate the Excel Spreadsheet before using the final results to drive the application.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)