@ -68,8 +68,7 @@ public class AnalysisService {
long endTime = 0 ;
long endTime = 0 ;
// 判断是否插入
// 判断是否插入
// messageLog = new MessageLog(message, InterfaceName.HIP_MESSAGE_SERVER, new Date(),webserviceId);
messageLog = new MessageLog ( message , InterfaceName . HIP_MESSAGE_SERVER , new Date ( ) , webserviceId ) ;
messageLog = new MessageLog ( message , InterfaceName . HIP_MESSAGE_SERVER , new Date ( ) ) ;
// 只要没有传过 才会插入新的
// 只要没有传过 才会插入新的
messageService . save ( messageLog ) ;
messageService . save ( messageLog ) ;
MessageDto messageDto = XMLUtils . xpathToBean ( message , tClass , parameter ) ;
MessageDto messageDto = XMLUtils . xpathToBean ( message , tClass , parameter ) ;
@ -83,13 +82,16 @@ public class AnalysisService {
Date date = simpleDateFormat . parse ( authorReportTime , new ParsePosition ( 0 ) ) ;
Date date = simpleDateFormat . parse ( authorReportTime , new ParsePosition ( 0 ) ) ;
String visitId = archiveMasterRepository . findVisitIdByTimeAndInpNo ( date , messageDto . getInpNo ( ) ) ;
String visitId = archiveMasterRepository . findVisitIdByTimeAndInpNo ( date , messageDto . getInpNo ( ) ) ;
messageDto . setVisitId ( visitId ) ;
messageDto . setVisitId ( visitId ) ;
} else if ( Objects . equals ( messageDto . getEntity ( ) , ExamApply . class . getName ( ) ) ) { // 申请单
ExamApply examApply = JSON . parseObject ( messageDto . getObject ( ) . toString ( ) , ExamApply . class ) ;
textContentTemp = changeApply ( examApply , parameter ) ;
}
}
archiveMasterId = messageService . getArchiveMasterId ( messageDto . getInpNo ( ) , messageDto . getVisitId ( ) );
archiveMasterId = messageService . getArchiveMasterId ( messageDto . getInpNo ( ) , messageDto . getVisitId ( ) , messageDto . getPatientId ( ) ) ;
if ( archiveMasterId ! = null ) {
if ( archiveMasterId ! = null ) {
if ( Objects . equals ( messageDto . getEntity ( ) , ExamApply . class . getName ( ) ) ) { // 申请单
ExamApply examApply = JSON . parseObject ( messageDto . getObject ( ) . toString ( ) , ExamApply . class ) ;
textContentTemp = changeApply ( examApply , parameter ) ;
}
// 保存消息从属表
// 保存消息从属表
patientMainStr = JSON . toJSONString ( new PatientMainDto ( messageDto . getInpNo ( ) , messageDto . getVisitId ( ) ) , SerializerFeature . WriteMapNullValue ) ;
patientMainStr = JSON . toJSONString ( new PatientMainDto ( messageDto . getInpNo ( ) , messageDto . getVisitId ( ) ) , SerializerFeature . WriteMapNullValue ) ;
if ( textContentTemp ! = null ) {
if ( textContentTemp ! = null ) {
@ -101,24 +103,24 @@ public class AnalysisService {
result = 1 ;
result = 1 ;
}
}
} else {
} else {
textContent = "没有入院消息 。。。 ";
textContent = "没有入院消息 ";
}
}
} else {
} else {
textContent = "传过来的消息无法解析 。。 ";
textContent = "传过来的消息无法解析 ";
}
}
outContent = XMLUtils . generateV3XmlStr ( typeCodeValue , textContent ) ;
outContent = XMLUtils . generateV3XmlStr ( typeCodeValue , textContent ) ;
if ( ! outContent . equals ( "" ) ) {
if ( ! outContent . equals ( "" ) ) {
endTime = System . currentTimeMillis ( ) ;
endTime = System . currentTimeMillis ( ) ;
// messageLog.setMasterId(archiveMasterId);
messageLog . setValue ( archiveMasterId , outContent , result , messageDto = = null ? "" : JSON . toJSONString ( messageDto ) , xmlCreateTime , ( endTime - startTime ) , new Date ( ) , type , textContent ) ;
messageLog . setValue ( outContent , result , messageDto = = null ? "" : JSON . toJSONString ( messageDto ) , xmlCreateTime , ( endTime - startTime ) , new Date ( ) , type , textContent ) ;
messageService . save ( messageLog ) ;
messageService . save ( messageLog ) ;
if ( Objects . equals ( typeCodeValue , "AA" ) ) {
if ( Objects . equals ( typeCodeValue , "AA" ) ) {
if ( Objects . equals ( type , AliasName . EKG_REPORT )
if ( Objects . equals ( type , AliasName . EKG_REPORT )
| | Objects . equals ( type , AliasName . PATHOLOGY_REPORT )
| | Objects . equals ( type , AliasName . PATHOLOGY_REPORT )
| | Objects . equals ( type , AliasName . RADIATION_REPORT )
| | Objects . equals ( type , AliasName . RADIATION_REPORT )
| | Objects . equals ( type , AliasName . ULTRASONIC_REPORT )
| | Objects . equals ( type , AliasName . ULTRASONIC_REPORT )
| | Objects . equals ( type , AliasName . PETCT_REPORT ) ) {
| | Objects . equals ( type , AliasName . PETCT_REPORT )
| | Objects . equals ( type , AliasName . OTHER_REPORT ) ) {
messageSubordinateService . save ( new MessageSubordinate ( messageLog . getId ( ) , patientMainStr , JSON . toJSONString ( messageLog ) ) ) ;
messageSubordinateService . save ( new MessageSubordinate ( messageLog . getId ( ) , patientMainStr , JSON . toJSONString ( messageLog ) ) ) ;
}
}
}
}
@ -136,7 +138,7 @@ public class AnalysisService {
if ( Objects . equals ( examApply . getResult ( ) , "delete" ) ) {
if ( Objects . equals ( examApply . getResult ( ) , "delete" ) ) {
// 1.2 判断是否是删除
// 1.2 判断是否是删除
if ( ! examApplyService . updateExamApplyIsValid ( examApplyTemp . getApplyId ( ) ) ) {
if ( ! examApplyService . updateExamApplyIsValid ( examApplyTemp . getApplyId ( ) ) ) {
textContent = "申请单删除失败了 。。。。 ";
textContent = "申请单删除失败了 ";
}
}
} else if ( Objects . equals ( interfaceName , InterfaceName . PARAMETER_EXAMAPPLYSTATECHANGE ) ) {
} else if ( Objects . equals ( interfaceName , InterfaceName . PARAMETER_EXAMAPPLYSTATECHANGE ) ) {
// 1.3 如果是检查申请单状态变更设置IsOpenHIS
// 1.3 如果是检查申请单状态变更设置IsOpenHIS
@ -154,11 +156,11 @@ public class AnalysisService {
}
}
} else {
} else {
// 1.5 如果存在,又不做任何操作,返回已存在
// 1.5 如果存在,又不做任何操作,返回已存在
textContent = "该申请单已存在 。。。。 ";
textContent = "该申请单已存在 ";
}
}
} else {
} else {
// 2 如果不存在,那就判断是否是新增,否则该申请单不存在
// 2 如果不存在,那就判断是否是新增,否则该申请单不存在
if ( Objects . equals ( examApply . getResult ( ) , "new" ) ) {
if ( Objects . equals ( examApply . getResult ( ) , "new" ) & & Objects . equals ( interfaceName , InterfaceName . PARAMETER_EXAMAPPLY ) ) {
if ( examApply . getReportType ( ) ! = null ) {
if ( examApply . getReportType ( ) ! = null ) {
switch ( examApply . getReportType ( ) ) {
switch ( examApply . getReportType ( ) ) {
case "病理" :
case "病理" :
@ -174,28 +176,32 @@ public class AnalysisService {
examApply . setReportType ( AliasName . RADIATION_REPORT ) ;
examApply . setReportType ( AliasName . RADIATION_REPORT ) ;
break ;
break ;
case "核医学" :
case "核医学" :
examApply . setReportType ( AliasName . PET_CT_REPORT ) ;
examApply . setReportType ( AliasName . PETCT_REPORT ) ;
break ;
case "肌电图" :
examApply . setReportType ( AliasName . ELECTROMYOGRAPHY ) ;
break ;
case "临床试验" :
examApply . setReportType ( AliasName . CLINICAL_TRIALS ) ;
break ;
case "内镜" :
examApply . setReportType ( AliasName . ENDOSCOPIC_REPORT ) ;
break ;
case "脑彩超" :
examApply . setReportType ( AliasName . BRAIN_COLOR_ULTRASOUND ) ;
break ;
break ;
case "脑电图" :
default :
examApply . setReportType ( AliasName . BRAIN_ELECTRIC_REPORT ) ;
//除了这5个 其他报告都归在一类
examApply . setReportType ( AliasName . OTHER_REPORT ) ;
break ;
break ;
// case "肌电图":
// examApply.setReportType(AliasName.ELECTROMYOGRAPHY);
// break;
// case "临床试验":
// examApply.setReportType(AliasName.CLINICAL_TRIALS);
// break;
// case "内镜":
// examApply.setReportType(AliasName.ENDOSCOPIC_REPORT);
// break;
// case "脑彩超":
// examApply.setReportType(AliasName.BRAIN_COLOR_ULTRASOUND);
// break;
// case "脑电图":
// examApply.setReportType(AliasName.BRAIN_ELECTRIC_REPORT);
// break;
}
}
}
}
examApplyService . save ( examApply ) ;
examApplyService . save ( examApply ) ;
} else {
} else {
textContent = "该申请单不存在。。。。" ;
textContent = "该申请单不存在 ";
}
}
}
}
return textContent ;
return textContent ;