Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

huangwenjie 7 years ago
parent
commit
37002dba41
18 changed files with 372 additions and 201 deletions
  1. 4 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionReasonDict.java
  2. 3 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionReasonDictDao.java
  3. 12 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionReviewedReasonDao.java
  4. 2 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java
  5. 101 101
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/redis/RedisMsgPubSubListener.java
  6. 44 44
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/redis/RedisThread.java
  7. 12 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionAdjustReasonDao.java
  8. 17 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionReasonDictDao.java
  9. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionReviewedReasonDao.java
  10. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/zydict/ZyCommonDictDao.java
  11. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/zydict/ZyIvPhysicDictDao.java
  12. 44 30
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  13. 57 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  14. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java
  15. 9 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  16. 26 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java
  17. 18 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java
  18. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionInfoController.java

+ 4 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionReasonDict.java

@ -2,11 +2,15 @@ package com.yihu.wlyy.entity.patient.prescription;
import com.yihu.wlyy.entity.IdEntity;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
import java.util.Date;
/**
/**
 * Created by Trick on 2017/8/26.
 * Created by Trick on 2017/8/26.
 */
 */
@Entity
@Table(name = "wlyy_prescription_Reason_dict")
public class PrescriptionReasonDict extends IdEntity {
public class PrescriptionReasonDict extends IdEntity {
    private String code;//编码code
    private String code;//编码code

+ 3 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionReasonDictDao.java

@ -11,5 +11,7 @@ import java.util.List;
 */
 */
public interface PrescriptionReasonDictDao extends PagingAndSortingRepository<PrescriptionReasonDict, Long>, JpaSpecificationExecutor<PrescriptionReasonDict> {
public interface PrescriptionReasonDictDao extends PagingAndSortingRepository<PrescriptionReasonDict, Long>, JpaSpecificationExecutor<PrescriptionReasonDict> {
    List<PrescriptionReasonDict> findByTypeOrderBySortAsc(String type);
    List<PrescriptionReasonDict> findByTypeOrderBySortAsc(Integer type);
    PrescriptionReasonDict findByTypeAndCode(Integer type,String code);
}
}

+ 12 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionReviewedReasonDao.java

@ -0,0 +1,12 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionReasonDict;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionReviewedReason;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2017/8/26.
 */
public interface PrescriptionReviewedReasonDao  extends PagingAndSortingRepository<PrescriptionReviewedReason, Long>, JpaSpecificationExecutor<PrescriptionReviewedReason> {
}

+ 2 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -1,9 +1,7 @@
package com.yihu.wlyy.event;
package com.yihu.wlyy.event;
import com.yihu.wlyy.redis.RedisThread;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
@ -15,8 +13,8 @@ import org.springframework.stereotype.Service;
public class ApplicationEvent implements ApplicationListener<ContextRefreshedEvent> {
public class ApplicationEvent implements ApplicationListener<ContextRefreshedEvent> {
    private Logger logger = LoggerFactory.getLogger(ApplicationEvent.class);
    private Logger logger = LoggerFactory.getLogger(ApplicationEvent.class);
    @Autowired
    private RedisThread redisThread;
//    @Autowired
//    private RedisThread redisThread;
    @Override
    @Override
    public void onApplicationEvent(ContextRefreshedEvent ContextRefreshedEvent) {
    public void onApplicationEvent(ContextRefreshedEvent ContextRefreshedEvent) {

+ 101 - 101
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/redis/RedisMsgPubSubListener.java

@ -1,101 +1,101 @@
package com.yihu.wlyy.redis;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.util.HttpUtil;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import redis.clients.jedis.JedisPubSub;
/**
 * Created by Trick on 2017/8/7.
 */
@Component
public class RedisMsgPubSubListener extends JedisPubSub {
    @Autowired
    private PrescriptionInfoService prescriptionInfoService;
    @Autowired
    private PrescriptionService prescriptionService;
    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
    @Override
    public void unsubscribe() {
        super.unsubscribe();
    }
    @Override
    public void unsubscribe(String... channels) {
        super.unsubscribe(channels);
    }
    @Override
    public void subscribe(String... channels) {
        super.subscribe(channels);
    }
    @Override
    public void psubscribe(String... patterns) {
        super.psubscribe(patterns);
    }
    @Override
    public void punsubscribe() {
        super.punsubscribe();
    }
    @Override
    public void punsubscribe(String... patterns) {
        super.punsubscribe(patterns);
    }
    @Override
    public void onMessage(String channel, String message) {
        logger.info("redis_onMessage...:"+message);
        //this.unsubscribe();
        try{
            JSONObject json = new JSONObject(message);
            String title =  json.getString("title");
            if("redisAddPrescription".equals(title)){
                logger.info(json.toString());
                //审核消息发送
                prescriptionInfoService.onMesSquareState(message);
            }else if("dispensingComplete".equals(title)){//配药完成
                //药品配送完成,提醒取药
                String prescriptionCode = json.getString("prescription");
                prescriptionService.dispensingComplete(prescriptionCode);
            }
        }catch (Exception e){
            logger.error("redis_error...",e);
        }
    }
    @Override
    public void onPMessage(String pattern, String channel, String message) {
    }
    @Override
    public void onSubscribe(String channel, int subscribedChannels) {
        //System.out.println("channel:" + channel + "is been subscribed:" + subscribedChannels);
    }
    @Override
    public void onPUnsubscribe(String pattern, int subscribedChannels) {
    }
    @Override
    public void onPSubscribe(String pattern, int subscribedChannels) {
    }
    @Override
    public void onUnsubscribe(String channel, int subscribedChannels) {
        System.out.println("channel:" + channel + "is been unsubscribed:" + subscribedChannels);
    }
}
//package com.yihu.wlyy.redis;
//
//import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
//import com.yihu.wlyy.service.app.prescription.PrescriptionService;
//import com.yihu.wlyy.util.HttpUtil;
//import org.json.JSONObject;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//import redis.clients.jedis.JedisPubSub;
//
///**
// * Created by Trick on 2017/8/7.
// */
//@Component
//public class RedisMsgPubSubListener extends JedisPubSub {
//
//    @Autowired
//    private PrescriptionInfoService prescriptionInfoService;
//    @Autowired
//    private PrescriptionService prescriptionService;
//
//    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
//
//    @Override
//    public void unsubscribe() {
//        super.unsubscribe();
//    }
//
//    @Override
//    public void unsubscribe(String... channels) {
//        super.unsubscribe(channels);
//    }
//
//    @Override
//    public void subscribe(String... channels) {
//        super.subscribe(channels);
//    }
//
//    @Override
//    public void psubscribe(String... patterns) {
//        super.psubscribe(patterns);
//    }
//
//    @Override
//    public void punsubscribe() {
//        super.punsubscribe();
//    }
//
//    @Override
//    public void punsubscribe(String... patterns) {
//        super.punsubscribe(patterns);
//    }
//
//    @Override
//    public void onMessage(String channel, String message) {
//        logger.info("redis_onMessage...:"+message);
//        //this.unsubscribe();
//        try{
//            JSONObject json = new JSONObject(message);
//            String title =  json.getString("title");
//            if("redisAddPrescription".equals(title)){
//                logger.info(json.toString());
//                //审核消息发送
//                prescriptionInfoService.onMesSquareState(message);
//            }else if("dispensingComplete".equals(title)){//配药完成
//                //药品配送完成,提醒取药
//                String prescriptionCode = json.getString("prescription");
//                prescriptionService.dispensingComplete(prescriptionCode);
//            }
//        }catch (Exception e){
//            logger.error("redis_error...",e);
//        }
//    }
//
//    @Override
//    public void onPMessage(String pattern, String channel, String message) {
//
//    }
//
//    @Override
//    public void onSubscribe(String channel, int subscribedChannels) {
//        //System.out.println("channel:" + channel + "is been subscribed:" + subscribedChannels);
//    }
//
//    @Override
//    public void onPUnsubscribe(String pattern, int subscribedChannels) {
//
//    }
//
//    @Override
//    public void onPSubscribe(String pattern, int subscribedChannels) {
//
//    }
//
//    @Override
//    public void onUnsubscribe(String channel, int subscribedChannels) {
//        System.out.println("channel:" + channel + "is been unsubscribed:" + subscribedChannels);
//    }
//}

+ 44 - 44
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/redis/RedisThread.java

@ -1,44 +1,44 @@
package com.yihu.wlyy.redis;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.util.SystemConf;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
/**
 * Created by Trick on 2017/8/7.
 */
@Component
public class RedisThread implements Runnable {
    @Value("${spring.redis.host}")
    private String url;
    @Autowired
    private RedisMsgPubSubListener redisMsgPubSubListener;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private PrescriptionService prescriptionService;
    @Override
    public void run() {
        String key = SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title");
        while (true){
            redisTemplate.watch(key);
            String message = redisTemplate.opsForList().rightPop(key);
            redisTemplate.unwatch();
            if(StringUtils.isEmpty(message)){
                try{
                    Thread.sleep(1000L);//如果没有读取到记录,等待1秒
                }catch (Exception e){
                    e.printStackTrace();
                }
            }else {
                prescriptionService.redisMessage(message);
            }
        }
    }
}
//package com.yihu.wlyy.redis;
//
//import com.yihu.wlyy.service.app.prescription.PrescriptionService;
//import com.yihu.wlyy.util.SystemConf;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.stereotype.Component;
//
///**
// * Created by Trick on 2017/8/7.
// */
//@Component
//public class RedisThread implements Runnable {
//
//    @Value("${spring.redis.host}")
//    private String url;
//    @Autowired
//    private RedisMsgPubSubListener redisMsgPubSubListener;
//    @Autowired
//    private StringRedisTemplate redisTemplate;
//    @Autowired
//    private PrescriptionService prescriptionService;
//
//    @Override
//    public void run() {
//        String key = SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title");
//        while (true){
//            redisTemplate.watch(key);
//            String message = redisTemplate.opsForList().rightPop(key);
//            redisTemplate.unwatch();
//            if(StringUtils.isEmpty(message)){
//                try{
//                    Thread.sleep(1000L);//如果没有读取到记录,等待1秒
//                }catch (Exception e){
//                    e.printStackTrace();
//                }
//            }else {
//                prescriptionService.redisMessage(message);
//            }
//        }
//    }
//}

+ 12 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionAdjustReasonDao.java

@ -0,0 +1,12 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionAdjustReason;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2017/8/26.
 */
public interface PrescriptionAdjustReasonDao extends PagingAndSortingRepository<PrescriptionAdjustReason, Long>, JpaSpecificationExecutor<PrescriptionAdjustReason> {
}

+ 17 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionReasonDictDao.java

@ -0,0 +1,17 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionReasonDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2017/8/26.
 */
public interface PrescriptionReasonDictDao extends PagingAndSortingRepository<PrescriptionReasonDict, Long>, JpaSpecificationExecutor<PrescriptionReasonDict> {
    List<PrescriptionReasonDict> findByTypeOrderBySortAsc(Integer type);
    PrescriptionReasonDict findByTypeAndCode(Integer type, String code);
}

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionReviewedReasonDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionReviewedReason;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2017/8/26.
 */
public interface PrescriptionReviewedReasonDao  extends PagingAndSortingRepository<PrescriptionReviewedReason, Long>, JpaSpecificationExecutor<PrescriptionReviewedReason> {
}

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/zydict/ZyCommonDictDao.java

@ -1,7 +1,9 @@
package com.yihu.wlyy.repository.zydict;
package com.yihu.wlyy.repository.zydict;
import com.yihu.wlyy.entity.zydict.ZyCommonDict;
import com.yihu.wlyy.entity.zydict.ZyCommonDict;
import com.yihu.wlyy.entity.zydict.ZyIvPhysicDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
@ -9,5 +11,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 */
 */
public interface ZyCommonDictDao extends PagingAndSortingRepository<ZyCommonDict, Long>, JpaSpecificationExecutor<ZyCommonDict> {
public interface ZyCommonDictDao extends PagingAndSortingRepository<ZyCommonDict, Long>, JpaSpecificationExecutor<ZyCommonDict> {
    @Query("select p.name from ZyCommonDict p where p.dictName=?1 and p.code=?2 ")
    String findByDictNameAndCode(String dictName,String code);
}
}

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/zydict/ZyIvPhysicDictDao.java

@ -1,11 +1,16 @@
package com.yihu.wlyy.repository.zydict;
package com.yihu.wlyy.repository.zydict;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.zydict.ZyIvPhysicDict;
import com.yihu.wlyy.entity.zydict.ZyIvPhysicDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
 * Created by yeshijie on 2017/8/11.
 * Created by yeshijie on 2017/8/11.
 */
 */
public interface ZyIvPhysicDictDao extends PagingAndSortingRepository<ZyIvPhysicDict, Long>, JpaSpecificationExecutor<ZyIvPhysicDict> {
public interface ZyIvPhysicDictDao extends PagingAndSortingRepository<ZyIvPhysicDict, Long>, JpaSpecificationExecutor<ZyIvPhysicDict> {
    @Query("select p from ZyIvPhysicDict p where p.physciCode=?1")
    ZyIvPhysicDict findByPhysicCode(String physciCode);
}
}

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

@ -16,6 +16,7 @@ import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.entity.zydict.ZyIvPhysicDict;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDoctorDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDoctorDao;
import com.yihu.wlyy.repository.consult.ConsultTeamLogDao;
import com.yihu.wlyy.repository.consult.ConsultTeamLogDao;
@ -176,27 +177,28 @@ public class ConsultTeamService extends ConsultService {
            return json;
            return json;
        }
        }
        //点击后判断,如果用户当前存在可申请续方的处方记录,则进入续方申请流程,若不存在可续方记录,alert“当前没有可以申请续方的处方记录”
        //点击后判断,如果用户当前存在可申请续方的处方记录,则进入续方申请流程,若不存在可续方记录,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();
        List<PrescriptionExplain> list = prescriptionExplainDao.findList();
@ -1156,11 +1158,7 @@ public class ConsultTeamService extends ConsultService {
            prescriptionInfo.setPrice(CommonUtil.doubleToInt(info.getDouble("price")));//药品单价
            prescriptionInfo.setPrice(CommonUtil.doubleToInt(info.getDouble("price")));//药品单价
//            prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
//            prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
            prescriptionInfo.setJwSubCode(info.getString("jwSubCode"));//智业子处方号
            prescriptionInfo.setJwSubCode(info.getString("jwSubCode"));//智业子处方号
            String subjectClass = info.getString("subjectClass");
            if(StringUtils.isBlank(subjectClass)){//处理默认药品的科目类型为空
                subjectClass = zyDictService.getSubjectClass(info.getString("drugCode"));
            }
            prescriptionInfo.setSubjectClass(subjectClass);//科目编码
            prescriptionInfo.setDrugNumUnit(info.getString("drugNumUnit"));//数量单位编码
            prescriptionInfo.setDrugNumUnit(info.getString("drugNumUnit"));//数量单位编码
            prescriptionInfo.setDrugNumUnitName(info.getString("drugNumUnitName"));//数量单位名称
            prescriptionInfo.setDrugNumUnitName(info.getString("drugNumUnitName"));//数量单位名称
            prescriptionInfo.setCost(CommonUtil.doubleToInt(info.getDouble("cost")));//金额
            prescriptionInfo.setCost(CommonUtil.doubleToInt(info.getDouble("cost")));//金额
@ -1176,15 +1174,31 @@ public class ConsultTeamService extends ConsultService {
            prescriptionInfo.setPhysicDose(info.getString("physicDose"));//用药剂量
            prescriptionInfo.setPhysicDose(info.getString("physicDose"));//用药剂量
            prescriptionInfo.setPhysicDoseUnit(info.getString("physicDoseUnit"));//剂量单位编码
            prescriptionInfo.setPhysicDoseUnit(info.getString("physicDoseUnit"));//剂量单位编码
            prescriptionInfo.setPhysicDoseUnitName(info.getString("physicDoseUnitName"));//剂量单位名称
            prescriptionInfo.setPhysicDoseUnitName(info.getString("physicDoseUnitName"));//剂量单位名称
            prescriptionInfo.setPhysicAmount(info.getString("physicAmount"));//用药总量
            prescriptionInfo.setPhysicAmountUnit(info.getString("physicAmount"));//总量单位编码
            prescriptionInfo.setPhysicAmountUnitName(info.getString("physicAmountUnitName"));//总量单位名称
            prescriptionInfo.setPhysicInjectPlace(info.getString("physicInjectPlace"));//注射地点编码
            prescriptionInfo.setPhysicInjectPlace(info.getString("physicInjectPlace"));//注射地点编码
            prescriptionInfo.setPhysicInjectPlaceName(info.getString("physicInjectPlaceName"));//注射地点名称
            prescriptionInfo.setPhysicInjectPlaceName(info.getString("physicInjectPlaceName"));//注射地点名称
            prescriptionInfo.setPhysicSkinTest(info.getString("physicSkinTest"));//注射地点名称
            prescriptionInfo.setPhysicSkinTest(info.getString("physicSkinTest"));//注射地点名称
            prescriptionInfo.setPhysicSkinTestName(info.getString("physicSkinTestName"));//皮试类型名称
            prescriptionInfo.setPhysicSkinTestName(info.getString("physicSkinTestName"));//皮试类型名称
            prescriptionInfo.setRemark(info.getString("Remark"));//备注
            prescriptionInfo.setRemark(info.getString("Remark"));//备注
            prescriptionInfo.setIsRefrigerate(zyDictService.getIsRefrigerate(prescriptionInfo.getDrugCode()));
            //需要特殊处理的字段
            ZyIvPhysicDict physicDict = zyDictService.findByPhysicCode(prescriptionInfo.getDrugCode());
            String subjectClass = info.getString("subjectClass");//科目类型
            String physicAmount = info.getString("physicAmount");//用药总量
            String physicAmountUnit = info.getString("physicAmountUnit");//总量单位编码
            String physicAmountUnitName = info.getString("physicAmountUnitName");//总量单位名称
            Integer isRefrigerate = 0;
            if(physicDict!=null){
                subjectClass = physicDict.getSubjectClass();
                isRefrigerate = "2".equals(physicDict.getStorageConditions())?1:isRefrigerate;
                physicAmount = null;
                physicAmountUnit = physicDict.getPackUnit();
                physicAmountUnitName = zyDictService.findByDictNameAndCode("IV_MEASURE_UNIT_DICT",physicAmountUnit);
            }
            prescriptionInfo.setPhysicAmount(physicAmount);
            prescriptionInfo.setPhysicAmountUnit(physicAmountUnit);
            prescriptionInfo.setPhysicAmountUnitName(physicAmountUnitName);
            prescriptionInfo.setIsRefrigerate(isRefrigerate);
            prescriptionInfo.setSubjectClass(subjectClass);//科目编码
            prescriptionInfoDao.save(prescriptionInfo);
            prescriptionInfoDao.save(prescriptionInfo);
        }
        }
        //设置最小用药天数
        //设置最小用药天数

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

@ -90,6 +90,12 @@ public class PrescriptionInfoService extends BaseService {
    private PrescriptionExpressageService expressageService;
    private PrescriptionExpressageService expressageService;
    @Autowired
    @Autowired
    private PrescriptionService prescriptionService;
    private PrescriptionService prescriptionService;
    @Autowired
    private PrescriptionReasonDictDao prescriptionReasonDictDao;
    @Autowired
    private PrescriptionReviewedReasonDao prescriptionReviewedReasonDao;
    @Autowired
    private PrescriptionAdjustReasonDao prescriptionAdjustReasonDao;
    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
@ -153,13 +159,13 @@ public class PrescriptionInfoService extends BaseService {
     * @param type
     * @param type
     * @return
     * @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 (StringUtils.isNotBlank(type)) {
            if ("1".equals(type)) {
            if ("1".equals(type)) {
                Patient p = patientDao.findByCode(patient);
                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);
                com.alibaba.fastjson.JSONArray pres = presModeAdapter.modeToPrescription(rp);
                if(pres==null||pres.size()==0){
                if(pres==null||pres.size()==0){
@ -567,7 +573,7 @@ public class PrescriptionInfoService extends BaseService {
            pre_sql.append(" AND pr.patient = ?");
            pre_sql.append(" AND pr.patient = ?");
            params.add(patient);
            params.add(patient);
        }
        }
        pre_sql.append(" GROUP BY pr.code ORDER BY pr.min_drug_day-TIMESTAMPDIFF(DAY, pr.pres_create_time, NOW()) ASC");
        pre_sql.append(" GROUP BY pr.code ORDER BY pr.min_drug_day-TIMESTAMPDIFF(DAY, pr.pres_create_time, NOW()),pr.create_time ASC");
        if (page != null && page > 0 && size != null && size > 0) {
        if (page != null && page > 0 && size != null && size > 0) {
            pre_sql.append(" LIMIT " + (page - 1) * size + "," + size);
            pre_sql.append(" LIMIT " + (page - 1) * size + "," + size);
        }
        }
@ -608,7 +614,7 @@ public class PrescriptionInfoService extends BaseService {
        return rs;
        return rs;
    }
    }
    public int reviewPrescription(String code, String reason, String state, String dept, String registerFee, String rateTypeCode) throws Exception {
    public int reviewPrescription(String code, String reason,String reasonCode, String state, String dept, String registerFee, String rateTypeCode) throws Exception {
        if (StringUtils.isNotBlank(state)) {
        if (StringUtils.isNotBlank(state)) {
            Prescription p = prescriptionDao.findByCode(code);
            Prescription p = prescriptionDao.findByCode(code);
            //更新审核记录
            //更新审核记录
@ -628,6 +634,8 @@ public class PrescriptionInfoService extends BaseService {
                reviewed.setReason(reason);
                reviewed.setReason(reason);
                reviewed.setReviewedTime(new Date());
                reviewed.setReviewedTime(new Date());
                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.reviewed_fail.getValue());
                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.reviewed_fail.getValue());
                //保存审核不通过原因
                saveReviewedReason(reasonCode,reviewed.getCode(),code);
                //修改系统的续方消息的审核状态
                //修改系统的续方消息的审核状态
                messageDao.updatePreScriptionMessage(p.getConsult(), "2", 6);
                messageDao.updatePreScriptionMessage(p.getConsult(), "2", 6);
@ -669,7 +677,7 @@ public class PrescriptionInfoService extends BaseService {
        return 0;
        return 0;
    }
    }
    public int updatePresInfo(String code, String infos, String diagnosis, String reason) {
    public int updatePresInfo(String code, String infos, String diagnosis, String reason,String reasonCode) {
        if (StringUtils.isNotBlank(code) && StringUtils.isNotBlank(infos)) {
        if (StringUtils.isNotBlank(code) && StringUtils.isNotBlank(infos)) {
            //同步智业接口
            //同步智业接口
            upload();
            upload();
@ -741,11 +749,48 @@ public class PrescriptionInfoService extends BaseService {
            prescriptionAdjust.setPrescriptionCode(code);
            prescriptionAdjust.setPrescriptionCode(code);
            prescriptionAdjustDao.save(prescriptionAdjust);
            prescriptionAdjustDao.save(prescriptionAdjust);
            //保存原因
            saveAjustReason(reasonCode,prescriptionAdjust,code);
            return 1;
            return 1;
        }
        }
        return 0;
        return 0;
    }
    }
    public void saveAjustReason(String reasonCode,PrescriptionAdjust prescriptionAdjust,String code){
        if(StringUtils.isNotBlank(reasonCode)){
            String reasoncodes[] = reasonCode.split(",");
            for(int i=0;i<reasoncodes.length;i++){
                PrescriptionReasonDict  dict =  prescriptionReasonDictDao.findByTypeAndCode(0,reasoncodes[i]);
                PrescriptionAdjustReason prescriptionAdjustReason = new PrescriptionAdjustReason();
                prescriptionAdjustReason.setCode(getCode());
                prescriptionAdjustReason.setPrescriptionCode(code);
                prescriptionAdjustReason.setAdjustCode(prescriptionAdjust.getCode());
                prescriptionAdjustReason.setReasonCode(reasoncodes[i]);
                prescriptionAdjustReason.setReasonValue(dict.getValue());
                prescriptionAdjustReason.setCreateTime(new Date());
                prescriptionAdjustReasonDao.save(prescriptionAdjustReason);
            }
        }
    }
    public void saveReviewedReason(String reasonCode,String reviewedCode ,String code){
        if(StringUtils.isNotBlank(reasonCode)){
            String reasoncodes[] = reasonCode.split(",");
            for(int i=0;i<reasoncodes.length;i++){
                PrescriptionReasonDict  dict =  prescriptionReasonDictDao.findByTypeAndCode(0,reasoncodes[i]);
                PrescriptionReviewedReason prescriptionReviewedReason = new PrescriptionReviewedReason();
                prescriptionReviewedReason.setCode(getCode());
                prescriptionReviewedReason.setPrescriptionCode(code);
                prescriptionReviewedReason.setReviewedCode(reviewedCode);
                prescriptionReviewedReason.setReasonCode(reasoncodes[i]);
                prescriptionReviewedReason.setReasonValue(dict.getValue());
                prescriptionReviewedReason.setCreateTime(new Date());
                prescriptionReviewedReasonDao.save(prescriptionReviewedReason);
            }
        }
    }
    public String upload() {
    public String upload() {
        return null;
        return null;
    }
    }
@ -1237,6 +1282,7 @@ public class PrescriptionInfoService extends BaseService {
    /**
    /**
     * @param doctor
     * @param doctor
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    public com.alibaba.fastjson.JSONArray getPrescriptionTemp(String doctor) throws Exception {
    public com.alibaba.fastjson.JSONArray getPrescriptionTemp(String doctor) throws Exception {
@ -1319,4 +1365,10 @@ public class PrescriptionInfoService extends BaseService {
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql.toString(),new Object[]{code});
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql.toString(),new Object[]{code});
        return rs;
        return rs;
    }
    }
    public List<PrescriptionReasonDict> getReasonByType(Integer type){
        List<PrescriptionReasonDict> list =  prescriptionReasonDictDao.findByTypeOrderBySortAsc(type);
        return list;
    }
}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -362,7 +362,7 @@ public class PrescriptionService extends BaseService {
                            JSONObject zySettleDetailObj = zySettleDetailList.getJSONObject(j);
                            JSONObject zySettleDetailObj = zySettleDetailList.getJSONObject(j);
                            //药品编码
                            //药品编码
                            String zyinfoKey = zySettleDetailObj.getString("INSUR_ITEM_CODE");
                            String zyinfoKey = zySettleDetailObj.getString("ITEM_CODE");
                            //总金额
                            //总金额
                            String cost = zySettleDetailObj.getString("COST");
                            String cost = zySettleDetailObj.getString("COST");

+ 9 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -89,15 +89,15 @@ public class JwPrescriptionService {
        params.add(new BasicNameValuePair("applyTimeFrom", applyTimeFrom));
        params.add(new BasicNameValuePair("applyTimeFrom", applyTimeFrom));
        params.add(new BasicNameValuePair("applyTimeEnd", applyTimeEnd));
        params.add(new BasicNameValuePair("applyTimeEnd", applyTimeEnd));
        String response = httpClientUtil.post(url, params, "UTF-8");
//        String sql = "SELECT h.response from wlyy_http_log h WHERE h.id = 806287";
//        List<Map<String ,Object>> list = jdbcTemplate.queryForList(sql);
//        String response = list.get(0).get("response").toString();
//        JSONObject jsonObject = new JSONObject();
//        jsonObject.put("status",200);
//        jsonObject.put("data",response);
//        response = jsonObject.toString();
    //    String response = httpClientUtil.post(url, params, "UTF-8");
        String sql = "SELECT h.response from wlyy_http_log h WHERE h.id = 806287";
        List<Map<String ,Object>> list = jdbcTemplate.queryForList(sql);
        String response = list.get(0).get("response").toString();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("status",200);
        jsonObject.put("data",response);
        response = jsonObject.toString();
        return response;
        return response;
    }
    }

+ 26 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java

@ -2,9 +2,12 @@ package com.yihu.wlyy.service.third.jw;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.zydict.ZyIvPhysicDict;
import com.yihu.wlyy.repository.doctor.DoctorMappingDao;
import com.yihu.wlyy.repository.doctor.DoctorMappingDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
import com.yihu.wlyy.repository.zydict.ZyCommonDictDao;
import com.yihu.wlyy.repository.zydict.ZyIvPhysicDictDao;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
@ -29,7 +32,10 @@ public class ZyDictService {
    private DoctorMappingDao doctorMappingDao;
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    @Autowired
    private HospitalMappingDao hospitalMappingDao;
    private HospitalMappingDao hospitalMappingDao;
    @Autowired
    private ZyIvPhysicDictDao zyIvPhysicDictDao;
    @Autowired
    private ZyCommonDictDao zyCommonDictDao;
    @Transactional
    @Transactional
    public void synchronousDict(String dictName) {
    public void synchronousDict(String dictName) {
@ -125,6 +131,25 @@ public class ZyDictService {
        return isRefrigerate;
        return isRefrigerate;
    }
    }
    /**
     * 按药品查找code
     * @param physicCode
     * @return
     */
    public ZyIvPhysicDict findByPhysicCode(String physicCode){
        return zyIvPhysicDictDao.findByPhysicCode(physicCode);
    }
    /**
     * 查找公共字典名称
     * @param dictName
     * @param code
     * @return
     */
    public String findByDictNameAndCode(String dictName,String code){
        return zyCommonDictDao.findByDictNameAndCode(dictName,code);
    }
    /**
    /**
     * 获取药品科目类型
     * 获取药品科目类型
     * @param physicCodde
     * @param physicCodde

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

@ -97,12 +97,13 @@ public class PrescriptionInfoController extends BaseController {
    @ObserverRequired
    @ObserverRequired
    public String reviewPrescription(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
    public String reviewPrescription(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
                                     @RequestParam(required = false) @ApiParam(value = "不同意原因", name = "reason") String reason,
                                     @RequestParam(required = false) @ApiParam(value = "不同意原因", name = "reason") String reason,
                                     @RequestParam(required = false) @ApiParam(value = "不同意原因CODE", name = "reasonCode") String reasonCode,
                                     @RequestParam(required = false) @ApiParam(value = "1同意,2不同意", name = "state") String state,
                                     @RequestParam(required = false) @ApiParam(value = "1同意,2不同意", name = "state") String state,
                                     @RequestParam(required = false) @ApiParam(value = "科室", name = "dept") String dept,
                                     @RequestParam(required = false) @ApiParam(value = "科室", name = "dept") String dept,
                                     @RequestParam(required = false) @ApiParam(value = "诊金", name = "registerFee") String registerFee,
                                     @RequestParam(required = false) @ApiParam(value = "诊金", name = "registerFee") String registerFee,
                                     @RequestParam(required = false) @ApiParam(value = "诊金类型", name = "rateTypeCode") String rateTypeCode) {
                                     @RequestParam(required = false) @ApiParam(value = "诊金类型", name = "rateTypeCode") String rateTypeCode) {
        try {
        try {
            int rs = prescriptionInfoService.reviewPrescription(code, reason, state, dept, registerFee, rateTypeCode);
            int rs = prescriptionInfoService.reviewPrescription(code, reason,reasonCode, state, dept, registerFee, rateTypeCode);
            if (rs == 0) {
            if (rs == 0) {
                return write(200, "开方失败!", "data", rs);
                return write(200, "开方失败!", "data", rs);
            } else {
            } else {
@ -120,9 +121,10 @@ public class PrescriptionInfoController extends BaseController {
    public String updatePresInfo(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
    public String updatePresInfo(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
                                 @RequestParam(required = true) @ApiParam(value = "续方药品JSON", name = "infos") String infos,
                                 @RequestParam(required = true) @ApiParam(value = "续方药品JSON", name = "infos") String infos,
                                 @RequestParam(required = false) @ApiParam(value = "疾病JSON", name = "diagnosis") String diagnosis,
                                 @RequestParam(required = false) @ApiParam(value = "疾病JSON", name = "diagnosis") String diagnosis,
                                 @RequestParam(required = false) @ApiParam(value = "调整原因", name = "reason") String reason) {
                                 @RequestParam(required = false) @ApiParam(value = "调整原因", name = "reason") String reason,
                                 @RequestParam(required = false) @ApiParam(value = "调整原因标签Code,用,分割", name = "reasonCode") String reasonCode) {
        try {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.updatePresInfo(code, infos, diagnosis, reason));
            return write(200, "操作成功!", "data", prescriptionInfoService.updatePresInfo(code, infos, diagnosis, reason,reasonCode));
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "查询失败!");
            return error(-1, "查询失败!");
@ -465,7 +467,7 @@ public class PrescriptionInfoController extends BaseController {
    @RequestMapping(value = "/getPhysicInfo", method = RequestMethod.GET)
    @RequestMapping(value = "/getPhysicInfo", method = RequestMethod.GET)
    @ApiOperation(value = "获取药品信息")
    @ApiOperation(value = "获取药品信息")
    public String getPhysicInfo(String code) {
    public String getPhysicInfo(@RequestParam(required = true) @ApiParam(name = "code", value = "药品code") String code) {
        try {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getPhysicInfo(code));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPhysicInfo(code));
        } catch (Exception e) {
        } catch (Exception e) {
@ -473,4 +475,16 @@ public class PrescriptionInfoController extends BaseController {
            return error(-1, "查询失败!");
            return error(-1, "查询失败!");
        }
        }
    }
    }
    @RequestMapping(value = "/getReasonByType", method = RequestMethod.GET)
    @ApiOperation(value = "获取原因")
    public String getReasonByType(@RequestParam(required = true) @ApiParam(name = "code", value = "类型:0 审核原因标签;1 调整原因标签") Integer type) {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getReasonByType(type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}
}

+ 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 = "获取长处方信息列表")
    @ApiOperation(value = "获取长处方信息列表")
    public String getPrescriptionInfos(@RequestParam(required = true)@ApiParam(name="type",value="1:查询处方;2我的续方;3:续方记录")String type,
    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="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="startDate",value="开始时间")String startDate,
                                       @RequestParam(required = false)@ApiParam(name="endDate",value="结束时间")String endDate,
                                       @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,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="page",value="起始页")Integer page,
                                       @RequestParam(required = false)@ApiParam(name="size",value="每页记录数")Integer size){
                                       @RequestParam(required = false)@ApiParam(name="size",value="每页记录数")Integer size){
        try {
        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) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "查询失败!");
            return error(-1, "查询失败!");