Patient Volume associated with Primary Reference Point

Dec 16, 2015 at 2:33 PM

I am currently doing some plan scripting with Eclipse Version 11. I am basically trying to use it to aid our treatment planning/checking procedures. I am trying to see what objects I can read/extract from a plan in Eclipse and then use it to compare with a predefined value. Anyway, I was wondering if it was possible to read/extract the patient volume that is associated with the primary reference point? It’s possible to read the primary reference point but the patient volume that it’s linked to doesn’t come across. And I can’t seem to find a link to it or any syntax in the help file. One of our plan checks here is to check that the patient volume associated with the primary reference point is the same as the target volume.

Many thanks in advance
Dec 17, 2015 at 9:13 PM
Unfortunate, it is currently not possible to retrieve the patient volume info that is associated with a reference point. However, the ID of the default primary reference point should correspond to the target volume. You may be able to do some limited check with the point ID or name info.

Jan 5, 2016 at 2:38 PM

The ID of the default primary reference point is just the name of the default primary reference point. It does not correspond to the target volume as you say. The target volume and the ID are independent.

Thanks anyway
Jun 16, 2016 at 8:27 PM
Edited Jun 16, 2016 at 8:32 PM
I've managed this with a ARIA database query within the c# script for the purposes of our plan checking. Here's the code, and yes I know it's sloppy! It would need to be adapted to your needs. Apologies if I necro'd this thread but it might be useful for people trying to do this in the future.
  PlanSetup ps  = context.PlanSetup;
  Course course = context.Course;
  Patient p = context.Patient; 

string connectionString = "Server=[YOURARIAROSERVER];Database=variansystem;User Id=[USERID];Password=[PASSWORD];";

string queryString = "SELECT distinct pv.PatientVolumeId,rp.PatientVolumeSer,rp.RefPointId,s.StructureSetSer, pv.PatientSer, s.StructureSer, s.Status, v.VolumeType,  pv.PatientVolumeSer, pv.PatientVolumeName, s.MaterialCTValue "+ 
"FROM Structure s, PatientVolume pv, VolumeType v, PlanSetup psu, Patient p, Course c, RefPoint rp, RadiationRefPoint rrp, RTPlan rtp " + 
"where s.PatientVolumeSer = pv.PatientVolumeSer " + 
"and pv.VolumeTypeSer = v.VolumeTypeSer " +  
"and s.StructureSetSer = psu.StructureSetSer " +
"AND pv.PatientSer = p.PatientSer " +
"and p.PatientId = '" + patient.Id.ToString() + "' " +
"and psu.CourseSer = c.CourseSer " +
"and c.CourseId = '" + course.Id.ToString() + "' " +
"and psu.PlanSetupId = '" + ps.Id.ToString() + "' " +
"and rrp.RTPlanSer = rtp.RTPlanSer " +
"and rtp.PlanSetupSer = psu.PlanSetupSer " +
"and rp.RefPointSer = rrp.RefPointSer " +
"and rp.RefPointId = '" + ps.PrimaryReferencePoint.Id.ToString() + "' " +
"and rp.PatientVolumeSer = pv.PatientVolumeSer";

 using (SqlConnection connection = new SqlConnection(connectionString))
using (SqlCommand cmd = new SqlCommand(queryString, connection))
   DataRow[] currentRows;
   DataTable table = new DataTable();
   using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

   currentRows = table.Select(null, null, DataViewRowState.CurrentRows);
   foreach (DataRow row in currentRows)
        if (row[0].ToString() != ps.TargetVolumeID.ToString())
              return new ReportLine(id, "Check passes, however primary ref point volume "+ 
              row[0].ToString() +  " does not reference the plan target volume " +
              ps.TargetVolumeID.ToString() + ". This will cause approval warnings.", 2);
Jul 7, 2016 at 3:25 PM
Thanks for this. However, we are having trouble logging in to the SQL database. Standard Eclipse logins don't seem to work. What would you suggest?

Thanks in advance
Jul 7, 2016 at 3:39 PM
The SQL database has its own login credentials (i.e. not ARIA login). That would have to be set up by your IT department or possibly your Varian rep. Try 'reports', 'reports'. That MIGHT work..