go to post Eduard Lebedyuk · Dec 28, 2016 The best way to add RESTForms (or any other repository) into your repository is submodules. Submodule is a pointer to specific commit from another repository. On disk it looks like folder. More info on submodules. To add RESTForms execute in git cli: git submodule add https://github.com/intersystems-ru/RESTForms.git
go to post Eduard Lebedyuk · Dec 27, 2016 I was caught on PYTHON too! Turns out that I had 3rd, but 2nd was required.
go to post Eduard Lebedyuk · Dec 26, 2016 Release page offers releases for both 2016.1 and 2016.2+. And in 2016.2+ $ methods are already removed.If however you want to use latest commit from repo, then you need to run SMR.
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 20, 2016 Have you checked how much time does it take to load all records from database on a server?
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 9, 2016 Then there are several free online courses you can take advantage of here. Especially Creating a Caché Class Definition course.
go to post Eduard Lebedyuk · Dec 9, 2016 Save it as CSV and import with Data Import Wizard or from the terminal.
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 7, 2016 On the other note, if you use REST on 2016.1+ you can enable CORS support in a more organised way: Class cors.REST Extends %CSP.REST { /// This parameter influences the CORS support. The default is an empty string meaning 'not specified'. /// If set to true (1) then CORS processing is ON. If set to false (0) then CORS processing is OFF. /// If left unset "" then the decision to process CORS is delegated to the setting on the URL map route. Parameter HandleCorsRequest; XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ] { <Routes> <Route Url="/:test" Method="GET" Call="Test" Cors="true"/> </Routes> } /// This is the CORS request handler. User should override this method in their subclass /// if they don't want the default behavior ClassMethod OnHandleCorsRequest(pUrl As %String) As %Status { #; The default implementation is simply to dispatch to the #; default handler Quit ..HandleDefaultCorsRequest(pUrl) } } Note, that if you're okay with HandleDefaultCorsRequest then you don't need to redefine OnHandleCorsRequest method and need supply only HandleCorsRequest or Cors attribute on per path basis.
go to post Eduard Lebedyuk · Dec 7, 2016 In some cases Access-Control-Allow-Origin: * is not a valid value, so I usually determine origin host and supply it: Do %response.SetHeader("Access-Control-Allow-Origin",..GetOrigins()) And GetOrigins method: /// Get Origin from %request object ClassMethod GetOrigins() As %String { set url = %request.GetCgiEnv("HTTP_REFERER") return $p(url,"/",1,3) // get http(s)://origin.com:port } Also, sometimes additional headers may be required, here's one of the more permissive sets: Do %response.SetHeader("Access-Control-Allow-Origin",..GetOrigins()) Do %response.SetHeader("Access-Control-Allow-Credentials","true") Do %response.SetHeader("Access-Control-Allow-Methods","GET, PUT, POST, DELETE, OPTIONS") Do %response.SetHeader("Access-Control-Max-Age","10000") Do %response.SetHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Accept-Language, X-Requested-With")
go to post Eduard Lebedyuk · Dec 7, 2016 What do you mean? Do you want to call RESTForms from some other (non-web) context? Can you please expand your question.