Hi ,
Does anyone know how to dynamically set a variable, for example
set Counter = 1
set x_Counter ="test" in Cache Object script. I tried with EXECUTE XECUTE ("set x"_Counter "="_DIAGS_""), but it does not work.
Thanks
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.
Hi ,
Does anyone know how to dynamically set a variable, for example
set Counter = 1
set x_Counter ="test" in Cache Object script. I tried with EXECUTE XECUTE ("set x"_Counter "="_DIAGS_""), but it does not work.
Thanks
A function iterates global ^data(a,b,c) with $order using 3 nested for-loops. At certain point, for example with a=10, b=20, c=30, the function exits and later has to resume the iteration from the same point. What could be easiest way for it? My solution looks too ugly.
I was wondering if there was a way to easily identify the node depth of a global.
Take the following global example. Is there way to determine the depth is 3?
s ^global("first","second","third")="some^info^here"Morning guys I have a SQL operation that I use to read data and results to a record map. But seems to have trouble saving the objects to a record map as I get this message
ERROR ErrException:
zInsertObject+2^%Library.RelationshipObject.1 -- logged as '-' number - @''
please help here is my code let me know if I missing anything thank you in advance
Method OnRequest(pRequest As DQToolsSet.PrimaryMessageREQ, Output pResponse As HSCIC.DBS.RequestRBAT) As %Status
{
#dim status as %Status=$$$OK
#dim resultSet as %SQL.StatementResult
set pobject=##class(%FileCharacterStream).%New()
set preq=##class(HSCIC.DBS.RequestRBAT).%New()
set status=..Adapter.ExecuteQuery(.resultSet,..GetTheSubmissionData(pRequest.pMonth, pRequest.pApp, pRequest.pRef, pRequest.pInPat))
nbsp;if ($$$ISOK(status))
{
While (resultSet.%Next(.status) && $$$ISOK(status))
{
set ppResponse=##class(HSCIC.DBS.RequestRMAP.Record).%New()
set ppResponse.RequestCode=resultSet.Get("recType")
set ppResponse.PatientID=resultSet.Get("ClientID")
set ppResponse.DOB=resultSet.Get("DOB")
set ppResponse.Property4=resultSet.Get("u1")
set ppResponse.Property5=resultSet.Get("u2")
set ppResponse.NHSNumber=resultSet.Get("NNN")
set ppResponse.Surname=resultSet.Get("Surname")
set ppResponse.AltSurname=resultSet.Get("u3")
set ppResponse.GivenName=resultSet.Get("GivenName1")
set ppResponse.AltGivenName=resultSet.Get("u4")
set ppResponse.SpineGender=resultSet.Get("Gender")
set ppResponse.Address1=resultSet.Get("a1")
set ppResponse.Address2=resultSet.Get("a2")
set ppResponse.Address3=resultSet.Get("a3")
set ppResponse.Address4=resultSet.Get("a4")
set ppResponse.Address5=resultSet.Get("a5")
set ppResponse.PostCode=resultSet.Get("Postcode")
set ppResponse.AltAddress1=resultSet.Get("p1")
set ppResponse.AltAddress2=resultSet.Get("p2")
set ppResponse.AltAddress3=resultSet.Get("p3")
set ppResponse.AltAddress4=resultSet.Get("p4")
set ppResponse.AltAddress5=resultSet.Get("p5")
set ppResponse.AltPostCode=resultSet.Get("p6")
set ppResponse.GPCode=resultSet.Get("GPCode")
set ppResponse.GPPracticeCode=resultSet.Get("PracticeCode")
set ppResponse.NewField3=resultSet.Get("u5")
set ppResponse.NewFiel23=resultSet.Get("u6")
set status=ppResponse.%Save()
set pobject=ppResponse
set pResponse=##class(HSCIC.DBS.RequestRBAT).%New()
if ($$$ISOK(status))
{
set status=pResponse.Records.InsertObject(pobject)
set status=pResponse.Records.%Save()
}
}
}
}
I've collated a list of public Caché Projects that I've been able to find through GitHub topics and various other searches, let me know if I have missed any and I will add them to the list.
The full list is here...
https://github.com/SeanConnelly/Public-Cache-Projects/blob/master/README.md
I've been writing ObjectScript for a long time and was a little surprised by this behavior so I'd like to understand what is going on.
I was doing a peer review on some source which had roughly the equivalent of the following line:
Set myRecord = ##class(MyObj.Record).%OpenId(id) Set emailList = previousEmails_","_myRecord.RecordGroup.EmailList
Hello community,
I need to perform some processing-heavy operations on a set of input objects and I would like to utilize more than a single processor core to do the heavy lifting.
Is there any way to call methods in parallel and wait for the results in a blocking way?
Basically, I am looking for an equivalent of the pythonese
with Pool(n) as p:
results = p.map(function, data)
Thanks
Jiri
EDIT: Correct English :)
This series of articles aims to address the following topics:
WRF to below example my idea is to check whether red is present in the list mylist. You can very well use LINQ on enumerable in C#
mylistProperty2
set =##class
It can be done with iterating over mylist
jmylist
Hi Guys,
Can you please advise on the below queries.
Query 1:
Example 1:
S a="345",b="arun",c="kumar",d="hi",e="yello",f="orange"
Example 2:
S a="345" S b="arun" S c="kumar" S d="hi" S e="yello" S f="orange"
Can you please advise me, which one is performance wise is better.
Query 2:
Example 1:
Example 2:
Please advise me, which one is giving better performance in this.
Any lead would be appreciated.
Thanks,
Arun Kumar Durairaj.
Set httprequest=##class(%Net.HttpRequest).%New()
Set httprequest.Server="www.intersystems.com"
Do httprequest.Get("/")
Do httprequest.HttpResponse.OutputToDevice()
Do httprequest.Get("/cache/")
Do httprequest.HttpResponse.OutputToDevice()The above is the code which i found in this link http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?…
How do the above code works and can i be able to run this?
Thanks in advance.
I want to disable / turn off the visible cursor and then re-enable from with a Cache MUMPS (COS) routine.
Can anyone advise please ?
I am using the free Intersystems Cache installation (CachePCkit V2017.1) on Windows 10 for my own use & personal development.
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
The base class Bmap.Person defines persons within an organization distributed
by various countries. All records are indexed by (Country, PersonalId).
this structure doesn't allow use of bitmaps.
So a wrapper class Bmap.PersonQ around the data eliminates the top level of
the index (Country) and isolates the PersonalId (%Integer, MINVAL=1).
We are ready to use a Bitmap index.
A few performance figures on 300010 generated records.
You see that Relative Cost are sometimes quite misleading.
base
select count(*) from Bmap.Person
300010 global references 1600446 lines executed
Intersytems documentation says not to hold entire SDA as object in In-memory.
// Serialize Object to XML
Set object = ##class(User.NewClass1).%New()
s object.Property1="one"
s object.Property2="two"
s object.Property3="three"
s object.Property4="four"
Set w=##class(%XML.Writer).%New()
set w.Charset="UTF-8"
Set w.Indent=1
set status=w.OutputToString()
set status=w.StartDocument()
Set status=w.
I'm trying to learn how To use SQL in CACHE, so I hope I don't bore you with "Dumb" questions....
I'm getting "ERROR #6022: Gateway failed" message following this line of code.
s sc=gc.Prepare(hstmt,pQuery)
This line of code comes from an example I found in the documentation. pQuery is the "Select" statement setting up the variables and tables I'm trying to pull information from.
What does that error indicate?
Thank you.
Hi Guys,
I would to know, I have a drop down list items in my applications. While, am clicking on the drop down bx, there are few numbers of listed items, while am doing mouse over action, I should display the entire text of selected item from that drop down list box, even am not selecting that item. I would like to know about the what is exact text it contains in Zen framework.
If any lead would be appreciated.
Thank you in advance.
I am trying to determine the write-access to a windows-directory, using the method %File.Writeable(
Note:
Any help is appreciated. Thanks in advance... :-)
I am using terminal but I have some problem with it.
I use $C(1) (ascii code 1) to separate data but I can't see it in the terminal and This is really hard to see in the table.
So I want to get you guys good brain and skill :)
how can I see it in the terminal ?
Terminal(intersystems) :
I can't see anything
another program :
It replaced ascii code 1 (=SOH) to ┌ (Special Character)
I want to see like another program in Intersystems's terminal.
Thank you smart developers!
Hi Guys,
I would like to know, how to setup a global structure in Cache classes storage type.
I want to set a global like below in Cache classes using Storage methods.
^A("ID1")="Name\Abb\Map"
^A("ID2")="Name\Abb\Map"
^A("ID3")="Name\Abb\Map"
...If any lead it would be appreciated.
Thanks,
Arun Kumar Durairaj.
Hi,
I have an Atelier question.
I have a routine developed in Studio to upload a tab-delimited text file to process using Objectscript into Cache.
In Windows, to upload the file “test.txt”, I used the Objectscript commands,
Set uploadfilename = “c/testdata/RNAseq/GDC download 11-19-17/GDC download 11-19-17 counts/GDC download 11-19-17 unzipped/test.txt”
set file = ##class(%Stream.FileCharacter).%New()
set file.Filename = uploadfilename ; pass in the file name of the file you want to open.How should this be done on a mac?
Is it possible to have a, b, c, d, e, and f as a counter instead of the counter being numeric? See below...Epic would like us to set OBX.4 using a alpha numeric combination.
OBX|4|ST|69548-6^Genetic Variant Assessment|1.ab
Thanks
Scott Roth
The Ohio State University Wexner Medical Center
I am trying to come up with a way to decode the Base64 we receive in an HL7 message into a PDF file and save it in a directory on our AIX machine. I thought I had the following working at one time but I am having issues. Has anyone done this before?
ClassMethod DecodeBase64HL7ToFile(base64 As %Stream, Ancillary As %String) As %Boolean
{
set Oref = ##class(%FileBinaryStream).%New()
set Oref.Filename = Ancillary
Do base64.Rewind()
While 'base64.AtEnd {
set ln=base64.ReadLine()
set lnDecoded=$system.Encryption.Base64Decode(ln)
do Oref.Write(lnDecoded)
}
Do Oref.%Save()
quit 1
}
Thanks
Scott
Hi,
My doubt is about the SQL Query in Caché:
I don't want to take all results from the table and orgainze them manually, for example: I have a table with 50 records, but I only want to select 10 records, being from tenth until the twentieth and this without knowing their IDs.
So, how can I do this, without losing performance, there is any way?
NOTE: In other SQL languages I can do, for example, SELECT * FROM extbl Limit 10 OFFSET 10
Thanks,
Andrei L. Nenevê
What happens if you don't declare a Persistent value when you call ExecuteQuery()? What does Ensemble set as the key value for your query? I have a query that I've executed on SQL Server, and I get 15 rows, but because this is my second time querying the data Ensemble thinks it exists.
The Method in question is SelectProviderClarityAudit. If I call this query multiple times it is not returning the same number of results each time in Ensemble.
Class osuwmc.CPD.ClarityDBPoll Extends Ens.BusinessOperation [ ClassType = "", ProcedureBlock ]
{
Parameter ADAPTER = "EnsLib.SQL.
This is probably a very naive question but :
Is it possible to create a Windows executable file from a Cache MUMPS (COS) routine, such that the routine can be run directly from Windows ?
If so, could some kind soul direct me to a source of information that describes the process.
I am using the free Intersystems Cache installation (CachePCkit V2017.1) on Windows 10 for my own use & personal development.
Thanks
Hi All,
I am new to webservice and UPS. I have tried the sample URL's that UPS have given for testing in PHP codes and it works just perfect for me.
But when i try to hit the same URL's in Ensemble. it gives some errors from UPS.
If anyone of you guys here has any knowledge about UPS integration or the webservice please help me. it will be much appreciated and helpful.
The ensemble code that i am trying with is,
set AuthToken=##class
Thanks,
Hi Everyone,
I am trying to reference a field, however, in our production environment, it can be found in the first second or third iteration. My code was only qualifying on the first iteration. I have been attempting to include all iterations, but I have come up short...below is a snippet of what I am attempting to use. My original code simply had GetValueAt("PID:13.4") but this only referenced the first iteration. Thanks for any thoughts!
Set PID13 = pInput
Hey guys!
Thanks for participating in our small but productive COS marathon on behalf Adventofcode 2017!
The leaderboard is here:

And we are ready to announce the winner but need your public repositories with COS solutions inside. Please share it below in comments.
We have results!
1st place: Bert Sarens! Repository.
2nd place: Peter ! Repository.
3rd place: Dmitry Maslennikov. .
Congratulations Bert!
You get 10,000 Global Masters points and the title of the AdventOfCode champion in Caché ObjectScript at least until December 2018!
Peter and Dmitry!
What is difference between using a command $classmethod rather than just invoking them straight away?
For example if i need to call a class and its method i can just use like
do ##class(circle).radius()
rather than using
do $classmethod("circle",radius)(I suppose both of them doing the same function i am not aware of it)
Please help me understand what is different and is there any specific usage.
Correct me if i have made mistake.