#ifndef SDCMFINDSCUDATACALLBACK_H
#define SDCMFINDSCUDATACALLBACK_H

#include "dcmtk/dcmnet/dfindscu.h"
#include "dcmtk/oflog/oflog.h"

#include "SDCMCommonStructure.h"


#include <list>
#include <vector>
using namespace std;




class SDCMFindSCUDataCallback : public DcmFindSCUCallback
{
public:
    //SDCMFindSCUDataCallback();

    SDCMFindSCUDataCallback(
      DcmFindSCUExtractMode extractResponses,
      int cancelAfterNResponses,
      const char *outputDirectory = NULL,
      STD_NAMESPACE ofstream *outputStream = NULL,
      const unsigned int limitOutput = 0);


    /// destructor
    virtual ~SDCMFindSCUDataCallback();



    virtual void callback(
          T_DIMSE_C_FindRQ *request,
          int& responseCount,
          T_DIMSE_C_FindRSP *rsp,
          DcmDataset *responseIdentifiers);

    void AddView(WORD wGroup, WORD wElement);

    int GetWorklistSize();

    void Clear();

    void ReadSequence(DcmElement* pElement, WorklistResponseData* wr);

    //CSList<WorklistResponseData, TRUE>* GetWorklistData();
    //vector<WorklistResponseData>* GetWorklistData();

    vector<CSDCM*>* GetDCMDumpList();

    void SetWorklistData(vector<WorklistResponseData>* pWorklistData);
    void SetWorklistDump(vector<CSDCM*>* pDCMDump);

    int CharacterSetConversion(DcmItem* pDcmItem, OFString strEnc);

    int ConvertPatientName(DcmElement* pElement, OFString strConv);

    OFString FindCharacterSet(DcmItem* pDcmItem);
protected:
    vector<SDCM_GROUP_ELEMENT>* m_pViewReservedList;

    vector<WorklistResponseData>* m_pDCMViewList;
    vector<CSDCM*>* m_pDCMDumpList;

    OFLogger* m_pLogger;

};

#endif // SDCMFINDSCUDATACALLBACK_H
