liusheng
2024-06-12 6d51501ca93f5bf46759f851988650477cf32e6c
smartor/src/main/java/com/smartor/yiwudataanalysis/ADT_A03.java
@@ -37,7 +37,7 @@
        //患者相关 ID^^^授权机构
        CX[] pid3_patientIdentifierList = pid.getPid3_PatientIdentifierList();
        if (pid3_patientIdentifierList != null || pid3_patientIdentifierList.length > 0) {
        if (pid3_patientIdentifierList != null && pid3_patientIdentifierList.length > 0) {
            for (CX cx : pid3_patientIdentifierList) {
                //患者相关ID
                String hzxgID = cx.getID().encode();
@@ -48,7 +48,7 @@
        //门诊不填,住院必填
        CX[] pid4_alternatePatientIDPID = pid.getPid4_AlternatePatientIDPID();
        if (pid4_alternatePatientIDPID != null || pid4_alternatePatientIDPID.length > 0) {
        if (pid4_alternatePatientIDPID != null && pid4_alternatePatientIDPID.length > 0) {
            for (CX cx : pid4_alternatePatientIDPID) {
                //非婴儿 0 婴儿 1
                String s = cx.getID().encode();
@@ -313,18 +313,21 @@
        //入科日期
        DT[] pv125_contractEffectiveDate = pv1.getPv125_ContractEffectiveDate();
        DT dt = pv125_contractEffectiveDate[0];
        SimpleDateFormat inputFormattt = new SimpleDateFormat("yyyyMMdd"); // 输入日期格式
        Date date22 = null; // 解析为Date对象
        try {
            date22 = inputFormattt.parse(dt.encode());
        } catch (ParseException e) {
            e.printStackTrace();
        if (pv125_contractEffectiveDate != null && pv125_contractEffectiveDate.length > 0) {
            DT dt = pv125_contractEffectiveDate[0];
            SimpleDateFormat inputFormattt = new SimpleDateFormat("yyyyMMdd"); // 输入日期格式
            try {
                date22 = inputFormattt.parse(dt.encode());
            } catch (ParseException e) {
                e.printStackTrace();
            }
        }
        SimpleDateFormat outputFormat2 = new SimpleDateFormat("yyyy-MM-dd"); // 输出日期格式
        String rkdate = outputFormat2.format(date22);
        String rkdate = null;
        if (date22 != null) rkdate = outputFormat2.format(date22);
        //账户冻结建议
        String pv128_interestCode = pv1.getPv128_InterestCode().encode();
@@ -422,14 +425,18 @@
        //数据入库
        HospitalRecord hospitalRecord = new HospitalRecord();
        hospitalRecord.setCreateTime(new Date());
        hospitalRecord.setPatientID(patientID);
//        hospitalRecord.setPatientID(patientID);
        hospitalRecord.setPatientID(id1);
        hospitalRecord.setOpreationTime(new Date());
        //就诊号
        hospitalRecord.setOutMedNO(id1);
        //就诊类型描述(门诊、住院...)
        hospitalRecord.setAdmTypeDesc(AdmTypeEnum.getDescByCode(patientClass));
        //IMP  住院
        hospitalRecord.setAdmTypeCode("IMP");
        hospitalRecord.setAdmStatus("患者出院");
        //入院状态(就诊中、结束就诊...)
        hospitalRecord.setAdmStatus(LevelHospEnum.getDescByCode(pv136_dischargeDisposition));
        hospitalRecord.setEncOuthostype(LevelHospEnum.getDescByCode(pv136_dischargeDisposition));
        hospitalRecord.setAdmDate(dischargeDateTime);
        hospitalRecord.setEncPatName(patientName);
        if (StringUtils.isNotEmpty(xb)) {
@@ -456,7 +463,8 @@
        HospitalUserinfo hospitalUserinfo = new HospitalUserinfo();
//        hospitalUserinfo.setCreateTime(null);
        hospitalUserinfo.setPatientID(patientID);
//        hospitalUserinfo.setPatientID(patientID);
        hospitalUserinfo.setPatientID(id1);
        hospitalUserinfo.setRegDate(rkdate);
        hospitalUserinfo.setIdentityID(SSNNumberPatient);
        hospitalUserinfo.setPatName(patientName);