发布新帖

Pesquisar

文章
· 四月 3, 2024 阅读大约需 2 分钟

Comfortable VSCode Auto Save and ObjectScript CompileOnSave settings

Hi - Recently I have been investigating an annoying situation whilst editing ObjectScript classes or routines in VSCode.

What was happening to me was, as I was typing in lines of code into my class (for example, adding a new Method, or changing the Class signature, or a block of code),  this would quickly get syntax checked, re-formatted, and compiled - inevitably, (since I would be mid-way through my typing), this would generate compilation errors.

Knowing that I was mid-way through adding code, I could simply dismiss this message, however, this soon got very annoying, and conditioned me to ignore the error (which is not a good thing).

Even worse, however, is that the compilation process also reformatted the document and sometimes broke what was previously well formatted lines of code (appearing below the line I was writing) - which required me to go into that area of the document and fix them back up.

What's going on ?

There are two settings at play here:

  1. VSCode's auto-save (files.autosave) settings which dictates wether to automatically save a document that has been changed, and if so, how long to wait before saving (files.autoSaveDelay)
  2. ObjectScript extension's compileOnSave (objectscript.compileOnSave), which determines wether after saving the document, this also imports into and compiles on the connected IRIS namespace.

Since I had autosave turned on, and on a short wait delay together with compileOnSave meant that partially edited code kept compiling, generating the above erros, and as mentioned, sometimes re-formatting good, pre-existing blocks of code.

In my case, I have settled on the following:

  1. AutoSave (files.autosave) off (autosaveDelay is ignored),  and
  2. CompileOnSave (objectscript.compileOnSave) on.

Now, when I'm happy with my edits (in my own time !), I press Ctrl-S, to save, import and compile my class, and look out for that pop-up message which has real meaning and purpose now.

You may choose a different combination, (for example, go ahead and Autosave after 5 minutes or so, accepting the code may not fully compile), however, I've found the above combination works for me, and hope that - if you are experiencing the same annoyance, then, this article may help you find your optimum configuration.

Thankyou to @Patrick Sulin, and @Raj Singh for pointing me in the direction of these settings !

Steve Pisani

12 Comments
讨论 (12)8
登录或注册以继续
文章
· 四月 3, 2024 阅读大约需 3 分钟

Connect Microsoft Excel to InterSystems IRIS via ODBC (Windows)

How to create an ODBC connection on your native Windows laptop to IRIS running on a Windows VM on the same computer, test the connection, and pull data from IRIS into Excel.

Recently I learned that Excel can connect to external databases via ODBC. This includes basically any ODBC data source. Since IRIS speaks ODBC via the ODBC API, we can take advantage of the InterSystems ODBC Driver to establish an ODBC connection to IRIS on Windows that Excel can utilize.

Before getting started, make sure you have installed the latest InterSystems ODBC driver on your native Windows, which can either be found on WRC or on GitHub. I assume that you are running IRIS on a Windows VM using VMWare hosted on your Windows machine. I also assume that you have Microsoft Excel installed on your native Windows as well. You’ll also need some data pre-loaded into your namespace to access. For this post, I am using data from the Python Quickstart. The data can be found on GitHub.

First you need to find the IP address for the VM. (Keep in mind that you may need to repeat this step if you restart the VM, connect to a different network or connect/disconnect a VPN connection.)

To find your IP address in the Windows VM, go to the Windows Command Prompt (cmd):

  1. In the VM, hold the Windows key and the R key. This opens the Run dialog (as seen below). Type in “cmd” and click <OK>:

 

  1. On the Command Prompt, type in “ipconfig -all” to find your IP address. You want to locate the line that says “IPv4 Address….” And make note of the numeric IP address given on that line:

 

  1. Also make note of the Web Server Port of your VM IRIS, because you’ll need that later.

 

Now, return to the Windows host system and open the ODBC Data Source Administrator (ODBC DSA) and configure the connection:

  1. In the ODBC DSA, open the “System DSN” tab and click “Add”:

 

  1. You will be prompted to select a driver for the data source. If you installed the InterSystems ODBC driver on your native Windows machine, you should select “InterSystems IRIS ODBC…” as I have done below and click “Finish”:

 

 

 

  1. This will open a new dialog where you need to name the data source, provide a description, input the IP address you copied previously and the Web Server Port. Input the namespace you want to connect to, the User Name and Password that you use for the Management Portal as well. Then click <Test Connection> as shown below:

 

 

  1. If all went well, you should see that the test completed successfully as shown below. This means that we now have a connection via our native Windows to IRIS on the VM:

 

Now we can open Microsoft Excel and access data via the ODBC data source. We do this by selecting the “Data” tab (1), then clicking “Get Data” (2). Click “From Other Sources” (3), and then “From ODBC” (4).

 

 

From the drop down, select the data source you created previously and click OK:

 

In the Navigator, select the table you want to connect to and click “Load”:

 

From here, we can see that we successfully connected to the data on IRIS on a VM and are able to access it in Microsoft Excel running on native Windows:

 

Wrapping up, we might wonder why we would want to access IRIS data in Excel. Many people have years of Excel expertise. They can use Excel to explore data, create pivot tables, visualizations, and dashboards.

2 Comments
讨论 (2)2
登录或注册以继续
文章
· 四月 3, 2024 阅读大约需 2 分钟

Reviews on Open Exchange - #41

If one of your packages on OEX receives a review you get notified by OEX only of YOUR own package.   
The rating reflects the experience of the reviewer with the status found at the time of review.   
It is kind of a snapshot and might have changed meanwhile.   
Reviews by other members of the community are marked by * in the last column.

I also placed a bunch of Pull Requests on GitHub when I found a problem I could fix.    
Some were accepted and merged, and some were just ignored.     
So if you made a major change and expect a changed review just let me know.

# Package Review Stars IPM Docker *
1 iris-xml-sample just perfect 5.5* 5.5   y  
2 fhirserver-profile-based-validation A valuable help to save time on the operation of FHIR profile validation. 5.0     *
3 Jupyter Server Proxy for VS Code Great utility 5.0   y *
4 OwnObjectScriptExtension Works 5.0     *
5 Vector-inside-IRIS all in COS 5.0 y y *
6 webHERALD Simplifying Mobile Integration for Caché Developers 5.0     *
7 workshop-smart A valuable help to save time on the operation of FHIR profile validation. 5.0   y *
8 UnitTest_RuleSet Great working example - easy to adapt 5.0     *
9 workshop-vector-face funny example on vectors 4.8   y  
10 yaml-utils Excellent yaml to json converter. 4.6 y   *

 

A Bit of History & Statistics

  • I started this series 3 years ago with April 2021 reviews
  • 913 packages of OEX were checked over this time
  • 708 (77.3 %) had a review worth to be listed
  • 576 (81.4 %) of them were done by myself
  • 134 (18.6 %) were contributed by other members of the community (BIG THANKS)

A technical note

All data were collected by analysis of official published web pages of OEX and GitHub.
So there may be some numeric differences as I never adjusted historical data.

讨论 (0)1
登录或注册以继续
问题
· 四月 2, 2024

What is the Difference Between do $Increment and if $Increment?

I'm currently making some changes to legacy code and I've noticed that it uses "i $i("  all over the place. Testing in terminal seems like this does the same thing as "do $i()". Is there a difference between these two (and if not is there some interesting history around this)?

7 Comments
讨论 (7)5
登录或注册以继续
问题
· 四月 2, 2024

Importing HealthShare WSDLs to SoapUI not working for several reasons (no authentication? linked resource not available?)

I'm currently fighting with SoapUI to get the HS WSDLs imported.

My first issue is, the IRISUsername and IRISPassword parameters don't seem to work.

i've tried the following url:

https://ifwap0661.ad.klinik.xxxyyy.de/ucrdev/csp/healthshare/hsrepositor...

result:
Error loading: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: The entity name must immediately follow the '&' in the entity reference.   

not entirely sure what is happening here.

if i enter the URL in a browser i'm required to still authenticate with user / pw, so i guess the Username & Password parameter somehow isn't working?

Second issue:

I downloaded the WSDL from the browser and saved it locally, to then import it into SoapUI, which also does not work:
Error loading [http://www.intersystems.com:80/healthshare/ihe/schema/IHE/XDS.b_Document... org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: Element type "link" must be followed by either attribute specifications, ">" or "/>".  

going to http://www.intersystems.com:80/healthshare/ihe/schema/IHE/XDS.b_Document... doesn't seem to provide the required document.

have these been moved? are there new WSDLs provided somewhere?

1 Comment
讨论 (1)2
登录或注册以继续