Index: ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_oracle.sql =================================================================== diff -u -r34210 -r34215 --- ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_oracle.sql (.../4.9.93_4.9.94_oracle.sql) (revision 34210) +++ ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_oracle.sql (.../4.9.93_4.9.94_oracle.sql) (revision 34215) @@ -1,2 +1,4 @@ insert into TousseDefinitionNote (id, note, tousseDefinitionId) select HIBERNATE_SEQUENCE.Nextval, note, id from TousseDefinition where forDisplay = 1 and note is not null; -update TousseDefinition set note_id = (select id from TousseDefinitionNote where tousseDefinitionId = TousseDefinition.id); \ No newline at end of file +update TousseDefinition set note_id = (select id from TousseDefinitionNote where tousseDefinitionId = TousseDefinition.id); +update UseRecord set departCodeOfpatient = (select orgUnitCoding from OrgUnit where name = UseRecord.ascriptionDepartment and rownum =1) where departCodeOfpatient is null and ascriptionDepartment is not null; +update UseRecord set departCodeOfpatient = (select orgUnitCoding from OrgUnit where orgUnitCoding = UseRecord.ascriptionDepartment and rownum =1) where departCodeOfpatient is null and ascriptionDepartment is not null; \ No newline at end of file Index: ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/HIPMessageWebServiceImplV3.java =================================================================== diff -u -r33107 -r34215 --- ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/HIPMessageWebServiceImplV3.java (.../HIPMessageWebServiceImplV3.java) (revision 33107) +++ ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/HIPMessageWebServiceImplV3.java (.../HIPMessageWebServiceImplV3.java) (revision 34215) @@ -512,6 +512,15 @@ newUseRecord.setSpecialInfection(specialInfection); newUseRecord.setRemark(remark); newUseRecord.setOperationStatus(operationStatus); + if(StringUtils.isNotBlank(newUseRecord.getAscriptionDepartment())){ + newUseRecord.setDepartCodeOfpatient(newUseRecord.getAscriptionDepartment()); + //ZJYY-112接口程序接收到手麻系统传入的入参后,根据字段ascriptionDepartment的值, + //查询出科室的编码,然后给UseRecord表的departCodeOfpatient字段赋值。 + OrgUnit orgUnit = orgUnitManager.getByName(newUseRecord.getAscriptionDepartment()); + if(orgUnit != null){ + newUseRecord.setDepartCodeOfpatient(orgUnit.getOrgUnitCoding()); + } + } }else{ // 修改记录录入时间 newUseRecord.setEnteringDate(operTime); Index: ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/CssdUseRecordServiceV4Impl.java =================================================================== diff -u -r34085 -r34215 --- ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/CssdUseRecordServiceV4Impl.java (.../CssdUseRecordServiceV4Impl.java) (revision 34085) +++ ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/CssdUseRecordServiceV4Impl.java (.../CssdUseRecordServiceV4Impl.java) (revision 34215) @@ -189,6 +189,8 @@ String patientAreaXpath = "/REQUEST/MSG/PATIENT_AREA"; // 病人所属科室名称 String ascriptionDepartmentXpath = "/REQUEST/MSG/ASCRIPTION_DEPART_NAME"; + // 病人所属科室编码 + String departCodeOfpatientXpath = "/REQUEST/MSG/ASCRIPTION_DEPART_CODE"; // 病房 String roomNumberXpath = "/REQUEST/MSG/ROOM_NUM"; // 床位 @@ -494,6 +496,15 @@ newUseRecord.setRoomNumber(patient.getRoomNumber()); newUseRecord.setBedNumber(patient.getBedNumber()); newUseRecord.setAscriptionDepartment(patient.getAscriptionDepartment()); + if(StringUtils.isNotBlank(newUseRecord.getAscriptionDepartment())){ + newUseRecord.setDepartCodeOfpatient(patient.getAscriptionDepartment()); + //ZJYY-112接口程序接收到手麻系统传入的入参后,根据字段ascriptionDepartment的值, + //查询出科室的编码,然后给UseRecord表的departCodeOfpatient字段赋值。 + OrgUnit orgUnit = orgUnitManager.getByName(newUseRecord.getAscriptionDepartment()); + if(orgUnit != null){ + newUseRecord.setDepartCodeOfpatient(orgUnit.getOrgUnitCoding()); + } + } newUseRecord.setVisitId(patient.getVisitId()); newUseRecord.setWashHandNurse(patient.getWashHandNurse()); newUseRecord.setCircuitNurse(patient.getCircuitNurse()); @@ -513,6 +524,7 @@ newUseRecord.setRoomNumber(processDataByXpath(document, null, roomNumberXpath)); newUseRecord.setBedNumber(processDataByXpath(document, null, bedNumberXpath)); newUseRecord.setAscriptionDepartment(processDataByXpath(document, null, ascriptionDepartmentXpath)); + newUseRecord.setDepartCodeOfpatient(processDataByXpath(document, null, departCodeOfpatientXpath)); String visitId = processDataByXpath(document, null, visitIdXpath); if(!DatabaseUtil.isPoIdValid(visitId)){ visitId = "0"; Index: ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/HIPMessageWebServiceImplV2.java =================================================================== diff -u -r34085 -r34215 --- ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/HIPMessageWebServiceImplV2.java (.../HIPMessageWebServiceImplV2.java) (revision 34085) +++ ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/HIPMessageWebServiceImplV2.java (.../HIPMessageWebServiceImplV2.java) (revision 34215) @@ -517,6 +517,15 @@ newUseRecord.setSpecialInfection(specialInfection); newUseRecord.setRemark(remark); newUseRecord.setOperationStatus(operationStatus); + if(StringUtils.isNotBlank(newUseRecord.getAscriptionDepartment())){ + newUseRecord.setDepartCodeOfpatient(newUseRecord.getAscriptionDepartment()); + //ZJYY-112接口程序接收到手麻系统传入的入参后,根据字段ascriptionDepartment的值, + //查询出科室的编码,然后给UseRecord表的departCodeOfpatient字段赋值。 + OrgUnit orgUnit = orgUnitManager.getByName(newUseRecord.getAscriptionDepartment()); + if(orgUnit != null){ + newUseRecord.setDepartCodeOfpatient(orgUnit.getOrgUnitCoding()); + } + } }else{ // 修改记录录入时间 newUseRecord.setEnteringDate(operTime); Index: ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_sqlserver.sql =================================================================== diff -u -r34210 -r34215 --- ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_sqlserver.sql (.../4.9.93_4.9.94_sqlserver.sql) (revision 34210) +++ ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_sqlserver.sql (.../4.9.93_4.9.94_sqlserver.sql) (revision 34215) @@ -1,2 +1,4 @@ insert into TousseDefinitionNote (note, tousseDefinitionId) select note, id from TousseDefinition where forDisplay = 1 and len(note)>0; -update TousseDefinition set note_id = (select id from TousseDefinitionNote where tousseDefinitionId = TousseDefinition.id); \ No newline at end of file +update TousseDefinition set note_id = (select id from TousseDefinitionNote where tousseDefinitionId = TousseDefinition.id); +update UseRecord set departCodeOfpatient = (select top 1 orgUnitCoding from OrgUnit where name = UseRecord.ascriptionDepartment) where (departCodeOfpatient is null or departCodeOfpatient = '') and ascriptionDepartment is not null and ascriptionDepartment <> ''; +update UseRecord set departCodeOfpatient = (select top 1 orgUnitCoding from OrgUnit where orgUnitCoding = UseRecord.ascriptionDepartment) where (departCodeOfpatient is null or departCodeOfpatient = '') and ascriptionDepartment is not null and ascriptionDepartment <> ''; \ No newline at end of file Index: ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/HIPMessageWebServiceImpl.java =================================================================== diff -u -r33070 -r34215 --- ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/HIPMessageWebServiceImpl.java (.../HIPMessageWebServiceImpl.java) (revision 33070) +++ ssts-webservice/src/main/java/com/forgon/disinfectsystem/webservice/datasync/common/HIPMessageWebServiceImpl.java (.../HIPMessageWebServiceImpl.java) (revision 34215) @@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired; import com.forgon.directory.model.BarcodeDevice; +import com.forgon.directory.model.OrgUnit; +import com.forgon.directory.service.OrgUnitManager; import com.forgon.disinfectsystem.barcode.service.BarcodeManager; import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; import com.forgon.disinfectsystem.datasynchronization.dao.SyncDataFromHIPDao; @@ -52,6 +54,8 @@ private UseRecordManager useRecordManager; @Autowired private WareHouseManager wareHouseManager; + @Autowired + private OrgUnitManager orgUnitManager; /** * 器械包使用登记(消毒物料使用登记) @@ -124,6 +128,15 @@ newUseRecord.setDepart(useRecord.getDepart()); newUseRecord.setDepartCoding(useRecord.getDepartCoding()); newUseRecord.setAscriptionDepartment(patient.getAscriptionDepartment()); + if(StringUtils.isNotBlank(newUseRecord.getAscriptionDepartment())){ + newUseRecord.setDepartCodeOfpatient(patient.getAscriptionDepartment()); + //ZJYY-112接口程序接收到手麻系统传入的入参后,根据字段ascriptionDepartment的值, + //查询出科室的编码,然后给UseRecord表的departCodeOfpatient字段赋值。 + OrgUnit orgUnit = orgUnitManager.getByName(newUseRecord.getAscriptionDepartment()); + if(orgUnit != null){ + newUseRecord.setDepartCodeOfpatient(orgUnit.getOrgUnitCoding()); + } + } newUseRecord.setVisitId(patient.getVisitId()); newUseRecord.setWashHandNurse(patient.getWashHandNurse()); newUseRecord.setCircuitNurse(patient.getCircuitNurse());