I like it. I think this is the cleanest way to solve my problem.
Thanks a lot
- Log in to post comments
I like it. I think this is the cleanest way to solve my problem.
Thanks a lot
Then, according your opinion, for complex conditions the best way is use IF ELSEIF instead of $SELECT or other similar
That's right
Nice.
This beta has solved the problem that I have with templates in Eclipse.
Cool...
If I've been "Global Master of the Month", may I claim the badge?
Hi Yuval,
Thanks for your comment.
The idea of this tip is only copy content from a class to another class, only I want a subgroup of elements. The command %ConstructClone is to clone a class, you have the same class, not a part of it.
Best regards
Hi all,
Since I've installed Eclipse instead of Atelier, I'm not able to get to add-in options. It is always greyed.
The server is online, I've tried to local and external server, but it doesn't work.
This is the version of Eclipse and Atelier pluging installed.


Any suggestion is welcome.
Best regards,
Francisco Lopez
Registered!!!
One question, the webinar will be available in Youtube or other platform afterwards?
Hi,
The usual port is the Web port (default 57772)
Please check with your administrator if the credential are correct, if you have any firwall that is closing the connection, etc...

Have you checkd if it works with a local instance? (localhost)
Best regards
Yep, that was other problem.
I've exported all classes, dropped namespace and database, created all as new namespace and import the classes.
Now, the message viewer works (fortunatly it is a DEV environment), compiled all via terminal.
However, sometimes the error about SendSuperSession appear intermittently, often when there are some request at the same time
It seem that works... but sometime I have an error, but I'm not able to check what is happend because the message viewer doesn't display the trace.
Always it's displaying an error


I've solved this problem just adding a Default setting for SendSuperSession

I know, this is not the best way to fix it.. but it works ;)
Thanks for your easy solution. I'll change my code to improve this.
Hi,
Check the following code:
Set tProduction="Demo.HL7.MsgRouter.Production"
// Types:
// Empty: Retrieve all items
// 1: Business Service
// 2: Business Process
// 3: Business Operation
Set tType="1"
Set tRS = ##class(%ResultSet).%New("Ens.Config.Production:EnumerateConfigItems")
Set tStatus = tRS.%Execute(tProduction, tType)
While tRS.%Next(.tStatus) {
write tRS.%Get("BusinessType")_" : "_tRS.%Get("ConfigName"),!
}II hope it's useful
Best regards,
Francisco Lopez
Indeed... the brace delimits the scope of the operation
OMG!!! What is that!!!
It seems a KGB spy code !!! ![]()
![]()
![]()
Yep, brace always.
Because you will never know if you need to update your condition or chain another. The brace shows what is the scope of the condition, also for loops, for, for each, etc.
It is a good practices and it is more readable.
As Eduard Lebedyuk has commented, a single IF for use to set a variable, the postconditionals is a good idea, coz you know the condition before to set.
The idea is to copy only the common properties.
If you see the definition of PersonalInfo and NameInfo, both are different classes.
The unique union between both classes is Kurro.Utils.Functions
He does not know what properties the target class obtained, he only knows his own properties and makes a list of methods to copy from the current class to the target class.
This method is compiled, therefore, you need to verify if the destination property exists in the target class at run time. This method is created "on fly" when you create a new instance of this class. Do you know if the property "Name" will be in the object passed as a parameter? Maybe not, so you should check if this property exists in the target.
makes sense?
I hope I have solved the doubt, or maybe I do not understand your question.
Hi,
I've created this method to check if a property exitsts because the method generator doesn't knows if the property exists in the target class in runtime.
If you debug the code you can see the compiled code:
zCopyProps(obj) public {
If (obj.ExistsProperty("Code")) { set obj.Code=..Code }
If (obj.ExistsProperty("DateOfBirthday")) { set obj.DateOfBirthday=..DateOfBirthday }
If (obj.ExistsProperty("FirstName")) { set obj.FirstName=..FirstName }
If (obj.ExistsProperty("PassportId")) { set obj.PassportId=..PassportId }
If (obj.ExistsProperty("SecondName")) { set obj.SecondName=..SecondName } }

so, in runtime, there is no a quick way to check if this property exists to prevent an exception error.
I'll be there, sure ![]()
Hi Sam.
Why not create a TCP listener Service and link the message to your rule?
Using a tool to send HL7 message you can debug your rule. (https://sourceforge.net/projects/hl7inspector/)
I use to use HL7 Inspector to send message and I've debugged my code by this way.
There is not a direct way to test your code in Studio.
Best regards,
Francisco López
Hi Eduard,
I tried to do that before, but all CSP pages was displayed, but WebApi didn't work. The problem has been resolved. Please check the other answer.
Thanks for your comment
Thanks Kyle,
You are right, Apache send all request to CSP Gateway, but IIS needs to know who to response the request. The answer is "*"
I've just done a "rubber duck" with myself... when I've wrote the comment, I've realised that the extensión that I have is "*.*", instead of "*", that is the difference.
A WebApi hasn't an extensión, therefore it is handler by the CSPms library.
I've just changed it and it works
Thanks for all
Hi Alexander,
I have the extension *.* to CSPms, instead of each extension (CSP, ZEN, CLS....) and the "Invoke handler only if request is mapped" is unchecked, but still doesn't work ![]()
If you really need a double key, use a persistence class instead.
You can define your fields and the key you want. You only need one instance of the object and find using the index.
The Looup table was designed to be used as a dictionary, do not try to use an object for another purpose.
Best regards
Thanks John.
I've checked your answer as correct because this is the best approach to do it.
In Studio we can add everything and I don't forget any file.
Best regards,
Francisco López
Hi again.... I've found a solution for this issue and it works.
<?xml version="1.0" encoding="UTF-8"?> <Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.2.1 (Build 803U)" ts="2017-09-29 08:24:26"> <Class name="Common.Produccion"> <Super>Ens.Production</Super> <TimeChanged>64397,40010.817022</TimeChanged> <TimeCreated>64329,41160.632132</TimeCreated> <XData name="ProductionDefinition"> <Data><![CDATA[ <Production Name="Common.Produccion" TestingEnabled="true" LogGeneralTraceEvents="false"> <Description></Description> <ActorPoolSize>2</ActorPoolSize> </Production> ]]></Data> </XData> </Class>
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.2.1 (Build 803U)" ts="2017-09-29 12:11:54">
<Routine name="Common.Common" type="INC" timestamp="64548,48449.743452"><![CDATA[
#include %occErrors
#include %ZEN.Utils
#define GetData(%x) $get(%request.Data(%x,1))
#define Header(%x) %request.GetCgiEnv("HTTP_"_%x)
#define Lower(%text) $ZCONVERT(%text,"l")
]]></Routine>
</Export>
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.2.1 (Build 803U)" ts="2017-09-29 08:24:26">
<Routine name="Common.Common" type="INC" timestamp="64548,48449.743452"><![CDATA[
#include %occErrors
#include %ZEN.Utils
/// GetData: Recoge el valor de un parámetro de una petición Request
#define GetData(%x) $get(%request.Data(%x,1))
/// Header: REcupera el contenido de la cabecera
#define Header(%x) %request.GetCgiEnv("HTTP_"_%x)
/// Lower: Convierte en minúscula el texto indicado
#define Lower(%text) $ZCONVERT(%text,"l")
]]></Routine>
<Class name="Common.Produccion">
<Super>Ens.Production</Super>
<TimeChanged>64397,40010.817022</TimeChanged>
<TimeCreated>64329,41160.632132</TimeCreated>
<XData name="ProductionDefinition">
<Data><![CDATA[
<Production Name="Common.Produccion" TestingEnabled="true" LogGeneralTraceEvents="false">
<Description></Description>
<ActorPoolSize>2</ActorPoolSize>
</Production>
]]></Data>
</XData>
</Class>
<Project name="EnsExportProduction_2017-09-04 08-20-12_724+2" LastModified="2017-09-29 08:24:26.599088">
<ProjectDescription><![CDATA[Studio Project generated from Ensemble Production 'Common.Produccion' at 2017-09-04 06:20:12.724 UTC]]></ProjectDescription>
<Items>
<ProjectItem name="Common.Common" type="INC"></ProjectItem>
<ProjectItem name="Common.Utils.Encriptar" type="CLS"></ProjectItem>
<ProjectItem name="Common.Utils.JSON" type="CLS"></ProjectItem>
<ProjectItem name="Common.Utils.Utilidades" type="CLS"></ProjectItem>
<ProjectItem name="EnsExportNotes.EnsExportProduction_2017-09-04 08-20-12_724+2.PTD" type="PTD"></ProjectItem>
</Items>
</Project><Document name="EnsExportNotes.EnsExportProduction_2017-09-04 08-20-12_724+2.PTD"><ProjectTextDocument name="EnsExportNotes.EnsExportProduction_2017-09-04 08-20-12_724+2" description="Export Notes for export EnsExportProduction_2017-09-04 08-20-12_724+2">
<![CDATA[<Deployment>
<Creation>
<Machine>MYSERVER</Machine>
<Instance>HEALTHSHARE</Instance>
<Namespace>COMMON</Namespace>
<SourceProduction>Common.Produccion</SourceProduction>
<Username>_SYSTEM</Username>
<UTC>2017-09-29 06:24:26.597</UTC>
</Creation>
<Notes>
</Notes>
<Contents>
<ExportProject>EnsExportProduction_2017-09-04 08-20-12_724+2</ExportProject>
<Item num="1">Common.Common.INC</Item>
<Item num="2">Common.Produccion.CLS</Item>
<Item num="3">Common.Utils.Encriptar.CLS</Item>
<Item num="4">Common.Utils.JSON.CLS</Item>
<Item num="5">Common.Utils.Utilidades.CLS</Item>
</Contents>
<ProductionClassInExport>Common.Produccion</ProductionClassInExport>
</Deployment>
]]></ProjectTextDocument>
</Document>Now you can deploy the production with the INC file without problem
There is a problem with this process, if you need to re-export the production, you'll lose the INC file and you need to paste it again
I hope this solution will work for someone else.
Best regards,
Francisco Lopez
Hi Conor.
If you try to convert directly this datetime to a $HOROLOG format, you'll have problems :)
Date is a valid format, however the time needs to convert a valid format, so modify the variable to convert a valid datetime format.
set myTimeStamp="20160105125915" set myTimeStampValid=$EXTRACT(fecha,1,4)_"-"_$EXTRACT(fecha,5,6)_"-"_$EXTRACT(fecha,7,8)_" "_$EXTRACT(fecha,9,10)_":"_$EXTRACT(fecha,11,12)_":"_$EXTRACT(fecha,13,14)
Then you have a datetime in format YYY-mm-dd HH:MM:ss
Now, you need to convert this variable to $HOROLOG format
set myTimeStampHorolog=$ZDATETIMEH(myTimeStampValid,3,1)
now, convert to UTC using your local time, if you know what is the UTC difference, apply directly.
Example: I'm in Spain, so is CET (UTC+1), however in summer (CEST) is UTC+2
If you use the method ##class(%SYSTEM.Util).LocalWithZTIMEZONEtoUTC you'll have the UTC as zone time, but your Ensemble doesn't know if it's Summer o Winter time.
if is Summer time, you need to reduce an hour your local time
set myTimeStampUTC=##class(%SYSTEM.Util).LocalWithZTIMEZONEtoUTC(myTimeStampHorolog)
;; IF SUMMER TIME, REDUCE ONE HOUR
set myTimeStampUTC=$ZDATETIMEH($SYSTEM.SQL.DATEADD("hour",-1,myTimeStampUTC),3,1)if you want to compare both datetimes (now, I'm in CEST, so I'm in UTC+2)
write "My local time:"_$ZDATETIME(myTimeStampHorolog,3,1) write "UTC time:"_$ZDATETIME(myTimeStampUTC,3,1)
The result is:
My local timestamp:2016-01-05 12:59:15 UTC timestamp:2016-01-05 10:59:15
Now, you have the same problem, you have a time separated by ":", so only need to revert the conversion
set myUTC=$ZDATE(myTimeStampUTC,8)_$REPLACE($ZTIME($PIECE(myTimeStampUTC,",",*),1),":","")
and compare:
write myTimeStamp write myUTC
Check the info about theses methods:
##class(%SYSTEM.Util).LocalWithZTIMEZONEtoUTC
I hope I have solved your problem
Best regards,
Francisco Lopez
P.S. Don't forget check the answer if it's the correct answer.
P.P.S. [EDITED] According to Eduard Lebedyuk (see below), you can replace
set myTimeStampValid=$EXTRACT(fecha,1,4)_"-"_$EXTRACT(fecha,5,6)_"-"_$EXTRACT(fecha,7,8)_" "_$EXTRACT(fecha,9,10)_":"_$EXTRACT(fecha,11,12)_":"_$EXTRACT(fecha,13,14)
to
set myTimeStampValid=$SYSTEM.SQL.TOTIMESTAMP(myTimeStamp,"YYYYMMDDHHMISS")
Thanks Mr. Lebedyuk
Thanks for the solution.
The problem was that I should to call to a BS, not a BP instead. So I've created a dummy BS to call the BP to do the process.
Thanks again for the key
The #12 ALWAYS works!!!! #TrueStory