New post

Find

Question
· Aug 2, 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 Comment
Discussion (1)1
Log in or sign up to continue
Question
· Jul 27, 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 Comments
Discussion (6)2
Log in or sign up to continue
Question
· Jul 13, 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 Comments
Discussion (3)1
Log in or sign up to continue
Discussion
· Jul 13, 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. 

Discussion (0)1
Log in or sign up to continue
Discussion (6)4
Log in or sign up to continue