go to post Robert Cemper · Jul 16, 2020 This option https://community.intersystems.com/post/terminal-multi-line-optionor the extended one with editor support https://community.intersystems.com/post/terminal-multi-line-command-editorcould be useful.
go to post Robert Cemper · Jul 12, 2020 Studio is an integrated part of Caché, Ensemble, IRIS, ... and part of any installation kit for Windows https://docs.intersystems.com/iris20201/csp/docbook/DocBook.UI.Page.cls?KEY=GSTD
go to post Robert Cemper · Jul 12, 2020 In studio you open the class and click the class attribute in the inspector
go to post Robert Cemper · Jul 12, 2020 to edit a table by DDL the corresponding class hat to be DDL allowed. DdlAllowed - Caché & Ensemble 2018.1.3 — 2018.1.4
go to post Robert Cemper · Jul 9, 2020 FIXED ! I have implemented an extension to %ZJSON.Generator to fix missing JSONTYPE Standard Caché data types don't have a parameter JSONTYPE (!!) so everthing is set to (quoted) "string".Especially numbers and boolean data must not be in quotes. e.g ....."NUMfield":124, "TrueFalse":true, .... instead of ....."NUMfield":"124", "TrueFalse":"true", .... this extension bypasses the missing parameter for these standard data types as indicated in %ZJSON.Adaptor/// number = %BigInt, %Currency, %Decimal, %Double, %Float, %Integer, %Numeric, %SmallInt, %TinyInt/// boolean = %Boolean For customized data classes it is easy to add Parameter JSONTYPE=". . . ."But changing sometihng in SYSLIB is a clear NO-NO to me. ( though it might have been easier) The extended version of %ZJSON.Generator is here: https://github.com/rcemper/Backport-JSON.-to-Cach-/blob/master/MissingJSONTYPE.xml
go to post Robert Cemper · Jul 9, 2020 Great stuff @Vitaliy.Serdtsev https://docs.intersystems.com/iris20192/csp/docbook/Doc.View.cls?KEY=RSQL_json everlasting learning!
go to post Robert Cemper · Jul 9, 2020 Got you! Something like $isJSON() ? like $isobject() or $listvalid()
go to post Robert Cemper · Jul 9, 2020 I didn't meet that. Basically it's %String or a %Stream based on size.I'd suggest having a private data type.This allows you also to have all tricky LogicalToODBC, .... under control. (and no MAXLEN for %String)And mapping it to %ALL or naming it %ZstringJSON or similar makes it public and update-restistant
go to post Robert Cemper · Jul 8, 2020 Some more findings what happens:The output methods are code generated. And the generator just uses JSONTYPE from the data type class.That means that even as the property parameter is available in Studio, ... you can't change it. example: Property bool as %Boolean (JSONTYPE="string") is just ignored and you see ,"bool":false This means: JSONTYPE is frozen in the data type classBringing Parameter JSONTYPE into the class (e.g, by %ZJSON.Adaptor) has no influence to the Generator To achieve the expected result you require a customized data class as suggested by @Timothy Leavitt Out of 25 only these 7 6 classes are affected the rest is string which is default anyhow. boolean %Library.Boolean.cls(JSONTYPE): Parameter JSONTYPE number %Library.Currency.cls(JSONTYPE): Parameter JSONTYPE number %Library.Decimal.cls(JSONTYPE): Parameter JSONTYPE number %Library.Float.cls(JSONTYPE): Parameter JSONTYPE number %Library.Integer.cls(JSONTYPE): Parameter JSONTYPE number %Library.Numeric.cls(JSONTYPE): Parameter JSONTYPE number %Library.PosixTime.cls(JSONTYPE): Parameter JSONTYPE not in Caché
go to post Robert Cemper · Jul 8, 2020 IRIS has added a new parameter in 25 Data Classes: Parameter JSONTYPE = ...I'll see the impact as soon as I find free time %Library.Binary.cls(JSONTYPE): Parameter JSONTYPE %Library.Boolean.cls(JSONTYPE): Parameter JSONTYPE %Library.Currency.cls(JSONTYPE): Parameter JSONTYPE %Library.Date.cls(JSONTYPE): Parameter JSONTYPE %Library.Decimal.cls(JSONTYPE): Parameter JSONTYPE %Library.Double.cls(JSONTYPE): Parameter JSONTYPE %Library.EnumString.cls(JSONTYPE): Parameter JSONTYPE %Library.FilemanDate.cls(JSONTYPE): Parameter JSONTYPE %Library.FilemanTime.cls(JSONTYPE): Parameter JSONTYPE %Library.FilemanTimeStamp.cls(JSONTYPE): Parameter JSONTYPE %Library.FilemanTimeStampUTC.cls(JSONTYPE): Parameter JSONTYPE %Library.FilemanYear.cls(JSONTYPE): Parameter JSONTYPE %Library.Float.cls(JSONTYPE): Parameter JSONTYPE %Library.InformixTimeStamp.cls(JSONTYPE): Parameter JSONTYPE %Library.Integer.cls(JSONTYPE): Parameter JSONTYPE %Library.List.cls(JSONTYPE): Parameter JSONTYPE %Library.ListOfBinary.cls(JSONTYPE): Parameter JSONTYPE %Library.Name.cls(JSONTYPE): Parameter JSONTYPE %Library.Numeric.cls(JSONTYPE): Parameter JSONTYPE %Library.PosixTime.cls(JSONTYPE): Parameter JSONTYPE %Library.Status.cls(JSONTYPE): Parameter JSONTYPE %Library.String.cls(JSONTYPE): Parameter JSONTYPE %Library.StringTimeStamp.cls(JSONTYPE): Parameter JSONTYPE %Library.Time.cls(JSONTYPE): Parameter JSONTYPE %Library.TimeStamp.cls(JSONTYPE): Parameter JSONTYPE
go to post Robert Cemper · Jul 8, 2020 With a small extension, you may get closer to your result.What you expect is a JSON Array, but %JSONExport... works on data OBJECTS, not on data TYPES { same as XMLExport() } So I have created a small wrapper object: Class Test.javier Extends (%RegisteredObject, %JSON.Adaptor) { Property wrap As Test.elementList(%JSONFIELDNAME = " "); } extending Test.Main: Class Test.Main Extends %RegisteredObject { ClassMethod Run() { Set elem = ##class(Test.element).%New() Set elemList = ##class(Test.elementList).%New() Do elemList.Insert(elem)#; Do elemList.%JSONExportToString(.json)#; Do ##class(%ZJSON.Formatter).%New().Format(json)#;; extended set jav=##class(Test.javier).%New() set jav.wrap=elemList Do jav.%JSONExportToString(.json) set json=$e($p(json,":",2,*),1,*-1) ; a little bit dirty Do ##class(%ZJSON.Formatter).%New().Format(json)} } And here we go: SAMPLES>do ##class(Test.Main).Run()[ { "field1":"testField1", "field2":"testField2" }]SAMPLES>
go to post Robert Cemper · Jul 8, 2020 Just to verify if this is a %JSON specific problem I added also %XML.Adaptor to the classes.And there is a similar problem: %ListOfObjects seems to be the bad guy. Do elemList.%JSONExport() {"ElementType":"Test.element","Size":1}Do elemList.XMLExport() <elementList><ElementType>Test.element</ElementType><Size>1</Size></elementList>zw elemListelemList=2@Test.elementList ; <OREF>+----------------- general information ---------------| oref value: 2| class name: Test.elementList| reference count: 2+----------------- attribute values ------------------| Data(1) = ""| ElementType = "Test.element"| Oref(1) = "1@Test.element"| Size = 1 <Set>+-----------------------------------------------------
go to post Robert Cemper · Jul 8, 2020 Thanks for cross checking with IRIS.As this is a 1:1 port I imported of course also all limits & bugs still in IRIS at that time
go to post Robert Cemper · Jul 7, 2020 You use set patientMRN = msgIn.GetValueAt("PID:3.1") and get back a value the reverse is do msgOut.SetValueAt(patientMRN,"PID:3.1") deails: https://docs.intersystems.com/irisforhealthlatest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=ENSLIB&CLASSNAME=EnsLib.HL7.Message
go to post Robert Cemper · Jul 7, 2020 in your query, I see "Timestamp" and Timestamp Check the status of SUPPORT_DELIMITED_IDENTIFIERS parameter Next check the date type of your column named Timestamp.easiest SELECT top 5 "Timestamp","Skillset" FROM "dbo"."iSkillsetStat" also try SELECT Timestamp,Skillset FROM dbo.iSkillsetStatwithout any quoted columns
go to post Robert Cemper · Jul 7, 2020 You won the extra points ! It's good to know someone is reading your comments. THANKS!
go to post Robert Cemper · Jul 6, 2020 Just found an example: Class Demo.Loan.BankUS Extends Ens.BusinessProcess [ ClassType = persistent, ProcedureBlock ]{ /// 2 modes: Queue, InProcParameter INVOCATION = "Queue"; Property CreditRating As %Integer; Property PrimeRate As %Numeric; Method OnRequest( request As Demo.Loan.Msg.Application, Output response As Demo.Loan.Msg.Approval) As %Status{ Set $ZT="Trap",tSC=$$$OK Do { $$$TRACE("received application for "_request.Name) #; If $zcrc(request.Name,2)#5=0 { Set response = ##class(Demo.Loan.Msg.Approval).%New() Set response.BankName = "BankUS" Set response.IsApproved = 0 $$$TRACE("application is denied because of bank holiday") Quit } #; Set tRequest = ##class(Demo.Loan.Msg.PrimeRateRequest).%New() Set tSC = ..SendRequestAsync("Demo.Loan.WebOperations",tRequest,1,"PrimeRate") #; Set tRequest = ##class(Demo.Loan.Msg.CreditRatingRequest).%New() Set tRequest.TaxID = request.TaxID Set tSC = ..SendRequestAsync("Demo.Loan.WebOperations",tRequest,1,"CreditRating") #; Set tSC = ..SetTimer("PT15S") #; Quit } While (0)Exit Quit tSCTrap Set $ZT="",tSC=$$$EnsSystemError Goto Exit} /// Handle a 'Response'Method OnResponse( request As Ens.Request, ByRef response As Ens.Response, callrequest As Ens.Request, callresponse As Ens.Response, pCompletionKey As %String) As %Status{ Set $ZT="Trap",tSC=$$$OK Do { If pCompletionKey="PrimeRate" { Set ..PrimeRate = callresponse.PrimeRate } Elseif pCompletionKey="CreditRating" { Set ..CreditRating = callresponse.CreditRating } Quit } While (0)Exit Quit tSCTrap Set $ZT="",tSC=$$$EnsSystemError Goto Exit} Method OnComplete( request As Ens.Request, ByRef response As Ens.Response) As %Status{ Set $ZT="Trap",tSC=$$$OK Do { Set response = ##class(Demo.Loan.Msg.Approval).%New() Set response.BankName = "BankUS" Set tIsUsCitizen=($zcvt($tr(request.Nationality,"."),"u")="USA")||($zcvt($tr(request.Nationality,"."),"u")="US") If ('tIsUsCitizen)||(..CreditRating<50) { Set response.IsApproved = 0 $$$TRACE("application is denied") } Else { Set response.IsApproved = 1 Set response.InterestRate = ..PrimeRate+2+(5*(1-(..CreditRating/100))) $$$TRACE("application is approved for "_response.InterestRate_"%") } Quit } While (0)Exit Quit tSCTrap Set $ZT="",tSC=$$$EnsSystemError Goto Exit} Storage Default{ <Data name="BankUSDefaultData"> <Subscript>"BankUS"</Subscript> <Value name="1"> <Value>CreditRating</Value> </Value> <Value name="2"> <Value>PrimeRate</Value> </Value> </Data> <DefaultData>BankUSDefaultData</DefaultData> <Type>%Library.CacheStorage</Type>} }
go to post Robert Cemper · Jul 6, 2020 #1)- create a simple Business Process using the wizard- compile it and see the resulting class and at least 4 related .int routines.- then decide if you really want to do this all manuallythe challenge is to properly use and service the methods you see in Ens.BusinessProcess To make it easier you may install (or activate) the ENSDEMO namespace as an example (before IRIS. have no idea where it is gone) #2) you write. ---transformation (written in DTL), but the code is manually written. --- It might sufficient to put your code just into a CODE Block of a BP generated with the wizard.
go to post Robert Cemper · Jul 6, 2020 My personal opinion:WIN* is a nice Desktop OS good for mom and aunt Betty. With an incredible paranoic approach. In post VMS times all *X (LinuX,AIX, OS X, Solaris(rip+), ***UNIX, ....) are real server OS systems by nature.