Exemple #1
0
 public int AddUpdatePatientScreening(int patientId, int patientMasterVisitId, int screeningType, int screeningCategory, int screeningValue, int userId)
 {
     try
     {
         int screeningResult;
         if (patientMasterVisitId > 0)
         {
             screeningResult = _patientScreening.checkScreeningByVisitId(patientId, patientMasterVisitId, screeningType, screeningCategory);
         }
         else
         {
             //(screening>0) ? update:add
             screeningResult = _patientScreening.checkScreeningByScreeningCategoryId(patientId, screeningType, screeningCategory);
         }
         if (screeningResult > 0)
         {
             var PS = new PatientScreening()
             {
                 PatientId            = patientId,
                 PatientMasterVisitId = patientMasterVisitId,
                 VisitDate            = DateTime.Today,
                 ScreeningTypeId      = screeningType,
                 ScreeningDone        = true,
                 ScreeningDate        = DateTime.Today,
                 ScreeningCategoryId  = screeningCategory,
                 ScreeningValueId     = screeningValue,
                 Comment   = null,
                 CreatedBy = userId,
                 Id        = screeningResult
             };
             return(_patientScreening.updatePatientScreeningById(PS));
         }
         else
         {
             var PS = new PatientScreening()
             {
                 PatientId            = patientId,
                 PatientMasterVisitId = patientMasterVisitId,
                 VisitDate            = DateTime.Today,
                 ScreeningTypeId      = screeningType,
                 ScreeningDone        = true,
                 ScreeningDate        = DateTime.Today,
                 ScreeningCategoryId  = screeningCategory,
                 ScreeningValueId     = screeningValue,
                 Comment   = null,
                 CreatedBy = userId
             };
             return(_patientScreening.AddPatientScreening(PS));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }