yeshijie 7 gadi atpakaļ
vecāks
revīzija
6985f18afa

+ 22 - 21
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -176,27 +176,28 @@ public class ConsultTeamService extends ConsultService {
            return json;
        }
        //点击后判断,如果用户当前存在可申请续方的处方记录,则进入续方申请流程,若不存在可续方记录,alert“当前没有可以申请续方的处方记录”
        int num = 0;
        Patient p = patientDao.findByCode(patient);
        String rp= jwPrescriptionService.getRecipeList(p.getSsc(),null,null,null);
        com.alibaba.fastjson.JSONArray pres =presModeAdapter.modeToPrescription(rp);
        Iterator iterator = pres.iterator();
        while (iterator.hasNext()){
            com.alibaba.fastjson.JSONObject r = ( com.alibaba.fastjson.JSONObject)iterator.next();
            com.alibaba.fastjson.JSONArray des = 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())){
                    //为糖尿病高血压
                    num++;
                    break;
                }
            }
        }
        if(num==0){
            json.put("msg","当前没有可以申请续方的处方记录");
            return json;
        }
        // 智业接口没有返回列表,是单条 所以先不处理
//        int num = 0;
//        Patient p = patientDao.findByCode(patient);
//        String rp= jwPrescriptionService.getRecipeList(p.getSsc(),null,null,null);
//        com.alibaba.fastjson.JSONArray pres =presModeAdapter.modeToPrescription(rp);
//        Iterator iterator = pres.iterator();
//        while (iterator.hasNext()){
//            com.alibaba.fastjson.JSONObject r = ( com.alibaba.fastjson.JSONObject)iterator.next();
//            com.alibaba.fastjson.JSONArray des = 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())){
//                    //为糖尿病高血压
//                    num++;
//                    break;
//                }
//            }
//        }
//        if(num==0){
//            json.put("msg","当前没有可以申请续方的处方记录");
//            return json;
//        }
        //续方说明
        List<PrescriptionExplain> list = prescriptionExplainDao.findList();

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

@ -153,13 +153,13 @@ public class PrescriptionInfoService extends BaseService {
     * @param type
     * @return
     */
    public com.alibaba.fastjson.JSONArray getPrescriptionInfos(String type, String diagnosisCode, String startDate, String endDate, String patient, String isRenewal, Integer page, Integer size) throws Exception {
    public com.alibaba.fastjson.JSONArray getPrescriptionInfos(String type,String recipeNo, String diagnosisCode, String startDate, String endDate, String patient, String isRenewal, Integer page, Integer size) throws Exception {
        if (StringUtils.isNotBlank(type)) {
            if ("1".equals(type)) {
                Patient p = patientDao.findByCode(patient);
                String rp = jwPrescriptionService.getRecipeList(p.getSsc(), null, startDate, endDate);
                String rp = jwPrescriptionService.getLastRecipe(p.getSsc(), recipeNo, startDate, endDate);
                com.alibaba.fastjson.JSONArray pres = presModeAdapter.modeToPrescription(rp);
                if(pres==null||pres.size()==0){

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

@ -41,13 +41,14 @@ public class PatientPrescriptionInfoController extends BaseController {
    @ApiOperation(value = "获取长处方信息列表")
    public String getPrescriptionInfos(@RequestParam(required = true)@ApiParam(name="type",value="1:查询处方;2我的续方;3:续方记录")String type,
                                       @RequestParam(required = false)@ApiParam(name="isRenewal",value="处方是否可续方:1.是;2.无过滤")String isRenewal,
                                       @RequestParam(required = false)@ApiParam(name="recipeNo",value="医嘱号,第一次获取上一方时传入0,第二次获取上一方时传入第一次返回的医嘱号,以此类推")String recipeNo,
                                       @RequestParam(required = false)@ApiParam(name="startDate",value="开始时间")String startDate,
                                       @RequestParam(required = false)@ApiParam(name="endDate",value="结束时间")String endDate,
                                       @RequestParam(required = false,defaultValue = "0")@ApiParam(name="diagnosisCode",value="所有诊断(0 全部 1高血压 2糖尿病)")String diagnosisCode,
                                       @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,recipeNo,diagnosisCode,startDate,endDate,getRepUID(),isRenewal,page,size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");