NetReceiveNSetRequest Example for Delphi
procedure TForm1.LEADDicomNet1NetReceiveNSetRequest(ASender: TObject;
hNet: Integer; nPresentationID, nMessageID: Smallint; const pszClass,
pszInstance: WideString; hDS: Integer);
var
nRet: Integer;
NewNode: TTreeNode;
strName: String;
begin
NewNode:= TreeView1.Items.Add(TreeView1.Selected, 'Command Set - ' + 'N-SET-REQUEST');
NewNode.MakeVisible();
TreeView1.Items.Add(NewNode, 'Presentation ID: ' + IntToStr(nPresentationID));
TreeView1.Items.Add(NewNode, 'Message ID: ' + IntToStr(nMessageID));
nRet:= LEADDicomDS1.FindUID (pszClass);
if(nRet = 0)then
begin
strName:= LEADDicomDS1.DefaultInterface.Get_CurrentUID().Name;
TreeView1.Items.Add(NewNode, 'Affected SOP Class: ' + strName + ' - ' + pszClass);
end
else
TreeView1.Items.Add(Newnode, 'Affected SOP Class: ' + pszClass);
TreeView1.Items.Add(NewNode, 'Affected SOP Instance: ' + pszInstance);
//this function will change the values of the requested SOP Instance
//to the values specefied in the data set elements in hDS
//this function should search all the managed SOP Instances for a
//match, and then change the requested elements.
//This is a function you must write
//nRet:= PerformNSETCommand(pszClass, pszInstance, hDS)
if(nRet <> DICOM_SUCCESS)then
nRet:= COMMAND_STATUS_NO_SUCH_OBJECT_INSTANCE;
//send a response
LEADDICOMNet1.SendNSetResponse(hNet, nPresentationID, nMessageID, pszClass, pszInstance, nRet, 0);
end;