Nouvelle publication

Pesquisar

Question
· Avr 11

Subroutine execution issues in WorkMgr

Hello Community,

The subroutine ^routine is not executed while the queue is being processed in WorkMgr. However, it works when defined as a function. Is it mandatory to define subroutine^routine as a function for it to execute properly?

testwqm.mac
 set wqm = ##class(%SYSTEM.WorkMgr).%New()
 set sc=wqm.Queue("subr1^testwqm")  ; not executing the subr1 
 set sc=wqm.Queue("subr2^testwqm") ; executing the subr2 properly
 set sc=wqm.Queue("subr1") ; executing the subr1 properly
 quit
subr1
 set ^test("subr1",$NOW())=$LB($USERNAME,$ROLES)
 quit
 ;
subr2()
 set ^test("subr2",$NOW())=$LB($USERNAME,$ROLES)
 quit

Thanks!

3 Comments
Discussion (3)2
Connectez-vous ou inscrivez-vous pour continuer
Article
· Avr 11 2m de lecture

Configurar una conexión de tabla vinculada ODBC/JDBC a MySQL desde Iris

Debido a que la interpretación de SCHEMA por parte de MySQL difiere de la comprensión interpretación común en SQL (como se ve en IRIS, SQL Server u Oracle), nuestro asistente automático de tablas vinculadas puede encontrar errores al intentar recuperar la información de metadatos para construir la tabla vinculada.

(Esto también se aplica a procedimientos y vistas vinculadas)

Al intentar crear una tabla vinculada mediante el asistente, os encontraréis con un error que se parece a esto:

ERROR #5535: SQL Gateway catalog table error in 'SQLPrimaryKeys'. Error: ' SQLState: (HY000) NativeError: [0] Message: [MySQL][ODBC 8.3(a) Driver][mysqld-5.5.5-10.4.18-MariaDB]Support for schemas is disabled by NO_SCHEMA option

Para crear una tabla vinculada a una base de datos MySQL que emplea una estructura “sin esquema” (comportamiento predeterminado), seguid las instrucciones que aparecen a continuación:

  1. Cread una conexión SQL Gateway:
  • Configurad la conexión SQL Gateway como de costumbre.
  • Aseguraos de que la casilla "No usar identificadores delimitados por defecto" esté marcada.
  • Haced clic en "Probar conexión" para confirmar que la conexión es exitosa.

  1. Usad la API basada en Terminal para crear la tabla vinculada:
  • Utilizad la siguiente API: $SYSTEM.SQL.Schema.CreateLinkedTable() El método CreateLinkedTable() utiliza los siguientes parámetros:

CreateLinkedTable(dsn As %String, externalSchema As %String, externalTable As %String, primaryKeys As %String, localClass As %String = "User.LinkedClass", localTable As %String, ByRef columnMap As %String = "")

  • Ejemplo: En este ejemplo, usamos la tabla del sistema de MySQL help_keyword con name como clave primaria

USER>do $SYSTEM.SQL.Schema.CreateLinkedTable("MyDSN", "", "help_keyword", "name", "User.LinkedClass", "LocalTable")

Aseguraos de que todos los parámetros estén especificados correctamente para evitar cualquier error durante el proceso de configuración.

En cualquier caso, ¿estáis utilizando actualmente tablas vinculadas? os recomiendo que echéis un vistazo su evolución en InterSystems IRIS, las Foreign Tables

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Article
· Avr 11 10m de lecture

Iris における Django アプリケーションの実行

django_logo

説明

これは、ネイティブウェブアプリケーションとして IRIS にデプロイできる Django アプリケーションのテンプレートです。

インストール

  1. リポジトリをクローンする
  2. 仮想環境を作成する
  3. 要件をインストールする
  4. docker-compose ファイルを実行する
git clone
cd iris-django-template
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
docker-compose up

使用法

ベース URL は http://localhost:53795/django/ です。

Discussion (0)0
Connectez-vous ou inscrivez-vous pour continuer
Question
· Avr 10

HL7 control characters showing up - resolved

Business Process is adding control characters.

Input HL7 shows no control characters in Notepad ++

Output

Code:

Method FromCerner(pRequest As EnsLib.HL7.Message) As %Status
{
    #dim tStatus As %Status = $$$OK
    #dim eException As %Exception.AbstractException
    #dim tOBXText As %String
    #dim tItemNumberCount As %Integer = 0
    #dim tItemNumberProcessed As %Integer = 0
    #dim tTotalCostSegment As %Integer = 0
    #dim tOrderType As %String
    #dim As %Interger = 0
    #dim tOBXKey As %Integer = 0
    #dim tOBXTextChanged As %String
       ////
       Set pOutput = pRequest.%ConstructClone(1) // moved here because %ConstructClone() need only be done at the message object level.
       //$$$LOGINFO(pOutput_" ---- pOutput to see if clone is created****")
    // Set the message
    Set tMessageType = pOutput.GetValueAt("MSH:9.1")
    //$$$LOGINFO(tMessageType_" --- tMessageType check that pOutput works") ORM found
    //
    Try {
          // Message Subtype
          Set tMessageSubType = pOutput.GetValueAt("ORCgrp(1).ORC:1")
          //$$$LOGINFO(tMessageSubType_"----- tMessageSubType - = NW -- ") works
          // Check if OBR:19 contains "Implant Usage (PSAS)" OR "Issued in Clinic (PSAS)"
          Set tOrderType = pOutput.GetValueAt("ORCgrp(1).OBRuniongrp.OBRunion.OBR:19(1).1")
          //$$$LOGINFO(tOrderType_" -- pOutput ???? -- tOrderType Ordder Type = Implant Usage (PSAS) for first interation")
       If ((tOrderType["Implant Usage (PSAS)") || (tOrderType["Issued in Clinic (PSAS)")) {
          // First loop: Count occurrences of "Item Number:"
          Set = 1
          Set tItemNumberCount = 0
          //
       While (pOutput.GetValueAt("ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX")'="") {
            // Find the number of segments that are Item Number
            Set tOBXText = pOutput.GetValueAt("ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX:5", .tStatus)
            //$$$LOGINFO(tOBXText_"**** "_i_" ---- tOBXText OBX 5 text and i value") // working
            //
                If (tOBXText [ "Item Number:") {
                Set tItemNumberCount = tItemNumberCount + 1
                     //$$$LOGINFO(tItemNumberCount_" ----- tItemNumberCount")
                                                                    }
            Set = + 1
        }    //end While loop
        //
        // Second loop: Modify OBX segments to remove "REASON FOR REQUEST"
        //$$$LOGINFO("SECOND LOOP for remove")
        //$$$LOGINFO(tItemNumberCount_" ----- tItemNumberCount")
        Set = 1
        Set tItemNumberProcessed = 0
           While (pOutput.GetValueAt("ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX")'="") {
               Set tOBXText = pOutput.GetValueAt("ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX:5", .tStatus) // using pOutput instead of pRequest
               //$$$LOGINFO(tOBXText_" ---- tOBXText get OBX 5 text")
            If (tOBXText [ "Item Number:") {
               Set tItemNumberProcessed = tItemNumberProcessed + 1
                                           }
            If (tItemNumberCount >= 1) && (tOBXText [ "REASON FOR REQUEST:") {
                Set tOBXText=$p(tOBXText,":",2,5) /// OBX 5 text parsed to replace in OBX 5 later
                // Start replacement process
                Do pOutput.SetValueAt(tOBXText,"ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX:5","set") /// Required
                //$$$LOGINFO(tOBXText_" ---- OBX 5 parsed to be saved in new OBX 5")
                //Set tOBXTextChanged = pOutput.GetValueAt("ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX:5") // NOT required
                //$$$LOGINFO(i_" **** "_tOBXTextChanged_" --- i --- tOBXTextChanged, Is OBX 5 changed???")
                Set = i
                
             //OBX|1|TX|2000.02^REASON FOR REQUEST^AS4|19||
             //Do pOutput.SetValueAt(tOBXText_"~~","ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX:5","set") //
                set segcnt = 0
             //
            If ((tOBXText[ "Total Cost:")) {
                Set tSegmentOBX = ##class(EnsLib.HL7.Segment).%New()
                Set tSegmentOBX.SegType = "2.3:OBX"
                Set tSC = tSegmentOBX.SetValueAt("OBX", 0, "set")
                Set tSC = tSegmentOBX.SetValueAt("1|TX|2000.02^REASON FOR REQUEST^AS4", 1, "set")
             //|1|TX|2000.02^REASON FOR REQUEST^AS4
                set count = 0
                set = +5
            If ('= (segcnt -4)) {
                Set tSC = pOutput.InsertSegmentAt(tSegmentOBX, z)
                                 }
                set segcnt = pOutput.SegCount
                set count = segcnt - 2
             //$$$LOGINFO(tOBXText_" *** "_z_" "_count_"***"_segcnt_" z ----count --- segcnt")
                Set tRemoveText = pOutput.GetValueAt("ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX:5", .tStatus)
             //$$$LOGINFO(i_" **** "_tRemoveText_"***"_z_"***"_count_"***"_segcnt_" --- i --- tRemoveText_ --- z ---- count --- segcount")
            If (segcnt - = 3) {
             //$$$LOGINFO(i_" **** "_tRemoveText_"***"_z_"***"_count_"***"_segcnt_" **** segcnt - 3 *** --- i --- tRemoveText_ --- z ---- count --- segcount")
                set tSC = pOutput.RemoveSegmentAt(z)
                                }
             //
             elseif (tItemNumberCount = 1) && (tOBXText [ "REASON FOR REQUEST:")
                {
                Set tOBXText=$p(tOBXText,":",2,5) /// OBX 5 text parsed to replace in OBX 5 later
                // Start replacement process
                Do pOutput.SetValueAt(tOBXText,"ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX:5","set") /// Required
                //$$$LOGINFO(tOBXText_" ---- OBX 5 parsed to be saved in new OBX 5")
                //Set tOBXTextChanged = pOutput.GetValueAt("ORCgrp(1).OBRuniongrp.OBXgrp("_i_").OBX:5") // NOT required
                //$$$LOGINFO(i_" **** "_tOBXTextChanged_" --- i --- tOBXTextChanged, Is OBX 5 changed???")
                }
             }
            }
            Set = + 1
        }
    }
            //
        // Process ORM messages with subtype RE
        If tMessageSubType = "RE" {
            Set tResultType = pRequest.GetValueAt("ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX:11")
            If tResultType = "D" {
                $$$ThrowOnError(..ProcessPurgeDocumentToVista(pRequest))
            Else {
                $$$ThrowOnError(..ProcessNewDocumentToVista(pRequest))
            }
        }
        ElseIf (tMessageType="ORM") {
            //$$$ThrowOnError(..SendRequestAsync(..VistaTarget, pRequest, 1, "OutputCernerToVistaORM"))
            $$$ThrowOnError(..SendRequestAsync(..VistaTarget, pOutput, 1, "OutputCernerToVistaORM")) // Must use the object for the clone
        }
        ElseIf (tMessageType="ORR") || (tMessageType="ACK") {
            $$$ThrowOnError(..SendRequestAsync(..VistaTarget, pRequest, 1, "OutputCernerToVistaORR"))
        }
        Else {
            $$$ThrowOnError($$$ERROR($$$GeneralError, "Error: unable to process message from Cerner. Message type " _ tMessageType _ " received."))
        }
    }
    Catch eException {
        Set tStatus = eException.AsStatus()
        Set tStatus = $$$ADDSC(tStatus, ..CreateAndSendAlert(eException.DisplayString(), pRequest))
    }
    Quit tStatus
} /// /////////////////////////////////////////
/// ////////////////////////////////////////

5 Comments
Discussion (5)3
Connectez-vous ou inscrivez-vous pour continuer
Article
· Avr 10 2m de lecture

Webゲートウェイの設定値をプログラムで変更する

これは、InterSystems FAQ サイトの記事です。
 

※Caché/Ensembleの「CSPゲートウェイ」は、IRISでは「Webゲートウェイ」と名称が変更されています。
 これに伴い、サービス名も、「%Service_CSP」 ⇒ 「%Service_WebGateway」となっています。
 以下は、IRISベースの名称で記載しておりますので、適宜読み替えてご参照ください。

Webゲートウェイ・レジストリとその関連クラスを使用すると、Webゲートウェイのインストール環境の確認、および、設定値の変更が可能です。
関連するクラスは、以下になります。
%CSP.Mgr.GatewayRegistry
%CSP.Mgr.GatewayMgr

例えば、以下は、アクティブなWebゲートウェイのインストール環境(リストの1番目)の情報を書き出しています。

Set reqistry = $system.CSP.GetGatewayRegistry()
Set gateways = reqistry.GetGatewayMgrs()
Set gateway = gateways.GetAt(1)
Write gateway.IPAddress," : ",gateway.Port," : ",gateway.Version

      ↓(結果)

127.0.0.1 : 52777 : 661.2001.1740


サーバ・パラメータの変更は以下のように行います。

 set reqistry = $system.CSP.GetGatewayRegistry()
 set gateways = reqistry.GetGatewayMgrs()
 set gateway = gateways.GetAt(1)
 set newpars("Server_Response_Timeout")=30
 do gateway.SetDefaultParams(.newpars)


Webゲートウェイ・レジストリの詳細については、下記ドキュメントをご参照ください。
[ドキュメント] InterSystems IRIS の Web ゲートウェイ・レジストリ

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer