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"
}
Scott Roth · Dec 30, 2025 go to post

I ended up taking the QuickStream response, and creating a dynamic object from the JSON in the quick stream to parse it apart.

Scott Roth · Dec 30, 2025 go to post

Using a variable, I created a bunch of IF Statements to either append to the end of the variable or add value to the variable. Once I went through all the necessary fields, I set target.Request.QueryString = the variable.

Scott Roth · Dec 30, 2025 go to post

This has been resolved. Working with another Hospital System we combined our efforts and came up with Code to take the Encoded HL7 Response, decode, and parse it apart to handle the ACK/NCK.,

Scott Roth · Dec 30, 2025 go to post

Worked with WRC and Product on how we could capture this and send the Data Mapping issues within Provider Directory to a Worklist Task.

Scott Roth · Dec 30, 2025 go to post

I worked with WRC and found out how to create a Template for the ncessary fields.

Scott Roth · Sep 9, 2025 go to post

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>
Scott Roth · Jun 18, 2025 go to post

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)
Scott Roth · Jun 18, 2025 go to post

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)
Scott Roth · Jun 11, 2025 go to post

[HealthConnect:3.5.0-1.m1]

it was a group permission issue with the directory. However, once I created the DB, added it to the mirror on the Primary, I cannot get it to Sync with the others in the mirror. I removed it from the mirror for now till I have time to look at it again.

Scott Roth · Apr 22, 2025 go to post

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"
 }
Scott Roth · Apr 3, 2025 go to post

The rule was just routing the message through a DTL and sending it to two places in the same line.

The message size was 12661.

My team member just ended up splitting up the send line into multiple send lines instead of a single send line with two destinations.

Scott Roth · Mar 13, 2025 go to post

The issue was with the query I was using. Those that wrote the query were renaming columns with ' ' but putting spaces in the new names. 

SELECT A AS 'ABC CDE' FROM TableName

I think there was the Typo in my service code, because I never use spaces and assumed that the column names did not have spaces.

Scott Roth · Feb 4, 2025 go to post

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' />
Scott Roth · Feb 3, 2025 go to post

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
}
Scott Roth · Jan 14, 2025 go to post

I am still working with WRC and Microsoft to determine where the issue is.

Scott Roth · Dec 27, 2024 go to post

I ended up writing a function with some help from the Developer community to do this. The function basically iterates through the the HL7 message and check it against a Data Lookup Table. I am in the office in two week and will share it once I am back in the office.

Scott Roth · Dec 18, 2024 go to post

I have seen this before on SQL Outbound Operations when we have had to force stop the BO when it was trying to call/execute a Stored Procedure. The only way we have seen to get rid of the empty PIDs is to stop/start the namespace.

Scott Roth · Jul 16, 2024 go to post

In this post https://community.intersystems.com/node/539431 from Apr 6, 2023, @Mark.O'Reilly9949 mentions building a custom function to Purge Custom Messages using a Data Lookup table. However, it does delete by message count and not by days, which is something I am not fond of, and I haven't been able to get it to work for our needs either.

Scott Roth · Jul 3, 2024 go to post

Robert is correct, more detail is needed. However, as an example, we take HL7 messages and using specific structure classes to match stored procedures, we send calls to an EnsLib.SQL.OutboundAdapter using JDBC to update, insert, and query MS SQL.

Scott Roth · May 9, 2024 go to post

When using a Code block, I find that I have to put a space in at the beginning of the code.

Scott Roth · May 6, 2024 go to post

I had to change the Access Control Rule (setfacl) on each of the files/folders to allow my non-root user access to the files/folders, using setfacl.

Scott Roth · Oct 30, 2023 go to post

We have turned off Telnet, and use ssh to connect to our servers, then open a terminal prompt by running...

:>iris session <name space>

There are many different clients out there from Windows Terminal, Cygwin, MobaXTerm, XWin32, even Windows Powershell would work with ssh. It all a matter of preference...

Scott Roth · Oct 6, 2023 go to post

I tracked down the issue to %Service_Login being disabled, as I thought this service was just used for API calls and not internally.

Scott Roth · Oct 6, 2023 go to post

While thinking about this, I am wondering if using an encryption key might be a possible solution as well that way there is limited access to the password, and the key would just have to be regulated to be updated every so often. With using a AD service account, the password still needs to be updated or kept up to date, and still needs to be passed into the shell script for Terminal to open.

I have submitted the following IDEA...

https://ideas.intersystems.com/ideas/DPI-I-466

Scott Roth · Aug 28, 2023 go to post

At the Java Gateway Service, I have specified the following JVM Args

-d64 -XX:+DisableExplicitGC -XX:+AggressiveOpts

At the %JDBCServer level, I have specififed 

-d64 -Xmx1024m -XX:+DisableExplicitGC -Xss512k

I have often asked for Best Practices but have not had much response. You have to play with the settings as you go...

Scott Roth · Aug 3, 2023 go to post

The issue was with the code that I was using in my Business Operation that was not calling the SSL Configuration. I have since reverted my Business Operation code back to the more standard code that is described in the Documentation, however I am still running into issues making sure the correct format of the Header is being sent in the REST API call, and how to interpret the JSON that is being returned by the REST API.