Nova postagem

Encontrar

Artigo
· Maio 16, 2024 1min de leitura

How to run SQL in terminal

InterSystems FAQ rubric

Too run SQL in Terminal use $system.SQL.Shell().

Please refer to the sample below.

SAMPLES>do $System.SQL.Shell()
SQL Command Line Shell
---------------------------------------------------- The command prefix is currently set to: <>.
Enter q to quit, ? for help.
SAMPLES>>select * from Sample.Vendor
1. select * from Sample.Vendor Vendor Balance Contact DaysClear DiscDays DiscRate LastInvDate LastPayDate MinPayment Name NetDays PayFlag TaxReportingAddress_City Address_State Address_Street Address_Zip
: *If you press Enter without entering anything on the first line, it will switch to multi-line input mode.
USER>d $SYSTEM.SQL.Shell()
SQL Command Line Shell
----------------------------------------------------
Enter q to quit, ? for help.
USER>> << entering multiline statement mode, 'GO' to execute >>
1>>set transaction isolation level read committed
2>>go

For details, please refer to the document below.

How to use SQLShell [IRIS]
How to use SQLShell

1 Comment
Discussão (1)2
Entre ou crie uma conta para continuar
Discussão (3)3
Entre ou crie uma conta para continuar
Artigo
· Maio 16, 2024 3min de leitura

Installation and adaptation of EMPI in Standalone mode - Notifying registrations and linkages to external systems

Reviewing the different articles that I have published, I realized that I needed to explain a very practical functionality within our EMPI (Enterprise Master Patient Index) and it is none other than the notification of registrations and links to systems external to the EMPI.

This functionality is frankly useful in a tool such as EMPI and especially in environments such as healthcare in which it is very common for the same patient to have their data duplicated in different systems and in the end it is necessary to uniquely identify it. The solution to reduce this amalgamation of records is to merge all this data into a single record that unifies all the available information.

In general, this work of deciding which records should be merged is quite complex if it is intended to be done by hand since it is very complicated to have access to the various systems that contain patient information (systems such as HIS, RIS, LIS, etc. from different providers distributed throughout the different centers of the health organization), but thanks to the EMPI linkage system this task is simplified by automating the vast majority of said links.

How can we inform that entire ecosystem of applications that they need to merge two patient records? Well, let's see it:

EMPI configuration

The first step to start generating notifications is to configure the PIX Notification Register:

Here we can see that by default we have two notification records:

One of the records is for PIXv3 notifications using HL7 v.3 messages (in XML) while the other will be PIXv2 using HL7 v.2 messaging.

In order to generate the necessary messages we must either define the domains in the field defined by default or check the All Domains box, this domain concept will correspond to the Assignment Authority (health services, hospital centers, etc.). With this step we will be defining the consumers of our output message; if we do not define any domain, the message will not be generated.

Now we open the production that manages the operation of the EMPI, let's take a look at the Business Process HS.IHE.PIX.Manager.Process that will be in charge of creating the response messages.

Let's pay attention to the configuration of said BP, as you can see we have two parameters PIXv2Operations and PIXv3Operations that are configured with 2 business operations of our production, the first of them will be in charge of receiving an HL7 v.2 message and the second an HL7 message v.3.

Let's now look at the BO  PIXv2.Notification.Operations:

As you can see, we have defined a BO of the EnsLib.HL7.Operation.FileOperation class since we will simply limit ourselves to writing the HL7 message for updating the patient data generated to a file on the server, but you could use any business operation that you have developed and that accepts HL7 messages as input, being able to forward them via TCP, embedded in a SOAP or through a REST call to an external API.

Testing

Let's look at an example of what happens with two patients in linkage review status after linking them normally.

We will link the first two, Juan García and Roberto Martín. Once the link is made, let's see the trace of the message:

Here we have our HL7 message generated of type ADT_A31 in which we report the update of the patient that has been linked to the new MPIID, now the patient Roberto Martín with MRN 556432 from Hospital 12 de Octubre has replaced his old MPIID (100001000) with the the same one that Juan García has (100000001).

Our EMPI will maintain a record for each patient, creating only the link with the MPIID assigned to both. With this ADT_A31 message it would now be the responsibility of the health service or hospital to merge both patients into one.

Conclusion

As we have seen in this article, EMPI has pre-built functionalities that cover the needs of any organization in a simple and agile way and allows us to expand them to cover those that are more specific to each client, one of them would precisely be automatic notifications. to any external application.

1 Comment
Discussão (1)2
Entre ou crie uma conta para continuar
Artigo
· Maio 16, 2024 3min de leitura

Instalación y adaptación de EMPI en modo Standalone - Notificando altas y vinculaciones a sistemas externos

Revisando los diferentes artículos que he ido publicando he caído en la cuenta de que me faltaba explicar una funcionalidad bastante práctica dentro de nuestro EMPI (Enterprise Master Patient Index) y no es otra que la notificación de altas y vinculaciones a sistemas externos al EMPI.

Esta funcionalidad es francamente útil en una herramienta como es el EMPI y sobretodo en entornos como el sanitario en el cual es muy habitual que un mismo paciente tenga sus datos duplicados en diferentes sistemas y que al final es necesario identificar univocamente. La solución para reducir dicha amalgama de registros es la fusión de todos esos datos en un registro único que unifique toda la información disponible.

Por lo general este trabajo de decidir que registros deberían ser fusionados es bastante complejo si se pretende realizar a mano ya que es muy complicado tener acceso a los diversos sistemas que contengan información de pacientes (sistemas como el HIS, RIS, LIS, etc de diferentes proveedores distribuidos por los diferentes centros de la organización de salud), pero gracias al sistema de vinculaciones del EMPI esta tarea se simplifica al automatizar la gran mayoría de dichas vinculaciones.

¿Cómo podemos informar a todo ese ecosistema de aplicaciones que debe fusionar dos registros de paciente? Pues bien, veámoslo:

Configuración de EMPI

El primer paso para poder empezar a generar notificaciones es configurar el registro de notificación PIX:

Aquí podemos ver que por defecto tenemos dos registros de notificaciones:

Uno de los registros es para notificaciones PIXv3 mediante mensajes de HL7 v.3 (en XML) mientras que el otro será PIXv2 que utiliza mensajería HL7 v.2. 

Para poder generar los mensajes necesarios deberemos o bien definir los dominios en el campo definido por defecto o marcar la casilla All Domains, este concepto de dominio corresponderá con el de Autoridad de Asignación (servicios de salud, centros hospitalarios, etc). Con este paso estaremos definiendo los consumidores de nuestro mensaje de salida, si no definimos ningún dominio el mensaje no se generará.

Ahora abrimos la producción que gestiona el funcionamiento del EMPI echemos un vistazo al Business Process HS.IHE.PIX.Manager.Process que será el encargado de la creación de los mensajes de respuesta.

Prestemos atención a la configuración de dicho BP, como véis tenemos dos parámetros PIXv2Operations y PIXv3Operations que están configurados con 2 business operations de nuestra producción, el primero de ellos será el encargado de recibir un mensaje HL7 v.2 y el segundo un mensaje de HL7 v.3.

Veamos ahora el BO  PIXv2.Notification.Operations:

Como podéis ver hemos definido un BO de la clase EnsLib.HL7.Operation.FileOperation ya que simplemente nos limitaremos a escribir el mensaje HL7 de actualización de los datos de paciente generado a un fichero del servidor, pero podríais utilizar cualquier business operation que tengáis desarrollado y que acepte mensajes de HL7 como entrada, pudiendo reenviarlos vía TCP, incrustados en un SOAP o mediante una llamada REST a una API externa.

Pruebas

Veamos un ejemplo de lo que ocurre con dos pacientes en estado de revisión de la vinculación tras vincularlos normalmente.

Vincularemos a los dos primeros, Juan García y Roberto Martín. Una vez realizada la vinculación veamos la traza del mensaje:

Aquí tenemos nuestro mensaje HL7 generado de tipo ADT_A31 en el que informamos de la actualización del paciente que se ha vinculado con el nuevo MPIID, ahora el paciente Roberto Martín con MRN 556432 del Hospital 12 de Octubre ha reemplazado su antiguo MPIID (100001000) por el mismo que tiene Juan García (100000001). 

Nuestro EMPI mantendra un registro para cada paciente, creando únicamente la vinculación con el MPIID asignado a ambos. Con este mensaje ADT_A31 ahora sería responsabilidad del servicio de salud o del hospital fusionar ambos pacientes en uno sólo.

Conclusión

Como hemos visto en este artículo, el EMPI dispone de funcionalidades preconstruidas que cubren las necesidades de cualquier organización de una forma sencilla y ágil y nos permite ampliarlas para cubrir aquellas que sean más específicas de cada cliente, una de ellas sería precisamente la de notificaciones automáticas a cualquier aplicación externa.

Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· Maio 16, 2024

RSA Encryption Decryption

Hi guys,

 

I try to make a test of encryption, decryption of a simple text.

I can crypt my text, but I can't decrypt it, do you see somewhere a dummy error of my part ?

Thanks for help

ClassMethod UnitTest()

{

  set inputPlainText = "David"

 

  // get private key

  set privKeyFileName = "C:\temp\toto.pem"

  set privobjCharFile = ##class(%Stream.FileCharacter).%New()

  set privobjCharFile.Filename = privKeyFileName

  set privKey = privobjCharFile.Read()

 

  set Inputbase64 = $SYSTEM.Encryption.Base64Encode(inputPlainText)

 

  // encrypte text using RSA

  set encryptText = $System.Encryption.RSAEncrypt(Inputbase64, privKey)

 

  // decrypt text using RSA

  set outputbase64 = $System.Encryption.RSADecrypt(encryptText, privKey)

 

  set plaintext = $SYSTEM.Encryption.Base64Decode(outputbase64)

 

  return plaintext

}

2 Comments
Discussão (2)1
Entre ou crie uma conta para continuar