public AppointmentTO makeAppointment(string pid, string clinicId, string apptTimestamp, string category, string subCategory, string apptLength, string apptType) { selectPatient(pid); AppointmentTO scheduledAppt = _svc.makeAppointment(clinicId, apptTimestamp, category, subCategory, apptLength, apptType); if (scheduledAppt.fault != null) { throw new ApplicationException("Unable to make appointment: " + scheduledAppt.fault.message); } return(scheduledAppt); }
public void testMakeAppointment() { string pid = "91"; login100(); // user is now authenticated IList <AppointmentTypeTO> apptTypes = _dao.getAppointmentTypes("A"); // we now have the appointment types we can display to the user IList <HospitalLocationTO> clinics = _dao.getClinics("A"); // get clinics starting at 'A' // we now have a list of clinics we can allow the user to select one HospitalLocationTO clinicWithDetails = _dao.getClinicSchedulingDetails(clinics[0].id); // we now have the details for the selected clinic and can show those to the user so a timeslot can be selected and we can pass the correct params to makeAppointment // note we hard coded the vista format timestamp here, we also hard coded the category as a suitable call to retrieve the categories needs to be developed and exposed AppointmentTO scheduledAppt = _dao.makeAppointment(pid, clinics[0].id, "3121210.10", "N", "", clinicWithDetails.appointmentLength, apptTypes[0].id); Assert.IsNull(scheduledAppt.fault); }
public void testMakeAppointment() { string pid = "10110"; connectAndLogin(); // user is now authenticated IList <AppointmentTypeTO> apptTypes = _dao.getAppointmentTypes("A"); // we now have the appointment types we can display to the user IList <HospitalLocationTO> clinics = _dao.getClinics("A"); // get clinics starting at 'A' // we now have a list of clinics we can allow the user to select one HospitalLocationTO clinicWithDetails = _dao.getClinicSchedulingDetails(clinics[0].id); // we now have the details for the selected clinic and can show those to the user so a timeslot can be selected and we can pass the correct params to makeAppointment // now ready to make appt - we choose the first appt type and clinic in the returns from above - we also choose to make an appt as soon as the // clinic opens - the appt length is the length specified for the clinic AppointmentTO scheduledAppt = _dao.makeAppointment(pid, clinics[0].id, "3121206.080000", "N", "", clinicWithDetails.appointmentLength, apptTypes[0].id); Assert.IsNull(scheduledAppt.fault); }
protected void Click_MakeAppointment(object sender, EventArgs e) { TimeSlot selectedSlot = (Session["FILTERED_SLOTS"] as IList <TimeSlot>)[dropdownAvailableTimes.SelectedIndex]; if (!selectedSlot.Available) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Please choose an available slot only');", true); return; } string dateString = "3" + selectedSlot.Start.ToString("yyMMdd.HHmmss"); try { //esb.appointmentResponse response = new SchedulingDao().makeAppointmentEsb(dateString, "30", "12", _patient, _ssn); //if (response != null) //{ // this.Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Your appointment is set for " + // selectedSlot.Start.ToString("MM/dd") + " at " + selectedSlot.Start.ToString("HH:mm") + // ". Good job.');", true); //} _dao = new SchedulingDao(); UserTO user = _dao.connectAndLogin(_siteCode, _accessCode, _verifyCode); AppointmentTO result = _dao.makeAppointment(_patient, "12", dateString, "N", "", "30", "9"); _dao.disconnect(); if (result.fault == null) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Your appointment is set for " + selectedSlot.Start.ToString("MM/dd") + " at " + selectedSlot.Start.ToString("HH:mm") + ". Good job.');", true); } } catch (Exception exc) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + exc.Message + "')", true); } }
public AppointmentTO makeAppointment(string clinicId, string appointmentTimestamp, string purpose, string purposeSubcategory, string appointmentLength, string appointmentType) { AppointmentTO result = new AppointmentTO(); if (!_mySession.ConnectionSet.IsAuthorized) { result.fault = new FaultTO("Connections not ready for operation", "Need to login?"); } else if (String.IsNullOrEmpty(clinicId)) { result.fault = new FaultTO("Missing clinic ID"); } else if (String.IsNullOrEmpty(appointmentTimestamp)) { result.fault = new FaultTO("Missing appointment timestamp"); } else if (String.IsNullOrEmpty(appointmentType)) { result.fault = new FaultTO("Missing appointment type"); } else if (String.IsNullOrEmpty(appointmentLength)) { result.fault = new FaultTO("Missing appointment length"); } else if (String.IsNullOrEmpty(purpose)) { result.fault = new FaultTO("Missing appointment purpose"); } if (result.fault != null) { return(result); } try { Appointment appt = new Appointment() { AppointmentType = new AppointmentType() { ID = appointmentType }, Clinic = new HospitalLocation() { Id = clinicId }, Length = appointmentLength, Purpose = purpose, PurposeSubcategory = purposeSubcategory, Timestamp = appointmentTimestamp }; appt = new EncounterApi().makeAppointment(_mySession.ConnectionSet.BaseConnection, appt); result = new AppointmentTO(appt); } catch (Exception exc) { result.fault = new FaultTO(exc); } return(result); }