public bool DeleteEligibilityResponse(int id, tech_assessmentContext context) { //make sure it exsists before attempting to delete EligibilityResponse eligibilityResponse = new EligibilityResponse(); eligibilityResponse = context.EligibilityResponses.Find(id); context.EligibilityResponses.Remove(eligibilityResponse); try { //attempt to commit the changes var changes = context.SaveChanges(); //if the changes are equal to 1 the change was sucessful return(changes == 1); } catch { //if commit fails let the requester know return(false); } }
public IEnumerable <Patient> GetAllPatients(tech_assessmentContext context) { //get all patients return(context.Patients.ToList()); }
public bool InsertTreatmentPlan(int patientId, string diagnosis, string service, string drug, string jcode, tech_assessmentContext context) { TreatmentPlan treatmentPlan = new TreatmentPlan(); treatmentPlan.PatientId = patientId; treatmentPlan.Diagnosis = diagnosis; treatmentPlan.Service = service; treatmentPlan.Drug = drug; treatmentPlan.Jcode = jcode; //attempt to insert new response if it fails returns false try { context.TreatmentPlans.Add(treatmentPlan); var changes = context.SaveChanges(); //if the changes are equal to 1 the change was sucessful return(changes == 1); } catch { return(false); } }
public bool UpdateTreatmentPlan(int id, int patientId, string diagnosis, string service, string drug, string jcode, tech_assessmentContext context) { //make sure it exsists before attempting to edit TreatmentPlan treatmentPlan = context.TreatmentPlans.Find(id); if (treatmentPlan != null) { treatmentPlan.PatientId = patientId; treatmentPlan.Diagnosis = diagnosis; treatmentPlan.Service = service; treatmentPlan.Drug = drug; treatmentPlan.Jcode = jcode; context.TreatmentPlans.Update(treatmentPlan); var changes = context.SaveChanges(); //if the changes are equal to 1 the change was sucessful return(changes == 1); } return(false); }
public IEnumerable <TreatmentPlan> GetAllTreatmentPlans(tech_assessmentContext context) { //get all prior authorizations return(context.TreatmentPlans.ToList()); }
public bool UpdatePriorAuthorization(int id, int treatmentId, string authorization, tech_assessmentContext context) { //make sure it exsists before attempting to edit PriorAuthorization priorAuthorization = context.PriorAuthorizations.Find(id); if (priorAuthorization.PriorAuthorizationId == id) { priorAuthorization.TreatmentPlanId = treatmentId; priorAuthorization.Authorization = authorization; context.PriorAuthorizations.Update(priorAuthorization); var changes = context.SaveChanges(); //if the changes are equal to 1 the change was sucessful return(changes == 1); } return(false); }
public IEnumerable <PriorAuthorization> GetAllPriorAuthorizations(tech_assessmentContext context) { //get all prior authorizations return(context.PriorAuthorizations.ToList()); }
public ElegibilityResponseInformation GetInformationToSubmitPriorAuthorization(int id, int authorizationId, tech_assessmentContext context) { //we need both an eligability response and an authorization document to submit prior authorization ElegibilityResponseInformation information = new ElegibilityResponseInformation(); EligibilityResponse response = context.EligibilityResponses.Find(id); PriorAuthorization authorization = context.PriorAuthorizations.Find(authorizationId); information.EligabilityResponse = response; information.authorization = authorization.Authorization; return(information); }
public bool UpdateEligibilityResponse(int id, int treatmentId, string response, tech_assessmentContext context) { //make sure it exsists before attempting to edit EligibilityResponse eligibilityResponse = context.EligibilityResponses.Find(id); if (eligibilityResponse.ResponseId == id) { eligibilityResponse.TreatmentPlanId = treatmentId; eligibilityResponse.Response = response; context.EligibilityResponses.Update(eligibilityResponse); var changes = context.SaveChanges(); //if the changes are equal to 1 the change was sucessful return(changes == 1); } return(false); }
public IEnumerable <EligibilityResponse> GetAllEligibilityResponses(tech_assessmentContext context) { //get all eligibility responses return(context.EligibilityResponses.ToList()); }