|
@ -35,6 +35,7 @@ import net.sf.json.JSONArray;
|
|
import net.sf.json.JSONObject;
|
|
import net.sf.json.JSONObject;
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
@ -126,15 +127,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 原处方记录列表
|
|
|
|
* @param registerSn
|
|
|
|
* @param patNo
|
|
|
|
* @param admNo
|
|
|
|
* @param demoFlag
|
|
|
|
* @return
|
|
|
|
* @throws Exception
|
|
|
|
|
|
*
|
|
*/
|
|
*/
|
|
public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn,String patNo,String admNo,boolean demoFlag)throws Exception{
|
|
|
|
|
|
public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn,String patient,String admNo,boolean demoFlag)throws Exception{
|
|
|
|
String patNo =patientMappingService.findHisPatNoByPatient(patient);
|
|
return entranceService.BS16017(registerSn,patNo,admNo,null,demoFlag);
|
|
return entranceService.BS16017(registerSn,patNo,admNo,null,demoFlag);
|
|
}
|
|
}
|
|
|
|
|
|
@ -194,7 +190,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
" o.origin_register_no AS originRegisterNo, " +
|
|
" o.origin_register_no AS originRegisterNo, " +
|
|
" o.hospital," +
|
|
" o.hospital," +
|
|
" o.hospital_name AS hospitalName," +
|
|
" o.hospital_name AS hospitalName," +
|
|
" o.winNo," +
|
|
|
|
|
|
" o.win_no AS winNo," +
|
|
" o.type," +
|
|
" o.type," +
|
|
" o.dept AS dept, " +
|
|
" o.dept AS dept, " +
|
|
" o.dept_name AS deptName, " +
|
|
" o.dept_name AS deptName, " +
|
|
@ -237,7 +233,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
* @param outpatientId
|
|
* @param outpatientId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public com.alibaba.fastjson.JSONObject findReOutpatientInfo(String outpatientId){
|
|
|
|
|
|
public com.alibaba.fastjson.JSONObject findReOutpatientInfo(String outpatientId,String prescriptionId){
|
|
com.alibaba.fastjson.JSONObject rs = new com.alibaba.fastjson.JSONObject();
|
|
com.alibaba.fastjson.JSONObject rs = new com.alibaba.fastjson.JSONObject();
|
|
|
|
|
|
//复诊信息
|
|
//复诊信息
|
|
@ -257,7 +253,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
rs.put("mobile",basePatientDO.getMobile());
|
|
rs.put("mobile",basePatientDO.getMobile());
|
|
|
|
|
|
//获取处方信息
|
|
//获取处方信息
|
|
List<WlyyPrescriptionDO> prescriptionDOs = prescriptionDao.findByOutpatientId(outpatientId);
|
|
|
|
|
|
List<WlyyPrescriptionDO> prescriptionDOs = null;
|
|
|
|
if(StringUtils.isNotBlank(prescriptionId)){
|
|
|
|
prescriptionDOs = prescriptionDao.findById(prescriptionId);
|
|
|
|
}else{
|
|
|
|
prescriptionDOs = prescriptionDao.findByOutpatientId(outpatientId);
|
|
|
|
|
|
|
|
}
|
|
List<WlyyPrescriptionVO> prescriptionVOs = new ArrayList<>();
|
|
List<WlyyPrescriptionVO> prescriptionVOs = new ArrayList<>();
|
|
if(prescriptionDOs!=null&&prescriptionDOs.size()>0){
|
|
if(prescriptionDOs!=null&&prescriptionDOs.size()>0){
|
|
convertToModels(prescriptionDOs,prescriptionVOs,WlyyPrescriptionVO.class);
|
|
convertToModels(prescriptionDOs,prescriptionVOs,WlyyPrescriptionVO.class);
|
|
@ -283,9 +285,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
}
|
|
}
|
|
|
|
|
|
//物流配送新
|
|
//物流配送新
|
|
List<WlyyPrescriptionExpressageLogDO> expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientId(outpatientId);
|
|
|
|
|
|
List<WlyyPrescriptionExpressageLogDO> expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId);
|
|
List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>();
|
|
List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>();
|
|
if(expressageLogDOs!=null&&expressageLogVOs.size()>0){
|
|
|
|
|
|
if(expressageLogDOs!=null&&expressageLogDOs.size()>0){
|
|
rs.put("expressageLogs",convertToModels(expressageLogDOs,expressageLogVOs, WlyyPrescriptionExpressageLogVO.class));
|
|
rs.put("expressageLogs",convertToModels(expressageLogDOs,expressageLogVOs, WlyyPrescriptionExpressageLogVO.class));
|
|
}else{
|
|
}else{
|
|
rs.put("expressageLogs",null);
|
|
rs.put("expressageLogs",null);
|
|
@ -932,7 +934,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
" o.id AS outpatientId, " +
|
|
" o.id AS outpatientId, " +
|
|
" o.icd10_name AS icd10Name, " +
|
|
" o.icd10_name AS icd10Name, " +
|
|
" p.`status`, " +
|
|
" p.`status`, " +
|
|
" p.id AS prescriptionId " +
|
|
|
|
|
|
" p.id AS prescriptionId ," +
|
|
|
|
" e.id AS expressageId" +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_outpatient o " +
|
|
" wlyy_outpatient o " +
|
|
" JOIN wlyy_prescription p ON p.outpatient_id = o.id " +
|
|
" JOIN wlyy_prescription p ON p.outpatient_id = o.id " +
|
|
@ -961,4 +964,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
|
|
return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Boolean setMailno(String mailno,String expressageId){
|
|
|
|
WlyyPrescriptionExpressageDO expressageDO = prescriptionExpressageDao.findOne(expressageId);
|
|
|
|
expressageDO.setMailno(mailno);
|
|
|
|
prescriptionExpressageDao.save(expressageDO);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|