Find

Question
· Sep 2, 2024

Allocation of Disk Space - Splitting of IRIS.dat into 2 different files

Currently we are exploring how we can allocate additional disk space to our current environment as we have seen a significant increase in growth of our Database files. Currently we have 3 namespaces, all with 1 IRIS.dat each that contains both the Global and Routines.

Since we have started down the route of everything within a single IRIS.dat file for each namespace, is it logical as we see growth to be able to split the current IRIS.dat for each namespace into a separate IRIS.dat for global and a IRIS.dat with for routines for each namespace in a Mirror environment?

I assume that we would have to take each one of the nodes down at a single time to do this. Is this even logical to do? 

Or do we add a LUN and move everything over to that new LUN as is still maintaining the single IRIS.dat per namespace?

Thanks

Scott

4 Comments
Discussion (4)2
Log in or sign up to continue
Article
· Sep 2, 2024 4m read

IRIS Native Python Part-2

In the preceding section, we explored the installation process and initiated the writing of the IRIS in native Python. We will now proceed to examine global traversal and engage with IRIS class objects.

 get: this function is used to get values from the traversal node.

def traversal_firstlevel_subscript():
    """
    ^mygbl(235)="test66,62" and ^mygbl(912)="test118,78"
    """
    for  i in irispy.node('^mygbl'):
        print(i, gbl_node.get(i,''))

 

node and items: single level traversal with node and get the values same as $Order(^mygbl(subscript), direction, data)

#single level traversal
def traversal_dollar_order_single_level():
    for  sub,val in irispy.node('^mygbl').items():
         print('subscript:',sub,' value:', val)
# multi level traversal
def traversal_dollar_order_multi_level():
    for  sub,val in irispy.node('^mygbl').items():
         print(f'sub type is: {type(sub)} {sub} and val type is {type(val)}')
         for sub1,val1 in irispy.node('^mygbl',sub).items():
            print('subscript:',sub1,' value:', val1)
        

 

nextsubscript: unlike above code you can use nextsubscript to get the next subscript easily

def traversal_dollar_order_use_nextsubscript():
      direction = 0
      next_sub = ''
      while next_sub != None:
            next_sub = irispy.nextSubscript(direction,'^mygbl', next_sub)
            print(f'next subscript = {next_sub}' )
            next_sub1=''
            if next_sub == None:return
            while next_sub1 != None:
                next_sub1 = irispy.nextSubscript(direction,'^mygbl',next_sub,next_sub1)
                print(f'1st subscript = {next_sub} next subscript {next_sub1}' )

 

Classes and Objects

You can call the classmethods, methods from the class definition by using the specific function. As  I mentioned earlier Typecast Methods are crucial to get the proper response from IRIS

Prior to this, it is important to note that, Unlike IRIS datatypes, which we can treat everything as strings, Python data types such as int, str, bool, and list are classified as objects. Each of these types possesses its own attributes and methods; for instance, the Python string type includes functions such as .upper() and .lower(), which are not applicable to other data types. Consequently, IRIS is equipped with the ability to convert IRIS string values into Python-supported datatype objects through the use of Typecast Methods. This functionality is similarly applicable to class methods, user-defined functions, and procedures. Alternatively, one must utilize Python's type conversion functions to achieve the desired data type.

 

classMethodValue: Call the Classmethod from python without initiate the object same as ( ex: Do ##Class(Test.MYTest).FirstNameGetStored(1) ) and get "string" default value in python. There are different typecast method available for expected return value instead of string. Please refer below.

def get_clsmethod_value():
    print(irispy.classMethodValue('Test.MYTest','FirstNameGetStored',1)) #return string 
    date_horolog = irispy.classMethodInteger('Test.MYTest','GetHorolog') #return +$H value
    print(irispy.classMethodVoid('Test.MYTest','SetTestGlobal','test')) # no return resposne

classMethodObject: Important function to Instantiate a new IRIS object or open the existing object. Set the properties and invoke instance methods etc...

New IRIS object: Initiate the class object for Test.MYTest and set the properties.

def cls_object_new():
    """
    initiate new object and store
    """
    iris_proxy_obj = irispy.classMethodObject('Test.MYTest','%New','ashok','kumar')

    birthdate_horolog = irispy.classMethodInteger('Test.MYTest','GetHorolog','12/12/1990')
    horolog = irispy.classMethodInteger('Test.MYTest','GetHorolog')
    iris_proxy_obj.set('BirthDate',birthdate_horolog) #set birthdate property
    iris_proxy_obj.set('RegisteredDate',horolog) #set the RegisteredDate property
    status = iris_proxy_obj.invoke('%Save') #call instance method
    return status


Open IRIS Object: In the below code. Open Test.MyTest class object and get both Birthdate and RegisteredDate values from the objectid "2" and convert RegisteredDate as python list 

def cls_object_open():
    iris_proxy_obj = irispy.classMethodObject('Test.MYTest','%OpenId',2)
    birth_date = iris_proxy_obj.get('BirthDate')
    full_name iris_proxy_obj.InvokeString("GetFullName")
    data = [birth_date, iris_proxy_obj.get('RegisteredDate')]
    return data

IRIS Class definition which I used for the class and object python code demo

 
Spoiler

 

Typecast methods:

these are few type cast method for retrieve proper return values from IRIS

classMethodValue()   - for call general classmethods

classMethodInteger - Return integer value
classMethodVoid - No return value
classMethodValue - default string
classMethodFloat - float return value

invoke() - is used to call the instance methods. You have to initiate the object for call this invoke functions

invokeString  - default string
invokeFloat - float return value
invokeInteger  -  return integer value

 

Will cover the functions, procedure calls in routines and other functionality in the upcoming article.

Discussion (0)1
Log in or sign up to continue
Question
· Sep 2, 2024

How to convert date in "YYYY-MM-DDTHH:MM:SSZ" format to "yyyymmddhhmmss" format?

I'm trying to convert date - 2023-09-28T20:35:41Z to BST/GMT format. I tried with $ZDT($ZDTH("2023-09-28T20:35:41Z",-2),8,1) but it's giving the output as '19700101 01:33:43' and looks link the date format in $ZDTH specified is wrong. Any inputs or solution would be appreciated.   

4 Comments
Discussion (4)2
Log in or sign up to continue
Announcement
· Sep 2, 2024

InterSystems Developer Tools Contest 2024

Hi Developers,

We'd like to invite you to join our next contest dedicated to creating useful tools to make your fellow developers' lives easier

🏆 InterSystems Developer Tools Contest 🏆

Submit an application that helps to develop faster, contributes more qualitative code, and helps in testing, deployment, support, or monitoring of your solution with InterSystems IRIS.

Duration: September 9 - 29, 2024

Prize pool: $14,000


The topic

💡  InterSystems IRIS developer tools 💡

In this contest, we expect applications that improve developer experience with IRIS, help to develop faster, contribute more qualitative code, help to test, deploy, support, or monitor your solution with InterSystems IRIS.

General Requirements:

  1. An application or library must be fully functional. It should not be an import or a direct interface for an already existing library in another language (except for C++, where you really need to do a lot of work to create an interface for IRIS). It should not be a copy-paste of an existing application or library.
  2. Accepted applications: new to Open Exchange apps or existing ones, but with a significant improvement. Our team will review all applications before approving them for the contest.
  3. The application should work either on IRIS, IRIS for Health or IRIS Cloud SQL. The first two could be downloaded as host (Mac, Windows) versions from Evaluation site, or can be used in the form of containers pulled from InterSystems Container Registry or Community Containers: intersystemsdc/iris-community:latest or intersystemsdc/irishealth-community:latest .  
  4. The application should be Open Source and published on GitHub. 
  5. The README file to the application should be in English, contain the installation steps, and either the video demo or/and a description of how the application works.
  6. No more than 3 submissions from one developer are allowed.

NB. Our experts will have the final say in whether the application is approved for the contest or not based on the criteria of complexity and usefulness. Their decision is final and not subject to appeal.

Prizes

1. Experts Nomination - a specially selected jury will determine the winners:

🥇 1st place - $5,000 

🥈 2nd place - $3,000 

🥉 3rd place - $1,500

🏅 4th place - $750

🏅 5th place - $500

🌟 6-10th places - $100

2. Community winners - an application that will receive the most votes in total:

🥇 1st place - $1000 

🥈 2nd place - $750 

🥉 3rd place - $500

🏅 4th place - $300

🏅 5th place - $200

If several participants score the same amount of votes, they all are considered winners, and the money prize is shared among the winners. 

Who can participate?

Any Developer Community member, except for InterSystems employees (ISC contractors allowed). Create an account!

Developers can team up to create a collaborative application. 2 to 5 developers are allowed in one team.

Do not forget to highlight your team members in the README of your application – DC user profiles.

Important Deadlines:

🛠 Application development and registration phase:

  • September 9, 2024 (00:00 EST): Contest begins.
  • September 22, 2024 (23:59 EST): Deadline for submissions.

 Voting period:

  • September 23, 2024 (00:00 EST): Voting begins.
  • September 29, 2024 (23:59 EST): Voting ends.

Note: Developers can improve their apps throughout the entire registration and voting period.

Helpful resources

✓ Example applications:

✓ Templates we suggest to start from:

✓ For beginners with IRIS and Python:

✓ For beginners with IRIS and ObjectScript:

✓ For beginners with ObjectScript Package Manager (ZPM):

✓ How to submit your app to the contest:

Need Help?

Join the contest channel on InterSystems' Discord server or talk with us in the comments section of this post. 

We can't wait to see your projects! Good luck 👍


By participating in this contest, you agree to the competition terms laid out here. Please read them carefully before proceeding. 

 
9 Comments
Discussion (9)2
Log in or sign up to continue
Announcement
· Sep 2, 2024

The 2nd InterSystems Japan Technical Writing Contest!

Hello developers!

Last year, for the first time, we held the Technical Article Contest on Japan's InterSystems Developer Community, and 📣 we are holding it again this year!📣

The topics are the same as last year, and you can submit any content related to InterSystems IRIS/InterSystems IRIS for Health.

🖋 InterSystems Japan Technical Article Contest – 2024: Articles related to IRIS 🖋

🎁 Participation prize:Everyone who submits a post will receive our👚Developer Community’s original T-shirt👕!!

🏆 Special Prize:Authors of three selected works will receive special prizes.

Updated on 30/8: Prize information added!Please check it out!👇

Discussion (0)0
Log in or sign up to continue