Encontrar

Artículo
· 22 oct, 2025 Lectura de 2 min

Tips on handling Large data

Hello community,

I wanted to share my experience about working on Large Data projects. Over the years, I have had the opportunity to handle massive patient data, payor data and transactional logs while working in an hospital industry. I have had the chance to build huge reports which had to be written using advanced logics fetching data across multiple tables whose indexing was not helping me write efficient code.

Here is what I have learned about managing large data efficiently.

Choosing the right data access method.

As we all here in the community are aware of, IRIS provides multiple ways to access data. Choosing the right method, depends on the requirement.

  • Direct Global Access: Fastest for bulk read/write operations. For example, if i have to traverse through indexes and fetch patient data, I can loop through the globals to process millions of records. This will save a lot of time.
Set ToDate=+H
Set FromDate=+$H-1 For  Set FromDate=$O(^PatientD("Date",FromDate)) Quit:FromDate>ToDate  Do
. Set PatId="" For  Set PatId=$Order(^PatientD("Date",FromDate,PatID)) Quit:PatId=""  Do
. . Write $Get(^PatientD("Date",FromDate,PatID)),!
  • Using SQL: Useful for reporting or analytical requirements, though slower for huge data sets.

Streamlining Bulk Operations

Handling millions of records one by one is slow and heavy. To optimize, I have found that saving in batches, using temporary globals for intermediate steps and breaking large jobs into smaller chunks will make a huge difference. Turning off non-essential indices during bulk inserts will also speed up things.

Using Streams

For large text, XML or JSON payloads, Stream objects prevent memory overload. Dealing with huge files can consume a lot of memory if we are loading everything at once. I would prefer stream objects to read or write the data in chunks. This will keep things fast and efficient. 

Set stream = ##class(%Stream.GlobalCharacter).%New()
Do stream.CopyFromFile("C:\Desktop\HUGEDATA.json")
w "Size: "_stream.Size(),!

This will be a simple way of handling data safely without slowing down the system.

Soooo ya. Handling huge data is not just about making things fast, it's about choosing the right way to access, store and keep the system balanced smartly. 

From migrating millions of patient records to building APIs that handle quite large datasets, these approaches have made a real difference in performance and maintainability.

If you are working with similar concepts and want to swap ideas, please feel free to reach out, I am always happy to share what has worked with me. Open for feedbacks and your opinions too...

 

Thanks!!! :-)

6 comentarios
Comentarios (6)3
Inicie sesión o regístrese para continuar
Artículo
· 22 oct, 2025 Lectura de 4 min

Accélérez vos recherches textuelles grâce aux index %iFind

Bonjour à tous les membres de la communauté!

Beaucoup d'entre vous se souviennent certainement des fonctionnalités NLP disponibles dans IRIS sous le nom iKnow, qui ont été supprimées depuis peu de temps. Mais... Tout a-t-il été supprimé ? NON! Un petit village résiste à la suppression: les index iFind!

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

Routing Rule with a variable target

Hi all,

Recently we were experimenting with having a variable target on a routing rule and noticed some interesting behaviour, code below.

<rule name="My Rule" disabled="false">
<constraint name="docCategory" value="Generic.2.3.1"></constraint>
<when condition="((Document.{MSH:MessageType.triggerevent}=&quot;A43&quot;))">
<send transform="" target="To&quot; _(pContext.Document.GetValueAt(&quot;MSH:SendingFacility&quot;))_&quot;FromServiceTCPOpr"></send>
</when>
</rule>


This code compiles and works. If SendingFacility is "TOM" the message will rout to ToTOMFromServiceTCPOpr, and if it is "BOB" it will route to ToBOBFromServiceTCPOpr.

However - if we remove the space between the first &quot; and the first underscore as in below this rule will not compile with error

<send transform="" target="To&quot;_(pContext.Document.GetValueAt(&quot;MSH:SendingFacility&quot;))_&quot;FromServiceTCPOpr"></send>

 

Invalid target name: To"_(pContext.Document.GetValueAt("MSH:SendingFacility"))_"FromServiceTCPOpr. Target name should not contain "_ and _"

Is this an error with the compiler or an issue with the rule (or neither)?

Thanks.

1 Comentario
Comentarios (1)2
Inicie sesión o regístrese para continuar
Artículo
· 21 oct, 2025 Lectura de 1 min

<FRAMESTACK>エラーが発生する原因

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

ルーチンやメソッドを実行した際に以下のような<FRAMESTACK>エラーが発生する場合、DOコマンドの発行の入れ子数が多すぎて、それ以上スタック情報を保持できなくなったことを示しています。

<FRAMESTACK> error is reported when the routine has too many nested calls to DO command. You can check the current stack with $STACK value.

可能性として高いのはプログラミング上のミスで再起的なメソッド/ルーチン呼び出しがループしている場合などです。

以下のようなプログラミングを行い、$STACK変数の値を確認することで、スタックのレベルがどのように変化しているのかを確認できます。

main() {
  write "main 1: ",$STACK,!
  do l1
  write "main 2: ",$STACK,!
  quit
}
 
l1() {
  write "l1 1: ",$STACK,!
  for i=1:1:5 {
    do l2(i)
  }
  write "l1 2: ",$STACK,!
  quit
}

l2(x) {
  write "l2("_x_") : ",$STACK,!
  if x#2=0 {
    write "--------", $STACK,!
  }
  quit
}
Comentarios (0)1
Inicie sesión o regístrese para continuar
Artículo
· 21 oct, 2025 Lectura de 1 min

文字列プロパティの数値 order by の並び順

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

%String型のプロパティをOrder Byの条件にしてクエリーを発行した際のデータは以下のような順番で並べられます。

SELECT * FROM Shop.Order order by StatusFlag
null
-1
-2
-99
0

これは%String型(文字列型)のプロパティの照合順として正しい振る舞いです。

文字列照合の並び順

文字列プロパティに対し、+ をつけることで、数値照合と同じ照合順を得ることができます。

SELECT * FROM Shop.Order order by +StatusFlag
null
-99
-1
-2
0
Comentarios (0)1
Inicie sesión o regístrese para continuar