|
@ -0,0 +1,155 @@
|
|
|
//package com.yihu.wlyy.service.app.prenatalInspector;
|
|
|
//
|
|
|
//import com.alibaba.fastjson.JSONArray;
|
|
|
//import com.alibaba.fastjson.JSONObject;
|
|
|
//import com.yihu.wlyy.entity.patient.PatientFamilyMember;
|
|
|
//import com.yihu.wlyy.entity.patient.SignFamily;
|
|
|
//import com.yihu.wlyy.entity.patient.prenatal.ChildInfo;
|
|
|
//import com.yihu.wlyy.entity.patient.prenatal.ImmuneDict;
|
|
|
//import com.yihu.wlyy.entity.patient.prenatal.ImmuneHospitalDict;
|
|
|
//import com.yihu.wlyy.repository.patient.*;
|
|
|
//import com.yihu.wlyy.service.BaseService;
|
|
|
//import com.yihu.wlyy.util.DateUtil;
|
|
|
//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
//import org.springframework.stereotype.Component;
|
|
|
//import org.springframework.transaction.annotation.Transactional;
|
|
|
//
|
|
|
//import java.util.Date;
|
|
|
//import java.util.List;
|
|
|
//
|
|
|
///**
|
|
|
// * Created by yeshijie on 2017/10/18.
|
|
|
// */
|
|
|
//@Component
|
|
|
//@Transactional(rollbackFor = Exception.class)
|
|
|
//public class ChildImmuneService extends BaseService{
|
|
|
//
|
|
|
// @Autowired
|
|
|
// private ChildInfoDao childInfoDao;
|
|
|
// @Autowired
|
|
|
// private PatientFamilyMemberDao memberDao;
|
|
|
// @Autowired
|
|
|
// private SignFamilyDao signFamilyDao;
|
|
|
// @Autowired
|
|
|
// private ImmuneDictDao immuneDictDao;
|
|
|
// @Autowired
|
|
|
// private ImmuneHospitalDictDao immuneHospitalDictDao;
|
|
|
// @Autowired
|
|
|
// private ImmuneMappingDao immuneMappingDao;
|
|
|
// @Autowired
|
|
|
// private ImmuneNeedleDao immuneNeedleDao;
|
|
|
// @Autowired
|
|
|
// private ChildImmuneDetailInfoDao childImmuneDetailInfoDao;
|
|
|
// @Autowired
|
|
|
// private ChildImmuneInfoDao childImmuneInfoDao;
|
|
|
//
|
|
|
// /**
|
|
|
// * 获取儿童信息
|
|
|
// * @param barcodeNo
|
|
|
// * @return
|
|
|
// */
|
|
|
// public JSONObject findChildInfo(String barcodeNo,String patient){
|
|
|
// Integer status = 0;
|
|
|
// ChildInfo childInfo = childInfoDao.findByBarcodeNo(barcodeNo);
|
|
|
// if(childInfo==null){
|
|
|
// //请求智业接口
|
|
|
//
|
|
|
//
|
|
|
// childInfoDao.save(childInfo);
|
|
|
// }
|
|
|
//
|
|
|
// PatientFamilyMember familyMember = memberDao.findByFamilyMember(childInfo.getCode(),8);
|
|
|
// if(familyMember!=null){
|
|
|
// if(patient.equals(familyMember.getPatient())){
|
|
|
// status = -2;
|
|
|
// }else {
|
|
|
// status = -1;
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// JSONObject re = new JSONObject();
|
|
|
// re.put("name","张三");
|
|
|
// re.put("age", DateUtil.getChildAge(DateUtil.strToDate("2017-01-01")));
|
|
|
// re.put("birthday","2017-01-01");
|
|
|
// re.put("sex","1");//0 未知的性别,1男,2女,9未说明的性别
|
|
|
// re.put("barcodeNo","350400201609090099");
|
|
|
// re.put("status",status);
|
|
|
//
|
|
|
// return re;
|
|
|
// }
|
|
|
//
|
|
|
// /**
|
|
|
// * 绑定儿童信息
|
|
|
// * @param barcodeNo
|
|
|
// * @param patient
|
|
|
// * @return
|
|
|
// */
|
|
|
// public Integer bindChildInfo(String barcodeNo,String patient){
|
|
|
// Integer re = 0;
|
|
|
// ChildInfo childInfo = childInfoDao.findByBarcodeNo(barcodeNo);
|
|
|
//
|
|
|
// PatientFamilyMember familyMember = memberDao.findByFamilyMember(childInfo.getCode(),8);
|
|
|
// if(familyMember!=null){
|
|
|
// if(patient.equals(familyMember.getPatient())){
|
|
|
// return -2;
|
|
|
// }else {
|
|
|
// return -1;
|
|
|
// }
|
|
|
// }
|
|
|
// familyMember = new PatientFamilyMember();
|
|
|
// familyMember.setIsAuthorize(1);
|
|
|
// familyMember.setPatient(patient);
|
|
|
// familyMember.setCzrq(new Date());
|
|
|
// familyMember.setFamilyMember(childInfo.getCode());
|
|
|
// familyMember.setFamilyRelation(8);//免疫关联
|
|
|
// memberDao.save(familyMember);
|
|
|
// return re;
|
|
|
// }
|
|
|
//
|
|
|
// /**
|
|
|
// * 获取免疫家人
|
|
|
// * @param patient
|
|
|
// * @return
|
|
|
// */
|
|
|
// public JSONArray getImmuneFamily(String patient){
|
|
|
// JSONArray re = new JSONArray();
|
|
|
// List<PatientFamilyMember> familyMemberList = memberDao.findByPatientAndFamilyRelation(patient,8);
|
|
|
// familyMemberList.forEach(one->{
|
|
|
// JSONObject json = new JSONObject();
|
|
|
// ChildInfo childInfo = childInfoDao.findByCode(one.getFamilyMember());
|
|
|
// json.put("name",childInfo.getName());
|
|
|
// json.put("age", DateUtil.getChildAge(childInfo.getBirthday()));
|
|
|
// json.put("birthday",childInfo.getBirthday());
|
|
|
// json.put("sex",childInfo.getSickSex());//0 未知的性别,1男,2女,9未说明的性别
|
|
|
// json.put("barcodeNo",childInfo.getBarcodeNo());
|
|
|
// json.put("photo",childInfo.getPhoto());
|
|
|
// re.add(json);
|
|
|
// });
|
|
|
// return re;
|
|
|
// }
|
|
|
//
|
|
|
// /**
|
|
|
// * 免疫计划表-居民端
|
|
|
// * @param patient
|
|
|
// */
|
|
|
// public void getImmunePlan(String patient){
|
|
|
//
|
|
|
// SignFamily signFamily = signFamilyDao.findByPatient(patient);
|
|
|
// if(signFamily==null){
|
|
|
// //未签约
|
|
|
//
|
|
|
// }
|
|
|
//
|
|
|
// //获取必打疫苗
|
|
|
// List<ImmuneDict> oneImmuneList = immuneDictDao.findByImmuneType(1);
|
|
|
//
|
|
|
//
|
|
|
// //获取非必打疫苗
|
|
|
// List<ImmuneHospitalDict> twoImmuneList = immuneHospitalDictDao.findByHospital(signFamily.getHospital());
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
// }
|
|
|
//
|
|
|
//
|
|
|
//}
|