Exemplo n.º 1
0
 public string addTannersStaging(int patientId, int patientMasterVisitId, int createdBy, DateTime tannersStagingDate, int breastsGenitals, int pubicHair)
 {
     try
     {
         PatientTannersStaging tannersStaging = new PatientTannersStaging()
         {
             PatientId            = patientId,
             PatientMasterVisitId = patientMasterVisitId,
             CreatedBy            = createdBy,
             TannersStagingDate   = tannersStagingDate,
             BreastsGenitalsId    = breastsGenitals,
             PubicHairId          = pubicHair
         };
         var tanners = new TannersStagingManager();
         Result = tanners.AddTannersStaging(tannersStaging);
         if (Result > 0)
         {
             Msg = "Tanner Stage Added Successfully";
         }
         else
         {
             Msg = "Incremental Error";
         }
     }
     catch (Exception e)
     {
         Msg = e.Message;
     }
     return(Msg);
 }
Exemplo n.º 2
0
 public void DeleteTanners(int id)
 {
     using (UnitOfWork _unitOfWork = new UnitOfWork(new GreencardContext()))
     {
         PatientTannersStaging tanners = _unitOfWork.TannersStagingRepository.GetById(id);
         _unitOfWork.TannersStagingRepository.Remove(tanners);
         _unitOfWork.Complete();
         _unitOfWork.Dispose();
     }
 }
Exemplo n.º 3
0
 public int AddTannersStaging(PatientTannersStaging T)
 {
     using (UnitOfWork unitofwork = new UnitOfWork(new GreencardContext()))
     {
         unitofwork.TannersStagingRepository.Add(T);
         _result = unitofwork.Complete();
         unitofwork.Dispose();
         return(T.Id);
     }
 }
Exemplo n.º 4
0
        public int AddTannersStaging(PatientTannersStaging T)
        {
            PatientTannersStaging tannersStaging = new PatientTannersStaging()
            {
                PatientId            = T.PatientId,
                PatientMasterVisitId = T.PatientMasterVisitId,
                CreatedBy            = T.CreatedBy,
                TannersStagingDate   = T.TannersStagingDate,
                BreastsGenitalsId    = T.BreastsGenitalsId,
                PubicHairId          = T.PubicHairId
            };
            //Check existing breatsGenitals greater than supplied breatsGenitals
            List <PatientTannersStaging> tannersList = new List <PatientTannersStaging>();
            int existingBG = 0, existingPH = 0, tannerid = 0, existingId = 0;

            tannersList = _tannersStaging.getBreastsGenitals(T.PatientId, T.BreastsGenitalsId);
            foreach (var items in tannersList)
            {
                existingBG = items.BreastsGenitalsId;
            }
            //check existing pubicHair greater than the current pubichair
            tannersList = _tannersStaging.getPubicHair(T.PatientId, T.PubicHairId);
            foreach (var items in tannersList)
            {
                existingPH = items.PubicHairId;
            }

            //get the highest date
            tannersList = _tannersStaging.getTannersHighestDate(T.PatientId, T.TannersStagingDate);
            foreach (var items in tannersList)
            {
                existingId = items.Id;
            }

            if (existingBG > T.BreastsGenitalsId || existingPH > T.PubicHairId)
            {
                tannerid = 0;
            }
            else
            {
                if (existingId > 0)
                {
                    tannerid = 0;
                }
                else
                {
                    tannerid = _tannersStaging.AddTannersStaging(tannersStaging);
                }
            }
            return(tannerid);
        }