|
|
|
@ -99,7 +99,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
// 记录大模型的流转记录
|
|
|
|
|
buildAiCirculationDetail(circulationList, answer, medicalRec);
|
|
|
|
|
// 保存消息到记录表
|
|
|
|
|
saveQaRecord(process.getId(), 2, question, null, answer, circulationList);
|
|
|
|
|
saveQaRecord(process.getId(), medicalRec, 2, question, null, answer, circulationList);
|
|
|
|
|
return answer;
|
|
|
|
|
}
|
|
|
|
|
QaSimilarityQuestionAnswer similarityResult = first.get();
|
|
|
|
@ -115,7 +115,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
String answer = aiService.talk(question, medicalRec.getMedicalRecordAi());
|
|
|
|
|
// 记录流转记录
|
|
|
|
|
buildAiCirculationDetail(circulationList, answer, medicalRec);
|
|
|
|
|
saveQaRecord(process.getId(), 2, question, null, answer, circulationList);
|
|
|
|
|
saveQaRecord(process.getId(), medicalRec, 2, question, null, answer, circulationList);
|
|
|
|
|
return answer;
|
|
|
|
|
}
|
|
|
|
|
// 根据对应的标准问题,从标准问题表中找到标准问题
|
|
|
|
@ -130,7 +130,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
String answer = aiService.talk(question, medicalRec.getMedicalRecordAi());
|
|
|
|
|
// 记录流转记录
|
|
|
|
|
buildAiCirculationDetail(circulationList, answer, medicalRec);
|
|
|
|
|
saveQaRecord(process.getId(), 2, question, null, answer, circulationList);
|
|
|
|
|
saveQaRecord(process.getId(), medicalRec, 2, question, null, answer, circulationList);
|
|
|
|
|
return answer;
|
|
|
|
|
}
|
|
|
|
|
// 根据问题找这个病历配置的答案
|
|
|
|
@ -146,7 +146,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
String answer = aiService.talk(question, medicalRec.getMedicalRecordAi());
|
|
|
|
|
// 记录流转记录
|
|
|
|
|
buildAiCirculationDetail(circulationList, answer, medicalRec);
|
|
|
|
|
saveQaRecord(process.getId(), 2, question, null, answer, circulationList);
|
|
|
|
|
saveQaRecord(process.getId(), medicalRec, 2, question, null, answer, circulationList);
|
|
|
|
|
return answer;
|
|
|
|
|
}
|
|
|
|
|
// 如果找到了,就走病历配置的内容回答
|
|
|
|
@ -165,7 +165,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
.matchQuestion(similarityResult.getMatchQuestion())
|
|
|
|
|
.successType(1)
|
|
|
|
|
.build());
|
|
|
|
|
saveQaRecord(process.getId(), 1, question, similarityResult.getLibraryQuestionId(), patientAnswer, circulationList);
|
|
|
|
|
saveQaRecord(process.getId(), medicalRec, 1, question, similarityResult.getLibraryQuestionId(), patientAnswer, circulationList);
|
|
|
|
|
return patientAnswer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -178,7 +178,7 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void saveQaRecord(String processId, Integer matchType, String question, String libraryId, String answer, List<AskCirculationDetail> circulationList) {
|
|
|
|
|
private void saveQaRecord(String processId, MedicalRec medicalRec, Integer matchType, String question, String libraryId, String answer, List<AskCirculationDetail> circulationList) {
|
|
|
|
|
DiagnosisQaRecord record = new DiagnosisQaRecord();
|
|
|
|
|
record.setProcessId(processId);
|
|
|
|
|
record.setMatchType(matchType);
|
|
|
|
@ -189,6 +189,8 @@ public class AskServiceImpl implements AskService {
|
|
|
|
|
record.insert();
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
|
|
circulationList.forEach(e -> {
|
|
|
|
|
e.setProcessId(processId);
|
|
|
|
|
e.setMedicalId(medicalRec.getId());
|
|
|
|
|
e.setRecordId(record.getId());
|
|
|
|
|
e.setCirculationNo(atomicInteger.incrementAndGet());
|
|
|
|
|
e.setQuestion(question);
|
|
|
|
|