|
@@ -29,6 +29,8 @@ import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
@Component
|
|
|
public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
@@ -73,7 +75,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
@Autowired
|
|
|
private AHomePageFacade aHomePageFacade;
|
|
|
|
|
|
- public static final Map<String,String> CITY_MAP = MapUtil.getMap("cityCode.json");
|
|
|
+ public static final Map<String, String> CITY_MAP = MapUtil.getMap("cityCode.json");
|
|
|
|
|
|
/**
|
|
|
* 终末质控-同步前一天的病历记录
|
|
@@ -81,20 +83,21 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
public void executeMrRecord() {
|
|
|
//String sql="select * from mr_medicalrecords where cjcxrq>=dateadd(day,-2,getdate()) and cjcxrq<=getdate()";
|
|
|
//String sql="select * from mr_medicalrecords where cjcxrq>=(select CONVERT(varchar,GETDATE()-2,23)) and cjcxrq<(select CONVERT(varchar,GETDATE(),23)) ORDER BY cjcxrq DESC";
|
|
|
- String sql="select * from ai_v_sendmrrecording where behospitalcode in()";
|
|
|
+ String sql = "select * from ai_v_sendmrrecording where behospitalcode in()";
|
|
|
List<MedicalRecord> medicalRecordList = tzDBConn.getMedicalRecord(sql);
|
|
|
execute(medicalRecordList);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 终末质控-通过接口更新病历记录
|
|
|
+ *
|
|
|
* @param list
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
public RespDTO<List<AMedicalRecordDTO>> executeMrRecord(List<AMedicalRecordVO> list) {
|
|
|
try {
|
|
|
- if(list!=null && list.size()>0) {
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
//循环验证数据有效性
|
|
|
for (AMedicalRecordVO aMedicalRecordVO : list) {
|
|
|
if ("".equals(aMedicalRecordVO.getRecId())) {
|
|
@@ -107,34 +110,35 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
}
|
|
|
//装载数据
|
|
|
List<MedicalRecord> medicalRecordList = Lists.newArrayList();
|
|
|
- list.stream().forEach(s->{
|
|
|
- MedicalRecord medicalRecord=new MedicalRecord();
|
|
|
- BeanUtil.copyProperties(s,medicalRecord);
|
|
|
+ list.stream().forEach(s -> {
|
|
|
+ MedicalRecord medicalRecord = new MedicalRecord();
|
|
|
+ BeanUtil.copyProperties(s, medicalRecord);
|
|
|
medicalRecord.setRecDate(DateUtil.parseDateTime(s.getRecDate()));
|
|
|
medicalRecordList.add(medicalRecord);
|
|
|
});
|
|
|
execute(medicalRecordList);
|
|
|
List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(list, AMedicalRecordDTO.class);
|
|
|
return RespDTO.onSuc(medicalRecordDTOList);
|
|
|
- }else{
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息","",JSON.toJSONString(list),"","未接收到数据!");
|
|
|
+ } else {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", "", JSON.toJSONString(list), "", "未接收到数据!");
|
|
|
return RespDTO.onError("未接收到数据!");
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息","",JSON.toJSONString(list),"",e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", "", JSON.toJSONString(list), "", e.getMessage());
|
|
|
return RespDTO.onError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 运行质控-通过接口更新病历记录
|
|
|
+ *
|
|
|
* @param aMrContentVO
|
|
|
* @return
|
|
|
*/
|
|
|
public RespDTO<Map<String, Object>> executeMrRecordIng(AMrContentVO aMrContentVO) {
|
|
|
try {
|
|
|
- if(aMrContentVO.getRecords()!=null && aMrContentVO.getRecords().size()>0){
|
|
|
- AMrContentDTO aMrContentDTO=new AMrContentDTO();
|
|
|
+ if (aMrContentVO.getRecords() != null && aMrContentVO.getRecords().size() > 0) {
|
|
|
+ AMrContentDTO aMrContentDTO = new AMrContentDTO();
|
|
|
//循环验证数据有效性
|
|
|
for (AMedicalRecordVO aMedicalRecordVO : aMrContentVO.getRecords()) {
|
|
|
if (aMedicalRecordVO.getRecId() == null || "".equals(aMedicalRecordVO.getRecId())) {
|
|
@@ -147,125 +151,112 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
return RespDTO.onError("请输入病历类别编号!");
|
|
|
} else if (aMedicalRecordVO.getRecTitle() == null || "".equals(aMedicalRecordVO.getRecTitle())) {
|
|
|
return RespDTO.onError("请输入病历标题!");
|
|
|
- }else if (aMedicalRecordVO.getContents() == null || aMedicalRecordVO.getContents().size() == 0) {
|
|
|
+ } else if (aMedicalRecordVO.getContents() == null || aMedicalRecordVO.getContents().size() == 0) {
|
|
|
return RespDTO.onError("请输入文书详情!");
|
|
|
}
|
|
|
}
|
|
|
//更新文书信息
|
|
|
executeMrRecord(aMrContentVO.getRecords());
|
|
|
aMrContentVO.getRecords().stream().forEach(s -> {
|
|
|
- if(StringUtil.isNotEmpty(aMrContentVO.getTranscode())){
|
|
|
- String sql = "SELECT CONTENTS FROM AI_V_SENDMRRECORDING WHERE RECID = '"+s.getRecId()+"' AND BEHOSPITALCODE = '" + s.getBehospitalCode() + "'";
|
|
|
+ if (StringUtil.isNotEmpty(aMrContentVO.getTranscode())) {
|
|
|
+ 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());
|
|
|
-// //更新文书详情
|
|
|
-// if(StringUtil.isNotEmpty(aMrContentVO.getTranscode())){
|
|
|
-// long startTime=System.currentTimeMillis();
|
|
|
-// String sql = "SELECT * FROM AI_V_SENDMRRECORDING WHERE RECID = '"+s.getRecId()+"'";
|
|
|
-// List<MedicalRecordContent> medicalRecordContentList = tzDBConn.getMedicalRecordContent(sql);
|
|
|
-//
|
|
|
-// aMedicalRecordContentFacade.execute(medicalRecordContentList);
|
|
|
-// long endTime=System.currentTimeMillis();
|
|
|
-// System.out.println((endTime-startTime));
|
|
|
-// }else{
|
|
|
-// aMedicalRecordContentFacade.executeMrRecordContent(s.getContents());
|
|
|
-// }
|
|
|
});
|
|
|
//评分后返回结构体
|
|
|
- if(aMrContentVO.getRecords().get(0).getRecTypeId().equals("BASY")){
|
|
|
+ if (aMrContentVO.getRecords().get(0).getRecTypeId().equals("BASY")) {
|
|
|
AHomePageIngVO aHomePageIngVO = new AHomePageIngVO();
|
|
|
aHomePageIngVO.setHomePages(getHomePageVo(aMrContentVO));
|
|
|
aHomePageIngVO.setDockModeType(aMrContentVO.getDockModeType());
|
|
|
return aHomePageFacade.executeHomePageIng(aHomePageIngVO);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return mrIng(aMrContentVO);
|
|
|
}
|
|
|
- }else{
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息","",JSON.toJSONString(aMrContentVO),"","未接收到数据!");
|
|
|
+ } else {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", "", JSON.toJSONString(aMrContentVO), "", "未接收到数据!");
|
|
|
return RespDTO.onError("未接收到数据!");
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息","",JSON.toJSONString(aMrContentVO),"",e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", "", JSON.toJSONString(aMrContentVO), "", e.getMessage());
|
|
|
return RespDTO.onError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 评分后返回结构体
|
|
|
+ *
|
|
|
* @param aMrContentVO
|
|
|
* @return
|
|
|
*/
|
|
|
- private RespDTO<Map<String, Object>> mrIng(AMrContentVO aMrContentVO){
|
|
|
+ private RespDTO<Map<String, Object>> mrIng(AMrContentVO aMrContentVO) {
|
|
|
try {
|
|
|
- String behospitalCode =aMrContentVO.getRecords().get(0).getBehospitalCode();
|
|
|
- Long hospitalId=aMrContentVO.getRecords().get(0).getHospitalId();
|
|
|
- MedicalRecord medicalRecord=new MedicalRecord();
|
|
|
- BeanUtil.copyProperties(aMrContentVO.getRecords().get(0),medicalRecord);
|
|
|
- Long modeId=initModeId(medicalRecord);
|
|
|
- if(aMrContentVO.getDockModeType().equals("0")){
|
|
|
- Map<String,Object> map=new HashMap<String,Object>();
|
|
|
+ String behospitalCode = aMrContentVO.getRecords().get(0).getBehospitalCode();
|
|
|
+ Long hospitalId = aMrContentVO.getRecords().get(0).getHospitalId();
|
|
|
+ MedicalRecord medicalRecord = new MedicalRecord();
|
|
|
+ BeanUtil.copyProperties(aMrContentVO.getRecords().get(0), medicalRecord);
|
|
|
+ Long modeId = initModeId(medicalRecord);
|
|
|
+ if (aMrContentVO.getDockModeType().equals("0")) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(aMrContentVO.getRecords(), AMedicalRecordDTO.class);
|
|
|
- map.put("records",medicalRecordDTOList);
|
|
|
+ map.put("records", medicalRecordDTOList);
|
|
|
//aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
|
|
|
return RespDTO.onSuc("保存成功");
|
|
|
- } else if(aMrContentVO.getDockModeType().equals("1")){
|
|
|
- if(modeId==null || modeId==0){
|
|
|
+ } else if (aMrContentVO.getDockModeType().equals("1")) {
|
|
|
+ if (modeId == null || modeId == 0) {
|
|
|
return RespDTO.onSuc("无对应的文书类型");
|
|
|
}
|
|
|
//页面模式
|
|
|
- String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
|
|
|
- Map<String,Object> map=new HashMap<String,Object>();
|
|
|
- map.put("url",url);
|
|
|
+ String url = readProperties.getProcessQcUrl() + "?behospitalCode=" + behospitalCode + "&hospitalId=" + hospitalId + "&modeId=" + modeId;
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("url", url);
|
|
|
//aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
|
|
|
return RespDTO.onSuc(map);
|
|
|
- }else if(aMrContentVO.getDockModeType().equals("2")){
|
|
|
- AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
|
|
|
+ } else if (aMrContentVO.getDockModeType().equals("2")) {
|
|
|
+ AnalyzeRunVO analyzeRunVO = new AnalyzeRunVO();
|
|
|
analyzeRunVO.setBehospitalCode(behospitalCode);
|
|
|
analyzeRunVO.setHospitalId(hospitalId);
|
|
|
analyzeRunVO.setModeId(modeId);
|
|
|
- AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
|
|
|
- Map<String,Object> map=new HashMap<String,Object>();
|
|
|
- if(analyzeRunDTO.getMsgDTOList().size()>0){
|
|
|
- map.put("analyze",analyzeRunDTO.getMsgDTOList());
|
|
|
+ AnalyzeRunDTO analyzeRunDTO = behospitalInfoFacade.analyzeRun(analyzeRunVO);
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ if (analyzeRunDTO.getMsgDTOList().size() > 0) {
|
|
|
+ map.put("analyze", analyzeRunDTO.getMsgDTOList());
|
|
|
}
|
|
|
//aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
|
|
|
//接口引擎模式
|
|
|
return RespDTO.onSuc(map);
|
|
|
- }else{
|
|
|
- if(modeId==null ||modeId==0 ){
|
|
|
+ } else {
|
|
|
+ if (modeId == null || modeId == 0) {
|
|
|
return RespDTO.onSuc("无对应的文书类型");
|
|
|
}
|
|
|
//页面模式
|
|
|
- String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
|
|
|
- Map<String,Object> map=new HashMap<String,Object>();
|
|
|
- long startTime=System.currentTimeMillis();
|
|
|
- AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
|
|
|
+ String url = readProperties.getProcessQcUrl() + "?behospitalCode=" + behospitalCode + "&hospitalId=" + hospitalId + "&modeId=" + modeId;
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ AnalyzeRunVO analyzeRunVO = new AnalyzeRunVO();
|
|
|
analyzeRunVO.setBehospitalCode(behospitalCode);
|
|
|
analyzeRunVO.setHospitalId(hospitalId);
|
|
|
analyzeRunVO.setModeId(modeId);
|
|
|
- AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
|
|
|
+ AnalyzeRunDTO analyzeRunDTO = behospitalInfoFacade.analyzeRun(analyzeRunVO);
|
|
|
|
|
|
- if(analyzeRunDTO.getMsgDTOList().size()>0){
|
|
|
- map.put("url",url);
|
|
|
- map.put("analyze",analyzeRunDTO.getMsgDTOList());
|
|
|
+ if (analyzeRunDTO.getMsgDTOList().size() > 0) {
|
|
|
+ map.put("url", url);
|
|
|
+ map.put("analyze", analyzeRunDTO.getMsgDTOList());
|
|
|
}
|
|
|
- long endTime=System.currentTimeMillis();
|
|
|
- System.out.println((endTime-startTime));
|
|
|
//aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
|
|
|
return RespDTO.onSuc(map);
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息","",JSON.toJSONString(aMrContentVO),"",e.getMessage());
|
|
|
- if(e.getMessage().contains("该病历无关联的质控条目")){
|
|
|
+ } catch (Exception e) {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", "", JSON.toJSONString(aMrContentVO), "", e.getMessage());
|
|
|
+ if (e.getMessage().contains("该病历无关联的质控条目")) {
|
|
|
return RespDTO.onSuc(e.getMessage());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return RespDTO.onError(e.getMessage());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
public List<AHomePageVO> getHomePageVo(AMrContentVO aMrContentVO) {
|
|
|
String behospitalCode = aMrContentVO.getRecords().get(0).getBehospitalCode();
|
|
|
Long hospitalId = aMrContentVO.getRecords().get(0).getHospitalId();
|
|
@@ -286,55 +277,55 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
aHomePageVO.setFileCode(paramsObj.getString("病案号"));
|
|
|
aHomePageVO.setName(paramsObj.getString("姓名"));
|
|
|
aHomePageVO.setSex(paramsObj.getString("性别"));
|
|
|
- if(StringUtil.isNotEmpty(paramsObj.getString("出生日期").replaceAll("[\u4e00-\u9fa5]","").trim())){
|
|
|
- aHomePageVO.setBirthday(paramsObj.getString("出生日期").replaceAll("[\u4e00-\u9fa5]","-"));
|
|
|
+ if (StringUtil.isNotEmpty(paramsObj.getString("出生日期").replaceAll("[\u4e00-\u9fa5]", "").trim())) {
|
|
|
+ aHomePageVO.setBirthday(paramsObj.getString("出生日期").replaceAll("[\u4e00-\u9fa5]", "-"));
|
|
|
}
|
|
|
|
|
|
- aHomePageVO.setAge(paramsObj.getString("新生儿年龄").replaceAll("[\u4e00-\u9fa5]",""));
|
|
|
- if(paramsObj.getString("新生儿年龄").contains("天")){
|
|
|
+ aHomePageVO.setAge(paramsObj.getString("新生儿年龄").replaceAll("[\u4e00-\u9fa5]", ""));
|
|
|
+ if (paramsObj.getString("新生儿年龄").contains("天")) {
|
|
|
aHomePageVO.setAgeUnit("天");
|
|
|
- }else if(paramsObj.getString("新生儿年龄").contains("月")){
|
|
|
+ } else if (paramsObj.getString("新生儿年龄").contains("月")) {
|
|
|
aHomePageVO.setAgeUnit("月");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
aHomePageVO.setAgeUnit("岁");
|
|
|
}
|
|
|
aHomePageVO.setNationality(NationalityEnum.getName(paramsObj.getString("国籍")));
|
|
|
aHomePageVO.setNewbornWeight(paramsObj.getString("新生儿出生体重"));
|
|
|
//aHomePageVO.setNewbornBehospitalWeight("");
|
|
|
- String[] provinceList = paramsObj.getString("省").split(" ");
|
|
|
+ String[] provinceList = paramsObj.getString("省").split(" ");
|
|
|
String[] cityList = paramsObj.getString("市").split(" ");
|
|
|
String[] areaList = paramsObj.getString("县").split(" ");
|
|
|
- if(provinceList.length > 0){
|
|
|
- if(provinceList[0].length() > 1){
|
|
|
+ if (provinceList.length > 0) {
|
|
|
+ if (provinceList[0].length() > 1) {
|
|
|
aHomePageVO.setBornAddress(CITY_MAP.get(provinceList[0]) == null ? "" : CITY_MAP.get(provinceList[0]));
|
|
|
}
|
|
|
- if(provinceList[1].length() > 1){
|
|
|
+ if (provinceList[1].length() > 1) {
|
|
|
aHomePageVO.setResidenceAddress(CITY_MAP.get(provinceList[1]) == null ? "" : CITY_MAP.get(provinceList[1]));
|
|
|
}
|
|
|
}
|
|
|
- if(cityList.length > 0){
|
|
|
- if(cityList[0].length() > 1){
|
|
|
+ if (cityList.length > 0) {
|
|
|
+ if (cityList[0].length() > 1) {
|
|
|
aHomePageVO.setBornAddress(aHomePageVO.getBornAddress() + (CITY_MAP.get(cityList[0]) == null ? "" : CITY_MAP.get(cityList[0])));
|
|
|
}
|
|
|
- if(cityList[1].length() > 1){
|
|
|
+ if (cityList[1].length() > 1) {
|
|
|
aHomePageVO.setResidenceAddress(aHomePageVO.getResidenceAddress() + (CITY_MAP.get(cityList[1]) == null ? "" : CITY_MAP.get(cityList[1])));
|
|
|
}
|
|
|
}
|
|
|
- if(areaList.length > 0){
|
|
|
- if(areaList[0].length() > 1){
|
|
|
+ if (areaList.length > 0) {
|
|
|
+ if (areaList[0].length() > 1) {
|
|
|
aHomePageVO.setBornAddress(aHomePageVO.getBornAddress() + (CITY_MAP.get(areaList[0]) == null ? "" : CITY_MAP.get(areaList[0])));
|
|
|
}
|
|
|
- if(areaList[1].length() > 1){
|
|
|
+ if (areaList[1].length() > 1) {
|
|
|
aHomePageVO.setResidenceAddress(aHomePageVO.getResidenceAddress() + (CITY_MAP.get(areaList[1]) == null ? "" : CITY_MAP.get(areaList[1])));
|
|
|
}
|
|
|
}
|
|
|
- aHomePageVO.setResidenceAddress(aHomePageVO.getResidenceAddress()+paramsObj.getString("户口地址其它"));
|
|
|
+ aHomePageVO.setResidenceAddress(aHomePageVO.getResidenceAddress() + paramsObj.getString("户口地址其它"));
|
|
|
aHomePageVO.setBornPlace(CITY_MAP.get(paramsObj.getString("籍贯_省")) + CITY_MAP.get(paramsObj.getString("籍贯_市")));
|
|
|
- aHomePageVO.setNation(FamousFamilyEnum.getName(paramsObj.getString("民族")));
|
|
|
+ aHomePageVO.setNation(coverValue(paramsObj.getString("民族"),"MZ"));
|
|
|
aHomePageVO.setIdentityCardNo(paramsObj.getString("身份证号"));
|
|
|
aHomePageVO.setJobType(OccupationEnum.getName(paramsObj.getString("职业")));
|
|
|
aHomePageVO.setMarriage(paramsObj.getString("婚姻"));
|
|
|
- aHomePageVO.setCurAddress(CITY_MAP.get(paramsObj.getString("现住址_省"))+CITY_MAP.get(paramsObj.getString("现住址_市"))+CITY_MAP.get(paramsObj.getString("现住址_县"))+paramsObj.getString("现住址其它"));
|
|
|
+ aHomePageVO.setCurAddress(CITY_MAP.get(paramsObj.getString("现住址_省")) + CITY_MAP.get(paramsObj.getString("现住址_市")) + CITY_MAP.get(paramsObj.getString("现住址_县")) + paramsObj.getString("现住址其它"));
|
|
|
aHomePageVO.setCurPhone(paramsObj.getString("现住址电话"));
|
|
|
aHomePageVO.setCurPostCode(paramsObj.getString("现住址邮编"));
|
|
|
aHomePageVO.setResidencePostCode(paramsObj.getString("户口地址邮编"));
|
|
@@ -345,19 +336,20 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
aHomePageVO.setContactRelation(RelationshipEnum.getName(paramsObj.getString("联系人关系")));
|
|
|
aHomePageVO.setContactAddress(paramsObj.getString("联系人地址"));
|
|
|
aHomePageVO.setContactPhone(paramsObj.getString("联系人电话"));
|
|
|
- if(StringUtil.isNotBlank(paramsObj.getString("入院途径"))){ //待定
|
|
|
+ if (StringUtil.isNotBlank(paramsObj.getString("入院途径"))) { //待定
|
|
|
aHomePageVO.setBehospitalWay(paramsObj.getString("入院途径").split(" ")[0]);
|
|
|
}
|
|
|
- if(YWDateUtils.isDate(paramsObj.getString("入院时间"),"yyyy年MM月dd日 HH时mm分") || YWDateUtils.isDate(paramsObj.getString("入院时间"),"yyyy-MM-dd HH:mm:ss")){
|
|
|
- aHomePageVO.setBehospitalDate(DateUtil.format(YWDateUtils.parseDateTime(paramsObj.getString("入院时间")),DateUtil.DATE_TIME_FORMAT));
|
|
|
+ if (YWDateUtils.isDate(paramsObj.getString("入院时间"), "yyyy年MM月dd日 HH时mm分") || YWDateUtils.isDate(paramsObj.getString("入院时间"), "yyyy-MM-dd HH:mm:ss")) {
|
|
|
+ aHomePageVO.setBehospitalDate(DateUtil.format(YWDateUtils.parseDateTime(paramsObj.getString("入院时间")), DateUtil.DATE_TIME_FORMAT));
|
|
|
}
|
|
|
- aHomePageVO.setBehospitalDept(tzDBConn.getDeptName(paramsObj.getString("入院科别")));
|
|
|
+
|
|
|
+ aHomePageVO.setBehospitalDept(coverValue(paramsObj.getString("入院科别"),"KS"));
|
|
|
aHomePageVO.setBehospitalWard(paramsObj.getString("入院病房"));
|
|
|
//aHomePageVO.setBehospitalBedId();
|
|
|
//aHomePageVO.setBehospitalBedCode();
|
|
|
aHomePageVO.setChangeDept(paramsObj.getString("转科科别"));
|
|
|
- if(YWDateUtils.isDate(paramsObj.getString("出院时间"),"yyyy-MM-dd HH:mm:ss") || YWDateUtils.isDate(paramsObj.getString("出院时间"),"yyyy年MM月dd日 HH时mm分")){
|
|
|
- aHomePageVO.setLeaveHospitalDate(DateUtil.format(YWDateUtils.parseDateTime(paramsObj.getString("出院时间")),DateUtil.DATE_TIME_FORMAT));
|
|
|
+ if (YWDateUtils.isDate(paramsObj.getString("出院时间"), "yyyy-MM-dd HH:mm:ss") || YWDateUtils.isDate(paramsObj.getString("出院时间"), "yyyy年MM月dd日 HH时mm分")) {
|
|
|
+ aHomePageVO.setLeaveHospitalDate(DateUtil.format(YWDateUtils.parseDateTime(paramsObj.getString("出院时间")), DateUtil.DATE_TIME_FORMAT));
|
|
|
}
|
|
|
aHomePageVO.setLeaveHospitalDept(paramsObj.getString("出院科别"));
|
|
|
aHomePageVO.setLeaveHospitalWard(paramsObj.getString("出院病房"));
|
|
@@ -376,19 +368,19 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
aHomePageVO.setAutopsy(paramsObj.getString("死亡患者尸检"));
|
|
|
aHomePageVO.setBloodType(paramsObj.getString("血型"));
|
|
|
aHomePageVO.setRh(paramsObj.getString("Rh"));
|
|
|
- aHomePageVO.setDeptDirector(tzDBConn.getDoctorName(paramsObj.getString("科主任")));
|
|
|
- aHomePageVO.setDirectorDoctor(tzDBConn.getDoctorName(paramsObj.getString("主任医师")));
|
|
|
- aHomePageVO.setAttendingDoctor(paramsObj.getString("主治医师"));
|
|
|
- aHomePageVO.setBehospitalDoctor(tzDBConn.getDoctorName(paramsObj.getString("住院医师")));
|
|
|
- aHomePageVO.setResponseNurse(tzDBConn.getDoctorName(paramsObj.getString("责任护士")));
|
|
|
- aHomePageVO.setStudyDoctor(tzDBConn.getDoctorName(paramsObj.getString("进修医师")));
|
|
|
- aHomePageVO.setPracticeDoctor(tzDBConn.getDoctorName(paramsObj.getString("实习医师")));
|
|
|
- aHomePageVO.setEncodeMan(tzDBConn.getDoctorName(paramsObj.getString("编码员")));
|
|
|
+ aHomePageVO.setDeptDirector(coverValue(paramsObj.getString("科主任"),"ZG"));
|
|
|
+ aHomePageVO.setDirectorDoctor(coverValue(paramsObj.getString("主任医师"),"ZG"));
|
|
|
+ aHomePageVO.setAttendingDoctor(coverValue(paramsObj.getString("主治医师"),"ZG"));
|
|
|
+ aHomePageVO.setBehospitalDoctor(coverValue(paramsObj.getString("住院医师"),"ZG"));
|
|
|
+ aHomePageVO.setResponseNurse(coverValue(paramsObj.getString("责任护士"),"ZG"));
|
|
|
+ aHomePageVO.setStudyDoctor(coverValue(paramsObj.getString("进修医师"),"ZG"));
|
|
|
+ aHomePageVO.setPracticeDoctor(coverValue(paramsObj.getString("实习医师"),"ZG"));
|
|
|
+ aHomePageVO.setEncodeMan(coverValue(paramsObj.getString("编码员"),"ZG"));
|
|
|
aHomePageVO.setHomePageQuality(paramsObj.getString("病案质量"));
|
|
|
- aHomePageVO.setQcDoctor(tzDBConn.getDoctorName(paramsObj.getString("质控医师")));
|
|
|
- aHomePageVO.setQcNurse(tzDBConn.getDoctorName(paramsObj.getString("质控护士")));
|
|
|
- if(YWDateUtils.isDate(paramsObj.getString("质控日期"),"yyyy-MM-dd HH:mm:ss")){
|
|
|
- aHomePageVO.setQcDate(DateUtil.format(YWDateUtils.parseDateTime(paramsObj.getString("质控日期")),DateUtil.DATE_TIME_FORMAT));
|
|
|
+ aHomePageVO.setQcDoctor(coverValue(paramsObj.getString("质控医师"),"ZG"));
|
|
|
+ aHomePageVO.setQcNurse(coverValue(paramsObj.getString("质控护士"),"ZG"));
|
|
|
+ if (YWDateUtils.isDate(paramsObj.getString("质控日期"), "yyyy-MM-dd HH:mm:ss")) {
|
|
|
+ aHomePageVO.setQcDate(DateUtil.format(YWDateUtils.parseDateTime(paramsObj.getString("质控日期")), DateUtil.DATE_TIME_FORMAT));
|
|
|
}
|
|
|
aHomePageVO.setLeaveHospitalType(paramsObj.getString("离院方式"));
|
|
|
aHomePageVO.setAcceptOrgCode(paramsObj.getString("接收机构名称"));
|
|
@@ -466,10 +458,10 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
// }
|
|
|
// aHomePageVO.setOperations(operationInfo);
|
|
|
// }
|
|
|
- String sql = "SELECT * FROM AI_V_SENDHOMEPAGEING_SSQK t where t.homepageid = '"+behospitalCode+"'";
|
|
|
+ String sql = "SELECT * FROM AI_V_SENDHOMEPAGEING_SSQK t where t.homepageid = '" + behospitalCode + "'";
|
|
|
aHomePageVO.setOperations(tzDBConn.getHomePageOperation(sql));
|
|
|
List<Object> diagnoseList = paramsObj.getJSONArray("出院诊断");
|
|
|
- if(diagnoseList.size() > 0){
|
|
|
+ if (diagnoseList.size() > 0) {
|
|
|
List<AHomeDiagnoseVO> leaveDiags = Lists.newLinkedList();
|
|
|
for (int i = 0; i < operationList.size(); i++) {
|
|
|
AHomeDiagnoseVO aHomeDiagnoseVO = new AHomeDiagnoseVO();
|
|
@@ -492,33 +484,33 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void execute(List<MedicalRecord> medicalRecordList){
|
|
|
+ public void execute(List<MedicalRecord> medicalRecordList) {
|
|
|
try {
|
|
|
List<MedicalRecord> addE = Lists.newLinkedList();
|
|
|
List<MedicalRecord> updateE = Lists.newLinkedList();
|
|
|
- List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
|
|
|
+ List<BehospitalInfo> behospitalInfoList = Lists.newLinkedList();
|
|
|
List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
|
|
|
if (medicalRecordList != null && medicalRecordList.size() > 0) {
|
|
|
medicalRecordList.stream().forEach(s -> {
|
|
|
//初始化mode_id
|
|
|
- Long modeId=initModeId(s);
|
|
|
- if(modeId==Long.valueOf("0")){
|
|
|
+ Long modeId = initModeId(s);
|
|
|
+ if (modeId == Long.valueOf("0")) {
|
|
|
//新增类型到监测表中
|
|
|
- QcAbnormal qcAbnormal=new QcAbnormal();
|
|
|
+ QcAbnormal qcAbnormal = new QcAbnormal();
|
|
|
qcAbnormal.setHospitalId(s.getHospitalId());
|
|
|
qcAbnormal.setBehospitalCode(s.getBehospitalCode());
|
|
|
qcAbnormal.setType(1);
|
|
|
qcAbnormal.setDescription(s.getRecTitle());
|
|
|
qcAbnormal.setGmtCreate(new Date());
|
|
|
qcAbnormalList.add(qcAbnormal);
|
|
|
- }else if(modeId==Long.valueOf("1")){
|
|
|
+ } else if (modeId == Long.valueOf("1")) {
|
|
|
BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
.eq("behospital_code", s.getBehospitalCode())
|
|
|
.eq("hospital_id", s.getHospitalId())
|
|
|
- .eq("is_deleted",IsDeleteEnum.N), false);
|
|
|
- if(behospitalInfo!=null){
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N), false);
|
|
|
+ if (behospitalInfo != null) {
|
|
|
//如果病人住院信息存在,更新对应的qc_type_id
|
|
|
- Long qcTypeId = initQcTypeId(s,behospitalInfo);
|
|
|
+ Long qcTypeId = initQcTypeId(s, behospitalInfo);
|
|
|
behospitalInfo.setQcTypeId(qcTypeId);
|
|
|
behospitalInfoList.add(behospitalInfo);
|
|
|
}
|
|
@@ -528,7 +520,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
MedicalRecord mRecord = this.getOne(new QueryWrapper<MedicalRecord>()
|
|
|
.eq("rec_id", s.getRecId())
|
|
|
.eq("hospital_id", s.getHospitalId())
|
|
|
- .eq("is_deleted",IsDeleteEnum.N)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N)
|
|
|
.eq("behospital_code", s.getBehospitalCode()), false);
|
|
|
if (mRecord != null) {
|
|
|
s.setGmtModified(new Date());
|
|
@@ -539,21 +531,21 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- if(addE.size()>0){
|
|
|
+ if (addE.size() > 0) {
|
|
|
medicalRecordService.saveBatch(addE);
|
|
|
}
|
|
|
- if(updateE.size()>0){
|
|
|
+ if (updateE.size() > 0) {
|
|
|
medicalRecordService.updateBatchByKey(updateE);
|
|
|
}
|
|
|
- if(qcAbnormalList.size()>0){
|
|
|
+ if (qcAbnormalList.size() > 0) {
|
|
|
qcAbnormalService.saveBatch(qcAbnormalList);
|
|
|
}
|
|
|
- if(behospitalInfoList.size()>0){
|
|
|
+ if (behospitalInfoList.size() > 0) {
|
|
|
behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
|
|
|
}
|
|
|
//aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(medicalRecordList),"","操作正常!");
|
|
|
- }catch (Exception e){
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息","",JSON.toJSONString(medicalRecordList),"",e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息", "", JSON.toJSONString(medicalRecordList), "", e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -564,38 +556,38 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
* @param medicalRecord
|
|
|
* @return
|
|
|
*/
|
|
|
- private Long initQcTypeId(MedicalRecord medicalRecord,BehospitalInfo behospitalInfo) {
|
|
|
+ private Long initQcTypeId(MedicalRecord medicalRecord, BehospitalInfo behospitalInfo) {
|
|
|
Long qcTypeId = Long.valueOf("0");
|
|
|
String behDeptId = behospitalInfo.getBehDeptId();
|
|
|
String recTypeId = medicalRecord.getRecTypeId();
|
|
|
- if(recTypeId.contains("RJBL") || recTypeId.contains("24XSCRYJL")){
|
|
|
- if(behDeptId.equals("52425")){
|
|
|
+ if (recTypeId.contains("RJBL") || recTypeId.contains("24XSCRYJL")) {
|
|
|
+ if (behDeptId.equals("52425")) {
|
|
|
/**妇科(住)日间病历、24小时出入院记录的病历模板,映射妇科日间*/
|
|
|
behDeptId = "52883";
|
|
|
BasDeptInfo basDeptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
|
|
|
- .eq("dept_id",behDeptId)
|
|
|
- .eq("hospital_id",behospitalInfo.getHospitalId())
|
|
|
- .eq("is_deleted",IsDeleteEnum.N));
|
|
|
+ .eq("dept_id", behDeptId)
|
|
|
+ .eq("hospital_id", behospitalInfo.getHospitalId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N));
|
|
|
behospitalInfo.setBehDeptId(behDeptId);
|
|
|
behospitalInfo.setBehDeptName(basDeptInfo.getDeptName());
|
|
|
behospitalInfo.setGmtModified(DateUtil.now());
|
|
|
- }else if(behDeptId.equals("51944")){
|
|
|
+ } else if (behDeptId.equals("51944")) {
|
|
|
/**乳腺外科日间病历、24小时出入院记录的病历模板,映射乳腺外科日间日间*/
|
|
|
behDeptId = "52923";
|
|
|
BasDeptInfo basDeptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
|
|
|
- .eq("dept_id",behDeptId)
|
|
|
- .eq("hospital_id",behospitalInfo.getHospitalId())
|
|
|
- .eq("is_deleted",IsDeleteEnum.N));
|
|
|
+ .eq("dept_id", behDeptId)
|
|
|
+ .eq("hospital_id", behospitalInfo.getHospitalId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N));
|
|
|
behospitalInfo.setBehDeptId(behDeptId);
|
|
|
behospitalInfo.setBehDeptName(basDeptInfo.getDeptName());
|
|
|
behospitalInfo.setGmtModified(DateUtil.now());
|
|
|
- }else if(behDeptId.equals("52424")){
|
|
|
+ } else if (behDeptId.equals("52424")) {
|
|
|
/**儿科日间病历、24小时出入院记录的病历模板,映射儿科日间*/
|
|
|
behDeptId = "52903";
|
|
|
BasDeptInfo basDeptInfo = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
|
|
|
- .eq("dept_id",behDeptId)
|
|
|
- .eq("hospital_id",behospitalInfo.getHospitalId())
|
|
|
- .eq("is_deleted",IsDeleteEnum.N));
|
|
|
+ .eq("dept_id", behDeptId)
|
|
|
+ .eq("hospital_id", behospitalInfo.getHospitalId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N));
|
|
|
behospitalInfo.setBehDeptId(behDeptId);
|
|
|
behospitalInfo.setBehDeptName(basDeptInfo.getDeptName());
|
|
|
behospitalInfo.setGmtModified(DateUtil.now());
|
|
@@ -606,65 +598,59 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
.eq("hospital_id", behospitalInfo.getHospitalId())
|
|
|
.eq("is_deleted", IsDeleteEnum.N));
|
|
|
if (medicalRecord != null) {
|
|
|
-// MedRecordType medRecordType =aMedRecordTypeFacade.getOne(new QueryWrapper<MedRecordType>()
|
|
|
-// .eq("hospital_id",medicalRecord.getHospitalId())
|
|
|
-// .eq("type_id",medicalRecord.getRecTypeId())
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N));
|
|
|
-// if (medRecordType!=null) {
|
|
|
- if (qcTypeList.size() == 0) {
|
|
|
- QcType qcType = qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
- .eq("default_module", 1)
|
|
|
- .eq("hospital_id", behospitalInfo.getHospitalId())
|
|
|
-// .eq("sex", behospitalInfo.getSex())
|
|
|
- .eq("is_deleted", IsDeleteEnum.N));
|
|
|
- qcTypeId = qcType.getId();
|
|
|
- } else if (qcTypeList.size() == 1) {
|
|
|
- qcTypeId = qcTypeList.get(0).getId();
|
|
|
- } else {
|
|
|
- QcType qcType = new QcType();
|
|
|
- qcTypeList.forEach(ss -> {
|
|
|
- if (ss.getSex().equals(behospitalInfo.getSex())) {
|
|
|
- qcType.setId(ss.getId());
|
|
|
- }
|
|
|
- });
|
|
|
- qcTypeId = qcType.getId();
|
|
|
- }
|
|
|
+ if (qcTypeList.size() == 0) {
|
|
|
+ QcType qcType = qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
+ .eq("default_module", 1)
|
|
|
+ .eq("hospital_id", behospitalInfo.getHospitalId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N));
|
|
|
+ qcTypeId = qcType.getId();
|
|
|
+ } else if (qcTypeList.size() == 1) {
|
|
|
+ qcTypeId = qcTypeList.get(0).getId();
|
|
|
+ } else {
|
|
|
+ QcType qcType = new QcType();
|
|
|
+ qcTypeList.forEach(ss -> {
|
|
|
+ if (ss.getSex().equals(behospitalInfo.getSex())) {
|
|
|
+ qcType.setId(ss.getId());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ qcTypeId = qcType.getId();
|
|
|
+ }
|
|
|
// }
|
|
|
-
|
|
|
}
|
|
|
return qcTypeId;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 初始化模型ID
|
|
|
+ *
|
|
|
* @param medicalRecord
|
|
|
* @return
|
|
|
*/
|
|
|
- private Long initModeId(MedicalRecord medicalRecord){
|
|
|
- Long modeId=Long.valueOf("0");
|
|
|
+ private Long initModeId(MedicalRecord medicalRecord) {
|
|
|
+ Long modeId = Long.valueOf("0");
|
|
|
try {
|
|
|
QueryWrapper<ModelHospital> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("hospital_id",medicalRecord.getHospitalId());
|
|
|
- wrapper.eq("hospital_model_name",medicalRecord.getRecTitle());
|
|
|
- ModelHospital mode=modelHospitalFacade.getOne(wrapper, false);
|
|
|
+ wrapper.eq("hospital_id", medicalRecord.getHospitalId());
|
|
|
+ wrapper.eq("hospital_model_name", medicalRecord.getRecTitle());
|
|
|
+ ModelHospital mode = modelHospitalFacade.getOne(wrapper, false);
|
|
|
String recTitle = medicalRecord.getRecTitle();
|
|
|
- if(mode!=null){
|
|
|
- modeId=mode.getStandModelId();
|
|
|
- }else{
|
|
|
- modeId=Long.valueOf("0");
|
|
|
- ModelHospital modelHospital=new ModelHospital();
|
|
|
+ if (mode != null) {
|
|
|
+ modeId = mode.getStandModelId();
|
|
|
+ } else {
|
|
|
+ modeId = Long.valueOf("0");
|
|
|
+ ModelHospital modelHospital = new ModelHospital();
|
|
|
modelHospital.setHospitalId(5L);
|
|
|
modelHospital.setHospitalModelName(medicalRecord.getRecTitle());
|
|
|
- if(recTitle.contains("查房")){
|
|
|
- modeId=4L;
|
|
|
+ if (recTitle.contains("查房")) {
|
|
|
+ modeId = 4L;
|
|
|
modelHospital.setStandModelId(4L);
|
|
|
modelHospital.setStandModelName("查房记录");
|
|
|
- }else if(recTitle.contains("手术知情同意书")){
|
|
|
- modeId=16L;
|
|
|
+ } else if (recTitle.contains("手术知情同意书")) {
|
|
|
+ modeId = 16L;
|
|
|
modelHospital.setStandModelId(16L);
|
|
|
modelHospital.setStandModelName("知情同意书");
|
|
|
- }else if(recTitle.contains("有创") && recTitle.contains("知情同意书")){
|
|
|
- modeId=59L;
|
|
|
+ } else if (recTitle.contains("有创") && recTitle.contains("知情同意书")) {
|
|
|
+ modeId = 59L;
|
|
|
modelHospital.setHospitalId(59L);
|
|
|
modelHospital.setHospitalModelName(recTitle);
|
|
|
}
|
|
@@ -672,14 +658,14 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
}
|
|
|
//aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-初始化modeId",JSON.toJSONString(medicalRecord),modeId.toString(),"操作成功!");
|
|
|
return modeId;
|
|
|
- }catch (Exception e){
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-初始化modeId",medicalRecord.getRecId(), JSON.toJSONString(medicalRecord),"",e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-初始化modeId", medicalRecord.getRecId(), JSON.toJSONString(medicalRecord), "", e.getMessage());
|
|
|
return modeId;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- public RespDTO deleteFlag(ADeleteFlagVO aDeleteFlagVO){
|
|
|
+ public RespDTO deleteFlag(ADeleteFlagVO aDeleteFlagVO) {
|
|
|
try {
|
|
|
//验证数据是否存在
|
|
|
if (StringUtil.isEmpty(aDeleteFlagVO.getRecId())) {
|
|
@@ -688,32 +674,48 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
|
return RespDTO.onError("请输入医院编码!");
|
|
|
} else if (StringUtil.isEmpty(aDeleteFlagVO.getBehospitalCode())) {
|
|
|
return RespDTO.onError("请输入病人住院编码!");
|
|
|
- }else {
|
|
|
- UpdateWrapper<MedicalRecord> updateWrapper=new UpdateWrapper<>();
|
|
|
+ } else {
|
|
|
+ UpdateWrapper<MedicalRecord> updateWrapper = new UpdateWrapper<>();
|
|
|
updateWrapper.eq("rec_id", aDeleteFlagVO.getRecId())
|
|
|
.eq("hospital_id", aDeleteFlagVO.getHospitalId())
|
|
|
.eq("behospital_code", aDeleteFlagVO.getBehospitalCode())
|
|
|
- .eq("is_deleted",IsDeleteEnum.N)
|
|
|
- .set("is_deleted",IsDeleteEnum.Y)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N)
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y)
|
|
|
.set("gmt_modified", DateUtil.now());
|
|
|
- Boolean flag=update(new MedicalRecord(),updateWrapper);
|
|
|
- if(flag){
|
|
|
- UpdateWrapper<MedicalRecordContent> updateWrapperContent=new UpdateWrapper<>();
|
|
|
+ Boolean flag = update(new MedicalRecord(), updateWrapper);
|
|
|
+ if (flag) {
|
|
|
+ UpdateWrapper<MedicalRecordContent> updateWrapperContent = new UpdateWrapper<>();
|
|
|
updateWrapperContent.eq("rec_id", aDeleteFlagVO.getRecId())
|
|
|
.eq("hospital_id", aDeleteFlagVO.getHospitalId())
|
|
|
- .eq("is_deleted",IsDeleteEnum.N)
|
|
|
- .set("is_deleted",IsDeleteEnum.Y)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N)
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y)
|
|
|
.set("gmt_modified", DateUtil.now());
|
|
|
|
|
|
- Boolean flagContent=aMedicalRecordContentFacade.update(new MedicalRecordContent(),updateWrapperContent);
|
|
|
+ Boolean flagContent = aMedicalRecordContentFacade.update(new MedicalRecordContent(), updateWrapperContent);
|
|
|
//aMedAbnormalInfoFacade.saveAbnormalInfo("文书内容-删除",JSON.toJSONString(aDeleteFlagVO),JSON.toJSONString(RespDTO.onSuc(flagContent)),"操作成功!");
|
|
|
}
|
|
|
//aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-删除",JSON.toJSONString(aDeleteFlagVO),JSON.toJSONString(RespDTO.onSuc(flag)),"操作成功!");
|
|
|
return RespDTO.onSuc(flag);
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("文书-删除",aDeleteFlagVO.getRecId(), JSON.toJSONString(aDeleteFlagVO),"",e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书-删除", aDeleteFlagVO.getRecId(), JSON.toJSONString(aDeleteFlagVO), "", e.getMessage());
|
|
|
return RespDTO.onError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public String coverValue(String field, String type) {
|
|
|
+ Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
|
|
|
+ Matcher m = p.matcher(field);
|
|
|
+ if (type.equals("ZG")) {
|
|
|
+ /**职工*/
|
|
|
+ return m.find() ? field : tzDBConn.getDoctorName(field);
|
|
|
+ } else if (type.equals("KS")) {
|
|
|
+ /**科室*/
|
|
|
+ return m.find() ? field : tzDBConn.getDeptName(field);
|
|
|
+ } else if (type.equals("MZ")) {
|
|
|
+ /**民族*/
|
|
|
+ return m.find() ? field : FamousFamilyEnum.getName(field);
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
}
|