Browse Source

长处方

trick9191 7 years ago
parent
commit
7bd2f91c66

+ 39 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -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){

+ 2 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -379,9 +379,7 @@ public class PrescriptionInfoController extends BaseController{
    @ApiOperation(value = "获取长处方详细信息")
    public String getPrescription(@RequestParam(required = true)@ApiParam(name="code",value="处方CODE")String code){
        try {
            //return write(200, "查询成功!", "data", prescriptionInfoService.getPrescription(code));
            return write(200, "查询成功!", "data", prescriptionInfoService.getContinuedPrescription("69d11d6aa5254acd859a23a281d11910"));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescription(code));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -399,4 +397,5 @@ public class PrescriptionInfoController extends BaseController{
            return error(-1, "查询失败!");
        }
    }
}

+ 1 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionInfoController.java

@ -54,9 +54,7 @@ public class PatientPrescriptionInfoController extends BaseController {
    @ApiOperation(value = "获取长处方详细信息")
    public String getPrescription(@RequestParam(required = true)@ApiParam(name="code",value="处方CODE")String code){
        try {
            //return write(200, "查询成功!", "data", prescriptionInfoService.getPrescription(code));
            return write(200, "查询成功!", "data", prescriptionInfoService.getContinuedPrescription("69d11d6aa5254acd859a23a281d11910"));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescription(code));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");