1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- /*******************************************************************************
- * Copyright (c) 2005, 2014 springside.github.io
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License");
- *******************************************************************************/
- package com.yihu.mm.service;
- import com.yihu.mm.repository.wlyy.patient.PatientDao;
- import com.yihu.wlyy.entity.organization.Hospital;
- import com.yihu.wlyy.entity.patient.Patient;
- import com.yihu.wlyy.entity.patient.SignFamily;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- /**
- * 患者基本信息类.
- *
- * @author George
- */
- @Service
- public class PatientService {
- @Autowired
- private PatientDao patientDao;
- @Autowired
- private HospitalService hospitalService;
- @Autowired
- private FamilyContractService familyContractService;
- public Patient findByCode(String code) {
- return patientDao.findByCode(code);
- }
- /**
- * 判断是否居民是否 是集美签约居民
- * 返回 0 :未签约,且非厦门市民
- * 1: 未签约,是厦门市民
- * 2: 签约 在集美
- * 3 签约不在集美
- * @return
- */
- public int isSignJM(String patientCode){
- SignFamily signFamily = familyContractService.findSignByPatient(patientCode);
- //未签约
- if(signFamily==null){
- Patient patient = findByCode(patientCode);
- //未签约判断是否在前门
- String city = patient.getCity();
- if("350200".equals(city)){
- return 1;//未签约 厦门居民
- }
- return 0;//未签约 非厦门居民
- }
- //签约
- String hospitalCode = signFamily.getHospital();
- Hospital hospital = hospitalService.findByCode(hospitalCode);
- String town = hospital.getTown();
- if("350211".equals(town)){
- return 2; //签约 签约在集美
- }
- return 3; //签约 但签约不在集美
- }
- }
|