查找

Announcement
· 4 min ago

Videos for InterSystems Developers, December 2025 Recap

Hello and welcome to the December 2025 Developer Community YouTube Recap.
InterSystems Ready 2025
By Jeffrey Fried, Dr Sankalp Khanna PhD
By Brenna Quirk, Jim Breen, Kim Koehler
By Thomas Dyar, Fernando Ferreira, Djeniffer Greffin, Claudio Laudeauzer, Holger Müller, Fabio Caré
By Boya Song
By Sean Kennedy
 
"Code to Care" videos
Using GenAI in Real Life: Daily Use Cases That Work
By Don Woodlock, Head of Global Healthcare Solutions, InterSystems
More from InterSystems Developers
SQL Tricks and Tips
By Ismail Ben Atitallah, Yiwen Huang
Smarter Table Statistics
By Yuchen Liu, Minhao Li
10th Anniversary of the InterSystems Developer Community
By InterSystems Developer Community Team
Developer Community Timeline - 10th Anniversary Edition
By InterSystems Developer Community Team
Discussion (0)0
Log in or sign up to continue
Article
· 33 min ago 5m read

Exemplo de API REST para decodificar dados em base64

Olá a todos,

Sou eu de novo 😁. No artigo anterior, Writing a REST api service for exporting the generated FHIR bundle in JSON, nós geramos um recurso DocumentReference, com o conteúdo codificados em Base64.

 

Question!! Is it possible to write a REST service for decoding it? Because I am very curious what is the message data talking about🤔🤔🤔

Duvida!! É possível escrever um serviço REST para decodificar isso? Porque estou muito curioso para saber o conteúdo da mensagem 🤔🤔🤔

OK, Vamos começar!

1. Crie uma nova classe utilitária datagen.utli.decodefhirjson.cls para decodificar os dados dentro de DocumentReference
 

Class datagen.utli.decodefhirjson Extends %RegisteredObject
{
}

2. Escreva uma função Python decodebase64docref para
a. percorrer o bundle FHIR
b. encontrar o recurso DocumentReference
  -pegar o primeiro elemento em content
   - pegar o attachment do content
     - recuperar o data do attachment
c. decodificar os dados em Base64
 (essa parte pedi ajuda ao chatGPT😂🤫) 

Class datagen.utli.decodefhirjson Extends %RegisteredObject
{

ClassMethod decodebase64docref(fhirbundle = "") As %String [ Language = python ]
{
    # w ##class(datagen.utli.decodefhirjson).decodebase64docref()
    import base64
    import json

    def decode_discharge_summary(bundle_json):
        """
        Extracts and decodes the Base64-encoded discharge summary note
        from a FHIR Bundle containing a DocumentReference.
        """
        for entry in bundle_json.get("entry", []):
            resource = entry.get("resource", {})
            if resource.get("resourceType") == "DocumentReference":
                # Traverse to the attachment
                content_list = resource.get("content", [])
                if not content_list:
                    continue
                attachment = content_list[0].get("attachment", {})
                base64_data = attachment.get("data")
                if base64_data:
                    decoded_text = base64.b64decode(base64_data).decode("utf-8")
                    return decoded_text
        return None


    # Example usage
    # Load your FHIR Bundle JSON from a file or object
    #with open("fhir_bundle.json", "r") as f:
    #    fhir_bundle = json.loads(f)
    if fhirbundle=="":
        rtstr=f"⚠️ No input found - JSON string is required."
        jsstr={"operation_outcome" : rtstr}
        return json.dumps(jsstr, indent=2)

    fhir_bundle = json.loads(fhirbundle)
    decoded_note = decode_discharge_summary(fhir_bundle)

    if decoded_note:
        #print("📝 Decoded Discharge Summary:\n")
        #print(decoded_note)
        rtstr=f"📝 Decoded Discharge Summary:\n {decoded_note}"
    else:
        #print("⚠️ No DocumentReference with Base64 note found.")
        rtstr=f"⚠️ No DocumentReference with Base64 note found."
    jsstr={"data" : rtstr}
    return json.dumps(jsstr, indent=2)
}

}

 

Para testar essa função, eu tentei fazer um pequeno truque, que é usar a função genfhirbundle para gerar um bundle FHIR em string JSON, conforme mostrado no artigo anterior Writing a REST api service for exporting the generated FHIR bundle in JSON 
 

Vamos gerar um bundle FHIR e armazená-lo em uma variável chamada jsonstr.
 

set jsonstr=##class(datagen.utli.genfhirjson).genfhirbundle(1)

Depois, teste a função de decodificação decodebase64docref   usando jsonstr.

w ##class(datagen.utli.decodefhirjson).decodebase64docref(jsonstr)

OK 😉. Parece tudo certo. Agora posso ler a mensagem decodificada.


 

Agora, voltando ao artigo anterior e ao anterior a esse, Writing a REST api service for exporting the generated patient data in .csv.

Gostaríamos de adicionar uma nova função e atualizar a rota da classe datagen.restservice.

1. Adicionar uma nova função DecodeDocRef, que deverá processar o bundle FHIR enviado no corpo da requisição em formato JSON.

Ou seja, neste caso esperamos um POST.

O conteúdo do corpo é empacotado por padrão como %CSP.BinaryStream e armazenado na variável %request.Content, então podemos usar o método .Read()   da classe %CSP.BinaryStream para ler o BinaryStream.

ClassMethod DecodeDocRef() As %Status
{
    // get body - json string
    #dim bistream As %CSP.BinaryStream =""
    set bistream=%request.Content
    set jsstr=bistream.Read()
    
    //decode the Document Reference data
    w ##class(datagen.utli.decodefhirjson).decodebase64docref(jsstr)
    return $$$OK
}

 

2. Depois, adicionamos uma rota para o REST service e compilamos 😀

<Route Url="/decode/docref" Method="POST" Call="DecodeDocRef" />

 

a classe  datagen.restservice atualizada ficará parecida com o seguinte:

 


Perfeito!😁

Vamnos testar no postman!!

Envie uma chamada POST para o seguinte caminho:

localhost/irishealth/csp/mpapp/decode/docref

com o seguinte corpo (eu simplifiquei o bundle FHIR, você pode testar com o completo 😀)

{
    "resourceType": "Bundle",
    "type": "transaction",
    "id": "98bfce83-7eb1-4afe-bf2b-42916512244e",
    "meta": {
        "lastUpdated": "2025-10-13T05:49:07Z"
    },
    "entry": [
        {
            "fullUrl": "urn:uuid:5be1037d-a481-45ca-aea9-2034e27ebdcd",
            "resource": {
                "resourceType": "DocumentReference",
                "id": "5be1037d-a481-45ca-aea9-2034e27ebdcd",
                "status": "current",
                "type": {
                    "coding": [
                        {
                            "system": "http://loinc.org",
                            "code": "18842-5",
                            "display": "Discharge summary"
                        }
                    ]
                },
                "subject": {
                    "reference": "9e3a2636-4e87-4dee-b202-709d6f94ed18"
                },
                "author": [
                    {
                        "reference": "2aa54642-6743-4153-a171-7b8a8004ce5b"
                    }
                ],
                "context": {
                    "encounter": [
                        {
                            "reference": "98cd848b-251f-4d0b-bf36-e35c9fe68956"
                        }
                    ]
                },
                "content": [
                    {
                        "attachment": {
                            "contentType": "text/plain",
                            "language": "en",
                            "data": "RGlzY2hhcmdlIHN1bW1hcnkgZm9yIHBhdGllbnQgOWUzYTI2MzYtNGU4Ny00ZGVlLWIyMDItNzA5ZDZmOTRlZDE4LiBEaWFnbm9zaXM6IFN0YWJsZS4gRm9sbG93LXVwIGluIDIgd2Vla3Mu",
                            "title": "Discharge Summary Note"
                        }
                    }
                ]
            },
            "request": {
                "method": "POST",
                "url": "DocumentReference"
            }
        }
    ]
}

Funcionou bem!!!😆😉

Muito obrigado pela leitura. 😘

Discussion (0)1
Log in or sign up to continue
Discussion (2)3
Log in or sign up to continue
Announcement
· Jan 9

InterSystems Developer Ecosystem News, Q4 2025

Hello and welcome to the Developer Ecosystem News!

The fourth quarter of the year was full of exciting activities in the InterSystems Developer Ecosystem. In case you missed something, we've prepared a selection of the hottest news and topics for you to catch up on!

News

🎇 2025 in Review - Celebrate Your Year with Developer Community!

🎆 Season’s Greetings to the Developer Community

🔔 New interface of the DC AI Chat!

📝 InterSystems Platforms Update Q4-2025

👨‍💻 Free Hands-On Online Tutorials for New InterSystems IRIS Developers

🔔 How to submit Bug Reports via the Ideas Portal

⌨ October and November Article Bounty on Global Masters

📝 InterSystems Developer Community GitHub

🎃 Halloween on Global Masters

🔧 Developer Community AI Is Taking a Break

🔧 Developer Community Search Update

🛠️ Maintenance Notice Dec 26, 2025

📝 Celebrating 1,000 Certifications

Contests & Events

 
InterSystems .Net, Java, Python, and JavaScript Contest
 
"Improving the Initial Developer Experience" Sweepstakes

🤝 Security & AI Meetup for Developers and Startups

🤝 AI Meetup for Developers and Startups

📺 [Webinar in Spanish] From Data to Knowledge: Harnessing Clinical Information with InterSystems and AI

📺 [Webinar in Dutch] Data exchange in healthcare according to the FHIR standard with Python

👩‍💻 InterSystems at Hack Jak Brno Healthcare Hackathon 2025

Latest Releases

⬇️ InterSystems Announces General Availability of InterSystems IRIS, InterSystems IRIS for Health, and HealthShare Health Connect 2025.3

⬇️ Maintenance Releases 2025.1.2 and 2024.1.5 of InterSystems IRIS, IRIS for Health, & HealthShare HealthConnect are now available

⬇️ Announcing Availability of Adaptive Analytics 2025.4.1

⬇️ Release Notes: InterSystems Cloud Services – Version 25.24.1 (November 2025)

⬇️ 2025.3 Modernizing Interoperability User Experience

⬇️ Client SDKs available on external repositories

⬇️ "IntegratedML Custom Models" Early Access Program

Best Practices & Key Questions

❓ Key Questions: October, November, December (TBA)

People and Companies to Know About 

👩‍🏫 Meet Henry Hamon Rodrigues Pereira - New Developer Community Moderator!

👩‍🏫 Celebrating a Guiding Voice in the Developer Community

👩‍🏫 Celebrating a Curious Mind of the Developer Community

So...

Here is our take on the most interesting and important things! 

What were your highlights from this past quarter? Share them in the comments section, and let's remember the fun we've had!

Discussion (0)2
Log in or sign up to continue
Article
· Jan 9 4m read

Sty Magazines: A Modern Digital Platform for Trends, Stories, and Inspiration

In today’s fast-paced digital world, people are constantly searching for reliable platforms that offer quality content, fresh perspectives, and meaningful stories. This is where Sty Magazines stands out as a modern and versatile online magazine designed to inform, inspire, and engage readers from around the globe.

Unlike traditional magazines that focus on only one niche, Sty Magazines follows a general and lifestyle-oriented approach, making it suitable for a wide audience. Whether you are interested in trends, business insights, technology updates, lifestyle topics, or informative articles, Sty Magazines delivers well-structured and reader-friendly content.

What Is Sty Magazines?

Sty Magazines is a digital magazine platform that publishes high-quality articles across multiple categories. The goal of the platform is to provide valuable information without relying on spammy keywords or misleading headlines. Instead, it focuses on originality, clarity, and usefulness.

As online readers become more selective, platforms like Sty Magazines play a crucial role in maintaining trust. Every article is crafted with proper research, clean formatting, and an easy-to-read tone that appeals to both casual readers and professionals.

Why Sty Magazines Is Different

One of the biggest strengths of Sty Magazines is its content diversity. Rather than limiting itself to a single topic, it covers a broad range of subjects, including:

  • Lifestyle and modern living
  • Business and entrepreneurship
  • Technology and digital trends
  • Online platforms and services
  • Informative and educational topics

This variety helps the website attract a wider audience and keeps readers engaged for longer periods, which is essential for SEO and long-term growth.

Another key difference is the clean and professional approach. Sty Magazines avoids unnecessary promotional content and focuses on genuine value. This makes it a trustworthy source for readers and a strong platform for brands and contributors.

SEO-Friendly and User-Focused Content

Search engines today prioritize websites that focus on user experience and quality content. Sty Magazines is built with this principle in mind. Articles are optimized using natural keyword placement, proper headings, and structured paragraphs.

The keyword “sty magazines” is used organically throughout the content, ensuring better visibility without keyword stuffing. This balanced approach helps the website rank higher while maintaining readability.

Additionally, the website structure supports easy navigation, fast loading, and mobile responsiveness, all of which contribute to better search engine performance.

A Platform for Writers and Contributors

Sty Magazines is not just a reading platform; it also serves as an opportunity for writers, bloggers, and content creators. Contributors can share their ideas, knowledge, and expertise with a global audience.

Publishing on Sty Magazines allows writers to:

  • Build authority in their niche
  • Gain exposure through a reputable platform
  • Improve their online presence
  • Share valuable insights with real readers

This collaborative approach helps the platform grow while maintaining content quality.

Building Trust Through Authentic Content

In an era where misinformation spreads quickly, Sty Magazines focuses on authentic and meaningful content. Each article aims to educate or inspire rather than mislead. This commitment to authenticity helps build long-term trust with readers.

Trust is one of the most important ranking factors for search engines, and Sty Magazines understands this well. By maintaining content integrity, the platform strengthens its reputation and online visibility.

The Future Vision of Sty Magazines

The future of Sty Magazines looks promising. With consistent publishing, SEO optimization, and audience-focused strategies, the platform has the potential to become a leading digital magazine.

As more readers move toward online media, Sty Magazines aims to:

  • Expand its content categories
  • Collaborate with expert writers
  • Improve user engagement
  • Maintain high editorial standards

This long-term vision ensures sustainable growth and strong brand identity.

Final Thoughts

Sty Magazines represents the new generation of online magazines—clean, informative, and user-focused. By combining quality content with smart SEO practices, it provides value to readers while building a strong digital presence.

If you are looking for a platform that delivers meaningful articles across multiple topics, Sty Magazines is the right choice. With dedication, consistency, and quality publishing, it is well on its way to achieving long-term success in the digital publishing world.

Discussion (0)1
Log in or sign up to continue