feat: The gender information which in worklist and local patient table can translate.

This commit is contained in:
sunwen
2024-09-14 13:44:33 +08:00
parent 031f1a2a47
commit ea6a6e99e4
13 changed files with 245 additions and 188 deletions

View File

@@ -4,6 +4,7 @@
#include "event/EventCenter.h"
#include "json/ScanJson.h"
#include "models/User.h"
#include "utilities/GenderHelper.h"
PatientInformationForm::PatientInformationForm(QWidget* parent)
: QWidget(parent)
@@ -12,10 +13,13 @@ PatientInformationForm::PatientInformationForm(QWidget* parent)
, mStudyUID()
, mModality()
, mMPPSUID()
, mDicomGender()
{
mUI->setupUi(this);
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
mUI->retranslateUi(this);
if(!mUI->mScanProtocol->text().isEmpty()) setExecuteProtocol(mIsExecuteProtocolLeft);
mUI->mPatientGender->setText(GenderHelper::getStringfromDicomGender(mDicomGender));
});
}
@@ -31,7 +35,8 @@ void PatientInformationForm::setPatientInformation(PatientInformation* informati
mUI->mPatientID->setText(information->ID);
mUI->mPatientBirthday->setText(information->BirthDate);
mUI->mPatientName->setText(information->Name);
mUI->mPatientGender->setText(information->Sex == "F" ? tr("Female") : (information->Sex == "M" ? tr("Male") : tr("Other")));
mDicomGender = information->Sex;
mUI->mPatientGender->setText(GenderHelper::getStringfromDicomGender(mDicomGender));
}
else
{
@@ -43,6 +48,7 @@ void PatientInformationForm::setPatientInformation(PatientInformation* informati
mStudyUID.clear();
mModality.clear();
mMPPSUID.clear();
mDicomGender.clear();
}
}
@@ -67,17 +73,6 @@ int PatientInformationForm::getProtocol()
return mCurrentProtocol;
}
QString PatientInformationForm::getProtocolString(ScanProtocal aProtocal)
{
switch (aProtocal)
{
case RSTAND: return tr("RSTAND");
case LSTAND: return tr("LSTAND");
case LONE: return tr("LONE");
case RONE: return tr("RONE");
}
}
QString PatientInformationForm::getPatientID()
{
return mUI->mPatientID->text();
@@ -107,6 +102,7 @@ void PatientInformationForm::clear()
mStudyUID.clear();
mModality.clear();
mMPPSUID.clear();
mDicomGender.clear();
}
const char* PatientInformationForm::getCurrentPatientJsonString(bool empty)
@@ -115,7 +111,7 @@ const char* PatientInformationForm::getCurrentPatientJsonString(bool empty)
cJSON_AddItemToObject(patientInfoObject, "PatientName", cJSON_CreateString(mUI->mPatientName->text().toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "PatientID", cJSON_CreateString(mUI->mPatientID->text().toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "AccessionNumber", cJSON_CreateString(mUI->mPaitenAccessionNumber->text().toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "PatientSex", cJSON_CreateString(mUI->mPatientGender->text().toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "PatientSex", cJSON_CreateString(mDicomGender.toStdString().c_str()));
cJSON_AddItemToObject(patientInfoObject, "PatientBirthDate",
cJSON_CreateString(mUI->mPatientBirthday->text().replace("/", "").replace("-", "").replace(' ', '.').toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "Laterality", cJSON_CreateString(mIsExecuteProtocolLeft ? "L" : "R"));

View File

@@ -22,7 +22,6 @@ public:
void setPatientInformation(PatientInformation* information);
void setAccessionNumber(AccessionInformation* aAccession);
int getProtocol();
QString getProtocolString(ScanProtocal aProtocal);
void setExecuteProtocol(bool aIsLeft);
void clear();
@@ -37,6 +36,7 @@ private:
QString mStudyUID;
QString mModality;
QString mMPPSUID;
QString mDicomGender;
};
#endif // PATIENTINFORMATIONFORM_H