DicomFileInsert event (ILEADDicomDirEvents Interface)

VB.NET example

C# example

Visual Basic example

Visual C++ 6.0 example

 

Syntax

void DicomFileInsert (BSTR bstrFileName, long hDicomDS, short nStatus, short* pReturnVal);

Overview

Refer to Creating DICOM Directories.

Remarks

This event is fired for each file enumerated by the InsertDicomFile method.

If the parameter passed to the InsertDicomFile method is NULL, then all files in the destination folder will be enumerated. If the IncludeSubfolders property is set to VARIANT_TRUE before calling the InsertDicomFile method, then all the files in the destination folder root and all files in all the subfolders of the destination folder will be enumerated. For each file, the DicomFileInsert event is fired once or twice:

image\sqrblit.gif The event is fired first just after trying to load the Data Set in the file and before actually adding the file to the Dicom Directory. If the Data Set was loaded successfully, the parameter hDicomDS specifies the loaded Data Set and the parameter nStatus is set to DICOMDIR_INSERTDICOMFILE_PREADD. To skip the addition of the file, the variable pointed to by pReturnVal should be set to DICOM_ERROR_FORMAT. If the Data Set wasn’t loaded successfully, the parameter hDicomDS is set to 0 and the parameter nStatus is set to an error code.

image\sqrblit.gif The event is fired the second time just after trying to add the loaded Data Set to the DICOM Directory. The parameter hDicomDS specifies the loaded Data Set. If the Data Set was added successfully, the parameter nStatus is set to DICOM_SUCCESS. Otherwise, it is set to an error code. The event will not be fired this second time if a loading failure was reported during the first firing of the event, or the file addition was skipped during the first firing of the event.

If the variable pointed to by pReturnVal is set to a value other than DICOM_SUCCESS or DICOM_ERROR_FORMAT, the InsertDicomFile method will stop adding new files and will return the same value. Therefore, to keep adding the DICOM files, this variable should be set to DICOM_SUCCESS (or left as is), or set to DICOM_ERROR_FORMAT if only the current file is to be skipped (which can be done during the first firing of the event).

The InsertDicomFile method will stop adding new files if an error occurred and it will return an error value.

See Also

Elements:

InsertDicomFile method

Topics:

DICOM Elements: DICOM Directories