Question Thembelani Mlalazi · Oct 9, 2017

I have this code here;I am trying to read a csv file but when I run this code I get  <LIST>%open+3^%stream.Object.1 would anyone have a look and tell me where I am going wrong .Record mapper is fine but I need a custom csv Importer

ClassMethod ImportCSV()
{
   set adapter =##class(%File).%New()
  
  set status=adapter.%Open("C:\In\in.csv")
  
  if $$$ISERR(status)
  {
   do $System.Status.DisplayError(status)
  }
  
  set counter =1
  
  while 'adapter.AtEnd
  {
   set line=adapter.ReadLine()
   
   set rec= ##class(CSVRecord).%New()
   
   set rec.ID=$piece(line,",",1)


13
0 4924
Question Justin Wilson · Dec 8, 2018

I have a persistent class that represents cities across the United States.  It is below, but basically has a City Id, Name, Lat, Lon and a few other unimportant fields for this issue.  Anytime I attempt to query on the Latitude or Longitude it immediately returns no results.  My first thought was that it was a casting issue so I tried casting both sides to floats, ints, even strings and in all cases it immediately comes back with no results.  I then decided to cast it to a string and attempt a like statement thinking it might be something about how floats are handled, but still no joy.  Any id

2
0 452
Announcement Dmitry Maslennikov · Nov 28, 2018

Are you ready for the next Advent of Code this year?

Just a few days left, the first puzzles will unlock on December 1st at midnight Eastern Time.

Not sure if I will manage to find time to solve those puzzles as quickly as last year, but hope some of you will do. We still have our leaderboard, you can join 130669-ab1f69bf.  So, we will see who the best.

4
0 588
Question John Kumpf · Dec 6, 2018

Hi guys,

I'm running a method on an instance of Cache 2010, which, when compiled, has $$$OK in it's .int code.  This line throws an error, telling me that "the OK macro isn't recognized". 

Some things I've tried;

- I looked it %occStatus, and the macro definition of OK is there.

- I changed $$$OK to 1 by hand in the .int code.  It compiled successfully, but each time I recompile the original class, it's going to put that $$$OK back

- I tried Include %occStatus at the top of the class.  The .int code was unchanged when I did this (is my syntax on that wrong?)

I've had this problem in two different cl

4
0 569
Question John Kumpf · Dec 6, 2018

Hi guys,

Mostly the title.  Let's say my commands are stored in a text file "inFile".  Here was my best guess:

<dir to iris> console IRIS2018 <inFile

For reference, here's an example of the analogous structure that works on Cache:

C:\InterSystems\Cache2018\bin\cache -s C:\InterSystems\Cache2018\mgr -U <namespace to start as> <inFile

I think the problem is this:  When the Cache prompt is started, it opens in the same terminal as the line that started it, so passing inFile to standard input effectively types out inFile's lines as login info or commands in Cache.  In IRIS on the other hand, "console"

1
0 1149
Article Sean Connelly · Nov 19, 2018 2m read

Here's a fun test to see how well you know ObjectScript.

What will each of the following statements output?

write 5 * 10 + 1

write 1 + 5 * 10

write 1 + 0 / 10

write 0 && 0 = 0

write 0 = 0 && 0

write 1 && 1 = 1

write 1 = 1 && 1

write 2 && 2 = 2

write 2 = 2 && 2

write "1 APPLE" + "2 BANANAS"

write "-1" + "1-2"

write +"+-+-+-5"

write "1D7P"-1

write "1E6F"-1

write 0 = "FOO"

write 0 = +"FOO"

write 0 = ''"FOO"

write "10X" - " 5" - "5"

write "10-5"

write +"10-5"

write @"10-5"

write 5_"1"-1

write "5"-1_"1"

write 10 + 10 > 21 + 1

13
2 1228
Question Gunwant Kapade · Dec 4, 2018

This is the class which I want to test.

Class GSK.MyTestUnit Extends %RegisteredObject {

ClassMethod Add(num1 As %Integer, num2 As %Integer) { s res=num1+num2 q res } }

This is my testing class.

Class GSK.TestingClass Extends %UnitTest.TestCase {

Method test() { Do $$$AssertEquals(##class(GSK.MyTestUnit).Add(3,8),41, "Test Add(2,2)=4 passed ") do $$$AssertNotEquals(##class(GSK.MyTestUnit).Add(3,8),11,"pass/fail") }

}

The test cases are passed even though they should fail.

s ^UnitTestRoot="C:\TestSuite1" d ##class(%UnitTest.Manager).RunTest("Test2")

Here TestSuite1 is my parent directory and Te

1
1 367
Question Tirthankar Bachhar · Dec 3, 2018

Hi,

When we define a %String property, and don't mention any MAXLEN, by default it uses 50 as defined in class %Library.String.

As a result, when we try to save data more than 50 characters, it fails with below error.

ERROR #7201: Datatype value 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' length longer than MAXLEN allowed of 50

This is very challenging when we parse data and tries to store it in SDA3 structure, because in many places its always set to 50, which is not enough.

We have been fighting a lot to avoid MAXLEN error in various scenarios and in various part of the products over a l

12
0 2086
Question David Foard · Dec 3, 2018

I am trying to use %INLIST in  SQL query using a cursor and the query fails to return results. It appears that the variable I use against %INLIST returns an empty string. All the examples I have seen use result sets and build the query as a string. Is it possible to use %INLIST in a cursor-based query? Below is a a snippet of the code I am using:

Property mylist as %String (MAXLEN="") [InitialExpression = "route1, route2, route3"];

set routeList = $LISTBUILD(mylist)

&sql(DECLARE MyReport CURSOR FOR

SELECT

      ProcessStartDate,

      ProcessCompleteDate,

      ProcessName,

     RouteName

FROM

       Pr

3
0 753
Question Scott Roth · Oct 12, 2018

In looking at the Production monitor within Ensemble, I was wondering if there is a way we could customize it for our use. I notice it is basically a dashboard.

For example I would only like to truly display those Services, Processes, and Operations that are truly in dire need of attention. The Monitor out of the box just seems too busy, and I would like to simplify it.

I was trying to find a sample how a Monitor Dashboard would be setup, but I am not seeing anything in ENSDEMO, or SAMPLES. Has anyone created a Custom Dashboard/Monitor for their purposes? Would you be willing to share an example

2
3 925
Announcement Evgeny Shvarov · Dec 3, 2018

Hi Community!

As you know or maybe guess we keep working on making Developer Community a better place for you, developers on InterSystems Data Platforms.

And here is the release on what we did in October-November.

Key visible enhancements:

better monthly digests,

InterSystems Best Practices,

Speed up mailings.

And a lot of small, but nice things - check the details inside.

0
0 212
Question Sean Connelly · Dec 3, 2018

It was mentioned in an earlier version of the IRIS documentation that IRIS and Cache should not be installed on the same physical server (port clashes?).

I can't see this warning in the current version of the documentation.

Could someone clarify if this has been resolved in the latest release of IRIS?

1
0 561
Article Dmitry Maslennikov · Nov 5, 2018 13m read

I bet that not everyone familiar with InterSystems Caché knows about Studio extensions for working with the source code. You can actually use the Studio to create your own type of source code, compile it into interpretable (INT) and object code, and sometimes even add code completion support. That is, theoretically, you can make the Studio support any programming language that will be executed by the DBMS just as well as Caché ObjectScript. In this article, I will give you a simple example of writing programs in Caché Studio using a language that resembles JavaScript. If you are interested, please read along.

6
6 1319
Question Eduard Lebedyuk · Dec 2, 2018

I'm using this code to read a file, line by line.
Most lines are shorter than 32767 symbols, but some are longer. No line is longer than $$$MaxStringLength and long strings are enabled.
Is there a param to Open/Read command I can pass to increase Read limit?
My code:

set filename = pFile
open filename:("R")
for  {
    use filename read x
    quit:$ZEOF=-1
    set ^dbg($i(^dbg)) = $lb($e(x,1,10), $e(x,*-10,*), $l(x))
}
close filename

I've checked reclen parameter but it did not seem to help
 

3
0 345
Question Anthony Harrison · Nov 9, 2018

We are trying to get a custom header that I have added to a request to Cache, and I have seen the following in another post, however it doesn't work for us:

You can do it as in any CSP page/class. With %request, which is object of class %CSP.Request

And headers available in property CgiEnvs, where every http header appear with a prefix HTTP_

So, you may try this code.

set ipCountry=%request.GetCgiEnv("HTTP_CF_IPCOUNTRY")

I have verified in Charles (a Mac equivalent to the Windows traffic sniffer 'Fiddler' program) that my client sent the following headers in the request to Cache:

GET

4
0 1512
Announcement Evgeny Shvarov · Dec 1, 2018
0
0 229
Question William Casey · Nov 30, 2018

Hi, all.

I know this is basic, and I think I have done this before, but I haven't been successful this time.

In a Routing Rule, I would like to take the value of MSH:9.2, see if that value does NOT exist in a lookup table, and ultimately return out of the rule if true.

So, if my message is an "A05", but "A05" is not in a particular lookup table, then it evaluates to 1, and I execute my action of "Return" and the rule ceases processing.

Is there something incorrect with my sample code below?

..DoesNotIntersectList(HL7.{MSH:9.2}, "ValidAdt.lut") 

Thank you in advance for any insight!

Bill

1
0 442
Question Lakin Ducker · Nov 28, 2018

I am new to InterSystems.

I have set up a simple application in HealthShare.

Name: /testwebapp
CSP Files Physical Path: /Users/lakinducker/Documents/Dev/testwebapp/dist/testwebapp
In that directory are the following:
index.html
styles.3bb2a9d4949b7dc120a9.css
polyfills.c6871e56cb80756a5498.js
main.4ba7035983a7e3311083.js
runtime.ec2944dd8b20ec099bf3.js
favicon.ico
3rdpartylicenses.txt
If I go to http://localhost:57772/testwebapp, I get "Not found".
If I go to http://localhost:57772/testwebapp/index.html, I get the index.html file. However, it fails to get any of the javascript or css files that are referen

9
0 459
Question Alexi Demetriou · Nov 20, 2018

Good morning,

Background to task: Shut down Ensemble from a task in Task Manager.

I have a batch file that shuts down Ensemble when run as administrator. I can confirm this works, as it brings up the shutdown/restart prompt for Ensemble, however I now need to plug this into Ensemble's Task Scheduler so it can be run on-demand.

At present I am trying to use: do ^execute: %windir%\system32\cmd.exe Z:\Scripts\shutdown.lnk

This is to run the batch file from the shortcut, which runs it as admin. I get a syntax error, which I am not surprised to see, so could I have some advice on how to code this bette

19
1 2146
Article Gevorg Arutiunian · Nov 29, 2018 3m read

The following class contains 1 class method "test" that creates a Zen Application and Page:


Class objectscript.createZenPage
{
	classmethod test() {
		// create Application...
		set app=##class(%Dictionary.ClassDefinition).%New()
		set app.Super="%ZEN.application"
		set app.Name="ZenTest.MyZenApplication"
		set app.ProcedureBlock=1
		 
		set param=##class(%Dictionary.ParameterDefinition).%New()
		set param.Name="APPLICATIONNAME"
		set param.Default="MyZenApplication"
		set param.parent=app
		do param.%Save()
		 
		set param=##class(%Dictionary.ParameterDefinition).%New()
		set param.Name="HOM
0
1 407
Question Jiri Svoboda · Nov 9, 2018

Hi all,

I have an incoming JSON message with a string field exceeding in length the 'caché long-string limit' of 3641144 characters.

Using {}.%FromJSON(instream) I am able to create %DynamicObject properly. However, I am unable to access the long property, as in every assignment, I get the <MAXSTRING> error.

Is there any way for me to obtain contents of the 'too long' string field as a stream?

Thanks

Jiri

3
0 12593
Question Harkirat Dhillon · Oct 25, 2018

Hello, I need help in health insight. I am trying to generate reports on deep see but i am not able to pull in the patient ids as these are our requirements for the project. Can anyone help me in unlocking this feature. Can anyone help me with link to correct documentation on how to access the edge gateways of multiple facilities to access the clinical data on sql explorer.

3
0 532
Question Andrew Hubbard · Nov 19, 2018

When using the JSON_OBJECT() function in Caché SQL on a %String property that contains JSON syntax, it converts the %String into a JSON object instead of escaping it as a string literal. How can I prevent this? (without ridiculous hacks like "add a space to the beginning of the value" as we don't always know which properties will contain these values and I certainly don't want to have to check for nulls and add/remove a space every single place this value is used in the application)

I don't want these strings automatically marshalled into JSON objects.

For example:

SELECT ID, JSON_OBJECT('ID': ID

12
0 1423