How does Vue.JS stacks against other popular JS frameworks like Angular2, React, etc.?
- Log in to post comments
How does Vue.JS stacks against other popular JS frameworks like Angular2, React, etc.?
I prefer %SQL.Util.Procedures because it is easier to use and it generates classes and methods that can be easily modified.
Signature should be:
As %List
Ensure that user, which you are using to access the database has apropriate permissions to connect and access data.
I use markdowntopdf, but there are many online and offline services with the similar capabilities. I have created a release with PDFs.
> Would you have three branches for the code or 3 repo's.
Please describe differences between your DEV, TEST, PROD code. Still, I'd probably recommend one repo and 3 branches.
>Would you have three projects in Atelier to communicate with the environments and GitHub?
No, there would be one Atelier project for DEV. All other code propagation should be done automatically by Continuous Integration/Continuous Delivery solution.
That may mean one of the several things:
Anyway, to solve this problem you need to make a correct request to the target system, record it and compare to the Ensemble request. Here's an article on that.
Why don't you want to do it in the rule editor?
Same as with modifying a rule:
Business Rule Definition is stored as XML in XData block named RuleDefinition inside rule class and can be (de)serialized as an object of Ens.Rule.Model.ruleDefinition class. Some utility methods are available there.
Here's an example of modifying Demo.ComplexMap.Rule.SemesterBatchRouting rule in ENSDEMO class. It modifies "when" condition from 1 to 0.
zn "ENSDEMO" set ruleClass = "Demo.ComplexMap.Rule.SemesterBatchRouting" set sc = ##class(Ens.Rule.Model.ruleDefinition).LoadFromClass(ruleClass, .rule) set rule.ruleSets.GetAt(1).actions.GetAt(1).whens.GetAt(1).condition=0 w rule.SaveAs(ruleClass) set sc=$system.OBJ.Compile(ruleClass,"k-d")
But instead of:
set sc = ##class(Ens.Rule.Model.ruleDefinition).LoadFromClass(ruleClass, .rule)
You need to create and fill rule object manually.
Your first link leads to class documentation root.
In any place (but preferably in the beginning) of your REST handler method add these lines:
set %response.ContentType = "text/html" do ##class(%CSP.Utils).DisplayAllObjects() quit $$$OK
and then open REST Url to see all current objects, including %request.
You can use %Dictionary package to modify classes.
For example you can open property which is an object of %Dictionary.PropertyDefinition, modify it and save. Recompile the class to see new class definition.
Here's an example of %Dictionary modification to create new method.
Code for the custom adapter that specifies Content type:
Class Production.Adapter.HTTPOutboundAdapter Extends EnsLib.HTTP.OutboundAdapter
{
Method Post(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) As %Status
{
quit ..SendFormDataArray(.pHttpResponse, "POST", ..GetRequest(), .pFormVarNames, .pData)
}
ClassMethod GetRequest() As %Net.HttpRequest
{
set request = ##class(%Net.HttpRequest).%New()
set request.ContentType = "application/json"
quit request
}
}Note that this way only one-line method Post gets redefined (you'll also need to redefine Get method, but still - these are small one-line methods). ContentType may be further refactored as a setting.
Some comments
Business Rule Definition is stored as XML in XData block named RuleDefinition inside rule class and can be (de)serialized as an object of Ens.Rule.Model.ruleDefinition class. Some utility methods are available there.
Here's an example of modifying Demo.ComplexMap.Rule.SemesterBatchRouting rule in ENSDEMO class. It modifies "when" condition from 1 to 0.
zn "ENSDEMO" set ruleClass = "Demo.ComplexMap.Rule.SemesterBatchRouting" set sc = ##class(Ens.Rule.Model.ruleDefinition).LoadFromClass(ruleClass, .rule) set rule.ruleSets.GetAt(1).actions.GetAt(1).whens.GetAt(1).condition=0 w rule.SaveAs(ruleClass) set sc=$system.OBJ.Compile(ruleClass,"k-d")
That said, I think the better approach would be to use (in order of
increasing implementation difficulty):
So the rule by itself does not change but values supplied by Context Class/Temporary Variables/etc do.
You can decode JSON escaped characters:
set string = $zcvt(string, "I", "JSON")
and remove special symbols after that.
You can get output from %ToJSON() into a variable without any redirection:
set jsonString = dynamicObj.%ToJSON()
iKnow or iFind?
If iFind, then what index?
It depends on your corpus, and diversity of concepts encountered there.
I have 1:1 as corpus size:index size as a baseline, but it all depends on many factors.
Thank you, Alexander.
Here's an article on useful autogenerated methods for properties, indices, queries, etc.
Here's a write-up on defining your own query types to add more methods than just Func().
This condition:
Super [ 'Persistent'
Is insufficient. Consider this case:
Class Package.ClassA Extends %Library.Persistent
{
}
Class Package.ClassB Extends %XML.Adaptor
{
}
Class Package.ClassC Extends (ClassA, ClassB)
{
}While Package.ClassC satisfies both conditions (it's a subclass of both %Library.Persistent and %XML.Adaptor), it would not be returned by the SQL query, as Super field does not contain required superclasses directly.
But we can easily join 2 SubclassOf queries via SQL:
SELECT s1.name
FROM %Dictionary.ClassDefinitionQuery_SubclassOf('%Library.Persistent') s1
INNER JOIN %Dictionary.ClassDefinitionQuery_SubclassOf('%XML.Adaptor') s2 ON s2.name = s1.nameDoes it work like this?
ClassMethod WriteCapture(vstrCommand As %String) As %String
{
set tOldIORedirected = ##class(%Device).ReDirectIO()
set tOldMnemonic = ##class(%Device).GetMnemonicRoutine()
set tOldIO = $io
try {
set str=""
//Redirect IO to the current routine - makes use of the labels defined below
use $io::("^"_$ZNAME)
//Enable redirection
do ##class(%Device).ReDirectIO(1)
XECUTE (vstrCommand)
} catch ex {
set str = ""
}
//Return to original redirection/mnemonic routine settings
if (tOldMnemonic '= "") {
use tOldIO::("^"_tOldMnemonic)
} else {
use tOldIO
}
do ##class(%Device).ReDirectIO(tOldIORedirected)
quit str
//Labels that allow for IO redirection
//Read Character - we don't care about reading
rchr(c) quit
//Read a string - we don't care about reading
rstr(sz,to) quit
//Write a character - call the output label
wchr(s) do output($char(s)) quit
//Write a form feed - call the output label
wff() do output($char(12)) quit
//Write a newline - call the output label
wnl() do output($char(13,10)) quit
//Write a string - call the output label
wstr(s) do output(s) quit
//Write a tab - call the output label
wtab(s) do output($char(9)) quit
//Output label - this is where you would handle what you actually want to do.
// in our case, we want to write to str
output(s) set str=str_s quit
}You can use simply:
..RetryInterval
Instead of
%Ensemble("%Process").RetryIntervalSince current object is %Ensemble("%Process").
set obj = {"RecordIDs":[{"ID":"1234","Type":"INTERNAL"},{"ID":"1234","Type":"EXTERNAL"}],"ContactIDs":null,"Items":[{"ItemNumber":"320","Value":null,"Lines":[{"LineNumber":0,"Value":"1","Sublines":null},{"LineNumber":1,"Value":"100063287","Sublines":null}]}]}
w obj.Items.%Get(0).Lines.%Get(0).LineNumber
>0
w obj.Items.%Get(0).Lines.%Get(1).LineNumber
>1To iterate over arbitrary number of array elements use iterator:
set iterator = obj.Items.%Get(0).Lines.%GetIterator()
while iterator.%GetNext(.key,.line) { w line.LineNumber,! }
>0
>1It's a global that stores information about processed files. It can be accessed via $$$DoneFileTable macro - it's defined in EnsLib.File.InboundAdapter.
You'll need to subclass EnsLib.File.InboundAdapter and modify this line in OnTask method to do what you need:
$$$LOGINFO("Skipping previously processed file '"_tOneFilename_"'")
Alternatively you can monitor done file table and send alerts when you find new records.
Both options seem lacking.
Provided your patient MRN doesn't contain whitespaces, you can use $justify to pad string to required length and $translate to convert whitespaces into zeros.
w $tr($j("a", 10), " ", 0)
>000000000a