I was able to figure it out, and get it to work..

Class osuwmc.DataLookup.REST.TableLookup Extends osuwmc.DataLookup.REST.Base
{

Parameter Version = "1.0.0";

Parameter HandleCorsRequests = 0;

XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<Routes> 
    <!-- Server Info -->
    <Route Url="/" Method="GET" Call="GetInfo" />
    <Route Url="/EpicDepartment" Method="GET" Call="GetAllEpicDepartments" />
    <Route Url="/EpicDepartment/:departmentID" Method="GET" Call="GetEpicDepartment"/>
    </Routes>
}

ClassMethod GetInfo() As %Status
{
    SET version = ..#Version
    SET info = {
      "version": (version)
    }
    RETURN ..%ProcessResult($$$OK, info)
}

ClassMethod GetAllEpicDepartments() As %Status
{
    SET tSC = $$$OK
    set %response.ContentType = ..#CONTENTTYPEJSON
    set rset = ##class(osuwmc.Epic.Clarity.DepartmentMaster).ExtentFunc()
    write "["
    if rset.%Next(){
      set department = ##class(osuwmc.Epic.Clarity.DepartmentMaster).%OpenId(rset.ID1)
      do department.%JSONExport()
    }
    while rset.%Next(){
      write ","
      set department = ##class(osuwmc.Epic.Clarity.DepartmentMaster).%OpenId(rset.ID1)
      do department.%JSONExport()
    }
    write "]"
    quit tSC
}

ClassMethod GetEpicDepartment(departmentID As %String) As %Status
{
  #dim tSC as %Status = $$$OK
  #dim e As %Exception.AbstractException
  #dim id as %Integer

  set %response.ContentType = ..#CONTENTTYPEJSON
  &sql(SELECT ID1 INTO :id FROM osuwmc_Epic_Clarity.DepartmentMaster WHERE ID = :departmentID)
  IF SQLCODE<0 {WRITE "SQLCODE error ",SQLCODE," ",%msg  QUIT}
  ELSEIF SQLCODE=100 {WRITE "Query returns no results"  QUIT}
  set department = ##class(osuwmc.Epic.Clarity.DepartmentMaster).%OpenId(id)
  Do department.%JSONExport()
  QUIT tSC
}

ClassMethod SwaggerSpec() As %Status
{
  Set tSC = ##class(%REST.API).GetWebRESTApplication($NAMESPACE, %request.Application, .swagger)
  Do swagger.info.%Remove("x-ISC_Namespace")
  Set swagger.basePath = "/api/mgmnt/v1/TESTCLIN/spec/TableLookup"
  Set swagger.info.title = "REST API to Access and Query OSUWMC Cache Tables"
  Set swagger.info.version = "0.1"
  Set swagger.host = "intengtest"
  Return ..%ProcessResult($$$OK, swagger)
}

}

That helped. I was able to get my first two Method's called; however, I am struggling now with passing a value into the message.

<Routes> 
    <!-- Server Info -->
    <Route Url="/" Method="GET" Call="GetInfo" />
    <Route Url="/GetAllEpicDepartments" Method="GET" Call="GetAllEpicDepartments" />
    <Route Url="/GetEpicDepartment" Method="GET" Call="GetEpicDepartment" />
</Routes>
ClassMethod GetEpicDepartment(ID As %String) As %Status
{
    SET tSC = $$$OK
    set sql = "SELECT ID as DepartmentID, Abbr, Name, ExternalName, PhoneNumber, ApptPhone, FaxNumber, Address1, Address2, City, Zip, Specialty, RevLocID, RevLocName, BuildingCategoryID, BuildingName, DepCategoryTypeID, DepType, Center, EAFParent, CostCenter FROM osuwmc_Epic_Clarity.DepartmentMaster WHERE ID = ?"
    do ##class(%ZEN.Auxiliary.jsonSQLProvider).%WriteJSONFromSQL(,,sql,ID)
    return tSC
}

When I try to pass... https://intengtest/api/mgmnt/v1/TESTCLIN/spec/TableLookup/GetEpicDepartment/{ID} into postman I get the following...

{
    "errors": [
        {
            "code": 5002,
            "domain": "%ObjectErrors",
            "error": "ERROR #5002: ObjectScript error: <REGULAR EXPRESSION>PatternSet+4^%Regex.Matcher.1",
            "id": "ObjectScriptError",
            "params": [
                "&lt;REGULAR EXPRESSION&gt;PatternSet+4^%Regex.Matcher.1"
            ]
        }
    ],
    "summary": "ERROR #5002: ObjectScript error: &lt;REGULAR EXPRESSION&gt;PatternSet+4^%Regex.Matcher.1"
}

Stay Connected is set at 60, messages are sent to the BO in batches depending on when we receive the HL7 message that it requires a lookup. 

Because this is going through a Java Gateway Business Service it seems like there is a disconnect on when the BO loses connection and pipe that it uses through the Java Gateway Business Service. The BO loses the connection, but the Java Gateway Business Service still thinks it is connected to the Database.

I have tried adding Connection Attributes to the BO, but it has not help.

Business Operation Settings

  <Item Name="PatientBillingDBPoll" Category="PatientBilling,SQL,PROD,CC,VANW,PatFeeder" ClassName="osuwmc.PatientBilling.PatientBillingDBPollOperation" PoolSize="1" Enabled="true" Foreground="false" Comment="Is used to lookup items against clarity tables" LogTraceEvents="true" Schedule="">
    <Setting Target="Adapter" Name="Credentials"></Setting>
    <Setting Target="Adapter" Name="DSN">MS-PatientBilling</Setting>
    <Setting Target="Adapter" Name="JGService">PatientBilling.JavaGateway</Setting>
    <Setting Target="Host" Name="FailureTimeout">20</Setting>
    <Setting Target="Host" Name="ReplyCodeActions">E=R</Setting>
    <Setting Target="Host" Name="AlertOnError">0</Setting>
    <Setting Target="Adapter" Name="StayConnected">60</Setting>
    <Setting Target="Adapter" Name="ConnectionAttributes">"queryTimeout = 30";"socketTimeout = 60";"cancelQueryTimeout = 45";"connectRetryCount = 100";"connectRetryInterval = 5"</Setting>
    <Setting Target="Host" Name="ArchiveIO">1</Setting>
  </Item>

Java Gateway Settings

<Item Name="PatientBilling.JavaGateway" Category="PROD" ClassName="EnsLib.JavaGateway.Service" PoolSize="1" Enabled="true" Foreground="false" Comment="" LogTraceEvents="true" Schedule="">
    <Setting Target="Host" Name="Port">55558</Setting>
    <Setting Target="Host" Name="JavaHome">/usr</Setting>
    <Setting Target="Host" Name="Logfile"></Setting>
    <Setting Target="Host" Name="ClassPath">/nfs/data/drivers/java/*</Setting>
    <Setting Target="Host" Name="JVMArgs">-d64 -Xss512k -Xmx1024m -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+ExplicitGCInvokesConcurrent -XX:+UseStringDeduplication -XX:MaxHeapFreeRatio=10 -XX:MinHeapFreeRatio=5</Setting>
  </Item>

This is how i solved the issue


 Set tSC = pRequest.NewResponse(.tResponse)  Quit:$$$ISERR(tSC) tSC
 Set tResponse.encodedMessage = $get(encodedMessage)
 set dMsg = $SYSTEM.Encryption.Base64Decode(tResponse.encodedMessage)
 set pResponse = ##class(EnsLib.HL7.Message).%New()
 set pResponse = ##class(EnsLib.HL7.Message).ImportFromString($Get(dMsg))
 set pResponse.DocType = ##class(EnsLib.HL7.Schema).ResolveSchemaTypeToDocType(pResponse.TypeVersion,pResponse.Name)

This is how I solved the issue...

 Set tSC = pRequest.NewResponse(.tResponse)  Quit:$$$ISERR(tSC) tSC
 Set tResponse.encodedMessage = $get(encodedMessage)
 set dMsg = $SYSTEM.Encryption.Base64Decode(tResponse.encodedMessage)
 set pResponse = ##class(EnsLib.HL7.Message).%New()
 set pResponse = ##class(EnsLib.HL7.Message).ImportFromString($Get(dMsg))
 set pResponse.DocType = ##class(EnsLib.HL7.Schema).ResolveSchemaTypeToDocType(pResponse.TypeVersion,pResponse.Name)

I was able to get it to work. I found that in Cache I need to call %Get("<column>") name vs what I am doing in a BPL.

 s Loc = ""
 s tStatement = ##class(%SQL.Statement).%New()
 s execall= "CALL osuwmc_Utils_EnterpriseDirDb.InterfaceCheckConnectMedCtrID(?)"
 s qStatus = tStatement.%Prepare(execall)
 if $$$ISERR(qStatus) {write "%Prepare failed:" do $SYSTEM.Status.DisplayError(qStatus) quit}
 set rset = tStatement.%Execute(pInput)
 while rset.%Next() {
 set Loc = rset.%Get("OSUguestRoleDTL")
 }
 if $Length(Loc) = 0 {
    set Loc = "OSUWMC"
 }

Within our DTC...

<assign value='source.GetFieldStreamRaw(.tStream,"ORCgrp(1).OBRgrp(1).OBXgrp(1).OBX:ObservationValue(1).AlternateText",.tRemainder)' property='tSC' action='set' />
<assign value='##class(osuwmc.Utils.Functions).DecodeBase64HL7ToFileFaxing(tStream,source.{MSH:SendingApplication.NamespaceID},source.{PID:PatientIdentifierList(1).IDNumber}_context.TextIDTemp_".PDF")' property='a' action='set' />

With some help from the Developer community, below is a Function I wrote for our needs to take a Base64 and write it out to a PDF.

ClassMethod DecodeBase64HL7ToFileFaxing(base64 As %Stream.GlobalBinary, Ancillary As %String, FileName As %String) As %String
{
	set ArchDir = <directory>
	set ArchAncDir = ArchDir_Ancillary_"/"
	set FaxDateDir = ArchAncDir_$PIECE($ZDATE($HOROLOG,7)," ",1)_"-"_$PIECE($ZDATE($HOROLOG,7)," ",2)_"-1/"

	if '##class(%Library.File).DirectoryExists(ArchDir)
	{
		do ##class(%Library.File).CreateDirectory(ArchDir)
	}
	if '##class(%Library.File).DirectoryExists(ArchAncDir)
	{
		do ##class(%Library.File).CreateDirectory(ArchAncDir)
	}
	if '##class(%Library.File).DirectoryExists(FaxDateDir)
	{
 		do ##class(%Library.File).CreateDirectory(FaxDateDir)
 	}
	set Oref = ##class(%Stream.FileBinary).%New()

	$$$LOGINFO(FaxDateDir_FileName)

	set Oref.Filename = FaxDateDir_FileName

	Do base64.Rewind()
	While 'base64.AtEnd {
		set ln = base64.ReadLine()
		set lnDecoded = $system.Encryption.Base64Decode(ln)
		do Oref.Write(lnDecoded)
	}
	Do Oref.%Save()
	do ##class(%File).SetAttributes(Oref,33261,.return)
	set Oref = "" // Close file
	set PDFFilePath = "/Fax/PDFFiles/"_Ancillary_"/"_$PIECE($ZDATE($HOROLOG,7)," ",1)_"-"_$PIECE($ZDATE($HOROLOG,7)," ",2)_"-1/"_FileName
	return PDFFilePath
}