Ephraim Malane · May 5

Add/Call objectscript xml class methods

Hi All,

I have been given the following  xml  class file with objectscript code that has methods that I need for file conversions. These method implementations will do necessary conversions but I don't know how to add it to Iris studio and run it as a task or maybe if it must be  put  on any location and call each method from the terminal and even if so how do I then call it.

Please advise how to go about this.


<?xml version="1.0" encoding="UTF-8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2020.1.1 (Build 408U)" ts="2022-02-01 16:19:05">
<Class name="User.Ready.ConvertCSV">

<Method name="DoAll">

<Method name="ConvertN">

<Method name="ConvertI">
    s filename = "C:\ready\In\I\I.csv"
    s newFilename = "C:\ready\Out\I.csv"

<Method name="ConvertS">
    s filename = "C:\ready\In\S\S.csv"
    s newFilename = "C:\ready\Out\S.csv"


Product version: IRIS 2020.2
$ZV: HealthShare 2020.2 [HealthShare Modules: Active Analytics:20.0.8620 + Core:20.0.8620 + Patient Index:20.0.8620] - IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2020.1 (Build 217_1_20418U) Tue Nov 17 2020 15:48:44 EST
0 112
Discussion (6)3
Log in or sign up to continue

if you import this class into IRIS you will then be able to run the methods.  Look up the docs for $system.OBJ.Load() .. you will load and compile the class and the. you can call the methods like this:

Do ##class(User.Ready.ConvertCSV).ConvertN()

(I assume you cut out the actual logic of the methods when you pastes it above as what you pasted is incomplete)

Thanks Ben,

Yes I did cut the actual logic,so I must Import this class under %SYS namespace right?

Import it in the namespace where you want to use it. You can also use Studio to import: Tools > Import Local.

avoid loading anything into %SYS unless it is a class / routine that starts with a "z" ... everything else will be overwritten when you upgrade InterSystems IRIS.  If you ever want to class to be available to all namespaces, you can call it %z<some name> and load it into %SYS and then you can call it from all namespaces and it should survive an upgrade.

Let us know if you got it working!

Than you guys,I got it working however I am not able to load the file codes on the you know how the structure should look like when uploading terminology codes file under Registry namespace?

Below is the error I am getting the below error

I am afraid I have no experience in this area.  I suggest that you ask this as a new question posting tagged as HealthShare so that you're more likely to get the attention of those who may know the answer