#ifndef FORMWORKLIST_H
#define FORMWORKLIST_H

#include <QWidget>

#include "common.h"

#include "dialogcalendar.h"
#include <QScrollArea>
#include "dialogprogress.h"
#include "sthreadworklistsearch.h"

#include <QTimer>

namespace Ui {
class FormWorklist;
}

class FormWorklist : public QWidget
{
    Q_OBJECT

public:
    explicit FormWorklist(QWidget *parent = nullptr);
    ~FormWorklist();

    virtual void Init();

    void CreateThreadWorklistSearch();

    void TerminateThreadWorklistSearch();

    void ErrorPatientInfo();



    void ClickSearchDateStartEnd();

protected:
    DialogProgress* m_pDialogSearchProgress;
    int m_nSearchDurationType;

public:
    virtual void resizeEvent(QResizeEvent *event);
    virtual void keyReleaseEvent(QKeyEvent *event);

signals:
    void Exit();

    void ChangeMenu(int);

public slots:
    void SetSearchDateUpdate(int nTypeSearchDuration);
    void worklistUpdateComplete();
    void worklistError();
    void SetWorklistProgress(int nValue);

    void OverTime();

private slots:
    void on_pushButton_DateStart_clicked();

    void on_pushButton_DateEnd_clicked();

    void on_pushButton_Execution_clicked();

    void on_pushButton_clicked();

    void on_plainTextEdit_PatientName_textChanged();

    void on_plainTextEdit_PatientID_textChanged();

    void on_pushButton_Emergency_clicked();

private:
    Ui::FormWorklist *ui;

    SThreadWorklistSearch* m_pThreadWorklistSearch;

    QTimer m_TimerSearch;


};

#endif // FORMWORKLIST_H
