|
@@ -47,78 +47,66 @@ public class BeHospitalizedAI {
|
|
|
public void medrec(InputInfo inputInfo, CRFServiceClient crfServiceClient) {
|
|
|
JSONArray crfContent = new JSONArray();
|
|
|
BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
|
|
|
- String chief_text = beHospitalizedDoc.getChiefLabel().getText();
|
|
|
- String Personal_text = beHospitalizedDoc.getPersonalLabel().getText();
|
|
|
- String family_text = beHospitalizedDoc.getFamilyLabel().getText();
|
|
|
- String past_text = beHospitalizedDoc.getPastLabel().getText();
|
|
|
- String present_text = beHospitalizedDoc.getPresentLabel().getText();
|
|
|
- String pacs_text = beHospitalizedDoc.getPacsLabel().getText();
|
|
|
- //月经史
|
|
|
- String menstrual_text = beHospitalizedDoc.getMenstrualLabel().getText();
|
|
|
- //婚育史
|
|
|
- String marital_text = beHospitalizedDoc.getMaritalLabel().getText();
|
|
|
- //一般体格检查
|
|
|
- String vital_text = beHospitalizedDoc.getVitalLabel().getText();
|
|
|
- //专科体格检查
|
|
|
- String vitalSpecial_text = beHospitalizedDoc.getVitalLabelSpecial().getText();
|
|
|
- //主诉
|
|
|
- putContent(crfContent, medicalTextType.get(3), chief_text, Content.chief);
|
|
|
- //现病史
|
|
|
- putContent(crfContent, medicalTextType.get(3), present_text, Content.present);
|
|
|
- //专科检查
|
|
|
- putContent(crfContent, medicalTextType.get(3), vitalSpecial_text, Content.special_exam);
|
|
|
- //既往史
|
|
|
- putContent(crfContent, medicalTextType.get(1), past_text, Content.past);
|
|
|
- //家族史
|
|
|
- putContent(crfContent, medicalTextType.get(1), family_text, Content.family);
|
|
|
- //存放一般查体
|
|
|
- putContent(crfContent, medicalTextType.get(4), vital_text, Content.phys_exam);
|
|
|
- //个人史
|
|
|
- putContent(crfContent, medicalTextType.get(2), Personal_text, Content.personal);
|
|
|
- //月经史
|
|
|
- putContent(crfContent, medicalTextType.get(2), menstrual_text, Content.menses);
|
|
|
- //婚育史
|
|
|
- putContent(crfContent, medicalTextType.get(2), marital_text, Content.marriage);
|
|
|
- //辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改)
|
|
|
- putContent(crfContent, medicalTextType.get(3), pacs_text, Content.pacs);
|
|
|
- //存储CRF完整所需结构数据
|
|
|
- CRFVo crfVo = new CRFVo();
|
|
|
- crfVo.setData(crfContent);
|
|
|
- //获取CRF模型返回数据
|
|
|
- JSONArray data = getAnnotation(crfServiceClient, crfVo).getData();
|
|
|
- JSONObject midData = getOutputs(data);
|
|
|
- //处理主诉
|
|
|
- putChiefCrfData(midData.getJSONObject(Content.chief), inputInfo);
|
|
|
- //处理现病史
|
|
|
- putPresentCrfData(midData.getJSONObject(Content.present), inputInfo);
|
|
|
- //处理既往史
|
|
|
- putPastCrfData(midData.getJSONObject(Content.past), inputInfo);
|
|
|
- //处理个人史
|
|
|
- putPersonalCrfData(midData.getJSONObject(Content.personal), inputInfo);
|
|
|
- //处理月经史
|
|
|
- putMensesCrfData(midData.getJSONObject(Content.menses), inputInfo);
|
|
|
- //处理家族史
|
|
|
- putFamilyCrfData(midData.getJSONObject(Content.family), inputInfo);
|
|
|
- //处理婚育史
|
|
|
- putMaritalCrfData(midData.getJSONObject(Content.marriage), inputInfo);
|
|
|
- //处理初步诊断
|
|
|
- putInitialDiagCrfData(midData.getJSONObject(Content.pridiag), inputInfo);
|
|
|
- //处理辅助检查
|
|
|
- putPacsCrfData(midData.getJSONObject(Content.pacs), inputInfo);
|
|
|
- // //存放CRF模型既往史、家族史返回数据
|
|
|
- // putAllCrfData(midData.getJSONObject(Content.past), crfOut);
|
|
|
- // putAllCrfData(midData.getJSONObject(Content.family), crfOut);
|
|
|
- // //存放CRF模型一般查体(体格检查(一))返回数据
|
|
|
- // putAllCrfData(midData.getJSONObject(Content.phys_exam), crfOut);
|
|
|
- // //存放CRF模型个人史、月经史、婚育史返回数据
|
|
|
- // putAllCrfData(midData.getJSONObject(Content.personal), crfOut);
|
|
|
- // putAllCrfData(midData.getJSONObject(Content.menses), crfOut);
|
|
|
- // putAllCrfData(midData.getJSONObject(Content.marriage), crfOut);
|
|
|
- // //存放CRF模型病历特点、初步诊断、诊断依据返回数据
|
|
|
- // putAllCrfData(midData.getJSONObject(Content.case_feature), crfOut);
|
|
|
- // putAllCrfData(midData.getJSONObject(Content.pridiag), crfOut);
|
|
|
- // putAllCrfData(midData.getJSONObject(Content.diag_basis), crfOut);
|
|
|
- // return crfOut;
|
|
|
+ if(beHospitalizedDoc != null){
|
|
|
+ String chief_text = beHospitalizedDoc.getChiefLabel().getText();
|
|
|
+ String Personal_text = beHospitalizedDoc.getPersonalLabel().getText();
|
|
|
+ String family_text = beHospitalizedDoc.getFamilyLabel().getText();
|
|
|
+ String past_text = beHospitalizedDoc.getPastLabel().getText();
|
|
|
+ String present_text = beHospitalizedDoc.getPresentLabel().getText();
|
|
|
+ String pacs_text = beHospitalizedDoc.getPacsLabel().getText();
|
|
|
+ //月经史
|
|
|
+ String menstrual_text = beHospitalizedDoc.getMenstrualLabel().getText();
|
|
|
+ //婚育史
|
|
|
+ String marital_text = beHospitalizedDoc.getMaritalLabel().getText();
|
|
|
+ //一般体格检查
|
|
|
+ String vital_text = beHospitalizedDoc.getVitalLabel().getText();
|
|
|
+ //专科体格检查
|
|
|
+ String vitalSpecial_text = beHospitalizedDoc.getVitalLabelSpecial().getText();
|
|
|
+ //主诉
|
|
|
+ putContent(crfContent, medicalTextType.get(3), chief_text, Content.chief);
|
|
|
+ //现病史
|
|
|
+ putContent(crfContent, medicalTextType.get(3), present_text, Content.present);
|
|
|
+ //专科检查
|
|
|
+ putContent(crfContent, medicalTextType.get(3), vitalSpecial_text, Content.special_exam);
|
|
|
+ //既往史
|
|
|
+ putContent(crfContent, medicalTextType.get(1), past_text, Content.past);
|
|
|
+ //家族史
|
|
|
+ putContent(crfContent, medicalTextType.get(1), family_text, Content.family);
|
|
|
+ //存放一般查体
|
|
|
+ putContent(crfContent, medicalTextType.get(4), vital_text, Content.phys_exam);
|
|
|
+ //个人史
|
|
|
+ putContent(crfContent, medicalTextType.get(2), Personal_text, Content.personal);
|
|
|
+ //月经史
|
|
|
+ putContent(crfContent, medicalTextType.get(2), menstrual_text, Content.menses);
|
|
|
+ //婚育史
|
|
|
+ putContent(crfContent, medicalTextType.get(2), marital_text, Content.marriage);
|
|
|
+ //辅助检查(暂用主诉现病史模型,之后会新训练单独模型再做修改)
|
|
|
+ putContent(crfContent, medicalTextType.get(3), pacs_text, Content.pacs);
|
|
|
+ //存储CRF完整所需结构数据
|
|
|
+ CRFVo crfVo = new CRFVo();
|
|
|
+ crfVo.setData(crfContent);
|
|
|
+ //获取CRF模型返回数据
|
|
|
+ JSONArray data = getAnnotation(crfServiceClient, crfVo).getData();
|
|
|
+ JSONObject midData = getOutputs(data);
|
|
|
+ //处理主诉
|
|
|
+ putChiefCrfData(midData.getJSONObject(Content.chief), inputInfo);
|
|
|
+ //处理现病史
|
|
|
+ putPresentCrfData(midData.getJSONObject(Content.present), inputInfo);
|
|
|
+ //处理既往史
|
|
|
+ putPastCrfData(midData.getJSONObject(Content.past), inputInfo);
|
|
|
+ //处理个人史
|
|
|
+ putPersonalCrfData(midData.getJSONObject(Content.personal), inputInfo);
|
|
|
+ //处理月经史
|
|
|
+ putMensesCrfData(midData.getJSONObject(Content.menses), inputInfo);
|
|
|
+ //处理家族史
|
|
|
+ putFamilyCrfData(midData.getJSONObject(Content.family), inputInfo);
|
|
|
+ //处理婚育史
|
|
|
+ putMaritalCrfData(midData.getJSONObject(Content.marriage), inputInfo);
|
|
|
+ //处理初步诊断
|
|
|
+ putInitialDiagCrfData(midData.getJSONObject(Content.pridiag), inputInfo);
|
|
|
+ //处理辅助检查
|
|
|
+ putPacsCrfData(midData.getJSONObject(Content.pacs), inputInfo);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void putChiefCrfData(JSONObject jsonObject, InputInfo inputInfo) {
|