@ -52,6 +52,8 @@ public class Lisinterface_jldermyy extends CommonImpl {
@Resource
LisWarningUtil lisWarningUtil ;
public static final String hospitalName = " 监利市第二人民医院 " ;
@Override
public Result invokeHttp ( String param ) {
@ -90,7 +92,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
}
} catch ( Exception e ) {
log . error ( " 调用平台接口,入参:{}, {}" , xmlData , e ) ;
log . error ( " 调用平台接口,入参:{}, \ r \ n {}" , xmlData , e ) ;
return new Result ( " -1 " , e . getMessage ( ) ) ;
}
log . info ( " 调用集成平台接口: \ r \ n入参: " + xmlData + " \ r \ n出参: " + ret ) ;
@ -114,14 +116,14 @@ public class Lisinterface_jldermyy extends CommonImpl {
}
}
public Result toXml ( String action , String param, Map < String , Object > paramMap ) {
public Result toXml ( String action , String OperateType, String param, Map < String , Object > paramMap ) {
Map < String , Object > mapHead = new HashMap < > ( ) ;
mapHead . put ( " SrvId " , action ) ;
mapHead . put ( " ReqSysId " , " 041001-4 " ) ;
mapHead . put ( " MsgId " , UUID . randomUUID ( ) ) ;
mapHead . put ( " Dt " , commonUtil . currentStringTime ( ) ) ;
mapHead . put ( " MsgCheckCode " , " " ) ;
mapHead . put ( " OperateType " , " 1 " ) ;
mapHead . put ( " OperateType " , OperateType ) ;
mapHead . put ( " Remark " , " " ) ;
Map < String , Object > map = new HashMap < > ( ) ;
@ -133,6 +135,32 @@ public class Lisinterface_jldermyy extends CommonImpl {
return result ;
}
public Result toXml ( String action , String OperateType , List < Map < String , Object > > paramList ) {
Map < String , Object > mapHead = new HashMap < > ( ) ;
mapHead . put ( " SrvId " , action ) ;
mapHead . put ( " ReqSysId " , " 041001-4 " ) ;
mapHead . put ( " MsgId " , UUID . randomUUID ( ) ) ;
mapHead . put ( " Dt " , commonUtil . currentStringTime ( ) ) ;
mapHead . put ( " MsgCheckCode " , " " ) ;
mapHead . put ( " OperateType " , OperateType ) ;
mapHead . put ( " Remark " , " " ) ;
Map < String , Object > map = new HashMap < > ( ) ;
map . put ( " MsgHead " , mapHead ) ;
for ( Map < String , Object > stringObjectMap : paramList ) {
for ( Map . Entry < String , Object > stringObjectEntry : stringObjectMap . entrySet ( ) ) {
String key = stringObjectEntry . getKey ( ) ;
Map string = ( Map ) stringObjectEntry . getValue ( ) ;
map . put ( key , string ) ;
}
}
String xmlStr = XmlUtil . toStr ( XmlUtil . mapToXml ( map , " Req " ) , CharsetUtil . UTF_8 , false , true ) ;
String joinedStr = joinStr ( xmlStr ) ;
Result result = invokeHttpWebService ( joinedStr ) ;
return result ;
}
public String joinStr ( String xmlStr ) {
StringBuffer sbStr = new StringBuffer ( ) ;
sbStr . append ( " <soapenv:Envelope xmlns:soapenv= \" http://schemas.xmlsoap.org/soap/envelope/ \" xmlns:urn= \" urn:hl7-org:v3 \" > " ) ;
@ -173,7 +201,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
applyQryConditionMap . put ( " ChargTimeEnd " , " " ) ;
applyQryConditionMap . put ( " OrderClass " , " 001 " ) ;
applyQryConditionMap . put ( " NurseAduitMark " , " " ) ;
Result result = toXml ( " 02004 " , " ApplyQryCondition" , applyQryConditionMap ) ;
Result result = toXml ( " 02004 " , " 1" , " ApplyQryCondition" , applyQryConditionMap ) ;
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return result ;
List < ApplyOrder > applyOrderList = getapplyOrderList ( result . getData ( ) . toString ( ) ) ;
if ( applyOrderList . size ( ) < = 0 ) return new Result ( " 0 " , " 没有获取到新的his申请单! " ) ;
@ -206,7 +234,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
applyQryConditionMap . put ( " ChargTimeEnd " , " " ) ;
applyQryConditionMap . put ( " OrderClass " , " 001 " ) ;
applyQryConditionMap . put ( " NurseAduitMark " , " " ) ;
Result result = toXml ( " 02004 " , " ApplyQryCondition" , applyQryConditionMap ) ;
Result result = toXml ( " 02004 " , " 1" , " ApplyQryCondition" , applyQryConditionMap ) ;
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return result ;
List < ApplyOrder > applyOrderList = getapplyOrderList ( LisUtil . isBank ( result . getData ( ) ) ) ;
if ( applyOrderList . size ( ) < = 0 ) return result ;
@ -255,7 +283,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
queryConditionMap . put ( " UnitId " , " 041001 " ) ;
queryConditionMap . put ( " DeptId " , " " ) ;
queryConditionMap . put ( " DeptName " , " " ) ;
Result result = toXml ( " 00008 " , " QueryCondition " , queryConditionMap ) ;
Result result = toXml ( " 00008 " , " 1 " , " QueryCondition " , queryConditionMap ) ;
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return result ;
Document document = XmlUtil . parseXml ( result . getData ( ) . toString ( ) ) ;
NodeList nodeListByXPath = XmlUtil . getNodeListByXPath ( " //Res/DeptList/Row " , document ) ;
@ -286,7 +314,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
itemInfoMap . put ( " ExpensesCode " , " " ) ;
itemInfoMap . put ( " StdCodeBegin " , " " ) ;
itemInfoMap . put ( " StdCodeEnd " , " " ) ;
Result result = toXml ( " 00014 " , " ItemInfo " , itemInfoMap ) ;
Result result = toXml ( " 00014 " , " 1 " , " ItemInfo " , itemInfoMap ) ;
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return result ;
Document document = XmlUtil . parseXml ( result . getData ( ) . toString ( ) ) ;
NodeList nodeListByXPath = XmlUtil . getNodeListByXPath ( " //Res/ItemList/Row " , document ) ;
@ -315,7 +343,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
queryConditionMap . put ( " UserId " , " " ) ;
queryConditionMap . put ( " UserCode " , " " ) ;
queryConditionMap . put ( " IdNumber " , " " ) ;
Result result = toXml ( " 00005 " , " QueryCondition " , queryConditionMap ) ;
Result result = toXml ( " 00005 " , " 1 " , " QueryCondition " , queryConditionMap ) ;
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return result ;
Document document = XmlUtil . parseXml ( result . getData ( ) . toString ( ) ) ;
NodeList nodeListByXPath = XmlUtil . getNodeListByXPath ( " //Res/UserList/Row " , document ) ;
@ -349,7 +377,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
wardInfoMap . put ( " UnitId " , " 041001 " ) ;
wardInfoMap . put ( " WardId " , " " ) ;
wardInfoMap . put ( " WardName " , " " ) ;
Result result = toXml ( " 00012 " , " WardInfo" , wardInfoMap ) ;
Result result = toXml ( " 00012 " , " 1" , " WardInfo" , wardInfoMap ) ;
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return result ;
Document document = XmlUtil . parseXml ( result . getData ( ) . toString ( ) ) ;
NodeList nodeListByXPath = XmlUtil . getNodeListByXPath ( " //Res/WardList/Row " , document ) ;
@ -387,21 +415,22 @@ public class Lisinterface_jldermyy extends CommonImpl {
LabReqmain labReqmainOne = commonUtil . getLabReqmainOne ( sqh ) ;
if ( labReqmainOne = = null ) return new Result ( " 0 " , " 手工单不进行接口处理 " ) ;
String brly = labReqmainOne . getBrly ( ) ;
String zt = labReqmainOne . getZt ( ) . trim ( ) ;
String zt = setReqStatus . getStatus ( ) ;
String userid = setReqStatus . getUserid ( ) ;
List < LabReqdetail > labReqdetailList = commonUtil . getLabReqdetailList ( sqh ) ;
if ( ( brly . equals ( " 1 " ) | | brly . equals ( " 3 " ) ) ) {
/ / 上机状态处理
if ( zt . equals ( " 2 " ) ) {
Result result = execStatus ( labReqmainOne , labReqdetailList , " 1 " );
Result result = execStatus ( labReqmainOne , labReqdetailList , " 1 " ,userid );
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return result ;
commonUtil . updateSqd ( sqh ) ;
}
/ / 作废条码处理
if ( zt . equals ( " 9 " ) ) {
Result result = execStatus ( labReqmainOne , labReqdetailList , " 3" ) ;
Result result = execStatus ( labReqmainOne , labReqdetailList , " 0" , userid ) ;
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return result ;
commonUtil . cancelSqd ( sqh ) ;
}
@ -417,6 +446,11 @@ public class Lisinterface_jldermyy extends CommonImpl {
return new Result ( " 0 " , " 执行状态成功! " ) ;
}
/ * *
* 发送报告信息
* @param setReport
* @return
* /
@Override
public Result setReportM ( SetReport setReport ) {
Date jyrq = setReport . getJyrq ( ) ;
@ -424,7 +458,13 @@ public class Lisinterface_jldermyy extends CommonImpl {
String ybh = setReport . getYbh ( ) ;
String userid = setReport . getUserid ( ) ;
String status = setReport . getStatus ( ) ;
if ( status . trim ( ) . equals ( " 5 " ) ) return new Result ( " 0 " , " 审核前不调用接口! " ) ;
commonUtil . saveTimeTask ( jyrq , yq , ybh , userid , status ) ;
Result result = sendCriticalInfo ( jyrq , yq , ybh , status , userid ) ;
/ / 发送失败也一样让审核成功
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) {
return new Result ( " 3 " , result . getMessage ( ) ) ;
}
return new Result ( " 0 " , " 调用成功! " ) ;
}
@ -473,12 +513,10 @@ public class Lisinterface_jldermyy extends CommonImpl {
j + + ;
/ / his申请单信息结构
Map < String , Object > hisSqdInfoMap = new HashMap < > ( ) ;
hisSqdInfoMap . put ( " cp_row " , j ) ;
hisSqdInfoMap . put ( " cp_select " , " 1 " ) ;
hisSqdInfoMap . put ( " lab_reqmain_yblx " , LisUtil. isBank ( applyOrder . getSampleTypeName ( ) ) ) ; / / 样本类型
hisSqdInfoMap . put ( " lab_reqmain_yblx " , feeClass. get ( " yblx " ) ) ; / / 样本类型 LisUtil. isBank ( applyOrder . getSampleTypeName ( ) )
hisSqdInfoMap . put ( " cp_tip " , " 1 " ) ;
hisSqdInfoMap . put ( " sqxmmc " , sqxmmc ) ;
hisSqdInfoMap . put ( " sqxmdh " , sqxmdh ) ;
@ -490,10 +528,10 @@ public class Lisinterface_jldermyy extends CommonImpl {
hisSqdInfoMap . put ( " lab_reqmain_bz2 " , LisUtil . isBank ( applyOrder . getPatientWardId ( ) ) ) ;
hisSqdInfoMap . put ( " lab_reqmain_brxb " , LisUtil . isBank ( applyOrder . getSex ( ) ) ) ;
hisSqdInfoMap . put ( " lab_reqmain_jzbz " , LisUtil . isBank ( applyOrder . getIsEmergency ( ) ) ) ; / / emer_flag
hisSqdInfoMap . put ( " lab_reqmain_brsr " , DateUtil . format ( DateUtil . parse ( LisUtil . isBank ( applyOrder . getBirthday ( ) ) , " yyyy MMddHHmmss" ) , " yyyy-MM-dd " ) ) ;
hisSqdInfoMap . put ( " lab_reqmain_brsr " , DateUtil . format ( DateUtil . parse ( LisUtil . isBank ( applyOrder . getBirthday ( ) ) , " yyyy / MM/ dd HH: mm: ss" ) , " yyyy-MM-dd HH:mm:ss " ) ) ;
hisSqdInfoMap . put ( " lab_reqmain_ksdh " , LisUtil . isBank ( applyOrder . getOrderDeptId ( ) ) ) ; / / plLisReqDhyyList . get ( i ) . getOpenDeptID ( )
hisSqdInfoMap . put ( " lab_reqmain_sqys " , LisUtil . isBank ( applyOrder . getOrderDoctorId ( ) ) ) ; / / applyDrId
hisSqdInfoMap . put ( " lab_reqmain_sqsj " , DateUtil . parse ( LisUtil . isBank ( applyOrder . getOrderTime ( ) ) , " yyyy -MM- dd HH:mm:ss" ) ) ; / / applyDatetime
hisSqdInfoMap . put ( " lab_reqmain_sqsj " , DateUtil . parse ( LisUtil . isBank ( applyOrder . getOrderTime ( ) ) , " yyyy /MM/ dd HH:mm:ss" ) ) ; / / applyDatetime
hisSqdInfoMap . put ( " lab_reqmain_ch " , LisUtil . isBank ( applyOrder . getBedNo ( ) ) ) ;
hisSqdInfoMap . put ( " bz2 " , reqid ) ; / / 申请单ID
hisSqdInfoMap . put ( " bz1 " , LisUtil . isBank ( applyOrder . getApplyNo ( ) ) ) ; / / 申请单明细ID his_recordid
@ -605,6 +643,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
}
labReqdetail . setBz1 ( ( String ) hisSqdInfoList . get ( i ) . get ( " bz1 " ) ) ;
labReqdetail . setBz2 ( ( String ) hisSqdInfoList . get ( i ) . get ( " bz2 " ) ) ;
labReqdetail . setBz3 ( LisUtil . isBank ( hisSqdInfoList . get ( i ) . get ( " bz3 " ) ) ) ;
labReqdetailList . add ( labReqdetail ) ;
continue ;
} else {
@ -635,6 +674,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
labReqdetail . setBz1 ( ( String ) hisSqdInfoList . get ( i ) . get ( " bz1 " ) ) ;
labReqdetail . setBz2 ( ( String ) hisSqdInfoList . get ( i ) . get ( " bz2 " ) ) ;
labReqdetail . setBz3 ( LisUtil . isBank ( hisSqdInfoList . get ( i ) . get ( " bz3 " ) ) ) ;
labReqdetailList . add ( labReqdetail ) ;
jymd = hisSqdInfoList . get ( i ) . get ( " sqxmmc " ) . toString ( ) ;
@ -651,7 +691,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
labReqmain . setBrxm ( ( String ) hisSqdInfoList . get ( i ) . get ( " lab_reqmain_brxm " ) ) ;
labReqmain . setBrxb ( ( String ) hisSqdInfoList . get ( i ) . get ( " lab_reqmain_brxb " ) ) ;
String brsr = hisSqdInfoList . get ( i ) . get ( " lab_reqmain_brsr " ) . toString ( ) ;
labReqmain . setBrsr ( DateUtil . parse ( brsr , " yyyy-MM-dd " ) ) ;
labReqmain . setBrsr ( DateUtil . parse ( brsr , " yyyy-MM-dd HH:mm:ss " ) ) ;
labReqmain . setSqsj ( DateUtil . parse ( hisSqdInfoList . get ( i ) . get ( " lab_reqmain_sqsj " ) . toString ( ) , " yyyy-MM-dd HH:mm:ss " ) ) ;
labReqmain . setBgddh ( ( String ) hisSqdInfoList . get ( i ) . get ( " cp_xmlb " ) ) ;
labReqmain . setYljg ( " 1 " ) ;
@ -702,7 +742,6 @@ public class Lisinterface_jldermyy extends CommonImpl {
/ / 过滤第一次没有参加生成条码的项目
hisSqdInfoList = hisSqdInfoList . stream ( ) . filter ( hisSqdInfo - > hisSqdInfo . get ( " cp_select " ) . equals ( " 1 " ) ) . collect ( Collectors . toList ( ) ) ;
/ / log . info ( " hisSqdInfoList: " + hisSqdInfoList . toString ( ) ) ;
/ / 置空判断条件
sflbdh1 = " " ;
yblx1 = " " ;
@ -717,7 +756,7 @@ public class Lisinterface_jldermyy extends CommonImpl {
/ / 执行申请单
for ( LabReqmain reqmain : labReqmainList ) {
List < LabReqdetail > collect = labReqdetailList . stream ( ) . filter ( labReqdetail - > labReqdetail . getSqh ( ) . equals ( reqmain . getSqh ( ) ) ) . collect ( Collectors . toList ( ) ) ;
execStatus ( reqmain , collect , " 1 " );
execStatus ( reqmain , collect , " 1 " ,userId );
}
if ( ! ls_nopriceitems . equals ( " " ) ) {
@ -727,41 +766,50 @@ public class Lisinterface_jldermyy extends CommonImpl {
return new Result ( " 0 " , " 保存成功! " ) ;
}
public Result execStatus ( LabReqmain labReqmainOne , List < LabReqdetail > labReqdetailList , String zt ){
public Result execStatus ( LabReqmain labReqmainOne , List < LabReqdetail > labReqdetailList , String zt ,String userId ){
Map < String , Object > map = new HashMap < > ( ) ;
map . put ( " SrcSystemId " , " 041001-4 " ) ;
map . put ( " ApplyFormSrcDataId " , " " ) ;
map . put ( " ApplyFormId " , " " ) ;
map . put ( " VisitType " , labReqmainOne . getBrly ( ) ) ;
map . put ( " VisitId " , " " ) ;
map . put ( " ApplyNo " , " " ) ;
map . put ( " VisitId " , labReqdetailList . get ( 0 ) . getBz2 ( ) ) ;
map . put ( " ApplyNo " , labReqdetailList . get ( 0 ) . getBz1 ( ) ) ;
List < Map < String , Object > > orderList = new ArrayList < > ( ) ;
for ( LabReqdetail labReqdetail : labReqdetailList ) {
Map < String , Object > rowMap = new HashMap < > ( ) ;
rowMap . put ( " OrderRowId " , " " ) ;
rowMap . put ( " OrderCode " , labReqdetail . getSqxmdh ( ) ) ;
rowMap . put ( " OrderRowId " , labReqdetail . getBz3 ( ) ) ;
rowMap . put ( " OrderCode " , " 041- " + labReqdetail . getSqxmdh ( ) ) ;
rowMap . put ( " OrderSrcDataId " , " " ) ;
orderList . add ( rowMap ) ;
Map < String , Object > rowMap1 = new HashMap < > ( ) ;
rowMap1 . put ( " Row " , rowMap ) ;
orderList . add ( rowMap1 ) ;
}
map . put ( " OrderList " , orderList ) ;
map . put ( " PerformType " , zt ) ; / / 执行类型 : 1已登记 2已出报告 3 已撤销
map . put ( " PerformOperator " , " " ) ;
map . put ( " PerformType " , zt ) ; / / 执行类型 : 1已登记 2已出报告 0 已撤销
map . put ( " PerformOperator " , commonUtil . getUserHISId ( userId ) ) ;
map . put ( " PerformDt " , " " ) ;
return toXml ( " 02005 " , " OrderKeyInf" , map ) ;
return toXml ( " 02005 " , " 3" , " OrderKeyInf" , map ) ;
}
public List < ApplyOrder > getapplyOrderList ( String xmlStr ) {
Document document = XmlUtil . parseXml ( xmlStr ) ;
NodeList nodeListByXPath = XmlUtil . getNodeListByXPath ( " //Res/ApplyOrderList " , document ) ;
NodeList nodeListByXPath = XmlUtil . getNodeListByXPath ( " //Res/ApplyOrderList /Row " , document ) ;
List < ApplyOrder > applyOrderList = new ArrayList < > ( ) ;
for ( int i = 1; i < = nodeListByXPath . getLength ( ) ; i + + ) {
for ( int i = 0; i < nodeListByXPath . getLength ( ) ; i + + ) {
ApplyOrder applyOrder = XmlUtil . xmlToBean ( nodeListByXPath . item ( i ) , ApplyOrder . class ) ;
applyOrderList . add ( applyOrder ) ;
}
return applyOrderList ;
}
/ * *
* 发送报告给his
* @param jyrq
* @param yq
* @param ybh
* @param status
* @return
* /
public Result sendHISReport ( Date jyrq , String yq , String ybh , String status ) {
LabPat labPatOne = commonUtil . getLabPatOne ( jyrq , yq , ybh ) ;
String sqh = labPatOne . getSqh ( ) ;
@ -778,6 +826,10 @@ public class Lisinterface_jldermyy extends CommonImpl {
}
boolean isxjy = commonUtil . isxjy ( yq ) ;
/ / 条码信息上传接口
Result result = sendSampleInfo ( labReqmainOne , labReqdetailList ) ;
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return new Result ( " -1 " , " 调用条码上传接口失败: " + result . getMessage ( ) ) ;
String reportId = DateUtil . format ( jyrq , " yyyyMMdd " ) + " | " + yq . trim ( ) + " | " + ybh ;
Map < String , String > ageFromBirthDay = LisUtil . getAgeFromBirthDay ( DateUtil . format ( labReqmainOne . getBrsr ( ) , " yyyy-MM-dd " ) ) ;
String zd = labReqmainOne . getZd ( ) ;
@ -789,10 +841,12 @@ public class Lisinterface_jldermyy extends CommonImpl {
zdmc = strings [ 1 ] ;
}
LabFeeitemClass labFeeitemclassOne = commonUtil . getLabFeeitemclassOne ( labReqmainOne . getBgddh ( ) ) ;
String yzdh = " " ;
String yzmc = " " ;
for ( LabReqdetail labReqdetail : labReqdetailList ) {
String sqxmdh = labReqdetail . getSqxmdh ( ) ;
String sqxmdh = " 041- " + labReqdetail . getSqxmdh ( ) ;
String sqxmmc = labReqdetail . getSqxmmc ( ) ;
yzdh = yzdh + " , " + sqxmdh ;
yzmc = yzmc + " , " + sqxmmc ;
@ -808,8 +862,8 @@ public class Lisinterface_jldermyy extends CommonImpl {
lisRptMap . put ( " WorksheetTypeName " , labPatOne . getJymd ( ) ) ;
lisRptMap . put ( " ReportName " , labPatOne . getJymd ( ) ) ;
lisRptMap . put ( " SampleBarcode " , sqh ) ;
lisRptMap . put ( " PatUnitId " , " ") ;
lisRptMap . put ( " PatUnitName " , " " ) ;
lisRptMap . put ( " PatUnitId " , " 041001 ") ;
lisRptMap . put ( " PatUnitName " , hospitalName ) ;
lisRptMap . put ( " VisitType " , labPatOne . getBrly ( ) ) ;
lisRptMap . put ( " VisitId " , bz2 ) ;
lisRptMap . put ( " PatNo " , labPatOne . getBrdh ( ) ) ;
@ -819,44 +873,48 @@ public class Lisinterface_jldermyy extends CommonImpl {
lisRptMap . put ( " PatWardId " , labReqmainOne . getBz2 ( ) ) ;
lisRptMap . put ( " PatWardName " , " " ) ;
lisRptMap . put ( " BedId " , labReqmainOne . getCh ( ) ) ;
lisRptMap . put ( " BedName " , " " ) ;
lisRptMap . put ( " Sex " , labReqmainOne . getBrxb ( ) );
lisRptMap . put ( " BedName " , labReqmainOne . getCh ( ) ) ;
lisRptMap . put ( " Sex " , labReqmainOne . getBrxb ( ) .trim ( ) );
String age = ageFromBirthDay . get ( " age " ) ;
String unit = ageFromBirthDay . get ( " unit " ) ;
switch ( unit ) {
case " 岁 " :
lisRptMap . put ( " AgeYear " , age ) ;
lisRptMap . put ( " AgeMonth " , " ") ;
lisRptMap . put ( " AgeDay " , " ") ;
lisRptMap . put ( " AgeMonth " , " 0 ") ;
lisRptMap . put ( " AgeDay " , " 0 ") ;
break ;
case " 月 " :
lisRptMap . put ( " AgeYear " , " ") ;
lisRptMap . put ( " AgeYear " , " 0 ") ;
lisRptMap . put ( " AgeMonth " , age ) ;
lisRptMap . put ( " AgeDay " , " ") ;
lisRptMap . put ( " AgeDay " , " 0 ") ;
break ;
case " 天 " :
lisRptMap . put ( " AgeYear " , " ") ;
lisRptMap . put ( " AgeMonth " , " ") ;
lisRptMap . put ( " AgeYear " , " 0 ") ;
lisRptMap . put ( " AgeMonth " , " 0 ") ;
lisRptMap . put ( " AgeDay " , age ) ;
break ;
}
lisRptMap . put ( " AgeText " , " ") ;
lisRptMap . put ( " AgeText " , " 0 ") ;
lisRptMap . put ( " Icd10 " , zddm ) ;
lisRptMap . put ( " DIAGNOSE " , zdmc ) ;
lisRptMap . put ( " EmType " , labReqmainOne . getJzbz ( ) ) ;
lisRptMap . put ( " ProfId " , " " ) ;
lisRptMap . put ( " ProfName " , " " ) ;
lisRptMap . put ( " SampleTypeCode " , " " ) ;
lisRptMap . put ( " ProfId " , labFeeitemclassOne . getSflbdh ( ) ) ;
lisRptMap . put ( " ProfName " , labFeeitemclassOne . getSflbmc ( ) ) ;
lisRptMap . put ( " SampleTypeCode " , labReqmainOne . getYblx ( ) ) ;
lisRptMap . put ( " SampleTypeName " , labReqmainOne . getYblx ( ) ) ;
lisRptMap . put ( " ContainerCode " , " " ) ;
lisRptMap . put ( " ContainerName " , " " ) ;
lisRptMap . put ( " CollectUserId " , labReqmainOne . getCyr ( ) ) ;
lisRptMap . put ( " CollectUserName " , commonUtil . getComDictValues ( " SRD " , labReqmainOne . getCyr ( ) ) ) ;
lisRptMap . put ( " CollectDt " , DateUtil . format ( labReqmainOne . getCysj ( ) , " yyyy-MM-dd HH:mm:ss " ) ) ;
lisRptMap . put ( " TestUnitId " , " " ) ;
lisRptMap . put ( " TestUnitName " , " " ) ;
lisRptMap . put ( " TestDeptId " , " " ) ;
lisRptMap . put ( " TestDeptName " , " " ) ;
lisRptMap . put ( " ContainerCode " , labFeeitemclassOne . getSampletips ( ) ) ;
lisRptMap . put ( " ContainerName " , labFeeitemclassOne . getSampletips ( ) ) ;
String cyr = labReqmainOne . getCyr ( ) ;
Date cysj = labReqmainOne . getCysj ( ) ;
if ( cyr = = null | | cyr . equals ( " " ) ) cyr = labReqmainOne . getJsys ( ) ;
if ( cysj = = null ) cysj = labReqmainOne . getJssj ( ) ;
lisRptMap . put ( " CollectUserId " , cyr ) ;
lisRptMap . put ( " CollectUserName " , commonUtil . getComDictValues ( " SRD " , cyr ) ) ;
lisRptMap . put ( " CollectDt " , DateUtil . format ( cysj , " yyyy-MM-dd HH:mm:ss " ) ) ;
lisRptMap . put ( " TestUnitId " , " 041001 " ) ;
lisRptMap . put ( " TestUnitName " , " 监利第二人民医院 " ) ;
lisRptMap . put ( " TestDeptId " , " 041001-308 " ) ;
lisRptMap . put ( " TestDeptName " , " 检验科 " ) ;
lisRptMap . put ( " TestDate " , DateUtil . format ( jyrq , " yyyy-MM-dd " ) ) ;
lisRptMap . put ( " TestNo " , ybh ) ;
lisRptMap . put ( " TestUserId " , labPatOne . getSjys ( ) ) ;
@ -868,17 +926,22 @@ public class Lisinterface_jldermyy extends CommonImpl {
lisRptMap . put ( " RptUserId " , labPatOne . getConfirmer ( ) ) ;
lisRptMap . put ( " RptUserName " , commonUtil . getComDictValues ( " SRD " , labPatOne . getConfirmer ( ) ) ) ;
lisRptMap . put ( " IsCritical " , isWjz ) ;
lisRptMap . put ( " IsInfect " , " ") ;
lisRptMap . put ( " IsMdro " , " " ) ;
lisRptMap . put ( " IsInfect " , " 0 ") ;
lisRptMap . put ( " IsMdro " , isxjy ? " 1 " : " 0 " ) ;
lisRptMap . put ( " IsMicrobe " , isxjy ? " 1 " : " 0 " ) ;
lisRptMap . put ( " SampleStatusCode " , " 1 " ) ;
lisRptMap . put ( " SampleStatusName " , " 正常 " ) ;
lisRptMap . put ( " RptQual " , " ") ;
lisRptMap . put ( " RptQual " , " 3 ") ;
lisRptMap . put ( " RptContent " , " " ) ;
lisRptMap . put ( " RptAdvice " , " " ) ;
lisRptMap . put ( " RptMemo " , " " ) ;
lisRptMap . put ( " RptOrderIdList " , yzdh ) ;
lisRptMap . put ( " RptOrderNameList " , yzmc ) ;
if ( status . equals ( " 1 " ) ) {
lisRptMap . put ( " Status " , " 3 " ) ; / / 状态1 待检 2 审核 3报告 10作废 ( STATUS = 1时才能作废 )
} else if ( status . equals ( " 0 " ) ) {
lisRptMap . put ( " Status " , " 10 " ) ; / / 状态1 待检 2 审核 3报告 10作废 ( STATUS = 1时才能作废 )
}
List < Map < String , Object > > itemResultList = new ArrayList < > ( ) ;
@ -933,8 +996,8 @@ public class Lisinterface_jldermyy extends CommonImpl {
itemResultMap . put ( " ValueBinary " , " " ) ;
itemResultMap . put ( " ValueBinaryFmt " , " " ) ;
itemResultMap . put ( " DisplaySn " , xmInfoOne . getDyxh ( ) ) ;
itemResultMap . put ( " OrderId " , labResult . getSqxmdh ( ) ) ;
itemResultMap . put ( " OrderName " , commonUtil . getXmFeeOne ( labResult . getSqxmdh ( ) ) );
itemResultMap . put ( " OrderId " , " 041- " + labResult . getSqxmdh ( ) ) ;
itemResultMap . put ( " OrderName " , commonUtil . getXmFeeOne ( labResult . getSqxmdh ( ) ) .getSfxmmc ( ) );
itemResultList . add ( itemResultMap ) ;
/ / 药敏结果
@ -1013,7 +1076,183 @@ public class Lisinterface_jldermyy extends CommonImpl {
map . put ( " LisRpt " , lisRptMap ) ;
map . put ( " LisRptFile " , lisRptFileMap ) ;
return toXml ( " 06001 " , " LisRpt " , map ) ;
List < Map < String , Object > > paramList = new ArrayList < > ( ) ;
paramList . add ( map ) ;
return toXml ( " 06001 " , " 2 " , paramList ) ;
}
/ * *
* 发送危急值信息给his
* @param jyrq
* @param yq
* @param ybh
* @return
* /
public Result sendCriticalInfo ( Date jyrq , String yq , String ybh , String status , String userId ) {
List < LabResultWarning > labResultWarningList = lisWarningUtil . getLabResultWarningList ( jyrq , yq , ybh ) ;
String msgContent = " " ;
String msgTemp = " " ;
LabPat labPatOne = commonUtil . getLabPatOne ( jyrq , yq , ybh ) ;
String sqh = labPatOne . getSqh ( ) ;
if ( sqh = = null | | sqh . equals ( " " ) ) return new Result ( " 0 " , " 手工单不进行危急值上报! " ) ;
String msgID = DateUtil . format ( labPatOne . getJyrq ( ) , " yyyyMMdd " ) + " | " + labPatOne . getYq ( ) + " | " + labPatOne . getYbh ( ) ;
List < Map < String , Object > > criticalItemInfoList = new ArrayList < > ( ) ;
for ( LabResultWarning labResultWarning : labResultWarningList ) {
String xmdh = labResultWarning . getXmdh ( ) ;
XmInfo xmInfoOne = commonUtil . getXmInfoOne ( yq , xmdh ) ;
msgTemp = msgTemp + " , " + xmInfoOne . getXmmc ( ) + " : " + labResultWarning . getCsjg ( ) + xmInfoOne . getDw ( ) ;
Map < String , Object > criticalItemInfoMap = new HashMap < > ( ) ;
criticalItemInfoMap . put ( " MsgId " , msgID ) ;
criticalItemInfoMap . put ( " ItemCode " , labResultWarning . getXmdh ( ) ) ;
criticalItemInfoMap . put ( " ItemName " , xmInfoOne . getXmmc ( ) ) ;
criticalItemInfoMap . put ( " CriticalMemo " , " " ) ;
criticalItemInfoList . add ( criticalItemInfoMap ) ;
}
msgContent = " 患者: " + labPatOne . getBrxm ( ) + " 的报告: " + labPatOne . getJymd ( ) + " ,发生了危急值: " + msgTemp ;
LabReqmain labReqmainOne = commonUtil . getLabReqmainOne ( sqh ) ;
Map < String , String > ageFromBirthDay = LisUtil . getAgeFromBirthDay ( DateUtil . format ( labReqmainOne . getBrsr ( ) , " yyyy-MM-dd " ) ) ;
Map < String , Object > criticalInfoMap = new HashMap < > ( ) ;
criticalInfoMap . put ( " UnitId " , " 041001 " ) ;
criticalInfoMap . put ( " MsgId " , DateUtil . format ( jyrq , " yyyyMMdd " + " | " + yq . trim ( ) + " | " + ybh ) ) ;
criticalInfoMap . put ( " MsgType " , " 1 " ) ;
criticalInfoMap . put ( " MsgContent " , msgContent ) ;
criticalInfoMap . put ( " CalcMemo " , " " ) ;
criticalInfoMap . put ( " WorksheetId " , " " ) ;
criticalInfoMap . put ( " OutinMark " , labPatOne . getBrly ( ) ) ;
criticalInfoMap . put ( " VisitType " , " " ) ;
criticalInfoMap . put ( " VisitId " , labPatOne . getBrly ( ) ) ;
criticalInfoMap . put ( " PatientId " , labReqmainOne . getBz1 ( ) ) ;
criticalInfoMap . put ( " PatientName " , labPatOne . getBrxm ( ) ) ;
criticalInfoMap . put ( " Sex " , labReqmainOne . getBrxb ( ) . trim ( ) ) ;
criticalInfoMap . put ( " AgeText " , ageFromBirthDay . get ( " age " ) + ageFromBirthDay . get ( " unit " ) ) ;
criticalInfoMap . put ( " PatDeptId " , labReqmainOne . getKsdh ( ) ) ;
criticalInfoMap . put ( " OrderDeptId " , labReqmainOne . getKsdh ( ) ) ;
criticalInfoMap . put ( " OrderUserId " , labReqmainOne . getSqys ( ) ) ;
criticalInfoMap . put ( " OrderDt " , DateUtil . format ( labReqmainOne . getSqsj ( ) , " yyyy-MM-dd HH:mm:ss " ) ) ;
criticalInfoMap . put ( " SendUnitId " , " 041001 " ) ;
criticalInfoMap . put ( " SendUnitName " , hospitalName ) ;
criticalInfoMap . put ( " SendDeptNo " , " " ) ;
criticalInfoMap . put ( " SendDeptName " , " " ) ;
criticalInfoMap . put ( " SendUserId " , userId ) ;
criticalInfoMap . put ( " SendUserName " , commonUtil . getComUsrName ( userId ) ) ;
criticalInfoMap . put ( " SendStationId " , " " ) ;
criticalInfoMap . put ( " SendDt " , commonUtil . currentStringTime ( ) ) ;
Map < String , Object > mapHead = new HashMap < > ( ) ;
mapHead . put ( " SrvId " , " 06007 " ) ;
mapHead . put ( " ReqSysId " , " 041001-4 " ) ;
mapHead . put ( " MsgId " , UUID . randomUUID ( ) ) ;
mapHead . put ( " Dt " , commonUtil . currentStringTime ( ) ) ;
mapHead . put ( " MsgCheckCode " , " " ) ;
mapHead . put ( " OperateType " , " 1 " ) ;
mapHead . put ( " Remark " , " " ) ;
Map < String , Object > map = new HashMap < > ( ) ;
map . put ( " MsgHead " , mapHead ) ;
map . put ( " CriticalInfo " , criticalInfoMap ) ;
map . put ( " CriticalItemInfo " , criticalItemInfoList ) ;
String xmlStr = XmlUtil . toStr ( XmlUtil . mapToXml ( map , " Req " ) , CharsetUtil . UTF_8 , false , true ) ;
String joinedStr = joinStr ( xmlStr ) ;
Result result = invokeHttpWebService ( joinedStr ) ;
if ( ! result . getResultCode ( ) . equals ( " 0 " ) ) return result ;
return new Result ( " 0 " , " 上传危急值结果成功! " ) ;
}
/ * *
* 条码信息上传到his
* @param labReqmain
* @param labReqdetailList
* @return
* /
public Result sendSampleInfo ( LabReqmain labReqmain , List < LabReqdetail > labReqdetailList ) {
Map < String , Object > sampleInfoMap = new HashMap < > ( ) ;
sampleInfoMap . put ( " SampleBarcode " , labReqmain . getSqh ( ) ) ;
sampleInfoMap . put ( " SampleBusi " , " 1 " ) ;
sampleInfoMap . put ( " PatUnitId " , " 041001 " ) ;
sampleInfoMap . put ( " PatUnitName " , hospitalName ) ;
sampleInfoMap . put ( " VisitType " , labReqmain . getBrly ( ) ) ;
sampleInfoMap . put ( " VisitId " , labReqdetailList . get ( 0 ) . getBz2 ( ) ) ;
sampleInfoMap . put ( " PatNo " , labReqmain . getBrdh ( ) ) ;
sampleInfoMap . put ( " PatName " , labReqmain . getBrxm ( ) ) ;
sampleInfoMap . put ( " PatDeptId " , labReqmain . getKsdh ( ) ) ;
sampleInfoMap . put ( " PatDeptName " , commonUtil . getComDictValues ( " DP " , labReqmain . getKsdh ( ) ) ) ;
sampleInfoMap . put ( " PatWardId " , " " ) ;
sampleInfoMap . put ( " PatWardName " , " " ) ;
sampleInfoMap . put ( " BedId " , labReqmain . getCh ( ) ) ;
sampleInfoMap . put ( " BedName " , labReqmain . getCh ( ) ) ;
sampleInfoMap . put ( " Sex " , labReqmain . getBrxb ( ) . trim ( ) ) ;
Date brsr = labReqmain . getBrsr ( ) ;
Map < String , String > ageFromBirthDay = LisUtil . getAgeFromBirthDay ( DateUtil . format ( brsr , " yyyy-MM-dd " ) ) ;
if ( ageFromBirthDay . get ( " unit " ) . equals ( " 岁 " ) ) {
sampleInfoMap . put ( " AgeYear " , ageFromBirthDay . get ( " age " ) ) ;
sampleInfoMap . put ( " AgeMonth " , " 0 " ) ;
sampleInfoMap . put ( " AgeDay " , " 0 " ) ;
} else if ( ageFromBirthDay . get ( " unit " ) . equals ( " 月 " ) ) {
sampleInfoMap . put ( " AgeYear " , " 0 " ) ;
sampleInfoMap . put ( " AgeMonth " , ageFromBirthDay . get ( " age " ) ) ;
sampleInfoMap . put ( " AgeDay " , " 0 " ) ;
} else if ( ageFromBirthDay . get ( " unit " ) . equals ( " 天 " ) ) {
sampleInfoMap . put ( " AgeYear " , " 0 " ) ;
sampleInfoMap . put ( " AgeMonth " , " 0 " ) ;
sampleInfoMap . put ( " AgeDay " , ageFromBirthDay . get ( " age " ) ) ;
}
sampleInfoMap . put ( " AgeText " , " 0 " ) ;
String zd = labReqmain . getZd ( ) ;
String [ ] strings = StrUtil . splitToArray ( zd , " & " ) ;
String zddm = " " ;
String zdmc = " " ;
if ( strings . length = = 2 ) {
zddm = strings [ 0 ] ;
zdmc = strings [ 1 ] ;
}
LabFeeitemClass labFeeitemclassOne = commonUtil . getLabFeeitemclassOne ( labReqmain . getBgddh ( ) ) ;
sampleInfoMap . put ( " Icd10 " , zddm ) ;
sampleInfoMap . put ( " DIAGNOSE " , zdmc ) ;
sampleInfoMap . put ( " EmType " , labReqmain . getJzbz ( ) ) ;
sampleInfoMap . put ( " ProfId " , labReqmain . getBgddh ( ) ) ;
sampleInfoMap . put ( " ProfName " , labFeeitemclassOne . getSflbmc ( ) ) ;
sampleInfoMap . put ( " SampleTypeCode " , " " ) ;
sampleInfoMap . put ( " SampleTypeName " , labReqmain . getYblx ( ) ) ;
sampleInfoMap . put ( " ContainerCode " , " 041001 " ) ;
sampleInfoMap . put ( " ContainerName " , " 监利第二人民医院 " ) ;
sampleInfoMap . put ( " SampleVolume " , " " ) ;
sampleInfoMap . put ( " OrderShortList " , labReqmain . getJymd ( ) ) ;
sampleInfoMap . put ( " CollectUnitId " , " 041001 " ) ;
sampleInfoMap . put ( " CollectUnitName " , labFeeitemclassOne . getSampletips ( ) ) ;
sampleInfoMap . put ( " CollectDeptId " , " 041001-308 " ) ;
sampleInfoMap . put ( " CollectDeptName " , " 检验科 " ) ;
sampleInfoMap . put ( " CollectUserId " , labReqmain . getCyr ( ) ) ;
sampleInfoMap . put ( " CollectUserName " , commonUtil . getComDictValues ( " SRD " , labReqmain . getCyr ( ) ) ) ;
sampleInfoMap . put ( " CollectDt " , DateUtil . format ( labReqmain . getCysj ( ) , " yyyy-MM-dd HH:mm:ss " ) ) ;
sampleInfoMap . put ( " CollectMemo " , " " ) ;
List < Map < String , Object > > orderInfoList = new ArrayList < > ( ) ;
for ( LabReqdetail labReqdetail : labReqdetailList ) {
Map < String , Object > mapRowIn = new HashMap < > ( ) ;
mapRowIn . put ( " OrderUnitId " , " " ) ;
mapRowIn . put ( " OrderDeptId " , labReqmain . getKsdh ( ) ) ;
mapRowIn . put ( " OrderDeptName " , commonUtil . getComDictValues ( " DP " , labReqmain . getKsdh ( ) ) ) ;
mapRowIn . put ( " OrderUserId " , labReqmain . getSqys ( ) ) ;
mapRowIn . put ( " OrderUserName " , commonUtil . getComDictValues ( " SRD " , labReqmain . getSqys ( ) ) ) ;
mapRowIn . put ( " OrderDt " , DateUtil . format ( labReqmain . getSqsj ( ) , " yyyy-MM-dd HH:mm:ss " ) ) ;
mapRowIn . put ( " OrderApplyNo " , labReqdetail . getBz1 ( ) ) ;
mapRowIn . put ( " OrderCode " , " 041- " + labReqdetail . getSqxmdh ( ) ) ;
mapRowIn . put ( " OrderName " , labReqdetail . getSqxmmc ( ) ) ;
Map < String , Object > mapRow = new HashMap < > ( ) ;
mapRow . put ( " Row " , mapRowIn ) ;
orderInfoList . add ( mapRow ) ;
}
sampleInfoMap . put ( " OrderInfo " , orderInfoList ) ;
return toXml ( " 06004 " , " 2 " , " SampleInfo " , sampleInfoMap ) ;
}
}