#ifndef C_BDM_FREEBASEPLUGIN_H
#define C_BDM_FREEBASEPLUGIN_H


#include "../C_BaseCommon.h"
#include "../../MedinTuxTools-QT4/medicabase/C_DBVar.h"
#include "../../MedinTuxTools-QT4/medicabase/C_BDM_Api.h"
#include <QObject>

class QSqlQuery;

class C_BDM_FreeBasePlugin : public C_BDM_PluginI
{
    Q_OBJECT
public:
     C_BDM_FreeBasePlugin(QObject *parent = 0);
    ~C_BDM_FreeBasePlugin();
    //------------------ INTERFACE VIRTUELLE -----------------
    int                   connect(const QString &params);
    //.................. liste des medicaments ................
    long                  drugsList_Count();
    int                   getDrugList_Start();
    int                   getDrugList_NextRecord(C_BDM_DrugListRecord &rC_BDM_DrugListRecord);
    //.................. liste des Smr ........................
    int                   smrList_Count();
    int                   getSmrList_Start();
    int                   getSmrList_NextRecord (C_BDM_SmrListRecord  &rC_BDM_SmrListRecord);

    //------------------ INTERFACE IMPLEMENTEE -----------------

private:
   QString cip_to_price(const QString &cip);
   QString get_CIS_From_CIP(const QString &cip);
   QString cip_to_libelle_atc(const QString &cip);
private:
   QSqlQuery *m_pQSqlQuery;
   int        m_position;
};


#endif // C_BDM_FREEBASEPLUGIN_H
