just for better readability of the audience I transformed your WHEN condition that dictates speed.

(HL7.{MSH:MessageType.TriggerEvent}!="S14")
&&
(HL7.{MSH:SendingFacility.NamespaceID} CONTAINS "CASE")
&&
(
 (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} CONTAINS "OSU UH ENDO")
 ||
 (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} CONTAINS "OSU UH BRONC")
 ||
 (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} CONTAINS "OSU UHE ENDO")
 ||
 (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} CONTAINS "OSU UHE BRONC")
 ||
 (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} CONTAINS "OSU STONERIDGE ENDO")
 ||
 (
  (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} StartsWith "MER")
  &&
  GroupIDExists(HL7,"AIS","3.1","GIProvationMERProcedures")
 )
 ||
 (
  (
   (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} StartsWith "ONT ENDO")
   ||
   (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} StartsWith "GAL OR")
   ||
   (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} StartsWith "GAL ENDO")
   ||
   (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} StartsWith "BUC OR")
  )
  &&
  GroupIDExists(HL7,"AIS","3.1","GIProvationAVIProcedures")
 )
 ||
 (
  ((HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} StartsWith "HOC OR")
  ||
  (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room} StartsWith "HOC ENDO")
  )
  &&
  GroupIDExists(HL7,"AIS","3.1","GIProvationHOCProcedures")
 )

It shows me that you basically check on  (HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room}
I see not much opportunity for optimization of CONTAINS
But for your StartsWith you may try this construct:

  In(SubString((HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room},1,6),"HOC OR","HOC EN")
or
 In(SubString((HL7.{RGSgrp(1).AIL:LocationResourceID(1).Room},1,6),"ONT EN","GAL OR","GAL EN",BUC OR")

An HealthShare expert might be able to answer if it is possible to have an index on the fields of your WHEN condition.

A different approach could be to handle the whole WHEN in a Custom Utility Function

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

the code is already included in the CSP example
the file comes a MIME data in %request:

for easier reading compile the CSP file and see the generated class   csp.upload.cls  in SAMPLES


<!-- As form is submitted to this page look to see if we have the stream in the %request object -->
<csp:if condition='($data(%request.MimeData("FileStream",1)))'>
<hr><br>
Submitted filename: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).FileName))#</b><br>
Size of file: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).Size))#</b><br>
Mime Section: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).MimeSection))#</b><br>
Type of stream: <b>#(..EscapeHTML($classname(%request.MimeData("FileStream",1))))#</b><br>
Content Type: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).ContentType))#</b><br>
<br>
First 200 characters of stream:<br>
<ul>
<script language="Cache" runat="server">
 

See also doc on %CSP.Request

http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?P...

It seems you try to call ans Action that is not defined / compiled

  /// Get class name for a message descriptor class for this web method based on the SOAPAction
Method GetMsgClass(action As %String, messageChildlist As %Integer, Output methodName As %String, bodyStream As %GlobalCharacterStream = "") As %String [ Internal, ServerOnly = 1 ]
{
Set (methodName,className,msgClass,methodList)=""
Set class=$classname()

Set methodList=$get($$$SOAPParametersSoapActionList(class,action))
>>>> this is line +3   ^^^^^^^^^^^^^^^^^^^^^^^^^^^

this translates to and there is no attempt to write something. 

#define SOAPParametersSoapActionList(%class,%soapAction) ^oddCOM(%class,$$$cCLASSxmldata,"P",0,"soapAction",$select(%soapAction="":$c(0),1:%soapAction))

But finally: . . . .  stNow"),h:\dev5\</text>

Does your Caché Server Instance have access right to  the bolded directory location ????  This smells like  <PROTECT>
 

You may try to cheat it by changing the <input> tag to 

    <input type=file size=30 name=FileStream onchange="javascript: alert(this.value);">

and you get in CHROME  and Firefox

C:\fakepath\EUR_Meldung.pdf

and fakepath doesn't exist obviously

while IE11 and EDGE on Windows10 tell me the real path (!)

C:\Users\ich\Desktop\EUR\EUR_Meldung.pdf

I give no further comment related to security & privacy on products from M$

OK, you look for something different than I understood.

The CLASS REFERENCE to DocBook seems to be not directly available as in Studio.
Just by external  access to Documentation ....

Part of it is found if you have an class in your editor and move your cursor over a class name
then you get a volatile class description that you can nail down by clicking or <F2>

Its's pretty similar to the DocBook version EXCEPT that you have no further references (e.g. Data Types or %Status or  ...)
So it's not a multi level navigation like in browser!

For illustration I have done this for %Persitent.  For %Populate, %XML.Adaptor you have do again and again.

 

To my understanding the structure of your global is irrelevant in this context.
If you want to use sharding forget about ALL global access.
You only access works over SQL !  (at least at the moment, objects may follow in some future)
It's the decision of the sharing logic where and how data are stored in globals.
If you ignore this and continue with direct global access you have a good chance to break it.

List of supported nnenmonics for ANSI terminals (X364)

%X364 ; BINDING FOR ANSI X3.64 NAMESPACE, NOV/92 ; LRS952 06/07/05
  
APC ; Application program command
BEL ; Ring the bell
CBT(%1) ; Cursor backward tabulation %1 tab stops
CCH ; Cancel character
CHA(%1) ; Cursor horizontal absolute (move to column %1)
CHT(%1) ; Cursor horizontal tabulation (forward %1 tab stops)
CNL(%1) ; Cursor next line (cursor down %1 lines)
CPL(%1) ; Cursor preceding line (cursor up %1 lines)
CPR ; Cursor position report (return in $KEY)
CTC(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Cursor tabulation control
CUB(%1) ; Cursor backward %1 columns
CUD(%1) ; Cursor down %1 lines
CUF(%1) ; Cursor forward %1 columns
CUP(%2,%1) ; Cursor position (column %1, line %2)
CUU(%1) ; Cursor up %1 lines
CVT(%1) ; Cursor vertical tabulation
DAQ(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Define area qualification
DCH(%1) ; Delete %1 characters
DCS ; Device control string
DL(%1) ; Delete %1 lines
DSR(%1) ; Device status report - type %1 - return in $KEY
EA(%1) ; Erase in area
ECH(%1) ; Erase %1 characters
ED(%1) ; Erase in display (%1=0 cursor-to-end,1 begin-to-cursor,2 entire scr)
EF(%1) ; Erase in field
EL(%1) ; Erase in line (%1=0 cursor-to-end, 1 begin-to-cursor, 2 entire line)
EPA ; End of protected area
ESA ; End of selected area
HPA(%1) ; Horizontal position attribute (cursor to column %1)
HPR(%1) ; Horizontal position relative (cursor forward %1 columns)
HTJ ; Horizontal tab with justify
HTS ; Horizontal tabulation set
HVP(%1,%2) ; Horizontal and vertical position (column %1, line %2)
ICH(%1) ; Insert %1 characters
IL(%1) ; Insert %1 lines
IND ; Index
INT ; Interrupt
MC ; Media copy
MW ; Message waiting
NEL ; Next line
NP(%1) ; Next page (advance %1 pages of terminal display memory)
OSC ; Operating system command
PLD ; Partial line down
PLU ; Partial line up
PM ; Privacy message
PP(%1) ; Preceding page (backup %1 pages of terminal display memory)
PU1 ; Private use one
PU2 ; Private use two
REP ; Repeat
RI ; Reverse index
RIS ; Reset to initial state
RM(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Reset mode
SEM ; Select editing extent mode
SGR(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Select graphic rendition %1 thru %9
SM(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Set mode
SPA ; Start of protected area
SS2 ; Single shift two
SS3 ; Single shift three
SSA ; Start of selected area
ST ; String terminator
STS ; Set transmit state
SU ; Scroll up
TBC ; Tabulation clear
VPA(%1) ; Vertical position attribute (move to row %1 at same column)
VPR(%1) ; Vertical position relative (move down %1 lines at same column)
VTS ; Vertical tabulation sets

As Eduard already pointed out there is just no need to use %XML.Node as %XML.Document inherits it already

I have elaborated your code also to cover Attributes and Chlidren in the document.
and added some readability features.

To some extend  %XML.TextReader could have done the same.

No need to copy the code from browser the class + test data is attached. xmlreading.zip  

Class XML.J [ Abstract ]
{

ClassMethod GetXMLDocFromFile(file = "C:\InterSystems\Cache\mgr\user\Test.xml") As %XML.Document
{
    set reader=##class(%XML.Reader).%New()
    set status=reader.OpenFile(file)
    if $$$ISERR(status) {do $System.Status.DisplayError(status) quit $$$NULLOREF}
#dim document as %XML.Document
    set document=reader.Document
 #; set reNo=##class(%XML.Node).%New() //check here
 #; set reNo.Document=document //check here
 #; do ..ShowNode(reNo)
    do ..ShowNamespaces(document)
#dim node as %XML.Node
    set %lev=0
    set node=document.GetDocumentElement()
    do ..Analyze(node)
    quit document
}

ClassMethod Analyze(node As %XML.Node)
{
    set hasChild =..ShowNode(node)
    set attribute=node.FirstAttributeName()
    while attribute'="" {
            do ..ShowAttribute(.attribute,node)
        }
    if hasChild {
        set tSC=node.MoveToFirstChild(1)
        if tSC , $i(%lev) {
            while tSC {
                do ..Analyze(node)
                set tSC=node.MoveToNextSibling(1)
                }
            do node.MoveToParent() if $i(%lev,-1)
            }
    }
    quit
}

ClassMethod ShowAttribute(ByRef attribute, node As %XML.Node)
{
   write !?(%lev+1*3),"Attribute_Name ",attribute
        ,!?(%lev+1*3),"Atribute_Value ",node.GetAttributeValue(attribute)
#; more to be added here
        ,!?(%lev+1*3),"--------------------------"
    set attribute=node.NextAttributeName(attribute)
    quit
}

ClassMethod ShowNamespaces(doc As %XML.Document)
{
    Set count=doc.CountNamespace()
    Write !, "Number of namespaces in document: "_count
    For i=1:1:count {
        Write !, "Namespace "_i_" is "_doc.GetNamespace(i)
}
}

// how to use the below method

ClassMethod ShowNode(node As %XML.Node) As %Boolean
{
    If node.NodeType=$$$xmlELEMENTNODE  {
        Write !?(%lev*3),"LocalName="_node.LocalName
#; Write !,"Namespace="_node.Namespace
#; }
#; If node.NodeType=$$$xmlELEMENTNODE {
#; Write !,"NamespaceIndex="_node.NamespaceIndex
        Write !?(%lev*3),"Nil="_node.Nil
        Write !?(%lev*3),"NodeData="_node.NodeData
        Write !?(%lev*3),"QName="_node.QName
    }
    Write !?(%lev*3),"NodeId="_node.NodeId
    Write !?(%lev*3),"NodeType="_node.NodeType
    Write !?(%lev*3),"HasChildNodes returns "_node.HasChildNodes()
    
    If node.NodeType=$$$xmlELEMENTNODE {
        Write !?(%lev*3),"GetNumberAttributes returns "_node.GetNumberAttributes()
        Set status=node.GetText(.text)
          If status {
           Write !?(%lev*3), "Text of the node is "_$tr(text,$c(10))
            else {
                Write !?(%lev*3), "GetText does not return text"
            }
    }
    quit node.HasChildNodes()
}
}

It seems to me you try to call a SOAP service.
That service requires some special XML structured content. That is missing. It is typically  placed in  Authtoken.Entity
you can test your request by

 set tSc = AuthToken.Post("/webservices/Void",1) to see what you send.with is empty in your case.

It may work with pure %Net.HttpReqquest but if you have a valid WSDL definition you better use
the WebService Client Generator in Caché Studio that does it all for you. 

It would be useful to have sour WSDL to try it. Pls. attach it.
As I don't have a personal account on UPS I'n unable to identify what you a re trying to achieve.

I worked also with PHP WS. It does a lot under cover (without your control) that you have to do in Caché by your own code.
eg. at any request the related WDSL is downloaded for actual mapping.

I was wondering where this goes and how you could get so far.
Caché uses a temp file.
 

USER>set sbJSON =##class(%Stream.FileCharacter).%New()
USER>s sc=sbJSON.WriteLine(12123)
 
USER>zw sc
sc=1
 
USER>zw sbJSON
sbJSON=<OBJECT REFERENCE>[6@%Stream.FileCharacter]
+----------------- general information ---------------
|      oref value: 6
|      class name: %Stream.FileCharacter
| reference count: 2
+----------------- attribute values ------------------
|     (%Concurrency) = 1
|          %Location = ""  <Set>
|         (%LockRef) = ""
|          (%Locked) = 0
|              AtEnd = 0
|                BOM = ""
|         (CurrFile) = "C:\InterSystems\17E20\mgr\Temp\mAiLCZXuPXOaSQ.stream"
|                 Id = ""  <Set>
|     LineTerminator = $c(13,10)  <Set>
|      (MakePermLoc) = 1
|             (Mode) = 3
|(NormalizedDirectory) = "C:\InterSystems\17E20\mgr\Temp\"
|(OidTranslateTable) = 0
|         (ReadMode) = 0
|           ReadSize = ""
|      RemoveOnClose = 0
|        (StoreFile) = ""
|  StreamFormatWrite = 1
|         (TempFile) = "mAiLCZXuPXOaSQ.stream"
|     TranslateTable = ""  <Set>
|      UseVMSVersion = 0
|   (VariableRecord) = 0
+--------------- calculated references ---------------
|  CanonicalFilename   <Get>
|           Filename   <Get,Set>
|       LastModified   <Get>
|               Size   <Get>
+-----------------------------------------------------
 
USER>