瀏覽代碼

代码修改

LAPTOP-KB9HII50\70708 3 年之前
父節點
當前提交
adeeac61ef

+ 0 - 115
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareService.java

@ -407,122 +407,7 @@ public class HealthCareService {
        if (outpatientDO == null){
            throw new Exception("门诊信息不存在");
        }
        BasePatientDO patientDO = patientDao.findById(outpatientDO.getPatient());
        if(patientDO == null){
            throw new Exception("居民不存在");
        }
        JSONObject data = new JSONObject();
        data.put("his_serial",outpatientDO.getRegisterNo());//HIS 门诊挂号号
        data.put("insurance_serial",outpatientDO.getInsuranceSerial());//医保门诊挂号流水号
        data.put("order_id","");//订单号 String	Y
        data.put("medical_mode","");//就诊类型 String	Y
        data.put("prescription_code",wlyyPrescriptionDO.getRealOrder());//医院处方编号
        data.put("region_code","");//参保地区划代码	String	Y
        data.put("name",patientDO.getName());//姓名
        data.put("idcard",patientDO.getIdcard());//证件号码
        data.put("cert_type","01");//证件类型
        String sex = IdCardUtil.getSexForIdcard_new(patientDO.getIdcard(),patientDO.getSex());
        if("3".equals(sex)){
            sex = "9";
        }
        data.put("sex",sex);//性别	String	Y
        String birth = IdCardUtil.getBirthdayForIdcardStr(patientDO.getIdcard(),patientDO.getBirthday());
        if(StringUtils.isBlank(birth)){
            throw new Exception("事前提醒失败:居民生日信息有误");
        }
        data.put("birth",birth);//出生日期 	String	Y
        data.put("phone",patientDO.getMobile());//用户手机号
        data.put("medical_type","11");//医疗类别	String	Y
        data.put("medical_type_name","普通门诊");//医疗类别	String	Y
//        data.put("insurance_ticket_no","");//诊查费结算后的收费单据号	String	N
        data.put("medical_time",DateUtil.dateToStr(outpatientDO.getCreateTime(),DateUtil.YYYY_MM_DD_HH_MM_SS));//特殊门诊病情编码	String	Y
        data.put("disease_code","");//特殊门诊病情编码	String	Y
        String doctorId = outpatientDO.getDoctor();
        BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
        if(doctorDO == null){
            throw new Exception("事前提醒失败:医生不存在");
        }
        List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(doctorId);
        if(doctorHospitalDOS.size()<=0){
            throw new Exception("事前提醒失败:未找到医生科室编码");
        }
        BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorId);
        if(doctorMappingDO == null){
            throw new Exception("事前提醒失败:未找到医生his编码");
        }
        data.put("dept_code",doctorHospitalDO.getDeptCode());//科室代码
        data.put("dept_name",doctorHospitalDO.getDeptName());//科室名称
        data.put("doctor_code",doctorMappingDO.getMappingCode());//医师编号
        data.put("doctor_name",doctorDO.getName());//医生名称
        data.put("doctor_idcard",doctorDO.getIdcard());//医师身份证号
/*        pharmacist_code	医院药师证件号码	String	N
        pharmacist_name	医院药师姓名	String	N
        pharmacist_audit_date	医院药师处方审核时间	String	N
        prescription _valid_date	处方过期时间	String	N
        prescription_type_code	处方类别编号	String	N
        tcm_nums	中药剂数	String	N
        tcm_method_code	中药药品用法编号	String	N
        tcm_method_name	中药药品用法名称	String	N
        tcm_freq_code	中药频次编号	String	N
        tcm_freq_name	中药频次名称	String	N*/
        data.put("prescription_date", DateUtil.dateToStr(outpatientDO.getCreateTime(),DateUtil.YYYY_MM_DD));//处方日期
        data.put("prescription_counts","1");//处方项目数
        data.put("prescription_source","");//处方来源	String	Y 0:非外配处方;1:外配处方
        //诊断
        JSONArray zdlist = new JSONArray();
        String icd10 = outpatientDO.getIcd10();
        String icd10Name = outpatientDO.getIcd10Name();
        String icd10sz[] = icd10.split(",");
        String icd10Namesz[] = icd10Name.split(",");
        for (int i=0;i<icd10sz.length;i++){
            JSONObject zd = new JSONObject();
            zd.put("disease_code_icd10",icd10sz[i].trim());//诊断或症状编码	String	Y	见icd-10或症状表编码
            zd.put("disease_name_icd10",icd10Namesz[i].trim());//诊断或症状名称	String	Y	见icd-10或症状表名称
            zd.put("disease_type","");//诊断或症状类型	String	Y	参见编码附件
            zd.put("disease_order","");//诊断或症状序号	String	Y	参见编码附件
        }
        data.put("zdlist",zdlist);
        //医嘱明细
        JSONArray mxlist = new JSONArray();
        List<WlyyPrescriptionInfoDO> prescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
        for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:prescriptionInfoDOS){
            JSONObject infoObj = new JSONObject();
            infoObj.put("catalog_item","");//社保三大目录统一编码          	String	Y
            infoObj.put("his_item_name",wlyyPrescriptionInfoDO.getDrugName());//HIS院内项目名称
            infoObj.put("his_item_code",wlyyPrescriptionInfoDO.getDrugNo());//HIS院内项目编码
            infoObj.put("item_name","");//医保项目名称
            infoObj.put("item_code","");//医保项目编码
            infoObj.put("prescription_code",wlyyPrescriptionDO.getRealOrder());//医院处方编号
            infoObj.put("his_detail_sn","");//his处方明细流水号
            infoObj.put("his_drug_no",wlyyPrescriptionInfoDO.getDrugNo());//院内药品编码
            infoObj.put("invoice_type","");//发票项目类别
            infoObj.put("specification_type",wlyyPrescriptionInfoDO.getSpecification());//规格型号
            infoObj.put("dosage_form",wlyyPrescriptionInfoDO.getDosage());//剂型
            infoObj.put("charge_unit","");//单位
            infoObj.put("price",wlyyPrescriptionInfoDO.getPackRetprice());//单价
            infoObj.put("amount",wlyyPrescriptionInfoDO.getQuantity());//数量
            infoObj.put("total_money",wlyyPrescriptionInfoDO.getPackRetprice()*Integer.parseInt(wlyyPrescriptionInfoDO.getQuantity()));//金额
            infoObj.put("single_dose",wlyyPrescriptionInfoDO.getDosage());//每次用量
            infoObj.put("use_frequency",wlyyPrescriptionInfoDO.getUsageName());//使用频次
            infoObj.put("medical_way","");//给药途径
            infoObj.put("prescription_date", DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime()));//处方日期
            infoObj.put("medication_days",wlyyPrescriptionInfoDO.getDays());//执行天数
            infoObj.put("his_dept_code",wlyyPrescriptionDO.getDept());//his内部科室编码
            infoObj.put("his_dept_name",wlyyPrescriptionDO.getDeptName());//his内部科室名称
            infoObj.put("limit_type","");//限制范围类别
            mxlist.add(infoObj);
        }
        data.put("mxlist",mxlist);
        String result = requestYlz(data,"N20.17.03.01","医师开方上传");
        if(result == null){

+ 15 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/healthCare/YlzMedicalPrescriptionUploadDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.hospital.healthCare;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalBillDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalPrescriptionUploadDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2021/10/4.
 */
public interface YlzMedicalPrescriptionUploadDao  extends PagingAndSortingRepository<YlzMedicalPrescriptionUploadDO, String>, JpaSpecificationExecutor<YlzMedicalPrescriptionUploadDO> {
}

+ 125 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/healthCare/YlzMedicalPrescriptionUploadDO.java

@ -0,0 +1,125 @@
package com.yihu.jw.entity.hospital.healthCare;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 处方上传记录表
 *
 * Created by yeshijie on 2021/10/4.
 */
@Entity
@Table(name = "base_ylz_medical_prescription_upload")
public class YlzMedicalPrescriptionUploadDO extends UuidIdentityEntity {
    private String icCardNo;//社保卡号
    private String hisSerial;//his挂号号
    private String orgCode;//医院编码
    private String transactionNo;//处方上传流水号
    private String insuranceSerial;//医保流水号
    private String regionCode;//参保地区划代码
    private String idcard;//证件号码
    private String name;//姓名
    private String certType;//证件类型
    private String dataSource;//数据来源
    private String outpatientId;//门诊id
    private String prescriptionId;//处方id
    public String getIcCardNo() {
        return icCardNo;
    }
    public void setIcCardNo(String icCardNo) {
        this.icCardNo = icCardNo;
    }
    public String getHisSerial() {
        return hisSerial;
    }
    public void setHisSerial(String hisSerial) {
        this.hisSerial = hisSerial;
    }
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    public String getTransactionNo() {
        return transactionNo;
    }
    public void setTransactionNo(String transactionNo) {
        this.transactionNo = transactionNo;
    }
    public String getInsuranceSerial() {
        return insuranceSerial;
    }
    public void setInsuranceSerial(String insuranceSerial) {
        this.insuranceSerial = insuranceSerial;
    }
    public String getRegionCode() {
        return regionCode;
    }
    public void setRegionCode(String regionCode) {
        this.regionCode = regionCode;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCertType() {
        return certType;
    }
    public void setCertType(String certType) {
        this.certType = certType;
    }
    public String getDataSource() {
        return dataSource;
    }
    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }
    public String getOutpatientId() {
        return outpatientId;
    }
    public void setOutpatientId(String outpatientId) {
        this.outpatientId = outpatientId;
    }
    public String getPrescriptionId() {
        return prescriptionId;
    }
    public void setPrescriptionId(String prescriptionId) {
        this.prescriptionId = prescriptionId;
    }
}