@ -417,20 +417,15 @@ public class CommomSearchController {
* /
@RequestMapping ( "getAssortList" )
@ResponseBody
public ResultUtil getAssortList ( HttpServletRequest request ) {
try {
Power_User user = ( Power_User ) request . getSession ( ) . getAttribute ( "CURRENT_USER" ) ;
List < Zd_Assort > zdAssorts = new ArrayList < > ( ) ;
if ( user . getRoleId ( ) = = 0 | | user . getRoleId ( ) = = - 100 ) {
zdAssorts = assortMapper . selectAll ( new Zd_Assort ( ) ) ;
} else {
zdAssorts = assortMapper . selectAllAndUserReaderByUserIdAndRoleId ( user . getUserId ( ) , user . getRoleId ( ) ) ;
}
return ResultUtil . ok ( zdAssorts ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( "查询图片分类出错了,请联系系统管理员!" ) ;
public ResultUtil getAssortList ( HttpServletRequest request ) throws Exception {
Power_User user = ( Power_User ) request . getSession ( ) . getAttribute ( "CURRENT_USER" ) ;
List < Zd_Assort > zdAssorts = new ArrayList < > ( ) ;
if ( user . getRoleId ( ) = = 0 | | user . getRoleId ( ) = = - 100 ) {
zdAssorts = assortMapper . selectAll ( new Zd_Assort ( ) ) ;
} else {
zdAssorts = assortMapper . selectAllAndUserReaderByUserIdAndRoleId ( user . getUserId ( ) , user . getRoleId ( ) ) ;
}
return ResultUtil . ok ( zdAssorts ) ;
}
/ * *
@ -507,7 +502,7 @@ public class CommomSearchController {
@OptionalLog ( module = "保存" , methods = "病案信息修改" )
@RequestMapping ( "updateCommomInfo" )
@ResponseBody
public ResultUtil updateCommomInfo ( CommomVo commomVo ) {
public ResultUtil updateCommomInfo ( CommomVo commomVo ) throws Exception {
if ( null ! = commomVo . getInpatientNo ( ) ) {
int vo = commomMapper . selectCountByPatients ( commomVo . getPatientId ( ) ) ;
if ( vo > 0 ) {
@ -1124,25 +1119,20 @@ public class CommomSearchController {
@OptionalLog ( module = "修改" , methods = "档案预览页面病案图片重新分类" )
@RequestMapping ( value = "updateScanAssort" )
@ResponseBody
public ResultUtil updateScanAssort ( String patientId , String assortIds , Integer index , String newAssortId ) {
public ResultUtil updateScanAssort ( String patientId , String assortIds , Integer index , String newAssortId ) throws Exception {
if ( StringUtils . isNoneBlank ( patientId ) & & StringUtils . isNoneBlank ( assortIds ) & & null ! = index & & StringUtils . isNoneBlank ( newAssortId ) ) {
try {
//根据index:当前pdf页数, patientId, admissIds获取pdf信息
List < ScanPathVo > scanPathVos = getPdfPathVo ( index , patientId , assortIds ) ;
List < String > list = new ArrayList < > ( ) ;
if ( null ! = scanPathVos & & ! scanPathVos . isEmpty ( ) ) {
for ( ScanPathVo scanPathVo : scanPathVos ) {
list . add ( scanPathVo . getScanPage ( ) ) ;
}
//批量更新
scanAssortService . SimpleUpdate ( patientId , newAssortId , list ) ;
return ResultUtil . ok ( ) ;
} else {
return ResultUtil . error ( "无图片" ) ;
//根据index:当前pdf页数, patientId, admissIds获取pdf信息
List < ScanPathVo > scanPathVos = getPdfPathVo ( index , patientId , assortIds ) ;
List < String > list = new ArrayList < > ( ) ;
if ( null ! = scanPathVos & & ! scanPathVos . isEmpty ( ) ) {
for ( ScanPathVo scanPathVo : scanPathVos ) {
list . add ( scanPathVo . getScanPage ( ) ) ;
}
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return null ;
//批量更新
scanAssortService . SimpleUpdate ( patientId , newAssortId , list ) ;
return ResultUtil . ok ( ) ;
} else {
return ResultUtil . error ( "无图片" ) ;
}
}
return null ;
@ -1165,17 +1155,21 @@ public class CommomSearchController {
@OptionalLog ( module = "修改" , methods = "档案预览页面病案图片重新分类" , fieldName = "name" , tableName = "commomtable" )
@RequestMapping ( value = "updateScanAssortByBlood" , method = RequestMethod . POST )
@ResponseBody
public ResultUtil updateScanAssortByBlood ( CommomVo commomVo , String assortIds , String newAssortId ) {
public ResultUtil updateScanAssortByBlood ( CommomVo commomVo , String assortIds , String newAssortId ) throws Exception {
if ( StringUtils . isNoneBlank ( commomVo . getPatientId ( ) ) & & StringUtils . isNoneBlank ( assortIds ) & & StringUtils . isNoneBlank ( newAssortId ) ) {
try {
//根据patientId, admissIds(scanPage分类图片集合)批量更新分段id assrotdId
//批量更新
scanAssortService . SimpleUpdateByPatientIdAndScanPages ( commomVo . getPatientId ( ) , newAssortId , assortIds ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return null ;
//根据patientId, admissIds(scanPage分类图片集合)批量更新分段id assrotdId
//组织picNames
String picNameStr = "" ;
String [ ] picNames = assortIds . split ( "," ) ;
for ( String picName : picNames ) {
if ( StringUtils . isNotBlank ( picName ) ) {
picNameStr + = "'" + picName + "'," ;
}
}
picNameStr = picNameStr . substring ( 0 , picNameStr . length ( ) - 1 ) ;
//批量更新
scanAssortService . SimpleUpdateByPatientIdAndScanPages ( commomVo . getPatientId ( ) , newAssortId , picNameStr ) ;
return ResultUtil . ok ( ) ;
}
return null ;
}
@ -1449,56 +1443,50 @@ public class CommomSearchController {
@RequestMapping ( "addCodeType" )
@ResponseBody
public ResultUtil addCodeType ( Emr_Code_Type codeType , Integer index , String patientId , String assortIds ,
HttpServletRequest request ) {
HttpServletRequest request ) throws Exception {
if ( StringUtils . isBlank ( assortIds ) ) {
return ResultUtil . error ( "没有分段数据,请先在用户分配调阅里添加并分配分段数据!" ) ;
}
if ( StringUtils . isNoneBlank ( patientId ) & & null ! = index ) {
try {
//验证标志和名称都不能重复
Emr_Code_Type isExistFlag = codeTypeMapper . checkFlagAndNameIsExist ( codeType . getTypeFlag ( ) , null ) ;
Emr_Code_Type isExistName = codeTypeMapper . checkFlagAndNameIsExist ( null , codeType . getTypeName ( ) ) ;
if ( codeType . getId ( ) = = null ) {
if ( isExistFlag = = null ) {
if ( isExistName = = null ) {
//新增
codeType . setPatientId ( patientId ) ;
//根据index:当前pdf页数, patientId, admissIds获取pdf信息
List < ScanPathVo > scanPathVo = getPdfPathVo ( index , patientId , assortIds ) ;
if ( null ! = scanPathVo & & ! scanPathVo . isEmpty ( ) ) {
codeType . setAssortId ( scanPathVo . get ( 0 ) . getAssortId ( ) ) ;
codeType . setScanPage ( scanPathVo . get ( 0 ) . getScanPage ( ) ) ;
} else {
return ResultUtil . error ( "图片不存在!" ) ;
}
codeTypeService . addCodeType ( codeType , request ) ;
return ResultUtil . ok ( ) ;
//验证标志和名称都不能重复
Emr_Code_Type isExistFlag = codeTypeMapper . checkFlagAndNameIsExist ( codeType . getTypeFlag ( ) , null ) ;
Emr_Code_Type isExistName = codeTypeMapper . checkFlagAndNameIsExist ( null , codeType . getTypeName ( ) ) ;
if ( codeType . getId ( ) = = null ) {
if ( isExistFlag = = null ) {
if ( isExistName = = null ) {
//新增
codeType . setPatientId ( patientId ) ;
//根据index:当前pdf页数, patientId, admissIds获取pdf信息
List < ScanPathVo > scanPathVo = getPdfPathVo ( index , patientId , assortIds ) ;
if ( null ! = scanPathVo & & ! scanPathVo . isEmpty ( ) ) {
codeType . setAssortId ( scanPathVo . get ( 0 ) . getAssortId ( ) ) ;
codeType . setScanPage ( scanPathVo . get ( 0 ) . getScanPage ( ) ) ;
} else {
return ResultUtil . error ( " 类别名称不能重复 !") ;
return ResultUtil . error ( "图片不存在!" ) ;
}
codeTypeService . addCodeType ( codeType , request ) ;
return ResultUtil . ok ( ) ;
} else {
return ResultUtil . error ( "类别标志不能重复!" ) ;
return ResultUtil . error ( "类别 名称 不能重复!") ;
}
} else {
if ( null ! = isExistName & & ! isExistName . getId ( ) . equals ( codeType . getId ( ) ) ) {
return ResultUtil . error ( "类别名称不能重复!" ) ;
return ResultUtil . error ( "类别标志不能重复!" ) ;
}
} else {
if ( null ! = isExistName & & ! isExistName . getId ( ) . equals ( codeType . getId ( ) ) ) {
return ResultUtil . error ( "类别名称不能重复!" ) ;
} else {
if ( null ! = isExistFlag & & ! isExistFlag . getId ( ) . equals ( codeType . getId ( ) ) ) {
return ResultUtil . error ( "类别标志不能重复!" ) ;
} else {
if ( null ! = isExistFlag & & ! isExistFlag . getId ( ) . equals ( codeType . getId ( ) ) ) {
return ResultUtil . error ( "类别标志不能重复!" ) ;
} else {
//修改
codeTypeService . updateCodeType ( codeType , request ) ;
return ResultUtil . ok ( ) ;
}
//修改
codeTypeService . updateCodeType ( codeType , request ) ;
return ResultUtil . ok ( ) ;
}
}
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
} else {
return null ;
}
return null ;
}
/ * *
@ -1517,14 +1505,9 @@ public class CommomSearchController {
@OptionalLog ( module = "删除" , methods = "编码类别" , fieldName = "typeName" , tableName = "emr_code_type" )
@RequestMapping ( value = "delCodeTypeById/{id}" )
@ResponseBody
public ResultUtil delCodeTypeById ( @PathVariable ( "id" ) Integer id ) {
try {
codeTypeService . deleteByPrimaryKey ( id ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
public ResultUtil delCodeTypeById ( @PathVariable ( "id" ) Integer id ) throws Exception {
codeTypeService . deleteByPrimaryKey ( id ) ;
return ResultUtil . ok ( ) ;
}
/********************************************手术编码*******************************************************/
@ -1543,14 +1526,9 @@ public class CommomSearchController {
@RequiresPermissions ( "/commom/addOperCode" )
@RequestMapping ( value = "addDiagCode" )
@ResponseBody
public ResultUtil addDiagCode ( String patientId , String diagNos , String diagNames , String diagCodes , String inhospstats ) {
try {
diagService . addDiagCode ( patientId , diagNos , diagNames , diagCodes , inhospstats ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
public ResultUtil addDiagCode ( String patientId , String diagNos , String diagNames , String diagCodes , String inhospstats ) throws Exception {
diagService . addDiagCode ( patientId , diagNos , diagNames , diagCodes , inhospstats ) ;
return ResultUtil . ok ( ) ;
}
/ * *
@ -1567,19 +1545,15 @@ public class CommomSearchController {
* /
@RequestMapping ( value = "checkOperateNo" )
@ResponseBody
public ResultUtil checkOperateNo ( String patientId , Short operateNo ) {
public ResultUtil checkOperateNo ( String patientId , Short operateNo ) throws Exception {
if ( StringUtils . isNoneBlank ( patientId ) & & operateNo ! = null ) {
try {
//根据patientId和手术编码查询手术编码集合
List < T_Operate > operates = operateService . selectAllByPatientId ( patientId , operateNo ) ;
if ( operates ! = null & & ! operates . isEmpty ( ) ) {
//存在
return ResultUtil . error ( ) ;
} else {
return ResultUtil . ok ( ) ;
}
} catch ( Exception e ) {
e . printStackTrace ( ) ;
//根据patientId和手术编码查询手术编码集合
List < T_Operate > operates = operateService . selectAllByPatientId ( patientId , operateNo ) ;
if ( operates ! = null & & ! operates . isEmpty ( ) ) {
//存在
return ResultUtil . error ( ) ;
} else {
return ResultUtil . ok ( ) ;
}
}
return ResultUtil . error ( ) ;
@ -1599,15 +1573,10 @@ public class CommomSearchController {
* /
@RequestMapping ( value = "getOperByCodeOrName" , produces = { "text/json;charset=UTF-8" } )
@ResponseBody
public String getOperByCodeOrName ( String code , String name ) {
public String getOperByCodeOrName ( String code , String name ) throws Exception {
//根据手术编码和名称查询手术编码对象
try {
List < Zd_Cm3 > cm3s = cm3Mapper . selectAll ( code , name ) ;
return JSON . toJSONString ( cm3s ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return null ;
}
List < Zd_Cm3 > cm3s = cm3Mapper . selectAll ( code , name ) ;
return JSON . toJSONString ( cm3s ) ;
}
/ * *
@ -1626,37 +1595,32 @@ public class CommomSearchController {
@OptionalLog ( module = "新增" , methods = "手术编码" , fieldName = "operateName" )
@RequestMapping ( value = "saveOperCode" )
@ResponseBody
public ResultUtil saveOperCode ( T_Operate operate , Integer isUpdateOperNo , HttpServletRequest request ) {
try {
if ( operate . getCurrentOperateNo ( ) = = null ) {
//新增
boolean flag = FormTokenFlagUtil . isFlag ( request ) ;
if ( ! flag ) {
return ResultUtil . error ( "请不要重复提交!" ) ;
}
operateService . insert ( operate ) ;
} else {
//修改
if ( isUpdateOperNo = = 1 ) {
//有修改手术序号
//查询手术序号是否存在
List < T_Operate > operates = operateService . selectAllByPatientId ( operate . getPatientId ( ) , operate . getOperateNo ( ) ) ;
if ( null ! = operates & & ! operates . isEmpty ( ) ) {
//存在
return ResultUtil . error ( "该手术序号已存在!" ) ;
} else {
operateService . updateByPrimaryKeySelective ( operate ) ;
}
public ResultUtil saveOperCode ( T_Operate operate , Integer isUpdateOperNo , HttpServletRequest request ) throws Exception {
if ( operate . getCurrentOperateNo ( ) = = null ) {
//新增
boolean flag = FormTokenFlagUtil . isFlag ( request ) ;
if ( ! flag ) {
return ResultUtil . error ( "请不要重复提交!" ) ;
}
operateService . insert ( operate ) ;
} else {
//修改
if ( isUpdateOperNo = = 1 ) {
//有修改手术序号
//查询手术序号是否存在
List < T_Operate > operates = operateService . selectAllByPatientId ( operate . getPatientId ( ) , operate . getOperateNo ( ) ) ;
if ( null ! = operates & & ! operates . isEmpty ( ) ) {
//存在
return ResultUtil . error ( "该手术序号已存在!" ) ;
} else {
//手术序号一样
operateService . updateByPrimaryKeySelective ( operate ) ;
}
} else {
//手术序号一样
operateService . updateByPrimaryKeySelective ( operate ) ;
}
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
return ResultUtil . ok ( ) ;
}
/ * *
@ -1675,15 +1639,10 @@ public class CommomSearchController {
@OptionalLog ( module = "删除" , methods = "手术编码" , fieldName = "operateName" , tableName = "t_operate" )
@RequestMapping ( value = "deleteOperCodeByPatientIdAndOperNo" )
@ResponseBody
public ResultUtil deleteOperCodeByPatientIdAndOperNo ( String patientId , Short operateNo ) {
public ResultUtil deleteOperCodeByPatientIdAndOperNo ( String patientId , Short operateNo ) throws Exception {
if ( StringUtils . isNoneBlank ( patientId ) & & null ! = operateNo ) {
try {
operateService . deleteOperCodeByPatientIdAndOperNo ( patientId , operateNo ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
operateService . deleteOperCodeByPatientIdAndOperNo ( patientId , operateNo ) ;
return ResultUtil . ok ( ) ;
} else {
return ResultUtil . error ( ) ;
}
@ -1704,14 +1663,9 @@ public class CommomSearchController {
@RequiresPermissions ( "/commom/addOperCode" )
@RequestMapping ( value = "addOperCode" )
@ResponseBody
public ResultUtil addOperCode ( String patientId , String operNos , String operDates , String operCodes , String operNames , String operateClasses , String operators , String assistant1s , String assistant2s , String cuts , String chossurgs , String anaesthesiaTypes , String anaesthesiaNames ) {
try {
operateService . addOperCode ( patientId , operNos , operDates , operCodes , operNames , operateClasses , operators , assistant1s , assistant2s , cuts , chossurgs , anaesthesiaTypes , anaesthesiaNames ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
public ResultUtil addOperCode ( String patientId , String operNos , String operDates , String operCodes , String operNames , String operateClasses , String operators , String assistant1s , String assistant2s , String cuts , String chossurgs , String anaesthesiaTypes , String anaesthesiaNames ) throws Exception {
operateService . addOperCode ( patientId , operNos , operDates , operCodes , operNames , operateClasses , operators , assistant1s , assistant2s , cuts , chossurgs , anaesthesiaTypes , anaesthesiaNames ) ;
return ResultUtil . ok ( ) ;
}
/ * *
@ -1728,14 +1682,9 @@ public class CommomSearchController {
* /
@RequestMapping ( value = "getDictionaryByTypeCode" , produces = { "text/json;charset=UTF-8" } )
@ResponseBody
public String getDictionaryByTypeCode ( String typeCode ) {
try {
List < Emr_Dictionary > dictionaries = dictionaryMapper . selectDictionaryByTypeCode ( typeCode ) ;
return JSON . toJSONString ( dictionaries ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return null ;
}
public String getDictionaryByTypeCode ( String typeCode ) throws Exception {
List < Emr_Dictionary > dictionaries = dictionaryMapper . selectDictionaryByTypeCode ( typeCode ) ;
return JSON . toJSONString ( dictionaries ) ;
}
/ * *
@ -1752,14 +1701,9 @@ public class CommomSearchController {
* /
@RequestMapping ( value = "getIcdCodeList" , produces = { "text/json;charset=UTF-8" } )
@ResponseBody
public String getIcdCodeList ( ) {
try {
List < Zd_Icd_Code > icdCodes = icdCodeMapper . selectAll ( null , null ) ;
return JSON . toJSONString ( icdCodes ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return null ;
}
public String getIcdCodeList ( ) throws Exception {
List < Zd_Icd_Code > icdCodes = icdCodeMapper . selectAll ( null , null ) ;
return JSON . toJSONString ( icdCodes ) ;
}
/ * *
@ -1776,14 +1720,9 @@ public class CommomSearchController {
* /
@RequestMapping ( value = "getIcdCodeByCodeOrName" , produces = { "text/json;charset=UTF-8" } )
@ResponseBody
public String getIcdCodeByCodeOrName ( String code , String name ) {
try {
List < Zd_Icd_Code > icdCodes = icdCodeMapper . selectAll ( code , name ) ;
return JSON . toJSONString ( icdCodes ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return null ;
}
public String getIcdCodeByCodeOrName ( String code , String name ) throws Exception {
List < Zd_Icd_Code > icdCodes = icdCodeMapper . selectAll ( code , name ) ;
return JSON . toJSONString ( icdCodes ) ;
}
/ * *
@ -1800,18 +1739,14 @@ public class CommomSearchController {
* /
@RequestMapping ( value = "checkDiagNo" )
@ResponseBody
public ResultUtil checkDiagNo ( String patientId , Short diagNo ) {
public ResultUtil checkDiagNo ( String patientId , Short diagNo ) throws Exception {
if ( StringUtils . isNoneBlank ( patientId ) & & diagNo ! = null ) {
try {
List < T_Diag > diags = diagService . selectAllByPatientId ( patientId , diagNo ) ;
if ( diags ! = null & & ! diags . isEmpty ( ) ) {
//存在
return ResultUtil . error ( ) ;
} else {
return ResultUtil . ok ( ) ;
}
} catch ( Exception e ) {
e . printStackTrace ( ) ;
List < T_Diag > diags = diagService . selectAllByPatientId ( patientId , diagNo ) ;
if ( diags ! = null & & ! diags . isEmpty ( ) ) {
//存在
return ResultUtil . error ( ) ;
} else {
return ResultUtil . ok ( ) ;
}
}
return ResultUtil . error ( ) ;
@ -1833,37 +1768,32 @@ public class CommomSearchController {
@OptionalLog ( module = "保存" , methods = "西医诊断编码" , fieldName = "diagName" )
@RequestMapping ( value = "saveDiag" )
@ResponseBody
public ResultUtil saveDiag ( T_Diag diag , Integer isUpdateOperNo , HttpServletRequest request ) {
try {
if ( diag . getCurrentDiagNo ( ) = = null ) {
//新增
boolean flag = FormTokenFlagUtil . isFlag ( request ) ;
if ( ! flag ) {
return ResultUtil . error ( "请不要重复提交!" ) ;
}
diagService . insert ( diag ) ;
} else {
//修改
if ( isUpdateOperNo = = 1 ) {
//有修改序号
//查询序号是否存在
List < T_Diag > diags = diagService . selectAllByPatientId ( diag . getPatientId ( ) , diag . getDiagNo ( ) ) ;
if ( null ! = diags & & ! diags . isEmpty ( ) ) {
//存在
return ResultUtil . error ( "该诊断序号已存在!" ) ;
} else {
diagService . updateByPrimaryKeySelective ( diag ) ;
}
public ResultUtil saveDiag ( T_Diag diag , Integer isUpdateOperNo , HttpServletRequest request ) throws Exception {
if ( diag . getCurrentDiagNo ( ) = = null ) {
//新增
boolean flag = FormTokenFlagUtil . isFlag ( request ) ;
if ( ! flag ) {
return ResultUtil . error ( "请不要重复提交!" ) ;
}
diagService . insert ( diag ) ;
} else {
//修改
if ( isUpdateOperNo = = 1 ) {
//有修改序号
//查询序号是否存在
List < T_Diag > diags = diagService . selectAllByPatientId ( diag . getPatientId ( ) , diag . getDiagNo ( ) ) ;
if ( null ! = diags & & ! diags . isEmpty ( ) ) {
//存在
return ResultUtil . error ( "该诊断序号已存在!" ) ;
} else {
//诊断序号一样
diagService . updateByPrimaryKeySelective ( diag ) ;
}
} else {
//诊断序号一样
diagService . updateByPrimaryKeySelective ( diag ) ;
}
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
return ResultUtil . ok ( ) ;
}
/*****************************************中医诊断********************************************************/
@ -1883,15 +1813,10 @@ public class CommomSearchController {
@OptionalLog ( module = "删除" , methods = "西医诊断编码" , fieldName = "diagName" , tableName = "t_diag" )
@RequestMapping ( value = "deleteCodeByPatientIdAndDiagNo" )
@ResponseBody
public ResultUtil deleteCodeByPatientIdAndDiagNo ( String patientId , Short diagNo ) {
public ResultUtil deleteCodeByPatientIdAndDiagNo ( String patientId , Short diagNo ) throws Exception {
if ( StringUtils . isNoneBlank ( patientId ) & & null ! = diagNo ) {
try {
diagService . deleteDiagByPatientIdAndDiagNo ( patientId , diagNo ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
diagService . deleteDiagByPatientIdAndDiagNo ( patientId , diagNo ) ;
return ResultUtil . ok ( ) ;
} else {
return ResultUtil . error ( ) ;
}
@ -1911,18 +1836,14 @@ public class CommomSearchController {
* /
@RequestMapping ( value = "checkHerbNo" )
@ResponseBody
public ResultUtil checkHerbNo ( String patientId , Short herbNo ) {
public ResultUtil checkHerbNo ( String patientId , Short herbNo ) throws Exception {
if ( StringUtils . isNoneBlank ( patientId ) & & herbNo ! = null ) {
try {
List < T_Herb_Diag > herbDiags = herbDiagService . selectAllByPatientId ( patientId , herbNo ) ;
if ( herbDiags ! = null & & ! herbDiags . isEmpty ( ) ) {
//存在
return ResultUtil . error ( ) ;
} else {
return ResultUtil . ok ( ) ;
}
} catch ( Exception e ) {
e . printStackTrace ( ) ;
List < T_Herb_Diag > herbDiags = herbDiagService . selectAllByPatientId ( patientId , herbNo ) ;
if ( herbDiags ! = null & & ! herbDiags . isEmpty ( ) ) {
//存在
return ResultUtil . error ( ) ;
} else {
return ResultUtil . ok ( ) ;
}
}
return ResultUtil . error ( ) ;
@ -1944,37 +1865,32 @@ public class CommomSearchController {
@OptionalLog ( module = "保存" , methods = "中医诊断编码" , fieldName = "herbName" )
@RequestMapping ( value = "saveHerbDiag" )
@ResponseBody
public ResultUtil saveHerbDiag ( T_Herb_Diag herbDiag , Integer isUpdateOperNo , HttpServletRequest request ) {
try {
if ( herbDiag . getCurrentHerbDiagNo ( ) = = null ) {
//新增
boolean flag = FormTokenFlagUtil . isFlag ( request ) ;
if ( ! flag ) {
return ResultUtil . error ( "请不要重复提交!" ) ;
}
herbDiagService . insert ( herbDiag ) ;
} else {
//修改
if ( isUpdateOperNo = = 1 ) {
//有修改序号
//查询序号是否存在
List < T_Herb_Diag > herbDiags = herbDiagService . selectAllByPatientId ( herbDiag . getPatientId ( ) , herbDiag . getHerbNo ( ) ) ;
if ( null ! = herbDiags & & ! herbDiags . isEmpty ( ) ) {
//存在
return ResultUtil . error ( "该诊断序号已存在!" ) ;
} else {
herbDiagService . updateByPrimaryKeySelective ( herbDiag ) ;
}
public ResultUtil saveHerbDiag ( T_Herb_Diag herbDiag , Integer isUpdateOperNo , HttpServletRequest request ) throws Exception {
if ( herbDiag . getCurrentHerbDiagNo ( ) = = null ) {
//新增
boolean flag = FormTokenFlagUtil . isFlag ( request ) ;
if ( ! flag ) {
return ResultUtil . error ( "请不要重复提交!" ) ;
}
herbDiagService . insert ( herbDiag ) ;
} else {
//修改
if ( isUpdateOperNo = = 1 ) {
//有修改序号
//查询序号是否存在
List < T_Herb_Diag > herbDiags = herbDiagService . selectAllByPatientId ( herbDiag . getPatientId ( ) , herbDiag . getHerbNo ( ) ) ;
if ( null ! = herbDiags & & ! herbDiags . isEmpty ( ) ) {
//存在
return ResultUtil . error ( "该诊断序号已存在!" ) ;
} else {
//诊断序号一样
herbDiagService . updateByPrimaryKeySelective ( herbDiag ) ;
}
} else {
//诊断序号一样
herbDiagService . updateByPrimaryKeySelective ( herbDiag ) ;
}
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
return ResultUtil . ok ( ) ;
}
/ * *
@ -1993,15 +1909,10 @@ public class CommomSearchController {
@OptionalLog ( module = "删除" , methods = "中医诊断编码" , fieldName = "herbName" , tableName = "t_herb_diag" )
@RequestMapping ( value = "deleteCodeByPatientIdAndHerbNo" )
@ResponseBody
public ResultUtil deleteCodeByPatientIdAndHerbNo ( String patientId , Short herbNo ) {
public ResultUtil deleteCodeByPatientIdAndHerbNo ( String patientId , Short herbNo ) throws Exception {
if ( StringUtils . isNoneBlank ( patientId ) & & null ! = herbNo ) {
try {
herbDiagService . deleteHerbDiagByPatientIdAndHerbNo ( patientId , herbNo ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( ) ;
}
herbDiagService . deleteHerbDiagByPatientIdAndHerbNo ( patientId , herbNo ) ;
return ResultUtil . ok ( ) ;
} else {
return ResultUtil . error ( ) ;
}
@ -2119,17 +2030,12 @@ public class CommomSearchController {
@RequiresPermissions ( "/commom/updatePic" )
@RequestMapping ( value = "updatePic" , method = RequestMethod . POST )
@ResponseBody
public ResultUtil updatePic ( CommomVo commomVo , @RequestParam ( required = false , value = "files" ) MultipartFile [ ] files , String assortId ) {
try {
String str = commomService . updatePic ( files , commomVo . getPatientId ( ) , assortId ) ;
if ( StringUtils . isNotBlank ( str ) ) {
return ResultUtil . error ( str ) ;
}
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( "上传出错了,请联系系统管理员!" ) ;
public ResultUtil updatePic ( CommomVo commomVo , @RequestParam ( required = false , value = "files" ) MultipartFile [ ] files , String assortId ) throws Exception {
ResultUtil resultUtil = commomService . updatePic ( files , commomVo . getPatientId ( ) , assortId ) ;
if ( ! resultUtil . getCode ( ) . equals ( 0 ) ) {
return resultUtil ;
}
return ResultUtil . ok ( ) ;
}
/ * *
@ -2148,17 +2054,12 @@ public class CommomSearchController {
@OptionalLog ( module = "删除" , methods = "档案预览页面删除病案图片" , fieldName = "name" , tableName = "commomtable" )
@RequestMapping ( value = "delScanAssortByBlood" , method = RequestMethod . POST )
@ResponseBody
public ResultUtil delScanAssortByBlood ( String patientId ) {
public ResultUtil delScanAssortByBlood ( String patientId ) throws Exception {
HttpServletRequest request = ( ( ServletRequestAttributes ) RequestContextHolder . getRequestAttributes ( ) ) . getRequest ( ) ;
String assortIds = request . getParameter ( "assortIds" ) ;
if ( StringUtils . isNoneBlank ( patientId ) & & StringUtils . isNoneBlank ( assortIds ) ) {
try {
scanAssortService . SimpleDelByPatientIdAndScanPages ( patientId , assortIds ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return null ;
}
scanAssortService . SimpleDelByPatientIdAndScanPages ( patientId , assortIds ) ;
return ResultUtil . ok ( ) ;
}
return null ;
}
@ -2180,14 +2081,9 @@ public class CommomSearchController {
@RequiresPermissions ( "/commom/addReMark" )
@RequestMapping ( value = "updateRecordReMark" , method = RequestMethod . POST )
@ResponseBody
public ResultUtil updateRecordReMark ( CommomVo commomVo ) {
try {
commomMapper . updateRecordReMark ( commomVo ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( "修改失败,请联系系统管理员!" ) ;
}
public ResultUtil updateRecordReMark ( CommomVo commomVo ) throws Exception {
commomService . updateRecordReMark ( commomVo ) ;
return ResultUtil . ok ( ) ;
}
/**************************病案备注结束*******************************/
/**************************恢复已删除图片开始*************************/
@ -2282,18 +2178,36 @@ public class CommomSearchController {
@RequiresPermissions ( "/commom/recoverPic" )
@RequestMapping ( value = "recoverPic" , method = RequestMethod . POST )
@ResponseBody
public ResultUtil recoverPic ( CommomVo commomVo , String scanPages ) {
try {
scanAssortService . recoverPic ( commomVo . getPatientId ( ) , scanPages ) ;
return ResultUtil . ok ( ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return ResultUtil . error ( e . getMessage ( ) ) ;
}
public ResultUtil recoverPic ( CommomVo commomVo , String scanPages ) throws Exception {
scanAssortService . recoverPic ( commomVo . getPatientId ( ) , scanPages ) ;
return ResultUtil . ok ( ) ;
}
/**************************恢复已删除图片结束***********************/
/**************************病案维护开始*****************************/
/ * *
* 验 证 编 号 和 协 议 号 是 否 存 在
* @param commomBlood
* @return
* @throws Exception
* /
//脐血库
@RequestMapping ( "validExistForm" )
@ResponseBody
public ResultUtil validExistForm ( CommomBlood commomBlood ) throws Exception {
String patientId = commomBlood . getPatientId ( ) ;
commomBlood . setPatientId ( null ) ;
FontCommom commom = new FontCommom ( ) ;
BeanUtils . copyProperties ( commomBlood , commom ) ;
List < FontCommom > list = commomMapper . isExistInpatient ( commom ) ;
if ( ! CollectionUtils . isEmpty ( list ) ) {
//修改的情况,同一份病案返回成功
if ( StringUtils . isNotBlank ( patientId ) & & list . get ( 0 ) . getPatientId ( ) . equals ( patientId ) ) {
return ResultUtil . ok ( ) ;
}
return ResultUtil . ok ( "已存在" ) ;
}
return ResultUtil . ok ( ) ;
}
/ * *
* 脐 血 库 新 增 档 案
* @param commomBlood
@ -2302,7 +2216,7 @@ public class CommomSearchController {
* /
@OptionalLog ( module = "新增" , methods = "新增档案" )
@RequiresPermissions ( "/commom/addRecord" )
@RequestMapping ( "addRecord" )
@RequestMapping ( value = "addRecord" , method = RequestMethod . POST )
@ResponseBody
public ResultUtil addRecordBlood ( @Valid CommomBlood commomBlood , HttpServletRequest request ) throws Exception {
//判断formToken
@ -2310,17 +2224,25 @@ public class CommomSearchController {
if ( ! flag ) {
return ResultUtil . error ( "请不要重复提交!" ) ;
}
//判断脐血编号不为空
if ( StringUtils . isBlank ( commomBlood . getInpatientNo ( ) ) ) {
return ResultUtil . error ( "脐血编号不能为空!" ) ;
//判断表单不为空和不可重复的字段
ResultUtil result = validFieldOper ( commomBlood ) ;
if ( ! result . getCode ( ) . equals ( 0 ) ) {
return result ;
}
//判断孕妇姓名不为空
if ( StringUtils . isBlank ( commomBlood . getName ( ) ) ) {
return ResultUtil . error ( "孕妇姓名不能为空!" ) ;
//进入添加病案方法
ResultUtil resultUtil = commomService . addRecordBlood ( commomBlood , request ) ;
//有错误返回错误信息
if ( ! resultUtil . getCode ( ) . equals ( 0 ) ) {
return resultUtil ;
}
commomService . addRecordBlood ( commomBlood ) ;
return ResultUtil . ok ( ) ;
}
/ * *
* 加 载 分 类 树
* @param request
* @return
* /
@RequestMapping ( "selectRecordTree" )
@ResponseBody
public List < Zd_Assort > selectRecordTree ( HttpServletRequest request ) {
@ -2346,5 +2268,72 @@ public class CommomSearchController {
return null ;
}
}
//判断表单不为空和不可重复的字段
private ResultUtil validFieldOper ( CommomBlood commomBlood ) throws Exception {
String patientId = commomBlood . getPatientId ( ) ;
//判断脐血编号不为空
String inpatientNo = commomBlood . getInpatientNo ( ) ;
if ( StringUtils . isBlank ( inpatientNo ) ) {
return ResultUtil . error ( "脐血编号不能为空!" ) ;
} else {
FontCommom commom = new FontCommom ( ) ;
commom . setInpatientNo ( inpatientNo ) ;
List < FontCommom > list = commomMapper . isExistInpatient ( commom ) ;
if ( ! CollectionUtils . isEmpty ( list ) ) {
if ( StringUtils . isNotBlank ( patientId ) ) {
if ( list . get ( 0 ) . getPatientId ( ) . equals ( patientId ) ) {
return ResultUtil . ok ( ) ;
}
}
return ResultUtil . error ( "脐血编号已存在!" ) ;
}
}
//验证协议号是否存在
String admissId = commomBlood . getAdmissId ( ) ;
if ( StringUtils . isNotBlank ( admissId ) ) {
FontCommom commom = new FontCommom ( ) ;
commom . setAdmissId ( admissId ) ;
List < FontCommom > list = commomMapper . isExistInpatient ( commom ) ;
if ( ! CollectionUtils . isEmpty ( list ) ) {
if ( StringUtils . isNotBlank ( patientId ) ) {
if ( list . get ( 0 ) . getPatientId ( ) . equals ( patientId ) ) {
return ResultUtil . ok ( ) ;
}
}
return ResultUtil . error ( "协议号已存在!" ) ;
}
}
//判断孕妇姓名不为空
if ( StringUtils . isBlank ( commomBlood . getName ( ) ) ) {
return ResultUtil . error ( "孕妇姓名不能为空!" ) ;
}
return ResultUtil . ok ( ) ;
}
@OptionalLog ( module = "修改" , methods = "修改档案" , fieldName = "name" , tableName = "commomtable" )
@RequiresPermissions ( "/commom/updateRecord" )
@RequestMapping ( value = "updateRecordBlood" , method = RequestMethod . POST )
@ResponseBody
public ResultUtil updateRecordBlood ( CommomBlood commomBlood ) throws Exception {
//判断表单不为空和不可重复的字段
ResultUtil resultUtil = validFieldOper ( commomBlood ) ;
if ( ! resultUtil . getCode ( ) . equals ( 0 ) ) {
return resultUtil ;
}
CommomVo commomVo = new CommomVo ( ) ;
BeanUtils . copyProperties ( commomBlood , commomVo ) ;
commomService . updateRecord ( commomVo ) ;
return ResultUtil . ok ( ) ;
}
@OptionalLog ( module = "删除" , methods = "删除档案" , fieldName = "name" , tableName = "commomtable" )
@RequiresPermissions ( "/commom/deleteRecord" )
@RequestMapping ( value = "deleteRecordBlood" , method = RequestMethod . POST )
@ResponseBody
public ResultUtil deleteRecordBlood ( String patientId ) throws Exception {
commomService . deleteRecord ( patientId ) ;
return ResultUtil . ok ( ) ;
}
/**************************病案维护结束*****************************/
}