go to post Eduard Lebedyuk · Jan 19, 2017 You can specify Logfile setting for logging and these settings for debug:JavaDebug: Allow a Java debugger (such as Eclipse or JSwat) to attach. If True, enables Java debugging via TCP. The default is False.JavaDebugPort: Specify the port on which to listen. The default is 8000.JavaDebugSuspend: If Yes, suspend the JVM on start to wait for the debugger to attach. The default is No.Documentation.
go to post Eduard Lebedyuk · Jan 9, 2017 You can search for the references in studio:Open StudioMenu -> Edit -> Search in filesFind: Dimension/Measure (for example [DateOfSale].[Actual].[DaySold])File type: *.dfiIt should find relevant entities.
go to post Eduard Lebedyuk · Jan 5, 2017 Cache Fileserver is an old project of mine which allows file upload/download. Files have IDs, but to download each client get's an unique link active only for his IP for a limited time. You can remove IDs altogether.
go to post Eduard Lebedyuk · Jan 2, 2017 You can define your own device of terminal type (also see System - Configuration - Devices you can see other defined Cache terminals) :
go to post Eduard Lebedyuk · Dec 23, 2016 Here's an idea on how to do it without triggers altogether. 1. Set IsLeader property only in case member is a leader. So its 1 or NULL. 2. Add unique index on (Team, IsLeader). Unique index can have any number of NULL records. 3. If you try to add more than one leader, you'll get an error: ERROR #5808: Key not unique: Utils.TeamMember:IsLeaderIndex:^Utils.TeamMemberI("IsLeaderIndex"," 1"," 1") [%SaveData+14^Utils.TeamMember.1:USER] Sample code: Class Utils.TeamMember Extends %Persistent { Property Team As %String; Property Member As %String; Property IsLeader(VALUELIST = ",1"); Index IsLeaderIndex On (Team, IsLeader) [ Unique ]; /// do ##class(Utils.TeamMember).Test() ClassMethod Test(AddTwoLeaders = {$$$YES}) { do ..%KillExtent() write $System.Status.GetErrorText(..Add(1, "Alice")) write $System.Status.GetErrorText(..Add(1, "Bob")) write $System.Status.GetErrorText(..Add(1, "Clover")) write $System.Status.GetErrorText(..Add(1, "Dave", 1)) if AddTwoLeaders { write $System.Status.GetErrorText(..Add(1, "Helen", 1)) } } ClassMethod Add(Team, Member, IsLeader = "") { set obj = ..%New() set obj.Team = Team set obj.Member = Member set obj.IsLeader = IsLeader quit obj.%Save() } }
go to post Eduard Lebedyuk · Dec 20, 2016 You should have FHIR package, which includes dtls to transform hl7 messages into json or xml. You can either use that or write your own solution based on that.
go to post Eduard Lebedyuk · Dec 9, 2016 How do you propose it should be handled instead?You provided two ways, by which you can control string/number output, and they seem to cover most of the cases.
go to post Eduard Lebedyuk · Dec 8, 2016 Hello.I have provided more comprehensive documentation for Ensemble Workflow REST API project.Do you think there's something else I need to add to it?
go to post Eduard Lebedyuk · Dec 6, 2016 is the import smart enough to figure out if a row already existsAs you can't specify an ID column during import, then no, SQL import wizard would only insert new rows.is there some other utility that can check for keys first?You can:export/import underlying global(s)use 3rd party SQL database explorers to generate UPDATE DDL statements from your data (DataGrip can do it for example), and then import this DDL into new namespace
go to post Eduard Lebedyuk · Nov 16, 2016 I think you need a persistent email message class, which you can customize as you need.
go to post Eduard Lebedyuk · Nov 13, 2016 1. Get list of all items in production (via Ens.Director:getProductionItems)2. Iterate over items local array and for each item:Get list of settings for an item (via Ens.Director:GetItemSettings)Check if ReplyCodeActions is a setting for current item, if it is get it's value.Write into any structure the pairs Item:ReplyCodeActionsValue Structure can be anything you want:Custom classDynamic object%List%ListOfDataTypesThat mainly depends on what do you want to do with this information later.
go to post Eduard Lebedyuk · Nov 4, 2016 Ceiling, floor, $NORMALIZE. Examples: >Write $SYSTEM.SQL.CEILING(.1) 1 >Write $SYSTEM.SQL.CEILING(1.2) 2 >Write $SYSTEM.SQL.CEILING(1.7) 2 >Write $SYSTEM.SQL.FLOOR(.1) 0 >Write $SYSTEM.SQL.FLOOR(1.2) 1 >Write $SYSTEM.SQL.FLOOR(1.7) 1 >Write $NORMALIZE(.1, 0) 0 >Write $NORMALIZE(1.2, 0) 1 >Write $NORMALIZE(1.7, 0) 2
go to post Eduard Lebedyuk · Oct 31, 2016 This line causes an error: Write tMessage.Name,! Your class does not have Name property, so it causes an error. The following method works : /// Do ##class(Testing.Messages.Session).test() ClassMethod test() { Set messagedata = "<?xml version=""1.0"" encoding=""UTF-8""?><session><sessionId>124364</sessionId><cabinet>demo</cabinet><eventType>IN</eventType><eventTime>20161006160154</eventTime><login>test</login><loginFirstName>test</loginFirstName><loginLastName>test</loginLastName></session>" Set reader = ##class(%XML.Reader).%New() Set status = reader.OpenString(messagedata) Do reader.Rewind() If $$$ISERR(status) {do $System.Status.DisplayError(status)} // Associate a class name with the XML element name Do reader.CorrelateRoot("Testing.Messages.Session") // Read objects from xml data While (reader.Next(.tMessage,.status)) { Do:$$$ISERR(status) $System.Status.DisplayError(status) Write tMessage.sessionId,! } } Terminal: USER >do ##class(Testing.Messages.Session).test() 124364
go to post Eduard Lebedyuk · Oct 18, 2016 Disclaimer. I am not familiar with EDI.Some solutions would be:Get official EDI 271 xsd schema files and import them into CachéAlternatively you can read EDI 271 specification/check examples and write your own classesThen you need a dtl to transform incoming message into your new classes. If there's a lot of them maybe it would be better to write one generic transformer or write a transformer generator based on class (which would generate transformation method based on class properties).After that you can transform your class object into json via several ways:Old json via %ZEN.proxyObject/%ZEN.auxillary.jsonProviderNew json via dynamic objects
go to post Eduard Lebedyuk · Oct 17, 2016 The CALLIN^%ZSTART entry point gets executed when an external program begins or completes a callin. You can add logging there to see if something initiates callin.
go to post Eduard Lebedyuk · Oct 11, 2016 You can write a dtl transformation or a generic business process which accepts object, dynamically gets a list of properties to convert (All %String properties? Some kind of a dictionary? Pattern?) and strips diacritic signs from them.
go to post Eduard Lebedyuk · Sep 27, 2016 We have a google calendar (and map) integration for Caché as a part of System of training courses grant project. Check out Stc.Google package there, especially Stc.Google.Calendar class.
go to post Eduard Lebedyuk · Sep 27, 2016 Yes. You can use cursors for that. In the following example rowlist contains list of affected ids. You can get it all at the end or get individual ids right before or after the update, or even decide on the update based on id/val values: Class User.NewClass1 Extends %Persistent { Property val; /// do ##class(User.NewClass1).Test() ClassMethod Test() { do ..%KillExtent() &sql(INSERT INTO NewClass1 SET val = 0) &sql(INSERT INTO NewClass1 SET val = 3) set rowlist = "" &sql(DECLARE NewClass1 CURSOR FOR SELECT %ID,val INTO :id, :val FROM NewClass1) &sql(OPEN NewClass1) for { &sql(FETCH NewClass1) quit:SQLCODE'=0 set val2 = val*2 write "Processing id: ", id,! set rowlist = rowlist _ $lb(id) &sql(UPDATE NewClass1 SET val = :val2 WHERE CURRENT OF NewClass1) } &sql(CLOSE NewClass1) zw rowlist } } It would output in a terminal: >do ##class(User.NewClass1).Test() Processing id: 1 Processing id: 2 rowlist=$lb("1","2") Documentation: WHERE CURRENT OFSQL Cursors
go to post Eduard Lebedyuk · Sep 27, 2016 Here's an example: Class User.NewClass1 Extends %Persistent { Property streams As list Of %Stream.GlobalCharacter; ClassMethod Test() { do ..%KillExtent() set obj = ..%New() set stream1 = ##class(%Stream.GlobalCharacter).%New() do stream1.WriteLine("Hi") set stream2 = ##class(%Stream.GlobalCharacter).%New() do stream2.WriteLine(123) do obj.streams.Insert(stream1) do obj.streams.Insert(stream2) write $System.Status.GetErrorText(obj.%Save()) kill set obj = ..%OpenId(1) for i=1:1:obj.streams.Count() { write "Stream #", i, ": ", obj.streams.GetAt(i).Read($$$MaxCacheInt) } } }
go to post Eduard Lebedyuk · Sep 20, 2016 In the underlying SQL write SELECT SUBSTRING(Comments, 1, 100) As Comments, ... FROM TABLE to get first 100 characters from the stream. More info.