Eduard Lebedyuk · Mar 8, 2021 go to post

Yes, check my other reply, I get the zeroth element from the JSON array with %Get(0).

Also both [] and {} are valid JSON.

Eduard Lebedyuk · Mar 8, 2021 go to post

I would recommend using plain %CSP.REST and calling BP/BO from it. Here's how. You'll need to replace async call with a sync one to get response back, but the rest of the logic would be the same.

Eduard Lebedyuk · Mar 8, 2021 go to post

Cache 2015 is a very old release. You should update to a latest version at least, preferably to InterSystems IRIS.

Eduard Lebedyuk · Mar 8, 2021 go to post

upgrade to 2016.2

What is the reason of this step?

This is a first version with Frozen Plans. If this feature is not needed then upgrade to 2018.1 directly (provided OS compatibility - you're absolutely right about it).

Cache 2017.2 (our App's supported version) turned to be incompatible with Ubuntu 18, which was chosen as on OS for IRIS.

What's the official way to upgrade in that case? I usually just power down an instance, remove it from autostart, upgrade OS to the version supported by a new release, upgrade instance to a new version.

This way Cache/IRIS never runs on unsupported OS. Do you have a case with WRC on this topic?

Eduard Lebedyuk · Mar 8, 2021 go to post

Yeah I've merged intersystemscommunity org into intersystemsdc recently.

Great to see it used!

Eduard Lebedyuk · Mar 7, 2021 go to post

Another minor thing:

RESTForms2 link links to localhost and /restforms2-ui/index.html#/

Eduard Lebedyuk · Mar 6, 2021 go to post

I would also recommend rewriting this property:

Property "cdsm_Physician_Issue_ID" As %String;

like this:

Property physicianIssueID As %String(%JSONFIELDNAME = "cdsm_Physician_Issue_ID");

This way JSON would still be imported, but you would be able to refer to property name without double quotes.

Eduard Lebedyuk · Mar 6, 2021 go to post

Get 0th array element from your array:

Class test.Provider Extends (%RegisteredObject, %JSON.Adaptor)
{

Property physicianFirstName As %String;

Property physicianLastName As %String;

Property physicianMiddleNameInitial As %String;

Property physicianSpecialty As %String;

Property physicianNPI As %String;

Property physicianMPIN As %String;

Property physicianTaxID As %String;

Property physicianADRId As %String;

Property physicianAddressLine1 As %String;

Property physicianCity As %String;

Property physicianState As %String;

Property physicianZip As %String;

Property physicianZipPlus4 As %String;

Property physicianPhone As %String;

Property facilityNPI As %String;

Property facilityAddressLine1 As %String;

Property facilityCity As %String;

Property facilityState As %String;

Property facilityZip As %String;

Property error As %String(MAXLEN = 200);

Property "cdsm_Physician_Issue_ID" As %String;

ClassMethod GetJSON() [ CodeMode = expression ]
{
[
    {
        "physicianFirstName": "STEVENSON",
        "physicianLastName": "HOWARD",
        "physicianMiddleNameInitial": "W",
        "physicianSpecialty": "null",
        "physicianNPI": "null",
        "physicianMPIN": "null",
        "physicianTaxID": "null",
        "physicianADRId": "null",
        "physicianAddressLine1": "null",
        "physicianCity": "null",
        "physicianState": "null",
        "physicianZip": "null",
        "physicianZipPlus4": "null",
        "physicianPhone": "null",
        "facilityNPI": "null",
        "facilityAddressLine1": "\"\"",
        "facilityCity": "\"\"",
        "facilityState": "\"\"",
        "facilityZip": "\"\"",
        "error": "Invalid NPI. Requested NPI should contain 10 numeric digits",
        "cdsm_Physician_Issue_ID": "null"
    }
]
}

/// do ##class(test.Provider).Test()
ClassMethod Test()
{
    set json = ..GetJSON()
    
    set obj = ..%New()
    set sc = obj.%JSONImport(json.%Get(0))
    
    zw sc,obj
}

}
Eduard Lebedyuk · Mar 6, 2021 go to post

%ZEN.Auxiliary.jsonProvider class and %ConvertJSONToObject method are definitely available in 2018.1. They are available on way older versions - 2014.1 at least and probably older.

That said, in 2018.1 it would be better to use %ZEN.Auxiliary.altJSONProvider - it has the same methods but uses dynamic objects instead of %ZEN.proxyObject which is faster.

Eduard Lebedyuk · Mar 5, 2021 go to post

First of all I would recommend reading these two documents available on WRC (Software Distribution - Docs):

  • InterSystems IRIS Adoption Guide
  • InterSystems IRIS In Place Conversion Guide

First one explains the differences between Cache and InterSystems IRIS and the second one is about automated in-place conversion from Cache to InterSystems IRIS.

I would recommend the following steps:

  • upgrade to 2016.2
    • This is the place to uplift your application - on the one hand it's still Cache so upgrade is simple, on the other the code, even with the new 2016.2 features would probably run fine on InterSystems IRIS
    • if you're using SQL - start using frozen plans
    • if you're using JSON - new JSON features become available here (dynamic objects)
  • upgrade to 2018.1 (latest micro)
  • perform in-place conversion to the latest InterSystems IRIS
Eduard Lebedyuk · Mar 3, 2021 go to post

The comments talk about modifying a setting too.

In general you need to open a corresponding Ens.Config.Item, adjust settings properties and save it. And activate changes in production of course.

Here's an example.

Eduard Lebedyuk · Mar 3, 2021 go to post

Sounds interesting.

Can you please point me to the point in code where it uses machine learning algorithms?

Eduard Lebedyuk · Feb 19, 2021 go to post

IndexHash+7 tries to access ^rINDEXCLASS global from CACHESYS database.

As the user does not have R (or possibly W, but probably R) privilege on %DB_CACHESYS  resource the <PROTECT> event is raised.

To solve this you need either:

Eduard Lebedyuk · Feb 18, 2021 go to post

For VSCode users. If you generated an api and don't see dispatcher class, that's because VSCode does not show generated classes by default.

You need to press "Show Generated Items" button to see them.

Eduard Lebedyuk · Feb 18, 2021 go to post

Why do you want to kill all BH jobs directly?

You can just disable a BH and it would effectively do the same:

set sc = ##class(Ens.Director).EnableConfigItem(BH, 0)
Eduard Lebedyuk · Feb 9, 2021 go to post

Table with notifications should be available on all application servers via ECP or Sharding.

This way each server can be aware of all the messages and inform the clients in turn.