Evgeny Shvarov · Jun 5, 2018 go to post

Like this:

write $case(condition,
             1:{ 
                 set a="hello " _"world"
                 return a
               }    
             2:"name",
             :"!")

I figured out that the thing I want is close to "closures" ;)

Evgeny Shvarov · Jun 5, 2018 go to post

Hi, Ed!

Thanks! 

I'll elaborate the problem a bit. Here is the $case everybody loves:

write $case(condition, 1:expression1, 2:expression2, expression3)

My problem is that with business logic change the expression1 and expression2 showed the need for multiline logic. And I was looking for something like:

write $case(condition,

1: {

New cool logic for expression 1 with line 1
and line 2


},

2:{

Perfect, better logic for expression2
maybe with 
few lines
more

},

expression3)
Evgeny Shvarov · May 31, 2018 go to post

Hi, Jaqueline!

@Sam Duncan is right below, and please don't consider my example above!

See the updated version of the method for Cube class:

classmethod UnitLevel(unitID, level) as %String {

s unit=##class(Police.Unit).%OpenId(unitID)

if '$IsObject(unit) return ""

return $Case(level,

  1:unit.UNI_PADRE.UNI_PADRE.UNI_PADRE.%Id(),

  2:unit.UNI_PADRE.UNI_PADRE.%Id(),

  3:unit.UNI_PADRE.%Id(),

  4:unit.%id(),:"") }

Introduce the dimension with 4 levels, with expressions:

1 st level:

%cube.UnitLevel(%source.%ID,1)

2nd level:

%cube.UnitLevel(%source.%ID,2)

3 and 4 levels same idea.

AND!!! The key thing!

introduce a calculated or direct field in your class which will indicate a level of the row - say H_LEVEL with values 1,2,3,4 according to the level of administration.

and introduce a build restriction to the cube with:

H_LEVEL=4

So, there would be only 4th level records in the cube, but you'll gather all other needed calculations and values using your hierarchy.

Evgeny Shvarov · May 31, 2018 go to post

Hi, Jaqueline!

Really interesting task. Do you have only 4 levels?

If so, you can introduce a method on a cube which would return a level of the unit.

Say:

classmethod UnitLevel(unitID as %Integer) as %String {

 s unit=##class(Police.Unit).%OpenId(unitID)

 if unit.UNI_PADRE="" return "Zone"

s padre=##class(Police.Unit).%OpenId(unit.UNI_PADRE)

if padre.UNI_PADRE="" return "Prefecrure"

/// continue here!

}

It's for 2 levels,  leave other two for you ;)

And use

%cube.UnitLevel(%source.UNI_CODIGO)

for the Dimension level expression.

Evgeny Shvarov · May 25, 2018 go to post

Thank you, Kyle! We'll cover you with comments until you back! And thanks for the great session!

Evgeny Shvarov · May 22, 2018 go to post

Hi, Pavan!

Of course, InterSystems Data Platform supports numerous of types of integration, it has integrational engine inside. As for FHIR, please check InterSystems FHIR Experience sandbox - it allows you to play with technology on your personal cloud sandbox.

Evgeny Shvarov · May 12, 2018 go to post

Hi, Peter! Want to add that highlighter is not ideal though (ObjectScript is a tough parsing exercise). If you see the bug in highlighting and want to improve it, you are very welcome to pull request here 

Evgeny Shvarov · May 10, 2018 go to post

Hi, Justin!

Also, if you are using try/catch blocks, you may conside use Log() method of %Exception class, which literally does the call of LOG^%ETN:


{ 
 try {
  	$$$TOE(sc,StatusMethod())
 }
 catch e {
 	set sc=e.AsStatus()
 	do e.Log()
 }

See the related discussion.

Evgeny Shvarov · May 8, 2018 go to post

Updated the agenda for the meetup - the new session by @Sergei Shutov has been introduced: 

Automatically configure a customized development environment. 

The session covers the approach and demo of creating a private development environment from source control, and how changes can be automatically pushed downstream to build and test environments. Show the use of open source Git hooks, %Installer, and Atelier, with Jenkins and automated Unit Tests.

Evgeny Shvarov · May 1, 2018 go to post

Why? Can't class methods be called from another namespace? Or it is easier with routine?

Evgeny Shvarov · Apr 29, 2018 go to post

Hi, Georgiy! You also can try isc-dev which provides the way to export/import classes, routines, and DeepSee components into the target folder.

Evgeny Shvarov · Apr 25, 2018 go to post

True! Nice hack ;) Thank you, Vitaly!

But obviously, you cannot use this calls in a code, because dc.test.1 can be dc.test.2 etc...

Evgeny Shvarov · Apr 24, 2018 go to post

Thanks, Dan! 

That's helpful.

And from that class descriptor/dispatch table, can we say in general that call:

do foo^utils(p1) 

would be always faster than

do ##class(My.Utils).foo(p1) 

assuming that the code in foo() is same?

Evgeny Shvarov · Apr 24, 2018 go to post

Oh, thanks, Dan! That's interesting.

So, practically speaking: 

Class My.Utils {

ClassMethod Foo {

///

}

}

Works faster than:

Class My.Utils Extends %RegisteredObject {

ClassMethod Foo {

///

}

}

Right?

Evgeny Shvarov · Apr 14, 2018 go to post
  1. Build git diff.
  2. Import new/modified classes.
  3. Delete deleted classes.

Interesting class, thanks! What do you use for deleting from the list?

Do you have any "automatic" check that classes in Namespace are equal to the classes in repo?