|
@@ -1,9 +1,21 @@
|
|
|
package cn.hnthyy.thmz.service.impl.his.yf;
|
|
|
|
|
|
+import cn.hnthyy.thmz.entity.his.mz.Employee;
|
|
|
+import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
|
|
|
+import cn.hnthyy.thmz.entity.his.zd.ZdUnitCode;
|
|
|
+import cn.hnthyy.thmz.entity.his.zy.APatientMi;
|
|
|
+import cn.hnthyy.thmz.entity.his.zy.ZyActpatient;
|
|
|
+import cn.hnthyy.thmz.mapper.his.mz.EmployeeMapper;
|
|
|
import cn.hnthyy.thmz.mapper.his.yf.YfSpiritAnestheticPrintMapper;
|
|
|
+import cn.hnthyy.thmz.mapper.his.yp.YpZdDictMapper;
|
|
|
+import cn.hnthyy.thmz.mapper.his.yp.YpZdManufactoryMapper;
|
|
|
+import cn.hnthyy.thmz.mapper.his.zd.ZdUnitCodeMapper;
|
|
|
+import cn.hnthyy.thmz.mapper.his.zy.APatientMiMapper;
|
|
|
+import cn.hnthyy.thmz.mapper.his.zy.ZyActpatientMapper;
|
|
|
import cn.hnthyy.thmz.service.his.yf.YfSpiritAnestheticPrintService;
|
|
|
import cn.hnthyy.thmz.vo.MzSendMedicineVo;
|
|
|
import cn.hnthyy.thmz.vo.SendDrugRecordVo;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -15,6 +27,24 @@ public class YfSpiritAnestheticPrintServiceImpl implements YfSpiritAnestheticPri
|
|
|
@SuppressWarnings("all")
|
|
|
@Autowired
|
|
|
private YfSpiritAnestheticPrintMapper yfSpiritAnestheticPrintMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private APatientMiMapper aPatientMiMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private EmployeeMapper employeeMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private YpZdDictMapper ypZdDictMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private YpZdManufactoryMapper ypZdManufactoryMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private ZyActpatientMapper zyActpatientMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private ZdUnitCodeMapper zdUnitCodeMapper;
|
|
|
|
|
|
@Override
|
|
|
public List<MzSendMedicineVo> queryMzSpiritAnestheticPrint(String beginDate, String endDate, String chargeItemCode, String unitCode, String[] drugFlags) {
|
|
@@ -30,15 +60,43 @@ public class YfSpiritAnestheticPrintServiceImpl implements YfSpiritAnestheticPri
|
|
|
public List<SendDrugRecordVo> getSendDrugRecord(SendDrugRecordVo sendDrugRecordVo) {
|
|
|
ArrayList<SendDrugRecordVo> sendDrugRecordVos = new ArrayList<>();
|
|
|
if(sendDrugRecordVo.getQueryScope() == 0){
|
|
|
- sendDrugRecordVos.addAll(yfSpiritAnestheticPrintMapper.selectYjRecord(sendDrugRecordVo));
|
|
|
+ sendDrugRecordVos.addAll(getYjRecord(sendDrugRecordVo));
|
|
|
sendDrugRecordVos.addAll(yfSpiritAnestheticPrintMapper.selectZyRecord(sendDrugRecordVo));
|
|
|
sendDrugRecordVos.addAll(yfSpiritAnestheticPrintMapper.selectMzRecord(sendDrugRecordVo));
|
|
|
}else if(sendDrugRecordVo.getQueryScope() == 1){
|
|
|
sendDrugRecordVos.addAll(yfSpiritAnestheticPrintMapper.selectMzRecord(sendDrugRecordVo));
|
|
|
}else if(sendDrugRecordVo.getQueryScope() == 2){
|
|
|
- sendDrugRecordVos.addAll(yfSpiritAnestheticPrintMapper.selectYjRecord(sendDrugRecordVo));
|
|
|
+ sendDrugRecordVos.addAll(getYjRecord(sendDrugRecordVo));
|
|
|
sendDrugRecordVos.addAll(yfSpiritAnestheticPrintMapper.selectZyRecord(sendDrugRecordVo));
|
|
|
}
|
|
|
return sendDrugRecordVos;
|
|
|
}
|
|
|
+
|
|
|
+ public List<SendDrugRecordVo> getYjRecord(SendDrugRecordVo sendDrugRecordVo) {
|
|
|
+ List<SendDrugRecordVo> sendDrugRecordVos = yfSpiritAnestheticPrintMapper.selectYjRecord(sendDrugRecordVo);
|
|
|
+ sendDrugRecordVos.forEach(sendDrugRecord ->{
|
|
|
+ APatientMi aPatientMi = aPatientMiMapper.selectPatientMiByInPatientNo(sendDrugRecord.getId());
|
|
|
+ if(aPatientMi != null){
|
|
|
+ sendDrugRecord.setSex(Integer.parseInt(aPatientMi.getSex()));
|
|
|
+ sendDrugRecord.setName(aPatientMi.getName());
|
|
|
+ sendDrugRecord.setBirthDay(aPatientMi.getBirthDate());
|
|
|
+ }
|
|
|
+ Employee employee = employeeMapper.selectByUserCode(sendDrugRecord.getDoctorName());
|
|
|
+ if(employee != null){
|
|
|
+ sendDrugRecord.setEmployeeName(employee.getEmployeeName());
|
|
|
+ }
|
|
|
+ YpZdDict ypZdDict = ypZdDictMapper.selectYpZdDictByCodeAndSerial(sendDrugRecord.getChargeCode(), sendDrugRecord.getSerial());
|
|
|
+ sendDrugRecord.setDrugName(ypZdDict.getName());
|
|
|
+ sendDrugRecord.setSpecification(ypZdDict.getSpecification());
|
|
|
+ sendDrugRecord.setAbbrName(ypZdManufactoryMapper.selectYpZdManufactoryByCode(ypZdDict.getManuCode()));
|
|
|
+ ZyActpatient zyActpatient = zyActpatientMapper.selectByInpatientNo(ZyActpatient.ZY_ACTPATIENT, sendDrugRecord.getId(), sendDrugRecord.getAdmissTimes());
|
|
|
+ if(zyActpatient == null){
|
|
|
+ zyActpatient = zyActpatientMapper.selectByInpatientNo(ZyActpatient.ZY_INACTPATIENT, sendDrugRecord.getId(), sendDrugRecord.getAdmissTimes());
|
|
|
+ }
|
|
|
+ sendDrugRecord.setIcdText(StringUtils.isBlank(zyActpatient.getAdmissDiagStr())?"":zyActpatient.getAdmissDiagStr());
|
|
|
+ ZdUnitCode zdUnitCode = zdUnitCodeMapper.selectByCode(sendDrugRecord.getWarnDept());
|
|
|
+ sendDrugRecord.setWarnDeptName(zdUnitCode.getName());
|
|
|
+ });
|
|
|
+ return sendDrugRecordVos;
|
|
|
+ }
|
|
|
}
|