Browse Source

Merge branch 'dev' of trick9191/patient-co-management into dev

trick9191 7 năm trước cách đây
mục cha
commit
832a8970e2

+ 276 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/vo/PatientArchivesDto.java

@ -0,0 +1,276 @@
package com.yihu.wlyy.entity.patient.vo;
/**
 * Created by Trick on 2017/11/28.
 */
public class PatientArchivesDto {
    private String doctorCode; //医生code
    private String patient; //患者code
    private String sex; //性别
    private String idcard; //身份证
    private String mobile; //电话
    private String ssc; //社保号
    private String name; //名字
    private String brithday; //生日
    private String jwCountryCode; //基卫社区code
    private String nation; //民族
    private String blood; // 血型
    private String marry; //结婚
    private String adress;  //地址
    private String education; //教育水平
    private String occupation; //职业
    private String payment; //支付方式
    private String drugAllergys; //药物过敏历史,如:1,2.4
    private String drugOtherContent; //药物过敏其他内容
    private String pastHistorys; //既往史,如1,2,4
    private String pastHistoryDate; //时间,如2014-05-11,2014-12-01
    private String pastHistoryContent; //既往史其他内容
    private String geneticFlag; //有无遗传病历史0。无,1.有
    private String geneticContent;//遗传病历史内容
    private String disabilitys; //残疾,如1,2,4
    private String familyHistoryFlag;//有无0.无,1.有
    private String familyFatherHistorys;//父亲的疾病
    private String familyMotherHistorys; //母亲的疾病
    private String familyBrotherHistorys; //兄弟的疾病
    private String familyChildrenHistorys; //子女的疾病
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getBrithday() {
        return brithday;
    }
    public void setBrithday(String brithday) {
        this.brithday = brithday;
    }
    public String getJwCountryCode() {
        return jwCountryCode;
    }
    public void setJwCountryCode(String jwCountryCode) {
        this.jwCountryCode = jwCountryCode;
    }
    public String getNation() {
        return nation;
    }
    public void setNation(String nation) {
        this.nation = nation;
    }
    public String getBlood() {
        return blood;
    }
    public void setBlood(String blood) {
        this.blood = blood;
    }
    public String getMarry() {
        return marry;
    }
    public void setMarry(String marry) {
        this.marry = marry;
    }
    public String getAdress() {
        return adress;
    }
    public void setAdress(String adress) {
        this.adress = adress;
    }
    public String getEducation() {
        return education;
    }
    public void setEducation(String education) {
        this.education = education;
    }
    public String getOccupation() {
        return occupation;
    }
    public void setOccupation(String occupation) {
        this.occupation = occupation;
    }
    public String getPayment() {
        return payment;
    }
    public void setPayment(String payment) {
        this.payment = payment;
    }
    public String getDrugAllergys() {
        return drugAllergys;
    }
    public void setDrugAllergys(String drugAllergys) {
        this.drugAllergys = drugAllergys;
    }
    public String getDrugOtherContent() {
        return drugOtherContent;
    }
    public void setDrugOtherContent(String drugOtherContent) {
        this.drugOtherContent = drugOtherContent;
    }
    public String getPastHistorys() {
        return pastHistorys;
    }
    public void setPastHistorys(String pastHistorys) {
        this.pastHistorys = pastHistorys;
    }
    public String getPastHistoryDate() {
        return pastHistoryDate;
    }
    public void setPastHistoryDate(String pastHistoryDate) {
        this.pastHistoryDate = pastHistoryDate;
    }
    public String getPastHistoryContent() {
        return pastHistoryContent;
    }
    public void setPastHistoryContent(String pastHistoryContent) {
        this.pastHistoryContent = pastHistoryContent;
    }
    public String getGeneticFlag() {
        return geneticFlag;
    }
    public void setGeneticFlag(String geneticFlag) {
        this.geneticFlag = geneticFlag;
    }
    public String getGeneticContent() {
        return geneticContent;
    }
    public void setGeneticContent(String geneticContent) {
        this.geneticContent = geneticContent;
    }
    public String getDisabilitys() {
        return disabilitys;
    }
    public void setDisabilitys(String disabilitys) {
        this.disabilitys = disabilitys;
    }
    public String getFamilyHistoryFlag() {
        return familyHistoryFlag;
    }
    public void setFamilyHistoryFlag(String familyHistoryFlag) {
        this.familyHistoryFlag = familyHistoryFlag;
    }
    public String getFamilyFatherHistorys() {
        return familyFatherHistorys;
    }
    public void setFamilyFatherHistorys(String familyFatherHistorys) {
        this.familyFatherHistorys = familyFatherHistorys;
    }
    public String getFamilyMotherHistorys() {
        return familyMotherHistorys;
    }
    public void setFamilyMotherHistorys(String familyMotherHistorys) {
        this.familyMotherHistorys = familyMotherHistorys;
    }
    public String getFamilyBrotherHistorys() {
        return familyBrotherHistorys;
    }
    public void setFamilyBrotherHistorys(String familyBrotherHistorys) {
        this.familyBrotherHistorys = familyBrotherHistorys;
    }
    public String getFamilyChildrenHistorys() {
        return familyChildrenHistorys;
    }
    public void setFamilyChildrenHistorys(String familyChildrenHistorys) {
        this.familyChildrenHistorys = familyChildrenHistorys;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
}

+ 413 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -15,6 +15,7 @@ import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.SocialSecurityInfo;
import com.yihu.wlyy.entity.patient.SocialSecurityInfo;
import com.yihu.wlyy.entity.patient.invitation.PatientInvitationLog;
import com.yihu.wlyy.entity.patient.invitation.PatientInvitationLog;
import com.yihu.wlyy.entity.patient.vo.PatientArchivesDto;
import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.repository.address.CityDao;
import com.yihu.wlyy.repository.address.CityDao;
import com.yihu.wlyy.repository.address.ProvinceDao;
import com.yihu.wlyy.repository.address.ProvinceDao;
@ -35,10 +36,12 @@ import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.service.common.login.LoginLogService;
import com.yihu.wlyy.service.common.login.LoginLogService;
import com.yihu.wlyy.service.third.jw.JwArchivesService;
import com.yihu.wlyy.service.third.jw.JwArchivesService;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.util.*;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.objenesis.ObjenesisBase;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.annotation.Transactional;
@ -392,6 +395,8 @@ public class PatientInfoService extends BaseService {
        json.put("PAST_NONE","1");//  既往史--疾病--无【0不勾选 1勾选】(同一类别,新增时,默认勾选)
        json.put("PAST_NONE","1");//  既往史--疾病--无【0不勾选 1勾选】(同一类别,新增时,默认勾选)
        String doctor = doctorCode;
        String doctor = doctorCode;
        String response = jwArchivesService.saveSickArchiveRecord(com.alibaba.fastjson.JSONObject.toJSONString(json, SerializerFeature.WriteMapNullValue),doctor);
        String response = jwArchivesService.saveSickArchiveRecord(com.alibaba.fastjson.JSONObject.toJSONString(json, SerializerFeature.WriteMapNullValue),doctor);
        if("0".equals(response)){
        if("0".equals(response)){
@ -412,6 +417,318 @@ public class PatientInfoService extends BaseService {
        socialSecurityInfoDao.save(info);
        socialSecurityInfoDao.save(info);
        return 1;
        return 1;
    }
    }
    public int createProfile(String archiveJson) throws Exception{
        net.sf.json.JSONObject j  = net.sf.json.JSONObject.fromObject(archiveJson);
        PatientArchivesDto archive = (PatientArchivesDto) net.sf.json.JSONObject.toBean(j,PatientArchivesDto.class);
        Patient p = patientDao.findByCode(archive.getPatient());
        com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
        json.put("ARCHIVE_TIME", DateUtil.getStringDateShort());//建档时间
        json.put("ARCHIVE_STATUS","3");//档案状态【1.未管理 2.死亡 3.正常 4.高危】
        json.put("SICK_NAME",p.getName());//姓名
        json.put("SICK_SEX",archive.getSex());//性别【1.男 2.女 9 未知】
        json.put("BIRTHDAY",archive.getBrithday());//出生日期
        json.put("ZONE_CODE",archive.getJwCountryCode());//所属社区【ZONE_DICT】
        json.put("IDENTITY_TYPE","1");//证件类型【IDENTITY_TYPE_DICT】
        json.put("IDENTITY_CARD_NO",p.getIdcard());//身份证号
        json.put("HOME_PHONE",p.getMobile());//本人电话
        json.put("HOME_ADDRESS",archive.getAdress());//现住址
        json.put("ORG_ID","0");//新增默认传0
        json.put("RESIDENCE","1");//户籍【1.户籍 2.非户籍】
        json.put("NATIONAL",archive.getNation());//民族【NATION_DICT】
        json.put("ORIGO","350200");//户口所在地【ZONE_DICT】
        json.put("BLOOD",archive.getBlood());//血型【1.A型 2.3.O型4.AB型 5.不详】
        json.put("BLOOD_RH","1");//RH阴性【1.否 2.是 3.不详】
        json.put("MARRIAGE",archive.getMarry());//婚姻状况【10.未婚 20.已婚 30.丧偶 40.离婚 90.未说明的婚姻状况】
        //补充参数
        json.put("ALLERGIC_WITHOUT","1");//药物过敏史--无【0不勾选 1勾选】(同一类别,新增时,默认勾选)",
        json.put("TRAUMA","0");// "TRAUMA":"既往史--外伤--【0 无 1 有】(同一类别,新增时,默认选无)",
        json.put("TRANSFUSION","0");//   "TRANSFUSION":"既往史--输血--【0 无 1 有】(同一类别,新增时,默认选无)",
        json.put("EXPOSE_WITHOUT","1");//"EXPOSE_WITHOUT":"暴露史--无【0不勾选 1勾选】(同一类别,新增时,默认勾选)",
        //教育程度
        if(StringUtils.isNotBlank(archive.getEducation())){
            json.put("EDUCATION",archive.getEducation()+"");//文化程度
        }
        //职业
        if(StringUtils.isNotBlank(archive.getOccupation())){
            json.put("OCCUPATION",archive.getOccupation()+"");//职业
        }
        //支付方式
        if(StringUtils.isNotBlank(archive.getPayment())){
            json.put("MEDICAL_EXPENSES",archive.getPayment()+"");//支付方式
        }
        //药物过敏史
        if(StringUtils.isNotBlank(archive.getDrugAllergys())){
            json.put("ALLERGIC_WITHOUT","0");//药物过敏历史
            String as[] = archive.getDrugAllergys().split(",");
            for(String str : as){
                if("1".equals(str)){
                    json.put("ALLERGIC_PENICILLIN","1");//药物过敏史--青霉素
                }
                if("2".equals(str)){
                    json.put("ALLERGIC_SULFANILAMIDE","1");//药物过敏史--磺胺
                }
                if("3".equals(str)){
                    json.put("ALLERGIC_STREPTOMYCIN","1");//药物过敏史--链霉素
                }
                if("4".equals(str)){
                    json.put("ALLERGIC_OTHER","1");//药物过敏史--其它
                }
            }
        }else{
            json.put("ALLERGIC_WITHOUT","1");//药物过敏历史
        }
        //既往史
        if(StringUtils.isNotBlank(archive.getPastHistorys())){
            json.put("PAST_NONE","0");//既往史
            String phs[] = archive.getPastHistorys().split(",");
            String dates[] = archive.getPastHistoryDate().split(",");
            for(int i=0 ;i<phs.length ; i++){
                if("1".equals(phs[i])){
                    json.put("PAST_HYPERTENSION","1");//既往史--疾病--高血压【0不勾选 1勾选】
                    if(StringUtils.isNotBlank(dates[i])){
                        json.put("PAST_HYPERTENSION_DATE",dates[i]);//既往史--疾病--高血压日期
                    }
                }
                if("2".equals(phs[i])){
                    json.put("PAST_DIABETES","1");//既往史--疾病--糖尿病【0不勾选 1勾选】
                    if(StringUtils.isNotBlank(dates[i])){
                        json.put("PAST_DIABETES_DATE",dates[i]);//既往史--疾病--糖尿病日期
                    }
                }
//                if("3".equals(phs[i])){
//                    json.put("SURGERY","1");//既往史--手术--【0 无 1 有】
//                    if(StringUtils.isNotBlank(dates[i])){
//                        json.put("PAST_HYPERTENSION_DATE",dates[i]);//既往史--疾病--高血压日期
//                    }
//                }
                if("4".equals(phs[i])){
                    json.put("PAST_OTHER","1");//既往史--疾病--其它【0不勾选 1勾选】
                    if(StringUtils.isNotBlank(dates[i])){
                        json.put("PAST_OTHER_CONTENT_DATE",dates[i]);//既往史--疾病--高血压日期
                    }
                }
            }
        }else{
            json.put("PAST_NONE","1");//既往史
        }
        //遗传病史
        if(StringUtils.isNotBlank(archive.getGeneticFlag())){
            json.put("GENETIC","1");//遗传病史【0 无 1 有】
            json.put("GENETIC_DISEASENAME",archive.getGeneticContent());//疾病名称
        }else{
            json.put("GENETIC","0");//遗传病史【0 无 1 有】
        }
        //残疾
        if(StringUtils.isNotBlank(archive.getDisabilitys())){
            String ds[] = archive.getDisabilitys().split(",");
            for(String d :ds){
                if("1".equals(d)){
                    json.put("DISABILITY_WITHOUT","1");//有无残疾--无残疾【0不勾选 1勾选】
                }
                if("2".equals(d)){
                    json.put("DISABILITY_EYES","1");//有无残疾--视力残疾【0不勾选 1勾选】
                    json.put("DISABILITY_WITHOUT","0");//有无残疾--无残疾【0不勾选 1勾选】
                }
                if("3".equals(d)){
                    json.put("DISABILITY_EAR","1");//有无残疾--听力残疾【0不勾选 1勾选】
                    json.put("DISABILITY_WITHOUT","0");//有无残疾--无残疾【0不勾选 1勾选】
                }
                if("4".equals(d)){
                    json.put("DISABILITY_SPEECH","1");//有无残疾--言语残疾【0不勾选 1勾选】
                    json.put("DISABILITY_WITHOUT","0");//有无残疾--无残疾【0不勾选 1勾选】
                }
                if("5".equals(d)){
                    json.put("DISABILITY_LIMB","1");//有无残疾--肢体残疾【0不勾选 1勾选】
                    json.put("DISABILITY_WITHOUT","0");//有无残疾--无残疾【0不勾选 1勾选】
                }
                if("6".equals(d)){
                    json.put("DISABILITY_INTELLECTUAL","1");//有无残疾--智力残疾【0不勾选 1勾选】
                    json.put("DISABILITY_WITHOUT","0");//有无残疾--无残疾【0不勾选 1勾选】
                }
                if("7".equals(d)){
                    json.put("DISABILITY_OTHER","1");//有无残疾--其它残疾【0不勾选 1勾选】
                    json.put("DISABILITY_WITHOUT","0");//有无残疾--无残疾【0不勾选 1勾选】
                }
            }
        }else{
            json.put("DISABILITY_WITHOUT","1");//  "DISABILITY_WITHOUT":"有无残疾--无残疾【0不勾选 1勾选】(同一类别,新增时,默认勾选)",
        }
        //家族史
        if(StringUtils.isNotBlank(archive.getFamilyHistoryFlag())&&"1".equals(archive.getFamilyHistoryFlag())){
            //父亲
            if(StringUtils.isNotBlank(archive.getFamilyFatherHistorys())){
                json.put("FAMILY_FATHER_NONE","0");//家族史--父亲--无【0不勾选 1勾选】
                String fhs[] = archive.getFamilyFatherHistorys().split(",");
                for(String fh : fhs){
                    if("1".equals(fh)){
                        json.put("FAMILY_FATHER_HYPERTENSION","1");//家族史--父亲--高血压【0不勾选 1勾选】
                    } else if("2".equals(fh)){
                        json.put("FAMILY_FATHER_DIABETES","1");//家族史--父亲--糖尿病【0不勾选 1勾选】
                    } else if("3".equals(fh)){
                        json.put("FAMILY_FATHER_CORONARY","1");//家族史--父亲--冠心病【0不勾选 1勾选】
                    } else if("4".equals(fh)){
                        json.put("FAMILY_FATHER_ALLERGY","1");//家族史--父亲--慢性阻塞性肺疾病【0不勾选 1勾选】
                    } else if("5".equals(fh)){
                        json.put("FAMILY_FATHER_MALIGNANT","1");//家族史--父亲--恶性肿瘤【0不勾选 1勾选】
                    } else if("6".equals(fh)){
                        json.put("FAMILY_FATHER_STROKE","1");//家族史--父亲--脑卒中【0不勾选 1勾选】
                    } else if("7".equals(fh)){
                        json.put("FAMILY_FATHER_SCHIZOPHRENIA","1");//家族史--父亲--重性精神疾病【0不勾选 1勾选】
                    } else if("8".equals(fh)){
                        json.put("FAMILY_FATHER_TB","1");//家族史--父亲--结核病【0不勾选 1勾选】
                    } else if("9".equals(fh)){
                        json.put("FAMILY_FATHER_HEPATITIS","1");//家族史--父亲--肝炎【0不勾选 1勾选】
                    } else if("10".equals(fh)){
                        json.put("FAMILY_FATHER_CONGENITAL","1");//家族史--父亲--先天畸形【0不勾选 1勾选】
                    } else if("11".equals(fh)){
                        json.put("FAMILY_FATHER_OTHER","1");//家族史--父亲--其它【0不勾选 1勾选】
                    }
                }
            }else{
                json.put("FAMILY_FATHER_NONE","1");//家族史--父亲--无【0不勾选 1勾选】
            }
            //母亲
            if(StringUtils.isNotBlank(archive.getFamilyMotherHistorys())){
                json.put("FAMILY_MOTHER_NONE","0");//家族史--母亲--无【0不勾选 1勾选】
                String mhs[] = archive.getFamilyMotherHistorys().split(",");
                for(String mh : mhs){
                    if("1".equals(mh)){
                        json.put("FAMILY_MOTHER_HYPERTENSION","1");//家族史--母亲--高血压【0不勾选 1勾选】
                    } else if("2".equals(mh)){
                        json.put("FAMILY_MOTHER_DIABETES","1");//家族史--母亲--糖尿病【0不勾选 1勾选】
                    } else if("3".equals(mh)){
                        json.put("FAMILY_MOTHER_CORONARY","1");//家族史--母亲--冠心病【0不勾选 1勾选】
                    } else if("4".equals(mh)){
                        json.put("FAMILY_MOTHER_ALLERGY","1");//家族史--母亲--慢性阻塞性肺疾病【0不勾选 1勾选】
                    } else if("5".equals(mh)){
                        json.put("FAMILY_MOTHER_MALIGNANT","1");//家族史--母亲--恶性肿瘤【0不勾选 1勾选】
                    } else if("6".equals(mh)){
                        json.put("FAMILY_MOTHER_STROKE","1");//家族史--母亲--脑卒中【0不勾选 1勾选】
                    } else if("7".equals(mh)){
                        json.put("FAMILY_MOTHER_SCHIZOPHRENIA","1");//家族史--母亲--重性精神疾病【0不勾选 1勾选】
                    } else if("8".equals(mh)){
                        json.put("FAMILY_MOTHER_TB","1");//家族史--母亲--结核病【0不勾选 1勾选】
                    } else if("9".equals(mh)){
                        json.put("FAMILY_MOTHER_HEPATITIS","1");//家族史--母亲--肝炎【0不勾选 1勾选】
                    } else if("10".equals(mh)){
                        json.put("FAMILY_MOTHER_CONGENITAL","1");//家族史--母亲--先天畸形【0不勾选 1勾选】
                    } else if("11".equals(mh)){
                        json.put("FAMILY_MOTHER_OTHER","1");//家族史--母亲--其它【0不勾选 1勾选】
                    }
                }
            }else{
                json.put("FAMILY_MOTHER_NONE","1");//家族史--母亲--无【0不勾选 1勾选】
            }
            //兄妹
            if(StringUtils.isNotBlank(archive.getFamilyBrotherHistorys())){
                json.put("FAMILY_BROTHERS_NONE","0");//家族史--兄弟姐妹--无【0不勾选 1勾选】
                String bhs[] = archive.getFamilyBrotherHistorys().split(",");
                for(String bh : bhs){
                    if("1".equals(bh)){
                        json.put("FAMILY_BROTHERS_HYPERTENSION","1");//家族史--兄弟姐妹--高血压【0不勾选 1勾选】
                    } else if("2".equals(bh)){
                        json.put("AMILY_BROTHERS_DIABETES","1");//家族史--兄弟姐妹--糖尿病【0不勾选 1勾选】
                    } else if("3".equals(bh)){
                        json.put("FAMILY_BROTHERS_CORONARY","1");//家族史--兄弟姐妹--冠心病【0不勾选 1勾选】
                    } else if("4".equals(bh)){
                        json.put("FAMILY_BROTHERS_ALLERGY","1");//家族史--兄弟姐妹--慢性阻塞性肺疾病【0不勾选 1勾选】
                    } else if("5".equals(bh)){
                        json.put("FAMILY_BROTHERS_MALIGNANT","1");//家族史--兄弟姐妹--恶性肿瘤【0不勾选 1勾选】
                    } else if("6".equals(bh)){
                        json.put("FAMILY_BROTHERS_STROKE","1");//家族史--兄弟姐妹--脑卒中【0不勾选 1勾选】
                    } else if("7".equals(bh)){
                        json.put("FAMILY_BROTHERS_SCHIZOPHRENIA","1");//家族史--兄弟姐妹--重性精神疾病【0不勾选 1勾选】
                    } else if("8".equals(bh)){
                        json.put("FAMILY_BROTHERS_TB","1");//家族史--兄弟姐妹--结核病【0不勾选 1勾选】
                    } else if("9".equals(bh)){
                        json.put("FAMILY_BROTHERS_HEPATITIS","1");//家族史--兄弟姐妹--肝炎【0不勾选 1勾选】
                    } else if("10".equals(bh)){
                        json.put("FAMILY_BROTHERS_CONGENITAL","1");//家族史--兄弟姐妹--先天畸形【0不勾选 1勾选】
                    } else if("11".equals(bh)){
                        json.put("FAMILY_BROTHERS_OTHER","1");//家族史--兄弟姐妹--其它【0不勾选 1勾选】
                    }
                }
            }else{
                json.put("FAMILY_BROTHERS_NONE","1");//家族史--兄弟姐妹--无【0不勾选 1勾选】
            }
            //子女
            if(StringUtils.isNotBlank(archive.getFamilyBrotherHistorys())){
                json.put("FAMILY_CHILDREN_NONE","0");//家族史--兄弟姐妹--无【0不勾选 1勾选】
                String bhs[] = archive.getFamilyBrotherHistorys().split(",");
                for(String bh : bhs){
                    if("1".equals(bh)){
                        json.put("FAMILY_CHILDREN_HYPERTENSION","1");//家族史--子女--高血压【0不勾选 1勾选】
                    } else if("2".equals(bh)){
                        json.put("FAMILY_CHILDREN_DIABETES","1");//家族史--子女--糖尿病【0不勾选 1勾选】
                    } else if("3".equals(bh)){
                        json.put("FAMILY_CHILDREN_CORONARY","1");//家族史--子女--冠心病【0不勾选 1勾选】
                    } else if("4".equals(bh)){
                        json.put("FAMILY_CHILDREN_ALLERGY","1");//家族史--子女--慢性阻塞性肺疾病【0不勾选 1勾选】
                    } else if("5".equals(bh)){
                        json.put("FAMILY_CHILDREN_MALIGNANT","1");//家族史--子女--恶性肿瘤【0不勾选 1勾选】
                    } else if("6".equals(bh)){
                        json.put("FAMILY_CHILDREN_STROKE","1");//家族史--子女--脑卒中【0不勾选 1勾选】
                    } else if("7".equals(bh)){
                        json.put("FAMILY_CHILDREN_SCHIZOPHRENIA","1");//家族史--子女--重性精神疾病【0不勾选 1勾选】
                    } else if("8".equals(bh)){
                        json.put("FAMILY_BROTHERS_TB","1");//家族史--子女--结核病【0不勾选 1勾选】
                    } else if("9".equals(bh)){
                        json.put("FAMILY_CHILDREN_HEPATITIS","1");//家族史--子女--肝炎【0不勾选 1勾选】
                    } else if("10".equals(bh)){
                        json.put("FAMILY_CHILDREN_CONGENITAL","1");//家族史--子女--先天畸形【0不勾选 1勾选】
                    } else if("11".equals(bh)){
                        json.put("FAMILY_CHILDREN_OTHER","1");//家族史--子女--其它【0不勾选 1勾选】
                    }
                }
            }else{
                json.put("FAMILY_CHILDREN_NONE","1");//家族史--子女--无【0不勾选 1勾选】
            }
        }else{
            json.put("FAMILY_FATHER_NONE","1");// "FAMILY_FATHER_NONE":"家族史--父亲--无【0不勾选 1勾选】(同一类别,新增时,默认勾选)",
            json.put("FAMILY_MOTHER_NONE","1");// "FAMILY_MOTHER_NONE":"家族史--母亲--无【0不勾选 1勾选】(同一类别,新增时,默认勾选)",
            json.put("FAMILY_BROTHERS_NONE","1");//  "FAMILY_BROTHERS_NONE":"家族史--兄弟姐妹--无【0不勾选 1勾选】(同一类别,新增时,默认勾选)",
            json.put("FAMILY_CHILDREN_NONE","1");//  "FAMILY_CHILDREN_NONE":"家族史--子女--无【0不勾选 1勾选】(同一类别,新增时,默认勾选)",
        }
        json.put("SURGERY","0");// "SURGERY":"既往史--手术--【0 无 1 有】(同一类别,新增时,默认选无)",
        String response = jwArchivesService.saveSickArchiveRecord(com.alibaba.fastjson.JSONObject.toJSONString(json, SerializerFeature.WriteMapNullValue),archive.getDoctorCode());
        if("0".equals(response)){
            return -1;
        }
        //保存建档记录
        SocialSecurityInfo info = new SocialSecurityInfo();
        info.setXming0(p.getName());
        info.setXbie00(p.getSex()+"");
        info.setSfzh18(p.getIdcard());
        info.setId0000(p.getIdcard());
        info.setCardno(p.getSsc());
        info.setCard16(p.getSsc());
        info.setCsrqi0(archive.getBrithday().replace("-",""));
        info.setGrsfen("8");
        info.setGzztai("01");
        socialSecurityInfoDao.save(info);
        return 1;
    }
    public  List<Map<String,Object>> getNationDict(){
    public  List<Map<String,Object>> getNationDict(){
        String sql = "SELECT t.NATION_CODE,t.NATION_NAME FROM zy_nation_dict t ";
        String sql = "SELECT t.NATION_CODE,t.NATION_NAME FROM zy_nation_dict t ";
@ -521,4 +838,100 @@ public class PatientInfoService extends BaseService {
        return rs;
        return rs;
    }
    }
    public JSONObject createProfileAndSign(String archiveJson)throws Exception{
        net.sf.json.JSONObject j  = net.sf.json.JSONObject.fromObject(archiveJson);
        PatientArchivesDto archive = (PatientArchivesDto) net.sf.json.JSONObject.toBean(j,PatientArchivesDto.class);
        JSONObject rs = new  JSONObject();
        // 解密身份证号
        rsaUtils.setBaseService(patientService);
        String idcard = rsaUtils.decryptString(archive.getIdcard());
        idcard = URLDecoder.decode(idcard, "UTF-8");
        idcard = StringUtils.reverse(idcard);
        // 校验身份证号
        IdcardValidator validator = new IdcardValidator();
        if (validator.isValidatedAllIdcard(idcard)) {
            if (idcard.length() == 15) {
                idcard = validator.convertIdcarBy15bit(idcard);
                if (StringUtils.isEmpty(idcard)) {
                    rs.put("code","-1");
                    rs.put("mes","身份证格式不正确!") ;
                    return rs;
                }
            }
        } else {
            rs.put("code","-1");
            rs.put("mes","身份证格式不正确!") ;
            return rs;
        }
        if(archive.getMobile().length()!=11){
            rs.put("code","-2");
            rs.put("mes","手机格式不正确!") ;
            return rs;
        }
        String salt = UUID.randomUUID().toString().replace("-", "");
        String password = idcard.substring(idcard.length()-6,idcard.length());
        password = MD5.GetMD5Code(password + salt);
        Patient p = patientService.registerAPPBydoctor(idcard,archive.getSsc(),archive.getName(),archive.getMobile(),password,salt,salt,3);
        createProfile(archiveJson);
        rs.put("code","1");
        rs.put("mes","操作成功!") ;
        return rs;
    }
    public Map<String,Object> getArchiveComboList(){
        List<SystemDict> education =systemDictDao.findByDictName("ZY_DEGREE_EDUCATION");
        List<SystemDict> occupation =systemDictDao.findByDictName("ZY_OCCUPATION");
        List<SystemDict> payment =systemDictDao.findByDictName("ZY_PAYMENT_METHOD");
        List<SystemDict> allergy =systemDictDao.findByDictName("ZY_HISTORY_OF_DRUG_ALLERGY");
        List<SystemDict> pastHistory =systemDictDao.findByDictName("ZY_PAST_HISTORY");
        List<SystemDict> disability =systemDictDao.findByDictName("ZY_DISABILITY");
        List<SystemDict> familyHistory =systemDictDao.findByDictName("ZY_FAMILY_HISTORY");
        Map<String,Object> rs = new HashedMap();
        rs.put("education",education);
        rs.put("occupation",occupation);
        rs.put("payment",payment);
        rs.put("allergy",allergy);
        rs.put("pastHistory",pastHistory);
        rs.put("disability",disability);
        rs.put("familyHistory",familyHistory);
        return rs;
    }
    public JSONObject getPatientJWInfo(String idcard)throws Exception{
        org.json.JSONArray jsonArray = jwArchivesService.getSickArchiveRecord(idcard);
        JSONObject rs = (JSONObject) jsonArray.get(0);
        String sql ="SELECT " +
                " TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, " +
                " p.photo, " +
                " FROM " +
                " wlyy_patient p " +
                " WHERE " +
                " p.idcard = '"+idcard+"'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null&&list.size()>0){
            Map<String,Object>  s = list.get(0);
            rs.put("age",s.get("age"));
            rs.put("photo",s.get("photo"));
        }
        return rs;
    }
    public  Map<String,Object> getPatientSignFamily(String idcard){
        SignFamily f = signFamilyDao.findByIdcard(idcard);
        Map<String,Object> rs = new HashedMap();
        rs.put("SignFamily",f);
        return rs;
    }
}
}

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -724,6 +724,8 @@ public class PrescriptionExpressageService extends BaseService {
                " wlyy_prescription p " +
                " wlyy_prescription p " +
                " WHERE " +
                " WHERE " +
                " p.hospital = '"+d.getHospital()+"' " +
                " p.hospital = '"+d.getHospital()+"' " +
                " AND p.drug_delivery_operator IS NOT NULL" +
                " AND p.drug_delivery_operator <>'' " +
                " GROUP BY " +
                " GROUP BY " +
                " p.drug_delivery_operator ";
                " p.drug_delivery_operator ";
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -2286,6 +2286,7 @@ public class SignWebService extends BaseService {
        SignFamilyRenewLog log = new SignFamilyRenewLog();
        SignFamilyRenewLog log = new SignFamilyRenewLog();
        //存储新记录
        //存储新记录
        log.setRenewSignCode(renew.getCode());
        log.setRenewSignCode(renew.getCode());
        log.setSignCode(renew.getCode());
        log.setSignYear(renew.getSignYear());
        log.setSignYear(renew.getSignYear());
        log.setIdcard(renew.getIdcard());
        log.setIdcard(renew.getIdcard());
        log.setAdminTeamId(renew.getAdminTeamId());
        log.setAdminTeamId(renew.getAdminTeamId());

+ 4 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/call/CustomerService.java

@ -37,7 +37,7 @@ public class CustomerService extends BaseService{
	@Autowired
	@Autowired
	private MessageDao messageDao;
	private MessageDao messageDao;
	public List<Map<String,Object>> getCallServices(String keyword, Integer serverType,Integer state,String patientName,String ssc,String idCard,String doctorName,String code,Integer adminTeamCode ,String startDate,String endDate,Integer page,Integer size){
	public List<Map<String,Object>> getCallServices(String keyword, Integer serverType,Integer state,String patientName,String ssc,String idCard,String doctor,String doctorName,String code,Integer adminTeamCode ,String startDate,String endDate,Integer page,Integer size){
		String sql = "SELECT " +
		String sql = "SELECT " +
				" s.`code`, " +
				" s.`code`, " +
				" s.patient, " +
				" s.patient, " +
@ -76,6 +76,9 @@ public class CustomerService extends BaseService{
		if(StringUtils.isNotBlank(idCard)){
		if(StringUtils.isNotBlank(idCard)){
			sql +=" AND s.IdCard ='"+idCard+"'" ;
			sql +=" AND s.IdCard ='"+idCard+"'" ;
		}
		}
		if(StringUtils.isNotBlank(doctor)){
			sql +=" AND s.doctor ='"+doctor+"'" ;
		}
		if(StringUtils.isNotBlank(doctorName)){
		if(StringUtils.isNotBlank(doctorName)){
			sql +=" AND s.doctor_name ='"+doctorName+"'" ;
			sql +=" AND s.doctor_name ='"+doctorName+"'" ;
		}
		}

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/call/CallRecordController.java

@ -33,6 +33,7 @@ public class CallRecordController extends BaseController {
                                  @ApiParam(name="patientName",value="患者姓名")@RequestParam(required = false)String patientName,
                                  @ApiParam(name="patientName",value="患者姓名")@RequestParam(required = false)String patientName,
                                  @ApiParam(name="ssc",value="医保卡号")@RequestParam(required = false)String ssc,
                                  @ApiParam(name="ssc",value="医保卡号")@RequestParam(required = false)String ssc,
                                  @ApiParam(name="idCard",value="身份证号")@RequestParam(required = false)String idCard,
                                  @ApiParam(name="idCard",value="身份证号")@RequestParam(required = false)String idCard,
                                  @ApiParam(name="doctor",value="医生code")@RequestParam(required = false)String doctor,
                                  @ApiParam(name="doctorName",value="医生姓名")@RequestParam(required = false)String doctorName,
                                  @ApiParam(name="doctorName",value="医生姓名")@RequestParam(required = false)String doctorName,
                                  @ApiParam(name="code",value="服务编号")@RequestParam(required = false)String code,
                                  @ApiParam(name="code",value="服务编号")@RequestParam(required = false)String code,
                                  @ApiParam(name="adminTeamCode",value="签约医生团队团队")@RequestParam(required = false)Integer adminTeamCode,
                                  @ApiParam(name="adminTeamCode",value="签约医生团队团队")@RequestParam(required = false)Integer adminTeamCode,
@ -42,7 +43,7 @@ public class CallRecordController extends BaseController {
                                  @ApiParam(name="size",value="每页大小")@RequestParam(required = true)Integer size){
                                  @ApiParam(name="size",value="每页大小")@RequestParam(required = true)Integer size){
        try {
        try {
            return write(200,"保存成功","data",customerService.getCallServices(keyword, serverType,state,patientName,ssc,idCard,doctorName, code,adminTeamCode,startDate, endDate, page, size));
            return write(200,"保存成功","data",customerService.getCallServices(keyword, serverType,state,patientName,ssc,idCard,doctor,doctorName, code,adminTeamCode,startDate, endDate, page, size));
        }catch (Exception e){
        }catch (Exception e){
            error(e);
            error(e);
            return error(-1,"保存失败");
            return error(-1,"保存失败");

+ 68 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -8,7 +8,6 @@ import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.SocialSecurityInfoDao;
import com.yihu.wlyy.repository.patient.SocialSecurityInfoDao;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.message.SendMessageService;
import com.yihu.wlyy.util.IdcardValidator;
import com.yihu.wlyy.util.IdcardValidator;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.RSAUtils;
import com.yihu.wlyy.util.RSAUtils;
@ -114,6 +113,20 @@ public class PatientInfoController extends BaseController {
        }
        }
    }
    }
    @RequestMapping(value = "createProfileDetail",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("档案详情建立")
    @ObserverRequired
    public String createProfile(@ApiParam(value = "建档实体", name = "archiveJson") @RequestParam(required = true)String archiveJson ){
        try {
            // 获取医生下的患者
            return write(200, "档案建立成功!", "data", patientInfoService.createProfile(archiveJson));
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "档案建立失败!");
        }
    }
    @RequestMapping(value = "getNationDict",method = RequestMethod.GET)
    @RequestMapping(value = "getNationDict",method = RequestMethod.GET)
    @ResponseBody
    @ResponseBody
    @ApiOperation("获取民族信息列表")
    @ApiOperation("获取民族信息列表")
@ -268,6 +281,19 @@ public class PatientInfoController extends BaseController {
        }
        }
    }
    }
    @RequestMapping(value = "createProfileAndSignDeail",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("居民注册与建档详情")
    public String createProfileAndSign(@ApiParam(value = "建档实体", name = "archiveJson") @RequestParam(required = true)String archiveJson){
        try {
            // 获取医生下的患者
            return write(200, "请求成功", "data",patientInfoService.createProfileAndSign(archiveJson));
        } catch (Exception e) {
            error(e);
            return error( -1, "建档失败!");
        }
    }
    /**
    /**
     * 患者注册
     * 患者注册
     *
     *
@ -432,4 +458,45 @@ public class PatientInfoController extends BaseController {
            return error(-1, "注册失败!");
            return error(-1, "注册失败!");
        }
        }
    }
    }
    @RequestMapping(value = "getArchiveComboList", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("获取居民建档详细信息下拉列表集合")
    public String getArchiveComboList(){
        try {
            // 获取医生下的患者
            return write(200, "请求成功", "data",patientInfoService.getArchiveComboList());
        } catch (Exception e) {
            error(e);
            return error( -1, "查询失败!");
        }
    }
    @RequestMapping(value = "getPatientJWInfo", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取居民建档信息")
    public String getPatientJWInfo(@ApiParam(value = "身份证号", name = "idcard") @RequestParam(required = true)String idcard){
        try {
            // 获取医生下的患者
            return write(200, "请求成功", "data",patientInfoService.getPatientJWInfo(idcard));
        } catch (Exception e) {
            error(e);
            return error( -1, "查询失败!");
        }
    }
    @RequestMapping(value = "getPatientSignFamily", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取居民签约信息")
    public String getPatientSignFamily(@ApiParam(value = "身份证号", name = "idcard") @RequestParam(required = true)String idcard){
        try {
            // 获取医生下的患者
            return write(200, "请求成功", "data",patientInfoService.getPatientSignFamily(idcard));
        } catch (Exception e) {
            error(e);
            return error( -1, "查询失败!");
        }
    }
}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionExpressageController.java

@ -132,7 +132,7 @@ public class PrescriptionExpressageController extends WeixinBaseController {
                                   @ApiParam(name = "startDate", value = "开始时间yyyy-MM--dd") @RequestParam(required = false)String startDate,
                                   @ApiParam(name = "startDate", value = "开始时间yyyy-MM--dd") @RequestParam(required = false)String startDate,
                                   @ApiParam(name = "endDate", value = "结束时间yyyy-MM-dd") @RequestParam(required = false)String endDate,
                                   @ApiParam(name = "endDate", value = "结束时间yyyy-MM-dd") @RequestParam(required = false)String endDate,
                                   @ApiParam(name = "operator", value = "操作人") @RequestParam(required = false)String operator,
                                   @ApiParam(name = "operator", value = "操作人") @RequestParam(required = false)String operator,
                                   @ApiParam(name = "flag", value = "1.扫描2.异常出药") @RequestParam(required = false)String flag,
                                   @ApiParam(name = "flag", value = "1为异常出药,0为正常") @RequestParam(required = false)String flag,
                                   @ApiParam(name = "page", value = "页面") @RequestParam(required = true)Integer page,
                                   @ApiParam(name = "page", value = "页面") @RequestParam(required = true)Integer page,
                                   @ApiParam(name = "pageSize", value = "页面大小") @RequestParam(required = true)Integer pageSize){
                                   @ApiParam(name = "pageSize", value = "页面大小") @RequestParam(required = true)Integer pageSize){
        try {
        try {

+ 16 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java

@ -945,6 +945,22 @@ public class PatientController extends WeixinBaseController {
        }
        }
    }
    }
    @RequestMapping(value = "createProfileDetail",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("档案详情建立")
    @ObserverRequired
    public String createProfile(@ApiParam(value = "建档实体", name = "archiveJson") @RequestParam(required = true)String archiveJson ){
        try {
            // 获取医生下的患者
            return write(200, "档案建立成功!", "data", patientInfoService.createProfile(archiveJson));
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "档案建立失败!");
        }
    }
    @RequestMapping(value = "getNationDict",method = RequestMethod.GET)
    @RequestMapping(value = "getNationDict",method = RequestMethod.GET)
    @ResponseBody
    @ResponseBody
    @ApiOperation("获取民族信息列表")
    @ApiOperation("获取民族信息列表")

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java

@ -246,6 +246,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
                jo.put("dispensaryDispensaryTypeName", prescription.getDispensaryTypeName());//处方配送方式
                jo.put("dispensaryDispensaryTypeName", prescription.getDispensaryTypeName());//处方配送方式
                jo.put("prescriptionStatus", prescription.getStatus());//处方状态
                jo.put("prescriptionStatus", prescription.getStatus());//处方状态
                jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(), "",""));//处方状态名称
                jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(), "",""));//处方状态名称
                jo.put("ssc",prescription.getSsc());//医保卡号
            }
            }
            return write(200, "查询成功", "data", jo);
            return write(200, "查询成功", "data", jo);
        } catch (Exception e) {
        } catch (Exception e) {