Kurro Lopez · Apr 26, 2017 go to post

Hi,

We are using Atelier with TFS and we haven't problems with it.

Sometimes, I have to check out the file manually because the synchronize process doesn't check out automatically. Some members of my team do it automatically but I don't. Don't know.

If you want to install TFS plugin, I've published a quick tutorial How to install and use TFS in Atelier. Please, have a look 

Best regards.

Kurro Lopez · Jun 14, 2017 go to post

Thanks to both,

I don't want to create a new account, cuz I can lose all my entries, and I couldn't link my account to Global Master one.

The account to WRC is other one, and I want to save it as it is.

Other option? wink

Kurro Lopez · Sep 20, 2017 go to post

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:

$ZDATETIMEH

$ZDATETIME

$EXTRACT

##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 

Kurro Lopez · Sep 29, 2017 go to post

Hi again.... I've found a solution for this issue and it works.

  • Create the deploy file from "Export from production". In this example, the file name is "Export-Common_Production.xml"
  • Export the INC file from Systems - Routines. In this example, the file name is Export.xml
  • Open the deploy file (Export-Common_Production.xml) . Look at the begin of the code
<?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>
  • Copy the content of Export.xml, only the <Routine> node
<?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>
  • Paste it at the begin of Deploy file
<?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>
  • Search down the node  <Project> and include the INC file
<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 &apos;Common.Produccion&apos; 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>
  • Search down the node <Document> and add the first file the INC and reorder the numbers of item
<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

Kurro Lopez · Jan 10, 2018 go to post

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

Kurro Lopez · Jan 18, 2018 go to post

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

Kurro Lopez · Jan 25, 2018 go to post

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

Kurro Lopez · Feb 22, 2018 go to post

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

Kurro Lopez · Jun 19, 2018 go to post

Hi Dani,

This class uses EnsLib.FTP.InboundAdapter, according to the documentation, this is the path on the Ensemble server to save a copy of each file received from the FTP server. That is not a FTP folder.

If you want to move the file processed into a FTP folder after processed, you should get the file from this folder and put it manually.

Have a look the link Using the FTP Inbound Adapter and Settings for the FTP Inbound Adapter

Have a nice day

Francisco López

Kurro Lopez · Jun 22, 2018 go to post

Hi,
Unfortunately, you should remove it manually. after, you should remove it in your local workspace, because if you want to synchronize your application, the package would be in your workspace again.

Best regards

Kurro Lopez · Apr 18, 2019 go to post

Hi,

You need to map the other Global database into your namespace. This is the only way to have visibility of other database

Kurro Lopez · Apr 30, 2019 go to post

Please, use the DTL class properties

set obj=##class(EXC.DTL.Lamont).%New()

write 'Source type: '_obj.GetSourceType()

write 'Target type: '_obj.GetTargetType()

Have a look the following documentation

Ens.DataTransformDTL

Best regards,

Francisco López

Kurro Lopez · May 3, 2019 go to post

Hi,

Try the following code. It only works if the class parent is Ens.DataTransformDTL

// Create a query to get only my class (in MyClass and sub folders)

setquery="SELECT ID FROM %Dictionary.ClassDefinition WHERE ID LIKE 'MyClass.%' AND super='Ens.DataTransformDTL'"settStatement = ##class(%SQL.Statement).%New()setqStatus=tStatement.%Prepare(query)settResult = tStatement.%Execute()

while tResult.%Next() {

   set dtlName = tResult.%Get("ID")

   setclassObject = $CLASSMETHOD(dtlName ,"%New")
   
   write !,"DTL: "_dtlName
   write !,"Source type: "_classObject.GetSourceType()
   write !,"Target type: "_classObject.GetTargetType()
   write !

}

Remember: It works only if the class inherits from Ens.DataTransformDTL, if you know which class is the one that inherits the DTL you want to examine, change the name of the value of 'Super' in the previous query

Best regards,

Francisco Lopez

Kurro Lopez · May 10, 2019 go to post

Well, next time I need to read the documentation in depth.

There is a base method to check if a class extends of other one

set obj = ##class(MyLibrary.ChildClass01).%New()

## this retrieves 1
wobj.%Extends("MyLibrary.ParentClass")

## this retrieves 0
wobj.%Extends("MyLibrary.ParentClassFake")

This has been a "Rubber duck", this is a sample of guide-book of rubber duck. wink

More info Clase %Library.SystemBase

Best regards,

Francisco López

Kurro Lopez · Jul 17, 2019 go to post

Hi Vikram,

Have you checked if you have granted privileges?

Best regards,

Francisco Lopez

Kurro Lopez · Feb 20, 2020 go to post

That depends on your data model.

If you require many related tables, it may be more useful to have the invocation with the data you need by appending the tables by primary keys.


SELECT table1.code, table2.description
FROM table1
INNER JOIN table2 ON table2.tab_id = table1.id

Also, it's important create the proper index to the fields that you need to search.

There is not a simple answer :)

Best Regards,
Francisco Lopez

Kurro Lopez · Apr 17, 2020 go to post

I've checked the locktable and it displays a lot of them :s

is possible to unlock all of them at the same time? I have to do one on one...

Kurro Lopez · May 21, 2020 go to post

To be honest... I'm using all at the same time:

Develop: VSCode
Debug: Studio
Synchronize code from server: Atellier

I have some problems to synchronize code from server to local code in VSCode, so I trust in Atellier.

Kurro Lopez · May 28, 2020 go to post

We are preparing a great concert to celebrate it with world famous guests, such as Beyonce, Jenifer Lopez, Maluma, Elton John, Paul McCartney, Rosalia, and some other surprises ...
We are waiting for the pandemic to allow us to do so, or we are going to have to suspend it.

hehehe, just kidding ... we will have a couple of beers for what we have done and for what we are going to do.

Thanks @Anastasia Dyubaylo 
 

Kurro Lopez · Jul 13, 2020 go to post
In deed,

The problem is in the backspace ($ c (8, ......)) because that character is not recognized in an HTML simulation.

Please, try to change this line:

 f  v#1 q:(v?.1n) " !no number", $c(27,91)_12_"D"

This is the ESC [12D statement which is the same than $c(8) but the WebTerminal is able to interpret it

I hope it helps you

Best regards,

Kurro López