In my previous article, we reviewed possible use-cases for macros, so let’s now proceed to a more comprehensive example of macros usability. In this article we will design and build a logging system.
Logging system
Logging system is a useful tool for monitoring the work of an application that saves a lot of time during debugging and monitoring. Our system would consist of two parts:
Storage class (for log records)
Set of macros that automatically add a new record to the log
We are trying to convert some of our SQL Service Integration Service jobs from Visual Studio to Ensemble. If we execute a Stored Procedure within SQL Server Management Studio it is returning approx 12,000 rows. However when Ensemble executes the same Stored Procedure it is only returning 250 rows.
We are wondering how to create translation profile for HL7 to SDA in "HEALTH SHARE". can you please help us with the class definition containing the mapping for that(so that we can import directly and understand the mapping).
The common requirement in many applications is logging of data changes in a database - which data has changed, who changed them and when (audit logging). There are many articles about this question and there are different approaches on how to do that in Caché.
In the previous article, I have demonstrated a simple way to record data changes. At this time I have changed the "Audit Abstract Class" which is responsible for recording audit data and the data structure where the audit log will be recorded.
I have changed the data structure to a parent and child structure where there will be two tables to record the "transaction" and the "fields its values" changed on that transaction.
The Management Portal allows you to Export one or more globals to a file that you can then Import into that or another namespace. However, the Management Portal can only be used to export entire globals. For exporting selected nodes or subtrees within a global, a different utility is necessary. This utility is the Export() classmethod in the %Library.Global class, which can export an entire global but also has the ability to export selected nodes or subtrees.
Over the next few months I will be releasing a number of open source libraries and tools to the Caché community.
Most of the code has evolved from previous production grade solutions over the years and I am collating it together under a single overarching library package that I am calling Cogs.
Curious if there is a string function which can transform a delimited string into an array without looping through $Piece...such as "a,b,c,d,e,f" into array(0)=5,array(1)="a",array(2)="b" etc
I've been wondering about some code that I have come across a lot over the years.
Let's assume I have class Cinema and class Film. Conceptually the data in these classes are never really physically deleted but only flagged as such, due to business requirements.
What I find is that developers tend to create a 3rd class "CinemaFilms", in a child relationship to parent Cinema, with a reference to Film. Rather than a one-to-many between Cinema and Film.
I have this code here;I am trying to read a csv file but when I run this code I get <LIST>%open+3^%stream.Object.1 would anyone have a look and tell me where I am going wrong .Record mapper is fine but I need a custom csv Importer
Recently, a partner company started to develop an Angular client for their Cache application. Together, we decided to leverage the power of Caché dynamic objects to exchange JSON encoded data between client and server parts. However, we realized that currently there is a gap in Cache JSON implementation that prevents simple use of traditional registered and persistent classes to exposed their data with the same ease as with XML. I wrote a small JSON adapter, that does the job and bridgers the gap. It's purpose is simple expose data described by a regular Cache class in a one-to-one fashion to a %DynamicObject. On the other hand, when a serialized JSON data comes in, it can be easily deserialized into dynamic object and subsequently bound to regular class by the newly created adapter.
I've created a datatype class whoch extends from %Library.String with a REGEX parameter and the validation of the value against the regular expression. The class does not support Populate using the regular expression as a template for data population.
This is the first article of a series diving into visualization tools and analysis of time series data. Obviously we are most interested in looking at performance related data we can gather from the Caché family of products. However, as we'll see down the road, we are absolutely not limited to that. For now we are exploring python and the libraries/tools available within that ecosystem.
Set httprequest=##class(%Net.HttpRequest).%New()
Set httprequest.Server="www.intersystems.com"
Do httprequest.Get("/")
Do httprequest.HttpResponse.OutputToDevice()
Do httprequest.Get("/cache/")
Do httprequest.HttpResponse.OutputToDevice()
It is often necessary to run some external command such as a python program or a shell script from inside Caché/Ensemble. There are three ways of doing this:
I am trying to read an xml document using %XML.TextReader and that's is all well and l can get my elements values but would like to determine where the next record start on the xml without referring to the document path in essence would like to use the same method to read different xml docs. I would like to know if is there a way or a function that I can use to get the start and end of a record in xml as I would to get the start and end element.
We are starting to look into our BPL's and catch errors that calls may return. Can someone explain how to use the THROW and CATCH within the Business Process Language or have a sample of how it should work?
Can anyone provide some sample in ObjectScripts to import a tab separate txt file into a SQL table? I checked the document, there are two available classes, %SQL.Import.Mgr and %SQL.Until.Procedures, which one is better choice?
I am trying to transform an Enlib.EDI.XML.Document through aXLT I know how to trans form the xml document through a xlt stylesheet but been trying to get an Enlib.EDI.XML. Document from a procees by creating aoperation that will do the transformation of this to file if this can be done in a process all ideas welcome so far I have come to this and I keep getting an error
I want to be able to import XML (say, using %XML.Reader) to Caché objects permissively (ignoring invalid/unexpected tags/attributes), but also to validate the same XML and list any/all invalid tags/attributes that it contains.