|
@@ -1,12 +1,17 @@
|
|
|
package com.lantone.qc.kernel.catalogue.leavehospital;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
+import com.lantone.qc.kernel.client.ChiefPresentSimilarityServiceClient;
|
|
|
+import com.lantone.qc.kernel.structure.ai.ModelAI;
|
|
|
+import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.OutputInfo;
|
|
|
import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
|
|
|
import com.lantone.qc.pub.model.entity.Diag;
|
|
|
import com.lantone.qc.pub.model.label.DiagLabel;
|
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -20,6 +25,8 @@ import java.util.List;
|
|
|
*/
|
|
|
@Component
|
|
|
public class LEA0146 extends QCCatalogue {
|
|
|
+ @Autowired
|
|
|
+ ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient;
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
status.set("0");
|
|
|
if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getLeaveHospitalDoc() != null) {
|
|
@@ -46,7 +53,28 @@ public class LEA0146 extends QCCatalogue {
|
|
|
putDiagToList(beHospitalizedDoc.getSuppleDiagLabel().getDiags(), beHospitalDiag); //其他诊断
|
|
|
}
|
|
|
|
|
|
- if (!leaveDiags.containsAll(beHospitalDiag)) {
|
|
|
+ String infoStr = "";
|
|
|
+ int matchSum = 0;
|
|
|
+ ModelAI modelAI = new ModelAI();
|
|
|
+ for (String beDiag : beHospitalDiag) {
|
|
|
+ JSONArray jsonArray = modelAI.loadChiefPresentSimilarAI(beDiag, leaveDiags, false
|
|
|
+ , "diagnose", chiefPresentSimilarityServiceClient);
|
|
|
+ if (jsonArray.size() == 2) {
|
|
|
+ /* 相似度最高诊断 */
|
|
|
+ String symptom = jsonArray.getString(0);
|
|
|
+ /* 相似度分数 */
|
|
|
+ double likeRate = jsonArray.getDoubleValue(1);
|
|
|
+ if (likeRate > 0.85) {
|
|
|
+ matchSum++;
|
|
|
+ } else {
|
|
|
+ infoStr = CatalogueUtil.concatInfo(infoStr, beDiag);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ infoStr = CatalogueUtil.concatInfo(infoStr, beDiag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ info.set(infoStr);
|
|
|
+ if (matchSum != beHospitalDiag.size()) {
|
|
|
status.set("-1");
|
|
|
}
|
|
|
}
|
|
@@ -54,7 +82,7 @@ public class LEA0146 extends QCCatalogue {
|
|
|
|
|
|
private void putDiagToList(List<Diag> diagList, List<String> beHospitalDiag) {
|
|
|
for (Diag diag : diagList) {
|
|
|
- beHospitalDiag.add(diag.getName());
|
|
|
+ beHospitalDiag.add(diag.getHospitalDiagName());
|
|
|
}
|
|
|
}
|
|
|
}
|