Browse Source

检查检验

Trick 5 years ago
parent
commit
c4d09c7ab6

+ 3 - 41
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/InspectionService.java

@ -1,19 +1,13 @@
package com.yihu.jw.hospital.prescription.service;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.hisview.WlyyHisJcmbDO;
import com.yihu.jw.entity.hospital.prescription.WlyyInspectionPartsDictDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.his.dao.WlyyHisJcmbDao;
import com.yihu.jw.hospital.his.dao.WlyyHisJymbDao;
import com.yihu.jw.hospital.his.dao.WlyyHisTcxzDao;
import com.yihu.jw.hospital.prescription.dao.InspectionPartsDictDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.mysql.query.BaseJpaService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -37,44 +31,12 @@ public class InspectionService extends BaseJpaService<WlyyPrescriptionDO, Prescr
    @Autowired
    private EntranceService entranceService;
    @Autowired
    private WlyyHisJcmbDao hisJcmbDao;
    @Autowired
    private WlyyHisJymbDao hisJymbDao;
    @Autowired
    private WlyyHisTcxzDao hisTcxzDao;
    public List<WlyyInspectionPartsDictDO> findByPartsCode(String parentCode){
    public List<WlyyInspectionPartsDictDO> findByPartsCode(String parentCode) {
        return inspectionPartsDictDao.findByParentCode(parentCode);
    }
    public List<WlyyHospitalSysDictDO> findDictByName(String hospital,String name){
        return hospitalSysDictDao.findByHospitalAndDictName(hospital,name);
    public List<WlyyHospitalSysDictDO> findDictByName(String hospital, String name) {
        return hospitalSysDictDao.findByHospitalAndDictName(hospital, name);
    }
    /**
     *
     * S60线上复诊 BS25033检查模板接口
     * @return
     * @throws Exception
     */
    public Boolean synJcmb()throws Exception{
        JSONArray jsonArray = entranceService.BS25033("",demoFlag);
        if(jsonArray!=null&&jsonArray.size()>0){
            for(int i=0;i<jsonArray.size();i++){
                JSONObject jcmb = jsonArray.getJSONObject(i);
                WlyyHisJcmbDO jcmbDO = new WlyyHisJcmbDO();
                jcmbDO.setTcNo(jcmb.getString("tc_no"));
                jcmbDO.setTcName(jcmb.getString("tc_name"));
                jcmbDO.setBzCode(jcmb.getString("bz_code"));
                jcmbDO.setBzName(jcmb.getString("bz_name"));
                jcmbDO.setChargeCode(jcmb.getString("charge_code"));
            }
        }
        return true;
    }
}

+ 72 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -1155,6 +1155,63 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return entranceService.MS30012(demoFlag);
    }
    /**
     * 检查模板选择接口
     * @param bz_code
     * @param flag
     * @return
     * @throws Exception
     */
    public JSONArray getJcmb(String bz_code,String flag)throws Exception{
        return entranceService.BS25033(bz_code,flag,demoFlag);
    }
    /**
     * 检验选择接口
     * @param bz_code
     * @param flag
     * @return
     * @throws Exception
     */
    public JSONArray getJymb(String bz_code,String flag)throws Exception{
        return entranceService.BS20030(bz_code,flag,demoFlag);
    }
    /**
     * 套餐选择接口
     * @param bz_code
     * @param flag
     * @return
     * @throws Exception
     */
    public JSONArray getTcxz(String bz_code,String flag)throws Exception{
        return entranceService.MS02017(bz_code,flag,demoFlag);
    }
    /**
     * 套餐子项目接口
     * @param parent_code 检查检验项目的charge_code
     * @return
     * @throws Exception
     */
    public JSONArray getTcChild(String parent_code)throws Exception{
        return entranceService.MS02015(parent_code,demoFlag);
    }
    /**
     * 项目子项目接口
     * @param zd_charge_code
     * @return
     * @throws Exception
     */
    public JSONArray getInsChild(String zd_charge_code)throws Exception{
        return entranceService.MS02016(zd_charge_code,demoFlag);
    }
    /**
     * 获取检查检验
     * @return
@ -1280,7 +1337,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    info.setPrescriptionId(prescription.getId());
                    //设置his药品查询条件
                    setInfoJsonParam(jsonData,doctorMappingDO,outpatientDO,info,Icd10);
                    setInfoJsonParam(jsonData,doctorMappingDO,outpatientDO,prescriptionDO,info,Icd10);
                }
                //保存处方
                prescriptionInfoDao.save(infoDOs);
@ -1301,7 +1358,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    ins.setOutpatientId(outPatientId);
                    //设置his药品查询条件
                    setInspectionParam(jsonData,doctorMappingDO,outpatientDO,ins,Icd10);
                    setInspectionParam(jsonData,doctorMappingDO,outpatientDO,prescriptionDO,ins,Icd10);
                }
            }
            //上传his开方
@ -1382,7 +1439,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param inspectionDO
     * @param Icd10
     */
    public void setInspectionParam(com.alibaba.fastjson.JSONArray jsonData,DoctorMappingDO doctorMappingDO,WlyyOutpatientDO outpatientDO,WlyyInspectionDO inspectionDO,String Icd10){
    public void setInspectionParam(com.alibaba.fastjson.JSONArray jsonData,DoctorMappingDO doctorMappingDO,WlyyOutpatientDO outpatientDO,WlyyPrescriptionDO prescriptionDO,WlyyInspectionDO inspectionDO,String Icd10){
        com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
@ -1439,10 +1496,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param info
     * @param Icd10
     */
    public void setInfoJsonParam(com.alibaba.fastjson.JSONArray jsonData,DoctorMappingDO doctorMappingDO,WlyyOutpatientDO outpatientDO,WlyyPrescriptionInfoDO info,String Icd10){
    public void setInfoJsonParam(com.alibaba.fastjson.JSONArray jsonData,DoctorMappingDO doctorMappingDO,WlyyOutpatientDO outpatientDO,WlyyPrescriptionDO prescriptionDO,WlyyPrescriptionInfoDO info,String Icd10){
        com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
        if(StringUtils.isNotBlank(prescriptionDO.getRealOrder())){
            json.put("realOrder",prescriptionDO.getRealOrder());
        }
        json.put("cardNo",outpatientDO.getCardNo());
        json.put("doctor",doctorMappingDO.getMappingCode());
        json.put("dept",outpatientDO.getDept());
@ -1458,7 +1518,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        json.put("unit",info.getUnit());
        json.put("usage",info.getUsageCode());
        json.put("supplyCode",info.getSupplyCode());
        json.put("days",info.getDays());
        if(StringUtils.isNotBlank(info.getDays())){
            json.put("days",info.getDays());
        }else{
            //如果是中草药,贴数为天数,没有默认1天
            json.put("days",StringUtils.isNotBlank(info.getPostCount())?info.getPostCount():"1");
        }
        json.put("frequency",info.getFrequency());
        //设置诊断
@ -3702,4 +3767,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public DoctorMappingDO getDoctorMapping(String doctor,String orgCode){
        return doctorMappingService.findMappingCode(doctor,orgCode);
    }
}

+ 17 - 12
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -814,7 +814,9 @@ public class EntranceService {
            for(WlyyHisPrescriptionVO vo:patientSubscribeJkedus){
                //必输字段
                sbs.append("<resquest card_no=\"" + vo.getCardNo() + "\" doctor=\"" + vo.getDoctor() + "\" dept=\"" + vo.getDept() + "\" win_no=\"" + vo.getWinNo() + "\" charge_flag=\"" + vo.getChargeFlag() + "\" ");
                if(StringUtils.isNotBlank(vo.getRealOrder())){
                    sbs.append(" real_order=\""+vo.getRealOrder()+"\"");
                }
                if(StringUtils.isNotBlank(vo.getChargeCode())){
                    sbs.append(" charge_code=\"" + vo.getChargeCode()+ "\"");
                }
@ -1942,13 +1944,13 @@ public class EntranceService {
    /**
     * 检查模板
     * 检验模板
     * @param bz_code
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public JSONArray BS20030(String bz_code,boolean demoFlag) throws Exception {
    public JSONArray BS20030(String bz_code,String flag,boolean demoFlag) throws Exception {
        String fid="BS20030";
        String resp="";
        if (demoFlag) {
@ -1966,6 +1968,7 @@ public class EntranceService {
            }else{
                sbs.append("<Msg/>");
            }
            sbs.append("<FLAG>"+flag+"</FLAG>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
@ -1980,7 +1983,7 @@ public class EntranceService {
     * @return
     * @throws Exception
     */
    public JSONArray BS25033(String bz_code,boolean demoFlag) throws Exception {
    public JSONArray BS25033(String bz_code,String flag,boolean demoFlag) throws Exception {
        String fid="BS25033";
        String resp="";
        if (demoFlag) {
@ -1998,6 +2001,7 @@ public class EntranceService {
            }else{
                sbs.append("<Msg/>");
            }
            sbs.append("<FLAG>"+flag+"</FLAG>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
@ -2007,12 +2011,12 @@ public class EntranceService {
    /**
     * S60线上复诊 MS02015套餐子项目字典接口
     * @param child_code
     * @param parent_code
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public JSONArray MS02015(String child_code,boolean demoFlag) throws Exception {
    public JSONArray MS02015(String parent_code,boolean demoFlag) throws Exception {
        String fid="MS02015";
        String resp="";
        if (demoFlag) {
@ -2025,8 +2029,8 @@ public class EntranceService {
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+targetSysCode+"</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>1000</endNum>");
            if(StringUtils.isNotBlank(child_code)){
                sbs.append("<Msg>and child_code = '"+child_code+"'</Msg>");
            if(StringUtils.isNotBlank(parent_code)){
                sbs.append("<Msg>and parent_code = '"+parent_code+"'</Msg>");
            }else{
                sbs.append("<Msg/>");
            }
@ -2039,12 +2043,12 @@ public class EntranceService {
    /**
     * S60线上复诊 MS02017套餐选择接口
     * @param charge_code
     * @param bz_code
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public JSONArray MS02017(String charge_code,boolean demoFlag) throws Exception {
    public JSONArray MS02017(String bz_code,String flag,boolean demoFlag) throws Exception {
        String fid="MS02017";
        String resp="";
        if (demoFlag) {
@ -2057,11 +2061,12 @@ public class EntranceService {
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+targetSysCode+"</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>1000</endNum>");
            if(StringUtils.isNotBlank(charge_code)){
                sbs.append("<Msg>and charge_code = '"+charge_code+"'</Msg>");
            if(StringUtils.isNotBlank(bz_code)){
                sbs.append("<Msg>and bz_code = '"+bz_code+"'</Msg>");
            }else{
                sbs.append("<Msg/>");
            }
            sbs.append("<FLAG>"+flag+"</FLAG>");
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);

+ 7 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -297,6 +297,13 @@ public class BaseHospitalRequestMapping {
        public static final String findDictByName = "/findDictByName";
        public static final String getJcmb="/getJcmb";
        public static final String getJymb="/getJymb";
        public static final String getTcxz="/getTcxz";
        public static final String getTcChild="/getTcChild";
        public static final String getInsChild="/getInsChild";
    }

+ 12 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyHisPrescriptionVO.java

@ -20,6 +20,10 @@ import java.util.List;
@ApiModel(value = "WlyyHisPrescriptionVO", description = "在线处方主表")
public class WlyyHisPrescriptionVO extends UuidIdentityVOWithOperator {
    /**
     * his处方ID,会做
     */
    private String realOrder;
    /**
     * 卡号
     */
@ -407,4 +411,12 @@ public class WlyyHisPrescriptionVO extends UuidIdentityVOWithOperator {
    public void setFixationfluid(String fixationfluid) {
        this.fixationfluid = fixationfluid;
    }
    public String getRealOrder() {
        return realOrder;
    }
    public void setRealOrder(String realOrder) {
        this.realOrder = realOrder;
    }
}

+ 16 - 10
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java

@ -421,8 +421,10 @@ public class MqSdkController extends EnvelopRestEndpoint {
    @GetMapping(value = "/BS20030")
    @ApiOperation(value = "检验模板接口")
    public ObjEnvelop BS20030(@ApiParam(name = "bz_code", value = "入参条件为第一节点代码")
                              @RequestParam(value = "bz_code",defaultValue = "") String bz_code) throws Exception {
        JSON obj = entranceService.BS20030(bz_code,demoFlag);
                              @RequestParam(value = "bz_code",defaultValue = "") String bz_code,
                              @ApiParam(name = "flag", value = "入参条件为第一节点代码")
                              @RequestParam(value = "flag",defaultValue = "1获取所有一级节点,2二级,3为具体信息") String flag) throws Exception {
        JSON obj = entranceService.BS20030(bz_code,flag,demoFlag);
        return success(obj);
    }
@ -430,17 +432,19 @@ public class MqSdkController extends EnvelopRestEndpoint {
    @ApiOperation(value = "BS25033检查模板接口")
    public ObjEnvelop BS25033(
            @ApiParam(name = "bz_code", value = "入参条件为第一节点代码")
            @RequestParam(value = "bz_code",defaultValue = "") String bz_code) throws Exception {
        JSON obj = entranceService.BS25033(bz_code,demoFlag);
            @RequestParam(value = "bz_code",defaultValue = "") String bz_code,
            @ApiParam(name = "flag", value = "入参条件为第一节点代码")
            @RequestParam(value = "flag",defaultValue = "1获取所有一级节点,2二级,3为具体信息") String flag) throws Exception {
        JSON obj = entranceService.BS25033(bz_code,flag,demoFlag);
        return success(obj);
    }
    @GetMapping(value = "/MS02015")
    @ApiOperation(value = "MS02015套餐子项目字典接口")
    public ObjEnvelop MS02015(
            @ApiParam(name = "child_code", value = "入参条件为子项目编码")
            @RequestParam(value = "child_code",defaultValue = "") String child_code) throws Exception {
        JSON obj = entranceService.MS02015(child_code,demoFlag);
            @ApiParam(name = "parent_code", value = "入参条件为子项目编码")
            @RequestParam(value = "parent_code",defaultValue = "") String parent_code) throws Exception {
        JSON obj = entranceService.MS02015(parent_code,demoFlag);
        return success(obj);
    }
@ -456,9 +460,11 @@ public class MqSdkController extends EnvelopRestEndpoint {
    @GetMapping(value = "/MS02017")
    @ApiOperation(value = "MS02017套餐选择接口")
    public ObjEnvelop MS02017(
            @ApiParam(name = "charge_code", value = "入参条件为收费项目代码")
            @RequestParam(value = "charge_code",defaultValue = "") String charge_code) throws Exception {
        JSON obj = entranceService.MS02017(charge_code,demoFlag);
            @ApiParam(name = "bz_code", value = "入参条件为收费项目代码")
            @RequestParam(value = "bz_code",defaultValue = "") String charge_code,
            @ApiParam(name = "flag", value = "入参条件为第一节点代码")
            @RequestParam(value = "flag",defaultValue = "1获取所有一级节点,2二级,3为具体信息") String flag) throws Exception {
        JSON obj = entranceService.MS02017(charge_code,flag,demoFlag);
        return success(obj);
    }
}

+ 50 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -274,6 +274,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(prescriptionService.getDrugFrequency());
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.makeDiagnosis)
    @ApiOperation(value = "下诊断", notes = "下诊断")
    public ObjEnvelop makeDiagnosis(@ApiParam(name = "outPatientId", value = "门诊编号")
@ -639,11 +641,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getInspectionDictionary)
    @ApiOperation(value = "获取检查检验", notes = "获取检查检验")
    public ListEnvelop getInspectionDictionary(@ApiParam(name = "pyKey", value = "拼音码")
                                              @RequestParam(value = "pyKey", required = true)String pyKey,
                                              @RequestParam(value = "pyKey", required = false)String pyKey,
                                              @ApiParam(name = "winNo", value = "6总部7金榜8夏禾")
                                              @RequestParam(value = "winNo", required = true)String winNo,
                                              @ApiParam(name = "codes", value = "检查检验收费码codes,用逗号分割")
                                              @RequestParam(value = "codes", required = true)String codes)throws Exception{
                                              @RequestParam(value = "codes", required = false)String codes)throws Exception{
        return success(prescriptionService.getInspectionDictionary(pyKey,codes,winNo));
    }
@ -669,4 +671,50 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "name", required = true)String name)throws Exception{
        return success(inspectionService.findDictByName(hospital,name));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getJymb)
    @ApiOperation(value = "检验模板接口")
    public ListEnvelop getJymb(@ApiParam(name = "bz_code", value = "入参条件为第一节点代码")
                              @RequestParam(value = "bz_code",defaultValue = "") String bz_code,
                              @ApiParam(name = "flag", value = "入参条件为第一节点代码")
                              @RequestParam(value = "flag",defaultValue = "1获取所有一级节点,2二级,3为具体信息") String flag) throws Exception {
        return success(prescriptionService.getJymb(bz_code,flag));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getJcmb)
    @ApiOperation(value = "检查模板接口")
    public ListEnvelop getJcmb(
            @ApiParam(name = "bz_code", value = "入参条件为第一节点代码")
            @RequestParam(value = "bz_code",defaultValue = "") String bz_code,
            @ApiParam(name = "flag", value = "入参条件为第一节点代码")
            @RequestParam(value = "flag",defaultValue = "1获取所有一级节点,2二级,3为具体信息") String flag) throws Exception {
        return success(prescriptionService.getJcmb(bz_code,flag));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getTcChild)
    @ApiOperation(value = "套餐子项目字典接口")
    public ListEnvelop getTcChild(
            @ApiParam(name = "parent_code", value = "入参条件为子项目编码")
            @RequestParam(value = "parent_code",defaultValue = "") String parent_code) throws Exception {
        return success(prescriptionService.getTcChild(parent_code));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getInsChild)
    @ApiOperation(value = "主项目绑定子项目字典接口")
    public ListEnvelop getInsChild(
            @ApiParam(name = "zd_charge_code", value = "入参条件为项目代码")
            @RequestParam(value = "zd_charge_code",defaultValue = "") String zd_charge_code) throws Exception {
        return success(prescriptionService.getInsChild(zd_charge_code));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getTcxz)
    @ApiOperation(value = "套餐选择接口")
    public ListEnvelop getTcxz(
            @ApiParam(name = "bz_code", value = "入参条件为收费项目代码")
            @RequestParam(value = "bz_code",defaultValue = "") String charge_code,
            @ApiParam(name = "flag", value = "入参条件为第一节点代码")
            @RequestParam(value = "flag",defaultValue = "1获取所有一级节点,2二级,3为具体信息") String flag) throws Exception {
        prescriptionService.getTcxz(charge_code,flag);
        return success(prescriptionService.getTcxz(charge_code,flag));
    }
}