trick9191 7 سال پیش
والد
کامیت
d2c65c5feb

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

@ -132,51 +132,12 @@ public class PrescriptionInfoService extends BaseService {
                for(int i=0;i<pres.size();i++){
                    com.alibaba.fastjson.JSONObject r = (com.alibaba.fastjson.JSONObject) pres.get(i);
                    r.put("reviewedState",presCheckState(r.getString("code")));
                    r.put("patientName",p.getName());
                    r.put("patient",p.getCode());
                }
                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{
                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 " +
                        "WHERE p.patient=?");
                List<Object> params = new ArrayList<>();
@ -202,6 +163,8 @@ public class PrescriptionInfoService extends BaseService {
                //通过缓存查找药品和疾病
                for(Map<String,Object> map :rs){
                    String code = (String)map.get("code");
                    map.put("patient",p.getCode());
                    map.put("patientName",p.getName());
                    map.put("prescriptionInfo",prescriptionDiagnosisService.getPrescriptionInfo(code));
                    map.put("prescriptionDt", prescriptionDiagnosisService.getPrescriptionDiagnosis(code));
                }
@ -1015,4 +978,11 @@ public class PrescriptionInfoService extends BaseService {
            return "1";
        }
    }
    public JSONArray getRateList(){
        StringBuffer sql = new StringBuffer("SELECT * from zy_common_dict WHERE dict_name = 'IV_RECIPE_FREQUENCY_DICT'");
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql.toString());
        return new JSONArray(rs);
    }
}

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

@ -365,7 +365,7 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/drugToRate", method = RequestMethod.GET)
    @ApiOperation(value ="频次翻译")
    public String drugToRate(String code){
    public String drugToRate(@RequestParam(required = true)@ApiParam(name="code",value="频次CODE")String code){
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.drugToRate(code));
        } catch (Exception e) {
@ -387,4 +387,16 @@ public class PrescriptionInfoController extends BaseController{
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getRateList" ,method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "查询频次列表")
    public String getRateList(){
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getRateList());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}

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

@ -6,7 +6,6 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -43,7 +42,7 @@ public class PatientPrescriptionInfoController extends BaseController {
                                       @RequestParam(required = false)@ApiParam(name="page",value="起始页")Integer page,
                                       @RequestParam(required = false)@ApiParam(name="size",value="每页条数")Integer size){
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionInfos(type,diagnosisCode,startDate,endDate,"915cc7da-5b1d-11e6-8344-fa163e8aee56",isRenewal,page,size));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionInfos(type,diagnosisCode,startDate,endDate,getRepUID(),isRenewal,page,size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");