Show / Hide Table of Contents

Class ClearCheckApi

The ClearCheckApi class allows other C# applications to call ClearCheck functionality in their standalone programs instead of using ClearCheck as an Eclipse plugin. Also you can use the ClearCheck API from your own Eclipse plugin.

Inheritance
System.Object
ClearCheckApi
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: ClearCheck.esapi.Api
Assembly: cs.temp.dll.dll
Syntax
public class ClearCheckApi : IDisposable
Examples

You can create the class instance within a using statement. Then set the patient context SetPatientContext(Patient, PlanningItem, PlanningItem), to add global templates to the patient AddDoseConstraintTemplateFromGlobalsUnapproved(String, String) or and set the selected patient templates SetDoseConstraintTemplate(String, String). Also you can remove templates which are not used DeleteDoseConstraintTemplate(String, String). After setting templates the user can generate a report GenerateReport(). and save the report results to a file using different formats SaveCsv(String), SaveJson(String) and SavePdf(String).

// create the Eclipse application instance
using (var application = VMS.TPS.Common.Model.API.Application.CreateApplication())
{
    // create the ClearCheck API instance
    using (var clearCheckApi = new ClearCheckApi(application))
    {
        // the patient ID for processing
        var patientId = "123456";

        // open the patient
        var patient = application.OpenPatientById(patientId);
        if (patient != null)
        {
            // get the plan by course ID and plan ID
            var courseId = "C1";
            var planId = "Prostate";
            PlanningItem plan = GetPlanningItem(patient, courseId, planId);
            if (plan != null)
            {
                // set the patient context
                clearCheckApi.SetPatientContext(patient, plan);

                // import templates from globals
                // or set available templates for
                // dose constraints, structure checks and plan checks
                //
                // add the dose constraints template from globals to patient
                clearCheckApi.AddDoseConstraintTemplateFromGlobalsApproved("Prostate");
                //
                // set the available structure checks template for the patient
                clearCheckApi.SetStructureCheckTemplate("Prostate");

                // generate report
                var success = clearCheckApi.GenerateReport();
                if (success)
                {
                    // save the report as a JSON file
                    clearCheckApi.SaveJson("123456_Prostate.JSON");
                }

                // print API log
                Console.WriteLine("API log for the patient report generation");
                foreach (var message in clearCheckApi.LogMessages)
                {
                    Console.WriteLine(message);
                }
            }
        }
    }
}

// Gets the plan for the patient by the course ID and plan ID.
private static PlanningItem GetPlanningItem(Patient patient, string courseId, string planId)
{
    // get course
    var course = patient.Courses.FirstOrDefault(c => c.Id == courseId);
    if (course == null)
    {
        Console.WriteLine(string.Format("'{0}' course has not been found", courseId));
        return null;
    }

    // get plan from plan setups
    PlanningItem plan = course.PlanSetups.FirstOrDefault(p => p.Id == planId);
    if (plan == null)
    {
        // get plan from plan sums
        plan = course.PlanSums.FirstOrDefault(p => p.Id == planId);
    }

    if (plan == null)
    {
        Console.WriteLine(string.Format("'{0}' plan has not been found", planId));
    }

    return plan;
}

Constructors

ClearCheckApi(Application)

Creates a new instance of the ClearCheckApi class.

Declaration
public ClearCheckApi(Application application)
Parameters
Type Name Description
Application application

The Eclipse Application instance.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when the application is null or when application.CurrentUser is null.

System.InvalidOperationException

Thrown when any error occurs.

ClearCheckApi(ScriptContext)

Creates a new instance of the ClearCheckApi class.

Declaration
public ClearCheckApi(ScriptContext scriptContext)
Parameters
Type Name Description
ScriptContext scriptContext

The Eclipse ScriptContext instance.

Examples

You can use the ClearCheck API from your own Eclipse ESAPI plugin. You can create the class instance within a using statement. Then set the patient context SetPatientContext(Patient, PlanningItem, PlanningItem), to add global templates to the patient AddDoseConstraintTemplateFromGlobalsUnapproved(String, String) or and set the selected patient templates SetDoseConstraintTemplate(String, String). Also you can remove templates which are not used DeleteDoseConstraintTemplate(String, String). After setting templates the user can generate a report GenerateReport() and save the report results to a file using different formats SaveCsv(String), SaveJson(String) and SavePdf(String).

namespace VMS.TPS
{
    public class Script
    {
        private ScriptContext context;

        public Script()
        {
        }

        public void Execute(ScriptContext context)
        {
            // ...
            try
            {
                Process(context);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
        }

        public void Process(ScriptContext context)
        {
            using (var clearCheckApi = new ClearCheckApi(context))
            {
                clearCheckApi.SetPatientContext(context.Patient, context.PlanSetup);

                // import templates from globals
                // or set available templates for
                // dose constraints, structure checks and plan checks
                //
                // add the dose constraints template from globals to patient
                clearCheckApi.AddDoseConstraintTemplateFromGlobalsApproved("Prostate");
                //
                // set the available structure checks template for the patient
                clearCheckApi.SetStructureCheckTemplate("Prostate");

                // generate report
                var success = clearCheckApi.GenerateReport();
                if (success)
                {
                    // save the report as a JSON file
                    clearCheckApi.SaveJson("123456_Prostate.JSON");
                }

                // print API log
                Console.WriteLine("API log for the patient report generation");
                foreach (var message in clearCheckApi.LogMessages)
                {
                    Console.WriteLine(message);
                }
            }
        }
    }
}
Exceptions
Type Condition
System.ArgumentNullException

Thrown when the scriptContext is null or when scriptContext.CurrentUser is null.

System.InvalidOperationException

Thrown when any error occurs.

Properties

CalculationMessages

Gets the error or warning messages which are generated while calculating template values.

Declaration
public List<string> CalculationMessages { get; }
Property Value
Type Description
System.Collections.Generic.List<System.String>

GlobalTemplates

Gets information about the global templates.

Declaration
public GlobalTemplatesInfo GlobalTemplates { get; }
Property Value
Type Description
GlobalTemplatesInfo

IsPlanError

Gets the value which indicates the plan contains an error message.

Declaration
public bool IsPlanError { get; }
Property Value
Type Description
System.Boolean

LogMessages

Gets the log messages which are generated for the patient.

Declaration
public List<string> LogMessages { get; }
Property Value
Type Description
System.Collections.Generic.List<System.String>

PatientTemplates

Gets the information about patient templates.

Declaration
public PatientTemplatesInfo PatientTemplates { get; }
Property Value
Type Description
PatientTemplatesInfo

PlanErrorMessage

Gets the plan error message.

Declaration
public string PlanErrorMessage { get; }
Property Value
Type Description
System.String

PlanToCompareErrorMessage

Gets the plan to compare error message.

Declaration
public string PlanToCompareErrorMessage { get; }
Property Value
Type Description
System.String

ReportGenerationTimeout

Gets or sets the timeout for the report generation.

Declaration
public TimeSpan ReportGenerationTimeout { get; set; }
Property Value
Type Description
System.TimeSpan

Methods

AddDoseConstraintTemplateFromGlobalsApproved(TemplateInfo)

Adds the Dose Constraint Template from globals to the patient as approved.

Declaration
public TemplateInfo AddDoseConstraintTemplateFromGlobalsApproved(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

The template info for the dose constraint template which is added.

Returns
Type Description
TemplateInfo

Template info for the dose constraint template which was added.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddDoseConstraintTemplateFromGlobalsApproved(String, String)
AddDoseConstraintTemplateFromGlobalsUnapproved(String, String)
AddDoseConstraintTemplateFromGlobalsUnapproved(TemplateInfo)

AddDoseConstraintTemplateFromGlobalsApproved(String, String)

Adds the Dose Constraint Template from globals to the patient as approved.

Declaration
public TemplateInfo AddDoseConstraintTemplateFromGlobalsApproved(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Returns
Type Description
TemplateInfo

Template info for the dose constraint template which was added.

Examples

You can add a global template to the patient templates after you set the patient context SetPatientContext(Patient, PlanningItem, PlanningItem), because it requires the plan structure set information. The added template will be set as active and it will be selected for generating the report.

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// add the dose constraints template from globals to the patient
TemplateInfo addedPatientTemplate = clearCheckApi.AddDoseConstraintTemplateFromGlobalsApproved("TemplateName", "TemplateFolder");

// generate report
var success = clearCheckApi.GenerateReport();
Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddDoseConstraintTemplateFromGlobalsApproved(TemplateInfo)
AddDoseConstraintTemplateFromGlobalsUnapproved(String, String)
AddDoseConstraintTemplateFromGlobalsUnapproved(TemplateInfo)

AddDoseConstraintTemplateFromGlobalsUnapproved(TemplateInfo)

Adds the Dose Constraint Template from globals to the patient as unapproved.

Declaration
public TemplateInfo AddDoseConstraintTemplateFromGlobalsUnapproved(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

The template info for the dose constraint template to add.

Returns
Type Description
TemplateInfo

Template info for the dose constraint template which was added.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddDoseConstraintTemplateFromGlobalsUnapproved(String, String)
AddDoseConstraintTemplateFromGlobalsApproved(String, String)
AddDoseConstraintTemplateFromGlobalsApproved(TemplateInfo)

AddDoseConstraintTemplateFromGlobalsUnapproved(String, String)

Adds the Dose Constraint Template from globals to the patient as unapproved.

Declaration
public TemplateInfo AddDoseConstraintTemplateFromGlobalsUnapproved(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Returns
Type Description
TemplateInfo

Template info for the dose constraint template which was added.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddDoseConstraintTemplateFromGlobalsUnapproved(TemplateInfo)
AddDoseConstraintTemplateFromGlobalsApproved(String, String)
AddDoseConstraintTemplateFromGlobalsApproved(TemplateInfo)

AddPlanCheckTemplateFromGlobals(TemplateInfo)

Adds the Plan Check Template from globals to the patient as approved.

Declaration
public TemplateInfo AddPlanCheckTemplateFromGlobals(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

The template info for the plan check template to add.

Returns
Type Description
TemplateInfo

Template info for the plan check template which was added.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddPlanCheckTemplateFromGlobals(String, String)

AddPlanCheckTemplateFromGlobals(String, String)

Adds the Plan Check Template from globals to the patient as approved.

Declaration
public TemplateInfo AddPlanCheckTemplateFromGlobals(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Returns
Type Description
TemplateInfo

Template info for the plan check template which was added.

Examples

You can add the global template to the patient templates after you set the patient context SetPatientContext(Patient, PlanningItem, PlanningItem), because it requires the plan data. The added template will be set as active and it will be selected for generating the report.

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// add the plan check template from globals to patient
TemplateInfo addedPatientTemplate = clearCheckApi.AddPlanCheckTemplateFromGlobals("TemplateName", "TemplateFolder");

// generate report
var success = clearCheckApi.GenerateReport();
Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddPlanCheckTemplateFromGlobals(TemplateInfo)

AddStructureCheckTemplateFromGlobalsApproved(TemplateInfo)

Adds the Structure Check Template from globals to the patient as approved.

Declaration
public TemplateInfo AddStructureCheckTemplateFromGlobalsApproved(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

The template info for the structure check template to add.

Returns
Type Description
TemplateInfo

Template info for the structure check template which was added.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddStructureCheckTemplateFromGlobalsApproved(String, String)
AddStructureCheckTemplateFromGlobalsUnapproved(String, String)
AddStructureCheckTemplateFromGlobalsUnapproved(TemplateInfo)

AddStructureCheckTemplateFromGlobalsApproved(String, String)

Adds the Structure Check Template from globals to the patient as approved.

Declaration
public TemplateInfo AddStructureCheckTemplateFromGlobalsApproved(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Returns
Type Description
TemplateInfo

Template info for the structure check template which was added.

Examples

You can add the global templates to the patient templates after you set the patient context SetPatientContext(Patient, PlanningItem, PlanningItem), because it requires the plan structure set data. The added template will be set as active and it will be selected for the generating the report.

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// add the structure checks template from globals to patient
TemplateInfo addedPatientTemplate = clearCheckApi.AddStructureCheckTemplateFromGlobalsApproved("TemplateName", "TemplateFolder");

// generate report
var success = clearCheckApi.GenerateReport();
Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddStructureCheckTemplateFromGlobalsApproved(TemplateInfo)
AddStructureCheckTemplateFromGlobalsUnapproved(String, String)
AddStructureCheckTemplateFromGlobalsUnapproved(TemplateInfo)

AddStructureCheckTemplateFromGlobalsUnapproved(TemplateInfo)

Adds the Structure Check Template from globals to the patient as unapproved.

Declaration
public TemplateInfo AddStructureCheckTemplateFromGlobalsUnapproved(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

The template info for the structure check template to add.

Returns
Type Description
TemplateInfo

Template info for the structure check template which was added.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddStructureCheckTemplateFromGlobalsUnapproved(String, String)
AddStructureCheckTemplateFromGlobalsApproved(String, String)
AddStructureCheckTemplateFromGlobalsApproved(TemplateInfo)

AddStructureCheckTemplateFromGlobalsUnapproved(String, String)

Adds the Structure Check Template from globals to the patient as unapproved.

Declaration
public TemplateInfo AddStructureCheckTemplateFromGlobalsUnapproved(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Returns
Type Description
TemplateInfo

Template info for the structure check template which was added.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
AddStructureCheckTemplateFromGlobalsApproved(String, String)
AddStructureCheckTemplateFromGlobalsApproved(TemplateInfo)
AddStructureCheckTemplateFromGlobalsUnapproved(TemplateInfo)

DeleteDoseConstraintTemplate(TemplateInfo)

Deletes the dose constraints template from the patient.

Declaration
public void DeleteDoseConstraintTemplate(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

The template info for the dose constraint template to delete.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
DeleteDoseConstraintTemplate(String, String)

DeleteDoseConstraintTemplate(String, String)

Deletes the dose constraint template from the patient.

Declaration
public void DeleteDoseConstraintTemplate(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
DeleteDoseConstraintTemplate(TemplateInfo)

DeletePlanCheckTemplate(TemplateInfo)

Deletes the plan check template from the patient.

Declaration
public void DeletePlanCheckTemplate(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

The template info for the plan check template to delete.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
DeletePlanCheckTemplate(String, String)

DeletePlanCheckTemplate(String, String)

Deletes the plan check template from the patient.

Declaration
public void DeletePlanCheckTemplate(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
DeletePlanCheckTemplate(TemplateInfo)

DeleteStructureCheckTemplate(TemplateInfo)

Deletes the structure check template from the patient.

Declaration
public void DeleteStructureCheckTemplate(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

The template info for the structure check template to delete.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
DeleteStructureCheckTemplate(String, String)

DeleteStructureCheckTemplate(String, String)

Deletes the structure check template from the patient.

Declaration
public void DeleteStructureCheckTemplate(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
DeleteStructureCheckTemplate(TemplateInfo)

Dispose()

Releases the resources which are associated with the instance.

Declaration
public void Dispose()

GenerateReport()

Generates the report.

Declaration
public bool GenerateReport()
Returns
Type Description
System.Boolean
Examples

You can generate the report after you set the patient context SetPatientContext(Patient, PlanningItem, PlanningItem).

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// generate report
var success = clearCheckApi.GenerateReport();
if (success)
{
    // save the report in JSON format
    clearCheckApi.SaveJson("123456_Prostate.json");
}
Exceptions
Type Condition
System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

OpenTemplateManager()

Opens the Template Manager Window for the patient.

Declaration
public void OpenTemplateManager()
Examples

You can open the ClearCheck Template Manager after you set the patient context SetPatientContext(Patient, PlanningItem, PlanningItem), because it requires the plan structure set data.

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// open the Template Manager
clearCheckApi.OpenTemplateManager();

SaveCsv(String)

Saves the generated report to a CSV file. The report should be generated using the GenerateReport() method before saving.

Declaration
public void SaveCsv(string fileName)
Parameters
Type Name Description
System.String fileName

The file path.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when fileName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

SaveJson(String)

Saves the generated report to a JSON file. The report should be generated using the GenerateReport() method before saving.

Declaration
public void SaveJson(string fileName)
Parameters
Type Name Description
System.String fileName

The file path.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when fileName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

SavePatientTemplates()

Saves the patient templates.

Declaration
public void SavePatientTemplates()
Examples

When you add templates to a patient from the globals or when you delete a template, you do it only at runtime. These changes will be used for the report generation, but they will not be saved for the patient automatically. You have invoke the SavePatientTemplates method in order to save the patient template changes.

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// add the dose constraint template from globals to patient
TemplateInfo addedPatientTemplate = clearCheckApi.AddDoseConstraintTemplateFromGlobalsApproved("TemplateName", "TemplateFolder");

// save patient templates
clearCheckApi.SavePatientTemplates();
Exceptions
Type Condition
System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

SavePdf(String)

Saves the generated report to a PDF file. The report should be generated using the GenerateReport() method before saving.

Declaration
public void SavePdf(string fileName)
Parameters
Type Name Description
System.String fileName

The file path.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when fileName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

SetDoseConstraintTemplate(TemplateInfo)

Sets the Dose Constraint Template for analysis.

Declaration
public void SetDoseConstraintTemplate(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

TemplateInfo.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent or it is inactive.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

SetDoseConstraintTemplate(String, String)

Sets the Dose Constraint Template for analysis.

Declaration
public void SetDoseConstraintTemplate(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Examples

Select the dose constraint template before the report generation.

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// set the "Default" dose constraint template for the report
clearCheckApi.SetDoseConstraintTemplate("Default");

// generate report
var success = clearCheckApi.GenerateReport();
Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent or it is inactive.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
SetDoseConstraintTemplate(TemplateInfo)

SetPatientContext(Patient, PlanningItem, PlanningItem)

Sets the patient context. See example in the class description ClearCheckApi

Declaration
public void SetPatientContext(Patient patient, PlanningItem plan, PlanningItem planToCompare = null)
Parameters
Type Name Description
Patient patient

Patient.

PlanningItem plan

The plan setup or plan sum for analysis.

PlanningItem planToCompare

The plan to compare.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when patient parameter is null or plan is null or plan type is not PlanSetup or PlanSum.

System.ObjectDisposedException

Thrown when the instance is disposed.

SetPlanCheckTemplate(TemplateInfo)

Sets the Plan Check Template for next calculations.

Declaration
public void SetPlanCheckTemplate(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

TemplateInfo.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error.

System.ObjectDisposedException

Thrown when the instance is disposed.

SetPlanCheckTemplate(String, String)

Sets the Plan Check Template for analysis.

Declaration
public void SetPlanCheckTemplate(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Examples

Select the plan check template before the report generation.

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// set the "Default" plan check template for the report
clearCheckApi.SetPlanCheckTemplate("Default");

// generate report
var success = clearCheckApi.GenerateReport();
Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
SetPlanCheckTemplate(TemplateInfo)

SetReportTemplate(String)

Sets the selected Report Template.

Declaration
public void SetReportTemplate(string templateName)
Parameters
Type Name Description
System.String templateName

Name of template.

Examples

Select the report template before the report generation.

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// set the "Default Landscape" report template for the report generation
clearCheckApi.SetReportTemplate("Default Landscape");

// generate report
var success = clearCheckApi.GenerateReport();
Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

SetStructureCheckTemplate(TemplateInfo)

Sets the Structure Check Template for analysis.

Declaration
public void SetStructureCheckTemplate(TemplateInfo templateInfo)
Parameters
Type Name Description
TemplateInfo templateInfo

TemplateInfo.

Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateInfo is null or templateInfo.TemplateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

SetStructureCheckTemplate(String, String)

Sets the Structure Check Template for analysis.

Declaration
public void SetStructureCheckTemplate(string templateName, string folderName = null)
Parameters
Type Name Description
System.String templateName

Name of template.

System.String folderName

Name of folder (optional).

Examples

Select the structure check template before the report generation.

// set patient context
clearCheckApi.SetPatientContext(patient, plan);

// set the "Default" structure check template for the report
clearCheckApi.SetStructureCheckTemplate("Default");

// generate report
var success = clearCheckApi.GenerateReport();
Exceptions
Type Condition
System.ArgumentException

Thrown when template is absent.

System.ArgumentNullException

Thrown when templateName is null.

System.InvalidOperationException

Thrown when any error occurs.

System.ObjectDisposedException

Thrown when the instance is disposed.

See Also
SetStructureCheckTemplate(TemplateInfo)

Implements

System.IDisposable
Back to top