Browse Source

[医保代码]

wangzhinan 3 years ago
parent
commit
6dc400bfb9

+ 26 - 8
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -76,10 +76,11 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        BasePatientMemberDictDO basePatientMemberDictDO = basePatientMemberDictDao.findOne(dictId);
        BasePatientDO basePatientDO = null;
        if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            List<BasePatientDO> listpatients=basePatientDao.findByMobileAndDel(phoneNum,"1");
            /*List<BasePatientDO> listpatients=basePatientDao.findByMobileAndDel(phoneNum,"1");
            if (listpatients!=null&&listpatients.size()>0){
                basePatientDO=listpatients.get(0);
            }
            }*/
            basePatientDO= basePatientDao.findByIdcard(idCard);
        }else {
            basePatientDO= basePatientDao.findByIdcard(idCard);
        }
@ -142,7 +143,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                        mixEnvelop.setMessage("您所添加的家属的名称有误,无法添加");
                        return mixEnvelop;
                    }
                    basePatientDO.setMobile(phoneNum);
                    /*basePatientDO.setMobile(phoneNum);*/
                    familyId= jsonObject.getString("brid");
                    birth= jsonObject.getString("csny");
                    long lt = new Long(birth);
@ -305,6 +307,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        result.setPatient(patientId);
        result.setCardNo(idCard);
        result.setCardType(cardType);
        result.setMobile(phoneNum);
        //保存到base_patient表
        basePatientDO.setName(familyName);
        basePatientDO.setIdcard(idCard);
@ -407,19 +410,23 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                            if (StringUtils.isNotEmpty(jsonObject1.getString("IDCARD"))){
                                System.out.println("同步的身份证号:"+jsonObject1.getString("IDCARD"));
                                BasePatientDO patientDO = null;
                                if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                                /*if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                                    List<BasePatientDO> listpatients=basePatientDao.findByMobileAndDel(jsonObject1.getString("TEL"),"1");
                                    if (listpatients!=null&&listpatients.size()>0){
                                        patientDO=listpatients.get(0);
                                    }
                                }else {
                                    patientDO= basePatientDao.findByIdcard(jsonObject1.getString("IDCARD"));
                                }
                                }else {*/
                                patientDO= basePatientDao.findByIdcard(jsonObject1.getString("IDCARD"));
                        /*        }*/
                                if (patientDO==null){
                                    patientDO = new BasePatientDO();
                                }
                                if (StringUtils.isNotBlank(jsonObject1.getString("TEL"))){
                                    patientDO.setMobile(jsonObject1.getString("TEL"));
                                    List<BasePatientDO> listpatients=basePatientDao.findByMobileAndDel(jsonObject1.getString("TEL"),"1");
                                    if (listpatients!=null&&listpatients.size()>0){
                                    }else {
                                        patientDO.setMobile(jsonObject1.getString("TEL"));
                                    }
                                }
                                if(StringUtils.isNotBlank(jsonObject1.getString("BIRTHDAY"))){
                                    patientDO.setBirthday(DateUtil.strToDate(jsonObject1.getString("BIRTHDAY")));
@ -480,6 +487,9 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                                    wlyyPatientFamilyMemberDO.setFamilyRelationName(basePatientMemberDictDO.getRelationName());
                                    wlyyPatientFamilyMemberDO.setCardNo(jsonObject1.getString("IDCARD"));
                                    wlyyPatientFamilyMemberDO.setYktFamilyId(jsonObject1.getString("ID"));
                                    if (StringUtils.isNotBlank(jsonObject1.getString("TEL"))){
                                        wlyyPatientFamilyMemberDO.setMobile(jsonObject1.getString("TEL"));
                                    }
                                    wlyyPatientFamilyMemberDao.save(wlyyPatientFamilyMemberDO);
                                }
                                if(jsonObject1.get("MEDICALCARD")!=null){
@ -551,6 +561,10 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                    }else {
                        map.put("card","");
                    }
                    WlyyPatientFamilyMemberDO patientFamilyMemberDO = wlyyPatientFamilyMemberDao.findByIdAndDel(map.get("id").toString());
                    if (patientFamilyMemberDO!=null){
                        map.put("mobile",patientFamilyMemberDO.getMobile());
                    }
                }
            }
@ -658,6 +672,10 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                    map.put("age",age);
                }
                if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                    WlyyPatientFamilyMemberDO patientFamilyMemberDO = wlyyPatientFamilyMemberDao.findByIdAndDel(map.get("id").toString());
                    if (patientFamilyMemberDO!=null){
                        map.put("mobile",patientFamilyMemberDO.getMobile());
                    }
                    if(null!=map.get("familyMember")){
                        List<PatientMedicareCardDO> list1 = basePatientMedicareCardDao.findByPatientCode(map.get("familyMember").toString());
                        if (list1!=null&&list1.size()!=0){

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

@ -1159,7 +1159,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            throw new RuntimeException("号源已经被预约,请选择其他号源");
        }
        if (!outpatientDO.getOutpatientType().equalsIgnoreCase("3")){
            if (0==expressageDO.getOneselfPickupFlg()){
            if (1==expressageDO.getOneselfPickupFlg()){
                if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                    String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
                    expressageDO.setHospitalCode(drugCode);

+ 2 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -469,7 +469,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            expressageDO.setOutpatientId(outpatient.getId());
            prescriptionExpressageDao.save(expressageDO);
            if (0==expressageDO.getOneselfPickupFlg()){
            if (1==expressageDO.getOneselfPickupFlg()){
                if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                    String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
                    expressageDO.setHospitalCode(drugCode);
@ -630,6 +630,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            object.put("pack_unit",map.get("yfdw"));
            object.put("pack_unit_name",map.get("yfdw"));
            object.put("yfdw",map.get("yfdw"));
            object.put("yfsb",map.get("yfsb"));//药房识别 3思明6五缘
            object.put("pack_size",map.get("yfbz"));
            object.put("yfsx",map.get("yfsx"));//药房属性
            object.put("ypjl",map.get("ypjl"));//药剂量

+ 22 - 7
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -160,6 +160,8 @@ public class YkyyEntranceService {
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private DictHospitalDeptDao dictHospitalDeptDao;
    @Autowired
    private PrescriptionExpressageDao prescriptionExpressageDao;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
@ -918,7 +920,7 @@ public class YkyyEntranceService {
                    for (int i =0;i<array1.size();i++){
                        JSONObject object1 = array1.getJSONObject(i);
                        WlyyPrescriptionInfoVO prescriptionInfoVO = new WlyyPrescriptionInfoVO();
                        String sql = "SELECT ypxh as \"ypxh\",ypmc2 as \"ypmc2\" from V_ZKSG_MZ_YPXX WHERE ypxh='"+object1.getString("ypxh")+"' ";
                        String sql = "SELECT ypxh as \"ypxh\",ypmc2 as \"ypmc2\" from V_hlwyy_MZ_YPXX WHERE ypxh='"+object1.getString("ypxh")+"' ";
                        JSONObject rs4 = new JSONObject();
@ -1254,7 +1256,7 @@ public class YkyyEntranceService {
                "FROM " +
                " V_ZKSG_CFCX c, " +
                " v_hlw_mzbrzd d, " +
                " V_ZKSG_MZ_YPXX x," +
                " V_hlwyy_MZ_YPXX x," +
                " V_ZKSG_BRCX p " +
                "WHERE " +
                " c.BRID = d.BRID " +
@ -1500,7 +1502,7 @@ public class YkyyEntranceService {
                "yp.gyffmc as \"gyffmc\"," +
                "yp.pzwh as \"pzwh\","+
                "yp.yfsb as \"yfsb\""+" FROM " +
                "V_ZKSG_MZ_YPXX yp where 1=1 ";
                "V_hlwyy_MZ_YPXX yp where 1=1 ";
        if (StringUtils.isNoneBlank(ypdm)){
            sql+=" and lower(yp.ypdm) like '%"+ypdm.toLowerCase()+"%' ";
        }
@ -1989,9 +1991,18 @@ public class YkyyEntranceService {
                prescriptionVO.setInfoVOs(null);
            }
            List<WlyyPrescriptionExpressageDO> expressageDOList =prescriptionExpressageDao.findByOutpatientId(wlyyPrescriptionDO.getOutpatientId());
            String drug = "";
            if (expressageDOList!=null&&expressageDOList.size()!=0){
                WlyyPrescriptionExpressageDO expressageDO = expressageDOList.get(0);
                if (1==expressageDO.getOneselfPickupFlg()){
                    drug = expressageDO.getHospitalCode();
                }else {
                    drug = "6";
                }
            }
            List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(code,1);
            synPrecriptionHis(prescriptionVO,code);
            synPrecriptionHis(prescriptionVO,code,drug);
            //同步检查检验
            if(null!=inspectionDOS&&inspectionDOS.size()>0){
                synInspect(inspectionDOS);
@ -2687,14 +2698,18 @@ public class YkyyEntranceService {
    }
    public WlyyPrescriptionVO synPrecriptionHis(WlyyPrescriptionVO wlyyPrescriptionVO,String code) throws Exception {
    public WlyyPrescriptionVO synPrecriptionHis(WlyyPrescriptionVO wlyyPrescriptionVO,String code,String drugCode) throws Exception {
        HlwCf01DO hlwCf01DO = new HlwCf01DO();
        logger.info("开始===================");
        if (wlyyPrescriptionVO!=null&&wlyyPrescriptionVO.getInfoVOs()!=null){
            try {
                hlwCf01DO.setSPZT(0);
                hlwCf01DO.setFKZT(wlyyPrescriptionVO.getPayStatus());
                hlwCf01DO.setYFSB(3);
                if (StringUtils.isNoneBlank(drugCode)){
                    Integer yfsb = Integer.parseInt(drugCode);
                    hlwCf01DO.setYFSB(yfsb);
                }
                hlwCf01DO.setCFLX(wlyyPrescriptionVO.getType());
                hlwCf01DO.setKFRQ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
                hlwCf01DO.setZFPB(0);

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -19,13 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
    @GeneratedValue(generator = "generator")
 /*   @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)
    @Column(name = "id", unique = true, nullable = false)*/
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
//   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/family/WlyyPatientFamilyMemberDO.java

@ -41,6 +41,16 @@ public class WlyyPatientFamilyMemberDO extends UuidIdentityEntityWithOperator {
    private String yktFamilyId;
    private String clinicid;
    private String mobile;
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getClinicid() {
        return clinicid;
    }

+ 21 - 5
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -2256,7 +2256,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                        for (int i=0;i<list.size();i++){
                                            JSONObject family = list.getJSONObject(i);
                                            iliness.add(family.getString("ILLNESS"));
                                            if (family.getString("ILLNESS").equalsIgnoreCase("本人")||tel.equalsIgnoreCase(family.getString("TEL"))){
                                            if (family.getString("ILLNESS").equalsIgnoreCase("本人")&&tel.equalsIgnoreCase(family.getString("TEL"))){
                                                basePatientDO.setDel("1");
                                                basePatientDO.setName(family.getString("NAME"));
                                                basePatientDO.setCreateTime(new Date());
@ -2288,6 +2288,22 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                                basePatientDO.setEnabled(1);
                                                basePatientDO.setPatientStatus("1");
                                                basePatientDao.save(basePatientDO);
                                            }else {
                                                basePatientDO.setDel("1");
                                                basePatientDO.setName(jsonObject.getString("USERNAME"));
                                                basePatientDO.setCreateTime(new Date());
                                                basePatientDO.setUpdateTime(new Date());
                                                basePatientDO.setYktId(jsonObject.getString("ID"));
                                                basePatientDO.setUserId(userId);
                                                basePatientDO.setMobile(tel);
                                                String salt = UUID.randomUUID().toString().substring(0,5);
                                                String pw = tel.substring(tel.length()-6,tel.length());
                                                basePatientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                                                basePatientDO.setSalt(salt);
                                                basePatientDO.setLocked(0);
                                                basePatientDO.setEnabled(1);
                                                basePatientDO.setPatientStatus("1");
                                                basePatientDao.save(basePatientDO);
                                            }
                                        }
                                    }else {
@ -2305,7 +2321,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                        basePatientDO.setPatientStatus("1");
                                        basePatientDao.save(basePatientDO);
                                    }
                                    String birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO.getIdcard());
                                    /*String birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO.getIdcard());
                                    Integer age = com.yihu.jw.util.idcard.IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard());
                                    Integer sex = basePatientDO.getSex()!=null?basePatientDO.getSex():0;
                                    if (iliness!=null&&iliness.size()!=0){
@ -2314,9 +2330,9 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                        }
                                    }else {
                                        ykyyService.addFamily(basePatientDO.getUserId(),basePatientDO.getIdcard(),basePatientDO.getName(),sex+"",birdth,age+"",basePatientDO.getMobile());
                                    }
                                    }*/
                                }
                            }else {
                            }/*else {
                                BasePatientDO basePatientDO1 = basePatientDOS.get(0);
                                basePatientDO1.setUserId(userId);
                                basePatientDao.save(basePatientDO1);
@ -2348,7 +2364,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                                    }
                                }
                            }
                            }*/
                        }
                    }
                }