検索

お知らせ
· 2024年11月9日

Top Videos for InterSystems Developers in October 2024

Hey Community,

Here is a digest of the Developer Community videos on InterSystems Developers YouTube Channel in October 2024:

 

Stay tuned with InterSystems Developers YouTube!

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
記事
· 2024年11月8日 4m read

第十五章 IRIS 进程之间的通信

第十五章 IRIS 进程之间的通信

本页介绍如何在两个或多个 IRIS 数据平台进程之间建立通信。

介绍

作业间通信 (IJC) 设备是一组特殊设备编号,可让在两个或多个 IRIS 进程之间传输信息。这些流程可以是作业流程或交互式流程。

IJC 设备成对工作。最多可以有 256IJC 设备对。使用称为接收器的偶数设备来读取数据。使用称为发送器的奇数设备来写入数据。尝试从发送器读取或写入接收器会导致 <NODEV> 错误。

可以向 IJC 设备发出 I/O 命令,就像向任何其他设备一样。向设备发出OPEN和USE命令后,进程可以发出:

  • 向接收器设备读取命令
  • 将命令写入发送器设备

一次只能有一个进程可以打开设备。

对基于 IRIS 设备表中映射的相对顺序,可以使用管理门户的配置选项查看和编辑该表。

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
お知らせ
· 2024年11月8日

[Video] How to Fail with AI (and how to succeed!)

Hi Community,

Play the new video on InterSystems Developers YouTube:

⏯ How to Fail with AI (and how to succeed!) @ Global Summit 2024

Learn the challenges organizations face when adopting AI, highlighting common pitfalls and offering a structured approach to successfully implementing AI projects. The importance of understanding AI is emphasized, starting with existing processes, and avoiding overhyped expectations. A six-step process for integrating AI into a business is outlined, including identifying pain points, mapping AI capabilities, and prioritizing use cases. The ultimate goal is to ensure that AI initiatives are aligned with business needs, are feasible, and deliver real value.  

🗣  Presenter: Tobias Zwingmann, Author & Managing Partner, RAPYD.AI

Enjoy watching, and expect more videos! 👍

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
質問
· 2024年11月8日

EnsLib.HL7.Message.getSegmentByIndex not documented?

Throughout the forum, I find examples of using the method getSegmentByIndex to get the segment as I loop through the HL7 message segments.

Today I spent way too long trying to figure out why I could not modify the segment with this same method. I reached out to my more experienced team and I showed where I got the base code from what I was doing, but I myself could not find the documentation of the method.

1 Comment
ディスカッション (1)2
続けるにはログインするか新規登録を行ってください
記事
· 2024年11月8日 4m read

Usando o Python no InterSystems IRIS – Exportando dados para o Excel

Usando o Python no InterSystems IRIS

Vamos neste breve artigo ver como podemos utilizar o python como linguagem de programação dentro o InterSystems IRIS. Para o nosso exemplo vamos criar um método que exporta os dados de uma tabela do IRIS para um arquivo no formato XLS (MS-Excel). Para isso vamos utilizar a biblioteca pandas do python.

Primeiro, vamos ver a nossa tabela.:

Class Demo.Alunos Extends (%Persistent, %Populate)
{

Property name As %String(MAXLEN = 100);

Property dob As %Date(FORMAT = 4);

Property sex As %String(VALUELIST = ",F,M");

Property course As %String(VALUELIST = ",Engenharia,Arquitetura,Direito,Artes,Letras,Psicologia,Musica");

Property note1 As %Integer(MAXVAL = 10, MINVAL = 0);

Property note2 As %Integer(MAXVAL = 10, MINVAL = 0);

Property debt As %Boolean;

}

Note que estamos utilizando a superclasse %Populate na nossa classe Demo.Alunos. Esta superclasse nos permite popular a nossa tabela com dados que serão criados baseado no tipo de cada propriedade. Para mais detalhes do %Populate veja o link https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GOBJ_populate

Compilada nossa classe, vamos abrir o terminal do Iris e pedir para criar 100 registros na nossa tabela:

Após criar os registros vamos verificar como ficou a nossa tabela. Abra o SQL Explorer no Portal de Administração do IRIS e veja o conteúdo da tabela:

 

Pronto. Temos nossa tabela criada e populada com 100 registros. Agora precisamos ver o python. Veja o link da documentação do IRIS a seguir: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=AFL_epython

Este link apresenta a documentação de instalação do python no IRIS para os diversos ambientes, e também o uso do irispip (até o IRIS 2024.1) ou pip (a partir do IRIS 2024.2) para a instalação de pacotes.

Uma vez instalado e configurado o python vamos abrir o shell python a partir do terminal do IRIS apenas para verificar se está tudo ok. Veja a tela a seguir:

Ótimo. Estamos com o ambiente montado e pronto para avançarmos. Vamos agora para o pacote que vamos utilizar, o pandas. Para maiores detalhes sobre este pacote veja o link a seguir: https://pandas.pydata.org/

Instale o pandas no seu ambiente obedecendo a documentação do IRIS. Veja o diretório de instalação dos pacotes e qual utilitário (irispip ou pip) usar (vai depender da sua versão de IRIS).

No meu ambiente (IRIS 2024.1) o comando seria, via shell do Windows, ir para o diretório bin da instalação do IRIS e executar o seguinte comando:

.\irispip install --target c:\InterSystems\IRIS_ISS\mgr\python pandas

No meu exemplo o pacote pandas será instalado em mgr\python da minha instalação de IRIS. Veja o caminho para mgr\python da sua instalação e ajuste o comando.

 Instalado o pandas vamos ao código do nosso método que exporta os dados para o Excel:

Class Python.Exporta [ Abstract ]
{

ClassMethod tabela() As %Status [ Language = python ]
{

              import iris
              import pandas as pd
             
              rs = iris.sql.exec("select * from demo.alunos")
              df = rs.dataframe()

              # Salvar o DataFrame como um arquivo XLS
              caminho_arquivo = 'c:\\temp\\dados.xlsx'
              df.to_excel(caminho_arquivo, index=False)
             
              return True
}

}

Salve e compile a classe. Uma vez criado o código vamos executa-lo via terminal:

 

Pronto. Agora é só ir até o local de criação e abrir a tabela:

 

O código python é bem simples. Primeiro criamos um recordset a partir do comando SQL para recuperar as linhas da nossa tabela. Depois convertemos esse recordset em um dataframe pandas. Então usamos o dataframe para exportar os dados no formato XLS.

Este é um exemplo simples de uso do python. Existem várias bibliotecas úteis prontas e disponíveis para uso.

Até a próxima!

1 Comment
ディスカッション (1)2
続けるにはログインするか新規登録を行ってください