Written by

Senior Startups and Community Programs Manager at InterSystems Corporation
Question Evgeny Shvarov · Mar 8, 2019

How to enable IRIS Text Analytics programmatically?

Hi Community!

How can I enable IRIS Text Analytics (formerly known as iKnow) in a given Namespace programmatically?

Comments

Eduard Lebedyuk · Mar 8, 2019

IRIS Text Analytics/iKnow and Analytics/DeepSee are enabled on per-application basis. Interoperability/Ensemble/HealthShare are enabled on a per-namespace basis.

First you need to get default application from the namespace:

set namespace = "USER"
set app = $System.CSP.GetDefaultApp(namespace) _ "/"

And then call one of these methods:

do EnableIKnow^%SYS.cspServer(app)
do EnableDeepSee^%SYS.cspServer(app)

If you want to enable Interoperability/Ensemble call:

set sc = ##class(%EnsembleMgr).EnableNamespace(namespace,1)
0
Yuri Marx  Nov 18, 2020 to Eduard Lebedyuk

Worked like a charm!

0
Dmitry Maslennikov · Mar 8, 2019

If you would like to do it with %Installer Manifiest, it is not going to be easy, unfortunately. CSPApplication there quite limited.

I can't just do it this way.

<CSPApplication Url="${CSPApp}" Directory="${CSPAppDir}" iKnowEnabled="yes"/>

You should first create simple csp application

<CSPApplication Url="${CSPApp}" Directory="${CSPAppDir}"/>

Add something like this method

ClassMethod EnableiKnow(pCSPName As %String = "") As %Status
{
  new $namespace
  znspace "%SYS"
  set props("iKnowEnabled")=1
  d ##class(Security.Applications).Modify(pCSPName,.props)
  quit $$$OK
}

But unfortunately, I also can't just call it from an installer, Invoke tag should be placed in Namespace tag. which is actually current namespace, but you should compute it first. This may help to declare a couple more default variables. Just place two first lines before your Installer generator

  do %code.WriteLine($c(9)_"set pVars(""CURRENTCLASS"")="""_%classname_"""")
  do %code.WriteLine($c(9)_"set pVars(""CURRENTNS"")=$namespace")
  quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "setup")

And finally, you can add this to your installer. Place it after CSPApplication creation, but outside of Namespace tag.

<Namespace Name="${CURRENTNS}">
    <Invoke Class="${CURRENTCLASS}" Method="EnableiKnow" CheckStatus="true">
      <Arg Value="${CSPAPP}"/>
    </Invoke>
  </Namespace>
0
José Pereira · Jul 29, 2020

Hi guys!

A related topic is how to disable Analytics. Recently, I had to disable access to DeepSee from certain namespace. I did that by settings this global:

Set ^SYS("Security", "CSP", "AllowPrefix", "web-app-name", "%DeepSee.") = 0

I used Caché 2017.2, but I think this also would work in newer Cache versions and in IRIS as well. More information here.

HTH, José

0