Cristiano Silva · Jul 31, 2017 go to post

His,

It looks like the record you are trying to access does not conform to the global mapping of the class.

Make a comparison with the global data of a record that is returned in the query and with this one that is giving problem, so maybe you can see if there is any piece of record that returns error is in disagreement with the global mapping of the class.

Regards.

Cristiano Silva · Jun 1, 2017 go to post

Hi Javier, 

A some years ago I wrote a class to copy from to object. Is a simple data tranformation that reads the definition of source object and try to set the target object.

Is a very simple copy, without care about with types, I use for save time when I need to copy many properties of source object  to target object.

Recently I adapted the code to consider the source objects that are dynamic objects.

Works similar to the method from JSON that Chris wrote in the post.

The code was written in portuguese (Brazil) I hope can be useful to you.

/// <p>/// <b>2012-03-01 - Cristiano José da Silva</b><br/>/// Classe utilizada para copiar todas propriedades de um objeto origem para um objeto destino.<br/>/// Esse método não se comporta como o %ConstructClone, pois ele copia os dados de origem para um /// destino mesmo sendo de tipos diferentes. Ele foi implementado para poder copiar objetos de tipos /// diferentes mas com a mesma definição.<br/>/// A definição mandatória é a da origem, isto é, caso o objeto destino possua um referência para outro/// objeto, e no objeto origem essa mesma propriedade seja uma string, o objeto destino receberá uma string /// no lugar de uma referência.<br/>/// Caso queira ignorar uma ou mais propriedade passa-las em no array pProriedadesAIgnorar indexao pelo nome /// da propriedade Ex:/// <example>/// Set tPropriedadesIgnoradas("Prop1") = 1/// Set tPropriedadesIgnoradas("PropN") = 1/// </example>/// <strong>/// Os nomes das propriedades devem ser exatamente iguais nas duas classes.</br>/// Os tipos também devem ser os mesmos para evitar erros./// </strong><br/>/// </p>Class cjs.dt.CopiarObjetoDT Extends Ens.DataTransform [ ProcedureBlock ]{ClassMethod Transform(pSource As %RegisteredObject, pTarget As %RegisteredObject, ByRef pProriedadesIgnoradas) As %Status{    #Dim tException As %Exception.General    #Dim tStatus As %Status = $System.Status.OK()     Try{        If ($IsObject($Get(pSource)) '= 1) {            Set tStatus = $System.Status.Error(5001, "Objeto origem é obrigatório")//            Quit}        If ($IsObject($Get(pTarget)) '= 1) {            Set tStatus = $System.Status.Error(5001, "Objeto destino é obrigatório")//            Quit}// Trata Objetos Dinâmicos (JSON)        If (pSource.%IsA("%Object")){            #Dim tIterator As %Iterator.AbstractIterator = pSource.$getIterator()            #Dim tChave As %String = ""            #Dim tValor As %String = ""//            While (tIterator.$getNext(.tChave, .tValor)){                If ($Data(pProriedadesIgnoradas)){                    Continue:($Get(pProriedadesIgnoradas(tChave), 0))}                Set $Property(pTarget, tChave) = tValor}}Else{            Set tDefinicaoClasse                   = ##Class(%Dictionary.CompiledClass).%OpenId(pSource.%ClassName(1))            #Dim tPropriedades As %ArrayOfObjects  = tDefinicaoClasse.Properties            #Dim tIndicePropriedade As %Integer    = 0//            For tIndicePropriedade = 1 : 1 : tPropriedades.Count(){                 #Dim tPropriedade As %Dictionary.CompiledProperty = tPropriedades.GetAt(tIndicePropriedade)//                Continue:(tPropriedade.Private || tPropriedade.ReadOnly || tPropriedade.Calculated || tPropriedade.Transient)//                #Dim tNomePropriedade As %String = tPropriedade.Name//                If ($Data(pProriedadesIgnoradas)){                    Continue:($Get(pProriedadesIgnoradas(tNomePropriedade), 0))}                Set $Property(pTarget, tNomePropriedade) = $Property(pSource, tNomePropriedade)}}}    Catch (tException){        Set tStatus = tException.AsStatus()}    Return tStatus}ClassMethod Teste(){    Write !, "Teste ambos sendo um objeto registrado", !//    Set tOrigem             = ##Class(Ens.StringContainer).%New()    Set tOrigem.StringValue = "Ambos registrado."    Set tDestino            = ##Class(Ens.StringContainer).%New()//    Do ..Transform(tOrigem, tDestino)//    Write tDestino.StringValue, !    Write !, "Teste da origem sendo um objeto dinâmico", !//    Set tOrigem             = ##Class(%Object).%New()    Set tOrigem.StringValue = "Origem dinâmico"    Set tDestino            = ##Class(Ens.StringContainer).%New()//    Do ..Transform(tOrigem, tDestino)//    Write tDestino.StringValue, !    Write !, "Teste da destino sendo um objeto dinâmico", !//    Set tOrigem             = ##Class(Ens.StringContainer).%New()    Set tOrigem.StringValue = "Destino dinâmico"    Set tDestino            = ##Class(%Object).%New()//    Do ..Transform(tOrigem, tDestino)//    Write tDestino.StringValue, !    Write !, "Teste ambos sendo um objeto dinâmico", !//    Set tOrigem             = ##Class(%Object).%New()    Set tOrigem.StringValue = "Ambos dinâmico"    Set tDestino            = ##Class(%Object).%New()//    Do ..Transform(tOrigem, tDestino)//    Write tDestino.StringValue, !}}
Cristiano Silva · Aug 2, 2017 go to post

Hi Pravin,

You can create a custom task and disable the journal in the beginning of the method with this line:

DO DISABLE^%NOJRN

Put yor purge logic and then in the end of code you can enable again the journal with:

DO ENABLE^%NOJRN

These lines affect only the current process.

Regards

Cristiano Silva · May 20, 2019 go to post

Hi Nigel,

Create a SSL Configuration in the Management Portal,  then in the Business Operation Configuration you select the SSL config that you created then append a '*' in the name, this instruct the adapter to uset SARTTLS in the connecion.

Cristiano Silva · Feb 21, 2020 go to post

Andreas,

Which the recommendation to migrate to IRIS if a Ensemble license is like that?

Elite, Multi-Server, Platform Independent 

Whats happens with the license, since is not compatible with Iris?

Cristiano Silva · Mar 3, 2020 go to post

I think the good sense is the key,

Today's compiler's optimizers detect the most of common expressions and generate the better performatic code, but we can't be obsessed with readability.

A good post: Performance vs Readability

Cristiano Silva · Mar 3, 2020 go to post

Hi Alberto,

I think file "/tmp/RESTForms2-master/src/Form/Installer.cls" is missing in the package.

Bellow the erro when try to start the container:

And the print of content of folder "\backend\src\Form":

Cristiano Silva · Mar 31, 2020 go to post

Hi Davi,

A simplest way is creating a datatype class:

Class system.dto.sector.SectorStatusEnum Extends %Integer [ ClassType = datatype ]{
Parameter DISPLAYLIST = ",Active,Inactive,Production,Upkeep,NewValue";
Parameter VALUELIST = ",1,2,3,4,5";}

And use the datatype in your class:

Class system.dto.sector.Test Extends %Persistent{Property SectorStatus As SectorStatusEnum;

}

Example:

Cristiano Silva · Apr 6, 2020 go to post

Hi Abel,

When we subclass a persistent class and we need that this subclass have a own storage we need to add in the inheritance class list the %Persistent class  first of all classes.

Shared storage

Class sample.MyHL7 Extends EnsLib.HL7.Message{Storage Default{<Type>%Library.CacheStorage</Type>}

}

Own storage

Class sample.MyHL7 Extends (%Persistent, EnsLib.HL7.Message){Storage Default{<Data name="MyHL7DefaultData"><Value name="1"><Value>%%CLASSNAME</Value></Value><Value name="2"><Value>ParentId</Value></Value><Value name="3"><Value>DocType</Value></Value><Value name="4"><Value>Envelope</Value></Value><Value name="5"><Value>Source</Value></Value><Value name="6"><Value>IsMutable</Value></Value><Value name="7"><Value>OriginalDocId</Value></Value><Value name="8"><Value>MessageTypeCategory</Value></Value><Value name="9"><Value>TimeCreated</Value></Value></Data><Data name="UserValues"><Attribute>UserValues</Attribute><Structure>subnode</Structure><Subscript>"UserValues"</Subscript></Data><DataLocation>^sample.MyHL7D</DataLocation><DefaultData>MyHL7DefaultData</DefaultData><IdLocation>^sample.MyHL7D</IdLocation><IndexLocation>^sample.MyHL7I</IndexLocation><StreamLocation>^sample.MyHL7S</StreamLocation><Type>%Library.CacheStorage</Type>}}
Cristiano Silva · Apr 7, 2020 go to post

Hi,

The error occour in the line:


zPATADVICEINFOExecute+15^web.DHCENS.CDSS.PARADVINCEINFO.1

When try to access the global ^PAADMi("No", ""), the error occours because is trying to acces a null subscript.

Maybe a parameter was not passed in the procedure call ?

Cristiano Silva · Apr 7, 2020 go to post

Hi Eric,

Ensemble manage all automaticaly.

Could you post the content of tah Log Tab? 

Cristiano Silva · Apr 7, 2020 go to post

The global ^PAADMi("No", "") is a index global, if I'm not wrong ,is a index of PA_AADM table and the field of the index is PAADM_PAPMI_NO (MRN number of patient).  Maybe then idex have some problem.

Do you have access to the stored procedure code?, If yes try to execute the query of procedure manually in the System Adminstration Portal. If not, I think you will need some suport.

Cristiano Silva · Apr 7, 2020 go to post

Hi Abel,

The simplet way to create a new HL7 message form a existing message is call the method OutputToIOStream from the original message and the call the classmethod  ImportFromIOStream  of the subclass.

Cristiano Silva · Apr 30, 2020 go to post

Hi Yone,

Try to append in the bigginer of you XML Strign the XML declarion:

In the line:

do mensajeXML.Write($zcvt("<ORM_O01>........

Try:

do mensajeXML.Write($zcvt("<?xml version="1.0" encoding="utf-8"?> <ORM_O01>........

And check if had some character that can cause the <SINTAX > error in the cos.

Cristiano Silva · May 20, 2020 go to post

Hi Arnold,

From server side directly Is not possible.

All %ZEN component writes the HTML code directly to device. The method responsible for this is %DrawHTML().

A way you can do more easily is using the instance of  %SQL.StatementResult to excute the query of your TablePane, and use the method %DisplayFormatted

Cristiano Silva · Jun 16, 2020 go to post

Thanks Navarro,

I don't see the typo in te test data, and with the change of the cnonce calculation works like a charm.

For my specific case,  the service doesn't send de opaque, but I changed the code to support the opaque too.

Abraço.

Cristiano Silva · Jun 24, 2020 go to post

Hi Vinay,

Generally you write direct to device.

You need to know the language that the printer works.

A common used printer is Zebra that has a proprietary language called ZPL:

https://www.zebra.com/us/en/support-downloads/knowledge-articles/zpl-command-information-and-details.html
 

Healthshare documentation:

https://cedocs.intersystems.com/ens20172/csp/docbook/Doc.View.cls?KEY=RACS_Settings#RACS_Category_DeviceSettings

After you setup the device  you need to use then:

https://cedocs.intersystems.com/ens20172/csp/docbook/DocBook.UI.Page.cls?KEY=GIOD_intro
https://cedocs.intersystems.com/ens20172/csp/docbook/DocBook.UI.Page.cls?KEY=ITECHREF_device