发布新帖

查找

文章
· 一月 25 阅读大约需 7 分钟

Destaque de Busca FHIR 2025.1 - Suporte a Buscas Relacionadas a Listas (_List, $find, Listas Funcionais/"Atuais")

Às vezes é mais conveniente, eficiente e seguro limitar as Buscas FHIR por "Listas" de Recursos pré-definidas.

Desde a v2025.1, suportamos vários recursos relacionados a Listas em nosso Servidor FHIR.

Vou destacar estes recursos aqui e fornecer alguns exemplos.

Em geral, você pode ver os detalhes sobre o Recurso List na documentação oficial do FHIR.

Mas aqui está uma breve descrição baseada no link acima:

O Recurso FHIR List representa uma coleção plana (opcionalmente ordenada) de registros usados para listas clínicas (ex: alergias, medicamentos, alertas, históricos) e gerenciamento de fluxo de trabalho (ex: rastreamento de pacientes, casos de ensino).
Listas podem ser homogêneas (tipo de recurso único) ou heterogêneas (tipos mistos, ex: uma lista de problemas abrangendo Conditions, AllergyIntolerances e Procedures).
Use List quando precisar de um conjunto curado/filtrado que não pode ser obtido via uma consulta simples (ex: alergias “atuais” vs. todas as alergias registradas).
Consultar uma List produz um snapshot de um ponto no tempo curado por humanos, enquanto consultar o endpoint do recurso geralmente retorna um conjunto de dados mais amplo, não curado, “no estado atual”.

Em nossas versões mais recentes (2025.1+), você pode encontrar novos suportes para trabalhar com Listas:

  • O Parâmetro de Busca _list

Veja a documentação FHIR relacionada para uma descrição completa. Veja nossa Documentação relacionada para detalhes sobre o suporte disponível (especificamente sobre buscas em nível de Tipo vs. nível de Sistema).

Usando este recurso, você pode definir, por exemplo, uma Lista de certos Recursos (como Encounters ou Patients, etc.) pelos quais você deseja buscar, sem ter que detalhar todos eles como múltiplos Parâmetros de Busca.

Por exemplo, eu poderia definir uma Lista de Pacientes:

 
Snippet cURL PUT /List

E então buscá-los desta forma:

 
Snippet cURL GET /Patient?_list

E receber de volta uma lista curada dos Pacientes que eu queria, em vez de ter que "mencionar" todos eles em vários Parâmetros de Busca.

E, claro, existem muitos outros casos de uso.

  • Listas Funcionais (incluindo a Operação Customizada $update-functional)

Um tipo especial de listas são as Listas Funcionais (ou Listas de "Recursos Atuais").

Veja a documentação FHIR relacionada para uma descrição completa.

Para sua conveniência, aqui está uma breve descrição baseada no link acima:

Muitos sistemas clínicos mantêm listas de pacientes “atuais” (por exemplo, uma lista de problemas atual e uma lista de medicamentos atual), mas o FHIR não pode inferir com segurança a “atualidade” inspecionando uma única instância de recurso. Usando Condition como exemplo, o mesmo tipo de recurso pode ser postado para múltiplos propósitos legítimos (entrada de lista de problemas curada, queixa/diagnóstico de encontro, contexto de fluxo de trabalho diagnóstico ou dados de encaminhamento de entrada), e a Condition não possui nenhum elemento que distingua claramente esses usos. Como distinguir o atual vs. o passado exigiria alteração retrospectiva (criando preocupações de integridade e assinatura digital), uma busca normal em Condition para um paciente retornará mais do que apenas os “problemas atuais” curados, e limitá-la apenas ao “atual” ocultaria outros registros importantes de Condition. Portanto, se uma Condition (ou registro similar) está na “lista atual” de um paciente pode ser determinado pelo fato de estar ou não referenciada na List apropriada. Via API REST, isso é expresso através do mecanismo de busca de lista usando _list com nomes de listas funcionais padrão (ex: GET [base]/AllergyIntolerance?patient=42&_list=$current-allergies), e o servidor pode suportar isso sem necessariamente expor uma instância de List independente. Existem vários nomes de listas funcionais "comuns", como $current-problems, $current-medications, $current-allergies e $current-drug-allergies (um subconjunto de alergias).

Para permitir a manutenção dessas Listas Funcionais, definimos uma Operação Customizada, chamada $update-functional, que permite a criação e atualização desses tipos de listas. Veja mais detalhes em nossa Documentação.

Você pode definir uma lista de alergias atuais, por exemplo, assim:

 
Snippet cURL POST /List/$update-functional?for=...&name=$current-allergies

Isso criará/atualizará a Lista $current-allergies, para um paciente específico (ID 34 no exemplo acima)

Note que eu incluí o 'for=' na URL apontando ao ID do paciente, e na liste eu tenho o 'subject' referenciando o paciente.

(Note também que para o cifrão ($) eu usei uma barra invertida antes (\), ou seja: \$)

E agora, posso solicitar o Recurso AllergyIntolerance deste Paciente e, em vez de receber todos eles, posso pedir apenas os "atuais", conforme definido na Lista acima.

Isso ficaria assim:

 
Snippet cURL GET /AllergyIntolerance?patient=...&_list=$current-allergies

E isso retornaria um subconjunto das alergias deste Paciente, conforme a lista de alergias atuais.

Note que estamos usando o mesmo Parâmetro de Busca _list mencionado anteriormente, apenas desta vez com uma "Lista Funcional" em vez de uma "Lista Customizada".

Note que você pode controlar os nomes das listas funcionais (e para cada lista, seu Parâmetro de Busca subject e o Tipo de Recurso subject; por exemplo, no exemplo acima, o parâmetro de busca subject foi patient e o Tipo de Recurso subject foi Patient), através da configuração do Endpoint FHIR, especificamente em "Interactions Strategy Settings", veja a documentação relacionada aqui. A aparência é esta:

  • Operação $find

Além disso, se você simplesmente quiser obter a própria Lista Funcional (para um assunto específico e de um tipo específico), pode usar a operação $find.

Veja a documentação FHIR relacionada para uma descrição completa. E veja também nossa Documentação relacionada.

Aqui está um exemplo, seguindo o anterior:

 
Snippet cURL /List/$find?patient=...&name=$current-allergies

Isso retornará a lista $current-allergies relacionada para este Paciente, conforme definido acima via a função $update-functional.

 

Veja o aplicativo relacionado no Open Exchange que inclui uma Postman Collection com os exemplos acima (e um pouco mais) e instruções sobre como executar isso no container docker do FHIR server template de @Evgeny Shvarov (de fato, o exemplo acima foi criado com base neste modelo; com uma pequena alteração... veja detalhes nas instruções de uso do meu app).

Uma nota geral - toda essa funcionalidade assume que você está usando a Estratégia de Armazenamento JsonAdvSQL, que é relativamente nova e o padrão atual para o seu Endpoint. (Se relevante, veja aqui sobre a migração de uma Estratégia legada)
讨论 (0)1
登录或注册以继续
文章
· 一月 25 阅读大约需 5 分钟

Vibecoding Full Stack Applications With IRIS Backend in January 2026

How I Vibecoded a Backend (and Frontend) on InterSystems IRIS

I wanted to try vibecoding a real backend + frontend setup on InterSystems IRIS, ideally using something realistic rather than a toy example. The goal was simple: take an existing, well-known persistent package in IRIS and quickly build a usable UI and API around it — letting AI handle as much of the boilerplate as possible. Here is the result of the experiments.

Choosing the Data Model

For this experiment, I picked the Samples BI Demo. It’s good for vibecoding:

  • Contains several well-designed persistent classes
  • It’s widely known and easy to install
  • It already works nicely with IRIS BI

Installation is trivial using IPM:

zpm "install samples-bi-demo"

Once installed, I verified that everything worked correctly in IRIS BI. For convenience and a better browsing experience, I also installed DSW (DeepSee Web). and made sure that data is there and all works perfectly - here is the screenshot of installed data viwed by DSW:

Sampels Bi Demo shows the sales of an imaginary company HoleFoods that produces and sells products with Holes. The setup goes with HoleFoods package of persistent classes:

  • Product
  • Outlet
  • Country
  • Region
  • Transaction

Quite a match for a CRUD demo.

Vibecoding Setup

Here is my "vibecoding with IRIS" setup:

That’s it. No heavy scaffolding, no custom frameworks.

The UI Recipe

The architecture I followed is straightforward and repeatable:

  1. A frontend UI
  2. Communicating with IRIS via a REST API
  3. Defined by a Swagger (OpenAPI) specification
  4. Implemented natively in InterSystems IRIS ObjectScript and IRIS SQL.

Generating the Swagger API

In this approach, OpenAPI spec or Swagger is the middleman that both the frontend UI and IRIS understand. IRIS 2025.3 supports Swagger / OpenAPI 2.0 so I asked Codex to generate a CRUD-style API for one of the persistent classes — starting with Product. To make this easier for the AI, I exported the source code of the persistent classes from my local IRIS instance and shared them with Codex.

I decided to begin with a simple requirement:

A page to create, edit, list, and delete Products

To support this, I asked Codex to:

  • Generate a spec.cls Swagger definition
  • Make Product derive from %JSON.Adaptor
  • Follow the conventions and preferences described in my AGENTS.md file
    (basically accumulated “wisdom” from previous interactions)

I also chose a base API path:

/holefoods/api

Codex generated the class:

Holefoods.api.spec After compiling it, IRIS automatically produced two additional classes:

  • Holefoods.api.disp
    Always generated by IRIS and responsible for endpoint routing and request/response plumbing
  • Holefoods.api.impl
    Where the actual business logic lives - it goes with method stubs initially.

This is one of those IRIS features that feels almost magical when paired with vibecoding. Being thoughtful (or maybe cautious 😄), Codex asked:

  • Whether the web application should be registered in module.xml
  • What dispatch class name should be used

I confirmed both — which means the API is automatically created when IRIS starts - and it added web app setup in module.xml so the web app appears in IRIS with next docker rebuild or manual module load:

<CSPApplication
Url="/holefoods/api"
DispatchClass="HoleFoods.api.disp"
MatchRoles=":{$dbrole}"
PasswordAuthEnabled="0"
UnauthenticatedEnabled="1"
Recurse="1"
UseCookies="2"
CookiePath="/holefoods/api/"
CorsAllowlist="*"
CorsCredentialsAllowed="1"
CorsHeadersList="Content-Type,Authorization,Accept-Language,X-Requested-With,session"
/>

Security Setup

Anyone who has worked with IRIS knows that web applications + security can sometimes be… eventful. So I explicitly asked Codex to generate:

Holefoods.api.security.cls

, following the instructions in AGENTS.md

This class introduced the required security adjustments to enable the API development phase to run smoothly, but also clearly and easily escalatable to any higher security level, mostly focusing on all the security relations to a special role that is given to an application and thus projected to everyone who is logged into this application.

Implementing the API

Next step: implementation.

I asked Codex to fully implement the CRUD logic inside:

Holefoods.api.impl And it just did. At this point, everything was ready to test.

Testing with Swagger UI

To quickly validate the API, I installed Swagger UI:

zpm "install swagger-ui"

Important note (learned the hard way earlier):
Swagger UI requires a _spec endpoint, which must always be implemented in the impl class. Once that’s in place, Swagger UI works perfectly.

After restarting IRIS, I could see the full API definition exposed — and test it interactively.

The request:

GET /holefoods/api/products

returned some meaningful data. At this stage, the backend was essentially “done”.

Vibecoding the Frontend

With a working API and a clean Swagger spec, building the frontend becomes trivial. You have options:

  • Ask Codex to generate the frontend
  • Use tools like Lovable to scaffold a UI directly from the spec

I chose the latter — and within minutes had a working local UI connected to IRIS. After some testing (and fixing a small issue with deletion), the full round-trip experience was there: UI → API → IRIS → persistent storage. Here is the screenshot of the first result (It can be viewed locally at http://localhost:5174/ ):

 

Adding Unit Tests (Because Adults Do That)

The last missing piece was unit testing. I asked Codex to generate:

HoleFoods.api.Unittests.cls

covering all endpoints defined in the Swagger spec.

Once generated, I added the test class to the module configuration so tests could be run via IPM with this line

<UnitTest Name="/tests" Package="HoleFoods.api.tests" Phase="test"/>

so tests can be called as:

zpm "test esh-vibe-back-demo" 

And just like that, all API endpoints were covered and visible in the IRIS unit test portal:

Later I asked to add /transactions endpoint and Codex introduced code into spec class, has built the implementation in impl and introduced unit-tests. And has built a UI the result of which you can see here:

Final Thoughts

InterSystems IRIS + Swagger + vibecoding looks like a powerful and effective combination.

Yes, the result is a prototype —but almost real, and testable, built shockingly fast.

Here is the repository.

Leveraging AGENTS.md and conducting open source examples with best practices on dealing with the IRIS backend can boost the leverage of IRIS as a robust backend for comprehensive full-stack applications.

The coachable code-generation capability of OpenAI Codex or Claude Code opens the opportunity of building superperformant backends on IRIS, as the nature of any SQL on IRIS backend is no other than code generation over the globals traversing. 

P.S.

This article is written by a human and reviewed by AI for better English :)

P.P.S.

And as a bonus track - built the UI on Lovable too - so you can play with the online demo:

讨论 (0)1
登录或注册以继续
文章
· 一月 25 阅读大约需 2 分钟

How to customize SQL table and field names of classes in InterSystems IRIS

In InterSystems IRIS, when you compile a persistent class, you automatically get a SQL table. Sometimes, there are situations that require having a slightly (or not so slightly) different names/options in SQL compared to Object model. Here are some of the settings that you can change to make it happen.

Class-level settings 

They define the "Face" of your class when it appears as a table in the SQL catalog.

SqlTableName allows you to change the name of SQL table that holds objects from your class. This is especially useful, when your class name uses reserved SQL words in a name, e.g. Group.

Usage:

Class Banking.Group Extends %Persistent [ SqlTableName = Banking_Group ]
{ 

}

SqlRowIdName allows you to rename the default primary key column to something semantically meaningful. Every persistent class has a unique identifier, and by default it's called ID. Naming it PatientID or OrderID makes it much more readable and prevents naming collisions in complex queries.

Usage:

Class Banking.Account Extends %Persistent [ SqlRowIdName = AccID ]
{
    
}

DdlAllowed allows or prevents the table schema from being changed using SQL. For example, if you are a "Class-first" developer, you don't want a DBA accidentally running ALTER TABLE and desyncing the class definition. Setting this to Not DdlAllowed (default) ensures the Class is the "source of truth." Setting it to DdlAllowed allows standard SQL DDL commands to modify the class.

Usage:

Class Banking.Transaction Extends %Persistent [ DdlAllowed ]
{
    
}
Class Banking.Account Extends %Persistent [ Not DdlAllowed ]
{
    
}

Property-level settings

These parameters change how individual data points (properties) are projected as columns.

SqlFieldName allows to provide a different column name than the property name. 

Usage:

Property CurrentAmount As %Float [ SqlFieldName = Amount ];

SqlListType and SqlListDelimiter allow to define how "List" collections are stored and viewed in SQL. Since SQL is inherently "flat," it struggles with lists. The goal of these settings is to set the storage method that matches your performance needs for "Unnesting" the data in queries. There are several possible values for the SqlListType:

SUBNODE: Stores list items in a separate global, which is more efficient for large lists (like a default for an array).

DELIMITED: Stores items as a single string with delimiters set in SqlListDelimiter 

LIST: Stored items in $List() format in memory and on disk. This is the default.

Usage:

Property Currencies As list Of %String [ SqlListDelimiter = ";", SqlListType = DELIMITED ];

There are several more settings you can configure to change how your SQL data is represented compared to the object model. Go through the documentation to uncver them all!

讨论 (0)2
登录或注册以继续
问题
· 一月 25

I am getting ASTM messages in a single line instead of different lines like H|..../rQ|..../rL in the service. How can I resolve it?

I've modified the class file, but messages still arrive as a single line (e.g., "H|.../rQ|.../rL") instead of separate lines in the ASTM service. The <ENQ>..<EOT> header looks correct, logs show no errors, and the service receives messages fine. Is there an Ensemble 2018.1 engine setting (like line terminator handling or TCP framing) to fix the line splitting? ​

1 条新评论
讨论 (1)2
登录或注册以继续
Job
· 一月 25

What Is Machine Learning? Simple Explanation for Beginners

 

Machine Learning (ML) is one of the most exciting and important technologies in today’s digital world. It is a major part of Artificial Intelligence (AI) and is used in everything from social media and online shopping to healthcare and self-driving cars. But what exactly is machine learning, and how does it work?

In this beginner-friendly guide, you’ll learn what machine learning is, how it works, its types, real-life examples, benefits, challenges, and why it matters for the future.

What Is Machine Learning?

Machine Learning is a branch of Artificial Intelligence that allows computers to learn from data and improve their performance without being explicitly programmed.

In simple words, instead of telling a computer exactly what to do, we give it data and let it learn patterns from that data.

For example:

  • Email services use machine learning to filter spam messages.
  • Netflix uses machine learning to recommend movies and shows.
  • Banks use machine learning to detect fraud.

How Does Machine Learning Work?

Machine learning works by using data, algorithms, and models.

Data Collection

First, a large amount of data is collected. This data can be text, images, numbers, or videos.

Data Preparation

The data is cleaned and organized. Errors, duplicates, and missing values are removed.

Choosing an Algorithm

An algorithm is selected based on the type of problem. Different algorithms are used for different tasks.

Training the Model

The algorithm is trained using data. During training, the model learns patterns and relationships.

Testing and Prediction

The trained model is tested with new data. If the results are accurate, it can be used to make predictions.

Types of Machine Learning

There are three main types of machine learning:

Supervised Learning

In supervised learning, the model is trained using labeled data.

Examples:

  • Email spam detection
  • Price prediction
  • Image classification

Unsupervised Learning

In unsupervised learning, the model works with unlabeled data and finds hidden patterns.

Examples:

  • Customer segmentation
  • Recommendation systems
  • Data clustering

Reinforcement Learning

In reinforcement learning, the model learns by trial and error.

Examples:

  • Game-playing AI
  • Robotics
  • Self-driving cars

Real-Life Examples of Machine Learning

Machine learning is already part of our daily lives:

  • Social Media: Shows relevant posts and ads.
  • E-commerce: Recommends products.
  • Healthcare: Helps detect diseases.
  • Finance: Identifies fraud.
  • Voice Assistants: Understand speech.

Benefits of Machine Learning

Machine learning offers many advantages:

  • Automates repetitive tasks
  • Improves accuracy
  • Handles large amounts of data
  • Makes better predictions
  • Saves time and money

Challenges and Limitations of Machine Learning

Despite its benefits, machine learning also has challenges:

  • Requires large amounts of data
  • Can be biased
  • Needs high computing power
  • Difficult to explain decisions
  • Expensive to develop

Machine Learning vs Artificial Intelligence

Many beginners confuse machine learning with artificial intelligence.

  • Artificial Intelligence is the broader concept of making machines smart.
  • Machine Learning is a subset of AI that focuses on learning from data.

The Future of Machine Learning

The future of machine learning looks very promising. It will play a major role in:

  • Healthcare
  • Education
  • Business
  • Smart cities
  • Climate research

FAQs:

What is machine learning in simple words?

Machine learning means teaching computers to learn from data and make decisions on their own.

Is machine learning the same as artificial intelligence?

No. Machine learning is a part of artificial intelligence.

Where is machine learning used?

Machine learning is used in social media, healthcare, finance, online shopping, and voice assistants.

Do I need coding to learn machine learning?

Basic programming knowledge is helpful but not always required for beginners.

Is machine learning hard to learn?

It can be challenging at first, but beginners can learn it step by step.

Conclusion:

Machine learning is a powerful technology that allows computers to learn from data and make smart decisions. It is already transforming industries such as healthcare, finance, education, and entertainment. While machine learning offers many benefits like automation and better predictions, it also comes with challenges such as data bias, high costs, and privacy concerns.

For beginners, understanding the basics of machine learning is the first step toward exploring the world of artificial intelligence. As technology continues to evolve, machine learning will become even more important in shaping the future. Learning about machine learning today can help you stay prepared for tomorrow’s opportunities.

To continue learning with simple guides, tutorials, and the latest updates on artificial intelligence and machine learning, explore more content on AI With Arzan and stay connected with a platform dedicated to beginners and tech learners.

讨论 (0)1
登录或注册以继续