Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C-PAD CDA channel fix... #89

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions adt_companion/mirth/adt-companion-receive-via-http.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<enabled>true</enabled>
<version>2.1.1.5490</version>
<lastModified>
<time>1337624217783</time>
<time>1339794274997</time>
<timezone>America/Los_Angeles</timezone>
</lastModified>
<revision>12</revision>
<revision>14</revision>
<sourceConnector>
<name>sourceConnector</name>
<properties>
Expand Down Expand Up @@ -78,7 +78,10 @@

var decoded = FileUtil.decode(msg[&apos;Content&apos;].toString());
var decoded2 = &quot;&quot;;
if (Packages.java.lang.String(decoded).substring(0, 70).match(/[a-zA-Z0-9\+\/]{70}/) != null) {
var testStr = Packages.java.lang.String(decoded).length() &gt; 70 ? Packages.java.lang.String(decoded).substring(0, 70) : Packages.java.lang.String(decoded);
var testStrLen = testStr.length();
var base64RegEx = new RegExp(&apos;^[A-Za-z0-9\+\/=]{&apos; + testStrLen + &apos;}$&apos;);
if (base64RegEx.test(testStr)) {
decoded2 = FileUtil.decode(Packages.java.lang.String(decoded));
} else {
decoded2 = decoded;
Expand All @@ -100,7 +103,10 @@ channelMap.put(&apos;filedata&apos;, Packages.java.lang.String(decoded2));</scri

var decoded = FileUtil.decode(msg[&apos;Content&apos;].toString());
var decoded2 = &quot;&quot;;
if (Packages.java.lang.String(decoded).substring(0, 70).match(/[a-zA-Z0-9\+\/]{70}/) != null) {
var testStr = Packages.java.lang.String(decoded).length() &gt; 70 ? Packages.java.lang.String(decoded).substring(0, 70) : Packages.java.lang.String(decoded);
var testStrLen = testStr.length();
var base64RegEx = new RegExp(&apos;^[A-Za-z0-9\+\/=]{&apos; + testStrLen + &apos;}$&apos;);
if (base64RegEx.test(testStr)) {
decoded2 = FileUtil.decode(Packages.java.lang.String(decoded));
} else {
decoded2 = decoded;
Expand Down Expand Up @@ -156,4 +162,4 @@ return;</deployScript>
<shutdownScript>// This script executes once when the channel is undeployed
// You only have access to the globalMap and globalChannelMap here to persist data
return;</shutdownScript>
</channel>
</channel>
Loading