go to post José Pereira · Feb 20 For those who reach this out, %FileCharacterStream class was deprecated in favor of %Stream.FileCharacter. Here is the updated snippet for convinence: Set tTempFile = ##class(%Stream.FileCharacter).%New() Set tTempFile.Filename = "/tmp/file.csv" $$$THROWONERROR(st, tTempFile.CopyFrom(csvfile)) $$$THROWONERROR(st, tTempFile.%Save())
go to post José Pereira · Feb 16 Hi Prashanth, I had a similar requirement once. The following is how I managed it: First, I setup a method in a CSP dispatch class, which respond to a REST endpoint, to invoke a Business Service in the current namespace working production: ClassMethod SomeRestEndpointCallback(body As %DynamicArray) As %DynamicObject { $$$TOE(st, ##class(Ens.Director).CreateBusinessService("BusinessServiceName", .service)) $$$ThrowOnError(service.ProcessInput(body, .output)) Return output } Then, I created a adapterless Business Service (https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...) in order to don't pooling for data but just wait for an external trigger instead: Class some.package.AdapterlessBS Extends Ens.BusinessService { /// Configuration item(s) to which to send file stream messages Property TargetConfigNames As Ens.DataType.ConfigName(MAXLEN = 1000); Parameter SETTINGS = "TargetConfigNames:Basic:selector?multiSelect=1&context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId}"; Method OnProcessInput(request As %RegisteredObject, Output response As %RegisteredObject) As %Status { Set tSC = $$$OK Try { // Could be any message... adapter to your needs Set tMsg = ##class(Ens.StringResponse).%New() Set tMsg.StringValue = "some value" // Send the message to the targets Set targets = $LFS(..TargetConfigNames) For i=1:1:$LL(targets) { Set target = $LG(targets, i) // can be sync or async... it's up to you decide //Set tSC = ..SendRequestSync(target, tMsg) Set tSC = ..SendRequestAsync(target, tMsg) Quit:$$$ISERR(tSC) } } Catch (ex) { Set tSC = ex.AsStatus() } Quit tSC } Now, you can add this Business Service to a interoperability production and set the desired Business Process as its target. So, when your REST endpoint is accessed, it will call the BS and then the BP. HTH,José
go to post José Pereira · Feb 6 Hi Robert, Great article! May be you find this discussion about ObjectScript quality rules interesting.
go to post José Pereira · Feb 6 Hi, In addition to @Robert Barbiaux response, you can use IRIS Unit Test in the ObjectScript side.
go to post José Pereira · Feb 5 Hi David. Thank you for your interest int the project. I didn't try it in GitHub Codespaces, but I just test it in my local Windows PC and it worked: As you can see, the command in README.md worked for me. I like to use this flags to get more information on possible issues. But, I changed such a commnad to just docker-compose up -d, once this command automatically builds the image if it does not exists. Thank you for your feedback, really appreciate it!
go to post José Pereira · Feb 3 Hi @Evgeny Shvarov / @Semion Makarov ! I just added an IRIS Interoperability Production show how to use the code generated by IRIS-FHIRfy to convert a simple CSV into FHIR and persist it to IRIS for Health. Evidences could be found here, here or here. Could you add the points for Digital Health Interoperability bonus to IRIS-FHIRfy, please? Thank you!
go to post José Pereira · Jul 10, 2023 Hi, I think you missed some links references: Btw, great article! :)
go to post José Pereira · Jul 9, 2023 Hi @Semion Makarov I added a BI dashboard to do analytics on the app logs of iris-fhir-generative-ai to the release 1.0.9, and a second article explaining about such analytics. So, I'd like to ask for IRIS BI and Second article bonuses. PS: Sorry for publish this so late, but I had this idea just Sunday late. 😄 Thanks!
go to post José Pereira · Jul 5, 2023 Thanks @Tani Frankel! I've the privilege to attend that session, very inspiring!
go to post José Pereira · Jul 4, 2023 Done:https://community.intersystems.com/sites/default/files/inline/images/pro...https://community.intersystems.com/sites/default/files/inline/images/pro... Thanks guys!
go to post José Pereira · Jul 4, 2023 Hi! Which pic? I can see all the 2 pics within the article. Could you send me its link or any other reference, please?
go to post José Pereira · Jan 13, 2023 Hi! May be this example could help you: ClassMethod ExecTestQuery(pParams) { Set mdx = "WITH "_ " %PARM pSelectedDim as 'value:Trimestre' "_ " %PARM pSelectedYear as 'value:NOW' "_ "SELECT "_ " [Measures].[QtdAtendimento] ON 0, "_ " NON EMPTY [DataD].[H1].@pSelectedDim.Members ON 1 "_ "FROM [ARQORDEMSERVICO] "_ "%FILTER [DATAD].[H1].[ANO].&[@pSelectedYear]" Set rs = ##class(%DeepSee.ResultSet).%New() Try { $$$TOE(st, rs.%PrepareMDX(mdx)) Write "Parameters: " Write:($D(pParams) = 0) "(default)" Write ! ZW pParams $$$TOE(st, rs.%Execute(.pParams)) Do rs.%Print() } Catch(e) { Write e.DisplaytString(),! } } ClassMethod TestDeepSeeResultSet() { Write "Test 1", ! Do ..ExecTestQuery() Write "------",! Write "Test 2", ! Set params("pSelectedDim") = "MesAno" Set params("pSelectedYear") = "2022" Do ..ExecTestQuery(.params) } Do ##class(teste.NewClass1).TestDeepSeeResultSet() Test 1 Parameters: (default) Qtd Atendimento Q1 2023 4 ------ Test 2 Parameters: pParams("pSelectedDim")="MesAno" pParams("pSelectedYear")=2022 Qtd Atendimento 1 Ago-2022 15 2 Set-2022 30 3 Out-2022 25 4 Nov-2022 9 5 Dez-2022 5 Some resources that may be useful: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY... https://docs.intersystems.com/ens201815/csp/docbook/Doc.View.cls?KEY=D2R... HTH, José
go to post José Pereira · Jan 9, 2023 Hi! Don't know if it's your case, but if you are able to generate the global data, you could use the $INCREMENT() function, which automatically stores the array length into global's head: Set ^test($INCREMENT(^test)) = "aa" Set ^test($INCREMENT(^test)) = "aa" Set ^test($INCREMENT(^test)) = "aa" Set ^test($INCREMENT(^test)) = "aa" ZWrite ^test ^test=4 ^test(1)="aa" ^test(2)="aa" ^test(3)="aa" ^test(4)="aa" Write ^test 4 HTH, José
go to post José Pereira · Jan 5, 2023 Hi @Ori Tsarfati! Recently, I had a similar requirement in a personal project and found JSON2Persistent in OpenExchange from @Michael Braam. I don't know if this is exactly what you need, but using this tool you can transform an ordinary JSON into in a set of persistent IRIS classes which could be used in DTLs. For instance, I took this FHIR resrouce example and save it to a file. JSON input { "fullUrl": "", "search": { "mode": "match" }, "resource": { "resourceType" : "Observation", "id" : "body-height", "meta" : { "profile" : ["http://hl7.org/fhir/StructureDefinition/vitalsigns"], "lastUpdated": "2022-12-11T16:21:20Z", "versionId": "1" }, "text" : { "status" : "generated", "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative: Observation</b><a name=\"body-height\"> </a></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource Observation "body-height" </p><p style=\"margin-bottom: 0px\">Profile: <a href=\"vitalsigns.html\">Vital Signs Profile</a></p></div><p><b>status</b>: final</p><p><b>category</b>: Vital Signs <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"http://terminology.hl7.org/4.0.0/CodeSystem-observation-category.html\">Observation Category Codes</a>#vital-signs)</span></p><p><b>code</b>: Body height <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#8302-2)</span></p><p><b>subject</b>: <a href=\"patient-example.html\">Patient/example</a> "Peter CHALMERS"</p><p><b>effective</b>: 1999-07-02</p><p><b>value</b>: 66.899999999999991 in<span style=\"background: LightGoldenRodYellow\"> (Details: UCUM code [in_i] = 'in_i')</span></p></div>" }, "status" : "final", "category" : [{ "coding" : [{ "system" : "http://terminology.hl7.org/CodeSystem/observation-category", "code" : "vital-signs", "display" : "Vital Signs" }], "text" : "Vital Signs" }], "code" : { "coding" : [{ "system" : "http://loinc.org", "code" : "8302-2", "display" : "Body height" }], "text" : "Body height" }, "subject" : { "reference" : "Patient/example" }, "effectiveDateTime" : "1999-07-02", "valueQuantity" : { "value" : 66.899999999999991, "unit" : "in", "system" : "http://unitsofmeasure.org", "code" : "[in_i]" }, "encounter": { "reference": "Encounter/529" }, "issued": "2012-09-10T11:59:49.565+00:00" } } Then I exctracted a set of persistent classes organized in a package called tmp.FHIRObservationSchema from that file using JSON2Persistent, like this: $$$TOE(sc, ##class(ISC.SE.Tools.JSON).GenerateClasses("/tmp/file.json", "tmp", "FHIRObservationSchema", 0, 1, "crk", 1)) After that, I was able to create a DTLs using the schema created from the FHIR resource JSON: DTL (Code) Class dc.FHIRServer.FHIRConditionToStringRequestDTL Extends Ens.DataTransformDTL [ DependsOn = (tmp.FHIRObservationSchema, Ens.StringRequest) ] { Parameter IGNOREMISSINGSOURCE = 1; Parameter REPORTERRORS = 1; Parameter TREATEMPTYREPEATINGFIELDASNULL = 0; XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ] { <transform sourceClass='tmp.FHIRObservationSchema' targetClass='Ens.StringRequest' create='new' language='objectscript' > <assign value='source.resource.id' property='auxId' action='set' /> <assign value='""' property='auxCoding' action='set' /> <foreach property='source.resource.code.coding()' key='k1' > <assign value='auxCoding_source.resource.code.coding.(k1).code_" "' property='auxCoding' action='set' /> </foreach> <assign value='"ID: "_auxId_", Codes: "_auxCoding' property='target.StringValue' action='set' /> </transform> } } DTL (UI) So, I create a method to test it: DTL test method ClassMethod TestDTL() { Set bodyHeight = { "fullUrl": "", "search": { "mode": "match" }, "resource": { "resourceType" : "Observation", "id" : "body-height", "meta" : { "profile" : ["http://hl7.org/fhir/StructureDefinition/vitalsigns"], "lastUpdated": "2022-12-11T16:21:20Z", "versionId": "1" }, "text" : { "status" : "generated", "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative: Observation</b><a name=\"body-height\"> </a></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource Observation "body-height" </p><p style=\"margin-bottom: 0px\">Profile: <a href=\"vitalsigns.html\">Vital Signs Profile</a></p></div><p><b>status</b>: final</p><p><b>category</b>: Vital Signs <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"http://terminology.hl7.org/4.0.0/CodeSystem-observation-category.html\">Observation Category Codes</a>#vital-signs)</span></p><p><b>code</b>: Body height <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"https://loinc.org/\">LOINC</a>#8302-2)</span></p><p><b>subject</b>: <a href=\"patient-example.html\">Patient/example</a> "Peter CHALMERS"</p><p><b>effective</b>: 1999-07-02</p><p><b>value</b>: 66.899999999999991 in<span style=\"background: LightGoldenRodYellow\"> (Details: UCUM code [in_i] = 'in_i')</span></p></div>" }, "status" : "final", "category" : [{ "coding" : [{ "system" : "http://terminology.hl7.org/CodeSystem/observation-category", "code" : "vital-signs", "display" : "Vital Signs" }], "text" : "Vital Signs" }], "code" : { "coding" : [{ "system" : "http://loinc.org", "code" : "8302-2", "display" : "Body height" }], "text" : "Body height" }, "subject" : { "reference" : "Patient/example" }, "effectiveDateTime" : "1999-07-02", "valueQuantity" : { "value" : 66.899999999999991, "unit" : "in", "system" : "http://unitsofmeasure.org", "code" : "[in_i]" }, "encounter": { "reference": "Encounter/529" }, "issued": "2012-09-10T11:59:49.565+00:00" } } Set input = ##class(tmp.FHIRObservationSchema).%New() $$$TOE(st, input.%JSONImport(bodyHeight)) $$$TOE(st, ##class(dc.FHIRServer.FHIRConditionToStringRequestDTL).Transform(input, .output)) ZWrite output } And got this output: HTH, José
go to post José Pereira · Dec 14, 2022 Hi! I grabbed some pieces of code from a previous project. In this project I could connect to Cache 2018. PS: I didn't test this mashup. import irisnative import jaydebeapi import pandas as pd def create_conn(type, host, port, namespace, user, password): if type == "cache": url = f"jdbc:Cache://{host}:{port}/{namespace}" driver = "com.intersys.jdbc.CacheDriver" jarfile = "C:/InterSystems/Cache2018/dev/java/lib/JDK18/cache-jdbc-2.0.0.jar" conn = jaydebeapi.connect(driver, url, [user, password], jarfile) else: conn = irisnative.createConnection(host, port, namespace, user, password, sharedmemory = True) return conn conn = create_conn("cache", "x.x.x.x", "56772", "namespace", "user", "password") sql = "select ..." df = pd.read_sql(sql, conn) display(df) HTH, José
go to post José Pereira · Dec 11, 2022 In addition to @Julius Kavay answer, there's also another similar question to yours here.
go to post José Pereira · Dec 11, 2022 But the way that this IA understands and creates text is impressive, no doubts. I think this is something we'll learn how to deal with our daily tasks. As the zdnet article says, Stack Overflow removes **temporarily**, so it may be a matter of time until we get handed by IA in our development tasks, with services like GitHub copilot. So thank you for bringing this topic to discussion!
go to post José Pereira · Dec 11, 2022 Seems to be kind a controversial topic: Stack Overflow temporarily bans answers from OpenAI's ChatGPT chatbot
go to post José Pereira · Dec 6, 2022 Hi! Have you tried the _count parameter? (https://build.fhir.org/search.html#_count) For instance: https://testserver/csp/healthshare/hsods/fhir/r4/Practitioner?identifier... HTH, José