|
@ -84,6 +84,10 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
@Autowired
|
|
|
private PresModeAdapter presModeAdapter;
|
|
|
|
|
|
private static final String gxy = "HP0093";
|
|
|
|
|
|
private static final String tnb ="HP0047";
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
|
|
|
|
|
|
/**
|
|
@ -103,10 +107,10 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
rs.put("states",states);
|
|
|
List<Map<String,Object>> diseases = new ArrayList<>();
|
|
|
Map<String,Object> dis1 = new HashMap<>();
|
|
|
dis1.put("code","HP0093");
|
|
|
dis1.put("code",gxy);
|
|
|
dis1.put("name","高血压");
|
|
|
Map<String,Object> dis2 = new HashMap<>();
|
|
|
dis2.put("code","HP0047");
|
|
|
dis2.put("code",tnb);
|
|
|
dis2.put("name","糖尿病");
|
|
|
diseases.add(dis1);
|
|
|
diseases.add(dis2);
|
|
@ -135,10 +139,37 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
r.put("patientName",p.getName());
|
|
|
r.put("patient",p.getCode());
|
|
|
}
|
|
|
//过滤可续签
|
|
|
if(StringUtils.isNotBlank(isRenewal)&&"1".equals(isRenewal)){
|
|
|
Iterator iterator = pres.iterator();
|
|
|
while (iterator.hasNext()){
|
|
|
com.alibaba.fastjson.JSONObject r = ( com.alibaba.fastjson.JSONObject)iterator.next();
|
|
|
//判断状态是否符合
|
|
|
String reviewedState = r.getString("reviewedState");
|
|
|
if("0".equals(reviewedState)){
|
|
|
iterator.remove();
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
com.alibaba.fastjson.JSONArray des = (com.alibaba.fastjson.JSONArray)r.getJSONArray("prescriptionDt");
|
|
|
|
|
|
for(int i=0 ;i<des.size();i++){
|
|
|
PrescriptionDiagnosis ds = des.getObject(i,PrescriptionDiagnosis.class);
|
|
|
if(gxy.equals(ds.getHealthProblem())||tnb.equals(ds.getHealthProblem())){
|
|
|
//为糖尿病高血压
|
|
|
}else{
|
|
|
//如果含有非糖尿病或高血压
|
|
|
iterator.remove();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
return pres;
|
|
|
}else{
|
|
|
Patient p = patientDao.findByCode(patient);
|
|
|
StringBuffer sqlBuffer = new StringBuffer("SELECT p.code,p.create_time AS date,p.status,p.hospital_name As hospitalName FROM wlyy_prescription p " +
|
|
|
StringBuffer sqlBuffer = new StringBuffer("SELECT p.code,p.create_time AS createTime,p.status,p.hospital_name As hospitalName FROM wlyy_prescription p " +
|
|
|
"WHERE p.patient=?");
|
|
|
List<Object> params = new ArrayList<>();
|
|
|
params.add(patient);
|
|
@ -208,8 +239,11 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
* @param code
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getPrescription(String code){
|
|
|
return null;
|
|
|
public com.alibaba.fastjson.JSONObject getPrescription(String code){
|
|
|
String rs = jwPrescriptionService.getRecipe(code,null);
|
|
|
com.alibaba.fastjson.JSONObject r = presModeAdapter.modelToSinglePrescription(rs);
|
|
|
r.put("reviewedState",presCheckState(code));
|
|
|
return r;
|
|
|
}
|
|
|
|
|
|
public com.alibaba.fastjson.JSONObject getPrescriptionProcess(String code){
|