You can send the List by reference to the Python method, populate it inside the method and use the populated list from the objectscript who call it.

Something like this:

set listOfStrings = ##class("%Library.ListOfDataTypes").%New()
do ..TestPython(listOfStrings)
$$$TRACE("What a beautiful trace! There are "_listOfStrings.Count()_" element(s)")
...
...
ClassMethod TestPython(ByRef listOfStrings As %List) [ Language = python ]
{

	import iris
	
	
	listOfStrings.Insert("One")
	listOfStrings.Insert("Two")
	listOfStrings.Insert("Three")
	
	return 1
}

If you want something low-code you can create a Data Transformation with a HL7 message as source and as destination a class created ad-hoc with the structure that you need. Take a look to this example:

The destination in a class called RestTest.FirstRestObject with this definition:

Class RestTest.FirstRestObject Extends (%Persistent, %JSON.Adaptor, Ens.Util.MessageBodyMethods, Ens.Request)
{

/// Description
Property Name As %String;
/// Description
Property LastName As %String;
Property Childs As list Of NestedRestObject;
}

This object has an SQL representation wich you could use later for your analysis: