Update RunMedQA.

This commit is contained in:
sdk-team
2021-04-17 02:36:08 +00:00
parent ed4870b066
commit b972642ffe
7 changed files with 159 additions and 31 deletions

View File

@@ -27,26 +27,15 @@ RunMedQARequest::RunMedQARequest() :
RunMedQARequest::~RunMedQARequest()
{}
std::string RunMedQARequest::getQuestion()const
std::string RunMedQARequest::getSessionId()const
{
return question_;
return sessionId_;
}
void RunMedQARequest::setQuestion(const std::string& question)
void RunMedQARequest::setSessionId(const std::string& sessionId)
{
question_ = question;
setBodyParameter("Question", question);
}
std::string RunMedQARequest::getOrgId()const
{
return orgId_;
}
void RunMedQARequest::setOrgId(const std::string& orgId)
{
orgId_ = orgId;
setBodyParameter("OrgId", orgId);
sessionId_ = sessionId;
setBodyParameter("SessionId", sessionId);
}
std::string RunMedQARequest::getOrgName()const
@@ -60,3 +49,81 @@ void RunMedQARequest::setOrgName(const std::string& orgName)
setBodyParameter("OrgName", orgName);
}
std::vector<RunMedQARequest::AnswerImageDataList> RunMedQARequest::getAnswerImageDataList()const
{
return answerImageDataList_;
}
void RunMedQARequest::setAnswerImageDataList(const std::vector<AnswerImageDataList>& answerImageDataList)
{
answerImageDataList_ = answerImageDataList;
for(int dep1 = 0; dep1!= answerImageDataList.size(); dep1++) {
auto answerImageDataListObj = answerImageDataList.at(dep1);
std::string answerImageDataListObjStr = "AnswerImageDataList." + std::to_string(dep1 + 1);
setParameter(answerImageDataListObjStr + ".AnswerImageData", answerImageDataListObj.answerImageData);
}
}
std::vector<RunMedQARequest::AnswerTextList> RunMedQARequest::getAnswerTextList()const
{
return answerTextList_;
}
void RunMedQARequest::setAnswerTextList(const std::vector<AnswerTextList>& answerTextList)
{
answerTextList_ = answerTextList;
for(int dep1 = 0; dep1!= answerTextList.size(); dep1++) {
auto answerTextListObj = answerTextList.at(dep1);
std::string answerTextListObjStr = "AnswerTextList." + std::to_string(dep1 + 1);
setParameter(answerTextListObjStr + ".AnswerText", answerTextListObj.answerText);
}
}
std::string RunMedQARequest::getDepartment()const
{
return department_;
}
void RunMedQARequest::setDepartment(const std::string& department)
{
department_ = department;
setBodyParameter("Department", department);
}
std::vector<RunMedQARequest::AnswerImageURLList> RunMedQARequest::getAnswerImageURLList()const
{
return answerImageURLList_;
}
void RunMedQARequest::setAnswerImageURLList(const std::vector<AnswerImageURLList>& answerImageURLList)
{
answerImageURLList_ = answerImageURLList;
for(int dep1 = 0; dep1!= answerImageURLList.size(); dep1++) {
auto answerImageURLListObj = answerImageURLList.at(dep1);
std::string answerImageURLListObjStr = "AnswerImageURLList." + std::to_string(dep1 + 1);
setParameter(answerImageURLListObjStr + ".AnswerImageURL", answerImageURLListObj.answerImageURL);
}
}
std::string RunMedQARequest::getQuestionType()const
{
return questionType_;
}
void RunMedQARequest::setQuestionType(const std::string& questionType)
{
questionType_ = questionType;
setBodyParameter("QuestionType", questionType);
}
std::string RunMedQARequest::getOrgId()const
{
return orgId_;
}
void RunMedQARequest::setOrgId(const std::string& orgId)
{
orgId_ = orgId;
setBodyParameter("OrgId", orgId);
}

View File

@@ -40,16 +40,38 @@ void RunMedQAResult::parse(const std::string &payload)
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["Answer"].isNull())
data_.answer = dataNode["Answer"].asString();
auto allSimilarQuestion = dataNode["SimilarQuestion"]["SimilarQuestion"];
for (auto value : allSimilarQuestion)
data_.similarQuestion.push_back(value.asString());
if(!dataNode["Reports"].isNull())
data_.reports = dataNode["Reports"].asString();
if(!dataNode["QuestionType"].isNull())
data_.questionType = dataNode["QuestionType"].asString();
if(!dataNode["AnswerType"].isNull())
data_.answerType = dataNode["AnswerType"].asString();
if(!dataNode["Question"].isNull())
data_.question = dataNode["Question"].asString();
if(!dataNode["SessionId"].isNull())
data_.sessionId = dataNode["SessionId"].asString();
auto allOptions = dataNode["Options"]["options"];
for (auto value : allOptions)
data_.options.push_back(value.asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
}
std::string RunMedQAResult::getMessage()const
{
return message_;
}
RunMedQAResult::Data RunMedQAResult::getData()const
{
return data_;
}
std::string RunMedQAResult::getCode()const
{
return code_;
}