Multiple Scripts

Multiple Scripts

Postby Todd Yingling » Mon Apr 04, 2011 1:05 pm

I recently found out that if you have two scripts on one line of mapping both will be called no matter what. Even when there are two different scripts on either side of the OR command. The first script is called and the second script is called right after it. I don't know the reasoning behind this, but it seems odd since the first script returns a value.

Now, I have one script with multiple functions. A main function that calls another function within the same script. Depending on the outcome of that function, it will process that value or call another function. Basically, if the first function (query) returns a value, process it. Otherwise, call the second function (query) and process that value.

Will I run into the same issue as I had before? Will both scripts be called?

Also, how do I echo out a variable from the script and where will it display?

Thanks,
Todd
Todd Yingling
 
Posts: 17
Joined: Mon Apr 04, 2011 12:11 pm

Re: Multiple Scripts

Postby jcampbell » Mon Apr 04, 2011 4:16 pm

Todd,

Would you be comfortable in posting the script and the corresponding mapping logic that references the script? We would like to duplicate the issue in our demo environments.

That said, we've encountered some ConnectR quirkiness when it comes to scripts. The latest is an instance where a ConnectR target system failed to stay connected after an interface change to add a script reference. As it turns out, the script was being supplied input which contained blocking logic. ConnectR doesn't handle this elegantly. More details can be found on the wiki:
http://wiki.galenhealthcare.com/Q:_Afte ... or_message

Regards,
Justin
Justin Campbell | Director of Integrations
office 1.617.379.0841
cell 1.802.363.5654
fax 1.801.409.3982
http://www.galenhealthcare.com | 888.GALEN.44

Visit http://www.galenhealthcare.com/calendar/
for a list of Galen's upcoming FREE webcasts.
jcampbell
 
Posts: 34
Joined: Wed Mar 16, 2011 6:45 am
Location: Boston, MA

Re: Multiple Scripts

Postby Todd Yingling » Thu Apr 07, 2011 1:42 pm

Justin,

I attached the script with out the connection data.

Basically, I worked around the issue where both scripts were called by the mapping no matter what value was returned by merging the two scripts into one script.

The issue I see now is that we believe the SP call is being placed twice. Have you heard of this issue at all? I test the GetGettysburgMRN script in the script window and it returns one value, but logs two calls on the SP side. Do you see any thing abnormal in this script?

Thanks,
Todd
You do not have the required permissions to view the files attached to this post.
Todd Yingling
 
Posts: 17
Joined: Mon Apr 04, 2011 12:11 pm

Re: Multiple Scripts

Postby jcampbell » Thu Apr 07, 2011 4:57 pm

Todd,

Are you indicating that you are seeing two stored procedure calls in SQL Server Profiler?

Thanks!
Justin
Justin Campbell | Director of Integrations
office 1.617.379.0841
cell 1.802.363.5654
fax 1.801.409.3982
http://www.galenhealthcare.com | 888.GALEN.44

Visit http://www.galenhealthcare.com/calendar/
for a list of Galen's upcoming FREE webcasts.
jcampbell
 
Posts: 34
Joined: Wed Mar 16, 2011 6:45 am
Location: Boston, MA

Re: Multiple Scripts

Postby Todd Yingling » Mon Apr 11, 2011 8:15 am

Hey Justin,

No, I was curious if you every heard of an issue where the SP was called twice? I'm not certain this is happening; although, I'm not sure how to determine it is or it is not.

When I test the script that I attached previously, it calls a SP that a colleague created. The correct value is returned every time; however, he shows that it performed the query twice. I already went down the path that there's an issue on his side. We came up empty. Now, I'm looking at CxR side.

You mentioned some quirks with scripts and CxR. I wasn't sure if you had ever heard of scripts making duplicate SP calls? Due to the results of this testing, I was curious if the queries that we currently do in production are making duplicate calls to the Works db, but I'm not certain how to tell if this is occurring.

Thanks again,
Todd
Todd Yingling
 
Posts: 17
Joined: Mon Apr 04, 2011 12:11 pm

Re: Multiple Scripts

Postby Todd Yingling » Thu Apr 14, 2011 8:03 am

Despite the quirks of scripting in CxR, the issue with duplicate calls was an error on our end.

Thanks Justin.
Todd Yingling
 
Posts: 17
Joined: Mon Apr 04, 2011 12:11 pm


Return to Tools: Queries, Scripts

Who is online

Users browsing this forum: No registered users and 2 guests

cron