How can I round to the next whole number?
.1 = 1
1.2 = 2
1.7 = 2
InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.
How can I round to the next whole number?
.1 = 1
1.2 = 2
1.7 = 2
Hey Guys,
I got stuck with this for 2 days, please help me
Actually my logic is when I enter the input on the text field in browser, the entered input to be print on the next page but I am getting "Undefined". How to i do it.
Below is my code:
Class Patient.Testing Extends %ZEN.Component.page
{
/// Class name of application this page belongs to.
Parameter APPLICATION;
/// Displayed name of this page.
Parameter PAGENAME = "userLogin";
/// Domain used for localization.
Parameter DOMAIN;
/// This Style block contains page-specific CSS style definitions.
Hello gentlemen,
here is my question: I would like to delete files one by one (not all at a time because I need to check somethinkg to delete it or not) in a defined folder but how can I handle it? I have used the extension :
EnsLib.File.PassthroughService
But it only works when a file is moved in my folder. But I want to launch my program everyday (with a planifier) in the purpose to delete file that more that 2 months old.
Hello,
I am struggling to print out the actual property values of the Security.System class.
https://cedocs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.c…
I was hoping to be able to print the Authentication Enabled properties of a system from the command line using the Get or GetProperties class method. Currently, however, I am only able to get a return 1 or Invalid Oref error.
I would expect one of these to work, but I think I am missing something. Any tips?
%SYS>w ##class(Security.System).Get("
1
%SYS>w ##class(Security.System).
0 {?
Hi all, I have released the latest version of VSCode extension for ObjectScript already a month ago, and finally a time for the info about this new release.
So, what's new in the release:
For details how it works now, look further.
A SOLID Design in Cache Object
In this session, we will discussing SOLID Principle of Programming and will implement in a example.
I have used Cache Object Programming Language for examples.
We will go step by step to understand the requirement, then what common mistakes we use to do while designing, understanding each principles and then complete design with its implementation via Cache Objects.
If you have any questions or suggestions, please write to me - sethisourabh.hit@gmail.com
CodeSet - https://github.com/sethisourabh/SolidPrinciplesTraining
Hi,
I have a method that has multiple parameters and is normally used from other classes in ObjectScript. Most of the parameters have default values. Withing the server code that's perfect. In some areas I can call myMethod(,,"sometext") or myMethod(tVariab) and thats fine... I use it as it's required in each place.
But now I want to expose it as a REST service so I need to buld a kind of wrapper.
Hi Everyone!
Please watch the new video on InterSystems Developers YouTube, recorded by @Sourabh Sethi in the "Coding Talks" format:
Informative and Fast WEB API VIA ObjectScript and Ensemble/HealthShare
Hello ,
Need some help to write a Request message to the File using EnsLib.File.PassthroughOperation class.
Request object is sent to the Ensemble operation has below simple structure.
Class ABC.Req Extends Ens.Request
{
Property SiteCode As %String;
Property HospitalCode As %String;
Property PatientFirstName As %String;
Property PatientLastName As %String;
Property EncounterId As %String;
}
But in the operation i am getting error
ERROR <Ens>ErrException: <PROPERTY DOES NOT EXIST>zOnMessage+1 ^EnsLib.File.PassthroughOperation.1 *Stream,ABC.Req -- logged as '-'
number - @'
Quit:'$IsObject(pRequest.
Pre-requisite - Basic knowledge of ENSEMBLE and ObjectScript
My both previous sessions were related to OBJECTSCRIPT.
This time, we are going to add a flavour Ensemble/Healthshare,
to be informative and fast.
In this session we are going to discuss about -
"Informative and Fast WEB API VIA ObjectScript and Ensemble/HealthShare"
Web API can be REST or SOAP. We will taking example of SOAP in this session.
However, whatever I demonstrate today, will also be applicable for REST.
In many projects I was faced with storing hierarchical data (tree) in classes.
By tree, I mean such data, where each node has a parent node — an object of the same class.
Many examples of such data can be given. For example, a catalog in the online store. Suppose that this online store sells books, in this case, the category tree might look like this:
The number in front of the name is the category ID.
For storage, you can create classes:
The MyApp.Category class is used to store the category tree and contains the property “Parent” - reference to the same class.
In this article we are going to compare $Increment and $Sequence functions.
First of all, a note for readers who have never heard of $Increment. $Increment is a Caché ObjectScript function which performs an atomic operation to increment its argument by 1 and return the resulting value. You can only pass a global or local variable node as a parameter to $Increment, not an arbitrary expression. $Increment is heavily used when assigning sequential IDs. In such cases parameter of $Increment is usually a global node. $Increment guarantees that each process using it gets a unique ID.
Hello,
Is it possible to write global output values to STDOUT, in a similar way to how csession can take routine intput, like below:
(In Cache Terminal)
%SYS>d ##class(%SYSTEM.License).
License Server summary view of active key.
Distributed license use:
Current License Units Used = 1
Maximum License Units Used = 1
License Units Authorized = 200
Local license use:
Current Connections = 1 Maximum Connections = 1
Current Users = 1 Maximum Users = 2
(From Linux OS Terminal)
[jhipp@test-sbox ~]# csession TEST "##class(%SYSTEM.
Hello Community,
How do i disable an operation explicitly based on a value in a variable?
I set the ReplyCodeAction to E=D.
In the Operation Code i am throwing an explicit ERROR
THROW ##class(%Exception.General).%New("Shutting Down Operation",999,,"My own special exception")
But my operation still remains up.
Any suggestions please will be appreciated.
Thanks,
Jimmy Christian.
I'm not saying that this is in anyway "best practices," but I'm in a peculiar situation where I need to restrict users from starting a "retired" Ensemble Production in a namespace that's been renamed. It's still an "Ensemble-activated" namespace; we need to keep it available for Ensemble Message Viewer access ... fortunately, only for a little while.
It's a bit of a hack ...
Open the Production class in Studio and add the following classmethod:
ClassMethod OnStart() As %Status
{
Return $system.Status.Hello community! I have to work with queries using all kinds of methods like embedded sql and class queries. But my favorite is dynamic sql, simply because of how easy it is to manipulate them at runtime. The downside to writing a lot of these is the maintenance of the code and interacting with the output in a meaningful way. In an effort to have as much dynamism as possible so that we're not rewriting code constantly, and so that we have as little code possible (while still making sense and getting the job done), I made a function that takes in any dynamic query and outputs a dynamic object.
Hi Everyone!
Please watch the new video on InterSystems Developers YouTube, recorded by @Sourabh Sethi in a new format called "Coding Talks":
A SOLID Design in InterSystems ObjectScript
Hi Everyone!
You're very welcome to watch the new video on InterSystems Developers YouTube, recorded by @Evgeny Shvarov in the new format called "Coding Talks":
GitHub Flow with InterSystems IRIS: Edit with VSCode, Test with Docker, Commit, Push, Pull Request
Hi guys!
What is the IRIS analog for Ensemble.INC?
Hi all,
I have a class that I want to serialize to JSon. So I'm using the object %ZEN.Auxiliary.jsonProvider)
set myClass = ##class(myapp.myclass).%New() set myClass.property1 ="value 1" set myClass.property2 = "value 2" set myClass.property3 = "value 3" do ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(.tStream,myClass ,,,1,"ed") write tStream.Read()
By definition of myclass, all properties are serialized, that's fine. But I want not serialize the property3. I think is using a XML attribute in the property, or something about. But I didn't find anything about.
Hi Everyone!
You're very welcome to watch the new video on InterSystems Developers YouTube, recorded by @Sourabh Sethi in a new format called "Coding Talks":
Locking in InterSystems ObjectScript
Hi, I am trying to transform a message to meet a third party specification, and would like to know if you can advice me on how to separate a single OBX segment into several segments based on a '.'
I would like to separate the segment where the . [marked in red] is into another OBX segment. So the next segment would be:
OBX|2|TX|R^REPORT^L|1|Patient had lumbar spine MRI ~ Patient also had barium swallow ~ Patient has good alignment 99%perfect ~ Patient has aspiration visible
Is there a way to do that?
Would appreciate your advice on this
Regards,
Eric
All,
I'm using Cache 2014.1 in an openVMS environment.
If I have multiple RMS files to clean up, for example.
!DIR MEMBER_EXTRACT.*;*
MEMBER_EXTRACT.CSV;2 MEMBER_EXTRACT.CSV;1
MEMBER_EXTRACT.PROC;1 MEMBER_EXTRACT.TXT;3
MEMBER_EXTRACT.TXT;2 MEMBER_EXTRACT.TXT;1
S FILE="MEMBER_EXTRACT.*;*"
Do ##class(%Library.File).ComplexDelete(FILE)
!DIR MEMBER_EXTRACT.*;*
MEMBER_EXTRACT.CSV;1 MEMBER_EXTRACT.TXT;2
MEMBER_EXTRACT.TXT;1
Total of 3 files.
What would be the best way to delete all the files using the ComplexDelete class
I am looking to get the exec statement when we call the SP with ..Adapter.ExecuteProcedure.
Set tSQLQuery="exec pSPName ? ? ?"
Set Status = ..Adapter.ExecuteProcedure(.tResultList,.tOutParms,tSQLQuery,"iii*, 1,2,3)
Get the exec string: exec pSPName '1', '2', '3'
Hey Intersystems-Developer,
I have already used that and know its possible, but can't find it anymore :(
I need dynamic access on proxy objects. For example:
set key = "lastName"
set name = obj.name
set lastName = obj.key <- Not possible
set lastName = obj.GetAt(key) <- Not possible
How can I get access to that object with my dynamic variable "key" ?
Best regards.
Hi guys!
As you know there are two (at least) ways to get the stored value of the property of InterSystems IRIS class if you know the ID of an instance (or a record).
1. Get it by as a property of an instance with "Object access":
ClassMethod GetPropertyForID(stId As %Integer) As %String
{
set obj=..%OpenId(stId)
return obj.StringData
}2. Get it as a value of a column of the record with "SQL access":
It’s often useful to make changes inside the current transaction, that would not be rolled-back if transaction is rolled-back. For example to do some logging.
This can be achieved by using global that is mapped to temporary database -- IRISTEMP. All globals that start with ^IRIS.Temp* are mapped to IRISTEMP by default. Problem with such approach is that IRISTEMP is cleaned on InterSystems IRIS restart, so this log is lost.
What else you can do is -- suspend transaction temporarily, do the logging, and then resume the same transaction.
Hi Dev Community,
My team is currently working on a project where we need to post pdf documents to a 3rd party REST API.
The API specifies a field in the JSON request message to contain the 'physical content' of the file as an array of bytes, example of the JSON request as follows - data truncated for readability purposes:
{
"CaptureSource":2,
"RecipientID":"ID34",
"Document": {
"Guid":"5D847A4E9CC1485382DC4A5F5DC80D6C",
"EventDate":"2019-01-14T13:23:46",
"FileExtension":"pdf",
"FileContent":"JVBERi0xLjQNCiXi48/TDQoxIDAgb2JqDQogIDw8DQogICA.
How can I remove elements from $lb property? Specifically last element?
$list does not work with $lb properties.
$listupdate can't remove elements
The only solution I found is a temp variable and $list, but isn't there something better?