发布新帖

查找

问题
· 二月 5

JSON Response Help - Extracting Data into Data Class or Iteration to Extract Data

I have always struggled with Iterating through a JSON response to pull out certain fields into a Data Class Structure to use to populate fields in a DTL. So I defined the whole structure for the following JSON, with the base structure extending Ens.Response, %XML.Adaptor, and %JSON.Adaptor.

{
    "status": {
        "message": "success",
        "code": 200
    },
    "data": {
        "client": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "entities": [
            {
                "id": "xxxxxxxxxxxxxxxxxx`",
                "name": "xxxxxxxxxxxxxxxxx",
                "totalCommentCount": 272,
                "totalRatingCount": 396,
                "totalSurveyCount": 396,
                "overallRating": {
                    "name": "Overall Satisfaction",
                    "value": 4.9,
                    "categoryResponseCount": 396,
                    "questionRatings": [
                        {
                            "name": "Provider listen carefully to you",
                            "value": 5.0,
                            "responseCount": 395
                        },
                        {
                            "name": "Provider expl in way you understand",
                            "value": 5.0,
                            "responseCount": 396
                        },
                        {
                            "name": "Talk with provider re prob/concern",
                            "value": 4.5,
                            "responseCount": 394
                        },
                        {
                            "name": "Know important info medical history",
                            "value": 4.9,
                            "responseCount": 393
                        },
                        {
                            "name": "Give easy to understand instruction",
                            "value": 4.9,
                            "responseCount": 347
                        },
                        {
                            "name": "Spend enough time with you",
                            "value": 4.9,
                            "responseCount": 395
                        },
                        {
                            "name": "Show respect for what you say",
                            "value": 5.0,
                            "responseCount": 395
                        }
                    ]
                },
                "comments": [],
                "PGSealOfIntegrity": {
                    "dataIntegrity": {
                        "horizontal": {
                            "darkBackground": {
                                "png": "xxxxxx"
                            },
                            "lightBackground": {
                                "jpg": "xxxxxxxxxxxxxxxxx",
                                "png": "xxxxxxxxxxxxxxxx"
                            },
                            "darkBackgroundHighResolution": {
                                "png": "xxxxxxxxxxxxxx"
                            }
                        },
                        "stacked": {
                            "darkBackground": {
                                "png": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"x
                            },
                            "lightBackground": {
                                "jpg": "xxxxxxxxxxxxxxxxx",
                                "png": "XXXXXXXXXXXXXXX"
                            }
                        }
                    },
                    "sealOfIntegrity": {
                        "darkBackground": {
                            "jpg": "XXXXXXXXXXXXXXXXXXXXXXXX",
                            "png": "XXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "lightBackground": {
                            "jpg": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
                            "png": "XXXXXXXXXXXXXXXXXXXXXXXXXX"
                        }
                    }
                },
                "totalPages": 14,
                "ratings": []
            }
        ],
        "filter": {
            "minThreshold": 0.0,
            "minRatingCount": 30,
            "minSurveyCount": 0,
            "minWordCount": 0,
            "days": 365,
            "page": 1,
            "perPage": 20,
            "showComments": false,
            "showRatings": true,
            "configVersion": "v2",
            "period": {
                "to": "2026-02-05T23:59:59Z",
                "from": "2025-02-05T00:00:00Z"
            }
        }
    }
}

The rest of the structure that is referenced by the base Response.cls structure extends %RegisteredObject, %JSON.Adaptor.

I am able to make the REST call, and the Response is populating into the Response.cls, however within the Trace Viewer the Response is blank. I know the data is there because when I send it to a DTL, I can pull the data elements out.

How do I make the Response show up within the Trace Viewer, or how would I go about extracting the values in RED below

                "id": "xxxxxx",

                "name": "xxxxxx",

                "totalCommentCount": 272,

                "totalRatingCount": 396,

                "totalSurveyCount": 396,

                "overallRating": {

                    "name": "Overall Satisfaction",

                    "value": 4.9,

4 条新评论
讨论 (4)3
登录或注册以继续
问题
· 二月 5

Splitting stream into HL7 messages

Hi,

I want to consume an API that provides HL7 messages. To achieve this, I have thought of the following workflow:

I have created a business service that periodically triggers a business process. The trigger request is forwarded to a business operation. There, a %Net.HttpRequest is assembled from scratch and then sent to the API endpoint. The corresponding HttpResponse then contains several HL7 messages encoded in UTF-8 in the message body. To further process the HL7 messages, the operation sends the HttpResponse back to the business process as EnsLib.HTTP.GenericMessage.

The raw data looks like this:

MSH|^~\&|Doctolib||Doctolib||20251028154100||SIU^S12|d50f01e649cda79faf29|P|2.5.1|||||FRA|UTF-8
SCH||20771389^Doctolib||||Vor.Tagesk^Vorgespräch für Tagesklinik|||||^^15^202511101000|||||117134^Mustermann^Stefan||||Doctolib|||||Booked
NTE|||Hier der Inhalt des Notizfeldes.  Achten Sie auf Umlaute: ä ö ü   (UTF-8)
PID|||56834111^^^Doctolib^PI||Testfrau^Liselotte^^^^^L||19690722|F|||||+4917612345678^^^liselotte@test.de~+4940123456
RGS|1
AIG|1|||Vorg-Tagesklinik^Vorgespräche Tagesklinik
MSH|^~\&|Doctolib||Doctolib||20251028154114||SIU^S13|39e482e10fa61ccd4500|P|2.5.1|||||FRA|UTF-8
SCH||20771389^Doctolib||||Vor.Tagesk^Vorgespräch für Tagesklinik|||||^^15^202511141600|||||117134^Mustermann^Stefan||||Doctolib|||||Booked
NTE|||Hier der Inhalt des Notizfeldes.  Achten Sie auf Umlaute: ä ö ü   (UTF-8)
PID|||56834111^^^Doctolib^PI||Testfrau^Liselotte^^^^^L||19690722|F|||||+4917612345678^^^liselotte@test.de~+4940123456
RGS|1
AIG|1|||Vorg-Tagesklinik^Vorgespräche Tagesklinik
MSH|^~\&|Doctolib||Doctolib||20251028154225||SIU^S17|1e5726345c7b4257b41f|P|2.5.1|||||FRA|UTF-8
SCH||20771388^Doctolib||||Vor.Tagesk^Vorgespräch für Tagesklinik|||||^^15^202511121600|||||117134^Mustermann^Stefan||||Doctolib|||||Deleted
NTE|||Hier der Inhalt des Notizfeldes
PID|||56834102^^^Doctolib^PI||Testmann^Heinrich^^^^^L||19881211|M|||||+4917612345678^^^heinrich@test.de~+4940123456
RGS|1
AIG|1|||Vorg-Tagesklinik^Vorgespräche Tagesklinik

 

The next step would be to split the message body into individual HL7 messages and then forward them accordingly. But splitting them up is causing me problems. In the message viewer, the stream is still displayed with line breaks. First, I tried to read the stream line by line and then save the individual streams in a collection (%ListOfObjects). However, the line breaks seem to get lost in the process.

Then I tried to save it in a collection of strings using the string “MSH|” (the start of the message) to split the stream. That worked, but unfortunately there were problems when converting the string to an EnsLib.HL7.Message because the framing did not fit.

How would you go about turning a stream with multiple HL7 messages into individual HL7 messages?

Regards

Robert

2 条新评论
讨论 (2)3
登录或注册以继续
Job
· 二月 5

Intersystems Cache & Iris Developer - Object Script. Remote (UK company)

Developer required to join a team working with and extending an existing CACHE application and subsequent migration to IRIS.

4yrs Minimum experience.

Applicants must have good general knowledge of development approaches and patterns.

SQL 

Opportunity from 6 Month contract to Permanent, depending on experience. Immediate start

Applications to chris.clipston@mtivity.com

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

Présentation des fonctions de fenêtre SQL (3ème partie)

Dans cette dernière partie de notre présentation des fonctions de fenêtre, nous allons explorer les fonctions restantes qui n'ont pas encore été abordées. Vous découvrirez également des conseils de performance et un guide pratique pour vous aider à décider quand il convient (ou non) d'utiliser efficacement les fonctions de fenêtre.

讨论 (0)2
登录或注册以继续
公告
· 二月 5

[Vídeo] Eliminando el miedo a FHIR: acelerando la preparación de la organización para FHIR

¡Hola comunidad!

Nos alegra compartir un nuevo vídeo de nuestro YouTube de InterSystems Developers:

Eliminando el miedo a FHIR: acelerando la preparación de la organización para FHIR @ Ready 2025

Los evangelistas de FHIR llevan más de una década promocionando el estándar, pero ¿qué se necesita para convertir la expectativa en realidad? Esta sesión explora los casos de uso específicos y las necesidades de diferentes organizaciones, destacando factores clave de éxito y lecciones aprendidas. Descubre cómo la formación basada en casos de uso puede ayudarte a aprovechar eficazmente las funcionalidades de FHIR en InterSystems IRIS for Health y HealthShare Unified Care Record.

🗣Ponente: @Chi Nguyen-Rettig, LEAD North

¿Te interesa conocer las mejores prácticas? ¡Mira el vídeo y suscríbete para ver más!

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