Jelajahi Sumber

审药接口提交

wangjun 4 tahun lalu
induk
melakukan
38d8f66db8

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

@ -2311,7 +2311,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if (StringUtils.isNotBlank(inspectionJson)) {
                List<WlyyInspectionDO> inspections = (List<WlyyInspectionDO>) com.alibaba.fastjson.JSONArray.parseArray(inspectionJson, WlyyInspectionDO.class);
                for (WlyyInspectionDO ins : inspections) {
                    YkEmrJcsqDO ykEmrJcsqDO =new YkEmrJcsqDO();
                    ins.setDel(1);
                    ins.setCreateTime(new Date());
                    ins.setPrescriptionId(prescription.getId());
@ -2372,7 +2371,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //上传his开方
                //sendHisDiagnosis(jsonData, outpatientDO, prescription)
                //zsSynHis(prescription.getId());
                //同步检查检验
                List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescription.getId(),1);
                if (inspectionDOS != null && inspectionDOS.size() > 0) {
                    syCheckParam(outpatientDO.getId());
                }
                Map<String, Object> result1 = new HashedMap();
                result1.put("code", 1);
                result1.put("mes", "开方提交成功");
@ -2419,34 +2422,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            condition += "<ApplyDept>"+outpatientDO.getDept()+"</ApplyDept>";
            condition += "<ApplyDoctor>"+applyDoctor+"</ApplyDoctor>";
            List<WlyyInspectionDO>  wlyyInspectionDOS = wlyyInspectionDao.findByOutpatientId(outpatientDO.getId());
            if (null!=wlyyInspectionDOS&&wlyyInspectionDOS.size()>0){
                for (WlyyInspectionDO wlyyInspectionDO:wlyyInspectionDOS){
                    inspectionList.append("<PresInfo>");
                    inspectionList.append("<ClinicCode>"+wlyyInspectionDO.getCode()+"</ClinicCode>");
                    inspectionList.append("<ClinicNum>"+wlyyInspectionDO.getQuantity()+"</ClinicNum>");
                    inspectionList.append("<ExecuteDept>"+wlyyInspectionDO.getDept()+"</ExecuteDept>");
                    inspectionList.append("<CheckResult>"+wlyyInspectionDO.getYwjcResult()+"</CheckResult>");
                    inspectionList.append("<CheckPart>"+wlyyInspectionDO.getCheckPart()+"</CheckPart>");
                    inspectionList.append("<SickSynptom>"+"临床症状和体征 "+"</SickSynptom>");
                    inspectionList.append("<Height>"+"身高"+"</Height>");
                    inspectionList.append("<Weight>"+"体重"+"</Weight>");
                    inspectionList.append("<SensitiveName>"+"过敏史"+"</SensitiveName>");
                    inspectionList.append("<SampleCode>"+"标本类型"+"</SampleCode>");
                    inspectionList.append("<ChiefComplaint>"+"主诉"+"</ChiefComplaint>");
                    inspectionList.append("<MedicalHistory>"+"病史"+"</MedicalHistory>");
                    inspectionList.append("<InspectionPurpose>"+wlyyInspectionDO.getGoal()+"</InspectionPurpose>");
                    inspectionList.append("<PastHistory>"+"既往史"+"</PastHistory>");
                    inspectionList.append("<LisCheckResult>"+"历史检验相关结果(化验单)"+"</LisCheckResult>");
                    inspectionList.append("<InspectionResult>"+"相关辅助检查"+"</InspectionResult>");
                    inspectionList.append("<InspectionNotice>"+"注意事项"+"</InspectionNotice>");
                    inspectionList.append("<Memo>"+wlyyInspectionDO.getCode()+"</Memo>");
                    inspectionList.append("</PresInfo>");
                }
                condition += "<PresDetail>" +inspectionList.toString()+"</PresDetail>";
            }
            String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                    "<root>"+condition+"</root>";
            Map resultMap =  xzzxEntranceService.checkSyncHis(msgBody);
            Map resultMap =  xzzxEntranceService.checkSyncHis("0",outpatientDO.getCardNo(),outpatientDO.getRegisterNo(),outpatientDO.getDept(),applyDoctor,wlyyInspectionDOS.toString());
            logger.info("同步his检查检验返回结果:"+resultMap.get("success"));
        }
@ -8591,5 +8569,4 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public void updateHisStatusByOutpatientId(String outpatientId){
        outpatientDao.updateHisStatusById(outpatientId,1);
    }
}

+ 26 - 8
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -28,6 +28,7 @@ import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.entrance.util.AES;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.base.doctor.BaseDoctorVO;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
@ -1206,7 +1207,6 @@ public class XzzxEntranceService{
        String condition ="";
        condition = "<IoFlag>"+IoFlag+"</IoFlag>";
        StringBuffer inspectionList = new StringBuffer();
        String applyDoctor = "";
        condition += "<PayCardNo>"+PayCardNo+"</PayCardNo>";
        condition += "<NullahNumber>"+NullahNumber+"</NullahNumber>";
        condition += "<ApplyDept>"+ApplyDept+"</ApplyDept>";
@ -1224,11 +1224,11 @@ public class XzzxEntranceService{
            inspectionList.append("<SensitiveName>"+"过敏史"+"</SensitiveName>");
            inspectionList.append("<SampleCode>"+"标本类型"+"</SampleCode>");
            inspectionList.append("<ChiefComplaint>"+"主诉"+"</ChiefComplaint>");
            inspectionList.append("<MedicalHistory>"+"病史"+"</MedicalHistory>");
            inspectionList.append("<MedicalHistory>"+wlyyInspectionDO.getInformation()+"</MedicalHistory>");
            inspectionList.append("<InspectionPurpose>"+wlyyInspectionDO.getGoal()+"</InspectionPurpose>");
            inspectionList.append("<PastHistory>"+"既往史"+"</PastHistory>");
            inspectionList.append("<LisCheckResult>"+"历史检验相关结果(化验单)"+"</LisCheckResult>");
            inspectionList.append("<InspectionResult>"+"相关辅助检查"+"</InspectionResult>");
            inspectionList.append("<LisCheckResult>"+wlyyInspectionDO.getYwjcResult()+"</LisCheckResult>");
            inspectionList.append("<InspectionResult>"+wlyyInspectionDO.getAdresult()+"</InspectionResult>");
            inspectionList.append("<InspectionNotice>"+"注意事项"+"</InspectionNotice>");
            inspectionList.append("<Memo>"+wlyyInspectionDO.getCode()+"</Memo>");
            inspectionList.append("</PresInfo>");
@ -1247,7 +1247,23 @@ public class XzzxEntranceService{
        return json;
    }
    /*
     *合理用药审核接口
     */
    public String checkPrescription(JSONObject patientAndDoctor,List<WlyyPrescriptionInfoDO> infos){
        String checkDate = "";
        String postBody = "<CheckInput TAG=\"2\" INPATIENT=\"否\">"+checkDate+"</CheckInput>";
    return  null;
    }
    //组装审药参数
    public void checkInpit(String prescriptionId){
        JSONObject jsonObject = new JSONObject();
        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
        if(null!=prescriptionDO){
        }
    }
//=====================微信模板消息推送===================================
@ -2322,7 +2338,7 @@ public class XzzxEntranceService{
     * @param spellCode 拼音码或药品名字
     * @return
     */
        public JSONArray selectExamApply(String spellCode) throws Exception {
    public JSONArray selectExamApply(String spellCode) throws Exception {
        String response="";
        String url = entranceUrl+"getExamApply?spellCode="+spellCode;
        response = httpClientUtil.get(url,"GBK");
@ -2383,13 +2399,15 @@ public class XzzxEntranceService{
    }
/**
 * 检查检验项目同步his
 * @param msgBody 拼音码或药品名字
 * @param
 * @return
 */
public Map checkSyncHis(String msgBody) throws Exception {
public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,String ApplyDept,String ApplyDoctor,String wlyyInspectionS) throws Exception {
    String response="";
    Map resultMap=new HashMap();
    String url = entranceUrl+"saveInspectToHospital?msgBody="+msgBody;
    String url = entranceUrl+"saveInspectToHospital?IoFlag="+IoFlag+"&PayCardNo="+PayCardNo+"&NullahNumber="+NullahNumber+
            "&ApplyDept="+ApplyDept+
            "&ApplyDoctor="+ApplyDoctor+"&wlyyInspectionS="+wlyyInspectionS;
    response = httpClientUtil.get(url,"GBK");
    JSONObject object = JSONObject.parseObject(response);
    if(object.getInteger("status")==200){

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

@ -1038,11 +1038,21 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取检查检验", notes = "获取检查检验")
    public ListEnvelop getInspectionDictionary(@ApiParam(name = "pyKey", value = "拼音码")
                                               @RequestParam(value = "pyKey", required = false)String pyKey,
                                               @ApiParam(name = "winNo", value = "6总部7金榜8夏禾")
                                               @ApiParam(name = "winNo", value = "6总部7金榜8夏禾10检查11检验")
                                               @RequestParam(value = "winNo", required = true)String winNo,
                                               @ApiParam(name = "codes", value = "检查检验收费码codes,用逗号分割")
                                               @RequestParam(value = "codes", required = false)String codes)throws Exception{
        return success(prescriptionService.getInspectionDictionary(pyKey,codes,winNo));
        if("xm_xzzx_wx".equalsIgnoreCase(wxId)){
            if ("10".equalsIgnoreCase(winNo)){
                //检查
                return success(xzzxEntranceService.selectExamApply(pyKey));
            }else {
                //检验
                return success(xzzxEntranceService.selectLisApply(pyKey));
            }
        }else {
            return success(prescriptionService.getInspectionDictionary(pyKey,codes,winNo));
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPrescriptionLogByPreId)
@ -1060,15 +1070,20 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.xzzxFindByPartsCode)
    @ApiOperation(value = "心脏查询部位字典", notes = "心脏查询部位字典")
    public ListEnvelop xzzxFindByPartsCode(@ApiParam(name = "spellCode", value = "父节点ID,第一层为0")
    public ListEnvelop xzzxFindByPartsCode(@ApiParam(name = "spellCode", value = "拼音首字母")
                                       @RequestParam(value = "spellCode", required = false)String spellCode)throws Exception{
        return success(xzzxEntranceService.selectCheckBody(spellCode));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByPartsCode)
    @ApiOperation(value = "查询部位字典", notes = "查询部位字典")
    public ListEnvelop findByPartsCode(@ApiParam(name = "parentCode", value = "父节点ID,第一层为0")
                                       @RequestParam(value = "parentCode", required = true)String parentCode)throws Exception{
        return success(inspectionService.findByPartsCode(parentCode));
                                       @RequestParam(value = "parentCode", required = false)String parentCode)throws Exception{
        if("xm_xzzx_wx".equalsIgnoreCase(wxId)){
            return success(xzzxEntranceService.selectCheckBody(parentCode));
        }else {
            return success(inspectionService.findByPartsCode(parentCode));
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDictByName)