Explore um caso de uso em mensagens paciente-provedor, inspirado por um estudo da Vanderbilt University. O estudo aborda o volume esmagador de mensagens de pacientes usando IA para ajudar os pacientes a elaborar melhores mensagens iniciais. Um LLM gera perguntas de acompanhamento com base na primeira mensagem do paciente, garantindo que o provedor obtenha os detalhes necessários antecipadamente e reduzindo atrasos no atendimento.
The utility returns the desired values from the text and display the multiple values if exists based on starting and ending string.
Class Test.Utility.FunctionSet Extends %RegisteredObject {
/// W !,##class(Test.Utility.FunctionSet).ExtractValues("Some random text VALUE=12345; some other VALUE=2345; more text VALUE=345678;","VALUE=",";")
ClassMethod ExtractValues(text As %String, startStr As %String, endStr As %String) As %String { //Initialize Valriables Set values = "" Set start = 1
While start '= 0 { Set start = $FIND(text, startStr, start) IF start = 0 { QUIT } Set end = $FIND(text, endStr, start) IF end = 0 { QUIT } //S value = $E(text, start, end-2) S value = $E(text, start, end-$L(endStr)-1) IF values '= "" { Set values = values _" "_value }Else { S values = value } S start = end } Q values } }
Output:
W !,##class(Test.Utility.FunctionSet).ExtractValues("Some random text VALUE=12345; some other VALUE=2345; more text VALUE=345678;","VALUE=",";")
Using embedded Python while building your InterSystems-based solution can add very powerful and deep capabilities to your toolbox.
I'd like to share one sample use-case I encountered - enabling a CDC (Change Data Capture) for a mongoDB Collection - capturing those changes, digesting them through an Interoperability flow, and eventually updating an EMR via a REST API.
The Core Functionality - "Change Watching" 👀
The basic idea is to use the PyMongo package, which, among other things, enables tracking changes within a mongo database via it's change_streams.
The important part is in the Inbound Adapter I created that has an OnInit() method that includes this line:
In your case you can either change this to fit your schema, or even consider adapting my sample to use a more "dynamic" approach where you can define a setting that would be used to dynamically import the JSON to a variable class name (vs. my hard-coded one).
[In any case, to load your JSON schema and create a class from it, you may use the Sample.OpenAPIClassGenerator class I included in my sample (adapted from @Guillaume.Rongier7183's OpenAPI Definition Class Generator (and call the ProcessFile() method I added on your JSON schema file).]
In essence this is the main part of this functionality: Adapter + Business Service that send off messages with changes that were made on a mongo DB Collection.
Widening the Picture 👩⚕️
For demonstration purposes, and to make a full flow that "tells a story" (which was the actual use-case I had) I also added a target for this CDC, which is a REST API of a mock EMR, which takes patient data and inserts it into a Patient Table.
You'll find this part under the Demo.EMR package (Data.Patient for the Table, and Util.API for the REST API); and the Demo.Int package for the Business Operation part.
By the way you can reuse this part for any other needs you might find when you need some mock API to send Patient data for testing as a target destination.
[Note the "mock EMR" table and API include data elements which I didn't use in this demo, like email address and phone number]
A Sample Full Flow (with screenshots) 📷
So here is a sample flow of how this would work -
1. Add a document to your mongo Collection.
Shell commands (Docker exec to connect to mongo container, and mongosh commands, to initiate ReplicaSet, and a Document to a Collection)
$ docker exec -it mongo1 bash
root@e3b93abb5596:/# mongosh
Current Mongosh Log ID: 676708e5955c5e4448fe6910
Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.3.2
Using MongoDB: 6.0.19
Using Mongosh: 2.3.2
For mongosh info see: https://www.mongodb.com/docs/mongodb-shell/
test> use admin
switched to db admin
{ ok: 1 }
admin> db.auth("admin","admin123")
{ ok: 1 }
admin> rs.initiate()
{
info2: 'no configuration specified. Using a default configuration for the set',
me: '960427582b78:27017',
ok: 1
}
rs0 [direct: other] admin> use testDB
switched to db testDB
rs0 [direct: primary] testDB> db.testCol.insertOne({"mrn":"123456789","first_name":"john","last_name":"smith","dob":"2001-01-01","gender":"male"})
{
acknowledged: true,
insertedId: ObjectId('676714119af8c381e2fe6914')
}
When you insert the document, thanks to the "watcher" running in IRIS, this will fire off into the Adapter and Business Service.
2. Examine your "EMR" table and see the new data from Mongo inserted into it.
DBeaver viewing the data in the Patient table
Before the the actions above our table was empty (using DBeaver via JDBC to connect to IRIS database)
And after, you can see a patient record has been added with the info from the document added in Mongo:
Of course you could use different tools than DBeaver for this examination (including the IRIS Management Portal's System Explorer -> SQL), but I used DBeaver to play the role as if this was indeed some external EMR and external table we are just looking at via JDBC.
3. Examine the "Behind the Scenes" inside InterSystems IRIS taking care of this flow.
Visual Trace of messages flow
Looking in the InterSystems IRIS Interoperability Visual Trace you can see the messages flowing from the Business Service who captured the change in Mongo, via a Data Transformation that transformed it to the Request Message being sent to the Business Operation that calls the REST API (which updates the Patient Table)
Take it for a Ride 🏎
The Open Exchange app includes all the related code, and setup instructions for a full Docker Container based demo per above (with all the related parts, including mongo containers).
[Note Mongo has a notion of a ReplicaSet and only with this feature would change_streams work, for simplicity the demo above assumes mongo1 (there are also 2 and 3) is the "primary"].
Again - this is just one example of how Embedded Python can get you up and running with your interoperability challenges very quickly and easily.
This rating includes only applications that have been published this year. The popularity of applications depends on various metrics such as views, bookmarks, ZPM installation rate, releases, reviews, and clicks on the Download button on the app page.
This rating includes applications that have been published since Open Exchange went online. The popularity of applications depends on various metrics such as views, bookmarks, ZPM installation rate, releases, reviews, and clicks on the Download button on the app page.
Different factors, such as publishing apps, entering contests, writing reviews, and releasing updates, affect a developer's rating. If you want to see the top developers based on the number of apps they've published, you can find the info here.
Nous sommes ravis d'inviter tous nos clients, partenaires et membres de la communauté à participer à l'InterSystems Benelux & France Summit 2025 ! L’inscription au Summit 2025 est déjà ouverte.
Cet événement promet d'être une expérience interactive mettant en lumière des études de cas inspirantes, des innovations technologiques et des feuilles de route pour l'année à venir dans les domaines de la santé et des plateformes de données. Des démonstrations pratiques vous permettront également d’explorer les derniers développements de manière tangible.
Au cours de plusieurs sessions, nous explorerons des sujets tels que :
Les normes de santé telles que FHIR et OMOP
L'analytique et l'IA
GenAI et la recherche vectorielle
Python
...et diverses autres technologies émergentes
Nous sommes convaincus que cet événement marquera remarquablement le début de l’année. Nous serions ravis d’avoir votre présence pour enrichir cet événement de votre expérience et de votre expertise. Réservez la date et inscrivez-vous dès aujourd’hui en utilisant notre formulaire d’inscription.
Nous avons hâte de vous retrouver à l'InterSystems Benelux & France Summit 2025!