|
@@ -152,11 +152,15 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public RespDTO<Map<String, Object>> executeMrRecordIng(AMrContentVO aMrContentVO) {
|
|
|
+ String behospitalCode = null;
|
|
|
try {
|
|
|
if (aMrContentVO.getRecords() != null && aMrContentVO.getRecords().size() > 0) {
|
|
|
AMrContentDTO aMrContentDTO = new AMrContentDTO();
|
|
|
//循环验证数据有效性
|
|
|
for (AMedicalRecordVO aMedicalRecordVO : aMrContentVO.getRecords()) {
|
|
|
+ if (behospitalCode == null) {
|
|
|
+ behospitalCode = aMedicalRecordVO.getBehospitalCode();
|
|
|
+ }
|
|
|
if (aMedicalRecordVO.getRecId() == null || "".equals(aMedicalRecordVO.getRecId())) {
|
|
|
return RespDTO.onError("请输入文书序号!");
|
|
|
} else if (aMedicalRecordVO.getHospitalId() == null) {
|
|
@@ -171,6 +175,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
return RespDTO.onError("请输入文书详情!");
|
|
|
}
|
|
|
}
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo(behospitalCode+"mrRecord", behospitalCode, JSON.toJSONString(aMrContentVO), "", "!");
|
|
|
//更新文书信息
|
|
|
executeMrRecord(aMrContentVO.getRecords());
|
|
|
aMrContentVO.getRecords().stream().forEach(s -> {
|
|
@@ -178,46 +183,57 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
String sql = "SELECT CONTENTS FROM AI_V_SENDMRRECORDING WHERE RECID = '" + s.getRecId() + "' AND BEHOSPITALCODE = '" + s.getBehospitalCode() + "'";
|
|
|
s.getContents().get(0).setXmlText(tzDBConn.getRecordXml(sql));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
aMedicalRecordContentFacade.executeMrRecordContent(s.getContents());
|
|
|
- /*//日间病历修改质控类型为0 不参与质控
|
|
|
- if(s.getRecTitle().contains("日间入出院记录")||s.getRecTitle().contains("24小时入出院记录")||s.getRecTitle().contains("日间病历")){
|
|
|
+ /*查看试图日间病例标识*/
|
|
|
+ String sql = "SELECT * FROM AI_V_SENDPATIENTINFO t WHERE t.BEHOSPITALCODE='" + s.getBehospitalCode() + "'";
|
|
|
+ List<BehospitalInfo> behospitalInfos = tzDBConn.getBehospitalInfo(sql);
|
|
|
+ BehospitalInfo hospitalInfo = null;
|
|
|
+ if (behospitalInfos.size() > 0) {
|
|
|
+ hospitalInfo = behospitalInfos.get(0);
|
|
|
+ }
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo(s.getBehospitalCode()+"mrRecord", s.getBehospitalCode(), hospitalInfo.getIsDaytime(), "", "!");
|
|
|
+ //更新日间病例标识 isDaytime
|
|
|
+ if(hospitalInfo.getIsDaytime().equals("1")){
|
|
|
UpdateWrapper<BehospitalInfo> wrapper = new UpdateWrapper<>();
|
|
|
wrapper.eq("behospital_code",s.getBehospitalCode())
|
|
|
.eq("is_deleted","N")
|
|
|
- .set("qc_type_id",0);
|
|
|
+ .set("is_daytime",1);
|
|
|
behospitalInfoService.update(wrapper);
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
BehospitalInfo behospitalInfo =behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>().eq("behospital_code", s.getBehospitalCode()));
|
|
|
- QcType qcType= qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
- .eq("beh_dept_id", behospitalInfo.getBehDeptId())
|
|
|
- .eq("default_module",0)
|
|
|
- .eq("sex",behospitalInfo.getSex())
|
|
|
- .eq("hospital_id", behospitalInfo.getHospitalId())
|
|
|
- .eq("is_deleted", IsDeleteEnum.N));
|
|
|
- //根据日间病例标志 查看质控类型 没有质控类型 则修改质控类型
|
|
|
- if (qcType==null) {
|
|
|
- UpdateWrapper<BehospitalInfo> wrapper = new UpdateWrapper<>();
|
|
|
-
|
|
|
- if (behospitalInfo.getIsDaytime().equals("1")) {
|
|
|
-
|
|
|
- if (behospitalInfo.getSex().equals(SexEnum.NUM_MALE.getName())) {
|
|
|
- QcType byId = qcTypeFacade.getById("129");
|
|
|
- wrapper.eq("behospital_code",s.getBehospitalCode())
|
|
|
- .eq("is_deleted","N")
|
|
|
- .set("qc_type_id",byId.getId());
|
|
|
- behospitalInfoService.update(wrapper);
|
|
|
-
|
|
|
- }else{
|
|
|
- QcType byId = qcTypeFacade.getById("161");
|
|
|
- wrapper.eq("behospital_code",s.getBehospitalCode())
|
|
|
- .eq("is_deleted","N")
|
|
|
- .set("qc_type_id",byId.getId());
|
|
|
- }
|
|
|
-
|
|
|
+ UpdateWrapper<BehospitalInfo> wrapper = new UpdateWrapper<>();
|
|
|
+ //使用试图日间标识 判断是否是日间病例
|
|
|
+ if (hospitalInfo.getIsDaytime().equals("1")) {
|
|
|
+
|
|
|
+ if (behospitalInfo.getSex().equals(SexEnum.NUM_MALE.getName())) {
|
|
|
+ QcType byId = qcTypeFacade.getById("129");
|
|
|
+ wrapper.eq("behospital_code",s.getBehospitalCode())
|
|
|
+ .eq("is_deleted","N")
|
|
|
+ .set("qc_type_id",byId.getId());
|
|
|
+
|
|
|
+ }else{
|
|
|
+ QcType byId = qcTypeFacade.getById("161");
|
|
|
+ wrapper.eq("behospital_code",s.getBehospitalCode())
|
|
|
+ .eq("is_deleted","N")
|
|
|
+ .set("qc_type_id",byId.getId());
|
|
|
}
|
|
|
- }});
|
|
|
+ behospitalInfoService.update(wrapper);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ QcType qcType= qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
+ .eq("beh_dept_id", behospitalInfo.getBehDeptId())
|
|
|
+ .eq("default_module",0)
|
|
|
+ .eq("sex",behospitalInfo.getSex())
|
|
|
+ .eq("hospital_id", behospitalInfo.getHospitalId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N));
|
|
|
+ //根据日间病例标志 查看质控类型 没有质控类型 则修改质控类型
|
|
|
+// if (qcType==null) {
|
|
|
+//
|
|
|
+// }
|
|
|
+ }
|
|
|
+});
|
|
|
|
|
|
//评分后返回结构体
|
|
|
if (aMrContentVO.getRecords().get(0).getRecTypeId().equals("BASY")) {
|