feat: add patient information json encrpt logic

This commit is contained in:
kradchen
2025-03-07 09:29:49 +08:00
parent bf68cfc532
commit 635891eabf

View File

@@ -25,6 +25,7 @@
#include "UsctStateManager.h"
#include "utilities/ScanProcessSequence.h"
#include "utilities/AlarmHelper.h"
#include "utilities/AESEncryptHelper.h"
#include "log/LogManager.h"
#include "forms/select/AccessionInformation.h"
@@ -873,7 +874,21 @@ DeviceStatus DeviceManager::getDeviceStatus()
bool DeviceManager::startFullScan(const QString& aPatientInfo)
{
mFullScanAction->setSendData(aPatientInfo);
QJsonDocument patientInfo = QJsonDocument::fromJson(aPatientInfo.toUtf8());
QJsonObject fullJson;
QJsonObject PatientInfoObj = patientInfo.object()["Patient Info"].toObject();
QJsonDocument patInfoJson(PatientInfoObj);
QString patInfStr = QString::fromUtf8(patInfoJson.toJson());
std::string cipherText = patInfStr.toStdString();
cipherText = AESEncryptHelper::encrypt(cipherText);
fullJson["Patient Info"] = QString::fromStdString(cipherText);
fullJson["mode"] = patientInfo.object()["mode"].toString();
fullJson["active report"] = patientInfo.object()["active report"].toString();
QString encryptedPatient = QString::fromUtf8(QJsonDocument(fullJson).toJson(QJsonDocument::Compact));
mFullScanAction->setSendData(encryptedPatient);
DmsSyncActionResult result = mFullScanAction->execute();
if(!result.mIsSucessful)
{