StatusAll Class (original) (raw)
Summary
A class that represents all status-related elements that can be included in the command set of a DIMSE service response.
Example
This example shows how to override the DicomNet::OnReceiveCFindResponse event to read and display the status and related optional status elements in a DICOM command set.
using Leadtools.Dicom;
using Leadtools.Dicom.Common;
using Leadtools.Dicom.Common.Extensions;
using Leadtools;
using Leadtools.Dicom.Common.Linq.BasicDirectory;
using Leadtools.Dicom.Common.DataTypes;
using Leadtools.Dicom.Common.DataTypes.Status;
public class StatusAllDicomNet : DicomNet
{
public StatusAllDicomNet(string path, DicomNetSecurityMode mode) : base(path, mode)
{
}
public StatusAllDicomNet(string path, DicomNetSecurityMode mode, bool reserved) : base(path, mode, reserved)
{
}
protected override void OnReceiveCFindResponse(byte presentationID, int messageID, string affectedClass, DicomCommandStatusType status, DicomDataSet dataSet)
{
using (DicomDataSet cs = GetCommandSet())
{
StatusAll statusAll = new StatusAll();
statusAll = cs.Get<StatusAll>();
string friendlyString = string.Empty;
// Log the friendlyString giving the status and any status-related optional command set elements
friendlyString = statusAll.ToString();
Console.WriteLine(friendlyString);
// Log the friendlyString but ignore the status
friendlyString = statusAll.ToString(StatusFormatFlags.IgnoreStatus, "\n", "\t");
Console.WriteLine(friendlyString);
}
}
}
Leadtools.Dicom.Common Assembly