Nueva publicación

Encontrar

Comentarios (5)3
Inicie sesión o regístrese para continuar
Pregunta
· 15 jul, 2024

General Logging In ObjectScript Classes (forDebugging)

I am trying to log certain program data in my ObjectScript REST class, to track down a bug I have. I am comparing two values at runtime, and one result does one thing, and another a different thing. Since this is a REST API class, I have no way of seeing in real time what the value is to debug. I cannot simply run the method in debug in Studio as it will not run properly being a REST class method, nor have the correct incoming header data to correctly replicate what is happening in the API at runtime when being hit by client apps. In other languages like C# or Java, when I would debug an API method like this, I would put in a line like
logger.Log("debug", {string containing any useful info for debugging the problem}...)
and then hit my services with the client app, run the scenario in question, and then check the logs and see what happened. I cannot figure out how to do this in ObjectScript. I've looked in the documentation for Logging, and all I've found so far are exception logging references, which is not what I'm after. Is there any way to do what I'm trying to do in ObjectScript classes?

6 comentarios
Comentarios (6)6
Inicie sesión o regístrese para continuar
Anuncio
· 15 jul, 2024

Building and Managing HL7 Integrations – IN PERSON August 5-9, 2024 / Registration space available

  • Building and Managing HL7 Integrations – In Person August 5-9, 2024 9:00am-5:00pm EDT
    • Build, configure, and manage HL7® V2 interfaces using InterSystems integration technologies.
    • This healthcare-focused 5-day course teaches implementation partners, integrators and analysts how to rapidly build HL7 integration solutions.
    • Students build a production that processes and routes HL7 messages.
    • Students learn how to work with the pre-built HL7 business services, business processes and business operations to receive and send HL7 messages.
    • Students also learn how to transform HL7 messages using graphical tools in the Management Portal.
    • This course teaches students how to monitor, manage, and troubleshoot Productions. Students also learn how to use the Management Portal for viewing, searching, and resending messages.
    • This course is applicable for users of InterSystems IRIS for Health, Ensemble, and HealthShare.
  • Self-Register Here
Comentarios (0)1
Inicie sesión o regístrese para continuar
Pregunta
· 15 jul, 2024

Avoiding STORE memory errors when setting values in very large HL7 messages

Hi

We have a use case whereby very large HL7 MDM messages, which contain many OBX segments, need to be processed by a custom business process. Part of the process is to iterate over each OBX segment and set a value in the same field for each segment.

Testing with a message that is ~500MB and contains over 8000 OBX segments I've encountered <STORE> errors, which surprisingly seems to be due to using SetValueAt. It appears to get through a few thousand segments before it falls over with the memory error, which I assume is because the SetValueAt method keeps in memory each preceding OBX segment?

I've found a way to avoid this problem by having the message reference killed and re-opened after every number of iterations, as though "batched", however this does seem hacky to me and given larger messages may not hold up.

I'd greatly appreciate any alternative solutions to this. It would be great if there were a way to easily set a field value across a given number of segments, using a virtual property path like the following would be great, which I tried to no avail:

do request.SetValueAt("a value","OBX(*):ObservationValue.ContentType")

Here's the logic in question:

ClassMethod FilterOBXSegments(ByRef meshRequest As Ens.Request) As %Status
{
set obxSegmentsTotal = meshRequest.GetValueAt("OBX(*)")
set contentType = ..GetContentType(meshRequest)
$$$LOGINFO("Content type: "_contentType) if '..IsContentTypeValid(contentType) return $$$ERROR($$$GeneralError, "Did not find mapped content type")

do meshRequest.%Save()
set objectId = meshRequest.%Id()

set batchSize = 100
$$$LOGINFO("Object id is: "_objectId)
for obxLoopIter = 1:1:obxSegmentsTotal
{
    $$$LOGINFO("OBX iteration of: "_obxLoopIter)    
    do meshRequest.SetValueAt(contentType,"OBX("_obxLoopIter_"):ObservationValue.ContentType")
    if obxLoopIter = batchSize
    {
        $$$LOGINFO("Reached memory batch size, saving and re-swizzling")
        do meshRequest.%Save()
         kill meshRequest
         set meshRequest = ##class(EnsLib.HL7.Message).%OpenId(objectId)
         set batchSize = batchSize + batchSize
    }
}
quit $$$OK
}
Comentarios (0)1
Inicie sesión o regístrese para continuar
Anuncio
· 15 jul, 2024

Technology Bonuses for the InterSystems Python Contest 2024

Hi Developers!

Here are the technology bonuses for the InterSystems Python Contest 2024 that will give you extra points in the voting:

  • IRIS Vector Search usage - 3
  • Python Pex Interoperability - 3
  • Python in BPL - 2
  • WSGI Web Apps - 2
  • Python libs: sqlalchemy and dbt - 2
  • LLM AI or LangChain usage: Chat GPT, Bard and others - 3
  • NoObjectScriptLine - 3
  • Hugginface - 2
  • Docker container usage - 2 
  • ZPM Package deployment - 2
  • Online Demo - 2
  • Implement InterSystems Community Idea - 4
  • Find a bug in Embedded Python - 2
  • First Article on Developer Community - 2
  • Second Article On DC - 1
  • First Time Contribution - 3
  • Video on YouTube - 3
  • YouTube Short - 1

See the details below.<--break-><--break->

IRIS Vector Search - 3 points

Starting from 2024.1 release InterSystems IRIS contains a new technology vector search that allows to build vectors over InterSystems IRIS data and perform search of already indexed vectors. Use it in your solution and collect 5 bonus points. Here is the demo project that leverages it.

Python Pex Interoperability - 3 points

InterSystems IRIS has Python Pex Interoperability module that provides the option to develop InterSystems Interoperability productions from Python. Use it and collect 3 extra points for your application. It's OK also to use alternative python.pex wheel introduced by Guillaume Ronguier in this project and template.

Python in BPL - 2 points

While building IRIS Interoperability productions it is possible to code BPL in with python now. Use it in your application and collect 2 extra bonus points! See the release notes. Example.

WSGI Web Apps - 2 points

The 2024.1 InterSystems IRIS release goes with an experimental feuture that allows to deploy WSGI Web Apps for IRIS. Take a look at three example applications for flask, fast-api and django to deploy IRIS apps with WSGI support.

Python libs: sqlalchemy and dbt - 2

Use sqlachemy and dbt for IRIS community libs and collect 2 additional bonus points for each.

LLM AI or LangChain usage: Chat GPT, Bard and others - 3 points

Collect 6 bonus expert points for building a solution that uses LangChain libs or Large Language Models (LLM) such as ChatGPT, Bard and other AI engines like PaLMLLaMA and more. AutoGPT usage counts too.

A few examples already could be found in Open Exchange: iris-openai, chatGPT telegram bot.

Here is an article with langchain usage example.

Pure Python(NoObjectScriptLine) - 3 points

We are introducing several python APIs in this contest! And the bonus is yet another challenge: build your python solution with InterSystems IRIS and try to avoid using even a line of ObjectScript! IRIS Classes with only Embedded Python methods are OK though. Do it and collect 4 bonus points more!

Here is a template that demonstrates how you can use IRIS without a line of ObjectScript. Yes, it contains ObjectScript classes for demo purpose but you can delete it in your app.

HuggingFace - 2

Deploy your solution at the hugging face repository and collect 2 extra points. Example.

Docker container usage - 2 points

The application gets a 'Docker container' bonus if it uses InterSystems IRIS  running in a docker container. Here is the simplest template to start from.

ZPM Package deployment - 2 points

You can collect the bonus if you build and publish the ZPM(InterSystems Package Manager) package for your Full-Stack application so it could be deployed with:

zpm "install your-multi-model-solution"

command on IRIS with ZPM client installed. 

ZPM client. Documentation.

Online Demo of your project - 2 points
Collect 2 more bonus points if you provision your project to the cloud as an online demo. You can do it on your own or you can use this template - here is an Example. Here is the video on how to use it.

Implement Community Opportunity Idea - 4 points

Implement any idea from the InterSystems Community Ideas portal which has the "Community Opportunity" status. This will give you 4 additional bonus points.

Find a bug in Embedded Python - 2 points
We want the broader adoption of InterSystems Embedded python, so we encourage you to report the bugs you will face during the development of your python application with IRIS in order to fix it. Please submit the bug here in a form of issue and how to reproduce it. You can collect 2 bonus points for the first reproducible bug.

Article on Developer Community - 2 points

Write a brand new article on Developer Community that describes the features of your project and how to work with it. Collect 2 points for the article. 
*This bonus is subject to the discretion of the experts whose decision is final.

The Second article on Developer Community - 1 point

You can collect one more bonus point for the second article or the translation of the first article. The second article should go into detail of a feature of your project. The 3rd and more articles will not bring more points, but the attention will be all yours. 
*This bonus is subject to the discretion of the experts whose decision is final.

First Time Contribution - 3 points

Collect 3 bonus points if you participate in InterSystems Open Exchange contests for the first time!

Video on YouTube - 3 points

Make the Youtube video demonstrating your product in action and collect 3 bonus points each.

YouTube Short - 1 point

Make a YouTube Short demonstrating your product in action and collect 1 bonus point each.

The list of bonuses is subject to change. Stay tuned!

Good luck in the competition!

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