#Object Data Model

0 Followers · 499 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 Ashok Kumar T · Sep 28

Hello Community

The InitialExpression keyword values does not to set default values for properties in classes that extend %CSP.Page, unlike in other class types such as %Persistent or %RegisteredObject, where it works as expected during object instantiation (typically via %New()).

  1. Is %CSP.Page instantiated using %New() under the hood, or does it use a different initialization mechanism?
  2. Are there specific limitations or behaviors in CSP pages that prevent InitialExpression from working as expected?

Thank you!

0
0 0
Article John Murray · Dec 18, 2024 1m read

A benefit of using Doxygenerate is that Doxygen does more than just HTML output. Tweak the Doxyfile that tells Doxygen what to do and you can easily create a PDF. Our example MARINA application yielded a 524-page PDF. Here's what page 94 looks like:

You can browse the whole file here.

In the screenshot above, notice how we only get details of the superclass that is part of the app (AuditHistory). The primary superclass, %Library.SerialObject, is shown faded and with no details of what BankDetails inherits from it.

0
0 0
Article Robbie Luman · Aug 15 8m read

Dynamic Entities (objects and arrays) in IRIS are incredibly useful in situations where you are having to transform JSON data into an Object Model for storage to the database, such as in REST API endpoints hosted within IRIS. This is because these dynamic objects and arrays can easily serve as a point of conversion from one data structure to the other.

Dynamic Objects

Dynamic Objects are very similar to the standard ObjectScript object model you get when you create a new instance of a class object, but with some key differences:

0
0 0
Question Scott Roth · Aug 15

Is there a way to Remove specific all Addresses from a Provider.Individual.Address before reinserting the Addresses from an HL7 message in Provider Directory?

Most fields we can call %clearFields() however since Addresses come from multiple locations we need to isolate and treat Addresses from this HL7 source as a snapshot.

Thanks

Scott

0
0 0
Article Ashok Kumar T · Jul 21 13m read

This article is a continuation of the IRIS JSON project and features additional methods and insights.

Let's continue with the instance methods

%GetTypeOf(Key)

This instance method is used to determine the JSON data type of the %DynamicObject or %DynamicArray.

It returns one of the following strings:

0
0 0
Discussion Evgeny Shvarov · Jun 21

Hi fellow developers!

Curious if you guys use CreatedAt and LastUpdated properties in your classes?

Created to stamp when the record was created and LastUpdated when it was last updated. Where it can be useful - almost everywhere )) I find it convenient in records sorting (e.g. by creation or last update), in sync (with other systems), and so on, for better analytics.

Do you use it all the time for all the classes?

If don't, why not? What do you use instead?

What property type do you use - %TimeStamp? %DateTime?

0
0 0
Question MARK PONGONIS · Jul 17, 2018

Would like to know if there is an alternative or better way to paginate through a dataset using dynamic SQL than what I am using below. The problem is that as the potential pool of data gets larger, this code slows down to the point of not being useable. In analyzing each line of code below, it appears the slow down is related to the initial rset.%Next() iteration. Is there anything available which does not require a subquery/%VID such as a simple LIMIT/OFFSET?

My code is similar to :

s sql=##class(%SQL.Statement).%New()

31
3 3604
Question Timothy Leavitt · Mar 31

I'm exploring this right now: given a bunch of types defined as Pydantic models, how can I come up with an equivalent %RegisteredObject/%SerialObject and convert to/from (e.g., to support persistence and match validation as much as possible)?

People who know Python better than I do (e.g., your average undergraduate from this decade): is this a stupid idea or a cool idea? Has anyone else done this before?

0
0 0
Article Nikita Savchenko · Apr 1, 2016 6m read


Hello!

This article is a small overview of a tool that helps to understand classes and their structure inside the InterSystems products: from IRIS to Caché, Ensemble, HealthShare.

In short, it visualizes a class or an entire package, shows the relations between classes and provides all the possible information to developers and team leads without making them go to Studio and examine the code there.

38
4 6146
Article Robert Cemper · Dec 22, 2024 3m read

I recently met an ages old issue related to code maintenance:

  • You have access to your IRIS server just over ODBC/JDBC
  • no VSCode access, no Studio access
  • no (Web-)Terminal access

But you need to take a look on Classes or Routines or Globals !!
Anyhow SQL is your friend.

  • First you need a simple table as temporary text store.
CREATEGLOBALTEMPORARYTABLE  arcc.txt (line VARCHAR(32000))

Not a thrilling action.

  • Next you export your code to local file and import it to your table
0
0 0
Announcement John Murray · Dec 16, 2024

The InterSystems platforms have always offered dynamic documentation of the packages and classes in a namespace, a feature known informally as Documatic. But what if you need to publish this class reference information on a website without requiring the site to be connected to an IRIS server containing the actual classes?

0
0 0
Question Arcady Goldmints-Orlov · Aug 14, 2018

Traditional Caché Objectscript has the multi-dimensional array as its main form of complex data structure and the $order command as the main means of traversing said data structures. But newer versions of Caché ObjectScript also have data structures that are direct parallels of what languages such as JavaScript provide, in the form of %DynamicObject and %DynamicArray. These have an easy to use iterator feature via the %GetIterator method, and even a handy built-in literal syntax for constructing new objects.

4
0 1205
Article Iryna Mykhailova · Jun 1, 2024 3m read

Columnar storage is one of the newer offers provided by InterSystems IRIS. Unlike traditional row-based storage, it optimizes query processing by storing data in columns rather than rows, enabling faster access and retrieval of relevant information.

A couple of articles have been written on when it should be used to give a system the biggest boost, how to create tables like that using SQL

CREATETABLEtable (column1 type1, column2 type2, column3 type3) WITH STORAGETYPE = COLUMNAR  -- ex 1CREATETABLEtable (column1 type1, column2 type2, column3 type3 WITH STORAGETYPE = COLUMNAR)  -- ex 2
0
0 0
Announcement Rob Tweed · Sep 28, 2022

I'd like to announce the release of something really rather interesting - revolutionary in fact.  That may sound like hyperbole, but I don't think you'll have seen anything quite like this, or even thought it possible!

We've pushed out a new JavaScript/Node.js module named glsdb which you can read all about here in detail:

https://github.com/robtweed/glsdb

However, for the purposes of this announcement here, I just want to focus on one part of glsdb: its APIs that abstract IRIS (or Cache) Classes as equivalent JavaScript Objects.

7
1 376
Article Brendan Bannon · Dec 27, 2016 8m read

The Art of Mapping Globals to Classes (4 of 3)

The forth in the trilogy, anyone a Hitchhikers Guide to the Galaxy fan?

If you are looking to breathe new life into an old MUMPS application follow these steps to map your globals to classes and expose all that beautiful data to Objects and SQL.

If the above does not sound familiar to you please start at the beginning with the following:

The Art of Mapping Globals to Classes (1 of 3)

The Art of Mapping Globals to Classes (2 of 3)

The Art of Mapping Globals to Classes (3 of 3)

7
0 2281
Article Brendan Bannon · Dec 27, 2016 8m read

Mapping Examples

Clearly if you have a fourth article in the trilogy you need to go for the money grab and write the fifth, so here it is!

Note:  Many years ago Dan Shusman told me that mapping globals is an art form.  There is no right or wrong way of doing it.  The way you interpret the data leads you to the type of mapping you do.  As always there is more than one way to get to a final answer.  As you look through my samples you will see there are some examples that map the same type of data in different ways.

15
1 2713
Question Yone Moreno · Dec 19, 2023

Good morning,

First of all thanks for your help and time.

We find ourselves at a crossroads in our development journey, and we're reaching out to the community for insights and guidance regarding a critical aspect of our data management strategy.

Our current challenge revolves around the persistence of data in Globals, specifically when it comes to purging. The issue at hand is that, despite purging, data stored in Globals under the current %Persistent classes remains intact. To address this, we are contemplating a shift from %Persistent to %SerialObject for each relevant class.

3
0 342
Article Mihoko Iijima · Nov 30, 2023 3m read

InterSystems FAQ rubric

Class definitions created by users are stored in class definition classes. They can be used to obtain a list of class definitions from a program.

Note: Class definition classes refer to all classes contained in the %Dictionary package.

In the sample code below, a list of class definitions is obtained using the query Summary of the class %Dictionary.ClassDefinitionQuery.

2
0 526
Article Mihoko Iijima · Sep 7, 2023 1m read

InterSystems FAQ rubric

You can avoid the error by specifying a stream object as the argument of %ToJSON() used when generating a JSON string from a dynamic object.

A code example is below.

USER>set temp=##class(%Stream.TmpCharacter).%New()

USER>set jsonobj={}

USER>set jsonobj.pro1=["a","b","c","d"]

USER>set jsonobj.pro2=["あ","い","う","え"]

USER>do jsonobj.%ToJSON(temp)

USER>write temp.Size
51
USER>write temp.Read()
{"pro1":["a","b","c","d"],"pro2":["あ","い","う","え"]}

See also the documentation for details.

[IRIS] Serializing large dynamic entities to streams

1
0 530
Article Mihoko Iijima · Aug 31, 2023 1m read

InterSystems FAQ rubric

By specifying the start and end values ​​of the IDs for which you want to rebuild indexes in the arguments of the %BuildIndices() method provided in the persistent class (=table) definition, you can rebuild only the indexes within that range.

For example, to rebuild the NameIDX index and ZipCode index in the Sample.Person class only for ID=10 to 20, execute the following code (the ID range is specified in the 5th and 6th arguments). 

 set status = ##class(Sample.Person).%BuildIndices($LB("NameIDX","ZipCode"),1,,1,10,20
0
0 505
Article Iryna Mykhailova · Aug 2, 2022 8m read

Before we start talking about databases and different data models that exist, first we'd better talk about what a database is and how to use it.

A database is an organized collection of data stored and accessed electronically. It is used to store and retrieve structured, semi-structured, or raw data which is often related to a theme or activity.

At the heart of every database lies at least one model used to describe its data. And depending on the model it is based on, a database may have slightly different characteristics and store different types of data.

5
3 1770
Article Eduard Lebedyuk · Aug 3, 2020 3m read

InterSystems IRIS currently limits classes to 999 properties.

But what to do if you need to store more data per object?

This article would answer this question (with the additional cameo of Community Python Gateway and how you can transfer wide datasets into Python).

The answer is very simple actually - InterSystems IRIS currently limits classes to 999 properties, but not to 999 primitives. The property in InterSystems IRIS can be an object with 999 properties and so on - the limit can be easily disregarded.

13
1 817
Question Gaolai Peng · Nov 8, 2018

I am trying to get SDA3.Container object from a Stream object like following code:

Method HandleECRUpdateRequest(pRequest As CUSTOM.CORE.Message.ECRUpdateRequest, ByRef pResponse As Ens.Response) As %Status
{

               Set tContainer=##Class(HS.SDA3.Container).%New()
               $$$ThrowOnError(tContainer.InitializeXMLParse(pRequest.ContentStream, "SDA3"))
              
               Set tEventDescription=tContainer.EventDescription

3
1 1150