master
hujl 4 years ago
parent 942cd1ddd9
commit 25f2de5fd9

@ -48,41 +48,41 @@ public class FontController {
@Autowired
private Zd_AssortService assortService;
/***************************提供第三方按多个分段id和记账号查询病历pdf***********************************/
/***************************提供第三方按多个分段id和记账号查询病历pdf***********************************/
/**
* idpdf
* idpdf
* */
@RequestMapping("showRecordByPatientId")
public String showRecordByPatientId( HttpServletResponse response, String assortIds, String patientId, String visitId, Model model){
response.setCharacterEncoding("utf-8");
System.out.println(System.getProperty("file.encoding"));//当前文件的编码方式
if(StringUtils.isBlank(assortIds)){
return retrunErrorPage(model,"病案分类Id不能为空!");
return retrunErrorPage(model,"病案分类Id不能为空!");
}
if(StringUtils.isBlank(patientId)){
return retrunErrorPage(model,"记账号不能为空!");
return retrunErrorPage(model,"记账号不能为空!");
}
if(StringUtils.isBlank(visitId)){
return retrunErrorPage(model,"住院次数不能为空!");
return retrunErrorPage(model,"住院次数不能为空!");
}
List<Archive_Master> list = new ArrayList<>();
//判断工号是否存在
//判断工号是否存在
try {
/* String checkUserName = checkUserName(userName);
if(StringUtils.isNotBlank(checkUserName)){
return retrunErrorPage(model,checkUserName);
}*/
//判断分类id是否存在,协商assortIds = "00000000"为查询全部
//判断分类id是否存在,协商assortIds = "00000000"为查询全部
if(!allAddortIds.equals(assortIds)) {
String checkAssortIds = checkAssortIds(assortIds);
if (StringUtils.isNotBlank(checkAssortIds)) {
return retrunErrorPage(model, checkAssortIds);
}
}
//判断记账号是否存在
//判断记账号是否存在
list = archiveMasterService.selectByObject(patientId,visitId);
if(null == list || list.isEmpty()){
return retrunErrorPage(model,"病历不存在!");
return retrunErrorPage(model,"病历不存在!");
}
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
@ -95,19 +95,19 @@ public class FontController {
}
/**
*
*
* */
private String retrunErrorPage(Model model, String errorMsg){
System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮<E69F9F>
// System.out.println(System.getProperty("file.encoding"));//当前文件的编码方式
model.addAttribute("errorMsg",errorMsg);
return "font/error";
}
/**
* id
* id
* */
private String checkAssortIds(String assortIds){
System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮<E69F9F>
// System.out.println(System.getProperty("file.encoding"));//当前文件的编码方式
Zd_Assort assort = new Zd_Assort();
assort.setPrintFlag("0");
List<Zd_Assort> assortList = null;
@ -120,7 +120,7 @@ public class FontController {
if(null != assortList && !assortList.isEmpty()){
String[] split = assortIds.split(",");
for (String s : split) {
//定义分类存在
//定义分类存在
boolean exist = false;
if (StringUtils.isNotBlank(s)) {
for (Zd_Assort assort1 : assortList) {
@ -131,17 +131,17 @@ public class FontController {
}
}
if (!exist) {
return "病案分类Id有误!";
return "病案分类Id有误!";
}
}
}else{
return "病案分类Id有误!";
return "病案分类Id有误!";
}
return null;
}
/**
*
*
* @param masterId
* @return
*/
@ -150,7 +150,7 @@ public class FontController {
public String getPdfToPdf(String masterId){
try {
Archive_Master archiveMaster = archiveMasterService.selectById(masterId);
//转换科室数据字典
//转换科室数据字典
if(StringUtils.isNotBlank(archiveMaster.getDeptName())){
Emr_Dictionary dictionary = new Emr_Dictionary();
dictionary.setCode(archiveMaster.getDeptName());
@ -159,7 +159,7 @@ public class FontController {
if(null != dictionaries && !dictionaries.isEmpty()){
archiveMaster.setDeptName(dictionaries.get(0).getName());
}
//判断出院日期
//判断出院日期
String dischargeDateTime = archiveMaster.getDischargeDateTime();
if(StringUtils.isNotBlank(dischargeDateTime)){
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
@ -178,7 +178,7 @@ public class FontController {
}
/**
* showRecordIframe
* showRecordIframe
* */
/*@RequestMapping("showRecordIframe")
public String showRecordIframe(){
@ -186,7 +186,7 @@ public class FontController {
}*/
/**
* masterid
* masterid
* @return
* @throws Exception
*/
@ -194,23 +194,23 @@ public class FontController {
@RequestMapping(value = "/getRecordTypeTree")
public String getRecordTypeTree(HttpServletResponse response,String patientId,String assortIds){
response.setCharacterEncoding("utf-8");
System.out.println(System.getProperty("file.encoding"));//褰撳墠鏂囦欢鐨勭紪鐮佹柟寮<E69F9F>
// System.out.println(System.getProperty("file.encoding"));//当前文件的编码方式
List<AssortTypeTree> treeList = new ArrayList<>();
if(StringUtils.isNotBlank(patientId) && StringUtils.isNotBlank(assortIds)){
List<Archive_Detail> list = new ArrayList<>();
//assortIds等于协商的全查的分类id全查
//assortIds等于协商的全查的分类id全查
try {
if(allAddortIds.equals(assortIds)){
list = archiveDetailService.selectTypeTreeByPatientIdAndAssortIds(patientId, null);
}else{
//否则按条件查
//分类id分别以单引号隔开
//否则按条件查
//分类id分别以单引号隔开
StringBuilder assortIdStr = new StringBuilder();
String[] split = assortIds.split(",");
for (String s : split) {
assortIdStr.append("'").append(s).append("',");
}
//去掉最后一个逗号
//去掉最后一个逗号
assortIdStr = new StringBuilder(assortIdStr.substring(0, assortIdStr.length() - 1));
list = archiveDetailService.selectTypeTreeByPatientIdAndAssortIds(patientId, assortIdStr.toString());
}
@ -220,18 +220,18 @@ public class FontController {
}
if(null != list && !list.isEmpty()){
Set<String> assortList = new LinkedHashSet<>();
//抽取首次病程记录
String strTemp = "首次病程";
//抽取首次病程记录
String strTemp = "首次病程";
String assortId = "11";
//定义护理记录里的首次护理记录排前头
String nurseTemp = "首次护理";
//定义护理记录里的首次护理记录排前头
String nurseTemp = "首次护理";
String nurseAssortId = "7";
Archive_Detail detailTemp = new Archive_Detail();
Archive_Detail nurseDetailVoTemp = new Archive_Detail();
//分类去重
//分类去重
for(Archive_Detail detail : list){
assortList.add(detail.getSubassort());
//获取title
//获取title
String title = detail.getTitle();
if(StringUtils.isNotBlank(title) && detail.getTitle().contains(strTemp)){
detailTemp = detail;
@ -240,41 +240,41 @@ public class FontController {
nurseDetailVoTemp = detail;
}
}
//组织树
//组织树
int id = 1;
//定义第一层的id为第二层父id
//定义第一层的id为第二层父id
int oneParentId = 0;
//定义第二层的id为第三层父id
//定义第二层的id为第三层父id
int twoParentId = 0;
AssortTypeTree tree = new AssortTypeTree();
//第一层,根目录全部影像资料
//第一层,根目录全部影像资料
tree.setId(id);
tree.setParentId(0);
tree.setName("全部影像资料");
tree.setName("全部影像资料");
tree.setChecked("true");
treeList.add(tree);
oneParentId = id;
id++;
for(String assortName : assortList){
AssortTypeTree tree1 = new AssortTypeTree();
//第二层,分类名称
//第二层,分类名称
tree1.setId(id);
tree1.setParentId(oneParentId);
twoParentId = id;
id++;
//定义该类的数量
//定义该类的数量
int count = 0;
//定义是否添加了首次病程
//定义是否添加了首次病程
boolean flag = false;
boolean nurseflag = false;
for(Archive_Detail detail : list){
if(StringUtils.isNoneBlank(detail.getSubassort()) && assortName.equals(detail.getSubassort())){
String assortid = detail.getAssortid();
if(StringUtils.isNotBlank(assortid) && assortid.equals(assortId)){
//是病程记录
//是病程记录
if(!flag && StringUtils.isNotBlank(detailTemp.getTitle())){
AssortTypeTree tree2 = new AssortTypeTree();
//第三层,资料名称
//第三层,资料名称
count++;
tree2.setId(id);
tree2.setParentId(twoParentId);
@ -287,10 +287,10 @@ public class FontController {
}
}
if(StringUtils.isNotBlank(assortid) && assortid.equals(nurseAssortId)){
//是护理记录
//是护理记录
if(!nurseflag && StringUtils.isNotBlank(nurseDetailVoTemp.getTitle())){
AssortTypeTree tree2 = new AssortTypeTree();
//第三层,资料名称
//第三层,资料名称
count++;
tree2.setId(id);
tree2.setParentId(twoParentId);
@ -304,7 +304,7 @@ public class FontController {
}
if(!detail.equals(detailTemp) && !detail.equals(nurseDetailVoTemp)) {
AssortTypeTree tree2 = new AssortTypeTree();
//第三层,资料名称
//第三层,资料名称
count++;
tree2.setId(id);
tree2.setParentId(twoParentId);
@ -326,7 +326,7 @@ public class FontController {
}
/**
* idPDFpdf
* idPDFpdf
* @param response
* @param detailIds
* @return
@ -342,13 +342,13 @@ public class FontController {
detail.setTitle(detailIds);
archiveDetailService.selectByIdStrFont(response,session,detail);
}else{
//存至session
//存至session
session.setAttribute("showRecord",null);
}
return Msg.success();
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
return Msg.fail("查看出错了,请联系系统管理员");
return Msg.fail("查看出错了,请联系系统管理员");
//e.printStackTrace();
}
}

Loading…
Cancel
Save