|
|
@@ -637,38 +637,47 @@ public class MzPharmacyController {
|
|
|
mzChargeDetail.setReceiptNo(Math.abs(mzChargeDetail.getReceiptNo()));//防止退药处方,需将发票号转为正数
|
|
|
List<MzSendMedicineVo> cfxxList = mzPharmacyService.getFyclPrescriptionDetail(mzChargeDetail);
|
|
|
if (cfxxList.size() > 0) {
|
|
|
+ // 获取公共信息
|
|
|
MzVisitTable visit = mzVisitTableService.queryByPatientIdAndTimes(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes());
|
|
|
String icdText = StringUtils.isBlank(visit.getIcdText())?"":visit.getIcdText();
|
|
|
MzBlRecord mzBlRecord = mzBlRecordService.queryMzBlRecordByPatientIdAndTimes(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes());
|
|
|
if(null != mzBlRecord && StringUtils.isNotBlank(mzBlRecord.getTentativeDiagnosis())){
|
|
|
icdText += (StringUtils.isBlank(icdText)?"":",")+mzBlRecord.getTentativeDiagnosis();
|
|
|
}
|
|
|
- cfxxList.get(0).setIcdText(icdText);
|
|
|
String warnDeptName = zdUnitCodeService.queryDeptNameByIdInCache(cfxxList.get(0).getWarnDept());
|
|
|
- cfxxList.get(0).setWarnDeptName(warnDeptName);
|
|
|
Employee employee = employeeService.queryByUserCode(cfxxList.get(0).getDoctorCode());
|
|
|
- cfxxList.get(0).setEmployeeName(employee.getEmployeeName());
|
|
|
+ String employeeName = employee.getEmployeeName();
|
|
|
|
|
|
// 获取患者信息,添加医保接口需要的三个参数
|
|
|
+ MzPatientMi patientInfo = null;
|
|
|
+ String psnCertType = "01"; // 默认身份证
|
|
|
+ String certno = ""; // 默认空字符串
|
|
|
+ String psnName = cfxxList.get(0).getName(); // 默认使用收费明细中的姓名
|
|
|
+
|
|
|
if (StringUtils.isNotBlank(cfxxList.get(0).getPatientId())) {
|
|
|
- MzPatientMi patientInfo = mzPatientMiService.queryByPatientId(cfxxList.get(0).getPatientId());
|
|
|
+ patientInfo = mzPatientMiService.queryByPatientId(cfxxList.get(0).getPatientId());
|
|
|
if (patientInfo != null) {
|
|
|
// 设置患者证件类型(默认身份证)
|
|
|
- cfxxList.get(0).setPsnCertType(patientInfo.getCertificateType() != null ?
|
|
|
- patientInfo.getCertificateType() : "01");
|
|
|
+ psnCertType = patientInfo.getCertificateType() != null ?
|
|
|
+ patientInfo.getCertificateType() : "01";
|
|
|
// 设置患者证件号码(身份证号)
|
|
|
- cfxxList.get(0).setCertno(patientInfo.getSocialNo() != null ?
|
|
|
- patientInfo.getSocialNo() : "");
|
|
|
+ certno = patientInfo.getSocialNo() != null ?
|
|
|
+ patientInfo.getSocialNo() : "";
|
|
|
// 设置患者姓名
|
|
|
- cfxxList.get(0).setPsnName(patientInfo.getName() != null ?
|
|
|
- patientInfo.getName() : cfxxList.get(0).getName());
|
|
|
- } else {
|
|
|
- // 如果查询不到患者信息,使用默认值
|
|
|
- cfxxList.get(0).setPsnCertType("01"); // 默认身份证
|
|
|
- cfxxList.get(0).setCertno(""); // 空字符串
|
|
|
- cfxxList.get(0).setPsnName(cfxxList.get(0).getName()); // 使用收费明细中的姓名
|
|
|
+ psnName = patientInfo.getName() != null ?
|
|
|
+ patientInfo.getName() : cfxxList.get(0).getName();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 为所有记录设置公共信息
|
|
|
+ for (MzSendMedicineVo item : cfxxList) {
|
|
|
+ item.setIcdText(icdText);
|
|
|
+ item.setWarnDeptName(warnDeptName);
|
|
|
+ item.setEmployeeName(employeeName);
|
|
|
+ item.setPsnCertType(psnCertType);
|
|
|
+ item.setCertno(certno);
|
|
|
+ item.setPsnName(psnName);
|
|
|
+ }
|
|
|
|
|
|
// 查询门诊病人处方过敏史
|
|
|
List<PatientAllergenInfo> patientAllergenInfoList = patientAllergenInfoService.queryPatientAllergenInfoByPatNo(cfxxList.get(0).getPatientId());
|