新しい投稿

検索

記事
· 2026年1月4日 1m read

Carregando dados em servidores (locais ou remotos) diretamente pelo VS Code.

Tenho o prazer de anunciar a publicação do gj :: dataLoader, uma nova extensão do VS Code que simplifica a tarefa de carregar dados de arquivos CSV locais em tabelas SQL dos seus servidores InterSystems IRIS.

Aqui está um vídeo introdutório:

gj :: dataLoader já está disponível no Marketplace para instalação direta no VS Code. É a minha proposta para o concurso “Bringing Ideas to Reality” 2025 e coloca em prática esta ideia: https://ideas.intersystems.com/ideas/DPI-I-667

Seus comentários serão bem-vindos.

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

Reviews on Open Exchange - #61

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 UNICAS Implementation OLÉ ! 5.5 y y  
2 UDP very handy and easy to follow 5.0   y *
3 Testify clear improvement 4.9 y y  
4 integratedml-demo-template expired license fixed 4.7   y  
5 ConfigSettingsExtract works OK 4.4   y  
6 InterSystems IRIS GraphRAG A huge piece 4.4   y  
7 dc-toon Useful tool 4.0     *
8 iris-localization-lab container is ok 4.0 y y  
9 Kano MDM partner posting        
10 TC52 HC Mobile Computer partner posting        
11 QuWiki partner posting        
12 Veromo Pty Ltd partner posting        
13 Logi Composer partner posting        
14 hackupc ???        


NOTE:
If some review is not readable for you, it might still wait for approval by OEX admins.

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

Construindo fluxos de integração de forma simples com o InterSystems IRIS

🚀 Um exemplo prático integrando REST, CSV, bancos de dados e serviços SOAP

No dia a dia de qualquer organização, a informação flui entre aplicações, serviços e sistemas muito diferentes entre si. Integrá-los de forma eficiente pode ser um desafio… a menos que você use o InterSystems IRIS.

Neste novo vídeo, eu mostro como construir um fluxo completo de integração combinando múltiplas tecnologias — APIs REST, arquivos CSV, bancos de dados e serviços SOAP — tudo dentro do ambiente visual oferecido pelo motor de interoperabilidade do IRIS.

👉 Você pode assistir ao vídeo aqui:

https://www.youtube.com/embed/82xA51nThqQ?si=CzRfwyLSwcKvOGGH
[これは埋め込みリンクですが、あなたはサイト上の埋め込みコンテンツへのアクセスに必要な Cookie を拒否しているため、それを直接表示することはできません。埋め込みコンテンツを表示するには、Cookie 設定ですべての Cookie を受け入れる必要があります。]

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

Defining REST API using iris-rest-api-template - Need guidance

Defining my first REST API within InterSystems using iris-rest-Api-template as a basis and I am seeing if someone could provide me some guidance to see if I can make it work.  

In some of my other posts, I have been trying to come up with a way for our Enterprise Application Development team which works with .Net to build Applications to make a REST call to our instance of InterSystems to query some of the Cache Tables we have defined. 

Using the iris-rest-api-template, I have created the osuwmc.DataLookup.REST.Base.cls

Class osuwmc.DataLookup.REST.Base Extends %CSP.REST [ System = 3 ]
{

Parameter CHARSET = "utf-8";
Parameter CONTENTTYPE = "application/json";
Parameter HandleCorsRequest = 1;
Parameter PAGESIZE As INTEGER = 50;
ClassMethod OnPreDispatch(pUrl As %String, pMethod As %String, ByRef pContinue As %Boolean) As %Status
{
  SET tSC = $$$OK
  TRY {
    
    // Set the return type according to the Accept type in the request. Default is application/json.
    IF ('..AcceptsContentType(..#CONTENTTYPEJSON)) {
      SET tSC = ..ReportHttpStatusCode(..#HTTP406NOTACCEPTABLE), pContinue=0
      QUIT
        } ELSE {   
      // This always returns json
      SET %response.ContentType=..#CONTENTTYPEJSON
        }
        
        
        // read request object into %DynamicObject format
    IF ((pMethod'="POST") && (pMethod'="PUT")) || (%request.Content="") {
      SET %request.Content = {}
    } ELSE {
      IF '$isobject(%request.Content) {
        SET tContent = %request.Content
      } ELSE {
        SET tContent = ""
        WHILE '%request.Content.AtEnd {
          SET tContent = tContent_%request.Content.Read()
        }
      }
      IF (tContent="") {
        SET %request.Content = {}
      } ELSE {
        SET tContent = $zconvert(tContent, "I", "UTF8")
        SET %request.Content = ##class(%Library.DynamicObject).%FromJSON(tContent)
      }
    }
        
  } CATCH ex {
    SET tSC = ex.AsStatus()
  }
  QUIT ##class(%iKnow.REST.Base).%ErrorHandler(tSC, .pContinue)
}

ClassMethod %ProcessResult(pStatus As %Status = {$$$OK}, pResult As %DynamicObject = "") As %Status [ Internal ]
{
  #dim %response As %CSP.Response
  SET tSC = $$$OK
  IF $$$ISERR(pStatus) {
    SET %response.Status = 500
    SET tSC = ..StatusToJSON(pStatus, .tJSON)
    IF $isobject(tJSON) {
      SET pResult = tJSON
    } ELSE {
      SET pResult = { "errors": [ { "error": "Unknown error parsing status code" } ] }
    }
  } 
  ELSEIF pStatus=1 {
    IF '$isobject(pResult){
      SET pResult = {
      }
    }
  }
  ELSE {
    SET %response.Status = pStatus
    SET error = $PIECE(pStatus, " ", 2, *)
    SET pResult = {
      "error": (error)
    }
  }
  
  IF pResult.%Extends("%Library.DynamicAbstractObject") {
    WRITE pResult.%ToJSON()
  }
  ELSEIF pResult.%Extends("%JSON.Adaptor") {
    DO pResult.%JSONExport()
  }
  ELSEIF pResult.%Extends("%Stream.Object") {
    DO pResult.OutputToDevice()
  }
  
  QUIT tSC
}

ClassMethod ReportHttpStatusCode(pHttpStatus, pSC As %Status = {$$$OK}) As %Status
{
  Set %response.Status=pHttpStatus
  
  If $$$ISERR(pSC) Do ..outputStatus(pSC)
  /*
  If (+pHttpStatus>=400) {
    Set %response.ContentType = "application/json"
    SET pResult = {
      "error": ($PIECE(pHttpStatus, " ", 2, *))
    }
    Return ..%ProcessResult($$$OK, pResult)
  }*/
  Return $$$OK
}

}

and the osuwmc.DataLookup.REST.TableLookup

Class osuwmc.DataLookup.REST.TableLookup Extends osuwmc.DataLookup.REST.Base
{

Parameter Version = "1.0.0";
Parameter GlobalName = "^OSUWMCDataLookup.TableLookup";
XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<Routes>  
    <!-- Server Info -->
    <Route Url="/" Method="GET" Call="GetInfo" Cors="true"/>
    <Route Url="/info" Method="GET" Call="GetAllEpicDepartments" Cors="true"/>
    </Routes>
}

ClassMethod GetInfo() As %Status
{
    SET version = ..#Version
    SET info = {
      "version": (version)
    }
    RETURN ..%ProcessResult($$$OK, info)
}

ClassMethod GetAllEpicDepartments() As %Status
{
    SET tSC = $$$OK
    set sql = "SELECT ID as DepartmentID, Abbr, Name, ExternalName, PhoneNumber, ApptPhone, FaxNumber, Address1, Address2, City, Zip, Specialty, RevLocID, RevLocName, BuildingCategoryID, BuildingName, DepCategoryTypeID, DepType, Center, EAFParent, CostCenter FROM osuwmc_Epic_Clarity.DepartmentMaster"
    do ##class(%ZEN.Auxiliary.jsonSQLProvider).%WriteJSONFromSQL(,sql)
    return tSC
}

ClassMethod GetEpicDepartment(ID As %String) As %Status
{
    SET tSC = $$$OK
    set sql = "SELECT ID as DepartmentID, Abbr, Name, ExternalName, PhoneNumber, ApptPhone, FaxNumber, Address1, Address2, City, Zip, Specialty, RevLocID, RevLocName, BuildingCategoryID, BuildingName, DepCategoryTypeID, DepType, Center, EAFParent, CostCenter FROM osuwmc_Epic_Clarity.DepartmentMaster WHERE ID = ?"
    do ##class(%ZEN.Auxiliary.jsonSQLProvider).%WriteJSONFromSQL(,,sql,ID)
    return tSC
}
ClassMethod SwaggerSpec() As %Status
{
  Set tSC = ##class(%REST.API).GetWebRESTApplication($NAMESPACE, %request.Application, .swagger)
  Do swagger.info.%Remove("x-ISC_Namespace")
  Set swagger.basePath = "/crud"
  Set swagger.info.title = "REST API to Access and Query OSUWMC Cache Tables"
  Set swagger.info.version = "0.1"
  Set swagger.host = "intengtest.osumc.edu"
  Return ..%ProcessResult($$$OK, swagger)
}

}

I defined the Web Application as /api/mgmnt/<namespace>/TableLookup with the osuwmc.DataLookup.REST.TableLookup as the Dispatch Class.

When I try to execute the REST call using POSTMAN, "msg": "ERROR #8754: Unable to use namespace: TABLELOOKUP."

If I try to use the sample class, I get a message saying that "The request URL was not found on the server" or a "404 Not Found"

I checked the Web Gateway to make sure the application was defined.

So, am I missing a step somewhere?

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

embeddedpy-bridge: Um kit de ferramentas para Embedded Python

Embeddedpy-bridge: Um kit de ferramentas para Embedded Python

Visão geral

Embedded Python é um divisor de águas para o InterSystems IRIS, oferecendo acesso ao vasto ecossistema Python diretamente dentro do banco de dados. No entanto, fazer a ponte entre ObjectScript e Python às vezes pode parecer como traduzir entre dois mundos diferentes.

Para tornar essa transição perfeitamente utilizável, embeddedpy-bridge.

Este pacote é um kit de utilidades focado em desenvolvedores, projetado para fornecer wrappers de alto nível em ObjectScript, sintaxe familiar e tratamento de erros robusto para o Python embarcado. Ele permite que os desenvolvedores interajam com estruturas de dados Python usando os padrões nativos do IRIS com os quais já estão acostumados.

O desafio

Embora a biblioteca %SYS.Python seja poderosa, os desenvolvedores frequentemente enfrentam alguns obstáculos:

  1. Tratamento de proxies: navegar por listas e dicionários Python usando proxies brutos não parece algo “nativo” do ObjectScript.
  2. Iteração: laçosWhile padrão do ObjectScript não “conversam” nativamente com iteradores Python.
  3. Gerenciamento de namespaces: garantir que utilitários Python estejam disponíveis em todo o sistema.

A Solução: embeddedpy-bridge

Meu objetivo foi criar uma “Ponte” que faça o Python se sentir como um cidadão de primeira classe dentro do ObjectScript.

Principais recursos:

  • Convenção de Prefixopy : Todos os métodos na classe %ZPython.Utils usam o prefixo py (por exemplo, pyDict(), pyList(), pyJSON()) para diferenciar claramente a lógica relacionada ao Python do código nativo do IRIS.
  • Wrappers Orientados a Objetos (OO): Classes de alto nível para ListDict que suportam métodos familiares como GetAt(), SetAt(), e Count().
  • Iteradores Inteligentes:ListIterator eDictIterator integrados permitem percorrer dados Python usando loops While padrão do ObjectScript.
  • Suporte a Macros: Um arquivo %ZPython.inc fornece atalhos como $$$pyDict$$$pyJSON para um desenvolvimento mais limpo e rápido.

Exempos de uso

1. Sintaxe Simples (Macros)

Chega de digitar ##class(...) toda vez. Use atalhos rápidos:

  • $$$pyDict — Cria um dicionário Python.
  • $$$pyList — Cria uma lista Python.
  • $$$pyJSON(dynObj) — Converte um objeto JSON em Python instantaneamente.

2. Manipulação Unificada de Dicionários

Em vez de lidar com proxies Python puros, use o dicionário encapsulado:

Exemplo de código:

Include %ZPython
Set pyDict = $$$pyDict
Do pyDict.SetAt("Status", "Active")
Do pyDict.SetAt("Version", 1.0)

// Standard IRIS iteration
Set iter = pyDict.%GetIterator()
While iter.%GetNext(.key, .val) {
    Write "Key: ", key, " Val: ", val, !
}

 

Set pyList = $$$zpyList()

Do pyList.Append("First Item")
Do pyList.Append("Second Item")

Write "Total items: ", pyList.Count(), !

// Access by index
Write "Item 1: ", pyList.GetAt(0), !

2. Conversão de Dados Sem Esforço

Converta objetos dinâmicos do IRIS em objetos Python e vice-versa com uma única linha:

Exemplo de código:

Set dynObj = {"name": "John", "roles": ["Admin", "User"]}
Set pyObj = $$$pyJSON(dynObj)

// Verify Python type
Write ##class(%ZPython.Utils).IsType(pyObj, "dict") // 1

O objetivo deste projeto é construir uma ponte entre dois mundos poderosos. Enquanto o InterSystems IRIS fornece o motor para o Python embutido, o embeddedpy-bridge fornece o volante.

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