go to post Eduard Lebedyuk · Nov 5, 2019 If you want it stored, make it triggered computed like this: Property LabCode As %Library.String(MAXLEN = 64) [ SqlColumnNumber = 5, SqlComputeCode = { set {*}= $EXTRACT({LabName},0,3)_" "_{LabID}}, SqlComputed, SqlComputeOnChange = LabName ]; Docs. Note that it wouldn't recalc LabCode values for existing rows. If you need that, trigger recalculation with trivial update.
go to post Eduard Lebedyuk · Nov 5, 2019 Use {%%ID}. Here's an example: Class util.Calc Extends %Persistent { Property calc As %String [ Calculated, SqlComputeCode = {set {*} = {%%ID}}, SqlComputed ]; /// do ##class(util.Calc).Test() ClassMethod Test() { set obj = ..%New() set sc = obj.%Save() do ..AllFunc().%Display() } Query All() As %SQLQuery { SELECT * FROM util.Calc } } Calling: do ##class(util.Calc).Test() Returns: ID calc 1 1 Docs.
go to post Eduard Lebedyuk · Nov 4, 2019 That would work storagetime but not at runtime. I think runtime hook disallowing duplicate inserts would be better. To OP. Age seems like a strange property to store in your use case. It's better to store DoB I think.
go to post Eduard Lebedyuk · Nov 1, 2019 There are many ways to do what you need. Copy CACHE.DAT / IRIS.DAT Export globals and code Use ASYNC mirror or backup Here's the questions you need to answer to choose the best path: Is downtime OK or not? Do you need a whole database or some part? What's the size of your DB? Are there mirrors/backups available? Are your code/data in separate DBs? Do you need to run the pipeline once or do you need to stay somewhat up to date?
go to post Eduard Lebedyuk · Oct 30, 2019 Some info about upcoming AI/ML webinar. Only a week left to register!
go to post Eduard Lebedyuk · Oct 28, 2019 What value are you expecting? Base64 is often used to encode hashes: write ##class(%SYSTEM.Encryption).Base64Encode(##class(%SYSTEM.Encryption).MD5Hash("f...@baz.com"))
go to post Eduard Lebedyuk · Oct 25, 2019 You need to create a class, for example. Test.EnsUtils, in it add this class method. After that execute the query above (name of the sql procedure would be Test.EnsUtils_ItemStatuses)
go to post Eduard Lebedyuk · Oct 24, 2019 You'll need a SQL procedure to return status. I haven't found it already SQL enabled. ClassMethod ItemStatuses(pName, pIsRunning, pEnabled, pID) As %String [ CodeMode = expression, SqlProc ] { ##class(EnsPortal.Utils).ItemStatuses(pName, pIsRunning, pEnabled, pID) } After that just query Ens_Config.Item: SELECT ID, ClassName, Name, Enabled, ItemStatuses(Name, 1, Enabled, Id) Status FROM Ens_Config.Item Parameter pIsRunning means a running production. Procedure returns comma-separated info about host status and io status.
go to post Eduard Lebedyuk · Oct 23, 2019 What error are you getting? The part of the code you've shown looks correct, except you don't need to call $zcvt, %Net.HttpRequest does that for you..
go to post Eduard Lebedyuk · Oct 19, 2019 Do you use an alternative or framework built around this native Unit Testing tool ? Not really. What is your experience with %UnitTest if you use it ? Except lack of test parallelization it's actually quite good. Also would be great to be able to skip some tests natively. Is there a tool you would recommend for your UI (I know this is not specifically an InterSystems' related question) @Sergey.Sarkisyan any comments? What process do you use to routinely run tests on your application ? You can read about that in my series of articles on GitLab.
go to post Eduard Lebedyuk · Oct 18, 2019 $ZUTIL(69,10) - Sets system behavior when journal is full. Calls: $ZU(69,10,n) - set journaling behavior $ZU(69,10) - get journaling behavior Parameters: n - The boolean value that specifies which system behavior applies when a journal is full. Values: 0 = Journaling suspends and processing continues. 1 = System freezes. Description$ZUTIL(69,10) determines Caché behavior when an error occurs in writing to the journal. If this option is set to “true” (1), as soon as the error occurs all global activities that are normally journaled are blocked, which causes other jobs to block. The typical outcome is that Caché goes into a hang state until the journaling problem is resolved, and then resumes running. While Caché is hanging, the administrator can take corrective measures, such as freeing up space on a disk that is full, switching the journal to a new disk, etc. This option has the advantage that once the problem is fixed and Caché resumes running, no journal information has been lost. It has the disadvantage that the system is less available while the problem is being solved. If this option is set to “false” (0), when a journaling error occurs journaling is entirely disabled, while Caché continues running as normal. Caché sends a console message to alert the administrator, who can fix the problem and then run ^JRNSWTCH at the console to restart journaling. The default is zero (0). The native default for this switch is “false” (0); that is, to suspend journaling and allow Caché processing to continue. Invoking $ZUTIL(69,10) without specifying n returns the current switch setting. This system-wide default can be configured. Go to the System Management Portal, select [Home] > [Configuration] >[Journal Settings]. View and edit the current setting of Freeze on error. The default is “No”. Setting $ZUTIL(69,10) changes the system configuration setting shown in the System Management Portal; this changepersists across a Caché shutdown and restart. $ZUTIL(69,68) - Enables or disables the encryption of journal files system-wide. Calls: $ZU(69,68,n) - set encryption $ZU(69,68) - get encryption Parameters: n: The boolean value that specifies whether or not Caché should establish encryption for future journal files. Values: 1 = encrypt journal files. 0 = do not encrypt journal files. The default is 0. DescriptionThe $ZUTIL(69,68) function disables or enables the encryption of journal files system-wide. $ZUTIL(69,68) takes effect when the next journal file is initiated.Invoking $ZUTIL(69,68) without specifying n returns the current switch setting $ZUTIL(69,70) - Enables or disables $DOUBLE returning INF and NAN values system-wide. Calls: $ZU(69,70) - get $DOUBLE behaviour $ZU(69,70,n)- set $DOUBLE behaviour Parameters n - A boolean that specifies whether to generate Caché error messages or return INF, –INF, and NAN values for unresolvable IEEE floating point conversions. Values: 0 - $DOUBLE returns INF, –INF, or NAN when given an unresolvable numeric expression. 1 - $DOUBLE generates Caché <MAXNUMBER>, <ILLEGAL VALUE>, and <DIVIDE> errors when given an unresolvable numeric expression. This is the default. DescriptionThe $ZUTIL(69,70) function sets the $DOUBLE function return value behavior system-wide. If 0, $DOUBLE returns INF (infinity), –INF, and NAN (Not A Number) for unresolvable IEEE floating point conversions. If 1, $DOUBLE generates Caché errors for unresolvable IEEE floating point conversions.$ZUTIL(69,70) controls the issuing of INF, –INF, and NAN when a $DOUBLE numeric operation cannot be resolved to a numeric value. It does not control the issuing of INF, –INF, and NAN in all cases. $DOUBLE always returns INF, –INF, or NAN when you supply one of these strings as the input value, regardless of the $ZUTIL(69,70) setting.Mathematical operations on $DOUBLE numbers that result in an INF, –INF, or NAN are controlled by $ZUTIL(69,70).These include arithmetic operations, exponentiation, and logarithmic and trigonometric functions.Invoking $ZUTIL(69,70) without specifying n returns the current switch setting.
go to post Eduard Lebedyuk · Oct 18, 2019 add SOAP envelope Not sure what are you trying to do. SOAP Operation should add all relevant headers and additional ones can be passed as objects. Docs. UPD. I meant java code for com.santer.siss.mapping.v25.fse.tester.HL7toXML:hl7ToRP method. For $$$CLASSNAME you can click RMB on it and then LMB on "Go To $$$CLASSNAME", in there you can see a macro definition(#define CLASSNAME <definition>). Please post it.
go to post Eduard Lebedyuk · Oct 18, 2019 Streams work like this: set stream = ##class(<stream class>).%New() do stream.Write(string) set sc = stream.Save() In your case I'd recommend using %Stream.GlobalCharacter as stream class. FileStream also works better if you supply a filename. Check this doc.
go to post Eduard Lebedyuk · Oct 18, 2019 The quite strange thing is that when I try to log the class type I have obtained as output of the java class, I didn't get %String or some otherObjectScript class but, instead, I get the xml message itself. It seem to be that the result don't have a proper class type. That is correct, the ret variable seems to be a string, so it's not a class, therefore it cannot have a class name. In Object Script there are objects and primitives (strings). Only objects have classes. The final issue arise when I try to put the result into a stream; the xml message results empty and, moreover, If I try to send just the RPStream, I get this error: OID is null. How are you doing it?