translation improvement 6
This commit is contained in:
@@ -1,62 +1,68 @@
|
||||
#include "patientinformationform.h"
|
||||
#include "ui_patientinformationform.h"
|
||||
#include "json/cJSON.h"
|
||||
PatientInformationForm::PatientInformationForm(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::PatientInformationForm)
|
||||
#include "event/EventCenter.h"
|
||||
|
||||
PatientInformationForm::PatientInformationForm(QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::PatientInformationForm)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->lbl_ID->setText("");
|
||||
ui->lbl_Date->setText("");
|
||||
ui->lbl_Name->setText("");
|
||||
ui->lbl_Sex->setText("");
|
||||
ui->lbl_Acc->setText("");
|
||||
ui->setupUi(this);
|
||||
//ui->lbl_ID->setText(tr(""));
|
||||
//ui->lbl_Date->setText(tr(""));
|
||||
//ui->lbl_Name->setText(tr(""));
|
||||
//ui->lbl_Sex->setText(tr(""));
|
||||
//ui->lbl_Acc->setText(tr(""));
|
||||
|
||||
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
||||
ui->retranslateUi(this);
|
||||
});
|
||||
}
|
||||
|
||||
PatientInformationForm::~PatientInformationForm()
|
||||
{
|
||||
delete ui;
|
||||
delete inf;
|
||||
delete jsonstr;
|
||||
delete ui;
|
||||
delete inf;
|
||||
delete jsonstr;
|
||||
}
|
||||
|
||||
void PatientInformationForm::setPatientInformation(PatientInformation* information) {
|
||||
ui->lbl_ID->setText(information->ID);
|
||||
ui->lbl_Date->setText(information->BirthDate);
|
||||
ui->lbl_Name->setText(information->Name);
|
||||
ui->lbl_Sex->setText(information->Sex);
|
||||
inf = information;
|
||||
ui->lbl_ID->setText(information->ID);
|
||||
ui->lbl_Date->setText(information->BirthDate);
|
||||
ui->lbl_Name->setText(information->Name);
|
||||
ui->lbl_Sex->setText(information->Sex);
|
||||
inf = information;
|
||||
}
|
||||
|
||||
void PatientInformationForm::setProtocol(int type) {
|
||||
currentProtocol = type;
|
||||
switch(type)
|
||||
{
|
||||
case 0:
|
||||
ui->lbl_Protocol->setText("LEFT ONLY");
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
ui->lbl_Protocol->setText("RIGHT ONLY");
|
||||
break;
|
||||
}
|
||||
currentProtocol = type;
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
ui->lbl_Protocol->setText(tr("LEFT ONLY"));
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
ui->lbl_Protocol->setText(tr("RIGHT ONLY"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const char *PatientInformationForm::getCurrentPatientJsonString(bool empty) {
|
||||
cJSON* root=cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(root, "PatientName",cJSON_CreateString(ui->lbl_Name->text().replace(' ','_').toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "PatientID",cJSON_CreateString(ui->lbl_ID->text().replace(' ','_').toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "PatientSex",cJSON_CreateString(ui->lbl_Sex->text().toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "PatientBirthDate",
|
||||
cJSON_CreateString(ui->lbl_Date->text().replace("/","").replace("-","").replace(' ','.').toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "Laterality",cJSON_CreateString(currentProtocol?"R":"L"));
|
||||
cJSON_AddItemToObject(root, "IsEmptyData",cJSON_CreateNumber(empty?1:0));
|
||||
cJSON_AddItemToObject(root, "OperatorName",cJSON_CreateString("Bob"));
|
||||
cJSON_AddItemToObject(root, "ReferringPhysicianName",cJSON_CreateString("XX"));
|
||||
cJSON_AddItemToObject(root, "InstitutionName",cJSON_CreateString("EQ9"));
|
||||
cJSON_AddItemToObject(root, "InstitutionAddress",cJSON_CreateString("HZ"));
|
||||
delete jsonstr;
|
||||
jsonstr = cJSON_Print(root);
|
||||
cJSON_Delete(root);
|
||||
return jsonstr;
|
||||
const char* PatientInformationForm::getCurrentPatientJsonString(bool empty) {
|
||||
cJSON* root = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(root, "PatientName", cJSON_CreateString(ui->lbl_Name->text().replace(' ', '_').toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "PatientID", cJSON_CreateString(ui->lbl_ID->text().replace(' ', '_').toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "PatientSex", cJSON_CreateString(ui->lbl_Sex->text().toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "PatientBirthDate",
|
||||
cJSON_CreateString(ui->lbl_Date->text().replace("/", "").replace("-", "").replace(' ', '.').toStdString().data()));
|
||||
cJSON_AddItemToObject(root, "Laterality", cJSON_CreateString(currentProtocol ? "R" : "L"));
|
||||
cJSON_AddItemToObject(root, "IsEmptyData", cJSON_CreateNumber(empty ? 1 : 0));
|
||||
cJSON_AddItemToObject(root, "OperatorName", cJSON_CreateString("Bob"));
|
||||
cJSON_AddItemToObject(root, "ReferringPhysicianName", cJSON_CreateString("XX"));
|
||||
cJSON_AddItemToObject(root, "InstitutionName", cJSON_CreateString("EQ9"));
|
||||
cJSON_AddItemToObject(root, "InstitutionAddress", cJSON_CreateString("HZ"));
|
||||
delete jsonstr;
|
||||
jsonstr = cJSON_Print(root);
|
||||
cJSON_Delete(root);
|
||||
return jsonstr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user