Find

Question
· Jun 10, 2019

How to generate a pdf file from an XLFO in Ensemble

In my production I receive an  XLFO stream and I would like to pass that to the FOP pdf rendering engine to produce pdf files .So far in my research that can be achieved through ZEN .I would like to create an operation that will take advantage of that and be able to pass my XLFO stream  to the operation and create pdf files I found something similar  here but for some reasons I get errors like below if any one understands what they mean please advice or someone  who had to do something similar advice on how to achieve this thanks in advance

 

0Error rendering: OS code=1 Use $LOG=1 to check•
ENSEMBLE†2e^zrenderDirectStatus+2^%SYS.ZENReportServer.1^1/e^%ServeTransform+48^%SYS.ZENReportServer.1^12e^%PerformTransform+1^%ZEN.Report.reportPage.1^1.e^%DisplayPDF1+19^%ZEN.Report.reportPage.1^1,e^%DisplayPDF+7^%ZEN.Report.reportPage.1^1-e^zCallReport+33^%ZEN.Report.reportPage.1^10e^zGenerateReport+4^%ZEN.Report.reportPage.1^14e^zTestFO2PDFFromMethod+5^ZEN.Report.FOWrapper.1^1e^^^0
2 Comments
Discussion (2)1
Log in or sign up to continue
Article
· May 29, 2019 1m read

Simple Remote Server Control

This example is extracted from a long-running installation.
The purpose is to have simple monitoring of several servers at a rather primitive level.
Just slightly more intelligent than a raw PING. But still easy to integrate.
It avoids the overkill of information you are often confronted with while you are just
interested in the number of active processes or similar basic figures.
The example shows a basic skeleton that might be easily filled by your real needs.

It consists of 3 sections:

  • the data section to hold server access data
  • the server section to run unattended at the server you want to monitor
  • the client section that is just for demonstration and should be integrated by your code into your environment.

Operation is simple:

the server starts and listens for requests.

from client, various inquiries go to server and get replied.

The whole example is kept very simple and it is your task to add what you require
and to adapt the client section to your needs and for your environment.

GitHub

Discussion (0)1
Log in or sign up to continue
Article
· May 23, 2019 9m read

PHP module for working with hierarchical data in InterSystems IRIS

PHP, from the beginning of its time, is renowned (and criticized) for supporting integration with a lot of libraries, as well as with almost all the DB existing on the market. However, for some mysterious reasons, it did not support hierarchical databases on the globals.

Globals are structures for storing hierarchical information. They are somewhat similar to key-value database with the only difference being that the key can be multi-level:


Set ^inn("1234567890", "city") = "Moscow"
Set ^inn("1234567890", "city", "street") = "Req Square"
Set ^inn("1234567890", "city", "street", "house") = 1
Set ^inn("1234567890", "year") = 1970
Set ^inn("1234567890", "name", "first") = "Vladimir"
Set ^inn("1234567890", "name", "last") = "Ivanov"

In this example, multi-level information is saved in the global ^inn using the built-in ObjectScript language. Global ^inn is stored on the hard drive (this is indicated by the “^” sign in beginning).

In order to work with globals from PHP, we will need new functions that will be added by the PHP module, which will be discussed below.

Globals support many functions for working with hierarchies: traversal tree on fixed level and in depth, deleting, copying and pasting entire trees and individual nodes. And also ACID transactions - as is done in any quality database. All this happens extremely quickly (about 105-106 inserts per second on regular PC) for two reasons:

 

  1. Globals are a lower level abstraction when compared to SQL,
  2. The bases have been in production on the globals for decades, and during this time they were polished and their code was thoroughly optimized.

Learn more about globals in the series of articles titled "Globals Are Magic Swords For Managing Data.":

Part 1.
Trees. Part 2.
Sparse arrays. Part 3.

In this world, globals are primarily used in storage systems for unstructured and sparse information, such as: medical, personal data, banking, etc.

I love PHP (and I use it in my development work), and I wanted to play around with globals. There was no PHP module for IRIS and Caché. I contacted InterSystems and asked them to create it. InterSystems sponsored the development as part of an educational grant and my graduate student and I created the module.

Generally speaking, InterSystems IRIS is a multi-model DBMS, and that's why from PHP you can work with it via ODBC using SQL, but I was interested in globals, and there was no such connector.

So, the module is available for PHP 7.x (was tested for 7.0-7.2). Currently it can only work with InterSystems IRIS and Caché installed on the same host.

Module page on OpenExchange (a directory of projects and add-ons for developers at InterSystems IRIS and Caché).

There is a useful DISCUSS section where people share their related experiences.

Download here:

https://github.com/intersystems-community/php_ext_iris

Download the repository from the command line:

git clone https://github.com/intersystems-community/php_ext_iris

 

Installation instructions for the module in English and Russian.

Module Functions:

PHP function Description
Working with data
iris_set($node, value)
 
Setting a node value.
iris_get($node)
 
Getting a node value.
iris_zkill($node)
 
Deleting a node value.
iris_kill($node)
 
Deleting a node and all descendant branches.
iris_order($node)
 
Traversal the branches of the global on a given level
iris_order_rev($node)
 
Traversal the branches of the global on a given level in reverse order
iris_query($CmdLine)
 
Traversal of the global in depth
Service functions
iris_set_dir($FullPath)
 
Setting up a directory with a database
iris_exec($CmdLine)
 
Execute database command
iris_connect($login, $pass) Connect to database
iris_quit() Close connection with DB
iris_errno() Get error code
iris_error() Get text description of error

 

 
If you want to play around with the module, check e.g. docker container implementation
 

Especially for DC and those who wants to use we run a virtual machine with a Caché php-module was set up.

 
For self-installation of the module for InterSystems Caché

Just out of interest, I ran two primitive tests to check the speed of inserting new values into the database in the docker container on my PC (AMD FX-9370@4700Mhz 32GB, LVM, SATA SSD).

  • Insertion of 1 million new nodes into the global took 1.81 seconds or 552K inserts per second.
  • Updating a value in the same global 1,000,000 times took 1.98 seconds or 505K updates per second. An interesting fact is that the insertion occurs faster than the update. Apparently this is a consequence of the initial optimization of the database aimed at quick insertion.

Obviously, these tests cannot be considered 100% accurate or useful, since they are primitive and are done in the container. On more powerful hardware with a disk system on a PCIe SSD, tens of millions of inserts per second can be achieved.

What else can be completed and the current state

  1. Useful functions for working with transactions can be added (you can still use them with iris_exec).
  2. The function of returning the whole global structure is not implemented, so as not to traverse the global from PHP.
  3. The function of saving a PHP array as a subtree is not implemented.
  4. Access to local database variables is not implemented. Only using iris_exec, although it's better with iris_set.
  5. Global traversal in depth in the opposite direction is not implemented.
  6. Access to the database via an object using methods (similar to current functions) is not implemented.

The current module is not quite yet ready for production: not tested for high loads and memory leaks. However, should someone need it, please feel free to contact me at any time (Sergey Kamenev sukamenev@gmail.com).

Bottom line

For a long time, the worlds of PHP and hierarchical databases on globals practically did not overlap, although globals provide strong and fast functionality for specific data types (medical, personal).

I hope that this module will motivate PHP programmers to experiment with globals and ObjectScript programmers for simple development of web interfaces in PHP.

P.S. Thank you for your time!

1 Comment
Discussion (1)2
Log in or sign up to continue
Discussion (5)2
Log in or sign up to continue
Question
· Apr 9, 2019

NHS CareConnect in Intersystems

Hi There ,

     We are trying to do a small POC trying to integrate NHS Careconnect with Ensemble/Healthconnect. Does anyone have implemented this before. It would be good that you provide some suggestions  or any sample implementation. It would be good to get suggestions any  interesting use cases 

within NHS England for the POC.

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