Find

Question
· Aug 23, 2024

How to disable renaming of custom schema on VSCode import?

during an upgrade, a customer wants to load custom schemas in a particular order.
For this, they renamed a file EPIC_MDM.HL7 to 1EPIC_MDM.HL7
Upon importing this file into their server using VSCode, the custom schema was renamed to 1EPIC_MDM.HL7 inside the <Category>

This is impacting the upgrade and they are looking for a way to import a custom schema without renaming the schema itself.

2 Comments
Discussion (2)2
Log in or sign up to continue
Question
· Aug 23, 2024

Linked Stored Procedure Question

Instead of building a BP to execute stored procedures just to insert the data, I figured I would give Linked Stored Procedures a try since all I need to do is insert the data. I have proved in our MS SQL Development environment that it is possible, so I through I could just repoint the Linked Stored Procedure 

set hdbc=$$GetJConnection^%apiGTW("xxxxx")

to the test environment. But when I made the changed in VSCode and compiled the Stored Procedure disappeared from the SQL view in the Management Portal.

So can we not simply update the connection string to point to a different MS SQL Connection?

2 Comments
Discussion (2)2
Log in or sign up to continue
Article
· Aug 23, 2024 3m read

Como buscar erros de aplicação (^ERRORS) usando um comando

Rubica InterSystems FAQ

Use a consulta ErrorList da classe SYS.ApplicationError.

  • Nota 1: Rode no namespace %SYS.
  • Nota 2: Essa é uma utilidade não armazenada, então usamos a classe %ResultSet ao invés de %SQL.Statement.

Um exemplo de execução de comando é o seguinte:

USER>set $namespace="%SYS"   // igual a zn "%SYS"
%SYS>set rset=##class(%ResultSet).%New()

%SYS>set rset.ClassName="SYS.ApplicationError"
%SYS>set rset.QueryName="ErrorList"
// O primeiro argumento da consulta é o nome do namespace, o segundo é a data (no formato MM/DD/AAAA).
%SYS>do rset.Execute("USER","08/17/2020")

// Para exibir os resultados na tela, execute o método %Display().
%SYS>do rset.%Display()
Error # Error message   Time    Process DisplayPID      Username        Code line
1 <DIVIDE> 02:43:10 2536 2536 irisowner

1 Rows(s) Affected

%SYS>do rset.Close()

A seguir, como retornar valores de coluna de um SELECT enquanto navega por entre as linhas.

Para mover para a próxima linha, use o método Next() (que retorna 1 se a próxima linha existe)

Para buscar uma coluna, use Get("nome da coluna"). Para detalhes nos nomes das colunas, veja a descrição da consulta ErrorList na documentação da classe.

Sobre nomes de colunas de consultas ErrorList.

%SYS>do rset.Execute("USER","08/17/2020")

%SYS>while rset.Next() { write rset.Get("Error #"),"-",rset.Get("Error message"),"-",rset.Get("Time"),"-",rset.Get("Code line"),!}
1-<DIVIDE>-02:43:10-

Para visualização do terminal, use também a rotina ^%ER.

Execute o seguinte quando estiver no namespace que quiser referenciar (o exemplo é executado no namespace USER).

O texto verde em negrito sublinhado indica a área de entrada.

USER>do ^%ER
 
For Date: ?L
Thu 09/17/2020  (T)   2 Errors
Mon 09/07/2020  (T-10) 3 Errors
Mon 08/31/2020  (T-17) 1 Error
Mon 08/24/2020  (T-24) 1 Error

For Date: 09/17/2020  17 Sep 2020   2 Errors

Error: ?L
 1. " *a"  at  9:05 am.   $I=|TRM|:|13484   ($X=0  $Y=15)
     $J=13484  $ZA=0   $ZB=$c(13)   $ZS=262144 ($S=268271680) 
 2. "^%ETN"  at  9:05 am.   $I=|TRM|:|13484   ($X=0  $Y=17)
     $J=13484  $ZA=0   $ZB=$c(13)   $ZS=262144 ($S=268263368)
     %ETN     ;%STACK-related error log

 Error: 1
 1. " *a"  at  9:05 am.   $I=|TRM|:|13484   ($X=0  $Y=15)
     $J=13484  $ZA=0   $ZB=$c(13)   $ZS=262144 ($S=268271680)
Variable:

Error:
 
For Date:
USER>

For Date: especifique a data quando o erro ocorreu em formato mm/dd/aaaa.

For Error: especifique o número do erro.

Quando tiver terminado, aperte Enter para sair. 

Discussion (0)1
Log in or sign up to continue
Question
· Aug 23, 2024

.NET External language server and output variables (IRISReference)

Hello, 

I'm working on building some .NET Scripts/CLI tools and starting to use the .NET external language server.

I've been able to connect using the .NET SDK, but trying to understand a little how to make a call that has a output parameter. I've read that you should use IRISReference, but haven't been able to get that to work. Here is what I'm trying to do

I'm trying to make a call to the %SYS.Namespace.ListAll() method but as you will note, the first param for the method is an output param (https://docs.intersystems.com/irisforhealthlatest/csp/documatic/%25CSP.D...)

If you read the https://docs.intersystems.com/irisforhealth20242/csp/docbook/DocBook.UI....
it references you should use IRISReference and then use that object when passing into the method. Example below

  IRISReference valueRef = new IRISReference(""); // set inital value to null string
  iris.ClassMethodString("%SomeClass","SomeMethod",valueRef);
  String myString = valueRef.value;               // get the method result

In my code I'm using the following, but receive a message of "Index was outside the bounds of the array." How should I be using the IRISReference object when the parameter expects an Output like the above %SYS.Namespace.ListAll() method

using InterSystems.Data.IRISClient;
using InterSystems.Data.IRISClient.ADO;

IRISConnection Conn;

try
{
    Conn = new IRISConnection();
    Conn.ConnectionString = "Server=myserver; Port=1972; Namespace=%SYS;Password=password; User ID=username";
    Conn.Open();

    IRIS iris = IRIS.CreateIRIS(Conn);
    IRISReference a = new IRISReference("");

    iris.ClassMethodStatusCode("%SYS.Namespace","ListAll",a);
    Conn.Close();
}
catch (Exception eConn)
{
    //this returns Index was outside the bounds of the array.
    Console.WriteLine(eConn.Message);
}
3 Comments
Discussion (3)2
Log in or sign up to continue
Question
· Aug 23, 2024

How do I get the instantiated name of a class

Hi Guys

How do get the item name of a class? I have several items derived from the same class, and for error reporting I want to get the name of the item which created it, rather than the class it is derived from from.

e.g. InPhase.LEGACY.GetUpdateNotification, InPhase.LFPSE.GetUpdateNotification and InPhase.ADHOC.GetUpdateNotification are all derived from the same class  InPhase.Services.LoadInPhaseUpdates

I'm aware that the $CLASSNAME($THIS) can be used to get classname, but this doesn't help.

Can anyone help?

Andy

6 Comments
Discussion (6)2
Log in or sign up to continue