#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 Bill Wang · Dec 22, 2016

Hi,

I have 3 classes defined to model the team/team-member/employee relationship, where each employee can belong to multiple teams, each team can have multiple employees, and one and only one team member is a team leader:

1
0 582
Question Scott Roth · Dec 8, 2016

Using the following...

//Get PDF stream object previously saved
   Set pdfStreamContainer = ##Class(Ens.StreamContainer).%OpenId(context.StreamContainerID)
   Try {
     Set pdfStreamObj = pdfStreamContainer.StreamGet()
   }
   Catch {
      $$$TRACE("Error opening stream object ID = "_context.StreamContainerID)
      Quit
   }

Would it be possible to search the pdfStreamObj for certain values like a Medical Record, or Patient Name?

Thanks

Scott

1
0 1148
Question Bahram Aziz · Dec 7, 2016

Hi,

I was looking at the ENSDEMO namespace in our Ensemble server. In the class Demo.REST.DirectoryOperation, there is a line that uses the macro $$$URLENCODE. I would like to know exactly what does this macro $$$URLENCODE() do. Specifically what value does it. Unfortunately, I can't find anything about this macro in the Ensemble Documentation.

2
0 1619
Question Laura Cavanaugh · Dec 6, 2016

Hello.  When you export and then import a table of data, is the import smart enough to figure out if a row already exists in the new namespace, and if so update the row rather than just save/add the row?

For example, we have a table in DEV, and the same table in QA.  The DEV table has more fields than QA.  When we moved up the class, the field definitions went with the table into QA, so now the table definition is the same in both.

2
0 605
Question John Hotalen · Nov 30, 2016

Hello Fellow Caché Developers,

The purpose of this post is to ask for everyone's thoughts and input around the use of transient, SQLCalculated/Computed properties within persistent classes.

This approach allows for extra data values needed in SQL queries to be available without having to join to other tables.

Very simple/basic example to illustrate the topic:

Let's say I have a persistent class named ICDAutoCodeDefn to hold ICD Auto-Coding definitions, such as:

Class ApplicationName.DB.MedicalCoding.ICDAutoCodeDefn Extends %Persistent

That has a few properties:

SpecimenPart As %String

4
0 956
Question Chip Gore · Nov 14, 2016

In writing some code on:

Cache for Windows (x86-64) 2015.1 (Build 429U) Fri Feb 13 2015 14:37:23 EST

I noticed an unexpected "ROLLFAIL" error when a Unique Index fail was generated in a %Save() call.

The object SHOULD fail to save, since the Unique criteria is not met, but I didn't expect to see a ROLLFAIL error as the "Last Error".

When running the following class code:

4
0 1164
Question Bapu Hirave · Nov 14, 2016

I have a soap webservice extended from %SOAP.WebService class

Lets say i have web method and have return type of following classes (either one of them)

Class ReturnTypeA

{

 Property SelectedDoses As %XML.DataSet;

}

Class ReturnTypeB

{

 Property SelectedDoses As list Of WebServices.DataTypes.Dose;

}

Which return type class has better performance while in terms of xmL serialization ? A or B

my client application is in C#

1
0 474
Question Mohan Sujay · Nov 9, 2016

Hi,

How to post and get data using php. I'm using a php external url. In the body in parsing the request as xml and when i execute this using fiddler it response the result as xml but when i consume it in classmethod it fails. I don't have a wsdl file how can i work it out?

2
0 519
Question Mohan Sujay · Nov 7, 2016

hi,

I have created a asp web service and it is hosted in our internal server. How can i consume that web service in cache class method? It is a soap web service with xml input and xml output. It works fine in all the browser.

3
0 557
Question Laura Cavanaugh · Nov 4, 2016

Here's an easy one for you; before I spend another hour looking for the answer, how do you convert %ArrayOfDataTypes to an array (that could, say, fit into the %session.Data array, or maybe just some array named info()), and of course back again?

NS>s aodt=##class(%ArrayOfDataTypes).%New()
 
NS>w aodt.SetAt("lcavanaugh","username")
1
NS>w aodt.SetAt("organization","coolcompany")
1
NS>w ##class(%ArrayOfDataTypes).BuildValueArray(aodt,.array)
 
<LIST>zBuildValueArray+1^%Library.ArrayOfDataTypes.1

aodt must be serialzed.  What?

NS>zw array

NS>

3
0 1174
Question sansa stark · Nov 4, 2016

Hi All, when I ran the Command to make a folder in particular directory its not working in terminal,but when i run the same command in studio output block it create the folder. Used command: S cmd="mkdir E:\DIRECTORY" O cmd:"QR":10 Suggest Please.

4
0 659
Question Jenna Makin · Oct 5, 2016

Hi-

I have created a class that extends %Persistent and %Populate and have set the various POPSPEC attributes of my properties to control how the  properties are populated.  However, when I compile the class and try to run the Populate() method it tells me the method isnt defined.

Here is the class definition:

2
0 1097
Article Jonathan Levinson · Nov 1, 2016 1m read
    Don’t use Python built into Mac.  Because of System Integrity Protection (SIP) you will not be able to access the libraries that the InterSystems Python binding requires.  The Python build into the MAC has baked in what libraries it can use.Install another Python.  Don’t put this other ahead of Mac Python on path since this could break things.  Apple regards its Python as part of the its OS, and may use that Python in its system operations.This Python will not be installed into the protected area.  Mac does not want you messing with its Python.Use explicit path to invoke this other Python.  
0
0 419
Article Kyle Baxter · Aug 29, 2016 6m read

This post is the direct result of working with an InterSystems customer who came to me with the following problem:

SELECT COUNT(*) FROM MyCustomTable

Takes 0.005 seconds, total 2300 rows.  However:

SELECT * FROM MyCustomTable

Took minutes.  The reason for this is subtle and interesting enough for me to write a post about.  This post is lengthy, but if you scroll to the bottom I'll write a quick summary, so if you've gotten this far and think you've already read enough, scroll to the end to get the main point.  Check for the sentence in bold.

11
0 1456
Question Mohan Sujay · Oct 12, 2016

hi,

1. Created a class(test) and added a classmethod(checkdata).

2. Assigned a object with xml.

3. Created a new class for response and initialized in classmethod(checkdata). 

4. Created a new class for request parsing with list of object parameter.

5. While parsing xml in request for list of object,  the  result count is "0". But the xml has value for "2" object list.

6. XML has follow:

<Request>
    <party>
        <to name=""mohan"" address1=""India""  />
        <to  name=""sujay"" address1=""USA"  />
    </party>
</Request>
4
0 965
Question Tirthankar Bachhar · Oct 20, 2016

Hi,

When we write unit test cases for cache object script code using %UnitTest.TestCase, what  is the best way to write code to identify code coverage?

So, let say my unit test case hit all 10 lines of code of a method for a given class. So, unit test coverage should be 100% for that. But, using line-by-line coverage [(%Monitor.System.LineByLine] getting wrong percentage, because it also includes code comment/documentation as part of code. So, practically we can not ever achieve 100% of code coverage by using this API.

2
0 938
Question Paul Riker · Oct 17, 2016

I have a persistent class where I am logging each CCDA I receive. I want to store all of the providers associated to that CCDA (many to one). In a relational database, I would have a child table with a foreign key to the primary table. I'm guessing the equivalent to Cache would be 

1. Create a custom class (ProviderList) with the properties I want to store.

2. Add the class as a property of my CCDA persistent class.

Property Providers as Array of ProviderList (SQLProjection = "table/column";

Am I on the right track?

4
0 613
Article Jose Ruperez · Oct 13, 2016 1m read

Here you have an easy way to write and execute COS code from your unix scripts. This way one does not need to write routines or even open Studio or Atelier. It can be an option for simple and small actions for instance things like installation tasks or compiling.

See sample bash script (compile.sh) to compile classes:

2
0 995
Question Chris Stewart · Oct 7, 2016

Hi


I have been working on changing a web application from using %FileBinaryStream to storing and serving the file content from a %Stream.GlobalBinary property, stored in a new database.  I have managed to migrate the data across, and have also been able to redirect the stream so that it is being served through the web link.  However, the previous method set attributes on the File stream to have the stream be rendered as the original file type through MIME, using this code

do stream.SetAttribute("ContentDisposition","inline; filename="_filecvt)

2
0 1128