#Object Data Model

4 Followers · 498 Posts

An object data model is that data or code is composed of modules that combine data and procedures that work on the data.

Learn more.

Question Chris Bransden · Apr 19, 2017

Hi!

I'm trying to insert a relationship from a parent object instance to a child object instnace programmatically. Ie, i want to do:

Do parentObject.childRefProperty.Insert(chilDobject)

where childRefProperty is defined by a string. I feel this should be achievable with $PROPERTY and/or $METHOD or maybe something in $SYSTEM.OBJ.*, but can't quite figure it out. Anyone know?

Cheers :)

Chris

3
0 316
Question Alexandr Ladoshkin · Apr 17, 2017

Hello everyone.

I have some issue with trigger. I have class where I defined 3 triggers (UPDATE, INSERT, DELETE). These triggers are Foreach = row/object. In my currently task, I need overide this triggers in children class.  is It possible to do it? 

Thank you for your help.

4
0 421
Question Scott Roth · Apr 11, 2017

With help from others here I had developed some code to take a Base64 PDF within a OBX.5 and save it locally to the file structure on the server.

I had to make a change to the code to return me a String so I can pass the Path back into Ensemble to use it in the message. When I made this change I am getting " ERROR #5034: Invalid status code structure ("/ensemble/data/transfer/AncillaryPDF/TMSAUDIO/Apr-11-1/980512729TMSAUDIO1046784936436537800.pdf")"

Here is the code...

3
0 1344
Question Stella Ticker · Apr 11, 2017

There is a large file that needs to be processed, with over 500 000 rows. Each row needs to be verified for various data and then all the results collated and reported into a single report.  What is the most efficient way to do this? I tried calling the processing function with Job , where each function jobbed off would report results to a different node of a common global. But the jobbed functions are not updating their respective rows even though I am passing the global name and root node. What is the most efficient way to process this large file? Any Cache/Ensemble ideas are appreciated.

1
0 1302
Question Gordon Hodgkinson · Apr 9, 2017

Hi All,

Am attempting to run sample unit tests as per

Caché %UnitTest Tutorial
Example: Executing a Test Using Set-Up and Tear Down Methods
 

 and getting an ERROR #5007:

The Terminal detail is as follows:

SAMPLES>Set ^UnitTestRoot="C:\UnitTests"                                        
SAMPLES>write ^UnitTestRoot
C:\UnitTests
SAMPLES>do ##class(%UnitTest.Manager).RunTest("MyTests")
 
ERROR #5007: Directory name '/usr/cachesys/mgr/samples/C:/UnitTests/MyTests/' is invalid
SAMPLES>

2
0 571
Question Bapu Hirave · Mar 24, 2017

here is my $ZV string "Cache for Windows (x86-64) 2016.2.1 (Build 803) Wed Oct 26 2016 12:43:35 EDT"

 two questions

1. How do i convert any Persistent object to JSON String ?

2. How do i convert an y Register object to JSON string ?

3. Do i need to extend from any adaptor class for 1 & 2 ?

11
0 5399
Question Stephen Wilson · Mar 24, 2017

Can you create ad-hoc Caché relationship objects that are not part of the original Caché class definition? One of the drawbacks with relationships is that that the more relationships you have defined, the more difficult it can be manage. I was wondering rather than having all your relationships defined in the Caché class, could you programmatically create relationships between classes as and when they are required? We mostly use parent-child relationships in our classes. It is not uncommon for us to have 4 parent-child relationships defined in a single class and each of those children have

3
0 463
Question David Baran · Mar 26, 2017

Hi,

I have a xml stored in a globalCharrachter Stream.

I would like to get a full node parts of the xml to store it in an other file.

Exemple of an Xml store in cache

<doc>
<header></header>
<product></header>
<market></marker>
<doc>
</aaa>

I would like to generate new xml from this one like

<product></product> to product.xml

<market></market> to market.xml

s xml = ##class(MyExemple.test).%OpenId(1) --> my object with XML <doc> store 
s doc = ##class(%XML.Document).%New()
d doc.GetDocumentFromStream(xml.TXML)
3
0 592
Question Ryan Hulslander · Mar 23, 2017

Goal:

  • Take an HL7 message, parse some data from it
  • Call a web service to get an authorization key, comes back as a simple string
  • Create a request object with data from the HL7 message and send it to the Web Service

The main web method call requires that key I received as a Soap Header element. All I can pass to the SOAP Operation business class is the request object with the data I plucked from the HL7 payload. Nothing in that particular request message has anything in it that tells anything to send the header, too.

2
0 1297
Question Eduard Lebedyuk · Mar 23, 2017

Let's say I have two classes: A and B. They share no common parent except %SystemBase. But these classes have some properties with the same name (type may be the same or not):

Class A {

Property data As C;

Property data2;

}
Class B {

Property data As D;

Property data3;

}

I need to automatically convert  object of class A into object of class B. I'm planing to write a class generator that generates a separate class that converts A to B.  It would work like this:

1. Query %Dictionary to get list of properties:

  • With the same names
  • With both properties being of datatype or object type
4
0 495
Article Michael Braam · Feb 20, 2017 14m read

Overview

Encryption of sensitive data becomes more and more important for applications. For example patient names, SSN, address-data or credit card-numbers etc..

Cache supports different flavors of encryption. Block-level database encryption and data-element encryption. The block-level database encryption protects an entire database.  The decryption/encryption is done when a block is written/read to or from the database and has very little impact on the performance.

With data-element encryption only certain data-fields are encrypted.  Fields that contain sensitive data like patient data or credit-card numbers. Data-element encryption is also useful if a re-encryption is required periodically. With data-element encryption it is the responsibility of the application to encrypt/decrypt the data.

Both encryption methods leverage the managed key encryption infrastructure of Caché.

The following article describes a sample use-case where data-element encryption is used to encrypt person data.  

But what if you have hundreds of thousands of records with an encrypted datafield and you have the need to search that field? Decryption of the field-values prior to the search is not an option. What about indices?

This article describes a possible solution and develops step-by-step a small example how you can use SQL and indices to search encrypted fields. 

9
2 1885
Question Stephen Wilson · Oct 18, 2016

I have been following the online Zen Quickstart Tutorial using the lastest release documentation. In addition to playing around with the styling and making a few minor functionality tweaks, I wanted to add an additional column that shows a count of the number of phone numbers for that Contact (as shown in the image below).

The idea here is that you can see what contacts have phone numbers without having to click on the "view phones" link. All I have done here is add a blank additional column to the %ZEN.Component.tablePane object

4
0 600
Article John Murray · Mar 4, 2016 1m read

There's plenty of goodness in the %-packages InterSystems supplies, and it seems that every new version of Caché brings something new. The browser-based class documentation (a.k.a. Documatic) generally provides a good level of information, but on the basis that "a picture is worth a thousand words" I sometimes want a diagram.

For example, when trying to navigate the %Dictionary package for a project that needed to find out about class definitions, here's one of the UML class diagrams I created.

7
0 1728
Question Stella Ticker · Mar 13, 2017

A method to convert certain non-readable ASCII characters in a %Stream.FileCharacter object first copies it into a %Stream.FileBinary object and then loops through each character one at a time to find and convert these offensive characters to our interpretation of their readable ASCII equivalents  . The loop is sequential (while 'bStream.AtEnd) and is taking too long for large files. Any suggestions for an existing Cache method to do this or is there another way, besides a sequential loop, to examine every character of  a binary Stream?

2
0 973
Question Susobhan Pandit · Jan 15, 2017

Hi,

I am saving 2000 objects of a class in a loop.

In one environment it is taking a total of 86 seconds and in another environment it is taking 0.55 seconds.

The code (the class and the code for save) is same for both the environment. I have Ensemble 2012.1.5.956 

Can somebody help me to identify the cause of the discrepancy. Is there any memory or any other setup which may cause the problem.

Thank you in davance,

Susobhan

2
0 274
Article John Murray · Mar 2, 2017 1m read

As more people join Developer Community, and with increasing efforts to promote code sharing, I'd like to draw fresh attention to this post I wrote a year ago. It spotlights a feature within the class compiler which is both useful and dangerous. When importing code (e.g. from an XML export of classes received from someone), it's worth considering the risks.

Even if that post doesn't seem relevant to you at the moment you may wish to note it for the future. A handy way of doing this is to click the star icon at the end of it.

1
0 343
Question Evgeny Shvarov · Feb 25, 2017

Hi!

Consider I have a class Package.Data with Property UniqueStringValue as %String.

I introduced the Index for this property:

 Index ValueIndex on UniqueStringValue [Unique];

It works well.  But if I try to check if there is an object with the certain value in code like this:

if ##class(Package.Data).ValueIndexExists(value)  

this expression fails, if value="value", even if there is an instance with instance.UniqueStingValue="Value"

How can I set the index to prevent saving case sensitive values in this class?

6
0 667
Question vp123 · Feb 21, 2017

Hi!

I'm trying to implement %OnAfterDelete ClassMethod for persistent class. As a parameter it gets oid As %ObjectIdentity for the deleted object.

ClassMethod %OnAfterDelete(oid As %ObjectIdentity) As %Status

My question is: how to get ID value from %ObjectIdentity ?

2
0 590
Question Laura Cavanaugh · Feb 15, 2017

I have a property, Emails, that needs to contain a list of comma-delimited values, or "". Is there a benefit to making this property a list of %String, a Collection[list] (or however you do it), an array, or anything other than a simple %String type?

I just  need to store some values, and return these values in SQL -- so it needs to be SQL compatible.  I don't need to index the values or use individual values in the SQL statement (e.g. Select * from table where emails [ "email@co.com"  -- I don't need to do this, although maybe this would work anyway if it's of type %String).

3
0 2867
Question Seth Jaffe · Feb 13, 2017

  The following code in .Net using  CacheObject.dll  version 2016.1.2.206 com library

                  ConnectionString  =  "cn_iptcp:10.56.135.160[1972]:PHDEMO:PHSYSADM:***********" 

                  b = factory.Connect(ConnectionString  )
                  objCacheObject =  factory.Static("CacheObjectConnection")     
                  clist  = factory.GetConnectionList()

  for the above code, b is true and clist is  Local,cn_iptcp:127.0.0.1[1972]: 

1
0 521
Question Scott Beeson · Jan 30, 2017

In the table/class HS_Registry.document there is a column/property named RepositoryUniqueId.  There are about 14 unique values, which pretty much lines up with the number of our "Push" (Provide & Register) participants and thus unique document repositories.  However, these values just look like OIDs.  I've been searching for over an hour and I can't find anywhere that will provide me some context to these "Repository IDs".  

Anyone have ideas or suggestions where I could find this info?

3
0 598
Article Tamara Lebedeva · Jan 28, 2017 10m read

Many mobile applications that enable users to get information about road fines and pay them, send notifications about newly added fines. This functionality can be efficiently implemented using push notifications sent to users’ devices.

Our application was not an exception. The server side is based on the Ensemble platform that offers integrated support of push notifications starting from version 2015.1.

0
0 660
Question Iryna Mykhailova · Feb 16, 2016

Recently I came across a very strong statement to the effect that InterSystems.Data.CacheClient.dll library works fast because it does not open a TCP/IP connection, instead it works in the same process as a database. It made me pause for quite some time. Firstly because .Net Managed Provider, which utilises this library, opens TCP/IP connection to the database (and it is stated in the documentation "Using .NET and the ADO.NET Managed Provider with Caché"). And secondly, because as far as I know only eXtreme applications attach themselves to the process. Besides, CacheClient for the most part

6
0 1408