查找

Artigo
· Set. 16 2min de leitura

Custom File Adapter - Lookup Table / Dynamic Files

My problem was separating HL7 messages by message type.  I had to create multiple File Operations.  So I with custom code I am able to use 1 File Adapter for 1 interface and multiple message types.  I did experiment pulling the MSH 4 out of the raw content to further access dynamic information, but that may open a need for more robust error checking / lookup default actions.

Using the recommended naming convention of "To_FILE_<IntegrationName>"

I decided to use a generic file name and path in the default settings.

I created a custom class that extended the EnsLib.File.OutboundAdapter  With some custom code that allows me to dynamically control file adapter path specific to each message type via a lookup table.  If I don't have a value then the default generic path will be used.  Otherwise my code will override the File Path and File Name.  Lookup table name can be anything, just needs to match in your code.


 

Custom Code

//SRC1 Pull  3rd piece name of the outbound operation name "<IntegrationName>"

//SRC2 Pull the 1st piece of the DOCTYPE NAME  "ORM" / "ADT" / "ORU" / etc..

// Set a new variable SRC to concatenate the SRC1_SRC2 together

//New Lookup table that will control path names all in one place.

 

Set src1=$PIECE(..%ConfigName,"_",3,3)
Set src2=$PIECE(pDocument.DocTypeName,"_",1,1)
If src=""
{
Set src=src1_"_"_src2
} Set pFilename = ..Adapter.CreateFilename(##class(%File).GetFilename(src), $PIECE((##class(Ens.Rule.FunctionSet).Lookup("HL7FileNamePath",src)),"^",2,2)_..Filename) $$$TRACE(pFilename)
//Reset file path to return a file path based on the Lookup and PIECE function(s)
Set ..Adapter.FilePath =$PIECE((##class(Ens.Rule.FunctionSet).Lookup("HL7FileNamePath",src)),"^",1,1)
$$$TRACE(..Adapter.FilePath)
Set tSC = ..Adapter.open(pFilename) Quit:$$$ISERR(tSC) tSC
Set $ZT="Trap"
Use ..Adapter.Device  Set tSC=..OutputFramedToDevice(pDocument,pSeparators,"",0,..IOLogEntry,.pDoFraming) Use ..Adapter.OldIO
Set $ZT=""

Discussão (0)1
Entre ou crie uma conta para continuar
Anúncio
· Set. 16

Kick-off Webinar for InterSystems .Net, Java, Python, and JavaScript Contest

Hey Community,

We're pleased to invite all the developers to the upcoming kick-off webinar for the InterSystems .Net, Java, Python, and JavaScript Contest!

During the webinar, you will discover the exciting challenges and opportunities that await developers in this contest. We will also discuss the topics we would like the participants to cover and show you how to develop, build, and deploy applications using the InterSystems IRIS data platform.

Date & Time: Wednesday, September 24 – 11:30 am EDT | 5:30 pm CEST  

Speakers:  
🗣 @Derek Gervais, Developer Relations Evangelist, InterSystems
​​​🗣 @Evgeny Shvarov, Senior Manager of Developer and Startup Programs, InterSystems
🗣 @Stefan Wittmann, Product Manager, InterSystems
​​​🗣 @Raj Singh, Product Manager - Developer Experience, InterSystems

✅ Register for the kick-off today!

Discussão (0)2
Entre ou crie uma conta para continuar
Pergunta
· Set. 16

HL7 Pass-through interface

For historic reasons we've got a mix of ADT feeds coming out of our PAS (TrakCare) to a wide range of downstream systems. In particular, there are some that are direct from TrakCare to the downstream systems, and many more that pass through Ensemble as our integration engine.

This is complicating management of the integrations, and so we'd like everything to go through the integration engine. In other words move from the flow in the top of the diagram to the flow in the bottom of the diagram:

So we want to build a couple of pass-through interfaces in Ensemble that respond identically to the current direct feeds - no transformations, and all ACK behaviour is transparent so that the only change visible to the TrakCare PAS is a change of IP/port for each of the currently direct feeds.

Should be easy, right? An HL7 TCP Service, possibly a routing process that simply passes everything on, and an HL7 TCP Operation that is connected to the downstream...

But what is happening is that the Router Process is generating an ACK and sending it back to the Service before the ACK comes back from the downstream. (I've faked a downstream, manually populated the ACK its sending back so I can definitely identify it. I can see it arriving in Ensemble - but after an ACK is sent to the upstream via the Service.) See the annotated message trace below:

Any pointers to what to be looking at?

I'm aware of Important HL7 Scenarios | Routing HL7 Version 2 Messages in Productions | InterSystems IRIS for Health 2025.1 and the Settings for HL7 Services, linked from there, but not seeing what we might have set wrong...

Thanks, Colin

6 Comments
Discussão (6)3
Entre ou crie uma conta para continuar
Artigo
· Set. 16 3min de leitura

Do "Ops!" ao "Aha!" - Evitando erros de principiante no ObjectScript

Começar a usar ObjectScript é realmente empolgante, mas também pode parecer um pouco estranho se você está acostumado com outras linguagens. Muitos iniciantes tropeçam nos mesmos obstáculos, então aqui estão alguns "pegadinhas" que você vai querer evitar. (Além de algumas dicas amigáveis para contorná-las.)


Nomear Coisas Aleatoriamente

Todos nós já fomos culpados de nomear algo como Test1 ou MyClass apenas para seguir em frente rapidamente. Mas quando seu projeto cresce, esses nomes se tornam um pesadelo.

➡  Escolha nomes claros e consistentes desde o início. Pense nisso como deixar um rastro para o seu "eu" do futuro e para seus colegas de equipe.


Confundir Globais e Variáveis

Globais (^GlobalName) podem ser confusas no começo. Eles não são apenas variáveis normais. Eles vivem no banco de dados e persistem mesmo depois que seu código para de rodar.

➡ Use-os apenas quando você realmente precisar de dados persistentes. Para todo o resto, use variáveis locais. (Isso também economiza armazenamento.)


Esquecer Transações

Imagine atualizar um registro de paciente e sua sessão travar na metade. Sem uma transação, você fica com dados incompletos.

➡ Envolva atualizações importantes em TSTART/TCOMMIT. É como apertar "salvar" e "desfazer" ao mesmo tempo.


Construir SQL em Strings

É tentador simplesmente colocar SQL em strings e executá-lo. Mas isso rapidamente se torna confuso e difícil de depurar.

➡ Use SQL embutido. É mais limpo, mais seguro e mais fácil de manter.

EXEMPLO:

❌ Construindo SQL em Strings

Set id=123
Set sql="SELECT Name, Age FROM Patient WHERE ID="_id
Set rs=##class(%SQL.Statement).%ExecDirect(,sql)

✅ Usando SQL Embutido

&SQL(SELECT Name, Age INTO :name, :age FROM Patient WHERE ID=:id)
Write name_" "_age,!

Ignorar o Tratamento de Erros

Ninguém gosta de ver seu aplicativo travar com uma mensagem enigmática. Isso geralmente acontece quando o tratamento de erros é ignorado.

➡Envolva operações arriscadas em TRY/CATCH e forneça a si mesmo mensagens de erro significativas.



Deixar de Usar Ferramentas Melhores

Sim, o terminal funciona. Mas se você só codifica por lá, está perdendo muito.

➡ Use o VS Code com a extensão ObjectScript. A depuração, o autocompletar e o destaque de sintaxe tornam a vida muito mais fácil.


Reinventar a Roda

Novos desenvolvedores frequentemente tentam escrever suas próprias utilidades para registro ou manipulação de JSON, sem perceber que o ObjectScript já tem soluções integradas.

➡ Explore a %Library e os objetos dinâmicos antes de criar os seus.


Escrever "Código Misterioso"

Todos nós já pensamos: "Vou me lembrar disso depois."

⚠️SPOILERVOCÊ NÃO VAI!

Adicione comentários curtos e claros. Mesmo uma única linha explicando por que você fez algo ajuda muuuito.


 

Considerações Finais : )

Aprender ObjectScript é como aprender qualquer outra língua nova. É preciso um pouco de paciência, e você cometerá erros ao longo do caminho. O segredo é reconhecer essas armadilhas comuns cedo e construir bons hábitos desde o início. Dessa forma, em vez de lutar contra a linguagem, você realmente aproveitará o que ela pode fazer. :)

Discussão (0)1
Entre ou crie uma conta para continuar
Artigo
· Set. 16 1min de leitura

Reviews on Open Exchange - #55

If one of your packages on OEX receives a review you get notified by OEX only of YOUR own package.   
The rating reflects the experience of the reviewer with the status found at the time of review.   
It is kind of a snapshot and might have changed meanwhile.   
Reviews by other members of the community are marked by * in the last column.

I also placed a bunch of Pull Requests on GitHub when I found a problem I could fix.    
Some were accepted and merged, and some were just ignored.     
So if you made a major change and expect a changed review, just let me know.

 

# Package Review Stars IPM Docker *
1 potato-analytics Pleasure to run 5.5 y y  
2 Beyond-Server-Limits hidden backdor 5.0   y *
3 csp-fileview-download nice Docker availale IPM ready 5.0 y y  
4 Full-OBJ-Dump nice helper 5.0 y y *
5 TaskScheduler OK, room for improvement 4.8 y y  
6 IRISFHIRServerLogs builds OK 4.6 y y  
7 customer-support-agent-demo IRIS runs fine 4.5   y  
8 MessageLogViz listing filtered text 4.0 y y  
9 iris-mock-server missing some parts 3.5 y y  
5 Comments
Discussão (5)3
Entre ou crie uma conta para continuar