فهرست منبع

Merge branch 'dev' of yeshijie/patient-co-management into dev

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

+ 7 - 7
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java

@ -43,7 +43,7 @@ public class PrescriptionController extends BaseController{
	@RequestMapping(value = "prePayCompletion",method = RequestMethod.POST)
	@ApiOperation("接收预结算完成消息")
	public Result prePayCompletion(@ApiParam(name="data",value="json串",defaultValue = "{}")
	public Result prePayCompletion(@ApiParam(name="data",value="json串",defaultValue = "{\"CODE\":1,\"RECIPE_NO\":\"0\",\"ORDER_NO\":\"DB0537136\"}")
								   @RequestParam(value = "data",required = true) String data){
		try {
@ -103,7 +103,7 @@ public class PrescriptionController extends BaseController{
	@ApiOperation("字典获取接口")
	public Result getDictForI(@ApiParam(name="dictName",value="字典名称",defaultValue = "IV_PHYSIC_DICT")
							  @RequestParam(value = "dictName",required = true) String dictName,
							  @ApiParam(name="hospital",value="医院code",defaultValue = "3501111")
							  @ApiParam(name="hospital",value="医院code",defaultValue = "3502050200")
							  @RequestParam(value = "hospital",required = true) String hospital)
	{
		try {
@ -142,11 +142,11 @@ public class PrescriptionController extends BaseController{
	public Result getLastRecipe(@ApiParam(name="cardNo",value="病人卡号",defaultValue = "")
								@RequestParam(value = "cardNo",required = true) String cardNo,
								@ApiParam(name="recipeNo",value="第一次获取上一方时传入0,第二次获取上一方时传入第一次返回的医嘱号,以此类推",defaultValue = "")
								@RequestParam(value = "recipeNo",required = true) String recipeNo,
								@RequestParam(value = "recipeNo",required = false) String recipeNo,
								@ApiParam(name="applyTimeFrom",value="开始时间",defaultValue = "")
								@RequestParam(value = "applyTimeFrom",required = true) String applyTimeFrom,
								@RequestParam(value = "applyTimeFrom",required = false) String applyTimeFrom,
								@ApiParam(name="applyTimeEnd",value="结束时间",defaultValue = "")
								@RequestParam(value = "applyTimeEnd",required = true) String applyTimeEnd)
								@RequestParam(value = "applyTimeEnd",required = false) String applyTimeEnd)
	{
		try {
@ -174,7 +174,7 @@ public class PrescriptionController extends BaseController{
		}
	}
	@RequestMapping(value = "getDispUnSettleFeeList",method = RequestMethod.POST)
	@RequestMapping(value = "getDispUnSettleFeeInfoList",method = RequestMethod.POST)
	@ApiOperation("查询处方结算结果列表")
	public Result getDispUnSettleFeeList(@ApiParam(name="cardNo",value="病人卡号",defaultValue = "")
										 @RequestParam(value = "cardNo",required = true) String cardNo,
@ -182,7 +182,7 @@ public class PrescriptionController extends BaseController{
										 @RequestParam(value = "visitNo",required = true) String visitNo)
	{
		try {
			String re = prescriptionService.getDispUnSettleFeeList(cardNo,null,null);
			String re = prescriptionService.getDispUnSettleFeeInfoList(cardNo,visitNo);
			return Result.success("查询处方结算结果列表!",re);
		} catch (Exception ex) {

+ 14 - 16
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -19,6 +19,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.Service;
import org.springframework.transaction.annotation.Transactional;
@ -59,7 +60,9 @@ public class PrescriptionService extends ZysoftBaseService{
    @Autowired
    private HospitalDao hospitalDao;
    private String channelTopic = "redisPrescription";
    @Value("${redisChannel.prescription}")
    private String channelTopic;
//    private String channelTopic = "redisPrescription";
    /**
     * 新增续方日志
@ -357,15 +360,12 @@ public class PrescriptionService extends ZysoftBaseService{
     */
    public String getLastRecipe(String cardNo,String recipeNo,String applyTimeFrom,String applyTimeEnd)  throws Exception
    {
        String hospital = null;
        String licence = null;
        Patient patient = patientDao.findBySsc(cardNo);
        SignFamily signFamily = signFamilyDao.findByPatient(patient.getCode());
        //
        String[] hospitalMapping = getHospitalMapping(signFamily.getHospital()); //获取机构映射
        hospital = hospitalMapping[0];
        licence = hospitalMapping[1];
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
@ -441,24 +441,21 @@ public class PrescriptionService extends ZysoftBaseService{
        String response = postSecond("saveRecipe","挂号开处方接口",null,json,header,false,2);
        return null;
        return response;
    }
    /**
     * 7.5 查询处方结算结果列表
     * @param cardNo
     * @param hospital
     * @param licence
     * @param cardNo 病人卡号
     * @param visitNo 挂号号
     * @return
     * @throws Exception
     */
    public String getDispUnSettleFeeList(String cardNo, String hospital, String licence)  throws Exception
    public String getDispUnSettleFeeInfoList(String cardNo, String visitNo)  throws Exception
    {
        if(hospital==null){
            String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
            hospital = hospitalMapping[0];
            licence = hospitalMapping[1];
        }
        String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
@ -466,6 +463,7 @@ public class PrescriptionService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("cardNo",cardNo);
        params.put("visitNo",visitNo);
        String response = postSecond("getDispUnSettleFeeList","查询处方结算结果列表",params,null,header,false,2);

+ 8 - 3
patient-co-service/wlyy_service/src/main/resources/application.yml

@ -48,6 +48,13 @@ spring:
        hibernate:
          dialect: org.hibernate.dialect.MySQL5Dialect
zysoftApi:
  internet: internet/CallEhrInterface
  base: base/CallEhrInterface
redisChannel:
    prescription: redisPrescription
---
spring:
  profiles: dev
@ -63,7 +70,6 @@ spring:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
    channelTopic : redisAddPrescription
---
spring:
@ -80,7 +86,7 @@ spring:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
    channelTopic : redisAddPrescription
---
spring:
  profiles: production
@ -96,4 +102,3 @@ spring:
    host: 120.41.253.95 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzl_ehr
    channelTopic : redisAddPrescription

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -34,6 +34,7 @@ public class Prescription extends IdEntity {
    private Date finishTime;                //配送员确认送达或居民确认取药的时间
    private String patient;                  //关联 wlyy_patient code
    private String patientName;             //患者名称
    private String ssc;//社保卡号
    private Integer type;                    //1 处方 2 续方
    private Integer status;                  //状态 (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 3.调整完成 4.调整失败 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 , 40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
    private String doctor;                   //开处方的医生code 关联 wlyy_doctor
@ -505,4 +506,12 @@ public class Prescription extends IdEntity {
    public void setFailReason(String failReason) {
        this.failReason = failReason;
    }
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
}

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionInfo.java

@ -18,6 +18,7 @@ public class PrescriptionInfo extends IdEntity{
    private String prescriptionCode;      //处方code 关联表wlyy_prescription code
    private String drugCode;               //药品code
    private String drugName;               //药品名称
    private String subjectClass;               //科目类别编码
    private String drugRate;               //吃药频率
    private String drugRateName;          //用药频次名称
    private String drugFormat;             //药品规格
@ -310,4 +311,12 @@ public class PrescriptionInfo extends IdEntity{
    public void setDrugRateName(String drugRateName) {
        this.drugRateName = drugRateName;
    }
    public String getSubjectClass() {
        return subjectClass;
    }
    public void setSubjectClass(String subjectClass) {
        this.subjectClass = subjectClass;
    }
}

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

@ -65,10 +65,9 @@ public class RedisMsgPubSubListener extends JedisPubSub {
                //审核消息发送
                prescriptionInfoService.onMesSquareState(message);
            }else if("dispensingComplete".equals(title)){//配药完成
                //提醒健管师待取药
                //药品配送完成,提醒取药
                String prescriptionCode = json.getString("prescription");
                prescriptionService.dispensingComplete(prescriptionCode);
            }
        }catch (Exception e){
            logger.error("redis_error...",e);

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

@ -33,6 +33,7 @@ import com.yihu.wlyy.service.app.health.HealthEduArticleService;
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.service.app.prescription.PrescriptionLogService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
@ -126,7 +127,9 @@ public class ConsultTeamService extends ConsultService {
    @Autowired
    private PrescriptionReviewedDao prescriptionReviewedDao;
    @Autowired
    WeiXinAccessTokenUtils accessTokenUtils;
    private WeiXinAccessTokenUtils accessTokenUtils;
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    Map<Integer, String> relations = new HashMap<>();
@ -1013,8 +1016,11 @@ public class ConsultTeamService extends ConsultService {
     * @param reason
     * @return
     */
    public String savePrescription(Prescription prescription,String jwCode,Doctor doctor,Patient p,ConsultTeam ct,String reason){
    public String savePrescription(Prescription prescription,String jwCode,Doctor doctor,Patient p,ConsultTeam ct,String reason) throws Exception{
        String re = "";
        //获取智业处方详细
        String response = jwPrescriptionService.getLastRecipe(p.getSsc(),jwCode,null,null);
        //续方主表
        prescription.setCode(getCode());
        prescription.setParentCode(jwCode);
@ -1029,9 +1035,10 @@ public class ConsultTeamService extends ConsultService {
        prescription.setJwCode(jwCode);
        prescription.setPatient(p.getCode());
        prescription.setPatientName(p.getName());
        prescription.setSsc(p.getSsc());
        prescription.setReason(reason);
        prescription.setType(2);
        prescription.setStatus(0);
        prescription.setType(PrescriptionLog.PrescriptionLogType.create.getValue());
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.revieweding.getValue());
        prescription.setConsult(ct.getConsult());
        prescriptionDao.save(prescription);

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

@ -25,54 +25,93 @@ public class JwPrescriptionService {
    /**
     * 获取字典列表
     * @param dictName
     * @param dictName 字典名称
     * @param hospital 药品code
     * @return
     * @throws Exception
     */
    public String getDictForI(String dictName) throws Exception{
    public String getDictForI(String dictName,String hospital) throws Exception{
        String url = jwUrl + "/third/prescription/getDictForI";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    public String getRecipeTemplate(String dictName) throws Exception{
    /**
     * 获取处方模板
     * @param deptCode 科室编码
     * @param staffCode 人员code
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getRecipeTemplate(String deptCode,String staffCode, String hospital) throws Exception{
        String url = jwUrl + "/third/prescription/getRecipeTemplate";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("deptCode", deptCode));
        params.add(new BasicNameValuePair("staffCode", staffCode));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    public String getLastRecipe(String dictName) throws Exception{
    /**
     * 获取历史处方记录
     * @param cardNo 社保卡号
     * @param recipeNo 医嘱号
     * @param applyTimeFrom 开始时间
     * @param applyTimeEnd 结束时间
     * @return
     * @throws Exception
     */
    public String getLastRecipe(String cardNo,String recipeNo,String applyTimeFrom,String applyTimeEnd) throws Exception{
        String url = jwUrl + "/third/prescription/getLastRecipe";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("cardNo", cardNo));
        params.add(new BasicNameValuePair("recipeNo", recipeNo));
        params.add(new BasicNameValuePair("applyTimeFrom", applyTimeFrom));
        params.add(new BasicNameValuePair("applyTimeEnd", applyTimeEnd));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    public String saveRecipe(String dictName) throws Exception{
    /**
     * 处方开方接口
     * @param prescriptionCode 续方code
     * @return
     * @throws Exception
     */
    public String saveRecipe(String prescriptionCode) throws Exception{
        String url = jwUrl + "/third/prescription/saveRecipe";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    public String getDispUnSettleFeeList(String dictName) throws Exception{
        String url = jwUrl + "/third/prescription/getDispUnSettleFeeList";
    /**
     * 待结算费用列表接口
     * @param cardNo
     * @param visitNo
     * @return
     * @throws Exception
     */
    public String getDispUnSettleFeeInfoList(String cardNo,String visitNo) throws Exception{
        String url = jwUrl + "/third/prescription/getDispUnSettleFeeInfoList";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("dictName", dictName));
        params.add(new BasicNameValuePair("cardNo", cardNo));
        params.add(new BasicNameValuePair("visitNo", visitNo));
        String response = httpClientUtil.post(url, params, "UTF-8");

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

@ -278,9 +278,11 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getPrescriptionDurgDict", method = RequestMethod.GET)
    @ApiOperation(value = "获取基卫的药品字典")
    public String getPrescriptionDurgDict(
            @RequestParam(required = true,name = "dictName") @ApiParam(value = "字典名称", name = "dictName",required = true)  String dictName){
            @RequestParam(required = true,name = "dictName") @ApiParam(value = "字典名称", name = "dictName",required = true)  String dictName,
            @RequestParam(required = true,name = "hospital") @ApiParam(value = "医院code", name = "hospital",required = true)  String hospital
    ){
        try {
            return write(200, "操作成功!", "data",jwPrescriptionService.getDictForI(dictName));
            return write(200, "操作成功!", "data",jwPrescriptionService.getDictForI(dictName,hospital));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");