Hello ISM Community,
Is it possible to copy all the classes in a package to a new package in Studio?
If not does anyone have some ObjectScript code that does this?
Regards
Mike
Code snippet is a programming term for a small region of re-usable source code, machine code, or text.
Hello ISM Community,
Is it possible to copy all the classes in a package to a new package in Studio?
If not does anyone have some ObjectScript code that does this?
Regards
Mike
Two fairly common requests we receive from HL7 customers are (1) how to remove all trailing delimiters for fields and segments in HL7 messages and (2) how to "find and replace" for an entire HL7 message (as opposed to one segment/field at a time). The code sample below shows a custom function that solves for item 1 and by extension item 2 above. In other words the same approach can be used for finding/replacing any sequence of chars in an entire HL7 message, with some tweaks to the custom function.
Here’s an example of how to actually call the function from DTL.
I have been tasked with creating a class that will handle error logging in a consistent manor for an application I am working on. The need is to have all variables in the calling method logged along with some other information.
The example given was zwrite which is exactly what I need, however, I somehow need to capture the output of ZW and put it into a database table. Any easy way to capture this data? I was able to dump ZW to a file, but that is not ideal.
Any help is appreciated!
Hi everyone!
I want to share four functions with you. I hope that you can use it at some time.
DNI: the initials of the type of national identity document, is composed of different series of numbers and letters. That proves the identity and personal data of the holder, as well as the Spanish nationality. Example: 94494452X
NIE: The NIE or foreigner identity number is a code for foreigners in Spain.
In this page you can generate examples of DNI or NIE https://generadordni.es/
The first function calculates the letter of a DNI number.
Hello, Community!
Here's an interesting task I found on the Internet.
Write a method that would draw a box of a specified size.
The goal is to write the shortest method.
Here's a method signature (it can't be modified):
ClassMethod main(s As %Integer = 10)
And call sample:
>do ##class(ITPlanet.Task4).main(5) ##### ## ## # # # ## ## ##### >do ##class(ITPlanet.Task4).main(10) ########## ## ## # # # # # # # # # ## # # ## # # # # # # # # # ## ## ########## >do ##class(ITPlanet.Task4).main(20) #################### ## ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ## # # ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ## ## ####################
Hello!
Is it possible in cache to divide numbers with spaces. For example number 12500 divide to 12 500?
Thank you!
Hi all,
I've created a method to calculate the age of a person, or the age of a process, contract or other stuff as you want.
/// Calculate the age from date of birth and other date (by default shoud be today).
/// <b>dateOfBird</b> Date of birth in cache format. ie. $ZDH("1972-01-01",3)
/// <b>day</b> Date to calculate to. ie: $H
ClassMethod AgeAt(dateOfBirth, day) As %Integer{
quit:dateOfBirth=""
quit:day=""
set yeardob=$SYSTEM.SQL.DATEPART("year",dateOfBirth)
set yearday=$SYSTEM.SQL.Hi!
It is often necessary to run some external command such as a python program or a shell script from inside Caché/Ensemble. There are three ways of doing this:
$ZF(-1) is normally more interesting because it allows you to recover the return code of the program you are calling. If that is important to you, that is the way to go.
Does anyone have a function they built to change a name from all lower case, or all upper case to mix case?
Thanks
Scott Roth
Zen report can create PDF document (https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GRPT_xslfo_pdf_config ). Store your images in the table. Pass session id to the Zen report. Zen report will select images using SQL. The <img> element will insert images to the report:
<img width="100%" src="!@ImageName" contentHeight="scale-to-fit" contentWidth="#(..ImageWidth)#" style="position:absolute" content-type="image/jpg"/>
Do the following (See the attachment image_to_pdf_using_zen_reports
With the release of Cache 2016.1, JSON support was re-architected and made part of the core object model with the creation of %Object and %Array classes, which allow you to create dynamic JSON enabled objects and arrays.
On a recent demonstration I was working on, I had the need to create a REST web service that returned a JSON representation of a persistent object. After searching for methods that would allow me to accomplish this, ultimately I found none, until now.
With the release of 2016.
Hi folks!
Is there a one line command to map class package A to Namespace ASPACE?

This is (the end) of a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
This is the 25th and last challenge of the 2016 series of Advent of Code.
In this challenge, you have to send a signal out, using the assembunny code interpreter that we had to make in earlier challenges.
There is one extra instruction added to the assembunny language, which outputs a value (out x).
Using the instructions as input (see http://adventofcode.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
Today, you need to find your way through a maze (again). There are 8 points of interest in the maze, and you have to visit them all, starting with point 0.
You may visit some points more than once, in random order. The challenge is to find the shortest path through the maze while visiting all points.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
Remember the assembunny language we had to code on day 12 (https://community.intersystems.com/post/advent-code-2016-day12-leonardo…)?
There is a new instruction we have to implement which toggles an instruction x lines away (further or back).
inc becomes dec, and all other one-argument instructions become inc.This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
The goal of today's challenge is to copy data from one disk to another, problem is that the disks are not directly connected. Luckily they are in a huge grid, and you have to find a way to copy the data through adjacents disks, while honoring the disk usage (you cannot copy to a disk where data is already stored).
The input is a df-like disk usage listing.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
The challenge of day 21 is about scrambling passwords.
There are a few functions you need to implement that will do operations on a string :
- swap position X with position Y : means that the letters at indexes X and Y (counting from 0) should be swapped. - swap letter X with letter Y : means that the letters X and Y should be swapped (regardless of where they appear in the string).
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
We are almost there : after this challenge, only 5 days left till the end of this advent of code (I cannot wait to get my life back !) .
The challenge of day 20 is about a list of integer ranges. Some ranges overlap, but there are also values that are outside any range.
You have to find out what is the lowest integer that is outside any range.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
Today's challenge is a variation on the White Elephant gift exchange (https://en.wikipedia.org/wiki/White_elephant_gift_exchange), in this case, by a bunch of Elves where only one can have all gifts.
Each Elf brings a present. They all sit in a circle, numbered starting with position 1. Then, starting with the first Elf, they take turns stealing all the presents from the Elf to their left.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
You walk into a room, step on a tile and hear a loud click...
Traps !
The challenge is about avoiding traps.
You can recognise if a tile is a trap by following scheme :
The first row is a given : a safe tile is shown as . and a trap is shown as ^
For the next rows, the state of a tile is calculated related to the tiles in the previous row (same position, tile left and tile
#########
#S| | | #
#-#-#-#-#
# | | | #
#-#-#-#-#
# | | | #
#-#-#-#-#
# | | |
####### V
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
The challenge today is again a-maze-ing (as a wellknown president would say).
The maze has a bunch of doors ( | and - on the drawing), but they can be locked depending on a hash that you need to calculate every step.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
The challenge of day 16 is about generating random data using a modified version of a dragon curve (you can find more info on fractal curves like Dragon here : https://en.wikipedia.org/wiki/Dragon_curve).
First you need to generate data in a loop as follows :
Create an initial state with your puzzle input Call the data you have at this point "a". Make a copy of "a"; call this copy "b".
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction and an index of all articles: go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
The challenge for today consists of capsules that bounce through a maze of spinning discs.
The capsule can fall through a hole of each disc if they hit the disc at position 0, each disc has a fixed amount of positions that rotate every second.
The distance between the release and the first disc is one second, as is the distance between each consecutive disc as well.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
The challenge today is about some basic cryptography : you will have to generate data for a one-time pad (OTP) (see https://en.wikipedia.org/wiki/One-time_pad for more info).
You need to generate keys by taking the MD5 of a pre-arranged salt (your puzzle input), and an increasing integer index starting with 0.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
Today, you have to find a path through a maze. To know if a coordinate is a wall or an open space, you will have to do a calculation like this :
x*x + 3*x + 2*x*y + y + y*y Add the office designer's favorite number (your puzzle input). Find the binary representation of that sum; count the number of bits that are 1. - If the number of bits that are 1 is even, it's an open space.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
Today, you need to make a compiler for the language assembunny.
Luckily, this language has only 4 instructions :
cpy x y copies x (either an integer or the value of a register) into register y. inc x increases the value of register x by one. dec x decreases the value of register x by one.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
The challenge today is about microchips and generators. A microchip belongs to one particular generator, and the two can be on the same floor, or in the same elevator. But if a microchip is with another generator on the same floor or elevator, it will get toasted, except if his own generator is also on the same floor/elevator.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
In today's challenge, you have to execute instructions that control how bots are handling microchips.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : go to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
Today's challenge is about decompressing input that is compressed in an experimental format.
In the format, markers indicate how much time a number of characters need to be repeated.
For example :
A(1x5)BC repeats only the B a total of 5 times, becoming ABBBBBC for a decompressed length of 7. (3x3)XYZ becomes XYZXYZXYZ for a decompressed length of 9.
This is a series of programming challenges for beginners and experienced Caché programmers.
For an introduction : goto to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…
The input in today's challenge consists of an encrypted name, a dash, a sectorID, a dash and a checksum between brackets.
A name is real if the checksum is equal to the five most common letters in the encypted name.