|
@ -1,5 +1,6 @@
|
|
|
package com.yihu.wlyy.service.app.prescription;
|
|
|
|
|
|
import com.yihu.wlyy.adapter.PresModeAdapter;
|
|
|
import com.yihu.wlyy.entity.dict.SystemDict;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
@ -79,6 +80,8 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
private JwPrescriptionService jwPrescriptionService;
|
|
|
@Autowired
|
|
|
private RedisTemplate redisTemplate;
|
|
|
@Autowired
|
|
|
private PresModeAdapter presModeAdapter;
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
|
|
|
|
|
@ -116,53 +119,57 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray getPrescriptionInfos(String type,String diagnosisCode,String startDate,String endDate,String patient,String isRenewal,Integer page,Integer size){
|
|
|
public com.alibaba.fastjson.JSONArray getPrescriptionInfos(String type,String diagnosisCode,String startDate,String endDate,String patient,String isRenewal,Integer page,Integer size) throws Exception{
|
|
|
|
|
|
if(StringUtils.isNotBlank(type)){
|
|
|
if("1".equals(type)){
|
|
|
//基卫接口
|
|
|
List<Map<String,Object>> prescriptions = new ArrayList<>();
|
|
|
Map<String,Object> p1 = new HashMap<>();
|
|
|
p1.put("code","2");
|
|
|
p1.put("hospital","3502050100");
|
|
|
p1.put("hospitalName","海沧区嵩屿街道社区卫生服务中心");
|
|
|
p1.put("doctor","hxmD201703150222");
|
|
|
p1.put("doctorName","黄小陌(全科)");
|
|
|
p1.put("adminTeamId","643");
|
|
|
p1.put("prescriptionType","门诊");
|
|
|
p1.put("date","2017-08-08 10:10:10");
|
|
|
p1.put("patient","37c0657335f94ed38eeced22dbed8011");
|
|
|
p1.put("patientName","花生");
|
|
|
if(StringUtils.isNotBlank((String)p1.get("code"))){
|
|
|
String sql = "SELECT p.status FROM wlyy_prescription p WHERE p.parent_code='2'";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
if(list!=null&&list.size()>0){
|
|
|
int state = (Integer) (list.get(0).get("status"));
|
|
|
p1.put("status",state);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
List<PrescriptionInfo> prescriptionInfos = new ArrayList<>();
|
|
|
PrescriptionInfo info1 = new PrescriptionInfo();
|
|
|
info1.setCode("2017080700001");
|
|
|
info1.setPrescriptionCode("201708070001");
|
|
|
info1.setDel(1);
|
|
|
info1.setDrugCode("A1");
|
|
|
info1.setDrugName("A药品");
|
|
|
prescriptionInfos.add(info1);
|
|
|
|
|
|
List<PrescriptionDiagnosis> diagnosises = new ArrayList<>();
|
|
|
PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();
|
|
|
diagnosis.setCode("1");
|
|
|
diagnosis.setName("糖尿病");
|
|
|
diagnosises.add(diagnosis);
|
|
|
|
|
|
p1.put("prescriptionDt",diagnosises);
|
|
|
p1.put("prescriptionInfo",prescriptionInfos);
|
|
|
|
|
|
prescriptions.add(p1);
|
|
|
|
|
|
return new JSONArray(prescriptions);
|
|
|
Patient p = patientDao.findByCode(patient);
|
|
|
|
|
|
String rp= jwPrescriptionService.getLastRecipe(p.getSsc(),null,null,null);
|
|
|
com.alibaba.fastjson.JSONArray pres =presModeAdapter.modeToPrescription(rp);
|
|
|
|
|
|
return pres;
|
|
|
// //基卫接口
|
|
|
// List<Map<String,Object>> prescriptions = new ArrayList<>();
|
|
|
// Map<String,Object> p1 = new HashMap<>();
|
|
|
// p1.put("code","2");
|
|
|
// p1.put("hospital","3502050100");
|
|
|
// p1.put("hospitalName","海沧区嵩屿街道社区卫生服务中心");
|
|
|
// p1.put("doctor","hxmD201703150222");
|
|
|
// p1.put("doctorName","黄小陌(全科)");
|
|
|
// p1.put("adminTeamId","643");
|
|
|
// p1.put("prescriptionType","门诊");
|
|
|
// p1.put("date","2017-08-08 10:10:10");
|
|
|
// p1.put("patient","37c0657335f94ed38eeced22dbed8011");
|
|
|
// p1.put("patientName","花生");
|
|
|
// if(StringUtils.isNotBlank((String)p1.get("code"))){
|
|
|
// String sql = "SELECT p.status FROM wlyy_prescription p WHERE p.parent_code='2'";
|
|
|
// List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
// if(list!=null&&list.size()>0){
|
|
|
// int state = (Integer) (list.get(0).get("status"));
|
|
|
// p1.put("status",state);
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// List<PrescriptionInfo> prescriptionInfos = new ArrayList<>();
|
|
|
// PrescriptionInfo info1 = new PrescriptionInfo();
|
|
|
// info1.setCode("2017080700001");
|
|
|
// info1.setPrescriptionCode("201708070001");
|
|
|
// info1.setDel(1);
|
|
|
// info1.setDrugCode("A1");
|
|
|
// info1.setDrugName("A药品");
|
|
|
// prescriptionInfos.add(info1);
|
|
|
//
|
|
|
// List<PrescriptionDiagnosis> diagnosises = new ArrayList<>();
|
|
|
// PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();
|
|
|
// diagnosis.setCode("1");
|
|
|
// diagnosis.setName("糖尿病");
|
|
|
// diagnosises.add(diagnosis);
|
|
|
//
|
|
|
// p1.put("prescriptionDt",diagnosises);
|
|
|
// p1.put("prescriptionInfo",prescriptionInfos);
|
|
|
//
|
|
|
// prescriptions.add(p1);
|
|
|
|
|
|
}else{
|
|
|
StringBuffer sqlBuffer = new StringBuffer("SELECT p.code,p.create_time AS date,p.status,p.hospital_name As hospitalName FROM wlyy_prescription p " +
|
|
@ -193,10 +200,10 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
map.put("prescriptionInfo",prescriptionDiagnosisService.getPrescriptionInfo(code));
|
|
|
map.put("prescriptionDt", prescriptionDiagnosisService.getPrescriptionDiagnosis(code));
|
|
|
}
|
|
|
return new JSONArray(rs);
|
|
|
return com.alibaba.fastjson.JSONArray.parseArray(new JSONArray(rs).toString());
|
|
|
}
|
|
|
}
|
|
|
return new JSONArray();
|
|
|
return new com.alibaba.fastjson.JSONArray();
|
|
|
}
|
|
|
|
|
|
/**
|