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

Article Sean Connelly · Aug 21, 2017 3m read

If you want to dynamically serve images as a property of JSON then there is no perfect encoding solution. One method used frequently is to Base64 encode the image. Whilst there are some negatives to doing this, such as data inflation, there are some positives to working with Base64 images inside the browser.

Let's say you have an image placeholder on a web page...

<div id="image-container"><div>


And you fetch a JSON message from the Caché server containing the image as one of its properties...

var msg = JSON.parse(client.responseText);
4
1 1925
Question Alex Goncharov · Nov 6, 2017

Hello, evrybody, I'm writing one project using CSP("OnPreHTTP"), and also REST angular. At the beginning I wrote purely on csp, then I decided to use angular for the flexibility of the client part. Now I can not design logging, I created a table App.Log with properties

3
0 689
Question Rajesh Shetty · Oct 20, 2017

Hi,

I am receiving a CSV file as Ens.StreamContainer using pRequest As Ens.StreamContainer

In the studio code, pRequest.Stream.ReadLine()  returns following records when read in a while loop using pRequest.Stream.AtEnd = 0

Appt ID , Patient ID , Patient Name    , Program ,   Appt Date , Appt Start

       102 ,            1002 ,    "Gene, Jill"       ,  HTR          , 06/06/2017 , 10:00

       103 ,            1044 ,    "Smith, John" ,  HTR          , 06/10/2017 , 08:00

2
0 1142
Article Rubens Silva · Oct 13, 2017 2m read

Hello again and welcome to the next tutorial on this series: Part 4 - Sharing data across router methods.  Here we are going to learn how to share a object containing data that is available for read across every router methods.
You're required to complete at least the Part 1 before entering this one. Still, this is supposed to be a really short tutorial, since there isn't much to be said about data sharing.

0
0 568
Question Thembelani Mlalazi · Oct 10, 2017

I have an xml file that I read into objects and I am trying to print that file back in nested xml anyone with idea on how that can be achieved or where I can read in order to achieve this, here is an example of what I am trying to do.

From this

<Root>
  <FamilyMembers>
  <familyName>
  </familyName>
  <Name>
  </Name>
  <Age>
  </Age>
  <Employment>
  </Employment>
  </FamilyMembers>
</Root>

 

To this

2
0 725
Question Arcady Goldmints-Orlov · Oct 3, 2017

I have a class that has a list property, which contains a list of other objects, and I want to join against it in SQL.

Class Foo Extends %Persistent
{
Property MyBars As list Of Bar;
}

Class Bar Extends %Persistent { Property Name As %String; }

Simply querying the Foo table, I see that MyBars looks like a $LIST, so I tried using a query with the %inlist operator but that didn't seem to work as expected. The following query produces zero results:

select bar.name from foo join bar on bar.id %INLIST MyBars

7
0 3123
Question Jenna Makin · Sep 29, 2017

Hi-

I am running the latest version of Cache and am trying to use the Config.* classes in the %SYS namespace to be able to gather information from a cache.cpf file that was provided to me by a customer.  The customer is running an older version of Cache which had a different Version number in the cpf file.  Theirs is 2013.1 and mine is 2015.1.  

My question is, are the Config.* classes backwards compatible.  Can I use a 2017.1 version of Cache to read information from cpf file from a 2014 system?

12
0 381
Article Rubens Silva · Aug 9, 2017 9m read

Hello.
The idea of this post is to introduce Frontier: An abstraction layer that allows Rapid REST development.

REQUIREMENTS:

Why?

Have you ever found yourself dealing with repetitive tasks like mounting objects, serializing them and eventually handling multiple errors for multiple cases? Frontier can boost your development by making you focus on what really matters: your application.
 

Frontier is made to stop you from WRITE'ing by instead forcing your methods to return values.
It's designed to make you code clean, and you'll see the why pretty soon.

This is the Part 1, where you'll learn he basics about how to work with Frontier. That means at the end of this part you should be capable of 

creating GET requests without difficulties. Since this also serves as a way to introduce the framework, I'll be calling this part: Core concepts.

8
0 1788
Question Kumaresh Ram · Sep 10, 2017

In which global cache class codes are storing in cache DB?

For example, Routine codes are storing in ^ROUTINE global.

situation: Need to read line by line and need to replace one string to another string in class files(.cls file) using programming.

Need to replace Property type in class files using programming i mean via programming to edit the class files

4
0 733
Article Maks Atygaev · Jul 18, 2017 7m read

MonCaché — MongoDB API implementation based on InterSystems Caché

Disclaimer: This article reflects author's private opinion and has no relation to the official position of InterSystems.

IDEA

The idea of the project is to implement basic MongoDB (v2.4.9) API features for searching, saving, updating and deleting documents in a way that will allow the use of InterSystems Caché instead of MongoDB without changing the code on the client side.

MOTIVATION

14
0 1957
Question Athanassios Hatzis · Aug 29, 2017

Hi,

I am experimenting with Cache-Python binding.  In the following piece of Python code

import intersys.pythonbind3

conn = intersys.pythonbind3.connection( )
conn.connect_now('localhost[1972]:SAMPLES', '_SYSTEM', '123', None)
samplesDB = intersys.pythonbind3.database(conn)
p10 = samplesDB.openid("Sample.Person",'10',-1,-1)

p10.run_obj_method("PrintPerson",[])

I am opening the 10th record of Sample.Person class and then I am calling an object method (PrintPerson). 

Method PrintPerson()

  {

    Write !, "Name: ", ..Name

    Quit  

  }

14
0 962
Article Sean Connelly · Apr 27, 2017 7m read

XDATA is used for a whole host of ISC libraries to store things like Zen pages, BPL logic and DTL transformations.

XDATA is the equivalent of XML config files of the JAVA world and JSON config files of the JavaScript / NPM world.

Whilst Atelier looks to shift source code to the disk, XDATA will remain a key component to source control our projects config / meta data.

I come across many developers who overlook XDATA, seeing it as an internal function of Cache and Ensemble and instead use globals to move meta data around, I've been there myself.

4
0 1345
Question Rubens Silva · Sep 4, 2017

Hello, I just noticed that the following query is not allowing when using cached queries.

The compiler will accuse the code about missing a closing quote.
Just so you know, if I use this query dynamically it works, so I guess it's related to the code linting.

Query T() As %SQLQuery [ SqlProc ]{SELECT TOP 3 JSON_OBJECT('lit':'Employee from','t':%TABLENAME,'name':Name,'num':SSN) FROM Sample.Employee}

The bold part is what is causing the error.

Version 2017.

4
0 482
Question Sean Connelly · Aug 25, 2017

SOLVED

tl;dr how can you tell if a number is really a string

The original question has been updated/improved.

Equality comparisons on floating point numbers will produce different results...

"1.1"=1.1  //is true!

"0.1"=0.1  //is not true :(

This second comparison can be fixed with...

+"0.1"=+0.1 // is true!

The problem is, what if we don't realise that a value is a stringy number, or just overlook implementing this defensive check.

One solution would be to lint check %Float properties and return types that should originate from a number and not a string, as discussed here...

31
0 1307
Question Guy Peer · Aug 28, 2017

Hi,

I have a process in which i call a rest operation in a while loop, get a response in JSON format of 50 issues, with paging, meaning this call will happen until the total amount of issues will be returned. each JSON is parsed into a proxyObject, and inserted to a list. later the entire list will be sent to an SQL operation which will write the data in the appropriate tables.

The problem i'm encountering, is when i use the "ASSIGN" action, with insert at a certain key (context.i=context.i +1  for each iteration of the loop), i get an Error  that says that the value 3 is invalid key.

6
0 766
Article Sean Connelly · Aug 21, 2017 2m read

tl;dr I have discovered that using $THIS in a very specific way will make persistent objects go stale.

I found that it only happens when using $get on an array that contains the OID reference of $THIS. I assume that this is an unwanted feature and have raised a WRC. The problem can be recreated following the steps below, I have also posted the workaround that I am currently testing and looks to be working fine.

1. Create a persistent class...

7
0 459
Question Kurro Lopez · Aug 23, 2017

Hi all,

I need to create a routine to modifiy some values in a global.

My first attempt was:

    // Search the first position of Messages
    set pos=$Order(^Ens.MessageBodyD(""))
    while(pos > 0){
        // Get the class name
        set clase = $Order(^Ens.MessageBodyD(pos,1))
        if (clase="MensajesRestResponse")
        {
            // Do the convertion
        }
        set pos = $Next(^Ens.MessageBodyD(pos))
    }

but if I use a *.bas file (cache basic script), I'm not able to use these commands ($Order and $Next) and I don't know how to translate theses words.

3
0 568
Article Fabian Haupt · Jan 20, 2017 8m read

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.

The series is closely tying into Murray's excellent series about Caché performance and monitoring (see here) and more specifically this article.

4
1 1806
Question Scott Roth · Aug 1, 2017

I know there are numerous Java libraries available to scan a PDF meta data, but is there a way to scan a PDF using native cache object script? We are looking to take a PDF from an external vendor, scan for meta data, create the HL7 message, and embed the PDF within the HL7 message.

Thanks

Scott Roth

The Ohio State University Wexner Medical Center

2
0 1612
Article John Murray · Aug 17, 2017 1m read

Here's one way to determine if a class is mapped (i.e. it is in a package whose definitions come from a database other than the default code database for the current namespace):

SAMPLES>w ##class(%Library.RoutineMgr).IsMapped("Cinema.Film.cls")
0
SAMPLES>w ##class(%Library.RoutineMgr).IsMapped("%iKnow.Objects.Source.cls")
1
SAMPLES>

If you pass a by-ref second argument to IsMapped you can also discover what database the class definition is stored in:

0
0 715