发布新帖

查找

文章
· 一月 29 阅读大约需 2 分钟

"隐藏的 HTTP 错误"(IIS 背后)

您发送了一个 HTTP 请求,但得到了一个 HTTP 错误,而且是一个您意想不到的 HTML 错误页面......这是怎么回事?

具体举例来说,也许您尝试读取 FHIR 资源(例如 /Patient/123),但得到的是 404 错误页面,尽管使用其他患者 ID 时,您得到的是资源有效载荷,因此 "页面 "肯定存在......为什么会得到 404 错误页面?

这些问题的答案与 IIS 网络服务器处理错误的行为有关。

IIS 有 3 个显示错误的选项:

  • 始终只显示自定义错误页面
  • 始终显示详细的服务器错误
  • 对本地请求显示详细错误,但对远程请求显示自定义错误页面。

最后一个选项(比始终显示详细错误)更安全,因为有时错误细节可能会暴露出不想让外部用户知道的内部信息。因此,这是 IIS 的默认设置。

但这意味着,如果您针对远程服务器进行测试,实际错误将被隐藏起来。因此,您需要将其更改为 "详细错误"(至少在调试阶段是这样,而且假设您考虑到了外部访问,也许会限制外部访问)。

有关此设置的更多详情,请参阅相关的 IIS 文章(您还可以查看我们文档中讨论此问题的相关部分)。

我提到的特定 FHIR 例子是一个有趣的案例,因为 404 错误可能仅仅意味着未找到特定的 FHIR 资源(您试图读取的 ID 不在存储库中),而不是服务器出现了某些问题("未找到页面")。

例如,如果您能看到详细的错误信息,就会看到类似下面的内容:

但如果没有详细的错误信息,你就会看到一个自定义的错误页面,就像这样:

这可能会引起误解,因此请牢记 IIS 设置。

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

embeddedpy-bridge: Un kit de herramientas para Python incrustado

Embeddedpy-bridge: Un kit de herramientas para Embedded Python

Visión general

Embedded Python es un cambio radical para InterSystems IRIS, ya que ofrece acceso al vasto ecosistema de Python directamente dentro de la base de datos. Sin embargo, salvar la brecha entre ObjectScript y Python a veces puede parecer bastante complicado.

Para hacer que esta transición sea fluida, podéis usar embeddedpy-bridge

Este paquete es un kit de utilidades orientado al desarrollador, diseñado para proporcionar wrappers de ObjectScript de alto nivel, sintaxis familiar y manejo robusto de errores para Python incrustado. Permite a los desarrolladores interactuar con estructuras de datos de Python usando los patrones nativos de IRIS con los que ya estáis familiarizados.

El reto

Aunque la biblioteca %SYS.Python  es poderosa, los desarrolladores a menudo se enfrentan a algunos obstáculos:

  1. Manejo de proxies: Navegar por listas y diccionarios de Python usando proxies sin procesar no se siente "nativo" en ObjectScript.
  2. Iteración: Los bucles While estándar de ObjectScript no "hablan" de forma nativa con los iteradores de Python.
  3. Gestión de espacios de nombres: Asegurar que las utilidades de Python estén disponibles en todo el sistema.

La solución:embeddedpy-bridge

Mi objetivo fue crear un "puente" que haga que Python se sienta como un ciudadano de primera clase dentro de ObjectScript.

Características clave:

  • Convención de prefijo py: Todos los métodos de la clase %ZPython.Utils usan el prefijo py   (por ejemplo, pyDict(), pyList() , pyJSON()) para distinguir claramente la lógica relacionada con Python del código nativo de IRIS.
  • Wrappers orientados a objetos: Clases de alto nivel para Listy Dict que soportan métodos familiares como GetAt(), SetAt() y Count().
  • Iteradores inteligentes: Los iteradores integrados ListIterator  y DictIteratorpermiten recorrer datos de Python usando bucles While estándar de ObjectScript.
  • Soporte de macros: Un archivo %ZPython.inc proporciona atajos como $$$pyDict y $$$pyJSON para un desarrollo más limpio y rápido.

Ejemplos de uso

1. Sintaxis simple (Macros)

Ya no tendréis que escribir ##class(...)  cada vez. Usad atajos:

  • $$$pyDict — Crear un diccionario de Python.
  • $$$pyList — Crear una lista de Python.
  • $$$pyJSON(dynObj) — Convertir un objeto JSON en Python al instante.

2. Manejo unificado de diccionarios

En lugar de gestionar proxies de Python sin procesar, usad el diccionario envuelto:

Fragmento 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. Conversión de datos sin interrupciones

Convertid objetos dinámicos de IRIS en objetos de Python y viceversa con una sola línea:

Fragmento 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

El objetivo de este proyecto es salvar la brecha entre dos mundos poderosos. Mientras que InterSystems IRIS proporciona el motor para Python incrustado, embeddedpy-bridge proporciona el volante.

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

改进 CCR 应用,实现最佳实践

在过去的一年中,CCR 开发团队优先考虑对 CCR 应用程序进行更改,以更好地展示和鼓励使用 CCR 的最佳实践。本文将重点介绍我们关注的一些领域:

  • 组织控制面板
  • 系统警报
  • 分支机构卫生

在上述每个领域,我们都提高了潜在 CCR 使用问题的可见性,并为用户提供了主动解决这些问题的工具。

组织控制面板

我们继续在 "组织 "详细信息页面上添加可用信息

概览(OverView)是全面了解组织 CCR 使用情况的好地方。现在,它包含了更多的关键绩效指标,突出显示了各种问题,并链接到 CCR 应用程序中您可以解决这些问题的页面。

系统选项卡包括有关所有环境中客户端工具状态的详细信息以及系统架构师信息。这里的警报会突出显示丢失的信息、不活动和过时的客户端工具,并链接到相应的系统。

组织详细信息页面上的其他选项卡也增加了更多详细信息,使组织的 CCR 使用情况一目了然。

系统警报

系统详情页是另一个提高可见性的区域,我们现在为许多 CCR 使用问题提供了警报。

新增了未设置 URL、不安全 URLS 和检测到的客户端工具问题的环境警报。悬停时会显示详细信息:

当 CCR 检测到系统的客户端工具已过期时,会出现提示,鼓励使用更新按钮。

6 个月内没有活动的系统现在会显示一个警告,如果不再使用该系统,可将其废弃,或点击此处的 "打盹 "按钮,将其视为下一年的活动系统。这适用于某些很少需要接收更新的系统。

系统分支卫生

系统分支卫生是了解系统的 Perforce 分支中现有问题的强大工具。它可在每个 1 级或 2 级系统的 "系统详细信息 "页面上使用。

该工具的核心功能已使用了一段时间,但最近的改进提高了对一些边缘情况的检测能力。

在成熟的系统上运行此检查,可以很好地识别将来可能会导致问题的任何项目。

结论

在这些领域以及整个 CCR 应用程序中,今年发生了许多变化,目的是促进 CCR 的最佳使用。未来的改进将侧重于进一步公开信息和开发工具,以帮助 CCR 用户更好地了解其系统并主动解决问题。

如果您对 CCR 应用程序鼓励最佳实践的方式有任何问题或建议,请在下面发表评论。

讨论 (0)1
登录或注册以继续
公告
· 一月 29

线上启动会:InterSystems 2026 全栈竞赛

Hi开发者们,

我们很高兴邀请大家参加即将举行的 InterSystems 全栈竞赛线上启动会

在此次线上研讨会上,您将发现本次竞赛中等待开发人员的激动人心的挑战和机遇。我们还将讨论希望参赛者涉及的主题,并向您展示如何使用 InterSystems IRIS 数据平台开发、构建和部署应用程序。

日期和时间:美国东部时间 2 月 2 日星期一下午 12:00 | 欧洲中部时间下午 6:00

演讲者
🗣 @Derek Gervais,开发人员关系布道师
🗣 @Evgeny Shvarov,开发人员和初创企业项目高级经理
🗣 @Raj Singh,开发人员体验产品经理

今天就注册参加启动仪式

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

pyprod: Pure Python IRIS Interoperability

Intersystems IRIS Productions provide a powerful framework for connecting disparate systems across various protocols and message formats in a reliable, observable, and scalable manner. intersystems_pyprod, short for InterSystems Python Productions, is a Python library that enables developers to build these interoperability components entirely in Python. Designed for flexibility, it supports a hybrid approach: you can seamlessly mix new Python-based components with existing ObjectScript-based ones, leveraging your established IRIS infrastructure. Once defined, these Python components are managed just like any other; they can be added, configured, and connected using the IRIS Production Configuration page. 


A Quick Primer on InterSystems IRIS Productions

Key Elements of a Production

Image from Learning Services training material

An IRIS Production generally receives data from external interfaces, processes it through coordinated steps, and routes it to its destination. As messages move through the system, they are automatically persisted, making the entire flow fully traceable through IRIS’s visual trace and logging tools. The architecture relies on certain key elements:

  1. Business Hosts: These are the core building blocks—Services, Processes, and Operations—that pass persistable messages between one another.
  2. Adapters: Inbound and outbound adapters manage the interaction with the external world, handling the specific protocols needed to receive and send data.
  3. Callbacks: The engine uses specific callback methods to pass messages between hosts, either synchronously or asynchronously. These callbacks follow strict signatures and return a Status object to ensure execution integrity.
  4. Configuration Helpers: Objects such as Properties and Parameters expose settings to the Production Configuration UI, allowing users to easily instantiate, configure, and save the state of these components.

Workflow using pyprod

This is essentially a 3 step process.

  1. Write your production components in a regular Python script. In that script, you import the required base classes from intersystems_pyprod and define your own components by subclassing them, just as you would with any other Python library.
  2. Load them into InterSystems IRIS by running the intersystems_pyprod (same name as the library) command from the terminal and passing it the path to your Python script. This step links the Python classes with IRIS so that they appear as production components and can be configured and wired together using the standard Production Configuration UI. 
  3. Create the production using the Production Configuration page and start the Production

NOTE: If you create all your components with all their Properties hardcoded within the python script, you only need to add them to the production and start the Production. 

You can connect pyprod to your IRIS instance by doing a one time setup


Simple Example

In this example, we demonstrate a synchronous message flow where a request originates from a Service, moves through a Process, and is forwarded to an Operation. The resulting response then travels the same path in reverse, passing from the Operation back through the Process to the Service. Additionally, we showcase how to utilize the IRISLog utility to write custom log entries.

Step 1

Create your Production components using pyprod in the file HelloWorld.py

Here are some key parts of the code

  • Package Naming: We define iris_package_name, which prefixes all classes as they appear on the Production Configuration page (If omitted, the script name is used as the default prefix).
  • Persistable Messages: We define MyRequest and MyResponse. These are the essential data structures for communication, as only persistable objects can be passed between Services, Processes, and Operations.
  • The Inbound Adapter: Our adapter passes a string to the Service using the business_host_process_input method.
  • The Business Service: Implemented with the help of OnProcessInput callback.
    • MyService receives data from the adapter and converts it into a MyRequest message
    • We use the ADAPTER IRISParameter to link the Inbound Adapter to the Service. Note that this attribute must be named ADAPTER in all caps to align with IRIS conventions.
    • We define a target IRISProperty, which allows users to select the destination component directly via the Configuration UI.
  • The Business Process: Implemented with the help of OnRequest callback.
  • The Business Operation: Implemented with the help of OnMessage callback. (You can also define a MessageMap)
  • Logic & Callbacks: Finally, the hosts implement their core logic within standard callbacks like OnProcessInput and OnRequest, routing messages using the SendRequestSync method.

You can read more about each of these parts on the pyprod API Reference page and also using the Quick Start Guide.

import time

from intersystems_pyprod import (
    InboundAdapter,BusinessService, BusinessProcess, 
    BusinessOperation, OutboundAdapter, JsonSerialize, 
    IRISProperty, IRISParameter, IRISLog, Status)

iris_package_name = "helloworld"

class MyRequest(JsonSerialize):
    content: str

class MyResponse(JsonSerialize):
    content: str

class MyInAdapter(InboundAdapter):
    def OnTask(self):
        time.sleep(0.5)
        self.business_host_process_input("request message")
        return Status.OK()

class MyService(BusinessService):
    ADAPTER = IRISParameter("helloworld.MyInAdapter")
    target = IRISProperty(settings="Target")
    def OnProcessInput(self, input):
        persistent_message = MyRequest(input)
        status, response = self.SendRequestSync(self.target, persistent_message)
        IRISLog.Info(response.content)
        return status

class MyProcess(BusinessProcess):
    target = IRISProperty(settings="Target")
    def on_request(self, input):
        status, response = self.SendRequestSync(self.target,input)
        return status, response


class MyOperation(BusinessOperation):
    ADAPTER = IRISParameter("helloworld.MyOutAdapter")
    def OnMessage(self, input):
        status = self.ADAPTER.custom_method(input)
        response = MyResponse("response message")
        return status, response


class MyOutAdapter(OutboundAdapter):
    def custom_method(self, input):
        IRISLog.Info(input.content)
        return Status.OK()

 

Step 2

Once your code is ready, load the components to IRIS.

$ intersystems_pyprod /full/path/to/HelloWorld.py

    Loading MyRequest to IRIS...
    ...
    Load finished successfully.
    
    Loading MyResponse to IRIS...
    ...
    Load finished successfully.
    ...
    

Step 3

Add each host to the Production using the Production Configuration page.

The image below shows MyService and its target property being configured through the UI. Follow the same process to add MyProcess and MyOperation. Once the setup is complete, simply start the production to see your messages in motion.


Final Thoughts

By combining the flexibility of the Python ecosystem with the industrial-grade reliability of InterSystems IRIS, pyprod offers a modern path for building interoperability solutions. Whether you are developing entirely new "Pure Python" productions or enhancing existing ObjectScript infrastructures with specialized Python libraries, pyprod ensures your components remain fully integrated, observable, and easy to configure. We look forward to seeing what you build!


Quick Links

GitHub repository  

PyPi Package

Support the Project: If you find this library useful, please consider giving us a ⭐ on GitHub and suggesting enhancements. It helps the project grow and makes it easier for other developers in the InterSystems community to discover it!
讨论 (0)1
登录或注册以继续