|
@@ -237,6 +237,7 @@ public class CaseFrontSheetMainService {
|
|
|
Integer days = DateUtil.daysBetween(sheet.getDismissDate(), sheet.getAdmissDate());
|
|
|
sheet.setAdmissDays(0 == days ? "1" : String.valueOf(days));
|
|
|
}
|
|
|
+ autoFillPart(sheet);
|
|
|
return ResultVoUtil.success(sheet);
|
|
|
}
|
|
|
int flag = overview.getInOutFlag();
|
|
@@ -306,9 +307,46 @@ public class CaseFrontSheetMainService {
|
|
|
sheet.setStandardAddress(standardAddressMember.makeStandardAddress());
|
|
|
sheet.setLivePlaceCombo(standardAddressMember.makeAddressCombo() + sheet.getLivePlace());
|
|
|
}
|
|
|
+ autoFillPart(sheet);
|
|
|
return ResultVoUtil.success(sheet);
|
|
|
}
|
|
|
|
|
|
+ private void autoFillPart(CaseFrontsheetMain sheet) {
|
|
|
+ String patNo = sheet.getBah();
|
|
|
+ int times = sheet.getAdmissTimes();
|
|
|
+ if (StringUtil.isBlank(sheet.getCaseClassification())) {
|
|
|
+ String blfxElement = dao.selectBlfxElement(patNo, times);
|
|
|
+ if (StringUtil.notBlank(blfxElement)) {
|
|
|
+ JSONObject blfxObj = JSONObject.parseObject(blfxElement);
|
|
|
+ JSONArray blfxArray = blfxObj.getJSONArray("病例分型");
|
|
|
+ if (null != blfxArray && blfxArray.size() > 0) {
|
|
|
+ JSONObject blfxItem = blfxArray.getJSONObject(0);
|
|
|
+ sheet.setCaseClassification(blfxItem.getString("code"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(sheet.getBacilliculture())) {
|
|
|
+ int bacillicultureCount = dao.selectBacillicultureCount(patNo, times);
|
|
|
+ sheet.setBacilliculture(bacillicultureCount > 0 ? "1" : "2");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(sheet.getStatutoryEpidemic())) {
|
|
|
+ Map<String, String> epidemic = dao.selectStatutoryEpidemic(patNo, times);
|
|
|
+ if (null != epidemic) {
|
|
|
+ if (StringUtil.notBlank(epidemic.get("a"))) {
|
|
|
+ sheet.setStatutoryEpidemic("1");
|
|
|
+ } else if (StringUtil.notBlank(epidemic.get("b"))) {
|
|
|
+ sheet.setStatutoryEpidemic("2");
|
|
|
+ } else if (StringUtil.notBlank(epidemic.get("c"))) {
|
|
|
+ sheet.setStatutoryEpidemic("3");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(sheet.getUseAntibiotic())) {
|
|
|
+ int antibioticCounts = dao.selectAntibiotics(patNo, times);
|
|
|
+ sheet.setUseAntibiotic(antibioticCounts > 0 ? "1" : "2");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private StandardAddressMember getStandardAddressMember(String bah) {
|
|
|
StandardAddressMember member = dao.selectStandardAddressMember(bah);
|
|
|
if (null != member) {
|