#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 Thembelani Mlalazi · Jan 30, 2018

I am trying to write an application that will take some information on the database make a call to the Google API distance matrix and get the information to use with rest of the application without using the ensemble part of the development is this possible and how can I do my communication with the  API from a cache class thanks in  advance

7
0 1473
Question John Murray · Jan 30, 2018

In part of this post in 2016 @Eduard Lebedyuk asked if anyone knew what is meant by an "expanded class", as referred to in the text that appears when we run the ShowQualifiers classmethod of %SYSTEM.OBJ thus:

SAMPLES>DO $system.OBJ.ShowQualifiers()
...
            Name: /checkuptodate
    Description: Skip classes or expanded classes that are up-to-date.

3
0 541
Question Scott Roth · Nov 18, 2016

I am trying to come up with a way to decode the Base64 we receive in an HL7 message into a PDF file and save it in a directory on our AIX machine. I thought I had the following working at one time but I am having issues. Has anyone done this before?

ClassMethod DecodeBase64HL7ToFile(base64 As %Stream, Ancillary As %String) As %Boolean
{
set Oref = ##class(%FileBinaryStream).%New()
set Oref.Filename = Ancillary
Do base64.Rewind()
While 'base64.AtEnd {
    set ln=base64.ReadLine()
    set lnDecoded=$system.Encryption.Base64Decode(ln)
do Oref.Write(lnDecoded)
}
Do Oref.%Save()
quit 1
}

Thanks

Scott

5
2 4621
Question Paul Rick · Jan 14, 2018

I have a class to track data changes.
As it becomes slower and slower to find last changes I think I need an index.
The 2 classes are just simplified reality.
HowTo ?

Class Rick.ChangeItem Extends %SerialObject
{
Property Subject As %String;
Property Author As %String;
Property Change As %TimeStamp;
}

and

Class DC.listItem Extends (%Persistent)
{
Property Title As %String;
Property Changes As List Of Rick.ChangeItem ;
/// where & how create the index ?
}
6
0 1127
Question Alex Kogan · Jan 11, 2018

My questions are regarding ClassMethods with a private keyword tags.

When we use a wizard to add a new method, we are given a options to
select private checkbox to make it a private method as well as 
Class Method checkbox in the same time. 

1. What would be the reason and the case to select and use them both?   
2. Secondly, if there is such a case in already developed application is it
safe to remove the private tag from ClassMethod? Obviously if it's not a 
ClassMethod private tag cannot be removed as easily.

Thank you,

11
0 638
Question Kishan Ravindran · Dec 26, 2017

What is difference between using a command $classmethod rather than just invoking them straight away?

For example if i need to call a class and its method i can just use like

do ##class(circle).radius()

rather than using

do $classmethod("circle",radius)

(I suppose both of them doing the same function i am not aware of it)

Please help me understand what is different and is there any specific usage.

Correct me if i have made mistake.

7
0 507
Question Thembelani Mlalazi · Dec 20, 2017

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.

Typical example  l would like to get the highlighted paths please note this would need to go for any xml doc

6
0 907
Question Thembelani Mlalazi · Dec 7, 2017

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

:ERROR{ERROR #5002: Cache error: <PROPERTY DOES NOT EXIST>zXMLTOJson+6^TestEnvironment.Custom.GENERAL.CUSTOM.XLT.XMLToJsonOperation1.1 *Parameters,EnsLib.EDI.XML}
7
0 1020
Question Thembelani Mlalazi · Dec 5, 2017

I am trying to age based on a given date and current date here is my code:


Property DOB As %Date
Method GetAge() As %Integer
{
   if (..DOB="")
    {
  set today=0 
    }
   else
  {
  set today=$ZDate($HOROLOG,2)-$ZDate(..DOB)
  }
  write "Today's==="_$ZDate($HOROLOG),!
  write today
  return today
}
4
0 2763
Article Vitaliy Serdtsev · Dec 8, 2017 6m read

First-class functionwiki

In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. This means the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures. Some programming language theorists require support for anonymous functions (function literals) as well. In languages with first-class functions, the names of functions do not have any special status; they are treated like ordinary variables with a function type.

This post continues the article “Declarative development in Caché”.

[2357111317].forEach(function(i) {
  console.log(i);
});

How to do something like this in Caché using COS?

Below are some exercises on this topic.

0
0 532
Question Scott Roth · Nov 30, 2017

I have a process that I am trying to duplicate from SQL Integration Services (SSIS) into Ensemble so that the rest of my team can help support any issues that may happen.

This particular job creates multiple dictionary files, but for each one of the dictionary files it creates, it also creates a control file that tells the vendor what to process.

So example....I have a result set that is written to a.txt but I also need to create aa.ctrl, then I will have a b.txt and need a b.ctrl.

1
0 530
Question Arun Kumar · Dec 1, 2017

Hi Guys,
Can you please guide me to get rid of this issue. Please find the image files with this post.

Please let me know, before we are developing an API what are all the setup/Configuration(Apache/web server) need to do in my machine. 

If any lead would be appreciated. 

I don't know, in XMLNamespace parameter which URL need to use.  

.

Thanks,

Arun Kumar Durairaj.

3
0 593
Question Evgeny Shvarov · Nov 6, 2017

Hi, folks!

Suppose you have a Caché class with %String property which contains relatively large text (from 10 to 2000 symbols).

The class:

Class Test.Duplicates Extends %Persistent 

{

Property Text As %String (MAXLEN = 2000);

}

And you have thousands of entries.

What are the best options to find entries which are duplicates on this property?

26
1 1519
Question Mike Kadow · Nov 15, 2017

Hello, this is going to be a stupid question, yea I know, there are no stupid questions.

Say, I have an Object Property, Name or Count or Title, or whatever.

How can I get a list, or find out all the different ways it can be expressed?

Example:

-Property Name As %Name;

-Property Name As %String="me"

-Property Name As %String [ Required];

But what other parameters, keywords, restrictions, lists, etc. that I can apply to this Property?

I have been search the I/S documentation and so far at least, I cannot find that sort of information, or in one place.

5
0 615
Question Marco Blom · Nov 21, 2017

Hello Community,

I have a simple question but somehow hard to find the solution:

this is a property in my class:

Property RelationAID As ZenCrm.Relationtypes;

this is my method to save:

ClassMethod PopulateMatrix(tvar1, tvar2) As %Status
{
set RelationMatrix=##class(ZenCrm.RelationMatrix).%New()
set RelationMatrix.RelationAID= tvar1
set RelationMatrix.RelationAType= tvar2
do RelationMatrix.%Save()
quit $$$OK
}

However the 'set' line does not work for the 'related properties.

I have tried: set RelationMatrix.Relationtypes.RelationAID but this failed.

Any suggestion? thanks!

2
0 513