查找

記事
· 2025年11月20日 4m read

Consumiendo API REST para principiantes (apto para novatos)

Como desarrollador que usa IRIS como base de datos en un par de proyectos, uso APIs REST todo el tiempo. En mi opinión, saber cómo consumir un recurso de una API REST es crucial para poder utilizar APIs REST externas con %Net.HttpRequest, porque permite la integración con aplicaciones y servicios web modernos, y es una habilidad esencial para un desarrollador backend que ama y utiliza IRIS como base de datos.

¿Qué es y para quién sirve %Net.HttpRequest?

Es solo una clase, pero es la forma adecuada de hacer solicitudes fuera del framework. Es una clase sencilla que proporciona métodos HTTP como GET, POST y PUT, además de otros métodos de solicitud, os permite “jugar” con los encabezados, crear la solicitud como queráis y gestionar la respuesta que recibáis. Por cada solicitud enviada usando %Net.HttpRequest, recibimos un objeto %Net.HttpResponse que contiene la respuesta con el mismo patrón.

Una forma adecuada de manejar solicitudes a APIs REST con %Net implica comprobar tanto el valor devuelto por %Status como los códigos de estado de la respuesta, lo cual os permite generar mensajes de error específicos y filtrar las respuestas cuando la solicitud falla. La forma recomendada es usar macros como $$$ISER() o $SYSTEM.Status.IsOK(). También podemos usar $SYSTEM.Status.DisplayError() para inspeccionar el código de estado HTTP y gestionarlo.

Antes de empezar a ensuciarnos las manos, debemos saber quién es JSONPlaceholder, así que en el sitio oficial dicen:

"API falsa, gratuita y fiable para pruebas y prototipos"

Y eso es exactamente lo que es: una API REST gratuita en línea para experimentar. Son datos falsos, incluso podemos enviar datos con POST, pero esta guía trata únicamente de consumir datos, así que centrémonos en eso. Y este es un ejemplo sencillo de cómo consumir un JSON desde un servicio REST API.

Set request = ##class(%Net.HttpRequest).%New()
Set request.Server = "jsonplaceholder.typicode.com"
Set status = request.Get("/posts/1")

If $$$ISERR(status) {
    Do $SYSTEM.Status.DisplayError(status)
    Quit
}

Set response = request.HttpResponse
Set httpStatus = response.StatusCode
Set body = response.Data.Read()

If httpStatus < 200 || httpStatus >= 300 {
    Write "HTTP Error: ", response.StatusLine, !
    Quit
}

Write "HTTP Status: ", response.StatusLine, !
// Do what ever you want with it!

¿Qué hacemos?

  1. Asignar “request” a una nueva instancia del objeto %New.HttpRequest.
  2. Asignar una ubicación/dirección a la propiedad Server en la instancia de request.
  3. Hacer una solicitud GET al endpoint que proporcionamos a la función “/posts/1”, lo que significa que pedimos datos de “posts” con id igual a 1 (para obtener solo el primer mensaje; podemos especificar solo “posts” y obtenerlos todos; es bueno trastear con ello).
  4. Comprobar si hay algún error en la función usando $$$ISERR con el estado devuelto por el método GET de la solicitud. Si no lo hay, la solicitud se envió correctamente desde nuestro endpoint.
  5. Asignar la variable response desde el propio objeto request.
  6. Extraer el código de estado y el cuerpo.
  7. Comprobar si el código de respuesta es OK. Si el código devuelto es mayor que 200 y menor o igual que 300, está OK (307 es una redirección, así que no es lo que necesitamos aquí).

Entonces, en perspectiva general, ¿qué estamos haciendo aquí?

  1. Crear una solicitud predefinida usando la clase
  2. Intentar consumir los datos que necesitamos
  3. Gestionar los casos tanto de error como de éxito

Si todo va bien, deberíais obtener algo así como un objeto JSON:

Y así es como consumimos datos de una API REST, pero ¿qué podemos hacer con ello?
Veamos cómo extraer los datos de la respuesta:

Set reponseBodyAsJSON = {}.%FromJSON(body)

Write "id: ", reponseBodyAsJSON.id, !
Write "title: ", reponseBodyAsJSON.title, !
Write "body: ", reponseBodyAsJSON.body, !

De esta manera, dividimos la respuesta en pares clave-valor como debe ser un JSON.
Así es como podemos acceder y consumir fácilmente un recurso de una API REST usando el método GET y la clase %Net.HttpRequest. Esta es una guía realmente apta para principiantes que os permite tener una “visión general” de cómo lo hacemos.

Aprender la magia de las APIs REST es vuestro deber.

Como este tema es muy accesible, podéis experimentar fácilmente haciendo solicitudes y probando diferentes métodos. En la próxima guía veremos cómo transferir datos de forma segura entre dos servicios basados en REST.

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

InterSystems IRIS, InterSystems IRIS for Health, HealthShare Health Connect 2025.3 のリリースのご案内

インターシステムズは InterSystems IRIS®InterSystems IRIS® for HealthTMHealthShare® Health Connect のバージョン 2025.3 をリリースしました。
2025.3 は Continuous Delivery(CD)リリースです。
 

【リリースハイライト】
Secure Wallet(セキュアウォレット)
  IRISSECURITY データベース上に構築された、新しい暗号化フレームワークで、機密データ管理を強化し、システムのセキュリティとアクセス制御を向上しました。

拡張されたオブザーバビリティとクラウド連携
  OpenTelemetry メトリクスが強化され、新たにプロセスおよび ECP メトリクスを追加しました。さらに、ジャーナルアーカイブが Azure Blob Storage に対応し、コスト効率の高い保管が可能になりました。

データ & AI の改善
  外部テーブルで JOIN のプッシュダウンがサポートされ、SQL パフォーマンスが向上しました。ベクトル検索では高速かつ堅牢な類似検索を実現する改良版 HNSW インデックスを導入しました。

ヘルスケア機能の強化
  FHIR Bulk Data Access と認証機能が改善されました。

開発者 & UI のアップデート
  Interoperability UI に一括管理アクションや、プロダクション構成内での拡張検索機能が追加され、大規模プロダクションでも使いやすいユーザビリティを実現し、モダンなユーザー体験をさらに強化します。

より良い製品を一緒に作り上げていくために、これらの機能強化に対するフィードックを開発者コミュニティで共有してください。
 

【ドキュメント】
注目の機能についての詳細は、以下のリンクからご覧いただけます (すべて英語) :

・InterSystems IRIS 2025.3 ドキュメントリリースノート

・InterSystems IRIS for Health 2025.3 ドキュメントリリースノート

・Health Connect 2025.3 ドキュメントリリースノート

さらに、アップグレードの影響に関するチェックリストでは、このリリースにアップグレードする際に注意する必要があるすべての変更点の概要を簡単に確認できます。
 

【早期アクセス・プログラム (EAP)】
現在、多くの EAP が用意されています。このページより興味のあるものに登録してください。こちらから登録できます
 

【ソフトウェアの入手方法】
通常通り、Continuous Delivery (CD) リリースには、サポートされているすべてのプラットフォーム用のクラシックインストールパッケージと Dockerコンテナ形式のコンテナイメージが付属しています。
 

【クラシックインストールパッケージ】
インストールパッケージは、InterSystems IRIS および InterSystems IRIS for Health 用は WRC の InterSystems IRIS のページから、Health Connect 用は HealthShare  のページから入手できます。さらに、キットは評価サービスのウェブサイトにもあります。
 

【Availability と Package の情報】
このリリースには、サポートされているすべてのプラットフォーム用のクラシック・
インストール・パッケージと Docker コンテナ形式のコンテナ・イメージが付属して
います。 一覧については サポート対象プラットフォーム をご参照ください。

この Continuous Delivery のビルド番号は次のとおりです : 2025.3.0.226.0

このリリースには、InterSystems Container Registry から入手可能な Dockerコンテナ形式のコンテナ・イメージが付属しています。IRIS コンテナには "2025.3""latest-cd" の両方のタグが付けられています。

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

How to Generate a UK Postcode Instantly for Online Forms and Testing

When you’re developing websites, testing online forms, or running software demos, having access to quick and valid postcode formats can save significant time. Many forms require users to enter a postcode to proceed, especially in e-commerce, delivery services, and address validation systems. Instead of searching manually for sample postcodes, knowing how to generate a UK post code instantly can make your workflow smoother and more efficient. This guide explains how postcodes work, why they’re essential in testing environments, and the smartest methods to generate them whenever you need.

Why You May Need a UK Postcode for Testing

In today’s digital landscape, most websites rely heavily on location-based data. Whether you’re building a checkout system, a booking platform, or a CRM, your forms probably need a postcode field. Developers, QA testers, and UX designers often require valid postcodes that follow the correct structure.

Using a correctly formatted UK post code helps you:

  • Test address lookup APIs
  • Validate input fields
  • Check error messages
  • Ensure smooth form submission
  • Simulate customer locations in different regions
  • Run geographical segmentation tests

Instead of using real addresses—which may raise privacy issues—sample postcodes provide a safe and reliable alternative.

Understanding the UK Postcode Format

Before generating a postcode, it’s important to understand the structure. A UK post code follows a logical alphanumeric pattern consisting of two main parts:

1. Outward Code (e.g., SW1A)

This directs mail to a specific region and local sorting office.

  • One or two letters for the area (e.g., SW = South West London)
  • One or two numbers for the district
  • Sometimes one extra letter for subdivisions, especially in cities

2. Inward Code (e.g., 1AA)

This pinpoints the exact delivery sector and address cluster.

  • A single number to identify the sector
  • Two final letters to identify the delivery point

A complete UK postcode looks like this: SW1A 0AA

Common valid examples include:

  • EC1A 1BB
  • W1A 0AX
  • M1 1AE
  • L1 8JQ

Having this structure in mind ensures that any postcode you generate will pass validation in most systems.

Methods to Generate a UK Postcode Instantly

Here are the most reliable ways to quickly create a valid UK post code for online forms and testing.

1. Use Test-Friendly Sample Postcodes

Many developers prefer using well-known sample postcodes used across documentation and demos. These postcodes are real and recognised by most systems:

  • SW1A 1AA – Buckingham Palace
  • SW1A 0AA – UK Parliament
  • EC1A 1BB – Common testing code used in API documentation
  • W1A 0AX – BBC Broadcasting House

These are universally accepted and ideal for simple tests.

2. Generate Random Valid Postcodes Manually

If you prefer creating custom test postcodes, you can follow this simple pattern:

Format:

  • Choose a real UK area code: AB, B, BN, BS, BT, DE, E, G, L, M, NE, N, RG, SE, W, YO, etc.
  • Add 1–2 digits for the district: 1, 12, 3, 9
  • Add a space
  • Add a sector digit (0–9)
  • Add two letters (avoid C, I, K, M, O, V for technical reasons)

Example you can create on the fly:

  • BN2 6TP
  • G12 4DR
  • M4 2FH

These will pass most validation formats because they follow official structure.

3. Use Online Postcode Generators

Several online tools allow you to instantly generate a UK post code. They offer random, valid-format postcodes ideal for testing. Look for features such as:

  • Random postcode generation
  • Region-specific selection (London, Scotland, Wales, etc.)
  • Bulk postcode generation for large-scale tests
  • CSV download options

These tools are fast and reliable, especially when you need multiple postcodes for API or database testing.

4. Use Postcode Data Files for Large-Scale Testing

If your application handles high-volume address data, downloading a full postcode dataset is useful.

You can obtain official datasets containing thousands of real postcodes with complete address information. Developers often use these for:

  • Load testing
  • Address autocomplete training
  • Mapping and geo-targeting
  • E-commerce location simulations

These datasets provide both accuracy and flexibility.

5. Use API-Based Testing Tools

If your project integrates services like:

  • Google Maps APIs
  • Royal Mail PAF
  • Postcodes.io
  • Loqate or other address validators

You can also generate sample postcodes directly through API calls. This method is especially helpful when verifying postcode lookups, distance calculations, or geographic segmentation.

Best Practices for Using Postcodes in Testing

To get the most accurate results when testing online forms or software systems, remember these tips:

  • Always use a properly formatted UK post code to avoid false errors.
  • Use region-specific postcodes when testing location-based services.
  • Avoid using real residential addresses unless absolutely necessary.
  • Use a mix of urban and rural postcodes to simulate real-world scenarios.
  • Load-test systems with thousands of sample postcodes before going live.

These practices ensure that your forms behave correctly under all user conditions.

Conclusion

Generating a UK postcode instantly is easy once you understand how postcodes are structured and where to find reliable test codes. Whether you’re completing an online form, debugging an address validation system, or simulating user input for software development, having correctly formatted examples is essential.

With methods ranging from sample postcodes to online generators and API-driven tools, you can quickly access or create any UK post code you need for testing. As digital systems continue to rely heavily on accurate location data, mastering postcode generation will make your development and testing workflows smoother, faster, and more efficient.

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

Strategic Accounting and Advisory Excellence for Modern Businesses

Faber LLP is a leading accounting and advisory firm based in Edmonton, Canada, known for blending technical excellence with a client-centered approach. The firm is dedicated to helping businesses, entrepreneurs, and individuals navigate the complexities of finance and taxation with confidence. By combining the personalized attention of a boutique firm with the comprehensive capabilities of a full-service accounting practice, Faber LLP delivers solutions that are both strategic and practical.

The firm’s services span a broad spectrum, including tax planning and compliance, corporate reorganizations, mergers and acquisitions, estate and trust taxation, cross-border taxation, and advisory services. Faber LLP also assists clients in claiming research and development (R&D) credits and other innovation-related incentives, helping businesses leverage every available opportunity for growth. Their advisory services go beyond traditional accounting, offering insights into business strategy, operational efficiency, and financial planning, acting as a trusted partner in decision-making.

At the core of Faber LLP’s approach is a commitment to integrity, transparency, and long-term client relationships. The team understands that every client’s situation is unique, which is why they deliver tailored guidance that aligns with specific goals and circumstances. Whether helping startups structure their finances for future growth, advising established companies on strategic expansions, or assisting individuals with complex tax planning, Faber LLP ensures clients receive informed, actionable, and forward-thinking advice.

By combining expertise, innovation, and a client-first philosophy, Faber LLP empowers businesses and individuals to achieve their financial objectives while navigating Canada’s dynamic economic and regulatory landscape. Their focus on proactive planning, strategic problem-solving, and ethical guidance makes them a trusted partner for those seeking clarity, stability, and growth in their financial affairs.

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

クライアントSDKを外部リポジトリから入手いただけます

コミュニティのみなさまに嬉しいお知らせです。

今年冒頭より、InterSystems IRIS, InterSystems IRIS for Health, Health Connect 向けの多くのクライアントSDKが、各外部リポジトリ (Maven, NuGet, npm, PyPI)に公開されております。これにより、ユーザのみなさまに以下のような多くのメリットがあります。

  • クライアントSDKのリリースは、InterSystems IRISのリリースサイクルと独立しており、SDKの最新版が公開されるとすぐに入手いただけます。
  • ネイティブパッケージ管理ツールを利用し、エコシステム内で依存関係としてSDKを統合できます。また業界標準の方法で依存関係を管理いただけます。
  • エンドユーザーが DBeaver などのSQLツールを通じてデータベース層へ直接アクセスする必要がある場合、SDKに直接アクセスできます。
  • InterSystems クライアントSDKをプロジェクトに直接含めることなく、依存関係のあるプロジェクトを公開できます。

これまでに公開したクライアントSDKの一覧、最新のリリースバージョン番号、および入手先は以下のとおりです。

Java

.NET

Node.js

Python

 

今後は、クライアントSDKの新バージョンがリリースされ次第、外部リポジトリに公開されます。つまり、外部リポジトリが、今後のクライアントSDKの主要な配布チャネルとなります。

クライアントSDKのご利用については https://www.intersystems.com/IERTU/ に記載されている利用規約が適用されます。 

外部リポジトリをまだご利用でない方は、ぜひお試しください。いつもどおり、みなさまからのフィードバックを心よりお待ちしております。

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