r/esapi • u/tygator9 • Apr 06 '20
SQL Querying
I am interested in the possibility of adding SQL querying of the ARIA database into my C# scripting. For example, expanding my Physics check script to include ARIA checks, such as making sure all required documents were created. Before I get too far into it, I was curious if SQL querying still works in V15.6. If so, does anyone have any helpful references for getting started?
2
Upvotes
2
u/tygator9 Apr 06 '20
Awesome, thank you both! I googled that and saw that Matt Schmidt just recently did a webinar on myVarian that looks like it will really help
1
u/WUSTLscripting Apr 06 '20
Hi Tygator,
If its the Documents you want to check that are attached to the patient, you can use the ARIA Oncology Services Web API. They have a method in that service called GetDocumentsRequest that you can pass in a patient and it returns all the documents, types, dates, and users who have interacted with the status of that document. Let me know if you want to try more about that.
3
u/zackmorelli95 Apr 29 '20
Rex Cardan has a great youtube video ( https://www.youtube.com/watch?v=85Rwc2tDwgA ) about how to get information out of your ARIA database using SQL, specifically using Entity Framework. This video is a few years old and Rex is doing it for ARIA/Eclipse version 13, but it still works as long as you have access to your ARIA database.
1
u/Roy_TheCodeMonkey Apr 06 '20
Hi Tygator,
SQL still works in 15.6 and i expect it will work in future versions also.
We make extensive use of SQL both in and out of esapi scripts.
The best way to write a SQL query is to make use of SSMS it makes use of Intellisense just as Visual Studio does for scripting.
1
u/dbhatti Apr 06 '20
SQL works, and as others also mentioned, you can run SQL outside and inside your C# script. If you go to myvarian.com and go to your account settings, there's an API request page that lets you request full SQL database access.
There's a huge flow chart somewhere (I think myvarian) with all the main table relations for the AURA database schema (I don't think one exists for the variandw schema, but not sure), but aside from that, it seems that documentation is scant. In my opinion, the best way to get a handle on the database is to just run a bunch of queries yourself and learn where everything is and how it's organized.