소스 검색

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

yeshijie 7 년 전
부모
커밋
4f33ab7ae5

+ 44 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExplain.java

@ -0,0 +1,44 @@
package com.yihu.wlyy.entity.patient.prescription;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 续方说明表
 * Created by yeshijie on 2017/8/24.
 */
@Entity
@Table(name = "wlyy_prescription_explain")
public class PrescriptionExplain extends IdEntity {
    private String content;//续方说明
    private String del;//是否有效,1有效,0无效
    private Date createTiem;
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
    public Date getCreateTiem() {
        return createTiem;
    }
    public void setCreateTiem(Date createTiem) {
        this.createTiem = createTiem;
    }
}

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 3 - 3
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/Message.java


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

@ -9,10 +9,7 @@ import com.yihu.wlyy.service.common.util.CommonUtil;
import com.yihu.wlyy.service.common.util.DateUtil;
import com.yihu.wlyy.service.dao.*;
import com.yihu.wlyy.service.dao.prescription.*;
import com.yihu.wlyy.service.entity.Doctor;
import com.yihu.wlyy.service.entity.Hospital;
import com.yihu.wlyy.service.entity.Patient;
import com.yihu.wlyy.service.entity.SignFamily;
import com.yihu.wlyy.service.entity.*;
import com.yihu.wlyy.service.entity.prescription.*;
import com.yihu.wlyy.service.entity.prescription.VO.PrescriptionExpressageVO;
import com.yihu.wlyy.service.service.ZysoftBaseService;
@ -65,6 +62,8 @@ public class PrescriptionService extends ZysoftBaseService{
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private PrescriptionReviewedDao prescriptionReviewedDao;
    @Autowired
    private MessageDao messageDao;
    @Value("${redisChannel.prescription}")
    private String channelTopic;
@ -175,13 +174,30 @@ public class PrescriptionService extends ZysoftBaseService{
                    //保存新的药品
                    prescriptionInfoDao.save(infoList);
                    //发送系统消息
                    Message message = new Message();
                    message.setCzrq(new Date());
                    message.setCreateTime(new Date());
                    message.setContent("您有1个续方申请已在线下调整完成,请点击进行CA认证。");
                    message.setRead(1);//设置未读
                    message.setReceiver(prescription.getDoctor());//设置接受医生的code
                    message.setSender("系统");//设置发送的用户
                    message.setSenderName("system");
                    message.setCode(getCode());
                    message.setTitle("新增系统消息");
                    message.setType(9);
                    message.setReadonly(1);//是否只读消息
                    message.setOver("1");//未处理
                    message.setRelationCode(prescription.getCode());
                    messageDao.save(message);
                    // redis 的发布 {tilte:redisAddPrescription   state: 1 ,//1:成功,2.失败 mes:'开方成功' prescription : "0001" //续方CODE  }
                    JSONObject message = new JSONObject();
                    message.put("title","adjustPrescription");
                    message.put("state",1);
                    message.put("prescription",prescription.getCode());
                    message.put("mes","调整处方完成");
                    redisTemplate.convertAndSend(channelTopic,message.toString());
                    JSONObject redisMessage = new JSONObject();
                    redisMessage.put("title","adjustPrescription");
                    redisMessage.put("state",1);
                    redisMessage.put("prescription",prescription.getCode());
                    redisMessage.put("mes","调整处方完成");
                    redisTemplate.convertAndSend(channelTopic,redisMessage.toString());
                }else {
                    //调整失败
                    prescription.setStatus(4);

+ 16 - 16
patient-co-service/wlyy_service/src/main/resources/system.properties

@ -1,20 +1,20 @@
###基卫测试环境服务
gateway_url = http://117.25.173.18:18280/
gateway_licence = 5YGl5bq45LmL7Lev
gateway_public_key = PublicKeyTest.key
jw_hospital = 350211B1013
jw_licence = 5YGl5bq45LmL7Lev
ca_url = http://117.29.183.114:8081/XMCAService?wsdl
ca_namespace = http://platfomservice.xmca.com/
#gateway_url = http://117.25.173.18:18280/
#gateway_licence = 5YGl5bq45LmL7Lev
#gateway_public_key = PublicKeyTest.key
#jw_hospital = 350211B1013
#jw_licence = 5YGl5bq45LmL7Lev
#ca_url = http://117.29.183.114:8081/XMCAService?wsdl
#ca_namespace = http://platfomservice.xmca.com/
##基卫服务
#guahao_url =  http://10.95.18.10/urp.service/urp.open.service/ReservationPulic.asmx
#guahao_namespace = http://www.zysoft.com.cn/
#gateway_url = http://10.95.21.21:18280/
#gateway_licence = 5YGl5bq45LmL7Lev
#gateway_public_key = PublicGov.key
#jw_hospital = 350211B1004
#jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
#ca_url = http://10.95.21.21:18280/base/XMCA6_UnifiedCallInterface
#ca_namespace = http://platfomservice.xmca.com/
guahao_url =  http://10.95.18.10/urp.service/urp.open.service/ReservationPulic.asmx
guahao_namespace = http://www.zysoft.com.cn/
gateway_url = http://10.95.21.21:18280/
gateway_licence = 5YGl5bq45LmL7Lev
gateway_public_key = PublicGov.key
jw_hospital = 350211B1004
jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
ca_url = http://10.95.21.21:18280/base/XMCA6_UnifiedCallInterface
ca_namespace = http://platfomservice.xmca.com/

+ 15 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java

@ -39,11 +39,14 @@ public class PresModeAdapter {
    public JSONArray modeTopresInfo(String json){
        try{
            JSONObject oldJson = JSONObject.parseObject(json);
            if(oldJson.getInteger("status")!=200){
                throw new RuntimeException("智业接口失败:"+oldJson.getString("msg"));
            }
            String dataStr = oldJson.getString("data");
            JSONObject data = JSONObject.parseObject(dataStr);
            JSONArray returnData = data.getJSONArray("returnData");
            String code = data.getString("CODE");
            if(StringUtils.isNotBlank(code)&&"1".equals(code)){
            if(StringUtils.isNotBlank(code)&&"1".equals(code)&&returnData.size()>0){
                JSONArray rs = new JSONArray();
                Iterator iterator = returnData.iterator();
                while (iterator.hasNext()){
@ -102,7 +105,7 @@ public class PresModeAdapter {
            logger.info("PresModeAdapter:modeTopresInfo:Json:"+json);
            throw e;
        }
        return null;
        return new JSONArray();
    }
    /**
@ -114,10 +117,13 @@ public class PresModeAdapter {
    public JSONArray modeToPrescription(String json){
        try{
            JSONObject oldJson = JSONObject.parseObject(json);
            if(oldJson.getInteger("status")!=200){
                throw new RuntimeException("智业接口失败:"+oldJson.getString("msg"));
            }
            JSONObject data = oldJson.getJSONObject("data");
            JSONArray returnData = data.getJSONArray("returnData");
            String code = data.getString("CODE");
            if(StringUtils.isNotBlank(code)&&"1".equals(code)){
            if(StringUtils.isNotBlank(code)&&"1".equals(code)&&returnData.size()>0){
                JSONArray rs = new JSONArray();
                Iterator iterator = returnData.iterator();
                while (iterator.hasNext()){
@ -210,7 +216,7 @@ public class PresModeAdapter {
            logger.info("PresModeAdapter:modeToPrescription:Json:"+json);
            throw e;
        }
        return null;
        return new JSONArray();
    }
    /**
@ -221,10 +227,13 @@ public class PresModeAdapter {
    public JSONObject modelToSinglePrescription(String json){
        try{
            JSONObject oldJson = JSONObject.parseObject(json);
            if(oldJson.getInteger("status")!=200){
                throw new RuntimeException("智业接口失败:"+oldJson.getString("msg"));
            }
            JSONObject data = oldJson.getJSONObject("data");
            JSONArray returnData = data.getJSONArray("returnData");
            String code = data.getString("CODE");
            if(StringUtils.isNotBlank(code)&&"1".equals(code)){
            if(StringUtils.isNotBlank(code)&&"1".equals(code)&&returnData.size()>0){
                JSONArray modeArray = returnData.getJSONArray(0);
                JSONObject mode = (JSONObject) modeArray.get(0);
                JSONObject p  = new JSONObject();
@ -308,7 +317,7 @@ public class PresModeAdapter {
            logger.info("PresModeAdapter:modelToSinglePrescription:Json:"+json);
            throw e;
        }
        return null;
        return new JSONObject();
    }
}

+ 18 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionExplainDao.java

@ -0,0 +1,18 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExplain;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2017/8/24.
 */
public interface PrescriptionExplainDao extends PagingAndSortingRepository<PrescriptionExplain, Long>, JpaSpecificationExecutor<PrescriptionExplain> {
    @Query("select p from PrescriptionExplain p where p.del='1' ")
    List<PrescriptionExplain> findList();
}

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

@ -26,10 +26,7 @@ import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.repository.patient.PatientFamilyMemberDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDiagnosisDao;
import com.yihu.wlyy.repository.prescription.PrescriptionInfoDao;
import com.yihu.wlyy.repository.prescription.PrescriptionReviewedDao;
import com.yihu.wlyy.repository.prescription.*;
import com.yihu.wlyy.service.app.health.HealthEduArticleService;
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
@ -150,6 +147,8 @@ public class ConsultTeamService extends ConsultService {
    private String im_list_get;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private PrescriptionExplainDao prescriptionExplainDao;
    @PostConstruct
    public void init() {
@ -199,12 +198,20 @@ public class ConsultTeamService extends ConsultService {
            return json;
        }
        //续方说明
        List<PrescriptionExplain> list = prescriptionExplainDao.findList();
        JSONArray ja = new JSONArray();
        for (PrescriptionExplain explain:list){
            ja.put(explain.getContent());
        }
        Doctor doctor = doctorDao.findByAdminTeamId(signFamily.getAdminTeamId());
        json.put("doctor",doctor.getCode());
        json.put("doctorName",doctor.getName());
        json.put("adminTeamId",signFamily.getAdminTeamId());
        json.put("hospital",doctor.getHospital());
        json.put("hospitalName",doctor.getHospitalName());
        json.put("prescriptionExplain",ja);
        return json;
    }
@ -1142,7 +1149,7 @@ public class ConsultTeamService extends ConsultService {
            prescriptionInfo.setDrugFormat(info.getString("drugFormat"));//药品规格
            prescriptionInfo.setNum(info.getInteger("num"));//药品数目
            prescriptionInfo.setPrice(CommonUtil.doubleToInt(info.getDouble("price")));//药品单价
            prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
//            prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
            prescriptionInfo.setJwSubCode(info.getString("jwSubCode"));//智业子处方号
            prescriptionInfo.setSubjectClass(info.getString("subjectClass"));//科目编码
            prescriptionInfo.setDrugNumUnit(info.getString("drugNumUnit"));//数量单位编码

+ 14 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionAdjustController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.web.doctor.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.service.app.prescription.PrescriptionAdjustService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
@ -61,6 +62,19 @@ public class PrescriptionAdjustController extends BaseController {
        }
    }
    @RequestMapping(value = "getPrescriptionStatus",method = RequestMethod.GET)
    @ApiOperation("获取续方状态")
    public String getPrescriptionStatus(@ApiParam(name = "code", value = "续方code", defaultValue = "10")
                                        @RequestParam(value = "code", required = true) String code){
        try {
            Prescription prescription = prescriptionDao.findByCode(code);
            return write(200,"success","data",prescription.getStatus());
        }catch (Exception e){
            error(e);
            return error(-1,"获取续方状态失败");
        }
    }