コード例 #1
0
        public ActionResult NewPatientRecord(string appointmentId, string practitionerId, string patientId)
        {
            NewPatientRecordViewModel result = new NewPatientRecordViewModel();

            PatientRecordModel newPatientRecord = new PatientRecordModel();

            if (appointmentId != null)
            {
                newPatientRecord.AppointmentId = Guid.Parse(appointmentId);
            }
            else
            {
                newPatientRecord.AppointmentId = Guid.Empty;
            }

            newPatientRecord.PractitionerId = Guid.Parse(practitionerId);
            newPatientRecord.PatientId      = Guid.Parse(patientId);

            //for appointment users and no appointment users
            //!newPatientRecord.AppointmentId.Equals(Guid.Empty)
            if (!newPatientRecord.PractitionerId.Equals(Guid.Empty) && !newPatientRecord.PatientId.Equals(Guid.Empty))
            {
                PractitionerProcess process = new PractitionerProcess();
                result = process.CreateNewPatientRecord(newPatientRecord);
            }
            //for not appointment user
            else
            {
                //no appointment made, retrive practitioner details
            }

            return(View(result));
        }