zdm před 6 roky
rodič
revize
ada34a038c

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

@ -1,13 +1,17 @@
package com.yihu.jw.hospital.prescription.service.entrance;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil;
import com.yihu.jw.restmodel.hospital.prescription.WlyyHisPrescriptionVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
@ -15,6 +19,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import java.io.BufferedReader;
import java.io.IOException;
@ -193,13 +198,14 @@ public class EntranceService {
    /**
     * 门诊处方信息(所有处方)根据处方信息封装到实体中
     * @param REGISTER_SN 流水号
     * @param realOrder 处方号
     * @param PAT_NO 病人id
     * @param ADM_NO 就诊唯一号
     * @param demoFlag 是否获取demo数据
     * @return
     * @throws Exception
     */
    public List<WlyyPrescriptionVO>  BS16017ReturnObj(String REGISTER_SN,String PAT_NO,String ADM_NO,boolean demoFlag) throws Exception {
    public List<WlyyPrescriptionVO>  BS16017ReturnObj(String REGISTER_SN,String realOrder,String PAT_NO,String ADM_NO,boolean demoFlag) throws Exception {
        String fid=BS16017;
        String resp = "";
        if (demoFlag) {
@ -215,6 +221,9 @@ public class EntranceService {
            if (StringUtils.isNotBlank(REGISTER_SN)) {
                sbs.append("<query compy=\"=\" item=\"REGISTER_SN\" splice=\"and\" value=\"'" + REGISTER_SN + "'\"/>");
            }
            if (StringUtils.isNotBlank(realOrder)) {
                sbs.append("<query compy=\"=\" item=\"real_order\" splice=\"and\" value=\"'" + realOrder + "'\"/>");
            }
            if (StringUtils.isNotBlank(PAT_NO)) {
                sbs.append("<query compy=\"=\" item=\"PAT_NO\" splice=\"and\" value=\"'" + PAT_NO + "'\"/>");
            }
@ -544,30 +553,58 @@ public class EntranceService {
    /**
     *  线上处方
     *  @param card_no 卡号
     *  @param doctor 医生工号
     *  @param dept 科室编码
     *  @param charge_code 号别
     *  @param win_no 分部号
     * @return
     * @throws Exception
     */
    public net.sf.json.JSONObject BS10112(String card_no, String doctor, String dept, String charge_code, String win_no, String charge_flag, String quantity, String serial_no, String group_no,
                                          String serial, String icd_code, String diag_two, String diag_three, String diag_four, String diag_five, String dosage, String unit, String usage, String supply_code, String days, String frequency, boolean demoFlag) throws Exception {
    public net.sf.json.JSONObject BS10112(String jsonData, boolean demoFlag) throws Exception {
        String fid=BS10112;
        ObjectMapper objectMapper = new ObjectMapper();
        List<WlyyHisPrescriptionVO> patientSubscribeJkedus = objectMapper.readValue(jsonData,  new TypeReference<List<WlyyHisPrescriptionVO>>(){});
        String resp="";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            //多个request? 诊断2到诊断4
            StringBuffer sbs = new StringBuffer();
            sbs.append("<ESBEntry><AccessControl><Fid>BS10112</Fid><UserName>jkzl</UserName><Password>123456</Password></AccessControl>");
            sbs.append("<MessageHeader><Fid>BS10112</Fid><MsgDate>2018-10-09 16:52:39</MsgDate><SourceSysCode>S60</SourceSysCode><TargetSysCode>S01</TargetSysCode></MessageHeader>");
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root>");
            sbs.append("<resquest card_no=\"" + card_no + "\" doctor=\"" + doctor + "\" dept=\"" + dept + "\" charge_code=\"" + charge_code + "\" win_no=\"" + win_no + "\" charge_flag=\"" + charge_flag + "\" ");
            sbs.append("quantity=\"" + quantity + "\"  serial_no=\"" + serial_no + "\"  group_no=\"" + group_no + "\"   serial=\"" + serial + "\"   icd_code=\"" + icd_code/*+"\" dosage=\""+dosage+"\" unit=\""+unit+"\" "*/);
            sbs.append(/*"usage=\""+usage+"\" supply_code=\""+supply_code+"\" days=\""+days+"\" frequency=\""+frequency+*/"\" days=\"" + days + "\" frequency=\"" + frequency + "\"/>");
            for(WlyyHisPrescriptionVO vo:patientSubscribeJkedus){
                //必输字段
                sbs.append("<resquest card_no=\"" + vo.getCardNo() + "\" doctor=\"" + vo.getDoctor() + "\" dept=\"" + vo.getDept() + "\" charge_code=\"" + vo.getChargeCode() + "\" win_no=\"" + vo.getWinNo() + "\" charge_flag=\"" + vo.getChargeFlag() + "\" ");
                sbs.append("quantity=\"" + vo.getQuantity() + "\"  serial_no=\"" + vo.getSerialNo() + "\"  group_no=\"" + vo.getGroupNo() + "\"   serial=\"" + vo.getSerial() + "\"   icd_code=\"" + vo.getIcdCode()+"\"");
                //选填字段
                if(StringUtils.isNotBlank(vo.getDiagTwo())){
                    sbs.append("\" diag_two=\""+vo.getDiagTwo()+"\"");
                }
                if(StringUtils.isNotBlank(vo.getDiagThree())){
                    sbs.append("\" diag_three=\""+vo.getDiagThree()+"\"");
                }
                if(StringUtils.isNotBlank(vo.getDiagFour())){
                    sbs.append("\" diag_four=\""+vo.getDiagFour()+"\"");
                }
                if (StringUtils.isNotBlank(vo.getDiagFive())) {
                    sbs.append("\" diag_five=\"" + vo.getDiagFive() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getDosage())) {
                    sbs.append("\" dosage=\"" + vo.getDosage() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getUnit())) {
                    sbs.append("\" unit=\"" + vo.getUnit() + "\"");
                }
                if (StringUtils.isNotBlank(vo.getUsage())) {
                    sbs.append("\" usage=\"" + vo.getUsage() + "\"");
                }
                if(StringUtils.isNotBlank(vo.getSupplyCode())){
                    sbs.append("\" supply_code=\""+vo.getSupplyCode()+"\"");
                }
                if(StringUtils.isNotBlank(vo.getDays())){
                    sbs.append("\" days=\""+vo.getDays()+"\"");
                }
                if(StringUtils.isNotBlank(vo.getFrequency())){
                    sbs.append("\" frequency=\""+vo.getFrequency()+ "\"");
                }
                sbs.append("/>");
            }
            sbs.append("</root>]]></Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);

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

@ -0,0 +1,278 @@
package com.yihu.jw.restmodel.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.restmodel.UuidIdentityVOWithOperator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Date;
import java.util.List;
/**
 * 
 * his在线处方主表vo
 * </pre>
 * @since 1.
 */
@ApiModel(value = "WlyyHisPrescriptionVO", description = "在线处方主表")
public class WlyyHisPrescriptionVO extends UuidIdentityVOWithOperator {
    /**
     * 卡号
     */
  private String cardNo;
    /**
     * 医生工号
     */
    private String doctor;
    /**
     * 科室编码
     */
    private String dept;
    /**
     * 收费码
     */
    private String chargeCode;
    /**
     * 分部号
     */
    private String winNo;
    /**
     * 项目类别
     */
    private String chargeFlag;
    /**
     * 数量
     */
    private String quantity;
    /**
     * 挂号流水号
     */
    private String serialNo;
    /**
     * 库房号
     */
    private String groupNo;
    /**
     * 药品序列号
     */
    private String serial;
    /**
     * 主诊断编码
     */
    private String icdCode;
    /**
     * 用量
     */
    private String dosage;
    /**
     * 用量单位
     */
    private String unit;
    /**
     * 频率
     */
    private String usage;
    /**
     * 用法
     */
    private String supplyCode;
    /**
     * 天数
     */
    private String days;
    /**
     * 组号
     */
    private String frequency;
    /**
     * 第二诊断
     */
    private String diagTwo;
    /**
     * 第三诊断
     */
    private String diagThree;
    /**
     * 第四诊断
     */
    private String diagFour;
    /**
     * 第五诊断
     */
  private String diagFive;
    public String getCardNo() {
        return cardNo;
    }
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDept() {
        return dept;
    }
    public void setDept(String dept) {
        this.dept = dept;
    }
    public String getChargeCode() {
        return chargeCode;
    }
    public void setChargeCode(String chargeCode) {
        this.chargeCode = chargeCode;
    }
    public String getWinNo() {
        return winNo;
    }
    public void setWinNo(String winNo) {
        this.winNo = winNo;
    }
    public String getChargeFlag() {
        return chargeFlag;
    }
    public void setChargeFlag(String chargeFlag) {
        this.chargeFlag = chargeFlag;
    }
    public String getQuantity() {
        return quantity;
    }
    public void setQuantity(String quantity) {
        this.quantity = quantity;
    }
    public String getSerialNo() {
        return serialNo;
    }
    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }
    public String getGroupNo() {
        return groupNo;
    }
    public void setGroupNo(String groupNo) {
        this.groupNo = groupNo;
    }
    public String getSerial() {
        return serial;
    }
    public void setSerial(String serial) {
        this.serial = serial;
    }
    public String getIcdCode() {
        return icdCode;
    }
    public void setIcdCode(String icdCode) {
        this.icdCode = icdCode;
    }
    public String getDiagTwo() {
        return diagTwo;
    }
    public void setDiagTwo(String diagTwo) {
        this.diagTwo = diagTwo;
    }
    public String getDiagThree() {
        return diagThree;
    }
    public void setDiagThree(String diagThree) {
        this.diagThree = diagThree;
    }
    public String getDiagFour() {
        return diagFour;
    }
    public void setDiagFour(String diagFour) {
        this.diagFour = diagFour;
    }
    public String getDiagFive() {
        return diagFive;
    }
    public void setDiagFive(String diagFive) {
        this.diagFive = diagFive;
    }
    public String getDosage() {
        return dosage;
    }
    public void setDosage(String dosage) {
        this.dosage = dosage;
    }
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    public String getUsage() {
        return usage;
    }
    public void setUsage(String usage) {
        this.usage = usage;
    }
    public String getSupplyCode() {
        return supplyCode;
    }
    public void setSupplyCode(String supplyCode) {
        this.supplyCode = supplyCode;
    }
    public String getDays() {
        return days;
    }
    public void setDays(String days) {
        this.days = days;
    }
    public String getFrequency() {
        return frequency;
    }
    public void setFrequency(String frequency) {
        this.frequency = frequency;
    }
}

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

@ -77,11 +77,13 @@ public class MqSdkController extends EnvelopRestEndpoint {
    public ListEnvelop BS16017ListObj(
            @ApiParam(name = "registerSn", value = "流水号", required = false)
            @RequestParam(value = "registerSn",required = false) String registerSn,
            @ApiParam(name = "realOrder", value = "处方号", required = false)
            @RequestParam(value = "realOrder",required = false) String realOrder,
            @ApiParam(name = "patNo", value = "病人id", required = false)
            @RequestParam(value = "patNo",required = false) String patNo,
            @ApiParam(name = "admNo", value = "住院唯一号", required = false)
            @RequestParam(value = "admNo",required = false) String admNo) throws Exception {
        List<WlyyPrescriptionVO>  BS16017ReturnObj= entranceService.BS16017ReturnObj(registerSn, patNo, admNo, demoFlag);
        List<WlyyPrescriptionVO>  BS16017ReturnObj= entranceService.BS16017ReturnObj(registerSn,realOrder, patNo, admNo, demoFlag);
        return success(BS16017ReturnObj);
    }
@ -156,51 +158,9 @@ public class MqSdkController extends EnvelopRestEndpoint {
    @PostMapping(value = "/BS10112")
    @ApiOperation(value = "线上处方接口")
    public ObjEnvelop BS10112(
            @ApiParam(name = "cardNo", value = "卡号")
            @RequestParam(value = "cardNo", required = true) String cardNo,
            @ApiParam(name = "doctor", value = "医生工号")
            @RequestParam(value = "doctor", required = true) String doctor,
            @ApiParam(name = "dept", value = "科室编码")
            @RequestParam(value = "dept", required = true) String dept,
            @ApiParam(name = "chargeCode", value = "收费码")
            @RequestParam(value = "chargeCode", required = true) String chargeCode,
            @ApiParam(name = "winNo", value = "分部号")
            @RequestParam(value = "winNo", required = true) String winNo,
            @ApiParam(name = "chargeFlag", value = "项目类别")
            @RequestParam(value = "chargeFlag", required = true) String chargeFlag,
            @ApiParam(name = "quantity", value = "数量")
            @RequestParam(value = "quantity", required = true) String quantity,
            @ApiParam(name = "serialNo", value = "挂号流水号")
            @RequestParam(value = "serialNo", required = true) String serialNo,
            @ApiParam(name = "groupNo", value = "库房号")
            @RequestParam(value = "groupNo", required = true) String groupNo,
            @ApiParam(name = "serial", value = "药品序列号")
            @RequestParam(value = "serial", required = true) String serial,
            @ApiParam(name = "icdCode", value = "主诊断编码")
            @RequestParam(value = "icdCode", required = true) String icdCode,
            @ApiParam(name = "diagTwo", value = "第二诊断")
            @RequestParam(value = "diagTwo", required = false) String diagTwo,
            @ApiParam(name = "diagThree", value = "第三诊断")
            @RequestParam(value = "diagThree", required = false) String diagThree,
            @ApiParam(name = "diagFour", value = "第四诊断")
            @RequestParam(value = "diagFour", required = false) String diagFour,
            @ApiParam(name = "diagFive", value = "第五诊断")
            @RequestParam(value = "diagFive", required = false) String diagFive,
            @ApiParam(name = "dosage", value = "用量")
            @RequestParam(value = "dosage", required = false) String dosage,
            @ApiParam(name = "unit", value = "用量单位")
            @RequestParam(value = "unit", required = false) String unit,
            @ApiParam(name = "usage", value = "频率")
            @RequestParam(value = "usage", required = false) String usage,
            @ApiParam(name = "supplyCode", value = "用法")
            @RequestParam(value = "supplyCode", required = false) String supplyCode,
            @ApiParam(name = "days", value = "天数")
            @RequestParam(value = "days", required = false) String days,
            @ApiParam(name = "frequency", value = "组号")
            @RequestParam(value = "frequency", required = false) String frequency) throws Exception {
        //TODO 处理多条药品
        JSONObject obj = entranceService.BS10112(cardNo, doctor, dept, chargeCode, winNo, chargeFlag, quantity, serialNo, groupNo,
                serial, icdCode, diagTwo, diagThree, diagFour, diagFive, dosage, unit, usage, supplyCode, days, frequency,demoFlag);
            @ApiParam(name = "jsonData", value = "处方开方json数组对象")
            @RequestBody String jsonData) throws Exception {
        JSONObject obj = entranceService.BS10112(jsonData,demoFlag);
        return  success(obj);
    }