Nueva publicación

查找

Pregunta
· 4 ago, 2023

Looking for a functionality in a Business Process to wait for another BP/BS

Hi All,

If I remember it correctly there is a functionality in IRIS to make this possible.

I've got two incoming Business Services of files from different sources.

BS1: An Ens.StreamContainer with some info and metadata which point to a specific file. Ens.StreamContainer will be send to a BP.

BS2: The files where the metadata points to. It's in the Ens.StreamContainer

But dependent on the flow the file could be later available on BS2. So I want the BPL to wait for the file to arrive at BS2. 

Then in the BPL I want to do some merging stuff with the 2 Ens.StreamContainers

So i'm looking for a functionaliteit to wait for a specific message and then go on. Can someone point me to the correct documentation or maybe has an example?

Thanks in advance.

4 comentarios
Comentarios (4)1
Inicie sesión o regístrese para continuar
Pregunta
· 2 ago, 2023

Where is IRIS Community on Docker located?

Have Docker running in Ubuntu and successfully downloaded IRIS Healthcare ML Community to local machine.

Cannot figure out how to launch IRIS...help!

Thanks, all...

Martin Arnold

1 Comentario
Comentarios (1)1
Inicie sesión o regístrese para continuar
Pregunta
· 27 jul, 2023

Is it possible to get a list all active open TCP/IP connections made by IRIS ?

There is several classes that allow to create TCP/IP connections (eg: to connect to a service).

Example : %Net.FtpSession (port 21), %Net.HttpRequest (usually port 80 or 443)

AFAIK connection will stay open unless closed explicitly or if variable that hold the instance is garbage collected.

Is there a way to get a list of all active (open) TCP/IP connections IRIS is maintaining so far ?

I took a look at Portal (eg: in dashboard, "System Resource Statistics") but couldn't find anything. Web Gateway panel provide information about connections but this is incoming connections for CSP pages. I am look for external connections (the other way around).

If it's not available in Portal, some API / classes will be fine too.

I could of course run TCPView , netstat or something like that but I am looking for something built-in in IRIS.

6 comentarios
Comentarios (6)2
Inicie sesión o regístrese para continuar
Pregunta
· 13 jul, 2023

Embedded Python and IRIS Streams

Hi All,

We're doing our first babysteps with embedded Python and IRIS with an interoperability solution. We want to convert a CSV file to an Excel xlt file.

As service we've got a EnsLib.File.PassthroughService which picks up a csv file

As operation we've got a EnsLib.File.PassthroughOperation which writes the Excel file.

In the middle:

We've created an Business Process with an %Stream.GlobalCharacter in the Request and a %Stream.GlobalCharacter  in the Response.

But how do we get the %Stream.GlobalCharacter in the Python ClassMethod? Ideally I don't would like to write the stream first to a temp file, give the temp file to Python and let Python write the XLT file and read that XLT file into a %Stream.GlobalCharacter.

Any ideas? See the code snipped below. This one works but will first create a string from the Stream but will fail when the csv is bigger then the Intersystems string limit

Class ZORG.BP.CsvToExcel Extends Ens.BusinessProcess
{

Method OnRequest(pRequest As ZORG.BP.CsvToExcel.CsvToExcelReq, Output pResponse As ZORG.BP.CsvToExcel.CsvToExcelResp) As %Status
{
    Set tsc = $$$OK
	; Create the response class
	Set pResponse = ##class(ZORG.BP.CsvToExcel.CsvToExcelResp).%New()
	Set pResponse.outputStream = ##class(%Stream.GlobalCharacter).%New()
	
	$$$TRACE("Size of Stream: "_pRequest.inputStream.SizeGet())
    Set XlsString=..convertCSVtoXLS(pRequest.inputStream.Read($$$MaxStringLength))
	Do pResponse.outputStream.Write(XlsString)
	
	return tsc
}

ClassMethod convertCSVtoXLS(csvFile As %String(MAXLEN="")) As %String [ Language = python ]
{

	"""
    This function takes a CSV string as input and converts it into an XLS string.
    
    Parameters:
    csv_string (str): The CSV string to be converted
    
    Returns:
    str: Th
	"""
	import pandas
	import xlwt
	import sys
	import csv
	import tempfile
	from io import StringIO
	
	# Read the CSVdata into a Pandas DataFrame
	
	df = pandas.read_csv(StringIO(csvFile), delimiter=";", decimal=",", dtype={'patno':str} )	
	# Create an instance of Workbook class from xlwt library	
	workbook = xlwt.Workbook()

    # Add a sheet to the workbook
	sheet = workbook.add_sheet('Sheet1')

    # Write the DataFrame values to the sheet
	for i, column in enumerate(df.columns):
		sheet.write(0, i, column)  # Write column headers
		for j, value in enumerate(df[column]):
			if ( str(value) != 'nan' ):       #catch empty cells
				sheet.write(j + 1, i, value)  # Write cell values

	# Write workbook to temporary file
	file = tempfile.TemporaryFile()
	
	# Save Workbook
	workbook.save(file)
	
	#Go to the beginning of the file
	file.seek(0)

	#Read from temporary File and return
	data = file.read()
	return(data)
}
}
3 comentarios
Comentarios (3)1
Inicie sesión o regístrese para continuar
Comentarios
· 13 jul, 2023

How could we leverage the power of ChatGPT or LLM in our routine job with IRIS on coding,implementation, testing,interoperability,etc.

With rapid evolution of Generative AI,  to embrace it and help us improve productivity is a must. Let's discuss and embrace the ideas of how we can leverage Generative AI to improve our routine work. 

Comentarios (0)1
Inicie sesión o regístrese para continuar