trick9191 %!s(int64=7) %!d(string=hai) anos
pai
achega
59fa9e97b2

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

@ -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();
    }
    /**

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

@ -17,10 +17,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -349,4 +346,18 @@ public class PrescriptionInfoController extends BaseController{
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescription" ,method = RequestMethod.GET)
    @ResponseBody
    @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"));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}

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

@ -43,7 +43,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,getRepUID(),isRenewal,page,size));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionInfos(type,diagnosisCode,startDate,endDate,"915cc7da-5b1d-11e6-8344-fa163e8aee56",isRenewal,page,size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");