Nueva publicación

Encontrar

Artículo
· 16 ene, 2025 Lectura de 1 min

Encontrad valores desde texto y mostradlos

La utilidad devuelve los valores deseados del texto y muestra múltiples valores si existen, basándose en una cadena de inicio y una de fin.

 

Class Test.Utility.FunctionSet Extends %RegisteredObject
{
/// W !,##class(Test.Utility.FunctionSet).ExtractValues("Some random text VALUE=12345; some other VALUE=2345; more text VALUE=345678;","VALUE=",";")

ClassMethod ExtractValues(text As %String, startStr As %String, endStr As %String) As %String
{    //Initialize Variables
   Set values = ""
   Set start = 1
   
   While start '= 0 
   {
      Set start = $Find(text, startStr, start)
      If start = 0 { Quit}
      Set end = $Find(text, endStr, start)
      If end = 0 { Quit}
      Set value = $Extract(text, start, end-$Length(endStr)-1)
     
      IF values '= "" 
      {
        Set values = values _" "_value   
      }
      Else 
      {
        Set values = value   
      }
      Set start = end
   }
   Quit values
} 
}

Output o salida:

Write !,##class(Test.Utility.FunctionSet).ExtractValues("Some random text VALUE=12345; some other VALUE=2345; more text VALUE=345678;","VALUE=",";")

12345 2345 345678

Comentarios (0)1
Inicie sesión o regístrese para continuar
Pregunta
· 16 ene, 2025

Python (embedded) for SYS.Mirror.GetFailoverMemberStatus does not work

Hi,

I'm using embedded Python as follows:

AUMHTESTTC01:%SYS>do ##class(%SYS.Python).Shell()
Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux
Type quit() or Ctrl-D to exit this shell.
>>> import iris
>>> mirror=iris.cls('SYS.Mirror')
>>> pri=[]
>>> alt=[]
>>> status=mirror.GetFailoverMemberStatus(pri,alt)
>>> print(status)
1
>>> print(pri)
[]
>>> print(alt)
[]
>>> exit()

However the equivalent ObjectScript works:

%SYS>set sc=##class(SYS.Mirror).GetFailoverMemberStatus(.pri,.alt)
%SYS>zw pri
pri=$lb("SERVERA.FOO.BAR.ORG/STAGE","SERVERA.foo.bar.org|2188","Primary","Active","172.31.33.69|1972","SERVERA.foo.bar.org|1972")
%SYS>zw alt
alt=$lb("SERVERB.FOO.BAR.ORG/STAGE","SERVERB.foo.bar.org|2188","Backup","Active","172.31.33.70|1972","SERVERB.foo.bar.org|1972")

Can someone please explain how to achieve the ObjectScript code in Python?
Thanks
 

4 comentarios
Comentarios (4)1
Inicie sesión o regístrese para continuar
InterSystems Official
· 15 ene, 2025

警告:特定の $List 操作でデータベースとジャーナルファイルに不正なデータが作成される

インターシステムズは、特定の $List シンタックスを使用することで不正なデータベースとジャーナルレコードが作成される問題を修正しました。この問題が発生する可能性は非常に低いものですが、発生した場合の影響は非常に大きなものとなります。

この問題は、以下の製品およびそれらベースとしたその他のインターシステムズ製品に存在します:

  • InterSystems IRIS® : 2023.3, 2024.1.0, 2024.1.1, 2024.1.2, 2024.2, 2024.3
  • InterSystems IRIS® for Health: 2023.3, 2024.1.0, 2024.1.1, 2024.1.2, 2024.2, 2024.3
  • HealthShare® Health Connect: 2023.3.0, 2024.1, 2024.1.1, 2024.1.2, 2024.2, 2024.3
  • HealthShare® Unified Care Record と関連製品: 2024.2

この問題はUnicode版の製品でのみ発生します。

以下のシンタックスでグローバル上のリスト形式データに新しい要素を追加する際に問題が発生します。

SET $LIST(<グローバル>, *+1) = 値

この操作によりリストデータが文字列最大長を超過した場合の正しい結果は <MAXSTRING>エラーです。バージョン 2023.3 よりも前の製品バージョンでは正しい結果でしたが、2023.3 以降のバージョンでは <MAXSTRING> エラーが発生せずに不正な値がデータベースに保存されます。

このようにして作成されたグローバルノードを参照すると <MAXSTRING> エラーが発生します。

このグローバル更新はジャーナルレコードにも記録されます(デフォルトの設定としてグローバル更新がジャーナル記録されると仮定)。今回問題となるジャーナルレコードを適用するすべての操作 - 開始時のジャーナルリカバリ、ジャーナルからのリストア、ミラーリング操作 が <MAXSTRING> エラーにより失敗し、それ以降のジャーナル処理を行うことができなくなります。

もしこの問題の影響を受けたお客様は、復旧方法についてカスタマーサポートセンターまでご連絡ください。

この不具合は修正ID DP-437169 で解決します。この修正は InterSystems IRIS、 InterSystems IRIS for Health、Health Connect の2024.1.3、2025.1.0以降のすべてのバージョンに含まれる予定です。HealthShare Unified Care Record および関連製品ではバージョン 2025.1 以降で修正予定ですが、それ以前のメンテナンスリリースでの修正予定はありません。

お客様のご要望により、本修正を現在お使いの製品に対する Adhoc として個別に作成し、提供することが可能です。お使いのシステムに対する Adhoc が必要な場合は、カスタマサポートセンターまでお知らせください。

この警告について質問がある場合は、カスタマーサポートセンターにご連絡下さい。

Comentarios (0)1
Inicie sesión o regístrese para continuar
Artículo
· 15 ene, 2025 Lectura de 3 min

第七十四章 使用 ^%IS

第七十四章 使用 ^%IS

^%IS 是一个通用的设备选择实用程序,用于基于字符的应用程序。可以使用内置的 ^%IS 实用程序来允许用户选择要将 I/O 操作定向到的设备。每当要选择设备时,应用程序都应该调用 ^%IS 实用程序。此实用程序允许用户指定要使用的设备和相应的 OPEN 命令参数,打开所选设备,然后将特定于设备的信息返回给调用程序。用户输入已在 ^%IS 全局中定义的助记词。^%IS 依赖于 Management Portal 中建立的 IO 配置默认值。

Comentarios (0)1
Inicie sesión o regístrese para continuar
Pregunta
· 15 ene, 2025

Application Error Question - Error Message... <SUBSCRIPT>buildRuntimePathFromIndex+135^EnsLib.EDI.X12.Document...

An X12 / 271 message shows "Completed" on the BO. However, it did not reach its destination. I searched for more information on what the error means but, couldn't find much. See error enclosed below. Any idea what it means and how to fix it?

More info...

  • The IOLog Record shows in the Output Data an error... "An error occurred with the web application. It has been logged to system error log (System Operation > System Logs > Application Error Log)."
  • The EDI response shows the same message... "An error occurred with the web application...." 
  • I re-sent the message from the BO and it went out successfully and reached its destination. 

Error logged in the Application Error Log: 

<SUBSCRIPT>buildRuntimePathFromIndex+135^EnsLib.EDI.X12.Document.1 ^EnsEDI.X12.Segment("") : CSP Error
Comentarios (0)1
Inicie sesión o regístrese para continuar