Prechádzať zdrojové kódy

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

yeshijie 4 rokov pred
rodič
commit
429dcde604
100 zmenil súbory, kde vykonal 18777 pridanie a 184 odobranie
  1. 28 2
      business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintService.java
  2. 10 0
      business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseDrugDictDao.java
  3. 10 0
      business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseTemplateDao.java
  4. 14 0
      business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseTemplateDictDao.java
  5. 9 0
      business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseTemplateOrgDao.java
  6. 109 0
      business/base-service/src/main/java/com/yihu/jw/dict/service/BaseDrugDictService.java
  7. 113 0
      business/base-service/src/main/java/com/yihu/jw/dict/service/TemplateManageService.java
  8. 55 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/service/WlyyHospitalSysDictService.java
  9. 6 0
      business/base-service/src/main/java/com/yihu/jw/hospital/message/dao/SystemMessageDao.java
  10. 18 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  11. 34 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/WorkTimeService.java
  12. 2 2
      business/base-service/src/main/java/com/yihu/jw/order/dao/BusinessOrderDao.java
  13. 9 6
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  14. 0 41
      business/base-service/src/main/java/com/yihu/jw/rehabilitation/SpecialistPatientRelationDao.java
  15. 8 0
      business/im-service/src/main/java/com/yihu/jw/im/dao/ConsultDao.java
  16. 27 0
      business/im-service/src/main/java/com/yihu/jw/im/dao/ConsultTeamDao.java
  17. 1 0
      business/im-service/src/main/java/com/yihu/jw/im/util/ImUtil.java
  18. 1 2
      common/common-entity/src/main/java/com/yihu/jw/entity/base/complaint/BaseComplaintDO.java
  19. 268 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseDrugDictDO.java
  20. 57 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseTemplateDO.java
  21. 40 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseTemplateDictDO.java
  22. 49 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseTemplateOrgDO.java
  23. 89 0
      common/common-entity/src/main/java/com/yihu/jw/entity/followup/BusinessMapping.java
  24. 2 1
      common/common-entity/src/main/java/com/yihu/jw/entity/followup/Followup.java
  25. 73 0
      common/common-entity/src/main/java/com/yihu/jw/entity/followup/FollowupContent.java
  26. 81 0
      common/common-entity/src/main/java/com/yihu/jw/entity/followup/FollowupMapping.java
  27. 117 0
      common/common-entity/src/main/java/com/yihu/jw/entity/followup/FollowupSign.java
  28. 0 9
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/message/SystemMessageDO.java
  29. 10 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/doctor/WlyyDoctorWorkTimeVO.java
  30. 20 1
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java
  31. 1 9
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  32. 86 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/DictDrugEndpoint.java
  33. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  34. 1 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  35. 29 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  36. 47 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  37. 5 0
      svr/svr-rehabilitation/pom.xml
  38. 71 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/DiagnosisInformationController.java
  39. 299 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/consult/ConsultController.java
  40. 124 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/consult/DoctorConsultController.java
  41. 85 4
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/doctor/DoctorRehabilitationManageController.java
  42. 43 4
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/doctor/DoctorRehabilitationPlanController.java
  43. 534 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/followUp/DoctorFollowUpController.java
  44. 80 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/followUp/DoctorPhthisisFollowupController.java
  45. 378 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/followUp/DoctorVisitDetailController.java
  46. 85 2
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/patient/PatientRehabilitationManageController.java
  47. 0 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/GuidanceMessageLogDao.java
  48. 17 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/PatientDiagnosisInformationDao.java
  49. 0 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/RehabilitationDetailAppointmentDao.java
  50. 0 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/RehabilitationOperateRecordsDao.java
  51. 7 8
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/SpecialDiseaseMessagesDao.java
  52. 42 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/consult/EvaluateDao.java
  53. 28 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/consult/EvaluateLabelDao.java
  54. 25 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/consult/EvaluateScoreDao.java
  55. 21 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/BusinessMappingDao.java
  56. 43 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowUpDao.java
  57. 26 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowUpMappingDao.java
  58. 24 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowupContentDao.java
  59. 22 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowupDrugsDao.java
  60. 15 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowupSignDao.java
  61. 324 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/es/ElasticSearchHelper.java
  62. 62 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/DiagnosisInformationService.java
  63. 4 1
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationGuidanceService.java
  64. 2 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationInfoService.java
  65. 78 47
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationManageService.java
  66. 24 26
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationPlanService.java
  67. 82 4
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/SpecialistEvaluateSevice.java
  68. 74 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/consult/ConsultService.java
  69. 799 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/consult/ConsultTeamService.java
  70. 1723 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/followUp/FollowUpService.java
  71. 103 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/followUp/FollowupDrugsService.java
  72. 218 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/followUp/PhthisisFollowupService.java
  73. 1263 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/followUp/VisitDetailService.java
  74. 0 2
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/message/RehabilitationMessageService.java
  75. 102 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/util/BusinessLogs.java
  76. 78 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/util/ClazzReflect.java
  77. 1 9
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/util/HtmlUtil.java
  78. 958 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/FollowupContentESDO.java
  79. 125 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/AssistantMsgPushLog.java
  80. 213 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/BirthDayWishesNotPushES.java
  81. 266 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/BirthDayWishesToPatientES.java
  82. 420 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/COPDDailyFollowupES.java
  83. 585 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/COPDFirstTimeQuestionnaireES.java
  84. 1006 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/FollowupSevereMentalDisorderES.java
  85. 191 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/GynecologicalInflammationDailyFollowupES.java
  86. 780 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/GynecologicalInflammationFollowupArchivesES.java
  87. 439 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/HealthEduArticleES.java
  88. 70 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/HealthEduArticleESResult.java
  89. 367 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/HealthEduArticlePatient.java
  90. 232 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/HealthEduArticlePatientDTO.java
  91. 100 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/MapDataDTO.java
  92. 1173 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/NewbornFamilyVisitRecordES.java
  93. 155 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/OldPeopleSelfcareAbilityAssessmentEs.java
  94. 2543 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/OlderPeopleHealthCheckRecordES.java
  95. 99 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PatientRemindRecordESDO.java
  96. 40 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PlatformInforPopularityDTO.java
  97. 190 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PlatformInformationLogES.java
  98. 110 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PlatformInformationPushRecordES.java
  99. 379 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PostpartumVisitRecordES.java
  100. 0 0
      svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/QuestionnaireWinningESDO.java

+ 28 - 2
business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintService.java

@ -89,6 +89,12 @@ public class BaseComplaintService {
            baseComplaintDictDO.setUpdateTime(new Date());
            baseComplaintDictDao.save(baseComplaintDictDO);
        }
        List<BaseComplaintDoctorDO> baseComplaintDoctorDOs = baseComplaintDoctorDao.findbyComplaintId(id);
        for (BaseComplaintDoctorDO baseComplaintDoctorDO:baseComplaintDoctorDOs){
            baseComplaintDoctorDO.setIsDel("0");
        }
        baseComplaintDoctorDao.save(baseComplaintDoctorDOs);
        return baseComplaintDictDO;
    }
@ -120,6 +126,26 @@ public class BaseComplaintService {
            String doctorName = "";
            BaseComplaintDoctorDO preDoctor= baseComplaintDoctorDao.findbyDoctorAndDel(doctor);
            BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
            List<BaseDoctorRoleDO> baseDoctorRoleDOs = baseDoctorRoleDao.findByDoctorCode(doctor);
            if (baseDoctorRoleDOs==null||baseDoctorRoleDOs.size()==0){
                BaseDoctorRoleDO baseDoctorRoleDO = new BaseDoctorRoleDO();
                baseDoctorRoleDO.setDoctorCode(doctor);
                baseDoctorRoleDO.setRoleCode("specialist");
                baseDoctorRoleDao.save(baseDoctorRoleDO);
            }else if (baseDoctorRoleDOs!=null){
                Boolean addRoleFlag=true;//是否为对应医生添加专科医生角色表示 true即为添加
                for (BaseDoctorRoleDO baseDoctorRoleDO :baseDoctorRoleDOs){
                    if (baseDoctorRoleDO.getRoleCode().equalsIgnoreCase("specialist")){
                        addRoleFlag=false;
                    }
                }
                if(addRoleFlag){
                    BaseDoctorRoleDO baseDoctorRoleDO = new BaseDoctorRoleDO();
                    baseDoctorRoleDO.setDoctorCode(doctor);
                    baseDoctorRoleDO.setRoleCode("specialist");
                    baseDoctorRoleDao.save(baseDoctorRoleDO);
                }
            }
            if (null != baseDoctorDO) {
                doctorName = baseDoctorDO.getName();
            }
@ -390,7 +416,7 @@ public class BaseComplaintService {
                " t.feed_back as \"feedBack\"," +
                " t.feed_img as \"feedImg\"," +
                " t.acceptor as \"acceptor\"," +
                " b.mobile as \"mobile\"," +
                " t.mobile as \"mobile\"," +
                " t.acceptor_name as \"acceptorName\"" +
                "from base_complaint t " +
                " left join base_patient b on t.patient=b.id" +
@ -524,7 +550,7 @@ public class BaseComplaintService {
                " t.feed_back as \"feedBack\"," +
                " t.feed_img as \"feedImg\"," +
                " t.acceptor as \"acceptor\"," +
                " b.mobile as \"mobile\"," +
                " t.mobile as \"mobile\"," +
                " t.acceptor_name as \"acceptorName\"" +
                " from base_complaint t " +
                " left join base_patient b on t.patient=b.id" +

+ 10 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseDrugDictDao.java

@ -0,0 +1,10 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.base.dict.BaseDrugDictDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseDrugDictDao  extends PagingAndSortingRepository<BaseDrugDictDO, String>, JpaSpecificationExecutor<BaseDrugDictDO> {
}

+ 10 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseTemplateDao.java

@ -0,0 +1,10 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.base.dict.BaseTemplateDO;
import com.yihu.jw.entity.base.dict.BaseTemplateDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseTemplateDao extends PagingAndSortingRepository<BaseTemplateDO, String>, JpaSpecificationExecutor<BaseTemplateDO> {
}

+ 14 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseTemplateDictDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.base.dict.BaseTemplateDictDO;
import com.yihu.jw.entity.base.dict.BaseTemplateOrgDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseTemplateDictDao extends PagingAndSortingRepository<BaseTemplateDictDO, String>, JpaSpecificationExecutor<BaseTemplateDictDO> {
    @Query("select  count(1) from BaseTemplateDictDO t where t.isDel = '1' and t.templateId=?1")
    Integer getCountByTemplateId(String templateId);
    BaseTemplateDictDO findByDictIdAndTemplateId(String dictId,String templateId);
}

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseTemplateOrgDao.java

@ -0,0 +1,9 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.base.dict.BaseDrugDictDO;
import com.yihu.jw.entity.base.dict.BaseTemplateOrgDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseTemplateOrgDao extends PagingAndSortingRepository<BaseTemplateOrgDO, String>, JpaSpecificationExecutor<BaseTemplateOrgDO> {
}

+ 109 - 0
business/base-service/src/main/java/com/yihu/jw/dict/service/BaseDrugDictService.java

@ -0,0 +1,109 @@
package com.yihu.jw.dict.service;
import com.sun.jndi.toolkit.dir.SearchFilter;
import com.yihu.jw.dict.dao.BaseDrugDictDao;
import com.yihu.jw.entity.base.dict.BaseDrugDictDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.prescription.BaseNationalDrugDictDO;
import com.yihu.jw.hospital.prescription.dao.BaseNationalDrugDictDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.common.ConvertToSpellUtils;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.yihu.jw.util.common.BeanUtils.getNullPropertyNames;
@Service
public class BaseDrugDictService extends BaseJpaService<BaseDrugDictDO, BaseDrugDictDao> {
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private BaseDrugDictDao baseDrugDictDao;
    public BaseDrugDictDO saveNationalDrug(BaseDrugDictDO nationalDrugDictDO) {
        //判断新增或编辑
        if (nationalDrugDictDO.getId() == null) {
            nationalDrugDictDO.setCreate_time(new Date());
            nationalDrugDictDO.setUpdate_time(new Date());
            return baseDrugDictDao.save(nationalDrugDictDO);
        }else {
            BaseDrugDictDO oldDurgDictDO =  baseDrugDictDao.findOne(nationalDrugDictDO.getId());
            BeanUtils.copyProperties(nationalDrugDictDO, oldDurgDictDO, getNullPropertyNames(nationalDrugDictDO));
            oldDurgDictDO.setUpdate_time(new Date());
            return baseDrugDictDao.save(oldDurgDictDO);
        }
    }
    public MixEnvelop  findDrugDict(String name,String status,Integer page,Integer pageSize){
        String sql = "select t.id as \"id\"," +
                " t.charge_code as \"charge_code\"," +
                " t.drugname as \"drugname\"," +
                " t.specification as \"specification\"," +
                " t.py_code as \"py_code\"," +
                " t.supply_code as \"supply_code\"," +
                " t.supply_name as \"supply_name\"," +
                " t.retprice as \"retprice\"," +
                " t.manu_name as \"manu_name\"," +
                " t.weigh_unit as \"weigh_unit\"," +
                " t.mini_unit_name as \"mini_unit_name\"," +
                " t.pack_unit_name as \"pack_unit_name\"," +
                " t.weigh_unit_name as \"weigh_unit_name\"," +
                " t.vol_unit_name as \"vol_unit_name\"," +
                " t.win_no as \"win_no\"," +
                " t.pack_retprice as \"pack_retprice\"," +
                " t.mini_unit as \"mini_unit\"," +
                " t.pack_size as \"pack_size\"," +
                " t.action as \"action\"," +
                " t.serial as \"serial\"," +
                " t.group_no as \"group_no\"," +
                " t.stock_amount as \"stock_amount\"," +
                " t.visible_flag as \"visible_flag\"," +
                " t.drug_flag as \"drug_flag\"," +
                " t.create_time as \"create_time\"," +
                " t.update_time as \"update_time\"," +
                " t.status as \"status\"," +
                " t.is_del as \"is_del\"" +
                " from base_drug_dict t " +
                " where t.is_del='1' ";
        String sqlCount = "select count(1) as \"count\" from base_drug_dict t where t.is_del='1' ";
        if (StringUtils.isNoneBlank(name)){
            sql+=" and t.drugname like '%"+name+"%'";
            sqlCount+=" and t.drugname like '%"+name+"%'";
        }
        if (StringUtils.isNoneBlank(status)){
            sql+=" and t.status = '"+status+"'";
            sqlCount+=" and t.status = '"+status+"'";
        }
        List<Map<String,Object>> coutList=hibenateUtils.createSQLQuery(sqlCount);
        Integer count=0 ;
        if (coutList!=null&&coutList.size()>0){
            count=Integer.valueOf(coutList.get(0).get("count").toString());
        }
        List<Map<String,Object>> list=hibenateUtils.createSQLQuery(sql,page,pageSize);
        MixEnvelop mixEnvelop = new MixEnvelop();
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setTotalCount(count);
        return mixEnvelop;
    }
    public BaseDrugDictDO findOneDrug(String id){
        return baseDrugDictDao.findOne(id);
    }
}

+ 113 - 0
business/base-service/src/main/java/com/yihu/jw/dict/service/TemplateManageService.java

@ -0,0 +1,113 @@
package com.yihu.jw.dict.service;
import com.yihu.jw.dict.dao.BaseDrugDictDao;
import com.yihu.jw.dict.dao.BaseTemplateDao;
import com.yihu.jw.dict.dao.BaseTemplateDictDao;
import com.yihu.jw.dict.dao.BaseTemplateOrgDao;
import com.yihu.jw.entity.base.dict.BaseTemplateDO;
import com.yihu.jw.entity.base.dict.BaseTemplateDictDO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import jdk.nashorn.internal.ir.IfNode;
import jdk.nashorn.internal.runtime.ListAdapter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class TemplateManageService {
    @Autowired
    private BaseDrugDictDao baseDrugDictDao;
    @Autowired
    private BaseTemplateDao baseTemplateDao;
    @Autowired
    private BaseTemplateDictDao baseTemplateDictDao;
    @Autowired
    private BaseTemplateOrgDao baseTemplateOrgDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    public MixEnvelop findTempalte(String templateType,Integer page ,Integer pageSize){
        String sql =" select t.id as \"id\" ," +
                " t.name as \"name\"," +
                " t.code as \"code\"," +
                " t.children_count as \"childrenCount\"," +
                " t.update_user as \"updateUser\"," +
                " t.update_user_name as \"updateUserName\"," +
                " t.update_time as \"updateTime\"," +
                " t.template_type as \"templateType\"," +
                " t.is_del as \"isDel\" " +
                " from base_template t " +
                " where t.is_del='1' ";
        String sqlCount=" select count(1) as \"count\" from base_template t where t.is_del='1'";
        if (StringUtils.isNotBlank(templateType)){
            sql+= " and t.template_type='"+templateType+"'";
            sqlCount+= " and t.template_type='"+templateType+"'";
        }
        sql+=" order by t.update_time desc";
        Integer count=0;
        List<Map<String,Object>> countList=hibenateUtils.createSQLQuery(sql);
        if (countList!=null&&countList.size()>0){
            count = Integer.parseInt(countList.get(0).get("count").toString());
        }
        List<Map<String,Object>> list=hibenateUtils.createSQLQuery(sql,page,pageSize);
        MixEnvelop mixEnvelop = new MixEnvelop();
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setTotalCount(count);
        return mixEnvelop;
    }
   public void addOrRemoveChildrenDict(String templateId,String dictId,String isDel){
       BaseTemplateDictDO baseTemplateDictDO = baseTemplateDictDao.findByDictIdAndTemplateId(dictId,templateId);
       if ("1".equalsIgnoreCase(isDel)){
           if (baseTemplateDictDO!=null){
               baseTemplateDictDO.setIsDel("1");
           }else {
               baseTemplateDictDO = new BaseTemplateDictDO();
               baseTemplateDictDO.setTemplateId(templateId);
               baseTemplateDictDO.setDictId(dictId);
               baseTemplateDictDO.setCreateTime(new Date());
               baseTemplateDictDO.setIsDel("1");
           }
       }else {
           if (baseTemplateDictDO!=null){
               baseTemplateDictDO.setIsDel("0");
           }
       }
       baseTemplateDictDao.save(baseTemplateDictDO);
       BaseTemplateDO baseTemplateDO = baseTemplateDao.findOne(templateId);
       Integer chuildrenCount =  baseTemplateDictDao.getCountByTemplateId(templateId);
       if (baseTemplateDO !=null ){
           baseTemplateDO.setChildrenCount(chuildrenCount.toString());
       }
       baseTemplateDao.save(baseTemplateDO);
   }
   public void saveOrUpdateTemplate(String templateId,String code,String name,String user,String userName,String templateType){
       BaseTemplateDO baseTemplateDO = baseTemplateDao.findOne(templateId);
       if (baseTemplateDO!=null){
           baseTemplateDO.setCode(code);
           baseTemplateDO.setName(name);
           baseTemplateDO.setUpdateTime(new Date());
           baseTemplateDO.setUpdateUser(user);
           baseTemplateDO.setUpdateUserName(userName);
           baseTemplateDO.setTemplateType(templateType);
       }else {
           baseTemplateDO = new BaseTemplateDO();
           baseTemplateDO.setCode(code);
           baseTemplateDO.setName(name);
           baseTemplateDO.setCreateTime(new Date());
           baseTemplateDO.setCreateUser(user);
           baseTemplateDO.setCreateUserName(userName);
           baseTemplateDO.setTemplateType(templateType);
           baseTemplateDO.setIsDel("1");
       }
       baseTemplateDao.save(baseTemplateDO);
   }
}

+ 55 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/dict/service/WlyyHospitalSysDictService.java

@ -21,6 +21,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.eval.MissingArgEval;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
@ -40,6 +41,8 @@ public class WlyyHospitalSysDictService extends BaseJpaService<WlyyHospitalSysDi
    private BaseDoctorDao baseDoctorDao;
    @Value("${wechat.id}")
    private String wechatId;
    @Autowired
    private StringRedisTemplate redisTemplate;
    //查字典
    public MixEnvelop findDictsByNameCode(String modelName,String name,String code,String value,Integer page ,Integer pageSize){
        String  sql = "select t.id as \"id\"," +
@ -401,4 +404,56 @@ public class WlyyHospitalSysDictService extends BaseJpaService<WlyyHospitalSysDi
        return mixEnvelop;
    }
    /**
     * 字典转译
     *
     * @param dictName
     * @param code
     * @return
     */
    public String getDictValue(String dictName, String code) {
        String re = "";
        /*try {
            if (!StringUtils.isEmpty(code)) {
                //判断该字典redis是否存在
                String exit = redisTemplate.opsForValue().get("systemDict:" + dictName);
                if (!StringUtils.isEmpty(exit)) {
                    re = redisTemplate.opsForValue().get("systemDict:" + dictName + ":" + code);
                    if(StringUtils.isEmpty(re)){
                        WlyyHospitalSysDictDO wlyyHospitalSysDictDO= wlyyHospitalSysDictDao.findOneByDictNameAndDictCode(dictName,code);
                        if (wlyyHospitalSysDictDO!=null){
                            re =wlyyHospitalSysDictDO.getDictValue();
                        }
//                        if (!StringUtils.isEmpty(re)) {
//                            redisTemplate.opsForValue().set("systemDict:" + dictName + ":" + code, re);
//                        }
                    }
                } else {
                    List<WlyyHospitalSysDictDO> list = wlyyHospitalSysDictDao.findByDictName(dictName);
                    if (list != null && list.size() > 0) {
                        redisTemplate.opsForValue().set("systemDict:" + dictName, "1");
                        for (WlyyHospitalSysDictDO item : list) {
                            redisTemplate.opsForValue().set("systemDict:" + dictName + ":" + item.getDictCode(), item.getDictValue());
                            if (code.equals(item.getDictCode())) {
                                re = item.getDictValue();
                            }
                        }
                    }
                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }*/
        if (StringUtils.isNoneBlank(code)){
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO= wlyyHospitalSysDictDao.findOneByDictNameAndDictCode(dictName,code);
            if (wlyyHospitalSysDictDO!=null){
                re =wlyyHospitalSysDictDO.getDictValue();
                System.out.println("re"+re);
            }
        }
        return re;
    }
}

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/message/dao/SystemMessageDao.java

@ -8,6 +8,7 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
@ -47,5 +48,10 @@ public interface SystemMessageDao extends PagingAndSortingRepository<SystemMessa
    Integer setSpecialistReadById(String id);
    @Query("update SystemMessageDO a set a.isRead = 0,a.over = '0' where a.receiver = ?1 and a.type = ?2 and (a.createTime > ?3 and a.createTime< ?4)")
    @Modifying
    void setMessageOverByType(String doctor, Integer type, Date start, Date end);
}

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

@ -1815,6 +1815,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    if (timeVOs != null && timeVOs.size() > 0) {
                        for (WlyyDoctorWorkTimeVO timeVO : timeVOs) {
                            timeVO.setCount(findWorkTimeInfoCout(timeVO.getId()));
                            try {
                                timeVO.setWeekday(getDayForWeek(DateUtil.dateToStr(timeVO.getStartTime(),"yyyy-MM-dd")));
                            }catch (Exception e){
                                e.printStackTrace();
                            }
                        }
                    }
                }
@ -1823,7 +1828,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return null;
    }
    public Integer getDayForWeek(String pTime) throws Exception {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Calendar c = Calendar.getInstance();
        c.setTime(format.parse(pTime));
        Integer dayForWeek = 0;
        if (c.get(Calendar.DAY_OF_WEEK) == 1) {
            dayForWeek = 7;
        } else {
            dayForWeek = c.get(Calendar.DAY_OF_WEEK) - 1;
        }
        return dayForWeek;
    }
    /**
     * 查询医生列表带月份排班状态
     *
@ -6670,7 +6686,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                rs.put("flag","0");
            }
        }else {
            rs.put("flag","0");
            rs.put("flag","1");
        }
        rs.put("id", patient);
        rs.put("name", basePatientDO.getName());

+ 34 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/WorkTimeService.java

@ -17,6 +17,7 @@ import com.yihu.jw.hospital.doctor.dao.DoctorWorkTimeDao;
import com.yihu.jw.hospital.prescription.dao.WlyyHospitalWorkRuleDao;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
@ -412,5 +413,38 @@ public class WorkTimeService {
//
//        System.out.println(monthDay);
//    }
    public String  findChargeTypeByDoctor(String doctor,String chargeType){
        JSONObject jsonObject = new JSONObject();
        String sqlCharge = "SELECT\n" +
                "\tt.id as \"id\",\n" +
                "\tt.name as \"name\",\n" +
                "\tt.idcard as \"idcard\",\n" +
                "\tm.req_fee as \"twfzFee\",\n" +
                "\ta.req_fee as \"spfzFee\",\n" +
                "\tb.req_fee as \"spzxFee\",\n" +
                "\tv.req_fee as \"twzxFee\",\n" +
                "\tg.req_fee as \"jyzxFee\",\n" +
                "\td.req_fee as \"xtzxFee\"\n" +
                "FROM\n" +
                "\tbase_doctor t\n" +
                "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" +
                "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" +
                "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" +
                "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" +
                "LEFT JOIN wlyy_charge_dict d ON t.twzx_charge_type = d.charge_type and d.is_del='1'\n" +
                " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" +
                "WHERE t.id = '"+doctor+"' ";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sqlCharge);
        String chargeFee="";
       if (list!=null&&list.size()>0){
           Map<String,Object> map = list.get(0);
           if (StringUtils.isNoneBlank(chargeType)){
               System.out.println("=="+map.get("spfzFee"));
               chargeFee= map.get(chargeType)==null?"":map.get(chargeType).toString();
           }
       }
        return chargeFee;
    }
}

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/order/dao/BusinessOrderDao.java

@ -35,6 +35,6 @@ public interface BusinessOrderDao extends PagingAndSortingRepository<BusinessOrd
    @Query("from BusinessOrderDO w where w.patient = ?1 and w.status=?2  and w.orderCategory =?3")
    List<BusinessOrderDO> selectByPatientAndStatusAndOrderCategory(String patient,Integer status,String orderCategory);
    @Query("from BusinessOrderDO  w where w.status=0 and w.lastPayTime<=?1")
    List<BusinessOrderDO> selectByLastPayTime(Long lastPayTime);
   /* @Query("from BusinessOrderDO  w where w.status=0 and w.lastPayTime<=?1")
    List<BusinessOrderDO> selectByLastPayTime(Long lastPayTime);*/
}

+ 9 - 6
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -645,13 +645,13 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
    }
    public PageEnvelop pageByCondition(String name, Integer archiveType, Integer archiveStatus,int page,int size){
        List<BasePatientVO> list = new ArrayList<>();
        List<Map<String ,Object>> list = new ArrayList<>();
        if (page>0){
            page--;
        }else{
            page=0;
        }
        String sqlCount = "select count(*) from base_patient where 1=1 ";
        String sqlCount = "select count(*) as \"total\" from base_patient where 1=1 ";
        String sql = "select * from base_patient where 1=1 ";
        String sqlCondition = "";
        if (StringUtils.isNotBlank(name)){
@ -663,10 +663,13 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
        if (archiveStatus!=null){
            sqlCondition += " and archive_status ="+archiveStatus;
        }
        Long count = jdbcTemplate.queryForObject(sqlCount+sqlCondition,Long.class);
        sqlCondition +=" limit "+page*size+","+size;
        list = jdbcTemplate.query(sql+sqlCondition,new BeanPropertyRowMapper<>(BasePatientVO.class));
        return PageEnvelop.getSuccessListWithPage("success",list,page,size,count);
        List<Map<String ,Object>> count = hibenateUtils.createSQLQuery(sqlCount+sqlCondition);
        Long cou=0l;
        if (count!=null&&count.size()>0){
            cou= Long.valueOf(count.get(0).get("total").toString());
        }
        list = hibenateUtils.createSQLQuery(sql+sqlCondition,page,size);
        return PageEnvelop.getSuccessListWithPage("success",list,page,size,cou);
    }

+ 0 - 41
business/base-service/src/main/java/com/yihu/jw/rehabilitation/SpecialistPatientRelationDao.java

@ -1,41 +0,0 @@
package com.yihu.jw.rehabilitation;
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2018/4/25.
 */
public interface SpecialistPatientRelationDao extends PagingAndSortingRepository<SpecialistPatientRelationDO, String>,
        JpaSpecificationExecutor<SpecialistPatientRelationDO> {
    public List<SpecialistPatientRelationDO> findByDoctorAndStatus(String doctor, String status);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient =?2  and p.status>=0 and p.signStatus=1")
    public SpecialistPatientRelationDO findByDoctorAndPatient(String doctor, String patient);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and (p.patient=?2 or p.healthAssistant=?2) and p.signStatus='1' and p.status>=0 ")
    SpecialistPatientRelationDO findByPatientAndDoctor(String doctor, String patient);
    List<SpecialistPatientRelationDO> findAllBySignStatus(String signStatus);
    @Modifying
    @Query("update SpecialistPatientRelationDO p set p.doctor = ?2, p.doctorName=?3 where p.patient=?1 and p.signStatus='1' and p.status>=0 ")
    void updateSpecialistByPatient(String patient, String doctor, String doctorName);
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient =?2 and p.status>=0 and p.signStatus=1")
    public SpecialistPatientRelationDO findByTeamCodeAndPatient(Integer teamCode, String patient);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient =?2 and p.teamCode =?3 and p.status>=0 and p.signStatus=1")
    public SpecialistPatientRelationDO findByDoctorAndPatientAndTeamCode(String doctor, String patient, Integer teamCode);
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient=?2 and p.doctor=?3 and p.status>=0 and p.status >=0 and p.signStatus=1")
    List<SpecialistPatientRelationDO> findListByTeamCodeAndPatientAndDoctor(Integer teamCode, String patient, String doctor);
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient=?2 and p.status>=0 and p.status >=0 and p.signStatus=1")
    List<SpecialistPatientRelationDO> findListByTeamAndPatient(Integer teamCode, String patient);
}

+ 8 - 0
business/im-service/src/main/java/com/yihu/jw/im/dao/ConsultDao.java

@ -1,6 +1,8 @@
package com.yihu.jw.im.dao;
import com.yihu.jw.entity.base.im.ConsultDo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -32,4 +34,10 @@ public interface ConsultDao extends PagingAndSortingRepository<ConsultDo, String
	ConsultDo queryByRelationCode(String relationCode);
	ConsultDo queryByIdAndType(String id,Integer type);
	/*@Query(value = "select a.id,a.type,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relation_code from wlyy_consult a,wlyy_consult_team b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type=?3 and a.symptoms like ?2 order by a.czrq desc",nativeQuery = true)
	Page<Object> findByPatientAndType(String patient, String title, Integer type, Pageable pageRequest);
	@Query(value = "select a.id,a.type,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relation_code  from wlyy_consult a,wlyy_consult_team b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type=?2 order by a.czrq desc",nativeQuery = true)
	Page<Object> findByPatientAndType(String patient,Integer type, Pageable pageRequest);*/
}

+ 27 - 0
business/im-service/src/main/java/com/yihu/jw/im/dao/ConsultTeamDao.java

@ -2,6 +2,8 @@ package com.yihu.jw.im.dao;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import org.hibernate.validator.constraints.LuhnCheck;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
@ -32,4 +34,29 @@ public interface ConsultTeamDao  extends PagingAndSortingRepository<ConsultTeamD
	ConsultTeamDo queryByRelationCode(String relationCode);
	List<ConsultTeamDo> findByTypeAndDel(Integer type,String del);
	// 患者咨询列表(未结束)
	@Query("select a from ConsultTeamDo a where a.patient = ?1 and a.status=0 and a.del = '1'")
	Page<ConsultTeamDo> findNotFinishedBypatient(String patient, Pageable pageRequest);
	@Query("select a from ConsultTeamDo a where a.patient = ?1 and a.id = ?2 and a.status=0 and a.del = '1' and a.type<>8")
	Page<ConsultTeamDo> findNotFinishedBypatient(String patient, String  id, Pageable pageRequest);
	// 患者咨询列表(已结束)
	@Query("select a from ConsultTeamDo a where a.patient=?1 and a.status=1 and a.del = '1' and a.type<>8")
	Page<ConsultTeamDo> findFinishedBypatient(String patient, Pageable pageRequest);
	@Query("select a from ConsultTeamDo a where a.patient=?1 and a.id = ?2 and a.status=1 and a.del = '1' and a.type<>8")
	Page<ConsultTeamDo> findFinishedBypatient(String patient, String id, Pageable pageRequest);
	// 患者咨询列表(已取消)
	@Query("select a from ConsultTeamDo a where a.patient=?1 and a.status=-1 and a.del = '1' and a.type<>8")
	Page<ConsultTeamDo> findCancelBypatient(String patient, Pageable pageRequest);
	@Query("select a from ConsultTeamDo a where a.patient=?1 and a.id =?2 and a.status=-1 and a.del = '1' and a.type<>8")
	Page<ConsultTeamDo> findCancelBypatient(String patient, String id, Pageable pageRequest);
	// 取消三师咨询
	@Modifying
	@Query("update ConsultTeamDo a set a.status = -1 where a.consult = ?1 and a.status <> 1")
	int cancel(String consult);
}

+ 1 - 0
business/im-service/src/main/java/com/yihu/jw/im/util/ImUtil.java

@ -754,6 +754,7 @@ public class ImUtil {
	public static final String SESSION_TYPE_GROUP = "3";
	public static final String SESSION_TYPE_SYSTEM = "0";
	public static final String SESSION_TYPE_PRESCRIPTION = "8";//续方
	public static final String SESSION_TYPE_KANGFU = "18";//续方
	public static final String SESSION_TYPE_EXAMINATION = "9";//在线复诊-图文
	public static final String SESSION_TYPE_ONDOOR_NURSING = "11";//上门护理
	public static final String SESSION_TYPE_COLLABORATION_HOSPITAL = "12";///互联网医院协同门诊

+ 1 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/complaint/BaseComplaintDO.java

@ -30,7 +30,6 @@ public class BaseComplaintDO  extends UuidIdentityEntity {
    private String imgUrl;
    private String isDel;
    private String status;
    @Transient
    private String mobile;
    private String visitTypeName;
    @Transient
@ -42,7 +41,7 @@ public class BaseComplaintDO  extends UuidIdentityEntity {
        this.visitTypeName = visitTypeName;
    }
    @Transient
    @Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }

+ 268 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseDrugDictDO.java

@ -0,0 +1,268 @@
package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_drug_dict")
public class BaseDrugDictDO extends UuidIdentityEntity {
    private String charge_code;
    private String drugname;
    private String specification;
    private String py_code;
    private String supply_code;
    private String supply_name;
    private String retprice;
    private String manu_name;
    private String weigh_unit;
    private String mini_unit_name;
    private String pack_unit_name;
    private String weigh_unit_name;
    private String vol_unit_name;
    private String win_no;
    private String pack_retprice;
    private String jbyw;
    private String mini_unit;
    private String pack_size;
    private String action;
    private String serial;
    private String group_no;
    private String stock_amount;
    private String visible_flag;
    private String drug_flag;
    private Date create_time;
    private String status;
    private Date update_time;
    private String is_del;
    @Column(name = "is_del")
    public String getIs_del() {
        return is_del;
    }
    public void setIs_del(String is_del) {
        this.is_del = is_del;
    }
    @Column(name = "update_time")
    public Date getUpdate_time() {
        return update_time;
    }
    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }
    @Column(name = "charge_code")
    public String getCharge_code() {
        return charge_code;
    }
    public void setCharge_code(String charge_code) {
        this.charge_code = charge_code;
    }
    @Column(name = "drugname")
    public String getDrugname() {
        return drugname;
    }
    public void setDrugname(String drugname) {
        this.drugname = drugname;
    }
    @Column(name = "specification")
    public String getSpecification() {
        return specification;
    }
    public void setSpecification(String specification) {
        this.specification = specification;
    }
    @Column(name = "py_code")
    public String getPy_code() {
        return py_code;
    }
    public void setPy_code(String py_code) {
        this.py_code = py_code;
    }
    @Column(name = "supply_code")
    public String getSupply_code() {
        return supply_code;
    }
    public void setSupply_code(String supply_code) {
        this.supply_code = supply_code;
    }
    @Column(name = "supply_name")
    public String getSupply_name() {
        return supply_name;
    }
    public void setSupply_name(String supply_name) {
        this.supply_name = supply_name;
    }
    @Column(name = "retprice")
    public String getRetprice() {
        return retprice;
    }
    public void setRetprice(String retprice) {
        this.retprice = retprice;
    }
    @Column(name = "manu_name")
    public String getManu_name() {
        return manu_name;
    }
    public void setManu_name(String manu_name) {
        this.manu_name = manu_name;
    }
    @Column(name = "weigh_unit")
    public String getWeigh_unit() {
        return weigh_unit;
    }
    public void setWeigh_unit(String weigh_unit) {
        this.weigh_unit = weigh_unit;
    }
    @Column(name = "mini_unit_name")
    public String getMini_unit_name() {
        return mini_unit_name;
    }
    public void setMini_unit_name(String mini_unit_name) {
        this.mini_unit_name = mini_unit_name;
    }
    @Column(name = "pack_unit_name")
    public String getPack_unit_name() {
        return pack_unit_name;
    }
    public void setPack_unit_name(String pack_unit_name) {
        this.pack_unit_name = pack_unit_name;
    }
    @Column(name = "weigh_unit_name")
    public String getWeigh_unit_name() {
        return weigh_unit_name;
    }
    public void setWeigh_unit_name(String weigh_unit_name) {
        this.weigh_unit_name = weigh_unit_name;
    }
    @Column(name = "vol_unit_name")
    public String getVol_unit_name() {
        return vol_unit_name;
    }
    public void setVol_unit_name(String vol_unit_name) {
        this.vol_unit_name = vol_unit_name;
    }
    @Column(name = "win_no")
    public String getWin_no() {
        return win_no;
    }
    public void setWin_no(String win_no) {
        this.win_no = win_no;
    }
    @Column(name = "pack_retprice")
    public String getPack_retprice() {
        return pack_retprice;
    }
    public void setPack_retprice(String pack_retprice) {
        this.pack_retprice = pack_retprice;
    }
    @Column(name = "jbyw")
    public String getJbyw() {
        return jbyw;
    }
    public void setJbyw(String jbyw) {
        this.jbyw = jbyw;
    }
    @Column(name = "mini_unit")
    public String getMini_unit() {
        return mini_unit;
    }
    public void setMini_unit(String mini_unit) {
        this.mini_unit = mini_unit;
    }
    @Column(name = "pack_size")
    public String getPack_size() {
        return pack_size;
    }
    public void setPack_size(String pack_size) {
        this.pack_size = pack_size;
    }
    @Column(name = "action")
    public String getAction() {
        return action;
    }
    public void setAction(String action) {
        this.action = action;
    }
    @Column(name = "serial")
    public String getSerial() {
        return serial;
    }
    public void setSerial(String serial) {
        this.serial = serial;
    }
    @Column(name = "group_no")
    public String getGroup_no() {
        return group_no;
    }
    public void setGroup_no(String group_no) {
        this.group_no = group_no;
    }
    @Column(name = "stock_amount")
    public String getStock_amount() {
        return stock_amount;
    }
    public void setStock_amount(String stock_amount) {
        this.stock_amount = stock_amount;
    }
    @Column(name = "visible_flag")
    public String getVisible_flag() {
        return visible_flag;
    }
    public void setVisible_flag(String visible_flag) {
        this.visible_flag = visible_flag;
    }
    @Column(name = "drug_flag")
    public String getDrug_flag() {
        return drug_flag;
    }
    public void setDrug_flag(String drug_flag) {
        this.drug_flag = drug_flag;
    }
    @Column(name = "create_time")
    public Date getCreate_time() {
        return create_time;
    }
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
    @Column(name = "status")
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
}

+ 57 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseTemplateDO.java

@ -0,0 +1,57 @@
package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "base_template")
public class BaseTemplateDO extends UuidIdentityEntityWithOperator {
    private String name;
    private String code;
    private String childrenCount;
    private String isDel;
    private String templateType;
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "children_count")
    public String getChildrenCount() {
        return childrenCount;
    }
    public void setChildrenCount(String childrenCount) {
        this.childrenCount = childrenCount;
    }
    @Column(name = "is_del")
    public String getIsDel() {
        return isDel;
    }
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
    @Column(name = "template_type")
    public String getTemplateType() {
        return templateType;
    }
    public void setTemplateType(String templateType) {
        this.templateType = templateType;
    }
}

+ 40 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseTemplateDictDO.java

@ -0,0 +1,40 @@
package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "base_template_dict")
public class BaseTemplateDictDO extends UuidIdentityEntityWithCreateTime {
    private String dictId;
    private String isDel;
    private String templateId;
    @Column(name = "dict_id")
    public String getDictId() {
        return dictId;
    }
    public void setDictId(String dictId) {
        this.dictId = dictId;
    }
    @Column(name = "is_del")
    public String getIsDel() {
        return isDel;
    }
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
    @Column(name = "template_id")
    public String getTemplateId() {
        return templateId;
    }
    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }
}

+ 49 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/BaseTemplateOrgDO.java

@ -0,0 +1,49 @@
package com.yihu.jw.entity.base.dict;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import org.springframework.beans.factory.annotation.Autowired;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "base_template_org")
public class BaseTemplateOrgDO extends UuidIdentityEntityWithCreateTime {
    private String templateId;
    private String orgCode;
    private String isDel;
    private String orgName;
    @Column(name = "template_id")
    public String getTemplateId() {
        return templateId;
    }
    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    @Column(name = "is_del")
    public String getIsDel() {
        return isDel;
    }
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
}

+ 89 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/followup/BusinessMapping.java

@ -0,0 +1,89 @@
package com.yihu.jw.entity.followup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 随访记录映射表
 * @author huangwenjie
 * @date 2017/10/23 14:02
 */
@Entity
@Table(name = "wlyy_business_mapping")
public class BusinessMapping extends IntegerIdentityEntity {
	private String code;
	private Integer businessId;
	private Integer businessType;
	private Integer needUpload;
	private Date createTime;
	private Date updateTime;
	
	@Basic
	@Column(name = "code")
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	
	@Basic
	@Column(name = "need_upload")
	public Integer getNeedUpload() {
		return needUpload;
	}
	
	public void setNeedUpload(Integer needUpload) {
		this.needUpload = needUpload;
	}
	
	@Basic
	@Column(name = "create_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+08:00")
	public Date getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@Basic
	@Column(name = "update_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+08:00")
	public Date getUpdateTime() {
		return updateTime;
	}
	
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	@Basic
	@Column(name = "business_id")
	public Integer getBusinessId() {
		return businessId;
	}
	public void setBusinessId(Integer businessId) {
		this.businessId = businessId;
	}
	@Basic
	@Column(name = "business_type")
	public Integer getBusinessType() {
		return businessType;
	}
	public void setBusinessType(Integer businessType) {
		this.businessType = businessType;
	}
}

+ 2 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/followup/Followup.java

@ -1,6 +1,7 @@
package com.yihu.jw.entity.followup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.iot.gateway.IdEntity;
@ -17,7 +18,7 @@ import java.util.Map;
@Entity
@Table(name = "wlyy_followup")
@SequenceGenerator(name="id_generated", sequenceName="wlyy_followup")
public class Followup extends IdEntity {
public class Followup extends IntegerIdentityEntity {
	//随访编号【基卫】
	private String followupNo;

+ 73 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/followup/FollowupContent.java

@ -0,0 +1,73 @@
package com.yihu.jw.entity.followup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;
/**
 * 随访面访详情
 * @author hzp add 2016-12-07
 *
 */
@Entity
@Table(name = "wlyy_followup_content")
@SequenceGenerator(name="id_generated", sequenceName="seq_wlyy_followup_drugs")
public class FollowupContent extends IntegerIdentityEntity {
	//随访ID
	private Long followupId;
	//随访项目【字典FOLLOWUP_PROJECT】
	private String followupProject;
	//随访项目问题
	private String followupKey;
	//随访项目回答
	private String followupValue;
	//创建时间
	private Date createTime;
	public Long getFollowupId() {
		return followupId;
	}
	public void setFollowupId(Long followupId) {
		this.followupId = followupId;
	}
	public String getFollowupProject() {
		return followupProject;
	}
	public void setFollowupProject(String followupProject) {
		this.followupProject = followupProject;
	}
	public String getFollowupKey() {
		return followupKey;
	}
	public void setFollowupKey(String followupKey) {
		this.followupKey = followupKey;
	}
	public String getFollowupValue() {
		return followupValue;
	}
	public void setFollowupValue(String followupValue) {
		this.followupValue = followupValue;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
}

+ 81 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/followup/FollowupMapping.java

@ -0,0 +1,81 @@
package com.yihu.jw.entity.followup;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.*;
import java.sql.Timestamp;
/**
 * 随访记录映射表
 * @author huangwenjie
 * @date 2017/10/23 14:02
 */
@Entity
@Table(name = "wlyy_followup_mapping")
@SequenceGenerator(name="id_generated", sequenceName="seq_wlyy_followup_mapping")
public class FollowupMapping extends IntegerIdentityEntity {
	private String code;
	private Integer followupId;
	private Integer needUpload;
	private Timestamp createTime;
	private Timestamp updateTime;
	private String errmsg;
	@Basic
	@Column(name = "code")
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	
	@Basic
	@Column(name = "followup_id")
	public Integer getFollowupId() {
		return followupId;
	}
	
	public void setFollowupId(Integer followupId) {
		this.followupId = followupId;
	}
	
	@Basic
	@Column(name = "need_upload")
	public Integer getNeedUpload() {
		return needUpload;
	}
	
	public void setNeedUpload(Integer needUpload) {
		this.needUpload = needUpload;
	}
	
	@Basic
	@Column(name = "create_time")
	public Timestamp getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	
	@Basic
	@Column(name = "update_time")
	public Timestamp getUpdateTime() {
		return updateTime;
	}
	
	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}
	public String getErrmsg() {
		return errmsg;
	}
	public void setErrmsg(String errmsg) {
		this.errmsg = errmsg;
	}
}

+ 117 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/followup/FollowupSign.java

@ -0,0 +1,117 @@
package com.yihu.jw.entity.followup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Trick on 2019/4/22.
 */
@Entity
@Table(name = "wlyy_followup_sign")
public class FollowupSign extends IntegerIdentityEntity {
    private String code;//
    private Integer followupId;//随访id',
    private String type;//签到方式1.定位,2.拍照,3.门牌',
    private String doctor;//医生',
    private String doctorName;//医生姓名',
    private String longitude;//经度',
    private String latitude;//纬度',
    private String address;//地址',
    private String img;//图片地址“,”分割',
    private Date createTime;//创建时间',
    private Integer del; //是否删除1为删除,0.为正常
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public Integer getFollowupId() {
        return followupId;
    }
    public void setFollowupId(Integer followupId) {
        this.followupId = followupId;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getLongitude() {
        return longitude;
    }
    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }
    public String getLatitude() {
        return latitude;
    }
    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 0 - 9
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/message/SystemMessageDO.java

@ -76,7 +76,6 @@ public class SystemMessageDO extends UuidIdentityEntity {
    private Integer state;
    private Integer readonly;
    private String reason;
    private String code;
    private String senderPhoto;
    @Column(name = "content")
    public String getContent() {
@ -110,14 +109,6 @@ public class SystemMessageDO extends UuidIdentityEntity {
    public void setReason(String reason) {
        this.reason = reason;
    }
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "sender_photo")
    public String getSenderPhoto() {
        return senderPhoto;

+ 10 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/doctor/WlyyDoctorWorkTimeVO.java

@ -54,6 +54,16 @@ public class WlyyDoctorWorkTimeVO {
    @ApiModelProperty(value = "创建人类型1医院2医生", example = "模块1")
    private Integer createUserType;//创建人类型1医院2医生
    @ApiModelProperty(value = "当前号源时间的星期数", example = "模块1")
    private Integer weekday;//创建人类型1医院2医生
    public Integer getWeekday() {
        return weekday;
    }
    public void setWeekday(Integer weekday) {
        this.weekday = weekday;
    }
    public String getId() {
        return id;

+ 20 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java

@ -436,7 +436,26 @@ public abstract class EnvelopRestEndpoint extends Exception {
        return links.toString();
    }
    /**
     * 获取被代理人code,若没有则返回当前登录者
     * @return
     */
    public String getRepUID(){
        try {
            HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
            String userAgent = request.getHeader("userAgent");
            if (org.apache.commons.lang3.StringUtils.isEmpty(userAgent)) {
                userAgent = request.getHeader("User-Agent");
            }
            JSONObject json = JSONObject.parseObject(userAgent);
            if(!json.containsKey("represented")){
                return json.getString("uid");
            }
            return json.getString("represented");
        } catch (Exception e) {
            return null;
        }
    }
    public String getUID() {
        try {
            HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();

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

@ -269,15 +269,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        if (wlyyHospitalSysDictDO!=null){
            isNeedGeet=wlyyHospitalSysDictDO.getDictValue();
        }
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)&&"1".equalsIgnoreCase(isNeedGeet)){
            String geetestChallenge = parameters.get("geetestChallenge");
            String geetestValidate = parameters.get("geetestValidate");
            String geetestSeccode = parameters.get("geetestSeccode");
            JSONObject resResult =validateGeet(geetestChallenge,geetestValidate,geetestSeccode,"1");
            if (resResult==null||!resResult.getString("result").equalsIgnoreCase("success")){
                throw new  Exception("验证失败");
            }
        }
        if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
            if(!verifyCaptcha(key,text)){
                throw new ImgCaptchaException("img_captcha error");

+ 86 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/DictDrugEndpoint.java

@ -0,0 +1,86 @@
package com.yihu.jw.base.endpoint.dict;
import com.yihu.jw.entity.hospital.prescription.BaseNationalDrugDictDO;
import com.yihu.jw.hospital.prescription.service.NationalDrugDictService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.Prescription.PREFIX)
@Api(value = "药品字典维护", description = "药品字典维护", tags = {"药品字典维护"})
public class DictDrugEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private NationalDrugDictService nationalDrugDictService;
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.saveNationalDrug)
    @ApiOperation(value = "保存药品字典接口")
    public ObjEnvelop saveNationalDrug(@ApiParam(name = "jsonData", value = "药品json串")
                                       @RequestParam(name = "jsonData", required = true) String jsonData) throws Exception {
        try {
            BaseNationalDrugDictDO nationalDrugDictDO = objectMapper.readValue(jsonData, BaseNationalDrugDictDO.class);
            return success(nationalDrugDictService.saveNationalDrug(nationalDrugDictDO));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getNationalDrugList)
    @ApiOperation(value = "获取药品字典接口")
    public MixEnvelop getNationalDrugList(@ApiParam(name = "name", value = "药品名称")
                                          @RequestParam(name = "name", required = false) String name,
                                          @ApiParam(name = "number", value = "药品编码")
                                          @RequestParam(name = "number", required = false) String number,
                                          @ApiParam(name = "hospital", value = "所属机构")
                                          @RequestParam(name = "hospital", required = false) String hospital,
                                          @ApiParam(name = "status", value = "状态")
                                          @RequestParam(name = "status", required = false) Integer status,
                                          @ApiParam(name = "page", value = "当前页")
                                          @RequestParam(name = "page", required = false) Integer page,
                                          @ApiParam(name = "pageSize", value = "页面大小")
                                          @RequestParam(name = "pageSize", required = false) Integer pageSize) throws Exception {
        try {
            return nationalDrugDictService.getNationalDrugList(name, number, hospital, status, page, pageSize);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.updateNationalDrugStatus)
    @ApiOperation(value = "更新药品字典状态")
    public Envelop updateNationalDrugStatus(@ApiParam(name = "id", value = "药品id")
                                            @RequestParam(name = "id", required = true) Integer id,
                                            @ApiParam(name = "status", value = "状态", required = true)
                                            @RequestParam(name = "status") Integer status){
        try {
            nationalDrugDictService.updateNationalDrugStatus(id,status);
            return success();
        }catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getNationalDrugById)
    @ApiOperation(value = "根据id获取药品字典")
    public ObjEnvelop getNationalDrugById(@ApiParam(name = "id", value = "药品id")
                                          @RequestParam(name = "id", required = true) Integer id) {
        try {
            return success(nationalDrugDictService.getNationalDrugById(id));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -324,7 +324,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                sql+="\t) tb" +
                "  GROUP BY\n" +
                "\ttb. ID,\n" +
                "\ttb.idcard,\n" +
                "\ttb.idcard,\n" + "\ttb.doctor_level,\n" +
                "\ttb.name,\n" +
                "\ttb.sex,\n" +
                "\ttb.mobile,\n" +

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -446,7 +446,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		try {
			logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
			return prescriptionService.findDoctorByHospitalAndDiseaseAndDept(iswork,patientid,
			return prescriptionService.findDoctorByHospitalAndDiseaseAndDept2(iswork,patientid,
					orgCode,dept,
					diseaseKey,doctorNameKey,
					jobTitleNameKey,outpatientType,

+ 29 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -2152,4 +2152,33 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/findDoctorWorkTime")
    @ApiOperation(value = "findDoctorWorkTime", notes = "findDoctorWorkTime")
    public Envelop findDoctorWorkTime(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor", required = false)String doctor,
            @ApiParam(name = "hospital", value = "hospital")
            @RequestParam(value = "hospital", required = false)String hospital,
            @ApiParam(name = "ywCode", value = "ywCode")
            @RequestParam(value = "ywCode", required = false)String ywCode)throws Exception {
        try {
            return success("操作成功", prescriptionService.findDoctorWorkTime(doctor,hospital,ywCode));
        }catch (Exception e){
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/findDoctorChargeType")
    @ApiOperation(value = "findDoctorChargeType", notes = "findDoctorChargeType")
    public Envelop findDoctorChargeType(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor", required = false)String doctor,
            @ApiParam(name = "chargeType", value = "chargeType")
            @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        try {
            return success("操作成功", workTimeService.findChargeTypeByDoctor(doctor,chargeType));
        }catch (Exception e){
            return Envelop.getError(e.getMessage());
        }
    }
}

+ 47 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -3091,4 +3091,51 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
       }
    }
    @GetMapping("/findDoctorChargeType")
    @ApiOperation(value = "findDoctorChargeType", notes = "findDoctorChargeType")
    public Envelop findDoctorChargeType(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor", required = false)String doctor,
            @ApiParam(name = "chargeType", value = "chargeType")
            @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        try {
            return success("操作成功", workTimeService.findChargeTypeByDoctor(doctor,chargeType));
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/findDoctorWorkDate")
    @ApiOperation(value = "findDoctorWorkDate", notes = "findDoctorWorkDate")
    public Envelop findDoctorWorkTime(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor", required = false)String doctor,
            @ApiParam(name = "hospital", value = "hospital")
            @RequestParam(value = "hospital", required = false)String hospital,
            @ApiParam(name = "type", value = "ywCode")
            @RequestParam(value = "type", required = false)String type)throws Exception {
        try {
            return success("操作成功", prescriptionService.findDoctorWorkTime(doctor,hospital,type));
        }catch (Exception e){
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/findDoctorWorkSource")
    @ApiOperation(value = "获取医生信息", notes = "获取医生信息")
    public ObjEnvelop findDoctorWordSource(@ApiParam(name = "doctor", value = "医生code")
                                     @RequestParam(value = "doctor", required = true)String doctor,
                                     @ApiParam(name = "withWork", value = "传1带排班,其他不带")
                                     @RequestParam(value = "withWork", required = false)String withWork,
                                     @ApiParam(name = "patient", value = "患者code")
                                     @RequestParam(value = "patient", required = false)String patient){
        try {
            return success(prescriptionService.findDoctorInfo(doctor,withWork,patient));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
}

+ 5 - 0
svr/svr-rehabilitation/pom.xml

@ -113,6 +113,11 @@
			<artifactId>im-service</artifactId>
			<version>2.0.0</version>
		</dependency>
		<dependency>
			<groupId>com.yihu.jw</groupId>
			<artifactId>es-service</artifactId>
			<version>2.0.0</version>
		</dependency>
		<dependency>
			<groupId>org.springside</groupId>
			<artifactId>springside-core</artifactId>

+ 71 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/DiagnosisInformationController.java

@ -0,0 +1,71 @@
package com.yihu.rehabilitation.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.specialist.rehabilitation.PatientDiagnosisInformationDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.rehabilitation.service.DiagnosisInformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
/**
 * Created by humingfen on 2019/2/11.
 */
@RestController
@RequestMapping("/diagnosisInformation")
@Api(tags = "诊疗信息管理相关操作", description = "诊疗信息相关操作")
public class DiagnosisInformationController extends EnvelopRestEndpoint {
    @Autowired
    private DiagnosisInformationService diagnosisInformationService;
    @PostMapping(value = SpecialistMapping.diagnosisInformation.createDiagnosisInformation)
    @ApiOperation(value = "诊疗信息创建")
    public Envelop createDiagnosisInformation(@ApiParam(name = "diagnosisInformationJson", value = "实体JSON")
                                                       @RequestParam(value = "diagnosisInformationJson")String diagnosisInformationJson){
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
            PatientDiagnosisInformationDO diagnosisInformationDO = objectMapper.readValue(diagnosisInformationJson, PatientDiagnosisInformationDO.class);
            return diagnosisInformationService.createDiagnosisInformation(diagnosisInformationDO);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.diagnosisInformation.findDiagnosisInformationByPlanId)
    @ApiOperation(value = "根据康复计划id查找诊疗信息")
    public Envelop findDiagnosisInformationByPlanId(@ApiParam(name = "planId", value = "康复计划id")
                                              @RequestParam(value = "planId") String planId){
        try {
            return diagnosisInformationService.findDiagnosisInformationByPlanId(planId);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.diagnosisInformation.findDiagnosisInformationByPatient)
    @ApiOperation(value = "查找居民诊疗信息记录")
    public Envelop findDiagnosisInformationByPatient(@ApiParam(name = "patient", value = "居民code")
                                                    @RequestParam(value = "patient") String patient,
                                                     @ApiParam(name = "page", value = "第几页")
                                                     @RequestParam(value = "page") Integer page,
                                                     @ApiParam(name = "size", value = "行数")
                                                         @RequestParam(value = "size") Integer size){
        try {
            return diagnosisInformationService.findDiagnosisInformationByPatient(patient, page, size);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}

+ 299 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/consult/ConsultController.java

@ -0,0 +1,299 @@
package com.yihu.rehabilitation.controller.consult;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
import com.yihu.jw.message.service.MessageService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.rehabilitation.dao.SignFamilyDao;
import com.yihu.rehabilitation.service.consult.ConsultTeamService;
import com.yihu.rehabilitation.util.BusinessLogs;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 患者端:三师咨询控制类
 *
 * @author George
 */
@Controller
@RequestMapping(value = "/patient/consult", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@Api(description = "患者端-患者咨询")
public class ConsultController extends EnvelopRestEndpoint {
    @Autowired
    private ConsultTeamService consultTeamService;
    /**
     * 三师咨询添加接口
     *
     * @param type     咨询类型:1三师咨询,2家庭医生咨询,18康复咨询
     * @param when     发病时间
     * @param symptoms 主要症状
     * @param images   图片URL地址,多图以逗号分隔
     * @param voice    语音URL地址
     * @return
     */
    @RequestMapping(value = "add")
    @ResponseBody
    @ApiOperation("三师咨询添加接口")
    public Envelop add(@RequestParam(required = false) Integer type,
                       @RequestParam(required = false) String when,
                       @RequestParam String symptoms,
                       @RequestParam(required = false) String images,
                       @RequestParam(required = false) String voice,
                       @RequestParam(required = false) Long guidance,
                       @RequestParam(required = false) String doctor) {
        try {
            System.out.println("guidance1="+guidance);
            System.out.println("symptoms="+symptoms);
            if (type == null) {
                type = 1;
            }
            if (type != 1 && type != 2 && type !=18&&(StringUtils.isNoneBlank(doctor)&&type==18)) {
                return failed( "无效请求!");
            }
            ConsultTeamDo consult = new ConsultTeamDo();
            // 设置咨询类型:1三师咨询,2家庭医生咨询  6.名医咨询  18,康复咨询
            consult.setType(type);
            // 设置发病时间
            consult.setWhen(when);
            // 设置主要症状
            consult.setSymptoms(symptoms);
            // 设置咨询图片URL
            consult.setImages(images);
            // 设置咨询语音URL
            consult.setVoice(voice);
            consult.setDoctor(doctor);
            consult.setIsAuthentication(0);
            consult.setIsRefinement(0);
            // 设置关联咨询
            if (guidance != null && guidance > 0) {
                consult.setGuidance(guidance);
            }
            System.out.println("guidance2="+guidance);
            // 保存到数据库
            int res = 0;
            JSONArray dts = null;
            synchronized (getUID().intern()){//新增同步方法。设备保存写在service层但是不生效,写在controller层才生效
                JSONObject re;
                if(type==18){//康复咨询
                    re = consultTeamService.addRecoverConsult(consult,getRepUID(),getUID());
                }
                else{
                    re = consultTeamService.addTeamConsult(consult,getRepUID(), getUID());
                }
                res = re.getInt("status");
                dts = re.has("doctor")?re.getJSONArray("doctor"):null;
            }
            if (res == -1) {
                return failed( "家庭签约信息不存在或已过期,无法进行家庭医生咨询!");
            } else if (res == -2) {
                return failed("家庭签约信息不存在或已过期,无法进行三师医生咨询!");
            }else if (res == -3) {
                return failed( "还有咨询未结束,不允许再次提交咨询!");
            }
//            Doctor doctor = doctorService.findDoctorByCode(consult.getDoctor());
            //创建咨询讨论组
            // JSONObject jo= talkGroupService.createConsultTalkGroup(consult.getDoctor(), doctor.getName(), doctor.getHospital(), doctor.getHospitalName(),
            //        consult.getPatient(), consult.getName(), consult.getConsult());
            // consult.setGroupCode(jo.getString("groupCode"));
            //更新讨论组
            //consultTeamService.save(consult);
            BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), new JSONObject(consult));
            return success("提交成功",  consult);
        } catch (Exception ex) {
            ex.printStackTrace();
            return failedException(ex);
        }
    }
    @RequestMapping(value = "intoTopic",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("进入咨询")
    public Envelop intoTopic(@RequestParam(required = true) String consult){
        try{
            int result = consultTeamService.intoTopic(consult,getRepUID(),getUID());
            if(result==-1){
                return failed("该咨询不是进行中");
            }
            JSONObject json = new JSONObject();
            json.put("consult",consult);
            json.put("content","进入咨询");
            BusinessLogs.info(BusinessLogs.BusinessType.consult, getRepUID(), getUID(), json);
            return success("进入成功");
        }catch (Exception e){
            e.printStackTrace();
            return failed("请求失败");
        }
    }
    /**
     * 查询与某个医生是否存在未结束的咨询
     *
     * @param doctor 医生
     * @return
     */
    @ApiOperation("查询与某个医生是否存在未结束的咨询")
    @RequestMapping(value = "/is_consult_unfinished",method = RequestMethod.POST)
    @ResponseBody
    public Envelop isExistsUnfinishedConsult(@RequestParam(required = false) String patient,
                                             @RequestParam(required = true) String doctor) {
        try {
            JSONObject result = new JSONObject();
            List<Map<String,Object>> consults = consultTeamService.getUnfinishedConsult(StringUtils.isEmpty(patient) ? getUID() : patient, doctor);
            if (consults != null && consults.size() > 0) {
                return success("查询成功",  consults.get(0).get("consult"));
            } else {
                return failed( "查询成功" );
            }
        } catch (Exception e) {
            return failedException(e);
        }
    }
    /**
     * 获取患者发起咨询时可选择的专科医生团队列表,
     * @param patientCode 患者code
     * @return
     */
    @RequestMapping(value = "getConsultDoctorForConsulting",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取咨询医生团队列表列表")
    public Envelop getConsultDoctorForConsulting(@RequestParam("patientCode")String patientCode){
        try {
            return success("查询成功",consultTeamService.getConsultDoctorForConsulting(patientCode));
        }catch (Exception e){
            e.printStackTrace();
            return failedException(e);
        }
    }
    /**
     * 查询患者三师咨询咨询列表
     *
     * @param status   咨询状态(0未结束,1已结束,-1 已取消)
     * @param pagesize 页数
     * @return 查询结果
     */
    @RequestMapping(value = "list")
    @ResponseBody
    @ApiOperation("查询患者三师咨询咨询列表")
    public Envelop list(int status, String id, int pagesize) {
        try {
            Page<ConsultTeamDo> consults = consultTeamService.findByPatient(getRepUID(), status, id, pagesize);
            JSONArray jsonArray = new JSONArray();
            if (consults != null) {
                for (ConsultTeamDo consult : consults) {
                    if (consult == null) {
                        continue;
                    }
                    JSONObject json = new JSONObject();
                    json.put("id", consult.getId());
                    // 设置咨询标志
                    json.put("code", consult.getConsult());
                    // 设置咨询类型:0公共咨询,1指定医生,2三师咨询
                    json.put("type", consult.getType());
                    // 设置标题
                    json.put("title", consult.getSymptoms());
                    // 设置发病时间
                    json.put("when", consult.getWhen());
                    // 设置患者未读数量
                    json.put("patientRead", consult.getPatientRead());
                    // 设置状态
                    json.put("status", consult.getStatus());
                    // 设置患者评价标识
                    json.put("comment", consult.getComment());
                    // 设置关联指导
                    json.put("guidance", consult.getGuidance());
                    // 设置咨询或回复时间
                    json.put("time", DateUtil.dateToStr(consult.getCzrq(), DateUtil.YYYY_MM_DD_HH_MM_SS));
                    jsonArray.put(json);
                }
            }
            return success( "查询成功",  jsonArray);
        } catch (Exception ex) {
            ex.printStackTrace();
            return failedException(ex);
        }
    }
    /**
     * 患者取消三师咨询
     *
     * @param consult
     * @return
     */
    @RequestMapping(value = "cancel")
    @ResponseBody
    @ApiOperation("患者取消三师咨询")
    public Envelop cancel(String consult) {
        try {
            int row = consultTeamService.cancel(consult);
            if (row > 0) {
                return success("咨询已取消!");
            } else {
                return failed( "咨询不能取消!");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    /**
     * 修改状态为1的咨询记录为结束
     *
     * @param code 咨询标识
     * @return
     */
    @RequestMapping(value = "finish")
    @ResponseBody
    @ApiOperation("修改状态为1的咨询记录为结束")
    public Envelop finish(@RequestParam(required = true) String code) {
        try {
            int row = consultTeamService.finishConsult(code, getRepUID(), 1);
            if (row > 0) {
                return success("操作成功!");
            }else if(row == -2) {
                return failed( "续方未审核,不能结束续方咨询!");
            }  else {
                return failed( "操作失败!");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
}

+ 124 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/consult/DoctorConsultController.java

@ -0,0 +1,124 @@
package com.yihu.rehabilitation.controller.consult;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.message.service.MessageService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.rehabilitation.aop.ObserverRequired;
import com.yihu.rehabilitation.dao.SignFamilyDao;
import com.yihu.rehabilitation.service.consult.ConsultTeamService;
import com.yihu.rehabilitation.service.followUp.FollowUpService;
import com.yihu.rehabilitation.util.BusinessLogs;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 医生端:三师咨询控制类
 *
 * @author George
 */
@RestController
@RequestMapping(value = "/doctor/consult", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "三师咨询")
public class DoctorConsultController extends EnvelopRestEndpoint {
    @Autowired
    private ConsultTeamService consultTeamService;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private SystemMessageService messageService;
    @Autowired
    protected HttpServletRequest request;
    @RequestMapping(value = "getKangFuConsultList",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取续方咨询列表")
    public Envelop getKangFuConsultList(@ApiParam(name = "title", value = "咨询标题") @RequestParam(required = false) String title,
                                        @ApiParam(name = "patient", value = "居民CODE") @RequestParam(required = false) String patient,
                                        @ApiParam(name = "id", value = "第几页") @RequestParam(required = true) Integer id,
                                        @ApiParam(name = "pagesize", value = "页面大小") @RequestParam(required = true) int pagesize){
        try {
            JSONArray array = new JSONArray();
//            Page<Object> data = consultTeamService.findConsultRecordByType("a663d0cf7f8c4d38a8327cedc921e65f", id, pagesize,8, title);//8表示续方咨询
            List<Map<String,Object>> data = consultTeamService.findConsultRecordByType(patient, id, pagesize,18, title);//18表示康复咨询
            BasePatientDO patientobj = basePatientDao.findById(patient);
            if (data != null) {
                for (Map<String,Object> consult : data) {
                    if (consult == null) {
                        continue;
                    }
                    JSONObject json = new JSONObject();
                    json.put("id", consult.get("id"));
                    // 设置咨询类型:1三师咨询,2视频咨询,3图文咨询,4公共咨询,5病友圈,8 续方咨询  18康复咨询
                    json.put("type", consult.get("type"));
                    // 设置咨询标识
                    json.put("code", consult.get("relation_code"));
                    // 设置显示标题
                    json.put("title", consult.get("title"));
                    json.put("patientName", patientobj.getName());
                    json.put("patientPhoto", patientobj.getPhoto());
                    // 设置主诉
                    json.put("symptoms", consult.get("symptoms"));
                    // 咨询状态
                    json.put("status", consult.get("status"));
                    // 设置咨询日期
                    json.put("czrq", DateUtil.dateToStrLong((Date) consult.get("czrq")));
                    // 咨询状态
                    json.put("doctorCode",consult.get("doctor"));
                    json.put("evaluate", consult.get("evaluate"));
                    array.put(json);
                }
            }
            return success( "查询成功!",  array);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @RequestMapping(value = "evaluateStatus")
    @ResponseBody
    public Envelop statuss(String consult) {
        try {
            ConsultTeamDo ct = consultTeamService.findByCode(consult);
            if (ct == null) {
                return failed( "获取状态失败!");
            } else {
                return success( "获取状态成功!",  ct.getEvaluate());
            }
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
}

+ 85 - 4
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/doctor/DoctorRehabilitationManageController.java

@ -116,13 +116,15 @@ public class DoctorRehabilitationManageController extends EnvelopRestEndpoint {
                                     @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                     @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                     @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                         @ApiParam(name = "taskExecutor", value = "1是本人任务", required = false)
                                             @RequestParam(value = "taskExecutor", required = false)String taskExecutor,
                                     @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                     @RequestParam(value = "status", required = false)Integer status){
        try {
            if(!StringUtils.isNotEmpty(doctorCode)){
                doctorCode = getUID();
            }
            return rehabilitationManageService.calendarPlanDetail(executeStartTime,executeEndTime,planId,searchTask,status,doctorCode,"1");
            return rehabilitationManageService.calendarPlanDetail(executeStartTime,executeEndTime,planId,searchTask,status,doctorCode,taskExecutor);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
@ -457,7 +459,7 @@ public class DoctorRehabilitationManageController extends EnvelopRestEndpoint {
    public ObjEnvelop getServiceItemsAfterStop(@ApiParam(name = "planId", value = "康复计划id", required = true)
                                               @RequestParam(value = "planId", required = true)String planId){
        try {
            return rehabilitationManageService.getServiceItemsAfterStop(planId);
            return ObjEnvelop.getSuccess("操作成功",rehabilitationManageService.getServiceItemsAfterStop(planId));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError(e.getMessage());
@ -670,7 +672,7 @@ public class DoctorRehabilitationManageController extends EnvelopRestEndpoint {
    @RequestMapping(value = "selectBySpecialistDoctor", method = RequestMethod.GET)
    @ApiOperation("康复管理-获取签约专科居民")
    @ApiOperation("康复管理-获取专科居民")
    public String selectBySpecialistDoctor(@ApiParam(name = "doctorCode", value = "医生code", required = false)
                                           @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                           @ApiParam(name = "doctorType", value = "医生类型(1专科2家医)", required = false)
@ -914,7 +916,7 @@ public class DoctorRehabilitationManageController extends EnvelopRestEndpoint {
    }
    @RequestMapping(value = "sendGuidance", method = RequestMethod.GET)
    @RequestMapping(value = "sendGuidance", method = RequestMethod.POST)
    @ApiOperation("康复管理-发送康复指导")
    public Envelop selectType(@ApiParam(name = "json", value = "康复指导json", required = true)
                             @RequestParam(value = "json", required = true) String json,
@ -981,4 +983,83 @@ public class DoctorRehabilitationManageController extends EnvelopRestEndpoint {
    }
    @RequestMapping(value = "selectByRelationCode", method = RequestMethod.GET)
    @ApiOperation("康复管理-根据业务code查找康复指导")
    public Envelop selectByRelationCode(@ApiParam(name = "relationCode", value = "业务关联code", required = false)
                                       @RequestParam(value = "relationCode", required = false) String relationCode,
                                       @ApiParam(name = "patient", value = "居民code", required = false)
                                       @RequestParam(value = "patient", required = false) String patient,
                                       @ApiParam(name = "doctor", value = "医生code", required = false)
                                       @RequestParam(value = "doctor", required = false) String doctor) {
        try {
            return success( "请求成功!", rehabilitationGuidanceService.selectByRelationCode(patient,doctor,relationCode));
        } catch (Exception e) {
          e.printStackTrace();
            return failed( "请求失败");
        }
    }
    @RequestMapping(value = "selectPlanDetailByPlanId", method = RequestMethod.GET)
    @ApiOperation("康复管理-查看其它服务计划")
    public Envelop selectPlanDetailByPlanId(@ApiParam(name = "planId", value = "计划id", required = true)
                                            @RequestParam(value = "planId", required = true) String planId,
                                            @ApiParam(name = "planDetailId", value = "计划详情id", required = true)
                                            @RequestParam(value = "planDetailId", required = true) String planDetailId,
                                            @ApiParam(name = "itemId", value = "服务项目code", required = true)
                                            @RequestParam(value = "itemId", required = true) String itemId) {
        try {
            return success( "请求成功!",rehabilitationManageService.selectPlanDetailByPlan(planId,planDetailId,itemId));
        } catch (Exception e) {
            e.printStackTrace();
            return failed( "请求失败");
        }
    }
    @PostMapping(value = "appointmentConsultation")
    @ApiOperation("预约协诊")
    public ObjEnvelop appointmentConsultation(@ApiParam(name = "patient", value = "居民code", required = true)
                                          @RequestParam(value = "patient", required = true) String patient,
                                          @ApiParam(name = "doctor", value = "医生code-家医", required = true)
                                          @RequestParam(value = "doctor", required = true) String doctor,
                                          @ApiParam(name = "doctorName", value = "医生姓名-家医", required = true)
                                          @RequestParam(value = "doctorName", required = true) String doctorName,
                                          @ApiParam(name = "appointmentDoctor", value = "医生code-专科", required = true)
                                          @RequestParam(value = "appointmentDoctor", required = true) String appointmentDoctor,
                                          @ApiParam(name = "appointmentDoctorName", value = "医生姓名-专科", required = true)
                                          @RequestParam(value = "appointmentDoctorName", required = true) String appointmentDoctorName,
                                          @ApiParam(name = "sendTime", value = "发送时间", required = true)
                                          @RequestParam(value = "sendTime", required = true) String sendTime,
                                          @ApiParam(name = "planDetailId", value = "计划明细id", required = true)
                                          @RequestParam(value = "planDetailId", required = true) String planDetailId){
        try {
            return rehabilitationManageService.appointmentConsultation(patient,doctor,doctorName,appointmentDoctor,appointmentDoctorName,sendTime,planDetailId,getUID());
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError( "请求失败");
        }
    }
    @RequestMapping(value = "updateRelationCodeByDetailId", method = RequestMethod.POST)
    @ApiOperation("康复管理-服务项目关联关系")
    @ObserverRequired
    public Envelop updateRelationCodeByDetailId(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                               @ApiParam(name = "relationCode", value = "业务关联code", required = false)@RequestParam(value = "relationCode", required = false)String relationCode){
        try {
            Integer result = rehabilitationManageService.updateRelationCodeByDetailId(planDetailId,relationCode);
            if (result==1){
                return success( "更新日志成功!");
            }else {
                return failed( "更新日志失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return failed( "更新日志失败");
        }
    }
}

+ 43 - 4
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/doctor/DoctorRehabilitationPlanController.java

@ -3,6 +3,8 @@ package com.yihu.rehabilitation.controller.doctor;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.entity.rehabilitation.SpecialDiseaseMessagesDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationOperateRecordsDO;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.patient.dao.BasePatientDao;
@ -13,7 +15,9 @@ import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.rehabilitation.RehabilitationRequestMapping;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.rehabilitation.aop.ObserverRequired;
import com.yihu.rehabilitation.dao.SpecialDiseaseMessagesDao;
import com.yihu.rehabilitation.service.PatientRecordService;
import com.yihu.rehabilitation.service.RehabilitationPlanService;
import com.yihu.rehabilitation.service.ZsRehabilitationInfoService;
@ -29,10 +33,8 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.persistence.criteria.CriteriaBuilder;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * Created by humingfen on 2018/8/22.
@ -53,8 +55,14 @@ public class DoctorRehabilitationPlanController extends EnvelopRestEndpoint {
    private ZsRehabilitationInfoService zsRehabilitationInfoService;
    @Autowired
    private DoctorPatientRelationService doctorPatientRelationService;
    @Autowired
    private SpecialDiseaseMessagesDao specialDiseaseMessagesDao;
    @Autowired
    private WxAccessTokenService wxAccessTokenService;
    @Value("${demo.flag}")
    private Boolean demoFlag;
    @Value("${wechat.id}")
    private String  wxId;
    @RequestMapping(value = RehabilitationRequestMapping.DoctorRehabilitationPlan.createRehabilitationPlan, method = RequestMethod.POST)
@ -99,6 +107,7 @@ public class DoctorRehabilitationPlanController extends EnvelopRestEndpoint {
            }
            return  ObjEnvelop.getSuccess("获取成功",rehabilitationPlanService.createRehabilitationPlan(json,baseDoctorDO),200);
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError(e.getMessage());
        }
    }
@ -167,6 +176,20 @@ public class DoctorRehabilitationPlanController extends EnvelopRestEndpoint {
            if(json.has("patientCode")){
                BasePatientDO patient = basePatientDao.findById(json.get("patientCode")+"");
                json.put("patientName",patient!=null?patient.getName():"");
                json.put("patientName",patient!=null?patient.getName():"");
                try {
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                    SpecialDiseaseMessagesDO diseaseMessages = new SpecialDiseaseMessagesDO();
                    diseaseMessages.setCode(patient.getId());
                    diseaseMessages.setName(patient.getName());
                    diseaseMessages.setAddress(patient.getAddress());
                    diseaseMessages.setCodeType("2");
                    diseaseMessages.setCreateTime(sdf.format(new Date()));
                    diseaseMessages.setResult("完成电话短信关怀");
                    specialDiseaseMessagesDao.save(diseaseMessages);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
            if(json.has("doctorCode")){
                BaseDoctorDO doctor = baseDoctorDao.findById(json.get("doctorCode")+"");
@ -423,4 +446,20 @@ public class DoctorRehabilitationPlanController extends EnvelopRestEndpoint {
            }
        }
    }
    @RequestMapping(value = "sendWxMsg", method = RequestMethod.POST)
    @ApiOperation("发送微信模板消息")
    public Envelop sendWxTemplate(@ApiParam(name = "planId", value = "康复计划id", required = true)
                                 @RequestParam(value = "planId")String planId){
        try {
            JSONObject jsonObject = rehabilitationPlanService.getServiceItemsAfterStop(planId);
            rehabilitationPlanService.sendWxTemplate(wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken(), planId, getUID(), jsonObject);
            return success( "发送成功!");
        } catch (Exception e) {
           e.printStackTrace();
            return failed("发送失败");
        }
    }
}

+ 534 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/followUp/DoctorFollowUpController.java

@ -0,0 +1,534 @@
package com.yihu.rehabilitation.controller.followUp;
import com.alibaba.fastjson.JSON;
import com.yihu.jw.entity.followup.Followup;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.rehabilitation.aop.ObserverRequired;
import com.yihu.rehabilitation.service.followUp.FollowUpService;
import com.yihu.rehabilitation.service.followUp.FollowupDrugsService;
import com.yihu.rehabilitation.util.BusinessLogs;
import com.yihu.rehabilitation.vo.FollowupContentESDO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
/**
 * 医生端:随访接口
 *
 * @author hzp add 2016-12-07
 */
@Controller
@RequestMapping(value = "/doctor/followup", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-随访接口")
public class DoctorFollowUpController  extends EnvelopRestEndpoint {
   @Autowired
    private FollowUpService followUpService;
   @Autowired
   private JdbcTemplate jdbcTemplate;
   @Autowired
   private FollowupDrugsService followupDrugsService;
    @ApiOperation("新增随访计划(批量)")
    @RequestMapping(value = "/addFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public Envelop addFollowupPlan(@ApiParam(name = "patient", value = "患者代码", defaultValue = "443a196ef8744536a531260eb26c05d7")
                                  @RequestParam(value = "patient", required = true) String patient,
                                   @ApiParam(name = "data", value = "随访计划列表json", defaultValue = "[{\"date\":\"2016-12-16 20:00:00\",\"type\":\"10\",\"doctor\":\"64de9952-5b15-11e6-8344-fa163e8aee56\"},{\"date\":\"2016-12-17 15:00:00\",\"type\":\"3\",\"doctor\":\"64de9952-5b15-11e6-8344-fa163e8aee56\"}]")
                                  @RequestParam(value = "data", required = true) String data) {
        try {
            Iterable<Followup> followups = followUpService.addFollowupPlan(getUID(), patient, data);
            if (followups != null) {
                for (Followup followup : followups) {
                    BusinessLogs.info(BusinessLogs.BusinessType.followup, getUID(), followup.getPatientCode(), new JSONObject(followup));
                }
            }
            return success( "新增随访计划成功!",followups);
        } catch (Exception e) {
            e.printStackTrace();
            return failed("新增随访计划失败!" );
        }
    }
    @ApiOperation("获取随访信息")
    @RequestMapping(value = "/getFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    public Envelop getFollowup(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
                              @RequestParam(value = "id", required = true) String id) {
        try {
            Map<String, String> response = followUpService.getFollowup(id);
            try {
                String sql = "UPDATE `wlyy_followup` SET `doctor_read_status`='1' WHERE (`id`="+id+") ";
                jdbcTemplate.update(sql);
            }catch (Exception e){
                e.printStackTrace();
            }
            return success( "获取随访信息成功!", response);
        } catch (Exception e) {
            e.printStackTrace();
            return failed("获取随访信息失败!" + e.getMessage());
        }
    }
    @RequestMapping(value = "/isFirstTimeFollowup",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("判断居民该类别随访是否为第一次")
    @ResponseBody
    public Envelop isFirstTimeFollowup(@ApiParam(name = "patient", value = "居民code", defaultValue = "")
                                      @RequestParam(value = "patient", required = true)String patient,
                                      @ApiParam(name = "followupClass", value = "随访类别", defaultValue = "")
                                      @RequestParam(value = "followupClass", required = true)String followupClass,
                                      @ApiParam(name = "followupId", value = "随访类别", defaultValue = "")
                                      @RequestParam(value = "followupId", required = true)Integer followupId) {
        try {
            return success( "操作成功!",followUpService.isFirstTimeFollowup(getUID(),patient,followupClass,followupId));
        }catch (Exception e){
            //日志文件中记录异常信息
          e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @ApiOperation("开始随访记录")
    @RequestMapping(value = "/startFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public Envelop startFollowup(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
                                @RequestParam(value = "id", required = true) String id,
                                @ApiParam(name = "followupNo", value = "随访记录编码")
                                @RequestParam(value = "followupNo", required = false) String followupNo,
                                @ApiParam(name = "date", value = "随访时间", defaultValue = "2016-12-14 20:00:00")
                                @RequestParam(value = "date", required = true) String date,
                                @ApiParam(name = "followupType", value = "随访方式【字典FOLLOWUP_WAY_DICT】", defaultValue = "12")
                                @RequestParam(value = "followupType", required = true) String followupType,
                                @ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病,3高糖】", defaultValue = "1")
                                @RequestParam(value = "followupClass", required = true) String followupClass,
                                @ApiParam(name = "followupManagerStatus", value = "随访管理状态【字典FOLLOWUP_MANAGER_STATUS】", defaultValue = "1")
                                @RequestParam(value = "followupManagerStatus", required = false) String followupManagerStatus,
                                @ApiParam(name = "plandate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
                                @RequestParam(value = "plandate", required = false) String plandate,
                                @ApiParam(name = "prescriptioncode", value = "续方CODE", defaultValue = "")
                                @RequestParam(value = "prescriptioncode", required = false) String prescriptioncode) {
        try {
            Followup followup = followUpService.startFollowup( id, followupNo, date, followupType, followupClass, followupManagerStatus,plandate,prescriptioncode);
            followUpService.getNotStartFollowup(getUID(), followup.getFollowupPlanDate());
            return success( "开始随访记录成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failed("开始随访记录失败!" + e.getMessage());
        }
    }
    @ApiOperation("获取上次随访")
    @RequestMapping(value = "/getLastFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop getLastFollowup(@ApiParam(name = "doctor", value = "医生代码", defaultValue = "443a196ef8744536a531260eb26c05d7")
                                  @RequestParam(value = "doctor", required = true) String doctor,
                                  @ApiParam(name = "patient", value = "患者代码", defaultValue = "P20161008001")
                                  @RequestParam(value = "patient", required = true) String patient,
                                  @ApiParam(name = "followClass", value = "随访类别", defaultValue = "1")
                                  @RequestParam(value = "followClass", required = true) String followClass) {
        try {
            Map<String, String> response = followUpService.getLastFollowup(doctor, patient, followClass);
            return success( "获取上次随访成功!",response);
        } catch (Exception e) {
          e.printStackTrace();
            return failed("获取上次随访失败!" + e.getMessage());
        }
    }
    @ApiOperation("复制上次随访数据")
    @RequestMapping(value = "/copyFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop copyFollowup(@ApiParam(name = "id", value = "本地随访ID", defaultValue = "")
                               @RequestParam(value = "id", required = true) Long id,
                               @ApiParam(name = "fromId", value = "拷贝随访记录ID", defaultValue = "")
                               @RequestParam(value = "fromId", required = true) Long fromId) {
        try {
            followUpService.copyFollowup(id, fromId);
            return success( "复制上次随访成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failed("复制上次随访失败!" + e.getMessage());
        }
    }
    @ApiOperation("保存全部随访表单数据")
    @RequestMapping(value = "/saveAllFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public Envelop saveAllFollowupProjectData(@ApiParam(name = "id", value = "随访记录ID")
                                             @RequestParam(value = "id", required = true) String id,
                                             @ApiParam(name = "followupNo", value = "随访记录编码")
                                             @RequestParam(value = "followupNo", required = false) String followupNo,
                                             @ApiParam(name = "date", value = "随访时间", defaultValue = "2016-12-14 20:00:00")
                                             @RequestParam(value = "date", required = false) String date,
                                             @ApiParam(name = "followupType", value = "随访方式【字典FOLLOWUP_WAY_DICT】", defaultValue = "12")
                                             @RequestParam(value = "followupType", required = false) String followupType,
                                             @ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病,3高糖】", defaultValue = "1")
                                             @RequestParam(value = "followupClass", required = false) String followupClass,
                                             @ApiParam(name = "followupManagerStatus", value = "随访管理状态【字典FOLLOWUP_MANAGER_STATUS】", defaultValue = "1")
                                             @RequestParam(value = "followupManagerStatus", required = false) String followupManagerStatus,
                                             @ApiParam(name = "plandate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
                                             @RequestParam(value = "plandate", required = false) String plandate,
                                             @ApiParam(name = "prescriptioncode", value = "续方CODE")
                                             @RequestParam(value = "prescriptioncode", required = false) String prescriptioncode,
                                             @ApiParam(name = "followupProjectData", value = "随访项目数据", defaultValue = "{\"WEIGHT\":\"76\",\"WEIGHT_EXP\":\"60\",\"BMI\":\"11\"}")
                                             @RequestParam(value = "followupProjectData", required = true) String followupProjectData) {
        try {
            JSONObject jsonObject = new JSONObject(followupProjectData);
            Followup followup = followUpService.startFollowup(id, followupNo, date, followupType, followupClass, followupManagerStatus, plandate, prescriptioncode);
            followUpService.finishFollowup(id);
            followUpService.saveAllFollowupProjectData(id, jsonObject.getJSONObject("followupProjectData").toString());
            followupDrugsService.saveFollowupDrugs(id,jsonObject.getJSONArray("drugsData").toString());
            return success( "保存随访项目数据成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failed("保存随访项目数据失败!" + e.getMessage());
        }
    }
    @RequestMapping(value = "/updateFollowStatus",produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ApiOperation("完成随访")
    @ResponseBody
    public Envelop  updateFollowStatus(@ApiParam(name = "followupId", value = "随访ID", defaultValue = "")
                                      @RequestParam(value = "followupId", required = true) Integer followupId,
                                      @ApiParam(name = "isFlag", value = "标识第一次还是N次肺结核(第一次0,n次为1)", defaultValue = "")
                                      @RequestParam(value = "isFlag", required = false)Integer isFlag)throws Exception {
        try {
            return success( "操作成功!",followUpService.updateFollowStatus(followupId,isFlag));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @RequestMapping(value = "/urlAnalysis",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("门牌解析上门地址")
    @ResponseBody
    public Envelop urlAnalysis(@ApiParam(name = "url", value = "地址解析", defaultValue = "")
                              @RequestParam(value = "url", required = true)String url)throws Exception {
        try {
            return success( "操作成功!",followUpService.urlAnalysis(url));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @RequestMapping(value = "/saveFollowupSign",produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ApiOperation("签到")
    @ResponseBody
    public Envelop saveFollowupSign(@ApiParam(name = "jsonSign", value = "签到", defaultValue = "")
                                   @RequestParam(value = "jsonSign", required = true)String jsonSign)throws Exception {
        try {
            return success("操作成功!",followUpService.saveFollowupSign(jsonSign));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @RequestMapping(value = "/updateFollowupSign",produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ApiOperation("更新签到")
    @ResponseBody
    public Envelop updateFollowupSign(@ApiParam(name = "jsonSign", value = "签到", defaultValue = "")
                                     @RequestParam(value = "jsonSign", required = true)String jsonSign)throws Exception {
        try {
            return success( "操作成功!",followUpService.updateFollowupSign(jsonSign));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @RequestMapping(value = "/findByFollowupId",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("签约详情")
    @ResponseBody
    public Envelop findByFollowupId(@ApiParam(name = "followupId", value = "签到", defaultValue = "")
                                   @RequestParam(value = "followupId", required = true)Integer followupId) {
        try {
            return success("操作成功!",followUpService.findByFollowupId(followupId));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @RequestMapping(value = "/findFollowupInfo",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("获取随访详情")
    @ResponseBody
    public Envelop findFollowupInfo(@ApiParam(name = "followupId", value = "随访ID", defaultValue = "")
                                   @RequestParam(value = "followupId", required = true)Integer followupId) {
        try {
            return success( "操作成功!",followUpService.findFollowupInfo(followupId));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @RequestMapping(value = "/delFollowup",produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ApiOperation("删除随访访视")
    @ResponseBody
    public Envelop delFollowup(@ApiParam(name = "followupId", value = "随访ID", defaultValue = "")
                              @RequestParam(value = "followupId", required = true)Integer followupId)throws Exception {
        try {
            Followup followup = followUpService.delFollowup(followupId);
            followUpService.getNotStartFollowup(getUID(), followup.getFollowupPlanDate());
            return success("操作成功!", true);
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!"+e.getMessage());
        }
    }
    @RequestMapping(value = "/saveFollowup",produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ApiOperation("保存随访访视")
    @ResponseBody
    public Envelop saveFollowup(@ApiParam(name = "jsonFollowup", value = "创建访视json", defaultValue = "")
                               @RequestParam(value = "jsonFollowup", required = true)String jsonFollowup){
        try {
            return success( "操作成功!",followUpService.saveFollowup(jsonFollowup));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!"+e.getMessage());
        }
    }
    @RequestMapping(value = "/findPatientFollowList",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("获取居民随访列表")
    @ResponseBody
    public Envelop findPatientFollowList(@ApiParam(name = "patient", value = "居民code", defaultValue = "")
                                        @RequestParam(value = "patient", required = true)String patient,
                                        @ApiParam(name = "doctor", value = "医生code", defaultValue = "")
                                        @RequestParam(value = "doctor", required = true)String doctor){
        try {
            return success("操作成功!",followUpService.findPatientFollowList(patient,doctor));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @RequestMapping(value = "/findPatientInfo",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("获取居民单条信息")
    @ResponseBody
    public Envelop findPatientInfo(@ApiParam(name = "patient", value = "居民code", defaultValue = "")
                                  @RequestParam(value = "patient", required = true)String patient) {
        try {
            return success( "操作成功!",followUpService.findPatientInfo(patient));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed("操作失败!");
        }
    }
    @RequestMapping(value = "/findFollowUpPatient",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("获取可随访居民列表")
    @ResponseBody
    public Envelop findFollowUpPatient(@ApiParam(name = "namekey", value = "居民姓名模糊", defaultValue = "")
                                      @RequestParam(value = "namekey", required = false)String namekey,
                                      @ApiParam(name = "labelCode", value = "标签code", defaultValue = "1")
                                      @RequestParam(value = "labelCode", required = false)String labelCode,
                                      @ApiParam(name = "doctor", value = "医生", defaultValue = "zjm20190214")
                                      @RequestParam(value = "doctor", required = true)String doctor,
                                      @ApiParam(name = "page", value = "页数,1开始", defaultValue = "1")
                                      @RequestParam(value = "page", required = true)Integer page,
                                      @ApiParam(name = "size", value = "每页大小", defaultValue = "10")
                                      @RequestParam(value = "size", required = true)Integer size)throws Exception {
        try {
            return success( "操作成功!",followUpService.findFollowUpPatient(namekey,doctor,labelCode,page,size));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed("操作失败!");
        }
    }
    @RequestMapping(value = "/findLabelListWithCount",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("获取随访标签列表带居民数")
    @ResponseBody
    public Envelop findLabelListWithCount(){
        try {
            return success("操作成功!",followUpService.findLabelListWithCount());
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @RequestMapping(value = "/findFollowupList",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("获取访视列表形式")
    @ResponseBody
    public Envelop findFollowupList(@ApiParam(name = "doctor", value = "医生", defaultValue = "zjm20190214")
                                   @RequestParam(value = "doctor", required = true) String doctor,
                                   @ApiParam(name = "patient", value = "居民")
                                   @RequestParam(value = "patient", required = false) String patient,
                                   @ApiParam(name = "followupClass", value = "随访类别,多类别“,”分割")
                                   @RequestParam(value = "followupClass", required = false) String followupClass,
                                   @ApiParam(name = "patientName", value = "居民姓名")
                                   @RequestParam(value = "patientName", required = false) String patientName,
                                   @ApiParam(value = "开始时间,格式(yyyy-MM-dd)", name = "startDate",required = false)
                                   @RequestParam(value = "startDate", required = false) String startDate,
                                   @ApiParam(value = "结束时间,格式(yyyy-MM-dd)", name = "endDate",required = false)
                                   @RequestParam(value = "endDate", required = false) String endDate,
                                   @ApiParam(name = "flag", value = "区分上门访视(1-是)")
                                   @RequestParam(value = "flag", required = false) String flag,
                                   @ApiParam(name = "type", value = "")
                                   @RequestParam(value = "type", required = false) Integer type){
        try {
            return success( "操作成功!",followUpService.findFollowupList(doctor,patient,followupClass,patientName,startDate,endDate,flag,type));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed("操作失败!");
        }
    }
    @RequestMapping(value = "/findFollowupByMonth",produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ApiOperation("获取访视计划按月日历形式")
    @ResponseBody
    public Envelop findFollowupByMonth(@ApiParam(name = "doctor", value = "医生", defaultValue = "zjm20190214")
                                      @RequestParam(value = "doctor", required = true) String doctor,
                                      @ApiParam(name = "patient", value = "居民")
                                      @RequestParam(value = "patient", required = false) String patient,
                                      @ApiParam(name = "followupClass", value = "随访类别,多类别“,”分割")
                                      @RequestParam(value = "followupClass", required = false) String followupClass,
                                      @ApiParam(name = "patientName", value = "居民姓名")
                                      @RequestParam(value = "patientName", required = false) String patientName,
                                      @ApiParam(value = "开始时间,格式(yyyy-MM-dd)", name = "startDate",required = false)
                                      @RequestParam(value = "startDate", required = false) String startDate,
                                      @ApiParam(value = "结束时间,格式(yyyy-MM-dd)", name = "endDate",required = false)
                                      @RequestParam(value = "endDate", required = false) String endDate,
                                      @ApiParam(name = "flag", value = "区分上门访视(1-是)")
                                      @RequestParam(value = "flag", required = false) String flag,
                                      @ApiParam(name = "type", value = "区分随访计划1、新增随访2、临时随访3、入户随访")
                                      @RequestParam(value = "type", required = false) Integer type){
        try {
            return success("操作成功!",followUpService.findFollowupByMonth(doctor,patient,followupClass,patientName,startDate,endDate,flag,type));
        }catch (Exception e){
            //日志文件中记录异常信息
            e.printStackTrace();
            //返回接口异常信息处理结果
            return failed( "操作失败!");
        }
    }
    @RequestMapping(value = "/getContinuedPrescriptionAsDoctor", method = RequestMethod.GET)
    @ApiOperation(value = "续方详情")
    public Envelop getContinuedPrescriptionAsDoctor(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
                                                   @RequestParam(required = true) @ApiParam(value = "团队长标识:1:是;2否", name = "type") String type) {
        try {
            return success( "查询成功!", followUpService.getContinuedPrescriptionAsDoctor(code));
        } catch (Exception e) {
            e.printStackTrace();
            return failed( "查询失败!");
        }
    }
    @ApiOperation("获取随访项目列表")
    @RequestMapping(value = "/getFollowupProject", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    public Envelop getFollowupProject(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
                                     @RequestParam(value = "id", required = true) String id) {
        try {
            List<Map<String, String>> list = followUpService.getFollowupProject(id);
            return success( "获取随访项目列表成功!",  list);
        } catch (Exception e) {
            e.printStackTrace();
            return failed("获取随访项目列表失败!" + e.getMessage());
        }
    }
    @ApiOperation("完成随访记录")
    @RequestMapping(value = "/finishFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public Envelop finishFollowup(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "")
                                 @RequestParam(value = "id", required = true) String id) {
        try {
            followUpService.finishFollowup(id);
            return success("完成随访记录成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failed("完成随访记录失败!" + e.getMessage());
        }
    }
    @ApiOperation("获取随访项目数据")
    @RequestMapping(value = "/getFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    public Envelop getFollowupProjectData(@ApiParam(name = "id", value = "随访记录ID", defaultValue = "4")
                                         @RequestParam(value = "id", required = true) String id,
                                         @ApiParam(name = "followupProject", value = "随访项目")
                                         @RequestParam(value = "followupProject", required = false) String followupProject) {
        try {
//            Map<String, String> response = followUpService.getFollowupProjectData(id, followupProject);
            //修改为通过ES查询---2017.11.01--huangwenjie
            FollowupContentESDO followupContentESDO = followUpService.esGetFollowupProjectDataList(id, followupProject);
            String jsonString = JSON.toJSONString(followupContentESDO);
            Map maps = (Map)JSON.parse(jsonString);
            return success( "获取随访项目数据成功!", maps);
        } catch (Exception e) {
            e.printStackTrace();
            return failed( "获取随访项目数据失败!" + e.getMessage());
        }
    }
}

+ 80 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/followUp/DoctorPhthisisFollowupController.java

@ -0,0 +1,80 @@
package com.yihu.wlyy.web.doctor.followup;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.app.followup.PhthisisFollowupService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * 医生端:肺结核随访服务控制器
 *
 * @author lith on 2019-05-05
 */
@RestController
@RequestMapping(value = "/doctor/phthisis", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "医生端-肺结核随访记录服务")
public class DoctorPhthisisFollowupController extends BaseController {
    @Autowired
    private PhthisisFollowupService phthisisFollowupService;
    @PostMapping(value = "/saveFirst")
    @ApiOperation(value = "保存第一次肺结核随访数据")
    public String saveFirstFollowup(@ApiParam(name = "jsonData", value = "随访json") @RequestParam(value = "jsonData", required = true) String jsonData) {
        StringBuilder errMsg = new StringBuilder();
        try {
            if(!phthisisFollowupService.saveFirstFollowup(jsonData,errMsg)){
                return error( -1, "保存第一次肺结核随访数据失败," + errMsg);
            }
        } catch (Exception e) {
            return errorResult(e);
        }
        return write(200, "保存第一次肺结核随访数据成功!");
    }
    @PostMapping(value = "/saveNTimes")
    @ApiOperation("保存第n次肺结核随访数据")
    public String saveNTimesFollowup(@ApiParam(name = "jsonData", value = "随访json") @RequestParam(value = "jsonData", required = true) String jsonData) {
        StringBuilder errMsg = new StringBuilder();
        try {
            if(!phthisisFollowupService.saveNTimesFollowup(jsonData,errMsg)){
                return error( -1, "保存第n次肺结核随访数据失败," + errMsg);
            }
        } catch (Exception e) {
            error(e);
            return error(-1, "保存第n次肺结核随访数据失败," + e.getMessage());
        }
        return write(200, "保存第n次肺结核随访数据成功!");
    }
    @GetMapping(value = "/getFirst")
    @ApiOperation("查询第一次肺结核随访数据详情")
    public String queryFirst(@ApiParam(name = "followupId", value = "随访记录ID")
                                         @RequestParam(value = "followupId", required = true) String followupId) {
        try {
            JSONObject firstFollowupES = phthisisFollowupService.queryFirstByFollowupId(followupId);
            return write(200, "查询成功!", "data", firstFollowupES);
        } catch (Exception e) {
            return invalidUserException(e, -1, "查询失败!" + e.getMessage());
        }
    }
    @GetMapping(value = "/getNTimes")
    @ApiOperation("查询第n次肺结核随访数据详情")
    public String queryNTimes(@ApiParam(name = "followupId", value = "随访记录ID")
                                         @RequestParam(value = "followupId", required = true) String followupId) {
        try {
            List<JSONObject> ntimesFollowups = phthisisFollowupService.queryNTimesByFollowupId(followupId);
            return write(200, "查询成功!", "data", ntimesFollowups);
        } catch (Exception e) {
            return invalidUserException(e, -1, "查询失败!" + e.getMessage());
        }
    }
}

+ 378 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/followUp/DoctorVisitDetailController.java

@ -0,0 +1,378 @@
package com.yihu.rehabilitation.controller.followUp;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.rehabilitation.aop.ObserverRequired;
import com.yihu.rehabilitation.service.followUp.VisitDetailService;
import com.yihu.rehabilitation.vo.entity.FollowupSevereMentalDisorderES;
import com.yihu.rehabilitation.vo.entity.NewbornFamilyVisitRecordES;
import com.yihu.rehabilitation.vo.entity.OlderPeopleHealthCheckRecordES;
import com.yihu.rehabilitation.vo.entity.PostpartumVisitRecordES;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * 医生端:访视详情表单接口
 *
 * @author hmf on 2019-04-23
 */
@Controller
@RequestMapping(value = "/doctor/visitDetail", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-访视详情表单接口")
public class DoctorVisitDetailController extends EnvelopRestEndpoint {
    @Autowired
    private VisitDetailService visitDetailService;
    @ApiOperation("保存孕产妇访视详情")
    @RequestMapping(value = "/savePostpartumVisitDetails", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop savePostpartumVisitDetails(@ApiParam(name = "followupId", value = "随访记录ID")
                                             @RequestParam(value = "followupId", required = true) String followupId,
                                              @ApiParam(name = "followupProject", value = "随访项目")
                                             @RequestParam(value = "followupProject", required = false) String followupProject,
                                              @ApiParam(name = "postpartumVisitDetails", value = "孕产妇访视详情数据")
                                             @RequestParam(value = "postpartumVisitDetails", required = true) String postpartumVisitDetails) {
        try {
            visitDetailService.savePostpartumVisitDetails(followupId, followupProject, postpartumVisitDetails, getUID());
            return success("保存孕产妇访视详情数据成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failed("保存孕产妇访视详情数据失败!" + e.getMessage());
        }
    }
    @ApiOperation("获取孕产妇访视详情")
    @RequestMapping(value = "/getPostpartumVisitDetails", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public Envelop getFollowupProjectData(@ApiParam(name = "followupId", value = "随访记录ID")
                                         @RequestParam(value = "followupId", required = true) String followupId,
                                         @ApiParam(name = "followupProject", value = "随访项目")
                                         @RequestParam(value = "followupProject", required = false) String followupProject) {
        try {
            PostpartumVisitRecordES postpartumVisitRecord = visitDetailService.getPostpartumVisitRecord(followupId, followupProject);
            return success("获取孕产妇访视详情成功!", postpartumVisitRecord);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("保存严重精神障碍患者随访记录")
    @RequestMapping(value = "/saveFollowupSevereMentalDisorder", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop saveFollowupSevereMentalDisorder(@ApiParam(name = "followupId", value = "随访记录ID")
                                             @RequestParam(value = "followupId", required = true) String followupId,
                                             @ApiParam(name = "followupProject", value = "随访项目")
                                             @RequestParam(value = "followupProject", required = false) String followupProject,
                                             @ApiParam(name = "severeMentalDisorderData", value = "严重精神障碍患者详情数据")
                                             @RequestParam(value = "severeMentalDisorderData", required = true) String severeMentalDisorderData) {
        try {
            visitDetailService.saveFollowupSevereMentalDisorder(followupId, followupProject, severeMentalDisorderData, getUID());
            return success( "保存严重精神障碍患者随访记录成功!");
        } catch (Exception e) {
           e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("获取严重精神障碍患者随访记录")
    @RequestMapping(value = "/getFollowupSevereMentalDisorder", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public Envelop getFollowupSevereMentalDisorder(@ApiParam(name = "followupId", value = "随访记录ID")
                                         @RequestParam(value = "followupId", required = true) String followupId,
                                         @ApiParam(name = "followupProject", value = "随访项目")
                                         @RequestParam(value = "followupProject", required = false) String followupProject) {
        try {
            FollowupSevereMentalDisorderES severeMentalDisorderES = visitDetailService.getFollowupSevereMentalDisorder(followupId, followupProject);
            return success( "获取严重精神障碍患者随访记录成功!", severeMentalDisorderES);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("保存老人健康体检随访记录")
    @RequestMapping(value = "/saveOlderPeopleHealthCheckRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop saveOlderPeopleHealthCheckRecord(@ApiParam(name = "followupId", value = "随访记录ID")
                                             @RequestParam(value = "followupId", required = true) String followupId,
                                             @ApiParam(name = "followupProject", value = "随访项目")
                                             @RequestParam(value = "followupProject", required = false) String followupProject,
                                             @ApiParam(name = "olderPeopleHealthCheckData", value = "老人健康体检随访记录")
                                             @RequestParam(value = "olderPeopleHealthCheckData", required = true) String olderPeopleHealthCheckData,
                                             @ApiParam(name = "bdStatus", value = "登记健康体检表状态(0-可编辑  1-不可编辑)")
                                             @RequestParam(value = "bdStatus", required = false) Integer bdStatus,
                                             @ApiParam(name = "pgStatus", value = "老年人生活自理能力评估表状态(0-可编辑  1-不可编辑)")
                                             @RequestParam(value = "pgStatus", required = false) Integer pgStatus ) {
        try {
            visitDetailService.saveOlderPeopleHealthCheckRecord(followupId, followupProject, olderPeopleHealthCheckData, getUID(),bdStatus,pgStatus);
            return success( "保存老人健康体检随访记录成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("获取老人健康体检随访记录")
    @RequestMapping(value = "/getOlderPeopleHealthCheckRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public Envelop getOlderPeopleHealthCheckRecord(@ApiParam(name = "followupId", value = "随访记录ID")
                                         @RequestParam(value = "followupId", required = true) String followupId,
                                         @ApiParam(name = "followupProject", value = "随访项目")
                                         @RequestParam(value = "followupProject", required = false) String followupProject) {
        try {
            OlderPeopleHealthCheckRecordES olderPeopleHealthCheckRecord = visitDetailService.getOlderPeopleHealthCheckRecord(followupId, followupProject);
            return success( "获取老人随访服务随访成功!",  olderPeopleHealthCheckRecord);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("保存新生儿家庭访视记录")
    @RequestMapping(value = "/saveNewbornFamilyVisitRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop saveNewbornFamilyVisitRecord(@ApiParam(name = "followupId", value = "随访记录ID")
                                                   @RequestParam(value = "followupId", required = true) String followupId,
                                                   @ApiParam(name = "followupProject", value = "随访项目")
                                                   @RequestParam(value = "followupProject", required = false) String followupProject,
                                                   @ApiParam(name = "newbornFamilyVisitRecordData", value = "新生儿家庭访视记录")
                                                   @RequestParam(value = "newbornFamilyVisitRecordData", required = true) String newbornFamilyVisitRecordData) {
        try {
            visitDetailService.saveNewbornFamilyVisitRecord(followupId, followupProject, newbornFamilyVisitRecordData, getUID());
            return success( "保存新生儿家庭访视记录成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("获取新生儿家庭访视记录")
    @RequestMapping(value = "/getNewbornFamilyVisitRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public Envelop getNewbornFamilyVisitRecord(@ApiParam(name = "followupId", value = "随访记录ID")
                                                  @RequestParam(value = "followupId", required = true) String followupId,
                                                  @ApiParam(name = "followupProject", value = "随访项目")
                                                  @RequestParam(value = "followupProject", required = false) String followupProject) {
        try {
            NewbornFamilyVisitRecordES newbornFamilyVisitRecordES = visitDetailService.getNewbornFamilyVisitRecord(followupId, followupProject);
            return success( "获取新生儿家庭访视记录成功!", newbornFamilyVisitRecordES);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("获取上次填写内容")
    @RequestMapping(value = "/getLastVisitRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    public Envelop getLastVisitRecord(@ApiParam(name = "patientCode", value = "居民code")
                                         @RequestParam(value = "patientCode", required = true) String patientCode,
                                         @ApiParam(name = "followupClass", value = "随访类别(5.产后 6.新生儿 7.严重精神病 8.80岁以上老人 9.肺结核)")
                                         @RequestParam(value = "followupClass") String followupClass) {
        try {
            JSONObject jsonObject = visitDetailService.getLastVisitRecord(patientCode, followupClass);
            return success("获取上次随访记录成功!", jsonObject);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("保存慢性妇科炎症日常随访")
    @RequestMapping(value = "/saveGynecologicalInflammationDaily", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop saveGynecologicalInflammationDaily(@ApiParam(name = "followupId", value = "随访记录ID")
                                                         @RequestParam(value = "followupId", required = true) String followupId,
                                                     @ApiParam(name = "jsonData", value = "随访表单数据", defaultValue = "{\"followup\":{\"followupDate\":\"2020-03-17\"},\"content\":{\"referralHospital\":\"2\",\"hospitalOrg\":\"\",\"hospitalOrgName\":\"医院\",\"illnessBetter\":\"1\",\"currentStatus\":\"2\",\"followClass\":\"1\"}}")
                                                   @RequestParam(value = "jsonData", required = true) String jsonData) {
        try {
            return success("保存慢性妇科炎症日常随访成功!",  visitDetailService.saveGynecologicalInflammationDaily(followupId, jsonData, getUID()));
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("获取慢性妇科炎症日常随访")
    @RequestMapping(value = "/getGynecologicalInflammationDaily", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public Envelop getGynecologicalInflammationDaily(@ApiParam(name = "followupId", value = "随访记录ID")
                                              @RequestParam(value = "followupId", required = true) String followupId) {
        try {
            JSONObject jsonObject = visitDetailService.getGynecologicalInflammationDaily(followupId);
            return success("获取慢性妇科炎症日常随访成功!",  jsonObject);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    /**
     * type:
     * BreastFollowup //4.慢性乳腺疾病日常随访
     * CerebralApoplexyFollowup //7.脑卒中日常随访
     * CoronaryFollowup//1.冠心病日常随访
     * FattyLiverFollowUp//8.脂肪肝日常随访
     * NephropathyFollowup//5.慢性肾病日常随访
     * ProstateFollowup//3.慢性前列腺疾病日常随访
     * @param followupId
     * @param type
     * @return
     */
    @ApiOperation("获取随访病种日常随访")
    @RequestMapping(value = "/selectFollowupDiseaseById", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public Envelop selectFollowupDiseaseById(@ApiParam(name = "followupId", value = "随访记录ID")
                                                    @RequestParam(value = "followupId", required = true) String followupId,
                                                    @ApiParam(name = "type", value = "病种类型")
                                                    @RequestParam(value = "type", required = true) String type) {
        try {
            JSONObject jsonObject = visitDetailService.selectFollowupDiseaseById(followupId,type);
            return success( "获取随访病种日常随访成功!", jsonObject);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    /**
     *
     * type:
     * BreastFollowup //4.慢性乳腺疾病日常随访
     * CerebralApoplexyFollowup //7.脑卒中日常随访
     * CoronaryFollowup//1.冠心病日常随访
     * FattyLiverFollowUp//8.脂肪肝日常随访
     * NephropathyFollowup//5.慢性肾病日常随访
     * ProstateFollowup//3.慢性前列腺疾病日常随访
     *
     * @param followupId
     * @param jsonData
     * @param type
     * @return
     */
    @ApiOperation("保存各类病种日常随访")
    @RequestMapping(value = "/saveFollowupDiseaseArchives", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop saveFollowupDiseaseArchives(@ApiParam(name = "followupId", value = "随访记录ID")
                                                     @RequestParam(value = "followupId", required = true) String followupId,
                                                     @ApiParam(name = "jsonData", value = "随访表单数据", defaultValue = "{\"followup\":{\"followupDate\":\"2020-03-17\"},\"content\":{\"referralHospital\":\"2\",\"hospitalOrg\":\"\",\"hospitalOrgName\":\"医院\",\"illnessBetter\":\"1\",\"currentStatus\":\"2\",\"followClass\":\"1\"}}")
                                                     @RequestParam(value = "jsonData", required = true) String jsonData,
                                                     @ApiParam(name = "type", value = "随访记录类型")
                                                         @RequestParam(value = "type", required = true) String type) {
        try {
            visitDetailService.saveFollowupDiseaseArchives(followupId, jsonData, getUID(),type);
            return success( "保存日常随访成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("保存慢性妇科炎症随访档案")
    @RequestMapping(value = "/saveGynecologicalInflammationFollowupArchives", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop saveGynecologicalInflammationFollowupArchives(@ApiParam(name = "followupId", value = "随访记录ID")
                                                     @RequestParam(value = "followupId", required = true) String followupId,
                                                     @ApiParam(name = "jsonData", value = "随访表单数据", defaultValue = "{\"followup\":{\"followupDate\":\"2020-03-17\"},\"content\":{\"referralHospital\":\"2\",\"hospitalOrg\":\"\",\"hospitalOrgName\":\"医院\",\"illnessBetter\":\"1\",\"currentStatus\":\"2\",\"followClass\":\"1\"}}")
                                                     @RequestParam(value = "jsonData", required = true) String jsonData) {
        try {
            return success( "保存慢性妇科炎症随访档案成功!", visitDetailService.saveGynecologicalInflammationFollowupArchives(followupId, jsonData, getUID()));
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("获取慢性妇科炎症随访档案")
    @RequestMapping(value = "/getGynecologicalInflammationFollowupArchives", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public Envelop getGynecologicalInflammationFollowupArchives(@ApiParam(name = "followupId", value = "随访记录ID")
                                                    @RequestParam(value = "followupId", required = true) String followupId) {
        try {
            JSONObject jsonObject = visitDetailService.getGynecologicalInflammationFollowupArchives(followupId);
            return success("获取慢性妇科炎症随访档案成功!",jsonObject);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("保存慢性阻塞性肺病--首次问卷")
    @RequestMapping(value = "/saveCOPDFirstTimeQuestionnaire", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop saveCOPDFirstTimeQuestionnaire(@ApiParam(name = "followupId", value = "随访记录ID")
                                                     @RequestParam(value = "followupId", required = true) String followupId,
                                                     @ApiParam(name = "jsonData", value = "随访表单数据")
                                                     @RequestParam(value = "jsonData", required = true) String jsonData) {
        try {
            return success( "保存慢性阻塞性肺病--首次问卷成功!", visitDetailService.saveCOPDFirstTimeQuestionnaire(followupId, jsonData, getUID()));
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("获取慢性阻塞性肺病--首次问卷")
    @RequestMapping(value = "/getCOPDFirstTimeQuestionnaire", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public Envelop getCOPDFirstTimeQuestionnaire(@ApiParam(name = "followupId", value = "随访记录ID")
                                                    @RequestParam(value = "followupId", required = true) String followupId) {
        try {
            JSONObject jsonObject = visitDetailService.getCOPDFirstTimeQuestionnaire(followupId);
            return success("获取慢性阻塞性肺病--首次问卷成功!",  jsonObject);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("保存慢性阻塞性肺病--日常随访")
    @RequestMapping(value = "/saveCOPDDailyFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    public Envelop saveCOPDDailyFollowup(@ApiParam(name = "followupId", value = "随访记录ID")
                                                 @RequestParam(value = "followupId", required = true) String followupId,
                                                 @ApiParam(name = "jsonData", value = "随访表单数据")
                                                 @RequestParam(value = "jsonData", required = true) String jsonData) {
        try {
            return success( "保存慢性阻塞性肺病--日常随访成功!", visitDetailService.saveCOPDDailyFollowup(followupId, jsonData, getUID()));
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
    @ApiOperation("获取慢性阻塞性肺病--日常随访")
    @RequestMapping(value = "/getCOPDDailyFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    public Envelop getCOPDDailyFollowup(@ApiParam(name = "followupId", value = "随访记录ID")
                                                @RequestParam(value = "followupId", required = true) String followupId) {
        try {
            JSONObject jsonObject = visitDetailService.getCOPDDailyFollowup(followupId);
            return success( "获取慢性阻塞性肺病--日常随访成功!",  jsonObject);
        } catch (Exception e) {
            e.printStackTrace();
            return failedException(e);
        }
    }
}

+ 85 - 2
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/controller/patient/PatientRehabilitationManageController.java

@ -8,6 +8,7 @@ package com.yihu.rehabilitation.controller.patient;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.specialist.rehabilitation.PatientMedicalRecordsDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationOperateRecordsDO;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientDao;
@ -27,8 +28,12 @@ import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * Created by 刘文彬 on 2018/8/30.
 */
@ -47,6 +52,8 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @RequestMapping(value = RehabilitationRequestMapping.PatientRehabilitationManage.patientRehabilitationDetail, method = RequestMethod.GET)
    @ApiOperation("康复管理-微信端-居民详情页")
@ -156,7 +163,6 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
                json.put("doctorName",doctor!=null?doctor.getName():"");
            }
            RehabilitationOperateRecordsDO rehabilitationOperateRecordsDO= toEntity(json.toString(), RehabilitationOperateRecordsDO.class);
            rehabilitationPlanService.saveRehabilitationRecord(rehabilitationOperateRecordsDO);
            return MixEnvelop.getSuccess(SpecialistMapping.api_success,rehabilitationPlanService.saveRehabilitationRecord(rehabilitationOperateRecordsDO));
        }catch (Exception e){
            e.printStackTrace();
@ -256,10 +262,87 @@ public class PatientRehabilitationManageController extends EnvelopRestEndpoint {
    public ObjEnvelop getServiceItemsAfterStop(@ApiParam(name = "planId", value = "康复计划id", required = true)
                                               @RequestParam(value = "planId", required = true)String planId){
        try {
            return rehabilitationManageService.getServiceItemsAfterStop(planId);
            return ObjEnvelop.getSuccess("操作成功",rehabilitationManageService.getServiceItemsAfterStop(planId));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @RequestMapping(value = "selectPlanDetailByPlanId", method = RequestMethod.GET)
    @ApiOperation("康复管理-查看其它服务计划")
    public Envelop selectPlanDetailByPlanId(@ApiParam(name = "planId", value = "计划id", required = true)
                                           @RequestParam(value = "planId", required = true) String planId,
                                           @ApiParam(name = "planDetailId", value = "计划详情id", required = true)
                                           @RequestParam(value = "planDetailId", required = true) String planDetailId,
                                           @ApiParam(name = "itemId", value = "服务项目code", required = true)
                                           @RequestParam(value = "itemId", required = true) String itemId) {
        try {
            return success( "请求成功!",rehabilitationManageService.selectPlanDetailByPlan(planId,planDetailId,itemId));
        } catch (Exception e) {
            e.printStackTrace();
            return failed( "请求失败");
        }
    }
    @RequestMapping(value = "selectPlanByPatient", method = RequestMethod.GET)
    @ApiOperation("康复管理-根据居民code查找康复计划")
    public Envelop calendarPlanDetailItems(@ApiParam(name = "patient", value = "居民code", required = false)
                                           @RequestParam(value = "patient", required = false)String patient,
                                           @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                           @RequestParam(value = "status", required = false)Integer status,
                                           @ApiParam(name = "planId", value = "计划id", required = false)
                                           @RequestParam(value = "planId", required = false)String planId){
        try {
            List<Map<String,Object>> result = rehabilitationManageService.selectPlanByPatient(patient,status,planId,"");
            return success("获取成功",  result);
        } catch (Exception e) {
            e.printStackTrace();
            return failed( "请求失败");
        }
    }
    @RequestMapping(value = "calendarPlanDetailItems", method = RequestMethod.GET)
    @ApiOperation("康复管理-康复计划服务项目按列表展示")
    public Envelop calendarPlanDetailItems(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = false)
                                           @RequestParam(value = "executeStartTime", required = false)String executeStartTime,
                                           @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = false)
                                           @RequestParam(value = "executeEndTime", required = false)String executeEndTime,
                                           @ApiParam(name = "planId", value = "计划id", required = true)
                                           @RequestParam(value = "planId", required = true)String planId,
                                           @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)", required = false)
                                           @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                           @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                           @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                           @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                           @RequestParam(value = "status", required = false)Integer status){
        try {
            List<Map<String,Object>> result = rehabilitationManageService.calendarPlanDetailItems(executeStartTime,executeEndTime,planId,searchTask,status,"");
            return success( "获取成功", result);
        } catch (Exception e) {
            e.printStackTrace();
            return failed( "请求失败");
        }
    }
    @RequestMapping(value = "selectByMedicalCode", method = RequestMethod.GET)
    @ApiOperation("获取医院病历")
    public Envelop selectByMedicalCode(@ApiParam(name = "medical", value = "住院code", required = true)
                                       @RequestParam(value = "medical", required = true)String medical){
        try {
            List<PatientMedicalRecordsDO> result = rehabilitationManageService.selectByMedicalCode(medical);
            try {
                String sql = "UPDATE `wlyy_patient_medical_records_rehabilitation` SET `patient_read_status`='1' WHERE (`code`='"+medical+"') ";
                jdbcTemplate.update(sql);
            }catch (Exception e){
                e.printStackTrace();
            }
            return success("操作成功", result);
        } catch (Exception e) {
            return failed( "请求失败");
        }
    }
}

business/base-service/src/main/java/com/yihu/jw/rehabilitation/GuidanceMessageLogDao.java → svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/GuidanceMessageLogDao.java


+ 17 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/PatientDiagnosisInformationDao.java

@ -0,0 +1,17 @@
package com.yihu.rehabilitation.dao;
import com.yihu.jw.entity.specialist.rehabilitation.PatientDiagnosisInformationDO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface PatientDiagnosisInformationDao extends PagingAndSortingRepository<PatientDiagnosisInformationDO, Long>,
        JpaSpecificationExecutor<PatientDiagnosisInformationDO> {
    PatientDiagnosisInformationDO findByPlanId(String planId);
    @Query("select d from PatientDiagnosisInformationDO d where d.patient = ?1 order by d.dischargeTime,d.createTime desc")
    Page<PatientDiagnosisInformationDO> findByPatient(String patient, Pageable pageRequest);
}

business/base-service/src/main/java/com/yihu/jw/rehabilitation/RehabilitationDetailAppointmentDao.java → svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/RehabilitationDetailAppointmentDao.java


business/base-service/src/main/java/com/yihu/jw/rehabilitation/RehabilitationOperateRecordsDao.java → svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/RehabilitationOperateRecordsDao.java


+ 7 - 8
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/SpecialDiseaseMessagesDao.java

@ -1,7 +1,6 @@
package com.yihu.wlyy.repository.specialist;
package com.yihu.rehabilitation.dao;
import com.yihu.wlyy.entity.message.WlyyDynamicMessages;
import com.yihu.wlyy.entity.specialist.SpecialDiseaseMessages;
import com.yihu.jw.entity.rehabilitation.SpecialDiseaseMessagesDO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@ -14,12 +13,12 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * @Auther: shi kejing
 * @Date: 2021/4/20 9:44
 */
public interface SpecialDiseaseMessagesDao extends PagingAndSortingRepository<SpecialDiseaseMessages,Long>, JpaSpecificationExecutor<SpecialDiseaseMessages> {
public interface SpecialDiseaseMessagesDao extends PagingAndSortingRepository<SpecialDiseaseMessagesDO,String>, JpaSpecificationExecutor<SpecialDiseaseMessagesDO> {
    @Query("select m from SpecialDiseaseMessages m where m.createTime>?1 and m.createTime<?2 order by m.createTime desc")
    Page<SpecialDiseaseMessages> findByTime(String createTime, String endTime, Pageable pageRequest);
    @Query("select m from SpecialDiseaseMessagesDO m where m.createTime>?1 and m.createTime<?2 order by m.createTime desc")
    Page<SpecialDiseaseMessagesDO> findByTime(String createTime, String endTime, Pageable pageRequest);
    @Query("select count(1) from SpecialDiseaseMessages m where m.createTime>?1 and m.createTime<?2")
    Integer findCountsByTime(String createTime,String endTime);
    @Query("select count(1) from SpecialDiseaseMessagesDO m where m.createTime>?1 and m.createTime<?2")
    Integer findCountsByTime(String createTime, String endTime);
}

+ 42 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/consult/EvaluateDao.java

@ -0,0 +1,42 @@
package com.yihu.rehabilitation.dao.consult;
import com.yihu.jw.entity.base.score.BaseEvaluateDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by 卓 on 2017/5/10.
 */
public interface EvaluateDao extends PagingAndSortingRepository<BaseEvaluateDO, Long>, JpaSpecificationExecutor<BaseEvaluateDO> {
    /**
     * 获取某个咨询的评分
     * @param consult
     * @return
     */
    List<BaseEvaluateDO> findByConsult(String consult);
    /**
     * 根据咨询获取实名或者匿名评分
     * @param consult
     * @return
     */
    List<BaseEvaluateDO> findByConsultAndType(String consult, int type);
    /**
     * 根据医生获取实名或者匿名评分
     * @param doctor
     * @return
     */
    List<BaseEvaluateDO> findByDoctorAndType(String doctor, int type);
    /**
     * 查找所有分数为零的接口
     */
    @Query("select a from Evaluate a where a.score =0")
    List<BaseEvaluateDO> findByScoreZero();
}

+ 28 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/consult/EvaluateLabelDao.java

@ -0,0 +1,28 @@
package com.yihu.rehabilitation.dao.consult;
import com.yihu.jw.entity.specialist.SpecialistEvaluateLabelDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by 卓 on 2017/5/10.
 */
public interface EvaluateLabelDao extends PagingAndSortingRepository<SpecialistEvaluateLabelDO, Long>, JpaSpecificationExecutor<SpecialistEvaluateLabelDO> {
    /**
     * 获取某个咨询的标签
     * @param consult
     * @return
     */
    List<SpecialistEvaluateLabelDO> findByConsult(String consult);
    /**
     * 获取某个医生的标签
     * @param doctor
     * @return
     */
    List<SpecialistEvaluateLabelDO> findByDoctor(String doctor);
}

+ 25 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/consult/EvaluateScoreDao.java

@ -0,0 +1,25 @@
package com.yihu.rehabilitation.dao.consult;
import com.yihu.jw.entity.base.score.BaseEvaluateScoreDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by 卓 on 2017/5/10.
 */
public interface EvaluateScoreDao extends PagingAndSortingRepository<BaseEvaluateScoreDO, Long>, JpaSpecificationExecutor<BaseEvaluateScoreDO> {
    int countEvaluateScoreByDoctor(String doctor);
    /**
     * 获取某个咨询的评分
     * @param consult
     * @return
     */
    List<BaseEvaluateScoreDO> findByConsult(String consult);
    List<BaseEvaluateScoreDO> findByConsultAndDoctor(String consult, String doctor);
}

+ 21 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/BusinessMappingDao.java

@ -0,0 +1,21 @@
package com.yihu.rehabilitation.dao.followUp;
import com.yihu.jw.entity.followup.BusinessMapping;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 随访记录映射表
 * @author huangwenjie
 * @date 2017/10/23 14:05
 */
public interface BusinessMappingDao extends PagingAndSortingRepository<BusinessMapping, Integer>, JpaSpecificationExecutor<BusinessMapping> {
	
	
	@Modifying
	@Query("update BusinessMapping p set p.needUpload=?1 where p.businessId=?2")
	void updateNeedUploadByBusinessId(Integer needUpload, Integer businessId);
}

+ 43 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowUpDao.java

@ -0,0 +1,43 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.rehabilitation.dao.followUp;
import com.yihu.jw.entity.followup.Followup;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
import java.util.Set;
public interface FollowUpDao extends PagingAndSortingRepository<Followup, Integer>, JpaSpecificationExecutor<Followup> {
    @Query(value = "select a.* from wlyy_followup a where a.doctor_code = ?1 and a.patient_code = ?2 and a.followup_class=?3 and a.status ='1' order by a.followup_date DESC limit 1",nativeQuery = true)
    Followup findLastFollowup(String doctors,String patientCode,String followClass) throws Exception;
    @Query("select a from Followup a where a.doctorCode = ?1 and a.patientCode = ?2 and a.followupClass = '9' order by a.followupPlanDate asc")
    List<Followup> findFollowupList(String doctor,String patientCode) throws Exception;
    @Query("select a.followupDate from Followup a where a.doctorCode = ?1 and a.patientCode = ?2 and a.followupClass = '9'" )
    List<Date> findFollowupDateList(String doctor,String patientCode) throws Exception;
    @Query("select a.status from Followup a where a.doctorCode = ?1 and a.patientCode = ?2 and a.followupClass = '9'" )
    Set findStatusList(String doctor, String patientCode) throws Exception;
    @Query("select a from Followup a where a.patientCode = ?1 and a.status <> '0' and a.doctorCode = ?2 order by a.followupPlanDate DESC")
    List<Followup> findAllPatientPlan(String patientCode,String doctorCode) throws Exception;
    @Query("select a from Followup a where a.prescriptionCode = ?1 and a.status <> '0'")
    Followup getFollowupByPrescriptionCode(String prescriptionCode);
    @Query("select a from Followup a where a.patientCode = ?1 and a.followupClass = ?2 and a.status = 1 order by a.followupDate desc")
    List<Followup> findAllByPatientCodeAndClass(String patientCode, String followupClass);
    //查询未完成有效随访计划记录
    @Query("select a from Followup a where a.doctorCode = ?1 and a.followupPlanDate between ?2 and ?3 and a.status NOT IN ('0', '1') ")
    List<Followup> getByDoctorPlan(String doctor, Date begin, Date end) throws Exception;
}

+ 26 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowUpMappingDao.java

@ -0,0 +1,26 @@
package com.yihu.rehabilitation.dao.followUp;
import com.yihu.jw.entity.followup.FollowupMapping;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 随访记录映射表
 * @author huangwenjie
 * @date 2017/10/23 14:05
 */
public interface FollowUpMappingDao extends PagingAndSortingRepository<FollowupMapping, Long>, JpaSpecificationExecutor<FollowupMapping> {
	
	List<FollowupMapping> findByNeedUpload(Integer needupload);
	
	FollowupMapping findByFollowupId(Integer followupid);
	
	@Modifying
	@Query("update FollowupMapping p set p.needUpload=?1 where p.followupId=?2")
	void updateNeedUploadByFollowupId(Integer needUpload, Integer followupId);
}

+ 24 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowupContentDao.java

@ -0,0 +1,24 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.rehabilitation.dao.followUp;
import com.yihu.jw.entity.followup.FollowupContent;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FollowupContentDao extends PagingAndSortingRepository<FollowupContent, Long>, JpaSpecificationExecutor<FollowupContent> {
    @Query("select distinct a.followupProject from FollowupContent a where a.followupId=?1")
    List<String> findProjectByFollowupId(Long followupId) throws Exception;
    List<FollowupContent> findByFollowupIdAndFollowupProject(Long followupId, String followupProject);
    List<FollowupContent> findByFollowupId(Long followupId);
}

+ 22 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowupDrugsDao.java

@ -0,0 +1,22 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.rehabilitation.dao.followUp;
import com.yihu.jw.entity.followup.FollowupDrugs;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface FollowupDrugsDao extends PagingAndSortingRepository<FollowupDrugs, Long>, JpaSpecificationExecutor<FollowupDrugs> {
    @Modifying
    @Query("delete FollowupDrugs a where a.followupId=?1")
    int deleteByFollowupId(Long followupId) throws Exception;
    List<FollowupDrugs> findByFollowupId(Long followupId) throws Exception;
}

+ 15 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/dao/followUp/FollowupSignDao.java

@ -0,0 +1,15 @@
package com.yihu.rehabilitation.dao.followUp;
import com.yihu.jw.entity.followup.FollowupSign;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2019/4/22.
 */
public interface FollowupSignDao extends PagingAndSortingRepository<FollowupSign, Integer>, JpaSpecificationExecutor<FollowupSign> {
    List<FollowupSign> findByFollowupIdAndDel(Integer followupId, Integer del);
}

+ 324 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/es/ElasticSearchHelper.java

@ -0,0 +1,324 @@
package com.yihu.rehabilitation.es;
import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.expr.SQLQueryExpr;
import com.alibaba.druid.sql.parser.SQLExprParser;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.es.es.ElasticFactory;
import io.searchbox.client.JestClient;
import io.searchbox.client.JestResult;
import io.searchbox.core.*;
import org.apache.commons.collections.CollectionUtils;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Client;
import org.nlpcn.es4sql.domain.Select;
import org.nlpcn.es4sql.jdbc.ObjectResult;
import org.nlpcn.es4sql.jdbc.ObjectResultsExtractor;
import org.nlpcn.es4sql.parse.ElasticSqlExprParser;
import org.nlpcn.es4sql.parse.SqlParser;
import org.nlpcn.es4sql.query.AggregationQueryAction;
import org.nlpcn.es4sql.query.DefaultQueryAction;
import org.nlpcn.es4sql.query.SqlElasticSearchRequestBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.*;
;
/**
 * Created by chenweida on 2017/6/2.
 */
@Component
@Scope("prototype")
public class ElasticSearchHelper {
    private Logger logger = LoggerFactory.getLogger(ElasticSearchHelper.class);
    @Autowired
    private ElasticFactory elasticFactory;
    private JestClient jestClient;
    @Value("${es.host}")
    private String esHost;
    @Autowired
    private ObjectMapper objectMapper;
    private static String[] curlCmds = new String[6];
    @PostConstruct
    public void init() {
        jestClient = elasticFactory.getJestClient();
        // curl命令格式
        String url = esHost.split(",")[0].replace("http://", "").concat("/_sql");
        curlCmds[0] = "curl";
        curlCmds[1] = url;
        curlCmds[2] = "-H";
        curlCmds[3] = "Content-Type: application/json";
        curlCmds[4] = "-d";
    }
    public <T> Boolean save(String index, String type, List<T> sources) throws IOException {
        Bulk.Builder bulk = (new Bulk.Builder()).defaultIndex(index).defaultType(type);
        sources.forEach((item) -> {
            Index indexObj = (new Index.Builder(item)).build();
            bulk.addAction(indexObj);
        });
        BulkResult br = (BulkResult)this.jestClient.execute(bulk.build());
        this.logger.debug("save flag: " + br.isSucceeded());
        return br.isSucceeded();
    }
    public Boolean save(String index, String type, String source,String errMsg) throws IOException {
        Bulk.Builder bulk = (new Bulk.Builder()).defaultIndex(index).defaultType(type);
        Index indexObj = (new Index.Builder(source)).build();
        bulk.addAction(indexObj);
        BulkResult br = (BulkResult)this.jestClient.execute(bulk.build());
        if(!br.isSucceeded()){
            this.logger.error("save flag: " + br.isSucceeded());
            errMsg = br.getErrorMessage();
        }
        return br.isSucceeded();
    }
    public Boolean saveWithCustomId(String index, String type, String source, String idFieldString,StringBuilder errMsg) throws IOException {
        Bulk.Builder bulk = (new Bulk.Builder()).defaultIndex(index).defaultType(type);
        JSONObject jsonObject = (JSONObject)(JSONObject.parse(source));
        Index indexObj = ((Index.Builder)(new Index.Builder(source)).id(jsonObject.getString(idFieldString))).build();
        bulk.addAction(indexObj);
        BulkResult br = (BulkResult)this.jestClient.execute(bulk.build());
        if(!br.isSucceeded()){
            errMsg.append(br.getJsonString());
            this.logger.error("save flag: " + br.isSucceeded() + "  " + errMsg.toString());
        }
        return br.isSucceeded();
    }
    public Boolean saveBulkWithCustomId(String index, String type, List<String> sources, String idFieldString) throws IOException {
        Bulk.Builder bulk = (new Bulk.Builder()).defaultIndex(index).defaultType(type);
        sources.forEach((item) -> {
            JSONObject jsonObject = (JSONObject)((JSONObject)JSONObject.parse(item));
            Index indexObj = ((Index.Builder)(new Index.Builder(item)).id(jsonObject.getString(idFieldString))).build();
            bulk.addAction(indexObj);
        });
        BulkResult br = (BulkResult)this.jestClient.execute(bulk.build());
        this.logger.debug("save flag: " + br.isSucceeded());
        return br.isSucceeded();
    }
    public <T> Boolean update(String index, String type, List<T> sources) throws IOException {
        Bulk.Builder bulk = (new Bulk.Builder()).defaultIndex(index).defaultType(type);
        sources.forEach((item) -> {
            JSONObject jo = new JSONObject();
            jo.put("doc", item);
//            Update indexObj = ((io.searchbox.core.Update.Builder)((io.searchbox.core.Update.Builder)((Builder)(new Builder(jo.toString())).index(index)).type(type)).id((item).getId())).build();
//            bulk.addAction(indexObj);
        });
        BulkResult br = (BulkResult)this.jestClient.execute(bulk.build());
        this.logger.debug("update flag: " + br.isSucceeded());
        return br.isSucceeded();
    }
    public Boolean updateByMap(String index, String type, List<Map<String, Object>> list) throws IOException {
        Bulk.Builder bulk = (new Bulk.Builder()).defaultIndex(index).defaultType(type);
        Iterator var10 = list.iterator();
        while(var10.hasNext()) {
            Map map = (Map)var10.next();
            JSONObject jo = new JSONObject();
            jo.put("doc", map);
            Update indexObj = ((Update.Builder)((Update.Builder)((Update.Builder)(new Update.Builder(jo.toString())).index(index)).type(type)).id(String.valueOf(map.get("id")))).build();
            bulk.addAction(indexObj);
        }
        BulkResult br = (BulkResult)this.jestClient.execute(bulk.build());
        this.logger.debug("update flag: " + br.isSucceeded());
        return br.isSucceeded();
    }
    public boolean update(String index, String type, String _id, JSONObject source) throws IOException {
        JSONObject docSource = new JSONObject();
        docSource.put("doc", source);
        Update update = ((Update.Builder)((Update.Builder)((Update.Builder)(new Update.Builder(docSource)).index(index)).type(type)).id(_id)).build();
        JestResult jestResult = this.jestClient.execute(update);
        this.logger.debug("update info: " + jestResult.isSucceeded());
        return true;
    }
    public boolean delete(String index, String type, List<Map<String, Object>> datas) throws IOException {
        Bulk.Builder bulk = (new Bulk.Builder()).defaultIndex(index).defaultType(type);
        Iterator var5 = datas.iterator();
        while(var5.hasNext()) {
            Map map = (Map)var5.next();
            if (map.containsKey("id") && map.containsKey("_id")) {
                Delete indexObj = null;
                if (null != map.get("_id")) {
                    indexObj = (new Delete.Builder(map.get("_id").toString())).build();
                } else if (null != map.get("id")) {
                    indexObj = (new Delete.Builder(map.get("id").toString())).build();
                }
                bulk.addAction(indexObj);
            }
        }
        BulkResult br = (BulkResult)this.jestClient.execute(bulk.build());
        this.logger.debug("delete data count: " + datas.size());
        this.logger.debug("delete flag: " + br.isSucceeded());
        return br.isSucceeded();
    }
    public SearchResult search(String index, String type, String queryStr) throws IOException {
        Search search = ((Search.Builder)((Search.Builder)(new Search.Builder(queryStr)).addIndex(index)).addType(type)).build();
        SearchResult result = (SearchResult)this.jestClient.execute(search);
        this.logger.info("search data count: " + result.getTotal());
        return result;
    }
    public List<Map<String, Object>> executeSQL(String sql) throws Exception {
        List<Map<String, Object>> returnModels = new ArrayList();
        SQLExprParser parser = new ElasticSqlExprParser(sql);
        SQLExpr expr = parser.expr();
        SQLQueryExpr queryExpr = (SQLQueryExpr)expr;
//        SQLBinaryExpr queryExpr = (SQLBinaryExpr)expr;
        Select select = (new SqlParser()).parseSelect(queryExpr);
        AggregationQueryAction action = null;
        DefaultQueryAction queryAction = null;
        SqlElasticSearchRequestBuilder requestBuilder = null;
        if (select.isAgg) {
            action = new AggregationQueryAction(this.elasticFactory.getTransportClient(), select);
            requestBuilder = action.explain();
        } else {
            Client client = this.elasticFactory.getTransportClient();
            queryAction = new DefaultQueryAction(client, select);
            requestBuilder = queryAction.explain();
        }
        SearchResponse response = (SearchResponse)requestBuilder.get();
        Object queryResult = null;
        if (sql.toUpperCase().indexOf("GROUP") == -1 && sql.toUpperCase().indexOf("SUM") == -1 && sql.toUpperCase().indexOf("COUNT(") == -1) {
            queryResult = response.getHits();
        } else {
            queryResult = response.getAggregations();
        }
        ObjectResult temp = (new ObjectResultsExtractor(true, true, true)).extractResults(queryResult, true);
        List<String> heads = temp.getHeaders();
        temp.getLines().stream().forEach((one) -> {
            Map<String, Object> oneMap = new HashMap();
            for(int i = 0; i < one.size(); ++i) {
                Object value = one.get(i);
                String key = (String)heads.get(i);
                oneMap.put(key, value);
            }
            returnModels.add(oneMap);
        });
        return returnModels;
    }
    public Integer executeCountSQL(String sql) throws Exception {
        SQLQueryExpr queryExpr = new SQLQueryExpr();
        Select select = (new SqlParser()).parseSelect(queryExpr);
        SqlElasticSearchRequestBuilder requestBuilder;
        if (select.isAgg) {
            AggregationQueryAction action = new AggregationQueryAction(this.elasticFactory.getTransportClient(), select);
            requestBuilder = action.explain();
        } else {
            Client client = this.elasticFactory.getTransportClient();
            DefaultQueryAction queryAction = new DefaultQueryAction(client, select);
            requestBuilder = queryAction.explain();
        }
        SearchResponse response = (SearchResponse)requestBuilder.get();
        Object queryResult;
        if (sql.toUpperCase().indexOf("GROUP") == -1 && sql.toUpperCase().indexOf("SUM") == -1 && sql.toUpperCase().indexOf("COUNT(") == -1) {
            queryResult = response.getHits();
        } else {
            queryResult = response.getAggregations();
        }
        ObjectResult temp = (new ObjectResultsExtractor(true, true, true)).extractResults(queryResult, true);
        for(int j = 0; j < temp.getLines().size(); ++j) {
            List<Object> one = (List)temp.getLines().get(j);
            for(int i = 0; i < one.size(); ++i) {
                Object value = one.get(i);
                if (value instanceof Double) {
                    Double valueTemp = (Double)value;
                    DecimalFormat df = new DecimalFormat("######0");
                    return Integer.parseInt(df.format(valueTemp));
                }
            }
        }
        return 0;
    }
    /**
     * 使用curl方式执行 es-sql 查询操作
     * @param sql
     * @return
     */
    public List<JSONObject> execCurl(String sql){
        List<JSONObject> result = new ArrayList<>();
        curlCmds[5] = sql;
        ProcessBuilder process = new ProcessBuilder(curlCmds);
        Process p;
        StringBuilder builder = new StringBuilder();
        try {
            p = process.start();
            BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String line = null;
            while ((line = reader.readLine()) != null) {
                builder.append(line);
                builder.append(System.getProperty("line.separator"));
            }
        } catch (IOException e) {
            System.out.print("error");
            e.printStackTrace();
        }
        try {
            logger.info("request curlCmds:" + objectMapper.writeValueAsString(curlCmds));
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        String esResponse = builder.toString();
        logger.info("esResponse:" + esResponse);
        JSONObject esResObj = JSONObject.parseObject(esResponse);
        if(null != esResObj){
            if(null == (esResObj.get("error"))){
                if(esResObj.getJSONObject("_shards").getIntValue("total") > 0){
                    List resList = JSONObject.parseObject(esResponse).getJSONObject("hits").getJSONArray("hits");
                    if(!CollectionUtils.isEmpty(resList)){
                        resList.forEach(
                                one->{
                                    JSONObject oneHit = (JSONObject)one;
                                    result.add(oneHit.getJSONObject("_source"));
                                }
                        );
                    }
                }
            }
        }
        logger.info("execCurl result:"+result.toString());
        return result;
    }
}

+ 62 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/DiagnosisInformationService.java

@ -0,0 +1,62 @@
package com.yihu.rehabilitation.service;
import com.yihu.jw.entity.specialist.rehabilitation.PatientDiagnosisInformationDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.rehabilitation.dao.PatientDiagnosisInformationDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
 * Created by humingfen on 2019/1/11.
 */
@Service
@Transactional
public class DiagnosisInformationService extends BaseJpaService<PatientDiagnosisInformationDO, PatientDiagnosisInformationDao> {
    @Autowired
    private PatientDiagnosisInformationDao diagnosisInformationDao;
    /**
     * 保存诊疗信息
     * @param diagnosisInformationDO
     * @return
     */
    public Envelop createDiagnosisInformation(PatientDiagnosisInformationDO diagnosisInformationDO) {
        Date date = new Date();
        diagnosisInformationDO.setCreateTime(date);
        diagnosisInformationDao.save(diagnosisInformationDO);
        return Envelop.getSuccess(SpecialistMapping.api_success);
    }
    /**
     * 根据康复计划查找诊疗信息
     * @param planId
     * @return
     */
    public ObjEnvelop findDiagnosisInformationByPlanId(String planId) {
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success, diagnosisInformationDao.findByPlanId(planId));
    }
    /**
     * 获取居民诊疗信息记录
     * @param patient
     * @param page
     * @param size
     * @return
     */
    public PageEnvelop findDiagnosisInformationByPatient(String patient, Integer page, Integer size) {
        PageRequest pageRequest = new PageRequest(page, size);
        Page<PatientDiagnosisInformationDO> list = diagnosisInformationDao.findByPatient(patient,pageRequest);
        return PageEnvelop.getSuccessListWithPage(SpecialistMapping.api_success, list.getContent(), page, size,list.getTotalElements());
    }
}

+ 4 - 1
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationGuidanceService.java

@ -1,6 +1,7 @@
package com.yihu.rehabilitation.service;
import com.yihu.rehabilitation.service.message.RehabilitationMessageService;
import org.springside.modules.persistence.DynamicSpecifications;
import org.springside.modules.persistence.SearchFilter;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
@ -47,6 +48,8 @@ public class RehabilitationGuidanceService {
    @Autowired
    private RehabilitationGuidancePatientDao rehabilitationGuidancePatientDao;
    @Autowired
    private RehabilitationMessageService rehabilitationMessageService;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private BasePatientDao patientDao;
@ -163,7 +166,7 @@ public class RehabilitationGuidanceService {
            rehabilitationguidancePatientDO.setIsRead(0);
            rehabilitationguidancePatientDO.setSendStatus(0);
            rehabilitationguidancePatientDO = rehabilitationGuidancePatientDao.save(rehabilitationguidancePatientDO);
            //this.sendSpecialistWeixinMessage(rehabilitationguidancePatientDO.getPatient(),rehabilitationguidancePatientDO.getDoctor(),1,rehabilitationguidancePatientDO.getArticle(),planId,null);
            rehabilitationMessageService.sendSpecialistWeixinMessage(rehabilitationguidancePatientDO.getPatient(),rehabilitationguidancePatientDO.getDoctor(),1,rehabilitationguidancePatientDO.getArticle(),planId,null);
        }
        return rehabilitationguidancePatientDOS;

+ 2 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationInfoService.java

@ -261,6 +261,8 @@ public class RehabilitationInfoService {
            String msg="first:"+first+"-----contentMsg:"+contentMsg+"-----remark:"+remark;
            logger.info("发送的信息="+msg);
            logger.info("ZSYY_Msg=" + responseMsg);
        }else if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
        }
    }

+ 78 - 47
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationManageService.java

@ -34,6 +34,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.rehabilitation.dao.*;
import com.yihu.rehabilitation.util.HtmlUtil;
import io.swagger.models.auth.In;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -120,7 +121,7 @@ public class RehabilitationManageService {
     * @param planDetailId
     */
    public ObjEnvelop appointmentConsultation(String patient,String doctor, String doctorName,
            String appointmentDoctor,String appointmentDoctorName,String sendTime, String planDetailId){
            String appointmentDoctor,String appointmentDoctorName,String sendTime, String planDetailId,String opDoctor){
        RehabilitationDetailAppointmentDO appointment = new RehabilitationDetailAppointmentDO();
        appointment.setAppointmentTime(sendTime+":00");
        appointment.setCreateTime(new Date());
@ -133,6 +134,7 @@ public class RehabilitationManageService {
        appointment.setPatient(patient);
        rehabilitationDetailAppointmentDao.save(appointment);
        return ObjEnvelop.getSuccess("获取成功",appointment);
    }
@ -581,12 +583,16 @@ public class RehabilitationManageService {
                sql+=" and i.code="+searchTask+" " ;
            }
        }
        if(taskExecutor.equals("1")){ //我的任务
        if (StringUtils.isNoneBlank(taskExecutor)){
            if(taskExecutor.equals("1")){ //我的任务
                sql+="and d.doctor='"+doctorCode+"' ";
            }
            if(taskExecutor.equals("2")){//他人任务
                sql+="and d.doctor <>'"+doctorCode+"' ";
            }
        }else {
            sql+="and d.doctor='"+doctorCode+"' ";
        }
        if(taskExecutor.equals("2")){//他人任务
            sql+="and d.doctor <>'"+doctorCode+"' ";
        }
        if(status!=null){
            sql+= " and d.status="+status;
        }
@ -796,7 +802,7 @@ public class RehabilitationManageService {
            planDetailList +=",'"+one+"'";
        }
        String planDetailResult = StringUtils.isNotEmpty(planDetailList)?planDetailList.substring(1):"";
        String sql = "select i.name,i.code,i.introduce,d.execute_time,d.hospital_name,d.id,d.status,d.type as detailType,d.expense,d.doctor as executeDoctor," +
        String sql = "select i.name,i.code,d.execute_time,d.hospital_name,d.id,d.status,d.type as detailType,d.expense,d.doctor as executeDoctor," +
                " d.doctor_name as executeDoctorName,p.patient ,p.id AS planId,p.create_user as createDoctor,p.create_user_name as createDoctorName, p.status as planStatus  " +
                " from wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id " +
@ -933,7 +939,7 @@ public class RehabilitationManageService {
        resultMap.put("appointmentDoctor",one.get("appointmentDoctor"));
        resultMap.put("appointmentDoctorName",one.get("appointmentDoctorName"));
        resultMap.put("reservationType",one.get("reservationType"));//复诊类型:1线上,2线下,3远程
        resultMap.put("executeTime",one.get("execute_time"));
        resultMap.put("frequencyCode",one.get("frequencyCode")+"");
        resultMap.put("isMyTask",isMyTask);//0不是自己的任务,1是自己的任务
//        if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){
@ -1049,12 +1055,10 @@ public class RehabilitationManageService {
    public ObjEnvelop patientRehabilitationDetail(String patientCode){
        Map<String,Object> resultMap = new HashMap<>();
        List<SignFamily> listFamiluy = signFamilyDao.findByPatientAndExpensesStatusAndStatus(patientCode,"1",1);
        String healthDoctor = null;
        String healthDoctorName =null;
        String generalDoctor = null;
        String generalDoctorName = null;
        String patientName = null;
        Integer age = null;
        String sex = null;
        String signHospitalName = null;
@ -1064,17 +1068,6 @@ public class RehabilitationManageService {
        String healthyCondition = healthyConditionList.size()>0?healthyConditionList.get(0).get("label_name")+"":"";
        String healthyConditionType = healthyConditionList.size()>0?healthyConditionList.get(0).get("label")+"":"";
        BasePatientDO patient = basePatientDao.findById(patientCode);
        if(listFamiluy.size()>0) {
            SignFamily signFamily = listFamiluy.get(0);
            healthDoctor = signFamily.getDoctorHealth();
            healthDoctorName = signFamily.getDoctorHealthName();
            generalDoctor = signFamily.getDoctor();
            generalDoctorName = signFamily.getDoctorName();
            patientName = signFamily.getName();
            signHospitalName = signFamily.getHospitalName();
        }
        //个人基础信息(康复机构)
        String patientInfoSql = " SELECT DISTINCT hospital_name from wlyy_rehabilitation_plan_detail d LEFT JOIN wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " where p.patient='"+patientCode+"' and p.status=1 ";
@ -1206,7 +1199,6 @@ public class RehabilitationManageService {
        resultMap.put("planFinish",planFinish);//已完成
        resultMap.put("healthyCondition",healthyCondition);
        resultMap.put("healthyConditionType",healthyConditionType);
        resultMap.put("patientName",patientName);
        resultMap.put("signHospitalName",signHospitalName);
        age = IdCardUtil.getAgeForIdcard(patient.getIdcard());
        sex = IdCardUtil.getSexForIdcard_new(patient.getIdcard());
@ -1324,18 +1316,22 @@ public class RehabilitationManageService {
        String doctorName = null;
        if(doctorType==1){
            SpecialistPatientRelationDO specialistPatientRelationDO = specialistPatientRelationDao.findByPatientAndDoctor(doctor,patient);
            adminTeamCode = specialistPatientRelationDO.getTeamCode();
            doctorName = specialistPatientRelationDO.getDoctorName();
            List<DoctorPatientRelationDO> specialistPatientRelationDO = doctorPatientRelationDao.findByDoctorAndPatient(doctor,patient);
            if (specialistPatientRelationDO!=null&&specialistPatientRelationDO.size()>0){
                //adminTeamCode = specialistPatientRelationDO.get(0).getTeamCode();
                doctorName = specialistPatientRelationDO.get(0).getDoctorName();
            }
        }else if(doctorType==2){
            String signFamilySql = " select f.* from wlyy_sign_family f where f.status=1 and f.expenses_status='1' and f.patient='"+patient+"'";
            List<Map<String,Object>> signFamily = jdbcTemplate.queryForList(signFamilySql);
            adminTeamCode = (Integer)signFamily.get(0).get("admin_team_code");
            doctorName = signFamily.get(0).get("doctor_name").toString();
        }
        String adminTeamSql = " select t.* from base_team t where t.del='1' and t.id="+adminTeamCode;
        List<Map<String,Object>> adminTeam = jdbcTemplate.queryForList(adminTeamSql);
        String adminTeamName = adminTeam.get(0).get("name").toString();
       /* String adminTeamSql = " select t.* from base_team t where t.del='1' and t.id="+adminTeamCode;
        List<Map<String,Object>> adminTeam = jdbcTemplate.queryForList(adminTeamSql);*/
        String adminTeamName = "";
        guidanceMessageLogDO.setAdminTeamCode(adminTeamCode);
        guidanceMessageLogDO.setAdminTeamName(adminTeamName);
        guidanceMessageLogDO.setDoctorName(doctorName);
@ -1871,7 +1867,7 @@ public class RehabilitationManageService {
        List<Frequency> frequencieList = frequencyDao.findByDel();
        return frequencieList;
    }
    public ObjEnvelop getServiceItemsAfterStop(String planId)throws Exception{
    public Map<String,Object> getServiceItemsAfterStop(String planId)throws Exception{
        Map<String,Object> reslutMap = new HashMap<>();
        String sql ="SELECT" +
                " p.patient," +
@ -1956,7 +1952,7 @@ public class RehabilitationManageService {
                reslutMap.put("mobile",patient.getMobile());
            }
        }
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,reslutMap);
        return reslutMap;
    }
    public String getCode() {
@ -2793,7 +2789,7 @@ public class RehabilitationManageService {
                        "AND pd.plan_id = '"+planId+"' AND pd.hospital_service_item_id='"+map.get("code")+"' AND ror.`status`=1 ";
                List<Map<String,Object>> mapList1 = jdbcTemplate.queryForList(sqlCount);
                int count = 0;
               /* if (map.get("code").toString().equalsIgnoreCase("6")){
                if (map.get("code").toString().equalsIgnoreCase("6")){
                    String allPlanSql = "select  wf.id as id,wf.followup_no as followupNo,wf.followup_date as followupDate,wf.followup_plan_date as followupPlanDate,wf.followup_next_date as followupNextDate,\n" +
                            "wf.followup_type as followupType,wf.followup_class as followupClass,wf.followup_manager_status as followupManagerStatus,wf.doctor_code as doctorCode,wf.doctor_name as doctorName,\n" +
                            "wf.jwdoctor_code as jwdoctorCode,wf.org_code as orgCode,wf.org_name as orgName,wf.jworg_code as jworgCode,wf.patient_code as patientCode,wf.patient_name as patientName,wf.idcard,\n" +
@ -2802,12 +2798,12 @@ public class RehabilitationManageService {
                            "and wf.patient_code = '"+map.get("patient")+"' order by wf.followup_plan_date desc";
                    List<Map<String , Object>> allPlanList = jdbcTemplate.queryForList(allPlanSql);
                    count = allPlanList.size();
                }*/
                }
                /*if (map.get("code").toString().equalsIgnoreCase("7")){
                    String allPrescrSql = "SELECT p.`name`, TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, p.sex, p.photo, pr.`status`, pr.`code`, \n" +
                            "LEFT(pr.create_time,19) AS createTime, pr.doctor, pr.min_drug_day AS minDrugDay, LEFT(pr.pres_create_time,19) AS presCreateTime \n" +
                            "FROM wlyy_prescription pr LEFT JOIN wlyy_patient p ON pr.patient = p.`code` WHERE 1=1 AND pr.patient = '"+map.get("patient")+"' AND pr.status = 100 GROUP BY pr.`code`;";
                if (map.get("code").toString().equalsIgnoreCase("7")){
                    String allPrescrSql = "SELECT p.`name`, TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, p.sex, p.photo, pr.`status`,  \n" +
                            "LEFT(pr.create_time,19) AS createTime, pr.doctor \n" +
                            "FROM wlyy_prescription pr LEFT JOIN base_patient p ON pr.patient_code = p.id WHERE 1=1 AND pr.patient_code = '"+map.get("patient")+"' AND pr.status = 100 ;";
                    List<Map<String , Object>> allPrescrList = jdbcTemplate.queryForList(allPrescrSql);
                    count = allPrescrList.size();
                }
@ -2816,7 +2812,7 @@ public class RehabilitationManageService {
                    Map<String,Object> map1 = mapList1.get(0);
                    map.put("compeletTotal",new Integer(map1.get("total").toString()) + count );
                    map.put("firstDate",map1.get("date"));
                }*/
                }
            }else {
                int codeCount = 0 ;
@ -2888,15 +2884,15 @@ public class RehabilitationManageService {
                String sqlTotal = "select count(*)\n" +
                        "from wlyy_consult a,wlyy_consult_team b where a.id = b.consult and a.patient = '"+map.get("patient")+"' and a.del = '1' and a.type=18";
                Integer consultTotal = jdbcTemplate.queryForObject(sqlTotal,Integer.class);
               /* String healthCount = "SELECT * FROM wlyy_patient_reservation WHERE incidental_msg_type = 0 AND source = 4 AND patient = '"+map.get("patient")+"' ORDER BY start_time DESC";
                /*String healthCount = "SELECT * FROM wlyy_patient_reservation WHERE incidental_msg_type = 0 AND source = 4 AND patient = '"+map.get("patient")+"' ORDER BY start_time DESC";
                List<Map<String , Object>> healthList = jdbcTemplate.queryForList(healthCount);
                map.put("healthList",healthList);
                map.put("total",consultTotal + healthList.size());*/
                map.put("healthList",healthList);*/
                map.put("total",consultTotal );
                //完成康复咨询数量
               /* sqlTotal = "select count(*)\n" +
                        "from wlyy_consult a,wlyy_consult_team b where a.code = b.consult and a.patient = '"+map.get("patient")+"' and a.del = '1' and a.type=18 and b.`status`=1";
                sqlTotal = "select count(*)\n" +
                        "from wlyy_consult a,wlyy_consult_team b where a.id = b.consult and a.patient = '"+map.get("patient")+"' and a.del = '1' and a.type=18 and b.`status`=1";
                consultTotal = jdbcTemplate.queryForObject(sqlTotal,Integer.class);
                map.put("compeletTotal",consultTotal + healthList.size());*/
                map.put("compeletTotal",consultTotal );
                //上次发起时间
                String sqlTemp ="select a.czrq\n" +
                        "from wlyy_consult a,wlyy_consult_team b where a.id = b.consult and a.patient = '"+map.get("patient")+"' and a.del = '1' and a.type=18 order by a.czrq desc limit 1";
@ -2909,16 +2905,16 @@ public class RehabilitationManageService {
                else{
                    map.put("lastDate",null);
                }
               /* //未回复康复咨询数量
                //未回复康复咨询数量
                sqlTotal="SELECT count(*) FROM wlyy.wlyy_consult_team a WHERE a.type = 18\n" +
                        "AND EXISTS ( SELECT DISTINCT t.id consultId FROM "+imDBName+".topics t, "+imDBName+".participants p, "+imDBName+".doctors d, "+imDBName+".sessions s \n" +
                        "WHERE p.participant_id = d.id AND t.session_id = p.session_id AND t.session_id = s.id\n" +
                        "AND s.type =18  AND t.`reply` = 0  AND a.consult = t.id\n" +
                        "and a.id in( select b.id from wlyy_consult a,wlyy_consult_team b \n" +
                        "where a.code = b.consult and a.patient = '"+map.get("patient")+"' and a.del = '1' and a.type=18 )\n" +
                        "where a.id = b.consult and a.patient = '"+map.get("patient")+"' and a.del = '1' and a.type=18 )\n" +
                        ")";
                Integer noReplay = jdbcTemplate.queryForObject(sqlTotal,Integer.class);
                map.put("noReplay",noReplay);*/
                map.put("noReplay",noReplay);
            }
        }
@ -3036,8 +3032,8 @@ public class RehabilitationManageService {
        Collections.sort(mapList, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                Timestamp map1value = (Timestamp) o1.get("completeTime");
                Timestamp map2value = (Timestamp) o2.get("completeTime");
                Timestamp map1value =Timestamp.valueOf (o1.get("completeTime").toString()) ;
                Timestamp map2value = Timestamp.valueOf (o2.get("completeTime").toString());
                int sort = 1;
                if (map1value.getTime() - map2value.getTime() > 0) {
                    return sort == 1 ? -1 : 1;
@ -3290,4 +3286,39 @@ public class RehabilitationManageService {
        return mapList;
    }
    /**
     *
     * @param planId 计划id
     * @param planDetailId 计划详情id
     * @param itemId 服务项目code
     * @return
     */
    public List<Map<String,Object>> selectPlanDetailByPlan(String planId,String planDetailId,String itemId){
        String sql ="SELECT * FROM wlyy_rehabilitation_plan_detail pd WHERE " +
                "pd.plan_id = '"+planId+"' " +
                "AND pd.id <>'"+planDetailId+"' " +
                "and pd.hospital_service_item_id='"+itemId+"' and status=0  order by pd.execute_time asc";
        sql = TransforSqlUtl.wlyy_rehabilitation_plan_detailAll(sql);
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        for (Map<String,Object> map:mapList){
            String doctorCode = map.get("doctor")+"";
            BaseDoctorDO doctor = baseDoctorDao.findById(doctorCode);
            List<BaseDoctorHospitalDO> depts=baseDoctorHospitalDao.findByDoctorCode(doctorCode);
            if (depts!=null&&depts.size()>0){
                map.put("hospital",depts.get(0).getOrgCode());
                map.put("hospitalName",depts.get(0).getOrgName());
                map.put("dept",depts.get(0).getDeptCode());
                map.put("deptName",depts.get(0).getDeptName());
            }
        }
        return mapList;
    }
    public Integer updateRelationCodeByDetailId(String planDetailId,String relationCode) throws Exception{
        String sql ="update wlyy_rehabilitation_plan_detail t set t.relation_code="+relationCode+" where t.id='"+planDetailId+"'";
        return  jdbcTemplate.update(sql);
    }
}

+ 24 - 26
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/RehabilitationPlanService.java

@ -15,6 +15,7 @@ import com.yihu.jw.entity.door.SignFamily;
import com.yihu.jw.entity.hospital.doctor.Frequency;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.patient.Message;
import com.yihu.jw.entity.rehabilitation.SpecialDiseaseMessagesDO;
import com.yihu.jw.entity.specialist.DoctorPatientRelationDO;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.RehabilitationServiceItemDO;
@ -66,6 +67,8 @@ import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static com.yihu.jw.entity.base.module.ModuleDO.Type.patient;
/**
 * Created by humingfen on 2018/8/22.
 */
@ -95,6 +98,8 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
    private ObjectMapper objectMapper;
    @Autowired
    private RehabilitationDetailDao rehabilitationDetailDao;
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
    @Value("${neiwang.enable}")
    private Boolean isneiwang;  //如果不是内网项目要转到到内网wlyy在上传
    @Autowired
@ -361,7 +366,9 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String nowDate = date+":00";
        System.out.println("date"+date+"===code"+code);
        Date date6 = DateUtil.strToDateLong(nowDate);
        System.out.println(date6);
        String date9 = sdf.format(date6)+" 09:00:00";//白天
        String date21 = sdf.format(date6)+" 21:00:00";//白天
        String date9s = DateUtil.getNextDay(date6,1)+" 09:00:00";//晚上
@ -706,33 +713,24 @@ public class RehabilitationPlanService extends BaseJpaService<PatientRehabilitat
    }
    public JSONObject getServiceItemsAfterStop(String planId)throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("planId", planId);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/getServiceItemsAfterStop", param);
        JSONObject result = new JSONObject(response.getContent());
        JSONObject jsonObject = new JSONObject();
        if(result.getInt("status")!=200){
            throw new Exception("请求微服务失败!");
        }
        if (result.getInt("status")==200){
            jsonObject = result.getJSONObject("obj");
            JSONArray jsonArray = jsonObject.getJSONArray("serviceList");
            if (jsonArray!=null && jsonArray.length()>0){
                jsonObject.put("patientName",jsonArray.getJSONObject(0).get("name"));
                jsonObject.put("abortTime",jsonArray.getJSONObject(0).get("abort_time"));
                jsonObject.put("hospitalName",jsonArray.getJSONObject(0).get("hospital_name"));
                jsonObject.put("abortReason",jsonArray.getJSONObject(0).get("abort_reason"));
                String patientCode = String.valueOf(jsonArray.getJSONObject(0).get("patient"));
                jsonObject.put("patientCode", patientCode);
                jsonObject.put("disease_name", jsonArray.getJSONObject(0).get("disease_name"));
                jsonObject.put("create_time", jsonArray.getJSONObject(0).get("create_time"));
                jsonObject.put("patient_img", jsonArray.getJSONObject(0).get("patient_img"));
                BasePatientDO patient = patientDao.findById(patientCode);
                if (patient!=null){
                    jsonObject.put("openid", patient.getOpenid());
                    jsonObject.put("ssc",patient.getSsc());
                    jsonObject.put("mobile",patient.getMobile());
                }
        Map<String,Object> map=rehabilitationManageService.getServiceItemsAfterStop(planId);
        JSONArray jsonArray = new JSONArray(map.get("serviceList"));
        if (jsonArray!=null && jsonArray.length()>0){
            jsonObject.put("patientName",jsonArray.getJSONObject(0).get("name"));
            jsonObject.put("abortTime",jsonArray.getJSONObject(0).get("abort_time"));
            jsonObject.put("hospitalName",jsonArray.getJSONObject(0).get("hospital_name"));
            jsonObject.put("abortReason",jsonArray.getJSONObject(0).get("abort_reason"));
            String patientCode = String.valueOf(jsonArray.getJSONObject(0).get("patient"));
            jsonObject.put("patientCode", patientCode);
            jsonObject.put("disease_name", jsonArray.getJSONObject(0).get("disease_name"));
            jsonObject.put("create_time", jsonArray.getJSONObject(0).get("create_time"));
            jsonObject.put("patient_img", jsonArray.getJSONObject(0).get("patient_img"));
            BasePatientDO patient = patientDao.findById(patientCode);
            if (patient!=null){
                jsonObject.put("openid", patient.getOpenid());
                jsonObject.put("ssc",patient.getSsc());
                jsonObject.put("mobile",patient.getMobile());
            }
        }
        return jsonObject;

+ 82 - 4
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/SpecialistEvaluateSevice.java

@ -6,13 +6,18 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.score.BaseEvaluateDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.patient.Message;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.entity.rehabilitation.RehabilitationInformationDO;
import com.yihu.jw.entity.specialist.SpecialistEvaluateLabelDO;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.im.dao.ConsultTeamDoctorDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.sign.dao.MessagesDao;
@ -21,17 +26,19 @@ import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.rehabilitation.dao.RehabilitationInformationDao;
import com.yihu.rehabilitation.dao.consult.EvaluateDao;
import com.yihu.rehabilitation.dao.consult.EvaluateScoreDao;
import com.yihu.rehabilitation.service.consult.ConsultTeamService;
import com.yihu.rehabilitation.util.ClazzReflect;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.*;
/**
 * @author wangzhinan
@ -55,6 +62,18 @@ public class SpecialistEvaluateSevice {
    private BaseOrgDao hospitalDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    EvaluateDao evaluateDao;
    @Autowired
    ConsultTeamService consultTeamService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    ConsultTeamDoctorDao consultTeamDoctorDao;
    @Autowired
    EvaluateScoreDao evaluateScoreDao;
    @Autowired
    private ImUtil ImUtill;
    /**
     * 添加评论
@ -276,5 +295,64 @@ public class SpecialistEvaluateSevice {
        return object;
    }
    /*public void saveByJson(String jsonData, String patient) {
        org.json.JSONObject jsonObject = new org.json.JSONObject(jsonData);
        String consult = jsonObject.getString("consult");
        ConsultTeamDo consultTeam = consultTeamService.findByCode(consult);
        //评价的分数
        org.json.JSONArray evaluateArray = jsonObject.getJSONArray("evaluate");
        //标签
        org.json.JSONArray labelArray = jsonObject.getJSONArray("label");
        org.json.JSONArray doctorArray = jsonObject.getJSONArray("evaluateScore");
        List<BaseEvaluateDO> evaluateList = null;
        List<SpecialistEvaluateLabelDO> evaluateLabelList = new ArrayList<>();
        Map<String, List<BaseEvaluateDO>> docEvaMap = new HashMap<>();
        //反射生成评价对象
        for (Object evaluateObj : evaluateArray) {
            BaseEvaluateDO evaluate = new BaseEvaluateDO();
            org.json.JSONObject obj = (org.json.JSONObject) evaluateObj;
            ClazzReflect clazzReflect = new ClazzReflect();
            evaluate = (BaseEvaluateDO) clazzReflect.formatToClazz(evaluate, obj);
            evaluate.setConsult(consult);
            evaluate.setPatient(patient);
            //把分数放入map中 给参与此次咨询的医生都评分
            if (docEvaMap.get(evaluate.getDoctor()) == null) {
                evaluateList = new ArrayList<>();
                evaluateList.add(evaluate);
                docEvaMap.put(evaluate.getDoctor(), evaluateList);
            } else {
                docEvaMap.get(evaluate.getDoctor()).add(evaluate);
            }
        }
        //反射得到标签内容
        for (Object labelObj : labelArray) {
            EvaluateLabel evaluateLabel = new EvaluateLabel();
            org.json.JSONObject obj = (org.json.JSONObject) labelObj;
            ClazzReflect clazzReflect = new ClazzReflect();
            evaluateLabel = (EvaluateLabel) clazzReflect.formatToClazz(evaluateLabel, obj);
            evaluateLabel.setConsult(consult);
            evaluateLabel.setPatient(patient);
            evaluateLabelList.add(evaluateLabel);
        }
        Map<String, org.json.JSONObject> doctorMap = new HashMap<>();
        //生成医生信息
        for(Object doctor : doctorArray){
            org.json.JSONObject d = (org.json.JSONObject) doctor;
            doctorMap.put((String)d.get("doctor"),d);
        }
        //计算单条得分
        evaluateScoreC(docEvaMap, consult,doctorMap);
        this.save(docEvaMap);
        evaluateLabelService.save(evaluateLabelList);
        consultTeam.setEvaluate(1);
        consultTeam.setEvaluateTime(new Date());
        org.json.JSONObject topicObject = new org.json.JSONObject();
        topicObject.put("evaluate", 1);
        topicObject.put("evaluate_time", new Date());
        ImUtill.updateTopics(consult, topicObject.toString());
        this.consultTeamService.save(consultTeam);
    }*/
}

+ 74 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/consult/ConsultService.java

@ -0,0 +1,74 @@
package com.yihu.rehabilitation.service.consult;
import com.alibaba.fastjson.JSON;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.door.SignFamily;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.ImgUtils;
import com.yihu.rehabilitation.dao.SignFamilyDao;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
@Component
@Transactional
public class ConsultService {
	@Autowired
	public BasePatientDao patientDao;
	@Autowired
	public BaseDoctorDao doctorDao;
	@Autowired
	public ConsultDao consultDao;
	@Autowired
	public ConsultTeamDao consultTeamDao;
	@Autowired
	private ImUtil imUtill;
	@Autowired
	private HttpClientUtil httpClientUtil;
	@Autowired
	private JdbcTemplate jdbcTemplate;
	/**
	 * 添加一条咨询记录
	 * @param patient 患者信息
	 * @param title 咨询标题
	 * @param type 咨询类型:1三师咨询,2视频咨询,3图文咨询,4公共咨询,5病友圈,9在线复诊,11上门服务
	 * @return
	 */
	public ConsultDo addConsult(String patient, String title, String symptoms, String images, int type) {
		ConsultDo consult = new ConsultDo();
		consult.setCzrq(new Date());
		consult.setDel("1");
		consult.setPatient(patient);
		consult.setTitle(title);
		consult.setSymptoms(symptoms);
		consult.setImages(images);
		consult.setType(type);
		return consultDao.save(consult);
	}
}

+ 799 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/consult/ConsultTeamService.java

@ -0,0 +1,799 @@
package com.yihu.rehabilitation.service.consult;
import com.alibaba.fastjson.JSON;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.im.ConsultTeamDoctorDo;
import com.yihu.jw.entity.base.im.ConsultTeamLogDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.door.SignFamily;
import com.yihu.jw.entity.followup.Followup;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.entity.rehabilitation.SpecialDiseaseMessagesDO;
import com.yihu.jw.entity.util.TransforSqlUtl;
import com.yihu.jw.hospital.HospitalDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionExpressageDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.im.dao.ConsultTeamDao;
import com.yihu.jw.im.dao.ConsultTeamDoctorDao;
import com.yihu.jw.im.dao.ConsultTeamLogDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.message.dao.MessageDao;
import com.yihu.jw.message.service.MessageService;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.rehabilitation.dao.SignFamilyDao;
import com.yihu.rehabilitation.dao.SpecialDiseaseMessagesDao;
import com.yihu.rehabilitation.dao.followUp.FollowUpDao;
import io.swagger.models.auth.In;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springside.modules.persistence.DynamicSpecifications;
import org.springside.modules.persistence.SearchFilter;
import org.springside.modules.persistence.SearchFilter.Operator;
import org.springside.modules.utils.Clock;
import javax.annotation.PostConstruct;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * 網絡諮詢类.
 * test
 *
 * @author George
 */
// Spring Service Bean的标识.
@Component
@Transactional(rollbackFor = Exception.class)
public class ConsultTeamService extends ConsultService {
    
    private Logger logger = LoggerFactory.getLogger(ConsultTeamService.class);
    private Clock clock = Clock.DEFAULT;
    // 咨询详细记录
    @Autowired
    private ConsultTeamLogDao consultTeamLogDao;
    @Autowired
    private ConsultTeamDoctorDao consultTeamDoctorDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private ConsultTeamDao consultTeamDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private SystemMessageDao messageDao;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionLogService prescriptionLogService;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    @Autowired
    private ImUtil ImUtill;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private FollowUpDao followupDao;
    @Autowired
    private MessageService messageService;
    @Autowired
    private WlyyHospitalSysDictDao systemDictDao;
    @Autowired
    private PrescriptionExpressageDao expressageDao;
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private SpecialDiseaseMessagesDao specialDiseaseMessagesDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    //健康问题 高血压
    private static final String gxy = "HP0093";
    //健康问题 糖尿病
    private static final String tnb = "HP0047";
    Map<Integer, String> relations = new HashMap<>();
    @Value("${im.im_list_get}")
    private String im_list_get;
    @Value("${im.data_base_name}")
    private String imdb;
    @PostConstruct
    public void init() {
        relations.put(0, "其他");
        relations.put(1, "父亲");
        relations.put(2, "母亲");
        relations.put(3, "老公");
        relations.put(4, "老婆");
        relations.put(5, "儿子");
        relations.put(6, "女儿");
        relations.put(7, "未知");
    }
    /**
     * 按类型查找居民的咨询记录
     * @return
     */
    public List<Map<String,Object>> findConsultRecordByType(String patient,Integer page,int pagesize,Integer type,String title){
        if(!StringUtils.isEmpty(title)){
            title="%"+title+"%";
            return findConsultNew(patient,page,pagesize,type, title);
        }else{
            return findConsultNew(patient,page,pagesize,type,"");
        }
    }
    public List<Map<String,Object>> findConsultNew(String patient, Integer page, Integer pagesize, Integer type, String title){
        String sql = "SELECT\n" +
                "\ta.id,\n" +
                "\ta.type,\n" +
                "\ta.title,\n" +
                "\ta.symptoms,\n" +
                "\ta.czrq,\n" +
                "\tb.STATUS as \"status\",\n" +
                "\tb.doctor,\n" +
                "\tb.evaluate,\n" +
                "\ta.relation_code \n" +
                "FROM\n" +
                "\twlyy_consult a,\n" +
                "\twlyy_consult_team b \n" +
                "WHERE\n" +
                "\ta.CODE = b.consult \n" ;
        // 排序
        if (org.apache.commons.lang3.StringUtils.isNoneBlank(patient)){
            sql+=" AND a.patient = '"+patient+"'";
        }
        if (type!=null){
            sql+=" AND a.type = "+type+"";
        }
        if (org.apache.commons.lang3.StringUtils.isNoneBlank(title)){
            sql+=" AND a.symptoms like '%"+title+"%'";
        }
        sql+="ORDER BY\n" +
                "\ta.czrq DESC";
        return hibenateUtils.createSQLQuery(sql,page,pagesize);
    }
    public ConsultTeamDo findByCode(String code) {
        return consultTeamDao.findByConsult(code);
    }
    /**
     * 查询居民与某个医生未结束的咨询
     *
     * @param patient 居民
     * @param doctor  医生
     * @return
     */
    public List<Map<String,Object>> getUnfinishedConsult(String patient, String doctor) {
        return findUnfinishedConsultType(patient, doctor);
    }
    public List<Map<String,Object>> findUnfinishedConsultType(String patient,String doctor){
        String sql = "SELECT\n" +
                "\ta \n" +
                "FROM\n" +
                "\twlyy_consult_team a,\n" +
                "\twlyy_consult_team_doctor b \n" +
                "WHERE\n" +
                "\ta.consult = b.consult \n" ;
        if (!StringUtils.isEmpty(patient)){
            sql+="   AND a.patient = '"+patient+"'";
        }
        if (!StringUtils.isEmpty(doctor)){
            sql+="   AND b.to_doctor = '"+doctor+"'";
        }
        sql+= "\tAND a.del = '1' \n" +
                "\tAND a.type <> 8 \n" +
                "\tAND a.STATUS = 0";
        return  hibenateUtils.createSQLQuery(sql);
    }
    public JSONObject getConsultDoctorForConsulting(String patientCode){
        JSONObject result = new JSONObject();
        String sql="SELECT DISTINCT p.patient, p.name AS patient_name, d.`id` as special_code, d.`name` as special_name \n" +
                "FROM wlyy_patient_rehabilitation_plan p, base_doctor d \n" +
                "WHERE p.patient = '"+patientCode+"' AND d.`code`= p.create_user  GROUP BY p.patient, p.create_user,p.team_code";
        sql = TransforSqlUtl.wlyy_patient_rehabilitation_planName2(sql);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        result.put("ConsultTeamList",list);
        for (Map<String,Object> map:list){
            String doctor=map.get("special_code").toString();
            List<BaseDoctorHospitalDO> depts=baseDoctorHospitalDao.findByDoctorCode(doctor);
            if (depts!=null&&depts.size()>0){
                map.put("dept",depts.get(0).getDeptCode());
                map.put("deptName",depts.get(0).getDeptName());
                map.put("org",depts.get(0).getOrgCode());
                map.put("orgName",depts.get(0).getOrgName());
            }
        }
        return result;
    }
    /**
     *   患者直接发起康复咨询
     * @param ct
     * @param patient
     * @return
     * @throws Exception
     */
    public JSONObject addRecoverConsult(ConsultTeamDo ct,String patient,String agent) throws Exception {
        JSONObject re = new JSONObject();
        if (exist(patient, ct.getType(),ct.getDoctor())) {//判断是否有未结束的咨询移到同步方法中
            re.put("status", -3);
            return re;
        }
        if (patient.equals(agent)) {
            agent = null;
        }
        //议题添加团队内所有成员
        com.alibaba.fastjson.JSONObject users = new com.alibaba.fastjson.JSONObject();
        String specialDoctorCode="";
        users.put(ct.getDoctor(), 0);
        //ct.setAdminTeamId(teamId);
        // 设置患者信息
        ct.setPatient(patient);
        // 查询患者信息
        BasePatientDO tempPatient = patientDao.findById(patient);
        // 设置患者姓名
        ct.setName(tempPatient.getName());
        // 设置患者生日
        ct.setBirthday(tempPatient.getBirthday());
        //新增性别
        ct.setSex(tempPatient.getSex());
        // 设置患者头像
        ct.setPhoto(tempPatient.getPhoto());
        // 设置操作日期
        ct.setCzrq(new Date());
        ct.setDel("1");
        ct.setStatus(0);
        ct.setEvaluate(0);
        // 医生未读数量为1
        ct.setDoctorRead(1);
        // 添加咨询记录
        ConsultDo consult = addConsult(ct.getPatient(), tempPatient.getName()+"康复咨询", ct.getSymptoms(), ct.getImages(), ct.getType());
        // 设置关联指导
        consult.setGuidance(ct.getGuidance());
        // 设置咨询标识
        ct.setConsult(consult.getId());
        //推送给IM去创建议题,取得成员消息
//        JSONObject messages = ImUtill.getCreateTopicMessage(patient, tempPatient.getName(), consult.getTitle(), "咨询问题:"+consult.getSymptoms(), consult.getImages());
        com.alibaba.fastjson.JSONObject messages = ImUtill.getCreateTopicMessage(patient, tempPatient.getName(), consult.getTitle(), consult.getSymptoms(), consult.getImages(), agent);
        users.put(patient, 0);//+ " "+(tempPatient.getSex()==1?"(男 ":"(女 ") + IdCardUtil.getAgeForIdcard(tempPatient.getIdcard())+")"
        com.alibaba.fastjson.JSONObject obj = ImUtill.createTopics(patient + "_" + ct.getDoctor() + "_" +specialDoctorCode+"_"+ ct.getType(), consult.getId(), tempPatient.getName(), users, messages, ImUtill.SESSION_TYPE_KANGFU);
        //specialDoctorCode
        if (obj == null) {
            throw new RuntimeException("IM消息发送异常!");
        }
        if (obj.getInteger("status") == -1) {//im议题创建失败
            throw new RuntimeException(obj.getString("message"));
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            SpecialDiseaseMessagesDO diseaseMessages = new SpecialDiseaseMessagesDO();
            diseaseMessages.setCode(patient);
            diseaseMessages.setName(tempPatient.getName());
            diseaseMessages.setAddress(tempPatient.getAddress());
            diseaseMessages.setCodeType("2");
            diseaseMessages.setCreateTime(sdf.format(new Date()));
            diseaseMessages.setResult("发起康复咨询");
            specialDiseaseMessagesDao.save(diseaseMessages);
        }catch (Exception e){
            logger.info("ConsultTeamService中 addRecoverConsult 方法保存出错");
            e.printStackTrace();
        }
        ct.setStartMsgId(obj.get("start_msg_id").toString());
        consultTeamDao.save(ct);
        consultDao.save(consult);
        JSONArray doctor = new JSONArray();
        for (String key : users.keySet()) {
            if (patient.equals(key)) {
                continue;
            }
            doctor.put(key);
            //记录咨询的医生详情误删
            ConsultTeamDoctorDo cd = new ConsultTeamDoctorDo();
            cd.setConsult(consult.getId());
            cd.setDel("1");
            cd.setCzrq(new Date());
            cd.setTo(key);
            consultTeamDoctorDao.save(cd);
        }
        // 保存医生咨询信息
        // 添加咨询转发记录
        // 添加医生咨询日志
        //String content = addLogs(ct);
        re.put("doctor", doctor);
        re.put("status", 1);
        return re;
    }
    /**
     * 查询患者是否还有未结束的三师咨询
     *
     * @param patient
     * @return
     */
    public boolean exist(String patient, Integer type,String doctor) throws Exception {
        String sql ="SELECT\n" +
                "\tcount( 1 ) as \"count\"\n" +
                "FROM\n" +
                "\tConsultTeam a,\n" +
                "\tConsultTeamDoctor b \n" +
                "WHERE\n" +
                "\ta.consult = b.consult \n" +
                "\tAND a.STATUS = 0 \n" +
                "\tAND a.del = '1' \n" ;
        if (StringUtils.isEmpty(patient)){
            sql+=" and a.patient = '"+patient+"'";
        }
        if (StringUtils.isEmpty(doctor)){
            sql+=" and b.to_doctor = '"+doctor+"'";
        }
        if (type!=null){
            sql+=" and a.type = "+type+"";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        int count = list==null?0:list.size();
        return count > 0;
    }
    /**
     * 患者端
     * 添加三师咨询
     *
     * @param ct      三师咨询对象
     * @param patient 患者标识
     * @return
     * @throws Exception
     */
    public JSONObject addTeamConsult(ConsultTeamDo ct, String patient,String agent) throws Exception {
        JSONObject re = new JSONObject();
        if (exist(patient, ct.getType(),ct.getDoctor())) {//判断是否有未结束的咨询移到同步方法中
            re.put("status", -3);
            return re;
        }
        com.alibaba.fastjson.JSONObject users = new  com.alibaba.fastjson.JSONObject ();
        if (patient.equals(agent)) {
            agent = null;
        }
      /*  // 咨询三师
        if (ct.getType() == 1) {
            // 查询三师签约信息
            SignFamily sc = signFamilyDao.findBySanshiPatientYes(patient);
            if (sc == null) {
                // 不存在三师签约
                re.put("status", -2);
                return re;
            }
            ct.setTeam(sc.getTeamCode());
            // 设置健康管理师,三师咨询默认给健康管理师处理
            //查找病人所在的团队
            DoctorTeam doctorTeam = doctorTeamDao.findBySanshiParientCode(patient);
            //得到团队的健康管理师
            DoctorTeamMember doctorTeamMemberHealthy = doctorTeamDoctor.findDoctorSanshi2ByTeam(doctorTeam.getCode(), 3);
            DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findDoctorSanshi2ByTeam(doctorTeam.getCode(), 2);
            if (doctorTeamMemberHealthy == null) {
                ct.setDoctor(doctorTeamMember.getMemberCode());
                users.put(doctorTeamMember.getMemberCode(), 0);
            } else {
                users.put(doctorTeamMemberHealthy.getMemberCode(), 0);
                if (doctorTeamMember != null) {
                    if (users.isNull(doctorTeamMember.getMemberCode())) {
                        users.put(doctorTeamMember.getMemberCode(), 1);
                    }
                }
                ct.setDoctor(doctorTeamMemberHealthy.getMemberCode());
            }
            // 设置家庭医生
            ct.setAdminTeamId(sc.getAdminTeamId());
        } else if (ct.getType() == 2) {
            // 咨询家庭医生
            SignFamily sf = signFamilyDao.findByjiatingPatient(patient);
            if (sf == null) {
                // 不存在家庭签约
                re.put("status", -1);
                return re;
            }
            ct.setTeam(sf.getTeamCode());
            // 设置健康管理师,家庭医生咨询默认给健康管理师处理
            //查找病人所在的团队
            //1.3.3.2 更改从签约记录判断团队成员,分配建管师
            if (org.apache.commons.lang3.StringUtils.isNotBlank(sf.getDoctorHealth())) {
                users.put(sf.getDoctorHealth(), 0);
                ct.setDoctor(sf.getDoctorHealth());
                if (org.apache.commons.lang3.StringUtils.isNotBlank(sf.getDoctor())) {
                    if (users.isNull(sf.getDoctor())) {
                        //全科需要判断是否开启健管师邀请后在接收消息
                        int isGetMessage = 1;
                        if (!messageService.getMessageNoticeSettingByMessageType(sf.getDoctor(), "1", MessageNoticeSetting.MessageTypeEnum.familyTopicSwitch.getValue())) {
                            isGetMessage = 0;
                        }
                        users.put(sf.getDoctor(), isGetMessage);
                    }
                }
            } else {
                ct.setDoctor(sf.getDoctor());
                users.put(sf.getDoctor(), 0);
            }
//            DoctorTeam doctorTeam = doctorTeamDao.findByParientCode(patient);
//            //得到团队的健康管理师
//            DoctorTeamMember doctorTeamMemberHealthy = doctorTeamDoctor.findDoctorJiating2ByTeam(doctorTeam.getCode(), 3);
//            DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findDoctorJiating2ByTeam(doctorTeam.getCode(), 2);
//            if (doctorTeamMemberHealthy == null) {
//                ct.setDoctor(doctorTeamMember.getMemberCode());
//                users.put(doctorTeamMember.getMemberCode(), 0);
//            } else {
//                users.put(doctorTeamMemberHealthy.getMemberCode(), 0);
//                if (doctorTeamMember != null) {
//                    //全健同一个人导致会话成员状态问题处理
//                    if (users.isNull(doctorTeamMember.getMemberCode())) {
//                        users.put(doctorTeamMember.getMemberCode(), 1);
//                    }
//                }
//                ct.setDoctor(doctorTeamMemberHealthy.getMemberCode());
//            }
            // 设置家庭医生
            ct.setAdminTeamId(sf.getAdminTeamId());
        }*/
        // 设置患者信息
        ct.setPatient(patient);
        // 查询患者信息
        BasePatientDO tempPatient = patientDao.findById(patient);
        // 设置患者姓名
        ct.setName(tempPatient.getName());
        // 设置患者生日
        ct.setBirthday(tempPatient.getBirthday());
        //新增性别
        ct.setSex(tempPatient.getSex());
        // 设置患者头像
        ct.setPhoto(tempPatient.getPhoto());
        // 设置操作日期
        ct.setCzrq(new Date());
        ct.setDel("1");
        ct.setStatus(0);
        ct.setEvaluate(0);
        // 医生未读数量为1
        ct.setDoctorRead(1);
        // 添加咨询记录
        ConsultDo consult = addConsult(ct.getPatient(), null, ct.getSymptoms(), ct.getImages(), ct.getType());
        // 设置关联指导
        consult.setGuidance(ct.getGuidance());
        // 设置咨询标识
        ct.setConsult(consult.getId());
        //推送给IM去创建议题,取得成员消息
//        JSONObject messages = ImUtill.getCreateTopicMessage(patient, tempPatient.getName(), consult.getTitle(), "咨询问题:"+consult.getSymptoms(), consult.getImages());
        com.alibaba.fastjson.JSONObject messages = ImUtill.getCreateTopicMessage(patient, tempPatient.getName(), consult.getTitle(), consult.getSymptoms(), consult.getImages(), agent);
        users.put(patient, 0);//+ " "+(tempPatient.getSex()==1?"(男 ":"(女 ") + IdCardUtil.getAgeForIdcard(tempPatient.getIdcard())+")"
        com.alibaba.fastjson.JSONObject  obj = ImUtill.createTopics(patient + "_" + ct.getTeam() + "_" + ct.getType(), consult.getId(), tempPatient.getName(), users, messages, ImUtill.SESSION_TYPE_MUC);
        if (obj == null) {
            throw new RuntimeException("IM消息发送异常!");
        }
        if (obj.getInteger("status") == -1) {//im议题创建失败
            throw new RuntimeException(obj.getString("message"));
        }
        ct.setStartMsgId(obj.get("start_msg_id").toString());
        consultTeamDao.save(ct);
        consultDao.save(consult);
        JSONArray doctor = new JSONArray();
        for (String key : users.keySet()) {
            if (patient.equals(key)) {
                continue;
            }
            doctor.put(key);
            //记录咨询的医生详情误删
            ConsultTeamDoctorDo cd = new ConsultTeamDoctorDo();
            cd.setConsult(consult.getId());
            cd.setDel("1");
            cd.setCzrq(new Date());
            cd.setTo(key);
            consultTeamDoctorDao.save(cd);
        }
        // 保存医生咨询信息
        // 添加咨询转发记录
        // 添加医生咨询日志
        //String content = addLogs(ct);
        re.put("doctor", doctor);
        re.put("status", 1);
        return re;
    }
    /**
     * 进入咨询
     *
     * @param consult
     * @param patient
     * @param agent
     * @return
     */
    public int intoTopic(String consult, String patient, String agent) throws Exception {
        ConsultTeamDo ct = consultTeamDao.findByConsult(consult);
        if (ct.getStatus() != 0) {
            return -1;
        }
        String content = "进入了咨询";
        BasePatientDO p = patientDao.findById(patient);
        String intoUserName = p.getName();
        if (patient.equals(agent)) {
            content = intoUserName + content;
        } /*else {
            PatientFamilyMember familyMember = familyMemberDao.findByPatientAndFamilyMember(patient, agent);
            Patient member = patientDao.findByCode(agent);
            content = member.getName() + "(" + relations.get(familyMember.getFamilyRelation()) + ")" + content;
        }*/
        ImUtill.sendIntoTopicIM(ct.getPatient(), ct.getPatient(), ct.getConsult(), content, agent, intoUserName);
        return 0;
    }
    /**
     * 查询咨询列表
     *
     * @param patientCode 患者标志
     * @param status      咨询状态(0未结束,1已结束,-1 已取消)
     * @param pageSize    页数
     * @return
     */
    public Page<ConsultTeamDo> findByPatient(String patientCode, int status, String id, int pageSize) {
        if (pageSize <= 0) {
            pageSize = 10;
        }
        // 排序
        Sort sort = new Sort(Direction.DESC, "id");
        // 分页信息
        PageRequest pageRequest = new PageRequest(0, pageSize, sort);
        Page<ConsultTeamDo> list = null;
        switch (status) {
            case 0:
                // 未结束
                if (!StringUtils.isEmpty(id)) {
                    list = consultTeamDao.findNotFinishedBypatient(patientCode, id, pageRequest);
                } else {
                    list = consultTeamDao.findNotFinishedBypatient(patientCode, pageRequest);
                }
                break;
            case 1:
                // 已结束
                if (!StringUtils.isEmpty(id)) {
                    list = consultTeamDao.findFinishedBypatient(patientCode, id, pageRequest);
                } else {
                    list = consultTeamDao.findFinishedBypatient(patientCode, pageRequest);
                }
                break;
            case -1:
                // 已取消
                if (!StringUtils.isEmpty(id)) {
                    list = consultTeamDao.findCancelBypatient(patientCode, id, pageRequest);
                } else {
                    list = consultTeamDao.findCancelBypatient(patientCode, pageRequest);
                }
                break;
        }
        return list;
    }
    /**
     * 取消三师咨询
     *
     * @param consult
     * @return
     */
    public int cancel(String consult) {
        return consultTeamDao.cancel(consult);
    }
    public int finishConsult(String consult, String endOperator, int endType) throws Exception {
        ConsultTeamDo consultTeam = consultTeamDao.findByConsult(consult);
        ConsultDo cons = consultDao.findOne(consult);
        if (consultTeam.getStatus() == 1) {
            return -1;
        }
        //新增续方咨询结束判断 (续方未审核时不可由医生或居民关闭)
        if (consultTeam.getType() == 8) {
            WlyyPrescriptionDO prescription = prescriptionDao.findOne(consultTeam.getRelationCode());
            if (prescription.getStatus() == 0) {
                return -2;
            }
        }
        String endName = "";
        String endId = "";
        //结束咨询才发送推送给IM文字消息
        if (endType == 1) {
            BasePatientDO p = patientDao.findById(endOperator);
            endName = p.getName();
            endId = p.getId();
        } else {
            if (endOperator.equals("admin")) {
                endId = "system";
                endName = "咨询超时未回复,系统自动";
            } else {
                BaseDoctorDO d = doctorDao.findById(endOperator);
                endId = d.getId();
                endName = d.getName();
            }
        }
        com.alibaba.fastjson.JSONObject obj = ImUtill.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
        if (obj == null) {
            throw new RuntimeException("IM消息结束异常!");
        }
        if (obj.getInteger("status") == -1) {
            throw new RuntimeException(String.valueOf(obj.get("message")));
        }
        //结束咨询才发送推送给IM文字消息
        if (endType == 1) {
            BasePatientDO p = patientDao.findById(endOperator);
            endName = p.getName();
            if (consultTeam.getType() == 2 || consultTeam.getType() == 8) {
                /*String openId = p.getOpenid();
                WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_survey", "zxpj");
                String first = templateConfig.getFirst();
                first = first.replace("key1", (endName == null ? "" : endName));
                String keyword1 = templateConfig.getKeyword1();
                JSONObject json = new JSONObject();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                json.put("keyword1", keyword1);
                json.put("keyword2", sdf.format(new Date()));
                json.put("toUser", p.getCode());
                json.put("represented", p.getCode());//被代理人
                json.put("remark", "");
                json.put("consult", consult);
//                String first = endName + ",您好!您有1条";;
                if (consultTeam.getType() == 8) {
//                    first += "续方";
                    first = first.replace("key2", "续方");
                } else {
                    first = first.replace("key2", "");
                }
//                first += "咨询已结束,请及时对咨询医生进行评价。";
                json.put("first", first);
                if (org.apache.commons.lang3.StringUtils.isNotBlank(p.getOpenid())) {
                    pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 17, openId, p.getName(), json);
                } else {
                    //发送代理人
                    JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(p.getCode(), p.getOpenid());
                    if (jsonArray != null && jsonArray.length() > 0) {
                        for (int i = 0; i < jsonArray.length(); i++) {
                            JSONObject j = jsonArray.getJSONObject(i);
                            Patient member = (Patient) j.get("member");
                            JSONObject data = json;
                            data.remove("toUser");
                            data.put("toUser", member.getCode());
                            data.remove("first");
                            data.put("first", weiXinOpenIdUtils.getTitleMes(p, j.getInt("relation"), p.getName()) + first);
                            pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 17, member.getOpenid(), p.getName(), data);
                        }
                    }
                }*/
            }
        } else {
            /*if (consultTeam.getType() == 2 || consultTeam.getType() == 8) {
                BasePatientDO p = patientDao.findById(consultTeam.getPatient());
                String name = p.getName();
                String openId = p.getOpenid();
                WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_survey", "zxpj");
                if (endOperator.equals("admin")) {
                    templateConfig = templateConfigDao.findByScene("template_doctor_survey", "zxcspj");
                }
                String first = templateConfig.getFirst();
                first = first.replace("key1", (name == null ? "" : name));
                String keyword1 = templateConfig.getKeyword1();
                JSONObject json = new JSONObject();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                json.put("keyword1", keyword1);
                json.put("keyword2", sdf.format(new Date()));
                json.put("toUser", p.getCode());
                json.put("represented", p.getCode());//被代理人
                json.put("remark", "");
                json.put("consult", consult);
//                String first = name + ",您好!您有1条";;
                if (consultTeam.getType() == 8) {
//                    first += "续方";
                    first = first.replace("key2", "续方");
                } else {
                    first = first.replace("key2", "");
                }
                *//*if (endOperator.equals("admin")) {
                    first += "咨询超时未回复,系统自动关闭,请及时对咨询医生进行评价。";
                }else {
                    first += "咨询已结束,请及时对咨询医生进行评价。";
                }*//*
                json.put("first", first);
                if (org.apache.commons.lang3.StringUtils.isNotBlank(p.getOpenid())) {
                    pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 17, openId, p.getName(), json);
                } else {
                    //发送代理人
                    JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(p.getCode(), p.getOpenid());
                    if (jsonArray != null && jsonArray.length() > 0) {
                        for (int i = 0; i < jsonArray.length(); i++) {
                            JSONObject j = jsonArray.getJSONObject(i);
                            Patient member = (Patient) j.get("member");
                            JSONObject data = json;
                            data.remove("toUser");
                            data.put("toUser", member.getCode());
                            data.remove("first");
                            data.put("first", weiXinOpenIdUtils.getTitleMes(p, j.getInt("relation"), p.getName()) + first);
                            pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 17, member.getOpenid(), p.getName(), data);
                        }
                    }
                }
            }*/
        }
        consultTeam.setEndMsgId(obj.getString("id"));
        cons.setEndTime(new Date());
        consultTeam.setEndTime(new Date());
        consultTeam.setStatus(1);
        consultDao.save(cons);
        consultTeamDao.save(consultTeam);
        return 1;
    }
}

+ 1723 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/followUp/FollowUpService.java

@ -0,0 +1,1723 @@
package com.yihu.rehabilitation.service.followUp;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.followup.*;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.es.es.ElasticFactory;
import com.yihu.jw.es.es.ElastricSearchSave;
import com.yihu.jw.es.util.ElasticsearchUtil;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.dict.service.WlyyHospitalSysDictService;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionExpressageDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.message.dao.MessageDao;
import com.yihu.jw.message.service.MessageService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.rehabilitation.dao.SignFamilyDao;
import com.yihu.rehabilitation.dao.followUp.*;
import com.yihu.rehabilitation.vo.FollowupContentESDO;
import io.searchbox.client.JestClient;
import io.searchbox.core.*;
import io.swagger.models.auth.In;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.json.JSONArray;
import org.json.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * 随访服务
 *
 * @author hzp add 2016-12-07
 */
@Component
@Transactional(rollbackOn = Exception.class)
public class FollowUpService {
    private static Logger logger = LoggerFactory.getLogger(FollowUpService.class);
    //统计随访类型
    public static String[] FOLLOWUP_TYPE = {"1","2","3","10","22"};
    //随访类别,多类别“,”分割【1.高血压 2.糖尿病 3.肿瘤 4.精神分裂症 5.产后 6.新生儿 7.严重精神病 8.80岁以上老人 9.肺结核】
    public static String[] FOLLOWUP_CLASS = {"1","2","1,2","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"};
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private FollowUpDao followupDao;
    @Autowired
    private FollowupContentDao followupContentDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private SystemMessageDao messageDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private FollowUpMappingDao followUpMappingDao;
    @Autowired
    private FollowupDrugsDao followupDrugsDao;
    @Autowired
    private SystemMessageService messageService;
    @Autowired
    private ObjectMapper objectMapper;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    @Autowired
    private WlyyHospitalSysDictService wlyyHospitalSysDictService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private ElasticsearchUtil elasticsearchUtil;
    @Autowired
    private ElasticFactory elasticFactory;
    @Autowired
    private SystemMessageDao systemMessageDao;
    @Value("${es.type.FollowUpContent}")
    private String esType;
    @Value("${es.index.FollowUp}")
    private String esIndex;
    @Autowired
    private ElastricSearchSave elastricSearchSave;
    @Autowired
    BusinessMappingDao businessMappingDao;
    @Autowired
    private FollowupSignDao followupSignDao;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    @Autowired
    private PrescriptionExpressageDao prescriptionExpressageDao;
    @Autowired
    private EnterpriseService enterpriseService;
    @Value("${wechat.id}")
    private String  wxId;
    /**
     * 新增随访计划(批量)
     */
    @Transactional
    public Iterable<Followup> addFollowupPlan(String doctorCode, String patientCode, String data) throws Exception {
        //批量随访计划
        System.out.println("data=="+data);
        JavaType javaType = objectMapper.getTypeFactory().constructParametricType(List.class, Map.class);
        List<Map<String, String>> list = objectMapper.readValue(data, javaType);
        if (list != null && list.size() > 0) {
            //获取患者信息
            BasePatientDO patient = patientDao.findById(patientCode);
            if (patient == null) {
                throw new Exception("not exit patient:" + patientCode + ".\r\n");
            }
            List<Followup> followupPlan = new ArrayList<>();
            for (Map<String, String> map : list) {
                //获取医生信息
                BaseDoctorDO doctor = doctorDao.findById(map.get("doctor"));
                List<BaseDoctorHospitalDO> depts=baseDoctorHospitalDao.findByDoctorCode(map.get("doctor"));
                if (doctor == null) {
                    throw new Exception("not exit doctor:" + doctorCode + ".\r\n");
                }
                Followup followup = new Followup();
                followup.setFollowupType(String.valueOf(map.get("type")));
                Date date = DateUtil.strToDate(map.get("date"));
                followup.setFollowupDate(date);
                followup.setFollowupPlanDate(date);
                followup.setDoctorCode(doctor.getId());
                followup.setDoctorName(doctor.getName());
                if (depts!=null&&depts.size()>0){
                    followup.setOrgCode(depts.get(0).getOrgCode());
                    followup.setOrgName(depts.get(0).getOrgName());
                }
                followup.setPatientCode(patientCode);
                followup.setPatientName(patient.getName());
                followup.setIdcard(patient.getIdcard());
                followup.setDataFrom("2");//数据来源 1基卫 2APP
                followup.setStatus("2");     //状态 0取消 1已完成 2未开始 3进行中
                followup.setCreateTime(new Date());
                followup.setCreater(doctorCode);
                followup.setFollowupClass(map.get("followupClass"));
                followup.setType(Integer.parseInt(map.get("type1").toString()));
                //followup.setAdminTeamCode(adminCodeId);
                followup.setSignType(2);
                /*//获取随访医生角色类型
                DoctorMappingDO doctorMapping = doctorMappingDao.findByDoctor(doctorCode);
                if(doctorMapping!=null){
                    followup.setJwDoctorWorkType(doctorMapping.getJwDoctorWorkType());
                }
                //新增签约保存CODE
                followup.setSignCode(patientService.getSignCodeByPatient(patientCode));*/
                followupPlan.add(followup);
            }
            return followupDao.save(followupPlan);
        }
        return null;
    }
    /**
     * 编辑随访计划
     */
    public void editFollowupPlan(String doctorCode, String id, String date, String followupType) throws Exception {
        Followup followup = followupDao.findOne(Integer.valueOf(id));
        if (followup != null) {
            Date followupDate = DateUtil.strToDate(date);
            followup.setFollowupDate(followupDate);
            followup.setFollowupPlanDate(followupDate);
            followup.setFollowupType(followupType);
            followup.setCreater(doctorCode);
            followupDao.save(followup);
        } else {
            throw new Exception("not exit follow:" + id + ".\r\n");
        }
    }
    /**
     * 开始随访记录
     */
    public Followup startFollowup(String id, String followupNo, String date, String followupType, String followupClass, String followupManagerStatus, String plandate, String prescriptioncode) throws Exception {
        Followup followup = followupDao.findOne(Integer.valueOf(id));
        if (followup != null) {
            if (followup.getStatus().compareTo("2") == 0) {
                followup.setFollowupNo(followupNo);
                followup.setFollowupDate(DateUtil.strToDate(date));
                //计划下次随访时间--huangwenjie.2017.10.19
                if (StringUtils.isNoneBlank(plandate)) {
                    followup.setFollowupNextDate(DateUtil.strToDate(plandate));
                    Followup nextFollowup = new Followup();
                    nextFollowup.setDataFrom(followup.getDataFrom());
                    nextFollowup.setStatus("2");
                    nextFollowup.setFollowupType(followupType);
                    nextFollowup.setFollowupNo(followup.getFollowupNo());
                    nextFollowup.setFollowupDate(DateUtil.strToDate(plandate));
                    nextFollowup.setFollowupPlanDate(DateUtil.strToDate(plandate));
                    nextFollowup.setJwdoctorCode(followup.getJwdoctorCode());
                    nextFollowup.setJworgCode(followup.getJworgCode());
                    nextFollowup.setOrgCode(followup.getOrgCode());
                    nextFollowup.setOrgName(followup.getOrgName());
                    nextFollowup.setCreater(followup.getCreater());
                    nextFollowup.setSignCode(followup.getSignCode());
                    nextFollowup.setAdminTeamCode(followup.getAdminTeamCode());
                    nextFollowup.setFollowupClass(followupClass);
                    nextFollowup.setFollowupManagerStatus(followupManagerStatus);
                    nextFollowup.setPatientName(followup.getPatientName());
                    nextFollowup.setPatientCode(followup.getPatientCode());
                    nextFollowup.setCreateTime(new Date());
                    nextFollowup.setUpdateTime(new Date());
                    nextFollowup.setDoctorCode(followup.getDoctorCode());
                    nextFollowup.setDoctorName(followup.getDoctorName());
                    nextFollowup.setIdcard(followup.getIdcard());
                    nextFollowup.setSignType(followup.getSignType());
                    nextFollowup.setType(1);
                    followupDao.save(nextFollowup);
                }
                followup.setFollowupType(followupType);
                followup.setFollowupClass(followupClass);
                followup.setFollowupManagerStatus(followupManagerStatus);
                followup.setStatus("3");  //状态 0取消 1已完成 2未开始 3进行中
                followup.setPrescriptionCode(prescriptioncode);
                if (StringUtils.isNoneBlank(prescriptioncode)) {
                    try {
                        WlyyPrescriptionDO prescription = prescriptionDao.findOne(prescriptioncode);
//                        prescription.setViewSuifang(1);
                        prescriptionDao.save(prescription);
                    } catch (Exception e) {
                        logger.info(e.getMessage());
                    }
                }
                Followup f = followupDao.save(followup);
                System.out.println("随访状态status" + f.getStatus());
                return f;
            }
            return followup;
        } else {
            throw new Exception("not exit follow:" + id + ".\r\n");
        }
    }
    /**
     * 新增临时随访记录(返回ID)
     */
    public String addFollowup(String doctorCode, String patientCode, String date, String followupType, String followupClass, String followupManagerStatus, String plandate, String prescriptioncode,Integer type) throws Exception {
        String re = "";
        //获取医生信息
        BaseDoctorDO doctor = doctorDao.findById(doctorCode);
        if (doctor == null) {
            throw new Exception("not exit doctor:" + doctorCode + ".\r\n");
        }
        //获取患者信息
        BasePatientDO patient = patientDao.findById(patientCode);
        if (patient == null) {
            throw new Exception("not exit patient:" + patientCode + ".\r\n");
        }
        List<BaseDoctorHospitalDO> depts=baseDoctorHospitalDao.findByDoctorCode(doctorCode);
        Followup followup = new Followup();
        Date followDate = DateUtil.strToDate(date);
        followup.setFollowupDate(followDate);
        followup.setFollowupPlanDate(followDate);
        followup.setDoctorCode(doctorCode);
        followup.setDoctorName(doctor.getName());
        if (depts!=null&&depts.size()>0){
            followup.setOrgCode(depts.get(0).getOrgCode());
            followup.setOrgName(depts.get(0).getOrgName());
        }
        followup.setPatientCode(patientCode);
        followup.setPatientName(patient.getName());
        followup.setIdcard(patient.getIdcard());
        followup.setFollowupType(followupType);
        followup.setFollowupClass(followupClass);
        followup.setFollowupManagerStatus(followupManagerStatus);
        followup.setDataFrom("2");//数据来源 1基卫 2APP
        followup.setStatus("2");     //状态 0取消 1已完成 2未开始 3进行中
        followup.setCreateTime(new Date());
        followup.setCreater(doctorCode);
        followup.setSignType(2);
        if (type!=null&&type!=0){
            followup.setType(type);
        }
        //如果有填入续方CODE,则添加续方关联--huangwenjie.2017.11.02
        if (StringUtils.isNotBlank(prescriptioncode)) {
            followup.setPrescriptionCode(prescriptioncode);
        }
        //计划下次随访时间--ysj.2017.10.26
        if (StringUtils.isNoneBlank(plandate)) {
            followup.setFollowupNextDate(DateUtil.strToDate(plandate));
            Followup nextFollowup = new Followup();
            nextFollowup.setDataFrom(followup.getDataFrom());
            nextFollowup.setStatus("2");
            nextFollowup.setFollowupType(followupType);
            nextFollowup.setFollowupNo(followup.getFollowupNo());
            nextFollowup.setFollowupDate(DateUtil.strToDate(plandate));
            nextFollowup.setFollowupPlanDate(DateUtil.strToDate(plandate));
            nextFollowup.setJwdoctorCode(followup.getJwdoctorCode());
            nextFollowup.setJworgCode(followup.getJworgCode());
            nextFollowup.setOrgCode(followup.getOrgCode());
            nextFollowup.setOrgName(followup.getOrgName());
            nextFollowup.setCreater(followup.getCreater());
            nextFollowup.setSignCode(followup.getSignCode());
            nextFollowup.setAdminTeamCode(followup.getAdminTeamCode());
            nextFollowup.setFollowupClass(followupClass);
            nextFollowup.setFollowupManagerStatus(followupManagerStatus);
            nextFollowup.setPatientName(followup.getPatientName());
            nextFollowup.setPatientCode(followup.getPatientCode());
            nextFollowup.setCreateTime(new Date());
            nextFollowup.setUpdateTime(new Date());
            nextFollowup.setDoctorCode(followup.getDoctorCode());
            nextFollowup.setDoctorName(followup.getDoctorName());
            nextFollowup.setIdcard(followup.getIdcard());
            nextFollowup.setSignType(followup.getSignType());
            nextFollowup.setType(type);
            followupDao.save(nextFollowup);
        }
        followupDao.save(followup);
        re = String.valueOf(followup.getId());
        return re;
    }
    /**
     * 取消随访计划
     */
    public void cancelFollowupPlan(String id) throws Exception {
        Followup followup = followupDao.findOne(Integer.valueOf(id));
        if (followup != null) {
            followup.setStatus("0");  //状态 0取消 1已完成 2未开始 3进行中
            followupDao.save(followup);
        } else {
            throw new Exception("not exit follow:" + id + ".\r\n");
        }
    }
    /**
     * 完成随访记录,并上传随访记录
     */
    public void finishFollowup(String id) throws Exception {
        Followup followup = followupDao.findOne(Integer.valueOf(id));
        if (followup != null) {
            followup.setStatus("1");  //状态 0取消 1已完成 2未开始 3进行中
            followup = followupDao.save(followup);
            //上传随访计划映射表记录
            FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(String.valueOf(followup.getId())));
            if (followupMapping == null) {
                followupMapping = new FollowupMapping();
            }
            followupMapping.setFollowupId(Integer.parseInt(String.valueOf(followup.getId())));
            followupMapping.setCode(UUID.randomUUID().toString());
            followupMapping.setCreateTime(DateUtil.getNowTimestamp());
            followupMapping.setUpdateTime(DateUtil.getNowTimestamp());
            followupMapping.setNeedUpload(1);
            followUpMappingDao.save(followupMapping);
            //随访完成,增加随访状态完成的标记
            WlyyPrescriptionDO prescription = prescriptionDao.findOne(followup.getPrescriptionCode());
            if(prescription  != null){
                //prescription.setViewSuifang(1);
                prescriptionDao.save(prescription);
            }
//            new Thread(new FollowupUploadTask(String.valueOf(followup.getId()))).start();
        } else {
            throw new Exception("not exit follow:" + id + ".\r\n");
        }
    }
    /*********************************** 随访详情 *******************************************************************/
    /**
     * 获取面访项目列表
     */
    public Map<String, String> getFollowup(String id) throws Exception {
        Map<String, String> re = new HashMap<>();
        Followup followup = followupDao.findOne(Integer.valueOf(id));
        if (followup != null) {
            re = getFollowupDetail(followup);
        } else {
            throw new Exception("not exit follow:" + id + ".\r\n");
        }
        return re;
    }
    /**
     * 获取面访项目列表
     *//*
    public List<Map<String, String>> getFollowupProject(String id) throws Exception {
        List<Map<String, String>> re = new ArrayList<>();
        //获取已填写的面访项目
//        List<String> project = followupContentDao.findProjectByFollowupId(Long.valueOf(id));
        //修改为通过ES查询---2017.11.01--huangwenjie
        List<String> project = esfindProjectByFollowupId(id);
        //获取所有面访项目
        List<WlyyHospitalSysDictDO> dictList = wlyyHospitalSysDictDao.findByDictName("FOLLOWUP_PROJECT");
        if (dictList != null && dictList.size() > 0) {
            for (WlyyHospitalSysDictDO dict : dictList) {
                Map<String, String> map = new HashMap<>();
                String code = dict.getDictCode();
                map.put("projectCode", code);
                map.put("projectName", dict.getDictValue());
                if (project != null && project.contains(code)) {
                    map.put("status", "1"); //已填写
                } else {
                    map.put("status", "0");//未填写
                }
                re.add(map);
            }
        }
        return re;
    }*/
    /**
     * 获取面访项目数据
     */
    public Map<String, String> getFollowupProjectData(String id, String followupProject) throws Exception {
        Map<String, String> re = new HashMap<>();
        List<FollowupContent> dataList = followupContentDao.findByFollowupIdAndFollowupProject(Long.valueOf(id), followupProject);
        for (FollowupContent item : dataList) {
            re.put(item.getFollowupKey(), item.getFollowupValue());
        }
        return re;
    }
    /**
     * 转译随访信息
     */
    private Map<String, String> getFollowupDetail(Followup followup) throws Exception {
        Map<String, String> re = new HashMap<>();
        //患者信息
        String patientCode = followup.getPatientCode();
        BasePatientDO patient = patientDao.findById(patientCode);
        if (patient != null) {
            re.put("patientCode", patientCode);
            re.put("patientName", patient.getName());
            re.put("idcard", patient.getIdcard());
            String mobile = patient.getMobile();
            if (StringUtils.isEmpty(mobile)) {
                mobile = patient.getMobileRemarks();
            }
            re.put("mobile", mobile);
            re.put("sex", String.valueOf(patient.getSex()));
            re.put("birthday", DateUtil.dateToStrLong(patient.getBirthday()));
            re.put("photo", patient.getPhoto());
        } else {
            throw new Exception("not exit patient:" + patientCode);
        }
        re.put("id", String.valueOf(followup.getId()));
        re.put("followupNo", followup.getFollowupNo());
        re.put("followupDate", DateUtil.dateToStrLong(followup.getFollowupDate()));
        re.put("followupNextDate", DateUtil.dateToStrLong(followup.getFollowupNextDate()));
        //随访方式转译
        re.put("followupType", followup.getFollowupType());
        String followupTypeName = wlyyHospitalSysDictService.getDictValue("FOLLOWUP_WAY_DICT", followup.getFollowupType());
        re.put("followupTypeName", followupTypeName);
        //随访类别转译
        String followupClass = followup.getFollowupClass();
        re.put("followupClass", followupClass);
        String followupClassName = wlyyHospitalSysDictService.getDictValue("FOLLOWUP_CLASS_DICT", followup.getFollowupClass());
        if (StringUtils.isNoneBlank(followupClass) && followupClass.contains(",")) {
            String[] followupClassArray = followupClass.split(",");
            followupClassName = "";
            for (int i = 0; i < followupClassArray.length; i++) {
                followupClassName += wlyyHospitalSysDictService.getDictValue("FOLLOWUP_CLASS_DICT", followupClassArray[i]);
                if (i != followupClassArray.length - 1) {
                    followupClassName += ",";
                }
            }
        }
        re.put("followupClassName", followupClassName);
        //随访管理状态转译
        re.put("followupManagerStatus", followup.getFollowupManagerStatus());
        String followupManagerStatusName = wlyyHospitalSysDictService.getDictValue("FOLLOWUP_MANAGER_STATUS", followup.getFollowupManagerStatus());
        re.put("followupManagerStatusName", followupManagerStatusName);
        re.put("doctorCode", followup.getDoctorCode());
        re.put("doctorName", followup.getDoctorName());
        re.put("orgCode", followup.getOrgCode());
        re.put("orgName", followup.getOrgName());
        re.put("dataFrom", followup.getDataFrom());
        re.put("status", followup.getStatus());
        re.put("followupContentPhone", followup.getFollowupContentPhone());
        re.put("createTime", DateUtil.dateToStrLong(followup.getCreateTime()));
        re.put("creater", followup.getCreater());
        re.put("prescriptionCode",followup.getPrescriptionCode());
        return re;
    }
    /**
     * ES获取面访项目数据列表
     *
     * @author huangwenjie
     * @date 2017/11/1 19:41
     */
    public List<String> esfindProjectByFollowupId(String id) throws Exception {
        JestClient jestClient = null;
        List<String> resultList = new ArrayList<>();
        try {
            //根据随访ID、分类ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", id))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                    .build();
            SearchResult result = jestClient.execute(search);
            List<FollowupContentESDO> followupContentESDOList = new ArrayList<>();
            followupContentESDOList = result.getSourceAsObjectList(FollowupContentESDO.class);
            if (!followupContentESDOList.isEmpty()) {
                for (FollowupContentESDO followupContentESDO : followupContentESDOList) {
                    if("2".equals(followupContentESDO.getFollowup_project())){
                        //判断血压必填
                        if(StringUtils.isNotBlank(followupContentESDO.getBP_D()) && StringUtils.isNotBlank(followupContentESDO.getBP_U())
                                &&StringUtils.isNotBlank(followupContentESDO.getBLOOD_SUGAR()) && StringUtils.isNotBlank(followupContentESDO.getBLOOD_SUGAR_TYPE())){
                            resultList.add(followupContentESDO.getFollowup_project());
                        } else if(StringUtils.isNotBlank(followupContentESDO.getBP_D()) && StringUtils.isNotBlank(followupContentESDO.getBP_U())){
                            resultList.add(followupContentESDO.getFollowup_project());
                        }
                    }else if("3".equals(followupContentESDO.getFollowup_project())){
                        //判断血糖必填
                        if(StringUtils.isNotBlank(followupContentESDO.getBS_FPG()) ||
                                StringUtils.isNotBlank(followupContentESDO.getNO_BS_FPG())||
                                StringUtils.isNotBlank(followupContentESDO.getRANDOM_BLOOD_SUGAR())){
                            resultList.add(followupContentESDO.getFollowup_project());
                        }
                    }else{
                        resultList.add(followupContentESDO.getFollowup_project());
                    }
                }
            }
            jestClient.shutdownClient();
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return resultList;
    }
    public Boolean isFirstTimeFollowup(String doctor,String patient,String followupClass,Integer followupId){
        //按时间升序取第一条
        String sql =" SELECT " +
                " f.id, " +
                " f.create_time " +
                " FROM " +
                " wlyy_followup f " +
                " WHERE " +
//                " f.doctor_code = '"+doctor+"' AND " +v
                "  f.patient_code = '"+patient+"' " +
                " AND f.followup_class = '"+followupClass+"' and f.status != 0 " +
                " ORDER BY " +
                " f.followup_date " +
                " ASC " +
                " LIMIT 0,1";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null&&list.size()>0){
            int id = (Integer)list.get(0).get("id");
            //如果与第一条的id不等,则非第一次
            if(!(id==followupId)){
                return false;
            }
        }
        return true;
    }
    /**
     * 如果今日没有计划中的随访计划,则将随访消息设成已操作
     * @param doctor
     */
    public void getNotStartFollowup(String doctor, Date followupPlanDate) {
        //如果计划随访日已经没有未开始状态的随访计划,就将该天的随访消息设成已操作状态
        String now = DateUtil.dateToStrShort(followupPlanDate);
        String start = now + " 00:00:00";
        String end = now + " 23:59:59";
        String sql = "select count(1) count from wlyy_followup where status = 2 and (followup_class is null or followup_class in (1,2)) " +
                "and followup_plan_date>='" + start + "' and followup_plan_date<='" + end + "'and  doctor_code = '" +doctor +"'";
        //获取所有未执行随访计划
        Long followupToday = jdbcTemplate.queryForObject(sql, Long.class);
        System.out.println("计划中随访:" + followupToday);
        if(followupToday == 0){
            systemMessageDao.setMessageOverByType(doctor, 4, DateUtil.strToDateLong(start), DateUtil.strToDateLong(end));
        }
    }
    /**
     * 获取上次随访
     */
    public Map<String, String> getLastFollowup(String doctor, String patient, String followClass) throws Exception {
        Map<String, String> re = new HashMap<>();
        /*//获取医生团队成员
        String[] doctors = new String[]{doctor};
        List<BaseDoctorDO> doctorList = getTeamDoctors(doctor, patient);
        if (doctorList != null && doctorList.size() > 1) {
            doctors = new String[doctorList.size()];
            for (int i = 0; i < doctorList.size(); i++) {
                doctors[i] = doctorList.get(i).getCode();
            }
        }*/
        //获取最新的随访记录
        Followup followup = followupDao.findLastFollowup(doctor, patient, followClass);
        if (followup != null) {
            re.put("id", String.valueOf(followup.getId()));
            re.put("followupDate", DateUtil.dateToStrShort(followup.getFollowupDate()));
        } else {
            re = null;
        }
        return re;
    }
    /**
     * 获取上次随访
     */
    public void copyFollowup(Long id, Long fromId) throws Exception {
//        List<FollowupContent> list = followupContentDao.findByFollowupId(fromId);
        JestClient jestClient = null;
        jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", fromId))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                .build();
        SearchResult result = jestClient.execute(search);
        List<FollowupContentESDO> list = result.getSourceAsObjectList(FollowupContentESDO.class);
        if (list != null && list.size() > 0) {
            List<FollowupContentESDO> copyList = new ArrayList<>();
            for (FollowupContentESDO item : list) {
                FollowupContentESDO copyItem = new FollowupContentESDO();
                BeanUtils.copyProperties(item, copyItem);
                copyItem.setFollowup_id(id + "");
                copyItem.setCreate_time(new Date());
//                copyItem.setFollowupId(id);
//                copyItem.setFollowupKey(item.getFollowupKey());
//                copyItem.setFollowupValue(item.getFollowupValue());
//                copyItem.setFollowupProject(item.getFollowupProject());
                copyList.add(copyItem);
            }
            elastricSearchSave.save(copyList, esIndex, esType);
        }
    }
    /**
     * ES 保存随访记录详情
     *
     * @author huangwenjie
     * @date 2017/11/1 14:57
     */
    @Transactional
    public void saveAllFollowupProjectData(String id, String followupProjectData) throws Exception {
        JestClient jestClient = null;
        try {
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", id))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                    .build();
            SearchResult result = jestClient.execute(search);
            List<FollowupContentESDO> followupContentESDOS = result.getSourceAsObjectList(FollowupContentESDO.class);
            List<FollowupContentESDO> dataList = new ArrayList<>();
            if(followupContentESDOS != null){
                dataList.addAll(followupContentESDOS);
                //删除原有记录
                this.esDeleteFollowUpContent(dataList);
            }
            //保存新的随访详情信息
            List<FollowupContentESDO> newdatalist = new ArrayList<>();
            FollowupContentESDO followupContentESDO = new FollowupContentESDO();
            followupContentESDO = JSON.parseObject(followupProjectData, FollowupContentESDO.class);
            followupContentESDO.setFollowup_id(id);
            followupContentESDO.setCreate_time(new Date());
            newdatalist.add(followupContentESDO);
            elastricSearchSave.save(newdatalist, esIndex, esType);
            //如果该随访是已完成的,则添加随访信息上传映射,上传到基卫
            Followup followup = followupDao.findOne(Integer.valueOf(id));
            if ("1".equals(followup.getStatus())) {
                FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(id));
                if (followupMapping == null) {
                    followupMapping = new FollowupMapping();
                    followupMapping.setCode(UUID.randomUUID().toString());
                    followupMapping.setFollowupId(Integer.parseInt(id));
                    followupMapping.setUpdateTime(DateUtil.getNowTimestamp());
                    followupMapping.setCreateTime(DateUtil.getNowTimestamp());
                }
                followupMapping.setNeedUpload(1);
                followUpMappingDao.save(followupMapping);
            }
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
    }
    /**
     * ES 删除随访详情信息
     *
     * @author huangwenjie
     * @date 2017/11/1 15:17
     */
    public void esDeleteFollowUpContent(List<FollowupContentESDO> datalist) throws Exception {
        JestClient jestClient = null;
        try {
            jestClient = elasticFactory.getJestClient();
            //根据id批量删除
            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
            for (FollowupContentESDO obj : datalist) {
                io.searchbox.core.Delete index = new Delete.Builder(obj.getId()).build();
                bulk.addAction(index);
            }
            BulkResult br = jestClient.execute(bulk.build());
            logger.info("delete data count:" + datalist.size());
            logger.info("delete flag:" + br.isSucceeded());
            jestClient.shutdownClient();
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
    }
    /**
     * 随访完成
     * @param followupId
     * @return
     */
    public Boolean updateFollowStatus(Integer followupId,Integer isFlag)throws Exception{
        Followup followup = followupDao.findOne(followupId);
        followup.setStatus("1");
        followupDao.save(followup);
        BusinessMapping businessMapping = new BusinessMapping();
        if (followup.getFollowupClass().equalsIgnoreCase("6")){
            businessMapping.setBusinessType(1);
        }else if (followup.getFollowupClass().equalsIgnoreCase("5")){
            businessMapping.setBusinessType(2);
        }else if (followup.getFollowupClass().equalsIgnoreCase("9")){
            if (isFlag!=null){
                if (isFlag==0){
                    businessMapping.setBusinessType(5);
                }else if (isFlag==1){
                    businessMapping.setBusinessType(6);
                }
            }
        }else if (followup.getFollowupClass().equalsIgnoreCase("8")){
            businessMapping.setBusinessType(3);
            businessMapping.setBusinessId(followupId);
            businessMapping.setNeedUpload(1);
            businessMapping.setCode(getCode());
            businessMapping.setCreateTime(new Date());
            businessMappingDao.save(businessMapping);
        }else if (followup.getFollowupClass().equalsIgnoreCase("8")){
            businessMapping.setBusinessType(4);
        }
        businessMapping.setBusinessId(followupId);
        businessMapping.setNeedUpload(1);
        businessMapping.setCode(getCode());
        businessMapping.setCreateTime(new Date());
        businessMappingDao.save(businessMapping);
        return true;
    }
    public String getCode() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }
    /**
     * 门牌地址解析
     * @param url
     * @return
     * @throws Exception
     */
    public String urlAnalysis(String url)throws Exception{
        Document doc = Jsoup.connect(url).get();
        String html = doc.toString();
        int start = html.indexOf("href=\"");
        int end = html.indexOf("\"}");
        int ed = url.indexOf("com");
        String ym = url.substring(0,ed+3);
        String path = html.substring(start+6,end);
        Document d = Jsoup.connect(ym+path).get();
        String address = d.select("div.dzksfd1_lz2").eq(1).text();
        logger.info("url:"+url+" path:"+ym+path+" adress:"+address);
        return address;
    }
    /**
     * 随访签到
     * @param jsonSign
     * @return
     * @throws Exception
     */
    public Boolean saveFollowupSign(String jsonSign)throws Exception{
        FollowupSign followupSign = objectMapper.readValue(jsonSign,FollowupSign.class);
        List<FollowupSign> sign = followupSignDao.findByFollowupIdAndDel(followupSign.getFollowupId(),0);
        if(sign!=null&&sign.size()>0){
            //做更新操作
            for(FollowupSign s:sign){
                s.setDel(1);
            }
            followupSignDao.save(sign);
        }else{
            //修改随访状态为进行中
            Followup followup = followupDao.findOne(followupSign.getFollowupId());
            followup.setStatus("3");
        }
        //新增更新随访状态
        followupSign.setCode(getCode());
        followupSign.setCreateTime(new Date());
        followupSign.setDel(0);
        followupSignDao.save(followupSign);
        return true;
    }
    /**
     * 修改签到记录
     * @param jsonSign
     * @return
     * @throws Exception
     */
    public Boolean updateFollowupSign(String jsonSign)throws Exception{
        //重新签到
        FollowupSign followupSign = objectMapper.readValue(jsonSign,FollowupSign.class);
        FollowupSign sign = followupSignDao.findOne(followupSign.getId());
        sign.setDel(1);
        followupSignDao.save(sign);
        FollowupSign newSign = new FollowupSign();
        newSign.setCode(getCode());
        newSign.setFollowupId(sign.getFollowupId());
        newSign.setAddress(sign.getAddress());
        newSign.setType(sign.getType());
        newSign.setCreateTime(new Date());
        newSign.setDoctor(sign.getDoctor());
        newSign.setDoctorName(sign.getDoctorName());
        newSign.setImg(sign.getImg());
        newSign.setLatitude(sign.getLatitude());
        newSign.setLongitude(sign.getLongitude());
        newSign.setDel(0);
        followupSignDao.save(newSign);
        return true;
    }
    /**
     * 签到详细
     * @param followupId
     * @return
     */
    public FollowupSign findByFollowupId(Integer followupId){
        List<FollowupSign> sign = followupSignDao.findByFollowupIdAndDel(followupId,0);
        if(sign!=null&&sign.size()>0){
            return sign.get(0);
        }
        return null;
    }
    /**
     * 获取随访详情
     * @param followupId
     * @return
     */
    public Followup findFollowupInfo(Integer followupId){
        Followup followup = followupDao.findOne(followupId);
        BasePatientDO patient = patientDao.findById(followup.getPatientCode());
        followup.setPhoto(patient.getPhoto());
        followup.setPatient(patient);
        return followup;
    }
    public Followup delFollowup(Integer followupId)throws Exception{
        Followup followup = followupDao.findOne(followupId);
        List<Followup> followupList = followupDao.findFollowupList(followup.getDoctorCode(),followup.getPatientCode());
        if(followupList.size()>=2){
            if(followupList.get(1)!=null&&followupList.get(1).getStatus().equals("1")){
                throw new Exception("当前状态不可删除!");
            }
        }
        followupDao.delete(followupId);
        return followup;
//        return true;
    }
    /**
     * 创建随访
     * @param jsonFollowup
     * @return
     * @throws Exception
     */
    public Followup saveFollowup(String jsonFollowup)throws Exception{
        Followup followup =  objectMapper.readValue(jsonFollowup,Followup.class);
        //访视添加居民信息
        if(StringUtils.isBlank(followup.getPatientName()) && StringUtils.isBlank(followup.getIdcard())) {
            BasePatientDO p = patientDao.findById(followup.getPatientCode());
            followup.setPatientName(p.getName());
            followup.setIdcard(p.getIdcard());
        }
        List<Date> dateList = followupDao.findFollowupDateList(followup.getDoctorCode(),followup.getPatientCode());
        Date prior = null;
        for (Date date : dateList) {
            try {
                if (prior == null) {
                    prior = date;
                } else {
                    if(prior.after(date)) {
                        prior = date;
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        Set statusList = followupDao.findStatusList(followup.getDoctorCode(), followup.getPatientCode());
        if (statusList.size() == 1 && statusList.iterator().next().equals("2")) {
            return followupDao.save(followup);
        }
        if (prior != null) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            String sdf1 = sdf.format(followup.getFollowupDate());
            String sdf2 = sdf.format(prior);
            DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
            Date followupDate = df.parse(sdf1);
            Date priorDate = df.parse(sdf2);
            Boolean b = null;
            if (followup.getId() != null) {
                b = this.isFirstTimeFollowup(followup.getDoctorCode(), followup.getPatientCode(), "9", followup.getId().intValue());
                List<Followup> followupList = followupDao.findFollowupList(followup.getDoctorCode(), followup.getPatientCode());
                if (b == true && followupList.size() >= 2) {
                    String two = sdf.format(followupList.get(1).getFollowupDate());
                    Date twoDate = df.parse(two);
                    if (followupDate.getTime() >= twoDate.getTime()) {
                        throw new Exception("第一次访视时间不能晚于第二次访视时间!");
                    }
                } else if (priorDate.getTime() >= followupDate.getTime()) {
                    throw new Exception("随访时间不能早于第一次随访时间!");
                } else {
                    return followupDao.save(followup);
                }
            } else if (priorDate.getTime() >= followupDate.getTime()) {
                throw new Exception("随访时间不能早于第一次随访时间!");
            } else {
                return followupDao.save(followup);
            }
        }
        return followupDao.save(followup);
    }
    /**
     * 获取居民随访列表
     * @param patient
     * @param doctor
     * @return
     * @throws Exception
     */
    public List<Followup> findPatientFollowList(String patient,String doctor)throws Exception{
        List<Followup> followups = followupDao.findAllPatientPlan(patient,doctor);
        return followups;
    }
    /**
     * 获取居民详情
     * @param patient
     * @return
     */
    public Map<String,Object> findPatientInfo(String patient){
        String sql = " SELECT " +
                " p.`name`, " +
                " p.id, " +
                " p.sex, " +
                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
                " p.photo, " +
                " l.label_code AS labelCode, " +
                " l.label_name AS labelName, " +
                " p.address," +
                " p.idcard," +
                " p.mobile" +
                " FROM " +
                " wlyy_followup_label l " +
                " JOIN wlyy_followup_label_patient lp ON l.label_code = lp.label_code " +
                " JOIN base_patient p ON lp.patient = p.id " +
                " WHERE " +
                " p.code = '"+patient+ "'";
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
        if(rs!=null&&rs.size()>0){
            return rs.get(0);
        }
        return null;
    }
    /**
     * 获取随访居民
     * @param namekey
     * @param labelCode
     * @param page
     * @param size
     * @return
     * @throws Exception
     */
    public Map<String,Object> findFollowUpPatient(String namekey,String doctor,String labelCode,Integer page,Integer size)throws Exception{
        String totalSql = " SELECT " +
                " DISTINCT p.id " +
                " FROM " +
                " wlyy_followup_label l " +
                " JOIN wlyy_followup_label_patient lp ON l.label_code = lp.label_code " +
                " JOIN base_patient p ON lp.patient = p.id " +
                " WHERE " +
                " 1=1 ";
        if(StringUtils.isNotBlank(namekey)){
            totalSql +=" AND p.name LIKE '%"+namekey+"%'";
        }
        if(StringUtils.isNotBlank(labelCode)){
            totalSql +=" AND lp.label_code ='"+labelCode+"' ";
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        Integer count = 0;
        if (rstotal != null && rstotal.size() > 0) {
            count = rstotal.size();
        }
        String sql = " SELECT DISTINCT" +
                " p.id, " +
                " p.`name`, " +
                " p.sex, " +
                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
                " p.photo" +
                " FROM " +
                " wlyy_followup_label l " +
                " JOIN wlyy_followup_label_patient lp ON l.label_code = lp.label_code " +
                " JOIN base_patient p ON lp.patient = p.id " +
                " WHERE " +
                " 1=1 ";
        if(StringUtils.isNotBlank(namekey)){
            sql +=" AND p.name LIKE '%"+namekey+"%'";
        }
        if(StringUtils.isNotBlank(labelCode)){
            sql +=" AND lp.label_code ='"+labelCode+"' ";
        }
        sql +=" limit " + (page-1)*size +"," + size;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        //设置标签
        if(list!=null&&list.size()>0){
            for(Map<String,Object> map:list){
                String patient = (String)map.get("code");
                map.put("labels",findPatientLabel(patient));
            }
        }
        Map<String,Object> rs = new HashedMap();
        rs.put("total",count);
        //统计随访数目
        rs.put("list",findPatientFollowCount(list,doctor));
        return rs;
    }
    public List<Map<String,Object>> findPatientLabel(String patient){
        String sql ="SELECT " +
                " pl.label_code AS labelCode, " +
                " pl.label_name AS labelName " +
                " FROM " +
                " wlyy_followup_label_patient pl " +
                " WHERE " +
                " pl.patient = '"+patient+"'";
        List<Map<String,Object>> label = jdbcTemplate.queryForList(sql);
        return label;
    }
     /* 统计当前医生的居民计划数与完成数
     * @param list
     * @return
             * @throws Exception
     */
    public List<Map<String, Object>> findPatientFollowCount(List<Map<String,Object>> list,String doctor)throws Exception{
        if(list!=null&&list.size()>0){
            for(Map<String,Object> map:list){
                String patient = (String)map.get("code");
                List<Followup> followups = followupDao.findAllPatientPlan(patient,doctor);
                //统计数目
                Integer count = 0;
                Integer compeleCount =0;
                if(followups!=null&&followups.size()>0){
                    count = followups.size();
                    for(Followup followup:followups){
                        if("1".equals(followup.getStatus())){
                            compeleCount++;
                        }
                    }
                    map.put("count",count);
                    map.put("compeleCount",compeleCount);
                    map.put("followups",followups);
                }else{
                    map.put("count",count);
                    map.put("compeleCount",compeleCount);
                    map.put("followups",followups);
                }
            }
        }
        return list;
    }
    /**
     * 获取随访标签列表带居民数
     * @return
     */
    public List<Map<String,Object>> findLabelListWithCount(){
        List<Map<String,Object>> rs = findFollowupLabel();
        if(rs!=null&& rs.size()>0){
            for(Map<String,Object> map:rs){
                String labelCode = (String)map.get("LableCode");
                map.put("count",findPatientFollowLabelCount(labelCode));
            }
        }
        return rs;
    }
    /**
     * 获取随访标签列表
     * @return
     */
    public List<Map<String,Object>> findFollowupLabel(){
        String sql=" SELECT " +
                " l.label_code AS LableCode, " +
                " l.label_name AS labelName " +
                " FROM " +
                " wlyy_followup_label l " +
                " ORDER BY " +
                " l.sort " +
                " ASC ";
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql);
        return rs;
    }
    /**
     * 计算随访标签人数
     * @param labelCode
     * @return
     */
    public Long findPatientFollowLabelCount(String labelCode){
        String sql =" SELECT " +
                " COUNT(1) AS total " +
                " FROM " +
                " wlyy_followup_label l " +
                " JOIN wlyy_followup_label_patient p ON l.label_code = p.label_code " +
                " WHERE " +
                " l.label_code ='"+labelCode+"'";
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");
        }
        return count;
    }
    /**
     * 获取随访计划
     * @param doctor
     * @param startTime
     * @param endTime
     * @return
     * @throws Exception
     */
    public List<Followup> findFollowupList(String doctor,String patient,String followupClass,String patientName,String startTime,String endTime,String flag,Integer type)throws Exception {
        //1.查找时间段中所有计划中的随访
        String sqlList = "select  wf.id as id,wf.followup_no as followupNo,wf.followup_date as followupDate,wf.followup_plan_date as followupPlanDate,wf.followup_next_date as followupNextDate," +
                " wf.followup_type as followupType,wf.followup_class as followupClass,wf.followup_manager_status as followupManagerStatus,wf.doctor_code as doctorCode,wf.doctor_name as doctorName," +
                "wf.jwdoctor_code as jwdoctorCode,wf.org_code as orgCode,wf.org_name as orgName,wf.jworg_code as jworgCode,wf.patient_code as patientCode,wf.patient_name as patientName,wf.idcard," +
                "wf.data_from as dataFrom,wf.status,wf.followup_content_phone as followupContentPhone,wf.creater,wf.sign_type as signType,wf.admin_team_code as adminTeamCode,wf.sign_code as signCode," +
                "wf.prescription_code as prescriptionCode,wf.age,wf.sex,wf.mobile,wf.idcard_encrypt AS idcardEncrypt,wf.type" +
                "";
        String sql = " from wlyy_followup wf ";
        sql+= " where 1=1 and wf.status !=0";
        if(!org.apache.commons.lang.StringUtils.isEmpty(doctor)){
            sql+=" and wf.doctor_code = '"+doctor+"'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(patient)){
            sql+=" and wf.patient_code = '"+patient+"'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(followupClass)){
            sql+=" and wf.followup_class = '"+followupClass+"'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(patientName)){
            sql+=" and wf.patient_name like '%"+patientName+"%'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(startTime)){
            sql+=" and wf.followup_plan_date >='"+startTime+"'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(endTime)){
            Date currentTime = DateUtil.strToDate(endTime + " 23:59:59");
            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            String dateString = formatter.format(currentTime);
            sql+=" and wf.followup_plan_date <='"+dateString+"'";
        }
        if(flag==null){
            flag="0";
        }
        if (type!=null&&type!=0){
            sql+=" AND  wf.type ="+type;
        }
        if(flag.equals("1")&&flag!=null){
            sql+=" and wf.followup_class in(5,6,7,8,9)";
        }
        if(flag.equals("2")&&flag!=null){
            sql+=" and (wf.followup_class in(1,2,3,4,11,12,13,14,15,16,17,18) or wf.followup_class IS NULL)";
        }
        sql+=" order by wf.followup_plan_date desc";
        List<Followup> followupAll = jdbcTemplate.query(sqlList+sql,new BeanPropertyRowMapper(Followup.class));
        List<Followup> followups = new ArrayList<>();
        for(Followup followup:followupAll){
            BasePatientDO patient1 = patientDao.findById(followup.getPatientCode());
            int age = IdCardUtil.getAgeForIdcard(followup.getIdcard());
            List<Map<String,Object>> map = findPatientLabel(followup.getPatientCode());
            followup.setPatient(patient1);
            followup.setFollowupLabelPatient(map);
            followups.add(followup);
        }
        return followups;
    }
    public Map<String,Object> findFollowupByMonth(String doctor,String patient,String followupClass,String patientName,String startTime,String endTime,String flag,Integer type1)throws Exception{
        String sqlList = "select  wf.id as id,wf.followup_no as followupNo,wf.followup_date as followupDate,wf.followup_plan_date as followupPlanDate,wf.followup_next_date as followupNextDate," +
                " wf.followup_type as followupType,wf.followup_class as followupClass,wf.followup_manager_status as followupManagerStatus,wf.doctor_code as doctorCode,wf.doctor_name as doctorName," +
                "wf.jwdoctor_code as jwdoctorCode,wf.org_code as orgCode,wf.org_name as orgName,wf.jworg_code as jworgCode,wf.patient_code as patientCode,wf.patient_name as patientName,wf.idcard," +
                "wf.data_from as dataFrom,wf.status,wf.followup_content_phone as followupContentPhone,wf.creater,wf.sign_type as signType,wf.admin_team_code as adminTeamCode,wf.sign_code as signCode," +
                "wf.prescription_code as prescriptionCode,wf.type";
        String sql = " from wlyy_followup wf ";
        sql+= " where 1=1 and wf.status !=0";
        if(!org.apache.commons.lang.StringUtils.isEmpty(doctor)){
            sql+=" and wf.doctor_code = '"+doctor+"'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(patient)){
            sql+=" and wf.patient_code = '"+patient+"'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(followupClass)){
            sql+=" and wf.followup_class = '"+followupClass+"'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(patientName)){
            sql+=" and wf.patient_name like '%"+patientName+"%'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(startTime)){
            sql+=" and wf.followup_plan_date >='"+startTime+"'";
        }
        if(!org.apache.commons.lang.StringUtils.isEmpty(endTime)){
            Date currentTime = DateUtil.strToDate(endTime + " 23:59:59");
            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            String dateString = formatter.format(currentTime);
            sql+=" and wf.followup_plan_date <='"+dateString+"'";
        }
        if (type1!=null&&type1!=0){
            sql+=" and wf.type ="+type1;
        }
        if(flag==null){
            flag="0";
        }
        if(flag.equals("1")&&flag!=null){
            sql+=" and wf.followup_class in(5,6,7,8,9)";
        }
        if(flag.equals("2")&&flag!=null){
            sql+=" and (wf.followup_class in(1,2,3,4,11,12,13,14,15,16,17,18) or wf.followup_class IS NULL)";
        }
        sql+=" order by wf.followup_plan_date desc";
        List<Followup> followups = jdbcTemplate.query(sqlList+sql,new BeanPropertyRowMapper(Followup.class));
        //按时间分组
        Map<String,Object> date = sortFollowupByDate(followups);
        //统计每一天完成数与计划数目
        if(date!=null&&date.size()>0){
            for(String key : date.keySet()){
                //获取一天的数据
                Map<String,Object> d = (Map<String,Object>)date.get(key);
                // 获取一天随访数据
                List<Followup> dateFollowups = (List<Followup>)d.get("followups");
                //统计一天各项纬度指标
                List<Map<String,Object>> statistics = new ArrayList<>();
                for(String type : FOLLOWUP_TYPE){
                    for(String cls:FOLLOWUP_CLASS ){
                        //统计单条
                        Map<String,Object> fs = sortFollowupList(type,cls,dateFollowups);
                        Integer count = (Integer)fs.get("count");
                        if(count!=0){
                            statistics.add(fs);
                        }
                    }
                }
                d.put("statistics",statistics);
            }
        }
        return date;
    }
    public Map<String,Object> sortFollowupByDate(List<Followup> followups){
        //按时间分组
        Map<String,Object> date = new HashedMap();
        if(followups!=null&&followups.size()>0){
            Iterator it = followups.iterator();
            while (it.hasNext()){
                Followup followup = (Followup)it.next();
                //1.获取日期分组
                Map<String,Object> dateFollows = (Map<String,Object>)date.get(DateUtil.dateToStr(followup.getFollowupPlanDate(),"yyyy-MM-dd"));
                //判断随访时间是否已经创建分组
                if(dateFollows!=null&&dateFollows.size()>0){
                    //同一天时间已经有分组则加入list
                    List<Followup> list = (List<Followup>)dateFollows.get("followups");
                    list.add(followup);
                }else{
                    //同一天的时间没有该分组则创建这天的随访计划List
                    Map<String,Object> newdateFollow = new HashedMap();
                    List<Followup> dateFollowups = new ArrayList<>();
                    dateFollowups.add(followup);
                    newdateFollow.put("followups",dateFollowups);
                    date.put(DateUtil.dateToStr(followup.getFollowupPlanDate(),"yyyy-MM-dd"),newdateFollow);
                }
            }
        }
        return date;
    }
    public Map<String,Object> sortFollowupList(String followupType,String followupClass,List<Followup> followups){
        //统计完成数
        Integer compeleCount = 0;
        //总数
        Integer count = 0;
        //迭代数组
        List<Followup> rs = new ArrayList<>();
        if(followups!=null&&followups.size()>0){
            Iterator it = followups.iterator();
            while (it.hasNext()){
                Followup followup = (Followup)it.next();
                //判断随访类型与类别
                if(followupClass.equals(followup.getFollowupClass())&& followupType.equals(followup.getFollowupType())){
                    rs.add(followup);
                    if("1".equals(followup.getStatus())){
                        compeleCount++;
                    }
                    //删除迭代器中元素
                    //it.remove();
                }
            }
            //设置总数
            count = rs.size();
        }
        Map<String,Object> mapFollow =new HashedMap();
        mapFollow.put("followupType",followupType);
        mapFollow.put("followupClass",followupClass);
        mapFollow.put("compeleCount",compeleCount);
        mapFollow.put("count",count);
        return mapFollow;
    }
    /**
     * 获取续方信息
     *
     * @param code
     * @return
     */
    public com.alibaba.fastjson.JSONObject getContinuedPrescriptionAsDoctor(String code) {
        WlyyPrescriptionDO prescription = prescriptionDao.findOne(code);
        List<WlyyPrescriptionInfoDO> prescriptionInfos = prescriptionInfoDao.findByPrescriptionId(code,1);
        //获取药品可拆标志
//        prescriptionInfos.forEach(info->{
//            List<Map<String,Object>> list = zyDictService.findDispDictByCode(prescription.getDoctor(),info.getDrugCode());
//            if(list!=null&&list.size()>0){
//                info.setDispPackUntuckFlag(Integer.valueOf(list.get(0).get("dispPackUntuckFlag").toString()));
//                info.setDispQuantityUntuckFlag(Integer.valueOf(list.get(0).get("dispQuantityUntuckFlag").toString()));
//            }
//        });
       /* PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code);
        List<PrescriptionAdjust> prescriptionAdjusts = prescriptionAdjustDao.findByPrescriptionCodeOrderByIdDesc(code);*/
        com.alibaba.fastjson.JSONObject rs = new com.alibaba.fastjson.JSONObject();
        rs.put("prescription", prescription);
        rs.put("prescriptionInfo", prescriptionInfos);
        //rs.put("reviewed", reviewed);
//        if(prescription!=null&&StringUtils.isNotBlank(prescription.getDoctor())){
//            rs.put("doctor",doctorDao.findByCode(prescription.getDoctor()));
//        }else{
//            rs.put("doctor","");
//        }
        if (prescription != null && StringUtils.isNotBlank(prescription.getPatientCode())) {
            rs.put("patient", patientDao.findById(prescription.getPatientCode()));
        } else {
            rs.put("patient", "");
        }
        rs.put("diagnosis", prescriptionDiagnosisDao.findByPrescriptionId(code,1));
       /* if (prescriptionAdjusts != null && prescriptionAdjusts.size() > 0) {
            rs.put("prescriptionAdjust", prescriptionAdjusts.get(0));
        } else {
            rs.put("prescriptionAdjust", "");
        }*/
        Followup followup = followupDao.getFollowupByPrescriptionCode(code);
        rs.put("followup",followup);
       /* WlyyPrescriptionExpressageDO prescriptionExpressage = prescriptionExpressageDao.fin(code);
        rs.put("prescriptionExpressage",prescriptionExpressage);*/
        return rs;
    }
    /**
     * 获取面访项目列表
     */
    public List<Map<String, String>> getFollowupProject(String id) throws Exception {
        List<Map<String, String>> re = new ArrayList<>();
        //获取已填写的面访项目
//        List<String> project = followupContentDao.findProjectByFollowupId(Long.valueOf(id));
        //修改为通过ES查询---2017.11.01--huangwenjie
        List<String> project = esfindProjectByFollowupId(id);
        //获取所有面访项目
        List<WlyyHospitalSysDictDO> dictList = wlyyHospitalSysDictDao.findByDictName("FOLLOWUP_PROJECT");
        if (dictList != null && dictList.size() > 0) {
            for (WlyyHospitalSysDictDO dict : dictList) {
                Map<String, String> map = new HashMap<>();
                String code = dict.getDictCode();
                map.put("projectCode", code);
                map.put("projectName", dict.getDictValue());
                if (project != null && project.contains(code)) {
                    map.put("status", "1"); //已填写
                } else {
                    map.put("status", "0");//未填写
                }
                re.add(map);
            }
        }
        return re;
    }
    /**
     * ES获取表单项目数据
     */
    public FollowupContentESDO esGetFollowupProjectDataList(String id, String followupProject) throws Exception {
        JestClient jestClient = null;
        FollowupContentESDO followupContentESDO = null;
        try {
            //根据随访ID、分类ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            if(StringUtils.isNotBlank(followupProject)) {
                searchSourceBuilder.query(
                        new BoolQueryBuilder()
                                .must(QueryBuilders.matchQuery("followup_id", id))
                                .must(QueryBuilders.matchQuery("followup_project", followupProject))
                );
            }else {
                searchSourceBuilder.query(
                        new BoolQueryBuilder()
                                .must(QueryBuilders.matchQuery("followup_id", id))
                                .mustNot(QueryBuilders.existsQuery("followup_project"))
                );
            }
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                    .build();
            SearchResult result = jestClient.execute(search);
            followupContentESDO = result.getSourceAsObject(FollowupContentESDO.class);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return followupContentESDO;
    }
    /**
     * ES获取面访项目数据
     */
    public FollowupContentESDO esGetFollowupProjectData(String id, String followupProject) throws Exception {
        JestClient jestClient = null;
        FollowupContentESDO followupContentESDO = null;
        try {
            //根据随访ID、分类ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", id))
                            .must(QueryBuilders.matchQuery("followup_project", followupProject))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                    .build();
            SearchResult result = jestClient.execute(search);
            followupContentESDO = result.getSourceAsObject(FollowupContentESDO.class);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return followupContentESDO;
    }
    /**
     * 每日发送随访计划提醒消息
     */
    @Transactional
    public void sendMessage(String date) {
        try {
            String start = date + " 00:00:00";
            String end = date + " 23:59:59";
            String sql = "select doctor_code,count(1) count from wlyy_followup where status not in ('0','1') and followup_plan_date>='" + start + "' and followup_plan_date<='" + end + "' group by doctor_code";
            //获取所有未执行随访计划
            List<Map<String, Object>> followupToday = jdbcTemplate.queryForList(sql);
            if (followupToday != null) {
                List<SystemMessageDO> list = new ArrayList<>();
                for (Map<String, Object> map : followupToday) {
                    String doctor = String.valueOf(map.get("doctor_code"));
                    String count = String.valueOf(map.get("count"));
                    // 添加签约消息
                    String title = "随访计划提醒";
                    String content = "您今日有" + count + "个随访计划待处理";
                    SystemMessageDO message = new SystemMessageDO();
                    message.setCode(getCode());
                    message.setCreateTime(new Date());
                    message.setCreateTime(new Date());
                    message.setContent(content);
                    message.setIsRead("1");//设置未读
                    message.setReceiver(doctor);//设置接受医生的code
                    message.setSender("system");//设置发送的用户
                    message.setTitle(title);
                    message.setType("4");//随访计划提醒
                    message.setReadonly(1);//是否只读消息
                    list.add(message);
                 // 推送消息给医生
                    //pushMsgTask.put(doctor, "4", title, content, "");
                    try {
                        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                        List<Followup> followups = followupDao.getByDoctorPlan(doctor,format.parse(start),format.parse(end));
                        String baseUrl =findDomainUrlInDict();
                        for (Followup followup:followups) {
                            //            新增发送医生助手模板消息 v1.4.0 by wujunjie
                            BaseDoctorDO doctor1 = doctorDao.findById(doctor);
                            String doctorOpenID = doctor1.getOpenid();
                            //推送企业微信消息
                            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                                String url="";//baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                                enterpriseService.sendTWMesByDoctor("zsyy",doctor,title,"",url);
                            }else if(wxId.equalsIgnoreCase("xm_ykyy_wx")){
                                String url="";//baseUrl+"/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                                enterpriseService.sendTWMesByDoctor("xm_ykyy_wx",doctor,title,"",url);
                            }else if (wxId.equalsIgnoreCase("xm_xzzx_wx")){
                                String url="";//https://ih.xmheart.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                                enterpriseService.sendTWMesByDoctor("xm_xzzx_wx",doctor,title,"",url);
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
                messageDao.save(list);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public String findDomainUrlInDict(){
        try {
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("domainUrl");
            if (wlyyHospitalSysDictDO!=null){
                return wlyyHospitalSysDictDO.getDictValue();
            }else {
                return "";
            }
        }catch (Exception e){
            e.printStackTrace();
            return "";
        }
    }
}

+ 103 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/followUp/FollowupDrugsService.java

@ -0,0 +1,103 @@
package com.yihu.rehabilitation.service.followUp;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.followup.FollowupDrugs;
import com.yihu.rehabilitation.dao.followUp.FollowupContentDao;
import com.yihu.rehabilitation.dao.followUp.FollowupDrugsDao;
import com.yihu.rehabilitation.vo.FollowupContentESDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import java.util.*;
/**
 * 随访用药服务
 * @author hzp add 2016-12-08
 *
 */
@Component
@Transactional(rollbackOn = Exception.class)
public class FollowupDrugsService  {
	@Autowired
	private FollowupContentDao followupContentDao;
	@Autowired
	private FollowupDrugsDao followupDrugsDao;
	@Autowired
	private ObjectMapper objectMapper;
	
	@Autowired
	private FollowUpService followUpService;
	private String drugsProject = "6";
	/**
	 *保存面访用药数据
	 */
	@Transactional
	public void saveFollowupDrugs(String id,String drugsData) throws Exception {
		JavaType javaType = objectMapper.getTypeFactory().constructParametricType(List.class, Map.class);
		List<Map<String,String>> list = objectMapper.readValue(drugsData,javaType);
		Long followupId = Long.valueOf(id);
		//删除原有用药记录
		followupDrugsDao.deleteByFollowupId(Long.valueOf(followupId));
		if(list!=null && list.size()>0)
		{
			List<FollowupDrugs> newList = new ArrayList<>();
			for(Map<String,String> item:list)
			{
				FollowupDrugs drug = new FollowupDrugs();
				drug.setFollowupId(followupId);
				drug.setDrugsGroup(item.get("drugsGroup"));
				drug.setDrugsCode(item.get("drugsCode"));
				drug.setDrugsName(item.get("drugsName"));
				drug.setDose(item.get("dose"));
				drug.setUnit(item.get("unit"));
				drug.setFrequency(item.get("frequency"));
				drug.setCreateTime(new Date());
				newList.add(drug);
			}
			followupDrugsDao.save(newList);
		}
	}
	/**
	 * 获取面访用药数据
	 */
	public Map<String,Object> getFollowupDrugs(String id) throws Exception
	{
		Map<String,Object> re = new HashMap<>();
		//2017-11-16 修改为从ES获取--huangwenjie
		FollowupContentESDO followupContentESDO = followUpService.esGetFollowupProjectData(id, "6");
		if(followupContentESDO != null){
			re.put("DRUG_COMPLIANCE_CODE",followupContentESDO.getDRUG_COMPLIANCE_CODE());
		}
//		List<FollowupContent> dataList =  followupContentDao.findByFollowupIdAndFollowupProject(Long.valueOf(id),drugsProject);
//		for(FollowupContent item:dataList)
//		{
//			re.put(item.getFollowupKey(),item.getFollowupValue());
//		}
		//获取用药记录
		List<FollowupDrugs> drugsList = followupDrugsDao.findByFollowupId(Long.valueOf(id));
		re.put("DRUG_LIST",drugsList);
		return re;
	}
}

+ 218 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/followUp/PhthisisFollowupService.java

@ -0,0 +1,218 @@
package com.yihu.rehabilitation.service.followUp;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.followup.Followup;
import com.yihu.jw.util.entity.EntityUtils;
import com.yihu.rehabilitation.dao.followUp.FollowUpDao;
import com.yihu.rehabilitation.es.ElasticSearchHelper;
import com.yihu.rehabilitation.vo.entity.phthisis_followup.PhthisisFirstFollowupES;
import com.yihu.rehabilitation.vo.entity.phthisis_followup.PhthisisFollowupManagementES;
import com.yihu.rehabilitation.vo.entity.phthisis_followup.PhthisisFollowupPatientInfoES;
import com.yihu.rehabilitation.vo.entity.phthisis_followup.PhthisisNTimesFollowupES;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * 肺结核随访服务
 */
@Component
@Transactional(rollbackOn = Exception.class)
public class PhthisisFollowupService {
    private Logger logger = LoggerFactory.getLogger(PhthisisFollowupService.class);
    @Value("${es.index.phthisis_first_followup_index}")
    private String firstIndex;
    @Value("${es.type.phthisis_first_followup_type}")
    private String firstType;
    @Value("${es.index.phthisis_n_times_followup_index}")
    private String nTimesIndex;
    @Value("${es.type.phthisis_n_times_followup_type}")
    private String nTimesType;
    @Autowired
    private ElasticSearchHelper elasticSearchHelper;
    @Autowired
    private FollowUpService followUpService;
    @Autowired
    private FollowUpDao followUpDao;
    @Autowired
    ObjectMapper objectMapper;
    /**
     * 保存第一次肺结核随访
     *
     * @param jsonData
     */
    public boolean saveFirstFollowup(String jsonData,StringBuilder errMsg) throws IOException {
        try {
            JSONObject.parseObject(jsonData);
        } catch (Exception e) {
            errMsg.append("参数转换成JSON对象异常:").append(e.getMessage());
            logger.error(errMsg.toString());
            return false;
        }
        PhthisisFirstFollowupES firstFollowupES = null;
        try {
            firstFollowupES = EntityUtils.jsonToEntity(jsonData, PhthisisFirstFollowupES.class);
        } catch (Exception e) {
            errMsg.append("第一次肺结核随访json转换成ES实体类异常:").append(e.getMessage());
            logger.error(errMsg.toString());
            return false;
        }
        if (StringUtils.isEmpty(firstFollowupES.getFollowup_id())) {
            errMsg.append("随访id为空!");
            logger.error(errMsg.toString());
            return false;
        }
        Followup followupMysqlEntity = followUpService.findFollowupInfo(Integer.parseInt(firstFollowupES.getFollowup_id()));
        if(null == followupMysqlEntity || null == followupMysqlEntity.getId()){
            errMsg.append("该随访不存在,随访id-->").append(firstFollowupES.getFollowup_id());
            logger.error(errMsg.toString());
            return false;
        }
        //设置当前随访状态
        if(followupMysqlEntity.getStatus().equals("2")){
            followupMysqlEntity.setStatus("3");
            followUpDao.save(followupMysqlEntity);
        }
        // 设置居民基本信息
        if(null == firstFollowupES.getPatient()){
            firstFollowupES.setPatient(new PhthisisFollowupPatientInfoES());
        }
        firstFollowupES.getPatient().setName(followupMysqlEntity.getPatientName());
        firstFollowupES.getPatient().setCode(followupMysqlEntity.getPatientCode());
        //设置医生基本信息
        firstFollowupES.setSignature_doctor(followupMysqlEntity.getDoctorCode());
        firstFollowupES.setSignature_doctor_name(followupMysqlEntity.getDoctorName());
        // 当前日期为随访日期
        firstFollowupES.setCreate_time(new Date());
        if (!elasticSearchHelper.saveWithCustomId(firstIndex, firstType, objectMapper.writeValueAsString(firstFollowupES), "followup_id", errMsg)) {
            return false;
        }
        return true;
    }
    /**
     * 保存第n次肺结核随访
     *
     * @param jsonData
     */
    public boolean saveNTimesFollowup(String jsonData,StringBuilder errMsg) throws IOException {
        try {
            JSONObject.parseObject(jsonData);
        } catch (Exception e) {
            errMsg.append("参数转换成JSON对象异常:").append(e.getMessage());
            logger.error(errMsg.toString());
            return false;
        }
        PhthisisNTimesFollowupES nTimesFollowupES = null;
        try {
            nTimesFollowupES = EntityUtils.jsonToEntity(jsonData, PhthisisNTimesFollowupES.class);
        } catch (Exception e) {
            errMsg.append("第n次肺结核随访json转换成ES实体类异常:").append(e.getMessage());
            logger.error(errMsg.toString());
            return false;
        }
        if (StringUtils.isEmpty(nTimesFollowupES.getFollowup_id())) {
            errMsg.append("随访id为空!");
            logger.error(errMsg.toString());
            return false;
        }
        Followup followupMysqlEntity = followUpService.findFollowupInfo(Integer.parseInt(nTimesFollowupES.getFollowup_id()));
        if(null == followupMysqlEntity || null == followupMysqlEntity.getId()){
            errMsg.append("该随访不存在,随访id-->").append(nTimesFollowupES.getFollowup_id());
            logger.error(errMsg.toString());
            return false;
        }
        //设置当前随访状态
        if(followupMysqlEntity.getStatus().equals("2")){
            followupMysqlEntity.setStatus("3");
            followUpDao.save(followupMysqlEntity);
        }
        // 设置居民基本信息
        if(null == nTimesFollowupES.getPatient()){
            nTimesFollowupES.setPatient(new PhthisisFollowupPatientInfoES());
        }
        nTimesFollowupES.getPatient().setName(followupMysqlEntity.getPatientName());
        nTimesFollowupES.getPatient().setCode(followupMysqlEntity.getPatientCode());
        //设置管理情况的医生
        if(null == nTimesFollowupES.getManagement()){
            nTimesFollowupES.setManagement(new PhthisisFollowupManagementES());
        }
        nTimesFollowupES.getManagement().setSignature_doctor(followupMysqlEntity.getDoctorCode());
        nTimesFollowupES.getManagement().setSignature_doctor_name(followupMysqlEntity.getDoctorName());
        nTimesFollowupES.getData().forEach(one -> {
            one.setFollowup_doctor(followupMysqlEntity.getDoctorCode());
            one.setFollowup_doctor_name(followupMysqlEntity.getDoctorName());
            one.setCreate_time(new Date());
        });
        if (!elasticSearchHelper.saveWithCustomId(nTimesIndex, nTimesType, objectMapper.writeValueAsString(nTimesFollowupES), "followup_id",errMsg)) {
            return false;
        }
        return true;
    }
    /**
     * 根据随访id查询第一次随访记录详情
     *
     * @param followupId
     */
    public JSONObject queryFirstByFollowupId(String followupId) {
        List<JSONObject> result = new ArrayList<>();
        String sql = "select * from " + firstIndex + " where followup_id = '" + followupId + "'";
        try {
            result = elasticSearchHelper.execCurl(sql);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (!CollectionUtils.isEmpty(result)) {
            return result.get(0);
        }
        return new JSONObject();
    }
    /**
     * 根据随访id查询第n次随访记录详情
     *
     * @param followupId
     */
    public List<JSONObject>  queryNTimesByFollowupId(String followupId) {
        List<JSONObject> result = new ArrayList<>();
        String sql = "select * from " + nTimesIndex + " where followup_id = '" + followupId + "'";
        try {
            result = elasticSearchHelper.execCurl(sql);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
}

+ 1263 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/followUp/VisitDetailService.java

@ -0,0 +1,1263 @@
package com.yihu.rehabilitation.service.followUp;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.followup.Followup;
import com.yihu.jw.entity.followup.FollowupMapping;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.es.es.ElasticFactory;
import com.yihu.jw.es.es.ElastricSearchSave;
import com.yihu.jw.es.util.ElasticsearchUtil;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.rehabilitation.dao.followUp.FollowUpDao;
import com.yihu.rehabilitation.dao.followUp.FollowUpMappingDao;
import com.yihu.rehabilitation.vo.entity.*;
import com.yihu.rehabilitation.vo.entity.followupDisease.*;
import io.searchbox.client.JestClient;
import io.searchbox.core.Search;
import io.searchbox.core.SearchResult;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import java.beans.PropertyDescriptor;
import java.io.IOException;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Component
@Transactional(rollbackOn = Exception.class)
public class VisitDetailService  {
    @Value("${es.type.PostpartumVisitRecord}")
    private String esTypePostpartum;
    @Value("${es.index.PostpartumVisitRecord}")
    private String esIndexPostpartum;
    @Value("${es.type.FollowupSevereMentalDisorder}")
    private String esTypeSevereMentalDisorder;
    @Value("${es.index.FollowupSevereMentalDisorder}")
    private String esIndexSevereMentalDisorder;
    @Value("${es.type.OlderPeopleHealthCheckRecord}")
    private String esTypeOlderPeopleHealthCheck;
    @Value("${es.index.OlderPeopleHealthCheckRecord}")
    private String esIndexOlderPeopleHealthCheck;
    @Value("${es.type.NewbornFamilyVisitRecord}")
    private String esTypeNewbornFamilyVisit;
    @Value("${es.index.NewbornFamilyVisitRecord}")
    private String esIndexNewbornFamilyVisit;
    @Value("${es.index.phthisis_n_times_followup_index}")
    private String esIndexPhthisisNTimes;
    @Value("${es.type.phthisis_n_times_followup_type}")
    private String esTypePhthisisNTimes;
    @Value("${es.type.GynecologicalInflammationDaily}")
    private String esTypeGynecologicalInflammationDaily;
    @Value("${es.index.GynecologicalInflammationDaily}")
    private String esIndexGynecologicalInflammationDaily;
    @Value("${es.type.GynecologicalInflammationFollowupArchives}")
    private String esTypeGynecologicalInflammationFollowupArchives;
    @Value("${es.index.GynecologicalInflammationFollowupArchives}")
    private String esIndexGynecologicalInflammationFollowupArchives;
    @Value("${es.type.COPDFirstTimeQuestionnaire}")
    private String esTypeCOPDFirstTimeQuestionnaire;
    @Value("${es.index.COPDFirstTimeQuestionnaire}")
    private String esIndexCOPDFirstTimeQuestionnaire;
    @Value("${es.type.COPDDailyFollowup}")
    private String esTypeCOPDDailyFollowup;
    @Value("${es.index.COPDDailyFollowup}")
    private String esIndexCOPDDailyFollowup;
    @Value("${es.type.BreastFollowup}")
    private String esTypeBreastFollowup;//慢性乳腺疾病日常随访
    @Value("${es.index.BreastFollowup}")
    private String esIndexBreastFollowup;//慢性乳腺疾病日常随访
    @Value("${es.type.CerebralApoplexyFollowup}")
    private String esTypeCerebralApoplexyFollowup;
    @Value("${es.index.CerebralApoplexyFollowup}")
    private String esIndexCerebralApoplexyFollowup;
    @Value("${es.type.CoronaryFollowup}")
    private String esTypeCoronaryFollowup;
    @Value("${es.index.CoronaryFollowup}")
    private String esIndexCoronaryFollowup;
    @Value("${es.type.FattyLiverFollowUp}")
    private String esTypeFattyLiverFollowUp;
    @Value("${es.index.FattyLiverFollowUp}")
    private String esIndexFattyLiverFollowUp;
    @Value("${es.type.NephropathyFollowup}")
    private String esTypeNephropathyFollowup;
    @Value("${es.index.NephropathyFollowup}")
    private String esIndexNephropathyFollowup;
    @Value("${es.type.ProstateFollowup}")
    private String esTypeProstateFollowup;
    @Value("${es.index.ProstateFollowup}")
    private String esIndexProstateFollowup;
    @Autowired
    private ElasticFactory elasticFactory;
    @Autowired
    private ElastricSearchSave elastricSearchSave;
    @Autowired
    private ElasticsearchUtil elasticsearchUtil;
    @Autowired
    private FollowUpDao followupDao;
    @Autowired
    private FollowUpMappingDao followUpMappingDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private PhthisisFollowupService phthisisFollowupService;
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private BaseOrgDao hospitalMappingDao;
    /**
     * @Title: getNullPropertyNames
     * @Description: 获取值为空的属性名称
     * @createdBy:byrc
     */
    public static String[] getNullPropertyNames(Object source) {
        BeanWrapper src = new BeanWrapperImpl(source);
        PropertyDescriptor[] pds = src.getPropertyDescriptors();
        Set<String> emptyNames = new HashSet<String>();
        for (PropertyDescriptor pd : pds) {
            Object srcValue = src.getPropertyValue(pd.getName());
            if (srcValue == null)
                emptyNames.add(pd.getName());
        }
        String[] result = new String[emptyNames.size()];
        return emptyNames.toArray(result);
    }
    /**
     * 保存孕产妇访视详情记录
     * @param followupId
     * @param followupProject
     * @param postpartumVisitDetails
     * @param doctorCode
     * @throws Exception
     */
    public void savePostpartumVisitDetails(String followupId, String followupProject, String postpartumVisitDetails, String doctorCode) throws Exception {
        BaseDoctorDO d = null;
        if(StringUtils.isNotBlank(doctorCode)){
            d = doctorDao.findById(doctorCode);
        }else {
            throw new Exception("该医生不存在!");
        }
        JestClient jestClient = null;
        jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", followupId))
//                        .must(QueryBuilders.matchQuery("followup_project", followupProject))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexPostpartum).addType(esTypePostpartum)
                .build();
        SearchResult result = jestClient.execute(search);
        PostpartumVisitRecordES postpartumVisitRecordES = result.getSourceAsObject(PostpartumVisitRecordES.class);
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        //设置当前随访状态
        if(followup.getStatus().equals("2")){
            followup.setStatus("3");
            followupDao.save(followup);
        }
        //保存新的随访详情信息,如果是编辑的id不变
        String id = null;
        if(postpartumVisitRecordES != null && StringUtils.isNotBlank(postpartumVisitRecordES.getId())) {
            id = postpartumVisitRecordES.getId();
        }
        postpartumVisitRecordES = JSON.parseObject(postpartumVisitDetails,PostpartumVisitRecordES.class);
        postpartumVisitRecordES.setId(id);
        postpartumVisitRecordES.setFollowup_id(followupId);
        postpartumVisitRecordES.setFollowup_project(followupProject);
        postpartumVisitRecordES.setCreate_time(new Date());
        postpartumVisitRecordES.setCreate_user(doctorCode);
        postpartumVisitRecordES.setCreate_user_name(d.getName());
        postpartumVisitRecordES.setVisiting_doctor_code(doctorCode);
        elastricSearchSave.save(postpartumVisitRecordES, esIndexPostpartum, esTypePostpartum);
    }
    /**
     * 根据随访id获取孕产妇访视详情
     * @param followupId
     * @param followupProject
     * @return
     * @throws Exception
     */
    public PostpartumVisitRecordES getPostpartumVisitRecord(String followupId, String followupProject) throws Exception{
        JestClient jestClient = null;
        PostpartumVisitRecordES postpartumVisitRecordES = null;
        try {
            //根据随访ID、分类ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", followupId))
//                            .must(QueryBuilders.matchQuery("followup_project", followupProject))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexPostpartum).addType(esTypePostpartum)
                    .build();
            SearchResult result = jestClient.execute(search);
            postpartumVisitRecordES = result.getSourceAsObject(PostpartumVisitRecordES.class);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return postpartumVisitRecordES;
    }
    /**
     * 保存严重精神障碍患者随访记录
     * @param followupId
     * @param followupProject
     * @param severeMentalDisorderData
     * @param doctorCode
     * @throws Exception
     */
    public void saveFollowupSevereMentalDisorder(String followupId, String followupProject, String severeMentalDisorderData, String doctorCode) throws Exception{
        BaseDoctorDO d = null;
        if(StringUtils.isNotBlank(doctorCode)){
            d = doctorDao.findById(doctorCode);
        }else {
            throw new Exception("该医生不存在!");
        }
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", followupId))
//                        .must(QueryBuilders.matchQuery("followup_project", followupProject))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexSevereMentalDisorder).addType(esTypeSevereMentalDisorder)
                .build();
        SearchResult result = jestClient.execute(search);
        FollowupSevereMentalDisorderES severeMentalDisorderES = result.getSourceAsObject(FollowupSevereMentalDisorderES.class);
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        //设置当前随访状态
        if(followup.getStatus().equals("2")){
            followup.setStatus("3");
            followupDao.save(followup);
        }
        //保存新的随访详情信息
        String id = null;
        if(severeMentalDisorderES != null && StringUtils.isNotBlank(severeMentalDisorderES.getId())) {
            id = severeMentalDisorderES.getId();
        }
        severeMentalDisorderES = JSON.parseObject(severeMentalDisorderData,FollowupSevereMentalDisorderES.class);
        severeMentalDisorderES.setId(id);
        severeMentalDisorderES.setFollowup_id(followupId);
        severeMentalDisorderES.setFollowup_project(followupProject);
        severeMentalDisorderES.setCreate_time(new Date());
        severeMentalDisorderES.setCreate_user(doctorCode);
        severeMentalDisorderES.setCreate_user_name(d.getName());
        elastricSearchSave.save(severeMentalDisorderES, esIndexSevereMentalDisorder, esTypeSevereMentalDisorder);
    }
    /**
     * 获取严重精神障碍患者随访记录
     * @param followupId
     * @param followupProject
     * @return
     * @throws IOException
     */
    public FollowupSevereMentalDisorderES getFollowupSevereMentalDisorder(String followupId, String followupProject) throws IOException {
        JestClient jestClient = null;
        FollowupSevereMentalDisorderES severeMentalDisorderES = null;
        try {
            //根据随访ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", followupId))
//                            .must(QueryBuilders.matchQuery("followup_project", followupProject))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexSevereMentalDisorder).addType(esTypeSevereMentalDisorder).build();
            SearchResult result = jestClient.execute(search);
            severeMentalDisorderES = result.getSourceAsObject(FollowupSevereMentalDisorderES.class);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return severeMentalDisorderES;
    }
    /**
     * 保存老人健康体检随访记录
     * @param followupId
     * @param followupProject
     * @param olderPeopleHealthCheckData
     * @param doctorCode
     * @throws Exception
     */
    public void saveOlderPeopleHealthCheckRecord(String followupId, String followupProject, String olderPeopleHealthCheckData, String doctorCode,Integer bdStatus,Integer pgStatus) throws Exception{
        BaseDoctorDO d = null;
        if(StringUtils.isNotBlank(doctorCode)){
            d = doctorDao.findById(doctorCode);
        }else {
            throw new Exception("该医生不存在!");
        }
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", followupId))
//                        .must(QueryBuilders.matchQuery("followup_project", followupProject))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexOlderPeopleHealthCheck).addType(esTypeOlderPeopleHealthCheck)
                .build();
        SearchResult result = jestClient.execute(search);
        OlderPeopleHealthCheckRecordES olderPeopleHealthCheckRecord = result.getSourceAsObject(OlderPeopleHealthCheckRecordES.class);
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        if (followup.getFollowupClass().equals("8")){
            /*if (bdStatus != null && bdStatus == 1){
                followup.setBdStatus(1);
            }else {
                followup.setPgStatus(1);
            }*/
        }
        followupDao.save(followup);
        //设置当前随访状态
        if(followup.getStatus().equals("2")){
            followup.setStatus("3");
            followupDao.save(followup);
        }
        //保存新的随访详情信息
        String id = null;
        if(olderPeopleHealthCheckRecord != null && StringUtils.isNotBlank(olderPeopleHealthCheckRecord.getId())) {
            id = olderPeopleHealthCheckRecord.getId();
        }
        olderPeopleHealthCheckRecord = JSON.parseObject(olderPeopleHealthCheckData,OlderPeopleHealthCheckRecordES.class);
        olderPeopleHealthCheckRecord.setId(id);
        olderPeopleHealthCheckRecord.setFollowup_id(followupId);
        olderPeopleHealthCheckRecord.setFollowup_project(followupProject);
        olderPeopleHealthCheckRecord.setCreate_time(new Date());
        olderPeopleHealthCheckRecord.setCreate_user(doctorCode);
        olderPeopleHealthCheckRecord.setCreate_user_name(d.getName());
        elastricSearchSave.save(olderPeopleHealthCheckRecord, esIndexOlderPeopleHealthCheck, esTypeOlderPeopleHealthCheck);
    }
    /**
     * 获取老人健康体检随访记录
     * @param followupId
     * @param followupProject
     * @return
     * @throws Exception
     */
    public OlderPeopleHealthCheckRecordES getOlderPeopleHealthCheckRecord(String followupId, String followupProject) throws Exception{
        JestClient jestClient = null;
        OlderPeopleHealthCheckRecordES olderPeopleHealthCheckRecord = null;
        try {
            //根据随访ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", followupId))
//                            .must(QueryBuilders.matchQuery("followup_project", followupProject))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexOlderPeopleHealthCheck).addType(esTypeOlderPeopleHealthCheck).build();
            SearchResult result = jestClient.execute(search);
            olderPeopleHealthCheckRecord = result.getSourceAsObject(OlderPeopleHealthCheckRecordES.class);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return olderPeopleHealthCheckRecord;
    }
    /**
     * 保存新生儿家庭访视记录
     * @param followupId
     * @param followupProject
     * @param newbornFamilyVisitRecordData
     * @param doctorCode
     * @throws Exception
     */
    public void saveNewbornFamilyVisitRecord(String followupId, String followupProject, String newbornFamilyVisitRecordData, String doctorCode) throws Exception{
        BaseDoctorDO d = null;
        if(StringUtils.isNotBlank(doctorCode)){
            d = doctorDao.findById(doctorCode);
        }else {
            throw new Exception("该医生不存在!");
        }
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", followupId))
//                        .must(QueryBuilders.matchQuery("followup_project", followupProject))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexNewbornFamilyVisit).addType(esTypeNewbornFamilyVisit)
                .build();
        SearchResult result = jestClient.execute(search);
        NewbornFamilyVisitRecordES newbornFamilyVisitRecordES = result.getSourceAsObject(NewbornFamilyVisitRecordES.class);
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        //设置当前随访状态
        if(followup.getStatus().equals("2")){
            followup.setStatus("3");
            followupDao.save(followup);
        }
        //保存新的随访详情信息
        String id = null;
        if(newbornFamilyVisitRecordES != null && StringUtils.isNotBlank(newbornFamilyVisitRecordES.getId())) {
            id = newbornFamilyVisitRecordES.getId();
        }
        newbornFamilyVisitRecordES = JSON.parseObject(newbornFamilyVisitRecordData,NewbornFamilyVisitRecordES.class);
        newbornFamilyVisitRecordES.setId(id);
        newbornFamilyVisitRecordES.setFollowup_id(followupId);
        newbornFamilyVisitRecordES.setFollowup_project(followupProject);
        newbornFamilyVisitRecordES.setCreate_time(new Date());
        newbornFamilyVisitRecordES.setCreate_user(doctorCode);
        newbornFamilyVisitRecordES.setCreate_user_name(d.getName());
        elastricSearchSave.save(newbornFamilyVisitRecordES, esIndexNewbornFamilyVisit, esTypeNewbornFamilyVisit);
    }
    /**
     * 获取新生儿家庭访视记录
     * @param followupId
     * @param followupProject
     * @return
     * @throws Exception
     */
    public NewbornFamilyVisitRecordES getNewbornFamilyVisitRecord(String followupId, String followupProject) throws Exception{
        JestClient jestClient = null;
        NewbornFamilyVisitRecordES newbornFamilyVisitRecordES = null;
        try {
            //根据随访ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", followupId))
//                            .must(QueryBuilders.matchQuery("followup_project", followupProject))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexNewbornFamilyVisit).addType(esTypeNewbornFamilyVisit).build();
            SearchResult result = jestClient.execute(search);
            newbornFamilyVisitRecordES = result.getSourceAsObject(NewbornFamilyVisitRecordES.class);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return newbornFamilyVisitRecordES;
    }
    /**
     * 根据居民code和访视类别获取上次随访记录
     * @param patientCode
     * @param followupClass 5.产后 6.新生儿 7.严重精神病 8.80岁以上老人 9.肺结核
     * @return
     */
    public JSONObject getLastVisitRecord(String patientCode, String followupClass) throws Exception {
        JSONObject res = new JSONObject();
        List<Followup> followupList = followupDao.findAllByPatientCodeAndClass(patientCode, followupClass);
        if (followupList.size() > 0) {
            String sql = "";
            res.put("followup", followupList.get(0));
            //产后记录
            if(followupClass.equals("5")) {
                PostpartumVisitRecordES es = this.getPostpartumVisitRecord(followupList.get(0).getId() + "", null);
//                sql = "select * from " + esIndexPostpartum + " where followup_id ='" + followupList.get(0).getId() + "' order by create_time desc ";
//                List<PostpartumVisitRecordES> returnList = elasticsearchUtil.excute(sql, PostpartumVisitRecordES.class, esTypePostpartum, esIndexPostpartum);
                res.put("detail", es);
            }else  if(followupClass.equals("6")) {
                NewbornFamilyVisitRecordES es = this.getNewbornFamilyVisitRecord(followupList.get(0).getId() + "", null);
//                sql = "select * from " + esIndexNewbornFamilyVisit + " where followup_id ='" + followupList.get(0).getId() + "' order by create_time desc ";
//                List<NewbornFamilyVisitRecordES> returnList = elasticsearchUtil.excute(sql, NewbornFamilyVisitRecordES.class, esTypeNewbornFamilyVisit, esIndexNewbornFamilyVisit);
                res.put("detail", es);
            }else  if(followupClass.equals("7")) {
                FollowupSevereMentalDisorderES es = this.getFollowupSevereMentalDisorder(followupList.get(0).getId() + "", null);
                res.put("detail", es);
//                sql = "select * from " + esIndexSevereMentalDisorder + " where followup_id ='" + followupList.get(0).getId() + "'order by create_time desc ";
//                List<FollowupSevereMentalDisorderES> returnList = elasticsearchUtil.excute(sql, FollowupSevereMentalDisorderES.class, esTypeSevereMentalDisorder, esIndexSevereMentalDisorder);
            }else  if(followupClass.equals("8")) {
                OlderPeopleHealthCheckRecordES es = this.getOlderPeopleHealthCheckRecord(followupList.get(0).getId() + "", null);
                res.put("detail", es);
//                sql = "select * from " + esIndexOlderPeopleHealthCheck + " where followup_id ='" + followupList.get(0).getId() + "' order by create_time desc ";
//                List<OlderPeopleHealthCheckRecordES> returnList = elasticsearchUtil.excute(sql, OlderPeopleHealthCheckRecordES.class, esTypeOlderPeopleHealthCheck, esIndexOlderPeopleHealthCheck);
            }else  if(followupClass.equals("9") && followupList.size() >= 2) {  //非第一次肺结核访视
                List<JSONObject> returnList = phthisisFollowupService.queryNTimesByFollowupId(followupList.get(0).getId() + "");
//                sql = "select * from " + esIndexPhthisisNTimes + " where followup_id ='" + followupList.get(0).getId() + "' ";
//                List<PhthisisNTimesFollowupDataES> returnList = elasticsearchUtil.excute(sql, PhthisisNTimesFollowupDataES.class, esTypePhthisisNTimes, esIndexPhthisisNTimes);
                res.put("detail", returnList);
            }
        }
        return res;
    }
    /**
     * 保存慢性妇科炎症日常随访
     * @param followupId
     * @param jsonData
     * @param doctorCode
     * @return
     * @throws Exception
     */
    public GynecologicalInflammationDailyFollowupES saveGynecologicalInflammationDaily(String followupId, String jsonData, String doctorCode) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        Followup followupTemp = JSON.parseObject(jsonObject.getString("followup"), Followup.class);
        BeanUtils.copyProperties(followupTemp, followup, getNullPropertyNames(followupTemp));
        //设置当前随访状态
        if(followup.getStatus().equals("2")){
            followup.setStatus("3");
            followupDao.save(followup);
        }
        //判断是否已同步给智业,同步完再更新表单就要修改状态重新同步
        FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(followupId));
        if(followupMapping != null){
            followUpMappingDao.updateNeedUploadByFollowupId(1, Integer.parseInt(followupId));
        }
        BaseDoctorDO d = null;
        DoctorMappingDO doctorMapping = null;
        if(StringUtils.isNotBlank(doctorCode)){
            d = doctorDao.findById(doctorCode);
            doctorMapping = doctorMappingDao.findByDoctor(doctorCode);
        }else {
            throw new Exception("该医生不存在!");
        }
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", followupId))
//                        .must(QueryBuilders.matchQuery("followup_project", followupProject))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexGynecologicalInflammationDaily).addType(esTypeGynecologicalInflammationDaily)
                .build();
        SearchResult result = jestClient.execute(search);
        GynecologicalInflammationDailyFollowupES dailyFollowupES = result.getSourceAsObject(GynecologicalInflammationDailyFollowupES.class);
        GynecologicalInflammationDailyFollowupES dailyFollowupNew = JSON.parseObject(jsonObject.getString("content"), GynecologicalInflammationDailyFollowupES.class);
        if(dailyFollowupES != null) {
            BeanUtils.copyProperties(dailyFollowupNew, dailyFollowupES, getNullPropertyNames(dailyFollowupNew));
        }else {
            dailyFollowupES = dailyFollowupNew;
        }
        //保存新的随访详情信息
        if(StringUtils.isBlank(dailyFollowupES.getId())) {
            dailyFollowupES.setFollowup_id(followupId);
            dailyFollowupES.setCreateTime(new Date());
            dailyFollowupES.setCreateOperator(doctorMapping.getMappingCode());
            dailyFollowupES.setCreateOperatorName(d.getName());
            dailyFollowupES.setValidFlag("1");
        }
        dailyFollowupES.setModifyTime(new Date());
        dailyFollowupES.setModifyOperator(doctorMapping.getMappingCode());
        dailyFollowupES.setModifyOperatorName(d.getName());
        elastricSearchSave.save(dailyFollowupES, esIndexGynecologicalInflammationDaily, esTypeGynecologicalInflammationDaily);
        return dailyFollowupES;
    }
    /**
     * 获取慢性妇科炎症日常随访
     * @param followupId
     * @return
     * @throws Exception
     */
    public JSONObject getGynecologicalInflammationDaily(String followupId) throws Exception {
        JSONObject jsonObject = new JSONObject();
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        jsonObject.put("followup", followup);
        JestClient jestClient = null;
        GynecologicalInflammationDailyFollowupES dailyFollowupES = null;
        try {
            //根据随访ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", followupId))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexGynecologicalInflammationDaily).addType(esTypeGynecologicalInflammationDaily).build();
            SearchResult result = jestClient.execute(search);
            dailyFollowupES = result.getSourceAsObject(GynecologicalInflammationDailyFollowupES.class);
            jsonObject.put("content", dailyFollowupES);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return jsonObject;
    }
    /**
     * 保存妇科炎症随访档案
     * @param followupId
     * @param jsonData
     * @param doctorCode
     * @return
     * @throws Exception
     */
    public GynecologicalInflammationFollowupArchivesES saveGynecologicalInflammationFollowupArchives(String followupId, String jsonData, String doctorCode) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        Followup followupTemp = JSON.parseObject(jsonObject.getString("followup"), Followup.class);
        BeanUtils.copyProperties(followupTemp, followup, getNullPropertyNames(followupTemp));
        //设置当前随访状态
        if(followup.getStatus().equals("2")){
            followup.setStatus("3");
            followupDao.save(followup);
        }
        //判断是否已同步给智业,同步完再更新表单就要修改状态重新同步
        FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(followupId));
        if(followupMapping != null){
            followUpMappingDao.updateNeedUploadByFollowupId(1, Integer.parseInt(followupId));
        }
        BaseDoctorDO d = null;
        DoctorMappingDO doctorMapping = null;
        if(StringUtils.isNotBlank(doctorCode)){
            d = doctorDao.findById(doctorCode);
            doctorMapping = doctorMappingDao.findByDoctor(doctorCode);
        }else {
            throw new Exception("该医生不存在!");
        }
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", followupId))
//                        .must(QueryBuilders.matchQuery("followup_project", followupProject))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexGynecologicalInflammationFollowupArchives).addType(esTypeGynecologicalInflammationFollowupArchives)
                .build();
        SearchResult result = jestClient.execute(search);
        GynecologicalInflammationFollowupArchivesES followupArchives = result.getSourceAsObject(GynecologicalInflammationFollowupArchivesES.class);
        GynecologicalInflammationFollowupArchivesES followupArchivesNew = JSON.parseObject(jsonObject.getString("content"), GynecologicalInflammationFollowupArchivesES.class);
        if(followupArchives != null) {
            BeanUtils.copyProperties(followupArchivesNew, followupArchives, getNullPropertyNames(followupArchivesNew));
        }else {
            followupArchives = followupArchivesNew;
        }
        //保存新的随访详情信息
        if(StringUtils.isBlank(followupArchives.getId())) {
            followupArchives.setFollowup_id(followupId);
            followupArchives.setCreateTime(new Date());
            followupArchives.setCreateOperator(doctorMapping.getMappingCode());
            followupArchives.setCreateOperatorName(d.getName());
            followupArchives.setValidFlag("1");
        }
        followupArchives.setModifyTime(new Date());
        followupArchives.setModifyOperator(doctorMapping.getMappingCode());
        followupArchives.setModifyOperatorName(d.getName());
        elastricSearchSave.save(followupArchives, esIndexGynecologicalInflammationFollowupArchives, esTypeGynecologicalInflammationFollowupArchives);
        return followupArchives;
    }
    /**
     * 获取各类病种单日常随访
     * type:
     * BreastFollowup //4.慢性乳腺疾病日常随访
     * CerebralApoplexyFollowup //7.脑卒中日常随访
     * CoronaryFollowup//1.冠心病日常随访
     * FattyLiverFollowUp//8.脂肪肝日常随访
     * NephropathyFollowup//5.慢性肾病日常随访
     * ProstateFollowup//3.慢性前列腺疾病日常随访
     * @param followupId
     * @return
     * @throws Exception
     */
    public JSONObject selectFollowupDiseaseById(String followupId,String type) throws Exception {
        JSONObject jsonObject = new JSONObject();
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        jsonObject.put("followup", followup);
        JestClient jestClient = null;
        BreastFollowupES breastFollowupES = null;
        CerebralApoplexyFollowupES cerebralApoplexyFollowupES = null;
        CoronaryFollowupES coronaryFollowupES = null;
        FattyLiverFollowUpES fattyLiverFollowUpES = null;
        NephropathyFollowupES nephropathyFollowupES = null;
        ProstateFollowupES prostateFollowupES = null;
        try {
            //根据随访ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", followupId))
            );
            if (type.equalsIgnoreCase("BreastFollowup")){
                Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexBreastFollowup).addType(esTypeBreastFollowup).build();
                SearchResult result = jestClient.execute(search);
                breastFollowupES = result.getSourceAsObject(BreastFollowupES.class);
                jsonObject.put("content", breastFollowupES);
            }else if (type.equalsIgnoreCase("CerebralApoplexyFollowup")){
                Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexCerebralApoplexyFollowup).addType(esTypeCerebralApoplexyFollowup).build();
                SearchResult result = jestClient.execute(search);
                cerebralApoplexyFollowupES = result.getSourceAsObject(CerebralApoplexyFollowupES.class);
                jsonObject.put("content", cerebralApoplexyFollowupES);
            }else if (type.equalsIgnoreCase("CoronaryFollowup")){
                Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexCoronaryFollowup).addType(esTypeCoronaryFollowup).build();
                SearchResult result = jestClient.execute(search);
                coronaryFollowupES = result.getSourceAsObject(CoronaryFollowupES.class);
                jsonObject.put("content", coronaryFollowupES);
            }else if (type.equalsIgnoreCase("FattyLiverFollowUp")){
                Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexFattyLiverFollowUp).addType(esTypeFattyLiverFollowUp).build();
                SearchResult result = jestClient.execute(search);
                fattyLiverFollowUpES = result.getSourceAsObject(FattyLiverFollowUpES.class);
                jsonObject.put("content", fattyLiverFollowUpES);
            }else if (type.equalsIgnoreCase("NephropathyFollowup")){
                Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexNephropathyFollowup).addType(esTypeNephropathyFollowup).build();
                SearchResult result = jestClient.execute(search);
                nephropathyFollowupES = result.getSourceAsObject(NephropathyFollowupES.class);
                jsonObject.put("content", nephropathyFollowupES);
            }else if (type.equalsIgnoreCase("ProstateFollowup")){
                Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexProstateFollowup).addType(esTypeProstateFollowup).build();
                SearchResult result = jestClient.execute(search);
                prostateFollowupES = result.getSourceAsObject(ProstateFollowupES.class);
                jsonObject.put("content", prostateFollowupES);
            }
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return jsonObject;
    }
    /**
     *
     * @param followupId
     * @param jsonData
     * @param doctorCode
     * @param type
     * @return
     * @throws Exception
     * BreastFollowup: breast_followup
    CerebralApoplexyFollowup: cerebral_apoplexy_followup
    CoronaryFollowup: coronary_followup
    FattyLiverFollowUp: fatty_liverFollowUp
    NephropathyFollowup: nephropathy_followup
    ProstateFollowup: prostate_followup
     */
    public void saveFollowupDiseaseArchives(String followupId, String jsonData, String doctorCode,String type) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        Followup followupTemp = JSON.parseObject(jsonObject.getString("followup"), Followup.class);
        BeanUtils.copyProperties(followupTemp, followup, getNullPropertyNames(followupTemp));
        //设置当前随访状态
        if(followup.getStatus().equals("2")){
            followup.setStatus("3");
            followupDao.save(followup);
        }
        //判断是否已同步给智业,同步完再更新表单就要修改状态重新同步
        FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(followupId));
        if(followupMapping != null){
            followUpMappingDao.updateNeedUploadByFollowupId(1, Integer.parseInt(followupId));
        }
        BaseDoctorDO d = null;
        DoctorMappingDO doctorMapping = null;
        if(StringUtils.isNotBlank(doctorCode)){
            d = doctorDao.findById(doctorCode);
            doctorMapping = doctorMappingDao.findByDoctor(doctorCode);
        }else {
            throw new Exception("该医生不存在!");
        }
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", followupId))
//                        .must(QueryBuilders.matchQuery("followup_project", followupProject))
        );
        BasePatientDO patient1 = patientDao.findById(followup.getPatientCode());
        String idcard = "";
        if (patient1!=null){
            idcard = patient1.getIdcard();
        }
        //获取随访机构id
        BaseOrgDO hospitalMapping = hospitalMappingDao.findByCode(followup.getOrgCode());
        followup.setJworgCode(hospitalMapping.getCode());
        String orgId= hospitalMapping.getCode();
        String followOrgId=hospitalMapping.getCode();
        String followDoctor = followup.getJwdoctorCode();//随访医生
        if (StringUtils.isBlank(followDoctor)) {
            followDoctor = doctorMappingDao.findByDoctor(followup.getDoctorCode()).getMappingCode();
            followup.setJwdoctorCode(followDoctor);
        }
        String followTime= DateUtil.dateToStrLong(followup.getFollowupDate());//随访时间
        //判断随访方式【1.门诊 2.电话 3.入户】,待确定
        String followupType = followup.getFollowupType();
        String followType = "";
        if(followupType.equals("1") || followupType.equals("22")) {
            followType="1";
        }else if(followupType.equals("3")) {
            followType="2";
        }
        BaseDoctorDO doctor = doctorDao.findById(followup.getDoctorCode());
        String followDoctorType=doctor.getLevel()+"";
        String nextFollowTime=DateUtil.dateToStrLong(followup.getFollowupNextDate());//下次随访时间
        String assessSource="4";//评估来源【1.前台三合一 2. 前台独立 3.后台自动 4.i健康】
        //判断是新增还是编辑,如果是编辑传回随访ID,新增则不传
        if (type.equalsIgnoreCase("BreastFollowup")){
            //4.慢性乳腺疾病日常随访
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexBreastFollowup).addType(esTypeBreastFollowup)
                    .build();
            SearchResult result = jestClient.execute(search);
            BreastFollowupES breastFollowup = result.getSourceAsObject(BreastFollowupES.class);
            BreastFollowupES breastFollowupNew = JSON.parseObject(jsonObject.getString("content"), BreastFollowupES.class);
            if(breastFollowup != null) {
                BeanUtils.copyProperties(breastFollowupNew, breastFollowup, getNullPropertyNames(breastFollowupNew));
            }else {
                breastFollowup = breastFollowupNew;
            }
            //保存新的随访详情信息
            if(StringUtils.isBlank(breastFollowup.getId())) {
                breastFollowup.setFollowup_id(followupId);
                breastFollowup.setCreateTime(DateUtil.getStringDate());
                breastFollowup.setCreateOperator(doctorMapping.getMappingCode());
                breastFollowup.setCreateOperatorName(d.getName());
                breastFollowup.setValidFlag("1");
                breastFollowup.setIdentityCardNo(idcard);
                breastFollowup.setOrgId(orgId);
                breastFollowup.setFollowOrgId(followOrgId);
                breastFollowup.setFollowDoctor(followDoctor);
                breastFollowup.setFollowTime(followTime);
                breastFollowup.setFollowType(followType);
                breastFollowup.setFollowDoctorType(followDoctorType);
                breastFollowup.setAssessSource(assessSource);
                breastFollowup.setNextFollowTime(nextFollowTime);
            }
            breastFollowup.setModifyTime(DateUtil.getStringDate());
            breastFollowup.setModifyOperator(doctorMapping.getMappingCode());
            breastFollowup.setModifyOperatorName(d.getName());
            elastricSearchSave.save(breastFollowup, esIndexBreastFollowup, esTypeBreastFollowup);
        }else if (type.equalsIgnoreCase("CoronaryFollowup")){
            //1.冠心病日常随访
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexCoronaryFollowup).addType(esTypeCoronaryFollowup)
                    .build();
            SearchResult result = jestClient.execute(search);
            CoronaryFollowupES coronaryFollowup = result.getSourceAsObject(CoronaryFollowupES.class);
            CoronaryFollowupES coronaryFollowupNew = JSON.parseObject(jsonObject.getString("content"), CoronaryFollowupES.class);
            if(coronaryFollowup != null) {
                BeanUtils.copyProperties(coronaryFollowupNew, coronaryFollowup, getNullPropertyNames(coronaryFollowupNew));
            }else {
                coronaryFollowup = coronaryFollowupNew;
            }
            //保存新的随访详情信息
            if(StringUtils.isBlank(coronaryFollowup.getId())) {
                coronaryFollowup.setFollowup_id(followupId);
                coronaryFollowup.setCreateTime(DateUtil.getStringDate());
                coronaryFollowup.setCreateOperator(doctorMapping.getMappingCode());
                coronaryFollowup.setCreateOperatorName(d.getName());
                coronaryFollowup.setValidFlag("1");
                coronaryFollowup.setIdentityCardNo(idcard);
                coronaryFollowup.setOrgId(orgId);
                coronaryFollowup.setFollowOrgId(followOrgId);
                coronaryFollowup.setFollowDoctor(followDoctor);
                coronaryFollowup.setFollowTime(followTime);
                coronaryFollowup.setFollowType(followType);
                coronaryFollowup.setFollowDoctorType(followDoctorType);
                coronaryFollowup.setAssessSource(assessSource);
                coronaryFollowup.setNextFollowTime(nextFollowTime);
            }
            coronaryFollowup.setModifyTime(DateUtil.getStringDate());
            coronaryFollowup.setModifyOperator(doctorMapping.getMappingCode());
            coronaryFollowup.setModifyOperatorName(d.getName());
            elastricSearchSave.save(coronaryFollowup, esIndexCoronaryFollowup, esTypeCoronaryFollowup);
        }else if (type.equalsIgnoreCase("CerebralApoplexyFollowup")){
            //7.脑卒中日常随访
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexCerebralApoplexyFollowup).addType(esTypeCerebralApoplexyFollowup)
                    .build();
            SearchResult result = jestClient.execute(search);
            CerebralApoplexyFollowupES cerebralApoplexyFollowup = result.getSourceAsObject(CerebralApoplexyFollowupES.class);
            CerebralApoplexyFollowupES cerebralApoplexyFollowupNew = JSON.parseObject(jsonObject.getString("content"), CerebralApoplexyFollowupES.class);
            if(cerebralApoplexyFollowup != null) {
                BeanUtils.copyProperties(cerebralApoplexyFollowupNew, cerebralApoplexyFollowup, getNullPropertyNames(cerebralApoplexyFollowupNew));
            }else {
                cerebralApoplexyFollowup = cerebralApoplexyFollowupNew;
            }
            //保存新的随访详情信息
            if(StringUtils.isBlank(cerebralApoplexyFollowup.getId())) {
                cerebralApoplexyFollowup.setFollowup_id(followupId);
                cerebralApoplexyFollowup.setCreateTime(DateUtil.getStringDate());
                cerebralApoplexyFollowup.setCreateOperator(doctorMapping.getMappingCode());
                cerebralApoplexyFollowup.setCreateOperatorName(d.getName());
                cerebralApoplexyFollowup.setValidFlag("1");
                cerebralApoplexyFollowup.setIdentityCardNo(idcard);
                cerebralApoplexyFollowup.setOrgId(orgId);
                cerebralApoplexyFollowup.setFollowOrgId(followOrgId);
                cerebralApoplexyFollowup.setFollowDoctor(followDoctor);
                cerebralApoplexyFollowup.setFollowTime(followTime);
                cerebralApoplexyFollowup.setFollowType(followType);
                cerebralApoplexyFollowup.setFollowDoctorType(followDoctorType);
                cerebralApoplexyFollowup.setAssessSource(assessSource);
                cerebralApoplexyFollowup.setNextFollowTime(nextFollowTime);
            }
            cerebralApoplexyFollowup.setModifyTime(DateUtil.getStringDate());
            cerebralApoplexyFollowup.setModifyOperator(doctorMapping.getMappingCode());
            cerebralApoplexyFollowup.setModifyOperatorName(d.getName());
            elastricSearchSave.save(cerebralApoplexyFollowup,esIndexCerebralApoplexyFollowup , esTypeCerebralApoplexyFollowup);
        }else if (type.equalsIgnoreCase("FattyLiverFollowUp")){
            //8.脂肪肝日常随访
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexFattyLiverFollowUp).addType(esTypeFattyLiverFollowUp)
                    .build();
            SearchResult result = jestClient.execute(search);
            FattyLiverFollowUpES fattyLiverFollowUp = result.getSourceAsObject(FattyLiverFollowUpES.class);
            FattyLiverFollowUpES fattyLiverFollowUpNew = JSON.parseObject(jsonObject.getString("content"), FattyLiverFollowUpES.class);
            if(fattyLiverFollowUp != null) {
                BeanUtils.copyProperties(fattyLiverFollowUpNew, fattyLiverFollowUp, getNullPropertyNames(fattyLiverFollowUpNew));
            }else {
                fattyLiverFollowUp = fattyLiverFollowUpNew;
            }
            //保存新的随访详情信息
            if(StringUtils.isBlank(fattyLiverFollowUp.getId())) {
                fattyLiverFollowUp.setFollowup_id(followupId);
                fattyLiverFollowUp.setCreateTime(DateUtil.getStringDate());
                fattyLiverFollowUp.setCreateOperator(doctorMapping.getMappingCode());
                fattyLiverFollowUp.setCreateOperatorName(d.getName());
                fattyLiverFollowUp.setValidFlag("1");
                fattyLiverFollowUp.setIdentityCardNo(idcard);
                fattyLiverFollowUp.setOrgId(orgId);
                fattyLiverFollowUp.setFollowOrgId(followOrgId);
                fattyLiverFollowUp.setFollowDoctor(followDoctor);
                fattyLiverFollowUp.setFollowTime(followTime);
                fattyLiverFollowUp.setFollowType(followType);
                fattyLiverFollowUp.setFollowDoctorType(followDoctorType);
                fattyLiverFollowUp.setAssessSource(assessSource);
                fattyLiverFollowUp.setNextFollowTime(nextFollowTime);
            }
            fattyLiverFollowUp.setModifyTime(DateUtil.getStringDate());
            fattyLiverFollowUp.setModifyOperator(doctorMapping.getMappingCode());
            fattyLiverFollowUp.setModifyOperatorName(d.getName());
            elastricSearchSave.save(fattyLiverFollowUp,esIndexFattyLiverFollowUp , esTypeFattyLiverFollowUp);
        }else if (type.equalsIgnoreCase("NephropathyFollowup")){
            //8.脂肪肝日常随访
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexNephropathyFollowup).addType(esTypeNephropathyFollowup)
                    .build();
            SearchResult result = jestClient.execute(search);
            NephropathyFollowupES nephropathyFollowup = result.getSourceAsObject(NephropathyFollowupES.class);
            NephropathyFollowupES nephropathyFollowupNew = JSON.parseObject(jsonObject.getString("content"), NephropathyFollowupES.class);
            if(nephropathyFollowup != null) {
                BeanUtils.copyProperties(nephropathyFollowupNew, nephropathyFollowup, getNullPropertyNames(nephropathyFollowupNew));
            }else {
                nephropathyFollowup = nephropathyFollowupNew;
            }
            //保存新的随访详情信息
            if(StringUtils.isBlank(nephropathyFollowup.getId())) {
                nephropathyFollowup.setFollowup_id(followupId);
                nephropathyFollowup.setCreateTime(DateUtil.getStringDate());
                nephropathyFollowup.setCreateOperator(doctorMapping.getMappingCode());
                nephropathyFollowup.setCreateOperatorName(d.getName());
                nephropathyFollowup.setValidFlag("1");
                nephropathyFollowup.setIdentityCardNo(idcard);
                nephropathyFollowup.setOrgId(orgId);
                nephropathyFollowup.setFollowOrgId(followOrgId);
                nephropathyFollowup.setFollowDoctor(followDoctor);
                nephropathyFollowup.setFollowTime(followTime);
                nephropathyFollowup.setFollowType(followType);
                nephropathyFollowup.setFollowDoctorType(followDoctorType);
                nephropathyFollowup.setAssessSource(assessSource);
                nephropathyFollowup.setNextFollowTime(nextFollowTime);
            }
            nephropathyFollowup.setModifyTime(DateUtil.getStringDate());
            nephropathyFollowup.setModifyOperator(doctorMapping.getMappingCode());
            nephropathyFollowup.setModifyOperatorName(d.getName());
            elastricSearchSave.save(nephropathyFollowup,esIndexNephropathyFollowup , esTypeNephropathyFollowup);
        }else if (type.equalsIgnoreCase("ProstateFollowup")){
            //8.脂肪肝日常随访
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexProstateFollowup).addType(esTypeProstateFollowup)
                    .build();
            SearchResult result = jestClient.execute(search);
            ProstateFollowupES prostateFollowup = result.getSourceAsObject(ProstateFollowupES.class);
            ProstateFollowupES prostateFollowupNew = JSON.parseObject(jsonObject.getString("content"), ProstateFollowupES.class);
            if(prostateFollowup != null) {
                BeanUtils.copyProperties(prostateFollowupNew, prostateFollowup, getNullPropertyNames(prostateFollowupNew));
            }else {
                prostateFollowup = prostateFollowupNew;
            }
            //保存新的随访详情信息
            if(StringUtils.isBlank(prostateFollowup.getId())) {
                prostateFollowup.setFollowup_id(followupId);
                prostateFollowup.setCreateTime(DateUtil.getStringDate());
                prostateFollowup.setCreateOperator(doctorMapping.getMappingCode());
                prostateFollowup.setCreateOperatorName(d.getName());
                prostateFollowup.setValidFlag("1");
                prostateFollowup.setIdentityCardNo(idcard);
                prostateFollowup.setOrgId(orgId);
                prostateFollowup.setFollowOrgId(followOrgId);
                prostateFollowup.setFollowDoctor(followDoctor);
                prostateFollowup.setFollowTime(followTime);
                prostateFollowup.setFollowType(followType);
                prostateFollowup.setFollowDoctorType(followDoctorType);
                prostateFollowup.setAssessSource(assessSource);
                prostateFollowup.setNextFollowTime(nextFollowTime);
            }
            prostateFollowup.setModifyTime(DateUtil.getStringDate());
            prostateFollowup.setModifyOperator(doctorMapping.getMappingCode());
            prostateFollowup.setModifyOperatorName(d.getName());
            elastricSearchSave.save(prostateFollowup,esIndexProstateFollowup , esTypeProstateFollowup);
        }
    }
    /**
     * 获取妇科炎症随访档案
     * @param followupId
     * @return
     * @throws Exception
     */
    public JSONObject getGynecologicalInflammationFollowupArchives(String followupId) throws Exception {
        JSONObject jsonObject = new JSONObject();
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        jsonObject.put("followup", followup);
        JestClient jestClient = null;
        GynecologicalInflammationFollowupArchivesES followupArchivesES = null;
        try {
            //根据随访ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", followupId))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexGynecologicalInflammationFollowupArchives).addType(esTypeGynecologicalInflammationFollowupArchives).build();
            SearchResult result = jestClient.execute(search);
            followupArchivesES = result.getSourceAsObject(GynecologicalInflammationFollowupArchivesES.class);
            jsonObject.put("content", followupArchivesES);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return jsonObject;
    }
    /**
     * 保存慢性阻塞性肺病--首次问卷
     * @param followupId
     * @param jsonData
     * @param doctorCode
     * @return
     * @throws Exception
     */
    public COPDFirstTimeQuestionnaireES saveCOPDFirstTimeQuestionnaire(String followupId, String jsonData, String doctorCode) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        Followup followupTemp = JSON.parseObject(jsonObject.getString("followup"), Followup.class);
        BeanUtils.copyProperties(followupTemp, followup, getNullPropertyNames(followupTemp));
        //设置当前随访状态
        if(followup.getStatus().equals("2")){
            followup.setStatus("3");
            followupDao.save(followup);
        }
        //判断是否已同步给智业,同步完再更新表单就要修改状态重新同步
        FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(followupId));
        if(followupMapping != null){
            followUpMappingDao.updateNeedUploadByFollowupId(1, Integer.parseInt(followupId));
        }
        BaseDoctorDO d = null;
        DoctorMappingDO doctorMapping = null;
        if(StringUtils.isNotBlank(doctorCode)){
            d = doctorDao.findById(doctorCode);
            doctorMapping = doctorMappingDao.findByDoctor(doctorCode);
        }else {
            throw new Exception("该医生不存在!");
        }
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", followupId))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexCOPDFirstTimeQuestionnaire).addType(esTypeCOPDFirstTimeQuestionnaire)
                .build();
        SearchResult result = jestClient.execute(search);
        COPDFirstTimeQuestionnaireES COPD = result.getSourceAsObject(COPDFirstTimeQuestionnaireES.class);
        COPDFirstTimeQuestionnaireES COPDNew = JSON.parseObject(jsonObject.getString("content"), COPDFirstTimeQuestionnaireES.class);
        if(COPD != null) {
            BeanUtils.copyProperties(COPDNew, COPD, getNullPropertyNames(COPDNew));
        }else {
            COPD = COPDNew;
        }
        //保存新的随访详情信息
        if(StringUtils.isBlank(COPD.getId())) {
            COPD.setFollowup_id(followupId);
            COPD.setValidFlag("1");
            COPD.setCreateTime(new Date());
            COPD.setCreateOperator(doctorMapping.getMappingCode());
            COPD.setCreateOperatorName(d.getName());
        }
        COPD.setModifyTime(new Date());
        COPD.setModifyOperator(doctorMapping.getMappingCode());
        COPD.setModifyOperatorName(d.getName());
        elastricSearchSave.save(COPD, esIndexCOPDFirstTimeQuestionnaire, esTypeCOPDFirstTimeQuestionnaire);
        return COPD;
    }
    /**
     * 获取慢性阻塞性肺病--首次问卷
     * @param followupId
     * @return
     * @throws IOException
     */
    public JSONObject getCOPDFirstTimeQuestionnaire(String followupId) throws IOException {
        JSONObject jsonObject = new JSONObject();
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        jsonObject.put("followup", followup);
        JestClient jestClient = null;
        COPDFirstTimeQuestionnaireES COPD = null;
        try {
            //根据随访ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", followupId))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexCOPDFirstTimeQuestionnaire).addType(esTypeCOPDFirstTimeQuestionnaire).build();
            SearchResult result = jestClient.execute(search);
            COPD = result.getSourceAsObject(COPDFirstTimeQuestionnaireES.class);
            jsonObject.put("content", COPD);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return jsonObject;
    }
    /**
     * 保存慢性阻塞性肺病--日常随访
     * @param followupId
     * @param jsonData
     * @param doctorCode
     * @return
     * @throws Exception
     */
    public COPDDailyFollowupES saveCOPDDailyFollowup(String followupId, String jsonData, String doctorCode) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        Followup followupTemp = JSON.parseObject(jsonObject.getString("followup"), Followup.class);
        BeanUtils.copyProperties(followupTemp, followup, getNullPropertyNames(followupTemp));
        //设置当前随访状态
        if(followup.getStatus().equals("2")){
            followup.setStatus("3");
            followupDao.save(followup);
        }
        //判断是否已同步给智业,同步完再更新表单就要修改状态重新同步
        FollowupMapping followupMapping = followUpMappingDao.findByFollowupId(Integer.parseInt(followupId));
        if(followupMapping != null){
            followUpMappingDao.updateNeedUploadByFollowupId(1, Integer.parseInt(followupId));
        }
        BaseDoctorDO d = null;
        DoctorMappingDO doctorMapping = null;
        if(StringUtils.isNotBlank(doctorCode)){
            d = doctorDao.findById(doctorCode);
            doctorMapping = doctorMappingDao.findByDoctor(doctorCode);
        }else {
            throw new Exception("该医生不存在!");
        }
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", followupId))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexCOPDDailyFollowup).addType(esTypeCOPDDailyFollowup)
                .build();
        SearchResult result = jestClient.execute(search);
        COPDDailyFollowupES COPD = result.getSourceAsObject(COPDDailyFollowupES.class);
        COPDDailyFollowupES COPDNew = JSON.parseObject(jsonObject.getString("content"), COPDDailyFollowupES.class);
        if(COPD != null) {
            BeanUtils.copyProperties(COPDNew, COPD, getNullPropertyNames(COPDNew));
        }else {
            COPD = COPDNew;
        }
        //保存新的随访详情信息
        if(StringUtils.isBlank(COPD.getId())) {
            COPD.setFollowup_id(followupId);
            COPD.setValidFlag("1");
            COPD.setCreateTime(new Date());
            COPD.setCreateOperator(doctorMapping.getMappingCode());
            COPD.setCreateOperatorName(d.getName());
        }
        COPD.setModifyTime(new Date());
        COPD.setModifyOperator(doctorMapping.getMappingCode());
        COPD.setModifyOperatorName(d.getName());
        elastricSearchSave.save(COPD, esIndexCOPDDailyFollowup, esTypeCOPDDailyFollowup);
        return COPD;
    }
    /**
     * 获取慢性阻塞性肺病--日常随访
     * @param followupId
     * @return
     * @throws IOException
     */
    public JSONObject getCOPDDailyFollowup(String followupId) throws IOException {
        JSONObject jsonObject = new JSONObject();
        Followup followup = followupDao.findOne(Integer.parseInt(followupId));
        jsonObject.put("followup", followup);
        JestClient jestClient = null;
        COPDDailyFollowupES COPD = null;
        try {
            //根据随访ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", followupId))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndexCOPDDailyFollowup).addType(esTypeCOPDDailyFollowup).build();
            SearchResult result = jestClient.execute(search);
            COPD = result.getSourceAsObject(COPDDailyFollowupES.class);
            jsonObject.put("content", COPD);
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return jsonObject;
    }
}

+ 0 - 2
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/service/message/RehabilitationMessageService.java

@ -63,8 +63,6 @@ public class RehabilitationMessageService {
    /*@Value("${hlwyy.url}")
    private String hlwyyUrl;*/
    private final String MESSAGE_NOTICESETTING = "wlyy:message:setting:";
   /* @Value("${im.im_list_get}")
    private String im_list_get;

+ 102 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/util/BusinessLogs.java

@ -0,0 +1,102 @@
package com.yihu.rehabilitation.util;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * 业务日志输出
 * <p>
 * Created by lyr-pc on 2017/1/19.
 */
public class BusinessLogs {
    // 日志输出
    private static Logger logger = LoggerFactory.getLogger(BusinessLogs.class);
    /**
     * 业务类型
     */
    public enum BusinessType {
        // 咨询
        consult
        // 指导
        , guidance
        // 健康教育
        , article
        // 随访
        , followup
        // 预约
        , appointment
        // 标签
        , label
        // 注册
        , register
        // 健康档案
        , archive
        // 签约
        , sign
        // 指标
        , index
    }
    /**
     * 业务日志输出
     *
     * @param type 业务类别
     * @param info 日志信息
     */
    public static void info(BusinessType type, String caller,String user, JSONObject info) {
        try {
            JSONObject log = new JSONObject();
            log.put("time", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(new Date()));
            log.put("logType", 2);
            log.put("caller", caller);
            JSONObject data = new JSONObject();
            data.put("businessType", type.ordinal());
            data.put("patient", user);
            data.put("data", info);
            log.put("data", data);
            logger.info(log.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
     * 业务日志输出
     *
     * @param type 业务类别
     * @param info 日志信息
     */
    public static void info(BusinessType type,String caller, String user, JSONArray info) {
        try {
            JSONObject log = new JSONObject();
            log.put("time", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(new Date()));
            log.put("logType", 2);
            log.put("caller", caller);
            JSONObject data = new JSONObject();
            data.put("businessType", type.ordinal());
            data.put("patient", user);
            data.put("data", info);
            log.put("data", data);
            logger.info(log.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

+ 78 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/util/ClazzReflect.java

@ -0,0 +1,78 @@
package com.yihu.rehabilitation.util;
import com.yihu.jw.util.date.DateUtil;
import org.json.JSONObject;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Date;
/**
 * Created by 卓 on 2017/3/14.
 */
public class ClazzReflect {
    public Object formatToClazz(Object clazz, JSONObject jsonObject){
        Field[] field = clazz.getClass().getDeclaredFields(); // 获取实体类的所有属性,返回Field数组
            try {
            for (int j = 0; j < field.length; j++) { // 遍历所有属性
                String name = field[j].getName(); // 获取属性的名字
                String key = field[j].getName();
                if(jsonObject.isNull(name))continue;
                name = name.substring(0, 1).toUpperCase() + name.substring(1); // 将属性的首字符大写,方便构造get,set方法
                String type = field[j].getGenericType().toString(); // 获取属性的类型
                Method m = null;
                if (type.equals("class java.lang.String")) { // 如果type是类类型,则前面包含"class ",后面跟类名
                    String value = jsonObject.getString(key);
                    m = clazz.getClass().getMethod("set"+name,String.class);
                    m.invoke(clazz, value);
                }
                if (type.equals("class java.lang.Integer")) {
                    Integer value =  jsonObject.getInt(key);
                    m = clazz.getClass().getMethod("set"+name,Integer.class);
                    m.invoke(clazz, value);
                }
                if (type.equals("class java.lang.Boolean")) {
                    Boolean value =  jsonObject.getBoolean(key);
                    m = clazz.getClass().getMethod("set"+name,Boolean.class);
                    m.invoke(clazz, value);
                }
                if (type.equals("class java.lang.Long")) {
                    Long value =  getJsonLong(jsonObject,key);
                    m = clazz.getClass().getMethod("set"+name,Long.class);
                    m.invoke(clazz, value);
                }
                if (type.equals("class java.util.Date")) {
                    String valueString = jsonObject.getString(key);
                    Date value =  DateUtil.strToDate(valueString);
                    m = clazz.getClass().getMethod("set"+name,Date.class);
                    m.invoke(clazz, value);
                }// 如果有需要,可以仿照上面继续进行扩充,再增加对其它类型的判断
            }
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }catch (Exception e){
              e.printStackTrace();
        }
        return clazz;
    }
    private Long getJsonLong(JSONObject jsonObject,String key){
            Object object = jsonObject.get(key);
            if(object==null||"".equals(object)){
                return null;
            }else{
                return jsonObject.getLong(key);
            }
    }
}

+ 1 - 9
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/util/HtmlUtil.java

@ -2,7 +2,7 @@ package com.yihu.rehabilitation.util;
import org.apache.commons.lang3.StringEscapeUtils;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
@ -27,12 +27,4 @@ public class HtmlUtil {
        return result;
    }
    public static  void main(String[] args){
        try {
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

+ 958 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/FollowupContentESDO.java

@ -0,0 +1,958 @@
package com.yihu.rehabilitation.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 随访详情ES实体类
 * @author huangwenjie
 * @date 2017/11/1 13:41
 */
public class FollowupContentESDO {
	
	@JestId
	private String id;
	private String followup_id;             //随访记录ID
	private String followup_project;        //随访详情分类ID
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
	@CreatedDate
	private Date create_time;
	
    private String NO_SYMPTOM;//无症状【0.无 1.有】
    private String HEADACHE;//头痛头晕【0.无 1.有】
    private String NAUSEA;//恶心呕吐【0.无 1.有】
    private String VERTIGO_TINNITUS;//眼花耳鸣【0.无 1.有】
    private String DIFFICULTY_BREATHING;//呼吸困难【0.无 1.有】
    private String PALPITATIONS;//心悸胸闷【0.无 1.有】
    private String EPISTAXIS_BLEEDING;//鼻衄出血不止【0.无 1.有】
    private String LIMBS_NUMB;//四肢发麻【0.无 1.有】
    private String EXTREMITY_EDEMA;//下肢水肿【0.无 1.有】
    private String SYMPTOM_OTHER;//"其他症状"
    private String POLYDIPSIA;//多饮【0.无 1.有】
    private String MORE_FOOD;//多食【0.无 1.有】
    private String MORE_URINE;//多尿【0.无 1.有】
    private String BLURRED_VISION;//视力模糊【0.无 1.有】
    private String INFECTION;//感染【0.无 1.有】
    private String NUMB_HANDS;//手脚麻木【0.无 1.有】
    private String WEIGHT_LOSS;//体重明显下降【0.无 1.有】
    private String HYPOG_REACT_CODE;//低血糖反应【0.无;1.偶尔;2.频繁;】
	
	//体征信息
    private String HEIGHT;//身高
    private String HEIGHT_EXP;//期望身高
    private String WEIGHT;//体重
    private String WEIGHT_EXP;//期望体重
    private String BP_D;//舒张压
    private String BP_U;//收缩压
    private String BS_FPG;//空腹血糖
    private String NO_BS_FPG;//餐后血糖
    private String RANDOM_BLOOD_SUGAR;//随机血糖
    private String BMI;//体质指数
    private String BMI_EXP;//期望体质
    private String OTHER_POSITIVE_SIGNS;//体征其他
    private String POFDA_MARK;//足背动脉搏动【TOUCH_DICT】
    private String HEART_RATE;//心率
	private String BLOOD_SUGAR;//血糖
	private String BLOOD_SUGAR_TYPE;//血糖类
	
	//检查室检查
    private String GHB;//糖化血红蛋白
    private String RENAL_FUNCTION_CREATININE;//血清肌酐
    private String RENAL_FUNCTION_BUN;//血尿素氮
    private String MICROALBUMINURIA;//尿微量白蛋白
    private String EXAM_DATE;//检查日期
    private String BLOOD_FAT_TRIGLYCERIDE;//甘油三酯 V01
    private String BLOOD_FAT_TC;//总胆固醇 V02
    private String BLOOD_FAT_LDLC;//血清低密度脂蛋白胆固醇 V03
	
	//生活方式
    private String DAILY_SMOKING;//日吸烟量
    private String SOMKING_EXP;//日吸烟期望
    private String DAILY_DRINKING;//日饮酒量
    private String DRINK_EXP;//日饮酒期望
    private String EXERCISE_FREQ_CODE;//运动频率【HYGIENE_SPORT_FREQ_DICT】
    private String EXERCISE_FREQ_CODE_EXP;//运动频率期望【HYGIENE_SPORT_FREQ_DICT】
    private String EXERCISE_DURATION_MINS;//运动时长(min) 分钟/次
    private String EXERCISE_DURATION_MINS_EXP;//运动时长期望(min) 分钟/次期望
    private String SALT_TAKEN_LEVEL_CODE;//摄盐情况【LIGHT_WEIGHT_DICT】
    private String SALT_TAKEN_LEVEL_EXP;//摄盐情况期望【LIGHT_WEIGHT_DICT】
    private String PSY_ADJUST_RESULT_CODE;//心里调整【GOOD_FAIR_POOR_DICT】
    private String COMPLIANCE_RESULT_CODE;//遵医行为【GOOD_FAIR_POOR_DICT】
    private String DAILY_STAPLE;//主食(克/天)
	
	//随访评价
    private String HYP_FOLLOWUP_TYPE_CODE;//高血压随访分类【FOLLOW_TYPE_DICT】
    private String HYP_COMPLICATION_DETAIL;//高血压随访分类--详情
    private String DIA_FOLLOWUP_TYPE_CODE;//糖尿病随访分类【FOLLOW_TYPE_DICT】
    private String DIA_COMPLICATION_DETAIL;//糖尿病随访分类--详情
	
	//用药情况
	private String DRUG_COMPLIANCE_CODE;//服药依从性【DRUG_STATE_DICT】
	
	//控制目标
    private String CONTROL_DATE;//控制日期 V04
	private String CONTROL_CONSTITUTOR;//制定者姓名
	private String CONTROL_CONSTITUTOR_DOCTORCODE;//制定者本地CODE
	private String CONTROL_CONSTITUTOR_JWDOCTORCODE;//制定者本地CODE
                            
    private String CONTROL_BP_U;//血压收缩压 V06
    private String CONTROL_BP_D;//血压舒张压 V07
    private String CONTROL_BS_FPG;//空腹血糖 V08
    private String CONTROL_NO_BS_FPG;//餐后血糖 V09
    private String CONTROL_GHB;//糖化血红蛋白 V10
    private String CONTROL_TRIGLYCERIDE;//甘油三酯 V11
    private String CONTROL_TOTAL_CHOLESTEROL;//总胆固醇 V12
    private String CONTROL_LDL;//低密度脂蛋白 V13
    private String CONTROL_WEIGHT;//体重 V14
    private String CONTROL_EXERCISE_FREQ_CODE;//运动频率 V15
    private String CONTROL_EXERCISE_DURATION_MINS;//运动时长 V16
	
	//健康教育
    private String ARCHIVE_TIME;//健康教育日期 V17
    private String ARCHIVE_OPERATOR_NAME;//健康教育记录者 基卫系统医生【传中文名称】 V18
    private String HEALTH_EDUCATE;//健康教育【CHRO_HEALTH_EDUCATE_DICT】 V19
    private String EDUCATE_CONTENT;//健康教育内容 V20
	
	//转诊
    private String DRUG_ADVERSE_MARK;//药物不良反应【0.无;1.有;】
    private String ADR_REMARK;//药物不良反应【内容】
    private String TRANSFER_RESON;//转诊原因
    private String TRANSFER_ORG_DEPT;//转诊机构科室
    private String REFUSE_REFERRAL;//患者拒绝转诊【0 否 1 是】
    private String REFUSE_REFERRAL_WHY;//患者拒绝转诊内容
	
	//多余字段
    private String ARCHIVE_ID;//档案ID
    private String CHECK_FEE_TYPE;//检测费用类型
    private String FAMILY_FOLLOWUP_ID;//随访细表外键随访ID
	
	
	
	public String getId() {
		return id;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	public String getFollowup_id() {
		return followup_id;
	}
	
	public void setFollowup_id(String followup_id) {
		this.followup_id = followup_id;
	}
	
	public String getFollowup_project() {
		return followup_project;
	}
	
	public void setFollowup_project(String followup_project) {
		this.followup_project = followup_project;
	}
	
	public Date getCreate_time() {
		return create_time;
	}
	
	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}
	
	@JSONField(name = "NO_SYMPTOM")
	public String getNO_SYMPTOM() {
		return NO_SYMPTOM;
	}
	
	public void setNO_SYMPTOM(String NO_SYMPTOM) {
		this.NO_SYMPTOM = NO_SYMPTOM;
	}
	
	@JSONField(name = "HEADACHE")
	public String getHEADACHE() {
		return HEADACHE;
	}
	
	public void setHEADACHE(String HEADACHE) {
		this.HEADACHE = HEADACHE;
	}
	
	@JSONField(name = "NAUSEA")
	public String getNAUSEA() {
		return NAUSEA;
	}
	
	public void setNAUSEA(String NAUSEA) {
		this.NAUSEA = NAUSEA;
	}
	
	@JSONField(name = "VERTIGO_TINNITUS")
	public String getVERTIGO_TINNITUS() {
		return VERTIGO_TINNITUS;
	}
	
	public void setVERTIGO_TINNITUS(String VERTIGO_TINNITUS) {
		this.VERTIGO_TINNITUS = VERTIGO_TINNITUS;
	}
	
	@JSONField(name = "DIFFICULTY_BREATHING")
	public String getDIFFICULTY_BREATHING() {
		return DIFFICULTY_BREATHING;
	}
	
	public void setDIFFICULTY_BREATHING(String DIFFICULTY_BREATHING) {
		this.DIFFICULTY_BREATHING = DIFFICULTY_BREATHING;
	}
	
	@JSONField(name = "PALPITATIONS")
	public String getPALPITATIONS() {
		return PALPITATIONS;
	}
	
	public void setPALPITATIONS(String PALPITATIONS) {
		this.PALPITATIONS = PALPITATIONS;
	}
	
	@JSONField(name = "EPISTAXIS_BLEEDING")
	public String getEPISTAXIS_BLEEDING() {
		return EPISTAXIS_BLEEDING;
	}
	
	public void setEPISTAXIS_BLEEDING(String EPISTAXIS_BLEEDING) {
		this.EPISTAXIS_BLEEDING = EPISTAXIS_BLEEDING;
	}
	
	@JSONField(name = "LIMBS_NUMB")
	public String getLIMBS_NUMB() {
		return LIMBS_NUMB;
	}
	
	public void setLIMBS_NUMB(String LIMBS_NUMB) {
		this.LIMBS_NUMB = LIMBS_NUMB;
	}
	
	@JSONField(name = "EXTREMITY_EDEMA")
	public String getEXTREMITY_EDEMA() {
		return EXTREMITY_EDEMA;
	}
	
	public void setEXTREMITY_EDEMA(String EXTREMITY_EDEMA) {
		this.EXTREMITY_EDEMA = EXTREMITY_EDEMA;
	}
	
	@JSONField(name = "SYMPTOM_OTHER")
	public String getSYMPTOM_OTHER() {
		return SYMPTOM_OTHER;
	}
	
	public void setSYMPTOM_OTHER(String SYMPTOM_OTHER) {
		this.SYMPTOM_OTHER = SYMPTOM_OTHER;
	}
	
	@JSONField(name = "POLYDIPSIA")
	public String getPOLYDIPSIA() {
		return POLYDIPSIA;
	}
	
	public void setPOLYDIPSIA(String POLYDIPSIA) {
		this.POLYDIPSIA = POLYDIPSIA;
	}
	
	@JSONField(name = "MORE_FOOD")
	public String getMORE_FOOD() {
		return MORE_FOOD;
	}
	
	public void setMORE_FOOD(String MORE_FOOD) {
		this.MORE_FOOD = MORE_FOOD;
	}
	
	@JSONField(name = "MORE_URINE")
	public String getMORE_URINE() {
		return MORE_URINE;
	}
	
	public void setMORE_URINE(String MORE_URINE) {
		this.MORE_URINE = MORE_URINE;
	}
	
	@JSONField(name = "BLURRED_VISION")
	public String getBLURRED_VISION() {
		return BLURRED_VISION;
	}
	
	public void setBLURRED_VISION(String BLURRED_VISION) {
		this.BLURRED_VISION = BLURRED_VISION;
	}
	
	@JSONField(name = "INFECTION")
	public String getINFECTION() {
		return INFECTION;
	}
	
	public void setINFECTION(String INFECTION) {
		this.INFECTION = INFECTION;
	}
	
	@JSONField(name = "NUMB_HANDS")
	public String getNUMB_HANDS() {
		return NUMB_HANDS;
	}
	
	public void setNUMB_HANDS(String NUMB_HANDS) {
		this.NUMB_HANDS = NUMB_HANDS;
	}
	
	@JSONField(name = "WEIGHT_LOSS")
	public String getWEIGHT_LOSS() {
		return WEIGHT_LOSS;
	}
	
	public void setWEIGHT_LOSS(String WEIGHT_LOSS) {
		this.WEIGHT_LOSS = WEIGHT_LOSS;
	}
	
	@JSONField(name = "HYPOG_REACT_CODE")
	public String getHYPOG_REACT_CODE() {
		return HYPOG_REACT_CODE;
	}
	
	public void setHYPOG_REACT_CODE(String HYPOG_REACT_CODE) {
		this.HYPOG_REACT_CODE = HYPOG_REACT_CODE;
	}
	
	@JSONField(name = "HEIGHT")
	public String getHEIGHT() {
		return HEIGHT;
	}
	
	public void setHEIGHT(String HEIGHT) {
		this.HEIGHT = HEIGHT;
	}
	
	@JSONField(name = "HEIGHT_EXP")
	public String getHEIGHT_EXP() {
		return HEIGHT_EXP;
	}
	
	public void setHEIGHT_EXP(String HEIGHT_EXP) {
		this.HEIGHT_EXP = HEIGHT_EXP;
	}
	
	@JSONField(name = "WEIGHT")
	public String getWEIGHT() {
		return WEIGHT;
	}
	
	public void setWEIGHT(String WEIGHT) {
		this.WEIGHT = WEIGHT;
	}
	
	@JSONField(name = "WEIGHT_EXP")
	public String getWEIGHT_EXP() {
		return WEIGHT_EXP;
	}
	
	public void setWEIGHT_EXP(String WEIGHT_EXP) {
		this.WEIGHT_EXP = WEIGHT_EXP;
	}
	
	@JSONField(name = "BP_D")
	public String getBP_D() {
		return BP_D;
	}
	
	public void setBP_D(String BP_D) {
		this.BP_D = BP_D;
	}
	
	@JSONField(name = "BP_U")
	public String getBP_U() {
		return BP_U;
	}
	
	public void setBP_U(String BP_U) {
		this.BP_U = BP_U;
	}
	
	@JSONField(name = "BS_FPG")
	public String getBS_FPG() {
		return BS_FPG;
	}
	
	public void setBS_FPG(String BS_FPG) {
		this.BS_FPG = BS_FPG;
	}
	
	@JSONField(name = "NO_BS_FPG")
	public String getNO_BS_FPG() {
		return NO_BS_FPG;
	}
	
	public void setNO_BS_FPG(String NO_BS_FPG) {
		this.NO_BS_FPG = NO_BS_FPG;
	}
	
	@JSONField(name = "RANDOM_BLOOD_SUGAR")
	public String getRANDOM_BLOOD_SUGAR() {
		return RANDOM_BLOOD_SUGAR;
	}
	
	public void setRANDOM_BLOOD_SUGAR(String RANDOM_BLOOD_SUGAR) {
		this.RANDOM_BLOOD_SUGAR = RANDOM_BLOOD_SUGAR;
	}
	
	@JSONField(name = "BMI")
	public String getBMI() {
		return BMI;
	}
	
	public void setBMI(String BMI) {
		this.BMI = BMI;
	}
	
	@JSONField(name = "BMI_EXP")
	public String getBMI_EXP() {
		return BMI_EXP;
	}
	
	public void setBMI_EXP(String BMI_EXP) {
		this.BMI_EXP = BMI_EXP;
	}
	
	@JSONField(name = "OTHER_POSITIVE_SIGNS")
	public String getOTHER_POSITIVE_SIGNS() {
		return OTHER_POSITIVE_SIGNS;
	}
	
	public void setOTHER_POSITIVE_SIGNS(String OTHER_POSITIVE_SIGNS) {
		this.OTHER_POSITIVE_SIGNS = OTHER_POSITIVE_SIGNS;
	}
	
	@JSONField(name = "POFDA_MARK")
	public String getPOFDA_MARK() {
		return POFDA_MARK;
	}
	
	public void setPOFDA_MARK(String POFDA_MARK) {
		this.POFDA_MARK = POFDA_MARK;
	}
	
	@JSONField(name = "HEART_RATE")
	public String getHEART_RATE() {
		return HEART_RATE;
	}
	
	public void setHEART_RATE(String HEART_RATE) {
		this.HEART_RATE = HEART_RATE;
	}
	@JSONField(name = "BLOOD_SUGAR")
	public String getBLOOD_SUGAR() {
		return BLOOD_SUGAR;
	}
	public void setBLOOD_SUGAR(String BLOOD_SUGAR) {
		this.BLOOD_SUGAR = BLOOD_SUGAR;
	}
	@JSONField(name = "BLOOD_SUGAR_TYPE")
	public String getBLOOD_SUGAR_TYPE() {
		return BLOOD_SUGAR_TYPE;
	}
	public void setBLOOD_SUGAR_TYPE(String BLOOD_SUGAR_TYPE) {
		this.BLOOD_SUGAR_TYPE = BLOOD_SUGAR_TYPE;
	}
	@JSONField(name = "GHB")
	public String getGHB() {
		return GHB;
	}
	
	public void setGHB(String GHB) {
		this.GHB = GHB;
	}
	
	@JSONField(name = "RENAL_FUNCTION_CREATININE")
	public String getRENAL_FUNCTION_CREATININE() {
		return RENAL_FUNCTION_CREATININE;
	}
	
	public void setRENAL_FUNCTION_CREATININE(String RENAL_FUNCTION_CREATININE) {
		this.RENAL_FUNCTION_CREATININE = RENAL_FUNCTION_CREATININE;
	}
	
	@JSONField(name = "RENAL_FUNCTION_BUN")
	public String getRENAL_FUNCTION_BUN() {
		return RENAL_FUNCTION_BUN;
	}
	
	public void setRENAL_FUNCTION_BUN(String RENAL_FUNCTION_BUN) {
		this.RENAL_FUNCTION_BUN = RENAL_FUNCTION_BUN;
	}
	
	@JSONField(name = "MICROALBUMINURIA")
	public String getMICROALBUMINURIA() {
		return MICROALBUMINURIA;
	}
	
	public void setMICROALBUMINURIA(String MICROALBUMINURIA) {
		this.MICROALBUMINURIA = MICROALBUMINURIA;
	}
	
	@JSONField(name = "EXAM_DATE")
	public String getEXAM_DATE() {
		return EXAM_DATE;
	}
	
	public void setEXAM_DATE(String EXAM_DATE) {
		this.EXAM_DATE = EXAM_DATE;
	}
	
	@JSONField(name = "BLOOD_FAT_TRIGLYCERIDE")
	public String getBLOOD_FAT_TRIGLYCERIDE() {
		return BLOOD_FAT_TRIGLYCERIDE;
	}
	
	public void setBLOOD_FAT_TRIGLYCERIDE(String BLOOD_FAT_TRIGLYCERIDE) {
		this.BLOOD_FAT_TRIGLYCERIDE = BLOOD_FAT_TRIGLYCERIDE;
	}
	
	@JSONField(name = "BLOOD_FAT_TC")
	public String getBLOOD_FAT_TC() {
		return BLOOD_FAT_TC;
	}
	
	public void setBLOOD_FAT_TC(String BLOOD_FAT_TC) {
		this.BLOOD_FAT_TC = BLOOD_FAT_TC;
	}
	
	@JSONField(name = "BLOOD_FAT_LDLC")
	public String getBLOOD_FAT_LDLC() {
		return BLOOD_FAT_LDLC;
	}
	
	public void setBLOOD_FAT_LDLC(String BLOOD_FAT_LDLC) {
		this.BLOOD_FAT_LDLC = BLOOD_FAT_LDLC;
	}
	
	@JSONField(name = "DAILY_SMOKING")
	public String getDAILY_SMOKING() {
		return DAILY_SMOKING;
	}
	
	public void setDAILY_SMOKING(String DAILY_SMOKING) {
		this.DAILY_SMOKING = DAILY_SMOKING;
	}
	
	@JSONField(name = "SOMKING_EXP")
	public String getSOMKING_EXP() {
		return SOMKING_EXP;
	}
	
	public void setSOMKING_EXP(String SOMKING_EXP) {
		this.SOMKING_EXP = SOMKING_EXP;
	}
	
	@JSONField(name = "DAILY_DRINKING")
	public String getDAILY_DRINKING() {
		return DAILY_DRINKING;
	}
	
	public void setDAILY_DRINKING(String DAILY_DRINKING) {
		this.DAILY_DRINKING = DAILY_DRINKING;
	}
	
	@JSONField(name = "DRINK_EXP")
	public String getDRINK_EXP() {
		return DRINK_EXP;
	}
	
	public void setDRINK_EXP(String DRINK_EXP) {
		this.DRINK_EXP = DRINK_EXP;
	}
	
	@JSONField(name = "EXERCISE_FREQ_CODE")
	public String getEXERCISE_FREQ_CODE() {
		return EXERCISE_FREQ_CODE;
	}
	
	public void setEXERCISE_FREQ_CODE(String EXERCISE_FREQ_CODE) {
		this.EXERCISE_FREQ_CODE = EXERCISE_FREQ_CODE;
	}
	
	@JSONField(name = "EXERCISE_FREQ_CODE_EXP")
	public String getEXERCISE_FREQ_CODE_EXP() {
		return EXERCISE_FREQ_CODE_EXP;
	}
	
	public void setEXERCISE_FREQ_CODE_EXP(String EXERCISE_FREQ_CODE_EXP) {
		this.EXERCISE_FREQ_CODE_EXP = EXERCISE_FREQ_CODE_EXP;
	}
	
	@JSONField(name = "EXERCISE_DURATION_MINS")
	public String getEXERCISE_DURATION_MINS() {
		return EXERCISE_DURATION_MINS;
	}
	
	public void setEXERCISE_DURATION_MINS(String EXERCISE_DURATION_MINS) {
		this.EXERCISE_DURATION_MINS = EXERCISE_DURATION_MINS;
	}
	
	@JSONField(name = "EXERCISE_DURATION_MINS_EXP")
	public String getEXERCISE_DURATION_MINS_EXP() {
		return EXERCISE_DURATION_MINS_EXP;
	}
	
	public void setEXERCISE_DURATION_MINS_EXP(String EXERCISE_DURATION_MINS_EXP) {
		this.EXERCISE_DURATION_MINS_EXP = EXERCISE_DURATION_MINS_EXP;
	}
	
	@JSONField(name = "SALT_TAKEN_LEVEL_CODE")
	public String getSALT_TAKEN_LEVEL_CODE() {
		return SALT_TAKEN_LEVEL_CODE;
	}
	
	public void setSALT_TAKEN_LEVEL_CODE(String SALT_TAKEN_LEVEL_CODE) {
		this.SALT_TAKEN_LEVEL_CODE = SALT_TAKEN_LEVEL_CODE;
	}
	
	@JSONField(name = "SALT_TAKEN_LEVEL_EXP")
	public String getSALT_TAKEN_LEVEL_EXP() {
		return SALT_TAKEN_LEVEL_EXP;
	}
	
	public void setSALT_TAKEN_LEVEL_EXP(String SALT_TAKEN_LEVEL_EXP) {
		this.SALT_TAKEN_LEVEL_EXP = SALT_TAKEN_LEVEL_EXP;
	}
	
	@JSONField(name = "PSY_ADJUST_RESULT_CODE")
	public String getPSY_ADJUST_RESULT_CODE() {
		return PSY_ADJUST_RESULT_CODE;
	}
	
	public void setPSY_ADJUST_RESULT_CODE(String PSY_ADJUST_RESULT_CODE) {
		this.PSY_ADJUST_RESULT_CODE = PSY_ADJUST_RESULT_CODE;
	}
	
	@JSONField(name = "COMPLIANCE_RESULT_CODE")
	public String getCOMPLIANCE_RESULT_CODE() {
		return COMPLIANCE_RESULT_CODE;
	}
	
	public void setCOMPLIANCE_RESULT_CODE(String COMPLIANCE_RESULT_CODE) {
		this.COMPLIANCE_RESULT_CODE = COMPLIANCE_RESULT_CODE;
	}
	
	@JSONField(name = "DAILY_STAPLE")
	public String getDAILY_STAPLE() {
		return DAILY_STAPLE;
	}
	
	public void setDAILY_STAPLE(String DAILY_STAPLE) {
		this.DAILY_STAPLE = DAILY_STAPLE;
	}
	
	@JSONField(name = "HYP_FOLLOWUP_TYPE_CODE")
	public String getHYP_FOLLOWUP_TYPE_CODE() {
		return HYP_FOLLOWUP_TYPE_CODE;
	}
	
	public void setHYP_FOLLOWUP_TYPE_CODE(String HYP_FOLLOWUP_TYPE_CODE) {
		this.HYP_FOLLOWUP_TYPE_CODE = HYP_FOLLOWUP_TYPE_CODE;
	}
	
	@JSONField(name = "HYP_COMPLICATION_DETAIL")
	public String getHYP_COMPLICATION_DETAIL() {
		return HYP_COMPLICATION_DETAIL;
	}
	
	public void setHYP_COMPLICATION_DETAIL(String HYP_COMPLICATION_DETAIL) {
		this.HYP_COMPLICATION_DETAIL = HYP_COMPLICATION_DETAIL;
	}
	
	@JSONField(name = "DIA_FOLLOWUP_TYPE_CODE")
	public String getDIA_FOLLOWUP_TYPE_CODE() {
		return DIA_FOLLOWUP_TYPE_CODE;
	}
	
	public void setDIA_FOLLOWUP_TYPE_CODE(String DIA_FOLLOWUP_TYPE_CODE) {
		this.DIA_FOLLOWUP_TYPE_CODE = DIA_FOLLOWUP_TYPE_CODE;
	}
	
	@JSONField(name = "DIA_COMPLICATION_DETAIL")
	public String getDIA_COMPLICATION_DETAIL() {
		return DIA_COMPLICATION_DETAIL;
	}
	
	public void setDIA_COMPLICATION_DETAIL(String DIA_COMPLICATION_DETAIL) {
		this.DIA_COMPLICATION_DETAIL = DIA_COMPLICATION_DETAIL;
	}
	
	@JSONField(name = "DRUG_COMPLIANCE_CODE")
	public String getDRUG_COMPLIANCE_CODE() {
		return DRUG_COMPLIANCE_CODE;
	}
	
	public void setDRUG_COMPLIANCE_CODE(String DRUG_COMPLIANCE_CODE) {
		this.DRUG_COMPLIANCE_CODE = DRUG_COMPLIANCE_CODE;
	}
	
	@JSONField(name = "CONTROL_DATE")
	public String getCONTROL_DATE() {
		return CONTROL_DATE;
	}
	
	public void setCONTROL_DATE(String CONTROL_DATE) {
		this.CONTROL_DATE = CONTROL_DATE;
	}
	
	@JSONField(name = "CONTROL_CONSTITUTOR")
	public String getCONTROL_CONSTITUTOR() {
		return CONTROL_CONSTITUTOR;
	}
	
	public void setCONTROL_CONSTITUTOR(String CONTROL_CONSTITUTOR) {
		this.CONTROL_CONSTITUTOR = CONTROL_CONSTITUTOR;
	}
	
	@JSONField(name = "CONTROL_CONSTITUTOR_DOCTORCODE")
	public String getCONTROL_CONSTITUTOR_DOCTORCODE() {
		return CONTROL_CONSTITUTOR_DOCTORCODE;
	}
	
	public void setCONTROL_CONSTITUTOR_DOCTORCODE(String CONTROL_CONSTITUTOR_DOCTORCODE) {
		this.CONTROL_CONSTITUTOR_DOCTORCODE = CONTROL_CONSTITUTOR_DOCTORCODE;
	}
	
	@JSONField(name = "CONTROL_CONSTITUTOR_JWDOCTORCODE")
	public String getCONTROL_CONSTITUTOR_JWDOCTORCODE() {
		return CONTROL_CONSTITUTOR_JWDOCTORCODE;
	}
	
	public void setCONTROL_CONSTITUTOR_JWDOCTORCODE(String CONTROL_CONSTITUTOR_JWDOCTORCODE) {
		this.CONTROL_CONSTITUTOR_JWDOCTORCODE = CONTROL_CONSTITUTOR_JWDOCTORCODE;
	}
	
	@JSONField(name = "CONTROL_BP_U")
	public String getCONTROL_BP_U() {
		return CONTROL_BP_U;
	}
	
	public void setCONTROL_BP_U(String CONTROL_BP_U) {
		this.CONTROL_BP_U = CONTROL_BP_U;
	}
	
	@JSONField(name = "CONTROL_BP_D")
	public String getCONTROL_BP_D() {
		return CONTROL_BP_D;
	}
	
	public void setCONTROL_BP_D(String CONTROL_BP_D) {
		this.CONTROL_BP_D = CONTROL_BP_D;
	}
	
	@JSONField(name = "CONTROL_BS_FPG")
	public String getCONTROL_BS_FPG() {
		return CONTROL_BS_FPG;
	}
	
	public void setCONTROL_BS_FPG(String CONTROL_BS_FPG) {
		this.CONTROL_BS_FPG = CONTROL_BS_FPG;
	}
	
	@JSONField(name = "CONTROL_NO_BS_FPG")
	public String getCONTROL_NO_BS_FPG() {
		return CONTROL_NO_BS_FPG;
	}
	
	public void setCONTROL_NO_BS_FPG(String CONTROL_NO_BS_FPG) {
		this.CONTROL_NO_BS_FPG = CONTROL_NO_BS_FPG;
	}
	
	@JSONField(name = "CONTROL_GHB")
	public String getCONTROL_GHB() {
		return CONTROL_GHB;
	}
	
	public void setCONTROL_GHB(String CONTROL_GHB) {
		this.CONTROL_GHB = CONTROL_GHB;
	}
	
	@JSONField(name = "CONTROL_TRIGLYCERIDE")
	public String getCONTROL_TRIGLYCERIDE() {
		return CONTROL_TRIGLYCERIDE;
	}
	
	public void setCONTROL_TRIGLYCERIDE(String CONTROL_TRIGLYCERIDE) {
		this.CONTROL_TRIGLYCERIDE = CONTROL_TRIGLYCERIDE;
	}
	
	@JSONField(name = "CONTROL_TOTAL_CHOLESTEROL")
	public String getCONTROL_TOTAL_CHOLESTEROL() {
		return CONTROL_TOTAL_CHOLESTEROL;
	}
	
	public void setCONTROL_TOTAL_CHOLESTEROL(String CONTROL_TOTAL_CHOLESTEROL) {
		this.CONTROL_TOTAL_CHOLESTEROL = CONTROL_TOTAL_CHOLESTEROL;
	}
	
	@JSONField(name = "CONTROL_LDL")
	public String getCONTROL_LDL() {
		return CONTROL_LDL;
	}
	
	public void setCONTROL_LDL(String CONTROL_LDL) {
		this.CONTROL_LDL = CONTROL_LDL;
	}
	
	@JSONField(name = "CONTROL_WEIGHT")
	public String getCONTROL_WEIGHT() {
		return CONTROL_WEIGHT;
	}
	
	public void setCONTROL_WEIGHT(String CONTROL_WEIGHT) {
		this.CONTROL_WEIGHT = CONTROL_WEIGHT;
	}
	
	@JSONField(name = "CONTROL_EXERCISE_FREQ_CODE")
	public String getCONTROL_EXERCISE_FREQ_CODE() {
		return CONTROL_EXERCISE_FREQ_CODE;
	}
	
	public void setCONTROL_EXERCISE_FREQ_CODE(String CONTROL_EXERCISE_FREQ_CODE) {
		this.CONTROL_EXERCISE_FREQ_CODE = CONTROL_EXERCISE_FREQ_CODE;
	}
	
	@JSONField(name = "CONTROL_EXERCISE_DURATION_MINS")
	public String getCONTROL_EXERCISE_DURATION_MINS() {
		return CONTROL_EXERCISE_DURATION_MINS;
	}
	
	public void setCONTROL_EXERCISE_DURATION_MINS(String CONTROL_EXERCISE_DURATION_MINS) {
		this.CONTROL_EXERCISE_DURATION_MINS = CONTROL_EXERCISE_DURATION_MINS;
	}
	
	@JSONField(name = "ARCHIVE_TIME")
	public String getARCHIVE_TIME() {
		return ARCHIVE_TIME;
	}
	
	public void setARCHIVE_TIME(String ARCHIVE_TIME) {
		this.ARCHIVE_TIME = ARCHIVE_TIME;
	}
	
	@JSONField(name = "ARCHIVE_OPERATOR_NAME")
	public String getARCHIVE_OPERATOR_NAME() {
		return ARCHIVE_OPERATOR_NAME;
	}
	
	public void setARCHIVE_OPERATOR_NAME(String ARCHIVE_OPERATOR_NAME) {
		this.ARCHIVE_OPERATOR_NAME = ARCHIVE_OPERATOR_NAME;
	}
	
	@JSONField(name = "HEALTH_EDUCATE")
	public String getHEALTH_EDUCATE() {
		return HEALTH_EDUCATE;
	}
	
	public void setHEALTH_EDUCATE(String HEALTH_EDUCATE) {
		this.HEALTH_EDUCATE = HEALTH_EDUCATE;
	}
	
	@JSONField(name = "EDUCATE_CONTENT")
	public String getEDUCATE_CONTENT() {
		return EDUCATE_CONTENT;
	}
	
	public void setEDUCATE_CONTENT(String EDUCATE_CONTENT) {
		this.EDUCATE_CONTENT = EDUCATE_CONTENT;
	}
	
	@JSONField(name = "DRUG_ADVERSE_MARK")
	public String getDRUG_ADVERSE_MARK() {
		return DRUG_ADVERSE_MARK;
	}
	
	public void setDRUG_ADVERSE_MARK(String DRUG_ADVERSE_MARK) {
		this.DRUG_ADVERSE_MARK = DRUG_ADVERSE_MARK;
	}
	
	@JSONField(name = "ADR_REMARK")
	public String getADR_REMARK() {
		return ADR_REMARK;
	}
	
	public void setADR_REMARK(String ADR_REMARK) {
		this.ADR_REMARK = ADR_REMARK;
	}
	
	@JSONField(name = "TRANSFER_RESON")
	public String getTRANSFER_RESON() {
		return TRANSFER_RESON;
	}
	
	public void setTRANSFER_RESON(String TRANSFER_RESON) {
		this.TRANSFER_RESON = TRANSFER_RESON;
	}
	
	@JSONField(name = "TRANSFER_ORG_DEPT")
	public String getTRANSFER_ORG_DEPT() {
		return TRANSFER_ORG_DEPT;
	}
	
	public void setTRANSFER_ORG_DEPT(String TRANSFER_ORG_DEPT) {
		this.TRANSFER_ORG_DEPT = TRANSFER_ORG_DEPT;
	}
	
	@JSONField(name = "REFUSE_REFERRAL")
	public String getREFUSE_REFERRAL() {
		return REFUSE_REFERRAL;
	}
	
	public void setREFUSE_REFERRAL(String REFUSE_REFERRAL) {
		this.REFUSE_REFERRAL = REFUSE_REFERRAL;
	}
	
	@JSONField(name = "REFUSE_REFERRAL_WHY")
	public String getREFUSE_REFERRAL_WHY() {
		return REFUSE_REFERRAL_WHY;
	}
	
	public void setREFUSE_REFERRAL_WHY(String REFUSE_REFERRAL_WHY) {
		this.REFUSE_REFERRAL_WHY = REFUSE_REFERRAL_WHY;
	}
	
	@JSONField(name = "ARCHIVE_ID")
	public String getARCHIVE_ID() {
		return ARCHIVE_ID;
	}
	
	public void setARCHIVE_ID(String ARCHIVE_ID) {
		this.ARCHIVE_ID = ARCHIVE_ID;
	}
	
	@JSONField(name = "CHECK_FEE_TYPE")
	public String getCHECK_FEE_TYPE() {
		return CHECK_FEE_TYPE;
	}
	
	public void setCHECK_FEE_TYPE(String CHECK_FEE_TYPE) {
		this.CHECK_FEE_TYPE = CHECK_FEE_TYPE;
	}
	
	@JSONField(name = "FAMILY_FOLLOWUP_ID")
	public String getFAMILY_FOLLOWUP_ID() {
		return FAMILY_FOLLOWUP_ID;
	}
	
	public void setFAMILY_FOLLOWUP_ID(String FAMILY_FOLLOWUP_ID) {
		this.FAMILY_FOLLOWUP_ID = FAMILY_FOLLOWUP_ID;
	}
}

+ 125 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/AssistantMsgPushLog.java

@ -0,0 +1,125 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * Created by 刘文彬 on 2018/8/7.
 * 推送医生助手的日志
 */
public class AssistantMsgPushLog {
    @JestId
    private String id;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date createTime;  // 创建时间
    private Integer pushPlatform; //推送的平台 1、微信平台,2、平台消息
    private String accessToken;//微信AccessToken(微信平台)
    private String type;//消息类型
    private String openid;//微信的openid
    private String url;//微信跳转url
    private String data;//数据(微信平台、平台消息)
    private String receiver;//接受人(平台消息)
    private String title;// 标题(平台消息)
    private String msg;//消息(平台消息)
    private Integer success;//是否推送成功(1、成功,-1、失败)
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getPushPlatform() {
        return pushPlatform;
    }
    public void setPushPlatform(Integer pushPlatform) {
        this.pushPlatform = pushPlatform;
    }
    public String getAccessToken() {
        return accessToken;
    }
    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getData() {
        return data;
    }
    public void setData(String data) {
        this.data = data;
    }
    public String getReceiver() {
        return receiver;
    }
    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }
    public Integer getSuccess() {
        return success;
    }
    public void setSuccess(Integer success) {
        this.success = success;
    }
}

+ 213 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/BirthDayWishesNotPushES.java

@ -0,0 +1,213 @@
package com.yihu.rehabilitation.vo.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import java.util.Date;
/**
 * 生日祝福为推送表
 * Created by humingfen on 2019/03/11.
 */
public class BirthDayWishesNotPushES {
    @JestId
    private String id;
    private String patientCode; // 患者标识(ES)
    private String patientName; // 患者名称(ES)
    private String openid;       //患者openid
    private String idcard;       //患者身份证
    private String doctorCode;  //全科code(doctor表中的code)(ES:必填)
    private String doctorName;  //全科名称(doctor表中的name)(ES:必填)
    private String doctorHealth;  //健管师code(doctor表中的code)(ES:必填)
    private String doctorHealthName;  //健管师code(doctor表中的code)(ES:必填)
    private Long adminTeamCode;// 行政团队(ES)
    private String adminTeamName;// 行政团队(ES)
    private String hospital; // 所属机构(ES)
    private String hospitalName; // 所属机构(ES)
    private String town; // 所属区划(ES)
    private String townName; // 所属区划(ES)
    private String city;// 所属市区
    private String cityName;//市名称
    private String province;//所属省
    private String provinceName;//省名称
    //生日祝福
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM-dd")
    @JSONField(format = "MM-dd")
    private String birthday;  // 居民生日(ES:必填)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date createTime;  // 创建时间(ES:必填)
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getPatientCode() {
        return patientCode;
    }
    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getDoctorHealth() {
        return doctorHealth;
    }
    public void setDoctorHealth(String doctorHealth) {
        this.doctorHealth = doctorHealth;
    }
    public String getDoctorHealthName() {
        return doctorHealthName;
    }
    public void setDoctorHealthName(String doctorHealthName) {
        this.doctorHealthName = doctorHealthName;
    }
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    public String getAdminTeamName() {
        return adminTeamName;
    }
    public void setAdminTeamName(String adminTeamName) {
        this.adminTeamName = adminTeamName;
    }
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    public String getTown() {
        return town;
    }
    public void setTown(String town) {
        this.town = town;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
    public String getBirthday() {
        return birthday;
    }
    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    public String getProvince() {
        return province;
    }
    public void setProvince(String province) {
        this.province = province;
    }
    public String getCityName() {
        return cityName;
    }
    public void setCityName(String cityName) {
        this.cityName = cityName;
    }
    public String getProvinceName() {
        return provinceName;
    }
    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }
}

+ 266 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/BirthDayWishesToPatientES.java

@ -0,0 +1,266 @@
package com.yihu.rehabilitation.vo.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.Transient;
import java.util.Date;
import java.util.Set;
/**
 * 生日祝福推送记录表
 * Created by humingfen on 2018/10/24.
 */
public class BirthDayWishesToPatientES {
    @JestId
    private String id;
    //说明:如医生推送生日祝福给5个居民,则保存5条userType=1的记录和1条userType=2的记录(共6条)batchNo批次号一样。
    private String batchNo;//批次号记录发送所属批次(ES:必填)
    private String patientCode; // 患者标识(ES)(根据userType的值,userType=1,必填;userType=2,为空)
    private String patientName; // 患者名称(ES)(根据userType的值,userType=1,必填;userType=2,为空)
    private String doctorCode;  //发送人code(doctor表中的code)(ES:必填)
    private String doctorName;  //发送人名称(doctor表中的name)(ES:必填)
    private Integer userType; // 1、患者,2医生(ES:必填)
    //备注:从发送人的信息中获取(doctor表获取)
    private String sendPic;   // 发送人头像(ES)
    private String sendSex;   // 发送人性别(ES)
    private Long adminTeamCode;// 行政团队(ES)
    private String adminTeamName;// 行政团队(ES)
    private String hospital; // 所属机构(ES)
    private String hospitalName; // 所属机构(ES)
    private String town; // 所属区划(ES)
    private String townName; // 所属区划(ES)
    private Integer sendType;//发送类型 1医生发送 2(管理员)卫纪委发送(ES:必填)
    private Integer sendLevel;   // 发送人级别  1专科医生,2全科医生,3健康管理师 4 管理员(ES)
    //说明:如普通医生推送则保存doctor表中的hospital字段,如管理员推送则保存当前角色的code(取wlyy_user_role表中的role字段)
    private String currentUserRoleCode;//发送者当前登录的角色code(ES:必填)
    private String currentUserRoleLevel;//发送者当前登录的角色级别,1、省,2、市,3、区,4、机构(ES:必填)
    private Integer sendSource; //1或者为空 i健康后台推送  2PC端推送(默认旧数据为1)(为后续平台推送统计做备用字段)
    private Integer allCount;//所有的推送数目(ES:必填)
    @Transient
    private Set<String> openidSet;//本次发送生日祝福的openid的总集合
    //生日祝福
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM-dd")
    @JSONField(format = "MM-dd")
    private String birthday;  // 居民生日(ES:必填)
    private Long templateId; //生日模板id
    private String content; //生日祝福内容 (ES:必填)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date createTime;  // 创建时间(ES:必填)
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getBatchNo() {
        return batchNo;
    }
    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }
    public String getPatientCode() {
        return patientCode;
    }
    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public Integer getUserType() {
        return userType;
    }
    public void setUserType(Integer userType) {
        this.userType = userType;
    }
    public String getSendPic() {
        return sendPic;
    }
    public void setSendPic(String sendPic) {
        this.sendPic = sendPic;
    }
    public String getSendSex() {
        return sendSex;
    }
    public void setSendSex(String sendSex) {
        this.sendSex = sendSex;
    }
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    public String getAdminTeamName() {
        return adminTeamName;
    }
    public void setAdminTeamName(String adminTeamName) {
        this.adminTeamName = adminTeamName;
    }
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    public String getTown() {
        return town;
    }
    public void setTown(String town) {
        this.town = town;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
    public String getCurrentUserRoleCode() {
        return currentUserRoleCode;
    }
    public void setCurrentUserRoleCode(String currentUserRoleCode) {
        this.currentUserRoleCode = currentUserRoleCode;
    }
    public String getCurrentUserRoleLevel() {
        return currentUserRoleLevel;
    }
    public void setCurrentUserRoleLevel(String currentUserRoleLevel) {
        this.currentUserRoleLevel = currentUserRoleLevel;
    }
    public Integer getSendSource() {
        return sendSource;
    }
    public void setSendSource(Integer sendSource) {
        this.sendSource = sendSource;
    }
    public Integer getAllCount() {
        return allCount;
    }
    public void setAllCount(Integer allCount) {
        this.allCount = allCount;
    }
    public String getBirthday() {
        return birthday;
    }
    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getSendType() {
        return sendType;
    }
    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }
    public Integer getSendLevel() {
        return sendLevel;
    }
    public void setSendLevel(Integer sendLevel) {
        this.sendLevel = sendLevel;
    }
    public Set<String> getOpenidSet() {
        return openidSet;
    }
    public void setOpenidSet(Set<String> openidSet) {
        this.openidSet = openidSet;
    }
    public Long getTemplateId() {
        return templateId;
    }
    public void setTemplateId(Long templateId) {
        this.templateId = templateId;
    }
}

+ 420 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/COPDDailyFollowupES.java

@ -0,0 +1,420 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 慢性阻塞性肺病日常随访
 * @author hmf
 * @date 2020/3/18
 */
public class COPDDailyFollowupES {
    @JestId
    private String id;
    private String followup_id;             //随访记录ID
    private String followup_project;        //随访详情分类ID
    private String version;//版本号
    private String problemId;//健康问题id(肺癌1001 慢性胃肠病1002 冠心病1003 慢性前列腺疾病1004 慢性乳腺疾病1005  慢性阻塞性肺病1006 脂肪肝1007 慢性妇科炎症1008 脑卒中1009 慢性肾病1010)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date createTime;//创建时间
    private String createOperator;//创建人
    private String createOperatorName;//创建人
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date modifyTime;//修改时间
    private String modifyOperator;//修改人
    private String modifyOperatorName;//修改人
    private String validFlag;//有效标志
    private String remark;//备注
    private String symptomNo;//症状_无
    private String symptomCough;//症状_咳嗽
    private String symptomExpectoration;//症状_咳痰
    private String symptomHemoptysis;//症状_咯血
    private String symptomAnhelationAcAf;//症状_气促_活动后
    private String symptomAnhelationCalm;//症状_气促_平静时
    private String symptomChestAcAf;//症状_胸闷_活动后
    private String symptomChestCalm;//症状_胸闷_平静时
    private String symptomChestPainAcAf;//症状_胸痛_活动后
    private String symptomChestPainCalm;//症状_胸痛_平静时
    private String symptomFeverLess;//症状_发热<=38摄氏度
    private String symptomFeverGreater;//症状_发热>=39摄氏度
    private String symptomDrowsiness;//症状_发热>=嗜睡
    private String symptomOther;//症状_其它
    private String symptomAcuteNum;//急性加重次数评估
    private String sickSign;//体征_体征
    //个人基本信息
    private String pulseRate;//脉率
    private String heartRate;//心率
    private String bloodPressureU;//血压(收缩压)
    private String bloodPressureD;//血压(舒张压)
    private String bloodPressureStatus;//血压状态
    private String height;//身高
    private String weight;//体重
    private String spo;//末梢血氧饱和度(spo2)
    private String lung;//慢阻肺
    private String lungType;//慢阻肺类型
    private String pdm;//fev1/fvc参考结论
    private String fev;//fev1占预计的百分比
    private String fvc;//fvc占预计的百分比
    private String historySmokingStatus;//个人信息及病史_吸烟现状
    private String sports;//运动
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getFollowup_id() {
        return followup_id;
    }
    public void setFollowup_id(String followup_id) {
        this.followup_id = followup_id;
    }
    public String getFollowup_project() {
        return followup_project;
    }
    public void setFollowup_project(String followup_project) {
        this.followup_project = followup_project;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    public String getProblemId() {
        return problemId;
    }
    public void setProblemId(String problemId) {
        this.problemId = problemId;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getCreateOperator() {
        return createOperator;
    }
    public void setCreateOperator(String createOperator) {
        this.createOperator = createOperator;
    }
    public String getCreateOperatorName() {
        return createOperatorName;
    }
    public void setCreateOperatorName(String createOperatorName) {
        this.createOperatorName = createOperatorName;
    }
    public Date getModifyTime() {
        return modifyTime;
    }
    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
    public String getModifyOperator() {
        return modifyOperator;
    }
    public void setModifyOperator(String modifyOperator) {
        this.modifyOperator = modifyOperator;
    }
    public String getModifyOperatorName() {
        return modifyOperatorName;
    }
    public void setModifyOperatorName(String modifyOperatorName) {
        this.modifyOperatorName = modifyOperatorName;
    }
    public String getValidFlag() {
        return validFlag;
    }
    public void setValidFlag(String validFlag) {
        this.validFlag = validFlag;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getSymptomNo() {
        return symptomNo;
    }
    public void setSymptomNo(String symptomNo) {
        this.symptomNo = symptomNo;
    }
    public String getSymptomCough() {
        return symptomCough;
    }
    public void setSymptomCough(String symptomCough) {
        this.symptomCough = symptomCough;
    }
    public String getSymptomExpectoration() {
        return symptomExpectoration;
    }
    public void setSymptomExpectoration(String symptomExpectoration) {
        this.symptomExpectoration = symptomExpectoration;
    }
    public String getSymptomHemoptysis() {
        return symptomHemoptysis;
    }
    public void setSymptomHemoptysis(String symptomHemoptysis) {
        this.symptomHemoptysis = symptomHemoptysis;
    }
    public String getSymptomAnhelationAcAf() {
        return symptomAnhelationAcAf;
    }
    public void setSymptomAnhelationAcAf(String symptomAnhelationAcAf) {
        this.symptomAnhelationAcAf = symptomAnhelationAcAf;
    }
    public String getSymptomAnhelationCalm() {
        return symptomAnhelationCalm;
    }
    public void setSymptomAnhelationCalm(String symptomAnhelationCalm) {
        this.symptomAnhelationCalm = symptomAnhelationCalm;
    }
    public String getSymptomChestAcAf() {
        return symptomChestAcAf;
    }
    public void setSymptomChestAcAf(String symptomChestAcAf) {
        this.symptomChestAcAf = symptomChestAcAf;
    }
    public String getSymptomChestCalm() {
        return symptomChestCalm;
    }
    public void setSymptomChestCalm(String symptomChestCalm) {
        this.symptomChestCalm = symptomChestCalm;
    }
    public String getSymptomChestPainAcAf() {
        return symptomChestPainAcAf;
    }
    public void setSymptomChestPainAcAf(String symptomChestPainAcAf) {
        this.symptomChestPainAcAf = symptomChestPainAcAf;
    }
    public String getSymptomChestPainCalm() {
        return symptomChestPainCalm;
    }
    public void setSymptomChestPainCalm(String symptomChestPainCalm) {
        this.symptomChestPainCalm = symptomChestPainCalm;
    }
    public String getSymptomFeverLess() {
        return symptomFeverLess;
    }
    public void setSymptomFeverLess(String symptomFeverLess) {
        this.symptomFeverLess = symptomFeverLess;
    }
    public String getSymptomFeverGreater() {
        return symptomFeverGreater;
    }
    public void setSymptomFeverGreater(String symptomFeverGreater) {
        this.symptomFeverGreater = symptomFeverGreater;
    }
    public String getSymptomDrowsiness() {
        return symptomDrowsiness;
    }
    public void setSymptomDrowsiness(String symptomDrowsiness) {
        this.symptomDrowsiness = symptomDrowsiness;
    }
    public String getSymptomOther() {
        return symptomOther;
    }
    public void setSymptomOther(String symptomOther) {
        this.symptomOther = symptomOther;
    }
    public String getSymptomAcuteNum() {
        return symptomAcuteNum;
    }
    public void setSymptomAcuteNum(String symptomAcuteNum) {
        this.symptomAcuteNum = symptomAcuteNum;
    }
    public String getSickSign() {
        return sickSign;
    }
    public void setSickSign(String sickSign) {
        this.sickSign = sickSign;
    }
    public String getPulseRate() {
        return pulseRate;
    }
    public void setPulseRate(String pulseRate) {
        this.pulseRate = pulseRate;
    }
    public String getHeartRate() {
        return heartRate;
    }
    public void setHeartRate(String heartRate) {
        this.heartRate = heartRate;
    }
    public String getBloodPressureU() {
        return bloodPressureU;
    }
    public void setBloodPressureU(String bloodPressureU) {
        this.bloodPressureU = bloodPressureU;
    }
    public String getBloodPressureD() {
        return bloodPressureD;
    }
    public void setBloodPressureD(String bloodPressureD) {
        this.bloodPressureD = bloodPressureD;
    }
    public String getBloodPressureStatus() {
        return bloodPressureStatus;
    }
    public void setBloodPressureStatus(String bloodPressureStatus) {
        this.bloodPressureStatus = bloodPressureStatus;
    }
    public String getHeight() {
        return height;
    }
    public void setHeight(String height) {
        this.height = height;
    }
    public String getWeight() {
        return weight;
    }
    public void setWeight(String weight) {
        this.weight = weight;
    }
    public String getSpo() {
        return spo;
    }
    public void setSpo(String spo) {
        this.spo = spo;
    }
    public String getLung() {
        return lung;
    }
    public void setLung(String lung) {
        this.lung = lung;
    }
    public String getLungType() {
        return lungType;
    }
    public void setLungType(String lungType) {
        this.lungType = lungType;
    }
    public String getPdm() {
        return pdm;
    }
    public void setPdm(String pdm) {
        this.pdm = pdm;
    }
    public String getFev() {
        return fev;
    }
    public void setFev(String fev) {
        this.fev = fev;
    }
    public String getFvc() {
        return fvc;
    }
    public void setFvc(String fvc) {
        this.fvc = fvc;
    }
    public String getHistorySmokingStatus() {
        return historySmokingStatus;
    }
    public void setHistorySmokingStatus(String historySmokingStatus) {
        this.historySmokingStatus = historySmokingStatus;
    }
    public String getSports() {
        return sports;
    }
    public void setSports(String sports) {
        this.sports = sports;
    }
}

+ 585 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/COPDFirstTimeQuestionnaireES.java

@ -0,0 +1,585 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 慢性阻塞性肺病--首次问卷
 * @author hmf
 * @date 2020/3/17
 */
public class COPDFirstTimeQuestionnaireES {
    @JestId
    private String id;
    private String followup_id;             //随访记录ID
    private String followup_project;        //随访详情分类ID
    private String version;//版本号
    private String problemId;//健康问题id(肺癌1001 慢性胃肠病1002 冠心病1003 慢性前列腺疾病1004 慢性乳腺疾病1005  慢性阻塞性肺病1006 脂肪肝1007 慢性妇科炎症1008 脑卒中1009 慢性肾病1010)
    private String symptomNo;//症状_无
    private String symptomCough;//症状_咳嗽
    private String symptomExpectoration;//症状_咳痰
    private String symptomHemoptysis;//症状_咯血
    private String symptomAnhelationAcAf;//症状_气促_活动后
    private String symptomAnhelationCalm;//症状_气促_平静时
    private String symptomChestAcAf;//症状_胸闷_活动后
    private String symptomChestCalm;//症状_胸闷_平静时
    private String symptomChestPainAcAf;//症状_胸痛_活动后
    private String symptomChestPainCalm;//症状_胸痛_平静时
    private String symptomFeverLess;//症状_发热<=38摄氏度
    private String symptomFeverGreater;//症状_发热>=39摄氏度
    private String symptomDrowsiness;//症状_发热>=嗜睡
    private String symptomOther;//症状_其它
    private String symptomAcuteNum;//急性加重次数评估
    //个人信息及病史
    private String historyEducation;//个人信息及病史_受教育水平
    private String historyOccupaExposure;//个人信息及病史_有无职业暴露史
    private String historyIndoorPollution;//个人信息及病史_室内环境空气污染
    private String historyWorkPollution;//个人信息及病史_工作环境污染暴露
    private String historySmokingStatus;//个人信息及病史_吸烟现状
    private String historyTherioma;//个人信息及病史_家族性存在恶性肿瘤病史
    private String historyHeredopathia;//个人信息及病史_家族性存在遗传病史
    private String historyChronicAirway;//个人信息及病史_家族性慢性气道病史
    private String sickSign;//体征_体征
    //个人基本信息
    private String pulseRate;//脉率
    private String heartRate;//心率
    private String bloodPressureU;//血压(收缩压)
    private String bloodPressureD;//血压(舒张压)
    private String bloodPressureStatus;//血压状态
    private String height;//身高
    private String weight;//体重
    private String spo;//末梢血氧饱和度(spo2)
    private String dr;//dr胸片(半年一次)
    private String lung;//慢阻肺
    private String lungType;//慢阻肺类型
    private String pdm;//fev1/fvc参考结论
    private String fev;//fev1占预计的百分比
    private String fvc;//fvc占预计的百分比
    //生活方式
    private String dailySmokingQuantity;//日吸烟量
    private String dailySmokingStartYear;//吸烟初始年龄
    private String dailySmokingYearNum;//吸烟年数
    private String dailySmokingIndex;//吸烟指数
    private String everyAlcoholTolerance;//日饮酒量
    private String sports;//运动
    private String oralHormone;//口服激素
    private String complianceBehavior;//遵医行为
    private String drugCompliance;//服药依从性
    private String drugAdverseReaction;//药物不良反应
    private String medicationSituation;//用药情况
    private String validFlag;//有效标志
    private String remark;//备注
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date createTime;//创建时间
    private String createOperator;//创建人
    private String createOperatorName;//创建人
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date modifyTime;//修改时间
    private String modifyOperator;//修改人
    private String modifyOperatorName;//修改人
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getFollowup_id() {
        return followup_id;
    }
    public void setFollowup_id(String followup_id) {
        this.followup_id = followup_id;
    }
    public String getFollowup_project() {
        return followup_project;
    }
    public void setFollowup_project(String followup_project) {
        this.followup_project = followup_project;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    public String getProblemId() {
        return problemId;
    }
    public void setProblemId(String problemId) {
        this.problemId = problemId;
    }
    public String getSymptomNo() {
        return symptomNo;
    }
    public void setSymptomNo(String symptomNo) {
        this.symptomNo = symptomNo;
    }
    public String getSymptomCough() {
        return symptomCough;
    }
    public void setSymptomCough(String symptomCough) {
        this.symptomCough = symptomCough;
    }
    public String getSymptomExpectoration() {
        return symptomExpectoration;
    }
    public void setSymptomExpectoration(String symptomExpectoration) {
        this.symptomExpectoration = symptomExpectoration;
    }
    public String getSymptomHemoptysis() {
        return symptomHemoptysis;
    }
    public void setSymptomHemoptysis(String symptomHemoptysis) {
        this.symptomHemoptysis = symptomHemoptysis;
    }
    public String getSymptomAnhelationAcAf() {
        return symptomAnhelationAcAf;
    }
    public void setSymptomAnhelationAcAf(String symptomAnhelationAcAf) {
        this.symptomAnhelationAcAf = symptomAnhelationAcAf;
    }
    public String getSymptomAnhelationCalm() {
        return symptomAnhelationCalm;
    }
    public void setSymptomAnhelationCalm(String symptomAnhelationCalm) {
        this.symptomAnhelationCalm = symptomAnhelationCalm;
    }
    public String getSymptomChestAcAf() {
        return symptomChestAcAf;
    }
    public void setSymptomChestAcAf(String symptomChestAcAf) {
        this.symptomChestAcAf = symptomChestAcAf;
    }
    public String getSymptomChestCalm() {
        return symptomChestCalm;
    }
    public void setSymptomChestCalm(String symptomChestCalm) {
        this.symptomChestCalm = symptomChestCalm;
    }
    public String getSymptomChestPainAcAf() {
        return symptomChestPainAcAf;
    }
    public void setSymptomChestPainAcAf(String symptomChestPainAcAf) {
        this.symptomChestPainAcAf = symptomChestPainAcAf;
    }
    public String getSymptomChestPainCalm() {
        return symptomChestPainCalm;
    }
    public void setSymptomChestPainCalm(String symptomChestPainCalm) {
        this.symptomChestPainCalm = symptomChestPainCalm;
    }
    public String getSymptomFeverLess() {
        return symptomFeverLess;
    }
    public void setSymptomFeverLess(String symptomFeverLess) {
        this.symptomFeverLess = symptomFeverLess;
    }
    public String getSymptomFeverGreater() {
        return symptomFeverGreater;
    }
    public void setSymptomFeverGreater(String symptomFeverGreater) {
        this.symptomFeverGreater = symptomFeverGreater;
    }
    public String getSymptomDrowsiness() {
        return symptomDrowsiness;
    }
    public void setSymptomDrowsiness(String symptomDrowsiness) {
        this.symptomDrowsiness = symptomDrowsiness;
    }
    public String getSymptomOther() {
        return symptomOther;
    }
    public void setSymptomOther(String symptomOther) {
        this.symptomOther = symptomOther;
    }
    public String getSymptomAcuteNum() {
        return symptomAcuteNum;
    }
    public void setSymptomAcuteNum(String symptomAcuteNum) {
        this.symptomAcuteNum = symptomAcuteNum;
    }
    public String getHistoryEducation() {
        return historyEducation;
    }
    public void setHistoryEducation(String historyEducation) {
        this.historyEducation = historyEducation;
    }
    public String getHistoryOccupaExposure() {
        return historyOccupaExposure;
    }
    public void setHistoryOccupaExposure(String historyOccupaExposure) {
        this.historyOccupaExposure = historyOccupaExposure;
    }
    public String getHistoryIndoorPollution() {
        return historyIndoorPollution;
    }
    public void setHistoryIndoorPollution(String historyIndoorPollution) {
        this.historyIndoorPollution = historyIndoorPollution;
    }
    public String getHistoryWorkPollution() {
        return historyWorkPollution;
    }
    public void setHistoryWorkPollution(String historyWorkPollution) {
        this.historyWorkPollution = historyWorkPollution;
    }
    public String getHistorySmokingStatus() {
        return historySmokingStatus;
    }
    public void setHistorySmokingStatus(String historySmokingStatus) {
        this.historySmokingStatus = historySmokingStatus;
    }
    public String getHistoryTherioma() {
        return historyTherioma;
    }
    public void setHistoryTherioma(String historyTherioma) {
        this.historyTherioma = historyTherioma;
    }
    public String getHistoryHeredopathia() {
        return historyHeredopathia;
    }
    public void setHistoryHeredopathia(String historyHeredopathia) {
        this.historyHeredopathia = historyHeredopathia;
    }
    public String getHistoryChronicAirway() {
        return historyChronicAirway;
    }
    public void setHistoryChronicAirway(String historyChronicAirway) {
        this.historyChronicAirway = historyChronicAirway;
    }
    public String getSickSign() {
        return sickSign;
    }
    public void setSickSign(String sickSign) {
        this.sickSign = sickSign;
    }
    public String getPulseRate() {
        return pulseRate;
    }
    public void setPulseRate(String pulseRate) {
        this.pulseRate = pulseRate;
    }
    public String getHeartRate() {
        return heartRate;
    }
    public void setHeartRate(String heartRate) {
        this.heartRate = heartRate;
    }
    public String getBloodPressureU() {
        return bloodPressureU;
    }
    public void setBloodPressureU(String bloodPressureU) {
        this.bloodPressureU = bloodPressureU;
    }
    public String getBloodPressureD() {
        return bloodPressureD;
    }
    public void setBloodPressureD(String bloodPressureD) {
        this.bloodPressureD = bloodPressureD;
    }
    public String getBloodPressureStatus() {
        return bloodPressureStatus;
    }
    public void setBloodPressureStatus(String bloodPressureStatus) {
        this.bloodPressureStatus = bloodPressureStatus;
    }
    public String getHeight() {
        return height;
    }
    public void setHeight(String height) {
        this.height = height;
    }
    public String getWeight() {
        return weight;
    }
    public void setWeight(String weight) {
        this.weight = weight;
    }
    public String getSpo() {
        return spo;
    }
    public void setSpo(String spo) {
        this.spo = spo;
    }
    public String getDr() {
        return dr;
    }
    public void setDr(String dr) {
        this.dr = dr;
    }
    public String getLung() {
        return lung;
    }
    public void setLung(String lung) {
        this.lung = lung;
    }
    public String getLungType() {
        return lungType;
    }
    public void setLungType(String lungType) {
        this.lungType = lungType;
    }
    public String getPdm() {
        return pdm;
    }
    public void setPdm(String pdm) {
        this.pdm = pdm;
    }
    public String getFev() {
        return fev;
    }
    public void setFev(String fev) {
        this.fev = fev;
    }
    public String getFvc() {
        return fvc;
    }
    public void setFvc(String fvc) {
        this.fvc = fvc;
    }
    public String getDailySmokingQuantity() {
        return dailySmokingQuantity;
    }
    public void setDailySmokingQuantity(String dailySmokingQuantity) {
        this.dailySmokingQuantity = dailySmokingQuantity;
    }
    public String getDailySmokingStartYear() {
        return dailySmokingStartYear;
    }
    public void setDailySmokingStartYear(String dailySmokingStartYear) {
        this.dailySmokingStartYear = dailySmokingStartYear;
    }
    public String getDailySmokingYearNum() {
        return dailySmokingYearNum;
    }
    public void setDailySmokingYearNum(String dailySmokingYearNum) {
        this.dailySmokingYearNum = dailySmokingYearNum;
    }
    public String getDailySmokingIndex() {
        return dailySmokingIndex;
    }
    public void setDailySmokingIndex(String dailySmokingIndex) {
        this.dailySmokingIndex = dailySmokingIndex;
    }
    public String getEveryAlcoholTolerance() {
        return everyAlcoholTolerance;
    }
    public void setEveryAlcoholTolerance(String everyAlcoholTolerance) {
        this.everyAlcoholTolerance = everyAlcoholTolerance;
    }
    public String getSports() {
        return sports;
    }
    public void setSports(String sports) {
        this.sports = sports;
    }
    public String getOralHormone() {
        return oralHormone;
    }
    public void setOralHormone(String oralHormone) {
        this.oralHormone = oralHormone;
    }
    public String getComplianceBehavior() {
        return complianceBehavior;
    }
    public void setComplianceBehavior(String complianceBehavior) {
        this.complianceBehavior = complianceBehavior;
    }
    public String getDrugCompliance() {
        return drugCompliance;
    }
    public void setDrugCompliance(String drugCompliance) {
        this.drugCompliance = drugCompliance;
    }
    public String getDrugAdverseReaction() {
        return drugAdverseReaction;
    }
    public void setDrugAdverseReaction(String drugAdverseReaction) {
        this.drugAdverseReaction = drugAdverseReaction;
    }
    public String getMedicationSituation() {
        return medicationSituation;
    }
    public void setMedicationSituation(String medicationSituation) {
        this.medicationSituation = medicationSituation;
    }
    public String getValidFlag() {
        return validFlag;
    }
    public void setValidFlag(String validFlag) {
        this.validFlag = validFlag;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getCreateOperator() {
        return createOperator;
    }
    public void setCreateOperator(String createOperator) {
        this.createOperator = createOperator;
    }
    public String getCreateOperatorName() {
        return createOperatorName;
    }
    public void setCreateOperatorName(String createOperatorName) {
        this.createOperatorName = createOperatorName;
    }
    public Date getModifyTime() {
        return modifyTime;
    }
    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
    public String getModifyOperator() {
        return modifyOperator;
    }
    public void setModifyOperator(String modifyOperator) {
        this.modifyOperator = modifyOperator;
    }
    public String getModifyOperatorName() {
        return modifyOperatorName;
    }
    public void setModifyOperatorName(String modifyOperatorName) {
        this.modifyOperatorName = modifyOperatorName;
    }
}

+ 1006 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/FollowupSevereMentalDisorderES.java

@ -0,0 +1,1006 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 严重精神障碍患者随访服务记录表
 * create by hmf on 2019/4/17
 */
public class FollowupSevereMentalDisorderES {
    @JestId
    private String id;
    private String followup_id;             //随访记录ID
    private String followup_project;        //随访详情分类ID
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date create_time;
    private String create_user;
    private String create_user_name;
    private String version;//版本号
    private String name;//患者姓名
    private String number;//编号
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date followup_date;//随访日期
    private Integer followup_type;//随访形式(1门诊 2家庭访视 3电话 4视频)
    private String followup_object;//随访对象(1患者本人 2患者家属、监护人 3其他知情人,多选用逗号隔开)
    private String followup_null_reason;//失访原因(1外出务工 2迁居他处 3走失 4连续三次未访到 5其他)
    /********** 如果死亡,日期和原因 **********/
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date death_date;//死亡日期
    private Integer death_reason_type;//死亡原因(1躯体疾病 2自杀 3他杀 4意外 5精神疾病相关并发症 6其他)
    private String physical_disease_type;//躯体疾病类型(1传染病和寄生虫病 2 肿瘤 3心脏病 4脑血管病 5呼吸系统疾病 6消化系统疾病 7其他疾病 8不详)
    private Integer dangerous_level;//危险性评估(0、0级 1、1级 2、2级 3、3级 4、4级 5、5级)
    /********** 目前症状 **********/
    private Integer illusion;//幻觉(1有,0无)
    private Integer communication_difficulty;//交流困难(1有,0无)
    private Integer suspicious;//猜疑(1有,0无)
    private Integer moods;//喜怒无常(1有,0无)
    private Integer weird;//行为怪异(1有,0无)
    private Integer talkative;//兴奋话多(1有,0无)
    private Integer smashing_objects;//伤人毁物(1有,0无)
    private Integer profoundly_pessimistic;//悲观厌世(1有,0无)
    private Integer outside_without_cause;//无故外走(1有,0无)
    private Integer to_myself_from_laughing;//自语自笑(1有,0无)
    private Integer withdrawn_lazy;//孤僻懒散(1有,0无)
    private Integer other_symptom;//其他症状(1有,0无)
    private String other_symptom_description;//其他症状说明
    private Integer intelligence;//自知力(1自知力完全 2不全 3缺失)
    private Integer sleep_condition;//睡眠情况(1良好 2一般 3较差)
    private Integer dietary_status;//饮食情况(1良好 2一般 3较差)
    /********** 社会功能情况 **********/
    private Integer selfcare_ability;//个人生活料理(1良好 2一般 3较差)
    private Integer housework;//家务劳动(1良好 2一般 3较差)
    private Integer work;//生产活动 及工作(1良好 2一般 3较差 9此项不可用)
    private Integer learning_ability;//学习能力(1良好 2一般 3较差)
    private Integer sociability;//社会人际交往(1良好 2一般 3较差)
    /********** 危险行为 **********/
    private Integer dangerous_behavior_1;//轻度滋事次数,次
    private Integer dangerous_behavior_2;//肇事次数,次
    private Integer dangerous_behavior_3;//肇祸次数,次
    private Integer dangerous_behavior_4;//其他危害行为次数,次
    private Integer dangerous_behavior_5;//自伤次数,次
    private Integer dangerous_behavior_6;//自杀未遂次数,次
    private Integer dangerous_behavior_7;//无危险行为(1是 0否)
    private Integer captivity_case;//两次随访期间关锁情况(1无关锁 2关锁 3关锁已清除)
    private Integer in_hospital_case;//两次随访期间住院情况(0未住院 1目前正在住院 2曾住院,现未住院)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date last_discharged_date;//末次出院日期
    private Integer laboratory_examination;//实验室检查(1无 2有)
    private String laboratory_examination_description;//实验室有检查描述
    private Integer compliance;//用药依从性(1按医嘱规律服药 2间断服药 3不服药 4医嘱无须服药)
    private Integer adverse_drug_reaction;//药物不良反应(1无 2有 9此项不适用)
    private String adverse_drug_reaction_description;//有药物不良反应说明
    private Integer treatment_effects;//治疗效果(1痊愈 2好转 3无变化 4加重 9此项不适用)
    /******** 转诊情况 ********/
    private Integer referral;//转诊建议(1否 2是)
    private String referral_reason;//转诊建议(原因)
    private Integer is_referral;//是否已转诊(1否 2是)
    private String organization_org;//转诊机构(智业机构code)
    private String organization_org_name;//转诊机构名称
    private String organization_hospital;//转诊机构code(dm_hospital表的code)
    private String organization;//转诊科室
    /******** 用药情况 ********/
    private String medicine1_name;//药物1名称
    private String medicine2_name;//药物2名称
    private String medicine3_name;//药物3名称
    private Integer medicine1_dosage_early;//药物1早剂量,mg
    private Integer medicine2_dosage_early;//药物2早剂量,mg
    private Integer medicine3_dosage_early;//药物3早剂量,mg
    private Integer medicine1_dosage_noon;//药物1中剂量,mg
    private Integer medicine2_dosage_noon;//药物2中剂量,mg
    private Integer medicine3_dosage_noon;//药物3中剂量,mg
    private Integer medicine1_dosage_night;//药物1晚剂量,mg
    private Integer medicine2_dosage_night;//药物2晚剂量,mg
    private Integer medicine3_dosage_night;//药物3晚剂量,mg
    private Integer medicine1_frequency;//药物1长效药,次/周
    private Integer medicine1_dosage;//药物1长效药,mg/次
    private Integer medicine2_frequency;//药物1长效药,次/周
    private Integer medicine2_dosage;//药物1长效药,mg/次
    private Integer medicine3_frequency;//药物1长效药,次/周
    private Integer medicine3_dosage;//药物1长效药,mg/次
    /******** 用药指导 ********/
    private String guide_medicine1_name;//药物1名称
    private Integer guide_medicine1_dosage_early;//药物1早上用量,mg
    private Integer guide_medicine1_dosage_noon;//药物1中午用量,mg
    private Integer guide_medicine1_dosage_night;//药物1晚用量,mg
    private Integer guide_sustained_medicine1_frequency;//长效药,次/周
    private Integer guide_sustained_meidicine1_dosage;//长效药,mg/次
    private String guide_medicine2_name;//药物2名称
    private Integer guide_medicine2_dosage_early;//早上用量,mg
    private Integer guide_medicine2_dosage_noon;//中午用量,mg
    private Integer guide_medicine2_dosage_night;//晚用量,mg
    private Integer guide_sustained_medicine2_frequency;//长效药,次/周
    private Integer guide_sustained_meidicine2_dosage;//长效药,mg/次
    private String guide_medicine3_name;//药物3名称
    private Integer guide_medicine3_dosage_early;//早上用量,mg
    private Integer guide_medicine3_dosage_noon;//中午用量,mg
    private Integer guide_medicine3_dosage_night;//晚用量,mg
    private Integer guide_sustained_medicine3_frequency;//长效药,次/周
    private Integer guide_sustained_meidicine3_dosage;//长效药,mg/次
    /******** 康复措施 ********/
    private Integer rehabilitation_work_ability;//生活劳动能力(1有 0无)
    private Integer rehabilitation_training;//职业训练(1有 0无)
    private Integer rehabilitation_learning_ability;//学习能力(1有 0无)
    private Integer rehabilitation_sociability;//社会交往(1有 0无)
    private Integer rehabilitation_other;//其他康复措施(1有 0无)
    private String rehabilitation_other_description;//其他康复措施描述
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date followup_next_date;//随访日期
    private Integer followup_class;//随访分类
    private String doctor_name;//随访医生名字
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getFollowup_id() {
        return followup_id;
    }
    public void setFollowup_id(String followup_id) {
        this.followup_id = followup_id;
    }
    public String getFollowup_project() {
        return followup_project;
    }
    public void setFollowup_project(String followup_project) {
        this.followup_project = followup_project;
    }
    public Date getCreate_time() {
        return create_time;
    }
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
    public String getCreate_user() {
        return create_user;
    }
    public void setCreate_user(String create_user) {
        this.create_user = create_user;
    }
    public String getCreate_user_name() {
        return create_user_name;
    }
    public void setCreate_user_name(String create_user_name) {
        this.create_user_name = create_user_name;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getFollowup_date() {
        return followup_date;
    }
    public void setFollowup_date(Date followup_date) {
        this.followup_date = followup_date;
    }
    public Integer getFollowup_type() {
        return followup_type;
    }
    public void setFollowup_type(Integer followup_type) {
        this.followup_type = followup_type;
    }
    public String getFollowup_object() {
        return followup_object;
    }
    public void setFollowup_object(String followup_object) {
        this.followup_object = followup_object;
    }
    public String getFollowup_null_reason() {
        return followup_null_reason;
    }
    public void setFollowup_null_reason(String followup_null_reason) {
        this.followup_null_reason = followup_null_reason;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getDeath_date() {
        return death_date;
    }
    public void setDeath_date(Date death_date) {
        this.death_date = death_date;
    }
    public Integer getDeath_reason_type() {
        return death_reason_type;
    }
    public void setDeath_reason_type(Integer death_reason_type) {
        this.death_reason_type = death_reason_type;
    }
    public String getPhysical_disease_type() {
        return physical_disease_type;
    }
    public void setPhysical_disease_type(String physical_disease_type) {
        this.physical_disease_type = physical_disease_type;
    }
    public Integer getDangerous_level() {
        return dangerous_level;
    }
    public void setDangerous_level(Integer dangerous_level) {
        this.dangerous_level = dangerous_level;
    }
    public Integer getIllusion() {
        return illusion;
    }
    public void setIllusion(Integer illusion) {
        this.illusion = illusion;
    }
    public Integer getCommunication_difficulty() {
        return communication_difficulty;
    }
    public void setCommunication_difficulty(Integer communication_difficulty) {
        this.communication_difficulty = communication_difficulty;
    }
    public Integer getSuspicious() {
        return suspicious;
    }
    public void setSuspicious(Integer suspicious) {
        this.suspicious = suspicious;
    }
    public Integer getMoods() {
        return moods;
    }
    public void setMoods(Integer moods) {
        this.moods = moods;
    }
    public Integer getWeird() {
        return weird;
    }
    public void setWeird(Integer weird) {
        this.weird = weird;
    }
    public Integer getTalkative() {
        return talkative;
    }
    public void setTalkative(Integer talkative) {
        this.talkative = talkative;
    }
    public Integer getSmashing_objects() {
        return smashing_objects;
    }
    public void setSmashing_objects(Integer smashing_objects) {
        this.smashing_objects = smashing_objects;
    }
    public Integer getProfoundly_pessimistic() {
        return profoundly_pessimistic;
    }
    public void setProfoundly_pessimistic(Integer profoundly_pessimistic) {
        this.profoundly_pessimistic = profoundly_pessimistic;
    }
    public Integer getOutside_without_cause() {
        return outside_without_cause;
    }
    public void setOutside_without_cause(Integer outside_without_cause) {
        this.outside_without_cause = outside_without_cause;
    }
    public Integer getTo_myself_from_laughing() {
        return to_myself_from_laughing;
    }
    public void setTo_myself_from_laughing(Integer to_myself_from_laughing) {
        this.to_myself_from_laughing = to_myself_from_laughing;
    }
    public Integer getWithdrawn_lazy() {
        return withdrawn_lazy;
    }
    public void setWithdrawn_lazy(Integer withdrawn_lazy) {
        this.withdrawn_lazy = withdrawn_lazy;
    }
    public Integer getOther_symptom() {
        return other_symptom;
    }
    public void setOther_symptom(Integer other_symptom) {
        this.other_symptom = other_symptom;
    }
    public String getOther_symptom_description() {
        return other_symptom_description;
    }
    public void setOther_symptom_description(String other_symptom_description) {
        this.other_symptom_description = other_symptom_description;
    }
    public Integer getIntelligence() {
        return intelligence;
    }
    public void setIntelligence(Integer intelligence) {
        this.intelligence = intelligence;
    }
    public Integer getSleep_condition() {
        return sleep_condition;
    }
    public void setSleep_condition(Integer sleep_condition) {
        this.sleep_condition = sleep_condition;
    }
    public Integer getDietary_status() {
        return dietary_status;
    }
    public void setDietary_status(Integer dietary_status) {
        this.dietary_status = dietary_status;
    }
    public Integer getSelfcare_ability() {
        return selfcare_ability;
    }
    public void setSelfcare_ability(Integer selfcare_ability) {
        this.selfcare_ability = selfcare_ability;
    }
    public Integer getHousework() {
        return housework;
    }
    public void setHousework(Integer housework) {
        this.housework = housework;
    }
    public Integer getWork() {
        return work;
    }
    public void setWork(Integer work) {
        this.work = work;
    }
    public Integer getLearning_ability() {
        return learning_ability;
    }
    public void setLearning_ability(Integer learning_ability) {
        this.learning_ability = learning_ability;
    }
    public Integer getSociability() {
        return sociability;
    }
    public void setSociability(Integer sociability) {
        this.sociability = sociability;
    }
    public Integer getDangerous_behavior_1() {
        return dangerous_behavior_1;
    }
    public void setDangerous_behavior_1(Integer dangerous_behavior_1) {
        this.dangerous_behavior_1 = dangerous_behavior_1;
    }
    public Integer getDangerous_behavior_2() {
        return dangerous_behavior_2;
    }
    public void setDangerous_behavior_2(Integer dangerous_behavior_2) {
        this.dangerous_behavior_2 = dangerous_behavior_2;
    }
    public Integer getDangerous_behavior_3() {
        return dangerous_behavior_3;
    }
    public void setDangerous_behavior_3(Integer dangerous_behavior_3) {
        this.dangerous_behavior_3 = dangerous_behavior_3;
    }
    public Integer getDangerous_behavior_4() {
        return dangerous_behavior_4;
    }
    public void setDangerous_behavior_4(Integer dangerous_behavior_4) {
        this.dangerous_behavior_4 = dangerous_behavior_4;
    }
    public Integer getDangerous_behavior_5() {
        return dangerous_behavior_5;
    }
    public void setDangerous_behavior_5(Integer dangerous_behavior_5) {
        this.dangerous_behavior_5 = dangerous_behavior_5;
    }
    public Integer getDangerous_behavior_6() {
        return dangerous_behavior_6;
    }
    public void setDangerous_behavior_6(Integer dangerous_behavior_6) {
        this.dangerous_behavior_6 = dangerous_behavior_6;
    }
    public Integer getDangerous_behavior_7() {
        return dangerous_behavior_7;
    }
    public void setDangerous_behavior_7(Integer dangerous_behavior_7) {
        this.dangerous_behavior_7 = dangerous_behavior_7;
    }
    public Integer getCaptivity_case() {
        return captivity_case;
    }
    public void setCaptivity_case(Integer captivity_case) {
        this.captivity_case = captivity_case;
    }
    public Integer getIn_hospital_case() {
        return in_hospital_case;
    }
    public void setIn_hospital_case(Integer in_hospital_case) {
        this.in_hospital_case = in_hospital_case;
    }
    public Date getLast_discharged_date() {
        return last_discharged_date;
    }
    public void setLast_discharged_date(Date last_discharged_date) {
        this.last_discharged_date = last_discharged_date;
    }
    public Integer getLaboratory_examination() {
        return laboratory_examination;
    }
    public void setLaboratory_examination(Integer laboratory_examination) {
        this.laboratory_examination = laboratory_examination;
    }
    public String getLaboratory_examination_description() {
        return laboratory_examination_description;
    }
    public void setLaboratory_examination_description(String laboratory_examination_description) {
        this.laboratory_examination_description = laboratory_examination_description;
    }
    public Integer getCompliance() {
        return compliance;
    }
    public void setCompliance(Integer compliance) {
        this.compliance = compliance;
    }
    public Integer getAdverse_drug_reaction() {
        return adverse_drug_reaction;
    }
    public void setAdverse_drug_reaction(Integer adverse_drug_reaction) {
        this.adverse_drug_reaction = adverse_drug_reaction;
    }
    public String getAdverse_drug_reaction_description() {
        return adverse_drug_reaction_description;
    }
    public void setAdverse_drug_reaction_description(String adverse_drug_reaction_description) {
        this.adverse_drug_reaction_description = adverse_drug_reaction_description;
    }
    public Integer getTreatment_effects() {
        return treatment_effects;
    }
    public void setTreatment_effects(Integer treatment_effects) {
        this.treatment_effects = treatment_effects;
    }
    public Integer getReferral() {
        return referral;
    }
    public void setReferral(Integer referral) {
        this.referral = referral;
    }
    public String getReferral_reason() {
        return referral_reason;
    }
    public void setReferral_reason(String referral_reason) {
        this.referral_reason = referral_reason;
    }
    public Integer getIs_referral() {
        return is_referral;
    }
    public void setIs_referral(Integer is_referral) {
        this.is_referral = is_referral;
    }
    public String getOrganization_org() {
        return organization_org;
    }
    public void setOrganization_org(String organization_org) {
        this.organization_org = organization_org;
    }
    public String getOrganization_org_name() {
        return organization_org_name;
    }
    public void setOrganization_org_name(String organization_org_name) {
        this.organization_org_name = organization_org_name;
    }
    public String getOrganization_hospital() {
        return organization_hospital;
    }
    public void setOrganization_hospital(String organization_hospital) {
        this.organization_hospital = organization_hospital;
    }
    public String getOrganization() {
        return organization;
    }
    public void setOrganization(String organization) {
        this.organization = organization;
    }
    public String getMedicine1_name() {
        return medicine1_name;
    }
    public void setMedicine1_name(String medicine1_name) {
        this.medicine1_name = medicine1_name;
    }
    public String getMedicine2_name() {
        return medicine2_name;
    }
    public void setMedicine2_name(String medicine2_name) {
        this.medicine2_name = medicine2_name;
    }
    public String getMedicine3_name() {
        return medicine3_name;
    }
    public void setMedicine3_name(String medicine3_name) {
        this.medicine3_name = medicine3_name;
    }
    public Integer getMedicine1_dosage_early() {
        return medicine1_dosage_early;
    }
    public void setMedicine1_dosage_early(Integer medicine1_dosage_early) {
        this.medicine1_dosage_early = medicine1_dosage_early;
    }
    public Integer getMedicine2_dosage_early() {
        return medicine2_dosage_early;
    }
    public void setMedicine2_dosage_early(Integer medicine2_dosage_early) {
        this.medicine2_dosage_early = medicine2_dosage_early;
    }
    public Integer getMedicine3_dosage_early() {
        return medicine3_dosage_early;
    }
    public void setMedicine3_dosage_early(Integer medicine3_dosage_early) {
        this.medicine3_dosage_early = medicine3_dosage_early;
    }
    public Integer getMedicine1_dosage_noon() {
        return medicine1_dosage_noon;
    }
    public void setMedicine1_dosage_noon(Integer medicine1_dosage_noon) {
        this.medicine1_dosage_noon = medicine1_dosage_noon;
    }
    public Integer getMedicine2_dosage_noon() {
        return medicine2_dosage_noon;
    }
    public void setMedicine2_dosage_noon(Integer medicine2_dosage_noon) {
        this.medicine2_dosage_noon = medicine2_dosage_noon;
    }
    public Integer getMedicine3_dosage_noon() {
        return medicine3_dosage_noon;
    }
    public void setMedicine3_dosage_noon(Integer medicine3_dosage_noon) {
        this.medicine3_dosage_noon = medicine3_dosage_noon;
    }
    public Integer getMedicine1_dosage_night() {
        return medicine1_dosage_night;
    }
    public void setMedicine1_dosage_night(Integer medicine1_dosage_night) {
        this.medicine1_dosage_night = medicine1_dosage_night;
    }
    public Integer getMedicine2_dosage_night() {
        return medicine2_dosage_night;
    }
    public void setMedicine2_dosage_night(Integer medicine2_dosage_night) {
        this.medicine2_dosage_night = medicine2_dosage_night;
    }
    public Integer getMedicine3_dosage_night() {
        return medicine3_dosage_night;
    }
    public void setMedicine3_dosage_night(Integer medicine3_dosage_night) {
        this.medicine3_dosage_night = medicine3_dosage_night;
    }
    public Integer getMedicine1_frequency() {
        return medicine1_frequency;
    }
    public void setMedicine1_frequency(Integer medicine1_frequency) {
        this.medicine1_frequency = medicine1_frequency;
    }
    public Integer getMedicine1_dosage() {
        return medicine1_dosage;
    }
    public void setMedicine1_dosage(Integer medicine1_dosage) {
        this.medicine1_dosage = medicine1_dosage;
    }
    public Integer getMedicine2_frequency() {
        return medicine2_frequency;
    }
    public void setMedicine2_frequency(Integer medicine2_frequency) {
        this.medicine2_frequency = medicine2_frequency;
    }
    public Integer getMedicine2_dosage() {
        return medicine2_dosage;
    }
    public void setMedicine2_dosage(Integer medicine2_dosage) {
        this.medicine2_dosage = medicine2_dosage;
    }
    public Integer getMedicine3_frequency() {
        return medicine3_frequency;
    }
    public void setMedicine3_frequency(Integer medicine3_frequency) {
        this.medicine3_frequency = medicine3_frequency;
    }
    public Integer getMedicine3_dosage() {
        return medicine3_dosage;
    }
    public void setMedicine3_dosage(Integer medicine3_dosage) {
        this.medicine3_dosage = medicine3_dosage;
    }
    public String getGuide_medicine1_name() {
        return guide_medicine1_name;
    }
    public void setGuide_medicine1_name(String guide_medicine1_name) {
        this.guide_medicine1_name = guide_medicine1_name;
    }
    public Integer getGuide_medicine1_dosage_early() {
        return guide_medicine1_dosage_early;
    }
    public void setGuide_medicine1_dosage_early(Integer guide_medicine1_dosage_early) {
        this.guide_medicine1_dosage_early = guide_medicine1_dosage_early;
    }
    public Integer getGuide_medicine1_dosage_noon() {
        return guide_medicine1_dosage_noon;
    }
    public void setGuide_medicine1_dosage_noon(Integer guide_medicine1_dosage_noon) {
        this.guide_medicine1_dosage_noon = guide_medicine1_dosage_noon;
    }
    public Integer getGuide_medicine1_dosage_night() {
        return guide_medicine1_dosage_night;
    }
    public void setGuide_medicine1_dosage_night(Integer guide_medicine1_dosage_night) {
        this.guide_medicine1_dosage_night = guide_medicine1_dosage_night;
    }
    public Integer getGuide_sustained_medicine1_frequency() {
        return guide_sustained_medicine1_frequency;
    }
    public void setGuide_sustained_medicine1_frequency(Integer guide_sustained_medicine1_frequency) {
        this.guide_sustained_medicine1_frequency = guide_sustained_medicine1_frequency;
    }
    public Integer getGuide_sustained_meidicine1_dosage() {
        return guide_sustained_meidicine1_dosage;
    }
    public void setGuide_sustained_meidicine1_dosage(Integer guide_sustained_meidicine1_dosage) {
        this.guide_sustained_meidicine1_dosage = guide_sustained_meidicine1_dosage;
    }
    public String getGuide_medicine2_name() {
        return guide_medicine2_name;
    }
    public void setGuide_medicine2_name(String guide_medicine2_name) {
        this.guide_medicine2_name = guide_medicine2_name;
    }
    public Integer getGuide_medicine2_dosage_early() {
        return guide_medicine2_dosage_early;
    }
    public void setGuide_medicine2_dosage_early(Integer guide_medicine2_dosage_early) {
        this.guide_medicine2_dosage_early = guide_medicine2_dosage_early;
    }
    public Integer getGuide_medicine2_dosage_noon() {
        return guide_medicine2_dosage_noon;
    }
    public void setGuide_medicine2_dosage_noon(Integer guide_medicine2_dosage_noon) {
        this.guide_medicine2_dosage_noon = guide_medicine2_dosage_noon;
    }
    public Integer getGuide_medicine2_dosage_night() {
        return guide_medicine2_dosage_night;
    }
    public void setGuide_medicine2_dosage_night(Integer guide_medicine2_dosage_night) {
        this.guide_medicine2_dosage_night = guide_medicine2_dosage_night;
    }
    public Integer getGuide_sustained_medicine2_frequency() {
        return guide_sustained_medicine2_frequency;
    }
    public void setGuide_sustained_medicine2_frequency(Integer guide_sustained_medicine2_frequency) {
        this.guide_sustained_medicine2_frequency = guide_sustained_medicine2_frequency;
    }
    public Integer getGuide_sustained_meidicine2_dosage() {
        return guide_sustained_meidicine2_dosage;
    }
    public void setGuide_sustained_meidicine2_dosage(Integer guide_sustained_meidicine2_dosage) {
        this.guide_sustained_meidicine2_dosage = guide_sustained_meidicine2_dosage;
    }
    public String getGuide_medicine3_name() {
        return guide_medicine3_name;
    }
    public void setGuide_medicine3_name(String guide_medicine3_name) {
        this.guide_medicine3_name = guide_medicine3_name;
    }
    public Integer getGuide_medicine3_dosage_early() {
        return guide_medicine3_dosage_early;
    }
    public void setGuide_medicine3_dosage_early(Integer guide_medicine3_dosage_early) {
        this.guide_medicine3_dosage_early = guide_medicine3_dosage_early;
    }
    public Integer getGuide_medicine3_dosage_noon() {
        return guide_medicine3_dosage_noon;
    }
    public void setGuide_medicine3_dosage_noon(Integer guide_medicine3_dosage_noon) {
        this.guide_medicine3_dosage_noon = guide_medicine3_dosage_noon;
    }
    public Integer getGuide_medicine3_dosage_night() {
        return guide_medicine3_dosage_night;
    }
    public void setGuide_medicine3_dosage_night(Integer guide_medicine3_dosage_night) {
        this.guide_medicine3_dosage_night = guide_medicine3_dosage_night;
    }
    public Integer getGuide_sustained_medicine3_frequency() {
        return guide_sustained_medicine3_frequency;
    }
    public void setGuide_sustained_medicine3_frequency(Integer guide_sustained_medicine3_frequency) {
        this.guide_sustained_medicine3_frequency = guide_sustained_medicine3_frequency;
    }
    public Integer getGuide_sustained_meidicine3_dosage() {
        return guide_sustained_meidicine3_dosage;
    }
    public void setGuide_sustained_meidicine3_dosage(Integer guide_sustained_meidicine3_dosage) {
        this.guide_sustained_meidicine3_dosage = guide_sustained_meidicine3_dosage;
    }
    public Integer getRehabilitation_work_ability() {
        return rehabilitation_work_ability;
    }
    public void setRehabilitation_work_ability(Integer rehabilitation_work_ability) {
        this.rehabilitation_work_ability = rehabilitation_work_ability;
    }
    public Integer getRehabilitation_training() {
        return rehabilitation_training;
    }
    public void setRehabilitation_training(Integer rehabilitation_training) {
        this.rehabilitation_training = rehabilitation_training;
    }
    public Integer getRehabilitation_learning_ability() {
        return rehabilitation_learning_ability;
    }
    public void setRehabilitation_learning_ability(Integer rehabilitation_learning_ability) {
        this.rehabilitation_learning_ability = rehabilitation_learning_ability;
    }
    public Integer getRehabilitation_sociability() {
        return rehabilitation_sociability;
    }
    public void setRehabilitation_sociability(Integer rehabilitation_sociability) {
        this.rehabilitation_sociability = rehabilitation_sociability;
    }
    public Integer getRehabilitation_other() {
        return rehabilitation_other;
    }
    public void setRehabilitation_other(Integer rehabilitation_other) {
        this.rehabilitation_other = rehabilitation_other;
    }
    public String getRehabilitation_other_description() {
        return rehabilitation_other_description;
    }
    public void setRehabilitation_other_description(String rehabilitation_other_description) {
        this.rehabilitation_other_description = rehabilitation_other_description;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getFollowup_next_date() {
        return followup_next_date;
    }
    public void setFollowup_next_date(Date followup_next_date) {
        this.followup_next_date = followup_next_date;
    }
    public Integer getFollowup_class() {
        return followup_class;
    }
    public void setFollowup_class(Integer followup_class) {
        this.followup_class = followup_class;
    }
    public String getDoctor_name() {
        return doctor_name;
    }
    public void setDoctor_name(String doctor_name) {
        this.doctor_name = doctor_name;
    }
}

+ 191 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/GynecologicalInflammationDailyFollowupES.java

@ -0,0 +1,191 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 妇科炎症日常随访表
 * @author hmf
 * @date 2020/3/12
 */
public class GynecologicalInflammationDailyFollowupES {
    @JestId
    private String id;
    private String followup_id;             //随访记录ID
    private String followup_project;        //随访详情分类ID
    private String version;//版本号
    private String followClass;//随访类别【1.阴道炎 2.盆腔炎 3.宫颈炎4.其他】
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date createTime;//创建时间
    private String createOperator;//创建人
    private String createOperatorName;//创建人
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date modifyTime;//修改时间
    private String modifyOperator;//修改人
    private String modifyOperatorName;//修改人
    private String problemId;//健康问题id(肺癌1001 慢性胃肠病1002 冠心病1003 慢性前列腺疾病1004 慢性乳腺疾病1005  慢性阻塞性肺病1006 脂肪肝1007 慢性妇科炎症1008 脑卒中1009 慢性肾病1010)
    private String referralHospital;//是否已经转诊上级医院 1是 0否
    private String hospitalOrg;//就诊机构
    private String hospitalOrgName;//就诊机构
    private String illnessBetter;//该院治疗后病情是否好转 1是 0否
    private String currentStatus;//目前情况(1还在治疗中 2还在治疗中、暂未就诊 3还在治疗中、拒绝管理 4还在治疗中、失访 5已结束治疗)
    private String validFlag;//有效标志
    private String remark;//备注
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getFollowup_id() {
        return followup_id;
    }
    public void setFollowup_id(String followup_id) {
        this.followup_id = followup_id;
    }
    public String getFollowup_project() {
        return followup_project;
    }
    public void setFollowup_project(String followup_project) {
        this.followup_project = followup_project;
    }
    public String getProblemId() {
        return problemId;
    }
    public void setProblemId(String problemId) {
        this.problemId = problemId;
    }
    public String getReferralHospital() {
        return referralHospital;
    }
    public void setReferralHospital(String referralHospital) {
        this.referralHospital = referralHospital;
    }
    public String getHospitalOrg() {
        return hospitalOrg;
    }
    public void setHospitalOrg(String hospitalOrg) {
        this.hospitalOrg = hospitalOrg;
    }
    public String getIllnessBetter() {
        return illnessBetter;
    }
    public void setIllnessBetter(String illnessBetter) {
        this.illnessBetter = illnessBetter;
    }
    public String getCurrentStatus() {
        return currentStatus;
    }
    public void setCurrentStatus(String currentStatus) {
        this.currentStatus = currentStatus;
    }
    public String getValidFlag() {
        return validFlag;
    }
    public void setValidFlag(String validFlag) {
        this.validFlag = validFlag;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getFollowClass() {
        return followClass;
    }
    public void setFollowClass(String followClass) {
        this.followClass = followClass;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getCreateOperator() {
        return createOperator;
    }
    public void setCreateOperator(String createOperator) {
        this.createOperator = createOperator;
    }
    public String getCreateOperatorName() {
        return createOperatorName;
    }
    public void setCreateOperatorName(String createOperatorName) {
        this.createOperatorName = createOperatorName;
    }
    public Date getModifyTime() {
        return modifyTime;
    }
    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
    public String getModifyOperator() {
        return modifyOperator;
    }
    public void setModifyOperator(String modifyOperator) {
        this.modifyOperator = modifyOperator;
    }
    public String getModifyOperatorName() {
        return modifyOperatorName;
    }
    public void setModifyOperatorName(String modifyOperatorName) {
        this.modifyOperatorName = modifyOperatorName;
    }
    public String getHospitalOrgName() {
        return hospitalOrgName;
    }
    public void setHospitalOrgName(String hospitalOrgName) {
        this.hospitalOrgName = hospitalOrgName;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
}

+ 780 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/GynecologicalInflammationFollowupArchivesES.java

@ -0,0 +1,780 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 妇科炎症随访档案
 * @author hmf
 * @date 2020/3/20
 */
public class GynecologicalInflammationFollowupArchivesES {
    @JestId
    private String id;
    private String followup_id;             //随访记录ID
    private String followup_project;        //随访详情分类ID
    private String version;//版本号
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date createTime;//创建时间
    private String createOperator;//创建人
    private String createOperatorName;//创建人
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date modifyTime;//修改时间
    private String modifyOperator;//修改人
    private String modifyOperatorName;//修改人
    private String problemId;//健康问题id(肺癌1001 慢性胃肠病1002 冠心病1003 慢性前列腺疾病1004 慢性乳腺疾病1005  慢性阻塞性肺病1006 脂肪肝1007 慢性妇科炎症1008 脑卒中1009 慢性肾病1010)
    private String validFlag;//有效标志
    private String remark;//备注
    private String symptomNo;//症状_无
    private String symptomPv;//症状_外阴瘙痒
    private String symptomDoap;//症状_腹痛程度
    private String bloodPressureD;//血压(舒张压)
    private String bloodPressureU;//血压(收缩压)
    private String height;//身高
    private String weight;//体重
    private String bmi;//体质指数
    private String heartRate;//心率
    private String leukorrheaWs;//白带_水样
    private String leukorrheaThick;//白带_稠
    private String leukorrheaCurd;//白带_凝乳或豆腐渣样
    private String leukorrheaSpum;//白带_泡沫状
    private String leukorrheaWhite;//白带_白色
    private String leukorrheaKelly;//白带_黄绿色
    private String leukorrheaPuru;//白带_脓性
    private String leukorrheaOdour;//白带_臭味
    private String leukorrheaCau;//白带_血性
    private String unCs;//宫颈_常大
    private String unPlump;//宫颈_肥大
    private String unLs;//宫颈_轻糜
    private String unMs;//宫颈_中糜
    private String unS;//宫颈_重糜
    private String unCb;//宫颈_接触性出血
    private String unLp;//宫颈_举痛
    private String ubCs;//宫体_常大
    private String ubM;//宫体_增大
    private String ubT;//宫体_压痛
    private String ubRt;//宫体_反跳痛
    private String aaLeftG;//附件区_左_肿物
    private String aaLeftT;//附件区_左_压痛
    private String aaLeftRt;//附件区_左_反跳痛
    private String aaRightG;//附件区_右_肿物
    private String aaRightT;//附件区_右_压痛
    private String aaRightRt;//附件区_右_反跳痛
    private String aeEm;//辅助检查_阴道微生态
    private String aeSc;//辅助检查_分泌物培养
    private String aeRbt;//辅助检查_血常规
    private String aeCrp;//辅助检查Crp
    private String aeCdu;//辅助检查_彩超
    private String aeLe;//辅助检查_白带检查
    private String aeOther;//辅助检查_其他
    private String aeResult;//辅助检查_结果登记
    private String heAoa;//健康宣教_是否滥用抗生素
    private String heCyua;//健康宣教_是否单独清洁内裤
    private String heFuodsl;//健康宣教_是否频繁使用药字号洗液、消毒护垫
    private String heLwttfalt;//健康宣教_是否长时间穿着厚紧身裤
    private String drugTimeStart1;//开始用药时间_1
    private String drugTimeEnd1;//结束用药时间_1
    private String drugName1;//药物名称_1
    private String drugResult1;//用药效果_1
    private String drugTimeStart2;//开始用药时间_2
    private String drugTimeEnd2;//结束用药时间_2
    private String drugName2;//药物名称_2
    private String drugResult2;//用药效果_2
    private String drugTimeStart3;//开始用药时间_3
    private String drugTimeEnd3;//结束用药时间_3
    private String drugName3;//药物名称_3
    private String drugResult3;//用药效果_3
    private String drugTimeStart4;//开始用药时间_4
    private String drugTimeEnd4;//结束用药时间_4
    private String drugName4;//药物名称_4
    private String drugResult4;//用药效果_4
    private String drugTimeStart5;//开始用药时间_5
    private String drugTimeEnd5;//结束用药时间_5
    private String drugName5;//药物名称_5
    private String drugResult5;//用药效果_5
    private String drugTimeStart6;//开始用药时间_6
    private String drugTimeEnd6;//结束用药时间_6
    private String drugName6;//药物名称_6
    private String drugResult6;//用药效果_6
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getFollowup_id() {
        return followup_id;
    }
    public void setFollowup_id(String followup_id) {
        this.followup_id = followup_id;
    }
    public String getFollowup_project() {
        return followup_project;
    }
    public void setFollowup_project(String followup_project) {
        this.followup_project = followup_project;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getCreateOperator() {
        return createOperator;
    }
    public void setCreateOperator(String createOperator) {
        this.createOperator = createOperator;
    }
    public String getCreateOperatorName() {
        return createOperatorName;
    }
    public void setCreateOperatorName(String createOperatorName) {
        this.createOperatorName = createOperatorName;
    }
    public Date getModifyTime() {
        return modifyTime;
    }
    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
    public String getModifyOperator() {
        return modifyOperator;
    }
    public void setModifyOperator(String modifyOperator) {
        this.modifyOperator = modifyOperator;
    }
    public String getModifyOperatorName() {
        return modifyOperatorName;
    }
    public void setModifyOperatorName(String modifyOperatorName) {
        this.modifyOperatorName = modifyOperatorName;
    }
    public String getProblemId() {
        return problemId;
    }
    public void setProblemId(String problemId) {
        this.problemId = problemId;
    }
    public String getValidFlag() {
        return validFlag;
    }
    public void setValidFlag(String validFlag) {
        this.validFlag = validFlag;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getSymptomNo() {
        return symptomNo;
    }
    public void setSymptomNo(String symptomNo) {
        this.symptomNo = symptomNo;
    }
    public String getSymptomPv() {
        return symptomPv;
    }
    public void setSymptomPv(String symptomPv) {
        this.symptomPv = symptomPv;
    }
    public String getSymptomDoap() {
        return symptomDoap;
    }
    public void setSymptomDoap(String symptomDoap) {
        this.symptomDoap = symptomDoap;
    }
    public String getBloodPressureD() {
        return bloodPressureD;
    }
    public void setBloodPressureD(String bloodPressureD) {
        this.bloodPressureD = bloodPressureD;
    }
    public String getBloodPressureU() {
        return bloodPressureU;
    }
    public void setBloodPressureU(String bloodPressureU) {
        this.bloodPressureU = bloodPressureU;
    }
    public String getHeight() {
        return height;
    }
    public void setHeight(String height) {
        this.height = height;
    }
    public String getWeight() {
        return weight;
    }
    public void setWeight(String weight) {
        this.weight = weight;
    }
    public String getBmi() {
        return bmi;
    }
    public void setBmi(String bmi) {
        this.bmi = bmi;
    }
    public String getHeartRate() {
        return heartRate;
    }
    public void setHeartRate(String heartRate) {
        this.heartRate = heartRate;
    }
    public String getLeukorrheaWs() {
        return leukorrheaWs;
    }
    public void setLeukorrheaWs(String leukorrheaWs) {
        this.leukorrheaWs = leukorrheaWs;
    }
    public String getLeukorrheaThick() {
        return leukorrheaThick;
    }
    public void setLeukorrheaThick(String leukorrheaThick) {
        this.leukorrheaThick = leukorrheaThick;
    }
    public String getLeukorrheaCurd() {
        return leukorrheaCurd;
    }
    public void setLeukorrheaCurd(String leukorrheaCurd) {
        this.leukorrheaCurd = leukorrheaCurd;
    }
    public String getLeukorrheaSpum() {
        return leukorrheaSpum;
    }
    public void setLeukorrheaSpum(String leukorrheaSpum) {
        this.leukorrheaSpum = leukorrheaSpum;
    }
    public String getLeukorrheaWhite() {
        return leukorrheaWhite;
    }
    public void setLeukorrheaWhite(String leukorrheaWhite) {
        this.leukorrheaWhite = leukorrheaWhite;
    }
    public String getLeukorrheaKelly() {
        return leukorrheaKelly;
    }
    public void setLeukorrheaKelly(String leukorrheaKelly) {
        this.leukorrheaKelly = leukorrheaKelly;
    }
    public String getLeukorrheaPuru() {
        return leukorrheaPuru;
    }
    public void setLeukorrheaPuru(String leukorrheaPuru) {
        this.leukorrheaPuru = leukorrheaPuru;
    }
    public String getLeukorrheaOdour() {
        return leukorrheaOdour;
    }
    public void setLeukorrheaOdour(String leukorrheaOdour) {
        this.leukorrheaOdour = leukorrheaOdour;
    }
    public String getLeukorrheaCau() {
        return leukorrheaCau;
    }
    public void setLeukorrheaCau(String leukorrheaCau) {
        this.leukorrheaCau = leukorrheaCau;
    }
    public String getUnCs() {
        return unCs;
    }
    public void setUnCs(String unCs) {
        this.unCs = unCs;
    }
    public String getUnPlump() {
        return unPlump;
    }
    public void setUnPlump(String unPlump) {
        this.unPlump = unPlump;
    }
    public String getUnLs() {
        return unLs;
    }
    public void setUnLs(String unLs) {
        this.unLs = unLs;
    }
    public String getUnMs() {
        return unMs;
    }
    public void setUnMs(String unMs) {
        this.unMs = unMs;
    }
    public String getUnS() {
        return unS;
    }
    public void setUnS(String unS) {
        this.unS = unS;
    }
    public String getUnCb() {
        return unCb;
    }
    public void setUnCb(String unCb) {
        this.unCb = unCb;
    }
    public String getUnLp() {
        return unLp;
    }
    public void setUnLp(String unLp) {
        this.unLp = unLp;
    }
    public String getUbCs() {
        return ubCs;
    }
    public void setUbCs(String ubCs) {
        this.ubCs = ubCs;
    }
    public String getUbM() {
        return ubM;
    }
    public void setUbM(String ubM) {
        this.ubM = ubM;
    }
    public String getUbT() {
        return ubT;
    }
    public void setUbT(String ubT) {
        this.ubT = ubT;
    }
    public String getUbRt() {
        return ubRt;
    }
    public void setUbRt(String ubRt) {
        this.ubRt = ubRt;
    }
    public String getAaLeftG() {
        return aaLeftG;
    }
    public void setAaLeftG(String aaLeftG) {
        this.aaLeftG = aaLeftG;
    }
    public String getAaLeftT() {
        return aaLeftT;
    }
    public void setAaLeftT(String aaLeftT) {
        this.aaLeftT = aaLeftT;
    }
    public String getAaLeftRt() {
        return aaLeftRt;
    }
    public void setAaLeftRt(String aaLeftRt) {
        this.aaLeftRt = aaLeftRt;
    }
    public String getAaRightG() {
        return aaRightG;
    }
    public void setAaRightG(String aaRightG) {
        this.aaRightG = aaRightG;
    }
    public String getAaRightT() {
        return aaRightT;
    }
    public void setAaRightT(String aaRightT) {
        this.aaRightT = aaRightT;
    }
    public String getAaRightRt() {
        return aaRightRt;
    }
    public void setAaRightRt(String aaRightRt) {
        this.aaRightRt = aaRightRt;
    }
    public String getAeEm() {
        return aeEm;
    }
    public void setAeEm(String aeEm) {
        this.aeEm = aeEm;
    }
    public String getAeSc() {
        return aeSc;
    }
    public void setAeSc(String aeSc) {
        this.aeSc = aeSc;
    }
    public String getAeRbt() {
        return aeRbt;
    }
    public void setAeRbt(String aeRbt) {
        this.aeRbt = aeRbt;
    }
    public String getAeCrp() {
        return aeCrp;
    }
    public void setAeCrp(String aeCrp) {
        this.aeCrp = aeCrp;
    }
    public String getAeCdu() {
        return aeCdu;
    }
    public void setAeCdu(String aeCdu) {
        this.aeCdu = aeCdu;
    }
    public String getAeLe() {
        return aeLe;
    }
    public void setAeLe(String aeLe) {
        this.aeLe = aeLe;
    }
    public String getAeOther() {
        return aeOther;
    }
    public void setAeOther(String aeOther) {
        this.aeOther = aeOther;
    }
    public String getAeResult() {
        return aeResult;
    }
    public void setAeResult(String aeResult) {
        this.aeResult = aeResult;
    }
    public String getHeAoa() {
        return heAoa;
    }
    public void setHeAoa(String heAoa) {
        this.heAoa = heAoa;
    }
    public String getHeCyua() {
        return heCyua;
    }
    public void setHeCyua(String heCyua) {
        this.heCyua = heCyua;
    }
    public String getHeFuodsl() {
        return heFuodsl;
    }
    public void setHeFuodsl(String heFuodsl) {
        this.heFuodsl = heFuodsl;
    }
    public String getHeLwttfalt() {
        return heLwttfalt;
    }
    public void setHeLwttfalt(String heLwttfalt) {
        this.heLwttfalt = heLwttfalt;
    }
    public String getDrugTimeStart1() {
        return drugTimeStart1;
    }
    public void setDrugTimeStart1(String drugTimeStart1) {
        this.drugTimeStart1 = drugTimeStart1;
    }
    public String getDrugTimeEnd1() {
        return drugTimeEnd1;
    }
    public void setDrugTimeEnd1(String drugTimeEnd1) {
        this.drugTimeEnd1 = drugTimeEnd1;
    }
    public String getDrugName1() {
        return drugName1;
    }
    public void setDrugName1(String drugName1) {
        this.drugName1 = drugName1;
    }
    public String getDrugResult1() {
        return drugResult1;
    }
    public void setDrugResult1(String drugResult1) {
        this.drugResult1 = drugResult1;
    }
    public String getDrugTimeStart2() {
        return drugTimeStart2;
    }
    public void setDrugTimeStart2(String drugTimeStart2) {
        this.drugTimeStart2 = drugTimeStart2;
    }
    public String getDrugTimeEnd2() {
        return drugTimeEnd2;
    }
    public void setDrugTimeEnd2(String drugTimeEnd2) {
        this.drugTimeEnd2 = drugTimeEnd2;
    }
    public String getDrugName2() {
        return drugName2;
    }
    public void setDrugName2(String drugName2) {
        this.drugName2 = drugName2;
    }
    public String getDrugResult2() {
        return drugResult2;
    }
    public void setDrugResult2(String drugResult2) {
        this.drugResult2 = drugResult2;
    }
    public String getDrugTimeStart3() {
        return drugTimeStart3;
    }
    public void setDrugTimeStart3(String drugTimeStart3) {
        this.drugTimeStart3 = drugTimeStart3;
    }
    public String getDrugTimeEnd3() {
        return drugTimeEnd3;
    }
    public void setDrugTimeEnd3(String drugTimeEnd3) {
        this.drugTimeEnd3 = drugTimeEnd3;
    }
    public String getDrugName3() {
        return drugName3;
    }
    public void setDrugName3(String drugName3) {
        this.drugName3 = drugName3;
    }
    public String getDrugResult3() {
        return drugResult3;
    }
    public void setDrugResult3(String drugResult3) {
        this.drugResult3 = drugResult3;
    }
    public String getDrugTimeStart4() {
        return drugTimeStart4;
    }
    public void setDrugTimeStart4(String drugTimeStart4) {
        this.drugTimeStart4 = drugTimeStart4;
    }
    public String getDrugTimeEnd4() {
        return drugTimeEnd4;
    }
    public void setDrugTimeEnd4(String drugTimeEnd4) {
        this.drugTimeEnd4 = drugTimeEnd4;
    }
    public String getDrugName4() {
        return drugName4;
    }
    public void setDrugName4(String drugName4) {
        this.drugName4 = drugName4;
    }
    public String getDrugResult4() {
        return drugResult4;
    }
    public void setDrugResult4(String drugResult4) {
        this.drugResult4 = drugResult4;
    }
    public String getDrugTimeStart5() {
        return drugTimeStart5;
    }
    public void setDrugTimeStart5(String drugTimeStart5) {
        this.drugTimeStart5 = drugTimeStart5;
    }
    public String getDrugTimeEnd5() {
        return drugTimeEnd5;
    }
    public void setDrugTimeEnd5(String drugTimeEnd5) {
        this.drugTimeEnd5 = drugTimeEnd5;
    }
    public String getDrugName5() {
        return drugName5;
    }
    public void setDrugName5(String drugName5) {
        this.drugName5 = drugName5;
    }
    public String getDrugResult5() {
        return drugResult5;
    }
    public void setDrugResult5(String drugResult5) {
        this.drugResult5 = drugResult5;
    }
    public String getDrugTimeStart6() {
        return drugTimeStart6;
    }
    public void setDrugTimeStart6(String drugTimeStart6) {
        this.drugTimeStart6 = drugTimeStart6;
    }
    public String getDrugTimeEnd6() {
        return drugTimeEnd6;
    }
    public void setDrugTimeEnd6(String drugTimeEnd6) {
        this.drugTimeEnd6 = drugTimeEnd6;
    }
    public String getDrugName6() {
        return drugName6;
    }
    public void setDrugName6(String drugName6) {
        this.drugName6 = drugName6;
    }
    public String getDrugResult6() {
        return drugResult6;
    }
    public void setDrugResult6(String drugResult6) {
        this.drugResult6 = drugResult6;
    }
}

+ 439 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/HealthEduArticleES.java

@ -0,0 +1,439 @@
package com.yihu.rehabilitation.vo.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.Transient;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
 * 推送记录表
 * Created by chenweida on 2017/9/7.
 */
public class HealthEduArticleES {
    @JestId
    private String id;
    //说明:如医生推送文章给5个居民,则保存5条userType=1的记录和1条userType=2的记录(共6条)batchNo批次号一样。
    private String batchNo;//批次号记录发送所属批次(ES:必填)
    private String patientCode; // 患者标识(ES)(根据userType的值,userType=1,必填;userType=2,为空)
    private String patientName; // 患者名称(ES)(根据userType的值,userType=1,必填;userType=2,为空)
    private String doctorCode;  //发送人code(doctor表中的code)(ES:必填)
    private String doctorName;  //发送人名称(doctor表中的name)(ES:必填)
    private String sendName;   // 推送人的名称(包括医生本人、卫计委)(ES:必填)(如医生本人推送则记录医生名称,如管理员推送则记录管理员的角色名称)
    //备注:从发送人的信息中获取(doctor表获取)
    private String sendPic;   // 发送人头像(ES)
    private String sendSex;   // 发送人性别(ES)
    private Long adminTeamCode;// 行政团队(ES)
    private String adminTeamName;// 行政团队(ES)
    private String hospital; // 所属机构(ES)
    private String hospitalName; // 所属机构(ES)
    private String town; // 所属区划(ES)
    private String townName; // 所属区划(ES)
    private String disease;//康复计划中的疾病类型
    private Integer teamCode;//康复计划中的专科签约医生团队(teamCode)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:s" +
            "" +
            "sXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date createTime;  // 创建时间(ES:必填)
    private Integer sendType;//发送类型 1医生发送 2(管理员)卫纪委发送(ES:必填)
    private String sendLevel;   // 发送人级别  1专科医生,2全科医生,3健康管理师 4 管理员(ES)
    private String articleId;  //文章id(ES:必填)
    private String articleTitle;  //文章标题(ES:必填)
    private String articleCover;//文章封面(ES:必填)
    private String articleContent; //文章内容(ES:必填)
    private String articleCategoryId;//文章类别(ES:必填)
    private String firstLevelCategoryId;//文章一级类别id(ES:必填)
    private String firstLevelCategoryName;//文章一级类别Name(ES:必填)
    private String secondLevelCategoryId;//文章二级类别id(ES:必填)
    private String secondLevelCategoryName;//文章二级类别Name(ES:必填)
    private String operatorId;//文章作者Id(ES:必填)
    private Integer isRead=0;//文章是否已读 0未读,1已读(ES:必填)
    private String articleSource;//文章来源(ES:必填)(备注:医生所属机构名称)
    private List<RoleVo> roleList;//发送者角色List(ES:非必填)(备注:管理员有值,普通医生为空)
    private String leaveWords;//医生留言(ES:非必填)
    //说明:如普通医生推送则保存doctor表中的hospital字段,如管理员推送则保存当前角色的code(取wlyy_user_role表中的role字段)
    private String currentUserRoleCode;//发送者当前登录的角色code(ES:必填)
    private String currentUserRoleLevel;//发送者当前登录的角色级别,1、省,2、市,3、区,4、机构(ES:必填)
    private Integer sendSource; //1或者为空 i健康后台推送  2PC端推送(默认旧数据为1)(为后续平台推送统计做备用字段)
    private Integer allCount;//所有的推送数目(ES:必填)
    private Long readNumber;//阅读数(备注:和浏览数不一样)(不保存ES)
    @Transient
    private Boolean newArricleFlag;//新版文章推送标志(不保存ES)
    @Transient
    private Set<String> openidSet;//本次发送文章的openid的总集合
    //说明:如医生推送文章给5个居民,则保存5条userType=1的记录和1条userType=2的记录(共6条)
    //业务需求:userType=1为居民被推送文章列表;userType=2医生推送的文章列表;
    private Integer userType; // 1、患者,2医生(ES:必填)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date czrq;//阅读时间(默认为空,isRead=0;如isRead=1已读,则该字段有值)(ES:非必填)
    private String openid;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getBatchNo() {
        return batchNo;
    }
    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }
    public String getPatientCode() {
        return patientCode;
    }
    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getSendName() {
        return sendName;
    }
    public void setSendName(String sendName) {
        this.sendName = sendName;
    }
    public String getSendPic() {
        return sendPic;
    }
    public void setSendPic(String sendPic) {
        this.sendPic = sendPic;
    }
    public String getSendSex() {
        return sendSex;
    }
    public void setSendSex(String sendSex) {
        this.sendSex = sendSex;
    }
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    public String getAdminTeamName() {
        return adminTeamName;
    }
    public void setAdminTeamName(String adminTeamName) {
        this.adminTeamName = adminTeamName;
    }
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    public String getTown() {
        return town;
    }
    public void setTown(String town) {
        this.town = town;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getSendType() {
        return sendType;
    }
    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }
    public String getSendLevel() {
        return sendLevel;
    }
    public void setSendLevel(String sendLevel) {
        this.sendLevel = sendLevel;
    }
    public String getArticleId() {
        return articleId;
    }
    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }
    public String getArticleTitle() {
        return articleTitle;
    }
    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }
    public String getArticleCover() {
        return articleCover;
    }
    public void setArticleCover(String articleCover) {
        this.articleCover = articleCover;
    }
    public String getArticleContent() {
        return articleContent;
    }
    public void setArticleContent(String articleContent) {
        this.articleContent = articleContent;
    }
    public String getArticleCategoryId() {
        return articleCategoryId;
    }
    public void setArticleCategoryId(String articleCategoryId) {
        this.articleCategoryId = articleCategoryId;
    }
    public String getFirstLevelCategoryId() {
        return firstLevelCategoryId;
    }
    public void setFirstLevelCategoryId(String firstLevelCategoryId) {
        this.firstLevelCategoryId = firstLevelCategoryId;
    }
    public String getFirstLevelCategoryName() {
        return firstLevelCategoryName;
    }
    public void setFirstLevelCategoryName(String firstLevelCategoryName) {
        this.firstLevelCategoryName = firstLevelCategoryName;
    }
    public String getSecondLevelCategoryId() {
        return secondLevelCategoryId;
    }
    public void setSecondLevelCategoryId(String secondLevelCategoryId) {
        this.secondLevelCategoryId = secondLevelCategoryId;
    }
    public String getSecondLevelCategoryName() {
        return secondLevelCategoryName;
    }
    public void setSecondLevelCategoryName(String secondLevelCategoryName) {
        this.secondLevelCategoryName = secondLevelCategoryName;
    }
    public String getOperatorId() {
        return operatorId;
    }
    public void setOperatorId(String operatorId) {
        this.operatorId = operatorId;
    }
    public Integer getIsRead() {
        return isRead;
    }
    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }
    public String getArticleSource() {
        return articleSource;
    }
    public void setArticleSource(String articleSource) {
        this.articleSource = articleSource;
    }
    public List<RoleVo> getRoleList() {
        return roleList;
    }
    public void setRoleList(List<RoleVo> roleList) {
        this.roleList = roleList;
    }
    public String getLeaveWords() {
        return leaveWords;
    }
    public void setLeaveWords(String leaveWords) {
        this.leaveWords = leaveWords;
    }
    public String getCurrentUserRoleCode() {
        return currentUserRoleCode;
    }
    public void setCurrentUserRoleCode(String currentUserRoleCode) {
        this.currentUserRoleCode = currentUserRoleCode;
    }
    public String getCurrentUserRoleLevel() {
        return currentUserRoleLevel;
    }
    public void setCurrentUserRoleLevel(String currentUserRoleLevel) {
        this.currentUserRoleLevel = currentUserRoleLevel;
    }
    public Integer getSendSource() {
        return sendSource;
    }
    public void setSendSource(Integer sendSource) {
        this.sendSource = sendSource;
    }
    public Integer getAllCount() {
        return allCount;
    }
    public void setAllCount(Integer allCount) {
        this.allCount = allCount;
    }
    public Boolean getNewArricleFlag() {
        return newArricleFlag;
    }
    public void setNewArricleFlag(Boolean newArricleFlag) {
        this.newArricleFlag = newArricleFlag;
    }
    public Integer getUserType() {
        return userType;
    }
    public void setUserType(Integer userType) {
        this.userType = userType;
    }
    public Long getReadNumber() {
        return readNumber;
    }
    public void setReadNumber(Long readNumber) {
        this.readNumber = readNumber;
    }
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
    public HealthEduArticleES() {
    }
    public Set<String> getOpenidSet() {
        return openidSet;
    }
    public void setOpenidSet(Set<String> openidSet) {
        this.openidSet = openidSet;
    }
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    public String getDisease() {
        return disease;
    }
    public void setDisease(String disease) {
        this.disease = disease;
    }
    public Integer getTeamCode() {
        return teamCode;
    }
    public void setTeamCode(Integer teamCode) {
        this.teamCode = teamCode;
    }
}

+ 70 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/HealthEduArticleESResult.java

@ -0,0 +1,70 @@
package com.yihu.rehabilitation.vo.entity;
import java.util.Date;
/**
 * 推送记录表
 * Created by chenweida on 2017/9/7.
 */
public class HealthEduArticleESResult {
    private Double batchCount;
    private Double articleCount;
    private Double addBatchno;
    private Double addCount;
    private String doctorCode;
    private Date createTime;
    public Double getBatchCount() {
        return batchCount;
    }
    public void setBatchCount(Double batchCount) {
        this.batchCount = batchCount;
    }
    public Double getArticleCount() {
        return articleCount;
    }
    public void setArticleCount(Double articleCount) {
        this.articleCount = articleCount;
    }
    public Double getAddBatchno() {
        return addBatchno;
    }
    public void setAddBatchno(Double addBatchno) {
        this.addBatchno = addBatchno;
    }
    public Double getAddCount() {
        return addCount;
    }
    public void setAddCount(Double addCount) {
        this.addCount = addCount;
    }
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 367 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/HealthEduArticlePatient.java

@ -0,0 +1,367 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.patient.Patient;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Transient;
import java.util.Date;
import java.util.List;
/**
 * 推送记录表
 * Created by chenweida on 2017/9/7.
 */
public class HealthEduArticlePatient {
    @JestId
    private String id;
    @Transient
    private String patient; // 患者标识
    @Transient
    private String patientName;    // 患者标识
    private String doctorCode;  //推送的医生code(包括医生本人、卫计委)
    private String doctorName;  //推送的医生名称(包括医生本人、卫计委)
//    private String sendCode;   // 发送人code
    private String sendName;   // 发送人名称
    private String sendPic;   // 发送人头像
    private String sendSex;   // 发送人性别
    private String sendLevel;   // 发送人级别  1专科医生,2全科医生,3健康管理师 4 管理员
    private Integer sendType;//发送类型 1医生发送 2卫纪委发送
    private Long adminTeamCode;// 行政团队
    private String adminTeamName;// 行政团队
    private String hospital; // 所属机构
    private String hospitalName; // 所属机构
    private String town; // 所属区划
    private String townName; // 所属区划
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date createTime;  // 创建时间
    private String batchNo;//批次号记录发送所属批次
    private String articleId;  //文章id
    private String attachedTitle;  //文章标题
    private String attachedPic;//文章封面
    private String attachedContent; //文章内容
    private String attachedMessage; //文章附加文件
    private String articleType;//文章类别
    private String level1Type;//1级类别
    private String level2Type;//2级类别
    private String level;//等级
    private Integer allCount;//所有的推送数目
    private String type;//推送类型 1:文章 2:健康课程
    private String articleUrl;//集美宣教,文章的url
    private List<Patient> patients;//被推送文章的患者
    private String operatorId;//文章作者Id
    private List<RoleVo> roleList;//发送者角色
    private String leaveWords;//医生留言
    private String currentUserRoleCode;//当前登录的角色code
    private String currentUserRoleLevel;//当前登录的角色级别
    private String isread;//1已读,0未读
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
//    public String getSendCode() {
//        return sendCode;
//    }
//
//    public void setSendCode(String sendCode) {
//        this.sendCode = sendCode;
//    }
    public String getSendName() {
        return sendName;
    }
    public void setSendName(String sendName) {
        this.sendName = sendName;
    }
    public Integer getSendType() {
        return sendType;
    }
    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    public String getTown() {
        return town;
    }
    public void setTown(String town) {
        this.town = town;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getBatchNo() {
        return batchNo;
    }
    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }
    public String getArticleId() {
        return articleId;
    }
    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }
    public String getAttachedTitle() {
        return attachedTitle;
    }
    public void setAttachedTitle(String attachedTitle) {
        this.attachedTitle = attachedTitle;
    }
    public String getAttachedPic() {
        return attachedPic;
    }
    public void setAttachedPic(String attachedPic) {
        this.attachedPic = attachedPic;
    }
    public String getAttachedContent() {
        return attachedContent;
    }
    public void setAttachedContent(String attachedContent) {
        this.attachedContent = attachedContent;
    }
    public String getAttachedMessage() {
        return attachedMessage;
    }
    public void setAttachedMessage(String attachedMessage) {
        this.attachedMessage = attachedMessage;
    }
    public String getAdminTeamName() {
        return adminTeamName;
    }
    public void setAdminTeamName(String adminTeamName) {
        this.adminTeamName = adminTeamName;
    }
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
    public String getArticleType() {
        return articleType;
    }
    public void setArticleType(String articleType) {
        this.articleType = articleType;
    }
    public String getLevel1Type() {
        return level1Type;
    }
    public void setLevel1Type(String level1Type) {
        this.level1Type = level1Type;
    }
    public String getLevel2Type() {
        return level2Type;
    }
    public void setLevel2Type(String level2Type) {
        this.level2Type = level2Type;
    }
    public String getLevel() {
        return level;
    }
    public void setLevel(String level) {
        this.level = level;
    }
    public Integer getAllCount() {
        return allCount;
    }
    public void setAllCount(Integer allCount) {
        this.allCount = allCount;
    }
    public String getSendPic() {
        return sendPic;
    }
    public void setSendPic(String sendPic) {
        this.sendPic = sendPic;
    }
    public String getSendSex() {
        return sendSex;
    }
    public void setSendSex(String sendSex) {
        this.sendSex = sendSex;
    }
    public String getSendLevel() {
        return sendLevel;
    }
    public void setSendLevel(String sendLevel) {
        this.sendLevel = sendLevel;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getArticleUrl() {
        return articleUrl;
    }
    public void setArticleUrl(String articleUrl) {
        this.articleUrl = articleUrl;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public List<Patient> getPatients() {
        return patients;
    }
    public void setPatients(List<Patient> patients) {
        this.patients = patients;
    }
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public String getOperatorId() {
        return operatorId;
    }
    public void setOperatorId(String operatorId) {
        this.operatorId = operatorId;
    }
    public List<RoleVo> getRoleList() {
        return roleList;
    }
    public void setRoleList(List<RoleVo> roleList) {
        this.roleList = roleList;
    }
    public String getLeaveWords() {
        return leaveWords;
    }
    public void setLeaveWords(String leaveWords) {
        this.leaveWords = leaveWords;
    }
    public String getCurrentUserRoleCode() {
        return currentUserRoleCode;
    }
    public void setCurrentUserRoleCode(String currentUserRoleCode) {
        this.currentUserRoleCode = currentUserRoleCode;
    }
    public String getCurrentUserRoleLevel() {
        return currentUserRoleLevel;
    }
    public void setCurrentUserRoleLevel(String currentUserRoleLevel) {
        this.currentUserRoleLevel = currentUserRoleLevel;
    }
    
    public String getIsread() {
        return isread;
    }
    
    public void setIsread(String isread) {
        this.isread = isread;
    }
}

+ 232 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/HealthEduArticlePatientDTO.java

@ -0,0 +1,232 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.Transient;
import java.util.Date;
/**
 * 患者健康教育文章
 *
 * @author George
 */
public class HealthEduArticlePatientDTO {
    private String id;
    // 患者标识
    private String patient;
    // 文章标识
    private String article;
    // 医生标识
    private String doctor;
    // 医生姓名
    private String doctorName;
    // 文章标题
    private String title;
    // 文章链接
    private String url;
    // 文章内容
    private String content;
    // 是否已读:0已读,1未读
    private Integer isRead;
    // 发布时间
    private Date czrq;
    // 签约类型 1三师 2家庭
    private Integer signType;
    // 行政团队
    private Long adminTeamCode;
    // 简介
    private String summary;
    //附加内容
    private String attachedContent;
    //批次号记录发送所属批次
    private String batchNo;
    //文章标题
    private String attachedTitle;
    //文章封面
    private String attachedPic;
    //推送类型
    private Integer sendType; //1或者为空 i健康后台推送  2PC端推送
    //签约表code
    private String signCode;
    private Integer articleId;
    private String patientName;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getBatchNo() {
        return batchNo;
    }
    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }
    public String getAttachedContent() {
        return attachedContent;
    }
    public void setAttachedContent(String attachedContent) {
        this.attachedContent = attachedContent;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getArticle() {
        return article;
    }
    public void setArticle(String article) {
        this.article = article;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @Transient
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    @Transient
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    @Transient
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public Integer getIsRead() {
        return isRead;
    }
    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
    public Integer getSignType() {
        return signType;
    }
    public void setSignType(Integer signType) {
        this.signType = signType;
    }
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    @Transient
    public String getSummary() {
        return summary;
    }
    public void setSummary(String summary) {
        this.summary = summary;
    }
    public String getSignCode() {
        return signCode;
    }
    public void setSignCode(String signCode) {
        this.signCode = signCode;
    }
    @Transient
    public Integer getArticleId() {
        return articleId;
    }
    public void setArticleId(Integer articleId) {
        this.articleId = articleId;
    }
    public String getAttachedTitle() {
        return attachedTitle;
    }
    public void setAttachedTitle(String attachedTitle) {
        this.attachedTitle = attachedTitle;
    }
    public String getAttachedPic() {
        return attachedPic;
    }
    public void setAttachedPic(String attachedPic) {
        this.attachedPic = attachedPic;
    }
    public Integer getSendType() {
        return sendType;
    }
    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }
}

+ 100 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/MapDataDTO.java

@ -0,0 +1,100 @@
package com.yihu.rehabilitation.vo.entity;/*
package com.yihu.es.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.elasticsearch.annotations.GeoPointField;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
import java.util.Date;
*/
/**
 * Created by chenweida on 2018/2/12.
 *//*
public class MapDataDTO {
    @JestId
    private String id;
    private String idCard; //设备绑定身份证
    private String deviceSn;//设备SnID
    private Long deviceId;//设备ID 用于区分类型
    @GeoPointField
    private GeoPoint location;//经纬度
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date deviceTime;//设备版定数时间
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date createTime;  // 创建时间(ES:必填)
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getIdcard() {
        return idCard;
    }
    public void setIdcard(String idCard) {
        this.idCard = idCard;
    }
    public String getDeviceSn() {
        return deviceSn;
    }
    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }
    public Long getDeviceId() {
        return deviceId;
    }
    public void setDeviceId(Long deviceId) {
        this.deviceId = deviceId;
    }
    public GeoPoint getLocation() {
        return location;
    }
    public void setLocation(GeoPoint location) {
        this.location = location;
    }
    public Date getDeviceTime() {
        return deviceTime;
    }
    public void setDeviceTime(Date deviceTime) {
        this.deviceTime = deviceTime;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public void setLocation(Double lat, Double lng) {
        GeoPoint geoPoint = new GeoPoint(lat, lng);
        this.location = geoPoint;
    }
}
*/

+ 1173 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/NewbornFamilyVisitRecordES.java

@ -0,0 +1,1173 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 新生儿家庭访视记录表
 * create by hmf on 2019/4/17
 */
public class NewbornFamilyVisitRecordES {
    @JestId
    private String id;
    private String followup_id;             //随访记录ID
    private String followup_project;        //随访详情分类ID
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date create_time;
    private String create_user;
    private String create_user_name;
    private String version;//版本号
    private String SICK_NAME;//儿童姓名
    private Integer HELP_ORGANIZATION_FLAG;//本地外地标志【1本地,2省内 3省外】
    private String PREGNANCY_NO;//妊娠编号
    private String NUMBER_NO;//建册编号
    private String HOME_REMARK;//家庭访视备注
    private String BIRTH_NO;//出生证号
    //第一次随访新生儿家庭基本信息
    private Integer SICK_SEX;//儿童性别(0未知 1男 2 女 9 未说明的性别)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date BIRTHDAY;//出生日期
    private String PERMANENT_RESIDENCE_ADDRESS;//户籍地址
    /******** 母亲信息 ********/
    private String MOTHER_IDENTITY_CARD_NO;//母亲身份证号
    private String MOTHER_ADDRESS;//母亲住址
    private String MOTHER_NAME;//母亲名字
    private String MOTHER_OCCUPATION;//母亲职业
    private String MOTHER_PHONE;//母亲电话
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date MOTHER_BIRTHDAY;//母亲出生日期
    /******** 父亲信息 ********/
    private String FATHER_NAME;//父亲名字
    private String FATHER_OCCUPATION;//父亲职业
    private String FATHER_PHONE;//父亲电话
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date FATHER_BIRTHDAY;//父亲出生日期
    /******** 新生儿信息 ********/
    private Integer BIRTH_PREGNANCY_WEEK;//出生孕周
    private Integer PREGNANCY_SICK;//母亲妊娠期患病情况(1无 2糖尿病  3妊娠期高血压 4其他)
    private String PREGNANCY_SICK_CIRCS;//母亲妊娠期其他患病情况
    private String HELP_ORGANIZATION_NAME;//助产机构名称
    private String HELP_HOSPITAL;//助产机构code(dm_hospital表的code)
    private String HELP_ORGANIZATION;//助产机构mapping_code (智业机构编码)
    private String HELP_OUT_ORGANIZATION;//外地转诊机构
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date DISCHARGED_DATE;//出院日期
    private String DELIVERY_WAY;//出生情况(1顺产 2胎头吸引 3产钳 4剖宫 5双多胎 6臀位 7其他,多个用逗号隔开 )
    private String BIRTH_OTHER;//出生情况-其他内容
    private Integer SUFFOCATION;//新生儿窒息【1无,2有】
    private Integer APGAR_O;//APGAR评分(1分钟)(1否 2是)
    private Integer APGAR_F;//APGAR评分(5分钟)(1否 2是)
    private Integer APGAR_N;//APGAR评分(不详)(1否 2是)
    private String BLESSEDEVENT_MEDICAL_HISTORY;// 新生儿期病史
    private Integer PLAN_IMMUNE;//计划免疫情况(1卡介苗 2乙肝疫苗 3以上两种 4未种 )
    private Double BLESSEDEVENT_BIRTH_WEIGHT;//新生儿出生体重,kg
    private Double BIRTH_BODY_LENGTH;//出生身长 cm
    private Integer DEFORMITY_NULL;//畸形异常(1无2有)
    /******** 新生儿疾病筛查 ********/
    private Integer SCREENING_1;//新生儿疾病筛查-甲低【1是,0否】
    private Integer SCREENING_2;//新生儿疾病筛查-苯丙酮尿症【1是,0否】
    private Integer SCREENING_3;//新生儿疾病筛查-其他遗传代谢病【1是,0否】
    private String SCREENING_ABNORMAL;//新生儿疾病筛查-其他遗传代谢病-内容
    private Integer SCREENING_4;//新生儿疾病筛查-未进行【1是,0否】
    private Integer SCREENING_5;//新生儿疾病筛查-检查均阴性【1是,0否】
    private Integer SCREENING_6;//新生儿疾病筛查-已查无结果【1是,0否】
    private Integer HEARING;//新生儿听力筛查(1通过 2未通过 3未筛查 4 不详 5已查无结果)
    private Double NOW_WEIGHT; //现在体重 kg
    private Integer FEED_TYPE;//喂奶方式【1纯母乳,2混合,3人工】
    private Integer EAT_MILE_TIME;//吃奶次数 次/日
    private Double EAT_MILE_AMOUNT;//吃奶量ml/次
    private Integer VOMIT;//呕吐【1无,2有】
    private Integer VULNUS;//大便【1糊状,2稀 3其他】
    private String VULNUS_OTHER;//大便其他说明
    private String VULNUS_TIME;//大便次数
    private Double BODY_TEMPERATURE;//体温
    private String PULSE_FREQUENCY;//心率 次/分钟
    private String BREATH_FREQUENCY;//呼吸频率 次/分钟
    private Integer COMPLEXION;//面色【1红润,2黄染,3其他】
    private String COMPLEXION_NULL;//面色异常表现
    private Integer FACE;//黄疸部位-面部
    private Integer TRUNK;//黄疸部位-躯干【1有,0无】
    private Integer LIMB;//黄疸部位-四肢【1是,0否】
    private Integer EXTREMITY;//黄疸部位-手足 【1是,0否】
    private Double BREGMA_FRONT;//前囟1 CM
    private Double BREGMA_BACK;//前囟2 CM
    private String BREGMA_PERFORMANCE;//前囟 其他表现
    private Integer BREGMA;//前囟 单选【1正常,2膨隆,3凹陷,4其他】
    private Integer EYE;//眼外观【1未见异常,2异常】
    private String EYE_NULL;//眼外观异常
    private Integer EAR;//耳外观异常【1未见异常,2异常】
    private String EAR_FACE;//耳外观
    private Integer LIMBS;//四肢活动度异常【1未见异常,2异常】
    private String LIMBS_NULL;//四肢活动度异常说明
    private Integer NECK_PACK;//颈部包块【1无,2有】
    private String NECK_PACK_NULL;//颈部包块异常说明
    private Integer NOSE;//鼻【1未见异常,2异常】
    private String NOSE_PERFORMANCE;//鼻异常说明
    private Integer ORAL;//口腔【1未见异常,2异常】
    private String ORAL_PERFORMANCE;//口腔异常
    private Integer ABDOMEN;//腹部触诊异常【1未见异常,2异常】
    private String ABDOMEN_NULL;//腹部触诊
    private Integer GENITALIA;//外生殖器异常【1未见异常,2异常】
    private String GENITALIA_NULL;//外生殖器
    private Integer VERTEBRAL;//脊柱异常【1未见异常,2异常】
    private String VERTEBRAL_NULL;//脊柱
    private Integer SKIN;//皮肤【1未见异常,2湿疹,3糜烂,4其他】
    private String SKIN_PERFORMANCE;//皮肤异常
    private Integer ANUS;//肛门【1未见异常,2异常】
    private String ANUS_PERFORMANCE;//肛门异常说明
    private Integer HEART;//心肺听诊【1未见异常,2异常】
    private String HEART_PERFORMANCE;//心肺听诊异常
    private Integer UMBILICAL;//脐带(1未脱落 2脱落 3脐带有渗出 4 其他)
    private String UMBILICAL_NULL;//脐带异常
    private String other;//其他
    private Integer referral;//转诊建议(1有,0无)
    private String referral_reason;//转诊建议(原因)
    private String organization_org;//转诊机构(智业机构code)
    private String organization_org_name;//转诊机构名称
    private String organization_hospital;//转诊机构code(dm_hospital表的code)
    private String organization;//转诊科室
    /******** 指导 ********/
    private Integer FEED_GUID ;//喂养指导【1有,0无】
    private Integer PREVENTION_HURT_GUID;//预防伤害指导【1有,0无】
    private Integer ORAL_CAVITY_GUID;//口腔保健指导【1有,0无】
    private Integer GROWUP_GUID;//发育指导【1是,0否】
    private Integer PREVENTION_DEFORMITY_GUID;//防残指导【1是,0否】
    private Integer OTHER_GUIDE;//其他指导
    private String OTHER_GUIDE_CONTENT;//其他指导内容
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date THIS_INTERVIEW_DATE;//本次访视日期
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date NEXT_VISITING_DATE;//下次随访日期
    private String  NEXT_VISITING_ADDRESS;//下次随访地点
    private String VISITING_DOCTOR;//随访医生
    private String FAMILY_SIGN;//签字家属
    //智业多余字段
    private String ORG_ID;//随访机构
    private String PHYSICLAL_STATUS;//两次访视间患者情况
    private String IDENTITY_CARD_NO;//身份证号
    private Integer IS_CHILD_WEAK;//是否高危儿
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getFollowup_id() {
        return followup_id;
    }
    public void setFollowup_id(String followup_id) {
        this.followup_id = followup_id;
    }
    public String getFollowup_project() {
        return followup_project;
    }
    public void setFollowup_project(String followup_project) {
        this.followup_project = followup_project;
    }
    public Date getCreate_time() {
        return create_time;
    }
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
    public String getCreate_user() {
        return create_user;
    }
    public void setCreate_user(String create_user) {
        this.create_user = create_user;
    }
    public String getCreate_user_name() {
        return create_user_name;
    }
    public void setCreate_user_name(String create_user_name) {
        this.create_user_name = create_user_name;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    public String getSICK_NAME() {
        return SICK_NAME;
    }
    public void setSICK_NAME(String SICK_NAME) {
        this.SICK_NAME = SICK_NAME;
    }
    public Integer getHELP_ORGANIZATION_FLAG() {
        return HELP_ORGANIZATION_FLAG;
    }
    public void setHELP_ORGANIZATION_FLAG(Integer HELP_ORGANIZATION_FLAG) {
        this.HELP_ORGANIZATION_FLAG = HELP_ORGANIZATION_FLAG;
    }
    public String getPREGNANCY_NO() {
        return PREGNANCY_NO;
    }
    public void setPREGNANCY_NO(String PREGNANCY_NO) {
        this.PREGNANCY_NO = PREGNANCY_NO;
    }
    public String getNUMBER_NO() {
        return NUMBER_NO;
    }
    public void setNUMBER_NO(String NUMBER_NO) {
        this.NUMBER_NO = NUMBER_NO;
    }
    public String getHOME_REMARK() {
        return HOME_REMARK;
    }
    public void setHOME_REMARK(String HOME_REMARK) {
        this.HOME_REMARK = HOME_REMARK;
    }
    public String getBIRTH_NO() {
        return BIRTH_NO;
    }
    public void setBIRTH_NO(String BIRTH_NO) {
        this.BIRTH_NO = BIRTH_NO;
    }
    public Integer getSICK_SEX() {
        return SICK_SEX;
    }
    public void setSICK_SEX(Integer SICK_SEX) {
        this.SICK_SEX = SICK_SEX;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getBIRTHDAY() {
        return BIRTHDAY;
    }
    public void setBIRTHDAY(Date BIRTHDAY) {
        this.BIRTHDAY = BIRTHDAY;
    }
    public String getPERMANENT_RESIDENCE_ADDRESS() {
        return PERMANENT_RESIDENCE_ADDRESS;
    }
    public void setPERMANENT_RESIDENCE_ADDRESS(String PERMANENT_RESIDENCE_ADDRESS) {
        this.PERMANENT_RESIDENCE_ADDRESS = PERMANENT_RESIDENCE_ADDRESS;
    }
    public String getMOTHER_IDENTITY_CARD_NO() {
        return MOTHER_IDENTITY_CARD_NO;
    }
    public void setMOTHER_IDENTITY_CARD_NO(String MOTHER_IDENTITY_CARD_NO) {
        this.MOTHER_IDENTITY_CARD_NO = MOTHER_IDENTITY_CARD_NO;
    }
    public String getMOTHER_ADDRESS() {
        return MOTHER_ADDRESS;
    }
    public void setMOTHER_ADDRESS(String MOTHER_ADDRESS) {
        this.MOTHER_ADDRESS = MOTHER_ADDRESS;
    }
    public String getMOTHER_NAME() {
        return MOTHER_NAME;
    }
    public void setMOTHER_NAME(String MOTHER_NAME) {
        this.MOTHER_NAME = MOTHER_NAME;
    }
    public String getMOTHER_OCCUPATION() {
        return MOTHER_OCCUPATION;
    }
    public void setMOTHER_OCCUPATION(String MOTHER_OCCUPATION) {
        this.MOTHER_OCCUPATION = MOTHER_OCCUPATION;
    }
    public String getMOTHER_PHONE() {
        return MOTHER_PHONE;
    }
    public void setMOTHER_PHONE(String MOTHER_PHONE) {
        this.MOTHER_PHONE = MOTHER_PHONE;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getMOTHER_BIRTHDAY() {
        return MOTHER_BIRTHDAY;
    }
    public void setMOTHER_BIRTHDAY(Date MOTHER_BIRTHDAY) {
        this.MOTHER_BIRTHDAY = MOTHER_BIRTHDAY;
    }
    public String getFATHER_NAME() {
        return FATHER_NAME;
    }
    public void setFATHER_NAME(String FATHER_NAME) {
        this.FATHER_NAME = FATHER_NAME;
    }
    public String getFATHER_OCCUPATION() {
        return FATHER_OCCUPATION;
    }
    public void setFATHER_OCCUPATION(String FATHER_OCCUPATION) {
        this.FATHER_OCCUPATION = FATHER_OCCUPATION;
    }
    public String getFATHER_PHONE() {
        return FATHER_PHONE;
    }
    public void setFATHER_PHONE(String FATHER_PHONE) {
        this.FATHER_PHONE = FATHER_PHONE;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getFATHER_BIRTHDAY() {
        return FATHER_BIRTHDAY;
    }
    public void setFATHER_BIRTHDAY(Date FATHER_BIRTHDAY) {
        this.FATHER_BIRTHDAY = FATHER_BIRTHDAY;
    }
    public Integer getBIRTH_PREGNANCY_WEEK() {
        return BIRTH_PREGNANCY_WEEK;
    }
    public void setBIRTH_PREGNANCY_WEEK(Integer BIRTH_PREGNANCY_WEEK) {
        this.BIRTH_PREGNANCY_WEEK = BIRTH_PREGNANCY_WEEK;
    }
    public Integer getPREGNANCY_SICK() {
        return PREGNANCY_SICK;
    }
    public void setPREGNANCY_SICK(Integer PREGNANCY_SICK) {
        this.PREGNANCY_SICK = PREGNANCY_SICK;
    }
    public String getPREGNANCY_SICK_CIRCS() {
        return PREGNANCY_SICK_CIRCS;
    }
    public void setPREGNANCY_SICK_CIRCS(String PREGNANCY_SICK_CIRCS) {
        this.PREGNANCY_SICK_CIRCS = PREGNANCY_SICK_CIRCS;
    }
    public String getHELP_ORGANIZATION_NAME() {
        return HELP_ORGANIZATION_NAME;
    }
    public void setHELP_ORGANIZATION_NAME(String HELP_ORGANIZATION_NAME) {
        this.HELP_ORGANIZATION_NAME = HELP_ORGANIZATION_NAME;
    }
    public String getHELP_HOSPITAL() {
        return HELP_HOSPITAL;
    }
    public void setHELP_HOSPITAL(String HELP_HOSPITAL) {
        this.HELP_HOSPITAL = HELP_HOSPITAL;
    }
    public String getHELP_ORGANIZATION() {
        return HELP_ORGANIZATION;
    }
    public void setHELP_ORGANIZATION(String HELP_ORGANIZATION) {
        this.HELP_ORGANIZATION = HELP_ORGANIZATION;
    }
    public String getHELP_OUT_ORGANIZATION() {
        return HELP_OUT_ORGANIZATION;
    }
    public void setHELP_OUT_ORGANIZATION(String HELP_OUT_ORGANIZATION) {
        this.HELP_OUT_ORGANIZATION = HELP_OUT_ORGANIZATION;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getDISCHARGED_DATE() {
        return DISCHARGED_DATE;
    }
    public void setDISCHARGED_DATE(Date DISCHARGED_DATE) {
        this.DISCHARGED_DATE = DISCHARGED_DATE;
    }
    public String getDELIVERY_WAY() {
        return DELIVERY_WAY;
    }
    public void setDELIVERY_WAY(String DELIVERY_WAY) {
        this.DELIVERY_WAY = DELIVERY_WAY;
    }
    public String getBIRTH_OTHER() {
        return BIRTH_OTHER;
    }
    public void setBIRTH_OTHER(String BIRTH_OTHER) {
        this.BIRTH_OTHER = BIRTH_OTHER;
    }
    public Integer getSUFFOCATION() {
        return SUFFOCATION;
    }
    public void setSUFFOCATION(Integer SUFFOCATION) {
        this.SUFFOCATION = SUFFOCATION;
    }
    public Integer getAPGAR_O() {
        return APGAR_O;
    }
    public void setAPGAR_O(Integer APGAR_O) {
        this.APGAR_O = APGAR_O;
    }
    public Integer getAPGAR_F() {
        return APGAR_F;
    }
    public void setAPGAR_F(Integer APGAR_F) {
        this.APGAR_F = APGAR_F;
    }
    public Integer getAPGAR_N() {
        return APGAR_N;
    }
    public void setAPGAR_N(Integer APGAR_N) {
        this.APGAR_N = APGAR_N;
    }
    public String getBLESSEDEVENT_MEDICAL_HISTORY() {
        return BLESSEDEVENT_MEDICAL_HISTORY;
    }
    public void setBLESSEDEVENT_MEDICAL_HISTORY(String BLESSEDEVENT_MEDICAL_HISTORY) {
        this.BLESSEDEVENT_MEDICAL_HISTORY = BLESSEDEVENT_MEDICAL_HISTORY;
    }
    public Integer getPLAN_IMMUNE() {
        return PLAN_IMMUNE;
    }
    public void setPLAN_IMMUNE(Integer PLAN_IMMUNE) {
        this.PLAN_IMMUNE = PLAN_IMMUNE;
    }
    public Double getBLESSEDEVENT_BIRTH_WEIGHT() {
        return BLESSEDEVENT_BIRTH_WEIGHT;
    }
    public void setBLESSEDEVENT_BIRTH_WEIGHT(Double BLESSEDEVENT_BIRTH_WEIGHT) {
        this.BLESSEDEVENT_BIRTH_WEIGHT = BLESSEDEVENT_BIRTH_WEIGHT;
    }
    public Double getBIRTH_BODY_LENGTH() {
        return BIRTH_BODY_LENGTH;
    }
    public void setBIRTH_BODY_LENGTH(Double BIRTH_BODY_LENGTH) {
        this.BIRTH_BODY_LENGTH = BIRTH_BODY_LENGTH;
    }
    public Integer getDEFORMITY_NULL() {
        return DEFORMITY_NULL;
    }
    public void setDEFORMITY_NULL(Integer DEFORMITY_NULL) {
        this.DEFORMITY_NULL = DEFORMITY_NULL;
    }
    public Integer getSCREENING_1() {
        return SCREENING_1;
    }
    public void setSCREENING_1(Integer SCREENING_1) {
        this.SCREENING_1 = SCREENING_1;
    }
    public Integer getSCREENING_2() {
        return SCREENING_2;
    }
    public void setSCREENING_2(Integer SCREENING_2) {
        this.SCREENING_2 = SCREENING_2;
    }
    public Integer getSCREENING_3() {
        return SCREENING_3;
    }
    public void setSCREENING_3(Integer SCREENING_3) {
        this.SCREENING_3 = SCREENING_3;
    }
    public String getSCREENING_ABNORMAL() {
        return SCREENING_ABNORMAL;
    }
    public void setSCREENING_ABNORMAL(String SCREENING_ABNORMAL) {
        this.SCREENING_ABNORMAL = SCREENING_ABNORMAL;
    }
    public Integer getSCREENING_4() {
        return SCREENING_4;
    }
    public void setSCREENING_4(Integer SCREENING_4) {
        this.SCREENING_4 = SCREENING_4;
    }
    public Integer getSCREENING_5() {
        return SCREENING_5;
    }
    public void setSCREENING_5(Integer SCREENING_5) {
        this.SCREENING_5 = SCREENING_5;
    }
    public Integer getSCREENING_6() {
        return SCREENING_6;
    }
    public void setSCREENING_6(Integer SCREENING_6) {
        this.SCREENING_6 = SCREENING_6;
    }
    public Integer getHEARING() {
        return HEARING;
    }
    public void setHEARING(Integer HEARING) {
        this.HEARING = HEARING;
    }
    public Double getNOW_WEIGHT() {
        return NOW_WEIGHT;
    }
    public void setNOW_WEIGHT(Double NOW_WEIGHT) {
        this.NOW_WEIGHT = NOW_WEIGHT;
    }
    public Integer getFEED_TYPE() {
        return FEED_TYPE;
    }
    public void setFEED_TYPE(Integer FEED_TYPE) {
        this.FEED_TYPE = FEED_TYPE;
    }
    public Integer getEAT_MILE_TIME() {
        return EAT_MILE_TIME;
    }
    public void setEAT_MILE_TIME(Integer EAT_MILE_TIME) {
        this.EAT_MILE_TIME = EAT_MILE_TIME;
    }
    public Double getEAT_MILE_AMOUNT() {
        return EAT_MILE_AMOUNT;
    }
    public void setEAT_MILE_AMOUNT(Double EAT_MILE_AMOUNT) {
        this.EAT_MILE_AMOUNT = EAT_MILE_AMOUNT;
    }
    public Integer getVOMIT() {
        return VOMIT;
    }
    public void setVOMIT(Integer VOMIT) {
        this.VOMIT = VOMIT;
    }
    public Integer getVULNUS() {
        return VULNUS;
    }
    public void setVULNUS(Integer VULNUS) {
        this.VULNUS = VULNUS;
    }
    public String getVULNUS_OTHER() {
        return VULNUS_OTHER;
    }
    public void setVULNUS_OTHER(String VULNUS_OTHER) {
        this.VULNUS_OTHER = VULNUS_OTHER;
    }
    public String getVULNUS_TIME() {
        return VULNUS_TIME;
    }
    public void setVULNUS_TIME(String VULNUS_TIME) {
        this.VULNUS_TIME = VULNUS_TIME;
    }
    public Double getBODY_TEMPERATURE() {
        return BODY_TEMPERATURE;
    }
    public void setBODY_TEMPERATURE(Double BODY_TEMPERATURE) {
        this.BODY_TEMPERATURE = BODY_TEMPERATURE;
    }
    public String getPULSE_FREQUENCY() {
        return PULSE_FREQUENCY;
    }
    public void setPULSE_FREQUENCY(String PULSE_FREQUENCY) {
        this.PULSE_FREQUENCY = PULSE_FREQUENCY;
    }
    public String getBREATH_FREQUENCY() {
        return BREATH_FREQUENCY;
    }
    public void setBREATH_FREQUENCY(String BREATH_FREQUENCY) {
        this.BREATH_FREQUENCY = BREATH_FREQUENCY;
    }
    public Integer getCOMPLEXION() {
        return COMPLEXION;
    }
    public void setCOMPLEXION(Integer COMPLEXION) {
        this.COMPLEXION = COMPLEXION;
    }
    public String getCOMPLEXION_NULL() {
        return COMPLEXION_NULL;
    }
    public void setCOMPLEXION_NULL(String COMPLEXION_NULL) {
        this.COMPLEXION_NULL = COMPLEXION_NULL;
    }
    public Integer getFACE() {
        return FACE;
    }
    public void setFACE(Integer FACE) {
        this.FACE = FACE;
    }
    public Integer getTRUNK() {
        return TRUNK;
    }
    public void setTRUNK(Integer TRUNK) {
        this.TRUNK = TRUNK;
    }
    public Integer getLIMB() {
        return LIMB;
    }
    public void setLIMB(Integer LIMB) {
        this.LIMB = LIMB;
    }
    public Integer getEXTREMITY() {
        return EXTREMITY;
    }
    public void setEXTREMITY(Integer EXTREMITY) {
        this.EXTREMITY = EXTREMITY;
    }
    public Double getBREGMA_FRONT() {
        return BREGMA_FRONT;
    }
    public void setBREGMA_FRONT(Double BREGMA_FRONT) {
        this.BREGMA_FRONT = BREGMA_FRONT;
    }
    public Double getBREGMA_BACK() {
        return BREGMA_BACK;
    }
    public void setBREGMA_BACK(Double BREGMA_BACK) {
        this.BREGMA_BACK = BREGMA_BACK;
    }
    public String getBREGMA_PERFORMANCE() {
        return BREGMA_PERFORMANCE;
    }
    public void setBREGMA_PERFORMANCE(String BREGMA_PERFORMANCE) {
        this.BREGMA_PERFORMANCE = BREGMA_PERFORMANCE;
    }
    public Integer getBREGMA() {
        return BREGMA;
    }
    public void setBREGMA(Integer BREGMA) {
        this.BREGMA = BREGMA;
    }
    public Integer getEYE() {
        return EYE;
    }
    public void setEYE(Integer EYE) {
        this.EYE = EYE;
    }
    public String getEYE_NULL() {
        return EYE_NULL;
    }
    public void setEYE_NULL(String EYE_NULL) {
        this.EYE_NULL = EYE_NULL;
    }
    public Integer getEAR() {
        return EAR;
    }
    public void setEAR(Integer EAR) {
        this.EAR = EAR;
    }
    public String getEAR_FACE() {
        return EAR_FACE;
    }
    public void setEAR_FACE(String EAR_FACE) {
        this.EAR_FACE = EAR_FACE;
    }
    public Integer getLIMBS() {
        return LIMBS;
    }
    public void setLIMBS(Integer LIMBS) {
        this.LIMBS = LIMBS;
    }
    public String getLIMBS_NULL() {
        return LIMBS_NULL;
    }
    public void setLIMBS_NULL(String LIMBS_NULL) {
        this.LIMBS_NULL = LIMBS_NULL;
    }
    public Integer getNECK_PACK() {
        return NECK_PACK;
    }
    public void setNECK_PACK(Integer NECK_PACK) {
        this.NECK_PACK = NECK_PACK;
    }
    public String getNECK_PACK_NULL() {
        return NECK_PACK_NULL;
    }
    public void setNECK_PACK_NULL(String NECK_PACK_NULL) {
        this.NECK_PACK_NULL = NECK_PACK_NULL;
    }
    public Integer getNOSE() {
        return NOSE;
    }
    public void setNOSE(Integer NOSE) {
        this.NOSE = NOSE;
    }
    public String getNOSE_PERFORMANCE() {
        return NOSE_PERFORMANCE;
    }
    public void setNOSE_PERFORMANCE(String NOSE_PERFORMANCE) {
        this.NOSE_PERFORMANCE = NOSE_PERFORMANCE;
    }
    public Integer getORAL() {
        return ORAL;
    }
    public void setORAL(Integer ORAL) {
        this.ORAL = ORAL;
    }
    public String getORAL_PERFORMANCE() {
        return ORAL_PERFORMANCE;
    }
    public void setORAL_PERFORMANCE(String ORAL_PERFORMANCE) {
        this.ORAL_PERFORMANCE = ORAL_PERFORMANCE;
    }
    public Integer getABDOMEN() {
        return ABDOMEN;
    }
    public void setABDOMEN(Integer ABDOMEN) {
        this.ABDOMEN = ABDOMEN;
    }
    public String getABDOMEN_NULL() {
        return ABDOMEN_NULL;
    }
    public void setABDOMEN_NULL(String ABDOMEN_NULL) {
        this.ABDOMEN_NULL = ABDOMEN_NULL;
    }
    public Integer getGENITALIA() {
        return GENITALIA;
    }
    public void setGENITALIA(Integer GENITALIA) {
        this.GENITALIA = GENITALIA;
    }
    public String getGENITALIA_NULL() {
        return GENITALIA_NULL;
    }
    public void setGENITALIA_NULL(String GENITALIA_NULL) {
        this.GENITALIA_NULL = GENITALIA_NULL;
    }
    public Integer getVERTEBRAL() {
        return VERTEBRAL;
    }
    public void setVERTEBRAL(Integer VERTEBRAL) {
        this.VERTEBRAL = VERTEBRAL;
    }
    public String getVERTEBRAL_NULL() {
        return VERTEBRAL_NULL;
    }
    public void setVERTEBRAL_NULL(String VERTEBRAL_NULL) {
        this.VERTEBRAL_NULL = VERTEBRAL_NULL;
    }
    public Integer getSKIN() {
        return SKIN;
    }
    public void setSKIN(Integer SKIN) {
        this.SKIN = SKIN;
    }
    public String getSKIN_PERFORMANCE() {
        return SKIN_PERFORMANCE;
    }
    public void setSKIN_PERFORMANCE(String SKIN_PERFORMANCE) {
        this.SKIN_PERFORMANCE = SKIN_PERFORMANCE;
    }
    public Integer getANUS() {
        return ANUS;
    }
    public void setANUS(Integer ANUS) {
        this.ANUS = ANUS;
    }
    public String getANUS_PERFORMANCE() {
        return ANUS_PERFORMANCE;
    }
    public void setANUS_PERFORMANCE(String ANUS_PERFORMANCE) {
        this.ANUS_PERFORMANCE = ANUS_PERFORMANCE;
    }
    public Integer getHEART() {
        return HEART;
    }
    public void setHEART(Integer HEART) {
        this.HEART = HEART;
    }
    public String getHEART_PERFORMANCE() {
        return HEART_PERFORMANCE;
    }
    public void setHEART_PERFORMANCE(String HEART_PERFORMANCE) {
        this.HEART_PERFORMANCE = HEART_PERFORMANCE;
    }
    public Integer getUMBILICAL() {
        return UMBILICAL;
    }
    public void setUMBILICAL(Integer UMBILICAL) {
        this.UMBILICAL = UMBILICAL;
    }
    public String getUMBILICAL_NULL() {
        return UMBILICAL_NULL;
    }
    public void setUMBILICAL_NULL(String UMBILICAL_NULL) {
        this.UMBILICAL_NULL = UMBILICAL_NULL;
    }
    public String getOther() {
        return other;
    }
    public void setOther(String other) {
        this.other = other;
    }
    public Integer getReferral() {
        return referral;
    }
    public void setReferral(Integer referral) {
        this.referral = referral;
    }
    public String getReferral_reason() {
        return referral_reason;
    }
    public void setReferral_reason(String referral_reason) {
        this.referral_reason = referral_reason;
    }
    public String getOrganization_org() {
        return organization_org;
    }
    public void setOrganization_org(String organization_org) {
        this.organization_org = organization_org;
    }
    public String getOrganization_org_name() {
        return organization_org_name;
    }
    public void setOrganization_org_name(String organization_org_name) {
        this.organization_org_name = organization_org_name;
    }
    public String getOrganization_hospital() {
        return organization_hospital;
    }
    public void setOrganization_hospital(String organization_hospital) {
        this.organization_hospital = organization_hospital;
    }
    public String getOrganization() {
        return organization;
    }
    public void setOrganization(String organization) {
        this.organization = organization;
    }
    public Integer getFEED_GUID() {
        return FEED_GUID;
    }
    public void setFEED_GUID(Integer FEED_GUID) {
        this.FEED_GUID = FEED_GUID;
    }
    public Integer getPREVENTION_HURT_GUID() {
        return PREVENTION_HURT_GUID;
    }
    public void setPREVENTION_HURT_GUID(Integer PREVENTION_HURT_GUID) {
        this.PREVENTION_HURT_GUID = PREVENTION_HURT_GUID;
    }
    public Integer getORAL_CAVITY_GUID() {
        return ORAL_CAVITY_GUID;
    }
    public void setORAL_CAVITY_GUID(Integer ORAL_CAVITY_GUID) {
        this.ORAL_CAVITY_GUID = ORAL_CAVITY_GUID;
    }
    public Integer getGROWUP_GUID() {
        return GROWUP_GUID;
    }
    public void setGROWUP_GUID(Integer GROWUP_GUID) {
        this.GROWUP_GUID = GROWUP_GUID;
    }
    public Integer getPREVENTION_DEFORMITY_GUID() {
        return PREVENTION_DEFORMITY_GUID;
    }
    public void setPREVENTION_DEFORMITY_GUID(Integer PREVENTION_DEFORMITY_GUID) {
        this.PREVENTION_DEFORMITY_GUID = PREVENTION_DEFORMITY_GUID;
    }
    public Integer getOTHER_GUIDE() {
        return OTHER_GUIDE;
    }
    public void setOTHER_GUIDE(Integer OTHER_GUIDE) {
        this.OTHER_GUIDE = OTHER_GUIDE;
    }
    public String getOTHER_GUIDE_CONTENT() {
        return OTHER_GUIDE_CONTENT;
    }
    public void setOTHER_GUIDE_CONTENT(String OTHER_GUIDE_CONTENT) {
        this.OTHER_GUIDE_CONTENT = OTHER_GUIDE_CONTENT;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getTHIS_INTERVIEW_DATE() {
        return THIS_INTERVIEW_DATE;
    }
    public void setTHIS_INTERVIEW_DATE(Date THIS_INTERVIEW_DATE) {
        this.THIS_INTERVIEW_DATE = THIS_INTERVIEW_DATE;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getNEXT_VISITING_DATE() {
        return NEXT_VISITING_DATE;
    }
    public void setNEXT_VISITING_DATE(Date NEXT_VISITING_DATE) {
        this.NEXT_VISITING_DATE = NEXT_VISITING_DATE;
    }
    public String getNEXT_VISITING_ADDRESS() {
        return NEXT_VISITING_ADDRESS;
    }
    public void setNEXT_VISITING_ADDRESS(String NEXT_VISITING_ADDRESS) {
        this.NEXT_VISITING_ADDRESS = NEXT_VISITING_ADDRESS;
    }
    public String getVISITING_DOCTOR() {
        return VISITING_DOCTOR;
    }
    public void setVISITING_DOCTOR(String VISITING_DOCTOR) {
        this.VISITING_DOCTOR = VISITING_DOCTOR;
    }
    public String getFAMILY_SIGN() {
        return FAMILY_SIGN;
    }
    public void setFAMILY_SIGN(String FAMILY_SIGN) {
        this.FAMILY_SIGN = FAMILY_SIGN;
    }
    public String getORG_ID() {
        return ORG_ID;
    }
    public void setORG_ID(String ORG_ID) {
        this.ORG_ID = ORG_ID;
    }
    public String getPHYSICLAL_STATUS() {
        return PHYSICLAL_STATUS;
    }
    public void setPHYSICLAL_STATUS(String PHYSICLAL_STATUS) {
        this.PHYSICLAL_STATUS = PHYSICLAL_STATUS;
    }
    public String getIDENTITY_CARD_NO() {
        return IDENTITY_CARD_NO;
    }
    public void setIDENTITY_CARD_NO(String IDENTITY_CARD_NO) {
        this.IDENTITY_CARD_NO = IDENTITY_CARD_NO;
    }
    public Integer getIS_CHILD_WEAK() {
        return IS_CHILD_WEAK;
    }
    public void setIS_CHILD_WEAK(Integer IS_CHILD_WEAK) {
        this.IS_CHILD_WEAK = IS_CHILD_WEAK;
    }
}

+ 155 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/OldPeopleSelfcareAbilityAssessmentEs.java

@ -0,0 +1,155 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 老人自理能力评估内容表
 * create by hmf on 2019/4/18
 */
public class OldPeopleSelfcareAbilityAssessmentEs {
    @JestId
    private String id;
    private String followup_id;             //随访记录ID
    private String followup_project;        //随访详情分类ID
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date create_time;
    private String create_user;
    private String create_user_name;
    private String number;//评估编号
    private String doctorName;//评估医生
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date assessment_time;//评估日期
    private Integer eat;//进餐(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分)
    private Integer wash;//梳洗(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分
    private Integer dress;//穿衣(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分
    private Integer toilet;//如厕(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分
    private Integer activity;//活动(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分
    private Integer score;//总评分
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getFollowup_id() {
        return followup_id;
    }
    public void setFollowup_id(String followup_id) {
        this.followup_id = followup_id;
    }
    public String getFollowup_project() {
        return followup_project;
    }
    public void setFollowup_project(String followup_project) {
        this.followup_project = followup_project;
    }
    public Date getCreate_time() {
        return create_time;
    }
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
    public String getCreate_user() {
        return create_user;
    }
    public void setCreate_user(String create_user) {
        this.create_user = create_user;
    }
    public String getCreate_user_name() {
        return create_user_name;
    }
    public void setCreate_user_name(String create_user_name) {
        this.create_user_name = create_user_name;
    }
    public String getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public Date getAssessment_time() {
        return assessment_time;
    }
    public void setAssessment_time(Date assessment_time) {
        this.assessment_time = assessment_time;
    }
    public Integer getEat() {
        return eat;
    }
    public void setEat(Integer eat) {
        this.eat = eat;
    }
    public Integer getWash() {
        return wash;
    }
    public void setWash(Integer wash) {
        this.wash = wash;
    }
    public Integer getDress() {
        return dress;
    }
    public void setDress(Integer dress) {
        this.dress = dress;
    }
    public Integer getToilet() {
        return toilet;
    }
    public void setToilet(Integer toilet) {
        this.toilet = toilet;
    }
    public Integer getActivity() {
        return activity;
    }
    public void setActivity(Integer activity) {
        this.activity = activity;
    }
    public Integer getScore() {
        return score;
    }
    public void setScore(Integer score) {
        this.score = score;
    }
}

+ 2543 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/OlderPeopleHealthCheckRecordES.java

@ -0,0 +1,2543 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 老年人健康体检随访记录表
 * create by hmf on 2019/4/18
 */
@Data
public class OlderPeopleHealthCheckRecordES {
    @JestId
    private String id;
    private String followup_id;             //随访记录ID
    private String followup_project;        //随访详情分类ID
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date create_time;
    private String create_user;
    private String create_user_name;
    private String version;//版本号
    private String name;//老人姓名
    private String idcard;//身份证
    private String number;//体检编号
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date duty;//体检日期
    private String responsibility_doctor_name;//责任医生
    /**********  症状  **********/
    private String symptom;//症状,多个用逗号隔开(1无症状 2头痛 3头晕 4心悸 5胸闷 6胸痛 7慢性咳嗽 8咳痰 9呼吸困难 10多饮
    // 11多尿 12体重下降 13乏力 14 关节肿痛 15视力模糊 16手脚麻木 17尿急 18尿痛 19便秘 20腹泻 21恶心呕吐 22眼花 23 耳鸣 24乳房胀痛 25其他)
    private String symptom_other;//其他症状说明
    /**********  一般情况  **********/
    private Double temperature;//体温
    private String pulse_frequency;//心率 次/分钟
    private String breath_frequency;//呼吸频率 次/分钟
    private Integer blood_pressure_left_low;//血压左侧低值
    private Integer blood_pressure_left_high;//血压左侧高值
    private Integer blood_pressure_right_low;//血压右侧低值
    private Integer blood_pressure_right_high;//血压右侧高值
    private Double height;//身高,cm
    private Double weight;//体重,kg
    private Double waistline;//腰围,cm
    private Double BMI;//体质组数,kg/m2
    private Integer health_status;//老年人健康状态自我评估(1满意 2基本满意 3说不清楚 4不太满意 5不满意)
    private Integer selfcare_ability;//老年人生活自理能力自我评估(1、可自理0~3分 2、轻度依赖4~8分 3、中度依赖9~18分 4、不能自理≥19分)
    private Integer cognitive_function;//认知功能(1粗筛阴性 2粗筛阳性)
    private Integer cognitive_function_score;//简易智力状态检查,总分
    private Integer emotional_state;//情感状态(1粗筛阴性 2粗筛阳性)
    private Integer emotional_state_score;//简易抑郁评分检查,总分
    /**********  生活方式  **********/
    //体育锻炼
    private Integer exercise_frequency;//锻炼频率(1每天 2每周一次以上 3偶尔 4不锻炼)
    private Integer exercise_time;//每次锻炼时间 ,分钟
    private String sustain_exercise_time;//坚持锻炼时间,年
    private String exercise_type;//锻炼方式
    private String dietary_habit;//饮食习惯(1荤素均衡 2荤食为主 3素食为主 4嗜盐 5嗜油 6嗜糖)
    //吸烟情况
    private Integer smoking_state;//吸烟状况(1从不吸烟 2已戒烟 3吸烟)
    private Integer smoking_daily;//日吸烟量,支
    private Integer start_smoking_age;//开始吸烟年龄,岁
    private Integer stop_smoking_age;//戒烟年龄,岁
    //饮酒情况
    private Integer drinking_frequency;//饮酒频率(1从不 2偶尔 3经常 4每天)
    private Integer drinking_daily;//日饮酒量,两
    private Integer is_stop_drinking;//是否戒酒(1否,2是)
    private Integer stop_drinking_age;//戒酒年龄,岁
    private Integer start_drinking_age;//开始饮酒年龄
    private Integer drunkenness;//近一年是否曾醉酒(1是 2否)
    private String drinking_type;//饮酒品种(1白酒 2啤酒 3红酒 4黄酒 5其他)
    private String other_drinking_type;//其他的饮酒品种
    //职业病危害因素接触史
    private String dust;//粉尘
    private Integer dust_protective_measures;//是否有粉尘防护措施(1无 2有)
    private String dust_protective_measures_has;//粉尘防护措施
    private String radiogen;//放射物质
    private Integer radiogen_protective_measures;//是否有放射物质防护措施(1无 2有)
    private String radiogen_protective_measures_has;//放射物质防护措施
    private String physical_factor;//物理因素
    private Integer physical_protective_measures;//是否有物理因素防护措施(1无 2有)
    private String physical_protective_measures_has;//物理因素防护措施
    private String chemical_factor;//化学因素
    private Integer chemical_protective_measures;//是否有化学因素防护措施(1无 2有)
    private String chemical_protective_measures_has;//化学因素防护措施
    private String other_hazard_factors;//其他危害因素
    private Integer other_hazard_protective_measures;//是否有其他危害因素防护措施(1无 2有)
    private String other_hazard_protective_measures_has;//其他危害因素防护措施
    /**********  脏器功能  **********/
    //口腔
    private Integer lip;//口唇(1红润 2苍白 3发钳 4皲裂 5疱疹)
    private Integer dentition;//齿列(1正常 2缺齿 3龋齿 4义齿,假牙)
    private Integer oropharynx;//咽部(1无充血 2充血 3淋巴滤泡增生)
    private Double left_eyesight;//左眼视力
    private Double right_eyesight;//右眼视力
    private Double left_correctional_eyesight;//左眼矫正视力
    private Double right_correctional_eyesight;//右眼矫正视力
    private Integer hearing;//听力(1听见 2听不清或无法听见)
    private Integer motor_function;//运动功能(1可顺利完成 2无法独立完成任何一个动作)
    /**********  查体  **********/
    private Integer fundus;//眼底(1正常 2异常)
    private String fundus_abnormal;//眼底异常表现
    private Integer skin;//皮肤(1正常 2潮红 3苍白 4发钳 5黄染 6色素沉着 7其他)
    private String skin_other;//皮肤其他状态描述
    private Integer sclera;//巩膜(1正常 2黄染 3充血 4其他)
    private String sclera_other;//巩膜其他状态描述
    private Integer lymphaden;//淋巴结(1未触及 2锁骨上 3腋窝 4其他 )
    private String lymphaden_other;//淋巴结其他位置
    //肺
    private Integer barrel_chest;//桶状胸(1否 2是)
    private Integer breath_sounds;//呼吸音(1正常 2异常)
    private String breath_sounds_abnormal;//呼吸异常描述
    private Integer rale;//罗音(1无 2干罗音 3湿罗音 4其他)
    private String rale_abnormal;//其他罗音描述
    //心脏
    private Integer heart_rate;//心率,次/分钟
    private Integer heart_rhythm;//心律(1齐 2不齐 3绝对不齐)
    private Integer heart_noise;//杂音(1无 2有)
    private String heart_noise_has;//有杂音描述
    //腹部
    private Integer abdominal_tenderness;//是否压痛(1无 2有)
    private String tenderness_has;//有压痛描述
    private Integer abdominal_mass;//是否腹部包块(1无 2有)
    private String mass_has;//有腹部包块描述
    private Integer abdominal_hepatomegaly;//是否腹部肝大(1无 2有)
    private String hepatomegaly_has;//腹部肝大描述
    private Integer abdominal_spleen_big;//是否腹部脾大(1无 2有)
    private String spleen_big_has;//腹部脾大
    private Integer abdominal_shifting_dullness;//是否移动性浊音(1无 2有)
    private String shifting_dullness_has;//移动性浊音
    private Integer crura_edema;//下肢水肿(1无 2单侧 3双侧不对称 4双侧对称)
    private Integer dorsal_foot_pulse;//足背动脉搏动(1未接触 2触及双侧对称 3触及左侧弱或消失 4触及右侧弱或消失 )
    private Integer anus_dre;//肛门指诊(1未见异常 2触痛 3包块 4前列腺异常 5其他)
    private String anus_dre_other;//肛门指诊其他现象
    private String breast;//乳腺(1未见异常 2乳房切除 3异常泌乳 4乳腺包块 5其他)
    private String breast_other;//乳腺其他现象
    //妇科
    private Integer vulva;//外阴(1未见异常 2异常)
    private String vulva_abnormal;//外阴异常描述
    private Integer vagina;//阴道(1未见异常 2异常)
    private String vagina_abnormal;//阴道异常描述
    private Integer cervical;//宫颈(1未见异常 2异常)
    private String cervical_abnormal;//宫颈异常描述
    private Integer corpus;//宫体(1未见异常 2异常)
    private String corpus_abnormal;//宫体异常描述
    private Integer gynecologic_appendix;//妇科附件(1未见异常 2异常)
    private String appendix_abnormal;//附件异常描述
    private String physical_examination_other;//查体其他信息
    /**********  辅助检查  **********/
    //血常规
    private Double hemoglobin;//血红蛋白
    private Double leukocyte;//白细胞
    private Double thrombocyte;//血小板
    private String blood_routine_other;//其他血常规
    //尿常规
    private String urine_protein;//尿蛋白
    private String urine_sugar;//尿糖
    private String urine_acetone_bodies;//尿酮体
    private String urine_occult_blood;//尿潜血
    private String urine_routine_other;//其他尿常规
    private Double fasting_blood_glucose_L;//空腹血糖,单位mmol/L
    private Double fasting_blood_glucose_dL;//空腹血糖,单位mg/dL
    private Integer electrocardiogram;//心电图(1正常 2异常)
    private String electrocardiogram_abnormal;//心电图异常
    private Double microalbuminuria;//尿微量白蛋白, mg/dL
    private Integer occult_blood_in_stool;//大便潜血(1阴性 2阳性)
    private Double glycated_hemoglobin;//糖化血红蛋白
    private Integer HBsAg;//乙型肝炎表面抗原(1阴性 2阳性)
    //肝功能
    private Double ALT;//血清谷丙转氨酶
    private Double SGOT;//血清谷草转氨酶
    private Double albumin;//白蛋白
    private Double total_bilirubin;//总胆红素
    private Double conjugated_bilirubin;//结合胆红素
    //肾功能
    private Double serum_creatinine;//血清肌酐
    private Double blood_urea_nitrogen;//血尿素氮
    private Double blood_potassium_concentration;//血钾浓度
    private Double blood_Na_concentration;//血钠浓度
    private Double uric_acid;//尿酸
    //血脂
    private Double total_cholesterol;//总胆固醇
    private Double triglyceride;//甘油三酯
    private Double LDL_cholesterol;//血清低密度脂蛋白胆固醇
    private Double HDL_cholesterol;//血清高密度脂蛋白胆固醇
    private Double alpha_fetal_protein;//甲胎蛋白
    private Integer chest_Xray;//胸部X线片(1正常 2异常)
    private String chest_Xray_abnormal;//胸部X线片异常
    //B超
    private Integer abdomen_B_ultrasonic;//腹部b超(1正常 2异常)
    private String abdomen_B_ultrasonic_abnormal;//腹部b超异常描述
    private Integer B_ultrasonic_other;//b超其他部位(1正常 2异常)
    private String B_ultrasonic_other_abnormal;//b超其他部位异常描述
    private Integer cervical_smear;//宫颈涂片(1正常 2异常)
    private String cervical_smear_abnormal;//宫颈涂片异常描述
    private String  auxiliary_examination_other;//其他辅助检查
    /**********  中医体质辨识  **********/
    private Integer mild_physical;//平和质(1是 2基本是)
    private Integer qi_deficiency;//气虚质(1是 2倾向是)
    private Integer  yang_deficiency;//阳虚质(1是 2倾向是)
    private Integer yin_deficiency ;//阴虚质(1是 2倾向是)
    private Integer phlegm_dampness;//痰湿质(1是 2倾向是)
    private Integer dampness_heat;//湿热质(1是 2倾向是)
    private Integer blood_stasis;//血瘀质(1是 2倾向是)
    private Integer logistic_regression;//气郁质(1是 2倾向是)
    private Integer grasp_quality;//特秉质(1是 2倾向是)
    /**********  现存主要健康问题  **********/
    //脑血管疾病
    private String cerebrovascular_disease;//脑血管疾病(1未发现 2缺血性卒中 3脑出血 4蛛网膜下腔出血 5短暂性脑缺血发作 6其他)
    private String cerebrovascular_disease_other;//其他脑血管疾病
    private String nephropathy;//肾脏疾病(1未发现 2糖尿病肾病 3 肾功能衰竭 4急性肾炎 5慢性肾炎 6其他)
    private String nephropathy_other;//其他肾脏疾病
    private String heart_disease;//心脏疾病(1未发现 2心肌梗死 3心绞痛 4冠状动脉血运重建 5充血性心力衰竭 6心前区疼痛 7其他)
    private String heart_disease_other;//其他心脏疾病
    private String vascular_disease;//血管疾病(1未发现 2夹层动脉瘤 3动脉闭塞性疾病 4其他)
    private String vascular_disease_other;//其他血管疾病
    private String eye_disease;//眼部疾病(1未发现 2视网膜出血或渗出 3视乳头水肿 4白内障 5其他)
    private String eye_disease_other;//其他眼部疾病
    private Integer nervous_system_disease;//神经系统疾病(1未发现 2有)
    private String nervous_system_disease_has;//有神经系统疾病
    private Integer other_system_disease;//其他系统疾病(1未发现 2有)
    private String other_system_disease_has;//有其他系统疾病说明
    /**********  住院治疗情况  **********/
    //住院史
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date admission_date1;//入院日期
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date discharge_date1;//出院日期
    private String admission_reason1;//入院原因
    private String admission_hospital_name1;//入院医疗机构名称
    private String admission_number1;//病案号
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date admission_date2;//入院日期
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date discharge_date2;//出院日期
    private String admission_reason2;//入院原因
    private String admission_hospital_name2;//入院医疗机构名称
    private String admission_number2;//病案号
    //家庭病床史
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date building_bed_date1;//建床日期
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date cancel_bed_date1;//撤床日期
    private String building_bed_reason1;//建床原因
    private String building_bed_hospiatl_name1;//医疗机构名称
    private String building_bed_number1;//建床病案号
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date building_bed_date2;//建床日期
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date cancel_bed_date2;//撤床日期
    private String building_bed_reason2;//建床原因
    private String building_bed_hospiatl_name2;//医疗机构名称
    private String building_bed_number2;//建床病案号
    /**********  主要用药情况  **********/
    private String medicine1;//药物名称
    private String medicine1_use;//用法
    private String medicine1_dosage;//用量
    private String medication1_time;//用药时间
    private Integer medication1_compliance;//服药依从性(1规律 2间断 3不服药)
    private String medicine2;//药物名称
    private String medicine2_use;//用法
    private String medicine2_dosage;//用量
    private String medication2_time;//用药时间
    private Integer medication2_compliance;//服药依从性(1规律 2间断 3不服药)
    private String medicine3;//药物名称
    private String medicine3_use;//用法
    private String medicine3_dosage;//用量
    private String medication3_time;//用药时间
    private Integer medication3_compliance;//服药依从性(1规律 2间断 3不服药)
    private String medicine4;//药物名称
    private String medicine4_use;//用法
    private String medicine4_dosage;//用量
    private String medication4_time;//用药时间
    private Integer medication4_compliance;//服药依从性(1规律 2间断 3不服药)
    private String medicine5;//药物名称
    private String medicine5_use;//用法
    private String medicine5_dosage;//用量
    private String medication5_time;//用药时间
    private Integer medication5_compliance;//服药依从性(1规律 2间断 3不服药)
    private String medicine6;//药物名称
    private String medicine6_use;//用法
    private String medicine6_dosage;//用量
    private String medication6_time;//用药时间
    private Integer medication6_compliance;//服药依从性(1规律 2间断 3不服药)
    /**********  非免疫规划预防接种史  **********/
    private String vaccination_name1;//预防接种名称
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date vaccination_date1;//预防接种日期
    private String vaccination_hospital_name1;//预防接种机构
    private String vaccination_name2;//预防接种名称
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date vaccination_date2;//预防接种日期
    private String vaccination_hospital_name2;//预防接种机构
    private String vaccination_name3;//预防接种名称
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date vaccination_date3;//预防接种日期
    private String vaccination_hospital_name3;//预防接种机构
    /**********  健康评价  **********/
    private Integer health_examination;//体检是否异常(1无 2有)
    private String health_examination_abnormal1;//体检异常1
    private String health_examination_abnormal2;//体检异常2
    private String health_examination_abnormal3;//体检异常3
    private String health_examination_abnormal4;//体检异常4
    /**********  健康指导  **********/
    private Integer regular_followup;//定期随访(1无,2有)
    private Integer chronic_health_management;//纳入慢性病患者健康管理(1无,2有)
    private Integer suggest_recheck;//建议复查(1无,2有)
    private Integer suggest_referral;//建议转诊(1无,2有)
    private Integer other_health_guidance;//其他健康指导(1无,2有)
    private String other_health_guidance_description;//其他健康指导内容(1无,2有)
    /**********  危险因素控制  **********/
    private Integer stop_smoking;//戒烟(1无,2有)
    private Integer healthy_drinking;//健康饮酒(1无,2有)
    private Integer diet;//饮食(1无,2有)
    private Integer exercise;//锻炼(1无,2有)
    private Integer lose_weight;//减肥(1无,2有)
    private Double goal_weight;//目标体重
    private String recommended_vaccination;//建议接种疫苗(1无,2有)
    private Integer other_advice;//是否有其他建议(1无,2有)
    private String other_advice_description;//其他建议内容
    /**********  老人自理能力评估内容  **********/
    private String assessment_number;//评估编号
    private String assessment_doctorName;//评估医生
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date assessment_time;//评估日期
    private Integer eat;//进餐(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分)
    private Integer wash;//梳洗(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分
    private Integer dress;//穿衣(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分
    private Integer toilet;//如厕(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分
    private Integer activity;//活动(1独立完成0-3分 2轻度依赖4-8分 3中度依赖9-18分 4不能自理≥19分
    private Integer score;//总评分
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getFollowup_id() {
        return followup_id;
    }
    public void setFollowup_id(String followup_id) {
        this.followup_id = followup_id;
    }
    public String getFollowup_project() {
        return followup_project;
    }
    public void setFollowup_project(String followup_project) {
        this.followup_project = followup_project;
    }
    public Date getCreate_time() {
        return create_time;
    }
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
    public String getCreate_user() {
        return create_user;
    }
    public void setCreate_user(String create_user) {
        this.create_user = create_user;
    }
    public String getCreate_user_name() {
        return create_user_name;
    }
    public void setCreate_user_name(String create_user_name) {
        this.create_user_name = create_user_name;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    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 getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }
    public Date getDuty() {
        return duty;
    }
    public void setDuty(Date duty) {
        this.duty = duty;
    }
    public String getResponsibility_doctor_name() {
        return responsibility_doctor_name;
    }
    public void setResponsibility_doctor_name(String responsibility_doctor_name) {
        this.responsibility_doctor_name = responsibility_doctor_name;
    }
    public String getSymptom() {
        return symptom;
    }
    public void setSymptom(String symptom) {
        this.symptom = symptom;
    }
    public String getSymptom_other() {
        return symptom_other;
    }
    public void setSymptom_other(String symptom_other) {
        this.symptom_other = symptom_other;
    }
    public Double getTemperature() {
        return temperature;
    }
    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }
    public String getPulse_frequency() {
        return pulse_frequency;
    }
    public void setPulse_frequency(String pulse_frequency) {
        this.pulse_frequency = pulse_frequency;
    }
    public String getBreath_frequency() {
        return breath_frequency;
    }
    public void setBreath_frequency(String breath_frequency) {
        this.breath_frequency = breath_frequency;
    }
    public Integer getBlood_pressure_left_low() {
        return blood_pressure_left_low;
    }
    public void setBlood_pressure_left_low(Integer blood_pressure_left_low) {
        this.blood_pressure_left_low = blood_pressure_left_low;
    }
    public Integer getBlood_pressure_left_high() {
        return blood_pressure_left_high;
    }
    public void setBlood_pressure_left_high(Integer blood_pressure_left_high) {
        this.blood_pressure_left_high = blood_pressure_left_high;
    }
    public Integer getBlood_pressure_right_low() {
        return blood_pressure_right_low;
    }
    public void setBlood_pressure_right_low(Integer blood_pressure_right_low) {
        this.blood_pressure_right_low = blood_pressure_right_low;
    }
    public Integer getBlood_pressure_right_high() {
        return blood_pressure_right_high;
    }
    public void setBlood_pressure_right_high(Integer blood_pressure_right_high) {
        this.blood_pressure_right_high = blood_pressure_right_high;
    }
    public Double getHeight() {
        return height;
    }
    public void setHeight(Double height) {
        this.height = height;
    }
    public Double getWeight() {
        return weight;
    }
    public void setWeight(Double weight) {
        this.weight = weight;
    }
    public Double getWaistline() {
        return waistline;
    }
    public void setWaistline(Double waistline) {
        this.waistline = waistline;
    }
    public Double getBMI() {
        return BMI;
    }
    public void setBMI(Double BMI) {
        this.BMI = BMI;
    }
    public Integer getHealth_status() {
        return health_status;
    }
    public void setHealth_status(Integer health_status) {
        this.health_status = health_status;
    }
    public Integer getSelfcare_ability() {
        return selfcare_ability;
    }
    public void setSelfcare_ability(Integer selfcare_ability) {
        this.selfcare_ability = selfcare_ability;
    }
    public Integer getCognitive_function() {
        return cognitive_function;
    }
    public void setCognitive_function(Integer cognitive_function) {
        this.cognitive_function = cognitive_function;
    }
    public Integer getCognitive_function_score() {
        return cognitive_function_score;
    }
    public void setCognitive_function_score(Integer cognitive_function_score) {
        this.cognitive_function_score = cognitive_function_score;
    }
    public Integer getEmotional_state() {
        return emotional_state;
    }
    public void setEmotional_state(Integer emotional_state) {
        this.emotional_state = emotional_state;
    }
    public Integer getEmotional_state_score() {
        return emotional_state_score;
    }
    public void setEmotional_state_score(Integer emotional_state_score) {
        this.emotional_state_score = emotional_state_score;
    }
    public Integer getExercise_frequency() {
        return exercise_frequency;
    }
    public void setExercise_frequency(Integer exercise_frequency) {
        this.exercise_frequency = exercise_frequency;
    }
    public Integer getExercise_time() {
        return exercise_time;
    }
    public void setExercise_time(Integer exercise_time) {
        this.exercise_time = exercise_time;
    }
    public String getSustain_exercise_time() {
        return sustain_exercise_time;
    }
    public void setSustain_exercise_time(String sustain_exercise_time) {
        this.sustain_exercise_time = sustain_exercise_time;
    }
    public String getExercise_type() {
        return exercise_type;
    }
    public void setExercise_type(String exercise_type) {
        this.exercise_type = exercise_type;
    }
    public String getDietary_habit() {
        return dietary_habit;
    }
    public void setDietary_habit(String dietary_habit) {
        this.dietary_habit = dietary_habit;
    }
    public Integer getSmoking_state() {
        return smoking_state;
    }
    public void setSmoking_state(Integer smoking_state) {
        this.smoking_state = smoking_state;
    }
    public Integer getSmoking_daily() {
        return smoking_daily;
    }
    public void setSmoking_daily(Integer smoking_daily) {
        this.smoking_daily = smoking_daily;
    }
    public Integer getStart_smoking_age() {
        return start_smoking_age;
    }
    public void setStart_smoking_age(Integer start_smoking_age) {
        this.start_smoking_age = start_smoking_age;
    }
    public Integer getStop_smoking_age() {
        return stop_smoking_age;
    }
    public void setStop_smoking_age(Integer stop_smoking_age) {
        this.stop_smoking_age = stop_smoking_age;
    }
    public Integer getDrinking_frequency() {
        return drinking_frequency;
    }
    public void setDrinking_frequency(Integer drinking_frequency) {
        this.drinking_frequency = drinking_frequency;
    }
    public Integer getDrinking_daily() {
        return drinking_daily;
    }
    public void setDrinking_daily(Integer drinking_daily) {
        this.drinking_daily = drinking_daily;
    }
    public Integer getIs_stop_drinking() {
        return is_stop_drinking;
    }
    public void setIs_stop_drinking(Integer is_stop_drinking) {
        this.is_stop_drinking = is_stop_drinking;
    }
    public Integer getStop_drinking_age() {
        return stop_drinking_age;
    }
    public void setStop_drinking_age(Integer stop_drinking_age) {
        this.stop_drinking_age = stop_drinking_age;
    }
    public Integer getStart_drinking_age() {
        return start_drinking_age;
    }
    public void setStart_drinking_age(Integer start_drinking_age) {
        this.start_drinking_age = start_drinking_age;
    }
    public Integer getDrunkenness() {
        return drunkenness;
    }
    public void setDrunkenness(Integer drunkenness) {
        this.drunkenness = drunkenness;
    }
    public String getDrinking_type() {
        return drinking_type;
    }
    public void setDrinking_type(String drinking_type) {
        this.drinking_type = drinking_type;
    }
    public String getOther_drinking_type() {
        return other_drinking_type;
    }
    public void setOther_drinking_type(String other_drinking_type) {
        this.other_drinking_type = other_drinking_type;
    }
    public String getDust() {
        return dust;
    }
    public void setDust(String dust) {
        this.dust = dust;
    }
    public Integer getDust_protective_measures() {
        return dust_protective_measures;
    }
    public void setDust_protective_measures(Integer dust_protective_measures) {
        this.dust_protective_measures = dust_protective_measures;
    }
    public String getDust_protective_measures_has() {
        return dust_protective_measures_has;
    }
    public void setDust_protective_measures_has(String dust_protective_measures_has) {
        this.dust_protective_measures_has = dust_protective_measures_has;
    }
    public String getRadiogen() {
        return radiogen;
    }
    public void setRadiogen(String radiogen) {
        this.radiogen = radiogen;
    }
    public Integer getRadiogen_protective_measures() {
        return radiogen_protective_measures;
    }
    public void setRadiogen_protective_measures(Integer radiogen_protective_measures) {
        this.radiogen_protective_measures = radiogen_protective_measures;
    }
    public String getRadiogen_protective_measures_has() {
        return radiogen_protective_measures_has;
    }
    public void setRadiogen_protective_measures_has(String radiogen_protective_measures_has) {
        this.radiogen_protective_measures_has = radiogen_protective_measures_has;
    }
    public String getPhysical_factor() {
        return physical_factor;
    }
    public void setPhysical_factor(String physical_factor) {
        this.physical_factor = physical_factor;
    }
    public Integer getPhysical_protective_measures() {
        return physical_protective_measures;
    }
    public void setPhysical_protective_measures(Integer physical_protective_measures) {
        this.physical_protective_measures = physical_protective_measures;
    }
    public String getPhysical_protective_measures_has() {
        return physical_protective_measures_has;
    }
    public void setPhysical_protective_measures_has(String physical_protective_measures_has) {
        this.physical_protective_measures_has = physical_protective_measures_has;
    }
    public String getChemical_factor() {
        return chemical_factor;
    }
    public void setChemical_factor(String chemical_factor) {
        this.chemical_factor = chemical_factor;
    }
    public Integer getChemical_protective_measures() {
        return chemical_protective_measures;
    }
    public void setChemical_protective_measures(Integer chemical_protective_measures) {
        this.chemical_protective_measures = chemical_protective_measures;
    }
    public String getChemical_protective_measures_has() {
        return chemical_protective_measures_has;
    }
    public void setChemical_protective_measures_has(String chemical_protective_measures_has) {
        this.chemical_protective_measures_has = chemical_protective_measures_has;
    }
    public String getOther_hazard_factors() {
        return other_hazard_factors;
    }
    public void setOther_hazard_factors(String other_hazard_factors) {
        this.other_hazard_factors = other_hazard_factors;
    }
    public Integer getOther_hazard_protective_measures() {
        return other_hazard_protective_measures;
    }
    public void setOther_hazard_protective_measures(Integer other_hazard_protective_measures) {
        this.other_hazard_protective_measures = other_hazard_protective_measures;
    }
    public String getOther_hazard_protective_measures_has() {
        return other_hazard_protective_measures_has;
    }
    public void setOther_hazard_protective_measures_has(String other_hazard_protective_measures_has) {
        this.other_hazard_protective_measures_has = other_hazard_protective_measures_has;
    }
    public Integer getLip() {
        return lip;
    }
    public void setLip(Integer lip) {
        this.lip = lip;
    }
    public Integer getDentition() {
        return dentition;
    }
    public void setDentition(Integer dentition) {
        this.dentition = dentition;
    }
    public Integer getOropharynx() {
        return oropharynx;
    }
    public void setOropharynx(Integer oropharynx) {
        this.oropharynx = oropharynx;
    }
    public Double getLeft_eyesight() {
        return left_eyesight;
    }
    public void setLeft_eyesight(Double left_eyesight) {
        this.left_eyesight = left_eyesight;
    }
    public Double getRight_eyesight() {
        return right_eyesight;
    }
    public void setRight_eyesight(Double right_eyesight) {
        this.right_eyesight = right_eyesight;
    }
    public Double getLeft_correctional_eyesight() {
        return left_correctional_eyesight;
    }
    public void setLeft_correctional_eyesight(Double left_correctional_eyesight) {
        this.left_correctional_eyesight = left_correctional_eyesight;
    }
    public Double getRight_correctional_eyesight() {
        return right_correctional_eyesight;
    }
    public void setRight_correctional_eyesight(Double right_correctional_eyesight) {
        this.right_correctional_eyesight = right_correctional_eyesight;
    }
    public Integer getHearing() {
        return hearing;
    }
    public void setHearing(Integer hearing) {
        this.hearing = hearing;
    }
    public Integer getMotor_function() {
        return motor_function;
    }
    public void setMotor_function(Integer motor_function) {
        this.motor_function = motor_function;
    }
    public Integer getFundus() {
        return fundus;
    }
    public void setFundus(Integer fundus) {
        this.fundus = fundus;
    }
    public String getFundus_abnormal() {
        return fundus_abnormal;
    }
    public void setFundus_abnormal(String fundus_abnormal) {
        this.fundus_abnormal = fundus_abnormal;
    }
    public Integer getSkin() {
        return skin;
    }
    public void setSkin(Integer skin) {
        this.skin = skin;
    }
    public String getSkin_other() {
        return skin_other;
    }
    public void setSkin_other(String skin_other) {
        this.skin_other = skin_other;
    }
    public Integer getSclera() {
        return sclera;
    }
    public void setSclera(Integer sclera) {
        this.sclera = sclera;
    }
    public String getSclera_other() {
        return sclera_other;
    }
    public void setSclera_other(String sclera_other) {
        this.sclera_other = sclera_other;
    }
    public Integer getLymphaden() {
        return lymphaden;
    }
    public void setLymphaden(Integer lymphaden) {
        this.lymphaden = lymphaden;
    }
    public String getLymphaden_other() {
        return lymphaden_other;
    }
    public void setLymphaden_other(String lymphaden_other) {
        this.lymphaden_other = lymphaden_other;
    }
    public Integer getBarrel_chest() {
        return barrel_chest;
    }
    public void setBarrel_chest(Integer barrel_chest) {
        this.barrel_chest = barrel_chest;
    }
    public Integer getBreath_sounds() {
        return breath_sounds;
    }
    public void setBreath_sounds(Integer breath_sounds) {
        this.breath_sounds = breath_sounds;
    }
    public String getBreath_sounds_abnormal() {
        return breath_sounds_abnormal;
    }
    public void setBreath_sounds_abnormal(String breath_sounds_abnormal) {
        this.breath_sounds_abnormal = breath_sounds_abnormal;
    }
    public Integer getRale() {
        return rale;
    }
    public void setRale(Integer rale) {
        this.rale = rale;
    }
    public String getRale_abnormal() {
        return rale_abnormal;
    }
    public void setRale_abnormal(String rale_abnormal) {
        this.rale_abnormal = rale_abnormal;
    }
    public Integer getHeart_rate() {
        return heart_rate;
    }
    public void setHeart_rate(Integer heart_rate) {
        this.heart_rate = heart_rate;
    }
    public Integer getHeart_rhythm() {
        return heart_rhythm;
    }
    public void setHeart_rhythm(Integer heart_rhythm) {
        this.heart_rhythm = heart_rhythm;
    }
    public Integer getHeart_noise() {
        return heart_noise;
    }
    public void setHeart_noise(Integer heart_noise) {
        this.heart_noise = heart_noise;
    }
    public String getHeart_noise_has() {
        return heart_noise_has;
    }
    public void setHeart_noise_has(String heart_noise_has) {
        this.heart_noise_has = heart_noise_has;
    }
    public Integer getAbdominal_tenderness() {
        return abdominal_tenderness;
    }
    public void setAbdominal_tenderness(Integer abdominal_tenderness) {
        this.abdominal_tenderness = abdominal_tenderness;
    }
    public String getTenderness_has() {
        return tenderness_has;
    }
    public void setTenderness_has(String tenderness_has) {
        this.tenderness_has = tenderness_has;
    }
    public Integer getAbdominal_mass() {
        return abdominal_mass;
    }
    public void setAbdominal_mass(Integer abdominal_mass) {
        this.abdominal_mass = abdominal_mass;
    }
    public String getMass_has() {
        return mass_has;
    }
    public void setMass_has(String mass_has) {
        this.mass_has = mass_has;
    }
    public Integer getAbdominal_hepatomegaly() {
        return abdominal_hepatomegaly;
    }
    public void setAbdominal_hepatomegaly(Integer abdominal_hepatomegaly) {
        this.abdominal_hepatomegaly = abdominal_hepatomegaly;
    }
    public String getHepatomegaly_has() {
        return hepatomegaly_has;
    }
    public void setHepatomegaly_has(String hepatomegaly_has) {
        this.hepatomegaly_has = hepatomegaly_has;
    }
    public Integer getAbdominal_spleen_big() {
        return abdominal_spleen_big;
    }
    public void setAbdominal_spleen_big(Integer abdominal_spleen_big) {
        this.abdominal_spleen_big = abdominal_spleen_big;
    }
    public String getSpleen_big_has() {
        return spleen_big_has;
    }
    public void setSpleen_big_has(String spleen_big_has) {
        this.spleen_big_has = spleen_big_has;
    }
    public Integer getAbdominal_shifting_dullness() {
        return abdominal_shifting_dullness;
    }
    public void setAbdominal_shifting_dullness(Integer abdominal_shifting_dullness) {
        this.abdominal_shifting_dullness = abdominal_shifting_dullness;
    }
    public String getShifting_dullness_has() {
        return shifting_dullness_has;
    }
    public void setShifting_dullness_has(String shifting_dullness_has) {
        this.shifting_dullness_has = shifting_dullness_has;
    }
    public Integer getCrura_edema() {
        return crura_edema;
    }
    public void setCrura_edema(Integer crura_edema) {
        this.crura_edema = crura_edema;
    }
    public Integer getDorsal_foot_pulse() {
        return dorsal_foot_pulse;
    }
    public void setDorsal_foot_pulse(Integer dorsal_foot_pulse) {
        this.dorsal_foot_pulse = dorsal_foot_pulse;
    }
    public Integer getAnus_dre() {
        return anus_dre;
    }
    public void setAnus_dre(Integer anus_dre) {
        this.anus_dre = anus_dre;
    }
    public String getAnus_dre_other() {
        return anus_dre_other;
    }
    public void setAnus_dre_other(String anus_dre_other) {
        this.anus_dre_other = anus_dre_other;
    }
    public String getBreast() {
        return breast;
    }
    public void setBreast(String breast) {
        this.breast = breast;
    }
    public String getBreast_other() {
        return breast_other;
    }
    public void setBreast_other(String breast_other) {
        this.breast_other = breast_other;
    }
    public Integer getVulva() {
        return vulva;
    }
    public void setVulva(Integer vulva) {
        this.vulva = vulva;
    }
    public String getVulva_abnormal() {
        return vulva_abnormal;
    }
    public void setVulva_abnormal(String vulva_abnormal) {
        this.vulva_abnormal = vulva_abnormal;
    }
    public Integer getVagina() {
        return vagina;
    }
    public void setVagina(Integer vagina) {
        this.vagina = vagina;
    }
    public String getVagina_abnormal() {
        return vagina_abnormal;
    }
    public void setVagina_abnormal(String vagina_abnormal) {
        this.vagina_abnormal = vagina_abnormal;
    }
    public Integer getCervical() {
        return cervical;
    }
    public void setCervical(Integer cervical) {
        this.cervical = cervical;
    }
    public String getCervical_abnormal() {
        return cervical_abnormal;
    }
    public void setCervical_abnormal(String cervical_abnormal) {
        this.cervical_abnormal = cervical_abnormal;
    }
    public Integer getCorpus() {
        return corpus;
    }
    public void setCorpus(Integer corpus) {
        this.corpus = corpus;
    }
    public String getCorpus_abnormal() {
        return corpus_abnormal;
    }
    public void setCorpus_abnormal(String corpus_abnormal) {
        this.corpus_abnormal = corpus_abnormal;
    }
    public Integer getGynecologic_appendix() {
        return gynecologic_appendix;
    }
    public void setGynecologic_appendix(Integer gynecologic_appendix) {
        this.gynecologic_appendix = gynecologic_appendix;
    }
    public String getAppendix_abnormal() {
        return appendix_abnormal;
    }
    public void setAppendix_abnormal(String appendix_abnormal) {
        this.appendix_abnormal = appendix_abnormal;
    }
    public String getPhysical_examination_other() {
        return physical_examination_other;
    }
    public void setPhysical_examination_other(String physical_examination_other) {
        this.physical_examination_other = physical_examination_other;
    }
    public Double getHemoglobin() {
        return hemoglobin;
    }
    public void setHemoglobin(Double hemoglobin) {
        this.hemoglobin = hemoglobin;
    }
    public Double getLeukocyte() {
        return leukocyte;
    }
    public void setLeukocyte(Double leukocyte) {
        this.leukocyte = leukocyte;
    }
    public Double getThrombocyte() {
        return thrombocyte;
    }
    public void setThrombocyte(Double thrombocyte) {
        this.thrombocyte = thrombocyte;
    }
    public String getBlood_routine_other() {
        return blood_routine_other;
    }
    public void setBlood_routine_other(String blood_routine_other) {
        this.blood_routine_other = blood_routine_other;
    }
    public String getUrine_protein() {
        return urine_protein;
    }
    public void setUrine_protein(String urine_protein) {
        this.urine_protein = urine_protein;
    }
    public String getUrine_sugar() {
        return urine_sugar;
    }
    public void setUrine_sugar(String urine_sugar) {
        this.urine_sugar = urine_sugar;
    }
    public String getUrine_acetone_bodies() {
        return urine_acetone_bodies;
    }
    public void setUrine_acetone_bodies(String urine_acetone_bodies) {
        this.urine_acetone_bodies = urine_acetone_bodies;
    }
    public String getUrine_occult_blood() {
        return urine_occult_blood;
    }
    public void setUrine_occult_blood(String urine_occult_blood) {
        this.urine_occult_blood = urine_occult_blood;
    }
    public String getUrine_routine_other() {
        return urine_routine_other;
    }
    public void setUrine_routine_other(String urine_routine_other) {
        this.urine_routine_other = urine_routine_other;
    }
    public Double getFasting_blood_glucose_L() {
        return fasting_blood_glucose_L;
    }
    public void setFasting_blood_glucose_L(Double fasting_blood_glucose_L) {
        this.fasting_blood_glucose_L = fasting_blood_glucose_L;
    }
    public Double getFasting_blood_glucose_dL() {
        return fasting_blood_glucose_dL;
    }
    public void setFasting_blood_glucose_dL(Double fasting_blood_glucose_dL) {
        this.fasting_blood_glucose_dL = fasting_blood_glucose_dL;
    }
    public Integer getElectrocardiogram() {
        return electrocardiogram;
    }
    public void setElectrocardiogram(Integer electrocardiogram) {
        this.electrocardiogram = electrocardiogram;
    }
    public String getElectrocardiogram_abnormal() {
        return electrocardiogram_abnormal;
    }
    public void setElectrocardiogram_abnormal(String electrocardiogram_abnormal) {
        this.electrocardiogram_abnormal = electrocardiogram_abnormal;
    }
    public Double getMicroalbuminuria() {
        return microalbuminuria;
    }
    public void setMicroalbuminuria(Double microalbuminuria) {
        this.microalbuminuria = microalbuminuria;
    }
    public Integer getOccult_blood_in_stool() {
        return occult_blood_in_stool;
    }
    public void setOccult_blood_in_stool(Integer occult_blood_in_stool) {
        this.occult_blood_in_stool = occult_blood_in_stool;
    }
    public Double getGlycated_hemoglobin() {
        return glycated_hemoglobin;
    }
    public void setGlycated_hemoglobin(Double glycated_hemoglobin) {
        this.glycated_hemoglobin = glycated_hemoglobin;
    }
    public Integer getHBsAg() {
        return HBsAg;
    }
    public void setHBsAg(Integer HBsAg) {
        this.HBsAg = HBsAg;
    }
    public Double getALT() {
        return ALT;
    }
    public void setALT(Double ALT) {
        this.ALT = ALT;
    }
    public Double getSGOT() {
        return SGOT;
    }
    public void setSGOT(Double SGOT) {
        this.SGOT = SGOT;
    }
    public Double getAlbumin() {
        return albumin;
    }
    public void setAlbumin(Double albumin) {
        this.albumin = albumin;
    }
    public Double getTotal_bilirubin() {
        return total_bilirubin;
    }
    public void setTotal_bilirubin(Double total_bilirubin) {
        this.total_bilirubin = total_bilirubin;
    }
    public Double getConjugated_bilirubin() {
        return conjugated_bilirubin;
    }
    public void setConjugated_bilirubin(Double conjugated_bilirubin) {
        this.conjugated_bilirubin = conjugated_bilirubin;
    }
    public Double getSerum_creatinine() {
        return serum_creatinine;
    }
    public void setSerum_creatinine(Double serum_creatinine) {
        this.serum_creatinine = serum_creatinine;
    }
    public Double getBlood_urea_nitrogen() {
        return blood_urea_nitrogen;
    }
    public void setBlood_urea_nitrogen(Double blood_urea_nitrogen) {
        this.blood_urea_nitrogen = blood_urea_nitrogen;
    }
    public Double getBlood_potassium_concentration() {
        return blood_potassium_concentration;
    }
    public void setBlood_potassium_concentration(Double blood_potassium_concentration) {
        this.blood_potassium_concentration = blood_potassium_concentration;
    }
    public Double getBlood_Na_concentration() {
        return blood_Na_concentration;
    }
    public void setBlood_Na_concentration(Double blood_Na_concentration) {
        this.blood_Na_concentration = blood_Na_concentration;
    }
    public Double getUric_acid() {
        return uric_acid;
    }
    public void setUric_acid(Double uric_acid) {
        this.uric_acid = uric_acid;
    }
    public Double getTotal_cholesterol() {
        return total_cholesterol;
    }
    public void setTotal_cholesterol(Double total_cholesterol) {
        this.total_cholesterol = total_cholesterol;
    }
    public Double getTriglyceride() {
        return triglyceride;
    }
    public void setTriglyceride(Double triglyceride) {
        this.triglyceride = triglyceride;
    }
    public Double getLDL_cholesterol() {
        return LDL_cholesterol;
    }
    public void setLDL_cholesterol(Double LDL_cholesterol) {
        this.LDL_cholesterol = LDL_cholesterol;
    }
    public Double getHDL_cholesterol() {
        return HDL_cholesterol;
    }
    public void setHDL_cholesterol(Double HDL_cholesterol) {
        this.HDL_cholesterol = HDL_cholesterol;
    }
    public Double getAlpha_fetal_protein() {
        return alpha_fetal_protein;
    }
    public void setAlpha_fetal_protein(Double alpha_fetal_protein) {
        this.alpha_fetal_protein = alpha_fetal_protein;
    }
    public Integer getChest_Xray() {
        return chest_Xray;
    }
    public void setChest_Xray(Integer chest_Xray) {
        this.chest_Xray = chest_Xray;
    }
    public String getChest_Xray_abnormal() {
        return chest_Xray_abnormal;
    }
    public void setChest_Xray_abnormal(String chest_Xray_abnormal) {
        this.chest_Xray_abnormal = chest_Xray_abnormal;
    }
    public Integer getAbdomen_B_ultrasonic() {
        return abdomen_B_ultrasonic;
    }
    public void setAbdomen_B_ultrasonic(Integer abdomen_B_ultrasonic) {
        this.abdomen_B_ultrasonic = abdomen_B_ultrasonic;
    }
    public String getAbdomen_B_ultrasonic_abnormal() {
        return abdomen_B_ultrasonic_abnormal;
    }
    public void setAbdomen_B_ultrasonic_abnormal(String abdomen_B_ultrasonic_abnormal) {
        this.abdomen_B_ultrasonic_abnormal = abdomen_B_ultrasonic_abnormal;
    }
    public Integer getB_ultrasonic_other() {
        return B_ultrasonic_other;
    }
    public void setB_ultrasonic_other(Integer b_ultrasonic_other) {
        B_ultrasonic_other = b_ultrasonic_other;
    }
    public String getB_ultrasonic_other_abnormal() {
        return B_ultrasonic_other_abnormal;
    }
    public void setB_ultrasonic_other_abnormal(String b_ultrasonic_other_abnormal) {
        B_ultrasonic_other_abnormal = b_ultrasonic_other_abnormal;
    }
    public Integer getCervical_smear() {
        return cervical_smear;
    }
    public void setCervical_smear(Integer cervical_smear) {
        this.cervical_smear = cervical_smear;
    }
    public String getCervical_smear_abnormal() {
        return cervical_smear_abnormal;
    }
    public void setCervical_smear_abnormal(String cervical_smear_abnormal) {
        this.cervical_smear_abnormal = cervical_smear_abnormal;
    }
    public String getAuxiliary_examination_other() {
        return auxiliary_examination_other;
    }
    public void setAuxiliary_examination_other(String auxiliary_examination_other) {
        this.auxiliary_examination_other = auxiliary_examination_other;
    }
    public Integer getMild_physical() {
        return mild_physical;
    }
    public void setMild_physical(Integer mild_physical) {
        this.mild_physical = mild_physical;
    }
    public Integer getQi_deficiency() {
        return qi_deficiency;
    }
    public void setQi_deficiency(Integer qi_deficiency) {
        this.qi_deficiency = qi_deficiency;
    }
    public Integer getYang_deficiency() {
        return yang_deficiency;
    }
    public void setYang_deficiency(Integer yang_deficiency) {
        this.yang_deficiency = yang_deficiency;
    }
    public Integer getYin_deficiency() {
        return yin_deficiency;
    }
    public void setYin_deficiency(Integer yin_deficiency) {
        this.yin_deficiency = yin_deficiency;
    }
    public Integer getPhlegm_dampness() {
        return phlegm_dampness;
    }
    public void setPhlegm_dampness(Integer phlegm_dampness) {
        this.phlegm_dampness = phlegm_dampness;
    }
    public Integer getDampness_heat() {
        return dampness_heat;
    }
    public void setDampness_heat(Integer dampness_heat) {
        this.dampness_heat = dampness_heat;
    }
    public Integer getBlood_stasis() {
        return blood_stasis;
    }
    public void setBlood_stasis(Integer blood_stasis) {
        this.blood_stasis = blood_stasis;
    }
    public Integer getLogistic_regression() {
        return logistic_regression;
    }
    public void setLogistic_regression(Integer logistic_regression) {
        this.logistic_regression = logistic_regression;
    }
    public Integer getGrasp_quality() {
        return grasp_quality;
    }
    public void setGrasp_quality(Integer grasp_quality) {
        this.grasp_quality = grasp_quality;
    }
    public String getCerebrovascular_disease() {
        return cerebrovascular_disease;
    }
    public void setCerebrovascular_disease(String cerebrovascular_disease) {
        this.cerebrovascular_disease = cerebrovascular_disease;
    }
    public String getCerebrovascular_disease_other() {
        return cerebrovascular_disease_other;
    }
    public void setCerebrovascular_disease_other(String cerebrovascular_disease_other) {
        this.cerebrovascular_disease_other = cerebrovascular_disease_other;
    }
    public String getNephropathy() {
        return nephropathy;
    }
    public void setNephropathy(String nephropathy) {
        this.nephropathy = nephropathy;
    }
    public String getNephropathy_other() {
        return nephropathy_other;
    }
    public void setNephropathy_other(String nephropathy_other) {
        this.nephropathy_other = nephropathy_other;
    }
    public String getHeart_disease() {
        return heart_disease;
    }
    public void setHeart_disease(String heart_disease) {
        this.heart_disease = heart_disease;
    }
    public String getHeart_disease_other() {
        return heart_disease_other;
    }
    public void setHeart_disease_other(String heart_disease_other) {
        this.heart_disease_other = heart_disease_other;
    }
    public String getVascular_disease() {
        return vascular_disease;
    }
    public void setVascular_disease(String vascular_disease) {
        this.vascular_disease = vascular_disease;
    }
    public String getVascular_disease_other() {
        return vascular_disease_other;
    }
    public void setVascular_disease_other(String vascular_disease_other) {
        this.vascular_disease_other = vascular_disease_other;
    }
    public String getEye_disease() {
        return eye_disease;
    }
    public void setEye_disease(String eye_disease) {
        this.eye_disease = eye_disease;
    }
    public String getEye_disease_other() {
        return eye_disease_other;
    }
    public void setEye_disease_other(String eye_disease_other) {
        this.eye_disease_other = eye_disease_other;
    }
    public Integer getNervous_system_disease() {
        return nervous_system_disease;
    }
    public void setNervous_system_disease(Integer nervous_system_disease) {
        this.nervous_system_disease = nervous_system_disease;
    }
    public String getNervous_system_disease_has() {
        return nervous_system_disease_has;
    }
    public void setNervous_system_disease_has(String nervous_system_disease_has) {
        this.nervous_system_disease_has = nervous_system_disease_has;
    }
    public Integer getOther_system_disease() {
        return other_system_disease;
    }
    public void setOther_system_disease(Integer other_system_disease) {
        this.other_system_disease = other_system_disease;
    }
    public String getOther_system_disease_has() {
        return other_system_disease_has;
    }
    public void setOther_system_disease_has(String other_system_disease_has) {
        this.other_system_disease_has = other_system_disease_has;
    }
    public Date getAdmission_date1() {
        return admission_date1;
    }
    public void setAdmission_date1(Date admission_date1) {
        this.admission_date1 = admission_date1;
    }
    public Date getDischarge_date1() {
        return discharge_date1;
    }
    public void setDischarge_date1(Date discharge_date1) {
        this.discharge_date1 = discharge_date1;
    }
    public String getAdmission_reason1() {
        return admission_reason1;
    }
    public void setAdmission_reason1(String admission_reason1) {
        this.admission_reason1 = admission_reason1;
    }
    public String getAdmission_hospital_name1() {
        return admission_hospital_name1;
    }
    public void setAdmission_hospital_name1(String admission_hospital_name1) {
        this.admission_hospital_name1 = admission_hospital_name1;
    }
    public String getAdmission_number1() {
        return admission_number1;
    }
    public void setAdmission_number1(String admission_number1) {
        this.admission_number1 = admission_number1;
    }
    public Date getAdmission_date2() {
        return admission_date2;
    }
    public void setAdmission_date2(Date admission_date2) {
        this.admission_date2 = admission_date2;
    }
    public Date getDischarge_date2() {
        return discharge_date2;
    }
    public void setDischarge_date2(Date discharge_date2) {
        this.discharge_date2 = discharge_date2;
    }
    public String getAdmission_reason2() {
        return admission_reason2;
    }
    public void setAdmission_reason2(String admission_reason2) {
        this.admission_reason2 = admission_reason2;
    }
    public String getAdmission_hospital_name2() {
        return admission_hospital_name2;
    }
    public void setAdmission_hospital_name2(String admission_hospital_name2) {
        this.admission_hospital_name2 = admission_hospital_name2;
    }
    public String getAdmission_number2() {
        return admission_number2;
    }
    public void setAdmission_number2(String admission_number2) {
        this.admission_number2 = admission_number2;
    }
    public Date getBuilding_bed_date1() {
        return building_bed_date1;
    }
    public void setBuilding_bed_date1(Date building_bed_date1) {
        this.building_bed_date1 = building_bed_date1;
    }
    public Date getCancel_bed_date1() {
        return cancel_bed_date1;
    }
    public void setCancel_bed_date1(Date cancel_bed_date1) {
        this.cancel_bed_date1 = cancel_bed_date1;
    }
    public String getBuilding_bed_reason1() {
        return building_bed_reason1;
    }
    public void setBuilding_bed_reason1(String building_bed_reason1) {
        this.building_bed_reason1 = building_bed_reason1;
    }
    public String getBuilding_bed_hospiatl_name1() {
        return building_bed_hospiatl_name1;
    }
    public void setBuilding_bed_hospiatl_name1(String building_bed_hospiatl_name1) {
        this.building_bed_hospiatl_name1 = building_bed_hospiatl_name1;
    }
    public String getBuilding_bed_number1() {
        return building_bed_number1;
    }
    public void setBuilding_bed_number1(String building_bed_number1) {
        this.building_bed_number1 = building_bed_number1;
    }
    public Date getBuilding_bed_date2() {
        return building_bed_date2;
    }
    public void setBuilding_bed_date2(Date building_bed_date2) {
        this.building_bed_date2 = building_bed_date2;
    }
    public Date getCancel_bed_date2() {
        return cancel_bed_date2;
    }
    public void setCancel_bed_date2(Date cancel_bed_date2) {
        this.cancel_bed_date2 = cancel_bed_date2;
    }
    public String getBuilding_bed_reason2() {
        return building_bed_reason2;
    }
    public void setBuilding_bed_reason2(String building_bed_reason2) {
        this.building_bed_reason2 = building_bed_reason2;
    }
    public String getBuilding_bed_hospiatl_name2() {
        return building_bed_hospiatl_name2;
    }
    public void setBuilding_bed_hospiatl_name2(String building_bed_hospiatl_name2) {
        this.building_bed_hospiatl_name2 = building_bed_hospiatl_name2;
    }
    public String getBuilding_bed_number2() {
        return building_bed_number2;
    }
    public void setBuilding_bed_number2(String building_bed_number2) {
        this.building_bed_number2 = building_bed_number2;
    }
    public String getMedicine1() {
        return medicine1;
    }
    public void setMedicine1(String medicine1) {
        this.medicine1 = medicine1;
    }
    public String getMedicine1_use() {
        return medicine1_use;
    }
    public void setMedicine1_use(String medicine1_use) {
        this.medicine1_use = medicine1_use;
    }
    public String getMedicine1_dosage() {
        return medicine1_dosage;
    }
    public void setMedicine1_dosage(String medicine1_dosage) {
        this.medicine1_dosage = medicine1_dosage;
    }
    public String getMedication1_time() {
        return medication1_time;
    }
    public void setMedication1_time(String medication1_time) {
        this.medication1_time = medication1_time;
    }
    public Integer getMedication1_compliance() {
        return medication1_compliance;
    }
    public void setMedication1_compliance(Integer medication1_compliance) {
        this.medication1_compliance = medication1_compliance;
    }
    public String getMedicine2() {
        return medicine2;
    }
    public void setMedicine2(String medicine2) {
        this.medicine2 = medicine2;
    }
    public String getMedicine2_use() {
        return medicine2_use;
    }
    public void setMedicine2_use(String medicine2_use) {
        this.medicine2_use = medicine2_use;
    }
    public String getMedicine2_dosage() {
        return medicine2_dosage;
    }
    public void setMedicine2_dosage(String medicine2_dosage) {
        this.medicine2_dosage = medicine2_dosage;
    }
    public String getMedication2_time() {
        return medication2_time;
    }
    public void setMedication2_time(String medication2_time) {
        this.medication2_time = medication2_time;
    }
    public Integer getMedication2_compliance() {
        return medication2_compliance;
    }
    public void setMedication2_compliance(Integer medication2_compliance) {
        this.medication2_compliance = medication2_compliance;
    }
    public String getMedicine3() {
        return medicine3;
    }
    public void setMedicine3(String medicine3) {
        this.medicine3 = medicine3;
    }
    public String getMedicine3_use() {
        return medicine3_use;
    }
    public void setMedicine3_use(String medicine3_use) {
        this.medicine3_use = medicine3_use;
    }
    public String getMedicine3_dosage() {
        return medicine3_dosage;
    }
    public void setMedicine3_dosage(String medicine3_dosage) {
        this.medicine3_dosage = medicine3_dosage;
    }
    public String getMedication3_time() {
        return medication3_time;
    }
    public void setMedication3_time(String medication3_time) {
        this.medication3_time = medication3_time;
    }
    public Integer getMedication3_compliance() {
        return medication3_compliance;
    }
    public void setMedication3_compliance(Integer medication3_compliance) {
        this.medication3_compliance = medication3_compliance;
    }
    public String getMedicine4() {
        return medicine4;
    }
    public void setMedicine4(String medicine4) {
        this.medicine4 = medicine4;
    }
    public String getMedicine4_use() {
        return medicine4_use;
    }
    public void setMedicine4_use(String medicine4_use) {
        this.medicine4_use = medicine4_use;
    }
    public String getMedicine4_dosage() {
        return medicine4_dosage;
    }
    public void setMedicine4_dosage(String medicine4_dosage) {
        this.medicine4_dosage = medicine4_dosage;
    }
    public String getMedication4_time() {
        return medication4_time;
    }
    public void setMedication4_time(String medication4_time) {
        this.medication4_time = medication4_time;
    }
    public Integer getMedication4_compliance() {
        return medication4_compliance;
    }
    public void setMedication4_compliance(Integer medication4_compliance) {
        this.medication4_compliance = medication4_compliance;
    }
    public String getMedicine5() {
        return medicine5;
    }
    public void setMedicine5(String medicine5) {
        this.medicine5 = medicine5;
    }
    public String getMedicine5_use() {
        return medicine5_use;
    }
    public void setMedicine5_use(String medicine5_use) {
        this.medicine5_use = medicine5_use;
    }
    public String getMedicine5_dosage() {
        return medicine5_dosage;
    }
    public void setMedicine5_dosage(String medicine5_dosage) {
        this.medicine5_dosage = medicine5_dosage;
    }
    public String getMedication5_time() {
        return medication5_time;
    }
    public void setMedication5_time(String medication5_time) {
        this.medication5_time = medication5_time;
    }
    public Integer getMedication5_compliance() {
        return medication5_compliance;
    }
    public void setMedication5_compliance(Integer medication5_compliance) {
        this.medication5_compliance = medication5_compliance;
    }
    public String getMedicine6() {
        return medicine6;
    }
    public void setMedicine6(String medicine6) {
        this.medicine6 = medicine6;
    }
    public String getMedicine6_use() {
        return medicine6_use;
    }
    public void setMedicine6_use(String medicine6_use) {
        this.medicine6_use = medicine6_use;
    }
    public String getMedicine6_dosage() {
        return medicine6_dosage;
    }
    public void setMedicine6_dosage(String medicine6_dosage) {
        this.medicine6_dosage = medicine6_dosage;
    }
    public String getMedication6_time() {
        return medication6_time;
    }
    public void setMedication6_time(String medication6_time) {
        this.medication6_time = medication6_time;
    }
    public Integer getMedication6_compliance() {
        return medication6_compliance;
    }
    public void setMedication6_compliance(Integer medication6_compliance) {
        this.medication6_compliance = medication6_compliance;
    }
    public String getVaccination_name1() {
        return vaccination_name1;
    }
    public void setVaccination_name1(String vaccination_name1) {
        this.vaccination_name1 = vaccination_name1;
    }
    public Date getVaccination_date1() {
        return vaccination_date1;
    }
    public void setVaccination_date1(Date vaccination_date1) {
        this.vaccination_date1 = vaccination_date1;
    }
    public String getVaccination_hospital_name1() {
        return vaccination_hospital_name1;
    }
    public void setVaccination_hospital_name1(String vaccination_hospital_name1) {
        this.vaccination_hospital_name1 = vaccination_hospital_name1;
    }
    public String getVaccination_name2() {
        return vaccination_name2;
    }
    public void setVaccination_name2(String vaccination_name2) {
        this.vaccination_name2 = vaccination_name2;
    }
    public Date getVaccination_date2() {
        return vaccination_date2;
    }
    public void setVaccination_date2(Date vaccination_date2) {
        this.vaccination_date2 = vaccination_date2;
    }
    public String getVaccination_hospital_name2() {
        return vaccination_hospital_name2;
    }
    public void setVaccination_hospital_name2(String vaccination_hospital_name2) {
        this.vaccination_hospital_name2 = vaccination_hospital_name2;
    }
    public String getVaccination_name3() {
        return vaccination_name3;
    }
    public void setVaccination_name3(String vaccination_name3) {
        this.vaccination_name3 = vaccination_name3;
    }
    public Date getVaccination_date3() {
        return vaccination_date3;
    }
    public void setVaccination_date3(Date vaccination_date3) {
        this.vaccination_date3 = vaccination_date3;
    }
    public String getVaccination_hospital_name3() {
        return vaccination_hospital_name3;
    }
    public void setVaccination_hospital_name3(String vaccination_hospital_name3) {
        this.vaccination_hospital_name3 = vaccination_hospital_name3;
    }
    public Integer getHealth_examination() {
        return health_examination;
    }
    public void setHealth_examination(Integer health_examination) {
        this.health_examination = health_examination;
    }
    public String getHealth_examination_abnormal1() {
        return health_examination_abnormal1;
    }
    public void setHealth_examination_abnormal1(String health_examination_abnormal1) {
        this.health_examination_abnormal1 = health_examination_abnormal1;
    }
    public String getHealth_examination_abnormal2() {
        return health_examination_abnormal2;
    }
    public void setHealth_examination_abnormal2(String health_examination_abnormal2) {
        this.health_examination_abnormal2 = health_examination_abnormal2;
    }
    public String getHealth_examination_abnormal3() {
        return health_examination_abnormal3;
    }
    public void setHealth_examination_abnormal3(String health_examination_abnormal3) {
        this.health_examination_abnormal3 = health_examination_abnormal3;
    }
    public String getHealth_examination_abnormal4() {
        return health_examination_abnormal4;
    }
    public void setHealth_examination_abnormal4(String health_examination_abnormal4) {
        this.health_examination_abnormal4 = health_examination_abnormal4;
    }
    public Integer getRegular_followup() {
        return regular_followup;
    }
    public void setRegular_followup(Integer regular_followup) {
        this.regular_followup = regular_followup;
    }
    public Integer getChronic_health_management() {
        return chronic_health_management;
    }
    public void setChronic_health_management(Integer chronic_health_management) {
        this.chronic_health_management = chronic_health_management;
    }
    public Integer getSuggest_recheck() {
        return suggest_recheck;
    }
    public void setSuggest_recheck(Integer suggest_recheck) {
        this.suggest_recheck = suggest_recheck;
    }
    public Integer getSuggest_referral() {
        return suggest_referral;
    }
    public void setSuggest_referral(Integer suggest_referral) {
        this.suggest_referral = suggest_referral;
    }
    public Integer getOther_health_guidance() {
        return other_health_guidance;
    }
    public void setOther_health_guidance(Integer other_health_guidance) {
        this.other_health_guidance = other_health_guidance;
    }
    public String getOther_health_guidance_description() {
        return other_health_guidance_description;
    }
    public void setOther_health_guidance_description(String other_health_guidance_description) {
        this.other_health_guidance_description = other_health_guidance_description;
    }
    public Integer getStop_smoking() {
        return stop_smoking;
    }
    public void setStop_smoking(Integer stop_smoking) {
        this.stop_smoking = stop_smoking;
    }
    public Integer getHealthy_drinking() {
        return healthy_drinking;
    }
    public void setHealthy_drinking(Integer healthy_drinking) {
        this.healthy_drinking = healthy_drinking;
    }
    public Integer getDiet() {
        return diet;
    }
    public void setDiet(Integer diet) {
        this.diet = diet;
    }
    public Integer getExercise() {
        return exercise;
    }
    public void setExercise(Integer exercise) {
        this.exercise = exercise;
    }
    public Integer getLose_weight() {
        return lose_weight;
    }
    public void setLose_weight(Integer lose_weight) {
        this.lose_weight = lose_weight;
    }
    public Double getGoal_weight() {
        return goal_weight;
    }
    public void setGoal_weight(Double goal_weight) {
        this.goal_weight = goal_weight;
    }
    public String getRecommended_vaccination() {
        return recommended_vaccination;
    }
    public void setRecommended_vaccination(String recommended_vaccination) {
        this.recommended_vaccination = recommended_vaccination;
    }
    public Integer getOther_advice() {
        return other_advice;
    }
    public void setOther_advice(Integer other_advice) {
        this.other_advice = other_advice;
    }
    public String getOther_advice_description() {
        return other_advice_description;
    }
    public void setOther_advice_description(String other_advice_description) {
        this.other_advice_description = other_advice_description;
    }
    public String getAssessment_number() {
        return assessment_number;
    }
    public void setAssessment_number(String assessment_number) {
        this.assessment_number = assessment_number;
    }
    public String getAssessment_doctorName() {
        return assessment_doctorName;
    }
    public void setAssessment_doctorName(String assessment_doctorName) {
        this.assessment_doctorName = assessment_doctorName;
    }
    public Date getAssessment_time() {
        return assessment_time;
    }
    public void setAssessment_time(Date assessment_time) {
        this.assessment_time = assessment_time;
    }
    public Integer getEat() {
        return eat;
    }
    public void setEat(Integer eat) {
        this.eat = eat;
    }
    public Integer getWash() {
        return wash;
    }
    public void setWash(Integer wash) {
        this.wash = wash;
    }
    public Integer getDress() {
        return dress;
    }
    public void setDress(Integer dress) {
        this.dress = dress;
    }
    public Integer getToilet() {
        return toilet;
    }
    public void setToilet(Integer toilet) {
        this.toilet = toilet;
    }
    public Integer getActivity() {
        return activity;
    }
    public void setActivity(Integer activity) {
        this.activity = activity;
    }
    public Integer getScore() {
        return score;
    }
    public void setScore(Integer score) {
        this.score = score;
    }
}

+ 99 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PatientRemindRecordESDO.java

@ -0,0 +1,99 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import java.util.Date;
/**
 * 疫苗提醒记录
 * @author zhangdan
 * @date 2018/09/27 20:51
 */
public class PatientRemindRecordESDO {
	
	@JestId
	private String id;
	// 业务主键
	private String code;
	private String patient;
	private String patientName;
	private String doctor;
	private String doctorName;
	private Integer remindType;//1计免提醒 2计免超期提醒
	private Integer status;//0未发送 1已发送
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
	private Date createDate;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getPatient() {
		return patient;
	}
	public void setPatient(String patient) {
		this.patient = patient;
	}
	public String getPatientName() {
		return patientName;
	}
	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}
	public String getDoctor() {
		return doctor;
	}
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}
	public String getDoctorName() {
		return doctorName;
	}
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
	public Integer getRemindType() {
		return remindType;
	}
	public void setRemindType(Integer remindType) {
		this.remindType = remindType;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
}

+ 40 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PlatformInforPopularityDTO.java

@ -0,0 +1,40 @@
package com.yihu.rehabilitation.vo.entity;
/**
 * 热度表
 *
 * @author zhangdan
 */
public class PlatformInforPopularityDTO {
   private String informationId;
   private String type;
   private Double result1;
    public String getInformationId() {
        return informationId;
    }
    public void setInformationId(String informationId) {
        this.informationId = informationId;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public Double getResult1() {
        return result1;
    }
    public void setResult1(Double result1) {
        this.result1 = result1;
    }
}

+ 190 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PlatformInformationLogES.java

@ -0,0 +1,190 @@
package com.yihu.rehabilitation.vo.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import java.util.Date;
/**
 * 平台咨讯操作日志表
 * Created by humingfen on 2018/11/22.
 */
public class PlatformInformationLogES {
    @JestId
    private String id;
    private String informationId;//平台咨讯id
    private String informationTitle;//平台咨讯名称
    private Integer informationType;//咨讯分类(1健康知识、2活动通知、3功能介绍、4平台宣传)
    private Integer operationType;//操作对象类型(1居民、2家医、3专科医生、4家医和专科)
    private String openid;//非医生就存openid
    private String doctorCode;//医生code
    private String doctorName;//医生名称
    private Integer type;//类型(1浏览、2点赞、3转发)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date createTime;//操作时间
    private String patientLabels;//居民标签
    private String orgCode;//居民或者医生所属机构
    private String orgName;//居民或者医生所属机构
    private String city;//居民或者医生所属城市
    private String cityName;//居民或者医生所属城市
    private String townName; //居民或者医生机构所在区县
    private String town; //居民或者医生机构所在区县
    private String hour;//查看时间(小时)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date platInfoCreateTime;//平台资讯创建时间
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getInformationId() {
        return informationId;
    }
    public void setInformationId(String informationId) {
        this.informationId = informationId;
    }
    public String getInformationTitle() {
        return informationTitle;
    }
    public void setInformationTitle(String informationTitle) {
        this.informationTitle = informationTitle;
    }
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getOperationType() {
        return operationType;
    }
    public void setOperationType(Integer operationType) {
        this.operationType = operationType;
    }
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    public Integer getInformationType() {
        return informationType;
    }
    public void setInformationType(Integer informationType) {
        this.informationType = informationType;
    }
    public String getPatientLabels() {
        return patientLabels;
    }
    public void setPatientLabels(String patientLabels) {
        this.patientLabels = patientLabels;
    }
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    public String getTown() {
        return town;
    }
    public void setTown(String town) {
        this.town = town;
    }
    public String getHour() {
        return hour;
    }
    public void setHour(String hour) {
        this.hour = hour;
    }
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    public String getCityName() {
        return cityName;
    }
    public void setCityName(String cityName) {
        this.cityName = cityName;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
    public Date getPlatInfoCreateTime() {
        return platInfoCreateTime;
    }
    public void setPlatInfoCreateTime(Date platInfoCreateTime) {
        this.platInfoCreateTime = platInfoCreateTime;
    }
}

+ 110 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PlatformInformationPushRecordES.java

@ -0,0 +1,110 @@
package com.yihu.rehabilitation.vo.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import java.util.Date;
/**
 * 平台咨讯推送记录表
 * Created by humingfen on 2018/11/22.
 */
public class PlatformInformationPushRecordES {
    @JestId
    private String id;
    private String batchNo;//批次号记录发送所属批次(ES:必填)
    private Integer type;//发送对象(1居民、2家医、3专科医生、4家医和专科)
    private String receiverCode;//发送对象code
    private String receiverName;//发送对象名称
    //平台咨讯库相关信息
    private Long informationId;//平台咨讯id
    private String informationTitle;//平台咨讯标题
    private String informationContent;//平台咨讯内容
    private Integer status;//浏览状态(1浏览,0未浏览)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date createTime;  // 发送时间(ES:必填)
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getBatchNo() {
        return batchNo;
    }
    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getReceiverCode() {
        return receiverCode;
    }
    public void setReceiverCode(String receiverCode) {
        this.receiverCode = receiverCode;
    }
    public String getReceiverName() {
        return receiverName;
    }
    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }
    public Long getInformationId() {
        return informationId;
    }
    public void setInformationId(Long informationId) {
        this.informationId = informationId;
    }
    public String getInformationTitle() {
        return informationTitle;
    }
    public void setInformationTitle(String informationTitle) {
        this.informationTitle = informationTitle;
    }
    public String getInformationContent() {
        return informationContent;
    }
    public void setInformationContent(String informationContent) {
        this.informationContent = informationContent;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 379 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/PostpartumVisitRecordES.java

@ -0,0 +1,379 @@
package com.yihu.rehabilitation.vo.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 产后访视记录表
 * create by hmf on 2019/4/17
 */
public class PostpartumVisitRecordES {
    @JestId
    private String id;
    private String followup_id;             //随访记录ID
    private String followup_project;        //随访详情分类ID
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    private Date create_time;
    private String create_user;
    private String create_user_name;
    private String version;//版本号
    private String name;//产妇姓名
    private String number;//编号
    private Date followup_date;//随访日期
    private Date parturition_date;//分娩日期
    private Date discharged_date;//出院日期
    private Double body_temperature;//体温
    private String healthy_condition;//一般健康情况
    private String psychologic_status;//一般心理状况
    private Integer blood_pressure_low;//血压低值
    private Integer blood_pressure_high;//血压高值
    private Integer breast_status;//乳房(1未见异常 2异常)
    private Integer lochia_status;//恶露(1未见异常 2异常)
    private Integer uterus_status;//子宫(1未见异常 2异常)
    private Integer wound_status;//伤口(1未见异常 2异常)
    private String other;//其他
    private Integer category;//分类(1未见异常 2异常)
    /******** 指导 ********/
    private Integer personal_hygiene ;//个人卫生【1有,0无】
    private Integer mentality;//心理指导【1有,0无】
    private Integer nutrition;//营养指导【1有,0无】
    private Integer breast_feeding;//母乳喂养指导【1是,0否】
    private Integer newborn_care_and_feeding;//新生儿护理与喂养指导【1有,0无】
    private Integer other_guide;//是否有其他指导【1有,0无】
    private String other_guide_content;//其他指导内容
    /******** 转诊 ********/
    private Integer REFERRAL;//转诊建议(1有,0无)
    private String REFERRAL_REASON;//转诊建议(原因)
    private String ORGANIZATION_ORG;//转诊机构(智业机构code)
    private String ORGANIZATION_ORG_NAME;//转诊机构名称
    private String ORGANIZATION_HOSPITAL;//转诊机构code(dm_hospital表的code)
    private String ORGANIZATION;//转诊科室
    private Date next_visiting_date;//下次随访日期
    private String visiting_doctor_name;//随访医生名称
    private String visiting_doctor_code;//随访医生code
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getFollowup_id() {
        return followup_id;
    }
    public void setFollowup_id(String followup_id) {
        this.followup_id = followup_id;
    }
    public String getFollowup_project() {
        return followup_project;
    }
    public void setFollowup_project(String followup_project) {
        this.followup_project = followup_project;
    }
    public Date getCreate_time() {
        return create_time;
    }
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getFollowup_date() {
        return followup_date;
    }
    public void setFollowup_date(Date followup_date) {
        this.followup_date = followup_date;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getParturition_date() {
        return parturition_date;
    }
    public void setParturition_date(Date parturition_date) {
        this.parturition_date = parturition_date;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getDischarged_date() {
        return discharged_date;
    }
    public void setDischarged_date(Date discharged_date) {
        this.discharged_date = discharged_date;
    }
    public Double getBody_temperature() {
        return body_temperature;
    }
    public void setBody_temperature(Double body_temperature) {
        this.body_temperature = body_temperature;
    }
    public String getHealthy_condition() {
        return healthy_condition;
    }
    public void setHealthy_condition(String healthy_condition) {
        this.healthy_condition = healthy_condition;
    }
    public String getPsychologic_status() {
        return psychologic_status;
    }
    public void setPsychologic_status(String psychologic_status) {
        this.psychologic_status = psychologic_status;
    }
    public Integer getBlood_pressure_low() {
        return blood_pressure_low;
    }
    public void setBlood_pressure_low(Integer blood_pressure_low) {
        this.blood_pressure_low = blood_pressure_low;
    }
    public Integer getBlood_pressure_high() {
        return blood_pressure_high;
    }
    public void setBlood_pressure_high(Integer blood_pressure_high) {
        this.blood_pressure_high = blood_pressure_high;
    }
    public Integer getBreast_status() {
        return breast_status;
    }
    public void setBreast_status(Integer breast_status) {
        this.breast_status = breast_status;
    }
    public Integer getLochia_status() {
        return lochia_status;
    }
    public void setLochia_status(Integer lochia_status) {
        this.lochia_status = lochia_status;
    }
    public Integer getUterus_status() {
        return uterus_status;
    }
    public void setUterus_status(Integer uterus_status) {
        this.uterus_status = uterus_status;
    }
    public Integer getWound_status() {
        return wound_status;
    }
    public void setWound_status(Integer wound_status) {
        this.wound_status = wound_status;
    }
    public String getOther() {
        return other;
    }
    public void setOther(String other) {
        this.other = other;
    }
    public Integer getCategory() {
        return category;
    }
    public void setCategory(Integer category) {
        this.category = category;
    }
    public Integer getPersonal_hygiene() {
        return personal_hygiene;
    }
    public void setPersonal_hygiene(Integer personal_hygiene) {
        this.personal_hygiene = personal_hygiene;
    }
    public Integer getMentality() {
        return mentality;
    }
    public void setMentality(Integer mentality) {
        this.mentality = mentality;
    }
    public Integer getNutrition() {
        return nutrition;
    }
    public void setNutrition(Integer nutrition) {
        this.nutrition = nutrition;
    }
    public Integer getBreast_feeding() {
        return breast_feeding;
    }
    public void setBreast_feeding(Integer breast_feeding) {
        this.breast_feeding = breast_feeding;
    }
    public Integer getNewborn_care_and_feeding() {
        return newborn_care_and_feeding;
    }
    public void setNewborn_care_and_feeding(Integer newborn_care_and_feeding) {
        this.newborn_care_and_feeding = newborn_care_and_feeding;
    }
    public Integer getOther_guide() {
        return other_guide;
    }
    public void setOther_guide(Integer other_guide) {
        this.other_guide = other_guide;
    }
    public String getOther_guide_content() {
        return other_guide_content;
    }
    public void setOther_guide_content(String other_guide_content) {
        this.other_guide_content = other_guide_content;
    }
    public Integer getREFERRAL() {
        return REFERRAL;
    }
    public void setREFERRAL(Integer REFERRAL) {
        this.REFERRAL = REFERRAL;
    }
    public String getREFERRAL_REASON() {
        return REFERRAL_REASON;
    }
    public void setREFERRAL_REASON(String REFERRAL_REASON) {
        this.REFERRAL_REASON = REFERRAL_REASON;
    }
    public String getORGANIZATION_ORG() {
        return ORGANIZATION_ORG;
    }
    public void setORGANIZATION_ORG(String ORGANIZATION_ORG) {
        this.ORGANIZATION_ORG = ORGANIZATION_ORG;
    }
    public String getORGANIZATION_ORG_NAME() {
        return ORGANIZATION_ORG_NAME;
    }
    public void setORGANIZATION_ORG_NAME(String ORGANIZATION_ORG_NAME) {
        this.ORGANIZATION_ORG_NAME = ORGANIZATION_ORG_NAME;
    }
    public String getORGANIZATION_HOSPITAL() {
        return ORGANIZATION_HOSPITAL;
    }
    public void setORGANIZATION_HOSPITAL(String ORGANIZATION_HOSPITAL) {
        this.ORGANIZATION_HOSPITAL = ORGANIZATION_HOSPITAL;
    }
    public String getORGANIZATION() {
        return ORGANIZATION;
    }
    public void setORGANIZATION(String ORGANIZATION) {
        this.ORGANIZATION = ORGANIZATION;
    }
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    public Date getNext_visiting_date() {
        return next_visiting_date;
    }
    public void setNext_visiting_date(Date next_visiting_date) {
        this.next_visiting_date = next_visiting_date;
    }
    public String getVisiting_doctor_name() {
        return visiting_doctor_name;
    }
    public void setVisiting_doctor_name(String visiting_doctor_name) {
        this.visiting_doctor_name = visiting_doctor_name;
    }
    public String getVisiting_doctor_code() {
        return visiting_doctor_code;
    }
    public void setVisiting_doctor_code(String visiting_doctor_code) {
        this.visiting_doctor_code = visiting_doctor_code;
    }
    public String getCreate_user() {
        return create_user;
    }
    public void setCreate_user(String create_user) {
        this.create_user = create_user;
    }
    public String getCreate_user_name() {
        return create_user_name;
    }
    public void setCreate_user_name(String create_user_name) {
        this.create_user_name = create_user_name;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
}

+ 0 - 0
svr/svr-rehabilitation/src/main/java/com/yihu/rehabilitation/vo/entity/QuestionnaireWinningESDO.java


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov