Welcome to SynapseDirect Sign in | Join | Help

SynapseDirect

Tutorial on how Chickenfoot script works ...

  •  11-03-2006, 8:09 PM

    Tutorial on how Chickenfoot script works ...

    Search ...

    You need to write a chickenfoot script and trigger it on this page to run your custom searches. This also requires Firefox.

    Number: 2525
    Street: H Street
    Suburb: Bakersfield
    City: Ca
    Zip: 93301
    Number&Street: 2525 H Street
    City&State: Bakersfield, Ca 93301

    This is a brief explanation as to how the searchprovider.html script works to bring up the provider's map on yahoo.com.

    The above is the result seen using Firefox when the Firefox icon is pressed on the Providers tab for a Dr Mitts who has been setup as a provider on the demo server.  Each line has a label, and the data follows with a new line for each data item.

    Different web services require different types of data to allow the search to work and so Synapse EMR is providing a range of the same data in different formats. 

    Let's walk thru the script line by line.  As you will see, we only need two lines from the above searchprovider.html page.

    // This chickenscript grabs the address details
    // and brings up the appropriate map in the USA. Change "United States" to "Canada" if you need this.
    These are just comment lines.

    try
    { street = find(/Number&Street: (.*)/).groups[1]; }
    catch(e) {
    street = ''; // this is two single quotes
    }
    This line says ... match the text "Number&Street:" on the page.  
    Then grab each character that follows until the end of the line, and assign it to the variable "street"
    If there is an error, then make the variable "street" just a blank.
    In the above instance, street is given the value "2525 H Street"
    try { city = find(/City&State: (.*)/).groups[1]; }
    catch(e) {
    city = '';
    }
    This line says ... match the text "City&State:" on the page.  
    Then grab each character that follows until the end of the line, and assign it to the variable "city"
    If there is an error, then make the variable "city" just a blank.

    In the above instance, city is given the value ": Bakersfield, Ca 93301"
    with(openTab('http://maps.yahoo.com/', true)) {
    Now, ask Firefox to open a new tab, and browse to http://maps.yahoo.com

    enter("Address",street);
    In the field associated with the text "Address" enter the value of the variable "street" which is "2525 H Street" 

    enter("City",city);

    In the field associated with the text "City" enter the value of the variable "city" which is "Bakersfield, Ca 93301"

    pick("United States");
    Now on the drop down list, pick "United States". 
    	click("Get Map");
    Now simulate a left mouse click on the button "Get Map". 

    }

    The maps.yahoo.com page now has all the information it needs, it has received a mouse click and then it does it's search bringing up the correct map.

     


    Graham Chiu
    Beta Downloads and Documentation Wiki
    Developer Forum
    Filed under:
View Complete Thread
Try-out the Click to try-out Synapse EMR Express Edition Free Synapse EMR Express Edition Click to try-out Synapse EMR Express Edition · ©2006 SynapseDirect · Terms and Conditions · Privacy Policy · help us keep Synapse EMR Express free for all Doctors

managing your electronic medical records · Unique Visits Dell Computer