#Business Service

0 Followers · 209 Posts

A business service is part of InterSystems Ensemble interoperability production which is responsible for accepting requests from external applications.

Article Andrew Sklyarov · Nov 8, 2025 4m read

When I started my journey with InterSystems IRIS, especially in Interoperability, one of the initial and common questions I had was: how can I run something on an interval or schedule? In this topic, I want to share two simple classes that address this issue. I'm surprised that some similar classes are not located somewhere in EnsLib. Or maybe I didn't search well? Anyway, this topic is not meant to be complex work, just a couple of snippets for beginners.

0
0 28
Question Robert Hildebrand · Oct 30, 2025

Hello,I am currently facing the task of retrieving or sending HL7 messages from a web API. Since we only send HL7 messages via internal sockets, web APIs are relatively new to me.The following is my plan for the new interface:I have created a new custom business service that periodically sends requests to a business process. In this business process, the HTTP request (HTTP.GenericMessage) is then created from scratch. The special feature is the "Authorisation" header field, where a signature is inserted, which consists of a base64-encoded hash value. The request is then sent to the API via a

4
0 51
Question Kurro Lopez · Oct 21, 2025

Hi community,

I have a service that uses EnsLib.RecordMap.Service.FTPService to capture files in an FTP directory.

Instead of uploading them all at once, I would need to do so one at a time.

I have a class that extends this class because it preprocesses, saves everything in the RecordMap class, and then processes all the records at once.

When I invoke the BP, it does so through the method set tStatus = ..SendRequest(message, 1).

I've set the SynchronousSend flag to 1, but it continues processing all the files at once.

1
0 35
Question Dmitrii Baranov · Oct 12, 2025

I need to build an integration solution that reads messages from a Kafka topic. The topic has 3 partitions and contains several million messages.

For certain reasons, I can only use the standard EnsLib.Kafka.Service class and cannot use either KafkaClient or Python.

To measure performance and collect statistics I created a simple key + timestamp table with no indexes (so it is unlikely to be a bottleneck). Next, I started an instance of EnsLib.Kafka.Service. In the OnProcessInput method, I receive a message, extract the key from it, get the current time, and write the row to the table.

The statistics shows that as messages are read, performance degrades literally by the minute. In the first minute, the business service is capable of processing up to 25000 messages per minute, then performance gradually decreases, and after 10 minutes performance drops to 2000 messages per minute.

Pool Size = 1, Call Interval = 5 First run 2025-10-11 19:01:00 25880 2025-10-11 19:02:00 12468 2025-10-11 19:03:00 8013 2025-10-11 19:04:00 6626 2025-10-11 19:05:00 5023 2025-10-11 19:06:00 4947 2025-10-11 19:07:00 3912 2025-10-11 19:08:00 3539 2025-10-11 19:09:00 3529 2025-10-11 19:10:00 3169 2025-10-11 19:11:00 2955 2025-10-11 19:12:00 2914 2025-10-11 19:13:00 2771 2025-10-11 19:14:00 2624 2025-10-11 19:15:00 2446 2025-10-11 19:16:00 2754 2025-10-11 19:17:00 2545 2025-10-11 19:18:00 2350 2025-10-11 19:19:00 2314 2025-10-11 19:20:00 2274 Pool Size = 1, Call Interval = 5 Second run 2025-10-11 19:22:00 22892 2025-10-11 19:23:00 15239 2025-10-11 19:24:00 11489 2025-10-11 19:25:00 8267 2025-10-11 19:26:00 6351 2025-10-11 19:27:00 5268 2025-10-11 19:28:00 4779 2025-10-11 19:29:00 4502 2025-10-11 19:30:00 3854 2025-10-11 19:31:00 4048 2025-10-11 19:32:00 3675 2025-10-11 19:33:00 3434 2025-10-11 19:34:00 2981 2025-10-11 19:35:00 3101 2025-10-11 19:36:00 2869 2025-10-11 19:37:00 2343

I tried to play with other configuration properties (CallInterval, ReceiveSettings = { "pollInterval": 1000 }) but that didn't help and even caused Java OutOfMemory error.

How can this problem be solved?

5
0 42
Question Kurro Lopez · Sep 5, 2025

Hello community.

I have a request from a client who wants to do the following.
Currently, they have a data upload process via FTP in which they have implemented a RecordMap to store the information of the CSV files that are uploaded to the FTP directory.
Now they want to have another directory so that it is ONLY executed through an external instruction, not when the file is uploaded to the directory.

3
0 68
Article Ashok Kumar T · Sep 8, 2025 19m read

FHIR Server

A FHIR Server is a software application that implements the FHIR (Fast Healthcare Interoperability Resources) standard, enabling healthcare systems to store, access, exchange, and manage healthcare data in a standardized manner.

Intersystems IRIS can store and retrieve the following FHIR resources:

  • Resource Repository – IRIS Native FHIR server can effortlessly store the FHIR bundles/resources directly in the FHIR repository.
  • FHIR Facade - the FHIR facade layer is a software architecture pattern used to expose a FHIR-compliant API on top of an existing one (often non-FHIR). It also streamlines the healthcare data system, including an electronic health record (EHR), legacy database, or HL7 v2 message store, without requiring the migration of all data into a FHIR-native system.

What is FHIR?

Fast Healthcare Interoperability Resources (FHIR) is a standardized framework created by HL7 International to facilitate the exchange of healthcare data in a flexible, developer-friendly, and modern way. It leverages contemporary web technologies to ensure seamless integration and communication across various healthcare systems.

0
3 224
Question Sizwe Hlatshwayo · Jun 21, 2025

Good day 

I am trying to connect a business service to fileZilla using FTP on my local PC Win 11.

I am trying to setup my training after attending the Building HL7 interfaces course with ISC.

The connection is failing. He is the error below

ERROR <Ens>ErrOutConnectFailed: FTP Connect failed for localhost:21//SSL=' with error ERROR <Ens>ErrFTPConnectFailed: FTP: Failed to connect to server 'localhost:21//SSL='/' (msg='Missing required argument',code=501)

1
0 56
Question Thembelani Mlalazi · Apr 16, 2025

I need to connect to a SFTP server and I seem to connect and timeout have tested the connection using File-zilla and the connection was successful but the problem is when I try to connect using the FTP in bound adapter service I get the following errors.

ERROR <Ens>ErrOutConnectExpired: FTP Connect timeout period (120) expired for ***************.com:990/******/SSL='********* + ERROR <Ens>ErrFTPConnectFailed: FTP: Failed to connect to server ***************.com:990/******/SSL='********* (msg='Timeout waiting for response',code=529)

1
0 114
Question Stuart Byrne · Jun 23, 2020

Dear Community,

I need to collect a file from an FTP server over FTPS.

I have the :

  • credentials saved correctly
  • correct host and port informatoin
  • correct filepath I am trying to collect from
  • I have setup the SSL configuration in  System > Security Management > SSL/TLS Configurations and this tests sucessfully

When I run the business service to connect it connects, but soon after connecting it fails to open the directory:

4
0 487
Article Sanjib Pandey · Mar 3, 2025 5m read

Background:

This guideline provides an overview of how to design and implement a REST API interface for querying patient demographic data from an Electronic Patient Record (EPR) system using HealthConnect. The process involves sending a query request with the patient's identification number, retrieving the response from the EPR system, extracting the required patient demographic data from the HL7 message, and sending it as a JSON response to the supplier. The high-level process diagram is shown below (Screenshot 1).

5
1 217
Article Kurro Lopez · Apr 1, 2025 1m read

Hi all,

As part of the development an API to know what is the instance of IRIS is connected, I've found some methods to know information about the server that can help you.

Get the server name: $SYSTEM.INetInfo.LocalHostName()

Get the server IP: $SYSTEM.INetInfo.HostNameToAddr($SYSTEM.INetInfo.LocalHostName())

Get the instance name: $PIECE($SYSTEM,":",2)

So, I have created the following code as BS class:

2
0 195
Question Warren Oyco · Feb 21, 2025

Hi Community,

I've created a method in my File Service to do a cleanup for every file load. Currently, I've set it to delete data when LastUpdated date is greater than maxdate. However, I want to do a cleanup for every new file load. Any suggestions or advice on how to do this? Thanks!

Method Cleanup()
{

   Set tMaxDate = ""
   &SQL(SELECT Max(LastUpdated) into :tMaxDate
   FROM MC_Table_Data.Patient) 
 

   &SQL(DELETE MC_Table_Data.Patient WHERE LastUpdated<:tMaxDate)
}

0
0 73
Article Kate Lau · Jan 2, 2025 5m read

Last Chapter: Creating a REST client to get Tracks from Spotify REST API - Part4 Save the Search Result

Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client

OK.... based on what I have done.... I am able to 

1. Query Track information by making use of the Spotify API

2. Store the necessary data into my own album, artists, and track table

so.... what next?🤔 How about I set up my own REST API service on my IRIS for the other people to query my table?🤔🤨

ok... 1st... start from document Introduction to Creating REST Services

0
0 116
Article Kate Lau · Dec 29, 2024 4m read

Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client

Recently, I come up an idea in my mind that how can I put my playlist on IRIS.🧐

At the same time, I was told to pay for my Spotify subscription💸💸... ooo.. how about to get some data from the Spotify API... so I started to do study about it.

Like most of the development, let's start from Documentation of  the API https://developer.spotify.com/documentation/web-api

In order to get the data, i am required to request an access token from for the token endpoint URL.🧐

2
2 268
Article Oliver Wilms · Dec 18, 2024 4m read

Implements Idea DPI-I-456

Idea

What The Sample Does

This sample was cloned from iris-interoperability-template. I have reconfigured the interoperability Production with an Inbound HTTP Adapter which is used by a HTTP Business Service. The configuration details for the business service are specified in System Default Settings. I configured Call Interval setting to call HTTPServer once every hour. You can change both the URL and frequency in the service's settings. Screenshot

Originally the HTTP Service had two targets. The response body from each call was sent as a HTTP Generic Message to a BPL business process and also a file operation which saved data to a folder iris-http-calls.

Now the HTTP Service sends a HTTP Generic Message to a file operation. Then a file service sends the file to a BPL business process.

Prerequisites

Make sure you have git and Docker desktop installed.

Installation: ZPM

Open IRIS Namespace with Interoperability Enabled. Open Terminal and call: USER>zpm "install iris-http-calls"

Installation: Docker

Clone/git pull the repo into any local directory

git clone https://github.com/oliverwilms/iris-http-calls.git

Open the terminal in this directory and run:

docker-compose build
  1. Run the IRIS container with your project:
docker-compose up -d

How to Run the Sample

Open the production and start it if it is not already running. It makes HTTP calls to HTTPServer using URL.

How to alter the template

This repository is ready to code in VSCode with the ObjectScript plugin. Install VSCode, Docker and ObjectScript plugin and open the folder in VSCode.

Use the handy VSCode menu to access the production and business rule editor and run a terminal: Screenshot 2020-10-29 at 20 15 56

environment variables usage

this example shows how you can introduce env variables in your dev environment. Suppose you need to setup the production with some secret token to access a limited access API. Of course you don't want to expose the secret to GitHub. In this case Env variables mechanism could be helpful. First introduce .env file and setup .gitignore to filter .env from git.

Then add the secret token in .env in a form ENV_VARIABLE="TOKEN VALUE"

Next introduce make environment variables be imported to dockerfile. to make it work add the environment section into docker-compose.yml, .e.g:

environment:
      - SAMPLE_TOKEN=${SAMPLE_TOKEN}

Then you'll be able to init the running container with the data from env variables e.g. with the following call, which uses the value from .env file as a setting of the production:

USER> d ##class(dc.Demo.Setup).Init($system.Util.GetEnviron("SAMPLE_TOKEN"))

package manager production parameters

Users of this module can use parameters to pass data to the module during installation and customize the File Path for the file operation and file service as well as modify URL. it can be useful when setup parameters are secret tokens to access particular API. You as a developer can provide such parameters with default tag in module.xml.

<Default Name="FilePath" Value="iris_http_calls" />
<Default Name="UrlModify" Value="/Patient?_id=egqBHVfQlt4Bw3XGXoxVxHg3" />

These default parameters enable users to call the installation of the package with the option of passing of parameters. E.g. the installation call could be run as:

zpm "install iris-http-calls -D FilePath=iris_http_calls -D UrlModify=/MedicationStatement?patient=egqBHVfQlt4Bw3XGXoxVxHg3"
USER>zpm "install iris-http-calls -D FilePath=iris_http_calls -D UrlModify=/MedicationStatement?patient=egqBHVfQlt4Bw3XGXoxVxHg3"

[USER|iris-http-calls]        Reload START (/usr/irissys/mgr/.modules/USER/iris-http-calls/0.3.37/)
[USER|iris-http-calls]        Reload SUCCESS
[iris-http-calls]       Module object refreshed.
[USER|iris-http-calls]        Validate START
[USER|iris-http-calls]        Validate SUCCESS
[USER|iris-http-calls]        Compile START
[USER|iris-http-calls]        Compile SUCCESS
[USER|iris-http-calls]        Activate START
[USER|iris-http-calls]        Configure START
[USER|iris-http-calls]        Configure SUCCESS
[USER|iris-http-calls]        Activate SUCCESS

The default parameters are used to setup the production in the following call:

<Invoke Class="dc.Demo.Setup" Method="Init" >
  <Arg>${FilePath}</Arg>
  <Arg>${UrlModify}</Arg>
</Invoke>

Method Init in dc.Demo.Setup class configures File Service and File Operation using the FilePath parameter. The UrlModify parameter is used to modify the URL setting of the HTTP service.

The production makes calls to HTTPServer using modified URL based on CallInterval. The response body is sent in a StreamContainer to a FileOperation. A file service reads the file and passes a Stream Container to a BPL process.

0
0 227
Question Mark OReilly · Aug 30, 2024

As part of fully decoupling code we send a snapshot from a business service (running a SQL statement). 

sql service                         Processor                                File Out

This is picked up by a processer and puts it into a file .txt. 

Issue is if you open it up via the SQL.snapshot message as this is 46,819 rows it'll take too long to respond to opening up the sql.snapshot in the message viewer when viewing the session if looking from the business service 

Is there any way to not have this xml open up in full in the portal? I.e. have a see more? 

3
0 178
Article Samuel Thomas · Sep 23, 2024 1m read

<> <> # IRIS-API-Template

This is a REST template that can send REST messages to production and control interfaces through Servicer, processes, and operations

How to use it

zpm "install iris-rest-template"

Prerequisites

Make sure you have git and Docker desktop installed.

Installation

1.Clone/git pull the repo into any local directory

git clone https://github.com/samuelxabc/IRIS-API-Template.git

Open the terminal in this directory and run

docker-compose build

Run the IRIS container

docker-compose up -d
3
0 199
Question Scott Roth · Jun 28, 2024

Has anyone noticed weird behavior when upgrading to HealthShare Health Connect 2024.1

Wednesday I upgraded our TEST environment from IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2022.1.4 (Build 812_0_22913U) [HealthConnect:3.5.0-1.m1] [HealthConnect:3.5.0-1.m1] to IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2U) [HealthConnect:3.5.0-1.m1].

Some of our Business Processes have been throwing...

2
0 251
Question Joe Jones · Mar 13, 2023

Hi Community,

I am receiving a JSON file as input in ensemble and i need to convert the JSON message to HL7 message.

Can anyone share few points how to read a JSON file into Ensemble production by creating a Custom Business service?

I have created a custom business service as below but i am not aware which parameters i need to pass in OnProcessInput method?

Method OnProcessInput(pInput As Ens.Request, Output pOutput As %RegisteredObject) As %Status

Do i need to Ens.Request or RegisteredObject or Ens.StreamContainer?

Thanks,

Joe

14
0 1405
Question Joseph Tsang · Mar 22, 2019

From time to time we develop an Ensemble Production with simple SQL Inbound data from external databases, we need to develop a few new classes. There are at least:

  • 1 Ens.Request class with the fields captured from the SQL ResultSet
  • 1 Business Service class using SQL Inbound Adaptor, and in the OnProcessInput(), copy the relevant field data from ResultSet to the new Ens.Request, and call either ..SendRequestSync() or ..SendRequestAsync().
3
0 465
Question Colin Brough · May 9, 2024

We have a custom business service that is triggered by a scheduled task. The service queries a table, iterates over the result set and sends a message on to a business process for each result. Happy path functionality is all fine.

However, when there is an error detected in the business service code, neither throwing an exception nor returning an error %Status behaves as we'd expect.

1
0 168
Article Erin Spencer · Jan 24, 2024 9m read

The traditional use of an IRIS production is for an inbound adapter to receive input from an external source, send that input to an IRIS service, then have that service send that input through the production.

With a custom inbound adapter though, we can make an IRIS production do more. We can use an IRIS production to process data from our own database without any external trigger.

By using an IRIS production in this way your data processing tasks now get to leverage all the built in features of an IRIS production, including:

1
2 509