/**
 * Private slot for a submission
 * Removes whitespace and makes sure none of the fields are empty
 * Also checks if the health card number is properly formatted
 */
void AddPatientControl::_submitClicked()
{
    const QString& firstName	= _form->getFirstName().trimmed();
    const QString& lastName	= _form->getLastName().trimmed();
    const QString& hcn		= _form->getHealthCardNumber().trimmed();
    const QString& requiredCare = _form->getRequiredCare().trimmed();
    const QString& occuringCare = _form->getOccuringCare().trimmed();
    const QDate&   dateAdded    = _form->getDateAdded();

    if (!firstName.isEmpty() && !lastName.isEmpty() &&
	Convenience::correctHealthCardNumber(hcn) && !requiredCare.isEmpty())
    {
        if (_addingToBed)
        {
            if (!occuringCare.isEmpty())
            {
                emit submitClicked(firstName, lastName, hcn, requiredCare, dateAdded, occuringCare);
                _form->close();
            }
            else
            {
                _form->displayError();
            }
        }
        else
        {
            emit submitClicked(firstName, lastName, hcn, requiredCare, dateAdded);
            _form->close();
        }
    }
    else
    {
	_form->displayError();
    }
}
UpdateBedsControl::UpdateBedsControl()
{
    _form = new UpdateBedsForm();
    _waitingForFacilitiesList = false;
    _waitingForCurrentBeds = false;
    _waitingForMinBeds = false;
    connect(_form, SIGNAL(facilitySelected(int)), SLOT(_facilitySelected(int)));
    connect(_form, SIGNAL(submitClicked()), SLOT(_submitClicked()));
}
Beispiel #3
0
Programa::Programa(QWidget* parent)
: QDialog(parent)
{
	setupUi(this);

	connect(submitButton, SIGNAL(clicked()), SLOT(submitClicked()));
	connect(importButton, SIGNAL(clicked()), SLOT(importClicked()));
	connect(exportButton, SIGNAL(clicked()), SLOT(exportClicked()));
	connect(closeButton, SIGNAL(clicked()), SLOT(close()));
}
void UpdateBedsControl::_submitClicked()
{
    int index = _form->getCurrentFacilityIndex();
    QMap<int, Facility*>::const_iterator find = _indexToFacility.find(index);
    if (find != _indexToFacility.end())
    {
	emit submitClicked(find.value(), _form->getNumAC(),
			   _form->getNumCCC(), _form->getNumLTC());
    }
    _form->close();
}
Beispiel #5
0
search_dial::search_dial(QWidget *parent) :
    QDialog(parent)
{
    search_label=new QLabel("enter your search text");
    submitButton=new QPushButton("Search");
    cancelButton=new QPushButton("Cancel");
    search_editor=new QLineEdit;

    QVBoxLayout *main_layout=new QVBoxLayout();
    main_layout->addWidget(search_label,0,Qt::AlignCenter);
    main_layout->addWidget(search_editor);

    QHBoxLayout *buttons_layout=new QHBoxLayout();
    buttons_layout->addWidget(submitButton);
    buttons_layout->addWidget(cancelButton);

    main_layout->addLayout(buttons_layout);

    setLayout(main_layout);

    connect(submitButton, SIGNAL(clicked()), this, SLOT(submitClicked()));
}
AddPatientControl::AddPatientControl(bool addingToBed)
    : _addingToBed(addingToBed)
{
    _form = new AddPatientForm(addingToBed);
    connect(_form, SIGNAL(submitClicked()), SLOT(_submitClicked()));
}
void AddFacilityForm::_submitClicked()
{
    emit submitClicked();
}