Esempio n. 1
0
        public IHttpActionResult Get(string nsId, string mark)
        {
            var response = service.QueryCareTypeList(nsId);

            return(Ok(response));
        }
Esempio n. 2
0
        /// <summary>
        /// 根据身份证号码或医保卡号查询资格信息
        /// </summary>
        /// <param name="keyNo">社保卡号或者身份证号码</param>
        /// <returns>资格证书信息</returns>
        public BaseResponse <AppCertBaseInfo> QueryAppcertInfo(string keyNo)
        {
            var response = new BaseResponse <AppCertBaseInfo>();
            var q        = from a in unitOfWork.GetRepository <NCIA_APPCERT>().dbSet
                           join n in unitOfWork.GetRepository <NCIA_APPLICANT>().dbSet on a.APPLICANTID equals n.APPLICANTID into nrd
                           from nr in nrd.DefaultIfEmpty()
                           select new AppCertBaseInfo
            {
                ApplicantId       = nr.APPLICANTID,
                Appcertid         = a.APPCERTID,
                Name              = nr.NAME,
                Gender            = nr.GENDER,
                Age               = DateTime.Now.Year - nr.BIRTHDATE.Year + 1,
                SsNO              = nr.SSNO,
                IdNO              = nr.IDNO,
                Mctype            = a.MCTYPE,
                CareType          = a.AGENCYAPPROVEDCARETYPE,
                Disease           = a.DISEASE,
                NsID              = nr.NSID,
                Phone             = nr.PHONE,
                FamilyMemberphone = nr.FAMILYMEMBERPHONE,
                Address           = nr.ADDRESS,
                Status            = a.STATUS,
                CertNo            = a.CERTNO,
                CertStartTime     = a.CERTSTARTTIME,
                CertExpiredTime   = a.CERTEXPIREDTIME,
                FamilyMemberName  = nr.FAMILYMEMBERNAME,
                Isdelete          = a.ISDELETE,
            };

            q = q.Where(m => m.Isdelete == false && m.Status == 6);
            if (!string.IsNullOrEmpty(keyNo))
            {
                q = q.Where(m => m.IdNO.ToUpper().Trim() == keyNo.ToUpper().Trim() || m.SsNO.ToUpper().Trim() == keyNo.ToUpper().Trim());
            }
            var careTypeInfo = service.QueryCareTypeList(SecurityHelper.CurrentPrincipal.OrgId);

            //var time = DateTime.Now;
            //q = q.Where(m => m.CertExpiredTime.HasValue && m.CertExpiredTime >= time);

            response.Data = q.FirstOrDefault();
            if (response.Data != null)
            {
                var careTypeList = careTypeInfo.Data.Where(m => m.CareType == response.Data.CareType.Value).ToList();
                if (careTypeList != null && careTypeList.Count != 1)
                {
                    response.ResultCode    = -1;
                    response.ResultMessage = "当前机构对应的护理形式信息配置错误,请联系管理人员!";
                    return(response);
                }
                else
                {
                    response.Data.CareType = careTypeList[0].CareTypeID;
                }
            }
            else
            {
                response.ResultCode    = -1;
                response.ResultMessage = "当前机构未查询到相对应的资格护理险信息!";
                return(response);
            }

            return(response);
        }