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é
go to post José Pereira · Dec 1, 2022 Hi @Thomas Kotze Currently this is not possible. But maybe some changes here may work for your needs. Try to replace the server address. Let me know if it works. Regards, José
go to post José Pereira · Nov 25, 2022 Hi Edmara! Which IRIS version are you trying? I did a test using the version "IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2022.2 (Build 368U) Fri Oct 21 2022 17:18:04 EDT" and all worked fine. Please, checkout the example below on your IRIS version. It shows the index global value (^dado.TblTesteI) in order to get more visibility of what is going on. dado.TblTeste: Spoiler Class dado.TblTeste Extends (%Persistent, %Populate) { Index idxFieldOneFieldTwoFieldThree On (FieldOneId, FieldTwoId, FieldThreeId) [ Unique ]; ForeignKey fkFieldOneId(FieldOneId) References dado.TblFieldOne(); ForeignKey fkFieldTwoId(FieldTwoId) References dado.TblFieldTwo(); ForeignKey fkFieldThreeId(FieldThreeId) References dado.TblFieldThree(); Property FieldOneId As dado.TblFieldOne [ Required ]; Property FieldTwoId As dado.TblFieldTwo [ Required ]; Property FieldThreeId As dado.TblFieldThree; Property Descricao As %String [ Required ]; Property VersaoCheck As %String [ InitialExpression = 0 ]; ClassMethod OpenCompositeIndexTest() { // IRIS version Write "IRIS version: ", $ZV,! // clean up tables Write !,"Cleaning up tables..." $$$TOE(st, ##class(dado.TblTeste).%KillExtent()) $$$TOE(st, ##class(dado.TblFieldOne).%KillExtent()) $$$TOE(st, ##class(dado.TblFieldTwo).%KillExtent()) $$$TOE(st, ##class(dado.TblFieldThree).%KillExtent()) // populate dependencies Write !,"Populating tables..." $$$TOE(st, ##class(dado.TblFieldOne).Populate()) $$$TOE(st, ##class(dado.TblFieldTwo).Populate()) $$$TOE(st, ##class(dado.TblFieldThree).Populate()) Write ! // test with value for all index fields Set testDesc = "Test with FieldThreeId using SQL DML" Write !,"---",!,testDesc_":" &SQL(insert into dado.TblTeste (FieldOneId, FieldTwoId, FieldThreeId, Descricao) values (1, 2, 3, :testDesc)) If SQLCODE < 0 {Write !,"SQLCODE error ", SQLCODE, " ", %msg} Set object = ##class(dado.TblTeste).idxFieldOneFieldTwoFieldThreeOpen(1, 2, 3) If 'object {Do $system.OBJ.DisplayError()} Else {Write !,"Ok"} Write !,"Index global: ",! ZWrite ^dado.TblTesteI // test with no value for field FieldThreeId and insertion via SQL DML Set testDesc = "Test with no FieldThreeId using SQL DML" Write !,"---",!,testDesc_":" &SQL(insert into dado.TblTeste (FieldOneId, FieldTwoId, FieldThreeId, Descricao) values (1, 2, null, :testDesc)) If SQLCODE < 0 {Write !,"SQLCODE error ", SQLCODE, " ", %msg} Set object = ##class(dado.TblTeste).idxFieldOneFieldTwoFieldThreeOpen(1, 2, "") If 'object {Do $system.OBJ.DisplayError()} Else {Write !,"Ok"} Write !,"Index global: ",! ZWrite ^dado.TblTesteI // test with no value for field FieldThreeId and insertion via object interface Set testDesc = "Test with no FieldThreeId using object" Write !,"---",!,testDesc_":" Set o = ##class(dado.TblTeste).%New() Do o.FieldOneIdSetObjectId(2) Do o.FieldTwoIdSetObjectId(1) Set o.Descricao = testDesc $$$TOE(st, o.%Save()) Set object = ##class(dado.TblTeste).idxFieldOneFieldTwoFieldThreeOpen(2, 1, "") If 'object {Do $system.OBJ.DisplayError()} Else {Write !,"Ok"} Write !,"Index global: ",! ZWrite ^dado.TblTesteI } Storage Default { <Data name="TblTesteDefaultData"> <Value name="1"> <Value>%%CLASSNAME</Value> </Value> <Value name="2"> <Value>FieldOneId</Value> </Value> <Value name="3"> <Value>FieldTwoId</Value> </Value> <Value name="4"> <Value>FieldThreeId</Value> </Value> <Value name="5"> <Value>Descricao</Value> </Value> <Value name="6"> <Value>VersaoCheck</Value> </Value> </Data> <DataLocation>^dado.TblTesteD</DataLocation> <DefaultData>TblTesteDefaultData</DefaultData> <IdLocation>^dado.TblTesteD</IdLocation> <IndexLocation>^dado.TblTesteI</IndexLocation> <StreamLocation>^dado.TblTesteS</StreamLocation> <Type>%Storage.Persistent</Type> } } dado.TblFieldOne: Spoiler Class dado.TblFieldOne Extends (%Persistent, %Populate) { Property FieldOneId As %Integer [ Required ]; Property FieldOneText As %String [ Required ]; Storage Default { <Data name="TblFieldOneDefaultData"> <Value name="1"> <Value>%%CLASSNAME</Value> </Value> <Value name="2"> <Value>FieldOneId</Value> </Value> <Value name="3"> <Value>FieldOneText</Value> </Value> </Data> <DataLocation>^dado.TblFieldOneD</DataLocation> <DefaultData>TblFieldOneDefaultData</DefaultData> <IdLocation>^dado.TblFieldOneD</IdLocation> <IndexLocation>^dado.TblFieldOneI</IndexLocation> <StreamLocation>^dado.TblFieldOneS</StreamLocation> <Type>%Storage.Persistent</Type> } } dado.TblFieldTwo: Spoiler Class dado.TblFieldTwo Extends (%Persistent, %Populate) { Property FieldTwoId As %Integer [ Required ]; Property FieldTwoText As %String [ Required ]; Storage Default { <Data name="TblFieldTwoDefaultData"> <Value name="1"> <Value>%%CLASSNAME</Value> </Value> <Value name="2"> <Value>FieldTwoId</Value> </Value> <Value name="3"> <Value>FieldTwoText</Value> </Value> </Data> <DataLocation>^dado.TblFieldTwoD</DataLocation> <DefaultData>TblFieldTwoDefaultData</DefaultData> <IdLocation>^dado.TblFieldTwoD</IdLocation> <IndexLocation>^dado.TblFieldTwoI</IndexLocation> <StreamLocation>^dado.TblFieldTwoS</StreamLocation> <Type>%Storage.Persistent</Type> } } dado.TblFieldThree: Spoiler Class dado.TblFieldThree Extends (%Persistent, %Populate) { Property FieldThreeId As %Integer [ Required ]; Property FieldThreeText As %String [ Required ]; Storage Default { <Data name="TblFieldThreeDefaultData"> <Value name="1"> <Value>%%CLASSNAME</Value> </Value> <Value name="2"> <Value>FieldThreeId</Value> </Value> <Value name="3"> <Value>FieldThreeText</Value> </Value> </Data> <DataLocation>^dado.TblFieldThreeD</DataLocation> <DefaultData>TblFieldThreeDefaultData</DefaultData> <IdLocation>^dado.TblFieldThreeD</IdLocation> <IndexLocation>^dado.TblFieldThreeI</IndexLocation> <StreamLocation>^dado.TblFieldThreeS</StreamLocation> <Type>%Storage.Persistent</Type> } } Output of OpenCompositeIndexTest() method: IRISAPP>d ##class(dado.TblTeste).OpenCompositeIndexTest()IRIS version: IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2022.2 (Build 368U) Fri Oct 21 2022 17:18:04 EDT Cleaning up tables...Populating tables... ---Test with FieldThreeId using SQL DML:OkIndex global: ^dado.TblTesteI("idxFieldOneFieldTwoFieldThree",1,2,3,1)="" ---Test with no FieldThreeId using SQL DML:OkIndex global: ^dado.TblTesteI("idxFieldOneFieldTwoFieldThree",1,2,-100000000000000,2)=""^dado.TblTesteI("idxFieldOneFieldTwoFieldThree",1,2,3,1)="" ---Test with no FieldThreeId using object:OkIndex global: ^dado.TblTesteI("idxFieldOneFieldTwoFieldThree",1,2,-100000000000000,2)=""^dado.TblTesteI("idxFieldOneFieldTwoFieldThree",1,2,3,1)=""^dado.TblTesteI("idxFieldOneFieldTwoFieldThree",2,1,-100000000000000,3)="" HTH, José
go to post José Pereira · Nov 2, 2022 Hi @Evgeny Shvarov ! I've create the module.xml but forgot to publish it to OEX... Done: https://openexchange.intersystems.com/portal/package/iris-grpc-example Thank you for letting me know!
go to post José Pereira · Nov 2, 2022 Also there are a plenty of examples in OpenExchange, which you can try via ZPM (IRIS package manager): https://openexchange.intersystems.com/?search=REST&sort=d.desc
go to post José Pereira · Apr 7, 2022 Hi guys! Could you please add the 1st article bonus for python-globals-serializer-example? Article: https://community.intersystems.com/post/serializing-python-objects-globals Thanks!
go to post José Pereira · Apr 7, 2022 Hi Vitaliy, Thank you for that valuable information! I'll take it into account. But let's assume that I do a partial rebuild. Is it OK to use this partially rebuilt index if I don't care about data that isn't indexed? Did you do this before? Thanks
go to post José Pereira · Feb 28, 2022 Hi! Please, checkout this post: https://community.intersystems.com/node/498271 HTH