Beispiel #1
0
 public bool UpdatePatientMedicalFamilyHistoryData(int id, PatientMedicalFamilyHistory patientInfo)
 {
     if (id > 0)
     {
         var patientMedicalFamilyHistory = _context.PatientMedicalFamilyHistory.Find(id);
         if (patientMedicalFamilyHistory != null)
         {
             patientMedicalFamilyHistory.AgeOfDiagnosis = patientInfo.AgeOfDiagnosis;
             patientMedicalFamilyHistory.CauseOfDeath   = patientInfo.CauseOfDeath;
             patientMedicalFamilyHistory.DOB            = patientInfo.DOB;
             patientMedicalFamilyHistory.DateOfDeath    = patientInfo.DateOfDeath;
             patientMedicalFamilyHistory.DeletedBy      = patientInfo.DeletedBy;
             patientMedicalFamilyHistory.DiseaseID      = patientInfo.DiseaseID;
             patientMedicalFamilyHistory.FirstName      = patientInfo.FirstName;
             patientMedicalFamilyHistory.GenderID       = patientInfo.GenderID;
             patientMedicalFamilyHistory.IsActive       = patientInfo.IsActive;
             patientMedicalFamilyHistory.IsDeleted      = patientInfo.IsDeleted;
             patientMedicalFamilyHistory.LastName       = patientInfo.LastName;
             patientMedicalFamilyHistory.Observation    = patientInfo.Observation;
             patientMedicalFamilyHistory.PatientID      = patientInfo.PatientID;
             patientMedicalFamilyHistory.RelationshipID = patientInfo.RelationshipID;
             patientMedicalFamilyHistory.UpdatedDate    = DateTime.Now;
             patientMedicalFamilyHistory.UpdatedBy      = patientInfo.UpdatedBy;
             _context.SaveChanges();
             return(true);
         }
     }
     return(false);
 }
Beispiel #2
0
        public override async Task <IActionResult> PatchAsync(int id, [FromBody] PatientMedicalFamilyHistory patientMedicalFamilyHistory)
        {
            //var attrToUpdate = _jsonApiContext.AttributesToUpdate;
            //var patientMedicalFamilyHistoryOld = _dbContextResolver.GetDbSet<PatientMedicalFamilyHistory>().Where(m => m.Id == id).FirstOrDefault();

            //CommonMethods commonMethods = new CommonMethods();
            ////List<AuditLogs> auditLogs = commonMethods.GetAuditLogValues(patientMedicalFamilyHistoryOld, patientMedicalFamilyHistory, "PatientMedicalFamilyHistory", attrToUpdate)
            ////    //.Where(i => attrToUpdate.Keys.Any(a1 => a1.InternalAttributeName == i.PropertyName))
            ////    .Select(q => new AuditLogs() { NewValue = q.NewValue, OldValue = q.OldValue, PrimaryKeyID = q.PrimaryKeyID, TableName = q.TableName, PropertyName = q.PropertyName }).ToList();
            ////await _dbContextResolver.GetDbSet<AuditLogs>().AddRangeAsync(auditLogs);
            ////return await base.PatchAsync(id, patientMedicalFamilyHistory);

            //// var patientMedicalFamilyHistoryInfo = await base.PatchAsync(id, patientMedicalFamilyHistory);

            //int eventID = _dbContextResolver.GetDbSet<Event>().LastOrDefault().Id + 1;
            //List<AuditLogs> auditLogs = commonMethods.GetAuditLogValues(patientMedicalFamilyHistoryOld, patientMedicalFamilyHistory, "PatientMedicalFamilyHistory", attrToUpdate)
            //    //.Where(i => attrToUpdate.Keys.Any(a1 => a1.InternalAttributeName == i.PropertyName))
            //    .Select(q => new AuditLogs() { NewValue = q.NewValue, OldValue = q.OldValue, PrimaryKeyID = q.PrimaryKeyID, TableName = q.TableName, PropertyName = q.PropertyName, EventID = eventID }).ToList();
            //await _dbContextResolver.GetDbSet<AuditLogs>().AddRangeAsync(auditLogs);
            return(await base.PatchAsync(id, patientMedicalFamilyHistory));
        }
Beispiel #3
0
 public override async Task <IActionResult> PostAsync([FromBody] PatientMedicalFamilyHistory patientMedicalFamilyHistory)
 {
     return(await base.PostAsync(patientMedicalFamilyHistory));
 }
Beispiel #4
0
 public bool UpdatePatientMedicalFamilyHistoryData(int id, PatientMedicalFamilyHistory patientInfo)
 {
     return(_patientCommonRepository.UpdatePatientMedicalFamilyHistoryData(id, patientInfo));
 }